X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations.inc.php;h=4bab494192afa8fceb929cda198e51c94f6603cc;hb=ff95a30266c7194bdff34f749121d43130f08b65;hp=536975fe93b3b6d7c856c1e54d75e51f0834eae2;hpb=4815662a4d472c4a4c1d82357138b9e4a8bf5aa0;p=platal.git diff --git a/include/validations.inc.php b/include/validations.inc.php index 536975f..4bab494 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -1,6 +1,6 @@ uid, $this->type, $this, $this->stamp); + global $globals; + update_NbValid(); return true; } @@ -138,12 +140,14 @@ abstract class Validate public function clean() { if ($this->unique) { - return XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?}', - $this->uid, $this->type); + $success = XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?}', + $this->uid, $this->type); } else { - return XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?} AND stamp={?}', - $this->uid, $this->type, $this->stamp); + $success = XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?} AND stamp={?}', + $this->uid, $this->type, $this->stamp); } + update_NbValid(); + return $success; } // }}}