function session_extraction() { $superCage = Inspekt::makeSuperCage(); if ($superCage->cookie->keyExists('session_id')) { $session_id = $superCage->cookie->getEscaped('session_id'); $sql = "SELECT member_id, member_login_key FROM {$this->sessionstable} AS s INNER JOIN {$this->usertable} AS u ON s.member_id = u.id WHERE s.id = '{$session_id}'"; $result = $this->query($sql); if (cpg_db_num_rows($result)) { $row = cpg_db_fetch_row($result); $result->free(); return $row; } } else { return false; } }
function session_extraction() { $superCage = Inspekt::makeSuperCage(); if ($superCage->cookie->keyExists($this->cookie_name . '_sid')) { $this->session_id = $superCage->cookie->getEscaped($this->cookie_name . '_sid'); $sql = "SELECT user_id, user_password, group_id FROM {$this->sessionstable} INNER JOIN {$this->usertable} ON session_user_id = user_id WHERE session_id = '{$this->session_id}'"; $result = $this->query($sql); if (cpg_db_num_rows($result)) { $row = cpg_db_fetch_array($result); $this->primary_group = array_pop($row); return $row['user_id'] == 1 ? false : $row; } else { return false; } $result->free(); } }
function session_extraction() { $superCage = Inspekt::makeSuperCage(); if ($superCage->cookie->keyExists($this->cookie_name . 'sessionhash')) { $session_id = $superCage->cookie->getEscaped($this->cookie_name . 'sessionhash'); } elseif ($superCage->cookie->keyExists($this->cookie_name . '_sessionhash')) { $session_id = $superCage->cookie->getEscaped($this->cookie_name . '_sessionhash'); } $sql = "SELECT u.{$this->field['user_id']}, u.{$this->field['password']}, u.{$this->field['grouptbl_group_id']}+100 AS usergroupid FROM {$this->usertable} AS u, {$this->sessionstable} AS s WHERE s.{$this->field['user_id']}=u.{$this->field['user_id']} AND s.sessionhash='{$session_id}'"; $result = $this->query($sql); if (cpg_db_num_rows($result)) { $row = cpg_db_fetch_array($result); $result->free(); return $row; } else { return false; } }
function session_extraction() { $superCage = Inspekt::makeSuperCage(); if (!$superCage->cookie->keyExists('sid')) { return false; } $this->sid = $superCage->cookie->getEscaped('sid'); if (!$this->sid) { return false; } $result = $this->query("SELECT u.{$this->field['user_id']}, u.{$this->field['password']}, additionalgroups\n FROM {$this->sessionstable} AS s\n INNER JOIN {$this->usertable} AS u ON u.uid = s.uid\n WHERE sid = '" . $this->sid . "'"); if (!cpg_db_num_rows($result)) { return false; } $row = cpg_db_fetch_row($result); $result->free(); $this->additionalgroups = array_pop($row); $this->logoutkey = md5($row[1]); return $row; }
function get_groups($row) { $id = $row['id']; $sql = "SELECT id FROM {$this->groupstable}, {$this->usertable} WHERE {$this->field['usertbl_group_id']} = {$this->field['grouptbl_group_id']} AND {$this->field['user_id']}='{$id}'"; $result = $this->query($sql); if (cpg_db_num_rows($result)) { $row = cpg_db_fetch_row($result); if ($this->use_post_based_groups) { $row = array($row[0] + 100); } else { if (in_array($row[0], $this->admingroups)) { $row = array(1); } else { $row = array(2); } } $result->free(); return $row; } else { return false; } }
function _session_load() { $superCage = Inspekt::makeSuperCage(); if ($superCage->cookie->keyExists('PHPSESSID')) { $session_id = $superCage->cookie->getEscaped('PHPSESSID'); $sql = "SELECT data FROM {$this->sessionstable} WHERE session_id = '{$session_id}'"; $result = $this->query($sql); if (cpg_db_num_rows($result)) { list($data) = cpg_db_fetch_row($result); session_name('CPG'); session_start(); session_decode($data); $session = $_SESSION; return $session; } $result->free(); } return false; }