<commit_before><?
  include_once dirname(__FILE__) . "/config/variables.php";
  include_once dirname(__FILE__) . "/config/authpostmaster.php";

  $query = "SELECT * FROM users WHERE user_id={$_GET['user_id']}";
  $result = $db->query($query);
  if ($result->numRows()) { $row = $result->fetchRow(); }
  $username = $row[username];
  $domquery = "SELECT avscan,spamassassin,quotas,pipe FROM domains WHERE domain_id={$_COOKIE['vexim'][2]}";
  $domresult = $db->query($domquery);
  if ($domresult->numRows()) { $domrow = $domresult->fetchRow(); }
  $blockquery = "SELECT blockhdr,blockval,block_id FROM blocklists,users
		WHERE blocklists.user_id='{$_GET['user_id']}'
		AND users.user_id=blocklists.user_id";
  $blockresult = $db->query($blockquery);
?>
<html>
  <head>
    <title>Virtual Exim: <? echo _("Manage Users"); ?></title>
    <link rel="stylesheet" href="style.css" type="text/css">
  </head>
  <body onLoad="document.userchange.realname.focus()">
  <? include dirname(__FILE__) . "/config/header.php"; ?>
    <div id="menu">
      <a href="adminuser.php"><? echo _("Manage Accounts"); ?></a><br>
      <a href="admin.php"><? echo _("Main Menu"); ?></a><br>
      <br><a href="logout.php"><? echo _("Logout"); ?></a><br>
    </div>
    <div id="forms">
    <table align="center">
      <form name="userchange" method="post" action="adminuserchangesubmit.php">
	<tr><td><? echo _("Name"); ?>:</td><td><input type="text" size="25" name="realname" value="<? print $row['realname']; ?>" class="textfield"></td></tr>
	<tr><td><? echo _("Email Address"); ?>:</td><td><? print $row['username']; ?></td></tr>
	<input name="user_id" type="hidden" value="<? print $_GET['user_id']; ?>" class="textfield">
	<tr><td><? echo _("Password"); ?>:</td><td><input type="password" size="25" name="clear" class="textfield"></td></tr>
	<tr><td><? echo _("Verify Password"); ?>:</td><td><input type="password" size="25" name="vclear" class="textfield"></td></tr>
	<? if ($postmasteruidgid == "yes") {
	  print "<tr><td>UID:</td><td><input type=\"text\" size=\"25\" name=\"uid\" class=\"textfield\" value=\"{$row['uid']}\"></td></tr>\n";
	  print "<tr><td>GID:</td><td><input type=\"text\" size=\"25\" name=\"gid\" class=\"textfield\" value=\"{$row['gid']}\"></td></tr>\n"; 
	  print "<tr><td colspan=\"2\" style=\"padding-bottom:1em\">" . _("When you update the UID or GID, please make sure your MTA still has permission to create the required user directories!") . "</td></tr>\n";
	  }
	  if ($domrow['quotas'] > "0") {
	    print "<tr><td>" . _("Mailbox quota") . " ({$domrow['quotas']} Mb max):</td>";
	    print "<td><input type=\"text\" size=\"5\" name=\"quota\" value=\"{$row['quota']}\" class=\"textfield\">Mb</td></tr>\n";
	} 
	if ($domrow['pipe'] == "1") {
	     print "<tr><td>" . _("Pipe to command or alternative Maildir") . ":</td>";
	     print "<td><input type=\"textfield\" size=\"25\" name=\"smtp\" class=\"textfield\" value=\"{$row['smtp']}\"></td></tr>\n";
	     print "<tr><td colspan=\"2\" style=\"padding-bottom:1em\">" . _("Optional") . ":" . _(" Pipe all mail to a command (e.g. procmail).") . "<br>\n";
	     print _("Check box below to enable") . ":</td></tr>\n";
	     print "<tr><td>" . _("Enable piped command or alternative Maildir") . "?</td><td><input type=\"checkbox\" name=\"on_piped\"";
	     if ($row['on_piped'] == "1") { print " checked "; } print "></td></tr>\n";
	} ?>
	<tr><td><? echo _("Admin"); ?>:</td><td><input name="admin" type="checkbox" <?
	   if ($row['admin'] == 1) { print "checked"; } ?> class="textfield"></td></tr>
	<? if ($domrow['avscan'] == "1") {
	     print "<tr><td>" . _("Anti-Virus") . ":</td><td><input name=\"on_avscan\" type=\"checkbox\"";
	     if ($row['on_avscan'] == "1") { print " checked "; } print "></td></tr>\n";
	   }
	   if ($domrow['spamassassin'] == "1") {
	     print "<tr><td>" . _("Spamassassin") . ":</td><td><input name=\"on_spamassassin\" type=\"checkbox\"";
	     if ($row['on_spamassassin'] == "1") { print " checked "; } print "></td></tr>\n";
	     print "<tr><td>" . _("Spamassassin tag score") . ":</td>";
	     print "<td><input type=\"text\" size=\"5\" name=\"sa_tag\" value=\"{$row['sa_tag']}\" class=\"textfield\"></td></tr>\n";
	     print "<tr><td>" . _("Spamassassin refuse score") . ":</td>";
	     print "<td><input type=\"text\" size=\"5\" name=\"sa_refuse\" value=\"{$row['sa_refuse']}\" class=\"textfield\"></td></tr>\n";
	   }
	   print "<tr><td>" . _("Maximum message size") . ":</td>";
	   print "<td><input type=\"text\" size=\"5\" name=\"maxmsgsize\" value=\"{$row['maxmsgsize']}\" class=\"textfield\">Kb</td></tr>\n";
	?>
	<tr><td><? echo _("Enabled"); ?>:</td><td><input name="enabled" type="checkbox" <?
		if ($row['enabled'] == 1) { print "checked"; } ?> class="textfield"></td></tr>
	<tr><td><? echo _("Vacation on"); ?>:</td><td><input name="on_vacation" type="checkbox" <?
		if ($row['on_vacation'] == "1") { print " checked "; } ?> ></td></tr>
	<tr><td><? echo _("Vacation message"); ?>:</td>
	<td><textarea name="vacation" cols="40" rows="5" class="textfield"><? print $row['vacation']; ?></textarea>
	<tr><td><? echo _("Forwarding on"); ?>:</td><td><input name="on_forward" type="checkbox" <?
		if ($row['on_forward'] == "1") { print " checked "; } ?> ></td></tr>
	<tr><td><? echo _("Forward mail to"); ?>:</td>
	<td><input type="text" size="25" name="forward" value="<? print $row['forward']; ?>" class="textfield"></td></tr>
	<input name="user_id" type="hidden" value="<? print $_GET['user_id']; ?>" class="textfield">
	<input name="localpart" type="hidden" value="<? print $row['localpart']; ?>" class="textfield">
	<tr><td colspan="2" class="button"><input name="submit" type="submit" value="Submit"></td></tr>
	<tr><td colspan="2" style="padding-top:1em"><? echo _("Aliases to this account "); ?>:<br>
	<?
	  # Print the aliases associated with this account
	  $query = "SELECT user_id,localpart,domain,realname FROM users,domains
			WHERE smtp='{$row['localpart']}@{$_COOKIE['vexim'][1]}'
			AND users.domain_id=domains.domain_id ORDER BY realname";
	  $result = $db->query($query);
	  if ($result->numRows()) {
	    while ($row = $result->fetchRow()) {
	      if ($row['domain'] == $_COOKIE['vexim'][1]) {
		print " <a href=\"adminaliaschange.php?user_id={$_GET['user_id']}\">{$row['localpart']}@{$row['domain']}</a> ";
	      } else {
		print "{$row['localpart']}@{$row['domain']}";
	      }
	      if ($row['realname'] == "Catchall") {
		print "{$row[realname]}";
	      }
	      print "<br>\n";
	    }
	  }
	?>
	</td></tr>
      </form>
    </table>
    <table align="center">
      <form name="blocklist" method="post" action="adminuserblocksubmit.php">
	  <tr><td colspan="2"><? echo _("Add a new header blocking filter for this user"); ?>:</td></tr>
	  <tr><td><? echo _("Header"); ?>:</td><td><select name="blockhdr" class="textfield">
		  <option value="From">From:</option>
		  <option value="To">To:</option>
                  <option value="Subject">Subject:</option>
		  <option value="X-Mailer">X-Mailer:</option>
		  </select></td>
	      <td><input name="blockval" type="text" size="25" class="textfield">
		  <input name="user_id" type="hidden" value="<? print $_GET['user_id']; ?>">
		  <input name="color" type="hidden" value="black"></td></tr>
	  <tr><td><input name="submit" type="submit" value="<? echo _("Submit"); ?>"></td></tr>
      </form>
    </table>
    <table align="center">
      <tr><th><? echo _("Delete"); ?></th><th><? echo _("Blocked Heade"); ?>r</th><th><? echo _("Content"); ?></th></tr>
      <? if ($blockresult->numRows()) { while ($blockrow = $blockresult->fetchRow()) {
	      print "<tr><td><a href=\"adminuserblocksubmit.php?action=delete&user_id={$_GET['user_id']}&block_id={$blockrow['block_id']}&localpart={$blockrow['localpart']}\"><img style=\"border:0;width:10px;height:16px\" title=\"Delete\" src=\"images/trashcan.gif\" alt=\"trashcan\"></a></td>";
	      print "<td>{$blockrow['blockhdr']}</td><td>{$blockrow['blockval']}</td></tr>\n";<commit_msg>Fixed typo<commit_after><?
  include_once dirname(__FILE__) . "/config/variables.php";
  include_once dirname(__FILE__) . "/config/authpostmaster.php";

  $query = "SELECT * FROM users WHERE user_id={$_GET['user_id']}";
  $result = $db->query($query);
  if ($result->numRows()) { $row = $result->fetchRow(); }
  $username = $row[username];
  $domquery = "SELECT avscan,spamassassin,quotas,pipe FROM domains WHERE domain_id={$_COOKIE['vexim'][2]}";
  $domresult = $db->query($domquery);
  if ($domresult->numRows()) { $domrow = $domresult->fetchRow(); }
  $blockquery = "SELECT blockhdr,blockval,block_id FROM blocklists,users
		WHERE blocklists.user_id='{$_GET['user_id']}'
		AND users.user_id=blocklists.user_id";
  $blockresult = $db->query($blockquery);
?>
<html>
  <head>
    <title>Virtual Exim: <? echo _("Manage Users"); ?></title>
    <link rel="stylesheet" href="style.css" type="text/css">
  </head>
  <body onLoad="document.userchange.realname.focus()">
  <? include dirname(__FILE__) . "/config/header.php"; ?>
    <div id="menu">
      <a href="adminuser.php"><? echo _("Manage Accounts"); ?></a><br>
      <a href="admin.php"><? echo _("Main Menu"); ?></a><br>
      <br><a href="logout.php"><? echo _("Logout"); ?></a><br>
    </div>
    <div id="forms">
    <table align="center">
      <form name="userchange" method="post" action="adminuserchangesubmit.php">
	<tr><td><? echo _("Name"); ?>:</td><td><input type="text" size="25" name="realname" value="<? print $row['realname']; ?>" class="textfield"></td></tr>
	<tr><td><? echo _("Email Address"); ?>:</td><td><? print $row['username']; ?></td></tr>
	<input name="user_id" type="hidden" value="<? print $_GET['user_id']; ?>" class="textfield">
	<tr><td><? echo _("Password"); ?>:</td><td><input type="password" size="25" name="clear" class="textfield"></td></tr>
	<tr><td><? echo _("Verify Password"); ?>:</td><td><input type="password" size="25" name="vclear" class="textfield"></td></tr>
	<? if ($postmasteruidgid == "yes") {
	  print "<tr><td>UID:</td><td><input type=\"text\" size=\"25\" name=\"uid\" class=\"textfield\" value=\"{$row['uid']}\"></td></tr>\n";
	  print "<tr><td>GID:</td><td><input type=\"text\" size=\"25\" name=\"gid\" class=\"textfield\" value=\"{$row['gid']}\"></td></tr>\n"; 
	  print "<tr><td colspan=\"2\" style=\"padding-bottom:1em\">" . _("When you update the UID or GID, please make sure your MTA still has permission to create the required user directories!") . "</td></tr>\n";
	  }
	  if ($domrow['quotas'] > "0") {
	    print "<tr><td>" . _("Mailbox quota") . " ({$domrow['quotas']} Mb max):</td>";
	    print "<td><input type=\"text\" size=\"5\" name=\"quota\" value=\"{$row['quota']}\" class=\"textfield\">Mb</td></tr>\n";
	} 
	if ($domrow['pipe'] == "1") {
	     print "<tr><td>" . _("Pipe to command or alternative Maildir") . ":</td>";
	     print "<td><input type=\"textfield\" size=\"25\" name=\"smtp\" class=\"textfield\" value=\"{$row['smtp']}\"></td></tr>\n";
	     print "<tr><td colspan=\"2\" style=\"padding-bottom:1em\">" . _("Optional") . ":" . _(" Pipe all mail to a command (e.g. procmail).") . "<br>\n";
	     print _("Check box below to enable") . ":</td></tr>\n";
	     print "<tr><td>" . _("Enable piped command or alternative Maildir") . "?</td><td><input type=\"checkbox\" name=\"on_piped\"";
	     if ($row['on_piped'] == "1") { print " checked "; } print "></td></tr>\n";
	} ?>
	<tr><td><? echo _("Admin"); ?>:</td><td><input name="admin" type="checkbox" <?
	   if ($row['admin'] == 1) { print "checked"; } ?> class="textfield"></td></tr>
	<? if ($domrow['avscan'] == "1") {
	     print "<tr><td>" . _("Anti-Virus") . ":</td><td><input name=\"on_avscan\" type=\"checkbox\"";
	     if ($row['on_avscan'] == "1") { print " checked "; } print "></td></tr>\n";
	   }
	   if ($domrow['spamassassin'] == "1") {
	     print "<tr><td>" . _("Spamassassin") . ":</td><td><input name=\"on_spamassassin\" type=\"checkbox\"";
	     if ($row['on_spamassassin'] == "1") { print " checked "; } print "></td></tr>\n";
	     print "<tr><td>" . _("Spamassassin tag score") . ":</td>";
	     print "<td><input type=\"text\" size=\"5\" name=\"sa_tag\" value=\"{$row['sa_tag']}\" class=\"textfield\"></td></tr>\n";
	     print "<tr><td>" . _("Spamassassin refuse score") . ":</td>";
	     print "<td><input type=\"text\" size=\"5\" name=\"sa_refuse\" value=\"{$row['sa_refuse']}\" class=\"textfield\"></td></tr>\n";
	   }
	   print "<tr><td>" . _("Maximum message size") . ":</td>";
	   print "<td><input type=\"text\" size=\"5\" name=\"maxmsgsize\" value=\"{$row['maxmsgsize']}\" class=\"textfield\">Kb</td></tr>\n";
	?>
	<tr><td><? echo _("Enabled"); ?>:</td><td><input name="enabled" type="checkbox" <?
		if ($row['enabled'] == 1) { print "checked"; } ?> class="textfield"></td></tr>
	<tr><td><? echo _("Vacation on"); ?>:</td><td><input name="on_vacation" type="checkbox" <?
		if ($row['on_vacation'] == "1") { print " checked "; } ?> ></td></tr>
	<tr><td><? echo _("Vacation message"); ?>:</td>
	<td><textarea name="vacation" cols="40" rows="5" class="textfield"><? print $row['vacation']; ?></textarea>
	<tr><td><? echo _("Forwarding on"); ?>:</td><td><input name="on_forward" type="checkbox" <?
		if ($row['on_forward'] == "1") { print " checked "; } ?> ></td></tr>
	<tr><td><? echo _("Forward mail to"); ?>:</td>
	<td><input type="text" size="25" name="forward" value="<? print $row['forward']; ?>" class="textfield"></td></tr>
	<input name="user_id" type="hidden" value="<? print $_GET['user_id']; ?>" class="textfield">
	<input name="localpart" type="hidden" value="<? print $row['localpart']; ?>" class="textfield">
	<tr><td colspan="2" class="button"><input name="submit" type="submit" value="Submit"></td></tr>
	<tr><td colspan="2" style="padding-top:1em"><? echo _("Aliases to this account "); ?>:<br>
	<?
	  # Print the aliases associated with this account
	  $query = "SELECT user_id,localpart,domain,realname FROM users,domains
			WHERE smtp='{$row['localpart']}@{$_COOKIE['vexim'][1]}'
			AND users.domain_id=domains.domain_id ORDER BY realname";
	  $result = $db->query($query);
	  if ($result->numRows()) {
	    while ($row = $result->fetchRow()) {
	      if ($row['domain'] == $_COOKIE['vexim'][1]) {
		print " <a href=\"adminaliaschange.php?user_id={$_GET['user_id']}\">{$row['localpart']}@{$row['domain']}</a> ";
	      } else {
		print "{$row['localpart']}@{$row['domain']}";
	      }
	      if ($row['realname'] == "Catchall") {
		print "{$row[realname]}";
	      }
	      print "<br>\n";
	    }
	  }
	?>
	</td></tr>
      </form>
    </table>
    <table align="center">
      <form name="blocklist" method="post" action="adminuserblocksubmit.php">
	  <tr><td colspan="2"><? echo _("Add a new header blocking filter for this user"); ?>:</td></tr>
	  <tr><td><? echo _("Header"); ?>:</td><td><select name="blockhdr" class="textfield">
		  <option value="From">From:</option>
		  <option value="To">To:</option>
                  <option value="Subject">Subject:</option>
		  <option value="X-Mailer">X-Mailer:</option>
		  </select></td>
	      <td><input name="blockval" type="text" size="25" class="textfield">
		  <input name="user_id" type="hidden" value="<? print $_GET['user_id']; ?>">
		  <input name="color" type="hidden" value="black"></td></tr>
	  <tr><td><input name="submit" type="submit" value="<? echo _("Submit"); ?>"></td></tr>
      </form>
    </table>
    <table align="center">
      <tr><th><? echo _("Delete"); ?></th><th><? echo _("Blocked Header"); ?></th><th><? echo _("Content"); ?></th></tr>
      <? if ($blockresult->numRows()) { while ($blockrow = $blockresult->fetchRow()) {
	      print "<tr><td><a href=\"adminuserblocksubmit.php?action=delete&user_id={$_GET['user_id']}&block_id={$blockrow['block_id']}&localpart={$blockrow['localpart']}\"><img style=\"border:0;width:10px;height:16px\" title=\"Delete\" src=\"images/trashcan.gif\" alt=\"trashcan\"></a></td>";
	      print "<td>{$blockrow['blockhdr']}</td><td>{$blockrow['blockval']}</td></tr>\n";
{'fraction_non_alphanumeric': 0.2800973600449354, 'fraction_numerical': 0.006241028521500343, 'mean_word_length': 4.587168758716876, 'pattern_counts': {'":': 16, '<': 563, '<?xml version=': 0, '>': 587, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '632297', 'n_tokens_mistral': 5730, 'n_tokens_neox': 5586, 'n_words': 1118}