X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations.inc.php;h=7c87d4c2a0a6cb1280a211caea295bcbca3af849;hb=3d57237e2ce44f487ebef727aa957c63643f5c1c;hp=3698105d329ac9d9b1871219af980139bac7aa6c;hpb=34c0246248ed6e3c6a372c89b359ce038bb95bc8;p=platal.git diff --git a/include/validations.inc.php b/include/validations.inc.php index 3698105..7c87d4c 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -1,6 +1,6 @@ user = &$_user; $this->stamp = date('YmdHis'); @@ -126,6 +129,11 @@ abstract class Validate */ public function handle_formu() { + if ($this->requireAdmin && !S::admin()) { + $this->trigError('Vous n\'avez pas les permissions nécessaires pour valider cette demande.'); + return false; + } + if (Env::has('delete')) { $this->clean(); $this->trigSuccess('Requête supprimée.'); @@ -455,7 +463,7 @@ abstract class ProfileValidate extends Validate * @param $_unique: set to false if a profile can have multiple requests of this type. * @param $_type: request's type. */ - public function __construct(User &$_user, Profile &$_profile, $_unique, $_type) + public function __construct(User $_user, Profile $_profile, $_unique, $_type) { parent::__construct($_user, $_unique, $_type); $this->profile = &$_profile;