Searching mentors in advanced search works back. (Closes #741)
[platal.git] / include / validations.inc.php
index 81c3041..a00b346 100644 (file)
@@ -115,6 +115,8 @@ abstract class Validate
         XDB::execute('INSERT INTO requests (user_id, type, data, stamp) VALUES ({?}, {?}, {?}, {?})',
                 $this->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;
     }
 
     // }}}
@@ -184,10 +188,10 @@ abstract class Validate
 
             // envoi d'un mail à hotliners
             global $globals;
-            $mailer = new PlMailer;
+            $mailer = new PlMailer();
             $mailer->setSubject("Commentaires de validation {$this->type}");
             $mailer->setFrom("validation+{$this->type}@{$globals->mail->domain}");
-            $mailer->addTo($globals->core->admin_emails);
+            $mailer->addTo($globals->core->admin_email);
 
             $body = "Validation {$this->type} pour {$this->prenom} {$this->nom}\n\n"
               . S::v('bestalias')." a ajouté le commentaire :\n\n"