Changeset 8643


Ignore:
Timestamp:
01/13/11 10:45:32 (9 years ago)
Author:
LucMorizur
Message:

Small corrections on previous commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/LCAS/trunk/include/functions.inc.php

    r8638 r8643  
    2929 * $conf['insensitive_case_logon'] and $conf['LCAS_replacement_set']. 
    3030 * 
    31  * @param mix s: string, or array of strings, to evaluate 
    32  * 
    33  * @return : string, or array of strings, modified as stated 
     31 * @param mix s: string 
     32 * 
     33 * @return : string modified as stated 
    3434*/ 
    3535function LCAS_change_case($Username, $Opt, $At_login=true) 
     
    283283  { 
    284284        $user = $row; 
    285         $user['transformed'] = LCAS_change_case($user['username'], $rule);  
     285        $user['transformed'] = LCAS_change_case($user['username'], $rule, false);  
    286286    array_push($users, $user); 
    287287        } 
     
    320320 *  
    321321 */ 
    322 function LCAS_SearchCaseUsername($username, $rule) 
     322function LCAS_SearchCaseUsername($username, $rule, $At_login=true) 
    323323{ 
    324324  global $conf; 
    325325 
    326   $username_c = LCAS_change_case($username, $rule); 
     326  $username_c = LCAS_change_case($username, $rule, $At_login); 
    327327 
    328328  if (isset($username)) 
     
    335335    "); 
    336336    while ($r = pwg_db_fetch_assoc($q)) 
    337      $LCAS_users[$r['username']] = LCAS_change_case($r['username'], $rule); 
    338      // $LCAS_users is now an associative table where the key is the account as 
    339      // registered in the DB, and the value is this same account, in lower case 
     337     $LCAS_users[$r['username']] = 
     338      LCAS_change_case($r['username'], $rule, $At_login); 
     339     // $LCAS_users is now an associative table where the key is the account 
     340     // as registered in the DB, and the value is this same account, 
     341     // transformed as stated by $rule. 
    340342 
    341343    $users_found = array_keys($LCAS_users, $username_c); 
    342344    // $users_found is now a table of which the values are all the accounts 
    343     // which can be written in lowercase the same way as $username 
    344     if (count($users_found) != 1) // If ambiguous, don't allow lowercase writing 
    345      return $username;            // but normal writing will work 
     345    // which can be written as stated by $rule the same way as $username can 
     346    if (count($users_found) != 1) // If ambiguous, don't allow transformed 
     347     return $username;            // writing but normal writing will work 
    346348    else 
    347349     return $users_found[0]; 
Note: See TracChangeset for help on using the changeset viewer.