Example #1
0
 public function index()
 {
     if (!User::$id || !User::root()) {
         return '/user/login/';
     }
     View::$theme = '';
     return array();
 }
Example #2
0
 public function index()
 {
     if (!User::root()) {
         $_SESSION['error_uri'] =& $_SERVER['REQUEST_URI'];
         return '/error/denied/';
     }
     View::$title = 'Order List';
     if (!isset($this->params[0])) {
         $this->params[0] = 0;
     }
     $page = (int) $this->params[0];
     $offset = $this->folder->config['arcLimit'] * $page;
     return $this->model->getOrder($offset, $this->folder->config['arcLimit']);
 }
Example #3
0
 public function editable()
 {
     if (!isset($this->id)) {
         return false;
     }
     if (!User::$id) {
         return false;
     }
     if (User::root()) {
         return true;
     }
     if ($this->rev_by == User::$id) {
         return true;
     }
     if (!$this->folder->isEditor(User::$id)) {
         return false;
     }
     if (User::level($this->rev_by) == User::$user['level']) {
         return true;
     }
     return User::$user['level'] < User::level($this->rev_by);
 }
Example #4
0
 public function commentList()
 {
     if (!User::root()) {
         return '/error/denied/';
     }
     $ret = array();
     $article = $this->model->get($this->params[0]);
     if ($_POST['approve']) {
         foreach ($_POST['checked'] as $cid) {
             $article->approveComment($cid);
         }
     }
     if ($_POST['unapprove']) {
         foreach ($_POST['checked'] as $cid) {
             $article->unapproveComment($cid);
         }
     }
     $page = 0;
     if (isset($this->params[1])) {
         $page = (int) $this->params[1];
     }
     $article->getComment($page, false);
     $ret['total'] = $article->countComment(false);
     $ret['data'] =& $article;
     return $ret;
 }