本文整理匯總了PHP中IPSMember::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSMember::save方法的具體用法?PHP IPSMember::save怎麽用?PHP IPSMember::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSMember
的用法示例。
在下文中一共展示了IPSMember::save方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: doExecute
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute(ipsRegistry $registry)
{
//-----------------------------------------
// Got sess ID and mem ID?
//-----------------------------------------
if (!$this->member->getProperty('member_id')) {
$this->returnString("no");
}
//-----------------------------------------
// Check that we have the key
//-----------------------------------------
if ($this->settings['ipb_reg_number']) {
$this->settings['ipschat_account_key'] = $this->settings['ipb_reg_number'];
}
if (!$this->settings['ipschat_account_key']) {
$this->returnString("no");
}
//-----------------------------------------
// Can we access?
//-----------------------------------------
$access_groups = explode(",", $this->settings['ipschat_group_access']);
$my_groups = array($this->memberData['member_group_id']);
if ($this->memberData['mgroup_others']) {
$my_groups = array_merge($my_groups, explode(",", IPSText::cleanPermString($this->memberData['mgroup_others'])));
}
$access_allowed = false;
foreach ($my_groups as $group_id) {
if (in_array($group_id, $access_groups)) {
$access_allowed = 1;
break;
}
}
if (!$access_allowed) {
$this->returnString("no");
}
if ($this->memberData['chat_banned']) {
$this->returnString("no");
}
$permissions = 0;
if ($this->settings['ipschat_mods']) {
$mod_groups = explode(",", $this->settings['ipschat_mods']);
foreach ($my_groups as $group_id) {
if (in_array($group_id, $mod_groups)) {
$permissions = 1;
break;
}
}
}
if (!$permissions) {
$this->returnString("no");
}
//-----------------------------------------
// Ban member
//-----------------------------------------
IPSMember::save($this->request['id'], array('core' => array('chat_banned' => 1)));
//-----------------------------------------
// Something to return
//-----------------------------------------
$this->returnString("ok");
}
示例2: doExecute
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute(ipsRegistry $registry)
{
//-----------------------------------------
// INIT
//-----------------------------------------
$info = array();
$id = intval($this->memberData['member_id']);
//-----------------------------------------
// Get HTML and skin
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members');
//-----------------------------------------
// Can we access?
//-----------------------------------------
if (!$this->memberData['g_mem_info'] or $this->memberData['gbw_no_status_update']) {
$this->returnJsonError($this->lang->words['status_off']);
}
if (!$id) {
$this->returnJsonError($this->lang->words['status_off']);
}
$newStatus = trim(IPSText::getTextClass('bbcode')->stripBadWords(IPSText::parseCleanValue($_POST['new_status'])));
IPSMember::save($id, array('extendedProfile' => array('pp_status' => $newStatus, 'pp_status_update' => time())));
$this->returnJsonArray(array('status' => 'success', 'new_status' => $newStatus));
exit;
}
示例3: doExecute
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute(ipsRegistry $registry)
{
//-----------------------------------------
// Security check
//-----------------------------------------
if ($this->request['k'] != $this->member->form_hash) {
$this->registry->getClass('output')->showError('no_permission', 20314);
}
//-----------------------------------------
// INIT
//-----------------------------------------
$info = array();
$id = intval($this->memberData['member_id']);
//-----------------------------------------
// Get HTML and skin
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members');
//-----------------------------------------
// Can we access?
//-----------------------------------------
if (!$this->memberData['g_mem_info']) {
$this->registry->output->showError('status_off', 10268);
}
if (!$id) {
$this->registry->output->showError('status_off', 10269);
}
$newStatus = trim(IPSText::getTextClass('bbcode')->stripBadWords($this->request['new_status']));
IPSMember::save($id, array('extendedProfile' => array('pp_status' => $newStatus, 'pp_status_update' => time())));
$this->registry->output->redirectScreen($this->lang->words['status_was_changed'], $this->settings['base_url'] . 'showuser=' . $id, $this->memberData['members_seo_name']);
}
示例4: _storeFacebookAuthDetails
/**
* Stores main facebook data
*
* @return @e void [Outputs JSON to browser AJAX call]
*/
protected function _storeFacebookAuthDetails()
{
$rToken = trim($this->request['accessToken']);
$rUserId = trim($this->request['userId']);
# Do not INTVAL as Facebook UID > Intval() max
/* Store it */
IPSMember::save($this->memberData['member_id'], array('core' => array('fb_uid' => $rUserId, 'fb_token' => $rToken)));
$this->returnJsonArray(array('status' => 'ok'));
}
示例5: doExecute
/**
* Main function executed automatically by the controller
*
* @param object $registry Registry object
* @return @e void
*/
public function doExecute(ipsRegistry $registry)
{
$member = IPSMember::load(intval($this->request['member']), 'none', 'id');
if ($member['member_id'] and $this->request['key'] == md5($member['email'] . ':' . $member['members_pass_hash'])) {
IPSMember::save($member['member_id'], array('members' => array('allow_admin_mails' => 0)));
$this->registry->getClass('output')->addContent($this->registry->output->getTemplate('ucp')->unsubscribed());
$this->registry->getClass('output')->sendOutput();
}
$this->registry->output->showError('email_no_unsubscribe');
}
示例6: doExecute
/**
* Class entry point
*
* @param object Registry reference
* @return @e void [Outputs to screen]
*/
public function doExecute(ipsRegistry $registry)
{
if (!$this->memberData['member_id']) {
$this->returnNull();
}
if ($this->memberData['members_auto_dst'] == 1 and $this->settings['time_dst_auto_correction']) {
$newValue = $this->memberData['dst_in_use'] ? 0 : 1;
IPSMember::save($this->memberData['member_id'], array('members' => array('dst_in_use' => $newValue)));
}
$this->returnNull();
}
示例7: _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);
}
示例8: doExecute
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute(ipsRegistry $registry)
{
if (!$this->memberData['member_id']) {
if ($this->request['xml']) {
$this->returnNull();
} else {
$this->registry->output->silentRedirect($this->settings['base_url']);
}
}
if ($this->memberData['members_auto_dst'] == 1 and $this->settings['time_dst_auto_correction']) {
$newValue = $this->memberData['dst_in_use'] ? 0 : 1;
IPSMember::save($this->memberData['member_id'], array('members' => array('dst_in_use' => $newValue)));
}
if ($this->request['xml'] == 1) {
$this->returnNull();
} else {
$this->registry->output->silentRedirect($this->settings['base_url']);
}
}
示例9: remove
/**
* Remove a photo for a member
* @param int $member_id
* @return string
*/
public function remove($member_id)
{
/* Fix up upload directory */
$paths = $this->_getProfileUploadPaths();
$upload_path = $paths['path'];
$upload_dir = $paths['dir'];
$memberData = IPSMember::load($member_id);
$bwOptions = IPSBWOptions::thaw($memberData['fb_bwoptions'], 'facebook');
$tcbwOptions = IPSBWOptions::thaw($memberData['tc_bwoptions'], 'twitter');
$bwOptions['fbc_s_pic'] = 0;
$tcbwOptions['tc_s_pic'] = 0;
/* We should also disable Gravatar Bug #38739 */
$memBitwise = IPSBWOptions::thaw($memberData['members_bitoptions'], 'members');
$memBitwise['bw_disable_gravatar'] = 1;
$memBitwise = IPSBWOptions::freeze($memBitwise, 'members');
$this->removeUploadedPhotos($member_id, $upload_path);
IPSMember::save($member_id, array('core' => array('members_bitoptions' => $memBitwise), 'extendedProfile' => array('pp_main_photo' => '', 'pp_main_width' => 0, 'pp_main_height' => 0, 'pp_thumb_photo' => '', 'pp_thumb_width' => 0, 'pp_thumb_height' => 0, 'pp_photo_type' => 'none', 'pp_gravatar' => '', 'fb_photo' => '', 'fb_photo_thumb' => '', 'fb_bwoptions' => IPSBWOptions::freeze($bwOptions, 'facebook'), 'tc_photo' => '', 'tc_bwoptions' => IPSBWOptions::freeze($tcbwOptions, 'twitter'))));
return true;
}
示例10: show
/**
* Shows the editor
* print $editor->show( 'message', 'reply-topic-1244' );
* @param string Field
* @param array Options: Auto save key, a unique key for the page. If supplied, editor will auto-save at regular intervals. Works for logged in members only
* @param string Optional content
*/
public function show($fieldName, $options = array(), $content = '')
{
$showEditor = TRUE;
/* Have we forced RTE? */
if (!empty($this->request['isRte'])) {
$options['isRte'] = intval($this->request['isRte']);
}
$_autoSaveKeyOrig = !empty($options['autoSaveKey']) ? $options['autoSaveKey'] : '';
$options['editorName'] = !empty($options['editorName']) ? $options['editorName'] : $this->_fetchEditorName();
$options['autoSaveKey'] = $_autoSaveKeyOrig && $this->memberData['member_id'] ? $this->_generateAutoSaveKey($_autoSaveKeyOrig) : '';
$options['type'] = !empty($options['type']) && $options['type'] == 'mini' ? 'mini' : 'full';
$options['minimize'] = intval($options['minimize']);
$options['height'] = intval($options['height']);
$options['isTypingCallBack'] = !empty($options['isTypingCallBack']) ? $options['isTypingCallBack'] : '';
$options['noSmilies'] = !empty($options['noSmilies']) ? true : false;
$options['delayInit'] = !empty($options['delayInit']) ? 1 : 0;
$options['smilies'] = $this->fetchEmoticons();
$options['bypassCKEditor'] = !empty($options['bypassCKEditor']) ? 1 : ($this->getRteEnabled() ? 0 : 1);
$options['legacyMode'] = !empty($options['legacyMode']) ? $options['legacyMode'] : 'on';
$html = '';
/* Fetch disabled tags */
$parser = $this->_newParserObject();
$options['disabledTags'] = $parser->getDisabledTags();
$this->setLegacyMode($options['legacyMode'] == 'on' ? true : false);
if (isset($options['recover'])) {
$content = $_POST['Post'];
}
/* Try and sniff out entered HTML */
if (IN_ACP and empty($options['isHtml'])) {
$options['isHtml'] = intval($this->_tryAndDetermineHtmlStatusTheHackyWay($content ? $content : $this->getContent()));
}
if (!empty($options['isHtml'])) {
$this->setIsHtml(true);
if (IN_ACP) {
$options['type'] = 'ipsacp';
}
} else {
if ($this->getIsHtml()) {
$options['isHtml'] = 1;
}
}
/* inline content */
if ($content) {
$this->setContent($this->getLegacyMode() ? str_replace('\\\'', '\'', $content) : $content);
}
/* Is this legacy bbcode? If we are using RTE, we need to send HTML.
@link http://community.invisionpower.com/resources/bugs.html/_/ip-board/old-style-image-links-do-not-parse-in-editor-r42078 */
if ($parser->isBBCode($this->getContent())) {
$this->setContent($parser->htmlToEditor($this->getContent()));
}
/* Store last editor ID in case calling scripts need it */
$this->settings['_lastEditorId'] = $options['editorName'];
if (IN_ACP) {
$html = $this->registry->getClass('output')->global_template->editor($fieldName, $this->getContent(), $options, $this->getAutoSavedContent($_autoSaveKeyOrig));
} else {
$warningInfo = '';
$acknowledge = FALSE;
//-----------------------------------------
// Warnings
//-----------------------------------------
if (isset($options['warnInfo']) and $this->memberData['member_id']) {
$message = '';
/* Have they been restricted from posting? */
if ($this->memberData['restrict_post']) {
$data = IPSMember::processBanEntry($this->memberData['restrict_post']);
if ($data['date_end']) {
if (time() >= $data['date_end']) {
IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0)));
} else {
$message = sprintf($this->lang->words['warnings_restrict_post_temp'], $this->lang->getDate($data['date_end'], 'JOINED'));
}
} else {
$message = $this->lang->words['warnings_restrict_post_perm'];
}
if ($this->memberData['unacknowledged_warnings']) {
$warn = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_member={$this->memberData['member_id']} AND wl_rpa<>0", 'order' => 'wl_date DESC', 'limit' => 1));
if ($warn['wl_id']) {
$moredetails = "<a href='javascript:void(0);' onclick='warningPopup( this, {$warn['wl_id']} )'>{$this->lang->words['warnings_moreinfo']}</a>";
}
}
if ($options['warnInfo'] == 'full') {
$this->registry->getClass('output')->showError("{$message} {$moredetails}", 103126, null, null, 403);
} else {
$showEditor = FALSE;
}
}
/* Nope? - Requires a new if in case time restriction got just removed */
if (empty($message)) {
/* Do they have any warnings they have to acknowledge? */
if ($this->memberData['unacknowledged_warnings']) {
$unAcknowledgedWarns = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_member={$this->memberData['member_id']} AND wl_acknowledged=0", 'order' => 'wl_date DESC', 'limit' => 1));
if ($unAcknowledgedWarns['wl_id']) {
if ($options['warnInfo'] == 'full') {
//.........這裏部分代碼省略.........
示例11: __create_user_session
/**
* Converge_Server::__create_user_session()
*
* Has to return at least the member ID, member log in key and session ID
*
* @access protected
* @param object $member Member object (can access as an array of member information thx to SPL)
* @return array $session Session information
*
* @deprecated Doesn't seem to be used anymore, need to verify properly for the next major revision
*/
protected function __create_user_session($member)
{
//-----------------------------------------
// INIT
//-----------------------------------------
$update = array();
//-----------------------------------------
// Generate a new log in key
//-----------------------------------------
if (!$member['member_login_key']) {
$update['member_login_key'] = IPSMember::generateAutoLoginKey();
}
//-----------------------------------------
// Set our privacy status
//-----------------------------------------
$update['login_anonymous'] = '0&1';
//-----------------------------------------
// Update member?
//-----------------------------------------
if (is_array($update) and count($update)) {
IPSMember::save($member['member_id'], array('core' => $update));
}
//-----------------------------------------
// Still here? Create a new session
//-----------------------------------------
$this->registry->member()->setMember($member['member_id']);
require_once IPS_ROOT_PATH . 'sources/classes/session/publicSessions.php';
/*noLibHook*/
require_once IPS_ROOT_PATH . 'sources/classes/session/convergeSessions.php';
/*noLibHook*/
$session = new convergeSessions($this->registry);
$session->time_now = time();
$update['publicSessionID'] = $session->createMemberSession();
return array_merge($this->memberData, $update);
}
示例12: fetchOutput
/**
* Fetches the output
*
* @access public
* @param string Output gathered
* @param string Title of the document
* @param array Navigation gathered
* @param array Array of document head items
* @param array Array of JS loader items
* @param array Array of extra data
* @return string Output to be printed to the client
*/
public function fetchOutput($output, $title, $navigation, $documentHeadItems, $jsLoaderItems, $extraData = array())
{
//-----------------------------------------
// INIT
//-----------------------------------------
$system_vars_cache = $this->caches['systemvars'];
$pmData = FALSE;
$notificationLatest = array();
//-----------------------------------------
// NORMAL
//-----------------------------------------
if ($this->_outputType == 'normal') {
//-----------------------------------------
// Do we have a notification show?
//-----------------------------------------
if (!empty($this->memberData['msg_show_notification']) and $this->memberData['_cache']['show_notification_popup']) {
if (!$this->settings['board_offline'] or $this->memberData['g_access_offline']) {
if (strpos(ipsRegistry::$settings['query_string_real'], 'module=messaging') === false) {
IPSMember::save($this->memberData['member_id'], array('core' => array('msg_show_notification' => 0)));
/* Grab inline notifications... */
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications');
$notifyLibrary = new $classToLoad($this->registry);
$notifyLibrary->setMember($this->memberData);
$tmp = $notifyLibrary->getLatestNotificationForInlinePopUp();
$weNeed = array('notify_title', 'member_member_id', 'member_PhotoTag', 'member_members_display_name', 'date_parsed', 'title', 'url', 'type', 'content', 'member_HoverCard');
foreach ($weNeed as $k) {
$notificationLatest[$k] = $tmp[$k];
}
}
}
}
//-----------------------------------------
// Add identifier URL
//-----------------------------------------
$http = 'http://';
if (strpos($this->settings['board_url'], 'https://') === 0) {
$http = 'https://';
}
$this->addMetaTag('identifier-url', $http . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
//-----------------------------------------
// Add in task image?
//-----------------------------------------
$task = '';
$system_vars_cache['task_next_run'] = isset($system_vars_cache['task_next_run']) ? $system_vars_cache['task_next_run'] : 0;
if (!$this->settings['task_use_cron'] and time() >= $system_vars_cache['task_next_run'] or defined('FORCE_TASK_KEY')) {
$_url = !$this->registry->getClass('output')->isHTTPS ? $this->settings['base_url'] : $this->settings['base_url_https'];
$task = "<div><img src='" . $_url . "app=core&module=task' alt='' style='border: 0px;height:1px;width:1px;' /></div>";
}
//-----------------------------------------
// Grab output
//-----------------------------------------
/* Inline msg */
$inlineMsg = $this->member->sessionClass()->getInlineMessage();
$templateName = 'globalTemplate';
$templateGroup = 'global';
if ($this->useMinimalWrapper) {
$templateName = 'globalTemplateMinimal';
$templateGroup = 'global_other';
}
/* Do pagination */
if (strstr($title, '<%pageNumber%>')) {
$replace = $this->_current_page_title ? ' ' . $this->lang->words['page_title_page'] . ' ' . $this->_current_page_title : '';
$title = str_replace('<%pageNumber%>', $replace, $title);
} else {
if ($this->_current_page_title) {
$title = $title . ' ' . $this->lang->words['page_title_page'] . ' ' . $this->_current_page_title;
}
}
$finalOutput = $this->output->getTemplate($templateGroup)->{$templateName}($output, $documentHeadItems, $this->_css, $jsLoaderItems, $this->_metaTags, array('title' => $title, 'applications' => $this->core_fetchApplicationData(), 'page' => $this->_current_page_title, 'notifications' => $notificationLatest ? IPSText::jsonEncodeForTemplate($notificationLatest) : '', 'inlineMsg' => $inlineMsg), array('navigation' => $navigation, 'adHeaderCode' => !empty($extraData['adHeaderCode']) ? $extraData['adHeaderCode'] : '', 'adFooterCode' => !empty($extraData['adFooterCode']) ? $extraData['adFooterCode'] : ''), array('time' => $this->registry->getClass('class_localization')->getDate(time(), 'SHORT', 1), 'mark_read_apps' => IPSLib::getEnabledApplications('itemMarking'), 'lang_chooser' => $this->html_buildLanguageDropDown(), 'skin_chooser' => $this->html_fetchSetsDropDown(), 'copyright' => $this->html_fetchCopyright()), array('ex_time' => (isset($this->request['faster']) and $this->request['faster'] == 'yes') ? $this->_getFasterText() : sprintf("%.4f", IPSDebug::endTimer()), 'gzip_status' => $this->settings['disable_gzip'] == 1 ? $this->lang->words['gzip_off'] : $this->lang->words['gzip_on'], 'server_load' => ipsRegistry::$server_load, 'queries' => $this->DB->getQueryCount(), 'task' => $task));
} else {
if ($this->_outputType == 'redirect') {
$extraData['full'] = 1;
# SEO?
if ($extraData['seoTitle']) {
$extraData['url'] = $this->output->buildSEOUrl($extraData['url'], 'none', $extraData['seoTitle'], $extraData['seoTemplate']);
}
$finalOutput = $this->output->getTemplate('global_other')->redirectTemplate($documentHeadItems, $this->_css, $jsLoaderItems, $extraData['text'], $extraData['url'], $extraData['full']);
} else {
if ($this->_outputType == 'popup') {
$finalOutput = $this->output->getTemplate('global_other')->displayPopUpWindow($documentHeadItems, $this->_css, $jsLoaderItems, $title, $output);
}
}
}
//-----------------------------------------
// Set a class on the body for print
//-----------------------------------------
if ($this->_printOnly) {
$finalOutput = str_replace("<body", "<body class='printpreview'", $finalOutput);
//.........這裏部分代碼省略.........
示例13: verifyLogin
//.........這裏部分代碼省略.........
return array(null, null, 'validating_remote', "<a href='{$this->revalidate_url}' target='_blank'>" . ipsRegistry::getClass('class_localization')->words['resend_val'] . "</a>");
}
} else {
return array(null, null, 'wrong_auth');
}
}
}
}
}
//-----------------------------------------
// Is this a partial member?
// Not completed their sign in?
//-----------------------------------------
if ($member['members_created_remote'] and isset($member['full']) and !$member['full']) {
return array($this->registry->getClass('class_localization')->words['partial_login'], $this->settings['base_url'] . 'app=core&module=global&section=register&do=complete_login&mid=' . $member['member_id'] . '&key=' . $member['timenow']);
}
//-----------------------------------------
// 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 (!$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 ($this->request['rememberMe']) {
IPSCookie::set("member_id", $member['member_id'], 1, 0, FALSE, TRUE);
IPSCookie::set("pass_hash", $member['member_login_key'], $_sticky, $_days, FALSE, TRUE);
IPSCookie::set("ipsconnect_" . md5($this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php'), '1', $_sticky, $_days, FALSE, FALSE);
} else {
// Ticket 824266
// IPSCookie::set( "member_id" , $member['member_id'], 0 );
// IPSCookie::set( "pass_hash" , $member['member_login_key'], 0 );
IPSCookie::set("ipsconnect_" . md5($this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php'), '1', 0, 0, FALSE, FALSE);
}
//-----------------------------------------
// Remove any COPPA cookies previously set
//-----------------------------------------
IPSCookie::set("coppa", '0', 0);
//-----------------------------------------
// Update profile if IP addr missing
//-----------------------------------------
if ($member['ip_address'] == "" or $member['ip_address'] == '127.0.0.1') {
$core['ip_address'] = $this->registry->member()->ip_address;
}
//-----------------------------------------
// Create / Update session
//-----------------------------------------
$privacy = $member['g_hide_online_list'] || empty($this->settings['disable_anonymous']) && !empty($this->request['anonymous']) ? 1 : 0;
$session_id = $this->registry->member()->sessionClass()->convertGuestToMember(array('member_name' => $member['members_display_name'], 'member_id' => $member['member_id'], 'member_group' => $member['member_group_id'], 'login_type' => $privacy));
if (!empty($this->request['referer']) and $this->request['section'] != 'register') {
if (stripos($this->request['referer'], 'section=register') or stripos($this->request['referer'], 'section=login') or stripos($this->request['referer'], 'section=lostpass') or stripos($this->request['referer'], CP_DIRECTORY . '/')) {
$url = $this->settings['base_url'];
} else {
$url = str_replace('&', '&', $this->request['referer']);
if ($this->registry->member()->session_type == 'cookie') {
$url = preg_replace('#s=(\\w){32}#', "", $url);
}
}
} else {
$url = $this->settings['base_url'];
}
//-----------------------------------------
// Set our privacy status
//-----------------------------------------
$core['login_anonymous'] = intval($privacy) . '&1';
$core['failed_logins'] = '';
$core['failed_login_count'] = 0;
IPSMember::save($member['member_id'], array('core' => $core));
//-----------------------------------------
// Clear out any passy change stuff
//-----------------------------------------
$this->DB->delete('validating', 'member_id=' . $this->registry->member()->getProperty('member_id') . ' AND lost_pass=1');
//-----------------------------------------
// Run member sync
//-----------------------------------------
$member['plainPassword'] = $password;
IPSLib::runMemberSync('onLogin', $member);
unset($member['plainPassword']);
//-----------------------------------------
// Redirect them to either the board
// index, or where they came from
//-----------------------------------------
if (!empty($this->request['return'])) {
$return = urldecode($this->request['return']);
if (strpos($return, "http://") === 0 || strpos($return, "https://") === 0) {
return array($this->registry->getClass('class_localization')->words['partial_login'], $return);
}
}
//-----------------------------------------
// Still here?
//-----------------------------------------
return array($this->registry->getClass('class_localization')->words['partial_login'], $url);
}
示例14: _memberDoEdit
//.........這裏部分代碼省略.........
if (!IPSLib::appIsInstalled($app_dir)) {
continue;
}
if (file_exists(IPSLib::getAppDir($app_dir) . '/extensions/admin/member_form.php')) {
require_once IPSLib::getAppDir($app_dir) . '/extensions/admin/member_form.php';
$_class = 'admin_member_form__' . $app_dir;
$_object = new $_class($this->registry);
$remote = $_object->getForSave();
$additionalCore = array_merge($remote['core'], $additionalCore);
$additionalExtended = array_merge($remote['extendedProfile'], $additionalExtended);
}
}
//-----------------------------------------
// Fix custom title
// @see http://forums./index.php?app=tracker&showissue=17383
//-----------------------------------------
$memberTitle = $this->request['title'];
$rankCache = ipsRegistry::cache()->getCache('ranks');
if (is_array($rankCache) && count($rankCache)) {
foreach ($rankCache as $k => $v) {
if ($member['posts'] >= $v['POSTS']) {
/* If this is the title passed to us from the form, we didn't have a custom title */
if ($v['TITLE'] == $memberTitle) {
$memberTitle = '';
}
break;
}
}
}
$newMember = array('member_group_id' => intval($this->request['member_group_id']), 'title' => $memberTitle, 'time_offset' => floatval($this->request['time_offset']), 'language' => $this->request['language'], 'skin' => intval($this->request['skin']), 'hide_email' => intval($this->request['hide_email']), 'allow_admin_mails' => intval($this->request['allow_admin_mails']), 'view_sigs' => intval($this->request['view_sigs']), 'view_pop' => intval($this->request['view_pop']), 'email_pm' => intval($this->request['email_pm']), 'posts' => intval($this->request['posts']), 'bday_day' => intval($this->request['bday_day']), 'bday_month' => intval($this->request['bday_month']), 'bday_year' => intval($this->request['bday_year']), 'warn_level' => intval($this->request['warn_level']), 'members_disable_pm' => intval($this->request['members_disable_pm']), 'mgroup_others' => $_POST['mgroup_others'] ? ',' . implode(",", $_POST['mgroup_others']) . ',' : '', 'identity_url' => trim($this->request['identity_url']));
//-----------------------------------------
// Throw to the DB
//-----------------------------------------
IPSMember::save($this->request['member_id'], array('core' => array_merge($newMember, $additionalCore), 'extendedProfile' => array_merge(array('pp_gender' => $this->request['pp_gender'] == 'male' ? 'male' : ($this->request['pp_gender'] == 'female' ? 'female' : ''), 'pp_bio_content' => IPSText::mbsubstr(nl2br($this->request['pp_bio_content']), 0, 300), 'pp_about_me' => $aboutme, 'signature' => $signature, 'pp_reputation_points' => intval($this->request['pp_reputation_points']), 'pp_status' => $this->request['pp_status'], 'pp_setting_count_visitors' => intval($this->request['pp_setting_count_visitors']), 'pp_setting_count_comments' => intval($this->request['pp_setting_count_comments']), 'pp_setting_count_friends' => intval($this->request['pp_setting_count_friends']), 'pp_setting_notify_comments' => $this->request['pp_setting_notify_comments'], 'pp_setting_notify_friend' => $this->request['pp_setting_notify_friend'], 'pp_setting_moderate_comments' => intval($this->request['pp_setting_moderate_comments']), 'pp_setting_moderate_friends' => intval($this->request['pp_setting_moderate_friends'])), $additionalExtended)));
if ($member['member_group_id'] != $newMember['member_group_id']) {
IPSLib::runMemberSync('onGroupChange', $this->request['member_id'], $newMember['member_group_id']);
//-----------------------------------------
// Remove restrictions if member demoted
// Commenting out as this may cause more problems than it's worth
// e.g. if you had accidentally changed their group, you'd need to reconfigure all restrictions
//-----------------------------------------
/*if( !$this->caches['group_cache'][ $newMember['member_group_id'] ]['g_access_cp'] )
{
$this->DB->delete( 'admin_permission_rows', 'row_id=' . $member['member_id'] . " AND row_id_type='member'" );
}*/
}
//-----------------------------------------
// Restriction permissions stuff
//-----------------------------------------
if (is_array($this->registry->getClass('class_permissions')->restrictions_row) and count($this->registry->getClass('class_permissions')->restrictions_row)) {
$is_admin = 0;
$groups = ipsRegistry::cache()->getCache('group_cache');
if (is_array($this->request['mgroup_others']) and count($this->request['mgroup_others'])) {
foreach ($this->request['mgroup_others'] as $omg) {
if ($groups[intval($omg)]['g_access_cp']) {
$is_admin = 1;
break;
}
}
}
if ($groups[intval($this->request['member_group_id'])]['g_access_cp']) {
$is_admin = 1;
}
if ($is_admin) {
//-------------------------------------------------
// Copy restrictions if they do not have any yet...
示例15: lostPasswordValidate
/**
* Validates a lost password request
*
* @return @e void
*/
public function lostPasswordValidate()
{
/* Check for input and it's in a valid format. */
$in_user_id = intval(trim(urldecode($this->request['uid'])));
$in_validate_key = IPSText::md5Clean(trim(urldecode($this->request['aid'])));
/* Check Input */
if (!$in_validate_key) {
$this->registry->output->showError('validation_key_incorrect', 1015);
}
if (!preg_match('/^(?:\\d){1,}$/', $in_user_id)) {
$this->registry->output->showError('uid_key_incorrect', 1016);
}
/* Attempt to get the profile of the requesting user */
$member = IPSMember::load($in_user_id);
if (!$member['member_id']) {
$this->registry->output->showError('lostpass_no_member', 1017);
}
/* Get validating info.. */
$validate = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'validating', 'where' => 'member_id=' . $in_user_id . ' and lost_pass=1'));
if (!$validate['member_id']) {
$this->registry->output->showError('lostpass_not_validating', 1018);
}
if ($validate['new_reg'] == 1 && $this->settings['reg_auth_type'] == "admin") {
$this->registry->output->showError('lostpass_new_reg', 4010, true);
}
if ($validate['vid'] != $in_validate_key) {
$this->registry->output->showError('lostpass_key_wrong', 1019);
} else {
/* On the same page? */
if ($validate['lost_pass'] != 1) {
$this->registry->output->showError('lostpass_not_lostpass', 4011, true);
}
/* Send a new random password? */
if ($this->settings['lp_method'] == 'random') {
//-----------------------------------------
// INIT
//-----------------------------------------
$save_array = array();
//-----------------------------------------
// Generate a new random password
//-----------------------------------------
$new_pass = IPSMember::makePassword();
//-----------------------------------------
// Generate a new salt
//-----------------------------------------
$salt = IPSMember::generatePasswordSalt(5);
$salt = str_replace('\\', "\\\\", $salt);
//-----------------------------------------
// New log in key
//-----------------------------------------
$key = IPSMember::generateAutoLoginKey();
//-----------------------------------------
// Update...
//-----------------------------------------
$save_array['members_pass_salt'] = $salt;
$save_array['members_pass_hash'] = md5(md5($salt) . md5($new_pass));
$save_array['member_login_key'] = $key;
$save_array['member_login_key_expire'] = $this->settings['login_key_expire'] * 60 * 60 * 24;
$save_array['failed_logins'] = null;
$save_array['failed_login_count'] = 0;
//-----------------------------------------
// Load handler...
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login');
$this->han_login = new $classToLoad($this->registry);
$this->han_login->init();
$this->han_login->changePass($member['email'], md5($new_pass), $new_pass, $member);
//if ( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' )
//{
// $this->registry->output->showError( $this->lang->words['lostpass_external_fail'], 2013 );
//}
IPSMember::save($member['member_id'], array('members' => $save_array));
/* Password has been changed! */
IPSLib::runMemberSync('onPassChange', $member['member_id'], $new_pass);
//-----------------------------------------
// Send out the email...
//-----------------------------------------
$message = array('NAME' => $member['members_display_name'], 'THE_LINK' => $this->registry->getClass('output')->buildUrl('app=core&module=usercp&tab=core&area=email', 'publicNoSession'), 'PASSWORD' => $new_pass, 'LOGIN' => $this->registry->getClass('output')->buildUrl('app=core&module=global§ion=login', 'publicNoSession'), 'USERNAME' => $member['name'], 'EMAIL' => $member['email'], 'ID' => $member['member_id']);
IPSText::getTextClass('email')->setPlainTextTemplate(IPSText::getTextClass('email')->getTemplate("lost_pass_email_pass", $member['language']));
IPSText::getTextClass('email')->buildPlainTextContent($message);
IPSText::getTextClass('email')->buildHtmlContent($message);
IPSText::getTextClass('email')->subject = $this->lang->words['lp_random_pass_subject'] . ' ' . $this->settings['board_name'];
IPSText::getTextClass('email')->to = $member['email'];
IPSText::getTextClass('email')->sendMail();
$this->registry->output->setTitle($this->lang->words['activation_form'] . ' - ' . ipsRegistry::$settings['board_name']);
$this->output = $this->registry->getClass('output')->getTemplate('register')->showLostPassWaitRandom($member);
} else {
if ($_POST['pass1'] == "") {
$this->registry->output->showError('pass_blank', 10184);
}
if ($_POST['pass2'] == "") {
$this->registry->output->showError('pass_blank', 10185);
}
$pass_a = trim($this->request['pass1']);
$pass_b = trim($this->request['pass2']);
//.........這裏部分代碼省略.........