'A', 'à' => 'À', 'â' => 'Â', 'á' => 'Á', 'ã' => 'Ã', 'ä' => 'Ä', 'å' => 'Å', 'a' => 'A', 'a' => 'A', 'a' => 'A', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', 'b' => 'B', 'c' => 'C', 'ç' => 'Ç', 'c' => 'C', 'c' => 'C', 'c' => 'C', 'c' => 'C', 'd' => 'D', 'd' => 'D', 'd' => 'Ð', 'e' => 'E', 'è' => 'È', 'é' => 'É', 'ê' => 'Ê', 'ë' => 'Ë', 'e' => 'E', 'e' => 'E', 'e' => 'E', 'e' => 'E', 'e' => 'E', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', 'f' => 'F ƒ', 'g' => 'G', 'g' => 'G', 'g' => 'G', 'g' => 'G', 'g' => 'G', 'h' => 'H', 'h' => 'H', 'h' => 'H', 'i' => 'I i I', 'ì' => 'Ì', 'í' => 'Í', 'î' => 'Î', 'ï' => 'Ï', 'i' => 'I', 'i' => 'I', 'i' => 'I', 'i' => 'I', 'i' => 'I', '?' => '?', '?' => '?', 'j' => 'J', 'j' => 'J', 'k' => 'K', 'k' => 'K', 'l' => 'L', 'l' => 'L', 'l' => 'L', 'l' => 'L', '?' => '?', 'l' => 'L', 'm' => 'M', 'n' => 'N', 'ñ' => 'Ñ', 'n' => 'N', 'n' => 'N', 'n' => 'N', 'o' => 'O', 'ò' => 'Ò', 'ó' => 'Ó', 'ô' => 'Ô', 'õ' => 'Õ', 'ö' => 'Ö', 'ø' => 'Ø', 'o' => 'O', 'o' => 'O', 'o' => 'O', 'o' => 'O', 'o' => 'O', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', 'p' => 'P', 'q' => 'Q ?', 'r' => 'R', 'r' => 'R', 'r' => 'R', 'r' => 'R', 's' => 'S', 's' => 'S', 's' => 'S', 's' => 'S', 'š' => 'Š', 's' => '?', 'ss' => 'ß', 't' => 'T', 't' => 'T', 't' => 'T', 't' => 'T', 'u' => 'U', 'ù' => 'Ù', 'ú' => 'Ú', 'û' => 'Û', 'ü' => 'Ü', 'u' => 'U', 'u' => 'U', 'u' => 'U', 'u' => 'U', 'u' => 'U', 'u' => 'U', 'u' => 'U', 'u' => 'U', 'u' => 'U', 'u' => 'U', 'u' => 'U', 'u' => 'U', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', 'v' => 'V', 'w' => 'W', 'w' => 'W', '?' => '?', '?' => '?', '?' => '?', 'x' => 'X', 'y' => 'Y', 'ý' => 'Ý', 'ÿ' => 'Ÿ', '?' => '?', '?' => '?', '?' => '?', '?' => '?', 'y' => 'Y', 'z' => 'Z', 'z' => 'Z', 'z' => 'Z', 'ž' => 'Ž', 'ae' => 'æ Æ', 'aé' => '? ?', 'ð' => 'Ð', '?' => '?', 'ij' => '? ?', '?' => '?', 'oe' => 'œ Œ', 'þ' => 'Þ', // Greek 'a' => '?', '?' => '?', 'ß' => '?', '?' => 'G', 'd' => '?', 'e' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => 'T', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', 'µ' => '? µ', '?' => '?', '?' => '?', '?' => '?', '?' => '?', 'p' => '?', '?' => '?', 's' => 'S ?', 't' => '?', '?' => '?', '?' => '?', '?' => '?', 'f' => 'F', '?' => '?', '?' => '?', '?' => 'O', '?' => '?', // Cyrillic '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', 'h' => '?', '?' => '?', '?' => '?', ); $LCAS_lang['char_replacement_set'][2] = array( // 2 : case insensitive, accents insensitive // Latin 'a' => 'A à À â  á Á ã à ä Ä å Å a A a A a A ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? @', 'b' => 'B', 'c' => 'C ç Ç c C c C c C c C', 'd' => 'D d D d Ð', 'e' => 'E è È é É ê Ê ë Ë e E e E e E e E e E ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?', 'f' => 'F ƒ', 'g' => 'G g G g G g G g G', 'h' => 'H h H h H', 'i' => 'I i I ì Ì í Í î Î ï Ï i I i I i I i I i I ? ? ? ?', 'j' => 'J j J', 'k' => 'K k K', 'l' => 'L l L l L l L ? ? l L', 'm' => 'M', 'n' => 'N ? ñ Ñ n N n N n N', 'o' => 'O ò Ò ó Ó ô Ô õ Õ ö Ö ø Ø o O o O o O o O o O ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?', 'p' => 'P', 'q' => 'Q ?', 'r' => 'R r R r R r R', 's' => 'S s S s S s S š Š s ?', 'ss' => 'ß', 't' => 'T t T t T t T', 'u' => 'U ù Ù ú Ú û Û ü Ü u U u U u U u U u U u U u U u U u U u U u U u U ? ? ? ? ? ? ? ? ? ? ? ? ? ?', 'v' => 'V', 'w' => 'W w W ? ? ? ? ? ?', 'x' => 'X', 'y' => 'Y ý Ý ÿ Ÿ ? ? ? ? ? ? ? ? y Y', 'z' => 'Z z Z z Z ž Ž', 'ae' => 'æ Æ ? ?', 'ð' => 'Ð', '?' => '?', 'ij' => '? ?', '?' => '?', 'oe' => 'œ Œ', 'þ' => 'Þ', // Greek 'a' => '? ? ?', 'ß' => '?', '?' => 'G', 'd' => '?', 'e' => '? ? ?', '?' => '?', '?' => '? ? ?', '?' => 'T', '?' => '? ? ? ? ? ?', '?' => '?', '?' => '?', 'µ' => '? µ', '?' => '?', '?' => '?', '?' => '? ? ?', 'p' => '?', '?' => '?', 's' => 'S ?', 't' => '?', '?' => '? ? ? ? ? ?', 'f' => 'F', '?' => '?', '?' => '?', '?' => 'O ? ?', // Cyrillic '?' => '?', '?' => '?', '?' => '?', '?' => '? ? ? ? ?', '?' => '?', '?' => '?', '?' => '? ? ?', '?' => '?', '?' => '?', '?' => '?', '?' => '? ? ? ? ?', '?' => '?', '?' => '?', '?' => '? ? ?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '? ? ?', '?' => '?', '?' => '? ? ?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', 'h' => '?', '?' => '?', '?' => '?', ); $LCAS_lang['char_replacement_set'][3] = array( // 3 : case sensitive, accents insensitive // Latin 'a' => 'à â á ã ä å a a a ? ? ? ? ? ? ? ? ? ? ? ? ? @', 'A' => 'À  Á Ã Ä Å A A A ? ? ? ? ? ? ? ? ? ? ? ? ?', 'c' => 'ç c c c c', 'C' => 'Ç C C C C', 'd' => 'd d', 'D' => 'D Ð', 'e' => 'è é ê ë e e e e e ? ? ? ? ? ? ? ?', 'E' => 'È É Ê Ë E E E E E ? ? ? ? ? ? ? ?', 'f' => 'ƒ', 'g' => 'g g g g', 'G' => 'G G G G', 'h' => 'h h', 'H' => 'H H', 'i' => 'ì í î ï i i i i i ? ? i', 'I' => 'Ì Í Î Ï I I I I I ? ? I', 'j' => 'j', 'J' => 'J', 'k' => 'k', 'K' => 'K', 'l' => 'l l l ? l', 'L' => 'L L L ? L', 'n' => 'ñ n n n ?', 'N' => 'Ñ N N N', 'o' => 'ò ó ô õ ö ø o o o o o ? ? ? ? ? ? ? ? ? ? ? ? ?', 'O' => 'Ò Ó Ô Õ Ö Ø O O O O O ? ? ? ? ? ? ? ? ? ? ? ? ?', 'q' => '?', 'r' => 'r r r', 'R' => 'R R R', 's' => 's s s š ?', 'S' => 'S S S Š', 'ss' => 'ß', 't' => 't t t', 'T' => 'T T T', 'u' => 'ù ú û ü u u u u u u u u u u u u ? ? ? ? ? ? ?', 'U' => 'Ù Ú Û Ü U U U U U U U U U U U U ? ? ? ? ? ? ?', 'w' => 'w ? ? ?', 'W' => 'W ? ? ?', 'y' => 'ý ÿ ? ? ? ? y', 'Y' => 'Ý Ÿ ? ? ? ? Y', 'z' => 'z z ž', 'Z' => 'Z Z Ž', 'ae' => '?', 'AE' => '?', 'ij' => '?', 'IJ' => '?', 'oe' => 'œ', 'OE' => 'Œ', // Greek 'a' => '?', '?' => '?', 'e' => '?', '?' => '?', 'µ' => 'µ', '?' => '?', '?' => '?', '?' => '? ? ?', '?' => '? ?', '?' => '?', '?' => '?', 's' => '?', '?' => '? ? ?', '?' => '? ?', '?' => '?', 'O' => '?', // Cyrillic '?' => '? ?', '?' => '? ?', '?' => '?', '?' => '?', '?' => '? ?', '?' => '? ?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', '?' => '?', ); // Exits immediately without changing the parameter, if the configuration // is set on "case sensitive and accent sensitive". if (!isset($Conf) or $Conf != 1 and $Conf != 2 and $Conf != 3 ) return $Username; // $v remembers if the given parameter was an array or not $s2 = ($v = (is_array($Username))) ? $Username : array(0 => $Username); // Builds an array of characters that must be replaced // $rep_char is the replacement character ; $char_rep_arr is an array of // characters which have to be replaced. ie : // if // $LCAS_lang['char_replacement_set'][$conf['insensitive_case_logon']]['e'] ='é è' // then // $char_rep_arr['é'] = 'e' ; $char_rep_arr['è'] = 'e'. $char_rep_arr = array(); foreach ( $LCAS_lang['char_replacement_set'][$Conf] as $rep_char => $char_rep_list ) { $t = explode(' ', $char_rep_list); foreach ($t as $c) $char_rep_arr[$c] = $rep_char; } // Replacement in each string of $s2 of the characters // that needs to be replaced $r = array(); foreach ($s2 as $s) { $t = LCAS_mbStringToArray($s); $t2 =''; foreach ($t as $c) { if (array_key_exists($c, $char_rep_arr)) $t2.= $char_rep_arr[$c]; else $t2.= $c; } $r[] = $t2; } // Return of the result if ($v) return $r; else return $r[0]; } /* Function called from main.inc.php to send validation email */ function LCAS_SendMail2User($typemail, $id, $username, $password, $email, $confirm) { global $conf; $conf_LCAS= unserialize($conf['LoginCaseAccentsSensitivity']); include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); $infos1_perso = ""; $infos2_perso = ""; /* We have to get the user's language in database */ $query =' SELECT user_id, language FROM '.USER_INFOS_TABLE.' WHERE user_id = '.$id.' ;'; $data = pwg_db_fetch_assoc(pwg_query($query)); /* Check if user is already registered (profile changing) - If not (new registration), language is set to current gallery language */ if (empty($data)) { /* And switch gallery to this language before using personalized and multilangual contents */ $language = pwg_get_session_var( 'lang_switch', $user['language'] ); switch_lang_to($language); } else { /* And switch gallery to this language before using personalized and multilangual contents */ $language = $data['language']; /* Usefull for debugging */ switch_lang_to($data['language']); load_language('plugin.lang', LCAS_PATH); } switch($typemail) { case 1: $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Add of %s', stripslashes($username))); $password = $password <> '' ? $password : l10n('LCAS_empty_pwd'); if (isset($conf_LCAS[9]) and $conf_LCAS[9] <> '') { if (function_exists('get_user_language_desc')) { $infos1_perso = get_user_language_desc($conf_LCAS[9])."\n\n"; } else $infos1_perso = l10n($conf_LCAS[9])."\n\n"; } break; case 2: $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', stripslashes($username))); $password = $password <> '' ? $password : l10n('LCAS_empty_pwd'); break; case 3: $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', stripslashes($username))); $password = $password <> '' ? $password : l10n('LCAS_no_update_pwd'); break; } if (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'true') { $infos1 = array( get_l10n_args('infos_mail %s', stripslashes($username)), get_l10n_args('User: %s', stripslashes($username)), get_l10n_args('Password: %s', $password), get_l10n_args('Email: %s', $email), get_l10n_args('', ''), ); } if ( isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true' and $confirm) { $infos2 = array ( get_l10n_args('Link: %s', AddConfirmMail($id, $email)), get_l10n_args('', ''), ); if (isset($conf_LCAS[10]) and $conf_LCAS[10] <> '') { if (function_exists('get_user_language_desc')) { $infos2_perso = get_user_language_desc($conf_LCAS[10])."\n\n"; } else $infos2_perso = l10n($conf_LCAS[10])."\n\n"; } } /* ******************************************************** */ /* **** Pending code since to find how to make it work **** */ /* ******************************************************** */ // Testing if FCK Editor is used. Then decoding htmlchars to avoid problems with pwg_mail() /*$areas = array(); array_push( $areas,'LCAS_MailInfo_Text','LCAS_accentSensitive_Text'); if (function_exists('set_fckeditor_instance')) { $fcke_config = unserialize($conf['FCKEditor']); foreach($areas as $area) { if (isset($fcke_config['LCAS_MailInfo_Text']) and $fcke_config['LCAS_MailInfo_Text'] = true) { $infos1_perso = html_entity_decode($infos1_perso,ENT_QUOTES,UTF-8); } if (isset($fcke_config['LCAS_accentSensitive_Text']) and $fcke_config['LCAS_accentSensitive_Text'] = true) { $infos2_perso = html_entity_decode($infos2_perso,ENT_QUOTES,UTF-8); } } }*/ /* Sending the email with subject and contents */ pwg_mail($email, array( 'subject' => $subject, 'content' => (isset($infos1) ? $infos1_perso.l10n_args($infos1)."\n\n" : "").(isset($infos2) ? $infos2_perso.l10n_args($infos2)."\n\n" : "").get_absolute_root_url(), )); /* ********************** */ /* Email sending debugger */ /* This is only to trace */ /* the send of emails for */ /* debugging */ /* ********************** */ //$content = (isset($infos1) ? $infos1_perso.l10n_args($infos1)."\n\n" : "").(isset($infos2) ? $infos2_perso.l10n_args($infos2)."\n\n" : "").get_absolute_root_url(); //MailLog($email,$subject,$content,$language); /* ********************** */ /* Switching back to default language */ switch_lang_back(); } /* Function called from LCAS_admin.php and main.inc.php to get the plugin version and name */ function LCAS_PluginInfos($dir) { $path = $dir; $plg_data = implode( '', file($path.'main.inc.php') ); if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) ) { $plugin['name'] = trim( $val[1] ); } if (preg_match("|Version: (.*)|", $plg_data, $val)) { $plugin['version'] = trim($val[1]); } if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) ) { $plugin['uri'] = trim($val[1]); } if ($desc = load_language('description.txt', $path.'/', array('return' => true))) { $plugin['description'] = trim($desc); } elseif ( preg_match("|Description: (.*)|", $plg_data, $val) ) { $plugin['description'] = trim($val[1]); } if ( preg_match("|Author: (.*)|", $plg_data, $val) ) { $plugin['author'] = trim($val[1]); } if ( preg_match("|Author URI: (.*)|", $plg_data, $val) ) { $plugin['author uri'] = trim($val[1]); } if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid=')) { list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']); if (is_numeric($extension)) $plugin['extension'] = $extension; } // IMPORTANT SECURITY ! $plugin = array_map('htmlspecialchars', $plugin); return $plugin ; } // Tri les doublons function CompareTransformedUser($a, $b) { return strcmp($a['transformed'], $b['transformed']); } // Fonctionnel mais optimisable function LCAS_GetDuplicates($source) { $users = array(); $duplicates = array(); // Liste des utilisateurs uniques foreach($source as $user) { if (isset($users[$user['transformed']])) { $users[$user['transformed']] += 1; } else { $users[$user['transformed']] = 1; } } // On récupère les doublons foreach($source as $user) { if ($users[$user['transformed']] > 1) { array_push($duplicates, $user); } } // Trier le tableau usort($duplicates, 'CompareTransformedUser'); return $duplicates; } /* Get all users to display the number of days since their last visit */ function LCAS_get_user_list($rule) { global $conf, $page; $users = array(); /* search users depending expiration date */ $query = ' SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id, u.'.$conf['user_fields']['username'].' AS username, u.'.$conf['user_fields']['email'].' AS email FROM '.USERS_TABLE.' AS u ;'; $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) { $user = $row; $user['transformed'] = LCAS_change_case($user['username'], $rule); array_push($users, $user); } return LCAS_GetDuplicates($users); } function LCAS_clean_obsolete_files() { if (file_exists(LCAS_PATH.'obsolete.list') and $old_files = file(LCAS_PATH.'obsolete.list', FILE_IGNORE_NEW_LINES) and !empty($old_files)) { array_push($old_files, 'obsolete.list'); foreach($old_files as $old_file) { $path = LCAS_PATH.$old_file; if (is_file($path)) { @unlink($path); } } } } ?>