Example #1
0
 function check($c, $p)
 {
     $c->log($p);
     $mdpass = md5($p['loginPassword']);
     $data = g::db()->getRows("SELECT count(*) as 'result' ,`u_id`,permission_id, limit_mac,u_room FROM  `user` where u_username = '******'loginName']}' and u_password = '******' ");
     $c->log($data[0]);
     $isAdmin = false;
     if ($data[0][permission_id] == 0) {
         $isAdmin = true;
     }
     if ($data[0][result] == 1) {
         $u = new gzUser();
         $u->id = $data[0]['u_id'];
         $u->isAuthcate = true;
         $u->isAdmin = $isAdmin;
         $u->limit_mac = $data[0]["limit_mac"];
         $u->name = $data[0]["u_room"];
         g::$session->setUser($u);
         g::$session->writeClose();
         unset($u->loginPassword);
         $c->data(array("user" => $u))->send(true);
     } else {
         $c->send(false);
     }
     $c->send(false);
 }
Example #2
0
 public function removeUser($c, $p)
 {
     g::db()->exec("DELETE FROM `authenuser` WHERE `a_id` = ?", array($p['a_id']));
     $data = Router::comm('/ip/hotspot/user/remove', array(".id" => "*" . $p['id']));
     if (empty($data)) {
         $c->send(true);
     }
     $c->send(false);
 }
Example #3
0
 function db_goDelete($c, $p)
 {
     g::db()->exec('delete from table1 where id=?', array($p['id']));
     $c->send(true);
 }
Example #4
0
 public function removeUserlogin($c, $p)
 {
     $c->log($p['u_id']);
     g::db()->exec("DELETE FROM `user` WHERE `u_id` = ?", array($p['u_id']));
     $c->send(true);
 }
Example #5
0
 function removeRow($c, $p)
 {
     g::db()->exec("DELETE FROM `{$this->table}` WHERE `{$this->table}`.`hierarchy_id` = ?", array($p['hierarchy_id']));
     $c->send(true);
 }
Example #6
0
 public static function db()
 {
     if (isset(self::$db)) {
         return self::$db;
     }
     return self::$db = new gzDatabaseConnectionP(CDB_HOST, CDB_PORT, CDB_DATABASE, CDB_USERNAME, CDB_PASSWORD);
 }