Files
Testing/user_account_delete.php

72 lines
2.0 KiB
PHP
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
<?php
/* $Id: user_account_delete.php 115 2009-03-14 01:46:48Z john $ */
$page = "user_account_delete";
include "header.php";
$task = ( isset($_POST['task']) ? $_POST['task'] : NULL );
$delete_token = ( isset($_POST['token']) ? $_POST['token'] : NULL );
if( !$user->level_info['level_profile_delete'] )
{
header("Location: user_account.php");
exit();
}
// DELETE THIS USER
if( $task == "dodelete" )
{
/*if( empty($_SESSION['delete_token']) || $_SESSION['delete_token']!=$delete_token || time()>$_SESSION['delete_token_expires'] )
{
$result = FALSE;
}
else
{
$user->user_delete();
$user->user_setcookies();
$result = TRUE;
}*/
$database->database_query("UPDATE se_users SET user_enabled='0', user_pdp_evc = 2 WHERE user_id='".$user->user_info["user_id"]."'");
$xml='<?xml version="1.0" encoding="UTF-8" ?>
<xmlrequest>
<username>bateworld@gmail.com</username>
<usertoken>405a1b48556d1ffd09416751a6c915a61a2beb2d</usertoken>
<requesttype>subscribers</requesttype>
<requestmethod>deleteSubscriber</requestmethod>
<details>
<listId>33624</listId>
<subscriberId>'.$user->user_info["user_email"].'</subscriberId>
</details>
</xmlrequest>';
/*
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, "https://www.ynotmail.com/clients/remote-api.php");
curl_setopt ($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
// $output contains the output string
$output = curl_exec($ch); */
header("Content-Type: application/json");
echo json_encode(array('result' => $result));
exit();
}
// Nothing wrong with being extra safe, right?
$_SESSION['delete_token'] = md5(uniqid(rand(), TRUE));
$_SESSION['delete_token_expires'] = time() + 300;
// ASSIGN SMARTY VARIABLES AND INCLUDE FOOTER
$smarty->assign('delete_token', $_SESSION['delete_token']);
include "footer.php";
?>