コード例 #1
0
 /**
  * Validates user login - required for linking new users
  *
  * @param string $login
  */
 function validateUsersLogin($login)
 {
     if (empty($login)) {
         $this->addValidationError($GLOBALS['strInvalidUsername']);
     } elseif (OA_Permission::userNameExists($login)) {
         $this->addValidationError($GLOBALS['strDuplicateClientName']);
     }
 }
コード例 #2
0
ファイル: Permission.php プロジェクト: villos/tree_admin
 /**
  * Checks if username is still available and if
  * it is allowed to use.
  *
  * @static
  * @param string $newName  User name to check
  * @param string $oldName  When the method check if user name is available it
  *                         could takes into account existing user name. So
  *                         the same username as existing username is allowed
  * @return boolean  True if allowed
  */
 function isUsernameAllowed($newName, $oldName = null)
 {
     if (!empty($oldName) && !strcasecmp($oldName, $newName)) {
         return true;
     }
     return !OA_Permission::userNameExists($newName);
 }