list (/*NULL*/, $domain) = explode('@', $this->username);
list (/*NULL*/, $domain) = explode('@', $this->username);
if ( ! $this->get(true) ) die("Alias not existing?"); # TODO: better error behaviour
if ( ! $this->get(true) ) die("Alias not existing?"); # TODO: better error behaviour
@ -149,7 +149,6 @@ class AliasHandler {
$addresses = array_unique($new_list);
$addresses = array_unique($new_list);
$E_username = escape_string($this->username);
$E_username = escape_string($this->username);
$goto = implode(',', $addresses);
$goto = implode(',', $addresses);
# $table_alias = table_by_key('alias');
if(sizeof($addresses) == 0) {
if(sizeof($addresses) == 0) {
# $result = db_delete('alias', 'address', $this->username); # '"DELETE FROM $table_alias WHERE address = '$username'"; # TODO: should never happen and causes broken behaviour
# $result = db_delete('alias', 'address', $this->username); # '"DELETE FROM $table_alias WHERE address = '$username'"; # TODO: should never happen and causes broken behaviour
error_log("Alias set to empty / Attemp to delete: " . $this->username); # TODO: more/better error handling - maybe just return false?
error_log("Alias set to empty / Attemp to delete: " . $this->username); # TODO: more/better error handling - maybe just return false?