log_auth("xxx", sprintf("Challenges::add [%s]\n", $login));
// FIXME Checks here
if ($login == '') {
- return ($G_false);
+ return (FALSE);
}
// log_auth("xxx", "LOOPI tstamp: ".$this->item[$i]->tstamp." curtime: ".$curtime);
- if (($chal = new Challenge($login, $token, $ip, $tstamp)) == null) {
- return ($G_false);
+ if (($chal = new Challenge($login, $token, $ip, $tstamp)) == FALSE) {
+ return (FALSE);
}
$this->item[$this->item_n] = $chal;
}
// Static functions
- static function &create()
+ static function create()
{
$chal =& new Challenges();
return $chal;
}
- function &load_data()
+ function load_data()
{
- GLOBAL $G_false, $sess;
+ GLOBAL $sess;
$doexit = FALSE;
do {
if (($tok = @ftok(FTOK_PATH."/challenges", "B")) == -1) {
$chals->garbage_manager();
- $ret = &$chals;
- return ($ret);
+ return ($chals);
} while (0);
if ($doexit)
exit();
- return ($G_false);
+ return (FALSE);
}
- function save_data(&$chals)
+ function save_data($chals)
{
$shm = FALSE;
$oldmod = $chals->mod;
);
-$G_false = FALSE;
$G_lng = langtolng($G_lang);
$G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 );
{
}
- function &create($idx)
+ function create($idx)
{
- GLOBAL $G_false;
-
if (($thiz =& new Table()) == FALSE)
- return ($G_false);
+ return (FALSE);
$thiz->idx = $idx;
$thiz->player = array();
return ($thiz);
}
- function copy(&$from)
+ function copy($from)
{
- GLOBAL $G_false;
-
$this->idx = $from->idx;
$this->player = array();
for ($i = 0 ; $i < $from->player_n ; $i++)
$this->wakeup_time = $from->wakeup_time;
}
- function &myclone(&$from)
+ function myclone($from)
{
- GLOBAL $G_false;
-
if (($thiz =& new Table()) == FALSE)
- return ($G_false);
+ return (FALSE);
$this->copy($from);
return ($thiz);
}
- function &spawn(&$from)
+ function spawn($from)
{
- GLOBAL $G_false;
-
if (($thiz =& new Table()) == FALSE)
- return ($G_false);
+ return (FALSE);
$thiz->idx = $from->idx;
$thiz->player = array();
return ($thiz);
}
- function wag_set(&$user, $mesg)
+ function wag_set($user, $mesg)
{
log_main("WAG_SET");
- $this->wag_own = &$user;
+ $this->wag_own = $user;
$this->wag_com = $mesg;
$this->wag_tout = 0;
}
function User() {
}
- function &create($idx, $name, $sess, $stat = "", $subst = "", $table = -1, $ip="0.0.0.0") {
- GLOBAL $G_false;
-
+ function create($idx, $name, $sess, $stat = "", $subst = "", $table = -1, $ip="0.0.0.0") {
// error_log("User::create BEGIN", 0);
if (($thiz =& new User()) == FALSE)
- return ($G_false);
+ return (FALSE);
$thiz->idx = $idx;
$thiz->code = -1;
return ($thiz);
}
- function copy(&$from)
+ function copy($from)
{
- GLOBAL $G_false;
-
$this->idx = $from->idx;
$this->code = $from->code;
$this->name = $from->name;
}
- function &myclone(&$from)
+ function myclone($from)
{
- GLOBAL $G_false;
-
if (($thiz =& new User()) == FALSE)
- return ($G_false);
+ return (FALSE);
$thiz->copy($from);
return ($thiz);
}
- function &spawn(&$from, $table, $table_pos)
+ function spawn($from, $table, $table_pos)
{
- GLOBAL $G_false;
-
if (($thiz =& new User()) == FALSE)
- return ($G_false);
+ return (FALSE);
$thiz->idx = $from->idx;
$thiz->code = $from->code;
// SHSPLIT save and load function for the User class.
- function &load_data($id)
+ function load_data($id)
{
- GLOBAL $G_false, $sess;
+ GLOBAL $sess;
// error_log("User::load_data BEGIN", 0);
//
// SHSPLIT: load users from the shared memory
//
- $ret = &$user;
- return ($ret);
+ return ($user);
} while (0);
if ($doexit)
exit();
- return ($G_false);
+ return (FALSE);
}
return;
} // function chatt_send( ...
- function &get_user($sess, &$idx)
+ function get_user($sess, &$idx)
{
- GLOBAL $PHP_SELF, $G_false;
+ GLOBAL $PHP_SELF;
if (validate_sess($sess)) {
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
log_main(sprintf("get_user: Wrong strlen [%s]",$sess));
}
- return ($G_false);
+ return (FALSE);
}
/*
- * function &add_user(&$room, &$sess, &$idx, $name, $pass, $ip)
+ * function add_user(&$room, &$sess, &$idx, $name, $pass, $ip)
*
* RETURN VALUE:
* if ($idx > -1 && ret == FALSE) => duplicated nick
* if ($idx == -$idx && ret == user) => SUCCESS (but the login exists in the auth db)
*/
- function &add_user(&$sess, &$idx, $name, $pass, $ip)
+ function add_user(&$sess, &$idx, $name, $pass, $ip)
{
- GLOBAL $G_base, $G_false, $CO_list;
+ GLOBAL $G_base, $CO_list;
$idx = 0;
- error_log("add_user: G_false: [".$G_false."]", 0);
-
$authenticate = FALSE;
$user_type = 0;
$login_exists = FALSE;
if (($name_new = validate_name($name)) == FALSE) {
$idx = -2;
- return ($G_false);
+ return (FALSE);
}
log_auth("XXX", sprintf("ARRIVA: [%s] pass:[%s]", $sess, ($pass == FALSE ? "FALSE" : $pass)));
log_auth("XXX", "authenticate: ".($authenticate != FALSE ? "TRUE" : "FALSE"));
if ($authenticate != FALSE) {
- error_log(print_r(&$authenticate, TRUE),0);
+ // error_log(print_r(&$authenticate, TRUE),0);
$user_type = $authenticate->type_get();
}
else {
$idx = -3;
- return ($G_false);
+ return (FALSE);
}
}
else {
return ($ret);
}
- return ($G_false);
+ return (FALSE);
}
- function standup_update(&$user)
+ function standup_update($user)
{
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
$user_cur = &$this->user[$i];
}
// Static functions
- static function &create()
+ static function create()
{
- $room =& new Room();
+ $room = new Room();
return $room;
}
- function &load_data()
+ function load_data()
{
- GLOBAL $G_false, $sess;
+ GLOBAL $sess;
$doexit = FALSE;
// error_log("Room::load_data BEGIN", 0);
// error_log("DE CHE", 0);
- $room =& Room::create();
+ $room = Room::create();
if (Room::save_data($room) == FALSE)
- return $G_false;
+ return FALSE;
return $room;
}
//
// SHSPLIT: load users from the shared memory
//
- $ret = &$room;
- return ($ret);
+ return ($room);
} while (0);
if ($doexit)
exit();
- return ($G_false);
+ return (FALSE);
}
$this->type = $type;
}
- static function &LoginDBItemFromRecord($rec)
+ static function LoginDBItemFromRecord($rec)
{
- $ret =& new LoginDBItem($rec->code, $rec->login, $rec->pass,
+ $ret = new LoginDBItem($rec->code, $rec->login, $rec->pass,
$rec->email, $rec->type);
return ($ret);
log_main("BriskDB create:end");
}
- static function &create()
+ static function create()
{
$ret = new BriskDB();
return ($this->item[$idx]->login);
}
- function &getitem_bylogin($login, &$id)
+ function getitem_bylogin($login, &$id)
{
- GLOBAL $G_false;
-
log_main("login_exists: ".$login);
/* check the existence of the nick in the BriskDB */
}
}
$id = -1;
- return ($G_false);
+ return (FALSE);
}
function getmail($login)
return (FALSE);
}
- function &login_verify($login, $pass)
+ function login_verify($login, $pass)
{
- GLOBAL $G_false;
-
- $ret = &$G_false;
+ $ret = FALSE;
log_main("login_verify: ".$login);
$this->db = DBConn::$dbcnnx;
}
- static function &create()
+ static function create()
{
- GLOBAL $G_dbauth, $G_false;
+ GLOBAL $G_dbauth;
- $ret = &$G_false;
-
if (DBConn::$dbcnnx == FALSE) {
if (!(DBConn::$dbcnnx = @pg_connect ($G_dbauth))) {
- return ($ret);
+ return (FALSE);
}
}
$this->dbconn = $dbconn;
}
- static function &create()
+ static function create()
{
- GLOBAL $DOCUMENT_ROOT, $G_dbpfx, $G_false;
+ GLOBAL $DOCUMENT_ROOT, $G_dbpfx;
$ret = FALSE;
$ret = new BriskDB($dbconn);
} while (0);
- if ($ret)
- return ($ret);
- else
- return ($G_false);
+ return ($ret);
}
function users_load()
return FALSE;
}
- function &getrecord_bylogin($login) {
- GLOBAL $G_false, $G_dbpfx;
+ function getrecord_bylogin($login) {
+ GLOBAL $G_dbpfx;
$user_sql = sprintf("SELECT * FROM %susers WHERE login = lower('%s') AND (type & CAST (X'%08x' as integer)) = 0;", $G_dbpfx, escsql($login), USER_FLAG_TY_DISABLE);
if (($user_pg = pg_query($this->dbconn->db(), $user_sql)) == FALSE)
- return $ret;
+ return FALSE;
if (pg_numrows($user_pg) != 1)
- return $ret;
+ return FALSE;
$user_obj = pg_fetch_object($user_pg, 0);
- function &login_verify($login, $pass)
+ function login_verify($login, $pass)
{
- GLOBAL $G_dbpfx, $G_false;
+ GLOBAL $G_dbpfx;
- error_log("dbase_pgsql G_false: [".$G_false."]", 0);
-
$ret = FALSE;
log_main("login_verify: ".$login);
//O log_main("login_verify: BEGIN");
if (($user_obj = $this->getrecord_bylogin($login)) == FALSE) {
- return $G_false;
+ return FALSE;
}
- error_log("G_false: [".$G_false."] user_obj: ".print_r($user_obj, TRUE), 0);
-
log_main("login[".$user_obj->code."]: ".$user_obj->login);
/* if it exists check for a valid challenge */
if (($a_sem = Challenges::lock_data()) != FALSE) {
- error_log("loop-2", 0);
+ // error_log("loop-2", 0);
if (($chals = &Challenges::load_data()) != FALSE) {
- error_log("loop-1", 0);
+ // error_log("loop-1", 0);
for ($e = 0 ; $e < $chals->item_n ; $e++) {
- error_log("loop", 0);
+ // error_log("loop", 0);
log_main("challenge[".$e."]: ".$chals->item[$e]->login);
if (strcmp($login, $chals->item[$e]->login) == 0) {
- error_log("loop2", 0);
+ // error_log("loop2", 0);
log_main("login_verify [".$pass."] with [".md5($chals->item[$e]->token.$user_obj->pass)."]");
if (strcmp($pass, md5($chals->item[$e]->token.$user_obj->pass)) == 0) {
- error_log("loop3", 0);
+ // error_log("loop3", 0);
log_main("login_verify SUCCESS for ".$login);
$chals->rem($login);
$ret = LoginDBItem::LoginDBItemFromRecord($user_obj);
- error_log("dbitem: ".print_r($ret, TRUE));
+ // error_log("dbitem: ".print_r($ret, TRUE));
break;
}
}
} // end for ($e = 0 ...
- error_log("end loop-1", 0);
+ // error_log("end loop-1", 0);
}
if ($chals->ismod()) {
// O } // if (strcasecmp($this->item[$i]->login, ...
//O }
- error_log("return: ".($G_false == FALSE ? "FALSE" : "not FALSE"), 0);
-
- if ($ret)
- return ($ret);
- else
- return ($G_false);
+ return ($ret);
}
- function &getitem_bylogin($login, &$id) {
- GLOBAL $G_false;
-
- $ret = &$G_false;
+ function getitem_bylogin($login, &$id) {
+ $ret = FALSE;
$id = -1;
log_main("getitem_bylogin: ".$login);
return TRUE;
}
- function &getdbconn()
+ function getdbconn()
{
- $ret = $this->dbconn;
- return ($ret);
+ return ($this->dbconn);
}
// ttok text UNIQUE,
log_auth("xxx", sprintf("Hardbans::add [%s]\n", $login));
- if (($chal = new Hardban($login, $ip, $session, $timeout)) == null) {
- return ($G_false);
+ if (($chal = new Hardban($login, $ip, $session, $timeout)) == FALSE) {
+ return (FALSE);
}
$this->item[$this->item_n] = $chal;
}
// Static functions
- static function &create()
+ static function create()
{
$chal =& new Hardbans();
return $chal;
}
- function &load_data()
+ function load_data()
{
- GLOBAL $G_false, $sess;
+ GLOBAL $sess;
$doexit = FALSE;
do {
if (($tok = @ftok(FTOK_PATH."/hardbans", "B")) == -1) {
$hban->garbage_manager(TRUE);
- $ret = &$hban;
- return ($ret);
+ return ($hban);
} while (0);
if ($doexit)
exit();
- return ($G_false);
+ return (FALSE);
}
- function save_data(&$hban)
+ function save_data($hban)
{
$shm = FALSE;
$oldmod = $hban->mod;
/* CREATE() NOT USED
- function &create($idx)
+ function create($idx)
{
- GLOBAL $G_false;
-
if (($thiz =& new Table_briskin5()) == FALSE)
- return ($G_false);
+ return (FALSE);
$thiz->create($idx);
*/
/* CLONE() NOT USED
- function &myclone(&$from)
+ function myclone(&$from)
{
- GLOBAL $G_false;
-
if (($thiz =& new Table_briskin5()) == FALSE)
- return ($G_false);
+ return (FALSE);
parent::copy($from);
parent::copy($from);
}
- function &spawn(&$from)
+ function spawn(&$from)
{
- GLOBAL $G_false;
-
if (($thiz =& new Table_briskin5()) == FALSE)
- return ($G_false);
+ return (FALSE);
$thiz->parentcopy($from);
log_main("PLAYER_N - spawn.".$thiz->player_n);
- $thiz->card = &$thiz->bunch_create();
+ $thiz->card = array();
+ $thiz->bunch_create();
$thiz->mazzo = rand(0,PLAYERS_N-1);
$thiz->points_n = 0;
$thiz->mult = 1;
}
- function &bunch_create()
- {
- $ret = array();
-
- for ($i = 0 ; $i < (BRISKIN5_PLAYERS_N == 5 ? 40 : 24) ; $i++) {
- // for ($i = 0 ; $i < 40 ; $i++) {
- $ret[$i] =& new Card($i, 'bunch', 'no_owner');
- }
+ // function bunch_create_old() function AND
+ // {
+ // $ret = array();
+ //
+ // for ($i = 0 ; $i < (BRISKIN5_PLAYERS_N == 5 ? 40 : 24) ; $i++) {
+ // // for ($i = 0 ; $i < 40 ; $i++) {
+ // $ret[$i] =& new Card($i, 'bunch', 'no_owner');
+ // }
+ //
+ // $oret = &$ret;
+ // return ($oret);
+ // }
- $oret = &$ret;
- return ($oret);
+ function bunch_create()
+ {
+ $ret = array();
+
+ for ($i = 0 ; $i < (BRISKIN5_PLAYERS_N == 5 ? 40 : 24) ; $i++) {
+ $this->card[$i] = new Card($i, 'bunch', 'no_owner');
+ }
}
function bunch_make()
}
/* CREATE NOT USED
- function &create($name, $sess, $stat = "", $subst = "", $table = -1, $ip="0.0.0.0") {
- GLOBAL $G_false;
-
+ function create($name, $sess, $stat = "", $subst = "", $table = -1, $ip="0.0.0.0") {
if (($thiz =& new User()) == FALSE)
- return ($G_false);
+ return (FALSE);
$thiz->asta_card = -2;
$thiz->asta_pnt = -1;
}
/* CLONE NOT USED
- function &myclone(&$from)
+ function myclone(&$from)
{
- GLOBAL $G_false;
-
if (($thiz =& new User()) == FALSE)
- return ($G_false);
+ return (FALSE);
$thiz->copy($from);
}
*/
- function &spawn(&$from, $table, $table_pos)
+ function spawn(&$from, $table, $table_pos)
{
- GLOBAL $G_false, $CO_bin5_pref_ring_endauct;
+ GLOBAL $CO_bin5_pref_ring_endauct;
if (($thiz =& new User_briskin5()) == FALSE)
- return ($G_false);
+ return (FALSE);
$thiz->parentcopy($from);
}
- function &get_user($sess, &$idx)
+ function get_user($sess, &$idx)
{
- GLOBAL $PHP_SELF, $G_false;
+ GLOBAL $PHP_SELF;
if (validate_sess($sess)) {
for ($i = 0 ; $i < BRISKIN5_MAX_PLAYERS ; $i++) {
log_main(sprintf("get_user: Wrong strlen [%s]",$sess));
}
- return ($G_false);
+ return (FALSE);
}
//
// static functions
//
- function &load_data($table_idx, $table_token = "")
+ function load_data($table_idx, $table_token = "")
{
GLOBAL $G_false, $sess;
$doexit = FALSE;
if ($doexit)
exit();
- return ($G_false);
+ return (FALSE);
}
$this->gam = $gam;
}
- function &myclone()
+ function myclone()
{
$ret = new Ptsgam($this->username, $this->pts, $this->gam);
}
-function placing_show_file(&$user, $ty, $subty)
+function placing_show_file($user, $ty, $subty)
{
$tail = FALSE;
GLOBAL $G_with_topbanner, $G_topbanner, $G_is_local;
GLOBAL $G_with_sidebanner, $G_sidebanner;
GLOBAL $G_with_sidebanner2, $G_sidebanner2;
- GLOBAL $G_with_poll, $G_false;
+ GLOBAL $G_with_poll;
GLOBAL $sess, $name, $pass_private, $table_idx, $table_token, $BRISK_SHOWHTML, $BRISK_DEBUG, $_SERVER;
GLOBAL $G_lang, $G_lng, $mlang_room;
$is_login = FALSE;
$standup = "";
$ACTION = "login";
- error_log("main: G_false: [".$G_false."]", 0);
-
if (isset($BRISK_SHOWHTML) == FALSE) {
$is_table = FALSE;
$sem = Room::lock_data();
echo show_notify(str_replace("\n", " ", $G_room_roadmap[$G_lang]), 0, $mlang_indwr['btn_close'][$G_lang], 400, 200);
}
else if ($argz[0] == 'placing') {
- GLOBAL $G_false;
-
require_once("briskin5/Obj/briskin5.phh");
require_once("briskin5/Obj/placing.phh");
- echo show_notify(str_replace("\n", " ", placings_show($G_false)), 0, $mlang_indwr['btn_close'][$G_lang], 800, 600);
+ echo show_notify(str_replace("\n", " ", placings_show(FALSE)), 0, $mlang_indwr['btn_close'][$G_lang], 800, 600);
}
else if ($argz[0] == 'whysupport') {
echo show_notify(str_replace("\n", " ", $G_room_whysupport[$G_lang]), 0, $mlang_indwr['btn_close'][$G_lng], 400, 200);