Ejemplo n.º 1
0
 public function execute()
 {
     # Page exists?
     if (false === ($page = GWF_Page::getByID(Common::getGetString('pageid')))) {
         header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
         return $this->module->error('err_404');
     }
     # Have permission to see?
     if (!$this->checkPermission($page)) {
         header($_SERVER['SERVER_PROTOCOL'] . " 403 Forbidden");
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     # Load comments?
     if ($page->isOptionEnabled(GWF_Page::COMMENTS)) {
         $this->mod_c = GWF_Module::loadModuleDB('Comments', true, true);
         if (false === ($this->comments = $page->getComments())) {
             return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
         }
         $_REQUEST['cmts_id'] = $this->comments->getID();
     }
     # Exec ...
     $back = '';
     if (isset($_POST['reply'])) {
         $back = $this->onReply($page);
     }
     return $this->showPage($page) . $back;
 }
Ejemplo n.º 2
0
 public function execute()
 {
     if (false === ($page = GWF_Page::getByID(Common::getGetString('pageid')))) {
         return $this->module->error('err_page');
     }
     $user = GWF_User::getStaticOrGuest();
     $this->is_author = $this->module->isAuthor($user);
     $this->is_owner = $this->is_author || $page->isOwner($user);
     if (!$this->is_owner && !$this->is_author) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     $this->page = $page;
     $this->user = $user;
     $this->is_oowner = $this->is_author ? true : $page->getOtherPage()->isOwner($user);
     $back = '';
     if (isset($_POST['edit'])) {
         $back .= $this->onEdit();
     } elseif (isset($_POST['unlock'])) {
         return $this->onUnlock() . $this->templateEdit();
     } elseif (isset($_POST['delete'])) {
         return $this->onDelete() . $this->templateEdit();
     } elseif (isset($_POST['translate'])) {
         GWF_Website::redirect($this->module->getMethodURL('Translate', '&pageid=' . $page->getID()));
         die;
     } elseif (isset($_POST['upload'])) {
         require_once GWF_CORE_PATH . 'module/PageBuilder/PB_Uploader.php';
         $back .= PB_Uploader::onUpload($this->module) . $this->templateEdit();
     }
     return $back . $this->templateEdit();
 }
Ejemplo n.º 3
0
 public function execute()
 {
     if (false === ($this->page = GWF_Page::getByID(Common::getGetString('pageid')))) {
         return $this->module->lang('err_page');
     }
     if ($this->page->isLocked()) {
         return $this->module->lang('err_locked');
     }
     $this->user = GWF_User::getStaticOrGuest();
     if (false === ($this->is_author = $this->module->isAuthor($this->user))) {
         if (false === $this->module->cfgLockedPosting()) {
             return GWF_HTML::err('ERR_NO_PERMISSION');
         } else {
             $this->locked_mode = true;
         }
     }
     $back = '';
     if (isset($_POST['translate'])) {
         $back .= $this->onTranslate($this->page);
     } elseif (isset($_POST['upload'])) {
         require_once GWF_CORE_PATH . 'module/PageBuilder/PB_Uploader.php';
         $back .= PB_Uploader::onUpload($this->module);
     }
     return $back . $this->templateTranslate($this->page);
 }
Ejemplo n.º 4
0
 public function execute()
 {
     if (false === ($page = GWF_Page::getByID(Common::getGetString('pageid')))) {
         return $this->module->error('err_page');
     }
     if ($page->getHashcode() !== Common::getGetString('token')) {
         return $this->module->error('err_token');
     }
     switch (Common::getGetString('action')) {
         case 'unlock':
             return $this->onEnable($page);
             // 			case 'accept':
             // 				return $this->onAccept($page);
         // 			case 'accept':
         // 				return $this->onAccept($page);
         case 'delete':
             return $this->onDelete($page);
         default:
             return GWF_HTML::err('ERR_PARAMETER', array(__FILE__, __LINE__, 'action'));
     }
 }