X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fdbase_pgsql.phh;h=20f47259eb7a54b708aead1afc75f6ba4f375e66;hb=0aa15362fed8ca3bc4e3f23c02f04de50d293ca8;hp=3e7a731edca41ef988d49214f9b35e0217d2f848;hpb=7fdf9c5ad973fa951aecd43ad3d903079d1927c8;p=brisk.git diff --git a/web/Obj/dbase_pgsql.phh b/web/Obj/dbase_pgsql.phh index 3e7a731..20f4725 100644 --- a/web/Obj/dbase_pgsql.phh +++ b/web/Obj/dbase_pgsql.phh @@ -157,11 +157,11 @@ class BriskDB return ($user_obj); } - function user_update_login_time($id, $lintm) + function user_update_login_time($code, $lintm) { GLOBAL $G_dbpfx; - $user_sql = sprintf("UPDATE %susers SET (lintm) = (date 'epoch' + %d * INTERVAL '1 second') WHERE code = %d;", $G_dbpfx, $lintm, $id); + $user_sql = sprintf("UPDATE %susers SET (lintm) = (date 'epoch' + %d * INTERVAL '1 second') WHERE code = %d;", $G_dbpfx, $lintm, $code); // $user_pg = $this->query($user_sql); // $row_n = pg_affected_rows($user_pg); @@ -172,6 +172,21 @@ class BriskDB return TRUE; } + + function user_prefs_update($code, $flags, $supp_comp) + { + GLOBAL $G_dbpfx; + + $user_sql = sprintf("UPDATE %susers SET (type, supp_comp) = (%d, '%s') WHERE code = %d;", + $G_dbpfx, $flags, $supp_comp, $code); + fprintf(STDERR, "REQUEST [%s]\n", $user_sql); + if ( ! (($user_pg = $this->query($user_sql)) != FALSE && pg_affected_rows($user_pg) == 1) ) { + return FALSE; + } + fprintf(STDERR, "REQUEST GOOD [%s]\n", $user_sql); + + return TRUE; + } function login_verify($login, $pass) {