Beispiel #1
0
 /**
  * @param $method
  * @param array $viewData
  * @param array $params
  * @return mixed
  */
 public function runAction($method, array $viewData = [], array $params = [])
 {
     if (!$this->canRunAction($method, $params)) {
         return $this->actionNotFound($method);
     }
     if (!$this->group->processBinds($params, $this->requestData)) {
         return $this->actionNotFound($method);
     }
     $this->requestData = array_merge($viewData, $this->requestData);
     $this->requestParams = $params;
     $result = $this->group->runBeforeCallback($this);
     if ($result) {
         return $result;
     }
     if ($_action = $this->getAction('_before')) {
         $result = call_user_func_array($_action, [$this, $params]);
         if ($result) {
             return $result;
         }
     }
     if ($action = $this->getAction($method)) {
         $result = call_user_func_array($action, [$this, $params]);
         if ($result) {
             return $result;
         }
     }
     if ($_action = $this->getAction('_after')) {
         $result = call_user_func_array($_action, [$this, $params]);
         if ($result) {
             return $result;
         }
     }
     $event = ($this->adminOnly() ? 'page.admin:' : 'page:') . $this->slug;
     \Event::fire($event . $this->slug, [&$this]);
     $event .= ':' . $method;
     \Event::fire($event . $this->slug, [&$this]);
 }
Beispiel #2
0
            $this->dbObj->Execute('DELETE FROM ' . WEB_ADMIN_TABPOX . 'grouprole WHERE groupid = ' . $id);
            $this->dbObj->Execute('DELETE FROM ' . WEB_ADMIN_TABPOX . 'groupmanager WHERE groupid = ' . $id);
            $this->dbObj->Execute('UPDATE ' . WEB_ADMIN_TABPOX . "group SET groupname = '" . $_POST['groupname'] . "' WHERE groupid = " . $id);
        } else {
            $info = '增加';
            $this->dbObj->Execute('INSERT INTO ' . WEB_ADMIN_TABPOX . 'group(groupname,importer,agencyid)VALUES' . "('" . $_POST['groupname'] . "'," . $this->getUid() . "," . $_SESSION["currentorgan"] . ")");
            $id = $this->dbObj->Insert_ID(WEB_ADMIN_TABPOX . 'group', 'groupid');
        }
        if (isset($_POST['roleids'])) {
            foreach ($_POST['roleids'] as $v) {
                $this->dbObj->Execute('INSERT INTO ' . WEB_ADMIN_TABPOX . 'grouprole(roleid,groupid,importer)VALUES(' . $v . ',' . $id . ',' . $this->getUid() . ')');
            }
        }
        if (isset($_POST['manages'])) {
            foreach ($_POST['manages'] as $v) {
                $this->dbObj->Execute('INSERT INTO ' . WEB_ADMIN_TABPOX . "groupmanager(groupid,userid,importer)values({$id},{$v}," . $this->getUid() . ")");
            }
        }
        $this->quit($info . '完成!');
    }
    function goModify()
    {
        $this->goAppend();
    }
    function quit($info)
    {
        exit("<script>alert('{$info}');location.href='group.php';</script>");
    }
}
$main = new PageGroup();
$main->Main();