diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/api/classes/class.cuser.php /usr/share/zabbix/api/classes/class.cuser.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/api/classes/class.cuser.php	2011-09-28 09:14:01.000000000 +0000
+++ /usr/share/zabbix/api/classes/class.cuser.php	2012-02-08 17:16:24.000000000 +0000
@@ -1150,8 +1150,18 @@
 		$passwd = $user['password'];
 		$auth_type = $user['auth_type'];
 
+    if ( $auth_type == ZBX_AUTH_LDAP && $name != ZBX_GUEST_USER && ! zbx_empty($passwd) )
+    {
+      $ldaplogin = self::ldapLogin($user);
+    }
+    else
+    {
+      $ldaplogin = false;
+    }
+
 		$password = md5($passwd);
 
+
 		$sql = 'SELECT u.userid,u.attempt_failed, u.attempt_clock, u.attempt_ip '.
 				' FROM users u '.
 				' WHERE u.alias='.zbx_dbstr($name);
@@ -1163,6 +1173,18 @@
 
 		$login = $attempt = DBfetch(DBselect($sql));
 
+    if ( !$login && $ldaplogin )
+    {
+      global $ZABBIX_LDAP_GUEST;
+      
+      # Successful ldap login, user does not exist.
+      $user['user'] = $ZABBIX_LDAP_GUEST['user'];
+      $user['password'] = $ZABBIX_LDAP_GUEST['password'];
+      $user['auth_type'] = ZBX_AUTH_INTERNAL;
+      error_log( "Casting successful ldap login for $name to " . $user['user'] );
+      return self::authenticate($user);
+    }
+
 		if($login){
 			if($login['attempt_failed'] >= ZBX_LOGIN_ATTEMPTS){
 				if((time() - $login['attempt_clock']) < ZBX_LOGIN_BLOCK){
@@ -1188,7 +1210,7 @@
 
 			switch($auth_type){
 				case ZBX_AUTH_LDAP:
-					$login = self::ldapLogin($user);
+					$login = $ldaplogin;
 					break;
 				case ZBX_AUTH_HTTP:
 					$login = true;
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/cn_zh.inc.php /usr/share/zabbix/include/locales/cn_zh.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/cn_zh.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/cn_zh.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -1748,6 +1748,7 @@
 	'S_REPORTS'=>			'系统评估',
 	'S_GENERAL'=>			'总览',
 	'S_LOGIN'=>			'登录',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>			'退出',
 	'S_PRINT'=>			'打印',
 	'S_LATEST_DATA'=>			'最新数据',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/cs_cz.inc.php /usr/share/zabbix/include/locales/cs_cz.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/cs_cz.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/cs_cz.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -2301,6 +2301,7 @@
 	'S_REPORTS'=>				'Protokoly',
 	'S_GENERAL'=>				'Obecné',
 	'S_LOGIN'=>				'Přihlásit',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>				'Odhlásit',
 	'S_PRINT'=>				'Tisk',
 	'S_LATEST_DATA'=>			'Poslední hodnoty',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/de_de.inc.php /usr/share/zabbix/include/locales/de_de.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/de_de.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/de_de.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -1653,6 +1653,7 @@
 	'S_REPORTS'=>			'Reports',
 	'S_GENERAL'=>			'Allgemein',
 	'S_LOGIN'=>			'Anmeldung',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>			'Abmeldung',
 	'S_PRINT'=>			'Drucken',
 	'S_LATEST_DATA'=>			'Aktuelle Daten',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/en_gb.inc.php /usr/share/zabbix/include/locales/en_gb.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/en_gb.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/en_gb.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -2395,6 +2395,7 @@
 	'S_REPORTS'=>				'Reports',
 	'S_GENERAL'=>				'General',
 	'S_LOGIN'=>				'Login',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>				'Logout',
 	'S_PRINT'=>				'Print',
 	'S_LATEST_DATA'=>			'Latest data',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/fr_fr.inc.php /usr/share/zabbix/include/locales/fr_fr.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/fr_fr.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/fr_fr.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -2085,6 +2085,7 @@
 	'S_REPORTS'=>			'Rapports',
 	'S_GENERAL'=>			'Général',
 	'S_LOGIN'=>			'Connexion',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>			'Déconnexion',
 	'S_PRINT'=>			'Imprimer',
 	'S_LATEST_DATA'=>			'Dernières données',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/hu_hu.inc.php /usr/share/zabbix/include/locales/hu_hu.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/hu_hu.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/hu_hu.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -1744,6 +1744,7 @@
 	'S_REPORTS'=>			'Jelentések',
 	'S_GENERAL'=>			'Általános',
 	'S_LOGIN'=>			'Belépés',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>			'Kilépés',
 	'S_PRINT'=>			'Nyomtatás',
 	'S_LATEST_DATA'=>			'Legfrissebb adat',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/ja_jp.inc.php /usr/share/zabbix/include/locales/ja_jp.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/ja_jp.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/ja_jp.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -2085,6 +2085,7 @@
 	'S_REPORTS'=>			'レポート',
 	'S_GENERAL'=>			'一般設定',
 	'S_LOGIN'=>			'ログイン',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>			'ログアウト',
 	'S_PRINT'=>			'プリント',
 	'S_LATEST_DATA'=>			'最新データ',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/ko_kr.inc.php /usr/share/zabbix/include/locales/ko_kr.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/ko_kr.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/ko_kr.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -1014,6 +1014,7 @@
 	'S_GENERAL'=>				'일반',
 	'S_AUDIT'=>				'감사',
 	'S_LOGIN'=>				'로그인',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>				'로그아웃',
 	'S_LATEST_DATA'=>			'최근 데이터',
 
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/lv_lv.inc.php /usr/share/zabbix/include/locales/lv_lv.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/lv_lv.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/lv_lv.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -531,6 +531,7 @@
 	'S_REPORT'=>			'Atskaite',
 	'S_REPORTS'=>			'Atskautes',
 	'S_LOGIN'=>			'Pieslēgties',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>			'Atslēgties',
 	'S_PRINT'=>			'Drukāt',
 	'S_LATEST_DATA'=>			'Jaunākā informācija',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/nl_nl.inc.php /usr/share/zabbix/include/locales/nl_nl.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/nl_nl.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/nl_nl.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -596,6 +596,7 @@
 	'S_GENERAL'=>			'Algemeen',
 	'S_AUDIT'=>			'Controle',
 	'S_LOGIN'=>			'Login',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LATEST_DATA'=>			'Laatste data',
 
 	);
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/pl_pl.inc.php /usr/share/zabbix/include/locales/pl_pl.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/pl_pl.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/pl_pl.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -1156,6 +1156,7 @@
 	'S_REPORTS'=>					'Raporty',
 	'S_GENERAL'=>					'Ogólne',
 	'S_LOGIN'=>					'Logowanie',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>					'Wylogowanie',
 	'S_PRINT'=>					'Drukuj',
 	'S_LATEST_DATA'=>				'Ostatnie dane',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/pt_br.inc.php /usr/share/zabbix/include/locales/pt_br.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/pt_br.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/pt_br.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -2083,6 +2083,7 @@
 	'S_REPORTS'=>			'Relatórios',
 	'S_GENERAL'=>			'Geral',
 	'S_LOGIN'=>			'Login',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>			'Logout',
 	'S_PRINT'=>			'Imprimir',
 	'S_LATEST_DATA'=>			'Dados recentes',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/ru_ru.inc.php /usr/share/zabbix/include/locales/ru_ru.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/ru_ru.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/ru_ru.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -2083,6 +2083,7 @@
 	'S_REPORTS'=>			'Отчеты',
 	'S_GENERAL'=>			'Общие',
 	'S_LOGIN'=>			'Вход в систему',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>			'Выход из системы',
 	'S_PRINT'=>			'Печать',
 	'S_LATEST_DATA'=>			'Последние данные',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/sk_sk.inc.php /usr/share/zabbix/include/locales/sk_sk.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/sk_sk.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/sk_sk.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -2026,6 +2026,7 @@
 	'S_REPORTS'=>			'Reports',
 	'S_GENERAL'=>			'General',
 	'S_LOGIN'=>			'Login',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>			'Odhlásiť',
 	'S_PRINT'=>			'Vytlačiť',
 	'S_LATEST_DATA'=>			'Posledné dáta',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/sp_sp.inc.php /usr/share/zabbix/include/locales/sp_sp.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/sp_sp.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/sp_sp.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -865,6 +865,7 @@
 	'S_GENERAL'=>			'Zabbix',
 	'S_AUDIT'=>			'Auditoría',
 	'S_LOGIN'=>			'Iniciar sesión',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>			'Finalizar sesión',
 	'S_LATEST_DATA'=>			'Última fecha',
 	'S_CANT_FORMAT_TREE'=>			'No es posible dar formato al Árbol',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/sv_se.inc.php /usr/share/zabbix/include/locales/sv_se.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/sv_se.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/sv_se.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -596,6 +596,7 @@
 	'S_GENERAL'=>			'Allmänt',
 	'S_AUDIT'=>			'Granskning',
 	'S_LOGIN'=>			'Inloggning',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LATEST_DATA'=>			'Senaste data',
 
 	);
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/ua_ua.inc.php /usr/share/zabbix/include/locales/ua_ua.inc.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/include/locales/ua_ua.inc.php	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/include/locales/ua_ua.inc.php	2012-02-09 19:02:19.000000000 +0000
@@ -2083,6 +2083,7 @@
 	'S_REPORTS'=>			'Звіти',
 	'S_GENERAL'=>			'Загальні парам.',
 	'S_LOGIN'=>			'Вхід в систему',
+	'S_LOGIN_EXTRA' => 'Please log in with your LDAP username and password',
 	'S_LOGOUT'=>			'Вихід із системи',
 	'S_PRINT'=>			'Версія для друку',
 	'S_LATEST_DATA'=>			'Останні дані',
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/index.php /usr/share/zabbix/index.php
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/index.php	2011-09-28 09:14:01.000000000 +0000
+++ /usr/share/zabbix/index.php	2012-02-09 19:01:29.000000000 +0000
@@ -102,6 +102,7 @@
 //	konqueror bug #138024; adding useless param(login=1) to the form's action path to avoid bug!!
 				$frmLogin = new CFormTable(S_LOGIN,'index.php?login=1','post','multipart/form-data');
 				$frmLogin->setHelp('web.index.login');
+        $frmLogin->addRow( S_LOGIN_EXTRA );
 				$frmLogin->addVar('request', $request);
 				$lt = new CTextBox('name');
 				$lt->addStyle('width: 150px');
diff -ru /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/conf/zabbix.conf.php.example /usr/share/zabbix/conf/zabbix.conf.php.example
--- /usr/src/redhat/BUILD/zabbix-1.8.8/frontends/php/conf/zabbix.conf.php.example	2011-09-28 09:13:58.000000000 +0000
+++ /usr/share/zabbix/conf/zabbix.conf.php.example	2012-03-02 20:42:28.000000000 +0000
@@ -1,6 +1,7 @@
 <?php
 // Zabbix GUI configuration file
 global $DB;
+global $ZABBIX_LDAP_GUEST;
 
 $DB["TYPE"]				= 'MYSQL';
 $DB["SERVER"]			= 'localhost';
@@ -16,4 +17,7 @@
 $ZBX_SERVER_NAME		= '';
 
 $IMAGE_FORMAT_DEFAULT	= IMAGE_FORMAT_PNG;
+
+$ZABBIX_LDAP_GUEST['user'] = 'ldap_guest';
+$ZABBIX_LDAP_GUEST['password'] = 'some_password';
 ?>
