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)
// Basic email properties; $sufficient indicates if the email can be used as
// an unique redirection; $redirect contains the delivery email address.
+ public $id;
public $type;
public $sufficient;
public $email;
}
$this->sufficient = ($this->type == 'smtp' || $this->type == 'googleapps');
$this->filter_level = ($this->type == 'imap') ? null : array_search($this->action, Bogo::$states);
+ if (array_key_exists($this->type , self::$storage_domains)) {
+ $this->id = $this->type;
+ } else {
+ $this->id = str_replace(array('@', '.'), array('_at_', '_dot_'), $this->email);
+ }
$this->user = &$user;
}
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
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