First commit
This commit is contained in:
0
source/module/member/index.htm
Normal file
0
source/module/member/index.htm
Normal file
117
source/module/member/member_connect.php
Normal file
117
source/module/member/member_connect.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: member_connect.php 34239 2013-11-21 08:31:14Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
define('NOROBOT', TRUE);
|
||||
|
||||
if(!$_G['setting']['connect']['allow']) {
|
||||
showmessage('qqconnect:qqconnect_closed');
|
||||
}
|
||||
|
||||
if($_GET['action'] == 'login') { // debug 已有账号,绑定我的账号走此分支
|
||||
|
||||
$ctl_obj = new logging_ctl();
|
||||
$_G['setting']['seccodestatus'] = 0;
|
||||
|
||||
$ctl_obj->connect_guest = $connect_guest;
|
||||
|
||||
$ctl_obj->extrafile = libfile('member/connect_logging', 'module');
|
||||
$ctl_obj->template = 'member/login';
|
||||
$ctl_obj->on_login();
|
||||
|
||||
} else { // debug 完善我的资料,即添加个新的论坛账号走此分支
|
||||
|
||||
$_G['qc']['connect_auth_hash'] = $_GET['con_auth_hash'];
|
||||
if(!$_G['qc']['connect_auth_hash']) {
|
||||
$_G['qc']['connect_auth_hash'] = $_G['cookie']['con_auth_hash'];
|
||||
}
|
||||
|
||||
$conopenid = authcode($_G['qc']['connect_auth_hash']);
|
||||
|
||||
$ctl_obj = new register_ctl();
|
||||
$ctl_obj->setting = $_G['setting'];
|
||||
|
||||
if($_G['setting']['regconnect']) {
|
||||
$ctl_obj->setting['regstatus'] = $ctl_obj->setting['regstatus'] ? $ctl_obj->setting['regstatus'] : 1;
|
||||
}
|
||||
|
||||
$_G['setting']['regclosed'] = $_G['setting']['regconnect'] && !$_G['setting']['regstatus'];
|
||||
|
||||
loadcache('connect_blacklist');
|
||||
if(in_array($conopenid, $_G['cache']['connect_blacklist'])) {
|
||||
showmessage('qqconnect:connect_uin_in_blacklist', $referer, array('changeqqurl' => $_G['connect']['discuz_change_qq_url']));
|
||||
}
|
||||
|
||||
$_G['qc']['uinlimit'] = $_G['setting']['connect']['register_uinlimit'] && C::t('#qqconnect#connect_memberbindlog')->count_uid_by_openid_type($conopenid, '1') >= $_G['setting']['connect']['register_uinlimit'];
|
||||
if($_G['qc']['uinlimit']) {
|
||||
$_G['setting']['regconnect'] = false;
|
||||
}
|
||||
if(!$_G['setting']['regconnect']) {
|
||||
$ctl_obj->showregisterform = 0;
|
||||
$ctl_obj->setting['sitemessage']['register'] = array();
|
||||
}
|
||||
|
||||
if($_G['qc']['uinlimit']) {
|
||||
$ctl_obj->showregisterform = 0;
|
||||
$ctl_obj->setting['sitemessage']['register'] = array();
|
||||
$ctl_obj->setting['regconnect'] = false;
|
||||
}
|
||||
|
||||
if($_G['setting']['connect']['register_regverify']) {
|
||||
$ctl_obj->setting['regverify'] = 0;
|
||||
}
|
||||
$_G['setting']['seccodestatus'] = 0;
|
||||
$_G['setting']['secqaa']['status'] = 0;
|
||||
|
||||
$ctl_obj->setting['sendregisterurl'] = false;
|
||||
|
||||
$ctl_obj->connect_guest = $connect_guest;
|
||||
|
||||
loadcache(array('fields_connect_register', 'profilesetting'));
|
||||
foreach($_G['cache']['fields_connect_register'] as $field => $data) {
|
||||
unset($_G['cache']['fields_register'][$field]);
|
||||
}
|
||||
$_G['cache']['profilesetting']['gender']['unchangeable'] = 0;
|
||||
$_G['cache']['profilesetting']['birthyear']['unchangeable'] = 0;
|
||||
$_G['cache']['profilesetting']['birthmonth']['unchangeable'] = 0;
|
||||
$_G['cache']['profilesetting']['birthday']['unchangeable'] = 0;
|
||||
$_G['cache']['fields_register'] = array_merge($_G['cache']['fields_connect_register'], $_G['cache']['fields_register']);
|
||||
|
||||
if($_G['setting']['connect']['register_invite']) {
|
||||
$ctl_obj->setting['regstatus'] = 1;
|
||||
}
|
||||
|
||||
if(!$_G['setting']['connect']['register_regverify']) {
|
||||
$ctl_obj->setting['seccodestatus'] = $_G['setting']['seccodestatus'];
|
||||
$ctl_obj->setting['secqaa']['status'] = $_G['setting']['secqaa']['status'];
|
||||
}
|
||||
|
||||
if(!defined('IN_MOBILE') || empty($_GET[$_G['setting']['reginput']['password']])) {
|
||||
$ctl_obj->setting['ignorepassword'] = 1;
|
||||
}
|
||||
$ctl_obj->setting['checkuinlimit'] = 1;
|
||||
$ctl_obj->setting['strongpw'] = 0;
|
||||
$ctl_obj->setting['pwlength'] = 0;
|
||||
|
||||
if($_GET['ac'] == 'bind') {
|
||||
$ctl_obj->setting['reglinkname'] = lang('plugin/qqconnect', 'connect_register_bind');
|
||||
} else {
|
||||
$ctl_obj->setting['reglinkname'] = lang('plugin/qqconnect', 'connect_register_profile');
|
||||
}
|
||||
|
||||
$ctl_obj->extrafile = libfile('member/connect_register', 'module');
|
||||
$ctl_obj->template = 'member/register';
|
||||
$ctl_obj->on_register();
|
||||
|
||||
}
|
||||
|
||||
?>
|
56
source/module/member/member_connect_logging.php
Normal file
56
source/module/member/member_connect_logging.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: member_connect_logging.php 33543 2013-07-03 06:01:33Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if(!empty($_POST)) {
|
||||
if($result['member']['conisbind']) {
|
||||
showmessage('qqconnect:connect_register_bind_already');
|
||||
}
|
||||
if($result['member']['groupid'] == 8) {
|
||||
showmessage('qqconnect:connect_register_bind_need_inactive');
|
||||
}
|
||||
|
||||
$conuin = $this->connect_guest['conuin'];
|
||||
$conuinsecret = $this->connect_guest['conuinsecret'];
|
||||
$conopenid = $this->connect_guest['conopenid'];
|
||||
$conuintoken = $this->connect_guest['conuintoken'];
|
||||
|
||||
$user_auth_fields = 1;
|
||||
$conispublishfeed = 0;
|
||||
$conispublisht = 0;
|
||||
|
||||
$is_use_qqshow = 0;
|
||||
|
||||
if ($conopenid) {
|
||||
C::t('#qqconnect#common_member_connect')->insert(array('uid' => $uid, 'conuin' => $conuin, 'conuinsecret' => $conuinsecret, 'conuintoken' => $conuintoken, 'conopenid' => $conopenid, 'conispublishfeed' => $conispublishfeed, 'conispublisht' => $conispublisht, 'conisregister' => '0', 'conisqzoneavatar' => '0', 'conisfeed' => $user_auth_fields, 'conisqqshow' => $is_use_qqshow), false, true);
|
||||
C::t('common_member')->update($uid, array('conisbind' => '1'));
|
||||
C::t('#qqconnect#connect_memberbindlog')->insert(array('uid' => $uid, 'uin' => $conopenid, 'type' => '1', 'dateline' => $_G['timestamp']));
|
||||
|
||||
C::t('#qqconnect#common_connect_guest')->delete($conopenid);
|
||||
|
||||
dsetcookie('connect_js_name', 'user_bind', 86400);
|
||||
dsetcookie('connect_js_params', base64_encode(serialize(array('type' => 'registerbind'))), 86400);
|
||||
|
||||
dsetcookie('connect_login', 1, 31536000);
|
||||
dsetcookie('connect_is_bind', '1', 31536000);
|
||||
dsetcookie('connect_uin', $conopenid, 31536000);
|
||||
dsetcookie('stats_qc_reg', 2, 86400);
|
||||
if ($_GET['is_feed']) {
|
||||
dsetcookie('connect_synpost_tip', 1, 31536000);
|
||||
}
|
||||
|
||||
} else {
|
||||
showmessage('qqconnect:connect_get_access_token_failed', dreferer());
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
132
source/module/member/member_connect_register.php
Normal file
132
source/module/member/member_connect_register.php
Normal file
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: member_connect_register.php 33538 2013-07-02 05:01:37Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$from_connect = $_G['setting']['connect']['allow'] ? 1 : 0;
|
||||
$_G['setting']['regname'] = $regname = 'connect';
|
||||
|
||||
if(empty($_POST)) {
|
||||
|
||||
$_G['qc']['connect_auth_hash'] = $_GET['con_auth_hash'];
|
||||
$_G['qc']['dreferer'] = dreferer();
|
||||
|
||||
if(!$_G['qc']['connect_auth_hash']) {
|
||||
$_G['qc']['connect_auth_hash'] = $_G['cookie']['con_auth_hash'];
|
||||
}
|
||||
$conopenid = authcode($_G['qc']['connect_auth_hash']);
|
||||
|
||||
if (empty($conopenid)) {
|
||||
showmessage('qqconnect:connect_login_first', null, array(), array('showmsg' => true, 'login' => 1));
|
||||
}
|
||||
|
||||
$_G['qc']['connect_is_feed'] = false;
|
||||
|
||||
$_G['qc']['connect_app_id'] = $_G['setting']['connectappid'];
|
||||
$_G['qc']['connect_openid'] = $conopenid;
|
||||
unset($auth_code, $conopenid);
|
||||
|
||||
$_G['qc']['connect_is_notify'] = true;
|
||||
|
||||
foreach($_G['cache']['fields_register'] as $field) {
|
||||
$fieldid = $field['fieldid'];
|
||||
$html = profile_setting($fieldid, $connectdefault);
|
||||
if($html) {
|
||||
$settings[$fieldid] = $_G['cache']['profilesetting'][$fieldid];
|
||||
$htmls[$fieldid] = $html;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if(!empty($_G['setting']['checkuinlimit']) && !empty($_GET['uin'])) {
|
||||
if($_G['qc']['uinlimit']) {
|
||||
showmessage('qqconnect:connect_register_uinlimit', '', array('limit' => $this->setting['connect']['register_uinlimit']));
|
||||
}
|
||||
if(!$_G['setting']['regconnect']) {
|
||||
showmessage('qqconnect:connect_register_closed');
|
||||
}
|
||||
}
|
||||
|
||||
$conuin = $this->connect_guest['conuin'];
|
||||
$conuinsecret = $this->connect_guest['conuinsecret'];
|
||||
$conuintoken = $this->connect_guest['conuintoken'];
|
||||
$conopenid = $this->connect_guest['conopenid'];
|
||||
|
||||
$cookie_expires = 2592000;
|
||||
dsetcookie('client_created', TIMESTAMP, $cookie_expires);
|
||||
dsetcookie('client_token', 1, $cookie_expires);
|
||||
|
||||
if (!$conuintoken || !$conopenid) {
|
||||
showmessage('qqconnect:connect_get_request_token_failed');
|
||||
}
|
||||
|
||||
if(C::t('#qqconnect#common_member_connect')->fetch_fields_by_openid($conopenid, 'uid')) {
|
||||
showmessage('qqconnect:connect_register_bind_uin_already');
|
||||
}
|
||||
|
||||
$conispublishfeed = 0;
|
||||
$conispublisht = 0;
|
||||
|
||||
$userdata = array();
|
||||
$userdata['avatarstatus'] = 0;
|
||||
$userdata['conisbind'] = 1;
|
||||
|
||||
C::t('#qqconnect#common_member_connect')->insert(array(
|
||||
'uid' => $uid,
|
||||
'conuin' => $conuin,
|
||||
'conuinsecret' => $conuinsecret,
|
||||
'conuintoken' => $conuintoken,
|
||||
'conopenid' => $conopenid,
|
||||
'conispublishfeed' => $conispublishfeed,
|
||||
'conispublisht' => $conispublisht,
|
||||
'conisregister' => $this->setting['ignorepassword'] ? '1' : '0',
|
||||
'conisqzoneavatar' => '0',
|
||||
'conisfeed' => '1',
|
||||
'conisqqshow' => '0',
|
||||
));
|
||||
|
||||
dsetcookie('connect_js_name', 'user_bind', 86400);
|
||||
dsetcookie('connect_js_params', base64_encode(serialize(array('type' => 'register'))), 86400);
|
||||
dsetcookie('connect_login', 1, 31536000);
|
||||
dsetcookie('connect_is_bind', '1', 31536000);
|
||||
dsetcookie('connect_uin', $conopenid, 31536000);
|
||||
dsetcookie('stats_qc_reg', 1, 86400);
|
||||
if ($_GET['is_feed']) {
|
||||
dsetcookie('connect_synpost_tip', 1, 31536000);
|
||||
}
|
||||
|
||||
C::t('#qqconnect#connect_memberbindlog')->insert(array('uid' => $uid, 'uin' => $conopenid, 'type' => '1', 'dateline' => $_G['timestamp']));
|
||||
dsetcookie('con_auth_hash');
|
||||
|
||||
C::t('#qqconnect#common_connect_guest')->delete($conopenid);
|
||||
if(!function_exists('build_cache_userstats')) {
|
||||
require_once libfile('cache/userstats', 'function');
|
||||
}
|
||||
build_cache_userstats();
|
||||
|
||||
if($_G['setting']['connect']['register_groupid']) {
|
||||
$userdata['groupid'] = $groupinfo['groupid'] = $_G['setting']['connect']['register_groupid'];
|
||||
}
|
||||
C::t('common_member')->update($uid, $userdata);
|
||||
|
||||
if($_G['setting']['connect']['register_addcredit']) {
|
||||
$addcredit = array('extcredits'.$_G['setting']['connect']['register_rewardcredit'] => $_G['setting']['connect']['register_addcredit']);
|
||||
}
|
||||
C::t('common_member_count')->increase($uid, $addcredit);
|
||||
}
|
||||
|
||||
function connect_filter_username($username) {
|
||||
$username = str_replace(' ', '_', trim($username));
|
||||
return cutstr($username, 15, '');
|
||||
}
|
||||
|
||||
?>
|
105
source/module/member/member_getpasswd.php
Normal file
105
source/module/member/member_getpasswd.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: member_getpasswd.php 35030 2014-10-23 07:43:23Z laoguozhang $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
define('NOROBOT', TRUE);
|
||||
|
||||
$paramexist = preg_match_all('/(\?|&(amp)?(;)?)(.+?)=([^&?]*)/i', $_SERVER['QUERY_STRING'], $parammatchs);
|
||||
if($paramexist){
|
||||
foreach($parammatchs[5] as $paramk => $paramv){
|
||||
$param[$parammatchs[4][$paramk]] = $paramv;
|
||||
}
|
||||
}
|
||||
$uid = isset($_GET['uid']) ? $_GET['uid'] : $param['uid'];
|
||||
$id = isset($_GET['id']) ? $_GET['id'] : $param['id'];
|
||||
$sign = isset($_GET['sign']) ? $_GET['sign'] : $param['sign'];
|
||||
|
||||
if($uid && $id && $sign === make_getpws_sign($uid, $id)) {
|
||||
|
||||
$discuz_action = 141;
|
||||
|
||||
|
||||
$member = getuserbyuid($uid, 1);
|
||||
$table_ext = isset($member['_inarchive']) ? '_archive' : '';
|
||||
$member = array_merge(C::t('common_member_field_forum'.$table_ext)->fetch($uid), $member);
|
||||
list($dateline, $operation, $idstring) = explode("\t", $member['authstr']);
|
||||
|
||||
if($dateline < TIMESTAMP - 86400 * 3 || $operation != 1 || $idstring != $id) {
|
||||
showmessage('getpasswd_illegal', NULL);
|
||||
}
|
||||
|
||||
if(!submitcheck('getpwsubmit') || $_GET['newpasswd1'] != $_GET['newpasswd2']) {
|
||||
$navtitle = lang('core', 'title_getpasswd');
|
||||
$hashid = $id;
|
||||
$uid = $_GET['uid'];
|
||||
include template('member/getpasswd');
|
||||
} else {
|
||||
if($_GET['newpasswd1'] != addslashes($_GET['newpasswd1'])) {
|
||||
showmessage('profile_passwd_illegal');
|
||||
}
|
||||
if($_G['setting']['pwlength']) {
|
||||
if(strlen($_GET['newpasswd1']) < $_G['setting']['pwlength']) {
|
||||
showmessage('profile_password_tooshort', '', array('pwlength' => $_G['setting']['pwlength']));
|
||||
}
|
||||
}
|
||||
if($_G['setting']['strongpw']) {
|
||||
$strongpw_str = array();
|
||||
if(in_array(1, $_G['setting']['strongpw']) && !preg_match("/\d+/", $_GET['newpasswd1'])) {
|
||||
$strongpw_str[] = lang('member/template', 'strongpw_1');
|
||||
}
|
||||
if(in_array(2, $_G['setting']['strongpw']) && !preg_match("/[a-z]+/", $_GET['newpasswd1'])) {
|
||||
$strongpw_str[] = lang('member/template', 'strongpw_2');
|
||||
}
|
||||
if(in_array(3, $_G['setting']['strongpw']) && !preg_match("/[A-Z]+/", $_GET['newpasswd1'])) {
|
||||
$strongpw_str[] = lang('member/template', 'strongpw_3');
|
||||
}
|
||||
if(in_array(4, $_G['setting']['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['newpasswd1'])) {
|
||||
$strongpw_str[] = lang('member/template', 'strongpw_4');
|
||||
}
|
||||
if($strongpw_str) {
|
||||
showmessage(lang('member/template', 'password_weak').implode(',', $strongpw_str));
|
||||
}
|
||||
}
|
||||
loaducenter();
|
||||
uc_user_edit(addslashes($member['username']), $_GET['newpasswd1'], $_GET['newpasswd1'], addslashes($member['email']), 1, 0);
|
||||
$password = md5(random(10));
|
||||
|
||||
if(isset($member['_inarchive'])) {
|
||||
C::t('common_member_archive')->move_to_master($member['uid']);
|
||||
}
|
||||
C::t('common_member')->update($uid, array('password' => $password));
|
||||
C::t('common_member_field_forum')->update($uid, array('authstr' => ''));
|
||||
|
||||
if(!function_exists('sendmail')) {
|
||||
include libfile('function/mail');
|
||||
}
|
||||
$reset_password_subject = array(
|
||||
'tpl' => 'password_reset',
|
||||
'var' => array(
|
||||
'username' => $member['username'],
|
||||
'bbname' => $_G['setting']['bbname'],
|
||||
'siteurl' => $_G['setting']['securesiteurl'],
|
||||
'datetime' => dgmdate(time(), 'Y-m-d H:i:s'),
|
||||
'clientip' => $_G['clientip']
|
||||
)
|
||||
);
|
||||
if(!sendmail("{$member['username']} <{$member['email']}>", $reset_password_subject)) {
|
||||
runlog('sendmail', "{$member['email']} sendmail failed.");
|
||||
}
|
||||
|
||||
showmessage('getpasswd_succeed', 'index.php', array(), array('login' => 1));
|
||||
}
|
||||
|
||||
} else {
|
||||
showmessage('parameters_error');
|
||||
}
|
||||
?>
|
26
source/module/member/member_logging.php
Normal file
26
source/module/member/member_logging.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: member_logging.php 25246 2011-11-02 03:34:53Z zhangguosheng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
define('NOROBOT', TRUE);
|
||||
|
||||
if(!in_array($_GET['action'], array('login', 'logout'))) {
|
||||
showmessage('undefined_action');
|
||||
}
|
||||
|
||||
$ctl_obj = new logging_ctl();
|
||||
$ctl_obj->setting = $_G['setting'];
|
||||
$method = 'on_'.$_GET['action'];
|
||||
$ctl_obj->template = 'member/login';
|
||||
$ctl_obj->$method();
|
||||
|
||||
?>
|
79
source/module/member/member_lostpasswd.php
Normal file
79
source/module/member/member_lostpasswd.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: member_lostpasswd.php 35041 2014-10-29 08:05:36Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
define('NOROBOT', TRUE);
|
||||
|
||||
$discuz_action = 141;
|
||||
|
||||
if(submitcheck('lostpwsubmit')) {
|
||||
loaducenter();
|
||||
$_GET['email'] = strtolower(trim($_GET['email']));
|
||||
if($_GET['username']) {
|
||||
list($tmp['uid'], , $tmp['email']) = uc_get_user(addslashes($_GET['username']));
|
||||
$tmp['email'] = strtolower(trim($tmp['email']));
|
||||
if($_GET['email'] != $tmp['email']) {
|
||||
showmessage('getpasswd_account_notmatch');
|
||||
}
|
||||
$member = getuserbyuid($tmp['uid'], 1);
|
||||
} else {
|
||||
$emailcount = C::t('common_member')->count_by_email($_GET['email'], 1);
|
||||
if(!$emailcount) {
|
||||
showmessage('lostpasswd_email_not_exist');
|
||||
}
|
||||
if($emailcount > 1) {
|
||||
showmessage('lostpasswd_many_users_use_email');
|
||||
}
|
||||
$member = C::t('common_member')->fetch_by_email($_GET['email'], 1);
|
||||
list($tmp['uid'], , $tmp['email']) = uc_get_user(addslashes($member['username']));
|
||||
$tmp['email'] = strtolower(trim($tmp['email']));
|
||||
}
|
||||
if(!$member) {
|
||||
showmessage('getpasswd_account_notmatch');
|
||||
} elseif($member['adminid'] == 1 || $member['adminid'] == 2) {
|
||||
showmessage('getpasswd_account_invalid');
|
||||
}
|
||||
|
||||
$table_ext = $member['_inarchive'] ? '_archive' : '';
|
||||
if($member['email'] != $tmp['email']) {
|
||||
C::t('common_member'.$table_ext)->update($tmp['uid'], array('email' => $tmp['email']));
|
||||
}
|
||||
|
||||
$memberauthstr = C::t('common_member_field_forum'.$table_ext)->fetch($member['uid']);
|
||||
list($dateline, $operation, $idstring) = explode("\t", $memberauthstr['authstr']);
|
||||
$interval = $_G['setting']['mailinterval'] > 0 ? (int)$_G['setting']['mailinterval'] : 300;
|
||||
if($dateline && $operation == 1 && $dateline > TIMESTAMP - $interval) {
|
||||
showmessage('getpasswd_has_send', '', array('interval' => $interval));
|
||||
}
|
||||
|
||||
$idstring = random(6);
|
||||
C::t('common_member_field_forum'.$table_ext)->update($member['uid'], array('authstr' => "{$_G['timestamp']}\t1\t$idstring"));
|
||||
require_once libfile('function/mail');
|
||||
$get_passwd_message = array(
|
||||
'tpl' => 'get_passwd',
|
||||
'var' => array(
|
||||
'username' => $member['username'],
|
||||
'bbname' => $_G['setting']['bbname'],
|
||||
'siteurl' => $_G['setting']['securesiteurl'],
|
||||
'uid' => $member['uid'],
|
||||
'idstring' => $idstring,
|
||||
'clientip' => $_G['clientip'],
|
||||
'sign' => make_getpws_sign($member['uid'], $idstring),
|
||||
)
|
||||
);
|
||||
if(!sendmail("{$_GET['username']} <{$tmp['email']}>", $get_passwd_message)) {
|
||||
runlog('sendmail', "{$tmp['email']} sendmail failed.");
|
||||
}
|
||||
showmessage('getpasswd_send_succeed', $_G['siteurl'], array(), array('showdialog' => 1, 'locationtime' => true));
|
||||
}
|
||||
|
||||
?>
|
21
source/module/member/member_register.php
Normal file
21
source/module/member/member_register.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: member_register.php 23897 2011-08-15 09:21:07Z zhengqingpeng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
define('NOROBOT', TRUE);
|
||||
|
||||
$ctl_obj = new register_ctl();
|
||||
$ctl_obj->setting = $_G['setting'];
|
||||
$ctl_obj->template = 'member/register';
|
||||
$ctl_obj->on_register();
|
||||
|
||||
?>
|
32
source/module/member/member_regverify.php
Normal file
32
source/module/member/member_regverify.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: member_regverify.php 28003 2012-02-20 09:55:39Z monkey $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
define('NOROBOT', TRUE);
|
||||
|
||||
if($_G['setting']['regverify'] == 2 && $_G['groupid'] == 8 && submitcheck('verifysubmit')) {
|
||||
|
||||
if(($verify_member = C::t('common_member_validate')->fetch($_G['uid'])) && $verify_member['status'] == 1) {
|
||||
C::t('common_member_validate')->update($_G['uid'], array(
|
||||
'submittimes' => $verify_member['submittimes']+1,
|
||||
'submitdate' => $_G['timestamp'],
|
||||
'status' => '0',
|
||||
'message' => dhtmlspecialchars($_GET['regmessagenew'])
|
||||
));
|
||||
showmessage('submit_verify_succeed', 'home.php?mod=spacecp&ac=profile');
|
||||
} else {
|
||||
showmessage('undefined_action');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
34
source/module/member/member_switchstatus.php
Normal file
34
source/module/member/member_switchstatus.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: member_switchstatus.php 27203 2012-01-11 03:14:19Z zhangguosheng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
define('NOROBOT', TRUE);
|
||||
|
||||
if($_G['uid']) {
|
||||
|
||||
if(!$_G['group']['allowinvisible']) {
|
||||
showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
|
||||
}
|
||||
|
||||
$_G['session']['invisible'] = $_G['session']['invisible'] ? 0 : 1;
|
||||
C::app()->session->update_by_uid($_G['uid'], array('invisible' => $_G['session']['invisible']));
|
||||
C::t('common_member_status')->update($_G['uid'], array('invisible' => $_G['session']['invisible']), 'UNBUFFERED');
|
||||
if(!empty($_G['setting']['sessionclose'])) {
|
||||
dsetcookie('ulastactivity', TIMESTAMP.'|'.getuserprofile('invisible'), 31536000);
|
||||
}
|
||||
$language = lang('forum/misc');
|
||||
$msg = $_G['session']['invisible'] ? $language['login_invisible_mode'] : $language['login_normal_mode'];
|
||||
showmessage('<a href="member.php?mod=switchstatus" title="'.$language['login_switch_invisible_mode'].'" onclick="ajaxget(this.href, \'loginstatus\');return false;" class="xi2">'.$msg.'</a>', dreferer(), array(), array('msgtype' => 3, 'showmsg' => 1));
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user