Beispiel #1
0
    } else {
        $status .= '<p>Sorry, we could not log you in with that 
                  username and password.</p><br /><br /><br /><br />
                  <br /><br />';
    }
}
if (isset($action) && $action == 'log-out') {
    session_destroy();
    unset($action);
    $_SESSION = array();
}
//need to process choose, delete or store account before drawing header
if (isset($action)) {
    switch ($action) {
        case 'delete-account':
            delete_account($_SESSION['auth_user'], $account);
            break;
        case 'store-settings':
            store_account_settings($_SESSION['auth_user'], $_POST);
            break;
        case 'select-account':
            // if have chosen a valid account, store it as a session variable
            if ($account && account_exists($_SESSION['auth_user'], $account)) {
                $_SESSION['selected_account'] = $account;
            }
    }
}
// set the buttons that will be on the tool bar
$buttons[0] = 'view-mailbox';
$buttons[1] = 'new-message';
$buttons[2] = 'account-setup';
Beispiel #2
0
function emember_menu()
{
    global $wpemem_evt;
    $wpemem_evt = isset($_REQUEST['event']) ? trim($_REQUEST['event']) : "";
    switch ($wpemem_evt) {
        case 'delete_account':
            delete_account();
            break;
    }
}
Beispiel #3
0
         $results = search_accounts_by_id();
     } else {
         $results = search_accounts_by_name();
     }
     $body->set("results", $results);
     break;
 case 3:
     // Update Account Details
     check_admin_authorization();
     update_account();
     header("Location: index.php?editor=account&acctid={$acctid}");
     exit;
 case 4:
     // Delete Account
     check_admin_authorization();
     delete_account($acctid);
     header("Location: index.php?editor=account");
     exit;
 case 5:
     // Character Transfer Selection
     check_admin_authorization();
     $body = new Template("templates/account/account.chartransfer.tmpl.php");
     $javascript = new Template("templates/account/js.tmpl.php");
     $body->set('acctid', $acctid);
     $body->set('acctname', getAccountName($acctid));
     $body->set('target_accounts', $target_accounts);
     break;
 case 6:
     // Transfer Character
     check_admin_authorization();
     char_transfer();
Beispiel #4
0
function purge_accounts()
{
    $accounts = $_POST['id'];
    foreach ($accounts as $account => $id) {
        delete_account($id);
    }
}
// delete_account.php is only accessible for logged in users.
require_once 'config.php';
require_once 'class.mysqli.php';
require_once 'class.util.php';
require_once 'class.customs.php';
// HNAuthLib
if (!is_user_logged_in()) {
    header('Location: login.php');
} else {
    $session = new Session();
    $loggedInUser = $session->getItem('username');
    $loggedInLevel = $session->getItem('userlevel');
}
if (isset($_POST['submit'])) {
    if (delete_account($_POST['username'], $_POST['password'])) {
        header('Location: index.php');
    } else {
        $errorMsg = '<div class="alert alert-danger alert-dismissable">';
        $errorMsg .= '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
        $errorMsg .= $responseMsg['hnauth'];
        $errorMsg .= '</div>';
    }
}
?>

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<?php

if (isset($_POST['cpassworddl'])) {
    $current_password = $_POST['cpassworddl'];
}
if ($current_password === getuserfield_settings('password', $user_id)) {
    if (delete_account($user_id)) {
        $msg = "Account Deleted Successfully";
        header("Location: student_homepage.php?pid=81fgc3tx&settings_msg={$msg}");
    } else {
        $msg = "Your account could not be deleted.";
        header("Location: student_homepage.php?pid=6st16yz9&settings_msg={$msg}");
    }
} else {
    $msg = "Your current password is invalid.";
    header("Location: student_homepage.php?pid=6st16yz9&settings_msg={$msg}");
}
Beispiel #7
0
      if(isset($_POST['text'])){
        edit_delivery_method($_POST['text']);
      }

      require "templates/admin/edit-delivery-method.php";
    }
    else if($_GET['action'] == 'delete_category'){
      if(isset($_POST['id'])){
        delete_category($_POST['id']);
      }

      require "templates/admin/delete-category.php";
    }
    else if($_GET['action'] == 'delete_account'){
      if(isset($_POST['id'])){
        delete_account($_POST['id']);
      }

      require "templates/admin/delete-account.php";
    }
    else if($_GET['action'] == 'ban_account'){
      if(isset($_POST['id'])){
        ban_account($_POST['id']);
      }

      require "templates/admin/ban-account.php";
    }
    else if($_GET['action'] == 'grant_admin_priviliges'){
      if(isset($_POST['id'])){
        grant_admin_priviliges($_POST['id']);
      }
Beispiel #8
0
         header('Location:index.php?action=display_post#' . $balise);
         // Maintien de la hauteur dans la page
     } else {
         header('Location:index.php?action=display_post');
     }
     break;
 case "delete_account":
     // Assez inélégant, mais nécessaire à l'actualisation totale de la page après une suppression réussie qui entraîne la déconnexion
     $treat_post = false;
     if (!isset($_SESSION["delete_account_state"])) {
         $_SESSION["delete_account_state"] = "execute";
     }
     if ($_SESSION["delete_account_state"] == "execute") {
         $_SESSION["delete_account_state"] = "wait";
         // On signale que la page est en attente d'actualisation
         $_SESSION["delete_account_display"] = delete_account();
         // Exécution proprement dite
         header('Location:index.php?action=delete_account');
         // Redirection vers l'affichage
     } elseif ($_SESSION["delete_account_state"] == "wait") {
         $_SESSION["delete_account_state"] = "display";
         // La page a été réactualisée, on peut maintenant afficher les résultats
     }
     break;
 case "new_document":
     // Similaire à "delete_account" : on ne peut se permettre une redirection *avant* le traitement, car le fichier temporaire uploadé est supprimé...
     $treat_post = false;
     if (!isset($_SESSION["new_document_state"])) {
         $_SESSION["new_document_state"] = "execute";
     }
     if ($_SESSION["new_document_state"] == "execute") {
        }
    } else {
        $status .= '<p>Sorry, we could not log you in with that 
                  username and password.</p><br /><br /><br /><br />
                  <br /><br />';
    }
}
if ($action == 'log-out') {
    session_destroy();
    unset($action);
    unset($HTTP_SESSION_VARS);
}
//need to process choose, delete or store account before drawing header
switch ($action) {
    case 'delete-account':
        delete_account($HTTP_SESSION_VARS['auth_user'], $account);
        break;
    case 'store-settings':
        store_account_settings($HTTP_SESSION_VARS['auth_user'], $HTTP_POST_VARS);
        break;
    case 'select-account':
        // if have chosen a valid account, store it as a session variable
        if ($account && account_exists($HTTP_SESSION_VARS['auth_user'], $account)) {
            $HTTP_SESSION_VARS['selected_account'] = $account;
        }
}
// set the buttons that will be on the tool bar
$buttons[0] = 'view-mailbox';
$buttons[1] = 'new-message';
$buttons[2] = 'account-setup';
//only offer a log out button if logged in
Beispiel #10
0
    $x = "deleted_" . time() . "_" . random_string();
    $retval = $user->update("email_addr='{$x}', authenticator='{$x}', name='', country='', postal_code='', has_profile=0");
    if (!$retval) {
        return false;
    }
    user_quit_team($user);
    forum_delete_user($user);
    pm_delete_user($user);
    anonymize_hosts($user);
    delete_profile($user);
    return true;
}
$user = get_logged_in_user();
$cmd = get_str("cmd", true);
if ($cmd == "delete") {
    $retval = delete_account($user);
    if (!$retval) {
        error_page(tra("Couldn't delete account"));
    } else {
        page_head(tra("Account deleted"));
        echo tra("Your account has been deleted.");
        page_tail();
    }
} else {
    page_head(tra("Confirm delete account"));
    echo "\n        <table><tr><td>\n        " . tra("Deleting your account will remove all of your\npersonal information from our servers,\nincluding your profile and message-board posts.\nNo jobs will be issued to any computers attached\nto this account.") . "\n        <p>\n        <b>" . tra("This cannot be undone.\nOnce your account has been deleted, you cannot get it back.") . "\n        <p>\n        " . tra("Are you sure you want to delete your account?") . "</b>\n        <p>\n    ";
    show_button("delete_account.php?cmd=delete", tra("Yes"), tra("Delete this account"));
    show_button("index.php", tra("No"), tra("Do not delete this account"));
    echo "</td></tr></table>\n";
    page_tail();
}
Beispiel #11
0
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>REST/OAuth Example</title>
    </head>
    <body>
        <tt>
            <?php 
$access_token = $_SESSION['access_token'];
$instance_url = $_SESSION['instance_url'];
if (!isset($access_token) || $access_token == "") {
    die("Error - access token missing from session!");
}
if (!isset($instance_url) || $instance_url == "") {
    die("Error - instance URL missing from session!");
}
show_accounts($instance_url, $access_token);
$id = create_account("My New Org", $instance_url, $access_token);
show_account($id, $instance_url, $access_token);
show_accounts($instance_url, $access_token);
update_account($id, "My New Org, Inc", "San Francisco", $instance_url, $access_token);
show_account($id, $instance_url, $access_token);
show_accounts($instance_url, $access_token);
delete_account($id, $instance_url, $access_token);
show_accounts($instance_url, $access_token);
?>
        </tt>
    </body>
</html>
Beispiel #12
0
        get_account_manage_data();
        break;
    case 'getAccountList':
        get_account_list();
        break;
    case 'getAccount':
        get_account();
        break;
    case 'setAccountDefault':
        set_account_default();
        break;
    case 'updateAccount':
        update_account();
        break;
    case 'deleteAccount':
        delete_account();
        break;
    case 'getAccountSimpleList':
        get_account_simple_list();
    default:
        break;
}
/**
 * 获取账户管理页面数据
 */
function get_account_manage_data()
{
    $userId = $_SESSION['userId'];
    // 获取账户列表
    $accountService = new AccountService();
    $result = $accountService->getAccountList($userId, null);
Beispiel #13
0
            $_SESSION['selected_account'] = $accounts[0];
            //            echo "Debug: session: ".$_SESSION['selected_account']."<br />".
            //                "accounts[0]: ".$accounts[0]."<br />";
        }
    } else {
        $status .= "<p style=\"padding-bottom: 100px\">\n            Sorry, but you cannot log in with this username and password.</p>";
    }
}
if ($action == 'log-out') {
    session_destroy();
    unset($action);
    $_SESSION = array();
}
switch (@$action) {
    case 'delete-account':
        delete_account($_SESSION['auth_user'], $_POST);
        break;
    case 'store-settings':
        store_account_settings($_SESSION['auth_user'], $_POST);
        break;
    case 'select-account':
        if ($account && account_exists($_SESSION['auth_user'], $account)) {
            $_SESSION['selected_account'] = $account;
        }
        break;
}
$buttons[0] = 'view-mailbox';
$buttons[1] = 'new-message';
$buttons[2] = 'account-setup';
if (check_auth_user()) {
    $buttons[4] = 'log-out';
        $location = $_POST['location'];
        add_hardware($id, $type, $model, $status, $description, $location);
        break;
    case 'Edit Hardware':
        $id = $_POST['id'];
        $type = $_POST['type'];
        $model = $_POST['model'];
        $status = $_POST['status'];
        $description = $_POST['description'];
        $location = $_POST['location'];
        edit_hardware($id, $type, $model, $status, $description, $location);
        break;
    case 'Delete Hardware':
        $id = $_POST['id'];
        delete_hardware($id);
        break;
    case 'Edit Account':
        $user = $_POST['user'];
        $email = $_POST['email'];
        $password = password_hash($_POST['password'], PASSWORD_DEFAULT);
        edit_account($user, $email, $password);
        break;
    case 'Delete Account':
        $user = $_POST['user'];
        $email = $_POST['email'];
        $hash = get_hash($user, $email);
        if (password_verify($_POST['password'], $hash)) {
            delete_account($user, $email);
        }
        break;
}
Beispiel #15
0
    }
    $prv_new = serialize($prv_array);
    file_put_contents('../private/passwd', $prv_new);
}
function show_cart()
{
    if (isset($_SESSION['cart'])) {
        foreach ($_SESSION['cart'] as $value) {
            echo "<div class='cart_compte'><ul class='inner_cart_ul'>";
            echo "<li class='inner_cart'><img style='width:90px;height:90px;' src='" . $value['location'] . "'>" . "<div>" . $value['name'] . "</div>" . "<div>" . $value['categories'] . "</div>" . "<div>" . $value['price'] . "</div>" . "<div>" . number_format($value['nb'], 0, ",", " ") . " items</div>" . "<div><form action='cart.php' method='POST'>\n\t\t\t\t\t\t<input type='hidden' name='name' value='" . $value['name'] . "'>\n\t\t\t\t\t\t<button type='submit' name='submit' value='del_o'>\n\t\t\t\t\t\t<i class='fa fa-cart-arrow-down'></i></button>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div></li>";
            echo "</ul></div>";
        }
    }
}
if (isset($_POST['submit']) && $_POST['submit'] == 'delete_my_account') {
    delete_account($_SESSION['log_on_user']);
    $_SESSION['log_on_user'] = NULL;
    $_SESSION['cart'] = NULL;
    header('Location: index.php');
}
?>
<html>
	<body>
	<?php 
show_cart();
if (isset($_SESSION['cart']) && $_SESSION['cart'] && $_SESSION['log_on_user']) {
    print '
	<div style="text-align: center;">
		Total : ' . number_format($_SESSION['total'], 2, ",", " ") . ' $
		<form action="cart.php" method="post">
			<button type="submit" name="submit" value="validate" id="delete_account">Validate</button>