Exemple #1
0
include LOCALE . LOCALESET . "user_fields.php";
include THEMES . "templates/global/profile.php";
if (!iMEMBER) {
    redirect("index.php");
}
$_GET['profiles'] = isset($_GET['profiles']) && isnum($_GET['profiles']) ? $_GET['profiles'] : 1;
add_to_title($locale['global_200'] . $locale['u102']);
$errors = array();
$_GET['profiles'] = isset($_GET['profiles']) && isnum($_GET['profiles']) ? $_GET['profiles'] : 1;
if (isset($_POST['update_profile'])) {
    $userInput = new PHPFusion\UserFieldsInput();
    $userInput->setUserNameChange(fusion_get_settings('userNameChange'));
    // accept or not username change.
    $userInput->verifyNewEmail = TRUE;
    $userInput->userData = $userdata;
    $userInput->saveUpdate();
    if (defender::safe()) {
        redirect(BASEDIR . "edit_profile.php");
    }
} elseif (isset($_GET['code']) && fusion_get_settings('email_verification') == 1) {
    $userInput = new PHPFusion\UserFieldsInput();
    $userInput->verifyCode($_GET['code']);
    redirect(BASEDIR . 'edit_profile.php');
}
opentable($locale['u102']);
if (fusion_get_settings('email_verification') == 1) {
    $result = dbquery("SELECT user_email FROM " . DB_EMAIL_VERIFY . " WHERE user_id='" . $userdata['user_id'] . "'");
    if (dbrows($result)) {
        $data = dbarray($result);
        echo "<div class='well text-center' style='margin: 5px auto 10px auto;'>" . sprintf($locale['u200'], $data['user_email']) . "\n<br />\n" . $locale['u201'] . "\n</div>\n";
    }