本文整理匯總了PHP中IPSCookie::set方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSCookie::set方法的具體用法?PHP IPSCookie::set怎麽用?PHP IPSCookie::set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSCookie
的用法示例。
在下文中一共展示了IPSCookie::set方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _toggleSidePanel
/**
* Toggle side panel on/off without JS
*
* @access public
* @return void
* @see The Dark Knight (it was an awesome movie)
*/
public function _toggleSidePanel()
{
$current = IPSCookie::get('hide_sidebar');
$new = $current ? 0 : 1;
IPSCookie::set('hide_sidebar', $new);
$this->registry->getClass('output')->silentRedirect($this->settings['base_url']);
}
示例2: _toggleSidePanel
/**
* Toggle side panel on/off without JS
*
* @return @e void
* @see The Dark Knight (it was an awesome movie)
*/
public function _toggleSidePanel()
{
/* Security Check */
if ($this->request['secure_key'] != $this->member->form_hash) {
$this->registry->output->showError('usercp_forums_bad_key', 102998, null, null, 403);
}
$current = IPSCookie::get('hide_sidebar');
$new = $current ? 0 : 1;
IPSCookie::set('hide_sidebar', $new);
$this->registry->getClass('output')->silentRedirect($this->settings['base_url'] . 'act=idx', 'false');
}
示例3: _change
/**
* Changes the skin ID choice for the member
*
* @return @e void
*/
protected function _change()
{
$skinId = $this->request['skinId'];
if ($this->request['skinId'] != 'setAsMobile' && $this->request['k'] != $this->member->form_hash) {
$this->registry->output->showError('no_permission', 10122243, FALSE, '', 403);
}
if (is_numeric($skinId)) {
/* Rudimentaty check */
if ($this->registry->output->allSkins[$skinId]['_youCanUse'] and $this->registry->output->allSkins[$skinId]['_gatewayExclude'] !== TRUE) {
if ($this->memberData['member_id']) {
/* Update... */
IPSMember::save($this->memberData['member_id'], array('core' => array('skin' => $skinId)));
} else {
IPSCookie::set('guestSkinChoice', $skinId);
}
/* Make sure mobile skin is removed */
IPSCookie::set("mobileApp", 'false', -1);
IPSCookie::set("mobileBrowser", 0, -1);
/* remove user agent bypass */
IPSCookie::set("uagent_bypass", 0, -1);
/* Update member row */
$this->memberData['skin'] = $skinId;
}
} else {
if ($skinId == 'fullVersion') {
/* Set cookie */
IPSCookie::set("uagent_bypass", 1, -1);
IPSCookie::set("mobileBrowser", 0, -1);
} else {
if ($skinId == 'unlockUserAgent') {
$this->member->updateMySession(array('uagent_bypass' => 1));
/* Set cookie */
IPSCookie::set("uagent_bypass", 1, -1);
IPSCookie::set("mobileBrowser", 0, -1);
} else {
if ($skinId == 'setAsMobile') {
$this->member->updateMySession(array('uagent_bypass' => 0));
/* Set cookie */
IPSCookie::set("uagent_bypass", 0, -1);
IPSCookie::set("mobileBrowser", 1, -1);
}
}
}
}
/* Redirect */
if ($this->settings['query_string_real']) {
$url = preg_replace('#&k=(?:\\S+?)($|&)#', '\\1', str_replace('&', '&', $this->settings['query_string_real']));
$url = preg_replace('#&settingNewSkin=(?:\\S+?)($|&)#', '\\1', $url);
$url = preg_replace('#&setAsMobile=(?:\\S+?)($|&)#', '\\1', $url);
$this->registry->getClass('output')->silentRedirect($this->settings['board_url'] . '?' . $url, '', true);
}
$this->registry->getClass('output')->silentRedirect($this->settings['board_url'], '', true);
}
示例4: dispatch
/**
* Figure out what api is being called
*
* @return @e void
*/
public function dispatch()
{
/* Force a cookie to identify as a mobile app */
if (!$this->request['dontSetCookie']) {
IPSCookie::set("mobileApp", 'true', -1);
}
/* Figure out the action */
switch ($this->request['api']) {
case 'getNotifications':
$this->_handleGetNotifications();
break;
case 'toggleNotifications':
$this->_handleToggleNotifications();
break;
case 'toggleNotificationKey':
$this->_hanldeToggleNotificaionKey();
break;
case 'notificationTypes':
$this->_handleNotificationTypes();
break;
case 'login':
$this->_handleLogin();
break;
case 'postImage':
$this->_handlePostImage();
break;
case 'postStatus':
$this->_handlePostStatus();
break;
case 'postTopic':
$this->_handlePostTopic();
break;
case 'postReply':
$this->_handlePostReply();
break;
case 'getStyle':
$this->_handleGetStyle();
break;
case 'getApns':
$this->_getApns();
break;
default:
$this->_invalidApi();
break;
}
}
示例5: convertMemberToGuest
/**
* Converts a member session to a guest session
*
* @access public
* @return string Current session ID
*/
public function convertMemberToGuest()
{
/* Delete old sessions */
$this->_destroySessions("ip_address='" . $this->_member->ip_address . "' AND id != '{$this->session_id}'");
/* Update this session directly */
$this->DB->update('sessions', array('member_name' => '', 'seo_name' => '', 'member_id' => 0, 'running_time' => time(), 'member_group' => $this->settings['guest_group']), "id='" . $this->session_id . "'", TRUE);
/* Remove from update and delete array */
unset($this->_sessionsToSave[$this->session_id]);
unset($this->_sessionsToKill[$this->session_id]);
/* Set cookie */
IPSCookie::set("session_id", $this->session_id, -1);
/* Save markers... */
$this->registry->classItemMarking->writeMyMarkersToDB();
IPSDebug::addLogMessage("convertMemberToGuest: {$this->session_id} " . serialize($data), 'sessions-' . $this->_memberData['member_id']);
/* Set type */
self::$data_store['_sessionType'] = 'update';
return $this->session_id;
}
示例6: _multiTopicModify
/**
* Topic multi-moderation
*
* @return @e void [Outputs to screen]
*/
protected function _multiTopicModify()
{
/* init */
$done = false;
/* Check these first */
switch ($this->request['tact']) {
case 't_approve':
$this->_topicsManage('approve_unapproved');
$done = true;
break;
case 't_delete_approve':
$this->_topicsManage('delete_unapproved');
$done = true;
break;
case 't_restore':
$this->_topicsManage('restore_deleted');
$done = true;
break;
case 't_delete_softed':
$this->_topicsManage('delete_deleted');
$done = true;
break;
}
$this->tids = $this->_getIds();
if (count($this->tids) and $done !== true) {
switch ($this->request['tact']) {
case 'close':
$this->_multiAlterTopics('close_topic', "state='closed'");
break;
case 'open':
$this->_multiAlterTopics('open_topic', "state='open'");
break;
case 'pin':
$this->_multiAlterTopics('pin_topic', "pinned=1");
break;
case 'unpin':
$this->_multiAlterTopics('unpin_topic', "pinned=0");
break;
case 'approve':
$this->_multiAlterTopics('topic_q', $this->registry->getClass('class_forums')->fetchTopicHiddenQuery(array('visible'), ''));
break;
case 'unapprove':
$this->_multiAlterTopics('topic_q', $this->registry->getClass('class_forums')->fetchTopicHiddenQuery(array('hidden'), ''));
break;
case 'delete':
$this->_multiAlterDeleteSplash();
break;
case 'deletedo':
$this->_multiAlterTopics('delete_topic');
break;
case 'sdelete':
$this->_multiSoftDeleteTopics(1, $this->request['deleteReason']);
break;
case 'sundelete':
$this->_multiSoftDeleteTopics(0);
break;
case 'move':
$this->_multiStartCheckedMove();
return;
break;
case 'domove':
$this->_multiCompleteCheckedMove();
break;
case 'merge':
if ($this->_multiTopicMerge() === FALSE) {
return;
}
break;
default:
$this->_multiTopicMmod();
break;
}
}
IPSCookie::set('modtids', '', 0);
/* From search? */
if ($this->fromSearch and $this->returnUrl) {
if ($this->request['nr']) {
$this->registry->output->silentRedirect($this->returnUrl);
} else {
$this->registry->output->redirectScreen($this->lang->words['cp_redirect_topics'], $this->returnUrl);
}
} else {
if ($this->request['return']) {
$_bits = explode(':', $this->request['return']);
if (count($_bits) and $_bits[0] == 'modcp') {
$this->registry->output->redirectScreen($this->lang->words['cp_redirect_posts'], $this->settings['base_url'] . "app=core&module=modcp&fromapp=forums&tab=" . $_bits[1] . 'topics');
}
} else {
if ($this->forum['id']) {
$url = "showforum=" . $this->forum['id'];
$url = $this->request['st'] ? "showforum=" . $this->forum['id'] . '&page=' . $this->request['page'] : $url;
if ($this->request['nr']) {
$this->registry->output->silentRedirect($this->settings['base_url'] . $url, $this->forum['name_seo'], 'showforum');
} else {
$this->registry->output->redirectScreen($this->lang->words['cp_redirect_topics'], $this->settings['base_url'] . $url, $this->forum['name_seo'], 'showforum');
//.........這裏部分代碼省略.........
示例7: array
//-----------------------------------------
// Get converge
//-----------------------------------------
$converge = $registry->DB()->buildAndFetch(array('select' => '*', 'from' => 'converge_local', 'where' => "converge_active=1 AND converge_product_id=" . $product_id));
//-----------------------------------------
// Get member....
//-----------------------------------------
$session = $registry->DB()->buildAndFetch(array('select' => '*', 'from' => 'sessions', 'where' => "id='" . $session_id . "' AND member_id=" . $member_id));
if ($session['member_id']) {
$member = IPSMember::load($member_id);
if (md5($member['member_login_key'] . $converge['converge_api_code']) == $key) {
if ($set_cookies) {
IPSCookie::set("member_id", $member['member_id'], 1);
IPSCookie::set("pass_hash", $member['member_login_key'], 1);
}
IPSCookie::set("session_id", $session_id, -1);
}
//-----------------------------------------
// Update session
//-----------------------------------------
$registry->DB()->update('sessions', array('browser' => $registry->member()->user_agent, 'ip_address' => $registry->member()->ip_address), "id='" . $session_id . "'");
}
//-----------------------------------------
// Is this a partial member?
// Not completed their sign in?
//-----------------------------------------
if ($member['members_created_remote']) {
$pmember = $registry->DB()->buildAndFetch(array('select' => '*', 'from' => 'members_partial', 'where' => "partial_member_id={$member['member_id']}"));
if ($pmember['partial_member_id']) {
ipsRegistry::getClass('output')->silentRedirect(ipsRegistry::$settings['board_url'] . '/index.' . ipsRegistry::$settings['php_ext'] . '?act=reg&do=complete_login&mid=' . $member['member_id'] . '&key=' . $pmember['partial_date']);
exit;
示例8: _saveCookie
/**
* Save cookie
*
* @access protected
* @param string Key name (leave blank to save out all cookies)
* @return @e void
*/
protected function _saveCookie($key = '')
{
if (!$this->_useCookies) {
return;
}
if ($key and is_array($this->_cookie[$key])) {
IPSCookie::set($key, $this->_cookie[$key], 1);
} else {
foreach ($this->_cookie as $k => $v) {
if (is_array($v) and !count($v)) {
/* Do we have a cookie? */
$test = IPSCookie::get($k);
if ($test) {
/* set a blank, non sticky cookie */
IPSCookie::set($k, '-', 0, -1);
} else {
continue;
}
} else {
IPSDebug::addMessage('Cookie SAVED: ' . $k . ' - ' . $this->_compressCookie($v));
IPSCookie::set($k, $this->_compressCookie($v), 1);
}
}
}
}
示例9: renderForum
/**
* Builds an array of forum data for use in the output template
*
* @access public
* @return array
**/
public function renderForum()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$this->request['st'] = $this->request['changefilters'] ? 0 : (isset($this->request['st']) ? intval($this->request['st']) : 0);
$announce_data = array();
$topic_data = array();
$other_data = array();
$multi_mod_data = array();
$footer_filter = array();
//-----------------------------------------
// Show?
//-----------------------------------------
if (isset($this->request['show']) and $this->request['show'] == 'sinceLastVisit') {
$this->request['prune_day'] = 200;
}
//-----------------------------------------
// Are we actually a moderator for this forum?
//-----------------------------------------
$mod = $this->memberData['forumsModeratorData'];
if (!$this->memberData['g_is_supmod']) {
if (!isset($mod[$this->forum['id']]) or !is_array($mod[$this->forum['id']])) {
$this->memberData['is_mod'] = 0;
}
}
//-----------------------------------------
// Announcements
//-----------------------------------------
if (is_array($this->registry->cache()->getCache('announcements')) and count($this->registry->cache()->getCache('announcements'))) {
$announcements = array();
foreach ($this->registry->cache()->getCache('announcements') as $announce) {
$order = $announce['announce_start'] ? $announce['announce_start'] . ',' . $announce['announce_id'] : $announce['announce_id'];
if ($announce['announce_forum'] == '*') {
$announcements[$order] = $announce;
} else {
if (strstr(',' . $announce['announce_forum'] . ',', ',' . $this->forum['id'] . ',')) {
$announcements[$order] = $announce;
}
}
}
if (count($announcements)) {
//-----------------------------------------
// sort by start date
//-----------------------------------------
krsort($announcements);
foreach ($announcements as $announce) {
if ($announce['announce_start']) {
$announce['announce_start'] = gmstrftime('%x', $announce['announce_start']);
} else {
$announce['announce_start'] = '--';
}
$announce['announce_title'] = IPSText::stripslashes($announce['announce_title']);
$announce['forum_id'] = $this->forum['id'];
$announce['announce_views'] = intval($announce['announce_views']);
$announce_data[] = $announce;
}
$this->forum['_showAnnouncementsBar'] = 1;
}
}
//-----------------------------------------
// Read topics
//-----------------------------------------
$First = intval($this->request['st']);
//-----------------------------------------
// Sort options
//-----------------------------------------
$cookie_prune = IPSCookie::get($this->forum['id'] . "_prune_day");
$cookie_sort = IPSCookie::get($this->forum['id'] . "_sort_key");
$cookie_sortb = IPSCookie::get($this->forum['id'] . "_sort_by");
$cookie_fill = IPSCookie::get($this->forum['id'] . "_topicfilter");
$prune_value = $this->selectVariable(array(1 => !empty($this->request['prune_day']) ? $this->request['prune_day'] : NULL, 2 => !empty($cookie_prune) ? $cookie_prune : NULL, 3 => $this->forum['prune'], 4 => '100'));
$sort_key = $this->selectVariable(array(1 => !empty($this->request['sort_key']) ? $this->request['sort_key'] : NULL, 2 => !empty($cookie_sort) ? $cookie_sort : NULL, 3 => $this->forum['sort_key'], 4 => 'last_post'));
$sort_by = $this->selectVariable(array(1 => !empty($this->request['sort_by']) ? $this->request['sort_by'] : NULL, 2 => !empty($cookie_sortb) ? $cookie_sortb : NULL, 3 => $this->forum['sort_order'], 4 => 'Z-A'));
$topicfilter = $this->selectVariable(array(1 => !empty($this->request['topicfilter']) ? $this->request['topicfilter'] : NULL, 2 => !empty($cookie_fill) ? $cookie_fill : NULL, 3 => $this->forum['topicfilter'], 4 => 'all'));
//print_r($this->request);exit;
//print($cookie_sort);exit;
if (!empty($this->request['remember'])) {
if ($this->request['prune_day']) {
IPSCookie::set($this->forum['id'] . "_prune_day", $this->request['prune_day']);
}
if ($this->request['sort_key']) {
IPSCookie::set($this->forum['id'] . "_sort_key", $this->request['sort_key']);
}
if ($this->request['sort_by']) {
IPSCookie::set($this->forum['id'] . "_sort_by", $this->request['sort_by']);
}
if ($this->request['topicfilter']) {
IPSCookie::set($this->forum['id'] . "_topicfilter", $this->request['topicfilter']);
}
}
//print $sort_key;exit;
//-----------------------------------------
// Figure out sort order, day cut off, etc
//.........這裏部分代碼省略.........
示例10: _fetchSkinByUserAgent
//.........這裏部分代碼省略.........
//-----------------------------------------
$useSkinID = FALSE;
if ($this->memberData['userAgentKey'] and !$this->memberData['userAgentBypass']) {
foreach ($this->allSkins as $id => $data) {
/* Got perms? */
if ($data['_youCanUse'] !== TRUE) {
continue;
}
/* Can use with this output format? */
if ($data['_gatewayExclude'] !== FALSE) {
continue;
}
/* Check user agents first */
if (is_array($data['_userAgents']['uagents'])) {
foreach ($data['_userAgents']['uagents'] as $_key => $_version) {
if ($this->memberData['userAgentKey'] == $_key) {
if ($_version) {
$_versions = explode(',', $_version);
foreach ($_versions as $_v) {
if (strstr($_v, '+')) {
if ($this->memberData['userAgentVersion'] >= intval($_v)) {
$useSkinID = $id;
break 3;
}
} else {
if (strstr($_v, '-')) {
if ($this->memberData['userAgentVersion'] <= intval($_v)) {
$useSkinID = $id;
break 3;
}
} else {
if ($this->memberData['userAgentVersion'] == intval($_v)) {
$useSkinID = $id;
break 3;
}
}
}
}
} else {
/* We don't care about versions.. */
$useSkinID = $id;
break 2;
}
}
}
}
/* Still here? */
if (is_array($data['_userAgents']['groups']) and $useSkinID === FALSE) {
foreach ($data['_userAgents']['groups'] as $groupID) {
$_group = $this->caches['useragentgroups'][$groupID];
$_gData = unserialize($_group['ugroup_array']);
if (is_array($_gData)) {
foreach ($_gData as $__key => $__data) {
if ($this->memberData['userAgentKey'] == $__key) {
if ($__data['uagent_versions']) {
$_versions = explode(',', $__data['uagent_versions']);
foreach ($_versions as $_v) {
if (strstr($_v, '+')) {
if ($this->memberData['userAgentVersion'] >= intval($_v)) {
$useSkinID = $id;
break 4;
}
} else {
if (strstr($_v, '-')) {
if ($this->memberData['userAgentVersion'] <= intval($_v)) {
$useSkinID = $id;
break 4;
}
} else {
if ($this->memberData['userAgentVersion'] == intval($_v)) {
$useSkinID = $id;
break 4;
}
}
}
}
} else {
/* We don't care about versions.. */
$useSkinID = $id;
break 3;
}
}
}
}
}
}
}
}
/* Did we automatically get set the mobile skin?
* If so, assign cookie
*/
if ($this->allSkins[$useSkinID]['set_key'] == 'mobile') {
IPSCookie::set("mobileBrowser", 1, -1);
}
if ($useSkinID !== FALSE) {
$this->memberData['userAgentLocked'] = TRUE;
IPSDebug::addMessage("Skin set found via user agent. Using set #" . $useSkinID);
}
return $useSkinID;
}
示例11: topicSetUp
/**
* Topic set up ya'll
*
* @access public
* @return void
**/
public function topicSetUp()
{
//-----------------------------------------
// Memory...
//-----------------------------------------
$_before = IPSDebug::getMemoryDebugFlag();
//-----------------------------------------
// INIT
//-----------------------------------------
$this->request['start'] = !empty($this->request['start']) ? intval($this->request['start']) : '';
$this->request['st'] = !empty($this->request['st']) ? intval($this->request['st']) : '';
//-----------------------------------------
// Compile the language file
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile(array('public_boards', 'public_topic'));
$this->registry->class_localization->loadLanguageFile(array('public_editors'), 'core');
//-----------------------------------------
// Get all the member groups and
// member title info
//-----------------------------------------
if (!is_array($this->cache->getCache('ranks'))) {
$this->cache->rebuildCache('ranks', 'global');
}
//-----------------------------------------
// Are we actually a moderator for this forum?
//-----------------------------------------
if (!$this->memberData['g_is_supmod']) {
$moderator = $this->memberData['forumsModeratorData'];
if (!isset($moderator[$this->forum['id']]) or !is_array($moderator[$this->forum['id']])) {
$this->memberData['is_mod'] = 0;
}
}
$this->settings['_base_url'] = $this->settings['base_url'];
$this->forum['FORUM_JUMP'] = $this->registry->getClass('class_forums')->buildForumJump();
$this->first = intval($this->request['st']) > 0 ? intval($this->request['st']) : 0;
$this->request['view'] = !empty($this->request['view']) ? $this->request['view'] : NULL;
//-----------------------------------------
// Check viewing permissions, private forums,
// password forums, etc
//-----------------------------------------
if (!$this->memberData['g_other_topics'] and $this->topic['starter_id'] != $this->memberData['member_id']) {
$this->registry->output->showError('topics_not_yours', 10359);
} else {
if (!$this->forum['can_view_others'] and !$this->memberData['is_mod'] and $this->topic['starter_id'] != $this->memberData['member_id']) {
$this->registry->output->showError('topics_not_yours2', 10360);
}
}
//-----------------------------------------
// Update the topic views counter
//-----------------------------------------
if (!$this->request['view'] and $this->topic['state'] != 'link') {
if ($this->settings['update_topic_views_immediately']) {
$this->DB->update('topics', 'views=views+1', "tid=" . $this->topic['tid'], true, true);
} else {
$this->DB->insert('topic_views', array('views_tid' => $this->topic['tid']), true);
}
}
//-----------------------------------------
// Need to update this topic?
//-----------------------------------------
if ($this->topic['state'] == 'open') {
if (!$this->topic['topic_open_time'] or $this->topic['topic_open_time'] < $this->topic['topic_close_time']) {
if ($this->topic['topic_close_time'] and ($this->topic['topic_close_time'] <= time() and (time() >= $this->topic['topic_open_time'] or !$this->topic['topic_open_time']))) {
$this->topic['state'] = 'closed';
$this->DB->update('topics', array('state' => 'closed'), 'tid=' . $this->topic['tid'], true);
}
} else {
if ($this->topic['topic_open_time'] or $this->topic['topic_open_time'] > $this->topic['topic_close_time']) {
if ($this->topic['topic_close_time'] and ($this->topic['topic_close_time'] <= time() and time() <= $this->topic['topic_open_time'])) {
$this->topic['state'] = 'closed';
$this->DB->update('topics', array('state' => 'closed'), 'tid=' . $this->topic['tid'], true);
}
}
}
} else {
if ($this->topic['state'] == 'closed') {
if (!$this->topic['topic_close_time'] or $this->topic['topic_close_time'] < $this->topic['topic_open_time']) {
if ($this->topic['topic_open_time'] and ($this->topic['topic_open_time'] <= time() and (time() >= $this->topic['topic_close_time'] or !$this->topic['topic_close_time']))) {
$this->topic['state'] = 'open';
$this->DB->update('topics', array('state' => 'open'), 'tid=' . $this->topic['tid'], true);
}
} else {
if ($this->topic['topic_close_time'] or $this->topic['topic_close_time'] > $this->topic['topic_open_time']) {
if ($this->topic['topic_open_time'] and ($this->topic['topic_open_time'] <= time() and time() <= $this->topic['topic_close_time'])) {
$this->topic['state'] = 'open';
$this->DB->update('topics', array('state' => 'open'), 'tid=' . $this->topic['tid'], true);
}
}
}
}
}
//-----------------------------------------
// Current topic rating value
//-----------------------------------------
//.........這裏部分代碼省略.........
示例12: _loginAsMember
/**
* Action: Log in as member
*/
protected function _loginAsMember()
{
$memberID = intval($this->request['member_id']);
//-----------------------------------------
// Load member
//-----------------------------------------
$member = IPSMember::load($memberID, 'all');
if (!$member['member_id']) {
return $this->_memberView();
}
if ($member['g_access_cp']) {
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg('member_edit_admin');
}
//-----------------------------------------
// Generate a new log in key
//-----------------------------------------
$_ok = 1;
$_time = $this->settings['login_key_expire'] ? time() + intval($this->settings['login_key_expire']) * 86400 : 0;
$_sticky = $_time ? 0 : 1;
$_days = $_time ? $this->settings['login_key_expire'] : 365;
if ($this->settings['login_change_key'] or !$member['member_login_key'] or $this->settings['login_key_expire'] and time() > $member['member_login_key_expire']) {
$member['member_login_key'] = IPSMember::generateAutoLoginKey();
$core['member_login_key'] = $member['member_login_key'];
$core['member_login_key_expire'] = $_time;
}
//-----------------------------------------
// Cookie me softly?
//-----------------------------------------
if ($setCookies) {
IPSCookie::set("member_id", $member['member_id'], 1);
IPSCookie::set("pass_hash", $member['member_login_key'], $_sticky, $_days);
} else {
IPSCookie::set("member_id", $member['member_id'], 0);
IPSCookie::set("pass_hash", $member['member_login_key'], 0);
}
//-----------------------------------------
// Create / Update session
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/session/publicSessions.php', 'publicSessions');
$sessionClass = new $classToLoad();
$session_id = $sessionClass->convertGuestToMember(array('member_name' => $member['members_display_name'], 'member_id' => $member['member_id'], 'member_group' => $member['member_group_id'], 'login_type' => 0));
//-----------------------------------------
// Boink
//-----------------------------------------
$this->registry->output->silentRedirect($this->settings['board_url']);
}
示例13: doLogout
/**
* Log a user out
*
* @access public
* @param integer Flag to check md5 key
* @return mixed Error message or array [0=immediate|redirect, 1=words to show, 2=URL to send to]
*/
public function doLogout($check_key = true)
{
//-----------------------------------------
// INIT
//-----------------------------------------
if ($check_key) {
$key = $this->request['k'];
# Check for funny business
if ($key != $this->member->form_hash) {
$this->registry->getClass('output')->showError('bad_logout_key', 2012);
}
}
//-----------------------------------------
// Set some cookies
//-----------------------------------------
IPSCookie::set("member_id", "0");
IPSCookie::set("pass_hash", "0");
IPSCookie::set("anonlogin", "-1");
if (is_array($_COOKIE)) {
foreach ($_COOKIE as $cookie => $value) {
if (stripos($cookie, $this->settings['cookie_id'] . 'ipbforumpass') !== false) {
IPSCookie::set($cookie, '-', -1);
}
}
}
//-----------------------------------------
// Logout callbacks...
//-----------------------------------------
$this->han_login->logoutCallback();
//-----------------------------------------
// Do it..
//-----------------------------------------
$this->member->sessionClass()->convertMemberToGuest();
list($privacy, $loggedin) = explode('&', $this->memberData['login_anonymous']);
IPSMember::save($this->memberData['member_id'], array('core' => array('login_anonymous' => "{$privacy}&0", 'last_activity' => time())));
//-----------------------------------------
// Return..
//-----------------------------------------
$url = "";
if ($this->request['return'] and $this->request['return'] != "") {
$return = urldecode($this->request['return']);
if (strpos($return, "http://") === 0) {
return array('immediate', '', $return);
}
}
return array('redirect', $this->lang->words['thanks_for_logout'], $this->settings['base_url']);
}
示例14: unsetCookies
/**
* Unset cookies
*
* @access public
* @return void
*/
public function unsetCookies()
{
foreach (array('_user', '_session_key', '_expires', '_ss') as $key) {
IPSCookie::set($this->settings['fbc_api_id'] . $key, -1, 0, -1);
unset($_COOKIE[$this->settings['fbc_api_id'] . $key]);
}
IPSCookie::set($this->settings['fbc_api_id'], -1, 0, -1);
IPSCookie::set('fbsetting_' . $this->settings['fbc_api_id'], -1, 0, -1);
}
示例15: init
/**
* Init method
*
* @param mixed Extra data (can be used by extending classes)
* @return @e void
*/
public function init($extraData = null)
{
$this->lang->loadLanguageFile(array('public_topic'), 'forums');
/* Init some data */
$this->_settings = $this->settings();
$this->qpids = IPSCookie::get('comment_pids');
$this->request['selectedpids'] = IPSCookie::get('commentmodpids');
$this->request['selectedpidcount'] = intval(count(preg_split("/,/", $this->request['commentmodpids'], -1, PREG_SPLIT_NO_EMPTY)));
IPSCookie::set('commentmodpids', '', 0);
/* Load parser */
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser');
$this->parser = new $classToLoad();
/* set up parser */
$this->parser->set(array('memberData' => $this->memberData, 'parseBBCode' => 1, 'parseHtml' => 0, 'parseEmoticons' => 1, 'parseArea' => 'comments'));
}