From abbf134a4f6bcf2ce006011f263148b0ea073bf5 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Wed, 27 Nov 2013 18:55:43 +0100 Subject: [PATCH] sanityzed record class fields access --- web/Obj/brisk.phh | 8 ++++---- web/Obj/dbase_base.phh | 4 ++++ web/Obj/user.phh | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 7fa2f36..20e6e3a 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -759,7 +759,7 @@ class Client_prefs { fprintf(STDERR, "QQ %s: %x\n", __FUNCTION__, $user->flags); $this->listen = ($user->flags & USER_FLAG_MAP_AUTH) >> 2; if ($user->rec != FALSE) { - $this->supp_comp = $user->rec->supp_comp; + $this->supp_comp = $user->rec->supp_comp_get(); } else { $this->supp_comp = "000000000000"; @@ -811,7 +811,7 @@ class Client_prefs { fprintf(STDERR, "QQ %s::%s %x\n", __CLASS__, __FUNCTION__, $user->flags); if ($user->is_supp_custom()) { - $user->rec->supp_comp = $this->supp_comp; + $user->rec->supp_comp_set($this->supp_comp); } if ($is_save) $user->store_set(); @@ -2262,7 +2262,7 @@ class Room // sql record exists AND last donate > 2013-01-01 if ($this->user[$i]->is_supp_custom()) { - $supp_comp_s = sprintf(', "%s"', $this->user[$i]->rec->supp_comp); + $supp_comp_s = sprintf(', "%s"', $this->user[$i]->rec->supp_comp_get()); } else { $supp_comp_s = ''; @@ -2310,7 +2310,7 @@ class Room log_main($user_cur->name. sprintf(" IN TABLE [%d]", $table_idx)); if ($user_cur->is_supp_custom()) - $supp_comp_s = sprintf(', "%s"', $user_cur->rec->supp_comp); + $supp_comp_s = sprintf(', "%s"', $user_cur->rec->supp_comp_get()); else $supp_comp_s = ''; diff --git a/web/Obj/dbase_base.phh b/web/Obj/dbase_base.phh index 2464f81..ab20e6c 100644 --- a/web/Obj/dbase_base.phh +++ b/web/Obj/dbase_base.phh @@ -90,6 +90,10 @@ class LoginDBItem { { return $this->supp_comp; } + function supp_comp_set($supp_comp) + { + $this->supp_comp = $supp_comp; + } function lice_vers_get() { diff --git a/web/Obj/user.phh b/web/Obj/user.phh index 80d3ce9..8ae6b32 100644 --- a/web/Obj/user.phh +++ b/web/Obj/user.phh @@ -322,7 +322,7 @@ class User { return FALSE; } return ($bdb->user_prefs_update($this->code, ($this->flags & (USER_FLAG_TY_ALL | USER_FLAG_MAP_AUTH)), - $this->rec->supp_comp)); + $this->rec->supp_comp_get())); } function rd_data_set($curtime, $transp, $enc, $stat, $subst, $step, $from) @@ -818,7 +818,7 @@ function is_supp_custom() return (TRUE); } /* - if ($this->rec->last_dona > 1356994800) { + if ($this->rec->last_dona_get() > 1356994800) { return (TRUE); } */ -- 2.17.1