What you need
- An Apache web server running PHP
- A Novell NetWare 4.x - 6.x network. Later versions use a Linux kernel and this code hasn't been tested on such.
- JRB Utils, a third-party library of NetWare tools, specifically Getrest which displays account restrictions for multiple NDS users.
How it Works
- Use straight HTML to create a list of NDS/eDirectory contexts in which we wish to chech last user logins
- Use PHP to construct a DOS command sequence for the JRB Utility getrest to perform the query
Here's how the HTML code for the NDS context list might look for three contexts and one Novell Group (the last entry)
(using CSS might be an option, I wrote this a long time ago).
Selecting an eDirectory/NDS Context to search in:
(Click on the thumbnail, right, to see what this should look like - depending on your CSS style sheet).
<form method=post action="<?php echo $PHP_SELF;?>">
<table width="80%" border="0" cellspacing="2" cellpadding="3">
<tr>
<td colspan="2">
Please Select an eDirectory Context below
<tr>
<td align"right"> </td>
<td>
<INPUT TYPE="RADIO" NAME="context" VALUE="somusers" CHECKED="true">SML Main context: som.staff.hw</INPUT>
<INPUT TYPE="RADIO" NAME="context" VALUE="lanusers">Languages Staff: staff.lan.hw</INPUT><P>
<INPUT TYPE="RADIO" NAME="context" VALUE="logmsc">Logistics Msc Microlab users: loglab.som.staff.hw</INPUT><P>
<INPUT TYPE="RADIO" NAME="context" VALUE="langmsc">Languages MSc Microlab users: som.staff.hw</INPUT>
</tr>
<tr>
<td>
<td><input type="submit" value="Submit" name="Submit">
<input type="reset" value="Cancel" name="cancel"></td>
</tr>
</table>
Notice how the fully-qualified context name is identified from the form variable passed e.g. somusers is matched to eDirectory context .som.staff.hw.
(Click on the thumbnail, right, to see what this should look like - depending on your CSS style sheet).
<?php
if ( isset($_POST['context']) ) {
// Handle eDirectory Contexts
if ($_POST['context']=='somusers'){
$nds = 'som.staff.hw';
}
if ($_POST['context']=='lanusers'){
$nds = 'staff.lan.hw';
}
if ($_POST['context']=='logmsc'){
$nds = 'loglab.som.staff.hw';
}
if ($_POST['context']=='langmsc'){
$nds = '#.lanpgmicrolab.som.staff.hw';
}
// Handle eDirectory Groups
if ($_POST['context']<>'langmsc'){
// When performing a last login for members of a group the syntax is slightly different
echo "<P><h3>Last Login Dates for users in <font color=\"red\">" . $nds ."</font></h3><pre>\n";
$lookup = 'N:\School\utils\JRButils\jrb32\getrest .*.' . $nds . ' lld /sv';
} else {
echo "<P><h3>Last Login Dates for users in <font color=\"red\">" . $nds ."</font></h3><pre>\n";
$lookup = 'N:\School\utils\JRButils\jrb32\getrest ' . $nds . ' lld /sv';
}
// Send the command to DOS for execution
passthru($lookup);
echo "</PRE>\n";
}
?>
Summary
That's it!

