FEATURES |
----------+
+ * Users Network construction
+ DONE - sql
+ - dbase API
+ - enhance info interface
+ . disable parts of interface
+ - minisplash at end of the match
+
+ * Double click on chat to open preferences
+
+ * APPRENTICE
+ Phase2
+ DONE - match counters (part 2)
+ DONE . migration script for old users
+ - guarantee for apprentice
+
+ BUGS |
+ ------+
- Global vars checker
+ - Remove books from chat
+ - Not triple chars between letters
+ - 10002 message when already clicked
+
+
+---------
+ - APPRENTICE
+ Phase2
+ DONE - match counters (part 2)
+ DONE . migration script for old users
+
- APPRENTICE
Phase1
DONE - correggere minuta giornaliera
DONE - fix layout of tables
DONE - aggiungere books.png
- Phase2
- - match counters (part 2)
- . migration script for old users
- - guarantee for apprentice
-
- MENTORS
- listen all
+++ /dev/null
---
--- Populate users db.
---
-
--- macro for user_flag bit-field
--- define('USER_FLAG_TY_ALL', 0xff0000); // done
--- define('USER_FLAG_TY_NORM', 0x010000); // done
--- define('USER_FLAG_TY_SUPER', 0x020000); // done
--- define('USER_FLAG_TY_CERT', 0x040000); // done
--- define('USER_FLAG_TY_FIRONLY', 0x200000); // done
--- define('USER_FLAG_TY_ADMIN', 0x400000); // done
--- define('USER_FLAG_TY_DISABLE', 0x800000); // done
-
-
-DELETE FROM #PFX#users WHERE code = 10101;
-DELETE FROM #PFX#users WHERE guar_code = 10101 AND code != 10101;
-INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10101, 'uno', md5('one'), 'uno@pluto.com', CAST (X'00450000' as integer), 10101);
-DELETE FROM #PFX#users WHERE code = 10102;
-INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10102, 'due', md5('two'), 'due@pluto.com', CAST (X'00010000' as integer), 10101);
-DELETE FROM #PFX#users WHERE code = 10103;
-INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10103, 'tre', md5('thr'), 'tre@pluto.com', CAST (X'00010000' as integer), 10102);
-DELETE FROM #PFX#users WHERE code = 10104;
-INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10104, 'qua', md5('for'), 'qua@pluto.com', CAST (X'00010000' as integer), 10102);
-DELETE FROM #PFX#users WHERE code = 10105;
-INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10105, 'cin', md5('fiv'), 'cin@pluto.com', CAST (X'00010000' as integer), 10103);
-DELETE FROM #PFX#users WHERE code = 10106;
-INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10106, 'sei', md5('six'), 'sei@pluto.com', CAST (X'00210000' as integer), 10103);
-ALTER SEQUENCE #PFX#users_code_seq RESTART WITH 10107;
--- /dev/null
+--
+-- Populate users db.
+--
+
+-- macro for user_flag bit-field
+-- define('USER_FLAG_TY_ALL', 0xff0000); // done
+-- define('USER_FLAG_TY_NORM', 0x010000); // done
+-- define('USER_FLAG_TY_SUPER', 0x020000); // done
+-- define('USER_FLAG_TY_CERT', 0x040000); // done
+-- define('USER_FLAG_TY_FIRONLY', 0x200000); // done
+-- define('USER_FLAG_TY_ADMIN', 0x400000); // done
+-- define('USER_FLAG_TY_DISABLE', 0x800000); // done
+
+
+DELETE FROM #PFX#users WHERE code = 10101;
+DELETE FROM #PFX#users WHERE guar_code = 10101 AND code != 10101;
+INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10101, 'uno', md5('one'), 'uno@pluto.com', CAST (X'00450000' as integer), 10101);
+DELETE FROM #PFX#users WHERE code = 10102;
+INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10102, 'due', md5('two'), 'due@pluto.com', CAST (X'00010000' as integer), 10101);
+DELETE FROM #PFX#users WHERE code = 10103;
+INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10103, 'tre', md5('thr'), 'tre@pluto.com', CAST (X'00010000' as integer), 10102);
+DELETE FROM #PFX#users WHERE code = 10104;
+INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10104, 'qua', md5('for'), 'qua@pluto.com', CAST (X'00010000' as integer), 10102);
+DELETE FROM #PFX#users WHERE code = 10105;
+INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10105, 'cin', md5('fiv'), 'cin@pluto.com', CAST (X'00010000' as integer), 10103);
+DELETE FROM #PFX#users WHERE code = 10106;
+INSERT INTO #PFX#users (code, login, pass, email, type, guar_code) VALUES (10106, 'sei', md5('six'), 'sei@pluto.com', CAST (X'00210000' as integer), 10103);
+ALTER SEQUENCE #PFX#users_code_seq RESTART WITH 10107;
$ret = 2;
break;
}
- if (($user_item = $bdb->getitem_bylogin($user_login, $user_code)) == FALSE) {
+ if ($user_login == $user->name) {
$ret = 3;
+ $mesg = sprintf($mlang_brisk['inf_self'][$G_lang]);
break;
}
- if ($user_login == $user->name) {
+ if (($user_item = $bdb->getitem_bylogin($user_login, $user_code)) == FALSE) {
$ret = 4;
- $mesg = sprintf($mlang_brisk['inf_self'][$G_lang]);
break;
}
if (($guar_item = $bdb->getitem_bycode($user_item->guar_code_get())) != FALSE) {
}
$user_tos_vers = $user_item->tos_vers_get();
+ if (($usernet_item = $bdb->usernet_bycode($user->code, $user_item->code)) == FALSE) {
+ $usernet_item = $bdb->usernet_default($user->code, $user_item->code);
+ }
+
if (versions_cmp($user_tos_vers, "1.2") < 0) {
$mesg = sprintf($mlang_brisk['tos_old'][$G_lang], xcape($user_login));
}
* brisk - dbase_base.phh
*
* Copyright (C) 2011-2012 Matteo Nastasi
- * mailto: nastasi@alternativeoutput.it
+ * mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
*
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, $rec->last_dona,
$rec->supp_comp, $rec->tos_vers, $rec->disa_reas, $rec->guar_code,
$rec->match_cnt, $rec->game_cnt);
{
return $this->login;
}
-
+
function pass_get()
{
return $this->pass;
return $bdb->mail_add_fromitem($this);
}
}
+
+define('USERNET_FRIEND', 0);
+define('USERNET_CLEVER', 1);
+define('USERNET_TRUST', 2);
+class UserNetItem {
+ var $owner;
+ var $target;
+ var $friend;
+ var $clever;
+ var $trust;
+
+ var $from_db;
+
+ function UserNetItem($owner, $target, $friend, $clever, $trust, $from_db)
+ {
+ $this->owner = $owner;
+ $this->target = $target;
+ $this->friend = $friend;
+ $this->clever = $clever;
+ $this->trust = $trust;
+
+ $this->from_db = $from_db;
+ }
+
+ static function UserNetItemFromRecord($rec)
+ {
+ $ret = new UserNetItem($rec->owner, $rec->target, $rec->friend,
+ $rec->clever, $rec->trust, TRUE);
+
+ return ($ret);
+ }
+
+ static function UserNetItemDefaults($owner, $target)
+ {
+ $ret = new UserNetItem($owner, $target, USERNET_FRIEND,
+ USERNET_CLEVER, USERNET_TRUST, FALSE);
+
+ return ($ret);
+ }
+
+
+}
+
?>
\ No newline at end of file
return (TRUE);
}
+ function usernet_bycode($owner, $target)
+ {
+ GLOBAL $G_dbpfx;
+ $ret = FALSE;
+
+ $net_sql = sprintf("SELECT * FROM %susers_net WHERE owner = %d AND target = %d;",
+ $G_dbpfx, $owner, $target);
+ if (($net_pg = $this->query($net_sql)) == FALSE) {
+ return FALSE;
+ }
+ if (pg_numrows($net_pg) != 1)
+ return FALSE;
+
+ $net_obj = pg_fetch_object($net_pg, 0);
+
+ return (UserNetItem::UserNetItemFromRecord($net_obj));
+ }
+
+ function usernet_default($owner, $target)
+ {
+ return (UserNetItem::UserNetItemDefaults($owner, $target));
+ }
} // End class BriskDB