X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fdbase_base.phh;h=25c36d54f470a7bd4ef363928ff1e27267646e10;hb=bddfecf27b05ebf105929f29ef23c26d3b258c3c;hp=1e7a19ad33a31674f922580e9a50e83f057333fb;hpb=a04917816df17fb43979ecb4299d84ac3ae7e6e7;p=brisk.git diff --git a/web/Obj/dbase_base.phh b/web/Obj/dbase_base.phh index 1e7a19a..25c36d5 100644 --- a/web/Obj/dbase_base.phh +++ b/web/Obj/dbase_base.phh @@ -3,7 +3,7 @@ * 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 * @@ -56,7 +56,7 @@ class LoginDBItem { 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); @@ -73,7 +73,7 @@ class LoginDBItem { { return $this->login; } - + function pass_get() { return $this->pass; @@ -98,6 +98,24 @@ class LoginDBItem { { return $this->supp_comp; } + function supp_comp_get_array() + { + $ret = array(); + $group_id = array("fg", "bg"); + $comp_id = array("r", "g", "b"); + $ret_arr = array(); + $supp_comp = $this->supp_comp; + + for ($i = 0 ; $i < 2 ; $i++) { + $group_cur = $group_id[$i]; + $ret_arr[$group_cur] = array(); + for ($e = 0 ; $e < 3 ; $e++) { + $ret_arr[$group_cur][$comp_id[$e]] = base_convert(substr($supp_comp, $i*6 + $e*2, 2), 16, 10); + } + } + return ($ret_arr); + } + function supp_comp_set($supp_comp) { $this->supp_comp = $supp_comp; @@ -181,4 +199,53 @@ class MailDBItem { return $bdb->mail_add_fromitem($this); } } + +define('USERSNET_DEF_FRIEND', 2); +define('USERSNET_DEF_SKILL', 2); +define('USERSNET_DEF_TRUST', 2); + +class UsersNetItem { + var $owner; + var $target; + var $friend; + var $skill; + var $trust; + + var $from_db; + + function UsersNetItem($owner, $target, $friend, $skill, $trust, + $widefriend, $narrowfriend, $from_db) + { + $this->owner = $owner; + $this->target = $target; + $this->friend = $friend; + $this->skill = $skill; + $this->trust = $trust; + $this->widefriend = $widefriend; + $this->narrowfriend = $narrowfriend; + + $this->from_db = $from_db; + } + + static function UsersNetItemFromRecord($rec, $widefriend, $narrowfriend) + { + $ret = new UsersNetItem($rec->owner, $rec->target, $rec->friend, + $rec->skill, $rec->trust, + $widefriend, $narrowfriend, TRUE); + + return ($ret); + } + + static function UsersNetItemDefaults($owner, $target, $widefriend, $narrowfriend) + { + $ret = new UsersNetItem($owner, $target, USERSNET_DEF_FRIEND, + USERSNET_DEF_SKILL, USERSNET_DEF_TRUST, + $widefriend, $narrowfriend, FALSE); + + return ($ret); + } + + +} + ?> \ No newline at end of file