oaooaPicHome beta1
This commit is contained in:
28
user/classes/checklogin.php
Normal file
28
user/classes/checklogin.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace user\classes;
|
||||
|
||||
class Checklogin{
|
||||
public function run(){
|
||||
|
||||
|
||||
global $_G;
|
||||
|
||||
if (!$_G['uid']) {
|
||||
if(defined('IS_API') && IS_API){
|
||||
exit(json_encode(array('loginstatus'=>0,'hash'=>FORMHASH,'isuser'=>true)));
|
||||
}else{
|
||||
include template('common/header_reload');
|
||||
|
||||
echo "<script type=\"text/javascript\">";
|
||||
|
||||
echo "location.href='user.php?mod=login';";
|
||||
|
||||
echo "</script>";
|
||||
|
||||
include template('common/footer_reload');
|
||||
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
15
user/classes/init.php
Normal file
15
user/classes/init.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace user\classes;
|
||||
|
||||
use \C;
|
||||
class Init{
|
||||
public function dzzInitbefore(){
|
||||
|
||||
$cachelist=array('usergroups','fields_register');
|
||||
|
||||
$dzz = C::app();
|
||||
|
||||
$dzz->cachelist = $cachelist;
|
||||
|
||||
}
|
||||
}
|
||||
23
user/classes/route.php
Normal file
23
user/classes/route.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace user\classes;
|
||||
|
||||
use \C;
|
||||
|
||||
class Route{
|
||||
public function run(){
|
||||
|
||||
global $_config;
|
||||
|
||||
require libfile('function/user');
|
||||
require libfile('function/mail');
|
||||
require libfile('function/profile');
|
||||
|
||||
$dzz = C::app();
|
||||
|
||||
$modarray = array('activate', 'clearcookies', 'getpasswd','login', 'lostpasswd','seccode','register','ajax', 'regverify', 'switchstatus','profile','password','avatar','space','sso');
|
||||
|
||||
$mod = !in_array($dzz->var['mod'], $modarray) && (!preg_match('/^\w+$/', $dzz->var['mod'])) ? $_config['default_mod'] : $dzz->var['mod'];
|
||||
|
||||
$_GET['mod'] = $mod;
|
||||
}
|
||||
}
|
||||
44
user/classes/safechk.php
Normal file
44
user/classes/safechk.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
namespace user\classes;
|
||||
|
||||
use \core as C;
|
||||
|
||||
class Safechk{
|
||||
|
||||
public function run(){
|
||||
global $_G;
|
||||
$uid = intval($_G['uid']);
|
||||
$seccodecheck = $_G['setting']['seccodestatus'] & 4;
|
||||
$errornumsession = isset($_SESSION['errornum'.$uid]) ? $_SESSION['errornum'.$uid]:0 ;
|
||||
$chkarr = C::t('user_profile')->get_userprofile_by_uid($uid);
|
||||
$hideemail = $this->mobileemail_safe( $chkarr['email']);
|
||||
$hidephone = $this->mobileemail_safe( $chkarr['phone']);
|
||||
$template = include template('common/safechk');
|
||||
}
|
||||
public function mobileemail_safe($val)
|
||||
{
|
||||
$patten = '/^([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-]+[.][A-Za-z0-9\-.]+)$/';
|
||||
if (preg_match($patten, $val)) {
|
||||
$emailarr = explode('@', $val);
|
||||
|
||||
$len = strlen($emailarr[0]);//字符长度
|
||||
$hlen = floor($len/2);//需要隐藏则字符长度
|
||||
|
||||
if($hlen == 0){
|
||||
$emailarr[0] = substr_replace($emailarr[0],'*',0,1);
|
||||
}else{
|
||||
|
||||
$start = ($hlen > 3) ? 3:$hlen;
|
||||
$hidestr = '';
|
||||
for($i = 0; $i <= $hlen; $i++){
|
||||
$hidestr .= '*';
|
||||
}
|
||||
$emailarr[0] = substr_replace($emailarr[0],$hidestr,$start,$hlen);
|
||||
}
|
||||
$val = $emailarr[0].'@'.$emailarr[1];
|
||||
} else if(preg_match('/^1[34578]{1}\d{9}$/',$val)){
|
||||
$val = preg_replace('/(\d{3})\d{5}(\d{3})/', '$1*****$2', $val);
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user