$query="SELECT alias.address,alias.goto,alias.modified,alias.domain FROM alias WHERE alias.address LIKE '%$fSearch%' OR alias.goto LIKE '%$fSearch%' ORDER BY alias.address";
}else{
$query="SELECT alias.address,alias.goto,alias.modified,alias.domain FROM alias LEFT JOIN mailbox ON alias.address=mailbox.username WHERE alias.address LIKE '%$fSearch%' AND mailbox.maildir IS NULL ORDER BY alias.address";
}
$result=db_query("$query");
if($result['rows']>0){
while($row=db_array($result['result'])){
if(check_owner($SESSID_USERNAME,$row['domain'])){
$tAlias[]=$row;
}
}
}
$result=db_query("SELECT * FROM mailbox WHERE username LIKE '%$fSearch%' ORDER BY username");
$query="SELECT alias.address,alias.goto,alias.modified,alias.domain FROM alias WHERE alias.address LIKE '%$fSearch%' OR alias.goto LIKE '%$fSearch%' ORDER BY alias.address";
}else{
$query="SELECT alias.address,alias.goto,alias.modified,alias.domain FROM alias LEFT JOIN mailbox ON alias.address=mailbox.username WHERE alias.address LIKE '%$fSearch%' AND mailbox.maildir IS NULL ORDER BY alias.address";
}
$result=db_query("$query");
if($result['rows']>0){
while($row=db_array($result['result'])){
if(check_owner($SESSID_USERNAME,$row['domain'])){
$tAlias[]=$row;
}
}
}
$result=db_query("SELECT * FROM mailbox WHERE username LIKE '%$fSearch%' ORDER BY username");