Changeset 8207
- Timestamp:
- Dec 21, 2010, 12:55:53 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/LCAS/trunk/include/functions.inc.php
r8206 r8207 354 354 ); 355 355 356 $LCAS_lang['char_replacement_set'][ 2] = array(357 // 2: case insensitive, accents insensitive356 $LCAS_lang['char_replacement_set'][3] = array( 357 // 3 : case insensitive, accents insensitive 358 358 359 359 // Latin … … 477 477 ); 478 478 479 $LCAS_lang['char_replacement_set'][ 3] = array(480 // 3: case sensitive, accents insensitive479 $LCAS_lang['char_replacement_set'][2] = array( 480 // 2 : case sensitive, accents insensitive 481 481 482 482 // Latin … … 864 864 global $conf; 865 865 866 $u_d1 = $username; 866 867 $username = LCAS_change_case($username, $rule); 868 $u_d2 = $username; 867 869 868 870 if (isset($username)) 869 { 871 { /* 870 872 $query = " 871 873 SELECT ".$conf['user_fields']['username']." … … 874 876 LIMIT 1;"; 875 877 876 list($username) = pwg_db_fetch_row(pwg_query($query)); 878 list($username) = pwg_db_fetch_row(pwg_query($query)); */ 879 880 $LCAS_users = array(); 881 $q = pwg_query(" 882 SELECT ".$conf['user_fields']['username']." AS username 883 FROM `".USERS_TABLE."`; 884 "); 885 while ($r = pwg_db_fetch_assoc($q)) 886 $LCAS_users[$r['username']] = LCAS_change_case($r['username'], $rule); 887 // $LCAS_users est maintenant un tableau associatif où la clé est le compte tel qu'enregistré en DB, 888 // et la valeur est ce même compte, écrit selon LCAS_change_case() pour la règle en cours 889 890 $user_found = array_search($username, $LCAS_users); 891 // $user_found vaut false si le username actuellement testé ne fait pas partie des valeurs de $LCAS_users ; 892 // sinon $user_found vaut la clé dans $LCAS_users, correspondant au compte trouvé. 893 // Donc le compte tel qu'écrit en DB, mais reconnu tel qu'écrit selon LCAS_change_case() pour la règle en cours 894 895 $username = ($user_found === false) ? $username : $user_found; 896 897 898 $fo=fopen (LCAS_PATH."admin/debuglog.txt","a") ; 899 fwrite($fo,"======================LG\r\n") ; 900 fwrite($fo,"u_d1 : ".$u_d1. "\r\n") ; 901 fwrite($fo,"u_d2 : ".$u_d2. "\r\n") ; 902 fwrite($fo,str_from_var3($LCAS_users). "\r\n") ; 903 fwrite($fo,"user_found : ".$user_found. "\r\n") ; 904 fwrite($fo,"username : ".$username. "\r\n") ; 905 fwrite($fo,"rule : ".$rule. "\r\n") ; 906 fclose($fo) ; 877 907 878 908 return isset($username) ? $username : ''; … … 880 910 } 881 911 912 913 /* 914 * str_from_var3($var) 915 * returns a string easing array var informations displaying in Piwigo : 916 * _ the string return value starts with"<p style = "text-align:left;">" ; 917 * _ all "TAB" characters (chr(10)) are replaced by "<br>" ; 918 * _ all spaces are replaced by " ". 919 * 920 * @param 921 * $var : variable to display 922 * @return 923 * string easy to display in Piwigo 924 */ 925 function str_from_var3($var) { 926 return 927 '<p style = "text-align:left;">'. 928 str_replace( 929 chr(10),'<br>', 930 str_replace(' ',' ', print_r /* var_dump */ ($var,true)) 931 ). 932 '</p>'; 933 } 882 934 883 935 // DebugLog function
Note: See TracChangeset
for help on using the changeset viewer.