Changeset 1438
- Timestamp:
- 01/21/10 15:31:55 (2 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 6 modified
-
CHANGELOG (modified) (1 diff)
-
wifidog/classes/Authenticator.php (modified) (1 diff)
-
wifidog/classes/Mail.php (modified) (1 diff)
-
wifidog/classes/Network.php (modified) (1 diff)
-
wifidog/classes/Role.php (modified) (1 diff)
-
wifidog/classes/User.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/CHANGELOG
r1436 r1438 1 1 # $Id$ 2 2 3 2009-12-17 3 2010-01-21 Geneviève Bastien <gbastien@versatic.net> 4 * Permission error when deleting user role (#689) 5 * Patch by Steven Kurylo to remove white spaces from authenticator arguments (#612) 6 * Search for stakeholders has now same case-sensitivity as the user's network (#662) 7 * Corrected (#613) patch by Hélène Gauthier 8 9 2009-12-17 Geneviève Bastien <gbastien@versatic.net> 4 10 * Code refactoring: Network, NodeGroup, Node inherit from HotspotGraphElement (#677) 5 11 6 2009-12-08 12 2009-12-08 Geneviève Bastien <gbastien@versatic.net> 7 13 * Added the concept of node group and hierarchy (in a not too clean way to start with, I will refactor the code before adding new functionalities to nodes and groups) (#246) 8 14 * Login and signup and logout script now receive the mac address as parameter (#675) -
trunk/wifidog-auth/wifidog/classes/Authenticator.php
r1419 r1438 147 147 148 148 foreach ($network_array as $network) { 149 if ($network->getName() == $default_network )149 if ($network->getName() == $default_network->getName()) 150 150 $default_network_param = $network->getId(); 151 151 } -
trunk/wifidog-auth/wifidog/classes/Mail.php
r1424 r1438 368 368 */ 369 369 public function send() { 370 $phpmailerPath = 'lib/PHPMailer_v2.0.0/'; 370 $dir = new DirectoryIterator('lib'); 371 foreach ($dir as $fileinfo) { 372 if ($fileinfo->isDir() && (substr($fileinfo->getFilename(), 0, 9) == 'PHPMailer')) { 373 $phpmailerPath = 'lib/' . $fileinfo->getFilename() . '/'; 374 } 375 } 371 376 require_once ($phpmailerPath.'class.phpmailer.php'); 372 377 require_once ($phpmailerPath.'class.smtp.php'); -
trunk/wifidog-auth/wifidog/classes/Network.php
r1436 r1438 688 688 } 689 689 } 690 $params = array_map('trim',$params); 690 691 return call_user_func_array(array (new ReflectionClass($this->_row['network_authenticator_class']), 'newInstance'), $params); 691 692 -
trunk/wifidog-auth/wifidog/classes/Role.php
r1421 r1438 485 485 486 486 $retval = false; 487 if (Security::hasPermission( 'SERVER_PERM_EDIT_ROLES', Server::getServer())) {487 if (Security::hasPermission(Permission::P('SERVER_PERM_EDIT_ROLES'), Server::getServer())) { 488 488 $db = AbstractDb::getObject(); 489 489 $id = $db->escapeString($this->getId()); -
trunk/wifidog-auth/wifidog/classes/User.php
r1435 r1438 172 172 return $object; 173 173 } 174 175 /** Instantiate a user object 176 * @param $username The username of the user 177 * @param $account_origin Network: The account origin 178 * @param &$errMsg An error message will be appended to this if the username is not empty, but the user doesn't exist. 179 * @return a User object, or null if there was an error 180 */ 181 public static function getUserByUsernameOrEmailAndOrigin($usernameOrEmail, Network $account_origin, &$errMsg = null) { 182 $db = AbstractDb::getObject(); 183 $object = null; 184 185 $username_str = $db->escapeString($usernameOrEmail); 186 $comparison = ($account_origin->getUsernamesCaseSensitive()? '=': 'ILike'); 187 $account_origin_str = $db->escapeString($account_origin->getId()); 188 $db->execSqlUniqueRes("SELECT user_id FROM users WHERE (username {$comparison} '$username_str' OR email ILike '$username_str') AND account_origin = '$account_origin_str'", $user_info, false); 189 190 if ($user_info != null) { 191 $object = self::getObject($user_info['user_id']); 192 } 193 else if (!empty($usernameOrEmail)) { 194 $errMsg .= sprintf(_("There is no user with username or email %s"),$usernameOrEmail); 195 } 196 return $object; 197 } 174 198 175 199 /** Instantiate a user object … … 857 881 if (!empty ($_REQUEST[$name])) { 858 882 $username = $_REQUEST[$name]; 859 return self :: getUserByUsernameOrEmail ($username, $errMsg);883 return self :: getUserByUsernameOrEmailAndOrigin($username, $network, $errMsg); 860 884 } else 861 885 return null;
