public function request($arg)
 {
     $this->cache = false;
     if (!tguard::post()) {
         return;
     }
     $antispam = isset($_POST['antispam']) ? $_POST['antispam'] : '';
     if (!$this->checkspam($antispam)) {
         return 403;
     }
     $password = isset($_POST['password']) ? trim($_POST['password']) : '';
     if ($password == '') {
         return;
     }
     if (!isset($this->perm)) {
         $idperm = isset($_GET['idperm']) ? (int) $_GET['idperm'] : 0;
         $perms = tperms::i();
         if (!$perms->itemexists($idperm)) {
             return 403;
         }
         $this->perm = tperm::i($idperm);
     }
     $backurl = isset($_GET['backurl']) ? $_GET['backurl'] : '';
     if ($this->perm->checkpassword($password)) {
         if ($backurl != '') {
             litepublisher::$urlmap->redir($backurl);
         }
     } else {
         $this->formresult = $this->invalidpassword;
     }
 }
 public function request($arg)
 {
     $this->cache = false;
     tlocal::usefile('admin');
     $this->formresult = '';
     if (tguard::post()) {
         $this->formresult = $this->processform();
     }
 }
 public function auth()
 {
     if ($s = tguard::checkattack()) {
         return $s;
     }
     if (!litepublisher::$options->authcookie()) {
         return litepublisher::$urlmap->redir('/admin/login/');
     }
 }
 public function request($arg)
 {
     if (litepublisher::$options->commentsdisabled) {
         return 404;
     }
     if ('POST' != $_SERVER['REQUEST_METHOD']) {
         return "<?php\n      header('HTTP/1.1 405 Method Not Allowed', true, 405);\n      header('Allow: POST');\n      header('Content-Type: text/plain');\n      ?>";
     }
     tguard::post();
     return $this->dorequest($_POST);
 }
 public function request($id)
 {
     if ($s = tguard::checkattack()) {
         return $s;
     }
     if (!litepublisher::$options->user) {
         return litepublisher::$urlmap->redir('/admin/login/' . litepublisher::$site->q . 'backurl=' . urlencode(litepublisher::$urlmap->url));
     }
     if (!litepublisher::$options->hasgroup('editor')) {
         $url = tusergroups::i()->gethome(litepublisher::$options->group);
         return litepublisher::$urlmap->redir($url);
     }
     tlocal::usefile('admin');
 }
示例#6
0
 public static function post()
 {
     if (is_bool(self::$posted)) {
         return self::$posted;
     }
     self::$posted = false;
     if (!isset($_POST) || !count($_POST)) {
         return false;
     }
     if (get_magic_quotes_gpc()) {
         foreach ($_POST as $name => $value) {
             $_POST[$name] = stripslashes($_POST[$name]);
         }
     }
     self::$posted = true;
     return true;
 }
 public function getargs()
 {
     if (isset($_GET['method'])) {
         return $_GET;
     }
     if (isset($_POST['method'])) {
         tguard::post();
         return $_POST;
     }
     if (isset($_POST['json'])) {
         tguard::post();
         if (($s = trim($_POST['json'])) && ($args = json_decode($s, true))) {
             if (isset($args['method'])) {
                 return $args;
             }
         }
     }
     if ($args = $this->get_json_args()) {
         if (isset($args['method'])) {
             return $args;
         }
     }
     return false;
 }
示例#8
0
 protected function doprocessform()
 {
     if (tguard::post()) {
         litepublisher::$urlmap->clearcache();
     }
     return parent::doprocessform();
 }
示例#9
0
 protected function doprocessform()
 {
     if (tguard::post()) {
         $this->formresult .= $this->processform();
     }
 }