mango r132 - in trunk: . lib



Author: ovitters
Date: Tue Mar  4 20:09:26 2008
New Revision: 132
URL: http://svn.gnome.org/viewvc/mango?rev=132&view=rev

Log:
	* lib/user.php: Don't validate uid again for users existing in LDAP.



Modified:
   trunk/ChangeLog
   trunk/lib/user.php

Modified: trunk/lib/user.php
==============================================================================
--- trunk/lib/user.php	(original)
+++ trunk/lib/user.php	Tue Mar  4 20:09:26 2008
@@ -20,6 +20,7 @@
 	function User() {
 		$this->authorizedKeys = array();
 		$this->groups = array();
+                $this->uid_from_ldap = false;
 		$this->pubkeyauthenticationuser = false;
 	}
 
@@ -185,6 +186,8 @@
 			$groups[] = $entries[$i]['cn'][0];
 		}
 		$user->groups = $groups;
+
+                $user->uid_from_ldap = true;
 		
 		// Tidy up		
 
@@ -442,7 +445,8 @@
 	
 	function validate() {
 		$errors = array();
-		if(empty($this->uid) || !preg_match("/^[a-z]{1,12}$/", $this->uid)) {
+                if($user->uid_from_ldap empty($this->uid)
+                   || (!$user->uid_from_ldap && !preg_match("/^[a-z]{1,12}$/", $this->uid))) {
 			$errors[] = "uid";
 		}
 		if(empty($this->cn))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]