Commit 7368ef80 authored by thejoelinux's avatar thejoelinux

correction session + 2 controllers

parent 75ebc9cf
......@@ -3,7 +3,7 @@
// You will need this if you have more than one webserver
// to enable the persistence of sessions accross different front servers.
class session_saas {
class session_saas implements SessionHandlerInterface {
private $life_time = 0;
private $debug = false;
......@@ -12,14 +12,7 @@ class session_saas {
if($this->debug) {
trigger_error('session_saas::__construct called', E_USER_NOTICE);
}
session_set_save_handler(
array(&$this, 'open'),
array(&$this, 'close'),
array(&$this, 'read'),
array(&$this, 'write'),
array(&$this, 'destroy'),
array(&$this, 'gc')
);
session_set_save_handler($this);
// session_name("whatever");
$this->life_time = ini_get('session.gc_maxlifetime');
// -- Define a lifetime on session cookie
......@@ -39,7 +32,7 @@ class session_saas {
return true;
}
public function open() {
public function open($save_path, $session_name) {
if($this->debug) {
trigger_error('session_saas::open called', E_USER_NOTICE);
}
......@@ -93,7 +86,7 @@ class session_saas {
);
$context = stream_context_create($opts);
if(file_get_contents($GLOBALS["saas_sessions_url"], false, $context)) {
if(!file_get_contents($GLOBALS["saas_sessions_url"], false, $context)) {
return false;
}
return true;
......
......@@ -58,7 +58,7 @@ class GamesController extends AppController {
return "games/edit";
}
function _edit() {
function _edit($success = 'edit') {
$game = Game::fetch($GLOBALS["data"]->db_escape_string($_REQUEST["i"]));
if($this->format == "json") {
echo json_encode($game);
......@@ -177,7 +177,7 @@ class GamesController extends AppController {
}
}
function _list() {
function _list($method = 'fetch_all') {
if($this->format == "json") {
parent::_list();
}
......
......@@ -70,7 +70,7 @@ class MembersController extends AppController {
}
}
function _edit() {
function _edit($success = 'edit') {
try {
$member = Member::fetch($GLOBALS["data"]->db_escape_string($_REQUEST["i"]));
if($member->id != 0) {
......@@ -286,7 +286,7 @@ class MembersController extends AppController {
}
}
function _list() {
function _list($method = 'fetch_all') {
if($this->format == "json") {
parent::_list();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment