Exemplo n.º 1
0
        exit;
    }
    if (!$user->update()) {
        if (!$user->name) {
            $error .= "The name '{$name}' is taken\n";
        } else {
            if (!$user->shortname) {
                $error .= "The name '{$name}' is too similar to a name already taken\n";
            }
        }
    } else {
        $tpl->set_var("NAME", $name);
    }
}
if (isset($update_email) && empty($error)) {
    $email_tid = $user->verify_email($update_email);
    if (!$email_tid) {
        $error .= "The email address '{$update_email}' is already used by another account\n";
    }
}
if (empty($error)) {
    if (($user->status == 'Suspended' || $user->status == 'Deleted') && (isset($user->update['name']) || isset($update_email))) {
        echo "You are suspended or deleted and not allowed to change your screen name or email address\n";
        exit;
    }
    if (!isset($user->update['name'])) {
        $tpl->set_var("name", "");
    }
    if (!isset($user->update['password'])) {
        $tpl->set_var("password", "");
    }