本文整理汇总了PHP中Session::resetSessions方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::resetSessions方法的具体用法?PHP Session::resetSessions怎么用?PHP Session::resetSessions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session::resetSessions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* @see Action::execute()
*/
public function execute()
{
AbstractAction::execute();
// check permission
WCF::getUser()->checkPermission('admin.user.canBanUser');
if (count($this->userIDs) > 0) {
// check permission
$sql = "SELECT\tDISTINCT groupID\n\t\t\t\tFROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\tWHERE\tuserID IN (" . implode(',', $this->userIDs) . ")";
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
if (!Group::isAccessibleGroup($row['groupID'])) {
throw new PermissionDeniedException();
}
}
// update user
$sql = "UPDATE\twcf" . WCF_N . "_user\n\t\t\t\tSET\tbanned = 0\n\t\t\t\tWHERE\tuserID IN (" . implode(',', $this->userIDs) . ")";
WCF::getDB()->sendQuery($sql);
// unmark users
UserEditor::unmarkAll();
// reset sessions
Session::resetSessions($this->userIDs);
}
$this->executed();
if (!empty($this->url)) {
HeaderUtil::redirect($this->url);
} else {
// set active menu item
WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.user.management');
// show succes message
WCF::getTPL()->assign('message', 'wcf.acp.user.unban.success');
WCF::getTPL()->display('success');
}
exit;
}
示例2: execute
/**
* @see Cronjob::execute()
*/
public function execute($data)
{
$sql = "SELECT\t*\n\t\t\tFROM\twcf" . WCF_N . "_group\n\t\t\tWHERE\tneededAge <> 0\n\t\t\t\tOR neededPoints <> 0";
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
$userIDArray = array();
if ($row['neededAge'] > 0) {
$sql = "SELECT\tuserID\n\t\t\t\t\tFROM\twcf" . WCF_N . "_user\n\t\t\t\t\tWHERE\tregistrationDate <= " . (TIME_NOW - 86400 * $row['neededAge']) . "\n\t\t\t\t\t\tAND userID NOT IN (\n\t\t\t\t\t\t\tSELECT\tuserID\n\t\t\t\t\t\t\tFROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\t\t\t\tWHERE\tgroupID = " . $row['groupID'] . "\n\t\t\t\t\t\t)";
$result2 = WCF::getDB()->sendQuery($sql);
while ($row2 = WCF::getDB()->fetchArray($result2)) {
$userIDArray[] = $row2['userID'];
}
}
if ($row['neededPoints'] > 0) {
$sql = "SELECT\tuserID\n\t\t\t\t\tFROM\twcf" . WCF_N . "_user\n\t\t\t\t\tWHERE\tactivityPoints >= " . $row['neededPoints'] . "\n\t\t\t\t\t\tAND userID NOT IN (\n\t\t\t\t\t\t\tSELECT\tuserID\n\t\t\t\t\t\t\tFROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\t\t\t\tWHERE\tgroupID = " . $row['groupID'] . "\n\t\t\t\t\t\t)";
$result2 = WCF::getDB()->sendQuery($sql);
while ($row2 = WCF::getDB()->fetchArray($result2)) {
$userIDArray[] = $row2['userID'];
}
}
if (count($userIDArray)) {
$userIDArray = array_unique($userIDArray);
// assign to group
$sql = "INSERT INTO\twcf" . WCF_N . "_user_to_groups\n\t\t\t\t\t\t\t(userID, groupID)\n\t\t\t\t\tSELECT\t\tuserID, " . $row['groupID'] . "\n\t\t\t\t\tFROM\t\twcf" . WCF_N . "_user\n\t\t\t\t\tWHERE\t\tuserID IN (" . implode(',', $userIDArray) . ")";
WCF::getDB()->sendQuery($sql);
// reset sesions
Session::resetSessions($userIDArray);
}
}
}
示例3: save
/**
* @see Form::save()
*/
public function save()
{
parent::save();
// save
$updateOptionValueUpdate = '';
foreach ($this->activeOptions as $option) {
if ($option['defaultValue'] != $option['optionValue']) {
$sql = "UPDATE\twcf" . WCF_N . "_user_option\n\t\t\t\t\tSET\tdefaultValue = '" . escapeString($option['optionValue']) . "'\n\t\t\t\t\tWHERE\toptionID = " . $option['optionID'];
WCF::getDB()->sendQuery($sql);
if (!empty($updateOptionValueUpdate)) {
$updateOptionValueUpdate .= ',';
}
$updateOptionValueUpdate .= 'userOption' . $option['optionID'] . "='" . escapeString($option['optionValue']) . "'";
}
}
// apply to existing users
if ($this->applyChangesToExistingUsers == 1 && !empty($updateOptionValueUpdate)) {
$sql = "UPDATE\twcf" . WCF_N . "_user_option_value\n\t\t\t\tSET\t" . $updateOptionValueUpdate;
WCF::getDB()->sendQuery($sql);
// reset sessions
Session::resetSessions();
}
// reset cache
WCF::getCache()->clearResource($this->cacheName . PACKAGE_ID);
// show success message
WCF::getTPL()->assign('success', true);
}
示例4: setSetting
/**
* Sets a setting with an identifier and value.
*
* @param int userID
* @param string setting
* @param mixed value
* @param int expire time
*/
public static function setSetting($userID, $setting, $value, $expireTime = 0x7fffffff)
{
$svalue = serialize($value);
$sql = "REPLACE INTO ugml_user_setting\n\t\t\t\t(userID, setting, expireTime, value)\n\t\t\t\tVALUES\n\t\t\t\t(" . $userID . ", '" . escapeString($setting) . "', " . $expireTime . ", '" . escapeString($svalue) . "')";
WCF::getDB()->sendQuery($sql);
self::$settings[$userID][$setting] = $svalue;
Session::resetSessions($userID);
}
示例5: execute
/**
* @see PMRuleAction::execute()
*/
public function execute(PMEditor $pm, PMRule $rule, UserProfile $recipient)
{
$sql = "UPDATE\twcf" . WCF_N . "_pm_to_user\n\t\t\tSET \tisViewed = " . TIME_NOW . ",\n\t\t\t\tuserWasNotified = 1\n\t\t\tWHERE \tpmID = " . $pm->pmID . "\n\t\t\t\tAND recipientID = " . $recipient->userID;
WCF::getDB()->sendQuery($sql);
$pm->updateViewedByAll();
$pm->updateUnreadMessageCount($recipient->userID);
Session::resetSessions($recipient->userID);
return true;
}
示例6: save
/**
* @see Form::save()
*/
public function save()
{
AbstractForm::save();
// save
$this->application->updateByLeader($this->applicationStatus, $this->reply, WCF::getUser()->userID);
// reset session
Session::resetSessions($this->application->userID);
$this->saved();
HeaderUtil::redirect('index.php?page=UserGroupLeader' . SID_ARG_2ND_NOT_ENCODED);
exit;
}
示例7: save
/**
* @see Form::save()
*/
public function save()
{
AbstractForm::save();
// save group
$this->group->update($this->groupName, $this->activeOptions, $this->additionalFields);
// update sessions
require_once WCF_DIR . 'lib/system/session/Session.class.php';
Session::resetSessions();
$this->saved();
// show success message
WCF::getTPL()->assign('success', true);
}
示例8: execute
/**
* @see Action::execute()
*/
public function execute()
{
parent::execute();
// check permission
WCF::getUser()->checkPermission('admin.user.canEnableUser');
if (count($this->userIDs) > 0) {
// check permission
$sql = "SELECT\tDISTINCT groupID\n\t\t\t\tFROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\tWHERE\tuserID IN (" . implode(',', $this->userIDs) . ")";
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
if (!Group::isAccessibleGroup($row['groupID'])) {
throw new PermissionDeniedException();
}
}
// send notification
$languages = array(0 => WCF::getLanguage(), WCF::getLanguage()->getLanguageID() => WCF::getLanguage());
$sql = "SELECT\tuserID, username, email, languageID\n\t\t\t\tFROM\twcf" . WCF_N . "_user\n\t\t\t\tWHERE\tuserID IN (" . implode(',', $this->userIDs) . ")\n\t\t\t\t\tAND activationCode <> 0";
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
if (!isset($languages[$row['languageID']])) {
$languages[$row['languageID']] = new Language($row['languageID']);
}
$mail = new Mail(array($row['username'] => $row['email']), $languages[$row['languageID']]->get('wcf.acp.user.activation.mail.subject', array('PAGE_TITLE' => $languages[$row['languageID']]->get(PAGE_TITLE))), $languages[$row['languageID']]->get('wcf.acp.user.activation.mail', array('PAGE_TITLE' => $languages[$row['languageID']]->get(PAGE_TITLE), '$username' => $row['username'], 'PAGE_URL' => PAGE_URL, 'MAIL_ADMIN_ADDRESS' => MAIL_ADMIN_ADDRESS)));
$mail->send();
}
// update groups
$sql = "DELETE FROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\tWHERE\t\tuserID IN (" . implode(',', $this->userIDs) . ")\n\t\t\t\t\t\tAND groupID = " . Group::getGroupIdByType(Group::GUESTS);
WCF::getDB()->sendQuery($sql);
$sql = "INSERT IGNORE INTO\twcf" . WCF_N . "_user_to_groups\n\t\t\t\t\t\t\t(userID, groupID)\n\t\t\t\tVALUES\t\t\t(" . implode(', ' . Group::getGroupIdByType(Group::USERS) . '),(', $this->userIDs) . ", '" . Group::getGroupIdByType(Group::USERS) . "')";
WCF::getDB()->sendQuery($sql);
// update user
$sql = "UPDATE\twcf" . WCF_N . "_user\n\t\t\t\tSET\tactivationCode = 0\n\t\t\t\tWHERE\tuserID IN (" . implode(',', $this->userIDs) . ")";
WCF::getDB()->sendQuery($sql);
// unmark users
UserEditor::unmarkAll();
// reset sessions
Session::resetSessions($this->userIDs);
}
$this->executed();
if (!empty($this->url)) {
HeaderUtil::redirect($this->url);
} else {
// set active menu item
WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.user.management');
// show succes message
WCF::getTPL()->assign('message', 'wcf.acp.user.enable.success');
WCF::getTPL()->display('success');
}
exit;
}
示例9: execute
/**
* @see Action::execute()
*/
public function execute()
{
parent::execute();
// check permission
WCF::getUser()->checkPermission('admin.user.infraction.canDeleteSuspension');
// revoke suspension
if (!$this->userSuspension->revoked) {
$object = Suspension::getSuspensionTypeObject($this->userSuspension->suspensionType);
$object->revoke(new User($this->userSuspension->userID), $this->userSuspension, new Suspension($this->userSuspension->suspensionID));
Session::resetSessions($this->userSuspension->userID);
}
// delete suspension
$this->userSuspension->delete();
$this->executed();
// forward to list page
HeaderUtil::redirect('index.php?page=UserSuspensionList&deletedUserSuspensionID=' . $this->userSuspensionID . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
exit;
}
示例10: create
/**
* Creates a new message
*
* @param int recipent id
* @param string subject
* @param string text
* @param int sender id
* @param string sender name
* @param int message type
*/
public static function create($recipentID, $subject, $text, $senderID = null, $senderName = null, $messageType = 1)
{
if ($senderID === null) {
$senderID = WCF::getUser()->userID;
}
if ($senderName === null) {
require_once LW_DIR . 'lib/data/user/LWUser.class.php';
$sender = new LWUser($senderID);
$senderName = $sender->getLinkedUsername();
}
// insert
$sql = "INSERT INTO ugml_messages\r\n\t\t\t\t(message_owner, message_sender, message_time,\r\n\t\t\t\t message_type, message_from, message_subject,\r\n\t\t\t\t message_text)\r\n\t\t\t\tVALUES\r\n\t\t\t\t(" . $recipentID . ", " . $senderID . ", " . time() . ",\r\n\t\t\t\t " . $messageType . ", '" . escapeString($senderName) . "', '" . escapeString($subject) . "',\r\n\t\t\t\t '" . escapeString($text) . "')";
WCF::getDB()->sendQuery($sql);
// update user
$sql = "UPDATE ugml_users\r\n\t\t\t\tSET new_message = new_message + 1\r\n\t\t\t\tWHERE id = " . $recipentID;
WCF::getDB()->sendQuery($sql);
Session::resetSessions($recipentID);
}
示例11: save
/**
* @see Form::save()
*/
public function save()
{
parent::save();
$sql = "SELECT\t\tuser.*,\n\t\t\t\t\tGROUP_CONCAT(groupID SEPARATOR ',') AS groupIDs\n\t\t\tFROM\t\twcf" . WCF_N . "_user user\n\t\t\tLEFT JOIN\twcf" . WCF_N . "_user_to_groups groups\n\t\t\tON\t\t(groups.userID = user.userID)\n\t\t\tWHERE\t\tuser.userID IN (" . $this->userIDs . ")\n\t\t\tGROUP BY\tuser.userID";
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
if (!Group::isAccessibleGroup(explode(',', $row['groupIDs']))) {
throw new PermissionDeniedException();
}
$user = new UserEditor(null, $row);
$user->addToGroups($this->groupIDs, false, false);
}
UserEditor::unmarkAll();
Session::resetSessions(explode(',', $this->userIDs));
$this->saved();
WCF::getTPL()->assign('message', 'wcf.acp.user.assignToGroup.success');
WCF::getTPL()->display('success');
exit;
}
示例12: execute
/**
* @see Action::execute()
*/
public function execute()
{
parent::execute();
// save pm
$sql = "INSERT INTO\twcf" . WCF_N . "_pm\n\t\t\t\t\t(userID, username, subject, message, time)\n\t\t\tVALUES\t\t(" . WCF::getUser()->userID . ", '" . escapeString(WCF::getUser()->username) . "', '" . escapeString($this->subject) . "', '" . escapeString($this->text) . "', " . TIME_NOW . ")";
WCF::getDB()->sendQuery($sql);
$pmID = WCF::getDB()->getInsertID("wcf" . WCF_N . "_pm", 'pmID');
// save recipients
$sql = "INSERT INTO\twcf" . WCF_N . "_pm_to_user\n\t\t\t\t\t(pmID, recipientID, recipient, isBlindCopy)\n\t\t\tSELECT\t\t" . $pmID . ", user_to_groups.userID, user_table.username, 1\n\t\t\tFROM\t\twcf" . WCF_N . "_user_to_groups user_to_groups\n\t\t\tLEFT JOIN\twcf" . WCF_N . "_user user_table\n\t\t\tON\t\t(user_table.userID = user_to_groups.userID)\n\t\t\tWHERE\t\tuser_to_groups.groupID = " . $this->groupID;
WCF::getDB()->sendQuery($sql);
// update counters
$sql = "UPDATE\twcf" . WCF_N . "_user\n\t\t\tSET\tpmUnreadCount = pmUnreadCount + 1,\n\t\t\t\tpmOutstandingNotifications = pmOutstandingNotifications + 1\n\t\t\tWHERE\tuserID IN (\n\t\t\t\t\tSELECT\tuserID\n\t\t\t\t\tFROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\t\tWHERE\tgroupID = " . $this->groupID . "\n\t\t\t\t)";
WCF::getDB()->sendQuery($sql);
// reset sessions
Session::resetSessions(array(), true, false);
$this->executed();
HeaderUtil::redirect('index.php?form=UserGroupAdministrate&groupID=' . $this->groupID . '&pmSuccess=1' . SID_ARG_2ND_NOT_ENCODED);
exit;
}
示例13: delete
/**
* Deletes this news.
*/
public function delete()
{
$identifier = $this->getIdentifier();
$hash = sha1($identifier);
WCF::getDB()->sendQuery("START TRANSACTION");
// user settings
// TODO: create a class, that handles this
$sql = "SELECT GROUP_CONCAT(userID)\n\t\t\t\tFROM ugml_user_setting\n\t\t\t\tWHERE hash = '" . $hash . "'\n\t\t\t\tGROUP BY hash";
$row = WCF::getDB()->getFirstRow($sql);
$userIDs = $row['userIDs'];
Session::resetSessions($userIDs, true, false);
$sql = "DELETE FROM ugml_user_setting\n\t\t\t\tWHERE hash = '" . $hash . "'";
WCF::getDB()->sendQuery($sql);
// news itself
$sql = "DELETE FROM ugml_news\n\t\t\t\tWHERE newsID = " . $this->newsID;
WCF::getDB()->sendQuery($sql);
WCF::getCache()->addResource('news-' . PACKAGE_ID, WCF_DIR . 'cache/cache.news-' . PACKAGE_ID . '.php', LW_DIR . 'lib/system/cache/CacheBuilderNews.class.php');
WCF::getCache()->clearResource('news-' . PACKAGE_ID);
WCF::getDB()->sendQuery("COMMIT");
}
示例14: execute
/**
* @see Action::execute()
*/
public function execute()
{
parent::execute();
// check permission
WCF::getUser()->checkPermission('admin.avatar.canDisableAvatar');
// enable avatar
require_once WCF_DIR . 'lib/data/user/UserEditor.class.php';
$user = new UserEditor($this->userID);
if (!$user->userID) {
throw new IllegalLinkException();
}
$sql = "UPDATE\twcf" . WCF_N . "_user\n\t\t\tSET\tdisableAvatar = 0\n\t\t\tWHERE\tuserID = " . $this->userID;
WCF::getDB()->sendQuery($sql);
// reset session
Session::resetSessions($this->userID, true, false);
$this->executed();
// forward to list page
HeaderUtil::redirect('index.php?page=AvatarList&type=1&pageNo=' . $this->pageNo . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
exit;
}
示例15: execute
/**
* @see Action::execute()
*/
public function execute()
{
AbstractAction::execute();
// check permission
WCF::getUser()->checkPermission('admin.user.canEnableUser');
if (count($this->userIDs) > 0) {
// check permission
$sql = "SELECT\tDISTINCT groupID\n\t\t\t\tFROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\tWHERE\tuserID IN (" . implode(',', $this->userIDs) . ")";
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
if (!Group::isAccessibleGroup($row['groupID'])) {
throw new PermissionDeniedException();
}
}
// update groups
$sql = "DELETE FROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\tWHERE\t\tuserID IN (" . implode(',', $this->userIDs) . ")\n\t\t\t\t\t\tAND groupID <> " . Group::getGroupIdByType(Group::EVERYONE);
WCF::getDB()->sendQuery($sql);
$sql = "INSERT IGNORE INTO\twcf" . WCF_N . "_user_to_groups\n\t\t\t\t\t\t\t(userID, groupID)\n\t\t\t\tVALUES\t\t\t(" . implode(', ' . Group::getGroupIdByType(Group::GUESTS) . '),(', $this->userIDs) . ", '" . Group::getGroupIdByType(Group::GUESTS) . "')";
WCF::getDB()->sendQuery($sql);
// update activation code
foreach ($this->userIDs as $userID) {
$sql = "UPDATE\twcf" . WCF_N . "_user\n\t\t\t\t\tSET\tactivationCode = " . UserRegistrationUtil::getActivationCode() . "\n\t\t\t\t\tWHERE\tuserID = " . $userID;
WCF::getDB()->sendQuery($sql);
}
// unmark users
UserEditor::unmarkAll();
// reset sessions
Session::resetSessions($this->userIDs);
}
$this->executed();
if (!empty($this->url)) {
HeaderUtil::redirect($this->url);
} else {
// set active menu item
WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.user.management');
// show succes message
WCF::getTPL()->assign('message', 'wcf.acp.user.disable.success');
WCF::getTPL()->display('success');
}
exit;
}