public function pre() { $this->user = Authenticate::session(); if (!is_a($this->user, 'Kadmin')) { throw new Exception('Not Authorized', 401); } }
public function pre() { $this->user = Authenticate::session(); if (!is_a($this->user, 'Kadmin') || $this->user->getType() != 'admin') { throw new Exception('Not Authorized', 401); } $this->targetLanguage = 'en'; C::s('LANG_DIR', realpath(ROOTDIR . '../locale/')); $this->path = C::g('LANG_DIR') . '/' . C::g('LANG_AVAILABLE', $this->targetLanguage) . '/LC_MESSAGES/'; }
public function pre() { $this->user = Authenticate::session(); if (!is_a($this->user, 'Kadmin') || $this->user->getType() != 'admin') { throw new Exception('Not Authorized', 401); } if (is_string($this->param2) && !empty($this->param2)) { $this->block = Block::getById($this->param2); } }
public function pre() { $this->user = Authenticate::session(); if (!is_a($this->user, 'Kadmin')) { throw new Exception('Not Authorized', 401); } if (MongoId::isValid($this->param2)) { $this->page = KLib\instance::of('Page', $this->param2); } }
<?php session_name('KNSESSID'); session_start(); require_once __DIR__ . '/../global.inc.php'; $user = Authenticate::session(); if (!is_a($user, 'Kadmin')) { header('HTTP/1.1 401 Authorization Required'); exit(0); } $config = (include 'config/config.php'); //TODO switch to array extract($config, EXTR_OVERWRITE); include 'include/utils.php'; if ($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager") { response('forbiden', 403)->send(); exit; } include 'include/mime_type_lib.php'; if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== false || strpos($_POST['path'], './') === 0) { response('wrong path', 400)->send(); exit; } if (strpos($_POST['name'], '/') !== false) { response('wrong path', 400)->send(); exit; } $path = $current_path . $_POST['path']; $name = $_POST['name']; $info = pathinfo($name); if (!in_array(fix_strtolower($info['extension']), $ext)) {