X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations.inc.php;h=8f5df6557adca26f0bf21239af57a7f4ca6e0163;hb=abc8b908704ff4cf1afe51aef381557f678f7982;hp=eb2cd4c3ee47b068cc86171b065910e4c9db6f4f;hpb=a392390935dc54af4523011a9c3d69ceeda35f2c;p=platal.git diff --git a/include/validations.inc.php b/include/validations.inc.php index eb2cd4c..8f5df65 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -390,7 +390,7 @@ abstract class Validate public function id() { - return $this->user->id() . '_' . $this->type . '_' . $this->stamp; + return str_replace(" ", "_", $this->user->id() . '_' . $this->type . '_' . $this->stamp); } // }}} @@ -624,6 +624,25 @@ abstract class ProfileValidate extends Validate } // }}} + // {{{ function get_all_typed_requests() + + /** Same as get_typed_request() but return an array of objects. + */ + static public function get_all_typed_requests($type) + { + $res = XDB::iterRow('SELECT data + FROM requests + WHERE type = {?} + ORDER BY stamp', + $type); + $array = array(); + while (list($data) = $res->next()) { + $array[] = Validate::unserialize($data); + } + return $array; + } + + // }}} // {{{ function get_typed_requests_count() /** Same as get_typed_requests() but returns the count of available requests.