X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fdbase_base.phh;h=5e65ec8986f3009169a4d7535dcf1ada0292249c;hb=a77cf3db1fbace39c49b030b9e144a316f007373;hp=3cb94d813715c815907da3b51e5ea05df0060042;hpb=b65dddf6cb8fdc5a98719ed170ca38c2059b362c;p=brisk.git diff --git a/web/Obj/dbase_base.phh b/web/Obj/dbase_base.phh index 3cb94d8..5e65ec8 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 * @@ -31,8 +31,14 @@ class LoginDBItem { var $type; var $last_dona; var $supp_comp; + var $tos_vers; + var $disa_reas; + var $guar_code; + var $match_cnt; + var $game_cnt; - function LoginDBItem($code, $login, $pass, $email, $type, $last_dona, $supp_comp) + function LoginDBItem($code, $login, $pass, $email, $type, $last_dona, $supp_comp, $tos_vers, + $disa_reas, $guar_code, $match_cnt, $game_cnt) { $this->code = $code; $this->login = $login; @@ -41,13 +47,19 @@ class LoginDBItem { $this->type = $type; $this->last_dona = $last_dona; $this->supp_comp = $supp_comp; + $this->tos_vers = $tos_vers; + $this->disa_reas = $disa_reas; + $this->guar_code = $guar_code; + $this->match_cnt = $match_cnt; + $this->game_cnt = $game_cnt; } 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->supp_comp, $rec->tos_vers, $rec->disa_reas, $rec->guar_code, + $rec->match_cnt, $rec->game_cnt); return ($ret); } @@ -61,7 +73,7 @@ class LoginDBItem { { return $this->login; } - + function pass_get() { return $this->pass; @@ -86,6 +98,129 @@ class LoginDBItem { { return $this->supp_comp; } + function supp_comp_set($supp_comp) + { + $this->supp_comp = $supp_comp; + } + + function tos_vers_get() + { + return $this->tos_vers; + } + function tos_vers_set($tos_vers) + { + $this->tos_vers = $tos_vers; + } + + function disa_reas_get() + { + return $this->disa_reas; + } + function disa_reas_set($disa_reas) + { + $this->disa_reas = $disa_reas; + } + function guar_code_get() + { + return $this->guar_code; + } + + function match_cnt_get() + { + return $this->match_cnt; + } + function match_cnt_add($v) + { + return $this->match_cnt += $v; + } + + function game_cnt_get() + { + return $this->game_cnt; + } + function game_cnt_add($v) + { + return $this->game_cnt += $v; + } +} + +define('MAIL_TYP_CHECK', 1); + +class MailDBItem { + var $code; + var $ucode; + var $type; + var $tstamp; + var $subj; + var $body_txt; + var $body_htm; + var $hash; + + function MailDBItem($code, $ucode, $type, $tstamp, $subj, $body_txt, $body_htm, $hash=NULL) + { + $this->code = $code; + $this->ucode = $ucode; + $this->type = $type; + $this->tstamp = $tstamp; + $this->subj = $subj; + $this->body_txt = $body_txt; + $this->body_htm = $body_htm; + $this->hash = $hash; + } + + static function MailDBItemFromRecord($rec) + { + $ret = new MailDBItem($rec->code, $rec->ucode, $rec->type, $rec->tstamp, $rec->subj, + $rec->body_txt, $rec->body_htm, $rec->hash); + + return ($ret); + } + + function store($bdb) + { + 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); + } + }