"") && ($dest <> "")) $sql[4] = "INSERT INTO " . $tbl_aliases . " (domain_id, source, destination, enabled) VALUES ('$domain','$source','$dest',1);"; ## Insert Domain Query ## if($ndomain <> "") { $sql0 = "SELECT name FROM " . $tbl_domains . " WHERE name = '$ndomain';"; $qr = query($sql0); if(mysql_num_rows($qr) < 1) $sql[5] = "INSERT INTO " . $tbl_domains . " (name) VALUES ('$ndomain');"; } ## Insert User Query ## if(($domain <> "") && ($usr <> "") && ($pwd <> "")) { $sql1 = "SELECT domain_id, user, password FROM " . $tbl_users . " WHERE domain_id = $domain AND user = '$usr' AND password = '".pw_encode($pwd)."';"; $qr = query($sql1); if(mysql_num_rows($qr) < 1) $sql[6] = "INSERT INTO " . $tbl_users . " (domain_id, user, password) VALUES ('$domain','$usr','".pw_encode($pwd)."'); "; } ## Delete Query ## if(($del <> "") && ($id <> "") && ($ack == retAl('Yes'))) { switch ($del) { case 1: $tbl = $tbl_aliases; break; case 2: $tbl = $tbl_domains; break; case 3: $tbl = $tbl_users; break; } $sql = "DELETE FROM ".$tbl." WHERE id = $id;"; $qry = query($sql); } ## Update Alias Query## if(($chg == 1) && ($id <> "") && ($domain <> "") && ($dest <> "") && ($ack == retAl('Save'))) { $sql = "UPDATE ".$tbl_aliases." SET domain_id = '".$domain."', source = '".$source."', destination = '".$dest."', enabled = '".$enabled."' WHERE id = ".$id.";"; $qry = query($sql); } ## Update Domain Query ## if(($chg == 2) && ($id <> "") && ($domain <> "") && ($ack == retAl('Save'))) { $sql = "UPDATE ".$tbl_domains." SET name='".$domain."' WHERE id = ".$id.";"; $qry = query($sql); } ## Update User Query ## if(($chg == 3) && ($id <> "") && ($domain <> "") && ($usr <> "") && ($pwd <> "") && ($ack == retAl('Save'))) { $sql = "UPDATE ".$tbl_users." SET domain_id ='".$domain."', user ='".$usr."', password = '".pw_encode($pwd)."' WHERE id = ".$id.";"; $qry = query($sql); } if($do) $qry = query($sql[$do]); if($qry) $result = true; else $result = false; /* Code */ ?> Mail-Control

Mail-Control v1.3


'.retAl('New Alias').'
'; $out.= ''; $out.= ''; $out.= ''; $out.= ''; $out.= ''; $out.= '
'.retAl('Domain').':
'.retAl('Source').':@'.retAl('Domain').'
'.retAl('Destination').':
'; break; case 2: $out = '
'.retAl('New Domain').'
'; $out.= ''; $out.= ''; $out.= '
'.retAl('Name').':
'; break; case 3: $sql = "SELECT id,name FROM " . $tbl_domains . ";"; $qry = query($sql); $out = '
'.retAl('New User').'
'; $out.= ''; $out.= ''; $out.= ''; $out.= ''; $out.= ''; $out.= '
'.retAl('Domain').':
'.retAl('Username').':@Domain
'.retAl('Password').': '.retAl('show password').'
'; break; } switch($do) { case 1: $thname = array(retAl('Action'),retAl('ID'),retAl('Source'),retAl('Domain'),retAl('Destination'),retAl('Enabled')); $thback = array('','id','source','domain_id','destination','enabled'); $out.= '
'.retAl('New Alias').'


'; $out.=''; for ($a=0;$a' : ''; $endlink = ($link) ? '' : ''; $out.=''; } $out.=''; while($row = fetch($qry)) { $i++; $rowcolor = ($i%2==0) ? 'rowcolor0' : 'rowcolor1'; $out.=''; } $out.='
'.$link.$thname[$a].$endlink.'
EditDelete'.$row[0].''.$row[1].''.$row[2].''.$row[3].''.$row[4].'
'; break; case 2: $thname = array(retAl('Action'),retAl('ID'),retAl('Name')); $thback = array('','id','name'); $out.='
'.retAl('New Domain').'


'; $out.=''; for ($a=0;$a' : ''; $endlink = ($link) ? '' : ''; $out.=''; } $out.=''; while($row = fetch($qry)) { $i++; $rowcolor = ($i%2==0) ? 'rowcolor0' : 'rowcolor1'; $out.=''; } $out.='
'.$link.$thname[$a].$endlink.'
EditDelete'.$row[0].''.$row[1].'
'; break; case 3: $thname = array(retAl('Action'),retAl('ID'),retAl('Domain'),retAl('User')); $thback = array("","id","domain_id","user"); $out.='
'.retAl('New User').'


'; $out.=''; for ($a=0;$a' : ''; $endlink = ($link) ? '' : ''; $out.=''; } $out.=''; while($row = fetch($qry)) { $i++; $rowcolor = ($i%2==0) ? 'rowcolor0' : 'rowcolor1'; $out.=''; } $out.='
'.$link.$thname[$a].$endlink.'
EditDelete'.$row[0].''.$row[1].''.$row[2].'
'; break; case 4: if($result == true) { $out = '
'.retAl('Alias').' '.retAl('was added...').'
'; $out .= '
'.retAl('Back').'
'; $out .= ""; } else { $out = '

'.retAl('ERROR adding Alias').'

'; $out .= '
'.retAl('Back').'
'; } break; case 5: if($result == true) { $out = '
'.retAl('Domain').' '.retAl('was added...').'
'; $out .= '
'.retAl('Back').'
'; $out .= ""; } else { $out = '

'.retAl('ERROR adding Domain').'

'; $out .= '
'.retAl('Back').'
'; } break; case 6: if($result == true) { $out = '
'.retAl('User').' '.retAl('was added...').'
'; $out .= '
'.retAl('Back').'
'; $out .= ""; } else { $out = '

'.retAl('ERROR adding User').'

'; $out .= '
'.retAl('Back').'
'; } break; } switch($del) { case 1: if($ack == "") { $out = '

'.retAl('Delete this alias?').'

'; $out.= '
ǀ
'; } else if($ack == retAl('Yes')) { $out = '
'.retAl('Alias').' '.retAl('was deleted...').'
'.retAl('Back').'
'; $out .= ""; } else { $out = '
'.retAl('Back').'
'; $out .= ""; } break; case 2: if($ack == "") { $out = '

'.retAl('Delete this domain?').'

' . "\n"; $out.= '
ǀ
'; } else if($ack == retAl('Yes')) { $out = '
'.retAl('Domain').' '.retAl('was deleted...').'
'.retAl('Back').'
'; $out .= ""; } else { $out = '
'.retAl('Back').'
'; $out .= ""; } break; case 3: if($ack == "") { $out = '

'.retAl('Delete this user?').'

' . "\n"; $out.= '
ǀ
'; } else if($ack == retAl('Yes')) { $out = '
'.retAl('User').' '.retAl('was deleted...').'
'.retAl('Back').'
'; $out .= ""; } else { $out = '
'.retAl('Back').'
'; $out .= ""; } break; } switch($chg) { case 1: $sql = "SELECT id,name FROM " . $tbl_domains . ";"; $qry = query($sql); $sql = "SELECT * FROM " . $tbl_aliases . " WHERE id=".$id.";"; $qry2 = query($sql); $details = fetch($qry2); if($ack == "") { $out = '
'.retAl('Edit Alias').':
'; $out.= ''; $out.= ''; $out.= ''; $out.= ''; $out.= ''; $out.= '
'.retAl('Domain').':
'.retAl('Source').':@Domain
'.retAl('Target').':
'.retAl('Enabled').':
'; } else if($ack == retAl('Save')) { $out = '
'.retAl('Alias').' '.('was changed...').'
'.retAl('Back').'
'; $out .= ""; } else { $out = '
'.retAl('Back').'
'; $out .= ""; } break; case 2: $sql = "SELECT name FROM " . $tbl_domains . " WHERE id=".$id.";"; $qry = query($sql); if($ack == "") { $dom = fetch($qry); $out = '
'.retAl('Edit Domain').'
'; $out.= ''; $out.= ''; $out.= '
'.retAl('Domain').':'; $out.= '
'; } else if($ack == retAl('Save')) { $out = '
'.retAl('Domain').' '.('was changed...').'
'.retAl('Back').'
'; $out .= ""; } else { $out = '
'.retAl('Back').'
'; $out .= ""; } break; case 3: $sql = "SELECT id,name FROM " . $tbl_domains . ";"; $qry = query($sql); $sql = "SELECT * FROM " . $tbl_users . " WHERE id=".$id.";"; $qry2 = query($sql); $details = fetch($qry2); if($ack == "") { $out = '
'.retAl('Edit User').'
'; $out.= ''; $out.= ''; $out.= ''; $out.= ''; $out.= '
'.retAl('Domain').':
'.retAl('Name').':@Domain
'.retAl('Password').': '.retAl('show password').'
'; } else if($ack == retAl('Save')) { $out = '
'.retAl('User').' '.('was changed...').'
'.retAl('Back').'
'; $out .= ""; } else { $out = '
'.retAl('Back').'
'; $out .= ""; } break; } echo $out; ?>