diff --git a/engine/init.php b/engine/init.php index 08700b2..a52cd6a 100644 --- a/engine/init.php +++ b/engine/init.php @@ -46,7 +46,7 @@ Token::generate(); if (user_logged_in() === true) { $session_user_id = getSession('user_id'); $user_data = user_data($session_user_id, 'id', 'name', 'password', 'email', 'premdays'); - $user_znote_data = user_znote_account_data($session_user_id, 'ip', 'created', 'points', 'cooldown'); + $user_znote_data = user_znote_account_data($session_user_id, 'ip', 'created', 'points', 'cooldown', 'flag'); } $errors = array(); // Log IP diff --git a/settings.php b/settings.php index 89b266a..c131059 100644 --- a/settings.php +++ b/settings.php @@ -9,7 +9,7 @@ if (empty($_POST) === false) { if (!Token::isValid($_POST['token'])) { $errors[] = 'Token is invalid.'; } - $required_fields = array('new_email'); + $required_fields = array('new_email', 'new_flag'); foreach($_POST as $key=>$value) { if (empty($value) && in_array($key, $required_fields) === true) { $errors[] = 'You need to fill in all fields.'; @@ -37,7 +37,12 @@ if (isset($_GET['success']) === true && empty($_GET['success']) === true) { 'email' => $_POST['new_email'], ); + $update_znote_data = array( + 'flag' => getValue($_POST['new_flag']), + ); + user_update_account($update_data); + user_update_znote_account($update_znote_data); header('Location: settings.php?success'); exit(); @@ -52,6 +57,22 @@ if (isset($_GET['success']) === true && empty($_GET['success']) === true) { email:
+
  • + Country:
    + +
  • +