Beispiel #1
0
        case 'change_password':
            if (isset($_POST['new_password'])) {
                $new_password = mysql_real_escape_string(trim($_POST['new_password']));
                if (empty($new_password)) {
                    break;
                }
                $success = user_change_password($new_password);
            }
            break;
        case 'change_email':
            if (isset($_POST['new_email'])) {
                $new_email = mysql_real_escape_string(trim($_POST['new_email']));
                if (empty($new_email)) {
                    break;
                }
                $success = user_change_email($new_email);
            }
            break;
        default:
            break;
    }
    if ($success) {
        echo 'success';
    } else {
        echo 'failed';
    }
    exit;
}
?>

<!DOCTYPE html>
Beispiel #2
0
        log_timing();
        exit;
    case 'reg_done':
        $reg_status = user_register($_POST);
        if ($reg_status == 1) {
            header("Location:index.php");
            exit;
        } else {
            $smarty->assign('reg_status', $reg_status);
        }
        break;
    case 'change_pw':
        $smarty->assign('change_status', user_change_password($_POST));
        break;
    case 'change_email':
        $smarty->assign('change_status', user_change_email($_POST));
        break;
    case 'generate_passwd':
        $smarty->assign('gen_status', user_generate_password($_POST['email']));
        break;
    case 'change_name':
        $smarty->assign('change_status', user_change_shown_name($_POST['shown_name']));
        break;
}
log_timing();
if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'login.php') === false && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) !== false) {
    $_SESSION['return_to'] = $_SERVER['HTTP_REFERER'];
} else {
    $_SESSION['return_to'] = 'index.php';
}
$smarty->assign('action', $action);
Beispiel #3
0
require_once "../common.inc";
# $Id: changeemail.php,v 1.13 2006/03/06 19:09:56 frabcus Exp $
# The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd
# This is free software, and you are welcome to redistribute it under
# certain conditions.  However, it comes with ABSOLUTELY NO WARRANTY.
# For details see the file LICENSE.html in the top level of the source.
require_once "../database.inc";
require_once "user.inc";
$password1 = mysql_real_escape_string($_POST["password1"]);
$new_email = mysql_real_escape_string($_POST["new_email"]);
$change_user_name = mysql_real_escape_string($_POST["change_user_name"]);
$submit = mysql_real_escape_string($_POST["submit"]);
$ok = false;
if ($submit) {
    $ok = user_change_email($password1, $new_email, $change_user_name);
}
$title = "Change email address";
pw_header();
if ($feedback) {
    if ($ok) {
        echo "<p>{$feedback}</p>";
    } else {
        echo "<div class=\"error\"><h2>Email address not changed</h2><p>{$feedback}</div>";
    }
}
if (!$ok) {
    echo ' <P>
    Fill in the information below, and we\'ll send you
    an email for you to confirm your new address. You will be signed
    up for the newsletter at your new address.