当前位置: 首页>>代码示例>>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;未经允许,请勿转载。