PerchUtil::redirect(PERCH_LOGINPATH . '/core/apps/content/'); } $Perch->page_title = $new_user_mode ? PerchLang::get('Create your password') : PerchLang::get('Reset your password'); if (PerchUtil::get('token')) { $mode = 'enter_token'; $Users = new PerchUsers(); $User = $Users->get_by_password_recovery_token(PerchUtil::get('token')); if (!$User) { $mode = 'token_expired'; } else { if (PerchUtil::post('username') && PerchUtil::post('new_password')) { if (PerchUtil::post('username') == $User->userUsername()) { PerchUtil::debug('Username matches'); if (PerchUtil::post('new_password') == PerchUtil::post('new_password2')) { if ($User->password_meets_requirements(PerchUtil::post('new_password'))) { $User->set_new_password(PerchUtil::post('new_password')); $mode = 'password_set'; } else { PerchUtil::debug($User->msg, 'notice'); $error = 'weak_password'; } } else { $error = 'non_matching_passwords'; } } else { $error = 'non_matching_username'; } } } } if (isset($_POST['reset']) && $_POST['reset'] == '1' && isset($_POST['email']) && $_POST['email'] != '') {
public function handle_empty_block_generation($Template) { if (PerchUtil::post('add-block')) { echo PerchContent_Util::get_empty_block(null, PerchUtil::post('add-block'), (int) PerchUtil::post('count'), false, $Template, $this); exit; } }