/** * Adds a new user account to the authentication table. * * Returns true on success, otherwise false. * * @param string $login Loginname * @param string $pass Password * @return boolean */ public function add($login, $pass) { $user = new PMF_User(); $result = $user->createUser($login, null); // Update user information from LDAP $user->setUserData(array('display_name' => $this->ldap->getCompleteName($login), 'email' => $this->ldap->getMail($login))); return $result; }
/** * Adds a new user account to the authentication table. * Returns true on success, otherwise false. * * @param string $login Login name * @param string $pass Password * * @return boolean */ public function add($login, $pass) { $user = new PMF_User(); $user->setLoginMinLength(2); // LDAP user names can be very short! $result = $user->createUser($login, null); $user->setStatus('active'); // Update user information from LDAP $user->setUserData(array('display_name' => $this->ldap->getCompleteName($login), 'email' => $this->ldap->getMail($login))); return $result; }
/** * Adds a new user account to the authentication table. * Returns true on success, otherwise false. * * @param string $login Login name * @param string $pass Password * * @return boolean */ public function add($login, $pass) { $user = new PMF_User($this->_config); $result = $user->createUser($login, null); $this->ldap->connect($this->ldapServer[$this->activeServer]['ldap_server'], $this->ldapServer[$this->activeServer]['ldap_port'], $this->ldapServer[$this->activeServer]['ldap_base'], $this->ldapServer[$this->activeServer]['ldap_user'], $this->ldapServer[$this->activeServer]['ldap_password']); if ($this->ldap->error) { $this->errors[] = $this->ldap->error; } $user->setStatus('active'); // Update user information from LDAP $user->setUserData(array('display_name' => $this->ldap->getCompleteName($login), 'email' => $this->ldap->getMail($login))); return $result; }