當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BuckysUser::deleteUserAccount方法代碼示例

本文整理匯總了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;
 }
開發者ID:HAPwebsite,項目名稱:Social-Network-Website,代碼行數:22,代碼來源:accountApi.php

示例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');
開發者ID:kishoreks,項目名稱:BuckysRoom,代碼行數:31,代碼來源:banned_users.php

示例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']);
         }
     }
 }
開發者ID:ravi50041,項目名稱:Social-Network-Website,代碼行數:22,代碼來源:class.BuckysBanUser.php

示例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";
開發者ID:kishoreks,項目名稱:BuckysRoom,代碼行數:31,代碼來源:delete_account.php


注:本文中的BuckysUser::deleteUserAccount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。