begin of thinksaas 3.68

Signed-off-by: kevin <kevin@lmve.net>
This commit is contained in:
2023-06-22 13:33:25 +08:00
commit 963ec1b2ea
2746 changed files with 331806 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
<?php
defined('IN_TS') or die('Access Denied.');
if($TS_SITE['isplogin']!=1){
tsNotice('短信登录未开启!');
}
/**
* 手机验证码登录
*/
if(tsIntval($TS_USER['userid']) > 0) {
header('Location: '.SITE_URL);exit;
}
switch($ts){
case "":
$title = '手机验证码登录';
include template("plogin");
break;
case "do":
$js = tsIntval($_GET['js']);
$phone = tsTrim($_POST['email']);
$authcode = strtolower($_POST['authcode']);
$phonecode = tsTrim($_POST['phonecode']);
if($phone=='' || $phonecode==''){
getJson('所有输入项都不能为空!',$js);
}
if(isPhone($phone)==false) getJson('手机号输入有误!',$js);
#验证手机验证码
if(aac('pubs')->verifyPhoneCode($phone,$phonecode)==false){
getJson('手机验证码输入有误!',$js);
}
#手机号是否存在
$strUser = $new['user']->find('user',array(
'phone'=>$phone,
));
if($strUser){
$new['user']->login($strUser['userid'],$phone);
getJson('登录成功!',$js,2,SITE_URL);
}else{
$new['user']->register($phone);
}
//跳转
getJson('登录成功!',$js,2,SITE_URL);
break;
}