Moves skills edition to mentor edition page.
[platal.git] / include / emails.inc.php
index 9776d80..5b6b0a7 100644 (file)
@@ -189,7 +189,7 @@ function mark_broken_email($email, $admin = false)
         return;
     }
 
-    $user = XDB::fetchOneAssoc('SELECT  r1.uid, r1.broken_level != 0 AS broken, COUNT(r2.uid) AS nb_mails,
+    $user = XDB::fetchOneAssoc('SELECT  r1.uid, a.hruid, a.full_name, r1.broken_level != 0 AS broken, COUNT(r2.uid) AS nb_mails,
                                         s.email AS alias, DATE_ADD(r1.last, INTERVAL 14 DAY) < CURDATE() as notify
                                   FROM  email_redirect_account AS r1
                             INNER JOIN  accounts               AS a  ON (a.uid = r1.uid)
@@ -514,7 +514,7 @@ class Email
         if (array_key_exists($this->type , self::$storage_domains)) {
             $this->id = $this->type;
         } else {
-            $this->id = str_replace('@', '_at_', $this->email);
+            $this->id = str_replace(array('@', '.'), array('_at_', '_dot_'), $this->email);
         }
         $this->user = &$user;
     }
@@ -523,7 +523,7 @@ class Email
     public function activate()
     {
         if ($this->inactive) {
-            if ($is_storage = in_array($this->type, self::get_allowed_storages($this->user))) {
+            if (in_array($this->type, self::get_allowed_storages($this->user))) {
                 self::activate_storage($this->user, $this->type, $this->action);
             } else {
                 XDB::execute('UPDATE  email_redirect_account
@@ -541,7 +541,7 @@ class Email
     public function deactivate()
     {
         if ($this->active) {
-            if ($is_storage = in_array($this->type, self::get_allowed_storages($this->user))) {
+            if (in_array($this->type, self::get_allowed_storages($this->user))) {
                 self::deactivate_storage($this->user, $this->type);
             } else {
                 XDB::execute('UPDATE  email_redirect_account