'Scroll beyond end of the page.', ]; $timeZones = DateTimeZone::listIdentifiers(); if(isset($_POST['date_format_custom'], $_POST['timezone']) && CSRF::verify()) { $timeZone = is_string($_POST['timezone']) ? $_POST['timezone'] : ''; $dateFormatCustom = is_string($_POST['date_format_custom']) ? $_POST['date_format_custom'] : ''; $currentPass = isset($_POST['currpass']) && is_string($_POST['currpass']) ? $_POST['currpass'] : ''; $newPass = isset($_POST['newpwd']) && is_string($_POST['newpwd']) ? $_POST['newpwd'] : ''; $confPass = isset($_POST['conpwd']) && is_string($_POST['conpwd']) ? $_POST['conpwd'] : ''; $newMail = isset($_POST['newmail']) && is_string($_POST['newmail']) ? $_POST['newmail'] : ''; $confMail = isset($_POST['conmail']) && is_string($_POST['conmail']) ? $_POST['conmail'] : ''; $setMail = !empty($newMail) && !empty($confMail); $setPass = !empty($newPass) && !empty($confPass); if($setMail || $setPass) { if(!verify_password($currentPass)) { $error = 'Current password was invalid.'; } else { if(!isset($error) && $setPass) { $error = validate_password($newPass); if(!isset($error)) { if($newPass !== $confPass) { $email = 'Passwords don\'t match.'; } else { user_set_password(current_user_id(), $newPass); } } } if(!isset($error) && $setMail) { $error = validate_email($newMail); if(!isset($error)) { if($newMail !== $confMail) { $error = 'E-mail addresses don\'t match.'; } else { $emailVerification = user_set_email(current_user_id(), $newMail); } } } } } if(!isset($error)) { if(!in_array($timeZone, $timeZones)) { $error = 'Invalid time zone specified.'; } elseif(strlen($dateFormatCustom) > 50) { $error = 'Invalid date/time format string.'; } else { $userFlags = 0; foreach(array_keys($options) as $flag) if(!empty($_POST['flag_' . $flag])) $userFlags |= $flag; $updateUser = $pdo->prepare(' UPDATE `fmf_users` SET `user_date_format` = :dtf, `user_time_zone` = :tz, `user_flags` = :flags WHERE `user_id` = :user '); $updateUser->bindValue('dtf', htmlentities($dateFormatCustom)); $updateUser->bindValue('tz', $timeZone); $updateUser->bindValue('flags', $userFlags); $updateUser->bindValue('user', current_user_id()); $updateUser->execute(); } } if(!empty($emailVerification)) { $userInfo = user_info(current_user_id(), true); $mailer->send( (new Swift_Message('flash.moe message board activation')) ->setFrom(['system@flash.moe' => 'flash.moe']) ->setTo([$userInfo['user_email'] => $userInfo['user_login']]) ->setBody( "Hey {$userInfo['user_login']},\r\n\r\n". "You are required to reactivate your account after e-mail changes.\r\n\r\n". "Click the following link to activate your account:\r\n\r\n". "\r\n" ) ); destroy_session($_COOKIE['fmfauth'] ?? ''); header('Location: /login?m=reactivate'); return; } } $userInfo = user_info(current_user_id(), true); $title = 'Settings'; foreach($timeZones as $key => $timeZone) { $timeZones[$key] = new DateTimeZone($timeZone); $timeZones[$key]->offset = $timeZones[$key]->getOffset(new DateTime('now', new DateTimeZone('UTC'))); } uasort($timeZones, function($a, $b) { $diff = $a->offset <=> $b->offset; if($diff === 0) return strcmp($a->getName(), $b->getName()); return $diff; }); include FMF_LAYOUT . '/header.php'; ?>

Avatar

Gravatar is used for user profile images, go here to change it. Only images with G rating will be used.

Options

$oText) { ?>

Time zone

Password


E-mail

You will be forced to reactivate your account after changing your e-mail address, make sure to get it right!

Current Password

Only required for changing e-mail or password.