From: x2000habouzit Date: Sun, 23 Jul 2006 22:21:26 +0000 (+0000) Subject: remove emails.inc.php hook X-Git-Tag: xorg/0.9.11~292 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=4c6fce943be8421bb3285f0e2d9f24f34688f903;p=platal.git remove emails.inc.php hook git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@614 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/configs/platal.ini b/configs/platal.ini index bf4bd09..f589a9f 100644 --- a/configs/platal.ini +++ b/configs/platal.ini @@ -9,6 +9,14 @@ web_pass = "***" table_prefix = "banana_" +[Mail] +domain = "" +domain2 = "" + +alias_dom = "" +alias_dom2 = "" + + [Lists] rpchost = "localhost" rpcport = 4949 diff --git a/hooks/emails.inc.php b/hooks/emails.inc.php deleted file mode 100644 index bdbf24f..0000000 --- a/hooks/emails.inc.php +++ /dev/null @@ -1,48 +0,0 @@ -domain2) || strlen($this->domain2)>strlen($this->domain)) { - return $this->domain; - } else { - return $this->domain2; - } - } -} - -function emails_config() -{ - global $globals; - $globals->mail = new MailConfig; -} -// }}} -?> diff --git a/include/validations/aliases.inc.php b/include/validations/aliases.inc.php index 9cd0b0b..6038b9c 100644 --- a/include/validations/aliases.inc.php +++ b/include/validations/aliases.inc.php @@ -92,20 +92,35 @@ class AliasReq extends Validate } // }}} + // {{{ function shorter_domain + + function shorter_domain() + { + global $globals; + + if (empty($globals->domain2) || strlen($globals->domain2) > strlen($globals->domain)) { + return $globals->domain; + } else { + return $globals->domain2; + } + } + + // }}} // {{{ function commit() function commit () { global $globals; - - XDB::execute("UPDATE auth_user_quick SET emails_alias_pub = {?} WHERE user_id = {?}", $this->public, $this->uid); + + XDB::execute("UPDATE auth_user_quick SET emails_alias_pub = {?} WHERE user_id = {?}", + $this->public, $this->uid); if ($this->old) { return XDB::execute('UPDATE virtual SET alias={?} WHERE alias={?}', $this->alias, $this->old); } else { XDB::execute('INSERT INTO virtual SET alias={?},type="user"', $this->alias); $vid = mysql_insert_id(); - $dom = $globals->mail->shorter_domain(); + $dom = $this->shorter_domain(); return XDB::query('INSERT INTO virtual_redirect (vid,redirect) VALUES ({?}, {?})', $vid, $this->forlife.'@'.$dom); } }