コード例 #1
0
    public function logoutAction()
    {
        $this->view->Title = 'Logout';
        $this->view->headTitle($this->view->Title, true);
        $auth = new Zendda_System_Auth();
        $auth->logout();
        $info = new Zendda_System_Info();
        $info->destroyInfo();
        $link = $this->view->baseUrl('/default/index/index');
        $linkLogin = $this->view->baseUrl('/default/public/login');
        $this->view->Notes = 'Bạn đã thoát khỏi hệ thống.
							Nhấn<a href="' . $link . '"> Trang chủ</a> để quay lại trang chủ.<br>
							Nhấn<a href="' . $linkLogin . '"> Đăng Nhập</a> để tiếp tục Đăng Nhập vào hệ thống.
						';
    }
コード例 #2
0
 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $auth = Zend_Auth::getInstance();
     $controllerName = $this->_request->getControllerName();
     if ($controllerName != 'training') {
         $flagAdmin = false;
         $tmp = explode('-', $controllerName);
         if ($tmp[0] == 'admin') {
             $flagAdmin = true;
         }
         $flagPage = 'none';
         //----------START-KIEM TRA QUYEN TRUY CAP VAO ADMIN -------------
         if ($flagAdmin == true) {
             if ($auth->hasIdentity() == false) {
                 $flagPage = 'login';
             } else {
                 $info = new Zendda_System_Info();
                 $group_acp = $info->getGroupInfo('group_acp');
                 if ($group_acp != 1) {
                     $flagPage = 'no-access';
                 } else {
                     $aclInfo = $info->getAclInfo();
                     $acl = new Zendda_System_Acl($aclInfo);
                     $permission = $info->getGroupInfo('permission');
                     if ($permission != 'Full Access') {
                         $arrParam = $this->_request->getParams();
                         if ($acl->isAllowed($arrParam) == false) {
                             $flagPage = 'no-access';
                         }
                     }
                 }
             }
         }
         //----------END-KIEM TRA QUYEN TRUY CAP VAO ADMIN -------------
         if ($flagPage != 'none') {
             if ($flagPage == 'login') {
                 $this->_request->setModuleName('default');
                 $this->_request->setControllerName('public');
                 $this->_request->setActionName('login');
             }
             if ($flagPage == 'no-access') {
                 $this->_request->setModuleName('default');
                 $this->_request->setControllerName('public');
                 $this->_request->setActionName('no-access');
             }
         }
     }
 }
コード例 #3
0
 public function saveItem($arrParams = null, $Option = null)
 {
     if ($Option['task'] == 'admin-add') {
         $info = new Zendda_System_Info();
         $created_by = $info->getMemberInfo('id');
         $row = $this->fetchNew();
         $row->title = $arrParams['title'];
         $row->image_thumb = $arrParams['image_name'];
         $row->image_actual = $arrParams['image_name'];
         $row->status = 1;
         $row->album_id = $arrParams['album_id'];
         $row->created = date("y-m-d h:m:s");
         $row->created_by = $created_by;
         $row->save();
     }
 }
コード例 #4
0
 public function saveItem($arrParams = null, $Option = null)
 {
     if ($Option['task'] == 'admin-add') {
         $row = $this->fetchNew();
         $row->title = $arrParams['title'];
         $row->question = $arrParams['message'];
         $row->fullname = $arrParams['fullname'];
         $row->email = $arrParams['email'];
         $row->created = date("y-m-d h:m:s");
         $row->save();
     }
     if ($Option['task'] == 'admin-edit') {
         $info = new Zendda_System_Info();
         $modified_by = $info->getMemberInfo('id');
         $where = 'qa_id = ' . $arrParams['id'];
         $row = $this->fetchRow($where);
         $row->answer = $arrParams['answer'];
         $row->is_answer = $arrParams['is_answer'];
         $row->status = $arrParams['status'];
         $row->modified = date("y-m-d h:m:s");
         $row->modified_by = $modified_by;
         $row->save();
     }
 }
コード例 #5
0
 public function saveItem($arrParams = null, $Option = null)
 {
     if ($Option['task'] == 'admin-add') {
         $info = new Zendda_System_Info();
         $created_by = $info->getMemberInfo('id');
         $row = $this->fetchNew();
         $row->album_name = $arrParams['album_name'];
         $row->image = $arrParams['picture'];
         $row->status = $arrParams['status'];
         $row->order = $arrParams['order'];
         $row->created = date("y-m-d h:m:s");
         $row->created_by = $created_by;
         $row->save();
     }
     if ($Option['task'] == 'admin-edit') {
         $info = new Zendda_System_Info();
         $modified_by = $info->getMemberInfo('id');
         $where = 'id = ' . $arrParams['id'];
         $row = $this->fetchRow($where);
         $row->album_name = $arrParams['album_name'];
         $row->image = $arrParams['picture'];
         $row->status = $arrParams['status'];
         $row->order = $arrParams['order'];
         $row->created = date("y-m-d h:m:s");
         $row->created_by = $modified_by;
         $row->save();
     }
 }
コード例 #6
0
 public function saveItem($arrParams = null, $Option = null)
 {
     if ($Option['task'] == 'admin-add') {
         $info = new Zendda_System_Info();
         $created_by = $info->getMemberInfo('id');
         $row = $this->fetchNew();
         $row->title_news = $arrParams['name'];
         $row->img_news_sml = $arrParams['picture'];
         $row->img_news_big = $arrParams['picture'];
         $row->news_hot = $arrParams['newshot'];
         $row->news_type = $arrParams['cat_id'];
         $row->status = $arrParams['status'];
         $row->order = $arrParams['order'];
         $row->summary_news = $arrParams['synopsis'];
         $row->content_news = $arrParams['content'];
         $row->created = date("y-m-d h:m:s");
         $row->created_by = $created_by;
         $row->save();
     }
     if ($Option['task'] == 'admin-edit') {
         $info = new Zendda_System_Info();
         $modified_by = $info->getMemberInfo('id');
         $where = 'news_id = ' . $arrParams['id'];
         $row = $this->fetchRow($where);
         $row->title_news = $arrParams['name'];
         $row->img_news_sml = $arrParams['picture'];
         $row->img_news_big = $arrParams['picture'];
         $row->news_hot = $arrParams['newshot'];
         $row->news_type = $arrParams['cat_id'];
         $row->status = $arrParams['status'];
         $row->order = $arrParams['order'];
         $row->summary_news = $arrParams['synopsis'];
         $row->content_news = $arrParams['content'];
         $row->modified = date("y-m-d h:m:s");
         $row->modified_by = $modified_by;
         $row->save();
     }
 }