Index: Controller/ManagementController.class.php
===================================================================
--- Controller/ManagementController.class.php (revision 0)
+++ Controller/ManagementController.class.php (revision 2)
@@ -0,0 +1,101 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 管理员配置管理
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+use Admin\Service\User;
+
+class ManagementController extends AdminBase {
+
+ //管理员列表
+ public function manager() {
+ $where = array();
+ $role_id = I('get.role_id', 0, 'intval');
+ if ($role_id) {
+ $where['role_id'] = $role_id;
+ $menuReturn = array(
+ 'url' => U('Rbac/rolemanage'),
+ 'name' => '返回角色管理',
+ );
+ $this->assign('menuReturn', $menuReturn);
+ }
+ $count = D('Admin/User')->where($where)->count();
+ $page = $this->page($count, 20);
+ $User = D('Admin/User')->where($where)->limit($page->firstRow . ',' . $page->listRows)->order(array('id' => 'DESC'))->select();
+ $this->assign("Userlist", $User);
+ $this->assign("Page", $page->show());
+ $this->display();
+ }
+
+ //编辑信息
+ public function edit() {
+ $id = I('request.id', 0, 'intval');
+ if (empty($id)) {
+ $this->error("请选择需要编辑的信息!");
+ }
+ //判断是否修改本人,在此方法,不能修改本人相关信息
+ if (User::getInstance()->id == $id) {
+ $this->error("修改当前登录用户信息请进入[我的面板]中进行修改!");
+ }
+ if (1 == $id) {
+ $this->error("该帐号不允许修改!");
+ }
+ if (IS_POST) {
+ if (false !== D('Admin/User')->amendManager($_POST)) {
+ $this->success("更新成功!", U("Management/manager"));
+ } else {
+ $error = D('Admin/User')->getError();
+ $this->error($error ? $error : '修改失败!');
+ }
+ } else {
+ $data = D('Admin/User')->where(array("id" => $id))->find();
+ if (empty($data)) {
+ $this->error('该信息不存在!');
+ }
+ $this->assign("role", D('Admin/Role')->selectHtmlOption($data['role_id'], 'name="role_id"'));
+ $this->assign("data", $data);
+ $this->display();
+ }
+ }
+
+ //添加管理员
+ public function adminadd() {
+ if (IS_POST) {
+ if (D('Admin/User')->createManager($_POST)) {
+ $this->success("添加管理员成功!", U('Management/manager'));
+ } else {
+ $error = D('Admin/User')->getError();
+ $this->error($error ? $error : '添加失败!');
+ }
+ } else {
+ $this->assign("role", D('Admin/Role')->selectHtmlOption(0, 'name="role_id"'));
+ $this->display();
+ }
+ }
+
+ //管理员删除
+ public function delete() {
+ $id = I('get.id');
+ if (empty($id)) {
+ $this->error("没有指定删除对象!");
+ }
+ if ((int) $id == User::getInstance()->id) {
+ $this->error("你不能删除你自己!");
+ }
+ //执行删除
+ if (D('Admin/User')->deleteUser($id)) {
+ $this->success("删除成功!");
+ } else {
+ $this->error(D('Admin/User')->getError()? : '删除失败!');
+ }
+ }
+
+}
Index: Controller/PublicController.class.php
===================================================================
--- Controller/PublicController.class.php (revision 0)
+++ Controller/PublicController.class.php (revision 2)
@@ -0,0 +1,135 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 后台模块公共方法
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+use Admin\Service\User;
+
+class PublicController extends AdminBase {
+
+ //后台登陆界面
+ public function login() {
+ //如果已经登录
+ if (User::getInstance()->id) {
+ $this->redirect('Admin/Index/index');
+ }
+ $this->display();
+ }
+
+ //后台登陆验证
+ public function tologin() {
+ //记录登陆失败者IP
+ $ip = get_client_ip();
+ $username = I("post.username", "", "trim");
+ $password = I("post.password", "", "trim");
+ $code = I("post.code", "", "trim");
+ if (empty($username) || empty($password)) {
+ $this->error("用户名或者密码不能为空,请重新输入!", U("Public/login"));
+ }
+ if (empty($code)) {
+ $this->error("请输入验证码!", U("Public/login"));
+ }
+ //验证码开始验证
+ if (!$this->verify($code)) {
+ $this->error("验证码错误,请重新输入!", U("Public/login"));
+ }
+ if (User::getInstance()->login($username, $password)) {
+ $forward = cookie("forward");
+ if (!$forward) {
+ $forward = U("Admin/Index/index");
+ } else {
+ cookie("forward", NULL);
+ }
+ //增加登陆成功行为调用
+ $admin_public_tologin = array(
+ 'username' => $username,
+ 'ip' => $ip,
+ );
+ tag('admin_public_tologin', $admin_public_tologin);
+ $this->redirect('Index/index');
+ } else {
+ //增加登陆失败行为调用
+ $admin_public_tologin = array(
+ 'username' => $username,
+ 'password' => $password,
+ 'ip' => $ip,
+ );
+ tag('admin_public_tologin_error', $admin_public_tologin);
+ $this->error("用户名或者密码错误,登陆失败!", U("Public/login"));
+ }
+ }
+
+ //退出登陆
+ public function logout() {
+ if (User::getInstance()->logout()) {
+ //手动登出时,清空forward
+ cookie("forward", NULL);
+ $this->success('注销成功!', U("Admin/Public/login"));
+ }
+ }
+
+ //常用菜单设置
+ public function changyong() {
+ if (IS_POST) {
+ //被选中的菜单项
+ $menuidAll = explode(',', I('post.menuid', ''));
+ if (is_array($menuidAll) && count($menuidAll) > 0) {
+ //取得菜单数据
+ $menu_info = cache('Menu');
+ $addPanel = array();
+ //检测数据合法性
+ foreach ($menuidAll as $menuid) {
+ if (empty($menu_info[$menuid])) {
+ continue;
+ }
+ $info = array(
+ 'mid' => $menuid,
+ 'userid' => User::getInstance()->id,
+ 'name' => $menu_info[$menuid]['name'],
+ 'url' => "{$menu_info[$menuid]['app']}/{$menu_info[$menuid]['controller']}/{$menu_info[$menuid]['action']}",
+ );
+ $addPanel[] = $info;
+ }
+ if (D('Admin/AdminPanel')->addPanel($addPanel)) {
+ $this->success("添加成功!", U("Public/changyong"));
+ } else {
+ $error = D('Admin/AdminPanel')->getError();
+ $this->error($error ? $error : '添加失败!');
+ }
+ } else {
+ D('Admin/AdminPanel')->where(array("userid" => \Admin\Service\User::getInstance()->id))->delete();
+ $this->error("常用菜单清除成功!");
+ }
+ } else {
+ //菜单缓存
+ // $result = cache("Menu");
+ $result = array();
+ $json = array();
+ foreach ($result as $rs) {
+ if ($rs['status'] == 0) {
+ continue;
+ }
+ $data = array(
+ 'id' => $rs['id'],
+ 'nocheck' => $rs['type'] ? 0 : 1,
+ 'checked' => $rs['id'],
+ 'parentid' => $rs['parentid'],
+ 'name' => $rs['name'],
+ 'checked' => D("Admin/AdminPanel")->isExist($rs['id']) ? true : false,
+ );
+ $json[] = $data;
+ }
+ $this->assign('json', json_encode($json))
+ ->display();
+ }
+ }
+
+}
Index: Controller/AddonshopController.class.php
===================================================================
--- Controller/AddonshopController.class.php (revision 0)
+++ Controller/AddonshopController.class.php (revision 2)
@@ -0,0 +1,277 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 插件商店
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+
+class AddonshopController extends AdminBase {
+
+ protected function _initialize() {
+ parent::_initialize();
+ if (!isModuleInstall('Addons')) {
+ $this->error('你还没有安装插件模块,无法使用插件商店!');
+ }
+ }
+
+ //在线插件列表
+ public function index() {
+ if (IS_POST) {
+ $this->redirect('index', $_POST);
+ }
+ $parameter = array(
+ 'page' => $_GET[C('VAR_PAGE')]? : 1,
+ 'paging' => 10,
+ );
+ $keyword = I('get.keyword', '', 'trim');
+ if (!empty($keyword)) {
+ $parameter['keyword'] = $keyword;
+ $this->assign('keyword', $keyword);
+ }
+ if (IS_AJAX) {
+ $data = $this->Cloud->data($parameter)->act('get.addons.list');
+ if (false === $data) {
+ exit($this->Cloud->getError());
+ }
+ $data['data'] = $data['data']? : array();
+ foreach ($data['data'] as $sign => $rs) {
+ $version = M('Addons')->where(array('sign' => $rs['sign']))->getField('version');
+ if ($version && version_compare($version, $rs['version'], '<')) {
+ $data['data'][$sign]['upgrade'] = true;
+ $data['data'][$sign]['newVersion'] = $rs['version'];
+ } else {
+ $data['data'][$sign]['upgrade'] = false;
+ }
+ }
+ $page = $this->page($data['total'], $data['paging']);
+ $this->assign('Page', $page->show());
+ $this->assign('data', $data['data']);
+ $this->display('ajax');
+ return true;
+ }
+ $this->assign('page', $parameter['page']);
+ $this->display();
+ }
+
+ //云端插件下载安装
+ public function install() {
+ $sign = I('get.sign', '', 'trim');
+ if (empty($sign)) {
+ $this->error('请选择需要安装的插件!');
+ }
+ $this->assign('stepUrl', U('public_step_1', array('sign' => $sign)));
+ $this->assign('sign', $sign);
+ $this->display();
+ }
+
+ //目录权限判断通过后获取下载地址进行插件下载
+ public function public_step_1() {
+ if (\Libs\System\RBAC::authenticate('install') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $sign = I('get.sign', '', 'trim');
+ if (empty($sign)) {
+ $this->error('请选择需要安装的插件!');
+ }
+ $cache = S('Cloud');
+ if (!empty($cache)) {
+ $this->error('已经有任务在执行,请稍后!');
+ }
+ //帐号权限检测
+ if ($this->Cloud->competence() == false) {
+ $this->errors($this->Cloud->getError());
+ }
+ //获取插件信息
+ $data = $this->Cloud->data(array('sign' => $sign))->act('get.addons.info');
+ if (false === $data) {
+ $this->error($this->Cloud->getError());
+ } else {
+ S('Cloud', $data, 3600);
+ }
+ if (empty($data)) {
+ $this->errors('获取不到需要安装的插件信息缓存!');
+ }
+ $path = PROJECT_PATH . 'Addon/' . $data['name'];
+ //检查是否有同样的插件目录存在
+ if (file_exists($path)) {
+ $this->errors("目录:{$path} 已经存在,无法安装在同一目录!");
+ }
+ //获取下载地址
+ $packageUrl = $this->Cloud->data(array('sign' => $sign))->act('get.addons.install.package.url');
+ if (empty($packageUrl)) {
+ $this->errors($this->Cloud->getError());
+ }
+ //开始下载
+ if ($this->CloudDownload->storageFile($packageUrl) !== true) {
+ $this->errors($this->CloudDownload->getError());
+ }
+ $this->success('文件下载完毕!', U('public_step_2', array('package' => $packageUrl)));
+ }
+
+ //移动目录到插件
+ public function public_step_2() {
+ if (\Libs\System\RBAC::authenticate('install') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $data = S('Cloud');
+ if (empty($data)) {
+ $this->errors('获取不到需要安装的插件信息缓存!');
+ }
+ $packageUrl = I('get.package');
+ if (empty($packageUrl)) {
+ $this->errors('package参数为空!');
+ }
+ //临时目录名
+ $tmp = $this->CloudDownload->getTempFile($packageUrl);
+ //插件安装目录
+ $addonsPath = PROJECT_PATH . 'Addon/' . $data['name'] . '/';
+ if ($this->CloudDownload->movedFile($tmp, $addonsPath, $packageUrl) !== true) {
+ $this->errors($this->CloudDownload->getError());
+ }
+ $this->success('移动文件到插件目录中,等待安装!', U('public_step_3', array('name' => $data['name'])));
+ }
+
+ //安装插件
+ public function public_step_3() {
+ if (\Libs\System\RBAC::authenticate('install') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $name = I('get.name');
+ S('Cloud', NULL);
+ if (D('Addons/Addons')->installAddon($name)) {
+ $this->success('插件安装成功!');
+ } else {
+ $error = D('Addons/Addons')->getError();
+ //删除目录
+ ShuipFCMS()->Dir->delDir(PROJECT_PATH . 'Addon/' . $name);
+ $this->error($error ? $error : '插件安装失败!');
+ }
+ }
+
+ //插件升级
+ public function upgrade() {
+ $sign = I('get.sign', '', 'trim');
+ if (empty($sign)) {
+ $this->error('请选择需要升级的插件!');
+ }
+ $cache = S('Cloud');
+ if (!empty($cache)) {
+ $this->error('已经有任务在执行,请稍后!');
+ }
+ //帐号权限检测
+ if ($this->Cloud->competence() == false) {
+ $this->error($this->Cloud->getError());
+ }
+ //获取插件信息
+ $data = $this->Cloud->data(array('sign' => $sign))->act('get.addons.info');
+ if (false === $data) {
+ $this->error($this->Cloud->getError());
+ } else {
+ $version = M('Addons')->where(array('sign' => $data['sign']))->getField('version');
+ if ($version && !version_compare($version, $data['version'], '<')) {
+ $this->error('该插件无需升级!');
+ }
+ S('Cloud', $data, 3600);
+ }
+ $this->assign('stepUrl', U('public_upgrade_1'));
+ $this->display();
+ }
+
+ //目录权限判断通过后获取升级包下载地址进行插件下载
+ public function public_upgrade_1() {
+ if (\Libs\System\RBAC::authenticate('upgrade') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $data = S('Cloud');
+ if (empty($data)) {
+ $this->errors('获取不到需要升级的插件信息缓存!');
+ }
+ $sign = $data['sign'];
+ //检查是否安装
+ if (!D('Addons/Addons')->isInstall($data['name'])) {
+ $this->errors("没有安装该插件无法升级!");
+ }
+ $config = M('Addons')->where(array('sign' => $sign))->find();
+ if (empty($config)) {
+ $this->errors("无法获取插件安装信息!");
+ }
+ //获取下载地址
+ $packageUrl = $this->Cloud->data(array('sign' => $sign, 'version' => $config['version']))->act('get.addons.upgrade.package.url');
+ if (empty($packageUrl)) {
+ $this->errors($this->Cloud->getError());
+ }
+ //开始下载
+ if ($this->CloudDownload->storageFile($packageUrl) !== true) {
+ $this->errors($this->CloudDownload->getError());
+ }
+ $this->success('升级包文件下载完毕!', U('public_upgrade_2', array('package' => $packageUrl)));
+ }
+
+ //移动升级包到插件目录
+ public function public_upgrade_2() {
+ if (\Libs\System\RBAC::authenticate('upgrade') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $data = S('Cloud');
+ if (empty($data)) {
+ $this->errors('获取不到需要升级的插件信息缓存!');
+ }
+ $packageUrl = I('get.package');
+ if (empty($packageUrl)) {
+ $this->errors('package参数为空!');
+ }
+ //临时目录名
+ $tmp = $this->CloudDownload->getTempFile($packageUrl);
+ //插件安装目录
+ $addonsPath = PROJECT_PATH . 'Addon/' . $data['name'] . '/';
+ if ($this->CloudDownload->movedFile($tmp, $addonsPath, $packageUrl) !== true) {
+ $this->errors($this->CloudDownload->getError());
+ }
+ $this->success('移动文件到插件目录成功,等待升级!', U('public_upgrade_3', array('name' => $data['name'])));
+ }
+
+ //升级插件
+ public function public_upgrade_3() {
+ if (\Libs\System\RBAC::authenticate('upgrade') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $name = I('get.name');
+ S('Cloud', NULL);
+ if (D('Addons/Addons')->upgradeAddon($name)) {
+ ShuipFCMS()->Dir->delDir(PROJECT_PATH . "Addon/{$name}/Upgrade/");
+ $this->success('插件升级成功!');
+ } else {
+ $error = $this->Module->error;
+ $this->error($error ? $error : '插件升级失败!');
+ }
+ }
+
+ //获取插件使用说明
+ public function public_explanation() {
+ $sign = I('get.sign');
+ if (empty($sign)) {
+ $this->error('缺少参数!');
+ }
+ $parameter = array(
+ 'sign' => $sign
+ );
+ $data = $this->Cloud->data($parameter)->act('get.addons.explanation');
+ if (false === $data) {
+ $this->error($this->Cloud->getError());
+ }
+ $this->ajaxReturn(array('status' => true, 'sign' => $sign, 'data' => $data));
+ }
+
+ protected function errors($message = '', $jumpUrl = '', $ajax = false) {
+ S('Cloud', NULL);
+ $this->error($message, $jumpUrl, $ajax);
+ }
+
+}
Index: Controller/BehaviorController.class.php
===================================================================
--- Controller/BehaviorController.class.php (revision 0)
+++ Controller/BehaviorController.class.php (revision 2)
@@ -0,0 +1,140 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 行为管理
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+
+class BehaviorController extends AdminBase {
+
+ //行为模型
+ protected $behavior = NULL;
+
+ protected function _initialize() {
+ parent::_initialize();
+ $this->behavior = D('Common/Behavior');
+ }
+
+ //行为列表
+ public function index() {
+ $where = array();
+ //搜索行为标识
+ $keyword = I('get.keyword');
+ if (!empty($keyword)) {
+ $where['name'] = array('like', '%' . $keyword . '%');
+ $this->assign('keyword', $keyword);
+ }
+ //获取总数
+ $count = $this->behavior->where($where)->count('id');
+ $page = $this->page($count, 20);
+ $action = $this->behavior->where($where)->limit($page->firstRow . ',' . $page->listRows)->order(array("id" => "desc"))->select();
+
+ $this->assign("Page", $page->show('Admin'));
+ $this->assign('data', $action);
+ $this->display();
+ }
+
+ //添加行为
+ public function add() {
+ if (IS_POST) {
+ $post = I('post.', '', '');
+ if ($this->behavior->addBehavior($post)) {
+ $this->success('添加成功,需要更新缓存后生效!', U('Behavior/index'));
+ } else {
+ $this->error($this->behavior->getError());
+ }
+ } else {
+
+ $this->display();
+ }
+ }
+
+ //编辑行为
+ public function edit() {
+ if (IS_POST) {
+ $post = I('post.', '', '');
+ if ($this->behavior->editBehavior($post)) {
+ $this->success('修改成功,需要更新缓存后生效!', U('Behavior/index'));
+ } else {
+ $this->error($this->behavior->getError());
+ }
+ } else {
+ $id = I('get.id', 0, 'intval');
+ if (empty($id)) {
+ $this->error('请选择需要编辑的行为!');
+ }
+ //查询出行为信息
+ $info = $this->behavior->getBehaviorById($id);
+ if (empty($info)) {
+ $error = $this->behavior->getError();
+ $this->error($error ? $error : '该行为不存在!');
+ }
+
+ $this->assign('info', $info);
+ $this->display();
+ }
+ }
+
+ //删除行为
+ public function delete() {
+ $id = I('get.id', 0, 'intval');
+ if (empty($id)) {
+ $this->error('请指定需要删除的行为!');
+ }
+ //删除
+ if ($this->behavior->delBehaviorById($id)) {
+ $this->success('行为删除成功,需要更新缓存后生效!', U('Behavior/index'));
+ } else {
+ $error = $this->behavior->getError();
+ $this->error($error ? $error : '删除失败!');
+ }
+ }
+
+ //行为日志
+ public function logs() {
+ if(IS_POST){
+ $this->redirect('loginlog',$_POST);
+ }
+ $wehre = array();
+ $type = I('type', '', 'trim');
+ $keyword = I('keyword', '', 'trim');
+ if ($type) {
+ if ($type == 'guid') {
+ $wehre[$type] = array('LIKE', "%{$keyword}%");
+ } else {
+ $wehre[$type] = $keyword;
+ }
+ $this->assign('type', $type);
+ $this->assign('keyword', $keyword);
+ }
+ $model = M('BehaviorLog');
+ $count = $model->where($wehre)->count();
+ $page = $this->page($count, 20);
+ $data = $model->where($wehre)->limit($page->firstRow . ',' . $page->listRows)->order(array('id' => 'DESC'))->select();
+ $this->assign('Page', $page->show())
+ ->display();
+ }
+
+ //状态转换
+ public function status() {
+ $id = I('get.id', 0, 'intval');
+ if (empty($id)) {
+ $this->error('请指定需要状态转换的行为!');
+ }
+ //状态转换
+ if ($this->behavior->statusBehaviorById($id)) {
+ $this->success('行为状态转换成功,需要更新缓存后生效!', U('Behavior/index'));
+ } else {
+ $error = $this->behavior->getError();
+ $this->error($error ? $error : '状态转换失败!');
+ }
+ }
+
+}
Index: Controller/ModuleshopController.class.php
===================================================================
--- Controller/ModuleshopController.class.php (revision 0)
+++ Controller/ModuleshopController.class.php (revision 2)
@@ -0,0 +1,271 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 模块商店
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+
+class ModuleshopController extends AdminBase {
+
+ //在线模块列表
+ public function index() {
+ if (IS_POST) {
+ $this->redirect('index', $_POST);
+ }
+ $parameter = array(
+ 'page' => $_GET[C('VAR_PAGE')]? : 1,
+ 'paging' => 10,
+ );
+ $keyword = I('get.keyword', '', 'trim');
+ if (!empty($keyword)) {
+ $parameter['keyword'] = $keyword;
+ $this->assign('keyword', $keyword);
+ }
+ if (IS_AJAX) {
+ $data = $this->Cloud->data($parameter)->act('get.module.list');
+ if (false === $data) {
+ exit($this->Cloud->getError());
+ }
+ $data['data'] = $data['data']? : array();
+ foreach ($data['data'] as $sign => $rs) {
+ $version = D('Common/Module')->where(array('sign' => $rs['sign']))->getField('version');
+ if ($version && version_compare($version, $rs['version'], '<')) {
+ $data['data'][$sign]['upgrade'] = true;
+ $data['data'][$sign]['newVersion'] = $rs['version'];
+ } else {
+ $data['data'][$sign]['upgrade'] = false;
+ }
+ }
+ $page = $this->page($data['total'], $data['paging']);
+ $this->assign('Page', $page->show());
+ $this->assign('data', $data['data']);
+ $this->display('ajax');
+ return true;
+ }
+ $this->assign('page', $parameter['page']);
+ $this->display();
+ }
+
+ //云端模块下载安装
+ public function install() {
+ $sign = I('get.sign', '', 'trim');
+ if (empty($sign)) {
+ $this->error('请选择需要安装的模块!');
+ }
+ $this->assign('stepUrl', U('public_step_1', array('sign' => $sign)));
+ $this->assign('sign', $sign);
+ $this->display();
+ }
+
+ //模块升级
+ public function upgrade() {
+ $sign = I('get.sign', '', 'trim');
+ if (empty($sign)) {
+ $this->error('请选择需要升级的模块!');
+ }
+ $cache = S('Cloud');
+ if (!empty($cache)) {
+ $this->error('已经有任务在执行,请稍后!');
+ }
+ //帐号权限检测
+ if ($this->Cloud->competence() == false) {
+ $this->error($this->Cloud->getError());
+ }
+ //获取模块信息
+ $data = $this->Cloud->data(array('sign' => $sign))->act('get.module.info');
+ if (false === $data) {
+ $this->error($this->Cloud->getError());
+ } else {
+ $version = D('Common/Module')->where(array('sign' => $data['sign']))->getField('version');
+ if ($version && !version_compare($version, $data['version'], '<')) {
+ $this->error('该模板无需升级!');
+ }
+ S('Cloud', $data, 3600);
+ }
+ $this->assign('stepUrl', U('public_upgrade_1'));
+ $this->display();
+ }
+
+ //目录权限判断通过后获取升级包下载地址进行模块下载
+ public function public_upgrade_1() {
+ if (\Libs\System\RBAC::authenticate('upgrade') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $data = S('Cloud');
+ if (empty($data)) {
+ $this->errors('获取不到需要升级的模块信息缓存!');
+ }
+ $sign = $data['sign'];
+ //检查是否安装
+ if (!isModuleInstall($data['module'])) {
+ $this->errors("没有安装该模块无法升级!");
+ }
+ $config = $this->Module->config($data['module']);
+ if (empty($config)) {
+ $this->errors("无法获取模块安装信息!");
+ }
+ //获取下载地址
+ $packageUrl = $this->Cloud->data(array('sign' => $sign, 'version' => $config['version']))->act('get.module.upgrade.package.url');
+ if (empty($packageUrl)) {
+ $this->errors($this->Cloud->getError());
+ }
+ //开始下载
+ if ($this->CloudDownload->storageFile($packageUrl) !== true) {
+ $this->errors($this->CloudDownload->getError());
+ }
+ $this->success('升级包文件下载完毕!', U('public_upgrade_2', array('package' => $packageUrl)));
+ }
+
+ //移动升级包到模块目录
+ public function public_upgrade_2() {
+ if (\Libs\System\RBAC::authenticate('upgrade') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $data = S('Cloud');
+ if (empty($data)) {
+ $this->errors('获取不到需要升级的模块信息缓存!');
+ }
+ $packageUrl = I('get.package');
+ if (empty($packageUrl)) {
+ $this->errors('package参数为空!');
+ }
+ //临时目录名
+ $tmp = $this->CloudDownload->getTempFile($packageUrl);
+ //模块安装目录
+ $modulePath = APP_PATH . "{$data['module']}/";
+ if ($this->CloudDownload->movedFile($tmp, $modulePath, $packageUrl) !== true) {
+ $this->errors($this->CloudDownload->getError());
+ }
+ $this->success('移动文件到模块目录成功,等待升级!', U('public_upgrade_3', array('module' => $data['module'])));
+ }
+
+ //升级模块
+ public function public_upgrade_3() {
+ if (\Libs\System\RBAC::authenticate('upgrade') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $module = I('get.module');
+ S('Cloud', NULL);
+ if ($this->Module->upgrade($module)) {
+ ShuipFCMS()->Dir->delDir(APP_PATH . "{$module}/Upgrade/");
+ $this->success('模块升级成功!');
+ } else {
+ $error = $this->Module->error;
+ $this->error($error ? $error : '模块升级失败!');
+ }
+ }
+
+ //目录权限判断通过后获取下载地址进行模块下载
+ public function public_step_1() {
+ if (\Libs\System\RBAC::authenticate('install') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $sign = I('get.sign', '', 'trim');
+ if (empty($sign)) {
+ $this->error('请选择需要安装的模块!');
+ }
+ $cache = S('Cloud');
+ if (!empty($cache)) {
+ $this->error('已经有任务在执行,请稍后!');
+ }
+ //帐号权限检测
+ if ($this->Cloud->competence() == false) {
+ $this->errors($this->Cloud->getError());
+ }
+ //获取模块信息
+ $data = $this->Cloud->data(array('sign' => $sign))->act('get.module.info');
+ if (false === $data) {
+ $this->error($this->Cloud->getError());
+ } else {
+ S('Cloud', $data, 3600);
+ }
+ if (empty($data)) {
+ $this->errors('获取不到需要安装的模块信息缓存!');
+ }
+ $path = APP_PATH . $data['module'];
+ //检查是否有同样的模块目录存在
+ if (file_exists($path)) {
+ $this->errors("目录:{$path} 已经存在,无法安装在同一目录!");
+ }
+ //获取下载地址
+ $packageUrl = $this->Cloud->data(array('sign' => $sign))->act('get.module.install.package.url');
+ if (empty($packageUrl)) {
+ $this->errors($this->Cloud->getError());
+ }
+ //开始下载
+ if ($this->CloudDownload->storageFile($packageUrl) !== true) {
+ $this->errors($this->CloudDownload->getError());
+ }
+ $this->success('文件下载完毕!', U('public_step_2', array('package' => $packageUrl)));
+ }
+
+ //移动目录到模块
+ public function public_step_2() {
+ if (\Libs\System\RBAC::authenticate('install') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $data = S('Cloud');
+ if (empty($data)) {
+ $this->errors('获取不到需要安装的模块信息缓存!');
+ }
+ $packageUrl = I('get.package');
+ if (empty($packageUrl)) {
+ $this->errors('package参数为空!');
+ }
+ //临时目录名
+ $tmp = $this->CloudDownload->getTempFile($packageUrl);
+ //模块安装目录
+ $modulePath = APP_PATH . "{$data['module']}/";
+ if ($this->CloudDownload->movedFile($tmp, $modulePath, $packageUrl) !== true) {
+ $this->errors($this->CloudDownload->getError());
+ }
+ $this->success('移动文件到模块目录中,等待安装!', U('public_step_3', array('module' => $data['module'])));
+ }
+
+ //安装模块
+ public function public_step_3() {
+ if (\Libs\System\RBAC::authenticate('install') !== true) {
+ $this->errors('您没有该项权限!');
+ }
+ $module = I('get.module');
+ S('Cloud', NULL);
+ if ($this->Module->install($module)) {
+ ShuipFCMS()->Dir->delDir(APP_PATH . "{$module}/Install/");
+ $this->success('模块安装成功!');
+ } else {
+ $error = $this->Module->error;
+ //删除目录
+ ShuipFCMS()->Dir->delDir(APP_PATH . $module);
+ $this->error($error ? $error : '模块安装失败!');
+ }
+ }
+
+ //获取模块使用说明
+ public function public_explanation() {
+ $sign = I('get.sign');
+ if (empty($sign)) {
+ $this->error('缺少参数!');
+ }
+ $parameter = array(
+ 'sign' => $sign
+ );
+ $data = $this->Cloud->data($parameter)->act('get.module.explanation');
+ if (false === $data) {
+ $this->error($this->Cloud->getError());
+ }
+ $this->ajaxReturn(array('status' => true, 'sign' => $sign, 'data' => $data));
+ }
+
+ protected function errors($message = '', $jumpUrl = '', $ajax = false) {
+ S('Cloud', NULL);
+ $this->error($message, $jumpUrl, $ajax);
+ }
+
+}
Index: Controller/AdminmanageController.class.php
===================================================================
--- Controller/AdminmanageController.class.php (revision 0)
+++ Controller/AdminmanageController.class.php (revision 2)
@@ -0,0 +1,83 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 我的面板
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+use Admin\Service\User;
+
+class AdminmanageController extends AdminBase {
+
+ //修改当前登陆状态下的用户个人信息
+ public function myinfo() {
+ if (IS_POST) {
+ $data = array(
+ 'id' => User::getInstance()->id,
+ 'nickname' => I('nickname'),
+ 'email' => I('email'),
+ 'remark' => I('remark')
+ );
+ if (D("Admin/User")->create($data)) {
+ if (D("Admin/User")->where(array('id' => User::getInstance()->id))->save() !== false) {
+ $this->success("资料修改成功!", U("Adminmanage/myinfo"));
+ } else {
+ $this->error("更新失败!");
+ }
+ } else {
+ $this->error(D("Admin/User")->getError());
+ }
+ } else {
+ $this->assign("data", User::getInstance()->getInfo());
+ $this->display();
+ }
+ }
+
+ //后台登陆状态下修改当前登陆人密码
+ public function chanpass() {
+ if (IS_POST) {
+ $oldPass = I('post.password', '', 'trim');
+ if (empty($oldPass)) {
+ $this->error("请输入旧密码!");
+ }
+ $newPass = I('post.new_password', '', 'trim');
+ $new_pwdconfirm = I('post.new_pwdconfirm', '', 'trim');
+ if ($newPass != $new_pwdconfirm) {
+ $this->error("两次密码不相同!");
+ }
+ if (D("Admin/User")->changePassword(User::getInstance()->id, $newPass, $oldPass)) {
+ //退出登陆
+ User::getInstance()->logout();
+ $this->success("密码已经更新,请从新登陆!", U("Admin/Public/login"));
+ } else {
+ $error = D("Admin/User")->getError();
+ $this->error($error ? $error : "密码更新失败!");
+ }
+ } else {
+ $this->assign('userInfo', User::getInstance()->getInfo());
+ $this->display();
+ }
+ }
+
+ //验证密码是否正确
+ public function public_verifypass() {
+ $password = I("get.password");
+ if (empty($password)) {
+ $this->error("密码不能为空!");
+ }
+ //验证密码
+ $user = D('Admin/User')->getUserInfo((int) User::getInstance()->id, $password);
+ if (!empty($user)) {
+ $this->success("密码正确!");
+ } else {
+ $this->error("密码错误!");
+ }
+ }
+
+}
Index: Controller/LogsController.class.php
===================================================================
--- Controller/LogsController.class.php (revision 0)
+++ Controller/LogsController.class.php (revision 2)
@@ -0,0 +1,103 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 网站后台日志管理
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+
+class LogsController extends AdminBase {
+
+ //后台登陆日志
+ public function loginlog() {
+ if (IS_POST) {
+ $this->redirect('loginlog', $_POST);
+ }
+ $where = array();
+ $username = I('username');
+ $start_time = I('start_time');
+ $end_time = I('end_time');
+ $loginip = I('loginip');
+ $status = I('status');
+ if (!empty($username)) {
+ $where['username'] = array('like', '%' . $username . '%');
+ }
+ if (!empty($start_time) && !empty($end_time)) {
+ $start_time = strtotime($start_time);
+ $end_time = strtotime($end_time) + 86399;
+ $where['logintime'] = array(array('GT', $start_time), array('LT', $end_time), 'AND');
+ }
+ if (!empty($loginip)) {
+ $where['loginip '] = array('like', "%{$loginip}%");
+ }
+ if ($status != '') {
+ $where['status'] = $status;
+ }
+ $model = D("Admin/Loginlog");
+ $count = $model->where($where)->count();
+ $page = $this->page($count, 20);
+ $data = $model->where($where)->limit($page->firstRow . ',' . $page->listRows)->order(array('id' => 'DESC'))->select();
+ $this->assign("Page", $page->show())
+ ->assign("data", $data)
+ ->assign('where', $where)
+ ->display();
+ }
+
+ //删除一个月前的登陆日志
+ public function deleteloginlog() {
+ if (D("Admin/Loginlog")->deleteAMonthago()) {
+ $this->success("删除登陆日志成功!");
+ } else {
+ $this->error("删除登陆日志失败!");
+ }
+ }
+
+ //操作日志查看
+ public function index() {
+ if (IS_POST) {
+ $this->redirect('index', $_POST);
+ }
+ $uid = I('uid');
+ $start_time = I('start_time');
+ $end_time = I('end_time');
+ $ip = I('ip');
+ $status = I('status');
+ $where = array();
+ if (!empty($uid)) {
+ $where['uid'] = array('eq', $uid);
+ }
+ if (!empty($start_time) && !empty($end_time)) {
+ $start_time = strtotime($start_time);
+ $end_time = strtotime($end_time) + 86399;
+ $where['time'] = array(array('GT', $start_time), array('LT', $end_time), 'AND');
+ }
+ if (!empty($ip)) {
+ $where['ip '] = array('like', "%{$ip}%");
+ }
+ if ($status != '') {
+ $where['status'] = (int) $status;
+ }
+ $count = M("Operationlog")->where($where)->count();
+ $page = $this->page($count, 20);
+ $Logs = M("Operationlog")->where($where)->limit($page->firstRow . ',' . $page->listRows)->order(array("id" => "desc"))->select();
+ $this->assign("Page", $page->show());
+ $this->assign("logs", $Logs);
+ $this->display();
+ }
+
+ //删除一个月前的操作日志
+ public function deletelog() {
+ if (D("Admin/Operationlog")->deleteAMonthago()) {
+ $this->success("删除操作日志成功!");
+ } else {
+ $this->error("删除操作日志失败!");
+ }
+ }
+
+}
Index: Controller/MainController.class.php
===================================================================
--- Controller/MainController.class.php (revision 0)
+++ Controller/MainController.class.php (revision 2)
@@ -0,0 +1,65 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 后台框架首页
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+
+class MainController extends AdminBase {
+
+ public function index() {
+ //服务器信息
+ $info = array(
+ '操作系统' => PHP_OS,
+ '运行环境' => $_SERVER["SERVER_SOFTWARE"],
+ 'PHP运行方式' => php_sapi_name(),
+ 'MYSQL版本' => mysql_get_server_info(),
+ // '产品名称' => '<font color="#FF0000">' . SHUIPF_APPNAME . '</font>' . " [<a href='http://www.shuipfcms.com' target='_blank'>访问官网</a>]",
+ // '用户类型' => '<font color="#FF0000" id="server_license">获取中...</font>',
+ // '产品版本' => '<font color="#FF0000">' . SHUIPF_VERSION . '</font>,最新版本:<font id="server_version">获取中...</font>',
+ // '产品流水号' => '<font color="#FF0000">' . SHUIPF_BUILD . '</font>,最新流水号:<font id="server_build">获取中...</font>',
+ '上传附件限制' => ini_get('upload_max_filesize'),
+ '执行时间限制' => ini_get('max_execution_time') . "秒",
+ '剩余空间' => round((@disk_free_space(".") / (1024 * 1024)), 2) . 'M',
+ );
+
+ $this->assign('server_info', $info);
+ $this->display();
+ }
+
+ public function public_server() {
+ $post = array(
+ 'domain' => $_SERVER['SERVER_NAME'],
+ );
+ $cache = S('_serverinfo');
+ if (!empty($cache)) {
+ $data = $cache;
+ } else {
+ $data = $this->Cloud->data($post)->act('get.serverinfo');
+ S('_serverinfo', $data, 300);
+ }
+ if (!empty($_COOKIE['notice_' . $data['notice']['id']])) {
+ $data['notice']['id'] = 0;
+ }
+ if (version_compare(SHUIPF_VERSION, $data['latestversion']['version'], '<')) {
+ $data['latestversion'] = array(
+ 'status' => true,
+ 'version' => $data['latestversion'],
+ );
+ } else {
+ $data['latestversion'] = array(
+ 'status' => false,
+ 'version' => $data['latestversion'],
+ );
+ }
+ $this->ajaxReturn($data);
+ }
+
+}
Index: Controller/MenuController.class.php
===================================================================
--- Controller/MenuController.class.php (revision 0)
+++ Controller/MenuController.class.php (revision 2)
@@ -0,0 +1,125 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 菜单管理
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+
+class MenuController extends AdminBase {
+
+ //菜单首页
+ public function index() {
+ if (IS_POST) {
+ $listorders = $_POST['listorders'];
+ if (!empty($listorders)) {
+ foreach ($listorders as $id => $v) {
+ D("Admin/Menu")->find($id);
+ D("Admin/Menu")->listorder = $v;
+ D("Admin/Menu")->save();
+ }
+ $this->success('修改成功!', U('index'));
+ exit;
+ }
+ }
+ $result = D("Admin/Menu")->order(array("listorder" => "ASC"))->select();
+ $tree = new \Tree();
+ $tree->icon = array(' │ ', ' ├─ ', ' └─ ');
+ $tree->nbsp = ' ';
+ foreach ($result as $r) {
+ $r['str_manage'] = '<a href="' . U("Menu/add", array("parentid" => $r['id'])) . '">添加子菜单</a> | <a href="' . U("Menu/edit", array("id" => $r['id'])) . '">修改</a> | <a class="J_ajax_del" href="' . U("Menu/delete", array("id" => $r['id'])) . '">删除</a> ';
+ $r['status'] = $r['status'] ? "显示" : "不显示";
+ $array[] = $r;
+ }
+ $tree->init($array);
+ $str = "<tr>
+ <td align='center'><input name='listorders[\$id]' type='text' size='3' value='\$listorder' class='input'></td>
+ <td align='center'>\$id</td>
+ <td >\$spacer\$name</td>
+ <td align='center'>\$status</td>
+ <td align='center'>\$str_manage</td>
+ </tr>";
+ $categorys = $tree->get_tree(0, $str);
+ $this->assign("categorys", $categorys);
+ $this->display();
+ }
+
+ //添加菜单
+ public function add() {
+ if (IS_POST) {
+ if (D("Admin/Menu")->create()) {
+ if (D("Admin/Menu")->add()) {
+ $this->success("添加成功!", U("Menu/index"));
+ } else {
+ $this->error("添加失败!");
+ }
+ } else {
+ $this->error(D("Admin/Menu")->getError());
+ }
+ } else {
+ $tree = new \Tree();
+ $parentid = I('get.parentid', 0, 'intval');
+ $result = D("Admin/Menu")->select();
+ foreach ($result as $r) {
+ $r['selected'] = $r['id'] == $parentid ? 'selected' : '';
+ $array[] = $r;
+ }
+ $str = "<option value='\$id' \$selected>\$spacer \$name</option>";
+ $tree->init($array);
+ $select_categorys = $tree->get_tree(0, $str);
+ $this->assign("select_categorys", $select_categorys);
+ $this->display();
+ }
+ }
+
+ //编辑
+ public function edit() {
+ if (IS_POST) {
+ if (D("Admin/Menu")->create()) {
+ if (D("Admin/Menu")->save() !== false) {
+ $this->success("更新成功!", U("Menu/index"));
+ } else {
+ $this->error("更新失败!");
+ }
+ } else {
+ $this->error(D("Admin/Menu")->getError());
+ }
+ } else {
+ $tree = new \Tree();
+ $id = I('id', 0, 'intval');
+ $rs = D("Admin/Menu")->find($id);
+ $result = D("Admin/Menu")->select();
+ foreach ($result as $r) {
+ $r['selected'] = $r['id'] == $rs['parentid'] ? 'selected' : '';
+ $array[] = $r;
+ }
+ $str = "<option value='\$id' \$selected>\$spacer \$name</option>";
+ $tree->init($array);
+ $select_categorys = $tree->get_tree(0, $str);
+ $this->assign("data", $rs);
+ $this->assign("select_categorys", $select_categorys);
+ $this->display();
+ }
+ }
+
+ //删除
+ public function delete() {
+ $id = I('get.id', 0, 'intval');
+ $count = D("Admin/Menu")->where(array("parentid" => $id))->count();
+ if ($count > 0) {
+ $this->error("该菜单下还有子菜单,无法删除!");
+ }
+ if (D("Admin/Menu")->delete($id)) {
+ $this->success("删除菜单成功!");
+ } else {
+ $this->error("删除失败!");
+ }
+ }
+
+}
Index: Controller/ConfigController.class.php
===================================================================
--- Controller/ConfigController.class.php (revision 0)
+++ Controller/ConfigController.class.php (revision 2)
@@ -0,0 +1,159 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 站点配置
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+
+class ConfigController extends AdminBase {
+
+ private $Config = null;
+
+ protected function _initialize() {
+ parent::_initialize();
+ $this->Config = D('Common/Config');
+ $configList = $this->Config->getField("varname,value");
+ $this->assign('Site', $configList);
+ }
+
+ //网站基本设置
+ public function index() {
+ if (IS_POST) {
+ if ($this->Config->saveConfig($_POST)) {
+ $this->success("更新成功!");
+ } else {
+ $error = $this->Config->getError();
+ $this->error($error ? $error : "配置更新失败!");
+ }
+ } else {
+ //首页模板
+ $filepath = TEMPLATE_PATH . (empty(self::$Cache["Config"]['theme']) ? 'Default' : self::$Cache["Config"]['theme']) . '/Content/Index/';
+ $indextp = str_replace($filepath, '', glob($filepath . 'index*'));
+ //URL规则
+ $Urlrules = cache('Urlrules');
+ $IndexURL = array();
+ $TagURL = array();
+ foreach ($Urlrules as $k => $v) {
+ if ($v['file'] == 'tags') {
+ $TagURL[$v['urlruleid']] = $v['example'];
+ }
+ if ($v['module'] == 'content' && $v['file'] == 'index') {
+ $IndexURL[$v['ishtml']][$v['urlruleid']] = $v['example'];
+ }
+ }
+ $this->assign('TagURL', $TagURL)
+ ->assign('IndexURL', $IndexURL)
+ ->assign('indextp', $indextp)
+ ->display();
+ }
+ }
+
+ //邮箱参数
+ public function mail() {
+ if (IS_POST) {
+ $this->index();
+ } else {
+ $this->display();
+ }
+ }
+
+ //附件参数
+ public function attach() {
+ if (IS_POST) {
+ $this->index();
+ } else {
+ $path = PROJECT_PATH . 'Libs/Driver/Attachment/';
+ $dirverList = glob($path . '*');
+ $lang = array(
+ 'Local' => '本地存储驱动',
+ 'Ftp' => 'FTP远程附件驱动',
+ );
+ foreach ($dirverList as $k => $rs) {
+ unset($dirverList[$k]);
+ $dirverName = str_replace(array($path, '.class.php'), '', $rs);
+ $dirverList[$dirverName] = $lang[$dirverName]? : $dirverName;
+ }
+ $this->assign('dirverList', $dirverList);
+ $this->display();
+ }
+ }
+
+ //高级配置
+ public function addition() {
+ if (IS_POST) {
+ if ($this->Config->addition($_POST)) {
+ $this->success("修改成功,请及时更新缓存!");
+ } else {
+ $error = $this->Config->getError();
+ $this->error($error ? $error : "高级配置更新失败!");
+ }
+ } else {
+ $addition = include COMMON_PATH . 'Conf/addition.php';
+ if (empty($addition) || !is_array($addition)) {
+ $addition = array();
+ }
+ $this->assign("addition", $addition);
+ $this->display();
+ }
+ }
+
+ //扩展配置
+ public function extend() {
+ if (IS_POST) {
+ $action = I('post.action');
+ if ($action) {
+ //添加扩展项
+ if ($action == 'add') {
+ $data = array(
+ 'fieldname' => trim(I('post.fieldname')),
+ 'type' => trim(I('post.type')),
+ 'setting' => I('post.setting'),
+ C("TOKEN_NAME") => I('post.' . C("TOKEN_NAME")),
+ );
+ if ($this->Config->extendAdd($data) !== false) {
+ $this->success('扩展配置项添加成功!', U('Config/extend'));
+ return true;
+ } else {
+ $error = $this->Config->getError();
+ $this->error($error ? $error : '添加失败!');
+ }
+ }
+ } else {
+ //更新扩展项配置
+ if ($this->Config->saveExtendConfig($_POST)) {
+ $this->success("更新成功!");
+ } else {
+ $error = $this->Config->getError();
+ $this->error($error ? $error : "配置更新失败!");
+ }
+ }
+ } else {
+ $action = I('get.action');
+ $db = M('ConfigField');
+ if ($action) {
+ if ($action == 'delete') {
+ $fid = I('get.fid', 0, 'intval');
+ if ($this->Config->extendDel($fid)) {
+ cache('Config', NULL);
+ $this->success("扩展配置项删除成功!");
+ return true;
+ } else {
+ $error = $this->Config->getError();
+ $this->error($error ? $error : "扩展配置项删除失败!");
+ }
+ }
+ }
+ $extendList = $db->order(array('fid' => 'DESC'))->select();
+ $this->assign('extendList', $extendList);
+ $this->display();
+ }
+ }
+
+}
Index: Controller/ModuleController.class.php
===================================================================
--- Controller/ModuleController.class.php (revision 0)
+++ Controller/ModuleController.class.php (revision 2)
@@ -0,0 +1,138 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 本地模块管理
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+use Libs\System\Module;
+
+class ModuleController extends AdminBase {
+
+ //模块所处目录路径
+ protected $appPath = APP_PATH;
+ //已安装模块列表
+ protected $moduleList = array();
+ //系统模块,隐藏
+ protected $systemModuleList = array('Admin', 'Api', 'Install', 'Attachment', 'Template', 'Content');
+
+ //初始化
+ protected function _initialize() {
+ parent::_initialize();
+ $this->moduleList = M('Module')->select();
+ }
+
+ //本地模块列表
+ public function index() {
+ //取得模块目录名称
+ $dirs = glob($this->appPath . '*');
+ foreach ($dirs as $path) {
+ if (is_dir($path)) {
+ //目录名称
+ $path = basename($path);
+ //系统模块隐藏
+ if (in_array($path, $this->systemModuleList)) {
+ continue;
+ }
+ $dirs_arr[] = $path;
+ }
+ }
+ //取得已安装模块列表
+ $moduleList = array();
+ foreach ($this->moduleList as $v) {
+ $moduleList[$v['module']] = $v;
+ //检查是否系统模块,如果是,直接不显示
+ if ($v['iscore']) {
+ $key = array_keys($dirs_arr, $v['module']);
+ unset($dirs_arr[$key[0]]);
+ }
+ }
+
+ //数量
+ $count = count($dirs_arr);
+ //把一个数组分割为新的数组块
+ $dirs_arr = array_chunk($dirs_arr, 10, true);
+ //当前分页
+ $page = max(I('get.' . C('VAR_PAGE'), 0, 'intval'), 1);
+ //根据分页取到对应的模块列表数据
+ $directory = $dirs_arr[intval($page - 1)];
+ foreach ($directory as $module) {
+ $moduleList[$module] = $this->Module->config($module);
+ }
+ //进行分页
+ $Page = $this->page($count, 10);
+
+ $this->assign("Page", $Page->show());
+ $this->assign("data", $moduleList);
+ $this->assign("modules", $this->moduleList);
+ $this->display();
+ }
+
+ //安装
+ public function install() {
+ if (IS_POST) {
+ $post = I('post.');
+ $module = $post['module'];
+ if (empty($module)) {
+ $this->error('请选择需要安装的模块!');
+ }
+ if ($this->Module->install($module)) {
+ $this->success('模块安装成功!', U('Admin/Module/index'));
+ } else {
+ $error = $this->Module->error;
+ $this->error($error ? $error : '模块安装失败!');
+ }
+ } else {
+ $module = I('get.module', '', 'trim,ucwords');
+ if (empty($module)) {
+ $this->error('请选择需要安装的模块!');
+ }
+ //检查是否已经安装过
+ if ($this->Module->isInstall($module) !== false) {
+ $this->error('该模块已经安装!');
+ }
+ $config = $this->Module->config($module);
+ //版本检查
+ if ($config['adaptation']) {
+ $version = version_compare(SHUIPF_VERSION, $config['adaptation'], '>=');
+ $this->assign('version', $version);
+ }
+ $this->assign('config', $config);
+ $this->display();
+ }
+ }
+
+ //模块卸载
+ public function uninstall() {
+ $module = I('get.module', '', 'trim,ucwords');
+ if (empty($module)) {
+ $this->error('请选择需要安装的模块!');
+ }
+ if ($this->Module->uninstall($module)) {
+ $this->success("模块卸载成功,请及时更新缓存!", U("Module/index"));
+ } else {
+ $error = $this->Module->error;
+ $this->error($error ? $error : "模块卸载失败!", U("Module/index"));
+ }
+ }
+
+ //模块状态转换
+ public function disabled() {
+ $module = I('get.module', '', 'trim,ucwords');
+ if (empty($module)) {
+ $this->error('请选择模块!');
+ }
+ if (D('Common/Module')->disabled($module)) {
+ $this->success("状态转换成功,请及时更新缓存!", U("Module/index"));
+ } else {
+ $this->error("状态转换成功失败!", U("Module/index"));
+ }
+ }
+
+}
Index: Controller/IndexController.class.php
===================================================================
--- Controller/IndexController.class.php (revision 0)
+++ Controller/IndexController.class.php (revision 2)
@@ -0,0 +1,139 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 后台首页
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+use Admin\Service\User;
+
+class IndexController extends AdminBase {
+
+ //后台框架首页
+ public function index() {
+ //清除缓存
+ if (IS_AJAX) {
+ $this->ajaxReturn(array('status' => 1));
+ return true;
+ }
+ $this->assign("SUBMENU_CONFIG", json_encode(D("Admin/Menu")->getMenuList()));
+ $this->assign('userInfo', User::getInstance()->getInfo());
+ $this->assign('role_name', D('Admin/Role')->getRoleIdName(User::getInstance()->role_id));
+ $this->display();
+ }
+
+ //缓存更新
+ public function cache() {
+ if (isset($_GET['type'])) {
+ $Dir = new \Dir();
+ $cache = D('Common/Cache');
+ $type = I('get.type');
+ set_time_limit(0);
+ switch ($type) {
+ case "site":
+ //开始刷新缓存
+ $stop = I('get.stop', 0, 'intval');
+ if (empty($stop)) {
+ try {
+ //已经清除过的目录
+ $dirList = explode(',', I('get.dir', ''));
+ //删除缓存目录下的文件
+ $Dir->del(RUNTIME_PATH);
+ //获取子目录
+ $subdir = glob(RUNTIME_PATH . '*', GLOB_ONLYDIR | GLOB_NOSORT);
+ if (is_array($subdir)) {
+ foreach ($subdir as $path) {
+ $dirName = str_replace(RUNTIME_PATH, '', $path);
+ //忽略目录
+ if (in_array($dirName, array('Cache', 'Logs'))) {
+ continue;
+ }
+ if (in_array($dirName, $dirList)) {
+ continue;
+ }
+ $dirList[] = $dirName;
+ //删除目录
+ $Dir->delDir($path);
+ //防止超时,清理一个从新跳转一次
+ $this->assign("waitSecond", 200);
+ $this->success("清理缓存目录[{$dirName}]成功!", U('Index/cache', array('type' => 'site', 'dir' => implode(',', $dirList))));
+ exit;
+ }
+ }
+ //更新开启其他方式的缓存
+ \Think\Cache::getInstance()->clear();
+ } catch (Exception $exc) {
+
+ }
+ }
+ if ($stop) {
+ $modules = $cache->getCacheList();
+ //需要更新的缓存信息
+ $cacheInfo = $modules[$stop - 1];
+ if ($cacheInfo) {
+ if ($cache->runUpdate($cacheInfo) !== false) {
+ $this->assign("waitSecond", 200);
+ $this->success('更新缓存:' . $cacheInfo['name'], U('Index/cache', array('type' => 'site', 'stop' => $stop + 1)));
+ exit;
+ } else {
+ $this->error('缓存[' . $cacheInfo['name'] . ']更新失败!', U('Index/cache', array('type' => 'site', 'stop' => $stop + 1)));
+ }
+ } else {
+ $this->success('缓存更新完毕!', U('Index/cache'));
+ exit;
+ }
+ }
+ $this->success("即将更新站点缓存!", U('Index/cache', array('type' => 'site', 'stop' => 1)));
+ break;
+ case "template":
+ //删除缓存目录下的文件
+ $Dir->del(RUNTIME_PATH);
+ $Dir->delDir(RUNTIME_PATH . "Cache/");
+ $Dir->delDir(RUNTIME_PATH . "Temp/");
+ //更新开启其他方式的缓存
+ \Think\Cache::getInstance()->clear();
+ $this->success("模板缓存清理成功!", U('Index/cache'));
+ break;
+ case "logs":
+ $Dir->delDir(RUNTIME_PATH . "Logs/");
+ $this->success("站点日志清理成功!", U('Index/cache'));
+ break;
+ default:
+ $this->error("请选择清楚缓存类型!");
+ break;
+ }
+ } else {
+ $this->display();
+ }
+ }
+
+ //后台框架首页菜单搜索
+ public function public_find() {
+ $keyword = I('get.keyword');
+ if (!$keyword) {
+ $this->error("请输入需要搜索的关键词!");
+ }
+ $where = array();
+ $where['name'] = array("LIKE", "%$keyword%");
+ $where['status'] = array("EQ", 1);
+ $where['type'] = array("EQ", 1);
+ $data = M("Menu")->where($where)->select();
+ $menuData = $menuName = array();
+ $Module = F("Module");
+ foreach ($data as $k => $v) {
+ $menuData[ucwords($v['app'])][] = $v;
+ $menuName[ucwords($v['app'])] = $Module[ucwords($v['app'])]['name'];
+ }
+ $this->assign("menuData", $menuData);
+ $this->assign("menuName", $menuName);
+ $this->assign("keyword", $keyword);
+ $this->display();
+ }
+
+}
Index: Controller/RbacController.class.php
===================================================================
--- Controller/RbacController.class.php (revision 0)
+++ Controller/RbacController.class.php (revision 2)
@@ -0,0 +1,260 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 系统权限配置,用户角色管理
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+
+class RbacController extends AdminBase {
+
+ //角色管理首页
+ public function rolemanage() {
+ $tree = new \Tree();
+ $tree->icon = array(' │ ', ' ├─ ', ' └─ ');
+ $tree->nbsp = ' ';
+ $roleList = D("Admin/Role")->getTreeArray();
+ foreach ($roleList as $k => $rs) {
+ $operating = '';
+ if ($rs['id'] == 1) {
+ $operating = '<font color="#cccccc">权限设置</font> | <a href="' . U('Management/manager', array('role_id' => $rs['id'])) . '">成员管理</a> | <font color="#cccccc">修改</font> | <font color="#cccccc">删除</font>';
+ } else {
+ $operating = '<a href="' . U("Rbac/authorize", array("id" => $rs["id"])) . '">权限设置</a> | <a href="' . U('Management/manager', array('role_id' => $rs['id'])) . '">成员管理</a> | <a href="' . U('Rbac/roleedit', array('id' => $rs['id'])) . '">修改</a> | <a class="J_ajax_del" href="' . U('Rbac/roledelete', array('id' => $rs['id'])) . '">删除</a>';
+ }
+ $roleList[$k]['operating'] = $operating;
+ }
+ $str = "<tr>
+ <td>\$id</td>
+ <td>\$spacer\$name</td>
+ <td>\$remark</td>
+ <td align='center'><font color='red'>√</font></td>
+ <td align='center'>\$operating</td>
+ </tr>";
+ $tree->init($roleList);
+ $this->assign("role", $tree->get_tree(0, $str));
+ $this->assign("data", D("Admin/Role")->order(array("listorder" => "asc", "id" => "desc"))->select())
+ ->display();
+ }
+
+ //添加角色
+ public function roleadd() {
+ if (IS_POST) {
+ if (D("Admin/Role")->create()) {
+ if (D("Admin/Role")->add()) {
+ $this->success("添加角色成功!", U("Rbac/rolemanage"));
+ } else {
+ $this->error("添加失败!");
+ }
+ } else {
+ $error = D("Admin/Role")->getError();
+ $this->error($error ? $error : '添加失败!');
+ }
+ } else {
+ $this->display();
+ }
+ }
+
+ //删除角色
+ public function roledelete() {
+ $id = I('get.id', 0, 'intval');
+ if (D("Admin/Role")->roleDelete($id)) {
+ $this->success("删除成功!", U('Rbac/rolemanage'));
+ } else {
+ $error = D("Admin/Role")->getError();
+ $this->error($error ? $error : '删除失败!');
+ }
+ }
+
+ //编辑角色
+ public function roleedit() {
+ $id = I('request.id', 0, 'intval');
+ if (empty($id)) {
+ $this->error('请选择需要编辑的角色!');
+ }
+ if (1 == $id) {
+ $this->error("超级管理员角色不能被修改!");
+ }
+ if (IS_POST) {
+ if (D("Admin/Role")->create()) {
+ if (D("Admin/Role")->where(array('id' => $id))->save()) {
+ $this->success("修改成功!", U('Rbac/rolemanage'));
+ } else {
+ $this->error("修改失败!");
+ }
+ } else {
+ $error = D("Admin/Role")->getError();
+ $this->error($error ? $error : '修改失败!');
+ }
+ } else {
+ $data = D("Admin/Role")->where(array("id" => $id))->find();
+ if (empty($data)) {
+ $this->error("该角色不存在!", U('rolemanage'));
+ }
+ $this->assign("data", $data)
+ ->display();
+ }
+ }
+
+ //角色授权
+ public function authorize() {
+ if (IS_POST) {
+ $roleid = I('post.roleid', 0, 'intval');
+ if (!$roleid) {
+ $this->error("需要授权的角色不存在!");
+ }
+ //被选中的菜单项
+ $menuidAll = explode(',', I('post.menuid', ''));
+ if (is_array($menuidAll) && count($menuidAll) > 0) {
+
+
+ $menu_info = cache('Menu');
+ $addauthorize = array();
+ //检测数据合法性
+ foreach ($menuidAll as $menuid) {
+ if (empty($menu_info[$menuid])) {
+ continue;
+ }
+ $info = array(
+ 'app' => $menu_info[$menuid]['app'],
+ 'controller' => $menu_info[$menuid]['controller'],
+ 'action' => $menu_info[$menuid]['action'],
+ 'type' => $menu_info[$menuid]['type'],
+ );
+ //菜单项
+ if ($info['type'] == 0) {
+ $info['app'] = $info['app'];
+ $info['controller'] = $info['controller'] . $menuid;
+ $info['action'] = $info['action'] . $menuid;
+ }
+ $info['role_id'] = $roleid;
+ $info['status'] = $info['type'] ? 1 : 0;
+ $addauthorize[] = $info;
+ }
+ if (D('Admin/Access')->batchAuthorize($addauthorize, $roleid)) {
+ $this->success("授权成功!", U("Rbac/rolemanage"));
+ } else {
+ $error = D("Admin/Access")->getError();
+ $this->error($error ? $error : '授权失败!');
+ }
+ } else {
+ $this->error("没有接收到数据,执行清除授权成功!");
+ }
+ } else {
+ //角色ID
+ $roleid = I('get.id', 0, 'intval');
+ if (empty($roleid)) {
+ $this->error("参数错误!");
+ }
+
+ //菜单缓存
+ $result = cache("Menu");
+ $result = array();
+ //获取已权限表数据
+ $priv_data = D("Admin/Role")->getAccessList($roleid);
+ $json = array();
+ foreach ($result as $rs) {
+ $data = array(
+ 'id' => $rs['id'],
+ 'checked' => $rs['id'],
+ 'parentid' => $rs['parentid'],
+ 'name' => $rs['name'] . ($rs['type'] == 0 ? "(菜单项)" : ""),
+ 'checked' => D("Admin/Role")->isCompetence($rs, $roleid, $priv_data) ? true : false,
+ );
+ $json[] = $data;
+ }
+ $this->assign('json', json_encode($json))
+ ->assign("roleid", $roleid)
+ ->assign('name', D("Admin/Role")->getRoleIdName($roleid))
+ ->display();
+ }
+ }
+
+ //栏目授权
+ public function setting_cat_priv() {
+ if (IS_POST) {
+ $roleid = I('post.roleid', 0, 'intval');
+ $priv = array();
+ foreach ($_POST['priv'] as $k => $v) {
+ foreach ($v as $e => $q) {
+ $priv[] = array("roleid" => $roleid, "catid" => $k, "action" => $q, "is_admin" => 1);
+ }
+ }
+ C('TOKEN_ON', false);
+ //循环验证每天数据是否都合法
+ foreach ($priv as $r) {
+ $data = M("CategoryPriv")->create($r);
+ if (!$data) {
+ $this->error(M("CategoryPriv")->getError());
+ } else {
+ $addpriv[] = $data;
+ }
+ }
+ C('TOKEN_ON', true);
+ //设置权限前,先删除原来旧的权限
+ M("CategoryPriv")->where(array("roleid" => $roleid))->delete();
+ //添加新的权限数据,使用D方法有操作记录产生
+ M("CategoryPriv")->addAll($addpriv);
+ $this->success("权限赋予成功!");
+ } else {
+ $roleid = I('get.roleid', 0, 'intval');
+ if(empty($roleid)){
+ $this->error('请指定需要授权的角色!');
+ }
+ $categorys = cache("Category");
+ $tree = new \Tree();
+ $tree->icon = array(' │ ', ' ├─ ', ' └─ ');
+ $tree->nbsp = ' ';
+ $category_priv = M("CategoryPriv")->where(array("roleid" => $roleid))->select();
+ $priv = array();
+ foreach ($category_priv as $k => $v) {
+ $priv[$v['catid']][$v['action']] = true;
+ }
+
+ foreach ($categorys as $k => $v) {
+ $v = getCategory($v['catid']);
+ if ($v['type'] == 1 || $v['child']) {
+ $v['disabled'] = 'disabled';
+ $v['init_check'] = '';
+ $v['add_check'] = '';
+ $v['delete_check'] = '';
+ $v['listorder_check'] = '';
+ $v['push_check'] = '';
+ $v['move_check'] = '';
+ } else {
+ $v['disabled'] = '';
+ $v['add_check'] = isset($priv[$v['catid']]['add']) ? 'checked' : '';
+ $v['delete_check'] = isset($priv[$v['catid']]['delete']) ? 'checked' : '';
+ $v['listorder_check'] = isset($priv[$v['catid']]['listorder']) ? 'checked' : '';
+ $v['push_check'] = isset($priv[$v['catid']]['push']) ? 'checked' : '';
+ $v['move_check'] = isset($priv[$v['catid']]['remove']) ? 'checked' : '';
+ $v['edit_check'] = isset($priv[$v['catid']]['edit']) ? 'checked' : '';
+ }
+ $v['init_check'] = isset($priv[$v['catid']]['init']) ? 'checked' : '';
+ $categorys[$k] = $v;
+ }
+ $str = "<tr>
+ <td align='center'><input type='checkbox' value='1' onclick='select_all(\$catid, this)' ></td>
+ <td>\$spacer\$catname</td>
+ <td align='center'><input type='checkbox' name='priv[\$catid][]' \$init_check value='init' ></td>
+ <td align='center'><input type='checkbox' name='priv[\$catid][]' \$disabled \$add_check value='add' ></td>
+ <td align='center'><input type='checkbox' name='priv[\$catid][]' \$disabled \$edit_check value='edit' ></td>
+ <td align='center'><input type='checkbox' name='priv[\$catid][]' \$disabled \$delete_check value='delete' ></td>
+ <td align='center'><input type='checkbox' name='priv[\$catid][]' \$disabled \$listorder_check value='listorder' ></td>
+ <td align='center'><input type='checkbox' name='priv[\$catid][]' \$disabled \$push_check value='push' ></td>
+ <td align='center'><input type='checkbox' name='priv[\$catid][]' \$disabled \$move_check value='remove' ></td>
+ </tr>";
+ $tree->init($categorys);
+ $categorydata = $tree->get_tree(0, $str);
+ $this->assign("categorys", $categorydata);
+ $this->assign("roleid", $roleid);
+ $this->display("categoryrbac");
+ }
+ }
+
+}
Index: Controller/UpgradeController.class.php
===================================================================
--- Controller/UpgradeController.class.php (revision 0)
+++ Controller/UpgradeController.class.php (revision 2)
@@ -0,0 +1,22 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 系统在线升级
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Controller;
+
+use Common\Controller\AdminBase;
+
+class UpgradeController extends AdminBase {
+
+ //升级首页
+ public function index() {
+
+ }
+
+}
Index: Conf/config.php
===================================================================
--- Conf/config.php (revision 0)
+++ Conf/config.php (revision 2)
@@ -0,0 +1,18 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 配置
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+return array(
+ 'URL_MODEL' => 0,
+ 'COMPONENTS' => array(
+ 'Module' => array(
+ 'class' => '\\Libs\\System\\Module',
+ 'path' => 'Libs.System.Module',
+ ),
+ ),
+);
Index: View/Main/index.php
===================================================================
--- View/Main/index.php (revision 0)
+++ View/Main/index.php (revision 2)
@@ -0,0 +1,141 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body>
+<div class="wrap">
+ <div id="home_toptip"></div>
+ <h2 class="h_a">系统信息</h2>
+ <div class="home_info">
+ <ul>
+ <volist name="server_info" id="vo">
+ <li> <em>{$key}</em> <span>{$vo}</span> </li>
+ </volist>
+ </ul>
+ </div>
+ <!-- <h2 class="h_a">开发团队</h2>
+ <div class="home_info" id="home_devteam">
+ <ul>
+ <li> <em>版权所有</em> <span><a href="http://www.shuipfcms.com" target="_blank">http://www.shuipfcms.com/</a></span> </li>
+ <li> <em>负责人</em> <span>水平凡</span> </li>
+ <li> <em>微博</em> <span><a href="http://t.qq.com/shuipf" target="_blank">http://t.qq.com/shuipf</a></span> </li>
+ <li> <em>联系邮箱</em> <span>admin@abc3210.com</span> </li>
+ <li> <em>捐赠</em> <span>您因如果使用ShuipFCMS而受益或者感到愉悦,您还可以这样帮助ShuipFCMS成长~<br/>捐赠:<a href="https://www.alipay.com/" target="_blank">支付宝帐号:gongjingpingde@163.com</a></span> </li>
+ <li> <em><font color="#0000FF">在线使用手册</font></em> <span><a href="http://document.shuipfcms.com/" target="_blank">http://document.shuipfcms.com/</a></span> </li>
+ </ul>
+ </div> -->
+ <h2 class="h_a" style="display:none">问题反馈</h2>
+ <div class="table_full" style="display:none">
+ <form method="post" action="http://www.abc3210.com/index.php?g=Formguide&a=post" id="RegForm" name="RegForm">
+ <table width="100%" class="table_form">
+ <input type="hidden" name="formid" value="4"/>
+ <tr>
+ <th width="80">类型<font color="red">*</font></th>
+ <td><select name='info[type]' id='type' ><option value="1" >意见反馈</option><option value="2" >Bug反馈</option></select></td>
+ </tr>
+ <tr>
+ <th width="80">反馈者<font color="red">*</font></th>
+ <td><input type="text" name="info[name]" class="input" id="name" /></td>
+ </tr>
+ <tr>
+ <th>联系邮箱<font color="red">*</font></th>
+ <td><input type="text" name="info[email]" class="input" id="email" /></td>
+ </tr>
+ <tr>
+ <th>反馈内容<font color="red">*</font></th>
+ <td><textarea id="content" name="info[content]" style="width:600px; height:150px;"></textarea></td>
+ </tr>
+ </table>
+ </div>
+ <div class="" style="display:none">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10" type="submit">提交</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<script src="{$config_siteurl}statics/js/artDialog/artDialog.js"></script>
+<script>
+$("#btn_submit").click(function(){
+ $("#tips_success").fadeTo(500,1);
+});
+artDialog.notice = function (options) {
+ return false;
+ var opt = options || {},
+ api, aConfig, hide, wrap, top,
+ duration = 800;
+
+ var config = {
+ id: 'Notice',
+ left: '100%',
+ top: '100%',
+ fixed: true,
+ drag: false,
+ resize: false,
+ follow: null,
+ lock: false,
+ init: function(here){
+ api = this;
+ aConfig = api.config;
+ wrap = api.DOM.wrap;
+ top = parseInt(wrap[0].style.top);
+ hide = top + wrap[0].offsetHeight;
+
+ wrap.css('top', hide + 'px')
+ .animate({top: top + 'px'}, duration, function () {
+ opt.init && opt.init.call(api, here);
+ });
+ },
+ close: function(here){
+ wrap.animate({top: hide + 'px'}, duration, function () {
+ opt.close && opt.close.call(this, here);
+ aConfig.close = $.noop;
+ api.close();
+ });
+
+ return false;
+ }
+ };
+
+ for (var i in opt) {
+ if (config[i] === undefined) config[i] = opt[i];
+ };
+
+ return artDialog(config);
+};
+$(function(){
+ $.getJSON('{:U("public_server")}',function(data){
+ if(data.state != 'fail'){
+ return false;
+ }
+ if(data.latestversion.status){
+ art.dialog({
+ title:'升级提示',
+ icon: 'warning',
+ content: '系统检测到新版本发布,请尽快更新到 '+data.latestversion.version + ',以确保网站安全!',
+ cancelVal: '关闭',
+ cancel: true
+ });
+ }
+ if(data.license.authorize){
+ $('#server_license').html(data.license.name);
+ }else{
+ $('#server_license').html('非授权用户');
+ }
+ $('#server_version').html(data.latestversion.version.version);
+ $('#server_build').html(data.latestversion.version.build);
+
+ if(data.notice.id > 0){
+ art.dialog.notice({
+ title: data.title,
+ width: 400,// 必须指定一个像素宽度值或者百分比,否则浏览器窗口改变可能导致artDialog收缩
+ content: data.notice.content,
+ close:function(){
+ setCookie('notice_'+data.notice.id,1,30);
+ }
+ });
+ }
+ });
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Module/install.php
===================================================================
--- View/Module/install.php (revision 0)
+++ View/Module/install.php (revision 2)
@@ -0,0 +1,58 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">模块信息</div>
+ <form class="J_ajaxForm" action="{:U('Module/install')}" method="post">
+ <div class="table_full">
+ <table width="100%" class="table_form">
+ <tr>
+ <th width="150">模块名称:</th>
+ <td >{$config.modulename}</td>
+ </tr>
+ <tr>
+ <th>模块版本:</th>
+ <td >{$config.version}</td>
+ </tr>
+ <tr>
+ <th>ShuipFCMS最低版本:</th>
+ <td ><if condition=" $config['adaptation'] ">{$config.adaptation}<else /><font color="#FF0000">没有标注,存在风险</font></if>
+ <if condition=" $version == false && isset($version) "><br/><font color="#FF0000">该模板最低只支持ShuipFCMS {$config.adaptation} 版本,请升级后再安装,避免不必要是损失!</font></if>
+ </td>
+ </tr>
+ <if condition=" !empty($config['depend']) ">
+ <tr>
+ <th>依赖模块:</th>
+ <td ><?php echo implode('|',$config['depend']) ?></td>
+ </tr>
+ </if>
+ <tr>
+ <th>模块简介:</th>
+ <td >{$config.introduce}</td>
+ </tr>
+ <tr>
+ <th >作者:</th>
+ <td >{$config.author}</td>
+ </tr>
+ <tr>
+ <th>E-mail:</th>
+ <td >{$config.authoremail}</td>
+ </tr>
+ <tr>
+ <th>作者主页:</th>
+ <td >{$config.authorsite}</td>
+ </tr>
+ </table>
+ </div>
+ <div class="">
+ <div class="btn_wrap_pd">
+ <input type="hidden" name="module" value="{$config.module}">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">确定安装</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Module/index.php
===================================================================
--- View/Module/index.php (revision 0)
+++ View/Module/index.php (revision 2)
@@ -0,0 +1,113 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body>
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">说明</div>
+ <div class="prompt_text">
+ <ul>
+ <li>模块管理可以很好的扩展网站运营中所需功能!</li>
+ <li><font color="#FF0000">获取更多模块请到官方网站模块扩展中下载安装!安装非官方发表模块需谨慎,有被清空数据库的危险!</font></li>
+ <li>官网地址:<font color="#FF0000">http://www.shuipfcms.com</font>,<a href="http://www.shuipfcms.com" target="_blank">立即前往</a>!</li>
+ </ul>
+ </div>
+ <div class="table_list">
+ <table width="100%">
+ <colgroup>
+ <col width="90">
+ <col>
+ <col width="160">
+ </colgroup>
+ <thead>
+ <tr>
+ <td align="center">应用图标</td>
+ <td>应用介绍</td>
+ <td align="center">安装时间</td>
+ <td align="center">操作</td>
+ </tr>
+ </thead>
+ <volist name="data" id="vo">
+ <tr>
+ <td>
+ <div class="app_icon">
+ <if condition=" $vo['icon'] ">
+ <img src="{$vo.icon}" alt="{$vo.modulename}" width="80" height="80">
+ <else/>
+ <img src="{$config_siteurl}statics/images/modul.png" alt="{$vo.modulename}" width="80" height="80">
+ </if>
+ </div>
+ </td>
+ <td valign="top">
+ <h3 class="mb5 f12"><if condition=" $vo['address'] "><a target="_blank" href="{$vo.address}">{$vo.modulename}</a><else />{$vo.modulename}</if></h3>
+ <div class="mb5"> <span class="mr15">版本:<b>{$vo.version}</b></span> <span>开发者:<if condition=" $vo['author'] "><a target="_blank" href="{$vo.authorsite}">{$vo.author}</a><else />匿名开发者</if></span> <span>适配 ShuipFCMS 最低版本:<if condition=" $vo['adaptation'] ">{$vo.adaptation}<else /><font color="#FF0000">没有标注,可能存在兼容风险</font></if></span> </div>
+ <div class="gray"><if condition=" $vo['introduce'] ">{$vo.introduce}<else />没有任何介绍</if></div>
+ <div> <span class="mr20"><a href="{$vo.authorsite}" target="_blank">{$vo.authorsite}</a></span> </div>
+ </td>
+ <td align="center"><if condition=" $vo['installtime'] "><span>{$vo.installtime|date='Y-m-d H:i:s',###}</span><else/>/</if></td>
+ <td align="center">
+ <?php
+ $op = array();
+ if(empty($vo['installtime'])){
+ $op[] = '<a href="'.U('install',array('module'=>$vo['module'])).'" class="btn btn_submit mr5">安装</a>';
+ }else{
+ if($vo['iscore'] == 0){
+ $op[] = '<a href="'.U('uninstall',array('module'=>$vo['module'])).'" class="J_ajax_upgrade btn">卸载</a>';
+ }
+ if($vo['disabled']){
+ if($vo['iscore'] == 0){
+ $op[] = '<a href="'.U('disabled',array('module'=>$vo['module'])).'" class="btn mr5">禁用</a>';
+ }
+ }else{
+ $op[] = '<a href="'.U('disabled',array('module'=>$vo['module'])).'" class="btn btn_submit mr5">启用</a>';
+ }
+ }
+ echo implode(' ',$op);
+ ?>
+ </td>
+ </tr>
+ </volist>
+ </table>
+ </div>
+ <div class="p10">
+ <div class="pages">{$Page}</div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<script>
+if ($('a.J_ajax_upgrade').length) {
+ Wind.use('artDialog', function () {
+ $('.J_ajax_upgrade').on('click', function (e) {
+ e.preventDefault();
+ var $_this = this,$this = $(this), url = this.href, msg = $this.data('msg'), act = $this.data('act');
+ art.dialog({
+ title: false,
+ icon: 'question',
+ content: '确定要卸载吗?',
+ follow: $_this,
+ close: function () {
+ $_this.focus();; //关闭时让触发弹窗的元素获取焦点
+ return true;
+ },
+ ok: function () {
+ $.getJSON(url).done(function (data) {
+ if (data.state === 'success') {
+ if (data.referer) {
+ location.href = data.referer;
+ } else {
+ reloadPage(window);
+ }
+ } else if (data.state === 'fail') {
+ art.dialog.alert(data.info);
+ }
+ });
+ },
+ cancelVal: '关闭',
+ cancel: true
+ });
+ });
+
+ });
+}
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Common/Head.php
===================================================================
--- View/Common/Head.php (revision 0)
+++ View/Common/Head.php (revision 2)
@@ -0,0 +1,9 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<!doctype html>
+<html>
+<head>
+<meta charset="UTF-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+<title>系统后台 - {$Config.sitename}</title>
+<Admintemplate file="Admin/Common/Cssjs"/>
+</head>
\ No newline at end of file
Index: View/Common/Nav.php
===================================================================
--- View/Common/Nav.php (revision 0)
+++ View/Common/Nav.php (revision 2)
@@ -0,0 +1,24 @@
+<?php
+$getMenu = isset($Custom)?$Custom:D('Admin/Menu')->getMenu();
+if($getMenu) {
+?>
+<div class="nav">
+ <?php
+ if(!empty($menuReturn)){
+ echo '<div class="return"><a href="'.$menuReturn['url'].'">'.$menuReturn['name'].'</a></div>';
+ }
+ ?>
+ <ul class="cc">
+ <?php
+ foreach($getMenu as $r){
+ $app = $r['app'];
+ $controller = $r['controller'];
+ $action = $r['action'];
+ ?>
+ <li <?php echo $action==ACTION_NAME ?'class="current"':""; ?>><a href="<?php echo U("".$app."/".$controller."/".$action."",$r['parameter']);?>"><?php echo $r['name'];?></a></li>
+ <?php
+ }
+ ?>
+ </ul>
+</div>
+<?php } ?>
\ No newline at end of file
Index: View/Common/Cssjs.php
===================================================================
--- View/Common/Cssjs.php (revision 0)
+++ View/Common/Cssjs.php (revision 2)
@@ -0,0 +1,3 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?><link href="{$config_siteurl}statics/css/admin_style.css" rel="stylesheet" />
+<link href="{$config_siteurl}statics/js/artDialog/skins/default.css" rel="stylesheet" />
+<Admintemplate file="Admin/Common/Js"/>
\ No newline at end of file
Index: View/Common/Js.php
===================================================================
--- View/Common/Js.php (revision 0)
+++ View/Common/Js.php (revision 2)
@@ -0,0 +1,10 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<script type="text/javascript">
+//全局变量
+var GV = {
+ DIMAUB: "{$config_siteurl}",
+ JS_ROOT: "{$config_siteurl}statics/js/"
+};
+</script>
+<script src="{$config_siteurl}statics/js/wind.js"></script>
+<script src="{$config_siteurl}statics/js/jquery.js"></script>
\ No newline at end of file
Index: View/Common/Exception.php
===================================================================
--- View/Common/Exception.php (revision 0)
+++ View/Common/Exception.php (revision 2)
@@ -0,0 +1,62 @@
+<?php
+if (C('LAYOUT_ON')) {
+ echo '{__NOLAYOUT__}';
+}
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <title>系统发生错误</title>
+ <style type="text/css">
+ *{ padding: 0; margin: 0; }
+ html{ overflow-y: scroll; }
+ body{ background: #fff; font-family: '微软雅黑'; color: #333; font-size: 16px; }
+ img{ border: 0; }
+ .error{ padding: 24px 48px; }
+ .face{ font-size: 100px; font-weight: normal; line-height: 120px; margin-bottom: 12px; }
+ h1{ font-size: 32px; line-height: 48px; }
+ .error .content{ padding-top: 10px}
+ .error .info{ margin-bottom: 12px; }
+ .error .info .title{ margin-bottom: 3px; }
+ .error .info .title h3{ color: #000; font-weight: 700; font-size: 16px; }
+ .error .info .text{ line-height: 24px; }
+ .copyright{ padding: 12px 48px; color: #999; }
+ .copyright a{ color: #000; text-decoration: none; }
+ </style>
+ </head>
+ <body>
+ <div class="error">
+ <p class="face">:(</p>
+ <h1><?php echo strip_tags($e['message']); ?></h1>
+ <div class="content">
+ <?php if (isset($e['file'])) { ?>
+ <div class="info">
+ <div class="title">
+ <h3>错误位置</h3>
+ </div>
+ <div class="text">
+ <p>FILE: <?php echo $e['file']; ?>  LINE: <?php echo $e['line']; ?></p>
+ </div>
+ </div>
+ <?php } ?>
+ <?php if (isset($e['trace'])) { ?>
+ <div class="info">
+ <div class="title">
+ <h3>TRACE</h3>
+ </div>
+ <div class="text">
+ <p><?php echo nl2br($e['trace']); ?></p>
+ </div>
+ </div>
+ <?php } ?>
+ </div>
+ </div>
+ <div class="copyright">
+ <p>
+ <a title="官方网站" href="http://www.shuipfcms.com" target="_blank">ShuipFCMS</a>
+ <sup><?php echo SHUIPF_VERSION ?> - <?php echo SHUIPF_BUILD ?></sup>
+ 官方交流群:<a href="http://wp.qq.com/wpa/qunwpa?idkey=7a6237a52fb5861c4b6e0c12255b78eef46ba7378ace9423f9ad292fd66e4ef7" title="QQ群" target="_blank">49219815</a>
+ </p>
+ </div>
+ </body>
+</html>
\ No newline at end of file
Index: View/Common/Trace.php
===================================================================
--- View/Common/Trace.php (revision 0)
+++ View/Common/Trace.php (revision 2)
@@ -0,0 +1,67 @@
+<div id="think_page_trace" style="position: fixed;bottom:0;right:0;font-size:14px;width:100%;z-index: 999999;color: #000;text-align:left;font-family:'微软雅黑';">
+ <div id="think_page_trace_tab" style="display: none;background:white;margin:0;height: 250px;">
+ <div id="think_page_trace_tab_tit" style="height:30px;padding: 6px 12px 0;border-bottom:1px solid #ececec;border-top:1px solid #ececec;font-size:16px">
+ <?php foreach ($trace as $key => $value) { ?>
+ <span style="color:#000;padding-right:12px;height:30px;line-height: 30px;display:inline-block;margin-right:3px;cursor: pointer;font-weight:700"><?php echo $key ?></span>
+ <?php } ?>
+ </div>
+ <div id="think_page_trace_tab_cont" style="overflow:auto;height:212px;padding: 0; line-height: 24px">
+ <?php foreach ($trace as $info) { ?>
+ <div style="display:none;">
+ <ol style="padding: 0; margin:0">
+ <?php
+ if (is_array($info)) {
+ foreach ($info as $k => $val) {
+ echo '<li style="border-bottom:1px solid #EEE;font-size:14px;padding:0 12px">' . (is_numeric($k) ? '' : $k . ' : ') . htmlentities($val, ENT_COMPAT, 'utf-8') . '</li>';
+ }
+ }
+ ?>
+ </ol>
+ </div>
+ <?php } ?>
+ </div>
+ </div>
+ <div id="think_page_trace_close" style="display:none;text-align:right;height:15px;position:absolute;top:10px;right:12px;cursor: pointer;"><img style="vertical-align:top;" src="data:image/gif;base64,R0lGODlhDwAPAJEAAAAAAAMDA////wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MUQxMjc1MUJCQUJDMTFFMTk0OUVGRjc3QzU4RURFNkEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MUQxMjc1MUNCQUJDMTFFMTk0OUVGRjc3QzU4RURFNkEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxRDEyNzUxOUJBQkMxMUUxOTQ5RUZGNzdDNThFREU2QSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxRDEyNzUxQUJBQkMxMUUxOTQ5RUZGNzdDNThFREU2QSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAAAAAAALAAAAAAPAA8AAAIdjI6JZqotoJPR1fnsgRR3C2jZl3Ai9aWZZooV+RQAOw==" /></div>
+</div>
+<div id="think_page_trace_open" style="height:30px;float:right;text-align: right;overflow:hidden;position:fixed;bottom:0;right:0;color:#000;line-height:30px;cursor:pointer;"><div style="background:#232323;color:#FFF;padding:0 6px;float:right;line-height:30px;font-size:14px"><?php echo G('beginTime', 'viewEndTime') . 's '; ?></div><img width="30" style="" title="ShowPageTrace" src="data:image/png;base64,<?php echo \Common\Controller\ShuipFCMS::logo() ?>"></div>
+<script type="text/javascript">
+ (function() {
+ var tab_tit = document.getElementById('think_page_trace_tab_tit').getElementsByTagName('span');
+ var tab_cont = document.getElementById('think_page_trace_tab_cont').getElementsByTagName('div');
+ var open = document.getElementById('think_page_trace_open');
+ var close = document.getElementById('think_page_trace_close').childNodes[0];
+ var trace = document.getElementById('think_page_trace_tab');
+ var cookie = document.cookie.match(/thinkphp_show_page_trace=(\d\|\d)/);
+ var history = (cookie && typeof cookie[1] != 'undefined' && cookie[1].split('|')) || [0, 0];
+ open.onclick = function() {
+ trace.style.display = 'block';
+ this.style.display = 'none';
+ close.parentNode.style.display = 'block';
+ history[0] = 1;
+ document.cookie = 'thinkphp_show_page_trace=' + history.join('|')
+ }
+ close.onclick = function() {
+ trace.style.display = 'none';
+ this.parentNode.style.display = 'none';
+ open.style.display = 'block';
+ history[0] = 0;
+ document.cookie = 'thinkphp_show_page_trace=' + history.join('|')
+ }
+ for (var i = 0; i < tab_tit.length; i++) {
+ tab_tit[i].onclick = (function(i) {
+ return function() {
+ for (var j = 0; j < tab_cont.length; j++) {
+ tab_cont[j].style.display = 'none';
+ tab_tit[j].style.color = '#999';
+ }
+ tab_cont[i].style.display = 'block';
+ tab_tit[i].style.color = '#000';
+ history[1] = i;
+ document.cookie = 'thinkphp_show_page_trace=' + history.join('|')
+ }
+ })(i)
+ }
+ parseInt(history[0]) && open.click();
+ (tab_tit[history[1]] || tab_tit[0]).click();
+ })();
+</script>
Index: View/success.php
===================================================================
--- View/success.php (revision 0)
+++ View/success.php (revision 2)
@@ -0,0 +1,29 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<!doctype html>
+<html>
+<head>
+<meta charset="UTF-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+<title>{$Config.sitename} - 提示信息</title>
+<Admintemplate file="Admin/Common/Cssjs"/>
+</head>
+<body>
+<div class="wrap">
+ <div id="error_tips">
+ <h2>{$msgTitle}</h2>
+ <div class="error_cont">
+ <ul>
+ <li>{$message}</li>
+ </ul>
+ <div class="error_return"><a href="{$jumpUrl}" class="btn">返回</a></div>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+<script language="javascript">
+setTimeout(function(){
+ location.href = '{$jumpUrl}';
+},{$waitSecond});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Behavior/logs.php
===================================================================
--- View/Behavior/logs.php (revision 0)
+++ View/Behavior/logs.php (revision 2)
@@ -0,0 +1,54 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">搜索</div>
+ <form method="post" action="{:U('logs')}">
+ <div class="search_type cc mb10">
+ <div class="mb10"> <span class="mr20"> 搜索类型:
+ <select class="select_2" name="type" style="width:70px;">
+ <option value="ruleid" <if condition="$type eq 'ruleid'">selected</if>>行为ID</option>
+ <option value="guid" <if condition="$type eq 'guid'">selected</if>>标识</option>
+ </select>
+ 关键字:
+ <input type="text" class="input length_5" name="keyword" size='10' value="{$keyword}" placeholder="关键字">
+ <button class="btn">搜索</button>
+ <?php
+ if(D('Admin/Access')->isCompetence('deletelog')){
+ ?>
+ <input type="button" class="btn" name="del_log_4" value="删除一月前数据" onClick="location='{:U("Logs/deletelog")}'" />
+ <?php
+ }
+ ?>
+ </span> </div>
+ </div>
+ <div class="table_list">
+ <table width="100%" cellspacing="0">
+ <thead>
+ <tr>
+ <td align="center" width="30">ID</td>
+ <td align="center" width="50" >行为ID</td>
+ <td align="center">标识</td>
+ <td align="center" width="150">时间</td>
+ </tr>
+ </thead>
+ <tbody>
+ <volist name="data" id="vo">
+ <tr>
+ <td align="center">{$vo.id}</td>
+ <td align="center">{$vo.ruleid}</td>
+ <td align="">{$vo.guid}</td>
+ <td align="center">{$vo.create_time|date="Y-m-d H:i:s",###}</td>
+ </tr>
+ </volist>
+ </tbody>
+ </table>
+ <div class="p10">
+ <div class="pages"> {$Page} </div>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Behavior/edit.php
===================================================================
--- View/Behavior/edit.php (revision 0)
+++ View/Behavior/edit.php (revision 2)
@@ -0,0 +1,119 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">行为规则使用说明</div>
+ <div class="prompt_text">
+ <p><b>规则定义格式1:</b> </p>
+ <ul style="color:#00F">
+ <li>格式: table:$table|field:$field|condition:$condition|rule:$rule[|cycle:$cycle|max:$max]</li>
+ </ul>
+ <p><b>规则字段解释:</b></p>
+ <ul>
+ <li>table->要操作的数据表,不需要加表前缀</li>
+ <li>field->要操作的字段</li>
+ <li>condition-><literal>操作的条件,目前支持字符串。条件中引用行为参数,使用{$parameter}的形式(该形式只对行为标签参数是为数组的有效,纯碎的参数使用{$self})!</literal></li>
+ <li>rule->对字段进行的具体操作,目前支持加、减 </li>
+ <li>cycle->执行周期,单位(小时),表示$cycle小时内最多执行$max次 </li>
+ <li>max->单个周期内的最大执行次数($cycle和$max必须同时定义,否则无效)</li>
+ </ul>
+ <p><b>规则定义格式2:</b> </p>
+ <ul style="color:#00F">
+ <li>格式: phpfile:$phpfile[|module:$module]</li>
+ </ul>
+ <p><b>规则字段解释:</b></p>
+ <ul>
+ <li>phpfile->直接调用已经定义好的行为文件。</li>
+ <li>module->行为所属模块,没有该参数时,自动定位到 shuipf\Common\Behavior 目录。</li>
+ </ul>
+ <p><b>规则定义格式3:</b> </p>
+ <ul style="color:#00F">
+ <li>格式: sql:$sql[|cycle:$cycle|max:$max]</li>
+ </ul>
+ <p><b>规则字段解释:</b></p>
+ <ul>
+ <li>sql-><literal>需要执行的SQL语句,表前缀可以使用“shuipfcms_”代替。参数可以使用 {$parameter}的形式(该形式只对行为标签参数是为数组的有效,纯碎的参数使用{$self})!</literal></li>
+ <li>cycle->执行周期,单位(小时),表示$cycle小时内最多执行$max次 </li>
+ <li>max->单个周期内的最大执行次数($cycle和$max必须同时定义,否则无效)</li>
+ </ul>
+ </div>
+ <form class="J_ajaxForm" action="{:U('Behavior/edit')}" method="post">
+ <div class="h_a">基本属性</div>
+ <div class="table_full">
+ <table width="100%" class="table_form contentWrap">
+ <tbody>
+ <tr>
+ <th width="80">行为标识</th>
+ <td><input type="test" name="name" class="input" id="name" value="{$info.name}">
+ <span class="gray">输入行为标识 英文字母</span></td>
+ </tr>
+ <tr>
+ <th>行为名称</th>
+ <td><input type="test" name="title" class="input" id="title" value="{$info.title}">
+ <span class="gray">输入行为名称</span></td>
+ </tr>
+ <tr>
+ <th>行为类型</th>
+ <td><select name="type">
+ <option value="1" <if condition="$info['type'] eq 1 ">selected</if>>控制器</option>
+ <option value="2" <if condition="$info['type'] eq 2 ">selected</if>>视图</option>
+ </select>
+ <span class="gray">控制器表示是在程序逻辑中的,视图,表示是在模板渲染过程中的!</span></td>
+ </tr>
+ <tr>
+ <th>行为描述</th>
+ <td><textarea name="remark" rows="2" cols="20" id="remark" class="inputtext" style="height:100px;width:500px;">{$info.remark}</textarea></td>
+ </tr>
+ <tr>
+ <th>行为规则</th>
+ <td><div class="cross" style="width:100%;">
+ <ul id="J_ul_list_addItem" class="J_ul_list_public" style="margin-left:0px;">
+ <li><span style="width:40px;">规则ID</span><span style="width:40px;">排序</span><span>规则</span></li>
+ <volist name="info.ruleList" id="vo">
+ <li><span style="width:40px;">{$vo.ruleid}</span><span style="width:40px;"><input type="test" name="listorder[{$vo.ruleid}]" class="input" value="{$vo.listorder}" style="width:35px;"></span><span style="width:500px;"><input type="test" name="rule[{$vo.ruleid}]" class="input" value="{$vo.rule}" style="width:450px;"><if condition=" $vo['system'] eq 0 "> <a href="" class="J_ul_list_remove">删除</a></if></span></li>
+ </volist>
+ </ul>
+ </div>
+ <a href="" class="link_add Js_ul_list_add" data-related="addItem">添加规则</a></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <input type="hidden" name="id" value="{$info.id}"/>
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">修改</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+<script type="text/javascript">
+var Js_ul_list_add = $('a.Js_ul_list_add');
+var new_key = 0;
+if (Js_ul_list_add.length) {
+ //添加
+ Js_ul_list_add.click(function (e) {
+ e.preventDefault();
+ new_key++;
+ var $this = $(this);
+ //添加分类
+ var _li_html = '<li>\
+ <span style="width:40px;"></span><span style="width:40px;"><input type="test" name="newlistorder[' + new_key + ']" class="input" value="" style="width:35px;"></span><span style="width:500px;"><input type="test" name="newrule[' + new_key + ']" class="input" value="" style="width:450px;"></span>\
+ </li>';
+ //"new_"字符加上唯一的key值,_li_html 由列具体页面定义
+ var $li_html = $(_li_html.replace(/new_/g, 'new_' + new_key));
+ $('#J_ul_list_' + $this.data('related')).append($li_html);
+ $li_html.find('input.input').first().focus();
+ });
+
+ //删除
+ $('ul.J_ul_list_public').on('click', 'a.J_ul_list_remove', function (e) {
+ e.preventDefault();
+ $(this).parents('li').remove();
+ });
+}
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Behavior/index.php
===================================================================
--- View/Behavior/index.php (revision 0)
+++ View/Behavior/index.php (revision 2)
@@ -0,0 +1,71 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">功能说明</div>
+ <div class="prompt_text">
+ <ul>
+ <li><font color="#FF0000">行为是系统中非常重要的一项功能,如果行为设置错误会导致系统崩溃或者不稳定的情况。</font></li>
+ <li>行为标签都是程序开发中,内置在程序业务逻辑流程中!</li>
+ <li>行为的增加,会<font color="#FF0000">严重影响</font>程序性能,请合理使用!</li>
+ </ul>
+ <p><b>行为来源:</b></p>
+ <p> <font color="#FF0000">行为都是在程序开发中,在程序逻辑处理中添加的一个行为定义,由站长/开发人员自行扩展。此处的行为管理,并不能添加没有在程序中定义的行为标签!了解有那些行为定义,请进入官网查看!</font></p>
+ </div>
+ <div class="h_a">搜索</div>
+ <div class="search_type mb10">
+ <form action="{$config_siteurl}index.php" method="get">
+ <input type="hidden" value="Admin" name="g">
+ <input type="hidden" value="Behavior" name="m">
+ <input type="hidden" value="index" name="a">
+ <div class="mb10">
+ <div class="mb10"> <span class="mr20"> 行为标识:
+ <input type="text" class="input length_2" name="keyword" style="width:200px;" value="{$keyword}" placeholder="请输入标识关键字...">
+ <button class="btn">搜索</button>
+ </span> </div>
+ </div>
+ </form>
+ </div>
+ <div class="table_list">
+ <table width="100%">
+ <colgroup>
+ <col width="50">
+ <col width="200">
+ <col width="200">
+ <col>
+ <col width="60">
+ <col width="60">
+ <col width="120">
+ </colgroup>
+ <thead>
+ <tr>
+ <td align="center">编号</td>
+ <td>行为标识</td>
+ <td>行为名称</td>
+ <td align="center">规则说明</td>
+ <td align="center">类型</td>
+ <td align="center">状态</td>
+ <td align="center">操作</td>
+ </tr>
+ </thead>
+ <volist name="data" id="vo">
+ <tr>
+ <td align="center">{$vo.id}</td>
+ <td>{$vo.name}</td>
+ <td>{$vo.title}</td>
+ <td>{$vo.remark}</td>
+ <td align="center"><if condition="$vo['type'] eq 1">控制器<elseif condition="$vo['type'] eq 2"/>视图</if></td>
+ <td align="center"><if condition="$vo['status']">正常<else /><font color="#FF0000">禁用</font></if></td>
+ <td align="center"><a href="{:U('Behavior/edit',array('id'=>$vo['id']))}">编辑</a> | <if condition="$vo['status']"><a href="{:U('Behavior/status',array('id'=>$vo['id']))}">禁用</a><else /><font color="#FF0000"><a href="{:U('Behavior/status',array('id'=>$vo['id']))}">启用</a></font></if> | <a href="{:U('Behavior/delete',array('id'=>$vo['id']))}" class="J_ajax_del">删除</a></td>
+ </tr>
+ </volist>
+ </table>
+ <div class="p10">
+ <div class="pages"> {$Page} </div>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Behavior/add.php
===================================================================
--- View/Behavior/add.php (revision 0)
+++ View/Behavior/add.php (revision 2)
@@ -0,0 +1,117 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">行为规则使用说明</div>
+ <div class="prompt_text">
+ <p><b>规则定义格式1:</b> </p>
+ <ul style="color:#00F">
+ <li>格式: table:$table|field:$field|condition:$condition|rule:$rule[|cycle:$cycle|max:$max]</li>
+ </ul>
+ <p><b>规则字段解释:</b></p>
+ <ul>
+ <li>table->要操作的数据表,不需要加表前缀</li>
+ <li>field->要操作的字段</li>
+ <li>condition-><literal>操作的条件,目前支持字符串。条件中引用行为参数,使用{$parameter}的形式(该形式只对行为标签参数是为数组的有效,纯碎的参数使用{$self})!</literal></li>
+ <li>rule->对字段进行的具体操作,目前支持加、减 </li>
+ <li>cycle->执行周期,单位(小时),表示$cycle小时内最多执行$max次 </li>
+ <li>max->单个周期内的最大执行次数($cycle和$max必须同时定义,否则无效)</li>
+ </ul>
+ <p><b>规则定义格式2:</b> </p>
+ <ul style="color:#00F">
+ <li>格式: phpfile:$phpfile[|module:$module]</li>
+ </ul>
+ <p><b>规则字段解释:</b></p>
+ <ul>
+ <li>phpfile->直接调用已经定义好的行为文件。</li>
+ <li>module->行为所属模块,没有该参数时,自动定位到 shuipf\Common\Behavior 目录。</li>
+ </ul>
+ <p><b>规则定义格式3:</b> </p>
+ <ul style="color:#00F">
+ <li>格式: sql:$sql[|cycle:$cycle|max:$max]</li>
+ </ul>
+ <p><b>规则字段解释:</b></p>
+ <ul>
+ <li>sql-><literal>需要执行的SQL语句,表前缀可以使用“shuipfcms_”代替。参数可以使用 {$parameter}的形式(该形式只对行为标签参数是为数组的有效,纯碎的参数使用{$self})!</literal></li>
+ <li>cycle->执行周期,单位(小时),表示$cycle小时内最多执行$max次 </li>
+ <li>max->单个周期内的最大执行次数($cycle和$max必须同时定义,否则无效)</li>
+ </ul>
+ </div>
+ <form class="J_ajaxForm" action="{:U('Behavior/add')}" method="post">
+ <div class="h_a">基本属性</div>
+ <div class="table_full">
+ <table width="100%" class="table_form contentWrap">
+ <tbody>
+ <tr>
+ <th width="80">行为标识</th>
+ <td><input type="test" name="name" class="input" id="name">
+ <span class="gray">输入行为标识 英文字母</span></td>
+ </tr>
+ <tr>
+ <th>行为名称</th>
+ <td><input type="test" name="title" class="input" id="title">
+ <span class="gray">输入行为名称</span></td>
+ </tr>
+ <tr>
+ <th>行为类型</th>
+ <td><select name="type">
+ <option value="1" selected>控制器</option>
+ <option value="2" >视图</option>
+ </select>
+ <span class="gray">控制器表示是在程序逻辑中的,视图,表示是在模板渲染过程中的!</span></td>
+ </tr>
+ <tr>
+ <th>行为描述</th>
+ <td><textarea name="remark" rows="2" cols="20" id="remark" class="inputtext" style="height:100px;width:500px;"></textarea></td>
+ </tr>
+ <tr>
+ <th>行为规则</th>
+ <td><div class="cross" style="width:100%;">
+ <ul id="J_ul_list_addItem" class="J_ul_list_public" style="margin-left:0px;">
+ <li><span style="width:40px;">排序</span><span>规则</span></li>
+ <li><span style="width:40px;"><input type="test" name="listorder[0]" class="input" value="" style="width:35px;"></span><span style="width:500px;"><input type="test" name="rule[0]" class="input" value="" style="width:450px;"></span></li>
+ </ul>
+ </div>
+ <a href="" class="link_add Js_ul_list_add" data-related="addItem">添加规则</a></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">添加</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+<script type="text/javascript">
+var Js_ul_list_add = $('a.Js_ul_list_add');
+var new_key = 0;
+if (Js_ul_list_add.length) {
+ //添加
+ Js_ul_list_add.click(function (e) {
+ e.preventDefault();
+ new_key++;
+ var $this = $(this);
+ //添加分类
+ var _li_html = '<li>\
+ <span style="width:40px;"><input type="test" name="listorder[' + new_key + ']" class="input" value="" style="width:35px;"></span>\
+ <span style="width:500px;"><input type="test" name="rule[' + new_key + ']" class="input" value="" style="width:450px;"></span>\
+ </li>';
+ //"new_"字符加上唯一的key值,_li_html 由列具体页面定义
+ var $li_html = $(_li_html.replace(/new_/g, 'new_' + new_key));
+ $('#J_ul_list_' + $this.data('related')).append($li_html);
+ $li_html.find('input.input').first().focus();
+ });
+
+ //删除
+ $('ul.J_ul_list_public').on('click', 'a.J_ul_list_remove', function (e) {
+ e.preventDefault();
+ $(this).parents('li').remove();
+ });
+}
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Adminmanage/chanpass.php
===================================================================
--- View/Adminmanage/chanpass.php (revision 0)
+++ View/Adminmanage/chanpass.php (revision 2)
@@ -0,0 +1,97 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap jj">
+ <div class="nav">
+ <ul class="cc">
+ <li class="current"><a href="{:U('Adminmanage/chanpass')}">修改密码</a></li>
+ </ul>
+ </div>
+ <!--====================用户编辑开始====================-->
+ <form class="J_ajaxForm" action="{:U('Admin/Adminmanage/chanpass')}" method="post">
+ <div class="h_a">用户信息</div>
+ <div class="table_full">
+ <table width="100%">
+ <col class="th" />
+ <col/>
+ <thead>
+ <tr>
+ <th>用户名</th>
+ <td> {$userInfo.username}</td>
+ </tr>
+ </thead>
+ <tr>
+ <th>旧密码</th>
+ <td><input name="password" type="password" class="input length_5 required" value=""><span id="J_reg_tip_password" role="tooltip"></span></td>
+ </tr>
+ <tr>
+ <th>新密码</th>
+ <td><input name="new_password" type="password" class="input length_5 required" value="">
+ <span id="J_reg_tip_new_password" role="tooltip"></span></td>
+ </tr>
+ <tr>
+ <th>重复新密码</th>
+ <td><input name="new_pwdconfirm" type="password" class="input length_5 required" value=""><span id="J_reg_tip_new_pwdconfirm" role="tooltip"></span></td>
+ </tr>
+ </table>
+ </div>
+ <div class="">
+ <div class="btn_wrap_pd">
+ <button type="submit" class="btn btn_submit chanpass_ajax_submit_btn">提交</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+<script type="text/jscript">
+$(function () {
+ Wind.use('ajaxForm', function () {
+ $('input[name=password]').on("focusout",function(e){
+ var passwords = $('input[name=password]').fieldValue();
+ $.get("{:U('Admin/Adminmanage/public_verifypass')}", { password: ""+passwords+"" } ,function(data){
+ if(data.state == "fail"){
+ $( '#J_reg_tip_password' ).html(' <span for="dbname" generated="true" class="tips_error" style="">旧密码不正确!</span>');
+ }else{
+ $( '#J_reg_tip_password' ).html('');
+ }
+ },"json");
+ });
+ $("button.chanpass_ajax_submit_btn").on("click", function (e) {
+ //删除它的默认事件,提交
+ e.preventDefault();
+ var btn = $(this),
+ form = btn.parents('form.J_ajaxForm');
+ //Ajax提交
+ form.ajaxSubmit({
+ //按钮上是否自定义提交地址(多按钮情况)
+ url: btn.data('action') ? btn.data('action') : form.attr('action'),
+ dataType: "json",
+ eforeSubmit: function (arr, $form, options) {
+ var text = btn.text();
+ //按钮文案、状态修改
+ btn.text(text + '中...').prop('disabled', true).addClass('disabled');
+ },
+ success: function (data, statusText, xhr, $form) {
+ var text = btn.text();
+ //按钮文案、状态修改
+ btn.removeClass('disabled').text(text.replace('中...', '')).parent().find('span').remove();
+ if( data.state === 'success' ) {
+ $( '<span class="tips_success">' + data.info + '</span>' ).appendTo(btn.parent()).fadeIn('slow').delay( 1000 ).fadeOut(function(){
+ if(data.referer){
+ window.location.href = data.referer;
+ }else{
+ reloadPage(window);
+ }
+ });
+ }else if( data.state === 'fail' ) {
+ $( '<span class="tips_error">' + data.info + '</span>' ).appendTo(btn.parent()).fadeIn( 'fast' );
+ btn.removeProp('disabled').removeClass('disabled');
+ }
+ }
+ });
+ });
+ });
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Adminmanage/myinfo.php
===================================================================
--- View/Adminmanage/myinfo.php (revision 0)
+++ View/Adminmanage/myinfo.php (revision 2)
@@ -0,0 +1,84 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap jj">
+ <div class="nav">
+ <ul class="cc">
+ <li class="current"><a href="{:U('Adminmanage/myinfo')}">修改个人信息</a></li>
+ </ul>
+ </div>
+ <!--====================用户编辑开始====================-->
+ <form class="J_ajaxForm" id="J_bymobile_form" action="{:U("Adminmanage/myinfo")}" method="post">
+ <input type="hidden" value="{$data.id}" name="id"/>
+ <input type="hidden" value="{$data.username}" name="username"/>
+ <div class="h_a">用户信息</div>
+ <div class="table_full">
+ <table width="100%">
+ <col class="th" />
+ <col/>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <td>{$data.id}</td>
+ </tr>
+ </thead>
+ <tr>
+ <th>用户名</th>
+ <td>{$data.username}</td>
+ </tr>
+ <tr>
+ <th>姓名</th>
+ <td><input name="nickname" type="text" class="input length_5 required" value="{$data.nickname}">
+ <span id="J_reg_tip_nickname" role="tooltip"></span></td>
+ </tr>
+ <tr>
+ <th>E-mail</th>
+ <td><input name="email" type="text" class="input length_5" value="{$data.email}"></td>
+ </tr>
+ <tr>
+ <th>备注</th>
+ <td><textarea id="J_textarea" name="remark" style="width:400px;height:100px;">{$data.remark}</textarea></td>
+ </tr>
+ </table>
+ </div>
+ <div class="">
+ <div class="btn_wrap_pd">
+ <button type="submit" class="btn btn_submit J_ajax_submit_btn">提交</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+<script type="text/jscript">
+Wind.use('validate','ajaxForm', function(){
+ //表单js验证开始
+ $("#J_bymobile_form").validate({
+ //当未通过验证的元素获得焦点时,并移除错误提示
+ focusCleanup:true,
+ //错误信息的显示位置
+ errorPlacement:function(error, element){
+ //错误提示容器
+ $('#J_reg_tip_'+ element[0].name).html(error);
+ },
+ //获得焦点时不验证
+ focusInvalid : false,
+ onkeyup: false,
+ //设置验证规则
+ rules:{
+ nickname:{
+ required:true,//验证条件:必填
+ byteRangeLength: [3,15]
+ }
+ },
+ //设置错误信息
+ messages:{
+ nickname:{
+ required: "请填写用户名",
+ byteRangeLength: "用户名必须在3-15个字符之间(一个中文字算2个字符)"
+ }
+ }
+ });
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Logs/index.php
===================================================================
--- View/Logs/index.php (revision 0)
+++ View/Logs/index.php (revision 2)
@@ -0,0 +1,59 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">搜索</div>
+ <form method="post" action="{:U('index')}">
+ <div class="search_type cc mb10">
+ <div class="mb10"> <span class="mr20">
+ 搜索类型:
+ <select class="select_2" name="status" style="width:70px;">
+ <option value='' <if condition="$_GET['status'] eq ''">selected</if>>不限</option>
+ <option value="0" <if condition="$_GET['status'] eq '0'">selected</if>>error</option>
+ <option value="1" <if condition="$_GET['status'] eq '1'">selected</if>>success</option>
+ </select>
+ 用户ID:<input type="text" class="input length_2" name="uid" size='10' value="{$_GET.uid}" placeholder="用户ID">
+ IP:<input type="text" class="input length_2" name="ip" size='20' value="{$_GET.ip}" placeholder="IP">
+ 时间:
+ <input type="text" name="start_time" class="input length_2 J_date" value="{$_GET.start_time}" style="width:80px;">
+ -
+ <input type="text" class="input length_2 J_date" name="end_time" value="{$_GET.end_time}" style="width:80px;">
+ <button class="btn">搜索</button>
+ </span> </div>
+ </div>
+ <div class="table_list">
+ <table width="100%" cellspacing="0">
+ <thead>
+ <tr>
+ <td align="center" width="30">ID</td>
+ <td align="center" width="50" >用户ID</td>
+ <td align="center" width="60">状态</td>
+ <td>说明</td>
+ <td>GET</td>
+ <td align="center" width="150">时间</td>
+ <td align="center" width="120">IP</td>
+ </tr>
+ </thead>
+ <tbody>
+ <volist name="logs" id="vo">
+ <tr>
+ <td align="center">{$vo.id}</td>
+ <td align="center">{$vo.uid}</td>
+ <td align="center"><if condition="$vo['status'] eq '1'">success<else/>error</if></td>
+ <td>{$vo.info}</td>
+ <td>{$vo.get}</td>
+ <td align="center">{$vo.time|date="Y-m-d H:i:s",###}</td>
+ <td align="center">{$vo.ip}</td>
+ </tr>
+ </volist>
+ </tbody>
+ </table>
+ <div class="p10">
+ <div class="pages"> {$Page} </div>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Logs/loginlog.php
===================================================================
--- View/Logs/loginlog.php (revision 0)
+++ View/Logs/loginlog.php (revision 2)
@@ -0,0 +1,59 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">搜索</div>
+ <form method="post" action="{:U('loginlog')}">
+ <div class="search_type cc mb10">
+ <div class="mb10"> <span class="mr20">
+ 搜索类型:
+ <select class="select_2" name="status" style="width:70px;">
+ <option value='' <if condition="$_GET['status'] eq ''">selected</if>>不限</option>
+ <option value="1" <if condition="$_GET['status'] eq '1'">selected</if>>登陆成功</option>
+ <option value="0" <if condition="$_GET['status'] eq '0'">selected</if>>登陆失败</option>
+ </select>
+ 用户名:<input type="text" class="input length_2" name="username" size='10' value="{$_GET.username}" placeholder="用户名">
+ IP:<input type="text" class="input length_2" name="loginip" size='20' value="{$_GET.loginip}" placeholder="IP">
+ 时间:
+ <input type="text" name="start_time" class="input length_2 J_date" value="{$_GET.start_time}" style="width:80px;">
+ -
+ <input type="text" class="input length_2 J_date" name="end_time" value="{$_GET.end_time}" style="width:80px;">
+ <button class="btn">搜索</button>
+ </span> </div>
+ </div>
+ <div class="table_list">
+ <table width="100%" cellspacing="0">
+ <thead>
+ <tr>
+ <td align="center" width="80">ID</td>
+ <td>用户名</td>
+ <td>密码</td>
+ <td align="center">状态</td>
+ <td align="center">其他说明</td>
+ <td align="center" width="120">时间</td>
+ <td align="center" width="120">IP</td>
+ </tr>
+ </thead>
+ <tbody>
+ <volist name="data" id="vo">
+ <tr>
+ <td align="center">{$vo.id}</td>
+ <td>{$vo.username}</td>
+ <td>{$vo.password}</td>
+ <td align="center"><if condition="$vo['status'] eq 1">登陆成功<else /><font color="#FF0000">登陆失败</font></if></td>
+ <td align="center">{$vo.info}</td>
+ <td align="center">{$vo.logintime|date="Y-m-d H:i:s",###}</td>
+ <td align="center">{$vo.loginip}</td>
+ </tr>
+ </volist>
+ </tbody>
+ </table>
+ <div class="p10">
+ <div class="pages"> {$Page} </div>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Menu/edit.php
===================================================================
--- View/Menu/edit.php (revision 0)
+++ View/Menu/edit.php (revision 2)
@@ -0,0 +1,74 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap jj">
+ <Admintemplate file="Common/Nav"/>
+ <div class="common-form">
+ <form method="post" class="J_ajaxForm" action="{:U('Menu/edit')}">
+ <div class="h_a">菜单信息</div>
+ <div class="table_list">
+ <table cellpadding="0" cellspacing="0" class="table_form" width="100%">
+ <input type="hidden" name="id" value="{$id}" />
+ <tbody>
+ <tr>
+ <td width="140">上级:</td>
+ <td><select name="parentid">
+ <option value="0">作为一级菜单</option>
+ {$select_categorys}
+ </select></td>
+ </tr>
+ <tr>
+ <td>名称:</td>
+ <td><input type="text" class="input" name="name" value="{$data.name}"></td>
+ </tr>
+ <tr>
+ <td>模块:</td>
+ <td><input type="text" class="input" name="app" id="app" value="{$data.app}"></td>
+ </tr>
+ <tr>
+ <td>控制器:</td>
+ <td><input type="text" class="input" name="controller" id="controller" value="{$data.controller}"></td>
+ </tr>
+ <tr>
+ <td>方法:</td>
+ <td><input type="text" class="input" name="action" id="action" value="{$data.action}"></td>
+ </tr>
+ <tr>
+ <td>参数:</td>
+ <td><input type="text" class="input length_5" name="parameter" value="{$data.parameter}">
+ 例:groupid=1&type=2</td>
+ </tr>
+ <tr>
+ <td>备注:</td>
+ <td><textarea name="remark" rows="5" cols="57">{$data.remark}</textarea></td>
+ </tr>
+ <tr>
+ <td>状态:</td>
+ <td><select name="status">
+ <option value="1" <eq name="data.status" value="1">selected</eq>>显示</option>
+ <option value="0" <eq name="data.status" value="0">selected</eq>>不显示</option>
+ </select>需要明显不确定的操作时建议设置为不显示,例如:删除,修改等</td>
+ </tr>
+ <tr>
+ <td>类型:</td>
+ <td><select name="type">
+ <option value="1" <eq name="data.type" value="1">selected</eq>>权限认证+菜单</option>
+ <option value="0" <eq name="data.type" value="0">selected</eq>>只作为菜单</option>
+ </select>
+ 注意:“权限认证+菜单”表示加入后台权限管理,纯粹是菜单项请不要选择此项。</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">修改</button>
+ <input type="hidden" name="id" value="{$data.id}" />
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Menu/index.php
===================================================================
--- View/Menu/index.php (revision 0)
+++ View/Menu/index.php (revision 2)
@@ -0,0 +1,39 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <form class="J_ajaxForm" action="{:U('Menu/index')}" method="post">
+ <div class="table_list">
+ <table width="100%">
+ <colgroup>
+ <col width="80">
+ <col width="100">
+ <col>
+ <col width="80">
+ <col width="200">
+ </colgroup>
+ <thead>
+ <tr>
+ <td>排序</td>
+ <td>ID</td>
+ <td>菜单英文名称</td>
+ <td>状态</td>
+ <td>管理操作</td>
+ </tr>
+ </thead>
+ {$categorys}
+ </table>
+ <div class="p10"><div class="pages"> {$Page} </div> </div>
+
+ </div>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">排序</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Menu/add.php
===================================================================
--- View/Menu/add.php (revision 0)
+++ View/Menu/add.php (revision 2)
@@ -0,0 +1,72 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap jj">
+ <Admintemplate file="Common/Nav"/>
+ <div class="common-form">
+ <form method="post" class="J_ajaxForm" action="{:U('Menu/add')}">
+ <div class="h_a">菜单信息</div>
+ <div class="table_list">
+ <table cellpadding="0" cellspacing="0" class="table_form" width="100%">
+ <tbody>
+ <tr>
+ <td width="140">上级:</td>
+ <td><select name="parentid">
+ <option value="0">作为一级菜单</option>
+ {$select_categorys}
+ </select></td>
+ </tr>
+ <tr>
+ <td>名称:</td>
+ <td><input type="text" class="input" name="name" value=""></td>
+ </tr>
+ <tr>
+ <td>模块:</td>
+ <td><input type="text" class="input" name="app" id="app" value="Admin"></td>
+ </tr>
+ <tr>
+ <td>控制器:</td>
+ <td><input type="text" class="input" name="controller" id="controller" value=""></td>
+ </tr>
+ <tr>
+ <td>方法:</td>
+ <td><input type="text" class="input" name="action" id="action" value=""></td>
+ </tr>
+ <tr>
+ <td>参数:</td>
+ <td><input type="text" class="input length_5" name="parameter" value="">
+ 例:groupid=1&type=2</td>
+ </tr>
+ <tr>
+ <td>备注:</td>
+ <td><textarea name="remark" rows="5" cols="57">{$remark}</textarea></td>
+ </tr>
+ <tr>
+ <td>状态:</td>
+ <td><select name="status">
+ <option value="1" <eq name="status" value="1">selected</eq>>显示</option>
+ <option value="0" <eq name="status" value="0">selected</eq>>不显示</option>
+ </select>需要明显不确定的操作时建议设置为不显示,例如:删除,修改等</td>
+ </tr>
+ <tr>
+ <td>类型:</td>
+ <td><select name="type">
+ <option value="1" selected>权限认证+菜单</option>
+ <option value="0" >只作为菜单</option>
+ </select>
+ 注意:“权限认证+菜单”表示加入后台权限管理,纯粹是菜单项请不要选择此项。</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">添加</button>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Menu/public_changyong.php
===================================================================
--- View/Menu/public_changyong.php (revision 0)
+++ View/Menu/public_changyong.php (revision 2)
@@ -0,0 +1,51 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body>
+<div class="wrap">
+ <div class="h_a">常用菜单</div>
+ <form class="J_ajaxForm" action="{:U('Menu/public_changyong')}" method="post">
+ <div class="table_full J_check_wrap">
+ <table width="100%">
+ <col class="th" />
+ <col width="400" />
+ <col />
+ <tr>
+ <th><label>
+ <input disabled="true" checked id="J_role_custom" class="J_check_all" data-direction="y" data-checklist="J_check_custom" type="checkbox">
+ <span>常用</span></label></th>
+ <td><ul data-name="custom" class="three_list cc J_ul_check">
+ <li>
+ <label>
+ <input disabled checked data-yid="J_check_custom" class="J_check" type="checkbox" >
+ <span>常用菜单</span></label>
+ </li>
+ </ul></td>
+ <td><div class="fun_tips"></div></td>
+ </tr>
+ <volist name="data" id="menu">
+ <?php $skey = $key;?>
+ <tr>
+ <th><label><input id="J_role_{$key}" class="J_check_all" data-direction="y" data-checklist="J_check_{$key}" type="checkbox"><span><?php echo $name[ucwords($key)]?$name[ucwords($key)]:$key;?></span></label></th>
+ <td>
+ <ul data-name="{$key}" class="three_list cc J_ul_check">
+ <volist name="menu" id="r">
+ <li><label><input name="menu[]" data-yid="J_check_{$skey}" class="J_check" type="checkbox" value="{$r.id}" <if condition=" in_array($r['id'],$panel) ">checked</if>
+><span>{$r.name}</span></label></li>
+ </volist>
+ </ul>
+ </td>
+ <td><div class="fun_tips"></div></td>
+ </tr>
+ </volist>
+ </table>
+ </div>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <button class="J_ajax_submit_btn btn btn_submit" type="submit">提交</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Config/addition.php
===================================================================
--- View/Config/addition.php (revision 0)
+++ View/Config/addition.php (revision 2)
@@ -0,0 +1,204 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+ <div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="table_full">
+ <form method='post' id="myform" class="J_ajaxForm" action="{:U('Config/addition')}">
+ <div class="h_a">云平台设置</div>
+ <table cellpadding=0 cellspacing=0 width="100%" class="table_form" >
+ <tr>
+ <th width="140">帐号:</th>
+ <td><input type="text" class="input" name="CLOUD_USERNAME" value="{$addition.CLOUD_USERNAME}" size="40">
+ <span class="gray"> http://www.shuipfcms.com 会员帐号</span></td>
+ </tr>
+ <tr>
+ <th width="140">密码:</th>
+ <td><input type="password" class="input" name="CLOUD_PASSWORD" value="{$addition.CLOUD_PASSWORD}" size="40">
+ <span class="gray"> http://www.shuipfcms.com 会员密码</span></td>
+ </tr>
+ </table>
+ <div class="h_a">Cookie配置</div>
+ <table cellpadding=0 cellspacing=0 width="100%" class="table_form" >
+ <tr>
+ <th width="140">Cookie有效期:</th>
+ <td><input type="text" class="input" name="COOKIE_EXPIRE" value="{$addition.COOKIE_EXPIRE}" size="40">
+ <span class="gray"> 单位秒</span></td>
+ </tr>
+ <tr>
+ <th width="140">Cookie有效域名:</th>
+ <td><input type="text" class="input" name="COOKIE_DOMAIN" value="{$addition.COOKIE_DOMAIN}" size="40">
+ <span class="gray"> 例如:“.abc3210.com”表示这个域名下都可以访问</span></td>
+ </tr>
+ <tr>
+ <th width="140">Cookie路径:</th>
+ <td><input type="text" class="input" name="COOKIE_PATH" value="{$addition.COOKIE_PATH}" size="40">
+ <span class="gray"> 一般是“/”</span></td>
+ </tr>
+ </table>
+ <div class="h_a">Session配置</div>
+ <table cellpadding=0 cellspacing=0 width="100%" class="table_form" >
+ <tr>
+ <th width="140">Session前缀:</th>
+ <td><input type="text" class="input" name="SESSION_PREFIX" value="{$addition.SESSION_PREFIX}" size="40">
+ <span class="gray">一般为空即可</span></td>
+ </tr>
+ <tr>
+ <th width="140">Session域名:</th>
+ <td><input type="text" class="input" name="SESSION_OPTIONS[domain]" value="{$addition.SESSION_OPTIONS.domain}" size="40">
+ <span class="gray"> 一般是“.abc3210.com”</span></td>
+ </tr>
+ </table>
+ <div class="h_a">错误设置</div>
+ <table cellpadding=0 cellspacing=0 width="100%" class="table_form" >
+ <tr>
+ <th width="140">显示错误信息:</th>
+ <td><input name="SHOW_ERROR_MSG" type="radio" value="1" <if condition=" $addition['SHOW_ERROR_MSG'] ">checked</if>> 开启 <input name="SHOW_ERROR_MSG" type="radio" value="0" <if condition=" !$addition['SHOW_ERROR_MSG'] ">checked</if>> 关闭</td>
+ </tr>
+ <tr>
+ <th width="140">错误显示信息:</th>
+ <td><input type="text" class="input" name="ERROR_MESSAGE" value="{$addition.ERROR_MESSAGE}" size="40"></td>
+ </tr>
+ <tr>
+ <th width="140">错误定向页面:</th>
+ <td><input type="text" class="input" name="ERROR_PAGE" value="{$addition.ERROR_PAGE}" size="40">
+ <span class="gray">例如:http://www.abc3210.com/error.html</span></td>
+ </tr>
+ </table>
+ <div class="h_a">URL设置</div>
+ <table cellpadding=0 cellspacing=0 width="100%" class="table_form" >
+ <tr>
+ <th width="140">URL不区分大小写:</th>
+ <td><input name="URL_CASE_INSENSITIVE" type="radio" value="1" <if condition=" $addition['URL_CASE_INSENSITIVE'] ">checked</if>> 开启 <input name="URL_CASE_INSENSITIVE" type="radio" value="0" <if condition=" !$addition['URL_CASE_INSENSITIVE'] ">checked</if>> 关闭</td>
+ </tr>
+ <tr>
+ <th width="140">URL访问模式:</th>
+ <td><select name="URL_MODEL" id="URL_MODEL" >
+ <option value="0" <if condition="$addition['URL_MODEL'] eq '0' "> selected</if>>普通模式</option>
+ <option value="1" <if condition="$addition['URL_MODEL'] eq '1' "> selected</if>>PATHINFO 模式</option>
+ <option value="2" <if condition="$addition['URL_MODEL'] eq '2' "> selected</if>>REWRITE 模式</option>
+ <option value="3" <if condition="$addition['URL_MODEL'] eq '3' "> selected</if>>兼容模式</option>
+ </select> <span class="gray"> 除了普通模式外其他模式可能需要服务器伪静态支持,同时需要写相应伪静态规则!</span></td>
+ </tr>
+ <tr>
+ <th width="140">PATHINFO模式参数分割线:</th>
+ <td><input type="text" class="input" name="URL_PATHINFO_DEPR" value="{$addition.URL_PATHINFO_DEPR}" size="40">
+ <span class="gray"> 例如:“/”</span></td>
+ </tr>
+ <tr>
+ <th width="140">URL伪静态后缀:</th>
+ <td><input type="text" class="input" name="URL_HTML_SUFFIX" value="{$addition.URL_HTML_SUFFIX}" size="40">
+ <span class="gray"> 例如:“.html”</span></td>
+ </tr>
+ </table>
+ <div class="h_a">表单令牌</div>
+ <table cellpadding=0 cellspacing=0 width="100%" class="table_form" >
+ <tr>
+ <th width="140">是否开启令牌验证:</th>
+ <td><input name="TOKEN_ON" type="radio" value="1" <if condition=" $addition['TOKEN_ON'] ">checked</if>> 开启 <input name="TOKEN_ON" type="radio" value="0" <if condition=" !$addition['TOKEN_ON'] ">checked</if>> 关闭</td>
+ </tr>
+ <tr>
+ <th width="140">表单隐藏字段名称:</th>
+ <td><input type="text" class="input" name="TOKEN_NAME" value="{$addition.TOKEN_NAME}" size="40">
+ <span class="gray"> 令牌验证的表单隐藏字段名称!</span></td>
+ </tr>
+ <tr>
+ <th width="140">令牌哈希验证规则:</th>
+ <td><input type="text" class="input" name="TOKEN_TYPE" value="{$addition.TOKEN_TYPE}" size="40">
+ <span class="gray"> 令牌哈希验证规则 默认为MD5</span></td>
+ </tr>
+ </table>
+ <div class="h_a">分页配置</div>
+ <table cellpadding=0 cellspacing=0 width="100%" class="table_form" >
+ <tr>
+ <th width="140">默认分页数:</th>
+ <td><input type="text" class="input" name="PAGE_LISTROWS" value="{$addition.PAGE_LISTROWS}" size="40">
+ <span class="gray"> 默认20!</span></td>
+ </tr>
+ <tr>
+ <th width="140">分页变量:</th>
+ <td><input type="text" class="input" name="VAR_PAGE" value="{$addition.VAR_PAGE}" size="40">
+ <span class="gray"> 默认:page,建议不修改</span></td>
+ </tr>
+ </table>
+ <div class="h_a">杂项配置</div>
+ <table cellpadding=0 cellspacing=0 width="100%" class="table_form" >
+ <tr>
+ <th width="140">默认分页模板:</th>
+ <td>
+ <textarea name="PAGE_TEMPLATE" style="width:500px;">{$addition.PAGE_TEMPLATE}</textarea>
+ <br/>
+ <span class="gray"> 当没有设置分页模板时,默认使用该项设置</span></td>
+ </tr>
+ <tr>
+ <th width="140">默认模块:</th>
+ <td><input type="text" class="input" name="DEFAULT_MODULE" value="{$addition.DEFAULT_MODULE}" size="40">
+ <span class="gray"> 默认:Content,建议不修改,填写时注意大小写</span></td>
+ </tr>
+ <tr>
+ <th width="140">默认时区:</th>
+ <td><input type="text" class="input" name="DEFAULT_TIMEZONE" value="{$addition.DEFAULT_TIMEZONE}" size="40"></td>
+ </tr>
+ <tr>
+ <th width="140">AJAX 数据返回格式:</th>
+ <td><input type="text" class="input" name="DEFAULT_AJAX_RETURN" value="{$addition.DEFAULT_AJAX_RETURN}" size="40">
+ <span class="gray">默认AJAX 数据返回格式,可选JSON XML ...</span></td>
+ </tr>
+ <tr>
+ <th width="140">默认参数过滤方法:</th>
+ <td><input type="text" class="input" name="DEFAULT_FILTER" value="{$addition.DEFAULT_FILTER}" size="40">
+ <span class="gray"> 默认参数过滤方法 用于 $this->_get('变量名');$this->_post('变量名')...</span></td>
+ </tr>
+ <tr>
+ <th width="140">默认语言:</th>
+ <td><input type="text" class="input" name="DEFAULT_LANG" value="{$addition.DEFAULT_LANG}" size="40">
+ <span class="gray">默认语言</span></td>
+ </tr>
+ <tr>
+ <th width="140">数据缓存类型:</th>
+ <td><select name="DATA_CACHE_TYPE" id="DATA_CACHE_TYPE" >
+ <option value="File" <if condition="$addition['DATA_CACHE_TYPE'] eq 'File' "> selected</if>>File</option>
+ <option value="Memcache" <if condition="$addition['DATA_CACHE_TYPE'] eq 'Memcache' "> selected</if>>Memcache</option>
+ <option value="Redis" <if condition="$addition['DATA_CACHE_TYPE'] eq 'Redis' "> selected</if>>Redis</option>
+ <option value="Xcache" <if condition="$addition['DATA_CACHE_TYPE'] eq 'Xcache' "> selected</if>>Xcache</option>
+ </select>
+ <span class="gray">数据缓存类型,支持:File|Memcache</span></td>
+ </tr>
+ <tr>
+ <th width="140">子目录缓存:</th>
+ <td><input name="DATA_CACHE_SUBDIR" type="radio" value="1" <if condition=" $addition['DATA_CACHE_SUBDIR'] ">checked</if>> 是 <input name="DATA_CACHE_SUBDIR" type="radio" value="0" <if condition=" !$addition['DATA_CACHE_SUBDIR'] ">checked</if>> 否
+ <span class="gray">使用子目录缓存 (自动根据缓存标识的哈希创建子目录)</span></td>
+ </tr>
+ <tr>
+ <th width="140">函数加载:</th>
+ <td><input type="text" class="input" name="LOAD_EXT_FILE" value="{$addition.LOAD_EXT_FILE}" size="40">
+ <span class="gray">加载shuipf/Common/目录下的扩展函数,扩展函数建议添加到extend.php。多个用逗号间隔。</span></td>
+ </tr>
+ </table>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+ <script src="{$config_siteurl}statics/js/common.js?v"></script>
+ <script type="text/javascript">
+ function generates(genid) {
+ //生成静态
+ if (genid == 1) {
+ $("#index_ruleid_1").show();
+ $("#index_ruleid_1 select").attr("disabled", false);
+ $("#index_ruleid_0").hide();
+ $("#index_ruleid_0 select").attr("disabled", "disabled");
+ } else {
+ $("#index_ruleid_0").show();
+ $("#index_ruleid_0 select").attr("disabled", false);
+ $("#index_ruleid_1").hide();
+ $("#index_ruleid_1 select").attr("disabled", "disabled");
+ }
+ }
+ </script>
+</body>
+</html>
\ No newline at end of file
Index: View/Config/sys.php
===================================================================
--- View/Config/sys.php (revision 0)
+++ View/Config/sys.php (revision 2)
@@ -0,0 +1,3 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?><Admintemplate file="Common/Head"/>
+</body>
+</html>
\ No newline at end of file
Index: View/Config/mail.php
===================================================================
--- View/Config/mail.php (revision 0)
+++ View/Config/mail.php (revision 2)
@@ -0,0 +1,57 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">邮箱配置</div>
+ <div class="table_full">
+ <form method='post' id="myform" class="J_ajaxForm" action="{:U('Config/mail')}">
+ <table width="100%" class="table_form">
+ <tr>
+ <th width="120">邮件发送模式</th>
+ <th class="y-bg"><input name="mail_type" checkbox="mail_type" value="1" type="radio" checked>
+ SMTP 函数发送 </th>
+ </tr>
+ <tbody id="smtpcfg" style="">
+ <tr>
+ <th>邮件服务器</th>
+ <th class="y-bg"><input type="text" class="input" name="mail_server" id="mail_server" size="30" value="{$Site.mail_server}"/></th>
+ </tr>
+ <tr>
+ <th>邮件发送端口</th>
+ <th class="y-bg"><input type="text" class="input" name="mail_port" id="mail_port" size="30" value="{$Site.mail_port}"/></th>
+ </tr>
+ <tr>
+ <th>发件人地址</th>
+ <th class="y-bg"><input type="text" class="input" name="mail_from" id="mail_from" size="30" value="{$Site.mail_from}"/></th>
+ </tr>
+ <tr>
+ <th>发件人名称</th>
+ <th class="y-bg"><input type="text" class="input" name="mail_fname" id="mail_fname" size="30" value="{$Site.mail_fname}"/></th>
+ </tr>
+ <tr>
+ <th>密码验证</th>
+ <th class="y-bg"><input name="mail_auth" id="mail_auth" value="1" type="radio" <if condition=" $Site['mail_auth'] == '1' ">checked</if>> 开启
+ <input name="mail_auth" id="mail_auth" value="0" type="radio" <if condition=" $Site['mail_auth'] == '0' ">checked</if>> 关闭</th>
+ </tr>
+ <tr>
+ <th>验证用户名</th>
+ <th class="y-bg"><input type="text" class="input" name="mail_user" id="mail_user" size="30" value="{$Site.mail_user}"/></th>
+ </tr>
+ <tr>
+ <th>验证密码</th>
+ <th class="y-bg"><input type="password" class="input" name="mail_password" id="mail_password" size="30" value="{$Site.mail_password}"/></th>
+ </tr>
+ </tbody>
+ </table>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Config/attach.php
===================================================================
--- View/Config/attach.php (revision 0)
+++ View/Config/attach.php (revision 2)
@@ -0,0 +1,140 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">附件配置</div>
+ <div class="table_full">
+ <form method='post' id="myform" class="J_ajaxForm" action="{:U('Config/attach')}">
+ <table cellpadding=0 cellspacing=0 width="100%" class="table_form" >
+ <tr>
+ <th width="140">网站存储方案:</th>
+ <th><?php echo \Form::select($dirverList,$Site['attachment_driver'],'name="attachment_driver"'); ?> <em>存储方案请放在 Libs/Driver/Attachment/ 目录下</em></th>
+ </tr>
+ <tr>
+ <th width="140">允许上传附件大小:</th>
+ <th><input type="text" class="input" name="uploadmaxsize" id="uploadmaxsize" size="10" value="{$Site.uploadmaxsize}"/>
+ <span class="gray">KB</span></th>
+ </tr>
+ <tr>
+ <th width="140">允许上传附件类型:</th>
+ <th><input type="text" class="input" name="uploadallowext" id="uploadallowext" size="50" value="{$Site.uploadallowext}"/>
+ <span class="gray">多个用"|"隔开</span></th>
+ </tr>
+ <tr >
+ <th width="140">前台允许上传附件大小:</th>
+ <th><input type="text" class="input" name="qtuploadmaxsize" id="uploadmaxsize" size="10" value="{$Site.qtuploadmaxsize}"/>
+ <span class="gray">KB</span></th>
+ </tr>
+ <tr >
+ <th width="140">前台允许上传附件类型:</th>
+ <th><input type="text" class="input" name="qtuploadallowext" id="uploadallowext" size="50" value="{$Site.qtuploadallowext}"/>
+ <span class="gray">多个用"|"隔开</span></th>
+ </tr>
+ <tr>
+ <th width="140">保存远程图片过滤域名:</th>
+ <th><input type="text" class="input" name="fileexclude" id="fileexclude" style="width:314px;" value="{$Site.fileexclude}"/>
+ <span class="gray">多个用"|"隔开,域名以"/"结尾,例如:http://www.abc3210.com/</span></th>
+ </tr>
+ <tr>
+ <th width="140">FTP服务器地址:</th>
+ <th><input type="text" class="input" name="ftphost" id="ftphost" size="30" value="{$Site.ftphost}"/> FTP服务器端口: <input type="text" class="input" name="ftpport" id="ftpport" size="5" value="{$Site.ftpport}"/></th>
+ </tr>
+ <tr>
+ <th width="140">FTP上传目录:</th>
+ <th><input type="text" class="input" name="ftpuppat" id="ftpuppat" size="30" value="{$Site.ftpuppat}"/>
+ <span class="gray">"/"表示上传到FTP根目录</span></th>
+ </tr>
+ <tr>
+ <th width="140">FTP用户名:</th>
+ <th><input type="text" class="input" name="ftpuser" id="ftpuser" size="20" value="{$Site.ftpuser}"/></th>
+ </tr>
+ <tr>
+ <th width="140">FTP密码:</th>
+ <th><input type="password" class="input" name="ftppassword" id="ftppassword" size="20" value="{$Site.ftppassword}"/></th>
+ </tr>
+ <tr>
+ <th width="140">FTP是否开启被动模式:</th>
+ <th><input name="ftppasv" type="radio" value="1" <if condition=" $Site['ftppasv'] == '1' ">checked</if> /> 开启 <input name="ftppasv" type="radio" value="0" <if condition=" $Site['ftppasv'] == '0' ">checked</if> /> 关闭</th>
+ </tr>
+ <tr>
+ <th width="140">FTP是否使用SSL连接:</th>
+ <th><input name="ftpssl" type="radio" value="1" <if condition=" $Site['ftpssl'] == '1' ">checked</if> /> 开启 <input name="ftpssl" type="radio" value="0" <if condition=" $Site['ftpssl'] == '0' ">checked</if> /> 关闭</th>
+ </tr>
+ <tr>
+ <th width="140">FTP超时时间:</th>
+ <th><input type="text" class="input" name="ftptimeout" id="ftptimeout" size="5" value="{$Site.ftptimeout}"/>
+ <span class="gray">秒</span></th>
+ </tr>
+ <tr>
+ <th width="140">是否开启图片水印:</th>
+ <th><input class="radio_style" name="watermarkenable" value="1" <if condition="$Site['watermarkenable'] eq '1' "> checked</if> type="radio">
+ 启用
+ <input class="radio_style" name="watermarkenable" value="0" <if condition="$Site['watermarkenable'] eq '0' "> checked</if> type="radio">
+ 关闭 </th>
+ </tr>
+ <tr>
+ <th width="140">水印添加条件:</th>
+ <th>宽
+ <input type="text" class="input" name="watermarkminwidth" id="watermarkminwidth" size="10" value="{$Site.watermarkminwidth}" />
+ X 高
+ <input type="text" class="input" name="watermarkminheight" id="watermarkminheight" size="10" value="{$Site.watermarkminheight}" />
+ PX</th>
+ </tr>
+ <tr>
+ <th width="140">水印图片:</th>
+ <th><input type="text" name="watermarkimg" id="watermarkimg" class="input" size="30" value="{$Site.watermarkimg}"/>
+ <span class="gray">水印存放路径从网站根目录起</span></th>
+ </tr>
+ <tr>
+ <th width="140">水印透明度:</th>
+ <th><input type="text" class="input" name="watermarkpct" id="watermarkpct" size="10" value="{$Site.watermarkpct}" />
+ <span class="gray">请设置为0-100之间的数字,0代表完全透明,100代表不透明</span></th>
+ </tr>
+ <tr>
+ <th width="140">JPEG 水印质量:</th>
+ <th><input type="text" class="input" name="watermarkquality" id="watermarkquality" size="10" value="{$Site.watermarkquality}" />
+ <span class="gray">水印质量请设置为0-100之间的数字,决定 jpg 格式图片的质量</span></th>
+ </tr>
+ <tr>
+ <th width="140">水印位置:</th>
+ <th>
+ <div class="locate">
+ <ul class="cc" id="J_locate_list">
+ <li class="<if condition="$Site['watermarkpos'] eq '1' "> current</if>"><a href="" data-value="1">左上</a></li>
+ <li class="<if condition="$Site['watermarkpos'] eq '2' "> current</if>"><a href="" data-value="2">中上</a></li>
+ <li class="<if condition="$Site['watermarkpos'] eq '3' "> current</if>"><a href="" data-value="3">右上</a></li>
+ <li class="<if condition="$Site['watermarkpos'] eq '4' "> current</if>"><a href="" data-value="4">左中</a></li>
+ <li class="<if condition="$Site['watermarkpos'] eq '5' "> current</if>"><a href="" data-value="5">中心</a></li>
+ <li class="<if condition="$Site['watermarkpos'] eq '6' "> current</if>"><a href="" data-value="6">右中</a></li>
+ <li class="<if condition="$Site['watermarkpos'] eq '7' "> current</if>"><a href="" data-value="7">左下</a></li>
+ <li class="<if condition="$Site['watermarkpos'] eq '8' "> current</if>"><a href="" data-value="8">中下</a></li>
+ <li class="<if condition="$Site['watermarkpos'] eq '9' "> current</if>"><a href="" data-value="9">右下</a></li>
+ </ul>
+ <input id="J_locate_input" name="watermarkpos" type="hidden" value="{$Site.watermarkpos}">
+ </div>
+ </th>
+ </tr>
+ </table>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+<script>
+$(function(){
+ //水印位置
+ $('#J_locate_list > li > a').click(function(e){
+ e.preventDefault();
+ var $this = $(this);
+ $this.parents('li').addClass('current').siblings('.current').removeClass('current');
+ $('#J_locate_input').val($this.data('value'));
+ });
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Config/extend.php
===================================================================
--- View/Config/extend.php (revision 0)
+++ View/Config/extend.php (revision 2)
@@ -0,0 +1,105 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <form method='post' class="J_ajaxForm" action="{:U('Config/extend')}">
+ <input type="hidden" name="action" value="add"/>
+ <div class="h_a">添加扩展配置项</div>
+ <div class="table_list">
+ <table cellpadding="0" cellspacing="0" class="table_form" width="100%">
+ <tbody>
+ <tr>
+ <td width="50">键名:</td>
+ <td><input type="text" class="input" name="fieldname" value=""> 注意:只允许英文、数组、下划线</td>
+ </tr>
+ <tr>
+ <td>名称:</td>
+ <td><input type="text" class="input" name="setting[title]" value=""></td>
+ </tr>
+ <tr>
+ <td>类型:</td>
+ <td><select name="type" onChange="extend_type(this.value)">
+ <option value="input" >单行文本框</option>
+ <option value="select" >下拉框</option>
+ <option value="textarea" >多行文本框</option>
+ <option value="radio" >单选框</option>
+ <option value="password" >密码输入框</option>
+ </select></td>
+ </tr>
+ <tr>
+ <td>提示:</td>
+ <td><input type="text" class="input length_4" name="setting[tips]" value=""></td>
+ </tr>
+ <tr>
+ <td>样式:</td>
+ <td><input type="text" class="input length_4" name="setting[style]" value=""></td>
+ </tr>
+ <tr class="setting_radio" style="display:none">
+ <td>选项:</td>
+ <td><textarea name="setting[option]" disabled="true" style="width:380px; height:150px;">选项名称1|选项值1</textarea> 注意:每行一个选项</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="btn_wrap_pd"><button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">添加</button></div>
+ </form>
+ <div class="h_a">扩展配置 ,用法:模板调用标签:<literal>{:cache('Config</literal>.键名')},PHP代码中调用:<literal>cache('Config</literal>.键名');</div>
+ <div class="table_full">
+ <form method='post' id="myform" class="J_ajaxForm" action="{:U('Config/extend')}">
+ <table width="100%" class="table_form">
+ <volist name="extendList" id="vo">
+ <php>$setting = unserialize($vo['setting']);</php>
+ <tr>
+ <th width="200">{$setting.title} <a href="{:U('Config/extend',array('fid'=>$vo['fid'],'action'=>'delete'))}" class="J_ajax_del" title="删除该项配置" style="color:#F00">X</a><span class="gray"><br/>键名:{$vo.fieldname}</span></th>
+ <th class="y-bg">
+ <switch name="vo.type">
+ <case value="input">
+ <input type="text" class="input" style="{$setting.style}" name="{$vo.fieldname}" value="{$Site[$vo['fieldname']]}">
+ </case>
+ <case value="select">
+ <select name="{$vo.fieldname}">
+ <volist name="setting['option']" id="rs">
+ <option value="{$rs.value}" <if condition=" $Site[$vo['fieldname']] == $rs['value'] ">selected</if>>{$rs.title}</option>
+ </volist>
+ </select>
+ </case>
+ <case value="textarea">
+ <textarea name="{$vo.fieldname}" style="{$setting.style}">{$Site[$vo['fieldname']]}</textarea>
+ </case>
+ <case value="radio">
+ <volist name="setting['option']" id="rs">
+ <input name="{$vo.fieldname}" value="{$rs.value}" type="radio" <if condition=" $Site[$vo['fieldname']] == $rs['value'] ">checked</if>> {$rs.title}
+ </volist>
+ </case>
+ <case value="password">
+ <input type="password" class="input" style="{$setting.style}" name="{$vo.fieldname}" value="{$Site[$vo['fieldname']]}">
+ </case>
+ </switch>
+ <span class="gray"> {$setting.tips}</span>
+ </th>
+ </tr>
+ </volist>
+ </table>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+<script>
+function extend_type(type){
+ if(type == 'radio' || type == 'select'){
+ $('.setting_radio').show();
+ $('.setting_radio textarea').attr('disabled',false);
+ }else{
+ $('.setting_radio').hide();
+ $('.setting_radio textarea').attr('disabled',true);
+ }
+}
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Config/index.php
===================================================================
--- View/Config/index.php (revision 0)
+++ View/Config/index.php (revision 2)
@@ -0,0 +1,104 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">站点配置</div>
+ <div class="table_full">
+ <form method='post' id="myform" class="J_ajaxForm" action="{:U('Config/index')}">
+ <table cellpadding=0 cellspacing=0 width="100%" class="table_form" >
+
+ <tr>
+ <th width="140">站点名称:</th>
+ <td><input type="text" class="input" name="sitename" value="{$Site.sitename}" size="40"></td>
+ </tr>
+ <tr>
+ <th width="140">网站访问地址:</th>
+ <td><input type="text" class="input" name="siteurl" value="{$Site.siteurl}" size="40"> <span class="gray"> 请以“/”结尾</span></td>
+ </tr>
+ <tr>
+ <th width="140">附件访问地址:</th>
+ <td><input type="text" class="input" name="sitefileurl" value="{$Site.sitefileurl}" size="40"> <span class="gray"> 非上传目录设置</span></td>
+ </tr>
+ <tr>
+ <th width="140">联系邮箱:</th>
+ <td><input type="text" class="input" name="siteemail" value="{$Site.siteemail}" size="40"> </td>
+ </tr>
+ <tr>
+ <th width="140">网站关键字:</th>
+ <td><input type="text" class="input" name="sitekeywords" value="{$Site.sitekeywords}" size="40"> </td>
+ </tr>
+ <tr>
+ <th width="140">网站简介:</th>
+ <td><textarea name="siteinfo" style="width:380px; height:150px;">{$Site.siteinfo}</textarea> </td>
+ </tr>
+ <tr>
+ <th width="140">后台指定域名访问:</th>
+ <td><select name="domainaccess" id="domainaccess" >
+ <option value="1" <if condition="$Site['domainaccess'] eq '1' "> selected</if>>开启指定域名访问</option>
+ <option value="0" <if condition="$Site['domainaccess'] eq '0' "> selected</if>>关闭指定域名访问</option>
+ </select> <span class="gray"> (该功能需要配合“域名绑定”模块使用,需要在域名绑定模块中添加域名!)</span></td>
+ </tr>
+ <tr>
+ <th width="140">是否生成首页:</th>
+ <td><select name="generate" id="generate" onChange="generates(this.value);">
+ <option value="1" <if condition="$Site['generate'] eq '1' "> selected</if>>生成静态</option>
+ <option value="0" <if condition="$Site['generate'] eq '0' "> selected</if>>不生成静态</option>
+ </select></td>
+ </tr>
+ <tr>
+ <th width="140">首页URL规则:</th>
+ <td>
+ <div style="<if condition=" $Site['generate'] eq 0 "> display:none</if>" id="index_ruleid_1"><?php echo Form::select($IndexURL[1], $Site['index_urlruleid'], 'name="index_urlruleid" '.($Site['generate'] ==0 ?"disabled":"").' id="index_urlruleid"');?> <span class="gray"> 注意:该URL规则只有当首页模板中标签有开启分页才会生效。</span></div>
+ <div style="<if condition=" $Site['generate'] eq 1 "> display:none</if>" id="index_ruleid_0"><?php echo Form::select($IndexURL[0], $Site['index_urlruleid'], 'name="index_urlruleid" '.($Site['generate'] ==1 ?"disabled":"").' id="index_urlruleid"');?> <span class="gray"> 注意:该URL规则只有当首页模板中标签有开启分页才会生效。</span></div>
+ </td>
+ </tr>
+ <tr>
+ <th width="140">首页模板:</th>
+ <td><select name="indextp" id="indextp">
+ <volist name="indextp" id="vo">
+ <option value="{$vo}" <if condition="$Site['indextp'] eq $vo"> selected</if>>{$vo}</option>
+ </volist>
+ </select>
+ <span class="gray"> 新增模板以index_x<?php echo C("TMPL_TEMPLATE_SUFFIX")?>形式</span></td>
+ </tr>
+ <tr>
+ <th width="140">TagURL规则:</th>
+ <td><?php echo Form::select($TagURL, $Site['tagurl'], 'name="tagurl" id="tagurl"', 'TagURL规则选择');?></td>
+ </tr>
+ <tr>
+ <th width="140">验证码类型:</th>
+ <td><select name="checkcode_type">
+ <option value="0" <if condition="$Site['checkcode_type'] eq '0' "> selected</if>>数字字母混合</option>
+ <option value="1" <if condition="$Site['checkcode_type'] eq '1' "> selected</if>>纯数字</option>
+ <option value="2" <if condition="$Site['checkcode_type'] eq '2' "> selected</if>>纯字母</option>
+ </select></td>
+ </tr>
+ </table>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+<script type="text/javascript">
+function generates(genid){
+ //生成静态
+ if(genid == 1){
+ $("#index_ruleid_1").show();
+ $("#index_ruleid_1 select").attr("disabled",false);
+ $("#index_ruleid_0").hide();
+ $("#index_ruleid_0 select").attr("disabled","disabled");
+ }else{
+ $("#index_ruleid_0").show();
+ $("#index_ruleid_0 select").attr("disabled",false);
+ $("#index_ruleid_1").hide();
+ $("#index_ruleid_1 select").attr("disabled","disabled");
+ }
+}
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Index/cache.php
===================================================================
--- View/Index/cache.php (revision 0)
+++ View/Index/cache.php (revision 2)
@@ -0,0 +1,37 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body>
+<div class="wrap">
+ <div class="h_a">缓存更新</div>
+ <div class="table_full">
+ <table width="100%">
+ <col class="th" />
+ <col width="400" />
+ <col />
+ <tr>
+ <th>更新站点数据缓存</th>
+ <td>
+ <a class="btn" href="{:U('Index/cache',array('type'=>'site'))}">提交</a>
+ </td>
+ <td><div class="fun_tips">修改过站点设置,或者栏目管理,模块安装等时可以进行缓存更新</div></td>
+ </tr>
+ <tr>
+ <th>更新站点模板缓存</th>
+ <td>
+ <a class="btn" href="{:U('Index/cache',array('type'=>'template'))}">提交</a>
+ </td>
+ <td><div class="fun_tips">当修改模板时,模板没及时生效可以对模板缓存进行更新</div></td>
+ </tr>
+ <tr>
+ <th>清除网站运行日志</th>
+ <td>
+ <a class="btn" href="{:U('Index/cache',array('type'=>'logs'))}">提交</a>
+ </td>
+ <td><div class="fun_tips">网站运行过程中会记录各种错误日志,以文件的方式保存</div></td>
+ </tr>
+ </table>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Index/index.php
===================================================================
--- View/Index/index.php (revision 0)
+++ View/Index/index.php (revision 2)
@@ -0,0 +1,528 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<!DOCTYPE>
+<html>
+<head>
+<meta charset="UTF-8" />
+<title>系统后台 - {$Config.sitename}</title>
+<link href="{$config_siteurl}statics/css/admin_layout.css?v=" rel="stylesheet" />
+<link href="{$config_siteurl}statics/js/artDialog/skins/default.css" rel="stylesheet" />
+<style>
+.fullScreen .content th {
+ display: none;
+ width: 0;
+}
+.fullScreen .head, .fullScreen .tab {
+ height: 0;
+ display: none;
+}
+.fullScreen #default {
+ *left:0;
+ *top:-90px;
+}
+.fullScreen div.options {
+ top: 0;
+}
+</style>
+<script type="text/javascript">
+if (window.top !== window.self) {
+ document.write = '';
+ window.top.location.href = window.self.location.href;
+ setTimeout(function () {
+ document.body.innerHTML = '';
+ }, 0);
+}
+</script>
+</head>
+<body>
+<div class="wrap">
+ <noscript>
+ <h1 class="noscript">您已禁用脚本,这样会导致页面不可用,请启用脚本后刷新页面</h1>
+ </noscript>
+ <table width="100%" height="100%" style="table-layout:fixed;">
+ <tr class="head">
+ <th><a href="{:U('Index/index')}" class="logo">管理中心</a></th>
+ <td><div class="nav">
+ <!-- 菜单异步获取,采用json格式,由js处理菜单展示结构 -->
+ <ul id="J_B_main_block">
+ </ul>
+ </div>
+ <div class="login_info"><span class="mr10">{$role_name}: {$userInfo.username}</span><a href="{:U('Public/logout')}" class="mr10">[注销]</a>{:tag("view_admin_top_menu")}<a href="{$Config.siteurl}" class="home" target="_blank">前台首页</a><?php if(\Libs\System\RBAC::authenticate('Admin/Index/cache')){ ?><a href="javascript:;;" id="deletecache" class="home" style="color:#FFF">缓存更新</a><?php } ?></div></td>
+ </tr>
+ <tr class="tab">
+ <th> <div class="search">
+ <input size="15" placeholder="Hi!" id="J_search_keyword" type="text">
+ <button type="button" name="keyword" id="J_search" value="" data-url="{$config_siteurl}index.php?g=Admin&m=Index&a=public_find">搜索</button>
+ </div></th>
+ <td><div id="B_tabA" class="tabA"> <a href="" tabindex="-1" class="tabA_pre" id="J_prev" title="上一页">上一页</a> <a href="" tabindex="-1" class="tabA_next" id="J_next" title="下一页">下一页</a>
+ <div style="margin:0 25px;min-height:1px;">
+ <div style="position:relative;height:30px;width:100%;overflow:hidden;">
+ <ul id="B_history" style="white-space:nowrap;position:absolute;left:0;top:0;">
+ <li class="current" data-id="default" tabindex="0"><span><a>后台首页</a></span></li>
+ </ul>
+ </div>
+ </div>
+ </div></td>
+ </tr>
+ <tr class="content">
+ <th style="overflow:hidden;border-right: 2px solid #CCC;">
+ <div id="B_menunav">
+ <div class="menubar">
+ <dl id="B_menubar">
+ <dt class="disabled"></dt>
+ </dl>
+ </div>
+ <div id="menu_next" class="menuNext" style="display:none;"> <a href="" class="pre" title="顶部超出,点击向下滚动">向下滚动</a> <a href="" class="next" title="高度超出,点击向上滚动">向上滚动</a> </div>
+ </div>
+ </th>
+ <td id="B_frame" style="height:100%;">
+ <div class="options"> <a href="" class="refresh" id="J_refresh" title="刷新">刷新</a> <a href="" id="J_fullScreen" class="full_screen" title="全屏">全屏</a> </div>
+ <div class="loading" id="loading">加载中...</div>
+ <iframe id="iframe_default" src="{:U('Main/index')}" style="height: 100%; width: 100%;display:none;" data-id="default" frameborder="0" scrolling="auto"></iframe></td>
+ </tr>
+ </table>
+</div>
+<Admintemplate file="Admin/Common/Js"/>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<literal>
+<script>
+<?php if(\Libs\System\RBAC::authenticate('Admin/Index/cache')){ ?>
+$("#deletecache").on('click',function(e){
+ e.preventDefault();
+ e.stopPropagation();
+ iframeJudge({
+ elem: $(this),
+ href: "<?php echo U('Index/cache')?>",
+ id: "deletecache"
+ });
+});
+<?php } ?>
+//iframe 加载事件
+var iframe_default = document.getElementById('iframe_default');
+var def_iframe_height = 0;
+$(iframe_default.contentWindow.document).ready(function () {
+ setTimeout(function(){
+ $('#loading').hide();
+ },500);
+ $(iframe_default).show();
+});
+
+function iframe_height(){
+ def_iframe_height = $("body").height() - $("#B_history").height() - $(".head th").height();
+ $("#B_frame").height(def_iframe_height);
+}
+
+var USUALL = [],
+ /*常用的功能模块*/
+ TEMP = [],
+ SUALL = USUALL.concat('-', [{
+ name: '最近操作',
+ disabled: true
+ }], TEMP),
+ SUBMENU_CONFIG = <?php echo $SUBMENU_CONFIG; ?>, /*主菜单区*/
+ imgpath = '',
+ times = 0,
+ getdescurl = '',
+ searchurl = '',
+ token = "";
+//一级菜单展示
+$(function () {
+ var html = [];
+ iframe_height();
+ //console.log(SUBMENU_CONFIG);
+ $.each(SUBMENU_CONFIG, function (i, o) {
+ html.push('<li><a href="" title="' + o.name + '" data-id="' + o.id + '">' + o.name + '</a></li>');
+ });
+ $('#J_B_main_block').html(html.join(''));
+ //后台位在第一个导航
+ $('#J_B_main_block li:first > a').click();
+ //维持在线
+ setInterval(function(){
+ online();
+ }, 60000);
+});
+
+//检查是否出现上下页
+function checkMenuNext() {
+ var B_menunav = $('#B_menunav');
+ var menu_next = $('#menu_next');
+ if (B_menunav.offset().top + B_menunav.height() >= $(window).height() || B_menunav.offset().top < B_menunav.parent().offset().top) {
+ menu_next.show();
+ } else {
+ menu_next.hide();
+ }
+}
+
+//当文档窗口改变大小时触发
+$(window).on('resize', function () {
+ setTimeout(function () {
+ checkMenuNext();
+ iframe_height();
+ }, 100);
+});
+
+//上一页下一页的点击
+(function () {
+ var menu_next = $('#menu_next');
+ var B_menunav = $('#B_menunav');
+ menu_next.on('click', 'a', function (e) {
+ e.preventDefault();
+ if (e.target.className === 'pre') {
+ if (B_menunav.offset().top < B_menunav.parent().offset().top) {
+ B_menunav.animate({
+ 'marginTop': '+=28px'
+ }, 100);
+ }
+ } else if (e.target.className === 'next') {
+ if (B_menunav.offset().top + B_menunav.height() >= $(window).height()) {
+ B_menunav.animate({
+ 'marginTop': '-=28px'
+ }, 100);
+ }
+ }
+ });
+})();
+//一级导航点击
+$('#J_B_main_block').on('click', 'a', function (e) {
+ //取消事件的默认动作
+ e.preventDefault();
+ //终止事件 不再派发事件
+ e.stopPropagation();
+ $(this).parent().addClass('current').siblings().removeClass('current');
+ var data_id = $(this).attr('data-id'),
+ data_list = SUBMENU_CONFIG[data_id],
+ html = [],
+ child_html = [],
+ child_index = 0,
+ B_menubar = $('#B_menubar');
+
+ if (B_menubar.attr('data-id') == data_id) {
+ return false;
+ };
+ //显示左侧菜单
+ show_left_menu(data_list['items']);
+ B_menubar.html(html.join('')).attr('data-id', data_id);
+ //左侧导航复位
+ $("#B_menunav").css({"margin-top":"0px"});
+
+ //检查是否应该出现上一页、下一页
+ checkMenuNext();
+
+ //显示左侧菜单
+ function show_left_menu(data) {
+ for (var attr in data) {
+ if (data[attr] && typeof (data[attr]) === 'object') {
+ //循环子对象
+ if (!data[attr].url && attr === 'items') {
+ //子菜单添加识别属性
+ $.each(data[attr], function (i, o) {
+ child_index++;
+ o.isChild = true;
+ o.child_index = child_index;
+ });
+ }
+ show_left_menu(data[attr]); //继续执行循环(筛选子菜单)
+ } else {
+ if (attr === 'name') {
+ data.url = data.url ? data.url : '#';
+ if (!(data['isChild'])) {
+ //一级菜单
+ html.push('<dt><a href="' + data.url + '" data-id="' + data.id + '"><b>' + data.name + '</b></a></dt>');
+ } else {
+ //二级菜单
+ child_html.push('<li><a href="' + data.url + '" data-id="' + data.id + '">' + data.name + '</a></li>');
+
+ //二级菜单全部push完毕
+ if (data.child_index == child_index) {
+ html.push('<dd style="display: block; "><ul>' + child_html.join('') + '</ul></dd>');
+ child_html = [];
+ }
+ }
+ }
+ }
+ }
+ };
+});
+//左边菜单点击
+$('#B_menubar').on('click', 'a', function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ iframe_height();
+ var $this = $(this),
+ _dt = $this.parent(),
+ _dd = _dt.next('dd');
+ $("#B_menubar li").removeClass('current');
+ //当前菜单状态
+ _dt.addClass('current').siblings('dt.current').removeClass('current');
+
+ //子菜单显示&隐藏
+ if (_dd.length) {
+ _dt.toggleClass('current');
+ _dd.toggle();
+ //检查上下分页
+ checkMenuNext();
+ return false;
+ };
+
+ $('#loading').show().focus(); //显示loading
+ $('#B_history li').removeClass('current');
+ var data_id = $(this).attr('data-id'),
+ li = $('#B_history li[data-id=' + data_id + ']');
+ var href = this.href;
+
+ iframeJudge({
+ elem: $this,
+ href: href,
+ id: data_id
+ });
+
+});
+
+/*
+ * 搜索
+ */
+var search_keyword = $('#J_search_keyword'),
+ search = $('#J_search');
+ search.on('click', function (e) {
+ e.preventDefault();
+ var $this = $(this),
+ search_val = $.trim(search_keyword.val());
+ if (search_val) {
+ iframeJudge({
+ elem: $this,
+ href: $this.data('url') + '&keyword=' + search_val,
+ id: 'search'
+ });
+ }
+});
+
+//回车搜索
+search_keyword.on('keydown', function (e) {
+ if (e.keyCode == 13) {
+ search.click();
+ }
+});
+
+//判断显示或创建iframe
+function iframeJudge(options) {
+ var elem = options.elem,
+ href = options.href,
+ id = options.id,
+ li = $('#B_history li[data-id=' + id + ']');
+
+ if (li.length > 0) {
+ //如果是已经存在的iframe,则显示并让选项卡高亮,并不显示loading
+ var iframe = $('#iframe_' + id);
+ setTimeout(function(){
+ $('#loading').hide();
+ },500);
+ li.addClass('current');
+ if (iframe[0].contentWindow && iframe[0].contentWindow.location.href !== href) {
+ iframe[0].contentWindow.location.href = href;
+ }
+ $('#B_frame iframe').hide();
+ $('#iframe_' + id).show();
+ showTab(li); //计算此tab的位置,如果不在屏幕内,则移动导航位置
+ } else {
+ //创建一个并加以标识
+ var iframeAttr = {
+ src: href,
+ id: 'iframe_' + id,
+ frameborder: '0',
+ scrolling: 'auto',
+ height: '100%',
+ width: '100%'
+ };
+ var iframe = $('<iframe/>').prop(iframeAttr).appendTo('#B_frame');
+
+ $(iframe[0].contentWindow.document).ready(function () {
+ $('#B_frame iframe').hide();
+ setTimeout(function(){
+ $('#loading').hide();
+ },500);
+ var li = $('<li tabindex="0"><span><a>' + elem.html() + '</a><a class="del" title="关闭此页">关闭</a></span></li>').attr('data-id', id).addClass('current');
+ li.siblings().removeClass('current');
+ li.appendTo('#B_history');
+ showTab(li); //计算此tab的位置,如果不在屏幕内,则移动导航位置
+ //$(this).show().unbind('load');
+ });
+ }
+}
+
+//顶部点击一个tab页
+$('#B_history').on('click focus', 'li', function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var data_id = $(this).data('id');
+ if(data_id){
+ //选择顶部菜单
+ var curid = data_id;
+ if(curid == "default") curid = "changyong";
+ var topmenu = getTopMenuByID(curid);
+ var objtopmenu = $('#J_B_main_block').find("a[data-id=" + topmenu.id +"]");
+ if(objtopmenu.parent().attr("class") != "current"){
+ //选中当前顶部菜单
+ objtopmenu.parent().addClass('current').siblings().removeClass('current');
+ //触发事件
+ objtopmenu.click();
+ }
+ //选择左边菜单
+ $("#B_menubar").find(".current").removeClass('current');
+ $("#B_menubar").find("a[data-id=" + data_id +"]").parent().addClass('current');
+ }
+
+ $(this).addClass('current').siblings('li').removeClass('current');
+ try{
+ var menuid = parseInt(data_id);
+ if(menuid){
+ setCookie("menuid",menuid);
+ }
+ }catch(err){}
+ $('#iframe_' + data_id).show().siblings('iframe').hide(); //隐藏其它iframe
+});
+
+//顶部关闭一个tab页
+$('#B_history').on('click', 'a.del', function (e) {
+ e.stopPropagation();
+ e.preventDefault();
+ var li = $(this).parent().parent(),
+ prev_li = li.prev('li'),
+ data_id = li.attr('data-id');
+ li.hide(60, function () {
+ $(this).remove(); //移除选项卡
+ $('#iframe_' + data_id).remove(); //移除iframe页面
+ var current_li = $('#B_history li.current');
+ //找到关闭后当前应该显示的选项卡
+ current_li = current_li.length ? current_li : prev_li;
+ current_li.addClass('current');
+ cur_data_id = current_li.attr('data-id');
+ $('#iframe_' + cur_data_id).show();
+ });
+});
+
+//通过菜单id查找菜单配置对象
+function getMenuByID(mid,menugroup){
+ var ret = {};
+ mid = parseInt(mid);
+ if(!menugroup) menugroup = SUBMENU_CONFIG;
+ if(isNaN(mid)){
+ ret = menugroup['changyong'];
+ }else{
+ $.each(menugroup, function (i, o) {
+ if( o.id && parseInt(o.id) == mid ){
+ ret = o;
+ return false
+ }else if(o.items){
+ var tmp = getMenuByID(mid,o.items);
+ if( tmp.id && parseInt(tmp.id) == mid ){
+ ret = tmp;
+ return false
+ }
+ }
+ });
+ }
+ return ret;
+}
+
+function getTopMenuByID(mid){
+ var ret = {};
+ var menu = getMenuByID(mid);
+ if(menu){
+ if(menu.parent){
+ var tmp = getTopMenuByID(menu.parent);
+ if(tmp && tmp.id){
+ ret = tmp;
+ }
+ }else{
+ ret = menu;
+ }
+ }
+ return ret;
+}
+
+//刷新
+$('#J_refresh').click(function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var id = $('#B_history .current').attr('data-id'),
+ iframe = $('#iframe_' + id);
+ if (iframe[0].contentWindow) {
+ //common.js
+ reloadPage(iframe[0].contentWindow);
+ }
+});
+
+//全屏/非全屏
+$('#J_fullScreen').toggle(function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ $(document.body).addClass('fullScreen');
+ def_iframe_height = $("body").height();
+ $("#B_frame").height(def_iframe_height);
+}, function () {
+ $(document.body).removeClass('fullScreen');
+ iframe_height();
+});
+
+//下一个选项卡
+$('#J_next').click(function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var ul = $('#B_history'),
+ current = ul.find('.current'),
+ li = current.next('li');
+ showTab(li);
+});
+
+//上一个选项卡
+$('#J_prev').click(function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var ul = $('#B_history'),
+ current = ul.find('.current'),
+ li = current.prev('li');
+ showTab(li);
+});
+
+//显示顶部导航时作位置判断,点击左边菜单、上一tab、下一tab时公用
+function showTab(li) {
+ if (li.length) {
+ var ul = $('#B_history'),
+ li_offset = li.offset(),
+ li_width = li.outerWidth(true),
+ next_left = $('#J_next').offset().left - 9, //右边按钮的界限位置
+ prev_right = $('#J_prev').offset().left + $('#J_prev').outerWidth(true); //左边按钮的界限位置
+ if (li_offset.left + li_width > next_left) { //如果将要移动的元素在不可见的右边,则需要移动
+ var distance = li_offset.left + li_width - next_left; //计算当前父元素的右边距离,算出右移多少像素
+ ul.animate({
+ left: '-=' + distance
+ }, 200, 'swing');
+ } else if (li_offset.left < prev_right) { //如果将要移动的元素在不可见的左边,则需要移动
+ var distance = prev_right - li_offset.left; //计算当前父元素的左边距离,算出左移多少像素
+ ul.animate({
+ left: '+=' + distance
+ }, 200, 'swing');
+ }
+ li.trigger('click');
+ }
+}
+
+//用于维持在线
+function online(){
+ $.get('<?php echo U("Admin/Index/index");?>');
+}
+
+//增强体验,如果支持全屏,则使用更完美的全屏方案
+/*
+Wind.use('requestFullScreen', function () {
+ if (fullScreenApi.supportsFullScreen) {
+ $('#J_fullScreen').unbind('click').one('click', function (e) {
+ e.preventDefault();
+ $('body').requestFullScreen();
+ });
+ }
+})
+*/
+</script>
+</literal>
+</body>
+</html>
\ No newline at end of file
Index: View/Index/public_find.php
===================================================================
--- View/Index/public_find.php (revision 0)
+++ View/Index/public_find.php (revision 2)
@@ -0,0 +1,46 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body>
+<div class="wrap">
+ <!--搜索开始-->
+ <div class="h_a">有关“<span class="red">{$keyword}</span>”的搜索结果</div>
+ <div class="search_list">
+ <?php
+ foreach($menuData as $k=>$v):
+ ?>
+ <h2><?php echo str_replace($keyword,"<font color=\"red\">".$keyword."</font>",$menuName[$k])?></h2>
+ <dl>
+ <?php
+ foreach($v as $id=>$men):
+ $url = $men['app']."/".$men['model']."/".$men['action'];
+ ?>
+ <dd><a class="J_search_items" href="{:U(''.$url.'',array('menuid'=>$men['id']) )}" data-id="{$men.id}{$men.app}"><?php echo str_replace($keyword,"<font color=\"red\">".$keyword."</font>",$men['name'])?></a></dd>
+ <?php
+ endforeach;
+ ?>
+ </dl>
+ <?php
+ endforeach;
+ ?>
+ </div>
+ <!--搜索结束-->
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+<script>
+$(function(){
+ $('a.J_search_items').on('click', function(e){
+ e.preventDefault();
+ var $this = $(this);
+ var data_id = $(this).attr('data-id');
+ var href = this.href;
+ parent.window.iframeJudge({
+ elem: $this,
+ href: href,
+ id: data_id
+ });
+ });
+
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Rbac/categoryrbac.php
===================================================================
--- View/Rbac/categoryrbac.php (revision 0)
+++ View/Rbac/categoryrbac.php (revision 2)
@@ -0,0 +1,61 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <form action="{:U("Rbac/setting_cat_priv")}" method="post" class="J_ajaxForm">
+ <div class="h_a">栏目权限</div>
+ <div class="table_full">
+ <table width="100%">
+ <tr>
+ <th width="50" align="center"><label>全选<input type="checkbox" onclick="select_all(0, this)"></label></th>
+ <th align="left">栏目名称</th>
+ <th width="35" align="center">查看</th>
+ <th width="35" align="center">添加</th>
+ <th width="35" align="center">修改</th>
+ <th width="35" align="center">删除</th>
+ <th width="35" align="center">排序</th>
+ <th width="35" align="center">推送</th>
+ <th width="35" align="center">移动</th>
+ </tr>
+ {$categorys}
+ </table>
+ </div>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <input type="hidden" name="roleid" value="{$roleid}" />
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+<script type="text/javascript">
+function select_all(name, obj) {
+ if (obj.checked) {
+ if (name == 0) {
+ $.each($("input[type='checkbox']"),function(i,rs){
+ if($(this).attr('disabled') != 'disabled'){
+ $(this).attr('checked', 'checked');
+ }
+ });
+ //$("input[type='checkbox']").attr('checked', 'checked');
+ } else {
+ $.each($("input[type='checkbox'][name='priv[" + name + "][]']"),function(i,rs){
+ if($(this).attr('disabled') != 'disabled'){
+ $(this).attr('checked', 'checked');
+ }
+ });
+ //$("input[type='checkbox'][name='priv[" + name + "][]']").attr('checked', 'checked');
+ }
+ } else {
+ if (name == 0) {
+ $("input[type='checkbox']").attr('checked', null);
+ } else {
+ $("input[type='checkbox'][name='priv[" + name + "][]']").attr('checked', null);
+ }
+ }
+}
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Rbac/roleedit.php
===================================================================
--- View/Rbac/roleedit.php (revision 0)
+++ View/Rbac/roleedit.php (revision 2)
@@ -0,0 +1,44 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">角色信息</div>
+ <form class="J_ajaxForm" action="{:U("Rbac/roleedit")}" method="post" id="myform">
+ <div class="table_full">
+ <table width="100%">
+ <tr>
+ <th width="100">父角色</th>
+ <td><?php echo D('Admin/Role')->selectHtmlOption($data['parentid'],'name="parentid"') ?></td>
+ </tr>
+ <tr>
+ <th width="100">角色名称</th>
+ <td><input type="text" name="name" value="{$data.name}" class="input" id="rolename">
+ </input></td>
+ </tr>
+ <tr>
+ <th>角色描述</th>
+ <td><textarea name="remark" rows="2" cols="20" id="remark" class="inputtext" style="height:100px;width:500px;">{$data.remark}</textarea></td>
+ </tr>
+ <tr>
+ <th>是否启用</th>
+ <td><input type="radio" name="status" value="1"
+ <if condition="$data['status'] eq 1">checked</if>
+ >启用
+ <label> <input type="radio" name="status" value="0"
+ <if condition="$data['status'] eq 0">checked</if>
+ >禁止</label></td>
+ </tr>
+ </table>
+ <input type="hidden" name="id" value="{$data.id}" />
+ </div>
+ <div class="">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Rbac/authorize.php
===================================================================
--- View/Rbac/authorize.php (revision 0)
+++ View/Rbac/authorize.php (revision 2)
@@ -0,0 +1,151 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">{$name} - 角色授权</div>
+ <form class="J_ajaxFsorm" action="{:U('Rbac/authorize')}" method="post">
+ <div class="table_full">
+ <ul id="treeDemo" class="ztree">
+ </ul>
+ </div>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <input type="hidden" name="roleid" value="{$roleid}" />
+ <input type="hidden" name="menuid" value="" />
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">授权</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<script type="text/javascript">
+//配置
+var setting = {
+ check: {
+ enable: true,
+ chkboxType:{ "Y" : "ps", "N" : "ps" }
+ },
+ data: {
+ simpleData: {
+ enable: true,
+ idKey: "id",
+ pIdKey: "parentid",
+ }
+ },
+ callback: {
+ beforeClick: function (treeId, treeNode) {
+ if (treeNode.isParent) {
+ zTree.expandNode(treeNode);
+ return false;
+ } else {
+ return true;
+ }
+ },
+ onClick:function(event, treeId, treeNode){
+ //栏目ID
+ var catid = treeNode.catid;
+ //保存当前点击的栏目ID
+ setCookie('tree_catid',catid,1);
+ }
+ }
+};
+//节点数据
+var zNodes ={$json};
+//zTree对象
+var zTree = null;
+Wind.css('zTree');
+$(function(){
+ Wind.use('cookie','zTree', function(){
+ $.fn.zTree.init($("#treeDemo"), setting, zNodes);
+ zTree = $.fn.zTree.getZTreeObj("treeDemo");
+ zTree.expandAll(true);
+ });
+});
+
+
+var ajaxForm_list = $('form.J_ajaxFsorm');
+if (ajaxForm_list.length) {
+ Wind.use('ajaxForm', 'artDialog', function () {
+ if ($.browser.msie) {
+ //ie8及以下,表单中只有一个可见的input:text时,会整个页面会跳转提交
+ ajaxForm_list.on('submit', function (e) {
+ //表单中只有一个可见的input:text时,enter提交无效
+ e.preventDefault();
+ });
+ }
+
+ $('button.J_ajax_submit_btn').bind('click', function (e) {
+ e.preventDefault();
+ /*var btn = $(this).find('button.J_ajax_submit_btn'),
+ form = $(this);*/
+ var btn = $(this),
+ form = btn.parents('form.J_ajaxFsorm');
+
+ //ie处理placeholder提交问题
+ if ($.browser.msie) {
+ form.find('[placeholder]').each(function () {
+ var input = $(this);
+ if (input.val() == input.attr('placeholder')) {
+ input.val('');
+ }
+ });
+ }
+
+ //处理被选中的数据
+ form.find('input[name="menuid"]').val("");
+ var nodes = zTree.getCheckedNodes(true);
+ var str = "";
+ $.each(nodes,function(i,value){
+ if (str != "") {
+ str += ",";
+ }
+ str += value.id;
+ });
+ form.find('input[name="menuid"]').val(str);
+
+ form.ajaxSubmit({
+ url: btn.data('action') ? btn.data('action') : form.attr('action'),
+ //按钮上是否自定义提交地址(多按钮情况)
+ dataType: 'json',
+ beforeSubmit: function (arr, $form, options) {
+ var text = btn.text();
+
+ //按钮文案、状态修改
+ btn.text(text + '中...').attr('disabled', true).addClass('disabled');
+ },
+ success: function (data, statusText, xhr, $form) {
+ var text = btn.text();
+ //按钮文案、状态修改
+ btn.removeClass('disabled').text(text.replace('中...', '')).parent().find('span').remove();
+ if (data.state === 'success') {
+ $('<span class="tips_success">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('slow').delay(1000).fadeOut(function () {
+ if (data.url) {
+ //返回带跳转地址
+ if (window.parent.art) {
+ //iframe弹出页
+ window.parent.location.href = data.url;
+ } else {
+ window.location.href = data.url;
+ }
+ } else {
+ if (window.parent.art) {
+ reloadPage(window.parent);
+ } else {
+ //刷新当前页
+ reloadPage(window);
+ }
+ }
+ });
+ } else if (data.state === 'fail') {
+ $('<span class="tips_error">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('fast');
+ btn.removeProp('disabled').removeClass('disabled');
+ }
+ }
+ });
+ });
+ });
+}
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Rbac/roleadd.php
===================================================================
--- View/Rbac/roleadd.php (revision 0)
+++ View/Rbac/roleadd.php (revision 2)
@@ -0,0 +1,39 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">角色信息</div>
+ <form class="J_ajaxForm" action="{:U("Rbac/roleadd")}" method="post" id="myform">
+ <div class="table_full">
+ <table width="100%">
+ <tr>
+ <th width="100">父角色</th>
+ <td><?php echo D('Admin/Role')->selectHtmlOption(0,'name="parentid"') ?></td>
+ </tr>
+ <tr>
+ <th width="100">角色名称</th>
+ <td><input type="text" name="name" value="{$data.name}" class="input" id="rolename"></input></td>
+ </tr>
+ <tr>
+ <th>角色描述</th>
+ <td><textarea name="remark" rows="2" cols="20" id="remark" class="inputtext" style="height:100px;width:500px;">{$data.remark}</textarea></td>
+ </tr>
+ <tr>
+ <th>是否启用</th>
+ <td><input type="radio" name="status" value="1" <if condition="$data['status'] eq 1">checked</if>>启用<label> <input type="radio" name="status" value="0" <if condition="$data['status'] eq 0">checked</if>>禁止</label></td>
+ </tr>
+ </table>
+ <input type="hidden" name="id" value="{$data.id}" />
+
+ </div>
+ <div class="">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Rbac/rolemanage.php
===================================================================
--- View/Rbac/rolemanage.php (revision 0)
+++ View/Rbac/rolemanage.php (revision 2)
@@ -0,0 +1,27 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body>
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="table_list">
+ <form name="myform" action="{:U("Rbac/listorders")}" method="post">
+ <table width="100%" cellspacing="0">
+ <thead>
+ <tr>
+ <td width="20">ID</td>
+ <td>角色名称</td>
+ <td width="200" align='center'>角色描述</td>
+ <td width="50" align='center'>状态</td>
+ <td width="250" align='center'>管理操作</td>
+ </tr>
+ </thead>
+ <tbody>
+ {$role}
+ </tbody>
+ </table>
+ </form>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Management/adminadd.php
===================================================================
--- View/Management/adminadd.php (revision 0)
+++ View/Management/adminadd.php (revision 2)
@@ -0,0 +1,62 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <form class="J_ajaxForm" action="{:U('Management/adminadd')}" method="post" id="myform">
+ <div class="h_a">基本属性</div>
+ <div class="table_full">
+ <table width="100%" class="table_form contentWrap">
+ <tbody>
+ <tr>
+ <th width="80">用户名</th>
+ <td><input type="test" name="username" class="input" id="username">
+ <span class="gray">请输入用户名</span></td>
+ </tr>
+ <tr>
+ <th>密码</th>
+ <td><input type="password" name="password" class="input" id="password" value="">
+ <span class="gray">请输入密码</span></td>
+ </tr>
+ <tr>
+ <th>确认密码</th>
+ <td><input type="password" name="pwdconfirm" class="input" id="pwdconfirm" value="">
+ <span class="gray">请输入确认密码</span></td>
+ </tr>
+ <tr>
+ <th>E-mail</th>
+ <td><input type="text" name="email" value="" class="input" id="email" size="30">
+ <span class="gray">请输入E-mail</span></td>
+ </tr>
+ <tr>
+ <th>真实姓名</th>
+ <td><input type="text" name="nickname" value="" class="input" id="realname"></td>
+ </tr>
+ <tr>
+ <th>备注</th>
+ <td><textarea name="remark" rows="2" cols="20" id="remark" class="inputtext" style="height:100px;width:500px;"></textarea></td>
+ </tr>
+ <tr>
+ <th>所属角色</th>
+ <td>{$role}</td>
+ </tr>
+ <tr>
+ <th>状态</td>
+ <td><select name="status">
+ <option value="1">开启</option>
+ <option value="0" selected>禁止</option>
+ </select></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">添加</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Management/edit.php
===================================================================
--- View/Management/edit.php (revision 0)
+++ View/Management/edit.php (revision 2)
@@ -0,0 +1,63 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <form class="J_ajaxForm" action="{:U('Management/edit')}" method="post" id="myform">
+ <input type="hidden" name="id" value="{$data.id}"/>
+ <div class="h_a">基本属性</div>
+ <div class="table_full">
+ <table width="100%" class="table_form contentWrap">
+ <tbody>
+ <tr>
+ <th width="80">用户名</th>
+ <td><input type="test" name="username" class="input" id="username" value="{$data.username}">
+ <span class="gray">请输入用户名</span></td>
+ </tr>
+ <tr>
+ <th>密码</th>
+ <td><input type="password" name="password" class="input" id="password" value="">
+ <span class="gray">请输入密码</span></td>
+ </tr>
+ <tr>
+ <th>确认密码</th>
+ <td><input type="password" name="pwdconfirm" class="input" id="pwdconfirm" value="">
+ <span class="gray">请输入确认密码</span></td>
+ </tr>
+ <tr>
+ <th>E-mail</th>
+ <td><input type="text" name="email" value="{$data.email}" class="input" id="email" size="30">
+ <span class="gray">请输入E-mail</span></td>
+ </tr>
+ <tr>
+ <th>真实姓名</th>
+ <td><input type="text" name="nickname" value="{$data.nickname}" class="input" id="realname"></td>
+ </tr>
+ <tr>
+ <th>备注</th>
+ <td><textarea name="remark" rows="2" cols="20" id="remark" class="inputtext" style="height:100px;width:500px;">{$data.remark}</textarea></td>
+ </tr>
+ <tr>
+ <th>所属角色</th>
+ <td>{$role}</td>
+ </tr>
+ <tr>
+ <th>状态</td>
+ <td><select name="status">
+ <option value="1" <if condition="$data['status'] eq 1 ">selected</if>>开启</option>
+ <option value="0" <if condition="$data['status'] eq 0 ">selected</if>>禁止</option>
+ </select></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">修改</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Management/manager.php
===================================================================
--- View/Management/manager.php (revision 0)
+++ View/Management/manager.php (revision 2)
@@ -0,0 +1,56 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="table_list">
+ <table width="100%" cellspacing="0">
+ <thead>
+ <tr>
+ <td width="10%">序号</td>
+ <td width="10%" align="left" >用户名</td>
+ <td width="10%" align="left" >所属角色</td>
+ <td width="10%" align="left" >最后登录IP</td>
+ <td width="10%" align="left" >最后登录时间</td>
+ <td width="15%" align="left" >E-mail</td>
+ <td width="20%">备注</td>
+ <td width="15%" align="center">管理操作</td>
+ </tr>
+ </thead>
+ <tbody>
+ <foreach name="Userlist" item="vo">
+ <tr>
+ <td width="10%" align="center">{$vo.id}</td>
+ <td width="10%" >{$vo.username}</td>
+ <td width="10%" ><?php echo D('Admin/Role')->getRoleIdName($vo['role_id'])?></td>
+ <td width="10%" >{$vo.last_login_ip}</td>
+ <td width="10%" >
+ <if condition="$vo['last_login_time'] eq 0">
+ 该用户还没登陆过
+ <else />
+ {$vo.last_login_time|date="Y-m-d H:i:s",###}
+ </if>
+ </td>
+ <td width="15%">{$vo.email}</td>
+ <td width="20%">{$vo.remark}</td>
+ <td width="15%" align="center">
+ <if condition="$User['username'] eq $vo['username']">
+ <font color="#cccccc">修改</font> |
+ <font color="#cccccc">删除</font>
+ <else />
+ <a href="{:U("Management/edit",array("id"=>$vo[id]))}">修改</a> |
+ <a class="J_ajax_del" href="{:U('Management/delete',array('id'=>$vo['id']))}">删除</a>
+ </if>
+ </td>
+ </tr>
+ </foreach>
+ </tbody>
+ </table>
+ <div class="p10">
+ <div class="pages"> {$Page} </div>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+</body>
+</html>
\ No newline at end of file
Index: View/Public/login.php
===================================================================
--- View/Public/login.php (revision 0)
+++ View/Public/login.php (revision 2)
@@ -0,0 +1,237 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<!doctype html>
+<html>
+<head>
+<meta http-equiv="X-UA-Compatible" content="edge" />
+<meta charset="utf-8" />
+<title>系统后台 - {$Config.sitename} - by ShuipFCMS</title>
+<meta name="generator" content="ThinkPHP Shuipf" />
+<admintemplate file="Admin/Common/Js"/>
+<style type="text/css">
+ html{font-size:62.5%;font-family:Tahoma}
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td,hr{margin:0;padding:0}
+body{line-height:1.333;font-size:12px;font-size:1.2rem}
+h1,h2,h3,h4,h5,h6{font-size:100%}
+input,textarea,select,button{font-size:12px;font-weight:normal}
+input[type="button"],input[type="submit"],select,button{cursor:pointer}
+table{border-collapse:collapse;border-spacing:0}
+address,caption,cite,code,dfn,em,th,var{font-style:normal;font-weight:normal}
+li{list-style:none}
+caption,th{text-align:left}
+q:before,q:after{content:''}
+abbr,acronym{border:0;font-variant:normal}
+sup{vertical-align:text-top}
+sub{vertical-align:text-bottom}
+fieldset,img,a img,iframe{border-width:0;border-style:none}
+iframe{overflow:hidden}
+img{ -ms-interpolation-mode:bicubic;}
+textarea{overflow-y:auto}
+legend{color:#000}
+a:link,a:visited{text-decoration:none}
+hr{height:0}
+label{cursor:pointer}
+.os_winXp{font-family:Tahoma}
+.os_mac{font-family:"Helvetica Neue",Helvetica,"Hiragino Sans GB",Arial}
+.os_vista,.os_win7{font-family:"Microsoft Yahei",Tahoma}
+.clearfix:before,.clearfix:after{content:".";display:block;height:0;visibility:hidden}
+.clearfix:after{clear:both}
+.clearfix{zoom:1}
+.header,nav,.footer{display:block}
+body{background-color:#f0f0f0}
+.wrap{background-color:#f5f5f5}
+.wrap .inner{width:1000px;margin:0 auto}
+iframe{background-color:transparent}
+.header{padding:19px 0 0 100px}
+.header h1{ /*background-image:url({$config_siteurl}statics/images/logo.gif);background-repeat:no-repeat;*/width:227px;height:78px;line-height:150px;overflow:hidden;font-size:0}
+.qzone_login{margin-top:55px}
+.qzone_login .qzone_cont{float:left;margin-left:112px;position:relative;width:429px;_display:inline;overflow:hidden;height:321px}
+.qzone_cont .img_list{width:429px;height:321px}
+.qzone_cont .img_list li{width:429px;height:321px;vertical-align:middle;display:table-cell}
+.qzone_cont .img_list .img_link{display:block;width:429px;text-align:center;height:321px;outline:none;overflow:hidden}
+.qzone_cont .scroll_img_box{margin:40px auto 0;height:16px;float:left}
+.qzone_cont .scroll_img{text-align:center;width:429px}
+.qzone_cont .scroll_img li{ width:10px;height:10px;background-image:url({$config_siteurl}statics/images/qzone_login.png);background-position:-663px 0;background-repeat:no-repeat;display:inline-block;margin-right:15px;cursor:pointer;*display:inline;*zoom:1;overflow:hidden}
+.qzone_cont .scroll_img .current_img{ background-image:url({$config_siteurl}statics/images/admin_img/qzone_login.png);background-position:-663px -17px}
+.qzone_login .login_main{margin:10px 0 0 68px;float:left;_display:inline;width:370px;overflow:hidden}
+.qzone_login .login_main a{color:#3da5dc}
+.login_main .login_list .input_txt{border:1px solid #d9d9d9;border-radius:3px;font-size:16px;font-family:"Microsoft Yahei",Tahoma;height:23px;width:259px;color:#666;padding:14px 0 14px 9px;margin-bottom:20px}
+.login_main .login_list .input_txt:focus{outline:0}
+.login_main .login_list .current_input{border-color:#56bdf3;box-shadow:inset 0 1px 3px rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 3px rgba(0,0,0,.2)}
+.login_main .login_list .login_input{position:relative;width:270px;height:73px}
+.login_main .login_list .txt_default{position:absolute;font-size:16px;font-family:"Microsoft Yahei",Tahoma;color:#666;top:17px;left:10px;cursor:text}
+.login_main .login_list .txt_click{color:#ccc}
+.login_main .login_list .yanzhengma{position:relative;color:#666}
+.login_main .login_list .yanzhengma .yanzheng_txt{margin-left:2px}
+.login_main .login_list .yanzhengma .input_txt{width:139px;margin-bottom:40px}
+.login_main .login_list .yanzhengma .yanzhengma_box{position:absolute;left:160px;top:0}
+.login_main .login_list .yanzhengma .yanzheng_img{display:block;margin-bottom:10px}
+.login_main .login_btn{ width:148px;height:48px;line-height:150px;overflow:hidden;font-size:0;*background:none;background-image:url({$config_siteurl}statics/images/qzone_login.png);background-position:-514px 0;border:none;cursor:pointer}
+.qzone_login .login_main nav{color:#d0d3d7;margin:20px 0 0 3px}
+.qzone_login .login_main nav .sep{margin:0 12px}
+.login_main .quick_login{color:#5a5b5b}
+.login_main .wrong_notice{color:red;margin:0 0 10px 1px}
+.login_main .login_change{margin:6px 0 0 3px}
+.platform_box{margin:94px 0 0 0;width:1000px;padding-bottom:16px}
+.platform_box nav{ background-image:url({$config_siteurl}statics/images/qzone_login.png);background-position:0 0;background-repeat:no-repeat;width:370px;height:52px;margin:0 auto}
+.platform_box nav .platform_link{width:86px;margin:0 1px;height:52px;line-height:160px;overflow:hidden;display:inline-block;font-size:0;*margin-top:-64px}
+.footer{ background:#f0f0f0 url({$config_siteurl}statics/images/ft_bg.jpg) repeat-x;color:#999}
+.footer .inner{width:1000px;margin:0 auto;text-align:center;padding:45px 0}
+.footer .links{margin-bottom:15px}
+.footer .links .sep{margin:0 12px;color:#d0d3d7}
+.footer .copyright{width:580px;margin:0 auto}
+.footer .copyright_en{float:left;margin-right:15px}
+.footer .copyright_ch{float:left}
+.footer .copyright_ch .copyright_link{margin-left:5px}
+.wrap {
+ overflow:hidden;
+ -webkit-animation: bounceIn 600ms linear;
+ -moz-animation: bounceIn 600ms linear;
+ -o-animation: bounceIn 600ms linear;
+ animation: bounceIn 600ms linear;
+}
+/*登录框动画*/
+@-webkit-keyframes bounceIn {
+ 0% {
+ opacity: 0;
+ -webkit-transform: scale(.3);
+ }
+
+ 50% {
+ opacity: 1;
+ -webkit-transform: scale(1.05);
+ }
+
+ 70% {
+ -webkit-transform: scale(.9);
+ }
+
+ 100% {
+ -webkit-transform: scale(1);
+ }
+}
+@-moz-keyframes bounceIn {
+ 0% {
+ opacity: 0;
+ -moz-transform: scale(.3);
+ }
+
+ 50% {
+ opacity: 1;
+ -moz-transform: scale(1.05);
+ }
+
+ 70% {
+ -moz-transform: scale(.9);
+ }
+
+ 100% {
+ -moz-transform: scale(1);
+ }
+}
+@-o-keyframes bounceIn {
+ 0% {
+ opacity: 0;
+ -o-transform: scale(.3);
+ }
+
+ 50% {
+ opacity: 1;
+ -o-transform: scale(1.05);
+ }
+
+ 70% {
+ -o-transform: scale(.9);
+ }
+
+ 100% {
+ -o-transform: scale(1);
+ }
+}
+@keyframes bounceIn {
+ 0% {
+ opacity: 0;
+ transform: scale(.3);
+ }
+
+ 50% {
+ opacity: 1;
+ transform: scale(1.05);
+ }
+
+ 70% {
+ transform: scale(.9);
+ }
+
+ 100% {
+ transform: scale(1);
+ }
+}
+</style>
+<script type="text/javascript">
+if (window.parent !== window.self) {
+ document.write = '';
+ window.parent.location.href = window.self.location.href;
+ setTimeout(function () {
+ document.body.innerHTML = '';
+ }, 0);
+}
+</script>
+</head>
+<body>
+<div class="wrap">
+ <div class="inner">
+ <div class="header">
+ <h1>{$Config.sitename}</h1>
+ </div>
+ <div class="qzone_login clearfix">
+ <div class="qzone_cont" id="_pt">
+ <li><img src="{$config_siteurl}statics/images/login_bg.jpg" alt="生活以快乐为基准,爱情以互惠为原则!"></li>
+ </div>
+ <!-- end qzone_cont -->
+ <div class="login_main">
+ <p class="wrong_notice" id="err_m" style="display:none;"></p>
+ <form id="loginform" method="post" name="loginform" action="{:U('Public/tologin')}" >
+ <ul class="login_list" id="web_login">
+ <li class="login_input">
+ <input value="" id="u" name="username" class="input_txt" tabindex="1" type="text" value="" placeholder="帐号名" title="帐号名" />
+ </li>
+ <li class="login_input">
+ <input maxlength=16 type="password" id="p" name="password" tabindex="2" class="input_txt" type="text" value="" placeholder="密码" title="密码"/>
+ </li>
+ <li class="yanzhengma clearfix" id="verifytip"> <span id="verifyinput">
+ <input id="verifycode" name="code" maxlength=5 tabindex="3" class="input_txt" type="text" value="" placeholder="请输入验证码" />
+ </span>
+ <div class="yanzhengma_box" id="verifyshow"> <img class="yanzheng_img" id="code_img" alt="" src="{:U('Api/Checkcode/index','code_len=4&font_size=20&width=130&height=50&font_color=&background=')}"><a href="javascript:;;" onClick="refreshs()" class="change_img">看不清,换一张</a> </div>
+ </li>
+ <li>
+ <button type="submit" class="login_btn" tabindex="4" id="subbtn">登录</button>
+ </li>
+ </ul>
+ </form>
+ <div class="quick_login" id="qlogin"> </div>
+ </div>
+ </div>
+ <div class="platform_box"> </div>
+ </div>
+</div>
+<div class="footer">
+ <div class="inner">
+ <div class="copyright clearfix">
+ <p class="copyright_en">Copyright © {:date('Y')} , futeng All Rights Reserved.</p>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<script>
+//刷新广告
+function refreshs(){
+ document.getElementById('code_img').src='{:U('Api/Checkcode/index','code_len=4&font_size=20&width=130&height=50&font_color=&background=&refresh=1')}&time='+Math.random();void(0);
+}
+$(function(){
+ $('#verifycode').focus(function(){
+ $('a.change_img').trigger("click");
+ });
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Public/changyong.php
===================================================================
--- View/Public/changyong.php (revision 0)
+++ View/Public/changyong.php (revision 2)
@@ -0,0 +1,150 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body class="J_scroll_fixed">
+<div class="wrap J_check_wrap">
+ <div class="h_a">常用菜单</div>
+ <form class="J_ajaxFsorm" action="{:U('Public/changyong')}" method="post">
+ <div class="table_full">
+ <ul id="treeDemo" class="ztree">
+ </ul>
+ </div>
+ <div class="btn_wrap">
+ <div class="btn_wrap_pd">
+ <input type="hidden" name="roleid" value="{$roleid}" />
+ <input type="hidden" name="menuid" value="" />
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">添加</button>
+ </div>
+ </div>
+ </form>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<script type="text/javascript">
+//配置
+var setting = {
+ check: {
+ enable: true,
+ chkboxType:{ "Y" : "", "N" : "" }
+ },
+ data: {
+ simpleData: {
+ enable: true,
+ idKey: "id",
+ pIdKey: "parentid",
+ }
+ },
+ callback: {
+ beforeClick: function (treeId, treeNode) {
+ if (treeNode.isParent) {
+ zTree.expandNode(treeNode);
+ return false;
+ } else {
+ return true;
+ }
+ },
+ onClick:function(event, treeId, treeNode){
+ //栏目ID
+ var catid = treeNode.catid;
+ //保存当前点击的栏目ID
+ setCookie('tree_catid',catid,1);
+ }
+ }
+};
+//节点数据
+var zNodes ={$json};
+//zTree对象
+var zTree = null;
+Wind.css('zTree');
+$(function(){
+ Wind.use('cookie','zTree', function(){
+ $.fn.zTree.init($("#treeDemo"), setting, zNodes);
+ zTree = $.fn.zTree.getZTreeObj("treeDemo");
+ zTree.expandAll(true);
+ });
+});
+
+
+var ajaxForm_list = $('form.J_ajaxFsorm');
+if (ajaxForm_list.length) {
+ Wind.use('ajaxForm', 'artDialog', function () {
+ if ($.browser.msie) {
+ //ie8及以下,表单中只有一个可见的input:text时,会整个页面会跳转提交
+ ajaxForm_list.on('submit', function (e) {
+ //表单中只有一个可见的input:text时,enter提交无效
+ e.preventDefault();
+ });
+ }
+
+ $('button.J_ajax_submit_btn').bind('click', function (e) {
+ e.preventDefault();
+ /*var btn = $(this).find('button.J_ajax_submit_btn'),
+ form = $(this);*/
+ var btn = $(this),
+ form = btn.parents('form.J_ajaxFsorm');
+
+ //ie处理placeholder提交问题
+ if ($.browser.msie) {
+ form.find('[placeholder]').each(function () {
+ var input = $(this);
+ if (input.val() == input.attr('placeholder')) {
+ input.val('');
+ }
+ });
+ }
+
+ //处理被选中的数据
+ form.find('input[name="menuid"]').val("");
+ var nodes = zTree.getCheckedNodes(true);
+ var str = "";
+ $.each(nodes,function(i,value){
+ if (str != "") {
+ str += ",";
+ }
+ str += value.id;
+ });
+ form.find('input[name="menuid"]').val(str);
+
+ form.ajaxSubmit({
+ url: btn.data('action') ? btn.data('action') : form.attr('action'),
+ //按钮上是否自定义提交地址(多按钮情况)
+ dataType: 'json',
+ beforeSubmit: function (arr, $form, options) {
+ var text = btn.text();
+
+ //按钮文案、状态修改
+ btn.text(text + '中...').attr('disabled', true).addClass('disabled');
+ },
+ success: function (data, statusText, xhr, $form) {
+ var text = btn.text();
+ //按钮文案、状态修改
+ btn.removeClass('disabled').text(text.replace('中...', '')).parent().find('span').remove();
+ if (data.state === 'success') {
+ $('<span class="tips_success">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('slow').delay(1000).fadeOut(function () {
+ if (data.url) {
+ //返回带跳转地址
+ if (window.parent.art) {
+ //iframe弹出页
+ window.parent.location.href = data.url;
+ } else {
+ window.location.href = data.url;
+ }
+ } else {
+ if (window.parent.art) {
+ reloadPage(window.parent);
+ } else {
+ //刷新当前页
+ reloadPage(window);
+ }
+ }
+ });
+ } else if (data.state === 'fail') {
+ $('<span class="tips_error">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('fast');
+ btn.removeProp('disabled').removeClass('disabled');
+ }
+ }
+ });
+ });
+ });
+}
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Addonshop/ajax.php
===================================================================
--- View/Addonshop/ajax.php (revision 0)
+++ View/Addonshop/ajax.php (revision 2)
@@ -0,0 +1,44 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+ <div class="table_list">
+ <table width="100%">
+ <thead>
+ <tr>
+ <td width="200">名称</td>
+ <td width="100">标识</td>
+ <td align="center">描述</td>
+ <td align="center" width="100">作者</td>
+ <td align="center" width="50">版本</td>
+ <td align="center" width="227">操作</td>
+ </tr>
+ </thead>
+ <volist name="data" id="vo">
+ <tr>
+ <td><if condition=" $vo['url'] "><a href="{$vo.url}" target="_blank">{$vo.title}</a><else/>{$vo.title}</if></td>
+ <td>{$vo.name}</td>
+ <td>{$vo.description}</td>
+ <td align="center">{$vo.author}</td>
+ <td align="center">{$vo.version}</td>
+ <td align="center">
+ <?php
+ $op = array();
+ if(!D('Addons/Addons')->isInstall($vo['name'])){
+ $op[] = '<a href="'.U('install',array('sign'=>$vo['sign']?:$vo['name'])).'" class="btn btn_submit mr5 Js_install">安装</a>';
+ }else{
+ //有安装,检测升级
+ if($vo['upgrade']){
+ $op[] = '<a href="'.U('upgrade',array('sign'=>$vo['sign']?:$vo['name'])).'" class="btn btn_submit mr5 Js_upgrade" id="upgrade_tips_'.$vo['name'].'">升级到最新'.$vo['newVersion'].'</a>';
+ }
+ }
+ echo implode(' ',$op);
+ if($vo['price']){
+ echo "<br /><font color=\"#FF0000\">价格:".$vo['price']." 元</font>";
+ }
+ ?>
+ </td>
+ </tr>
+ </volist>
+ </table>
+ </div>
+ <div class="p10">
+ <div class="pages">{$Page}</div>
+ </div>
\ No newline at end of file
Index: View/Addonshop/install.php
===================================================================
--- View/Addonshop/install.php (revision 0)
+++ View/Addonshop/install.php (revision 2)
@@ -0,0 +1,83 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<style>
+.logs li { line-height:25px;}
+</style>
+<body>
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">使用说明</div>
+ <div class="prompt_text" id="explanation">
+ <div class="loading">loading...</div>
+ </div>
+ <div class="h_a">在线安装日志</div>
+ <div class="prompt_text logs" id="record">
+ <ul>
+ </ul>
+ </div>
+ <div class="loading" style="display:none;">loading...</div>
+ <div class="btn_wrap1">
+ <div class="btn_wrap_pd">
+ <input type="hidden" name="id" value="53">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit" id="cloud_button" style="display:none">完成安装</button>
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit" id="cloud_start">开始安装</button>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<script>
+//请求
+function getStep(url){
+ $.getJSON(url,function(data){
+ if(data.status){
+ $('#record ul').append('<li>'+data.info+'</li>');
+ if(data.url){
+ step(data.url);
+ }else{
+ $('#cloud_button').html('完成安装');
+ $('div.loading').hide();
+ $('button.J_ajax_submit_btn').click(function(){
+ window.location.href = '{:U("index")}';
+ });
+ $('#cloud_button').show();
+ $('#record ul').append('<li>安装结束!</li>');
+ }
+ }else{
+ $('#record ul').append('<li style="color:#F00">'+data.info+'</li>');
+ $('#cloud_button').html('重新安装');
+ $('div.loading').hide();
+ $('button.J_ajax_submit_btn').click(function(){
+ location.reload();
+ });
+ $('#cloud_button').show();
+ }
+ });
+}
+//获取使用说明
+function getExplanation(sign){
+ $('#record ul').append('<li>获取插件安装使用说明....</li>');
+ $.getJSON('{:U("public_explanation")}',{ sign:sign },function(data){
+ if(data.status){
+ $('#record ul').append('<li>获取插件安装使用说明成功....</li>');
+ $('#explanation').html(data.data);
+ }else{
+ $('#explanation').html('<p>暂无说明</p>');
+ }
+ });
+}
+function step(url){
+ $('div.loading').show();
+ getStep(url);
+}
+$(function(){
+ getExplanation('{$sign}');
+ $('#cloud_start').click(function(){
+ $(this).hide();
+ $('#record ul').append('<li>开始执行安装....</li>');
+ $('#record ul').append('<li>开始检查目录权限和下载安装包....</li>');
+ step('{$stepUrl}');
+ });
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Addonshop/index.php
===================================================================
--- View/Addonshop/index.php (revision 0)
+++ View/Addonshop/index.php (revision 2)
@@ -0,0 +1,37 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body>
+<div class="wrap J_check_wrap" id="loadhtml">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">说明</div>
+ <div class="prompt_text">
+ <ul>
+ <li>插件管理可以很好的扩展网站运营中所需功能!</li>
+ <li><font color="#FF0000">获取更多插件请到官方网站插件扩展中下载安装!安装非官方发表插件需谨慎,有被清空数据库的危险!</font></li>
+ <li>官网地址:<font color="#FF0000">http://www.shuipfcms.com</font>,<a href="http://www.shuipfcms.com" target="_blank">立即前往</a>!</li>
+ </ul>
+ </div>
+ <div class="h_a">搜索</div>
+ <div class="search_type mb10">
+ <form action="{:U('index')}" method="post">
+ <div class="mb10">
+ <div class="mb10"> <span class="mr20"> 插件名称:
+ <input type="text" class="input length_2" name="keyword" style="width:200px;" value="{$keyword}" placeholder="请输入关键字...">
+ <button class="btn">搜索</button>
+ </span> </div>
+ </div>
+ </form>
+ </div>
+ <div class="loading">loading...</div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<script>
+$(function(){
+ $.get('{:U("index")}',{ page:'{$page}',keyword:'{$keyword}',r:Math.random() },function(data){
+ $('#loadhtml').append(data);
+ $('div.loading').hide();
+ });
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Addonshop/upgrade.php
===================================================================
--- View/Addonshop/upgrade.php (revision 0)
+++ View/Addonshop/upgrade.php (revision 2)
@@ -0,0 +1,61 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<style>
+.logs li { line-height:25px;}
+</style>
+<body>
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">在线升级</div>
+ <div class="prompt_text logs" id="record">
+ <ul>
+ <li>开始执行升级....</li>
+ <li>开始检查目录权限和下载升级包....</li>
+ </ul>
+ </div>
+ <div class="loading">loading...</div>
+ <div class="btn_wrap1" style="display:none">
+ <div class="btn_wrap_pd">
+ <input type="hidden" name="id" value="53">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit" id="cloud_button">完成升级</button>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<script>
+//请求
+function getStep(url){
+ $.getJSON(url,function(data){
+ if(data.status){
+ $('#record ul').append('<li>'+data.info+'</li>');
+ if(data.url){
+ step(data.url);
+ }else{
+ $('#cloud_button').html('完成升级');
+ $('div.loading').hide();
+ $('button.J_ajax_submit_btn').click(function(){
+ window.location.href = '{:U("index")}';
+ });
+ $('.btn_wrap1').show();
+ $('#record ul').append('<li>升级结束!</li>');
+ }
+ }else{
+ $('#record ul').append('<li style="color:#F00">'+data.info+'</li>');
+ $('div.loading').hide();
+ $('#cloud_button').html('重新升级');
+ $('button.J_ajax_submit_btn').click(function(){
+ location.reload();
+ });
+ $('.btn_wrap1').show();
+ }
+ });
+}
+function step(url){
+ getStep(url);
+}
+$(function(){
+ step('{$stepUrl}');
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Moduleshop/ajax.php
===================================================================
--- View/Moduleshop/ajax.php (revision 0)
+++ View/Moduleshop/ajax.php (revision 2)
@@ -0,0 +1,56 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+ <div class="table_list">
+ <table width="100%">
+ <colgroup>
+ <col width="90">
+ <col>
+ <col width="160">
+ </colgroup>
+ <thead>
+ <tr>
+ <td align="center">应用图标</td>
+ <td>应用介绍</td>
+ <td align="center">操作</td>
+ </tr>
+ </thead>
+ <volist name="data" id="vo">
+ <tr>
+ <td>
+ <div class="app_icon">
+ <if condition=" $vo['icon'] ">
+ <img src="{$vo.icon}" alt="{$vo.modulename}" width="80" height="80">
+ <else/>
+ <img src="{$config_siteurl}statics/images/modul.png" alt="{$vo.modulename}" width="80" height="80">
+ </if>
+ </div>
+ </td>
+ <td valign="top">
+ <h3 class="mb5 f12"><if condition=" $vo['address'] "><a target="_blank" href="{$vo.address}">{$vo.modulename}</a><else />{$vo.modulename}</if></h3>
+ <div class="mb5"> <span class="mr15">版本:<b>{$vo.version}</b></span> <span>开发者:<if condition=" $vo['author'] "><a target="_blank" href="{$vo.authorsite}">{$vo.author}</a><else />匿名开发者</if></span> <span>适配 ShuipFCMS 最低版本:<if condition=" $vo['adaptation'] ">{$vo.adaptation}<else /><font color="#FF0000">没有标注,可能存在兼容风险</font></if></span> </div>
+ <div class="gray"><if condition=" $vo['introduce'] ">{$vo.introduce}<else />没有任何介绍</if></div>
+ <div> <span class="mr20"><a href="{$vo.authorsite}" target="_blank">{$vo.authorsite}</a></span> </div>
+ </td>
+ <td align="center">
+ <?php
+ $op = array();
+ if(!isModuleInstall($vo['module'])){
+ $op[] = '<a href="'.U('install',array('sign'=>$vo['sign'])).'" class="btn btn_submit mr5 Js_install">安装</a>';
+ }else{
+ //有安装,检测升级
+ if($vo['upgrade']){
+ $op[] = '<a href="'.U('upgrade',array('sign'=>$vo['sign'])).'" class="btn btn_submit mr5 Js_upgrade" id="upgrade_tips_'.$vo['sign'].'">升级到最新'.$vo['newVersion'].'</a>';
+ }
+ }
+ echo implode(' ',$op);
+ if($vo['price']){
+ echo "<br /><font color=\"#FF0000\">价格:".$vo['price']." 元</font>";
+ }
+ ?>
+ </td>
+ </tr>
+ </volist>
+ </table>
+ </div>
+ <div class="p10">
+ <div class="pages">{$Page}</div>
+ </div>
\ No newline at end of file
Index: View/Moduleshop/install.php
===================================================================
--- View/Moduleshop/install.php (revision 0)
+++ View/Moduleshop/install.php (revision 2)
@@ -0,0 +1,83 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<style>
+.logs li { line-height:25px;}
+</style>
+<body>
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">使用说明</div>
+ <div class="prompt_text" id="explanation">
+ <div class="loading">loading...</div>
+ </div>
+ <div class="h_a">在线安装日志</div>
+ <div class="prompt_text logs" id="record">
+ <ul>
+ </ul>
+ </div>
+ <div class="loading" style="display:none;">loading...</div>
+ <div class="btn_wrap1">
+ <div class="btn_wrap_pd">
+ <input type="hidden" name="id" value="53">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit" id="cloud_button" style="display:none">完成安装</button>
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit" id="cloud_start">开始安装</button>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<script>
+//请求
+function getStep(url){
+ $.getJSON(url,function(data){
+ if(data.status){
+ $('#record ul').append('<li>'+data.info+'</li>');
+ if(data.url){
+ step(data.url);
+ }else{
+ $('#cloud_button').html('完成安装');
+ $('div.loading').hide();
+ $('button.J_ajax_submit_btn').click(function(){
+ window.location.href = '{:U("index")}';
+ });
+ $('#cloud_button').show();
+ $('#record ul').append('<li>安装结束!</li>');
+ }
+ }else{
+ $('#record ul').append('<li style="color:#F00">'+data.info+'</li>');
+ $('div.loading').hide();
+ $('#cloud_button').html('重新安装');
+ $('button.J_ajax_submit_btn').click(function(){
+ location.reload();
+ });
+ $('#cloud_button').show();
+ }
+ });
+}
+//获取使用说明
+function getExplanation(sign){
+ $('#record ul').append('<li>获取模块安装使用说明....</li>');
+ $.getJSON('{:U("public_explanation")}',{ sign:sign },function(data){
+ if(data.status){
+ $('#record ul').append('<li>获取模块安装使用说明成功....</li>');
+ $('#explanation').html(data.data);
+ }else{
+ $('#explanation').html('<p>暂无说明</p>');
+ }
+ });
+}
+function step(url){
+ $('div.loading').show();
+ getStep(url);
+}
+$(function(){
+ getExplanation('{$sign}');
+ $('#cloud_start').click(function(){
+ $(this).hide();
+ $('#record ul').append('<li>开始执行安装....</li>');
+ $('#record ul').append('<li>开始检查目录权限和下载安装包....</li>');
+ step('{$stepUrl}');
+ });
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Moduleshop/index.php
===================================================================
--- View/Moduleshop/index.php (revision 0)
+++ View/Moduleshop/index.php (revision 2)
@@ -0,0 +1,36 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<body>
+<div class="wrap J_check_wrap" id="loadhtml">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">说明</div>
+ <div class="prompt_text">
+ <ul>
+ <li>模块管理可以很好的扩展网站运营中所需功能!</li>
+ <li><font color="#FF0000">安装新模块后,需要刷新后台界面才能看到对应模块菜单。</font></li>
+ </ul>
+ </div>
+ <div class="h_a">搜索</div>
+ <div class="search_type mb10">
+ <form action="{:U('index')}" method="post">
+ <div class="mb10">
+ <div class="mb10"> <span class="mr20"> 模块名称:
+ <input type="text" class="input length_2" name="keyword" style="width:200px;" value="{$keyword}" placeholder="请输入关键字...">
+ <button class="btn">搜索</button>
+ </span> </div>
+ </div>
+ </form>
+ </div>
+ <div class="loading">loading...</div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<script>
+$(function(){
+ $.get('{:U("index")}',{ page:'{$page}',keyword:'{$keyword}',r:Math.random() },function(data){
+ $('#loadhtml').append(data);
+ $('div.loading').hide();
+ });
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/Moduleshop/upgrade.php
===================================================================
--- View/Moduleshop/upgrade.php (revision 0)
+++ View/Moduleshop/upgrade.php (revision 2)
@@ -0,0 +1,61 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<Admintemplate file="Common/Head"/>
+<style>
+.logs li { line-height:25px;}
+</style>
+<body>
+<div class="wrap J_check_wrap">
+ <Admintemplate file="Common/Nav"/>
+ <div class="h_a">在线升级</div>
+ <div class="prompt_text logs" id="record">
+ <ul>
+ <li>开始执行升级....</li>
+ <li>开始检查目录权限和下载升级包....</li>
+ </ul>
+ </div>
+ <div class="loading">loading...</div>
+ <div class="btn_wrap1" style="display:none">
+ <div class="btn_wrap_pd">
+ <input type="hidden" name="id" value="53">
+ <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit" id="cloud_button">完成升级</button>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js"></script>
+<script>
+//请求
+function getStep(url){
+ $.getJSON(url,function(data){
+ if(data.status){
+ $('#record ul').append('<li>'+data.info+'</li>');
+ if(data.url){
+ step(data.url);
+ }else{
+ $('#cloud_button').html('完成升级');
+ $('div.loading').hide();
+ $('button.J_ajax_submit_btn').click(function(){
+ window.location.href = '{:U("index")}';
+ });
+ $('.btn_wrap1').show();
+ $('#record ul').append('<li>升级结束!</li>');
+ }
+ }else{
+ $('#record ul').append('<li style="color:#F00">'+data.info+'</li>');
+ $('div.loading').hide();
+ $('#cloud_button').html('重新升级');
+ $('button.J_ajax_submit_btn').click(function(){
+ location.reload();
+ });
+ $('.btn_wrap1').show();
+ }
+ });
+}
+function step(url){
+ getStep(url);
+}
+$(function(){
+ step('{$stepUrl}');
+});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: View/error.php
===================================================================
--- View/error.php (revision 0)
+++ View/error.php (revision 2)
@@ -0,0 +1,29 @@
+<?php if (!defined('SHUIPF_VERSION')) exit(); ?>
+<!doctype html>
+<html>
+<head>
+<meta charset="UTF-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+<title>{$Config.sitename} - 提示信息</title>
+<Admintemplate file="Admin/Common/Cssjs"/>
+</head>
+<body>
+<div class="wrap">
+ <div id="error_tips">
+ <h2>{$msgTitle}</h2>
+ <div class="error_cont">
+ <ul>
+ <li>{$error}</li>
+ </ul>
+ <div class="error_return"><a href="{$jumpUrl}" class="btn">返回</a></div>
+ </div>
+ </div>
+</div>
+<script src="{$config_siteurl}statics/js/common.js?v"></script>
+<script language="javascript">
+setTimeout(function(){
+ location.href = '{$jumpUrl}';
+},{$waitSecond});
+</script>
+</body>
+</html>
\ No newline at end of file
Index: Model/OperationlogModel.class.php
===================================================================
--- Model/OperationlogModel.class.php (revision 0)
+++ Model/OperationlogModel.class.php (revision 2)
@@ -0,0 +1,53 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 后台操作日志
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Model;
+
+use Common\Model\Model;
+
+class OperationlogModel extends Model {
+
+ //array(填充字段,填充内容,[填充条件,附加规则])
+ protected $_auto = array(
+ array('time', 'time', 1, 'function'),
+ array('ip', 'get_client_ip', 3, 'function'),
+ );
+
+ /**
+ * 记录日志
+ * @param type $message 说明
+ */
+ public function record($message, $status = 0) {
+ $fangs = 'GET';
+ if (IS_AJAX) {
+ $fangs = 'Ajax';
+ } else if (IS_POST) {
+ $fangs = 'POST';
+ }
+ $data = array(
+ 'uid' => \Admin\Service\User::getInstance()->id? : 0,
+ 'status' => $status,
+ 'info' => "提示语:{$message}<br/>模块:" . MODULE_NAME . ",控制器:" . CONTROLLER_NAME . ",方法:" . ACTION_NAME . "<br/>请求方式:{$fangs}",
+ 'get' => $_SERVER['HTTP_REFERER'],
+ );
+ $this->create($data);
+ return $this->add() !== false ? true : false;
+ }
+
+ /**
+ * 删除一个月前的日志
+ * @return boolean
+ */
+ public function deleteAMonthago() {
+ $status = $this->where(array("time" => array("lt", time() - (86400 * 30))))->delete();
+ return $status !== false ? true : false;
+ }
+
+}
Index: Model/MenuModel.class.php
===================================================================
--- Model/MenuModel.class.php (revision 0)
+++ Model/MenuModel.class.php (revision 2)
@@ -0,0 +1,276 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 后台菜单模型
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Model;
+
+use Common\Model\Model;
+
+class MenuModel extends Model {
+
+ //自动验证
+ protected $_validate = array(
+ //array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
+ array('name', 'require', '菜单名称不能为空!', 1, 'regex', 3),
+ array('app', 'require', '模块不能为空!', 1, 'regex', 3),
+ array('controller', 'require', '控制器不能为空!', 1, 'regex', 3),
+ array('action', 'require', '方法不能为空!', 1, 'regex', 3),
+ array('status', array(0, 1), '状态值的范围不正确!', 2, 'in'),
+ array('type', array(0, 1), '状态值的范围不正确!', 2, 'in'),
+ );
+
+ /**
+ * 获取菜单
+ * @return type
+ */
+ public function getMenuList() {
+ $items['0changyong'] = array(
+ "id" => "",
+ "name" => "常用菜单",
+ "parent" => "changyong",
+ "url" => U("Public/changyong"),
+ );
+ foreach (D('Admin/AdminPanel')->getAllPanel(\Admin\Service\User::getInstance()->id) as $r) {
+ $items[$r['mid'] . '0changyong'] = array(
+ "icon" => "",
+ "id" => $r['mid'] . '0changyong',
+ "name" => $r['name'],
+ "parent" => "changyong",
+ "url" => U($r['url']),
+ );
+ }
+ $changyong = array(
+ "changyong" => array(
+ "icon" => "",
+ "id" => "changyong",
+ "name" => "常用",
+ "parent" => "",
+ "url" => "",
+ "items" => $items
+ )
+ );
+ $data = $this->getTree(0);
+ return array_merge($changyong, $data ? $data : array());
+ }
+
+ /**
+ * 按父ID查找菜单子项
+ * @param integer $parentid 父菜单ID
+ * @param integer $with_self 是否包括他自己
+ */
+ public function adminMenu($parentid, $with_self = false) {
+ //父节点ID
+ $parentid = (int) $parentid;
+ $result = $this->where(array('parentid' => $parentid, 'status' => 1))->order('listorder ASC,id ASC')->select();
+ if (empty($result)) {
+ $result = array();
+ }
+ if ($with_self) {
+ $parentInfo = $this->where(array('id' => $parentid))->find();
+ $result2[] = $parentInfo ? $parentInfo : array();
+ $result = array_merge($result2, $result);
+ }
+ //是否超级管理员
+ if (\Admin\Service\User::getInstance()->isAdministrator()) {
+ //如果角色为 1 直接通过
+ return $result;
+ }
+ $array = array();
+ //子角色列表
+ $child = explode(',', D("Admin/Role")->getArrchildid(\Admin\Service\User::getInstance()->role_id));
+ foreach ($result as $v) {
+ //方法
+ $action = $v['action'];
+ //条件
+ $where = array('app' => $v['app'], 'controller' => $v['controller'], 'action' => $action, 'role_id' => array('IN', $child));
+ //如果是菜单项
+ if ($v['type'] == 0) {
+ $where['controller'] .= $v['id'];
+ $where['action'] .= $v['id'];
+ }
+ //public开头的通过
+ if (preg_match('/^public_/', $action)) {
+ $array[] = $v;
+ } else {
+ if (preg_match('/^ajax_([a-z]+)_/', $action, $_match)) {
+ $action = $_match[1];
+ }
+ //是否有权限
+ if (D('Admin/Access')->isCompetence($where)) {
+ $array[] = $v;
+ }
+ }
+ }
+ return $array;
+ }
+
+ /**
+ * 取得树形结构的菜单
+ * @param type $myid
+ * @param type $parent
+ * @param type $Level
+ * @return type
+ */
+ public function getTree($myid, $parent = "", $Level = 1) {
+ $data = $this->adminMenu($myid);
+ $Level++;
+ if (is_array($data)) {
+ foreach ($data as $a) {
+ $id = $a['id'];
+ $name = $a['app'];
+ $controller = $a['controller'];
+ $action = $a['action'];
+ //附带参数
+ $fu = "";
+ if ($a['parameter']) {
+ $fu = "?" . $a['parameter'];
+ }
+ $array = array(
+ "icon" => "",
+ "id" => $id . $name,
+ "name" => $a['name'],
+ "parent" => $parent,
+ "url" => U("{$name}/{$controller}/{$action}{$fu}", array("menuid" => $id)),
+ );
+ $ret[$id . $name] = $array;
+ $child = $this->getTree($a['id'], $id, $Level);
+ //由于后台管理界面只支持三层,超出的不层级的不显示
+ if ($child && $Level <= 3) {
+ $ret[$id . $name]['items'] = $child;
+ }
+ }
+ }
+ return $ret;
+ }
+
+ /**
+ * 获取菜单导航
+ * @param type $app
+ * @param type $model
+ * @param type $action
+ */
+ public function getMenu() {
+ $menuid = I('get.menuid', 0, 'intval');
+ $menuid = $menuid ? $menuid : cookie("menuid", "", array("prefix" => ""));
+ $info = $this->where(array("id" => $menuid))->getField("id,action,app,controller,parentid,parameter,type,name");
+ $find = $this->where(array("parentid" => $menuid, "status" => 1))->getField("id,action,app,controller,parentid,parameter,type,name");
+ if ($find) {
+ array_unshift($find, $info[$menuid]);
+ } else {
+ $find = $info;
+ }
+ foreach ($find as $k => $v) {
+ $find[$k]['parameter'] = "menuid={$menuid}&{$find[$k]['parameter']}";
+ }
+ return $find;
+ }
+
+ // 写入数据前的回调方法 包括新增和更新
+ protected function _before_write(&$data) {
+ if ($data['app']) {
+ $data['app'] = ucwords($data['app']);
+ }
+ if ($data['controller']) {
+ $data['controller'] = ucwords($data['controller']);
+ }
+ if ($data['action']) {
+ $data['action'] = strtolower($data['action']);
+ }
+ //清除缓存
+ cache('Menu', NULL);
+ }
+
+ /**
+ * 模块安装时进行菜单注册
+ * @param array $data 菜单数据
+ * @param array $config 模块配置
+ * @param type $parentid 父菜单ID
+ * @return boolean
+ */
+ public function installModuleMenu(array $data, array $config, $parentid = 0) {
+ if (empty($data) || !is_array($data)) {
+ $this->error = '没有数据!';
+ return false;
+ }
+ if (empty($config)) {
+ $this->error = '模块配置信息为空!';
+ return false;
+ }
+ //默认安装时父级ID
+ $defaultMenuParentid = $this->where(array('app' => 'Admin', 'controller' => 'Module', 'action' => 'local'))->getField('id')? : 42;
+ //安装模块名称
+ $moduleNama = $config['module'];
+ foreach ($data as $rs) {
+ if (empty($rs['route'])) {
+ $this->error = '菜单信息配置有误,route 不能为空!';
+ return false;
+ }
+ $route = $this->menuRoute($rs['route']);
+ $pid = $parentid ? : ((is_null($rs['parentid']) || !isset($rs['parentid'])) ? (int) $defaultMenuParentid : $rs['parentid']);
+ $newData = array_merge(array(
+ 'name' => $rs['name'],
+ 'parentid' => $pid,
+ 'type' => isset($rs['type']) ? $rs['type'] : 1,
+ 'status' => isset($rs['status']) ? $rs['status'] : 0,
+ 'remark' => $rs['remark']? : '',
+ 'listorder' => $rs['listorder']? : 0,
+ ), $route);
+ if (!$this->create($newData)) {
+ $this->error = '菜单信息配置有误,' . $this->error;
+ return false;
+ }
+ $newId = $this->add();
+ //是否有子菜单
+ if (!empty($rs['child'])) {
+ if ($this->installModuleMenu($rs['child'], $config, $newId) !== true) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * 把模块安装时,Menu.php中配置的route进行转换
+ * @param type $route route内容
+ * @param type $moduleNama 安装模块名称
+ * @return array
+ */
+ private function menuRoute($route, $moduleNama) {
+ $route = explode('/', $route, 3);
+ if (count($route) < 3) {
+ array_unshift($route, $moduleNama);
+ }
+ $data = array(
+ 'app' => $route[0],
+ 'controller' => $route[1],
+ 'action' => $route[2],
+ );
+ return $data;
+ }
+
+ /**
+ * 更新缓存
+ * @param type $data
+ * @return type
+ */
+ public function menu_cache() {
+ $data = $this->where('status = 1')->select();
+ if (empty($data)) {
+ return false;
+ }
+ $cache = array();
+ foreach ($data as $rs) {
+ $cache[$rs['id']] = $rs;
+ }
+ cache('Menu', $cache);
+ return $cache;
+ }
+
+}
Index: Model/AdminPanelModel.class.php
===================================================================
--- Model/AdminPanelModel.class.php (revision 0)
+++ Model/AdminPanelModel.class.php (revision 2)
@@ -0,0 +1,54 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 常用菜单
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Model;
+
+use Common\Model\Model;
+
+class AdminPanelModel extends Model {
+
+ /**
+ * 添加常用菜单
+ * @param type $data
+ * @return boolean
+ */
+ public function addPanel($data) {
+ //删除旧的
+ $this->where(array("userid" => \Admin\Service\User::getInstance()->id))->delete();
+ if (empty($data)) {
+ return true;
+ }
+ C('TOKEN_ON', false);
+ foreach ($data as $k => $rs) {
+ $data[$k] = $this->create($rs, 1);
+ }
+
+ return $this->addAll($data) !== false ? true : false;
+ }
+
+ /**
+ * 返回某个用户的全部常用菜单
+ * @param type $userid 用户ID
+ * @return type
+ */
+ public function getAllPanel($userid) {
+ return $this->where(array('userid' => $userid))->select();
+ }
+
+ /**
+ * 检查该菜单是否已经添加过
+ * @param type $mid 菜单ID
+ * @return boolean
+ */
+ public function isExist($mid) {
+ return $this->where(array('mid' => $mid, "userid" => \Admin\Service\User::getInstance()->id))->count();
+ }
+
+}
Index: Model/LoginlogModel.class.php
===================================================================
--- Model/LoginlogModel.class.php (revision 0)
+++ Model/LoginlogModel.class.php (revision 2)
@@ -0,0 +1,42 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 后台登录日志
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Model;
+
+use Common\Model\Model;
+
+class LoginlogModel extends Model {
+
+ //array(填充字段,填充内容,[填充条件,附加规则])
+ protected $_auto = array(
+ array('logintime', 'time', 1, 'function'),
+ array('loginip', 'get_client_ip', 3, 'function'),
+ );
+
+ /**
+ * 删除一个月前的日志
+ * @return boolean
+ */
+ public function deleteAMonthago() {
+ $status = $this->where(array("logintime" => array("lt", time() - (86400 * 30))))->delete();
+ return $status !== false ? true : false;
+ }
+
+ /**
+ * 添加登录日志
+ * @param array $data
+ * @return boolean
+ */
+ public function addLoginLogs($data) {
+ $this->create($data);
+ return $this->add() !== false ? true : false;
+ }
+
+}
Index: Model/UserModel.class.php
===================================================================
--- Model/UserModel.class.php (revision 0)
+++ Model/UserModel.class.php (revision 2)
@@ -0,0 +1,190 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 后台用户模型
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Model;
+
+use Common\Model\Model;
+
+class UserModel extends Model {
+
+ //array(验证字段,验证规则,错误提示,[验证条件,附加规则,验证时间])
+ protected $_validate = array(
+ array('username', 'require', '用户名不能为空!'),
+ array('nickname', 'require', '真实姓名不能为空!'),
+ array('role_id', 'require', '帐号所属角色不能为空!', 0, 'regex', 1),
+ array('password', 'require', '密码不能为空!', 0, 'regex', 1),
+ array('pwdconfirm', 'password', '两次输入的密码不一样!', 0, 'confirm'),
+ array('email', 'email', '邮箱地址有误!'),
+ array('username', '', '帐号名称已经存在!', 0, 'unique', 1),
+ array('status', array(0, 1), '状态错误,状态只能是1或者0!', 2, 'in'),
+ );
+ //array(填充字段,填充内容,[填充条件,附加规则])
+ protected $_auto = array(
+ array('create_time', 'time', 1, 'function'),
+ array('update_time', 'time', 3, 'function'),
+ array('verify', 'genRandomString', 1, 'function', 6), //新增时自动生成验证码
+ );
+
+ /**
+ * 获取用户信息
+ * @param type $identifier 用户名或者用户ID
+ * @return boolean|array
+ */
+ public function getUserInfo($identifier, $password = NULL) {
+ if (empty($identifier)) {
+ return false;
+ }
+ $map = array();
+ //判断是uid还是用户名
+ if (is_int($identifier)) {
+ $map['id'] = $identifier;
+ } else {
+ $map['username'] = $identifier;
+ }
+ $userInfo = $this->where($map)->find();
+ if (empty($userInfo)) {
+ return false;
+ }
+ //密码验证
+ if (!empty($password) && $this->hashPassword($password, $userInfo['verify']) != $userInfo['password']) {
+ return false;
+ }
+ return $userInfo;
+ }
+
+ /**
+ * 更新登录状态信息
+ * @param type $userId
+ * @return type
+ */
+ public function loginStatus($userId) {
+ $this->find((int) $userId);
+ $this->last_login_time = time();
+ $this->last_login_ip = get_client_ip();
+ return $this->save();
+ }
+
+ /**
+ * 对明文密码,进行加密,返回加密后的密文密码
+ * @param string $password 明文密码
+ * @param string $verify 认证码
+ * @return string 密文密码
+ */
+ public function hashPassword($password, $verify = "") {
+ return md5($password . md5($verify));
+ }
+
+ /**
+ * 修改密码
+ * @param int $uid 用户ID
+ * @param string $newPass 新密码
+ * @param string $password 旧密码
+ * @return boolean
+ */
+ public function changePassword($uid, $newPass, $password = NULL) {
+ //获取会员信息
+ $userInfo = $this->getUserInfo((int) $uid, $password);
+ if (empty($userInfo)) {
+ $this->error = '旧密码不正确或者该用户不存在!';
+ return false;
+ }
+ $verify = genRandomString(6);
+ $status = $this->where(array('id' => $userInfo['id']))->save(array('password' => $this->hashPassword($newPass, $verify), 'verify' => $verify));
+ return $status !== false ? true : false;
+ }
+
+ /**
+ * 修改管理员信息
+ * @param type $data
+ */
+ public function amendManager($data) {
+ if (empty($data) || !is_array($data) || !isset($data['id'])) {
+ $this->error = '没有需要修改的数据!';
+ return false;
+ }
+ $info = $this->where(array('id' => $data['id']))->find();
+ if (empty($info)) {
+ $this->error = '该管理员不存在!';
+ return false;
+ }
+ //密码为空,表示不修改密码
+ if (isset($data['password']) && empty($data['password'])) {
+ unset($data['password']);
+ }
+ if ($this->create($data)) {
+ if ($this->data['password']) {
+ $verify = genRandomString(6);
+ $this->verify = $verify;
+ $this->password = $this->hashPassword($this->password, $verify);
+ }
+ $status = $this->save();
+ return $status !== false ? true : false;
+ }
+ return false;
+ }
+
+ /**
+ * 创建管理员
+ * @param type $data
+ * @return boolean
+ */
+ public function createManager($data) {
+ if (empty($data)) {
+ $this->error = '没有数据!';
+ return false;
+ }
+ if ($this->create($data)) {
+ $id = $this->add();
+ if ($id) {
+ return $id;
+ }
+ $this->error = '入库失败!';
+ return false;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * 删除管理员
+ * @param type $userId
+ * @return boolean
+ */
+ public function deleteUser($userId) {
+ $userId = (int) $userId;
+ if (empty($userId)) {
+ $this->error = '请指定需要删除的用户ID!';
+ return false;
+ }
+ if ($userId == 1) {
+ $this->error = '该管理员不能被删除!';
+ return false;
+ }
+ if (false !== $this->where(array('id' => $userId))->delete()) {
+ return true;
+ } else {
+ $this->error = '删除失败!';
+ return false;
+ }
+ }
+
+ /**
+ * 插入成功后的回调方法
+ * @param type $data 数据
+ * @param type $options 表达式
+ */
+ protected function _after_insert($data, $options) {
+ //添加信息后,更新密码字段
+ $this->where(array('id' => $data['id']))->save(array(
+ 'password' => $this->hashPassword($data['password'], $data['verify']),
+ ));
+ }
+
+}
Index: Model/AccessModel.class.php
===================================================================
--- Model/AccessModel.class.php (revision 0)
+++ Model/AccessModel.class.php (revision 2)
@@ -0,0 +1,135 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 后台用户权限模型
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Model;
+
+use Common\Model\Model;
+
+class AccessModel extends Model {
+
+ /**
+ * 根据角色ID返回全部权限
+ * @param type $roleid 角色ID
+ * @return array
+ */
+ public function getAccessList($roleid) {
+ if (empty($roleid)) {
+ return false;
+ }
+ //子角色列表
+ $child = explode(',', D("Admin/Role")->getArrchildid($roleid));
+ if (empty($child)) {
+ return false;
+ }
+ //查询出该角色拥有的全部权限列表
+ $data = $this->where(array('role_id' => array('IN', $child)))->select();
+ if (empty($data)) {
+ return false;
+ }
+ $accessList = array();
+ foreach ($data as $info) {
+ unset($info['status']);
+ $accessList[] = $info;
+ }
+ return $accessList;
+ }
+
+ /**
+ * 检查用户是否有对应权限
+ * @param type $map 方法[模块/控制器/方法],为空自动获取
+ * @return type
+ */
+ public function isCompetence($map = '') {
+ //超级管理员
+ if (\Admin\Service\User::getInstance()->isAdministrator()) {
+ return true;
+ }
+ if (!is_array($map)) {
+ //子角色列表
+ $child = explode(',', D("Admin/Role")->getArrchildid(\Admin\Service\User::getInstance()->role_id));
+ if (!empty($map)) {
+ $map = trim($map, '/');
+ $map = explode('/', $map);
+ if (empty($map)) {
+ return false;
+ }
+ } else {
+ $map = array(MODULE_NAME, CONTROLLER_NAME, ACTION_NAME,);
+ }
+ if (count($map) >= 3) {
+ list($app, $controller, $action) = $map;
+ } elseif (count($map) == 1) {
+ $app = MODULE_NAME;
+ $controller = CONTROLLER_NAME;
+ $action = $map[0];
+ } elseif (count($map) == 2) {
+ $app = MODULE_NAME;
+ list($controller, $action) = $map;
+ }
+ $map = array('role_id' => array('IN', $child), 'app' => $app, 'controller' => $controller, 'action' => $action);
+ }
+ $count = $this->where($map)->count();
+ return $count ? true : false;
+ }
+
+ /**
+ * 返回用户权限列表,用于授权
+ * @param type $roleid 角色
+ * @param type $userId 用户ID
+ * @return type
+ */
+ public function getUserAccessList($roleid, $userId = 0) {
+ if (empty($roleid)) {
+ return false;
+ }
+ $result = cache('Menu');
+ $data = $this->where(array("role_id" => $roleid))->field("role_id,app,controller,action")->select();
+ $json = array();
+ foreach ($result as $rs) {
+ $data = array(
+ 'id' => $rs['id'],
+ 'checked' => $rs['id'],
+ 'parentid' => $rs['parentid'],
+ 'name' => $rs['name'] . ($rs['type'] == 0 ? "(菜单项)" : ""),
+ 'checked' => D('Admin/Role')->isCompetence($rs, $roleid, $data) ? true : false,
+ );
+ $json[] = $data;
+ }
+ return array();
+ }
+
+ /**
+ * 角色授权
+ * @param type $addauthorize 授权数据
+ * @param type $roleid 角色id
+ * @return boolean
+ */
+ public function batchAuthorize($addauthorize, $roleid = 0) {
+ if (empty($addauthorize)) {
+ $this->error = '没有需要授权的权限!';
+ return false;
+ }
+ if (empty($roleid)) {
+ if (empty($addauthorize[0]['role_id'])) {
+ $this->error = '角色ID不能为空!';
+ return false;
+ }
+ $roleid = $addauthorize[0]['role_id'];
+ }
+ C('TOKEN_ON', false);
+ foreach ($addauthorize as $k => $rs) {
+ $addauthorize[$k] = $this->create($rs, 1);
+ }
+ //删除旧的权限
+ $this->where(array("role_id" => $roleid))->delete();
+ return $this->addAll($addauthorize) !== false ? true : false;
+ }
+
+}
Index: Model/RoleModel.class.php
===================================================================
--- Model/RoleModel.class.php (revision 0)
+++ Model/RoleModel.class.php (revision 2)
@@ -0,0 +1,245 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 后台用户角色表
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Model;
+
+use Common\Model\Model;
+
+class RoleModel extends Model {
+
+ //array(验证字段,验证规则,错误提示,[验证条件,附加规则,验证时间])
+ protected $_validate = array(
+ array('name', 'require', '角色名称不能为空!'),
+ array('name', '', '该名称已经存在!', 0, 'unique', 3),
+ array('status', 'require', '缺少状态!'),
+ array('status', array(0, 1), '状态错误,状态只能是1或者0!', 2, 'in'),
+ );
+ //array(填充字段,填充内容,[填充条件,附加规则])
+ protected $_auto = array(
+ array('create_time', 'time', 1, 'function'),
+ array('update_time', 'time', 3, 'function'),
+ array('listorder', '0'),
+ );
+
+ /**
+ * 通过递归的方式获取该角色下的全部子角色
+ * @param type $id
+ * @return string
+ */
+ public function getArrchildid($id) {
+ if (empty($this->roleList)) {
+ $this->roleList = $this->getTreeArray();
+ }
+ $arrchildid = $id;
+ if (is_array($this->roleList)) {
+ foreach ($this->roleList as $k => $cat) {
+ if ($cat['parentid'] && $k != $id && $cat['parentid'] == $id) {
+ $arrchildid .= ',' . $this->getArrchildid($k);
+ }
+ }
+ }
+ return $arrchildid;
+ }
+
+ /**
+ * 通过递归的方式获取父角色ID列表
+ * @param type $id 角色ID
+ * @param type $arrparentid
+ * @param type $n
+ * @return boolean
+ */
+ public function getArrparentid($id, $arrparentid = '', $n = 1) {
+ if (empty($this->roleList)) {
+ $this->roleList = $this->getTreeArray();
+ }
+ if ($n > 10 || !is_array($this->roleList) || !isset($this->roleList[$id])) {
+ return false;
+ }
+ //获取当前栏目的上级栏目ID
+ $parentid = $this->roleList[$id]['parentid'];
+ //所有父ID
+ $arrparentid = $arrparentid ? $parentid . ',' . $arrparentid : $parentid;
+ if ($parentid) {
+ $arrparentid = $this->getArrparentid($parentid, $arrparentid, ++$n);
+ } else {
+ $this->roleList[$id]['arrparentid'] = $arrparentid;
+ }
+ return $arrparentid;
+ }
+
+ /**
+ * 删除角色
+ * @param int $roleid 角色ID
+ * @return boolean
+ */
+ public function roleDelete($roleid) {
+ if (empty($roleid) || $roleid == 1) {
+ $this->error = '超级管理员角色不能被删除!';
+ return false;
+ }
+ //角色信息
+ $info = $this->where(array('id' => $roleid))->find();
+ if (empty($info)) {
+ $this->error = '该角色不存在!';
+ return false;
+ }
+ //子角色列表
+ $child = explode(',', $this->getArrchildid($roleid));
+ if (count($child) > 1) {
+ $this->error = '该角色下有子角色,请删除子角色才可以删除!';
+ return false;
+ }
+ $status = $this->where(array('id' => $roleid))->delete();
+ if ($status !== false) {
+ //删除access中的授权信息
+ return D('Admin/Access')->where(array('role_id' => $roleid))->delete() !== false ? true : false;
+ }
+ return false;
+ }
+
+ /**
+ * 根据角色Id获取角色名
+ * @param int $roleId 角色id
+ * @return string 返回角色名
+ */
+ public function getRoleIdName($roleId) {
+ return $this->where(array('id' => $roleId))->getField('name');
+ }
+
+ /**
+ * 检查指定菜单是否有权限
+ * @param type $data menu表中数组,单条
+ * @param type $roleid 需要检查的角色ID
+ * @param type $priv_data 已授权权限表数据
+ * @return boolean
+ */
+ public function isCompetence($data, $roleid, $priv_data = array()) {
+ $priv_arr = array('app', 'controller', 'action');
+ if ($data['app'] == '') {
+ return false;
+ }
+ if (empty($priv_data)) {
+ //查询已授权权限
+ $priv_data = $this->getAccessList($roleid);
+ }
+ if (empty($priv_data)) {
+ return false;
+ }
+ //菜单id
+ $menuid = $data['id'];
+ //菜单类型
+ $type = $data['type'];
+ //去除不要的数据
+ foreach ($data as $key => $value) {
+ if (!in_array($key, $priv_arr)) {
+ unset($data[$key]);
+ }
+ }
+ $competence = array(
+ 'role_id' => $roleid,
+ 'app' => $data['app'],
+ );
+ //如果是菜单项加上菜单Id用以区分,保持唯一
+ if ($type == 0) {
+ $competence["controller"] = $data['controller'] . $menuid;
+ $competence["action"] = $data['action'] . $menuid;
+ } else {
+ $competence["controller"] = $data['controller'];
+ $competence["action"] = $data['action'];
+ }
+ //检查是否在已授权列表中
+ $implode = implode('', $competence);
+ $info = in_array(implode('', $competence), $this->privArrStr($priv_data));
+ if ($info) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * 按规则排序组合
+ * @param type $priv_data
+ * @return array
+ */
+ private function privArrStr($priv_data) {
+ $privArrStr = array();
+ if (empty($priv_data)) {
+ return $privArrStr;
+ }
+ foreach ($priv_data as $rs) {
+ $competence = array(
+ 'role_id' => $rs['role_id'],
+ 'app' => $rs['app'],
+ 'controller' => $rs['controller'],
+ 'action' => $rs['action'],
+ );
+ $privArrStr[] = implode('', $competence);
+ }
+ return $privArrStr;
+ }
+
+ /**
+ * 返回Tree使用的数组
+ * @return array
+ */
+ public function getTreeArray() {
+ $roleList = array();
+ $roleData = $this->order(array("listorder" => "asc", "id" => "desc"))->select();
+ foreach ($roleData as $rs) {
+ $roleList[$rs['id']] = $rs;
+ }
+ return $roleList;
+ }
+
+ /**
+ * 返回select选择列表
+ * @param int $parentid 父节点ID
+ * @param string $selectStr 是否要 <select></select>
+ * @return string
+ */
+ public function selectHtmlOption($parentid = 0, $selectStr = '') {
+ $tree = new \Tree();
+ $tree->icon = array(' │ ', ' ├─ ', ' └─ ');
+ $tree->nbsp = ' ';
+ $str = "'<option value='\$id' \$selected>\$spacer\$name</option>";
+ $tree->init($this->getTreeArray());
+ if ($selectStr) {
+ $html = '<select ' . $selectStr . '>';
+ $html.=$tree->get_tree(0, $str, $parentid);
+ $html.='</select>';
+ return $html;
+ }
+ return $tree->get_tree(0, $str, $parentid);
+ }
+
+ /**
+ * 根据角色ID返回全部权限
+ * @param type $roleid 角色ID
+ * @return array
+ */
+ public function getAccessList($roleid) {
+ $priv_data = array();
+ $data = D("Admin/Access")->getAccessList($roleid);
+ if (empty($data)) {
+ return $priv_data;
+ }
+ foreach ($data as $k => $rs) {
+ $priv_data[$k] = array(
+ 'role_id' => $rs['role_id'],
+ 'app' => $rs['app'],
+ 'controller' => $rs['controller'],
+ 'action' => $rs['action'],
+ );
+ }
+ return $priv_data;
+ }
+
+}
Index: Service/User.class.php
===================================================================
--- Service/User.class.php (revision 0)
+++ Service/User.class.php (revision 2)
@@ -0,0 +1,158 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ShuipFCMS 后台用户服务
+// +----------------------------------------------------------------------
+// | Copyright (c) 2012-2014 http://www.shuipfcms.com, All rights reserved.
+// +----------------------------------------------------------------------
+// | Author: 水平凡 <admin@abc3210.com>
+// +----------------------------------------------------------------------
+
+namespace Admin\Service;
+
+class User {
+
+ //存储用户uid的Key
+ const userUidKey = 'spf_userid';
+ //超级管理员角色id
+ const administratorRoleId = 1;
+
+ //当前登录会员详细信息
+ private static $userInfo = array();
+
+ /**
+ * 连接后台用户服务
+ * @staticvar \Admin\Service\Cache $systemHandier
+ * @return \Admin\Service\Cache
+ */
+ static public function getInstance() {
+ static $handier = NULL;
+ if (empty($handier)) {
+ $handier = new User();
+ }
+ return $handier;
+ }
+
+ /**
+ * 魔术方法
+ * @param type $name
+ * @return null
+ */
+ public function __get($name) {
+ //从缓存中获取
+ if (isset(self::$userInfo[$name])) {
+ return self::$userInfo[$name];
+ } else {
+ $userInfo = $this->getInfo();
+ if (!empty($userInfo)) {
+ return $userInfo[$name];
+ }
+ return NULL;
+ }
+ }
+
+ /**
+ * 获取当前登录用户资料
+ * @return array
+ */
+ public function getInfo() {
+ if (empty(self::$userInfo)) {
+ self::$userInfo = $this->getUserInfo($this->isLogin());
+ }
+ return !empty(self::$userInfo) ? self::$userInfo : false;
+ }
+
+ /**
+ * 检验用户是否已经登陆
+ * @return boolean 失败返回false,成功返回当前登陆用户基本信息
+ */
+ public function isLogin() {
+ $userId = \Libs\Util\Encrypt::authcode(session(self::userUidKey), 'DECODE');
+ if (empty($userId)) {
+ return false;
+ }
+ return (int) $userId;
+ }
+
+ //登录后台
+ public function login($identifier, $password) {
+ if (empty($identifier) || empty($password)) {
+ return false;
+ }
+ //验证
+ $userInfo = $this->getUserInfo($identifier, $password);
+ if (false == $userInfo) {
+ //记录登录日志
+ $this->record($identifier, $password, 0);
+ return false;
+ }
+ //记录登录日志
+ $this->record($identifier, $password, 1);
+ //注册登录状态
+ $this->registerLogin($userInfo);
+ return true;
+ }
+
+ /**
+ * 检查当前用户是否超级管理员
+ * @return boolean
+ */
+ public function isAdministrator() {
+ $userInfo = $this->getInfo();
+ if (!empty($userInfo) && $userInfo['role_id'] == self::administratorRoleId) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * 注销登录状态
+ * @return boolean
+ */
+ public function logout() {
+ session('[destroy]');
+ return true;
+ }
+
+ /**
+ * 记录登陆日志
+ * @param type $identifier 登陆方式,uid,username
+ * @param type $password 密码
+ * @param type $status
+ */
+ private function record($identifier, $password, $status = 0) {
+ //登录日志
+ D('Admin/Loginlog')->addLoginLogs(array(
+ "username" => $identifier,
+ "status" => $status,
+ "password" => $status ? '密码保密' : $password,
+ "info" => is_int($identifier) ? '用户ID登录' : '用户名登录',
+ ));
+ }
+
+ /**
+ * 注册用户登录状态
+ * @param array $userInfo 用户信息
+ */
+ private function registerLogin(array $userInfo) {
+ //写入session
+ session(self::userUidKey, \Libs\Util\Encrypt::authcode((int) $userInfo['id'], ''));
+ //更新状态
+ D('Admin/User')->loginStatus((int) $userInfo['id']);
+ //注册权限
+ \Libs\System\RBAC::saveAccessList((int) $userInfo['id']);
+ }
+
+ /**
+ * 获取用户信息
+ * @param type $identifier 用户名或者用户ID
+ * @return boolean|array
+ */
+ private function getUserInfo($identifier, $password = NULL) {
+ if (empty($identifier)) {
+ return false;
+ }
+ return D('Admin/User')->getUserInfo($identifier, $password);
+ }
+
+}
