if ($isadmin==true) {
$remotes=gettranslate($userlang,"SMTP server");
$users=gettranslate($userlang,"User Management");
- $click1="<a href='/lvlusr.php'>$remotes</a>";
+ $click1="<a href='/lvlrmt.php'>$remotes</a>";
$click2="<a href='/lvlusr.php'>$users</a>";
}
$click3="<a href='/lvllog.php'>$out</a>";
$click2="<a href='/lvlmai.php'>$main</a>";
$click3="<a href='/lvllog.php'>$out</a>";
break;
+ case "lvlrmt" :
+ $entete=gettranslate($userlang,"Remote server Management");
+ $main=gettranslate($userlang,"Main screen");
+ $out=gettranslate($userlang,"Logout");
+ $click2="<a href='/lvlmai.php'>$main</a>";
+ $click3="<a href='/lvllog.php'>$out</a>";
+ break;
default :
$color="red";
$data="???";
include_once "gesdis.php";
include_once "gessql.php";
-//section to generate the main screen body
+//==============================================================
+//
+// Procedure to extract the list of actions
+//
+//==============================================================
+function getactions($dbsql,$offset)
+
+{
+$limit=20;
+if (isset($_POST['username']))
+ $username=trim(($_POST['username']));
+if (isset($_POST['limit']))
+ $limit=intval($_POST['limit']);
+$numrec=sql_getnumactions($dbsql,$username);
+$actions=sql_getactionslist($dbsql,$username,$limit,$offset);
+
+return $actions;
+}
+
+//==============================================================
+//
+// section to generate the main screen body
+//
+//==============================================================
function body($logname)
{
$top=topper($isadmin,$logname,"lvlmai");
$footer=footer("lvlmai");
-$limit=20;
$offset=0;
$username="";
-$dbsql=sql_connect();
-if (isset($_POST['username']))
- $username=trim(($_POST['username']));
-if (isset($_POST['limit']))
- $limit=intval($_POST['limit']);
if (isset($_POST['offset']))
$offset=intval($_POST['offset']);
-
-$actions=sql_getactionslist($dbsql,$username,$limit,$offset);
+$dbsql=sql_connect();
+$actions=getactions($dbsql,$offset);
$line="";
$count=$offset+1;
foreach($actions as $action) {
+ rou_alert(0,"JMPDBG count=$count");
$info=substr($action['info'],3,1);
$status=$action['status'];
$subject=htmlspecialchars($action['subject'],ENT_QUOTES);
$bgcolor="#ff6666"; //light red
$subject=htmlspecialchars($action['info'],ENT_QUOTES);
break;
+ case 551 :
+ $bgcolor="#FF7F50"; //coral (orange red)
+ break;
case 555 :
$bgcolor="#D3D3D3"; //light gray
break;
--- /dev/null
+<?php
+// vim: smarttab tabstop=8 shiftwidth=2 expandtab
+//==============================================================
+//
+// Main screen management
+//
+//==============================================================
+include_once "subrou.php";
+include_once "unienv.php";
+include_once "gesdis.php";
+include_once "gessql.php";
+
+function tblheader(string $username,int $numrec,int $offset,int $limit)
+
+{
+global $userlang;
+
+$debut=$offset+1;
+$email=gettranslate($userlang,"Remote SMTP server");
+
+$STR = <<<EOT
+<TR>
+<TD align=left>
+<FORM action="lvlusr.php" method="post">
+<input type="hidden" name="username" value="$username"/>
+<input type="hidden" name="offset" value="$offset"/>
+<input type="hidden" name="limit" value="$limit"/>
+<button name="scanner" value="gofirst">
+<FONT SIZE=+3>
+⇤
+</FONT>
+</Button>
+<button name="scanner" value="goprevious">
+<FONT SIZE=+3>
+←
+</FONT>
+</Button>
+<button name="scanner" value="gonext">
+<FONT SIZE=+3>
+→
+</FONT>
+</Button>
+<button name="scanner" value="golast">
+<FONT SIZE=+3>
+⇥
+</FONT>
+</Button>
+<FONT SIZE=+2>$debut/$numrec</FONT>
+</FORM>
+</TD>
+<TD align=left>
+<FORM action="lvlusr.php" method="post">
+<FONT SIZE=+1>
+$email:
+<input type="text" value="$username" name="username" size=20 style="font-size: 100%;">
+<input type="submit" style="display:none"/>
+</FONT>
+</FORM>
+</TD>
+<TD align=right>
+<FORM method="post">
+<input type="hidden" name="username" value="$username"/>
+<input type="hidden" name="offset" value="$offset"/>
+<input type="hidden" name="limit" value="$limit"/>
+<select name="limit" style="font-size: 130%;" onchange='if (this.value!=0) {this.form.submit();}'>
+<option selected="selected">$limit</option>
+<option value=20>20</option>
+<option value=40>40</option>
+<option value=80>80</option>
+<option value=100>100</option>
+</SELECT>
+</FORM>
+</TD>
+</TR>
+EOT;
+
+return $STR;
+}
+
+//section to generate the main screen body
+function body($logname)
+
+{
+$OPEP="lvlusr.php:body";
+
+global $isadmin;
+global $logname;
+
+$limit=20;
+$offset=0;
+$username="";
+$dbsql=sql_connect();
+if (isset($_POST['username']))
+ $username=trim(($_POST['username']));
+if (isset($_POST['limit']))
+ $limit=intval($_POST['limit']);
+if (isset($_POST['offset']))
+ $offset=intval($_POST['offset']);
+$numrec=sql_getnumemail($dbsql,$username);
+if (isset($_POST['scanner'])) {
+ $scanner=$_POST['scanner'];
+ switch ($scanner) {
+ case "golast" :
+ $offset=$numrec-$limit;
+ break;
+ case "gonext" :
+
+ $offset+=$limit;
+ if ($offset>($numrec-$limit))
+ $offset=$numrec-$limit;
+ break;
+ case "goprevious" :
+ $offset-=$limit;
+ if ($offset<0)
+ $offset=0;
+ break;
+ case "gofirst" :
+ $offset=0;
+ break;
+ default :
+ break;
+ }
+ }
+$emails=sql_getemaillist($dbsql,$username,$limit,$offset);
+$line="";
+$count=$offset;
+foreach($emails as $email) {
+ $count++;
+ $bgcolor="white";
+ if ($count & 1 ) {
+ $bgcolor="green";
+ }
+ $name=$email['email'];
+ $last=$email['lastemail'];
+ $max=$email['mxspace'];
+ $lock=$email['locked'];
+ $line=$line."<TR>\r\n";
+ $line=$line."<TD><FONT SIZE=-1>$count </FONT>\r\n";
+ $line=$line."<INPUT TYPE=IMAGE SRC=\"/reg-icons/folder.gif\" alt=\"ouvrir le dossier\" title=\"ouvrir le dossier\">\r\n";
+ $line=$line." $name\r\n";
+ $line=$line."</TD>\r\n";
+ $line=$line."<TD align=center>$last</TD>\r\n";
+ $line=$line."<TD align=center>$max</TD>\r\n";
+ $line=$line."<TD align=center>$lock</TD>\r\n";
+ $line=$line."</TR>";
+ }
+sql_close($dbsql);
+
+$start=starthtml("directives");
+$stop=endhtml();
+$top=topper($isadmin,$logname,"lvlrmt");
+$footer=footer("lvlusr");
+$tblheader=tblheader($username,$numrec,$offset,$limit);
+
+$STR = <<<EOT
+$start
+$top
+<style type="text/css">
+.table-userlist tr:nth-child(odd)
+ {
+ background-color: #66ff99; /*light green */
+ color: black ;
+ }
+
+.table-userlist tr:nth-child(even)
+ {
+ background-color: white;
+ color: black ;
+ }
+</style>
+
+<CENTER>
+<table WIDTH="100%" BORDER="0" CellSpacing="0">
+$tblheader
+<table class="table-userlist" WIDTH="100%" BORDER="1" CellSpacing="0">
+<TR>
+<TH align=center>Email</TH>
+<TH align=center>lastemail</TH>
+<TH align=center>mxspace</TH>
+<TH align=center>locked</TH>
+</TR>
+$line
+</Table>
+</Table>
+</CENTER>
+<BR>
+<BR>
+$footer
+$stop
+EOT;
+
+return $STR;
+}
+
+
+$dbsql=sql_connect();
+sql_setlogname($dbsql);
+sql_close($dbsql);
+rou_closelog();
+
+if ($logname!=NULL) {
+ echo body($logname);
+ }
+else {
+ header('Location: lvllog.php');
+ }
+?>
+
+
+