Location: PHPKode > projects > Replex > replex-0.9.0/admin/domain8.php
<?php
/*************************************************************
$Id: domain8.php,v 1.2 2001/05/08 21:13:44 jimir Exp $
 
 ***************************************************************/

include("include/config.php"); 
include("lib/user.php");
include("lib/account.php");
include("lib/domain.php");
include("lib/alias.php");
include("db/class_mysql.php");

# Authenticate current user
$USER = new User;
if (!$USER->HTTPauthenticate($DBCONN)) {
  $USER->http_refuse();
}


if(!empty($domain)) {
    $ACCOUNT = new Account;
    $ACCOUNT->retrieveDomainInfo($DBCONN,$domain);
}
else {
//redirect to error page

}

if(!empty($error)) {
  if($error=="error1") {
    $errormsg="<h3>Required fields are missing</h3>";	
  }
  else if($error=="error2") {
    $errormsg="<h3>Alias already exists - try another!</h3>";	
  }
  else if($error=="error3") {
    $errormsg="<h3>Error occured in creating the alias!</h3>";	
  }
  else if($error=="error4") {
    $errormsg="<h3>No account chosen!</h3>";
  }
  else if($error=="error5") {
    $errormsg="<h3>DB-ERROR</h3>";	
  }
  else if($error=="error6") {
    $errormsg="<h3>Domain name could not be found!</h3>";	
  }
  else if($error=="error7") {
    $errormsg="<h3>Email is not valid!</h3>";
  }
  else if($error=="error8") {
    $errormsg="<H3>Alias is not valid!</H3>";
  }  
}


$activetab=5;
$showtabs=6;
include("domains3_menu.php");
?>
<span class="headline">Create new alias</span><br><br>
<%=$errormsg%>

<form action="alias_update.php" type="post">
<table border=0>
<tr>
  <td class="td-hl" colspan=2>Create alias</td>
</tr>
       <tr>
       <td>Domainname:</td>
       <td><%=$domain%></td>
       </tr>
       <tr>
       <td>Alias:*</td>
       <td colspan="2"><input type="text" name="alias" value="<%=$alias%>" size="20" maxlength="100">@<%=$domain%></td>
       </tr>
       <tr>
       <td>Destination:*</td>
       <td><input type="radio" name="dest" value="email" <% if($dest=="email" || $dest!="account") echo "CHECKED";%>>Email:</td><td><input type="text" name="email" value="<%=$email%>" size="40" maxlength="100" onfocus="this.form.dest[0].click();"></td>
       </tr>
       <tr><td>
      </td><td><input type="radio" name="dest" value="account"  <% if($dest=="account") echo "CHECKED";%>>Account:</td>
        <td><select name="accounts" onfocus="this.form.dest[1].click();"><option value="none" <%if($accounts=="none") echo "SELECTED"%>>-->> select one <<--</option>
         <% for($a=0;$a<count($ACCOUNT->username);$a++): %>
            <option value="<%=$ACCOUNT->getUserName($a)%>" <% if($accounts==$ACCOUNT->getUserName($a)) echo "SELECTED"%>><%=$ACCOUNT->getUserName($a)%></option> 
         <% endfor %>
         </select></td>
       </tr>
       <tr>
       <td></td>
       <td colspan="2">Required fields are marked with *</td>
       </tr>
       <tr>
       <td>&nbsp;</td>
       <td></td>
       </tr>
       <tr>
       <td></td>
       <td><input type="submit" name="createalias" value="Create" CLASS="button" ONMOUSEOVER="this.className='buttonhover'" ONMOUSEOUT="this.className='button'"></td>
       </tr>
       </table>
       <input type="hidden" name="caller" value="domain">  
       <input type="hidden" name="domain" value="<%=$domain%>"> 
	</form>
<% menu_html_trail() %>
Return current item: Replex