protected function main() { // Il y a bien tous les paramètres nécessaires à l'éxécution du script if (!is_logged_in() && !empty($_GET['idm']) && is_numeric($_GET['idm']) && !empty($_GET['ca'])) { // Fil ariane $this->set_filAriane(Nw::$lang['users']['title_redef_pass']); $this->set_title(Nw::$lang['users']['title_redef_pass']); $this->set_tpl('membres/redefine_mdp.html'); $this->add_css('forms.css'); // Ce code existe bien avec ce code d'activation inc_lib('users/mbr_act_exists'); if (!mbr_act_exists($_GET['idm'], $_GET['ca'])) { redir(Nw::$lang['users']['redef_mdp_echoue'], false, './'); } //Si on redéfinit if (isset($_POST['submit']) && !multi_empty(trim($_POST['nw_pass1']), trim($_POST['nw_pass2']))) { if ($_POST['nw_pass1'] == $_POST['nw_pass2']) { inc_lib('users/chg_password'); chg_password($_POST['nw_pass1'], $_GET['idm'], $_GET['ca']); redir(Nw::$lang['users']['new_redef_pwd'], true, './'); } else { redir(Nw::$lang['users']['sames_password'], false, $_SERVER['REQUEST_URI']); } } } else { header('Location: ./'); } }
protected function main() { if (!is_logged_in()) { redir(Nw::$lang['common']['need_login'], false, 'users-10.html'); } $this->set_title(Nw::$lang['users']['item_mdp']); $this->set_tpl('membres/options_pass.html'); $this->add_css('forms.css'); $this->set_filAriane(array(Nw::$lang['users']['mes_options_title'] => array('users-60.html'), Nw::$lang['users']['item_mdp'] => array(''))); if (isset($_POST['submit']) && !multi_empty(trim($_POST['old']), trim($_POST['nw_pass1']), trim($_POST['nw_pass2']))) { $bf_token = 'jJ_=éZAç1l'; $ft_token = 'ù%*àè1ç0°dezf'; $pass_membre = insertBD(sha1($bf_token . trim($_POST['old']) . $ft_token)); if ($_POST['nw_pass1'] == $_POST['nw_pass2']) { if (Nw::$dn_mbr['u_password'] == $pass_membre) { inc_lib('users/chg_password'); chg_password($_POST['nw_pass1'], Nw::$dn_mbr['u_id']); if (!empty($_COOKIE['nw_pass'])) { $time_expire = time() + 10 * 365 * 24 * 3600; setcookie('nw_ident', Nw::$dn_mbr['u_id'], $time_expire); setcookie('nw_pass', $pass_membre, $time_expire); } redir(Nw::$lang['users']['mdp_change'], true, 'users-60.html'); } else { redir(Nw::$lang['users']['not_root_password'], false, 'users-63.html'); } } else { redir(Nw::$lang['users']['sames_password'], false, 'users-63.html'); } } }