<html>

<head>

<script language="JavaScript">
<!---
function do_copy(sel){
 var i;
 for (i=0; i<sel.options.length; i++)
   if (sel.options[i].selected==true)
     document.manager.uset.value
      = sel.options[i].text;
}
// -->
</script>


<title>WebMail Management</title>
</head>

||ifdef||background||
<body background="||nwimg||/||background||">
||else||
<body>
||endif||
<center>
<table cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td valign="top">
		<img src="||nwimg||/logo.gif"></td>
        <td>&nbsp;</td>
        <td align="center" valign="top">
		<font color="#FF0000" size="6">WebMail Management</font></td>
        <td>&nbsp;</td>
        <td align="right" valign="top"><img src="||nwimg||/logo.gif"></td>
    </tr>
</table>
</center>
||ifdef||error||
	<center>
	<table border="1">		
		<tr>	<td><img src="||nwimg||/attention.gif">
			<td bgcolor="ffffff">||error||</td>
		</tr>
	</table>
	</center>
||endif||


||ifndef||manpass||
	<h3>Welcome to the Managers Page. This is used to assist in mantaining your users.</h3>	
	<h3>You Must Enter Your Managers Password Below</h3>
	<form action="||action||" method="post">
		<input type=hidden name="cmd" value="domanager">

		<center>
		<input type="password" size="20" name="manpass">
		<input type="submit" name="domanager" size="10" value="Enter Manager" >
		</center>
	</form>
	<p><b>NOTE:</b> To setup a managers password you need to add the following line to your ini file:<p>

	<pre>                managers_password xxxxx</pre>
||else||

	<center>
	<table border="1" cellpadding="0" cellspacing="0">
	<tr><td><table cellpadding="0" cellspacing="0">
			<tr><td nowrap align="right"><b>Number of users:</b></td><td>||nusers||</td></tr>
			<tr><td nowrap align="right"><b>Matching users:</b></td><td>||nmatches||</td></tr>
			<tr><td nowrap align="right"><b>Number Changed:</b></td><td>||nmodified||</td></tr>
		</table></td>
	<td><table border="1" cellpadding="0" cellspacing="0">
		<form name=manager action="||action||" method="post">
		<input type="hidden" name="manpass" value="||manpass||">
		<input type="hidden" name="wild_search" value="||wild_search||">
		<tr><td><table cellpadding="0" cellspacing="0">
			<tr>	<td><b>Apply to users matching:</b></td>
				<td><input type="text" name="uwild" size="10" value="||uwild||" ></td>
			</tr>	
			<tr>	<td><b>Setting to Change:</b></td>
				<td><input type="text" name="uset" size="15" value="||uset||" ></td>
				<td><select size="1" name="uset1" onchange="do_copy(this)">
						||include||user_opt.dat||
					</select></td>
			</tr>
			<tr>	<td><b>New Value:</b></td>
				<td><input type="text" name="uval" size="10" value="||uval||"></td>
				<td align="center"><input type="submit" name="domanager_process" size="10" value="Process"></td>
			</table>
			<input type="checkbox" name="uadd" value="on" ||uadd||>Add a line for users with no curent matching setting
		<tr><td><table>
			<tr><td>Delete <em>All Files</em> for WebMail users matching:</td></tr>
			<tr><td><input type="text" name="uwild" size="10" value="">
				<input type="submit" name="domanager_delete" size="10" value="Delete Accounts" >
				Use with care!</td></tr>
			<tr><td>eg. 'john*'<br>will match: john@1.2.3.4, john@4.3.2.1, john1@1.2.3.4</td></tr>
			</table>
		</form></table>
	</td></tr>
	<tr><td><table cellpadding="0" cellspacing="0">
			<tr><td nowrap align="right"><b>EMails Removed:</b></td><td>||nemails_removed||</td></tr>
			<tr><td nowrap align="right"><b>Accounts Removed:</b></td><td>||naccounts_removed||</td></tr>
		</table></td>
	<td>	<form action="||action||" method="post">
		<input type="hidden" name="manpass" value="||manpass||">
		<input type="hidden" name="wild_search" value="||wild_search||">
		<table cellpadding="0" cellspacing="0">
		<tr align="center">	<td><h3>Cleaning Functions</h3></td></td></tr>
		<tr>	<td><b>Apply to users:</b> <input type="text" name="uwild" size="10" value="||uwild||" > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="submit" name="domanager_cleaning" size="10" value="Clean"></td></tr>
		<tr>	<td>Remove accounts that have not been used for <input type="text" name="account_days" size="3" value=""> days.</td></tr>
		<tr>	<td>Remove EMails <input type="text" name="email_days" size="3" value=""> days old and larger than <input type="text" name="email_size" size="3" value=""> kilo-bytes.</td></tr>
		<tr>	<td><input type="checkbox" name="remove_fails" value="on">Remove Accounts that can not connect to their POP/IMAP server.</td></tr>
		<tr>	<td><input type="checkbox" name="remove_invalid" value="on">Remove Accounts that fail password check.</td></tr>
		<tr>	<td><input type="checkbox" name="remove_draft" value="on">Remove Draft Messages as Well.</td></tr>
		<tr>	<td><b>NOTE:</b> The users trash will be emptied, and kick them off the IMAP server.</td></tr>
		</form></table>
	</td></tr>

	<tr>	<td>&nbsp;</td>
		<td>
			<center><b>Hash Method Converting</b></center><br>

<form action="||action||" method="post">
		<input type="hidden" name="manpass" value="||manpass||">
		<input type="hidden" name="wild_search" value="||wild_search||">

<table border width="100%"> 

<tr>	<td align="center">
	<b>hash_method 1 (default)
		||ifequal||hash_method||2||
		||else||
			<br>(currently using)
		||endif||
	</b></td>	
	<td align="center"><b>hash_method 2
		||ifequal||hash_method||2||
			<br>(currently using)
		||endif||
	</b></td>
</tr>
<tr><td>
	The user profile directory layout for this method is:<br>

	&nbsp;&nbsp;&nbsp;<b>/u_xx/username@pop_host:port</b><br>

	Where 'u_xx' is build from the first two character of the username.<br>
	&nbsp;&nbsp;&nbsp;ie. <b>/u_jo/john@1_2_3_4:143</b>

	<center><input type="submit" name="domanager_method_one" size="10" value="Convert All User to Method 1"></center>
</td>
<td>
	The user profile directory layout for this method is:<br>

	&nbsp;&nbsp;&nbsp;<b>/n_xx/yy/username@pop_host:port</b><br>
	
	Where 'n_xx' and 'yy' is generated from the full username.<br>
	&nbsp;&nbsp;&nbsp;ie. <b>/n_v0/w1/john@1_2_3_4:143</b>

	<center><input type="submit" name="domanager_method_two" size="10" value="Convert All User to Method 2"></center>
</td></tr>

</table>
</form>
		</td>
	</tr>
	</table>
	</center>	

	<hr>

	||ifdef||user||
		<a name="userinfo"></a>
		<form action="||action||#userinfo" method="post">
			<input type="hidden" name="manpass" value="||manpass||">
			<input type="hidden" name="user" value="||user||">
			<input type="hidden" name="wild_search" value="||wild_search||">

			<center>
			<h2>||host_user0||@||host_name0||</h2>
			<table border="1" cellpadding="0" cellspacing="0">
				<tr>	<td align="right"><b>Last Login:</b></td>
					<td>||last_login_time||</td>
				</tr>
				<tr>	<td align="right"><b>Real Name:</b></td>
					<td><b>||_real_name||</b></td>
				</tr>
				<tr><td align="right"><b>Logout Last Session:</b></td><td>
					||ifequal||_no_logout||Occured||
						NO</td>
					||else||
						YES</td>
					||endif||
				</tr>
				<tr>	<td align="right"><b>Default Reply:</b></td>
					<td><b>||dflt_reply||</b></td>
<!--					<td align="center"><input type="submit" name="domanager_save" size="10" value="Update"></td> -->
				</tr>
	
				<tr><td align="right"><b>Message Settings:</b>
				    <td><table cellpadding="0" cellspacing="0">
					<tr><td><input type=checkbox name="v_raw" value="on" ||v_raw||>Raw</td>
					<td><input type=checkbox name="v_headers" value="on" ||v_headers||>Headers</td>
					<td><input type=checkbox name="v_font" value="on" ||v_font||>Variable width font</td></tr>
					<tr><td><input type=checkbox name="v_inline" value="on" ||v_inline||>Inline Images</td>
					<td><input type=checkbox name="v_asis" value="on" >HTML</td>
					<td><input type=checkbox name="v_exec" value="on" >Execute HTML</td></tr>
					<tr><td><input type=checkbox name="autoadd" value="on" ||autoadd||> Add addresses automatically</td>
					</table></td>
				</tr>
				<tr>	<td align="right"><b>Max Pick Size</b></td>
					<td><b>||max_pick_size||</b></td>
				</tr>
		
			</table>
			</center>
			<center><input type="submit" name="domanager_view" size="10" value="view user.dat"></center>
		</form>

		||ifdef||show_email||
			<form action="||action||#userinfo" method="post">
				<input type="hidden" name="manpass" value="||manpass||">
				<input type="hidden" name="user" value="||user||">
				<input type="hidden" name="wild_search" value="||wild_search||">

				<center><table border="1">
					<tr><td><textarea name="user_data" rows=15 cols=80>||show_email||</textarea>
				</table>
				<input type="submit" name="domanager_data" size="10" value="save user.dat">
				</center>
			</form>
		||endif||

		<hr>
	||endif||

	<a name="#usersearch"></a>
	<form action="||action||#usersearch" method="post">
		<input type="hidden" name="manpass" value="||manpass||">
		<input type="text" size="15" name="wild_search" value="||wild_search||">
		
		<input type="submit" name="domanager_search" size="10" value="Search">
	</form>
	<p>e.g. lynden, jo*hn, w??ll </p>

	<p><b>Search Results</b><p>
	<p>
	||begin_users||
		<a href="||action||?cmd=domanager_show&manpass=||manpass||&user=||user||&wild_search=||wild_search||&&#userinfo">||user_name||@||user_host||:||user_port|| 
		||ifdef||hash_type||||ifequal||hash_type||hash_method||||else||(||hash_type||)||endif||
		||else||(||hash_type||)||endif||</a>,
	||end_users||
	</p>

||endif||


||ifdef||register||
<p>If you are the system administrator of this site and you wish to register this 
copy of WebMail then you should click here ||register|| to enter order details.</p>
||endif||



<hr>
||copyright||
</body>
</html>
