Commits

Ivica Nedeljkovic committed 0f917be Merge

Merge with default

  • Participants
  • Parent commits cf0bc6c, 9aa0a26
  • Branches commandLineUnitTests

Comments (0)

Files changed (27)

File app/protected/modules/install/serviceHelpers/LDAPServiceHelper.php

-<?php
-    /*********************************************************************************
-     * Zurmo is a customer relationship management program developed by
-     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
-     *
-     * Zurmo is free software; you can redistribute it and/or modify it under
-     * the terms of the GNU General Public License version 3 as published by the
-     * Free Software Foundation with the addition of the following permission added
-     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
-     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
-     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
-     *
-     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
-     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-     * details.
-     *
-     * You should have received a copy of the GNU General Public License along with
-     * this program; if not, see http://www.gnu.org/licenses or write to the Free
-     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-     * 02110-1301 USA.
-     *
-     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
-     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
-     ********************************************************************************/
-
-    /**
-     * Checks that the LDAP extension for php is installed.
-     */
-    class LDAPServiceHelper extends ServiceHelper
-    {
-        protected $required = false;
-
-        protected function checkService()
-        {
-            $passed = InstallUtil::isLDAPInstalled();
-            if ($passed)
-            {
-                $this->message = Zurmo::t('InstallModule', 'LDAP is installed.');
-            }
-            else
-            {
-                $this->message = Zurmo::t('InstallModule', 'LDAP is not installed.');
-            }
-            return $passed;
-        }
-    }
-?>

File app/protected/modules/install/serviceHelpers/LdapServiceHelper.php

+<?php
+    /*********************************************************************************
+     * Zurmo is a customer relationship management program developed by
+     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
+     *
+     * Zurmo is free software; you can redistribute it and/or modify it under
+     * the terms of the GNU General Public License version 3 as published by the
+     * Free Software Foundation with the addition of the following permission added
+     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
+     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
+     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
+     *
+     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
+     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+     * details.
+     *
+     * You should have received a copy of the GNU General Public License along with
+     * this program; if not, see http://www.gnu.org/licenses or write to the Free
+     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+     * 02110-1301 USA.
+     *
+     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
+     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
+     ********************************************************************************/
+
+    /**
+     * Checks that the Ldap extension for php is installed.
+     */
+    class LdapServiceHelper extends ServiceHelper
+    {
+        protected $required = false;
+
+        protected function checkService()
+        {
+            $passed = InstallUtil::isLdapInstalled();
+            if ($passed)
+            {
+                $this->message = Zurmo::t('InstallModule', 'Ldap is installed.');
+            }
+            else
+            {
+                $this->message = Zurmo::t('InstallModule', 'Ldap is not installed.');
+            }
+            return $passed;
+        }
+    }
+?>

File app/protected/modules/install/utils/CheckServicesUtil.php

                          'SetIncludePath',
                          'IMAP',
                          'Pdo',
-                         'PdoMysql'
+                         'PdoMysql',
+                         'Ldap'
             );
         }
 
                          'DatabaseThreadStack',
                          'DatabaseDefaultCollation',
                          'DatabaseLogBin',
-                         'DatabaseOptimizerSearchDepth',
-                         'LDAP'                         
+                         'DatabaseOptimizerSearchDepth'                                                 
             );
         }
 

File app/protected/modules/install/utils/InstallUtil.php

             return extension_loaded("pdo_mysql");
         }
         
-        public static function isLDAPInstalled()
+        public static function isLdapInstalled()
         {
             return extension_loaded("ldap");
         }

File app/protected/modules/users/UserLDAPIdentity.php

-<?php
-    /*********************************************************************************
-     * Zurmo is a customer relationship management program developed by
-     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
-     *
-     * Zurmo is free software; you can redistribute it and/or modify it under
-     * the terms of the GNU General Public License version 3 as published by the
-     * Free Software Foundation with the addition of the following permission added
-     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
-     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
-     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
-     *
-     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
-     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-     * details.
-     *
-     * You should have received a copy of the GNU General Public License along with
-     * this program; if not, see http://www.gnu.org/licenses or write to the Free
-     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-     * 02110-1301 USA.
-     *
-     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
-     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
-     ********************************************************************************/
-
-    /**
-     * UserLDAPIdentity represents the data needed to identity a user using ldap server 
-	 * authentication.
-     */
-    class UserLDAPIdentity extends UserIdentity
-    {
-        
-        const ERROR_NO_RIGHT_WEB_LOGIN = 3;
-        /**
-         * Authenticates a user against ldap server.
-         * @return boolean whether authentication succeeds.
-         */
-        public function authenticate()
-        {
-            try
-            {                
-                $host                      = Yii::app()->authenticationHelper->ldapHost;
-                $port                      = Yii::app()->authenticationHelper->ldapPort;
-                $baseDomain                = Yii::app()->authenticationHelper->ldapBaseDomain;
-                $bindPassword              = Yii::app()->authenticationHelper->ldapBindPassword;
-                $bindRegisteredDomain      = Yii::app()->authenticationHelper->ldapBindRegisteredDomain;                                 
-                $ldapConnection            = LDAPUtil::establishConnection($host,$port,$bindRegisteredDomain,
-                                                                           $bindPassword,$baseDomain);                                                        
-                if($ldapConnection)
-                {                                     
-                    $ldapFilter              = '(|(cn='.$this->username.')(&(uid='.$this->username.')))'; 
-                    $ldapResults             = ldap_search($ldapConnection, $baseDomain,$ldapFilter); 					
-                    $ldapResultsCount        = ldap_count_entries($ldapConnection,$ldapResults);  
-                    if ($ldapResultsCount > 0)
-                    {				 
-                        $result = @ldap_get_entries($ldapConnection, $ldapResults);                                                          					
-                        $zurmoLogin = parent::authenticate();                                           
-                        if(!$zurmoLogin)
-                        {
-                           if ($result[0] && @ldap_bind($ldapConnection, $result[0]['dn'], $this->password))
-                            {                                
-                              if($this->errorCode!=1)
-                              {
-                                 $this->setState('username', $this->username);
-                                 $this->errorCode = self::ERROR_NONE;
-                                 return true;
-                              }                              
-                            }                                                    
-                        }
-                        else
-                        {                             
-                            $this->setState('username', $this->username);
-                            $this->errorCode = self::ERROR_NONE;
-                            return true;
-                        }
-                    }
-                    else
-                    {
-                        return parent::authenticate();	                     
-                    }					
-                }
-                else
-                {
-                    return parent::authenticate();
-                }
-            }
-            catch (NotFoundException $e)
-            {
-                $this->errorCode = self::ERROR_USERNAME_INVALID;
-            }
-            catch (BadPasswordException $e)
-            {
-                $this->errorCode = self::ERROR_PASSWORD_INVALID;
-            }
-            catch (NoRightWebLoginException $e)
-            {
-                $this->errorCode = self::ERROR_NO_RIGHT_WEB_LOGIN;
-            }
-            return false;
-        }
-    }
-?>

File app/protected/modules/users/UserLdapIdentity.php

+<?php
+    /*********************************************************************************
+     * Zurmo is a customer relationship management program developed by
+     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
+     *
+     * Zurmo is free software; you can redistribute it and/or modify it under
+     * the terms of the GNU General Public License version 3 as published by the
+     * Free Software Foundation with the addition of the following permission added
+     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
+     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
+     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
+     *
+     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
+     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+     * details.
+     *
+     * You should have received a copy of the GNU General Public License along with
+     * this program; if not, see http://www.gnu.org/licenses or write to the Free
+     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+     * 02110-1301 USA.
+     *
+     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
+     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
+     ********************************************************************************/
+
+    /**
+     * UserLdapIdentity represents the data needed to identity a user using ldap server 
+	 * authentication.
+     */
+    class UserLdapIdentity extends UserIdentity
+    {
+        
+        const ERROR_NO_RIGHT_WEB_LOGIN = 3;
+        /**
+         * Authenticates a user against ldap server.
+         * @return boolean whether authentication succeeds.
+         */
+        public function authenticate()
+        {
+            try
+            {                
+                $host                      = Yii::app()->authenticationHelper->ldapHost;
+                $port                      = Yii::app()->authenticationHelper->ldapPort;
+                $baseDomain                = Yii::app()->authenticationHelper->ldapBaseDomain;
+                $bindPassword              = Yii::app()->authenticationHelper->ldapBindPassword;
+                $bindRegisteredDomain      = Yii::app()->authenticationHelper->ldapBindRegisteredDomain;                                 
+                $ldapConnection            = LdapUtil::establishConnection($host,$port,$bindRegisteredDomain,
+                                                                           $bindPassword,$baseDomain);                                                        
+                if($ldapConnection)
+                {                                     
+                    $ldapFilter              = '(|(cn='.$this->username.')(&(uid='.$this->username.')))'; 
+                    $ldapResults             = ldap_search($ldapConnection, $baseDomain,$ldapFilter); 					
+                    $ldapResultsCount        = ldap_count_entries($ldapConnection,$ldapResults);  
+                    if ($ldapResultsCount > 0)
+                    {				 
+                        $result = @ldap_get_entries($ldapConnection, $ldapResults);                                                          					
+                        $zurmoLogin = parent::authenticate();                                           
+                        if(!$zurmoLogin)
+                        {
+                           if ($result[0] && @ldap_bind($ldapConnection, $result[0]['dn'], $this->password))
+                            {                                
+                              if($this->errorCode!=1)
+                              {
+                                 $this->setState('username', $this->username);
+                                 $this->errorCode = self::ERROR_NONE;
+                                 return true;
+                              }                              
+                            }                                                    
+                        }
+                        else
+                        {                             
+                            $this->setState('username', $this->username);
+                            $this->errorCode = self::ERROR_NONE;
+                            return true;
+                        }
+                    }
+                    else
+                    {
+                        return parent::authenticate();	                     
+                    }					
+                }
+                else
+                {
+                    return parent::authenticate();
+                }
+            }
+            catch (NotFoundException $e)
+            {
+                $this->errorCode = self::ERROR_USERNAME_INVALID;
+            }
+            catch (BadPasswordException $e)
+            {
+                $this->errorCode = self::ERROR_PASSWORD_INVALID;
+            }
+            catch (NoRightWebLoginException $e)
+            {
+                $this->errorCode = self::ERROR_NO_RIGHT_WEB_LOGIN;
+            }
+            return false;
+        }
+    }
+?>

File app/protected/modules/users/tests/unit/UserLDAPTest.php

-<?php
-    /*********************************************************************************
-     * Zurmo is a customer relationship management program developed by
-     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
-     *
-     * Zurmo is free software; you can redistribute it and/or modify it under
-     * the terms of the GNU General Public License version 3 as published by the
-     * Free Software Foundation with the addition of the following permission added
-     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
-     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
-     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
-     *
-     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
-     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-     * details.
-     *
-     * You should have received a copy of the GNU General Public License along with
-     * this program; if not, see http://www.gnu.org/licenses or write to the Free
-     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-     * 02110-1301 USA.
-     *
-     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
-     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
-     ********************************************************************************/
-
-    class UserLDAPTest extends ZurmoBaseTest
-    {
-        public static function setUpBeforeClass()
-        {
-            parent::setUpBeforeClass();
-            SecurityTestHelper::createSuperAdmin();            
-            if (!ZurmoTestHelper::isAuthenticationLDAPTestConfigurationSet()) 
-            {            
-                Yii::app()->authenticationHelper->ldapHost                 = 
-                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapHost'];
-                Yii::app()->authenticationHelper->ldapPort                 = 
-                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapPort'];
-                Yii::app()->authenticationHelper->ldapBindRegisteredDomain = 
-                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindRegisteredDomain'];
-                Yii::app()->authenticationHelper->ldapBindPassword         = 
-                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindPassword'];
-                Yii::app()->authenticationHelper->ldapBaseDomain           = 
-                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBaseDomain'];
-                Yii::app()->authenticationHelper->ldapEnabled              = 
-                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapEnabled'];            
-                Yii::app()->authenticationHelper->setLDAPSettings();
-                Yii::app()->authenticationHelper->init();            
-            }
-        }
-
-        public function setUp()
-        {
-            parent::setUp();
-            Yii::app()->user->userModel = User::getByUsername('super');
-        }
-
-        /**
-        *user exists in zurmo but not on ldap
-        */
-        public function testUserExitsInZurmoButNotOnldap()
-        {   
-            if (!ZurmoTestHelper::isAuthenticationLDAPTestConfigurationSet())
-            {
-                $this->markTestSkipped(Yii::t('Default', 'Test LDAP settings are not configured in perInstanceTest.php file.'));
-            }      
-            $user               = new User();
-            $user->username     = 'abcdefg';
-            $user->title->value = 'Mr.';
-            $user->firstName    = 'abcdefg';
-            $user->lastName     = 'abcdefg';
-            $user->setPassword('abcdefgN4');
-            $this->assertTrue($user->save());
-            //Now attempt to login as bill a user in zurmo but not on ldap
-            $bill               = User::getByUsername('abcdefg');
-            $this->assertEquals(md5('abcdefgN4'), $bill->hash);
-            $bill->setRight('UsersModule', UsersModule::RIGHT_LOGIN_VIA_WEB, RIGHT::ALLOW);
-            $this->assertTrue($bill->save());
-            //for normal user
-            $identity           = new UserIdentity('abcdefg', 'abcdefgN4');
-            $authenticated      = $identity->authenticate();
-            $this->assertEquals(0, $identity->errorCode);
-            $this->assertTrue($authenticated);
-            $bill->forget();            
-        }
-        
-        /**
-        *one where it exists in both, but the pass is wrong for ldap, but ok for zurmo pass.
-        */
-        public function testUserExitsInBothButWrongPasswordForldap()
-        {
-            if (!ZurmoTestHelper::isAuthenticationLDAPTestConfigurationSet())
-            {
-                $this->markTestSkipped(Yii::t('Default', 'Test LDAP settings are not configured in perInstanceTest.php file.'));
-            } 
-            Yii::app()->user->userModel = User::getByUsername('super');
-            //creating user same as on ldap with different password
-            $admin = new User();
-            $admin->username           = 'admin';
-            $admin->title->value       = 'Mr.';
-            $admin->firstName          = 'admin';
-            $admin->lastName           = 'admin';
-            $admin->setPassword('test123');
-            $this->assertTrue($admin->save());
-            $admin->setRight('UsersModule', UsersModule::RIGHT_LOGIN_VIA_WEB, RIGHT::ALLOW);
-            $this->assertTrue($admin->save());
-            $username = Yii::app()->authenticationHelper->ldapBindRegisteredDomain;
-            $password = Yii::app()->authenticationHelper->ldapBindPassword;
-            $identity = new UserLDAPIdentity($username,'test123');                        
-            $authenticated = $identity->authenticate(true);
-            $this->assertEquals(0, $identity->errorCode);
-            $this->assertTrue($authenticated);     
-        }
-        
-        /**
-        *one for when the user exists in ldap but not zurmo
-        */
-        public function testUserExitsInldapNotInZurmo()
-        {
-            if (!ZurmoTestHelper::isAuthenticationLDAPTestConfigurationSet())
-            {
-                $this->markTestSkipped(Yii::t('Default', 'Test LDAP settings are not configured in perInstanceTest.php file.'));
-            } 
-            Yii::app()->user->userModel = User::getByUsername('super');     
-            $identity                   = new UserLDAPIdentity('john','johnldap');                        
-            $authenticated              = $identity->authenticate(true);
-            $this->assertEquals(1, $identity->errorCode);
-            $this->assertFalse($authenticated);     
-        }                
-        
-        /**
-        *one for when the user exists in ldap and zurmo
-        */
-        public function testUserExitsInldapAndZurmo()
-        {                    
-            if (!ZurmoTestHelper::isAuthenticationLDAPTestConfigurationSet())
-            {
-                $this->markTestSkipped(Yii::t('Default', 'Test LDAP settings are not configured in perInstanceTest.php file.'));
-            } 
-            Yii::app()->user->userModel = User::getByUsername('super'); 
-            $username                   = Yii::app()->authenticationHelper->ldapBindRegisteredDomain;
-            $password                   = Yii::app()->authenticationHelper->ldapBindPassword;            
-            $identity                   = new UserLDAPIdentity($username,$password);                        
-            $authenticated              = $identity->authenticate(true);
-            $this->assertEquals(0, $identity->errorCode);
-            $this->assertTrue($authenticated);     
-        }                  
-    }
-?>

File app/protected/modules/users/tests/unit/UserLdapTest.php

+<?php
+    /*********************************************************************************
+     * Zurmo is a customer relationship management program developed by
+     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
+     *
+     * Zurmo is free software; you can redistribute it and/or modify it under
+     * the terms of the GNU General Public License version 3 as published by the
+     * Free Software Foundation with the addition of the following permission added
+     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
+     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
+     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
+     *
+     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
+     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+     * details.
+     *
+     * You should have received a copy of the GNU General Public License along with
+     * this program; if not, see http://www.gnu.org/licenses or write to the Free
+     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+     * 02110-1301 USA.
+     *
+     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
+     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
+     ********************************************************************************/
+
+    class UserLdapTest extends ZurmoBaseTest
+    {
+        public static function setUpBeforeClass()
+        {
+            parent::setUpBeforeClass();
+            SecurityTestHelper::createSuperAdmin();            
+            if (!ZurmoTestHelper::isAuthenticationLdapTestConfigurationSet()) 
+            {            
+                Yii::app()->authenticationHelper->ldapHost                 = 
+                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapHost'];
+                Yii::app()->authenticationHelper->ldapPort                 = 
+                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapPort'];
+                Yii::app()->authenticationHelper->ldapBindRegisteredDomain = 
+                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindRegisteredDomain'];
+                Yii::app()->authenticationHelper->ldapBindPassword         = 
+                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindPassword'];
+                Yii::app()->authenticationHelper->ldapBaseDomain           = 
+                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBaseDomain'];
+                Yii::app()->authenticationHelper->ldapEnabled              = 
+                Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapEnabled'];            
+                Yii::app()->authenticationHelper->setLdapSettings();
+                Yii::app()->authenticationHelper->init();            
+            }
+        }
+
+        public function setUp()
+        {
+            parent::setUp();
+            Yii::app()->user->userModel = User::getByUsername('super');
+        }
+
+        /**
+        *user exists in zurmo but not on ldap
+        */
+        public function testUserExitsInZurmoButNotOnldap()
+        {   
+            if (!ZurmoTestHelper::isAuthenticationLdapTestConfigurationSet())
+            {
+                $this->markTestSkipped(Yii::t('Default', 'Test Ldap settings are not configured in perInstanceTest.php file.'));
+            }      
+            $user               = new User();
+            $user->username     = 'abcdefg';
+            $user->title->value = 'Mr.';
+            $user->firstName    = 'abcdefg';
+            $user->lastName     = 'abcdefg';
+            $user->setPassword('abcdefgN4');
+            $this->assertTrue($user->save());
+            //Now attempt to login as bill a user in zurmo but not on ldap
+            $bill               = User::getByUsername('abcdefg');
+            $this->assertEquals(md5('abcdefgN4'), $bill->hash);
+            $bill->setRight('UsersModule', UsersModule::RIGHT_LOGIN_VIA_WEB, RIGHT::ALLOW);
+            $this->assertTrue($bill->save());
+            //for normal user
+            $identity           = new UserIdentity('abcdefg', 'abcdefgN4');
+            $authenticated      = $identity->authenticate();
+            $this->assertEquals(0, $identity->errorCode);
+            $this->assertTrue($authenticated);
+            $bill->forget();            
+        }
+        
+        /**
+        *one where it exists in both, but the pass is wrong for ldap, but ok for zurmo pass.
+        */
+        public function testUserExitsInBothButWrongPasswordForldap()
+        {
+            if (!ZurmoTestHelper::isAuthenticationLdapTestConfigurationSet())
+            {
+                $this->markTestSkipped(Yii::t('Default', 'Test Ldap settings are not configured in perInstanceTest.php file.'));
+            } 
+            Yii::app()->user->userModel = User::getByUsername('super');
+            //creating user same as on ldap with different password
+            $admin = new User();
+            $admin->username           = 'admin';
+            $admin->title->value       = 'Mr.';
+            $admin->firstName          = 'admin';
+            $admin->lastName           = 'admin';
+            $admin->setPassword('test123');
+            $this->assertTrue($admin->save());
+            $admin->setRight('UsersModule', UsersModule::RIGHT_LOGIN_VIA_WEB, RIGHT::ALLOW);
+            $this->assertTrue($admin->save());
+            $username = Yii::app()->authenticationHelper->ldapBindRegisteredDomain;
+            $password = Yii::app()->authenticationHelper->ldapBindPassword;
+            $identity = new UserLdapIdentity($username,'test123');                        
+            $authenticated = $identity->authenticate(true);
+            $this->assertEquals(0, $identity->errorCode);
+            $this->assertTrue($authenticated);     
+        }
+        
+        /**
+        *one for when the user exists in ldap but not zurmo
+        */
+        public function testUserExitsInldapNotInZurmo()
+        {
+            if (!ZurmoTestHelper::isAuthenticationLdapTestConfigurationSet())
+            {
+                $this->markTestSkipped(Yii::t('Default', 'Test Ldap settings are not configured in perInstanceTest.php file.'));
+            } 
+            Yii::app()->user->userModel = User::getByUsername('super');     
+            $identity                   = new UserLdapIdentity('john','johnldap');                        
+            $authenticated              = $identity->authenticate(true);
+            $this->assertEquals(1, $identity->errorCode);
+            $this->assertFalse($authenticated);     
+        }                
+        
+        /**
+        *one for when the user exists in ldap and zurmo
+        */
+        public function testUserExitsInldapAndZurmo()
+        {                    
+            if (!ZurmoTestHelper::isAuthenticationLdapTestConfigurationSet())
+            {
+                $this->markTestSkipped(Yii::t('Default', 'Test Ldap settings are not configured in perInstanceTest.php file.'));
+            } 
+            Yii::app()->user->userModel = User::getByUsername('super'); 
+            $username                   = Yii::app()->authenticationHelper->ldapBindRegisteredDomain;
+            $password                   = Yii::app()->authenticationHelper->ldapBindPassword;            
+            $identity                   = new UserLdapIdentity($username,$password);                        
+            $authenticated              = $identity->authenticate(true);
+            $this->assertEquals(0, $identity->errorCode);
+            $this->assertTrue($authenticated);     
+        }                  
+    }
+?>

File app/protected/modules/zurmo/ZurmoModule.php

                 'configureSubMenuItems' => array(
                     array(
                         'category'         => self::ADMINISTRATION_CATEGORY_GENERAL,
-                        'titleLabel'       => 'LDAP Configuration',
-                        'descriptionLabel' => 'Manage LDAP Authentication',
-                        'route'            => '/zurmo/ldap/configurationEditLDAP',
+                        'titleLabel'       => 'Ldap Configuration',
+                        'descriptionLabel' => 'Manage Ldap Authentication',
+                        'route'            => '/zurmo/ldap/configurationEditLdap',
                         'right'            => self::RIGHT_ACCESS_GLOBAL_CONFIGURATION,
                     ),
                 ),

File app/protected/modules/zurmo/adapters/ldap/LDAPConfigurationFormAdapter.php

-<?php
-    /*********************************************************************************
-     * Zurmo is a customer relationship management program developed by
-     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
-     *
-     * Zurmo is free software; you can redistribute it and/or modify it under
-     * the terms of the GNU General Public License version 3 as published by the
-     * Free Software Foundation with the addition of the following permission added
-     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
-     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
-     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
-     *
-     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
-     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-     * details.
-     *
-     * You should have received a copy of the GNU General Public License along with
-     * this program; if not, see http://www.gnu.org/licenses or write to the Free
-     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-     * 02110-1301 USA.
-     *
-     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
-     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
-     ********************************************************************************/
-
-    /**
-     * Class to adapt LDAP Configuration values into a configuration form.
-     * Saves global values from a configuration form.
-     */
-    class LDAPConfigurationFormAdapter
-    {
-        /**
-         * @return LDAPConfigurationForm
-         */
-        public static function makeFormFromGlobalConfiguration()
-        {
-            $form                                    = new LDAPConfigurationForm();
-            $form->host                              = Yii::app()->authenticationHelper->ldapHost;
-            $form->port                              = Yii::app()->authenticationHelper->ldapPort;
-            $form->bindRegisteredDomain              = Yii::app()->authenticationHelper->ldapBindRegisteredDomain;            
-            $form->bindPassword                      = Yii::app()->authenticationHelper->ldapBindPassword;
-            $form->baseDomain                        = Yii::app()->authenticationHelper->ldapBaseDomain;
-            $form->enabled                           = Yii::app()->authenticationHelper->ldapEnabled;			
-            return $form;
-        }
-
-        /**
-         * Given a LDAPConfigurationForm, save the configuration global values.
-         */
-        public static function setConfigurationFromForm(LDAPConfigurationForm $form)
-        {             
-            Yii::app()->authenticationHelper->ldapHost                 = $form->host;
-            Yii::app()->authenticationHelper->ldapPort                 = $form->port;
-            Yii::app()->authenticationHelper->ldapBindRegisteredDomain = $form->bindRegisteredDomain;
-            Yii::app()->authenticationHelper->ldapBindPassword         = $form->bindPassword;
-            Yii::app()->authenticationHelper->ldapBaseDomain           = $form->baseDomain;
-            Yii::app()->authenticationHelper->ldapEnabled                  = $form->enabled;
-            Yii::app()->authenticationHelper->setLDAPSettings();
-       }
-    }
-?>

File app/protected/modules/zurmo/adapters/ldap/LdapConfigurationFormAdapter.php

+<?php
+    /*********************************************************************************
+     * Zurmo is a customer relationship management program developed by
+     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
+     *
+     * Zurmo is free software; you can redistribute it and/or modify it under
+     * the terms of the GNU General Public License version 3 as published by the
+     * Free Software Foundation with the addition of the following permission added
+     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
+     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
+     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
+     *
+     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
+     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+     * details.
+     *
+     * You should have received a copy of the GNU General Public License along with
+     * this program; if not, see http://www.gnu.org/licenses or write to the Free
+     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+     * 02110-1301 USA.
+     *
+     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
+     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
+     ********************************************************************************/
+
+    /**
+     * Class to adapt Ldap Configuration values into a configuration form.
+     * Saves global values from a configuration form.
+     */
+    class LdapConfigurationFormAdapter
+    {
+        /**
+         * @return LdapConfigurationForm
+         */
+        public static function makeFormFromGlobalConfiguration()
+        {
+            $form                                    = new LdapConfigurationForm();
+            $form->host                              = Yii::app()->authenticationHelper->ldapHost;
+            $form->port                              = Yii::app()->authenticationHelper->ldapPort;
+            $form->bindRegisteredDomain              = Yii::app()->authenticationHelper->ldapBindRegisteredDomain;            
+            $form->bindPassword                      = Yii::app()->authenticationHelper->ldapBindPassword;
+            $form->baseDomain                        = Yii::app()->authenticationHelper->ldapBaseDomain;
+            $form->enabled                           = Yii::app()->authenticationHelper->ldapEnabled;			
+            return $form;
+        }
+
+        /**
+         * Given a LdapConfigurationForm, save the configuration global values.
+         */
+        public static function setConfigurationFromForm(LdapConfigurationForm $form)
+        {             
+            Yii::app()->authenticationHelper->ldapHost                 = $form->host;
+            Yii::app()->authenticationHelper->ldapPort                 = $form->port;
+            Yii::app()->authenticationHelper->ldapBindRegisteredDomain = $form->bindRegisteredDomain;
+            Yii::app()->authenticationHelper->ldapBindPassword         = $form->bindPassword;
+            Yii::app()->authenticationHelper->ldapBaseDomain           = $form->baseDomain;
+            Yii::app()->authenticationHelper->ldapEnabled                  = $form->enabled;
+            Yii::app()->authenticationHelper->setLdapSettings();
+       }
+    }
+?>

File app/protected/modules/zurmo/components/ZurmoAuthenticationHelper.php

     class ZurmoAuthenticationHelper extends CApplicationComponent
     {
         /**
-         * LDAP server host name. Example someDomain.com
+         * Ldap server host name. Example someDomain.com
          * @var string
          */
         public $ldapHost;
 
         /**
-         * LDAP server port number. Default to 389, but it can be set to something different.
+         * Ldap server port number. Default to 389, but it can be set to something different.
          * @var integer
          */
         public $ldapPort = 389;
 
         /**
-         * LDAP server username. 
+         * Ldap server username. 
          * @var string
          */
         public $ldapBindRegisteredDomain;
 
         /**
-         * LDAP server password. 
+         * Ldap server password. 
          * @var string
          */
         public $ldapBindPassword;
 
         /**
-         * LDAP server domain name. 
+         * Ldap server domain name. 
          * @var string
          */
         public $ldapBaseDomain;
 				
          /**
-         * LDAP server authentication feature turn on. 
+         * Ldap server authentication feature turn on. 
          * @var boolean
          */
         public $ldapEnabled;
         
         /**
          * Contains array of settings to load during initialization from the configuration table.
-         * @see loadLDAPSettings
+         * @see loadLdapSettings
          * @var array
          */
         protected $settingsToLoad = array(
 
 
         /**
-         * Called once per page load, will load up LDAP settings from the database if available.
+         * Called once per page load, will load up Ldap settings from the database if available.
          * (non-PHPdoc)
          * @see CApplicationComponent::init()
          */
         public function init()
         {
-            $this->loadLDAPSettings();
+            $this->loadLdapSettings();
         }
 
-        public function loadLDAPSettings()
+        public function loadLdapSettings()
         {
             foreach ($this->settingsToLoad as $keyName)
             {
         }
 
         /**
-         * Set LDAP settings into the database.
+         * Set Ldap settings into the database.
          */
-        public function setLDAPSettings()
+        public function setLdapSettings()
         {
             foreach ($this->settingsToLoad as $keyName)
             {                
         */
         public function makeIdentity($username, $password)
         {
-          //checking LDAP option enable 
+          //checking Ldap option enable 
           $ldapEnabled = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'ldapEnabled');
           if($ldapEnabled)
           {  		     
-             return new UserLDAPIdentity($username, $password);
+             return new UserLdapIdentity($username, $password);
           }
           else
           {

File app/protected/modules/zurmo/controllers/LDAPController.php

-<?php
-    /*********************************************************************************
-     * Zurmo is a customer relationship management program developed by
-     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
-     *
-     * Zurmo is free software; you can redistribute it and/or modify it under
-     * the terms of the GNU General Public License version 3 as published by the
-     * Free Software Foundation with the addition of the following permission added
-     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
-     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
-     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
-     *
-     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
-     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-     * details.
-     *
-     * You should have received a copy of the GNU General Public License along with
-     * this program; if not, see http://www.gnu.org/licenses or write to the Free
-     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-     * 02110-1301 USA.
-     *
-     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
-     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
-     ********************************************************************************/
-
-    /**
-     * Controller Class for managing LDAP Authentication.
-     *
-     */
-    class ZurmoLDAPController extends ZurmoModuleController
-    {       
-        public function actionConfigurationEditLDAP()
-        {
-            $configurationForm = LDAPConfigurationFormAdapter::makeFormFromGlobalConfiguration();
-            $postVariableName   = get_class($configurationForm);            
-            if (isset($_POST[$postVariableName]))
-            {                                  
-                $configurationForm->setAttributes($_POST[$postVariableName]);                
-                if ($configurationForm->validate())
-                {
-                    LDAPConfigurationFormAdapter::setConfigurationFromForm($configurationForm);
-                    Yii::app()->user->setFlash('notification',
-                        Yii::t('Default', 'LDAP Configuration saved successfully.')
-                    );
-                    $this->redirect(Yii::app()->createUrl('configuration/default/index'));
-                }
-            }
-            $editView = new LDAPConfigurationEditAndDetailsView(
-                                    'Edit',
-                                    $this->getId(),
-                                    $this->getModule()->getId(),
-                                    $configurationForm);
-            $editView->setCssClasses( array('AdministrativeArea') );
-            $view = new ZurmoConfigurationPageView(ZurmoDefaultAdminViewUtil::
-                                         makeStandardViewForCurrentUser($this, $editView));
-            echo $view->render();
-        }
-        
-        public function actionTestConnection()
-        {
-            $configurationForm = LDAPConfigurationFormAdapter::makeFormFromGlobalConfiguration();
-            $postVariableName  = get_class($configurationForm);
-            if (isset($_POST[$postVariableName]) || (isset($_POST['LDAPConfigurationForm'])))
-            {
-                if (isset($_POST[$postVariableName]))
-                {
-                    $configurationForm->setAttributes($_POST[$postVariableName]);
-                }
-                else
-                {
-                    $configurationForm->host                  = $_POST['LDAPConfigurationForm']['host'];
-                    $configurationForm->port                  = $_POST['LDAPConfigurationForm']['port'];
-                    $configurationForm->bindRegisteredDomain  = $_POST['LDAPConfigurationForm']['bindRegisteredDomain'];
-                    $configurationForm->bindPassword          = $_POST['LDAPConfigurationForm']['bindPassword'];
-                    $configurationForm->baseDomain            = $_POST['LDAPConfigurationForm']['baseDomain'];
-                    $configurationForm->enabled               = $_POST['LDAPConfigurationForm']['enabled'];                    
-                }
-                if ($configurationForm->host != null && $configurationForm->port != null && 
-                    $configurationForm->bindRegisteredDomain != null && $configurationForm->bindPassword != null &&
-      				$configurationForm->baseDomain != null	)
-                {
-                    $authenticationHelper = new ZurmoAuthenticationHelper;
-                    $authenticationHelper->ldapHost                 = $configurationForm->host;
-                    $authenticationHelper->ldapPort                 = $configurationForm->port;
-                    $authenticationHelper->ldapBindRegisteredDomain = $configurationForm->bindRegisteredDomain;
-                    $authenticationHelper->ldapBindPassword         = $configurationForm->bindPassword;
-                    $authenticationHelper->ldapBaseDomain           = $configurationForm->baseDomain;
-                    $authenticationHelper->ldapEnabled              = $configurationForm->enabled;
-                    
-                    $host                      = $configurationForm->host;             
-                    $port                      = $configurationForm->port;                
-                    $bindRegisteredDomain      = $configurationForm->bindRegisteredDomain;
-                    $bindPassword              = $configurationForm->bindPassword;         
-                    $baseDomain                = $configurationForm->baseDomain;           
-                    $testConnectionResults     = LDAPUtil::establishConnection($host,$port,$bindRegisteredDomain,
-                                                                               $bindPassword,$baseDomain);                      
-                    if($testConnectionResults)
-                    {
-                       $messageContent = Yii::t('Default', 'Successfully Connected to LDAP Server') . "\n";  
-                    }
-                    else
-                    {
-                       $messageContent = Yii::t('Default', 'Unable to connect to LDAP server') . "\n";
-                    }                                                                   
-                }
-                else
-                {
-                    $messageContent = Yii::t('Default', 'All fields are required') . "\n";
-                }
-                Yii::app()->getClientScript()->setToAjaxMode();
-                $messageView = new TestLDAPConnectionView($messageContent);
-                $view = new ModalView($this, $messageView);				
-                echo $view->render();
-            }
-            else
-            {
-                throw new NotSupportedException();
-            }
-        }
-    }
-	
-?>

File app/protected/modules/zurmo/controllers/LdapController.php

+<?php
+    /*********************************************************************************
+     * Zurmo is a customer relationship management program developed by
+     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
+     *
+     * Zurmo is free software; you can redistribute it and/or modify it under
+     * the terms of the GNU General Public License version 3 as published by the
+     * Free Software Foundation with the addition of the following permission added
+     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
+     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
+     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
+     *
+     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
+     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+     * details.
+     *
+     * You should have received a copy of the GNU General Public License along with
+     * this program; if not, see http://www.gnu.org/licenses or write to the Free
+     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+     * 02110-1301 USA.
+     *
+     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
+     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
+     ********************************************************************************/
+
+    /**
+     * Controller Class for managing Ldap Authentication.
+     *
+     */
+    class ZurmoLdapController extends ZurmoModuleController
+    {       
+        public function actionConfigurationEditLdap()
+        {
+            $configurationForm = LdapConfigurationFormAdapter::makeFormFromGlobalConfiguration();
+            $postVariableName   = get_class($configurationForm);            
+            if (isset($_POST[$postVariableName]))
+            {                                  
+                $configurationForm->setAttributes($_POST[$postVariableName]);                
+                if ($configurationForm->validate())
+                {
+                    LdapConfigurationFormAdapter::setConfigurationFromForm($configurationForm);
+                    Yii::app()->user->setFlash('notification',
+                        Yii::t('Default', 'Ldap Configuration saved successfully.')
+                    );
+                    $this->redirect(Yii::app()->createUrl('configuration/default/index'));
+                }
+            }
+            $editView = new LdapConfigurationEditAndDetailsView(
+                                    'Edit',
+                                    $this->getId(),
+                                    $this->getModule()->getId(),
+                                    $configurationForm);
+            $editView->setCssClasses( array('AdministrativeArea') );
+            $view = new ZurmoConfigurationPageView(ZurmoDefaultAdminViewUtil::
+                                         makeStandardViewForCurrentUser($this, $editView));
+            echo $view->render();
+        }
+        
+        public function actionTestConnection()
+        {
+            $configurationForm = LdapConfigurationFormAdapter::makeFormFromGlobalConfiguration();
+            $postVariableName  = get_class($configurationForm);
+            if (isset($_POST[$postVariableName]) || (isset($_POST['LdapConfigurationForm'])))
+            {
+                if (isset($_POST[$postVariableName]))
+                {
+                    $configurationForm->setAttributes($_POST[$postVariableName]);
+                }
+                else
+                {
+                    $configurationForm->host                  = $_POST['LdapConfigurationForm']['host'];
+                    $configurationForm->port                  = $_POST['LdapConfigurationForm']['port'];
+                    $configurationForm->bindRegisteredDomain  = $_POST['LdapConfigurationForm']['bindRegisteredDomain'];
+                    $configurationForm->bindPassword          = $_POST['LdapConfigurationForm']['bindPassword'];
+                    $configurationForm->baseDomain            = $_POST['LdapConfigurationForm']['baseDomain'];
+                    $configurationForm->enabled               = $_POST['LdapConfigurationForm']['enabled'];                    
+                }
+                if ($configurationForm->host != null && $configurationForm->port != null && 
+                    $configurationForm->bindRegisteredDomain != null && $configurationForm->bindPassword != null &&
+      				$configurationForm->baseDomain != null	)
+                {
+                    $authenticationHelper = new ZurmoAuthenticationHelper;
+                    $authenticationHelper->ldapHost                 = $configurationForm->host;
+                    $authenticationHelper->ldapPort                 = $configurationForm->port;
+                    $authenticationHelper->ldapBindRegisteredDomain = $configurationForm->bindRegisteredDomain;
+                    $authenticationHelper->ldapBindPassword         = $configurationForm->bindPassword;
+                    $authenticationHelper->ldapBaseDomain           = $configurationForm->baseDomain;
+                    $authenticationHelper->ldapEnabled              = $configurationForm->enabled;
+                    
+                    $host                      = $configurationForm->host;             
+                    $port                      = $configurationForm->port;                
+                    $bindRegisteredDomain      = $configurationForm->bindRegisteredDomain;
+                    $bindPassword              = $configurationForm->bindPassword;         
+                    $baseDomain                = $configurationForm->baseDomain;           
+                    $testConnectionResults     = LdapUtil::establishConnection($host,$port,$bindRegisteredDomain,
+                                                                               $bindPassword,$baseDomain);                      
+                    if($testConnectionResults)
+                    {
+                       $messageContent = Yii::t('Default', 'Successfully Connected to Ldap Server') . "\n";  
+                    }
+                    else
+                    {
+                       $messageContent = Yii::t('Default', 'Unable to connect to Ldap server') . "\n";
+                    }                                                                   
+                }
+                else
+                {
+                    $messageContent = Yii::t('Default', 'All fields are required') . "\n";
+                }
+                Yii::app()->getClientScript()->setToAjaxMode();
+                $messageView = new TestLdapConnectionView($messageContent);
+                $view = new ModalView($this, $messageView);				
+                echo $view->render();
+            }
+            else
+            {
+                throw new NotSupportedException();
+            }
+        }
+    }
+	
+?>

File app/protected/modules/zurmo/elements/TestLDAPConnectionElement.php

-<?php
-    /*********************************************************************************
-     * Zurmo is a customer relationship management program developed by
-     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
-     *
-     * Zurmo is free software; you can redistribute it and/or modify it under
-     * the terms of the GNU General Public License version 3 as published by the
-     * Free Software Foundation with the addition of the following permission added
-     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
-     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
-     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
-     *
-     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
-     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-     * details.
-     *
-     * You should have received a copy of the GNU General Public License along with
-     * this program; if not, see http://www.gnu.org/licenses or write to the Free
-     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-     * 02110-1301 USA.
-     *
-     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
-     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
-     ********************************************************************************/
-
-    /**
-     * Utilize this element to display a  button that can be used to send a test LDAP connection while setting
-     * up the LDAP server configuration.
-     */
-    class TestLDAPConnectionElement extends Element
-    {
-        /**
-         * Renders a button.
-         * @return A string containing the element's content.
-         */
-        protected function renderControlEditable()
-        {
-            $htmlOptions             = array();
-            $htmlOptions['id']       = $this->getEditableInputId();
-            $htmlOptions['name']     = $this->getEditableInputName();
-            $htmlOptions['disabled'] = $this->getDisabledValue();
-            $htmlOptions             = array_merge($this->getHtmlOptions(), $htmlOptions);
-            $content                 = $this->renderTestButton();
-            return $content;
-        }
-
-        protected function renderControlNonEditable()
-        {
-            throw new NotImplementedException();
-        }
-
-        protected function renderError()
-        {
-            return null;
-        }
-
-       /**
-         * Render a test button. This link calls a modal
-         * popup.
-         * @return The element's content as a string.
-         */
-        protected function renderTestButton()
-        {
-            $content  = '<span>';
-            $content .= ZurmoHtml::ajaxLink(
-                ZurmoHtml::tag('span', array('class' => 'z-label'), Yii::t('Default', 'Test Connection')),
-                Yii::app()->createUrl('zurmo/ldap/testConnection/', array()),
-                static::resolveAjaxOptionsForTestLDAPConnection($this->form->getId()),
-                array('id' => 'TestLDAPConnectionButton', 'class' => 'LDAPTestingButton z-button')
-            );
-            $content .= '</span>';
-            return $content;
-        }
-
-        protected static function resolveAjaxOptionsForTestLDAPConnection($formId)
-        {
-            assert('is_string($formId)');
-            $title               = Yii::t('Default', 'Test Connection Results');
-            $ajaxOptions         = ModalView::getAjaxOptionsForModalLink($title);
-            $ajaxOptions['type'] = 'POST';
-            $ajaxOptions['data'] = 'js:$("#' . $formId . '").serialize()';
-            return $ajaxOptions;
-        }
-    }
-?>

File app/protected/modules/zurmo/elements/TestLdapConnectionElement.php

+<?php
+    /*********************************************************************************
+     * Zurmo is a customer relationship management program developed by
+     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
+     *
+     * Zurmo is free software; you can redistribute it and/or modify it under
+     * the terms of the GNU General Public License version 3 as published by the
+     * Free Software Foundation with the addition of the following permission added
+     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
+     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
+     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
+     *
+     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
+     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+     * details.
+     *
+     * You should have received a copy of the GNU General Public License along with
+     * this program; if not, see http://www.gnu.org/licenses or write to the Free
+     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+     * 02110-1301 USA.
+     *
+     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
+     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
+     ********************************************************************************/
+
+    /**
+     * Utilize this element to display a  button that can be used to send a test Ldap connection while setting
+     * up the Ldap server configuration.
+     */
+    class TestLdapConnectionElement extends Element
+    {
+        /**
+         * Renders a button.
+         * @return A string containing the element's content.
+         */
+        protected function renderControlEditable()
+        {
+            $htmlOptions             = array();
+            $htmlOptions['id']       = $this->getEditableInputId();
+            $htmlOptions['name']     = $this->getEditableInputName();
+            $htmlOptions['disabled'] = $this->getDisabledValue();
+            $htmlOptions             = array_merge($this->getHtmlOptions(), $htmlOptions);
+            $content                 = $this->renderTestButton();
+            return $content;
+        }
+
+        protected function renderControlNonEditable()
+        {
+            throw new NotImplementedException();
+        }
+
+        protected function renderError()
+        {
+            return null;
+        }
+
+       /**
+         * Render a test button. This link calls a modal
+         * popup.
+         * @return The element's content as a string.
+         */
+        protected function renderTestButton()
+        {
+            $content  = '<span>';
+            $content .= ZurmoHtml::ajaxLink(
+                ZurmoHtml::tag('span', array('class' => 'z-label'), Yii::t('Default', 'Test Connection')),
+                Yii::app()->createUrl('zurmo/ldap/testConnection/', array()),
+                static::resolveAjaxOptionsForTestLdapConnection($this->form->getId()),
+                array('id' => 'TestLdapConnectionButton', 'class' => 'LdapTestingButton z-button')
+            );
+            $content .= '</span>';
+            return $content;
+        }
+
+        protected static function resolveAjaxOptionsForTestLdapConnection($formId)
+        {
+            assert('is_string($formId)');
+            $title               = Yii::t('Default', 'Test Connection Results');
+            $ajaxOptions         = ModalView::getAjaxOptionsForModalLink($title);
+            $ajaxOptions['type'] = 'POST';
+            $ajaxOptions['data'] = 'js:$("#' . $formId . '").serialize()';
+            return $ajaxOptions;
+        }
+    }
+?>

File app/protected/modules/zurmo/forms/ldap/LDAPConfigurationForm.php

-<?php
-    /*********************************************************************************
-     * Zurmo is a customer relationship management program developed by
-     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
-     *
-     * Zurmo is free software; you can redistribute it and/or modify it under
-     * the terms of the GNU General Public License version 3 as published by the
-     * Free Software Foundation with the addition of the following permission added
-     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
-     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
-     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
-     *
-     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
-     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-     * details.
-     *
-     * You should have received a copy of the GNU General Public License along with
-     * this program; if not, see http://www.gnu.org/licenses or write to the Free
-     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-     * 02110-1301 USA.
-     *
-     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
-     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
-     ********************************************************************************/
-
-    /**
-     * Form to all editing and viewing of LDAP Configuration values in the user interface.
-     */
-    class LDAPConfigurationForm extends ConfigurationForm
-    {
-        public $host;
-        public $port = 389;
-        public $bindRegisteredDomain;
-        public $bindPassword;
-        public $baseDomain;		
-        public $testConnection;
-        public $enabled;
-		
-        public function rules()
-        {
-            return array(
-                array('host',                              'required'),
-                array('host',                              'type',      'type' => 'string'),
-                array('host',                              'length',    'min'  => 1, 'max' => 64),
-                array('port',                              'required'),
-                array('port',                              'type',      'type' => 'integer'),
-                array('port',                              'numerical', 'min'  => 1),
-                array('bindRegisteredDomain',              'required'),
-                array('bindRegisteredDomain',              'type',      'type' => 'string'),
-                array('bindRegisteredDomain',              'length',    'min'  => 1, 'max' => 64),
-                array('bindPassword',                      'required'),
-                array('bindPassword',                      'type',      'type' => 'string'),
-                array('bindPassword',                      'length',    'min'  => 1, 'max' => 64),
-                array('baseDomain',                        'required'),
-                array('baseDomain',                        'type',      'type' => 'string'),
-                array('baseDomain',                        'length',    'min'  => 1, 'max' => 64),
-                array('enabled',                           'boolean'),
-            );
-        }
-
-        public function attributeLabels()
-        {
-            return array(
-                'host'                                 => Yii::t('Default', 'Host'),
-                'port'                                 => Yii::t('Default', 'Port'),
-                'bindRegisteredDomain'                 => Yii::t('Default', 'Username'),
-                'bindPassword'                         => Yii::t('Default', 'Password'),
-                'baseDomain'                           => Yii::t('Default', 'Base Domain'),
-                'enabled'                              => Yii::t('Default', 'Turn On LDAP')
-            );
-        }
-    }
-?>

File app/protected/modules/zurmo/forms/ldap/LdapConfigurationForm.php

+<?php
+    /*********************************************************************************
+     * Zurmo is a customer relationship management program developed by
+     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
+     *
+     * Zurmo is free software; you can redistribute it and/or modify it under
+     * the terms of the GNU General Public License version 3 as published by the
+     * Free Software Foundation with the addition of the following permission added
+     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
+     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
+     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
+     *
+     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
+     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+     * details.
+     *
+     * You should have received a copy of the GNU General Public License along with
+     * this program; if not, see http://www.gnu.org/licenses or write to the Free
+     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+     * 02110-1301 USA.
+     *
+     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
+     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
+     ********************************************************************************/
+
+    /**
+     * Form to all editing and viewing of Ldap Configuration values in the user interface.
+     */
+    class LdapConfigurationForm extends ConfigurationForm
+    {
+        public $host;
+        public $port = 389;
+        public $bindRegisteredDomain;
+        public $bindPassword;
+        public $baseDomain;		
+        public $testConnection;
+        public $enabled;
+		
+        public function rules()
+        {
+            return array(
+                array('host',                              'required'),
+                array('host',                              'type',      'type' => 'string'),
+                array('host',                              'length',    'min'  => 1, 'max' => 64),
+                array('port',                              'required'),
+                array('port',                              'type',      'type' => 'integer'),
+                array('port',                              'numerical', 'min'  => 1),
+                array('bindRegisteredDomain',              'required'),
+                array('bindRegisteredDomain',              'type',      'type' => 'string'),
+                array('bindRegisteredDomain',              'length',    'min'  => 1, 'max' => 64),
+                array('bindPassword',                      'required'),
+                array('bindPassword',                      'type',      'type' => 'string'),
+                array('bindPassword',                      'length',    'min'  => 1, 'max' => 64),
+                array('baseDomain',                        'required'),
+                array('baseDomain',                        'type',      'type' => 'string'),
+                array('baseDomain',                        'length',    'min'  => 1, 'max' => 64),
+                array('enabled',                           'boolean'),
+            );
+        }
+
+        public function attributeLabels()
+        {
+            return array(
+                'host'                                 => Yii::t('Default', 'Host'),
+                'port'                                 => Yii::t('Default', 'Port'),
+                'bindRegisteredDomain'                 => Yii::t('Default', 'Username'),
+                'bindPassword'                         => Yii::t('Default', 'Password'),
+                'baseDomain'                           => Yii::t('Default', 'Base Domain'),
+                'enabled'                              => Yii::t('Default', 'Turn On Ldap')
+            );
+        }
+    }
+?>

File app/protected/modules/zurmo/tests/unit/ZurmoTestHelper.php

             return $file;
         }
         
-        public static function isAuthenticationLDAPTestConfigurationSet()
+        public static function isAuthenticationLdapTestConfigurationSet()
         {
-            $isAuthenticationLDAPTestConfigurationSet = false;
+            $isAuthenticationLdapTestConfigurationSet = false;
 
             if (isset(Yii::app()->params['authenticationTestSettings']))
             {
                     $ldapBindPassword != '' && $ldapBaseDomain != '' 
                 )
                 {
-                    $isAuthenticationLDAPTestConfigurationSet = true;
+                    $isAuthenticationLdapTestConfigurationSet = true;
                 }
             }
-            return $isAuthenticationLDAPTestConfigurationSet;
+            return $isAuthenticationLdapTestConfigurationSet;
         }
     }
 ?>

File app/protected/modules/zurmo/tests/unit/walkthrough/LDAPConfigurationSuperUserWalkthroughTest.php

-<?php
-    /*********************************************************************************
-     * Zurmo is a customer relationship management program developed by
-     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
-     *
-     * Zurmo is free software; you can redistribute it and/or modify it under
-     * the terms of the GNU General Public License version 3 as published by the
-     * Free Software Foundation with the addition of the following permission added
-     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
-     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
-     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
-     *
-     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
-     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-     * details.
-     *
-     * You should have received a copy of the GNU General Public License along with
-     * this program; if not, see http://www.gnu.org/licenses or write to the Free
-     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-     * 02110-1301 USA.
-     *
-     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
-     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
-     ********************************************************************************/
-
-    /**
-     * Testing the views for configuring LDAP server
-     */
-    class LDAPConfigurationSuperUserWalkthroughTest extends ZurmoWalkthroughBaseTest
-    {
-        public static function setUpBeforeClass()
-        {
-            parent::setUpBeforeClass();
-            SecurityTestHelper::createSuperAdmin();
-            $super = User::getByUsername('super');
-            Yii::app()->user->userModel = $super;
-        }
-
-        public function testSuperUserAllDefaultControllerActions()
-        {
-            $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
-            $this->runControllerWithNoExceptionsAndGetContent('zurmo/ldap/configurationEditLDAP');
-        }
-        
-
-        public function testSuperUserModifyLDAPConfiguration()
-        {
-            if (!ZurmoTestHelper::isAuthenticationLDAPTestConfigurationSet())
-            {
-                $this->markTestSkipped(Yii::t('Default', 'Test LDAP settings are not configured in perInstanceTest.php file.'));
-            } 
-            $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');           
-            //Change LDAP settings            
-            $this->resetGetArray();
-            $this->setPostArray(array('LDAPConfigurationForm' => array(
-                                      'host'                  =>
-                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapHost'],
-                                      'port'                  => 
-                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapPort'],
-                                      'bindRegisteredDomain'  => 
-                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindRegisteredDomain'],
-                                      'bindPassword'          => 
-                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindPassword'],
-                                      'baseDomain'            => 
-                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBaseDomain'],
-                                      'enabled'               => 
-                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapEnabled'])));
-            $this->runControllerWithRedirectExceptionAndGetContent('zurmo/ldap/configurationEditLDAP');
-            $this->assertEquals('LDAP Configuration saved successfully.', Yii::app()->user->getFlash('notification'));
-
-            //Confirm the setting did in fact change correctly
-            $authenticationHelper = new ZurmoAuthenticationHelper;
-            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapHost'],                  
-                                Yii::app()->authenticationHelper->ldapHost);
-            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapPort'],
-                                Yii::app()->authenticationHelper->ldapPort);
-            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindRegisteredDomain'],  
-                                Yii::app()->authenticationHelper->ldapBindRegisteredDomain);
-            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindPassword'],          
-                                Yii::app()->authenticationHelper->ldapBindPassword);
-            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBaseDomain'],            
-                                Yii::app()->authenticationHelper->ldapBaseDomain);
-            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapEnabled'],
-                                Yii::app()->authenticationHelper->ldapEnabled);
-        }
-        
-        /*
-        *@depends testSuperUserModifyLDAPConfiguration 
-        */
-        public function testSuperUserTestLDAPConnection()
-        {
-            if (!ZurmoTestHelper::isAuthenticationLDAPTestConfigurationSet())
-            {
-                $this->markTestSkipped(Yii::t('Default', 'Test LDAP settings are not configured in perInstanceTest.php file.'));
-            } 
-            $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
-            //check LDAP connection         
-            $this->resetGetArray();
-            $this->setPostArray(array('LDAPConfigurationForm' => array(
-                                      'host'                              => Yii::app()->authenticationHelper->ldapHost,
-                                      'port'                              => Yii::app()->authenticationHelper->ldapPort,
-                                      'bindRegisteredDomain'              => Yii::app()->authenticationHelper->ldapBindRegisteredDomain,
-                                      'bindPassword'                      => Yii::app()->authenticationHelper->ldapBindPassword,
-                                      'baseDomain'                        => Yii::app()->authenticationHelper->ldapBaseDomain,
-                                      'enabled'                           => Yii::app()->authenticationHelper->ldapEnabled)));
-            $content = $this->runControllerWithNoExceptionsAndGetContent('zurmo/ldap/testConnection');            
-            $this->assertTrue(strpos($content, "Successfully Connected to LDAP Server") > 0);                  
-        }
-    }
-?>

File app/protected/modules/zurmo/tests/unit/walkthrough/LdapConfigurationSuperUserWalkthroughTest.php

+<?php
+    /*********************************************************************************
+     * Zurmo is a customer relationship management program developed by
+     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
+     *
+     * Zurmo is free software; you can redistribute it and/or modify it under
+     * the terms of the GNU General Public License version 3 as published by the
+     * Free Software Foundation with the addition of the following permission added
+     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
+     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
+     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
+     *
+     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
+     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+     * details.
+     *
+     * You should have received a copy of the GNU General Public License along with
+     * this program; if not, see http://www.gnu.org/licenses or write to the Free
+     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+     * 02110-1301 USA.
+     *
+     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207,
+     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
+     ********************************************************************************/
+
+    /**
+     * Testing the views for configuring Ldap server
+     */
+    class LdapConfigurationSuperUserWalkthroughTest extends ZurmoWalkthroughBaseTest
+    {
+        public static function setUpBeforeClass()
+        {
+            parent::setUpBeforeClass();
+            SecurityTestHelper::createSuperAdmin();
+            $super = User::getByUsername('super');
+            Yii::app()->user->userModel = $super;
+        }
+
+        public function testSuperUserAllDefaultControllerActions()
+        {
+            $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
+            $this->runControllerWithNoExceptionsAndGetContent('zurmo/ldap/configurationEditLdap');
+        }
+        
+
+        public function testSuperUserModifyLdapConfiguration()
+        {
+            if (!ZurmoTestHelper::isAuthenticationLdapTestConfigurationSet())
+            {
+                $this->markTestSkipped(Yii::t('Default', 'Test Ldap settings are not configured in perInstanceTest.php file.'));
+            } 
+            $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');           
+            //Change Ldap settings            
+            $this->resetGetArray();
+            $this->setPostArray(array('LdapConfigurationForm' => array(
+                                      'host'                  =>
+                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapHost'],
+                                      'port'                  => 
+                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapPort'],
+                                      'bindRegisteredDomain'  => 
+                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindRegisteredDomain'],
+                                      'bindPassword'          => 
+                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindPassword'],
+                                      'baseDomain'            => 
+                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBaseDomain'],
+                                      'enabled'               => 
+                                      Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapEnabled'])));
+            $this->runControllerWithRedirectExceptionAndGetContent('zurmo/ldap/configurationEditLdap');
+            $this->assertEquals('Ldap Configuration saved successfully.', Yii::app()->user->getFlash('notification'));
+
+            //Confirm the setting did in fact change correctly
+            $authenticationHelper = new ZurmoAuthenticationHelper;
+            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapHost'],                  
+                                Yii::app()->authenticationHelper->ldapHost);
+            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapPort'],
+                                Yii::app()->authenticationHelper->ldapPort);
+            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindRegisteredDomain'],  
+                                Yii::app()->authenticationHelper->ldapBindRegisteredDomain);
+            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBindPassword'],          
+                                Yii::app()->authenticationHelper->ldapBindPassword);
+            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapBaseDomain'],            
+                                Yii::app()->authenticationHelper->ldapBaseDomain);
+            $this->assertEquals(Yii::app()->params['authenticationTestSettings']['ldapSettings']['ldapEnabled'],
+                                Yii::app()->authenticationHelper->ldapEnabled);
+        }
+        
+        /*
+        *@depends testSuperUserModifyLdapConfiguration 
+        */