<?php
  ///////////////////////////////////////////////////
  //2007 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

  $lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0,2);
  if (is_file ("../../lang/".$lang."/".$lang.".php")) include "../../lang/".$lang."/".$lang.".php";
     else include "../../lang/ru/ru.php";

  $title=$titlepage = $TEXT['alias-ed'];
  $helppage = $TEXT['alias-ed-tit'];

  require_once "../../config.php";
  require_once "../../util/top_layer2.php";

  if($result2['administrator'] == 0) puterror3($TEXT['error-loginform4']);

  if(!isset($button)) $button = $TEXT['btn_edit'];
  if(!isset($action)) $action = "edit.php";

  if(empty($_GET['local'])) puterror3($TEXT['alias-error1']);
  if(strlen($_GET['local'])>65) puterror3($TEXT['alias-error2']);
  $_GET['local'] = rep($_GET['local']);

  $old_address = $_GET['local'];

  $query = "SELECT * FROM `userforward` WHERE `local_part`='".$_GET['local']."' ";
  $result = mysql_query($query);
  if (!$result) puterror3($TEXT['error-tbl33']);
      $result2 = mysql_fetch_array($result);
         $local_part = $result2['local_part'];
	 $domain = $result2['domain'];
	 $recipients = $result2['recipients'];
?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table>
<tr><td class="useraddedit"><?php echo $TEXT['alias-who']; ?></td><td class="useraddedit"><input size=50 maxlength=64 class="inputmandatory" type=text name=local_part value='<?php echo $local_part; ?>' ></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['tbl-domain']; ?></td><td class="useraddedit"><input size=50 maxlength=200 class="inputmandatory" type=text name=domain value='<?php echo $domain; ?>' ></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['alias-where']; ?></td><td class="useraddedit"><textarea class="inputmandatory" cols="50" rows="20" name=recipients ><?= $recipients ?></textarea></td></tr>
<tr><td></td><td>
<input class=button type=submit value='<?php echo $button; ?>' />
<input type=hidden name=old_address value='<?php echo $old_address; ?>' />
</td></tr>
</table>
</form>
<?php
  require_once "../../util/bottom.php";
?>