Bye xorg.misc.inc.php
[platal.git] / include / validations / nomusage.inc.php
index c3ff4bf..788d7c6 100644 (file)
@@ -49,7 +49,6 @@ class UsageReq extends Validate
         parent::__construct($_uid, true, 'usage');
         $this->nom_usage  = $_usage;
         $this->reason = $_reason;
-        require_once 'xorg.misc.inc.php';
         $this->alias   = make_username($this->prenom, $this->nom_usage);
         if (!$this->nom_usage) $this->alias = "";
 
@@ -92,6 +91,13 @@ class UsageReq extends Validate
             if ($this->nom_usage) {
                 $res .= "\n\n  Les alias {$this->alias}@{$globals->mail->domain} et @{$globals->mail->domain2} sont maintenant à ta disposition !";
             }
+            if ($globals->mailstorage->googleapps_domain) {
+                require_once 'googleapps.inc.php';
+                $account = new GoogleAppsAccount($this->uid, $this->forlife);
+                if ($account->active()) {
+                    $res .= "\n\n  Si tu utilises Google Apps, tu peux changer ton nom d'usage sur https://mail.google.com/a/polytechnique.org/#settings/accounts";
+                }
+            }
             return $res;
         } else {
             return "  La demande de changement de nom d'usage que tu avais faite a été refusée.";