diff options
Diffstat (limited to 'app/class/Controllerpage.php')
-rw-r--r-- | app/class/Controllerpage.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/class/Controllerpage.php b/app/class/Controllerpage.php index e12d76e..75ac6cf 100644 --- a/app/class/Controllerpage.php +++ b/app/class/Controllerpage.php @@ -156,6 +156,7 @@ class Controllerpage extends Controller $filedir = Model::HTML_RENDER_DIR . $id . '.html'; if(file_exists($filedir)) { $html = file_get_contents($filedir); + sleep($this->page->sleep()); echo $html; } else { echo 'Please render this page'; @@ -203,9 +204,13 @@ class Controllerpage extends Controller public function log($id) { - $this->setpage($id, 'pagelog'); - $this->importpage(); - var_dump($this->page); + if($this->user->issupereditor()) { + $this->setpage($id, 'pagelog'); + $this->importpage(); + var_dump($this->page); + } else { + $this->routedirect('pageread/', ['page' => $id]); + } } public function add($id) @@ -216,6 +221,7 @@ class Controllerpage extends Controller if ($this->user->iseditor() && !$this->importpage()) { $this->page->reset(); + $this->page->addauthor($this->user->id()); if (!empty(Config::defaultpage())) { $defaultpage = $this->pagemanager->get(Config::defaultpage()); if ($defaultpage !== false) { @@ -236,7 +242,7 @@ class Controllerpage extends Controller public function confirmdelete($id) { $this->setpage($id, 'pageconfirmdelete'); - if ($this->user->iseditor() && $this->importpage()) { + if ($this->importpage() && ($this->user->issupereditor() || $this->page->authors() === [$this->user->id()] )) { $this->showtemplate('confirmdelete', ['page' => $this->page, 'pageexist' => true]); |