本文整理汇总了PHP中BuckysUser::deleteUserAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP BuckysUser::deleteUserAccount方法的具体用法?PHP BuckysUser::deleteUserAccount怎么用?PHP BuckysUser::deleteUserAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BuckysUser
的用法示例。
在下文中一共展示了BuckysUser::deleteUserAccount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteAccountAction
public function deleteAccountAction()
{
$data = $_POST;
$token = isset($data['TOKEN']) ? trim($data['TOKEN']) : null;
if (!$token) {
return ['STATUS_CODE' => STATUS_CODE_BAD_REQUEST, 'DATA' => buckys_api_get_error_result('Api token should not be blank')];
}
if (!($userID = BuckysUsersToken::checkTokenValidity($token, "api"))) {
return ['STATUS_CODE' => STATUS_CODE_UNAUTHORIZED, 'DATA' => buckys_api_get_error_result('Api token is not valid.')];
}
$current = BuckysUser::getUserData($userID);
if (!buckys_validate_password($data['password'], $current['password'])) {
return ['STATUS_CODE' => STATUS_CODE_OK, 'DATA' => buckys_api_get_error_result('Current password is incorrect.')];
} else {
if (BuckysUser::deleteUserAccount($userID)) {
return ['STATUS_CODE' => STATUS_CODE_OK, 'DATA' => ['STATUS' => 'SUCCESS']];
} else {
return ['STATUS_CODE' => STATUS_CODE_UNAUTHORIZED, 'DATA' => buckys_api_get_error_result('There was an error to saving your information.')];
}
}
exit;
}
示例2: buckys_redirect
buckys_redirect('/index.php', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR);
}
if (isset($_REQUEST['action'])) {
if ($_REQUEST['action'] == 'unban') {
BuckysBanUser::unbanUsers($_REQUEST['bannedID']);
buckys_redirect('/banned_users.php', MSG_UNBAN_USERS);
} else {
if ($_REQUEST['action'] == 'delete') {
BuckysBanUser::deleteUsers($_REQUEST['bannedID']);
buckys_redirect('/banned_users.php', MSG_DELETE_USERS);
} else {
if ($_REQUEST['action'] == 'deletebyid') {
if (!isset($_REQUEST['userID']) || !BuckysUser::checkUserID($_REQUEST['userID'], false)) {
buckys_redirect('/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
}
BuckysUser::deleteUserAccount($_REQUEST['userID']);
buckys_redirect('/index.php', MSG_DELETE_USERS);
}
}
}
exit;
}
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$totalCount = BuckysBanUser::getBannedUsersCount();
//Init Pagination Class
$pagination = new Pagination($totalCount, BuckysBanUser::$COUNT_PER_PAGE, $page);
$page = $pagination->getCurrentPage();
$users = BuckysBanUser::getBannedUsers($page, BuckysBanUser::$COUNT_PER_PAGE);
buckys_enqueue_stylesheet('account.css');
buckys_enqueue_stylesheet('moderator.css');
buckys_enqueue_javascript('banned_users.js');
示例3: deleteUsers
/**
* Delete Banned Users
*
* @param mixed $ids
*/
public static function deleteUsers($ids)
{
global $db, $TNB_GLOBALS;
if (!is_array($ids)) {
$ids = [$ids];
}
//Check the user has lready been banned or not
$rows = $db->getResultsArray("SELECT * FROM " . TABLE_BANNED_USERS . " WHERE bannedID IN (" . implode(', ', $ids) . ")");
if ($rows) {
foreach ($rows as $row) {
$userID = $row['bannedUserID'];
BuckysUser::deleteUserAccount($userID);
//Remove From banned users table
$db->query("DELETE FROM " . TABLE_BANNED_USERS . " WHERE bannedID=" . $row['bannedID']);
}
}
}
示例4: buckys_redirect
if ($_POST['password'] != $_POST['password2']) {
buckys_redirect("/change_password.php", MSG_NOT_MATCH_PASSWORD, MSG_TYPE_ERROR);
$isValid = false;
}
}
//Check Current Password
$data = BuckysUser::getUserData($userID);
if (!$data) {
buckys_redirect("/index.php");
}
if (!buckys_validate_password($_POST['password'], $data['password'])) {
buckys_add_message(MSG_CURRENT_PASSWORD_NOT_CORRECT, MSG_TYPE_ERROR);
$isValid = false;
}
if ($isValid) {
//Delete Account
BuckysUser::deleteUserAccount($userID);
unset($_SESSION['userID']);
setcookie('bkuid0', null, time() - 1000, "/", "buckysroom.com");
setcookie('bkuid1', null, time() - 1000, "/", "buckysroom.com");
setcookie('bkuid2', null, time() - 1000, "/", "buckysroom.com");
buckys_session_destroy();
buckys_session_start();
buckys_redirect('/index.php', MSG_ACCOUNT_DELETED);
}
}
buckys_enqueue_stylesheet('account.css');
buckys_enqueue_stylesheet('info.css');
$BUCKYS_GLOBALS['content'] = 'delete_account';
$BUCKYS_GLOBALS['title'] = "Delete Account - BuckysRoom";
require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";