Exemplo n.º 1
0
 /**
  * Verifies that the user is at least an admin (which means that he is an admin or a master).
  * @return bool
  * true if ok<br />
  * Redirects with a 403 error if not
  */
 protected function onlyAdmin($thisIsAnAdminPage = false)
 {
     if ($thisIsAnAdminPage) {
         $this->helper->isAdminPage(true);
     }
     if (!$this->isAdmin()) {
         $this->linker->path->error('403');
     }
     return true;
 }
Exemplo n.º 2
0
 /**
  * public function write
  *
  */
 public function write()
 {
     if (!$this->onlyWriteDifferences) {
         $valuesToWrite = $this->values;
     } else {
         $valuesToWrite = $this->helper->array_diff_assoc_recursive($this->values, $this->fileValues);
     }
     $ret = sh_helper::writeArrayInFile($this->fileToWrite, 'this->values', $valuesToWrite, false);
     $this->reload();
     return $ret;
 }