From 925b0ba2e56117e3bbe2947d7938ed35815efa1a Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 16 Aug 2014 13:59:37 -0700 Subject: Authentication backends refactoring --- app/Model/Ldap.php | 104 ----------------------------------------------------- 1 file changed, 104 deletions(-) delete mode 100644 app/Model/Ldap.php (limited to 'app/Model/Ldap.php') diff --git a/app/Model/Ldap.php b/app/Model/Ldap.php deleted file mode 100644 index 007f7171..00000000 --- a/app/Model/Ldap.php +++ /dev/null @@ -1,104 +0,0 @@ -create($username, $info[0][LDAP_ACCOUNT_FULLNAME][0], $info[0][LDAP_ACCOUNT_EMAIL][0]); - } - - return false; - } - - /** - * Create automatically a new local user after the LDAP authentication - * - * @access public - * @param string $username Username - * @param string $name Name of the user - * @param string $email Email address - * @return bool - */ - public function create($username, $name, $email) - { - $user = $this->user->getByUsername($username); - - // There is an existing user account - if ($user) { - - if ($user['is_ldap_user'] == 1) { - - // LDAP user already created - return true; - } - else { - - // There is already a local user with that username - return false; - } - } - - // Create a LDAP user - $values = array( - 'username' => $username, - 'name' => $name, - 'email' => $email, - 'is_admin' => 0, - 'is_ldap_user' => 1, - ); - - return $userModel->create($values); - } -} -- cgit v1.2.3