vr-shopxo-source/app/index/controller/Safety.php

262 lines
6.2 KiB
PHP
Raw Normal View History

2018-12-28 10:58:37 +00:00
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
2021-03-16 02:34:52 +00:00
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
2018-12-28 10:58:37 +00:00
// +----------------------------------------------------------------------
2021-03-16 02:34:52 +00:00
// | Licensed ( https://opensource.org/licenses/mit-license.php )
2018-12-28 10:58:37 +00:00
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\index\controller;
use app\service\ApiService;
2019-12-24 07:18:56 +00:00
use app\service\SeoService;
use app\service\SafetyService;
2019-03-15 09:46:35 +00:00
use app\service\NavigationService;
2018-12-28 10:58:37 +00:00
/**
* 安全
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-02T22:48:35+0800
*/
class Safety extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
public function __construct()
{
parent::__construct();
// 是否登录
2019-02-14 15:06:04 +00:00
$this->IsLogin();
2018-12-28 10:58:37 +00:00
}
/**
* 首页
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-22T16:50:32+0800
*/
public function Index()
{
// 模板数据
$assign = [
// 基础数据
'data' => [
2018-12-28 10:58:37 +00:00
'mobile' => $this->user['mobile_security'],
'email' => $this->user['email_security'],
],
// 安全信息列表
'safety_panel_list' => NavigationService::UsersSafetyPanelList(),
// 浏览器名称
'home_seo_site_title' => SeoService::BrowserSeoTitle('安全设置', 1),
];
MyViewAssign($assign);
2021-07-18 15:42:10 +00:00
return MyView();
2018-12-28 10:58:37 +00:00
}
/**
* 登录密码修改页面
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-28T10:12:20+0800
*/
public function LoginPwdInfo()
{
2019-12-24 07:18:56 +00:00
// 浏览器名称
2021-07-18 15:42:10 +00:00
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('登录密码修改 - 安全设置', 1));
return MyView();
2018-12-28 10:58:37 +00:00
}
/**
* 原手机号码修改页面
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-28T10:12:20+0800
*/
public function MobileInfo()
{
if(empty($this->user['mobile']))
{
2021-07-18 15:42:10 +00:00
return MyRedirect(MyUrl('index/safety/newmobileinfo'));
2018-12-28 10:58:37 +00:00
}
2019-12-24 07:18:56 +00:00
// 浏览器名称
2021-07-18 15:42:10 +00:00
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('手机号码修改 - 安全设置', 1));
return MyView();
2018-12-28 10:58:37 +00:00
}
/**
* 新手机号码修改页面
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-28T10:12:20+0800
*/
public function NewMobileInfo()
{
2021-07-18 15:42:10 +00:00
if(MySession('safety_sms') == null && !empty($this->user['mobile']))
2018-12-28 10:58:37 +00:00
{
return $this->error('原帐号校验失败', MyUrl('index/safety/mobileinfo'));
}
2019-12-24 07:18:56 +00:00
// 浏览器名称
2021-07-18 15:42:10 +00:00
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('手机号码修改 - 安全设置', 1));
return MyView();
2018-12-28 10:58:37 +00:00
}
/**
* 电子邮箱修改页面
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-28T10:12:20+0800
*/
public function EmailInfo()
{
if(empty($this->user['email']))
{
2021-07-18 15:42:10 +00:00
return MyRedirect(MyUrl('index/safety/newemailinfo'));
2018-12-28 10:58:37 +00:00
}
2019-12-24 07:18:56 +00:00
// 浏览器名称
2021-07-18 15:42:10 +00:00
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('电子邮箱修改 - 安全设置', 1));
return MyView();
2018-12-28 10:58:37 +00:00
}
/**
* 新电子邮箱修改页面
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-28T10:12:20+0800
*/
public function NewEmailInfo()
{
2021-07-18 15:42:10 +00:00
if(MySession('safety_email') == null && !empty($this->user['email']))
2018-12-28 10:58:37 +00:00
{
return $this->error('原帐号校验失败', MyUrl('index/safety/emailinfo'));
}
2019-12-24 07:18:56 +00:00
// 浏览器名称
2021-07-18 15:42:10 +00:00
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('电子邮箱修改 - 安全设置', 1));
return MyView();
2018-12-28 10:58:37 +00:00
}
/**
* 验证码显示
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-05T15:10:21+0800
*/
public function VerifyEntry()
{
$params = [
'width' => 100,
'height' => 28,
'use_point_back' => false,
'key_prefix' => 'safety',
];
2018-12-28 10:58:37 +00:00
$verify = new \base\Verify($params);
$verify->Entry();
}
/**
* 登录密码修改
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-28T10:38:23+0800
*/
public function LoginPwdUpdate()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
2018-12-28 10:58:37 +00:00
}
// 开始处理
$params = $this->data_post;
2018-12-28 10:58:37 +00:00
$params['user'] = $this->user;
return ApiService::ApiDataReturn(SafetyService::LoginPwdUpdate($params));
2018-12-28 10:58:37 +00:00
}
/**
* 验证码发送
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-05T19:17:10+0800
*/
public function VerifySend()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
2018-12-28 10:58:37 +00:00
}
// 开始处理
$params = $this->data_post;
2018-12-28 10:58:37 +00:00
$params['user'] = $this->user;
return ApiService::ApiDataReturn(SafetyService::VerifySend($params));
2018-12-28 10:58:37 +00:00
}
/**
* 原账户验证码校验
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-28T15:57:19+0800
*/
public function VerifyCheck()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
2018-12-28 10:58:37 +00:00
}
// 开始处理
$params = $this->data_post;
2018-12-28 10:58:37 +00:00
$params['user'] = $this->user;
return ApiService::ApiDataReturn(SafetyService::VerifyCheck($params));
2018-12-28 10:58:37 +00:00
}
/**
* 账户更新
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-28T17:04:36+0800
*/
public function AccountsUpdate()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
2018-12-28 10:58:37 +00:00
}
// 开始处理
$params = $this->data_post;
2018-12-28 10:58:37 +00:00
$params['user'] = $this->user;
return ApiService::ApiDataReturn(SafetyService::AccountsUpdate($params));
2018-12-28 10:58:37 +00:00
}
}
?>