本文整理匯總了PHP中UserProfile::Delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserProfile::Delete方法的具體用法?PHP UserProfile::Delete怎麽用?PHP UserProfile::Delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserProfile
的用法示例。
在下文中一共展示了UserProfile::Delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: deleteUserId
public static function deleteUserId($user_id)
{
$userProfile = new UserProfile();
return $userProfile->Delete('user_id', $user_id);
}
示例2: act_delete_user
public function act_delete_user()
{
//$this->set_event();
if (isset($_POST['no'])) {
set_redirect_header('admin', 'user_management');
return;
}
if (!isset($_POST['users'])) {
shnMessageQueue::addInformation(_t('PLEASE_SELECT_A_USER_TO_DELETE'));
set_redirect_header('admin', 'user_management');
exit;
}
$this->del_confirm = true;
if (isset($_POST['yes'])) {
if (isset($_POST['user'])) {
array_push($_POST['users'], $_POST['user']);
}
//if multiplt users are selected
if (is_array($_POST['users'])) {
foreach ($_POST['users'] as $user) {
if ($user == 'admin') {
shnMessageQueue::addInformation(_t('YOU_CANNOT_DELETE_THE_ADMINISTRATOR_ACCOUNT_'));
continue;
}
if ($user == $_SESSION['username']) {
shnMessageQueue::addInformation(_t('YOU_CANNOT_DELETE_YOURSELF_FROM_THE_LIST_OF_USERS_'));
continue;
}
if (key(acl_get_user_roles($user)) == 'admin' && $_SESSION['username'] != 'admin') {
shnMessageQueue::addInformation(_t('YOU_CANNOT_DELETE_OTHER_ADMIN_USERS_'));
continue;
}
$u = new User();
$up = new UserProfile();
$up->Delete('username', $user);
$u->Delete('username', $user);
acl_delete_user($user);
}
}
set_redirect_header('admin', 'user_management');
return;
}
//if there are multiple evets show table
$this->users = Browse::getUserListArray($_POST['users']);
}