$gdivAtt->lTableWidth = 900;
$gdivAtt->lUnderscoreWidth = 300;
$gdivAtt->divID = 'groupDiv';
$gdivAtt->divImageID = 'groupDivImg';
$gdivAtt->bStartOpen = true;
$gdivAtt->bAddTopBreak = true;
$gdivAtt->bCloseDiv = false;
echoT($strHTMLSummary);
if ($utable->lNumEditableFields == 0 && !$bCProg) {
    echoT('<br><i>There are no editable fields in table <b>' . htmlspecialchars($utable->strUserTableName) . '.</b></i><br>');
    return;
}
$glLabelWidth = 150;
$clsForm = new generic_form();
openForm($clsForm, $lTableID, $lFID, $lRecID, $lEnrollRecID, $bUseReturnPath, $bCusVerification);
userTable($clsForm, $utable, $errMessages, $strSafeAttendLabel, $strSafeEnrollLabel);
buttonAndClose($clsForm);
function openForm(&$clsForm, $lTableID, $lFID, $lRecID, $lEnrollRecID, $bUseReturnPath, $bCusVerification)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gbShowHiddenVerifyError;
    $clsForm->strLabelClass = $clsForm->strLabelRowLabelClass = $clsForm->strLabelClassRequired = 'enpViewLabel';
    $clsForm->strTitleClass = 'enpViewTitle';
    $clsForm->strEntryClass = 'enpView';
    $clsForm->bValueEscapeHTML = false;
    $attributes = array('name' => 'frmPTable', 'id' => 'frmPTable');
    echoT(form_open('admin/uf_multirecord/addEditMultiRecord/' . $lTableID . '/' . $lFID . '/' . $lRecID . '/' . $lEnrollRecID . '/' . ($bUseReturnPath ? 'true' : 'false'), $attributes));
    if ($bCusVerification) {
        echoT(form_hidden('hVerify', 'true') . "\n");
    userTable($users, 2, $config);
    ?>
      </div>
      <div id="fragment-3">
        <?php 
    userTable($users, 3, $config);
    ?>
      </div>
      <div id="fragment-4">
        <?php 
    userTable($users, 4, $config);
    ?>
      </div>
      <div id="fragment-5">
        <?php 
    userTable($users, 5, $config);
    ?>
      </div>
  </div>

  
  
  <div id="tableBottom">
    <div>
			<input type="button" value="Save Admins to Servers" class="button" onclick="location.href='index.php?page=uploadAdmins&adminPage=1'" />
    </div>
  </div>
    
</div>
<h5>Resetting a password emails the user a new randomly generated password.</h5>
<br/>
Example #3
0
function displayUserManagement()
{
    global $mysqli;
    if (ACCESS < ACCESS_USERDB) {
        redirect(BASEDIR);
    }
    echo '<h2>User management</h2>';
    $result = $mysqli->query("SELECT *, (SELECT COUNT(*) FROM `compos` B WHERE A.`idhost` = B.`idhost`) AS `num_compos` FROM `hosts` A ORDER BY `access_level` DESC, `idhost` ASC") or die('query failed');
    echo "<table>";
    while ($row = $result->fetch_assoc()) {
        echo "<tr><td style=\"width:28px;\">";
        if (canDeleteUser($row)) {
            $nameJS = str_replace("'", "\\'", str_replace("\\", "\\\\", htmlspecialchars($row["hostname"])));
            echo '<a href="{{BASE}}admin/deluser/', $row["idhost"], '" onclick="return confirm(\'Delete ', $nameJS, '?\')"><img src="{{BASE}}img/user_delete.png" width="16" height="16" alt="Delete" title="Delete"></a>';
        }
        echo "</td><td style=\"width:20px;\">";
        $editOpen = "";
        $editClose = "";
        if (canEditUser($row)) {
            $editOpen = '<a href="{{BASE}}admin/user/' . $row["idhost"] . '">';
            $editClose = '</a>';
            echo $editOpen, '<img src="{{BASE}}img/user_edit.png" width="16" height="16" alt="Edit" title="Edit">', $editClose;
        }
        echo "</td>";
        echo '<td>', $editOpen, '<strong>', htmlspecialchars($row["hostname"]), '</strong>', $editClose, $row["idhost"] == $_SESSION["idhost"] ? " (you)" : "", '</td>
            <td><img src="{{BASE}}img/vcard.png" width="16" height="16" alt="Role:"> ', htmlspecialchars(getRoleName($row["access_level"])), '</td>';
        if (ACCESS >= ACCESS_FULLADMIN) {
            echo '<td>', $row["num_compos"], ' compos</td>';
        }
        echo "</tr>";
    }
    echo "</table>";
    $result->free();
    echo '<h2 id="addusertable">Add user</h2>';
    if (isset($_GET["which"])) {
        switch ($_GET["which"]) {
            case 1:
                echo '<p>User name is missing!</p>';
                break;
            case 2:
                echo '<p>No password specified or passwords did not match!</p>';
                break;
            case 3:
                echo '<p>Invalid role specified!</p>';
                break;
            case 4:
                echo '<p>User name is already taken!</p>';
                break;
        }
    }
    userTable(NULL);
}