+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-// {{{ config HOOK
-
-class MailConfig
-{
- var $domain = '';
- var $domain2 = '';
-
- var $alias_dom = '';
- var $alias_dom2 = '';
-
- function shorter_domain()
- {
- if (empty($this->domain2) || strlen($this->domain2)>strlen($this->domain)) {
- return $this->domain;
- } else {
- return $this->domain2;
- }
- }
-}
-
-function emails_config()
-{
- global $globals;
- $globals->mail = new MailConfig;
-}
-// }}}
-?>
}
// }}}
+ // {{{ 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);
}
}