public function _initialize() { load('extend'); if (ismobile()) { C('DEFAULT_THEME', 'mobile'); } //全局首页,用户个人中心导航分类展示 $cats = M('Category')->where('isverify=1 and isshow=1')->order('sort desc')->select(); $this->assign('cats', $cats); $m = M('member_user_rank'); $ranklist = $m->order('rank_id asc')->getField('rank_id,name'); $this->assign('ranklist', $ranklist); //个人信息 $User = M('Member_user'); $id = $_SESSION[C('USER_AUTH_KEY_ID')]; $result = array(); if (!empty($id)) { $result = $User->find($id); $result['expires_time'] = strtotime('+' . $result['expires_time'] . 'month', $result['regtime']); //新注册用户试用2天付费用户 if (strtotime('+2 days', $result['regtime']) > time() && $result['user_rank'] < 2) { $result['user_rank'] = 2; $result['expires_time'] = strtotime('+2 days', $result['regtime']); } } $this->persons = $result; $this->assign('persons', $result); }
public function register($username, $password, $field, $type = 'email') { $returns = array('uid' => '-1', 'username' => '', 'email' => '', 'mobile' => '', 'userip' => ''); if (!isset($username) || empty($username) || strlen($username) < 2 || !isset($password) || empty($password) || strlen($password) < 6) { return $returns; } if ($type == 'email' && !isemail($field)) { return $returns; } if ($type == 'mobile' && !ismobile($field)) { return $returns; } $this->group = M('member_group')->where("type='member' AND creditslower>=0")->order('creditslower', 'ASC')->find(1); cookie('member_group', serialize($this->group)); $type = $type == 'mobile' ? $type : 'email'; $email = $type == 'email' ? $field : ''; $mobile = $type == 'mobile' ? $field : ''; $account = array('username' => $username, 'password' => sha1(md5($password)), 'email' => $email, 'mobile' => $mobile, 'gid' => $this->group['gid'], 'status' => 0, 'newpm' => 0, 'emailstatus' => 0, 'avatarstatus' => 0, 'regdate' => TIMESTAMP); $this->uid = M('member')->insert($account, true); $this->username = $username; $this->email = $email; $this->mobile = $mobile; $returns = array('uid' => $this->uid, 'username' => $this->username, 'email' => $this->email, 'mobile' => $this->mobile, 'userip' => $_SERVER['REMOTE_ADDR']); $account['uid'] = $this->uid; $this->account = $account; cookie('member_account', serialize($account)); $this->status = $this->getStatus(); cookie('member_status', serialize($this->status)); $this->count = $this->getCount(); cookie('member_count', serialize($this->count)); $this->profile = $this->getProfile(); cookie('member_profile', serialize($this->profile)); return $returns; }
/** * 登录验证 */ private function chklogin() { $account = htmlspecialchars(trim($_GET['account_' . FORMHASH])); $password = trim($_GET['password_' . FORMHASH]); $captchacode = strtolower(trim($_GET['captchacode'])); $this->checkCaptchacode($captchacode); if (strlen($account) < 2) { $this->showError('username_verify_failed'); } if (strlen($password) < 6) { $this->showError('password_verify_failed'); } $member = new Member(); if (isemail($account)) { $returns = $member->Login($account, $password, 'email'); } elseif (ismobile($account)) { $returns = $member->Login($account, $password, 'mobile'); } else { $returns = $member->Login($account, $password); } if ($member->uid > 0) { $continue = $_GET['continue']; $this->showSuccess('login_succeed', $continue, array(), '', true); } else { $this->showError('login_verify_failed'); } }
public function _initialize() { if (ismobile()) { C('DEFAULT_THEME', 'mobile'); } //全局首页,用户个人中心导航分类展示 }
public function run(&$return) { if (ismobile()) { //设置默认默认主题为 Mobile C('DEFAULT_V_LAYER', 'Mobile'); } $return = true; }
public function _initialize() { // 控制器初始化方法 // 判断是否手机访问 if (ismobile()) { C('DEFAULT_THEME', 'mobile'); } }
public function _initialize() { if (ismobile()) { C('DEFAULT_THEME', 'mobile'); } //全局首页,用户个人中心导航分类展示 $cats = M('Category')->where('isverify=1 and isshow=1')->limit('5')->select(); $this->assign('cats', $cats); }
public function _initialize() { if (ismobile()) { C('DEFAULT_THEME', 'mobile'); } //全局首页,用户个人中心导航分类展示 $cats = M('Category')->where('isverify=1')->order('sort asc')->select(); $cats = list2layer($cats, 0); // dump($cats); $this->assign('cats', $cats); }
public function save() { $accountnew = $_GET['accountnew']; $profilenew = $_GET['profilenew']; if (isemail($accountnew['email']) || ismobile($accountnew['mobile'])) { $this->t('member')->where(array('uid' => $this->uid))->update($accountnew); } $profilenew['locked'] = 1; $profilenew['modified'] = time(); $this->t('member_profile')->where(array('uid' => $this->uid))->update($profilenew); $this->showSuccess('modi_succeed'); }
public function _initialize() { if (ismobile()) { C('DEFAULT_THEME', 'mobile'); } if (empty($_SESSION[C('USER_AUTH_KEY_F')])) { $this->error('请先登入', U('Index/Index/index')); return; } $cats = M('Category')->where('isverify=1 and isshow=1')->limit('5')->select(); $this->assign('cats', $cats); //侧栏的数据分配 $sidebar3 = M('Article')->where('ispush=1 and islock=0')->order('rand()')->limit('5')->select(); //随机5篇 $this->assign('sidebar3', $sidebar3); }
public function _initialize() { if (ismobile()) { C('DEFAULT_THEME', 'mobile'); } if (cookie('username') == '') { $this->redirect('index/Login/index'); return; } $cats = M('Category')->where('isverify=1 and isshow=1')->limit('5')->select(); $this->assign('cats', $cats); //侧栏的数据分配 $sidebar3 = M('Article')->where('ispush=1 and islock=0')->order('rand()')->limit('5')->select(); //随机5篇 $this->assign('sidebar3', $sidebar3); }
public function _initialize() { //移动设备浏览,则切换模板 if (ismobile()) { //设置默认默认主题为 Mobile C('DEFAULT_THEME', 'Mobile'); } $user = $this->saveCurrentUserSession(); if (empty($user)) { $actionName = strtolower(ACTION_NAME); if (!in_array($actionName, array("login", "checklogin"))) { $this->display("LogIn:Index"); exit; } } $this->user = $user; }
unset($search_condition[$k]); } } if (!submitcheck('qunfasmssubmit', 1)) { showsubmenusteps($Plang['smstong_nav_members_qunfasms'], array(array($Plang['smstong_nav_members_select'], !$_G['gp_submit']))); showtagheader('div', 'qunfasms', TRUE); showformheader('plugins&operation=config&do=' . $_G['gp_do'] . '&identifier=smstong&pmod=qunfasms', 'qunfasmssubmit'); showhiddenfields(array('notifymember' => 1)); echo '<table class="tb tb1">'; if ($_G['gp_getmobile']) { $query = DB::query("SELECT mobile FROM " . DB::table('common_member_profile') . " WHERE mobile<>''"); require_once DISCUZ_ROOT . './source/plugin/smstong/smstong.func.php'; while ($v = DB::fetch($query)) { foreach ($v as $key => $value) { $value = preg_replace('/\\s+/', ' ', $value); if (ismobile($value)) { $mobile .= strlen($value) > 11 && is_numeric($value) ? '[' . $value . '],' : $value . ','; } } } $_G['gp_mobile'] = trim($mobile, ","); } showtablerow('', array('class="th12"', ''), array($Plang['smstong_members_qunfasms_mobile'], '<textarea name="mobile" cols="100" rows="25">' . $_G['gp_mobile'] . '</textarea>')); showtagheader('tbody', 'messagebody', TRUE); showsendsms(); showtagfooter('tbody'); $search_condition = serialize($search_condition); showsubmit('qunfasmssubmit', 'submit', 'td', '<input type="hidden" name="conditions" value=\'' . $search_condition . '\' />'); showtablefooter(); showformfooter(); showtagfooter('div');
} elseif ($action == 'bindmobile') { require dirname(__FILE__) . '/includes/lib_sms.php'; $_SESSION['sms_code'] = getverifycode(); $smarty->assign('sms_code', $_SESSION['sms_code']); $smarty->assign('ztime', $_CFG['ihuyi_sms_smsgap']); $smarty->display('user_transaction.dwt'); } elseif ($action == 'act_bindmobile') { require_once ROOT_PATH . 'includes/lib_sms.php'; require_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/sms.php'; $mobile = isset($_POST['mobile']) ? trim($_POST['mobile']) : ''; //手机号 $verifycode = isset($_POST['verifycode']) ? trim($_POST['verifycode']) : ''; //验证码 if ($_CFG['ihuyi_sms_mobile_bind'] == '1') { /* 提交的手机号是否正确 */ if (!ismobile($mobile)) { show_message($_LANG['invalid_mobile_phone']); } /* 提交的验证码不能为空 */ if (empty($verifycode)) { show_message($_LANG['verifycode_empty']); } /* 提交的验证码是否正确 */ if (empty($mobile)) { show_message($_LANG['invalid_verify_code']); } /* 提交的手机号是否已经绑定帐号 */ $sql = "SELECT COUNT(user_id) FROM " . $ecs->table('users') . " WHERE mobile_phone = '{$mobile}'"; if ($db->getOne($sql) > 0) { show_message($_LANG['mobile_phone_binded']); }
function action_check_register() { $user = $GLOBALS['user']; $_CFG = $GLOBALS['_CFG']; $_LANG = $GLOBALS['_LANG']; $smarty = $GLOBALS['smarty']; $db = $GLOBALS['db']; $ecs = $GLOBALS['ecs']; $user_id = $GLOBALS['user_id']; include_once ROOT_PATH . 'includes/cls_json.php'; require_once ROOT_PATH . 'includes/lib_sms.php'; $json = new JSON(); $username = trim($_POST['username']); $re = $json->decode($_POST['username']); $username = $re->username; $result = array('error' => '', 'message' => ''); if (preg_match("/([a-z0-9]*[-_\\.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[\\.][a-z]{2,3}([\\.][a-z]{2})?/i", $username)) { $sql = "select count(*) from " . $GLOBALS['ecs']->table('users') . " where email = '{$username}'"; $num = $GLOBALS['db']->getOne($sql); if ($num > 0) { $result['error'] = 2; $result['message'] = '邮箱已存在,请重新输入!'; } else { $result['error'] = 0; $result['message'] = '可以注册'; } } else { if (ismobile($username)) { $sql = "select count(*) from " . $GLOBALS['ecs']->table('users') . " where mobile_phone = '{$username}'"; $num = $GLOBALS['db']->getOne($sql); if ($num > 0) { $result['error'] = 2; $result['message'] = '手机号已存在,请重新输入!'; } else { $result['error'] = 0; $result['message'] = '可以注册'; } } else { $sql = "update " . $GLOBALS['ecs']->table('goods') . " set goods_name = 'ddd' where goods_id = '32'"; $GLOBALS['db']->query($sql); $sql = "select count(*) from " . $GLOBALS['ecs']->table('users') . " where user_name = '{$username}'"; $num = $GLOBALS['db']->getOne($sql); if ($num > 0) { $result['error'] = 3; $result['message'] = '用户名已存在,请重新输入!'; } else { $result['error'] = 0; $result['message'] = '可以注册'; } } } die($json->encode($result)); }
public function paymentSucc() { $this->assign('navFlage', 'step4'); if (ismobile()) { $this->display('mobile-paymentSucc'); } else { $this->display('paymentSucc'); } }
$protect_info['answer1'] = $protect_info['answer1_1']; $protect_info['answer2'] = $protect_info['answer2_1']; $protect_info['answer3'] = $protect_info['answer3_1']; updatetable('protect_info', $protect_info, array('uid' => $_SGLOBAL['supe_uid'])); showmessage('成功设置密保问题!', 'cp.php?ac=protect&op=question'); } else { showmessage('密保答案错误!', 'cp.php?ac=protect&op=question'); } } } elseif ($_GET['op'] == 'mobile') { $send_interval = 60 * 2; if (!empty($_GET['get_code'])) { if ($protect_info['mobile_send_time'] + $send_interval > $_SGLOBAL['timestamp']) { showmessage("发送太快!", 'cp.php?ac=protect&op=mobile'); } else { if (!ismobile($_GET['mobile'])) { showmessage('手机号码不正确!', 'cp.php?ac=protect&op=mobile'); } else { $protect_info['mobile_send_time'] = $_SGLOBAL['timestamp']; $verifycode = rand(100000, 999999); $protect_info['mobile_code'] = $verifycode; $protect_info['mobile_1'] = $_GET['mobile']; $content = "您在i北航(i.buaa.edu.cn)的手机密保验证码为" . $verifycode . "请及时输入验证码完成手机密保设置!"; if (sendsms($_GET['mobile'], '验证码', $content)) { if ($first_time) { $protect_info['uid'] = $_SGLOBAL['supe_uid']; inserttable('protect_info', $protect_info); } else { updatetable('protect_info', $protect_info, array('uid' => $_SGLOBAL['supe_uid'])); } showmessage("成功发送!", "cp.php?ac=protect&op=mobile");
function checkinfo($realname, $email, $mobile) { global $_SGLOBAL; $message = ''; if (empty($realname)) { $message = '对不起,姓名不能为空!'; return $message; } if (empty($email) && empty($mobile)) { $message = '对不起,Email和手机不能全为空!'; return $message; } if (!empty($email) && !isemail($email)) { $message = '对不起,Email的格式不对!'; return $message; } /*检查该用户是否已经激活开通*/ $query = $_SGLOBAL['db']->query("SELECT userid FROM " . tname('baseprofile') . " WHERE realname='{$realname}' and birthday='{$birthday}' and isactive=1 limit 1"); if ($active = $_SGLOBAL['db']->result($query)) { $message = '邀请不成功,该用户已开通个人空间'; return $message; } if (!empty($mobile)) { $mobile = ismobile($mobile); if (!$mobile) { $message = '对不起,输入手机号有误,请重新输入'; return $message; } /*判断该手机号是否已经开通过个人主页,是否一天之内邀请同一个人的次数超过3次*/ $query = $_SGLOBAL['db']->query("SELECT id FROM " . tname('mobilereg') . " WHERE mobile = '{$mobile}' and status=1 limit 1"); if ($value = $_SGLOBAL['db']->result($query)) { $message = '该手机号已经激活开通个人主页。'; return $message; } else { $query = $_SGLOBAL['db']->query("SELECT id FROM " . tname('mobilereg') . " WHERE mobile = '" . $mobile . "' and status=0 ORDER BY dateline DESC LIMIT 1"); if ($value = $_SGLOBAL['db']->fetch_array($query)) { if ($_SGLOBAL['timestamp'] - $value['dateline'] <= 60) { $message = '对不起,您的操作过快,请等待30秒再接收验证码'; return $message; } $yesterday = $_SGLOBAL['timestamp'] - 86400; $query = $_SGLOBAL['db']->query("SELECT mobile FROM " . tname('mobilereg') . " WHERE mobile = '" . $mobile . "' AND dateline > '" . $yesterday . "' "); $count = $_SGLOBAL['db']->num_rows($query); if ($count >= 3) { $message = '您已经邀请手机号:' . $mobile . '发出的' . $count . '条邀请短信。'; return $message; } } else { $query = $_SGLOBAL['db']->query("SELECT uid FROM " . tname('spacefield') . " WHERE mobile = '{$mobile}' limit 1"); if ($value = $_SGLOBAL['db']->result($query)) { $message = '该手机号已经激活开通个人主页。'; return $message; } } } } return $message; }
function viewthread_avatar_output() { global $_G, $postlist; if (!$this->allow) { return; } if ($_G['cache']['plugin']['smstong']['displaythreadmobile']) { foreach ($postlist as $id => $post) { if ($post['authorid']) { $target .= $post['authorid'] . ','; } } $target = substr($target, 0, -1); if (!empty($target)) { $query = DB::query("SELECT * FROM " . DB::table("common_member_profile") . " WHERE uid in ({$target})"); while ($data = DB::fetch($query)) { $user[$data['uid']] = $data; } include_once DISCUZ_ROOT . './data/plugindata/smstong.lang.php'; require_once DISCUZ_ROOT . './source/plugin/smstong/smstong.func.php'; foreach ($user as $uid => $ex) { if (ismobile($user[$uid]['mobile'])) { $mobile[$uid] = " <img src='source/plugin/smstong/mobile.gif' title='" . lang('plugin/smstong', 'smstong_mobilebind_bindimage') . "' />"; } } foreach ($postlist as $id => $post) { $return[] = $mobile[$post['uid']]; } return $return; } return; } return; }
}) </script> <?php } ?> <script> window.isArchive = <?php if ($this->is('index') || $this->is('archive')) { echo 'true'; } else { echo 'false'; } ?> ; <?php if (!ismobile()) { ?> $(function(){ var qrcode = new QRCode(document.getElementById("qrcode-img"), { width : 96,//设置宽高 height : 96 }); qrcode.makeCode("<?php echo $this->request->getRequestUrl(); ?> "); }); <?php } ?> </script>
$jslist[] = $value; } $query = $_SGLOBAL['db']->query("SELECT name,tel,address FROM " . tname('jifen_cjlog') . " WHERE uid=" . $_SGLOBAL[supe_uid] . " group by name,tel,address"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $jslist[] = $value; } if ($_POST) { if (!$_POST['realname'] || !$_POST['tel']) { showmessage("信息填写有误"); } if ($_POST['tel']) { if (!ismobile($_POST['tel'])) { showmessage("手机号有误!"); } } $arr = array("uid" => $_SGLOBAL[supe_uid], "username" => $_SGLOBAL[supe_username], "lpid" => $lpid, "giftname" => $thevalue[name], "time" => time(), "address" => strip_tags($_POST['address']), "tel" => ismobile(strip_tags($_POST['tel'])), "name" => strip_tags($_POST['realname'])); $id = inserttable('jifen_dhlog', $arr, 1); //插入数据 $_SGLOBAL['db']->query('UPDATE ' . tname('jifen_lp') . ' SET total=total-1,nums=nums+1 WHERE id=' . $lpid); //更新礼品信息 $_SGLOBAL['db']->query('UPDATE ' . tname('space') . ' SET credit=credit-' . $thevalue['price'] . ' WHERE uid=' . $_SGLOBAL[supe_uid]); //更新积分信息 //发全站feed $uid = $_SGLOBAL['supe_uid']; realname_set($_SGLOBAL['supe_uid'], $_SGLOBAL['supe_username']); realname_get(); include_once S_ROOT . './source/function_cp.php'; $avatar = ckavatar($uid) ? avatar($uid, 'middle', true) : UC_API . '/images/noavatar_middle.gif'; $summay = getstr($thevalue['des'], 150, 1, 1, 0, 0, -1); if ($thevalue['pic']) { $thevalue['pic'] = "jifen/uploads/image/" . $thevalue['id'] . ".jpg";
if ($_CFG['cart_confirm'] > 2) { $result['message'] = ''; } else { $result['message'] = $_CFG['cart_confirm'] == 1 ? $_LANG['addto_cart_success_1'] : $_LANG['addto_cart_success_2']; } $result['content'] = insert_cart_info(); $result['one_step_buy'] = $_CFG['one_step_buy']; ///*新加*/ //ecs_header("Location: flow.php?step=cart\n"); //exit; require_once ROOT_PATH . 'includes/lib_sms.php'; /* 获取用户手机号 */ $sql = "SELECT user_id, mobile_phone FROM " . $ecs->table('users') . " WHERE user_name='{$_SESSION['user_name']}' LIMIT 1"; $row = $db->getRow($sql); /* 是否开启强制手机绑定 */ if ($_CFG['ihuyi_sms_mobile_cons'] == '1' && (!$row || !ismobile($row['mobile_phone']))) { require_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/sms.php'; show_message($_LANG['ihuyi_sms_mobile_cons_notice'], '绑定手机号', 'user.php?act=bindmobile', 'info'); } /*------------------------------------------------------ */ //-- 收货人信息 /*------------------------------------------------------ */ if ($_SESSION['user_id'] == 0) { ecs_header("Location: flow.php?step=login\n"); exit; } include_once 'includes/lib_transaction.php'; if ($_SERVER['REQUEST_METHOD'] == 'GET') { /* 取得购物类型 */ $flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS; $sql = "SELECT COUNT(*) FROM " . $ecs->table('cart') . " WHERE session_id = '" . SESS_ID . "' " . "AND parent_id = 0 AND is_gift = 0 AND rec_type = '{$flow_type}' and extension_code!='virtual_card'";
function checkinfo($realname, $birthday, $email, $mobile, $isfile, $startyear) { /* * email:将要检查的邮箱 * name:将要检查的名字 * birthday:将要检查的生日 * mobile:将要检查的手机号码 * isfile:是否通过文件邀请 * startyear:将要检查的入学年份 * file_pointer:通过文件邀请时的文件 */ global $_SGLOBAL; $message = ''; if (empty($realname)) { $message = myshowmessage('realname_is_null', $isfile); return $message; } if (empty($email) && empty($mobile)) { $message = myshowmessage('both_is_null', $isfile); return $message; } if (!empty($email) && !isemail($email)) { $message = myshowmessage('email_error', $isfile); return $message; } /*检查该用户是否已经激活开通*/ $query = $_SGLOBAL['db']->query("SELECT userid FROM " . tname('baseprofile') . " WHERE realname='{$realname}' and birthday='{$birthday}' and isactive=1"); $active = $_SGLOBAL['db']->fetch_array($query); if (!empty($active)) { $message = myshowmessage('邀请不成功,该用户已开通个人空间'); return $message; } /*if(!empty($email)){ $query = $_SGLOBAL['db']->query("SELECT otheremail FROM ".tname('baseprofile')." WHERE otheremail='$email'"); $otheremail = $_SGLOBAL['db']->fetch_array($query); if(!empty($otheremail)) { $message = myshowmessage('email_is_wrong', $isfile); return $message; } }*/ if (!empty($mobile)) { $mobile = ismobile($mobile); if (!$mobile) { $message = myshowmessage('对不起,输入手机号有误,请重新输入'); return $message; } /*判断该手机号是否已经开通过个人主页,是否一天之内邀请同一个人的次数超过3次*/ $query = $_SGLOBAL['db']->query("SELECT id FROM " . tname('mobilereg') . " WHERE mobile = '" . $mobile . "' and status=1 limit 1"); if ($value = $_SGLOBAL['db']->fetch_array($query)) { $message = myshowmessage('该手机号已经激活开通个人主页。'); return $message; } else { $query = $_SGLOBAL['db']->query("SELECT id FROM " . tname('mobilereg') . " WHERE mobile = '" . $mobile . "' and status=0 ORDER BY dateline DESC LIMIT 1"); /*myshowmessage("SELECT * FROM ".tname('mobilereg')." WHERE mobile = '".$mobile."' and status=0 ORDER BY dateline DESC LIMIT 1"); exit();*/ if ($value = $_SGLOBAL['db']->fetch_array($query)) { //24小时之前发布多少条~ if ($_SGLOBAL['timestamp'] - $value['dateline'] <= 60) { $message = myshowmessage('对不起,您的操作过快,请等待30秒再接收验证码', '', 2); return $message; } $yesterday = $_SGLOBAL['timestamp'] - 86400; $query = $_SGLOBAL['db']->query("SELECT mobile FROM " . tname('mobilereg') . " WHERE mobile = '" . $mobile . "' AND dateline > '" . $yesterday . "' "); $count = $_SGLOBAL['db']->num_rows($query); if ($count >= 3) { $message = myshowmessage('您已经邀请手机号:' . $mobile . '发出的' . $count . '条邀请短信。'); return $message; } } else { /*$query = $_SGLOBAL['db']->query("SELECT m.uid,m.username FROM ".tname('spacefield')." s join ".tname('member')." m on s.uid = m.uid WHERE s.mobile = '".$mobile."'");*/ $query = $_SGLOBAL['db']->query("SELECT uid FROM " . tname('spacefield') . " WHERE mobile = '" . $mobile . "' limit 1"); if ($value = $_SGLOBAL['db']->fetch_array($query)) { $message = myshowmessage('该手机号已经激活开通个人主页。'); return $message; } } } } return $message; }
function notifymembers($operation, $variable) { global $_G, $lang, $Plang, $urladd, $conditions, $search_condition; if (!empty($_G['gp_current'])) { $message = $_G['gp_message']; } else { $current = 0; $message = trim($_G['gp_message']); $message = trim(str_replace("\t", ' ', $message)); $message = stripslashes($message); } $pertask = intval($_G['gp_pertask']); $current = $_G['gp_current'] ? intval($_G['gp_current']) : 0; $next = $current + $pertask; $continue = FALSE; $uids = searchmembers($search_condition, $pertask, $current); $conditions = $uids ? 'uid IN (' . dimplode($uids) . ')' : '0'; if ($_G['gp_notifymember'] && in_array($_G['gp_notifymembers'], array('sendsms'))) { if (empty($message)) { cpmsg($Plang['smstong_members_sendsms_sm_invalid'], '', 'error'); } $sql = "SELECT uid, mobile FROM " . DB::table('common_member_profile') . " WHERE {$conditions} AND mobile<>''"; $query = DB::query($sql); require_once DISCUZ_ROOT . './source/plugin/smstong/smstong.func.php'; while ($member = DB::fetch($query)) { if (!ismobile($member['mobile'])) { continue; } $ret = sendsms($_G['cache']['plugin']['smstong']['smsusername'], $_G['cache']['plugin']['smstong']['smspassword'], $member['mobile'], $message, false); if ($ret === true) { $continue = TRUE; } else { cpmsg($Plang['smstong_sendsms_failured'] . $ret, '', 'error'); } } } $newsletter_detail = array(); if ($continue) { cpmsg("{$Plang['smstong_nav_members_sendsms']}: " . cplang('members_newsletter_processing', array('current' => $current, 'next' => $next, 'search_condition' => serialize($search_condition))), "action=plugins&operation=config&do={$_G['gp_do']}&identifier=smstong&pmod=sendsms&sendsmssubmit=yes&message=" . rawurlencode($_G['gp_message']) . "¤t={$next}&pertask={$pertask}¬ifymember={$_G['gp_notifymember']}¬ifymembers=" . rawurlencode($_G['gp_notifymembers']) . $urladd, 'loadingform'); } else { cpmsg($Plang['smstong_members_sendsms_notify_succeed'], "action=plugins&operation=config&do={$_G['gp_do']}&identifier=smstong&pmod=sendsms", 'succeed'); } }
/** * 修改手机号 */ public function modimobile() { $mobile = trim($_GET['mobile']); $newmobile = trim($_GET['newmobile']); $seccode = trim($_GET['seccode']); if (!$this->_verify_sec_code($mobile, $seccode)) { $this->showAppError(-1, 'seccode validate failed', array('mobile' => $mobile, 'seccode' => $seccode)); } if (!ismobile($newmobile)) { $this->showAppError(-2, 'mobile number error', array('newmobile' => $newmobile)); } if ($this->_verifyMobile($newmobile) > 0) { $this->showAppError(-3, 'mobile number exist', array('newmobile' => $newmobile)); } $this->t('member')->where(array('uid' => $this->uid, 'username' => $this->username))->update(array('mobile' => $newmobile)); $this->showAppData(array('uid' => $this->uid, 'mobile' => $newmobile, 'status' => 'success')); }
}*/ if ($bp['isactive'] == 1) { showmessage('users_have_actived', 'index.php', 2); } require_once 'do_mobileregajax.php'; } elseif ($op == "checkmobile") { $mobile = ismobile($_GET['mobile']) ? trim($_GET['mobile']) : ''; if ($mobile) { showmessage('succeed'); } else { showmessage('对不起,输入手机号有误,请重新输入'); } } elseif ($op == "checkgetverifycode") { $verifycode = rand(100000, 999999); $mobile = $_GET['mobile']; $mobile = ismobile($_GET['mobile']) ? trim($_GET['mobile']) : ''; if (!$mobile) { showmessage('对不起,输入手机号有误,请重新输入'); } $content = "您在i北航(i.buaa.edu.cn)的注册验证码为" . $verifycode . "请及时输入验证码完成注册![i北航]"; $yesterday = $_SGLOBAL['timestamp'] - 86400; $sql = $_SGLOBAL['db']->query("SELECT mobile FROM " . tname('mobilereg') . " WHERE mobile = '" . $mobile . "' AND dateline > '" . $yesterday . "' "); $count = $_SGLOBAL['db']->num_rows($sql); if ($count >= 3) { showmessage('已经存在手机号:' . $mobile . '发出的' . $count . '条验证码还未完成注册。'); } $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('mobilereg') . " WHERE mobile = '" . $mobile . "' and status=0 ORDER BY dateline DESC LIMIT 1"); if ($value = $_SGLOBAL['db']->fetch_array($query) && $_SGLOBAL['timestamp'] - $value['dateline'] <= 60) { showmessage('对不起,您的操作过快,请等待30秒再接收验证码', 'index.php', 2); } else { $mquery = $_SGLOBAL['db']->query("SELECT mobile FROM " . tname('spacefield') . " WHERE mobile = '" . $mobile . "'");
} $user = DB::fetch(DB::query("SELECT username FROM " . DB::table('common_member') . " WHERE uid={$need['1']}")); if (!$user) { echo ''; exit; } require_once libfile('function/post'); require_once libfile('function/forum'); $pid = insertpost(array('fid' => $fid, 'tid' => $tid, 'first' => 0, 'author' => $user['username'], 'authorid' => $need[1], 'subject' => '', 'dateline' => TIMESTAMP, 'message' => $content, 'useip' => $_G['clientip'], 'invisible' => 0, 'anonymous' => 0, 'usesig' => 1, 'htmlon' => 0, 'bbcodeoff' => 0, 'smileyoff' => 0, 'parseurloff' => 0, 'attachment' => '0', 'replycredit' => 0, 'status' => 0)); $expiration = $_G['timestamp'] + 86400; DB::query("UPDATE " . DB::table('forum_thread') . " SET lastposter='{$user['username']}', lastpost='{$_G['timestamp']}', replies=replies+1 WHERE tid='{$tid}' AND fid='{$fid}'", 'UNBUFFERED'); $lastpost = "{$tid}\t" . addslashes(cutstr($post['subject'], 60, '')) . "\t{$_G['timestamp']}\t{$user['username']}"; DB::query("UPDATE " . DB::table('forum_forum') . " SET lastpost='{$lastpost}' {$update}, posts=posts+1, todayposts=todayposts+1 WHERE fid='{$fid}'", 'UNBUFFERED'); updatepostcredits('+', $need[1], 'reply', $fid); $exists = DB::fetch(DB::query("SELECT mobile FROM " . DB::table('common_member_profile') . " WHERE uid={$reply['authorid']}")); if ($_G['cache']['plugin']['smstong']['replynotify'] == 1 && ismobile($exists['mobile'])) { $contents = $_G['cache']['plugin']['smstong']['replynotifymsg']; $rp = array('$username', '$subject', '$content'); $sm = array($user['username'], $post['subject'], htmlspecialchars(messagecutstr($content, 100))); $contents = str_replace($rp, $sm, $contents); $ret = sendsms($_G['cache']['plugin']['smstong']['smsusername'], $_G['cache']['plugin']['smstong']['smspassword'], $exists['mobile'], $contents, false, $pid . "," . $reply['authorid']); if ($ret === TRUE) { } else { showmessage('smstong:smstong_activitymessage_sendsms_failured', '', array('ret' => $ret)); } } DB::query("UPDATE sms_send SET remark='' WHERE id = " . $record['id'] . ""); } else { echo ''; exit; }
$xml->loadXML($xmlstr); // Make a DOMDocument for the XSL stylesheet $xsl = new DOMDocument(); /* // See which user agent is connecting $UA = getenv('HTTP_USER_AGENT'); if (preg_match("/Symbian/", $UA) | preg_match("/Opera/", $UA) | preg_match("/Nokia/", $UA)) { // if a mobile phone, use a wml stylesheet and set appropriate MIME type header("Content-type:text/vnd.wap.wml"); $xsl->load('index-wml.xsl'); } else { // if not a mobile phone, use a html stylesheet header("Content-type:text/html"); $xsl->load('register.xsl'); } */ if (ismobile()) { header("Content-type:text/html"); $xsl->load('mobile_login.xsl'); } // Make the transformation and print the result $proc = new XSLTProcessor(); $proc->importStyleSheet($xsl); // attach the xsl rules echo utf8_decode($proc->transformToXML($xml)); ?>
$insert_sms = array('uid' => $_SGLOBAL['supe_uid'], 'username' => $_SGLOBAL['supe_username'], 'realname' => $_SN['uid'], 'receivernum' => $mobile, 'receivername' => $realname, 'startyear' => '$startyear', 'message' => $smsmessage, 'postip' => getonlineip(), 'dateline' => $_SGLOBAL['timestamp']); inserttable('sms', $insert_sms, 1); getreward('sendsms', 0); } } else { getreward('smsfail', 0); } } } //foreach //第二次foreach不用检查其信息,因为是数据库里面的!! $year = $_POST['year']; $mrs = $_SGLOBAL['db']->query("select mobile,realname,startyear FROM " . tname('baseprofile') . " WHERE mobile>0 AND academy=" . $_SN[$uid] . " AND satrtyear in {$year} "); if ($value = $_SGLOBAL['db']->fetch_array($mrs)) { foreach ($_POST['mobile'] as $key => $mobile) { $mobile = ismobile(trim($mobile)); if ($mobile) { $realname = getstr($_POST['realname'][$key], 30, 1, 1); $startyear = intval(getstr($_POST['startyear'][$key], 6, 1, 1)); $smsuid = 'TCLKJ0003'; $smspassword = '******'; $smsmessage = urlencode(iconv('UTF-8', 'GB2312', "{$smsmessage}")); $sendurl = "http://inolink.com/WS/Send.aspx?CorpID={$smsuid}&Pwd={$smspassword}&Mobile={$mobile}&Content={$smsmessage}&Cell=&SendTime="; $result = file_get_contents($sendurl); if (is_numeric($result)) { if ($result == 0) { $insert_sms = array('uid' => $_SGLOBAL['supe_uid'], 'username' => $_SGLOBAL['supe_username'], 'realname' => $_SN['uid'], 'receivernum' => $mobile, 'receivername' => $realname, 'startyear' => '$startyear', 'message' => $smsmessage, 'postip' => getonlineip(), 'dateline' => $_SGLOBAL['timestamp']); inserttable('sms', $insert_sms, 1); getreward('sendsms', 0); } } else {