$name, 'URL' => get_admin_plugin_menu_link(LCAS_PATH.'/admin/LCAS_admin.php') ) ); return $menu; } // Check users identification add_event_handler('init', 'LCAS_InitPage'); function LCAS_InitPage() { global $conf; $conf_LCAS= unserialize($conf['LoginCaseAccentsSensitivity']); /* User identification */ if (script_basename() == 'identification') { if (isset($_POST['username'])) { /* Username is case insensitive only */ if (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'true' and isset($conf_LCAS[1]) and $conf_LCAS[1] == 'false') { $new_username = LCAS_SearchCaseUsername($_POST['username'],1); $_POST['username'] = $new_username == '' ? $_POST['username'] : $new_username; } /* Username is accent insensitive only */ if (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'false' and isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true') { $new_username = LCAS_SearchCaseUsername($_POST['username'],2); $_POST['username'] = $new_username == '' ? $_POST['username'] : $new_username; } //* Username is accent and case insensitive */ if (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'true' and isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true') { $new_username = LCAS_SearchCaseUsername($_POST['username'],3); $_POST['username'] = $new_username == '' ? $_POST['username'] : $new_username; } } } } // Check users registration add_event_handler('register_user_check', 'LCAS_RegistrationCheck'); function LCAS_RegistrationCheck($errors) { global $conf, $lang; $conf_LCAS= unserialize($conf['LoginCaseAccentsSensitivity']); load_language('plugin.lang', LCAS_PATH); /* Username is accent and case insensitive */ if (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'true' and $conf['insensitive_case_logon'] == true and isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true') { $NewPostLogin = LCAS_SearchCaseUsername($_POST['login'],3); } /* Username is accent insensitive only */ elseif (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'false' and $conf['insensitive_case_logon'] == false and isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true') { $NewPostLogin = LCAS_SearchCaseUsername($_POST['login'],2); } /* Username is case insensitive only is already controled by Piwigo with $conf['insensitive_case_logon'] == true */ if (isset($NewPostLogin) and get_userid($NewPostLogin)) { $lang['reg_err_login5'] = $lang['reg_err_login5'].l10n('LCAS_accent_error'); array_push($errors, $lang['reg_err_login5']); } return $errors; } ?>