예제 #1
0
 case "list":
     // Build table to list users and return it as $usertable
     $user = new BaseUser();
     $users = $user->returnUsers();
     $tmpHTML = "<TABLE CELLSPACING=0 CELLPADDING=2 BORDER=0 WIDTH='100%' BGCOLOR='#000000'><TR><TD>";
     $tmpHTML = $tmpHTML . "<table CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH='100%' BGCOLOR='#FFFFFF'>";
     $tmpHTML = $tmpHTML . "<tr><td CLASS='plfieldhdr' width=25>" . _EDIT . "</td><td CLASS='plfieldhdr' width=35>&nbsp;" . _DELETE . "</td><td CLASS='plfieldhdr'>" . _ID . "</td><td CLASS='plfieldhdr'>" . _LOGIN;
     $tmpHTML = $tmpHTML . "</td><td CLASS='plfieldhdr'>" . _ROLEID . "</td><td CLASS='plfieldhdr'>" . _NAME;
     $tmpHTML = $tmpHTML . "</td><td CLASS='plfieldhdr'>" . _ENABLED . "</td></tr>";
     // Verify that we have a user in the db --Kevin
     if ($users != "") {
         foreach ($users as $row) {
             //explode array rows and build table
             $tmpRow = explode("|", $row);
             $enabled = $tmpRow[4] == 1 ? "<a href='base_useradmin.php?action=disableuser&amp;userid=" . urlencode($tmpRow[0]) . "'><img src='" . $BASE_urlpath . "/images/greencheck.png' border='0' alt='button_greencheck'></a>" : "<a href='base_useradmin.php?action=enableuser&amp;userid=" . urlencode($tmpRow[0]) . "'><img src='" . $BASE_urlpath . "/images/button_exclamation.png' border='0' alt='button_exclamation'>";
             $rolename = $user->roleName($tmpRow[2]);
             $name = $tmpRow[2] == 1 ? "<font color='#ff000'><b>" . htmlspecialchars($tmpRow[1]) . "</b></font>" : htmlspecialchars($tmpRow[1]);
             $tmpHTML = $tmpHTML . "<tr><td align='center'><a href='base_useradmin.php?action=edituser&amp;userid=" . urlencode($tmpRow[0]) . "'>";
             $tmpHTML = $tmpHTML . "<img src='" . $BASE_urlpath . "/images/button_edit.png' border='0' alt='button_edit'></a></td>";
             $tmpHTML = $tmpHTML . "<td align='center'><a href='base_useradmin.php?action=deleteuser&amp;userid=" . urlencode($tmpRow[0]) . "'>";
             $tmpHTML = $tmpHTML . "<img src='" . $BASE_urlpath . "/images/button_delete.png' border='0' alt='button_delete'></a></td>";
             $tmpHTML = $tmpHTML . "<td align='center'>" . htmlspecialchars($tmpRow[0]);
             $tmpHTML = $tmpHTML . "</td><td align='center'>" . htmlspecialchars($name);
             $tmpHTML = $tmpHTML . "</td><td align='center'>" . htmlspecialchars($rolename);
             $tmpHTML = $tmpHTML . "</td><td align='center'>" . htmlspecialchars($tmpRow[3]);
             $tmpHTML = $tmpHTML . "</td><td align='center'>" . $enabled . "</td></tr>";
         }
     }
     // Footer of table
     $tmpHTML = $tmpHTML . "</table></td></tr></table>";
     $pagebody = $tmpHTML;
예제 #2
0
            $page_body = $page_body . $form;
            break;
        case "display":
            $user = new BaseUser();
            $userlogin = $user->returnUser();
            $userid = $user->returnUserID($userlogin);
            $userinfo = $user->returnEditUser($userid);
            $form = "<table border=1 class='query'>";
            $form = $form . "<tr><td width='25%' align='right'>" . gettext("User ID:") . "</td>";
            $form = $form . "<td align='left'>" . $userinfo[0] . "</td></tr>";
            $form = $form . "<tr><td width='25%' align='right'>" . gettext("Login:"******"</td>";
            $form = $form . "<td align='left'>" . $userinfo[1] . "</td></tr>";
            $form = $form . "<tr><td width='25%' align='right'>" . gettext("Full Name:") . "</td>";
            $form = $form . "<td align='left'>" . $userinfo[3] . "</td></tr>";
            $form = $form . "<tr><td width='25%' align='right'>" . gettext("Role:") . "</td>";
            $form = $form . "<td align='left'>" . $user->roleName($userinfo[2]) . "</td></tr>";
            $form = $form . "</tr></table>";
            $page_body = $form;
            break;
        default:
            $page_body = $page_body . " ";
    }
}
?>
<!-- Footer menu -->
<table width="100%" border=0><tr><td width="15%" valign="top">
<div class="mainheadermenu" width="50%">
<table border="0" class="mainheadermenu">
    <tr>
        <td class="menuitem">