Пример #1
0
 public function checkTodo()
 {
     $checkTodo = S("checkTodo");
     if (empty($checkTodo)) {
         $check_res = "";
         $AccessEvent = new AccessEvent();
         $UpdateEvent = new UpdateEvent();
         if ($UpdateEvent->check()) {
             $check_res .= '<li><a href="' . U("Admin/System/update") . '"><i class="fa fa-laptop"></i> 发现新的可升级版本</a></li>';
         }
         if (!$UpdateEvent->checkVersion()) {
             $check_res .= '<li><a href="' . U("Admin/System/update") . '"><i class="fa fa-laptop"></i> 数据库中版本号与代码中不一致</a></li>';
         }
         if (!$AccessEvent->checkAccess()) {
             $check_res .= '<li><a href="' . U("Admin/Access/rolelist") . '"><i class="fa fa-laptop"></i> 需要重建角色权限!</a></li>';
         }
         if (!$AccessEvent->checkNode()) {
             $check_res .= '<li><a href="' . U("Admin/Access/nodelist") . '"><i class="fa fa-laptop"></i> 需要重建节点!</a></li>';
         }
         if ($check_res == "") {
             $check_res = "none";
         }
         S("checkTodo", $check_res);
         die($check_res);
     } else {
         die(S("checkTodo"));
     }
 }
Пример #2
0
 public function rebuildAccess()
 {
     D('Node')->where('1')->delete();
     //清空
     D('Access')->where('1')->delete();
     //清空
     $Access = new AccessEvent();
     $Access->initAdmin();
     $Access->initWeixin();
     $this->success("重建完成,请重新分配权限");
 }
Пример #3
0
 /**
  *
  */
 public function step5()
 {
     File::delAll(RUNTIME_PATH);
     File::delAll(LOG_PATH);
     File::delAll(WEB_CACHE_PATH);
     File::delAll(WEB_ROOT . 'Data/Cache');
     File::delAll(WEB_ROOT . 'Data/Temp');
     //A('Install/Test')->init($key = 'zts');
     $Access = new AccessEvent();
     $Access->initAdmin();
     $Access->initWeixin();
     // File::delAll(WEB_ROOT . 'Data/Install');
     if (File::writeFile(WEB_ROOT . 'Data/Install/install.lock', 'installed', 'w+')) {
         C('URL_MODEL', 3);
         $this->success('GreenCMS安装成功,5秒钟返回首页', U('Home/Index/index'), 5);
     }
 }