X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fdbase_pgsql.phh;h=3c72851e9555085a59cf34db77f839270234c9a0;hb=3dc6d58fd477565017745b33c752232166a0b508;hp=3e7a731edca41ef988d49214f9b35e0217d2f848;hpb=e968a160b612abc48f7e0ab29210ef2e6c906606;p=brisk.git diff --git a/web/Obj/dbase_pgsql.phh b/web/Obj/dbase_pgsql.phh index 3e7a731..3c72851 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,20 @@ class BriskDB return TRUE; } + + function user_update_flags($code, $flags) + { + GLOBAL $G_dbpfx; + + $user_sql = sprintf("UPDATE %susers SET (type) = (%d) WHERE code = %d;", $G_dbpfx, $flags, $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) {