Location: PHPKode > projects > Replex > replex-0.9.0/admin/domain4.php
<?php
/*************************************************************
$Id: domain4.php,v 1.5 2001/05/19 03:30:31 jimir Exp $
 
 ***************************************************************/

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

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

if(!empty($domain)) {
  $DOMAIN = new Domain;
  if($DOMAIN->retrieveDomain($DBCONN,$domain)) {
    $show=1;	
  }
  else {
    $show=0;
    $error="error2";	
  }
  	
}
else {
  $DOMAIN = new Domain;
  $DOMAIN->name="";	
}

if(!empty($error)) {
  if($error=="error1") {
    $errormsg="<h3>Required fields are missing</h3>";
    $show=1;
    $DOMAIN->name[0]=$domainname;
    $DOMAIN->prefix[0]=$prefix;
    $DOMAIN->maxaccounts[0]=$maxaccounts;
  }
  if($error=="error2") {
    $errormsg="<h3>Domainname does not exist!</h3>";	
  }
  if($error=="error4") {
    $errormsg="<h3>DB-ERROR</h3>";
    $show=1;
    $DOMAIN->name[0]=$domainname;
    $DOMAIN->prefix[0]=$prefix;
    $DOMAIN->maxaccounts[0]=$maxaccounts;
  }
  
}


$activetab=1;
$showtabs=6;
include("domains3_menu.php");
?>
<% if($show) { %>
<%
$ACCOUNT = new Account;
$ACCOUNT->retrieveDomainInfo($DBCONN,$DOMAIN->getName(0));
%>

<span class="headline">Edit domain: <%=$DOMAIN->getName(0)%></span><br><br>
<%=$errormsg%>
<form action="domain_update.php" type="post">
<table border=0>
 <tr>
  <td>Prefix:</td>
  <td><%=$DOMAIN->getPrefix(0)%></td>
 </tr>
 <tr>
  <td>Max accounts:*</td>
  <td>
<select name="maxaccounts">
<% echo "TEST:".$maxaccounts%>
  <% for($a=0;$a<count($ACCOUNT_MAXACCOUNT);$a++):%>
    <% if($ACCOUNT->getAffectedRows()<=$ACCOUNT_MAXACCOUNT[$a]):%>
      <option value="<%=$ACCOUNT_MAXACCOUNT[$a]%>" <%if($DOMAIN->getMaxAccounts(0)==$ACCOUNT_MAXACCOUNT[$a]) echo "SELECTED"%>><%=$ACCOUNT_MAXACCOUNT[$a]%></option>
    <% endif %>
<% endfor %>
</select>
 </td>
 </tr>
<tr>
  <td></td>
  <td>Required fields are marked with *</td>
 </tr>
<tr>
  <td></td>
  <td>&nbsp;</td>
 </tr>
<tr>
  <td></td>
  <td><input type="submit" name="updatedomain" value="Update" CLASS="button" ONMOUSEOVER="this.className='buttonhover'" ONMOUSEOUT="this.className='button'">&nbsp;<input type="submit" name="deletedomain" value="Delete" ONCLICK="if(confirm('This will delete the domain from the system and all the accounts/aliases connected to this domain')){return true;}else return false;" CLASS="button" ONMOUSEOVER="this.className='buttonhover'" ONMOUSEOUT="this.className='button'"></td>
 </tr>
</table>
<input type="hidden" name="domainname" value="<%=$DOMAIN->getName(0)%>">
<input type="hidden" name="prefix" value="<%=$DOMAIN->getPrefix(0)%>">

</form>
<% } %>
<% menu_html_trail() %>	
Return current item: Replex