-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
aimerforreimu
committed
Apr 4, 2018
1 parent
72a9d3d
commit bd0bce8
Showing
20 changed files
with
894 additions
and
356 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
/** | ||
* Created by aimer. | ||
* User: aimer | ||
* Date: 2018/4/4 | ||
* Time: 下午4:00 | ||
*/ | ||
|
||
namespace admin\controller; | ||
|
||
|
||
use framework\core\Controller; | ||
use framework\core\Factory; | ||
use framework\tools\Regex; | ||
|
||
class AdminController extends Controller | ||
{ | ||
public function settingAction() | ||
{ | ||
if ($this->isLogin()) { | ||
$a_model = Factory::M('user'); | ||
$name = $_SESSION['user']; | ||
$admin = $a_model->getInfo($name); | ||
$this->smarty->assign('admin', $admin[0]); | ||
$this->smarty->display('admin/setting.html'); | ||
} else { | ||
$this->showActionInfo('请登录', null, '/?c=user&a=loginAction', '登录', 2000); | ||
} | ||
} | ||
|
||
public function doResetPassWord() | ||
{ | ||
if ($this->isLogin()) { | ||
//Check Authenticate | ||
if ($_POST['authenticate'] == $GLOBALS['config']['authenticate_code']) { | ||
//Check password is same or not | ||
if ($_POST['password'] == $_POST['password-repeat']) { | ||
$regexTest = new Regex(); | ||
//Use Regex Tool to check password regular | ||
$checkPassword = $regexTest->checkPassWord($_POST['password']); | ||
if ($checkPassword) { | ||
//Update | ||
$a_model = Factory::M('User'); | ||
$admin['password'] = md5($_POST['password']); | ||
$where['admin_id'] = $_POST['admin_id']; | ||
$a_model->update($admin, $where); | ||
|
||
//Logout | ||
if (empty($_SESSION['user'])) { | ||
$this->showActionInfo(null, null, nulll, null, 0); | ||
die; | ||
} | ||
unset($_SESSION['user']); | ||
setcookie('uname', '', time() - 1); | ||
setcookie('keysid', '', time() - 1); | ||
$this->showActionInfo('更改成功,请重新登录', null, null, null, 20000); | ||
|
||
} else { | ||
$this->showActionInfo('密码不符合要求', null, null, null, 2000); | ||
} | ||
} else { | ||
$this->showActionInfo('两次密码不匹配', null, null, null, 2000); | ||
} | ||
} else { | ||
$this->showActionInfo('验证秘钥不正确', null, null, null, 2000); | ||
} | ||
} else { | ||
$this->showActionInfo('请登录', null, '/?c=user&a=loginAction', '登录', 2000); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
application/admin/controller/IllegalScanController.class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* Created by aimer. | ||
* User: aimer | ||
* Date: 2018/4/4 | ||
* Time: 下午2:27 | ||
*/ | ||
|
||
namespace admin\controller; | ||
|
||
|
||
use framework\core\Controller; | ||
use framework\core\Factory; | ||
use framework\tools\Page; | ||
|
||
class IllegalScanController extends Controller | ||
{ | ||
public function illegalScanUserDashBroad() | ||
{ | ||
if ($this->isLogin()) { | ||
$s_model = Factory::M('Scan'); | ||
|
||
$page = new Page(); | ||
$illegal_scans_num = $page->total_pages = $s_model->getIllegalScanCount(); | ||
|
||
//How many data in one page | ||
$page->url = '/?m=admin&c=illegalScan&a=illegalScanUserDashBroad&'; | ||
$page->pagesize = $GLOBALS['config']['page_limit']; | ||
//Now page | ||
$page->now_page = isset($_GET['page']) ? $_GET['page'] : 1; | ||
$offset = ($page->now_page - 1) * $page->pagesize; | ||
$limit = $page->pagesize; | ||
//Get All Illegal Scan Info | ||
$illegal_scans = $s_model->getIllegalScan($offset, $limit); | ||
$page_bar = $page->create(); | ||
$this->smarty->assign('illegal_scans', $illegal_scans); | ||
$this->smarty->assign('illegal_num', $illegal_scans_num); | ||
$this->smarty->assign('page_bar', $page_bar); | ||
$this->smarty->display('illegal/illegal.html'); | ||
} else { | ||
$this->showActionInfo('请登录', null, '/?c=user&a=loginAction', '登录', 2000); | ||
} | ||
} | ||
|
||
public function illegalScanDetail() | ||
{ | ||
if ($this->isLogin()) { | ||
$s_model = Factory::M('Scan'); | ||
$detail = $s_model->getIllegalScanDetail($_GET['s_id']); | ||
$this->smarty->assign('detail',$detail[0]); | ||
$this->smarty->display('illegal/illegal_detail.html'); | ||
} else { | ||
$this->showActionInfo('请登录', null, '/?c=user&a=loginAction', '登录', 2000); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.