// directly to this page? dbgSquirt("...not set"); header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/changeemail.php?error=No new email was provided. Please enter one and click Save. If this error reoccurs, contact an administrator."); exit; } // verify that the new email is non-blank $newEmail = $_POST['newemail']; dbgSquirt("Checking blank -- {$newEmail}"); if (empty($newEmail)) { // error ... requested email is blank... bounce them back to change email page dbgSquirt("...Empty"); header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/changeemail.php?error=The new email must not be blank."); exit; } // update the email for this user with the provided value if (updateEmail($username, $newEmail)) { // update successful $title = "Email changed"; $heading = "Email changed"; $msg = "Email changed to <em>{$newEmail}</em>."; } else { // update failed $title = "Error while changing email"; $heading = "Error while changing email"; $msg = "An error occurred while attempting to change your email. Please contact an administrator."; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- System: Repro
if (setUserActive($userdetails['activation_token'])) { $successes[] = lang("ACCOUNT_MANUALLY_ACTIVATED", array($displayname)); } else { $errors[] = lang("SQL_ERROR"); } } //Update email if ($userdetails['email'] != $_POST['email']) { $email = trim($_POST["email"]); //Validate email if (!isValidEmail($email)) { $errors[] = lang("ACCOUNT_INVALID_EMAIL"); } elseif (emailExists($email)) { $errors[] = lang("ACCOUNT_EMAIL_IN_USE", array($email)); } else { if (updateEmail($userId, $email)) { $successes[] = lang("ACCOUNT_EMAIL_UPDATED"); } else { $errors[] = lang("SQL_ERROR"); } } } //Update title if ($userdetails['title'] != $_POST['title']) { $title = trim($_POST['title']); //Validate title if (minMaxRange(1, 50, $title)) { $errors[] = lang("ACCOUNT_TITLE_CHAR_LIMIT", array(1, 50)); } else { if (updateTitle($userId, $title)) { $successes[] = lang("ACCOUNT_TITLE_UPDATED", array($displayname, $title));
<?php if (isset($_GET['delete'])) { $id = intval($_GET['delete']); deleteEmail($db, $id); } if (isset($_POST['edit'])) { $id = intval($_POST['id']); $email = trim(strip_tags($_POST['email'])); $password = trim(strip_tags($_POST['password'])); $role = trim(strip_tags($_POST['role'])); updateEmail($db, $id, $email, $password, $role); redirectTo('index.php'); } ?> <div class="top clearfix"> <h1 class="left">Administation</h1> <a href="logout.php" class="cta">Se déconnecter</a> </div> <div class="view-toggle clearfix"> <a href="/admin" class="active">Gestion des inscrits</a> <a href="/admin/mailing.php">Envoyer un mail à la liste</a> </div> <!-- CONTAINER --> <div class="container"> <div class="inner-wrap admin"> <h2>Liste des adresses :</h2>
<?php require 'models/connect.php'; require 'models/validation_functions.php'; require 'models/user_functions.php'; if (isset($_SESSION)) { $emailError = ''; $imageError = ''; if (!empty($_POST['newemail'])) { $valid = validateEmail($_POST['newemail']); if ($valid) { $success = updateEmail($_POST['newemail'], $_SESSION['userid']); if (!$success) { $emailError = 'το E-mail'; } } else { $emailError = 'το E-mail'; } } if (!empty($_FILES['newimg'])) { $path = imageUpload('data/profile_imgs/', 'newimg'); $success = false; if ($path) { $success = imageUpdate($path, $_SESSION['userid']); } if (!$success) { $imageError = 'την Εικόνα'; } } if ($emailError || $imageError) { echo "Προσπαθήστε ξάνα υπήρξε πρόβλημα με : {$emailError} {$imageError} ";
</div> <!-- end of container --> </div> <!-- <?php } } // break; // // case 'updateemail': // if (isset($_POST['username']) && isset($_POST['email'])) { // if (updateEmail($_POST['username'], $_POST['email'])) { // unset($_GET['action']); } else { ?> <div class="main"> <span class="shadow-top"></span> <!-- shell --> <div class="shell"> <div class="container"> <!-- testimonial --> <section class="testimonial"> <h2>Final Fantasy XI Private Server!</h2> <p><strong>“</strong>Your email was update successfuly!.</p> <p>in a few moments you will be redirected to your profile, and again Thank you for your patience.</p>
<?php include '../../settings.php'; include '../../inc/login_functions.php'; include '../../inc/helper.php'; include 'functions.php'; $logedIn = access($mysqli); $userData = getUserData($mysqli, $_SESSION['userId']); $updateEmail = updateEmail($mysqli, $_SESSION['userId']); $updateProfile = updateProfile($mysqli, $_SESSION['userId']); $updatePassword = updatePassword($mysqli, $_SESSION['userId']); if ($updateProfile == 1 || $updatePassword == 1 || $updateEmail == 1) { header("Location: updateRedirect.php"); exit; } if ($updatePassword == 2 || $updateEmail == 2) { header("Location: ../../404.php"); exit; } include "../../inc/header.php"; include "../../inc/topNavbar.php"; ?> <section id="main-container"> <?php include "../../inc/leftNavbar.php"; ?> <!--Page main section start--> <section id="min-wrapper">
public function index() { /* UserCake (Via CupCake) Version: 2.0.2 http://usercake.com */ global $baseURL; require_once "{$baseURL}/application/third_party/user_cake/models/config.php"; if (!securePage($_SERVER['PHP_SELF'])) { die; } $userId = $_GET['id']; //Check if selected user exists if (!userIdExists($userId)) { header("Location: " . str_replace('index.php/', '', site_url('admin_users'))); die; } $userdetails = fetchUserDetails(NULL, NULL, $userId); //Fetch user details //Forms posted if (!empty($_POST)) { //Delete selected account if (!empty($_POST['delete'])) { $deletions = $_POST['delete']; if ($deletion_count = deleteUsers($deletions)) { $successes[] = lang("ACCOUNT_DELETIONS_SUCCESSFUL", array($deletion_count)); } else { $errors[] = lang("SQL_ERROR"); } } else { //Update display name if ($userdetails['display_name'] != $_POST['display']) { $displayname = trim($_POST['display']); //Validate display name if (displayNameExists($displayname)) { $errors[] = lang("ACCOUNT_DISPLAYNAME_IN_USE", array($displayname)); } elseif (minMaxRange(5, 25, $displayname)) { $errors[] = lang("ACCOUNT_DISPLAY_CHAR_LIMIT", array(5, 25)); } elseif (!ctype_alnum($displayname)) { $errors[] = lang("ACCOUNT_DISPLAY_INVALID_CHARACTERS"); } else { if (updateDisplayName($userId, $displayname)) { $successes[] = lang("ACCOUNT_DISPLAYNAME_UPDATED", array($displayname)); } else { $errors[] = lang("SQL_ERROR"); } } } else { $displayname = $userdetails['display_name']; } //Activate account if (isset($_POST['activate']) && $_POST['activate'] == "activate") { if (setUserActive($userdetails['activation_token'])) { $successes[] = lang("ACCOUNT_MANUALLY_ACTIVATED", array($displayname)); } else { $errors[] = lang("SQL_ERROR"); } } //Update email if ($userdetails['email'] != $_POST['email']) { $email = trim($_POST["email"]); //Validate email if (!isValidEmail($email)) { $errors[] = lang("ACCOUNT_INVALID_EMAIL"); } elseif (emailExists($email)) { $errors[] = lang("ACCOUNT_EMAIL_IN_USE", array($email)); } else { if (updateEmail($userId, $email)) { $successes[] = lang("ACCOUNT_EMAIL_UPDATED"); } else { $errors[] = lang("SQL_ERROR"); } } } //Update title if ($userdetails['title'] != $_POST['title']) { $title = trim($_POST['title']); //Validate title if (minMaxRange(1, 50, $title)) { $errors[] = lang("ACCOUNT_TITLE_CHAR_LIMIT", array(1, 50)); } else { if (updateTitle($userId, $title)) { $successes[] = lang("ACCOUNT_TITLE_UPDATED", array($displayname, $title)); } else { $errors[] = lang("SQL_ERROR"); } } } //Remove permission level if (!empty($_POST['removePermission'])) { $remove = $_POST['removePermission']; if ($deletion_count = removePermission($remove, $userId)) { $successes[] = lang("ACCOUNT_PERMISSION_REMOVED", array($deletion_count)); } else { $errors[] = lang("SQL_ERROR"); } } if (!empty($_POST['addPermission'])) { $add = $_POST['addPermission']; if ($addition_count = addPermission($add, $userId)) { $successes[] = lang("ACCOUNT_PERMISSION_ADDED", array($addition_count)); } else { $errors[] = lang("SQL_ERROR"); } } $userdetails = fetchUserDetails(NULL, NULL, $userId); } } $userPermission = fetchUserPermissions($userId); $permissionData = fetchAllPermissions(); require_once "{$baseURL}/application/third_party/user_cake/models/header.php"; echo "\r\n<body>\r\n<div id='wrapper'>\r\n<div id='top'><div id='logo'></div></div>\r\n<div id='content'>\r\n<h1>UserCake (Via CupCake)</h1>\r\n<h2>Admin User</h2>\r\n<div id='left-nav'>"; include "{$baseURL}/application/third_party/user_cake/left-nav.php"; echo "\r\n</div>\r\n<div id='main'>"; echo resultBlock($errors, $successes); echo "\r\n<form name='adminUser' action='" . $_SERVER['PHP_SELF'] . "?id=" . $userId . "' method='post'>\r\n<table class='admin'><tr><td>\r\n<h3>User Information</h3>\r\n<div id='regbox'>\r\n<p>\r\n<label>ID:</label>\r\n" . $userdetails['id'] . "\r\n</p>\r\n<p>\r\n<label>Username:</label>\r\n" . $userdetails['user_name'] . "\r\n</p>\r\n<p>\r\n<label>Display Name:</label>\r\n<input type='text' name='display' value='" . $userdetails['display_name'] . "' />\r\n</p>\r\n<p>\r\n<label>Email:</label>\r\n<input type='text' name='email' value='" . $userdetails['email'] . "' />\r\n</p>\r\n<p>\r\n<label>Active:</label>"; //Display activation link, if account inactive if ($userdetails['active'] == '1') { echo "Yes"; } else { echo "No\r\n\t</p>\r\n\t<p>\r\n\t<label>Activate:</label>\r\n\t<input type='checkbox' name='activate' id='activate' value='activate'>\r\n\t"; } echo "\r\n</p>\r\n<p>\r\n<label>Title:</label>\r\n<input type='text' name='title' value='" . $userdetails['title'] . "' />\r\n</p>\r\n<p>\r\n<label>Sign Up:</label>\r\n" . date("j M, Y", $userdetails['sign_up_stamp']) . "\r\n</p>\r\n<p>\r\n<label>Last Sign In:</label>"; //Last sign in, interpretation if ($userdetails['last_sign_in_stamp'] == '0') { echo "Never"; } else { echo date("j M, Y", $userdetails['last_sign_in_stamp']); } echo "\r\n</p>\r\n<p>\r\n<label>Delete:</label>\r\n<input type='checkbox' name='delete[" . $userdetails['id'] . "]' id='delete[" . $userdetails['id'] . "]' value='" . $userdetails['id'] . "'>\r\n</p>\r\n<p>\r\n<label> </label>\r\n<input type='submit' value='Update' class='submit' />\r\n</p>\r\n</div>\r\n</td>\r\n<td>\r\n<h3>Permission Membership</h3>\r\n<div id='regbox'>\r\n<p>Remove Permission:"; //List of permission levels user is apart of foreach ($permissionData as $v1) { if (isset($userPermission[$v1['id']])) { echo "<br><input type='checkbox' name='removePermission[" . $v1['id'] . "]' id='removePermission[" . $v1['id'] . "]' value='" . $v1['id'] . "'> " . $v1['name']; } } //List of permission levels user is not apart of echo "</p><p>Add Permission:"; foreach ($permissionData as $v1) { if (!isset($userPermission[$v1['id']])) { echo "<br><input type='checkbox' name='addPermission[" . $v1['id'] . "]' id='addPermission[" . $v1['id'] . "]' value='" . $v1['id'] . "'> " . $v1['name']; } } echo "\r\n</p>\r\n</div>\r\n</td>\r\n</tr>\r\n</table>\r\n</form>\r\n</div>\r\n<div id='bottom'></div>\r\n</div>\r\n</body>\r\n</html>"; }
$user = updateUsername($user, $data); R::store($user); if ($jsonResponse->alerts[0]['type'] == 'success') { logAction($before['username'] . ' changed username to ' . $user->username, $before, $user->export()); } $jsonResponse->addBeans(getUsers()); } $app->response->setBody($jsonResponse->asJson()); }); // Update current user's email if not taken. $app->post('/updateemail', function () use($app, $jsonResponse) { $data = json_decode($app->environment['slim.input']); if (validateToken()) { $user = getUser(); $before = $user->export(); $user = updateEmail($user, $data); R::store($user); if ($jsonResponse->alerts[0]['type'] == 'success') { logAction($before['username'] . ' changed email to ' . $user->email, $before, $user->export()); } $jsonResponse->addBeans(getUsers()); } $app->response->setBody($jsonResponse->asJson()); }); // Update current user's default board. $app->post('/updateboard', function () use($app, $jsonResponse) { $data = json_decode($app->environment['slim.input']); if (validateToken()) { $user = getUser(); $before = $user->export(); $user->defaultBoard = $data->defaultBoard;
* Displays user account details */ $dialog = ""; if (isset($_POST)) { require_once "includes/userFunctions.php"; } if (isset($_POST["oldPassword"], $_POST["password1"], $_POST["password2"])) { if (strcmp(trim($_POST["password1"]), trim($_POST["password2"])) === 0) { $dialog = updatePassword($_POST["oldPassword"], $_POST["password1"]); } else { $dialog = "Your passwords do not match."; } } if (isset($_POST["oldEmail"], $_POST["email1"], $_POST["email2"])) { if (strcmp(trim($_POST["email1"]), trim($_POST["email2"])) === 0) { $dialog = updateEmail($_POST["oldEmail"], $_POST["email1"]); } else { $dialog = "Your emails do not match."; } } if (isset($_POST["resend"])) { exit(json_encode(array("type" => sendEmailVerification($_POST["resend"])))); } $title = "Account Details"; $loginRequired = true; require "includes/header.php"; ?> <div class="container"> <div class="row page-header"> <div class="col-xs-12">