X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fdbase_pgsql.phh;fp=web%2FObj%2Fdbase_pgsql.phh;h=73712edba3501165830072d771cb92d7adf4074e;hb=1c4871f5ddd191e54ca89b2c27985c54500504e0;hp=477491851f63febe676f373bf2a1e51941dc0a58;hpb=2c36a4f9d580674adfffac403280d5d4ab7feab8;p=brisk.git diff --git a/web/Obj/dbase_pgsql.phh b/web/Obj/dbase_pgsql.phh index 4774918..73712ed 100644 --- a/web/Obj/dbase_pgsql.phh +++ b/web/Obj/dbase_pgsql.phh @@ -742,6 +742,34 @@ INSERT INTO %smails (code, ucode, type, tstamp, subj, body_txt, body_htm, hash) return $usr_obj; } + function mail_check($code, $type, $hash) + { + GLOBAL $G_dbpfx; + + $mai_sql = sprintf("SELECT * FROM %smails WHERE code = %d AND type = %d AND hash = '%s';", + $G_dbpfx, $code, $type, escsql($hash)); + if (($mai_pg = $this->query($mai_sql)) == FALSE || pg_numrows($mai_pg) != 1) { + // check failed + return (FALSE); + } + + $mai_obj = pg_fetch_object($mai_pg, 0); + return ($mai_obj); + } + + function mail_delete($code) + { + GLOBAL $G_dbpfx; + + $mai_sql = sprintf("DELETE FROM %smails WHERE code = %d;", $G_dbpfx, $code); + + if (($mai_pg = $this->query($mai_sql)) == FALSE || pg_affected_rows($mai_pg) != 1) { + return (FALSE); + } + return (TRUE); + } + + } // End class BriskDB class LoginDBOld