diff --git a/webui/group-add.php b/webui/group-add.php index afc37d023ae94e52cbd57bf68fc750d2602e788f..e55ccf071cb2f2fceb229f42a704fced42e5c6b6 100644 --- a/webui/group-add.php +++ b/webui/group-add.php @@ -34,16 +34,14 @@ printHeader(array( )); -if ($_POST['frmaction'] == "add") { +if (isset($_POST['frmaction']) && $_POST['frmaction'] == "add") { ?> <p class="pageheader">Add Group</p> <form method="post" action="group-add.php"> - <div> - <input type="hidden" name="frmaction" value="add2" /> - </div> + <input type="hidden" name="frmaction" value="add2" /> <table class="entry"> <tr> <td class="entrytitle">Name</td> @@ -76,7 +74,7 @@ if ($_POST['frmaction'] == "add") { <?php # Check we have all params -} elseif ($_POST['frmaction'] == "add2") { +} elseif (isset($_POST['frmaction'] && $_POST['frmaction'] == "add2") { ?> diff --git a/webui/group-attribute-add.php b/webui/group-attribute-add.php index 33a331b1bb39e785cbc0706bc45e33cf3c6fb0a3..b6247f39ebaff01130b93bc707e8ce45cfb394e9 100644 --- a/webui/group-attribute-add.php +++ b/webui/group-attribute-add.php @@ -35,13 +35,13 @@ printHeader(array( if (isset($_POST['frmaction']) && $_POST['frmaction'] == "add") { + ?> + <p class="pageheader">Add attribute</p> <form method="post" action="group-attribute-add.php"> - <div> - <input type="hidden" name="frmaction" value="add2" /> - </div> + <input type="hidden" name="frmaction" value="add2" /> <table class="entry"> <tr> <td class="entrytitle">Attribute Name</td> @@ -83,7 +83,7 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "add") { <?php # Check we have all params -} elseif ($_POST['frmaction'] == "add2") { +} elseif (isset($_POST['frmaction']) && $_POST['frmaction'] == "add2") { ?> diff --git a/webui/group-attribute-change.php b/webui/group-attribute-change.php index 359927f53bd3545d61e1edd989e54578065dfb84..6c50ffa283b69b352f1812f0e89b97b72d357122 100644 --- a/webui/group-attribute-change.php +++ b/webui/group-attribute-change.php @@ -40,8 +40,7 @@ if (isset($_POST['frmaction'] && $_POST['frmaction'] == "change") { # Check an attribute was selected if (isset($_POST['attr_id'])) { # Prepare statement - $temp = $_POST['attr_id']; - $sql = "SELECT ID, Name, Operator, Value, Disabled FROM ${DB_TABLE_PREFIX}group_attributes WHERE ID = '$temp'"; + $sql = "SELECT ID, Name, Operator, Value, Disabled FROM ${DB_TABLE_PREFIX}group_attributes WHERE ID = ".$db->quote($_POST['attr_id']); $res = $db->query($sql); $row = $res->fetchObject(); @@ -50,10 +49,8 @@ if (isset($_POST['frmaction'] && $_POST['frmaction'] == "change") { <p class="pageheader">Update Group Attribute</p> <form action="group-attribute-change.php" method="post"> - <div> - <input type="hidden" name="frmaction" value="change2" /> - <input type="hidden" name="attr_id" value="<?php echo $_POST['attr_id']; ?>" /> - </div> + <input type="hidden" name="frmaction" value="change2" /> + <input type="hidden" name="attr_id" value="<?php echo $_POST['attr_id']; ?>" /> <table class="entry" style="width: 75%;"> <tr> <td></td> diff --git a/webui/group-attribute-delete.php b/webui/group-attribute-delete.php index a4bedf25f73b4ff72e30912fde2e8b6e6fc8a48c..0cc3650bf6bc83b3a21b93fa415d819fc111116f 100644 --- a/webui/group-attribute-delete.php +++ b/webui/group-attribute-delete.php @@ -35,12 +35,13 @@ printHeader(array( )); - # Display delete confirm screen if (isset($_POST['frmaction'] && $_POST['frmaction'] == "delete") { # Check a user was selected if (isset($_POST['attr_id'])) { + ?> + <p class="pageheader">Delete Attribute</p> <form action="group-attribute-delete.php" method="post"> @@ -54,51 +55,67 @@ if (isset($_POST['frmaction'] && $_POST['frmaction'] == "delete") { <input type="submit" name="confirm" value="no" /> </div> </form> + <?php + } else { + ?> + <div class="warning">No attribute selected</div> -<?php - } +<?php + } # SQL Updates } elseif (isset($_POST['frmaction']) && $_POST['frmaction'] == "delete2") { + ?> + <p class="pageheader">Attribute Delete Results</p> -<?php - if (isset($_POST['attr_id'])) { +<?php - if ($_POST['confirm'] == "yes") { - $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}group_attributes WHERE ID = ".$_POST['attr_id']); + if (isset($_POST['attr_id'])) { + if (isset($_POST['confirm']) && $_POST['confirm'] == "yes") { + $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}group_attributes WHERE ID = ".$db->quote($_POST['attr_id'])); if ($res !== FALSE) { + ?> + <div class="notice">Attribute with ID: <?php print_r($_POST['attr_id']);?> deleted</div> + <?php + } else { + ?> + <div class="warning">Error deleting attribute</div> <div class="warning"><?php print_r($db->errorInfo()) ?></div> -<?php - } -?> <?php + + } # Warn } else { + ?> + <div class="warning">Delete attribute aborted</div> + <?php + } -?> -<?php } else { + ?> + <div class="warning">Invocation error, no attribute ID selected</div> + <?php - } + } } printFooter(); diff --git a/webui/group-attributes.php b/webui/group-attributes.php index f4daa02d0c97ebbbafa88edf3ad28ed5fbc617bd..9a8a2501836abdf147ca20027eb21e2e4af24239 100644 --- a/webui/group-attributes.php +++ b/webui/group-attributes.php @@ -34,6 +34,7 @@ printHeader(array( )); ?> + <p class="pageheader">Attribute List</p> <form id="main_form" action="group-attributes.php" method="post"> @@ -63,7 +64,7 @@ printHeader(array( </select> </div> -<p /> + <p /> <table class="results" style="width: 75%;"> <tr class="resultstitle"> @@ -73,44 +74,73 @@ printHeader(array( <td class="textcenter">Value</td> <td class="textcenter">Disabled</td> </tr> + <?php - $_SESSION['attr_group_id'] = $_POST['group_id']; - if (isset($_POST['group_id'])) { + + $_SESSION['attr_group_id'] = $_POST['group_id']; + if (isset($_POST['group_id'])) { - $temp = $_SESSION['attr_group_id']; - $sql = "SELECT ID, Name, Operator, Value, Disabled FROM ${DB_TABLE_PREFIX}group_attributes WHERE GroupID = $temp ORDER BY ID"; - $res = $db->query($sql); + $sql = "SELECT + ID, + Name, + Operator, + Value, + Disabled + FROM + ${DB_TABLE_PREFIX}group_attributes + WHERE + GroupID = ".$db->quote($_POST['group_id'])." + ORDER BY + ID + "; + + $res = $db->query($sql); + + while ($row = $res->fetchObject()) { - while ($row = $res->fetchObject()) { ?> - <tr class="resultsitem"> - <td><input type="radio" name="attr_id" value="<?php echo $row->id ?>"/><?php echo $row->id ?></td> - <td><?php echo $row->name ?></td> - <td><?php echo $row->operator ?></td> - <td><?php echo $row->value ?></td> - <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no' ?></td> - </tr> + + <tr class="resultsitem"> + <td><input type="radio" name="attr_id" value="<?php echo $row->id; ?>"/><?php echo $row->id; ?></td> + <td><?php echo $row->name; ?></td> + <td><?php echo $row->operator; ?></td> + <td><?php echo $row->value; ?></td> + <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no'; ?></td> + </tr> + <?php - } - $res->closeCursor(); - if ($res->rowCount() == 0) { + + } + $res->closeCursor(); + if ($res->rowCount() == 0) { + ?> - <p /> - <tr> - <td colspan="5" class="textcenter">Group attribute list is empty</td> - </tr> + + <p /> + <tr> + <td colspan="5" class="textcenter">Group attribute list is empty</td> + </tr> + <?php - } - } else { + + } + } else { + ?> - <tr class="resultitem"> - <td colspan="5" class="textcenter">No Group ID selected</td> - </tr> + + <tr class="resultitem"> + <td colspan="5" class="textcenter">No Group ID selected</td> + </tr> + <?php - } + + } + ?> + </table> </form> + <?php printFooter(); diff --git a/webui/group-delete.php b/webui/group-delete.php index f9313364ec29dd3be5fb995dd7a0ba499587c48b..5f9b3927dfb351940a003b9a803e2da8c99f4e8d 100644 --- a/webui/group-delete.php +++ b/webui/group-delete.php @@ -36,109 +36,101 @@ printHeader(array( # Display delete confirm screen -if ($_POST['frmaction'] == "delete") { - +if (isset($_POST['frmaction']) && $_POST['frmaction'] == "delete") { # Check a policy group was selected if (isset($_POST['group_id'])) { + ?> + <p class="pageheader">Delete Group</p> <form action="group-delete.php" method="post"> - <div> - <input type="hidden" name="frmaction" value="delete2" /> - <input type="hidden" name="group_id" value="<?php echo $_POST['group_id']; ?>" /> - </div> - + <input type="hidden" name="frmaction" value="delete2" /> + <input type="hidden" name="group_id" value="<?php echo $_POST['group_id']; ?>" /> <div class="textcenter"> Are you very sure? <br /> <input type="submit" name="confirm" value="yes" /> <input type="submit" name="confirm" value="no" /> </div> </form> + <?php + } else { + ?> - <div class="warning">No group selected</div> -<?php - } + <div class="warning">No group selected</div> +<?php + } # SQL Updates -} elseif ($_POST['frmaction'] == "delete2") { +} elseif (isset($_POST['frmaction']) && $_POST['frmaction'] == "delete2") { + ?> + <p class="pageheader">Group Delete Results</p> + <?php + if (isset($_POST['group_id'])) { + if (isset($_POST['confirm']) && $_POST['confirm'] == "yes") { - if ($_POST['confirm'] == "yes") { $db->beginTransaction(); - $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}users_to_groups WHERE GroupID = ".$db->quote($_POST['group_id'])); - if ($res !== FALSE) { -?> - <div class="notice">Users removed</div> -<?php - } else { -?> - <div class="warning">Error removing users</div> - <div class="warning"><?php print_r($db->errorInfo()) ?></div> -<?php - $db->rollback(); - } + $resultRemoveMembers = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}users_to_groups WHERE GroupID = ".$db->quote($_POST['group_id'])); + $resultRemoveAttributes = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}group_attributes WHERE GroupID = ".$db->quote($_POST['group_id'])); + $resultRemoveGroup = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}groups WHERE ID = ".$db->quote($_POST['group_id'])); + + if ($resultRemoveMembers && $resultRemoveAttributes && $resultRemoveGroup) { - $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}group_attributes WHERE GroupID = ".$db->quote($_POST['group_id'])); - if ($res !== FALSE) { ?> - <div class="notice">Attributes removed</div> + + <div class="notice">Group deleted</div> + <?php + + $db->commit(); } else { + ?> - <div class="warning">Error removing attributes</div> + + <div class="warning">Error deleting group</div> <div class="warning"><?php print_r($db->errorInfo()) ?></div> -<?php - $db->rollback(); - } - if ($res !== FALSE) { - $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}groups WHERE ID = ".$db->quote($_POST['group_id'])); - if ($res) { -?> - <div class="notice">Group deleted</div> <?php - } else { -?> - <div class="warning">Error deleting group!</div> - <div class="warning"><?php print_r($db->errorInfo()) ?></div> -<?php - $db->rollback(); - } - } - if ($res) { - $db->commit(); + $db->rollback(); } } else { + ?> + <div class="notice">Group not deleted, aborted by user</div> + <?php - } + } # Warn } else { + ?> - <div class="warning">Invocation error, no group ID</div> -<?php - } + <div class="warning">Invocation error, no group ID</div> +<?php + } } else { + ?> + <div class="warning">Invalid invocation</div> + <?php -} +} printFooter(); diff --git a/webui/group-main.php b/webui/group-main.php index 103aff078a05acd17a74c0e263d1e242fa653ca3..b54db36783e6d485b6120c4f5b1e7a16598eb52d 100644 --- a/webui/group-main.php +++ b/webui/group-main.php @@ -32,6 +32,7 @@ printHeader(array( )); ?> + <p class="pageheader">User Groups</p> <form id="main_form" action="group-main.php" method="post"> @@ -76,40 +77,46 @@ printHeader(array( <td class="textcenter">Disabled</td> <td class="textcenter">Comment</td> </tr> + <?php + $sql = "SELECT ID, Name, Priority, Disabled, Comment FROM ${DB_TABLE_PREFIX}groups ORDER BY ID"; $res = $db->query($sql); $rownums = 0; while ($row = $res->fetchObject()) { - if ($row->id != NULL) { - $rownums = $rownums + 1; - } else { - $rownums = $rownums - 1; - } + ?> <tr class="resultsitem"> - <td><input type="radio" name="group_id" value="<?php echo $row->id ?>" /></td> - <td><?php echo $row->name ?></td> - <td><?php echo $row->priority ?></td> - <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no' ?></td> - <td><?php echo $row->comment ?></td> + <td><input type="radio" name="group_id" value="<?php echo $row->id; ?>" /></td> + <td><?php echo $row->name; ?></td> + <td><?php echo $row->priority; ?></td> + <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no'; ?></td> + <td><?php echo $row->comment; ?></td> </tr> + <?php + } - $res->closeCursor(); - if ($rownums <= 0) { + if ($res->rowCount() == 0) { + ?> + <p /> <tr> <td colspan="5" class="textcenter">Group list is empty</td> </tr> + <?php + } - unset($rownums); + $res->closeCursor(); + ?> + </table> </form> + <?php printFooter(); diff --git a/webui/group-users.php b/webui/group-users.php index a7d66568b2b037c1e2e8d1c56c12db00bff9ed67..efc05ef3d528f41c69ca251e362605b785fd9674 100644 --- a/webui/group-users.php +++ b/webui/group-users.php @@ -50,67 +50,60 @@ if (isset($_POST['group_id'])) { ?> - <table class="results" style="width: 75%;"> - <tr class="resultstitle"> - <td class="textcenter">ID</td> - <td class="textcenter">Member</td> - <td class="textcenter">Disabled</td> - </tr> + <table class="results" style="width: 75%;"> + <tr class="resultstitle"> + <td class="textcenter">ID</td> + <td class="textcenter">Member</td> + <td class="textcenter">Disabled</td> + </tr> <?php - # Get list of members belonging to this group - $stmt = $db->prepare("SELECT UserID FROM ${DB_TABLE_PREFIX}users_to_groups WHERE GroupID = ?"); - $res = $stmt->execute(array($_REQUEST['group_id'])); + # Get list of members belonging to this group + $stmt = $db->prepare("SELECT UserID FROM ${DB_TABLE_PREFIX}users_to_groups WHERE GroupID = ?"); + $stmtResult = $stmt->execute(array($_REQUEST['group_id'])); - $rownums = 0; - # Loop with rows - while ($row = $stmt->fetchObject()) { - if ($row->userid != NULL) { - $rownums = $rownums + 1; - } else { - $rownums = $rownums - 1; - } + # Loop with rows + while ($row = $stmt->fetchObject()) { - $sql = "SELECT ID, Username, Disabled FROM ${DB_TABLE_PREFIX}users WHERE ID = ".$row->userid; - $res = $db->query($sql); + $sql = "SELECT ID, Username, Disabled FROM ${DB_TABLE_PREFIX}users WHERE ID = ".$db->quote($row->userid); + $res = $db->query($sql); - # List users - while ($row = $res->fetchObject()) { + # List users + while ($row = $res->fetchObject()) { ?> - <tr class="resultsitem"> - <td><?php echo $row->id ?></td> - <td><?php echo $row->username ?></td> - <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no' ?></td> - </tr> + <tr class="resultsitem"> + <td><?php echo $row->id; ?></td> + <td><?php echo $row->username; ?></td> + <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no'; ?></td> + </tr> <?php - } - $res->closeCursor(); } - $stmt->closeCursor(); + $res->closeCursor(); + } - # Did we get any results? - if ($rownums <= 0) { + # Did we get any results? + if ($stmt->rowCount() == 0) { ?> - <p /> - <tr> - <td colspan="3" class="textcenter">Group has no users</td> - </tr> + <p /> + <tr> + <td colspan="3" class="textcenter">Group has no users</td> + </tr> <?php - } - unset($rownums); + } + $stmt->closeCursor(); ?> - </table> + </table> <?php diff --git a/webui/index.php b/webui/index.php index c6c0549178c9ead8f9a9b263bf4c75cd702a4a4d..0a3b538f6789b99820969c5ee951a281f97450fd 100644 --- a/webui/index.php +++ b/webui/index.php @@ -25,14 +25,18 @@ printHeader(); ?> <p class="pageheader">Features Supported</p> <ul> - - <li>Users & Groups - <a title="Help on policies and groups" href="http://www.policyd.org/tiki-index.php?page=Policies%20%26%20Groups&structure=Documentation" class="help"> - <img src="images/help.gif" alt="Help" /> - </a> + <li>Users + <ul> + <li>Add, remove and edit users</li> + <li>Add, remove and edit user attributes</li> + <li>Add groups, remove groups and edit group attributes</li> + </ul> + </li> + <li>Groups <ul> - <li>Define policy groups made up of various combinations of tags.</li> - <li>Define and manage policies comprising of ACL's which can include groups.</li> + <li>Add and remove groups</li> + <li>Add, remove and edit group attributes</li> + <li>Assign users to groups</li> </ul> </li> </ul> diff --git a/webui/user-add.php b/webui/user-add.php index 104888a01a86d99ea6f90674640b185a9d7ad8ea..6f346c1c74d913af533b5915acf6c82c57202b6c 100644 --- a/webui/user-add.php +++ b/webui/user-add.php @@ -29,9 +29,10 @@ printHeader(array( ), )); +if (isset($_POST['frmaction']) && $_POST['frmaction'] == "add") { -if ($_POST['frmaction'] == "add") { ?> + <p class="pageheader">Add user</p> <form method="post" action="user-add.php"> <div> @@ -49,23 +50,36 @@ if ($_POST['frmaction'] == "add") { </tr> </table> </form> + <?php # Check we have all params -} elseif ($_POST['frmaction'] == "add2") { +} elseif (isset($_POST['frmaction']) && $_POST['frmaction'] == "add2") { + ?> + <p class="pageheader">User Add Results</p> + <?php + # Check name if (empty($_POST['user_name'])) { + ?> + <div class="warning">Username cannot be empty</div> + <?php + } else if (!preg_match('/^[a-z0-9]+$/i', $_POST['user_name'])) { + ?> + <div class="warning">Username invalid: must be alphanumeric</div> + <?php + # Add to database } else { $stmt = $db->prepare("INSERT INTO ${DB_TABLE_PREFIX}users (Username) VALUES (?)"); @@ -74,20 +88,32 @@ if ($_POST['frmaction'] == "add") { )); # Was it successful? if ($res) { + ?> + <div class="notice">User added</div> + <?php + } else { + ?> + <div class="warning">Failed to add user</div> <div class="warning"><?php print_r($stmt->errorInfo()) ?></div> + <?php + } } } else { + ?> + <div class="warning">Invalid invocation</div> + <?php + } printFooter(); diff --git a/webui/user-attribute-add.php b/webui/user-attribute-add.php index 4f626f4fa47084bec0874c5a42582364ba7a13bb..66c8d6d4fcf413d1923d42f8bd199524a7390c62 100644 --- a/webui/user-attribute-add.php +++ b/webui/user-attribute-add.php @@ -37,8 +37,10 @@ printHeader(array( -if ($_POST['frmaction'] == "add") { +if (isset($_POST['frmaction']) && $_POST['frmaction'] == "add") { + ?> + <p class="pageheader">Add attribute</p> <form method="post" action="attribute-add.php"> @@ -59,10 +61,10 @@ if ($_POST['frmaction'] == "add") { <option value=":=">:=</option> <option value="+=">+=</option> <option value="!=">!=</option> - <option value=">">></option> - <option value="<"><</option> - <option value=">=">>=</option> - <option value="<="><=</option> + <option value=">">></option> + <option value="<"><</option> + <option value=">=">>=</option> + <option value="<="><=</option> <option value="=~">=~</option> <option value="!~">!~</option> <option value="=*">=*</option> @@ -83,19 +85,27 @@ if ($_POST['frmaction'] == "add") { </tr> </table> </form> + <?php # Check we have all params -} elseif ($_POST['frmaction'] == "add2") { +} elseif (isset($_POST['frmaction']) && $_POST['frmaction'] == "add2") { + ?> + <p class="pageheader">Attribute Add Results</p> <?php + # Check for empty values if (empty($_POST['attr_name']) || empty($_POST['attr_operator']) || empty($_POST['attr_value'])) { + ?> + <div class="warning">Submission cannot have empty value</div> + <?php + } else { $stmt = $db->prepare("INSERT INTO ${DB_TABLE_PREFIX}user_attributes (UserID,Name,Operator,Value) VALUES (?,?,?,?)"); # Which user am I working with? @@ -108,22 +118,34 @@ if ($_POST['frmaction'] == "add") { $_POST['attr_value'], )); if ($res) { + ?> + <div class="notice">Attribute added</div> + <?php + session_destroy(); } else { + ?> + <div class="warning">Failed to add attribute</div> <div class="warning"><?php print_r($stmt->errorInfo()) ?></div> + <?php + } } } else { + ?> + <div class="warning">Invalid invocation</div> + <?php + } printFooter(); diff --git a/webui/user-attribute-change.php b/webui/user-attribute-change.php index a37f3543820582e8effd3ca00746d35fcc55802d..1de70c89d79ec7ef3532dc58d81c104bad9191b7 100644 --- a/webui/user-attribute-change.php +++ b/webui/user-attribute-change.php @@ -37,15 +37,16 @@ printHeader(array( # Display change screen -if ($_POST['frmaction'] == "change") { +if (isset($_POST['frmaction']) && $_POST['frmaction'] == "change") { # Check an attribute was selected if (isset($_POST['attr_id'])) { # Prepare statement - $temp = $_POST['attr_id']; - $sql = "SELECT ID, Name, Operator, Value, Disabled FROM ${DB_TABLE_PREFIX}user_attributes WHERE ID = $temp"; + $sql = "SELECT ID, Name, Operator, Value, Disabled FROM ${DB_TABLE_PREFIX}user_attributes WHERE ID = ".$db->quote($_POST['attr_id']); $res = $db->query($sql); $row = $res->fetchObject(); + ?> + <p class="pageheader">Update User</p> <form action="attribute-change.php" method="post"> @@ -64,14 +65,14 @@ if ($_POST['frmaction'] == "change") { Name <?php tooltip('user_attributes_name'); ?> </td> - <td class="oldval texttop"><?php echo $row->name ?></td> + <td class="oldval texttop"><?php echo $row->name; ?></td> <td><textarea name="user_attributes_name" cols="40" rows="1"></textarea></td> </tr> <tr> <td class="entrytitle texttop"> Operator </td> - <td class="oldval texttop"><?php echo $row->operator ?></td> + <td class="oldval texttop"><?php echo $row->operator; ?></td> <td> <select name="user_attributes_operator"> <option value="=">=</option> @@ -79,10 +80,10 @@ if ($_POST['frmaction'] == "change") { <option value=":=">:=</option> <option value="+=">+=</option> <option value="!=">!=</option> - <option value=">">></option> - <option value="<"><</option> - <option value=">=">>=</option> - <option value="<="><=</option> + <option value=">">></option> + <option value="<"><</option> + <option value=">=">>=</option> + <option value="<="><=</option> <option value="=~">=~</option> <option value="!~">!~</option> <option value="=*">=*</option> @@ -94,12 +95,12 @@ if ($_POST['frmaction'] == "change") { </tr> <tr> <td class="entrytitle texttop">Value</td> - <td class="oldval texttop"><?php echo $row->value ?></td> + <td class="oldval texttop"><?php echo $row->value; ?></td> <td><textarea name="user_attributes_value" cols="40" rows="5"></textarea></td> </tr> <tr> <td class="entrytitle">Disabled</td> - <td class="oldval"><?php echo $row->disabled ? 'yes' : 'no' ?></td> + <td class="oldval"><?php echo $row->disabled ? 'yes' : 'no'; ?></td> <td> <select name="user_attributes_disabled"> <option value="">--</option> @@ -116,21 +117,28 @@ if ($_POST['frmaction'] == "change") { <input type="submit" /> </div> </form> + <?php + $res->closeCursor(); } else { + ?> - <div class="warning">No attribute selected</div> -<?php - } + <div class="warning">No attribute selected</div> +<?php + } # SQL Updates -} elseif ($_POST['frmaction'] == "change2") { +} elseif (isset($_POST['frmaction']) && $_POST['frmaction'] == "change2") { + ?> + <p class="pageheader">Attribute Update Results</p> + <?php + # Check an attribute was selected if (isset($_POST['attr_id'])) { @@ -155,35 +163,51 @@ if ($_POST['frmaction'] == "change") { $res = $db->exec("UPDATE ${DB_TABLE_PREFIX}user_attributes SET $updateStr WHERE ID = ".$db->quote($_POST['attr_id'])); if ($res) { + ?> + <div class="notice">Attribute updated</div> + <?php + } else { + ?> + <div class="warning">Error updating attribute</div> <div class="warning"><?php print_r($db->errorInfo()) ?></div> + <?php - } + } # Warn } else { + ?> + <div class="warning">No attribute updates</div> + <?php - } + } # Warn } else { + ?> + <div class="error">No attribute data available</div> -<?php - } +<?php + } } else { + ?> + <div class="warning">Invalid invocation</div> + <?php + } diff --git a/webui/user-attribute-delete.php b/webui/user-attribute-delete.php index 5dd55ae5e849670b04273313a2a1184471c724c9..6e31f45cef65c9b0c2b7e867663b184c3c7462f0 100644 --- a/webui/user-attribute-delete.php +++ b/webui/user-attribute-delete.php @@ -37,10 +37,12 @@ printHeader(array( # Display delete confirm screen -if ($_POST['frmaction'] == "delete") { +if (isset($_POST['frmaction']) && $_POST['frmaction'] == "delete") { # Check a user was selected if (isset($_POST['attr_id'])) { + ?> + <p class="pageheader">Delete Attribute</p> <form action="attribute-delete.php" method="post"> @@ -54,51 +56,67 @@ if ($_POST['frmaction'] == "delete") { <input type="submit" name="confirm" value="no" /> </div> </form> + <?php + } else { + ?> + <div class="warning">No attribute selected</div> -<?php - } +<?php + } # SQL Updates -} elseif ($_POST['frmaction'] == "delete2") { +} elseif (isset($_POST['frmaction'] && $_POST['frmaction'] == "delete2") { + ?> + <p class="pageheader">Attribute Delete Results</p> + <?php - if (isset($_POST['attr_id'])) { + if (isset($_POST['attr_id'])) { + if (isset($_POST['confirm']) && $_POST['confirm'] == "yes") { + $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}user_attributes WHERE ID = ".$db->quote($_POST['attr_id'])); + if ($res) { - if ($_POST['confirm'] == "yes") { - $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}user_attributes WHERE ID = ".$_POST['attr_id']); - if ($res !== FALSE) { ?> - <div class="notice">Attribute with ID: <?php print_r($_POST['attr_id']);?> deleted</div> + + <div class="notice">Attribute with ID: <?php echo $_POST['attr_id']; ?> deleted</div> + <?php + } else { + ?> + <div class="warning">Error deleting attribute</div> <div class="warning"><?php print_r($db->errorInfo()) ?></div> -<?php - } -?> <?php + + } # Warn } else { + ?> + <div class="warning">Delete attribute aborted</div> + <?php + } -?> -<?php } else { + ?> + <div class="warning">Invocation error, no attribute ID selected</div> + <?php - } + } } printFooter(); diff --git a/webui/user-attributes.php b/webui/user-attributes.php index cf604adbb096038a591586b336b240e1322b5513..cc0f0d80b16e430803349c1fe5b802b91fa4ec91 100644 --- a/webui/user-attributes.php +++ b/webui/user-attributes.php @@ -80,32 +80,25 @@ printHeader(array( $_SESSION['attr_user_id'] = $_POST['user_id']; if (isset($_POST['user_id'])) { - $temp = $_SESSION['attr_user_id']; - $sql = "SELECT ID, Name, Operator, Value, Disabled FROM ${DB_TABLE_PREFIX}user_attributes WHERE UserID = $temp ORDER BY ID"; + $sql = "SELECT ID, Name, Operator, Value, Disabled FROM ${DB_TABLE_PREFIX}user_attributes WHERE UserID = ".$db->quote($_POST['user_id'])." ORDER BY ID"; $res = $db->query($sql); - $rownums = 0; while ($row = $res->fetchObject()) { - if ($row->id != NULL) { - $rownums = $rownums + 1; - } else { - $rownums = $rownums - 1; - } ?> + <tr class="resultsitem"> - <td><input type="radio" name="attr_id" value="<?php echo $row->id ?>"/><?php echo $row->id ?></td> - <td><?php echo $row->name ?></td> - <td><?php echo $row->operator ?></td> - <td><?php echo $row->value ?></td> - <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no' ?></td> + <td><input type="radio" name="attr_id" value="<?php echo $row->id; ?>"/><?php echo $row->id; ?></td> + <td><?php echo $row->name; ?></td> + <td><?php echo $row->operator; ?></td> + <td><?php echo $row->value; ?></td> + <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no'; ?></td> </tr> <?php } - $res->closeCursor(); - if ($rownums <= 0) { + if ($res->rowCount() == 0) { ?> @@ -117,7 +110,7 @@ printHeader(array( <?php } - unset($rownums); + $res->closeCursor(); } else { ?> diff --git a/webui/user-delete.php b/webui/user-delete.php index 46cb39fd4160fe22dffa04260305039f01250d02..0a23eec194d7a3d88aa430759abd85fd90661c93 100644 --- a/webui/user-delete.php +++ b/webui/user-delete.php @@ -37,7 +37,7 @@ printHeader(array( # Display delete confirm screen -if ($_POST['frmaction'] == "delete") { +if (isset($_POST['frmaction']) && $_POST['frmaction'] == "delete") { # Check a user was selected if (isset($_POST['user_id'])) { @@ -46,10 +46,8 @@ if ($_POST['frmaction'] == "delete") { <p class="pageheader">Delete User</p> <form action="user-delete.php" method="post"> - <div> - <input type="hidden" name="frmaction" value="delete2" /> - <input type="hidden" name="user_id" value="<?php echo $_POST['user_id']; ?>" /> - </div> + <input type="hidden" name="frmaction" value="delete2" /> + <input type="hidden" name="user_id" value="<?php echo $_POST['user_id']; ?>" /> <div class="textcenter"> Are you very sure? <br /> <input type="submit" name="confirm" value="yes" /> @@ -69,7 +67,7 @@ if ($_POST['frmaction'] == "delete") { } # SQL Updates -} elseif ($_POST['frmaction'] == "delete2") { +} elseif (isset($_POST['frmaction']) && $_POST['frmaction'] == "delete2") { ?> @@ -79,17 +77,16 @@ if ($_POST['frmaction'] == "delete") { if (isset($_POST['user_id'])) { # Check to see if user's attributes are empty - $userID = $_POST['user_id']; - $sql = "SELECT * FROM ${DB_TABLE_PREFIX}user_attributes WHERE UserID = $userID"; + $sql = "SELECT * FROM ${DB_TABLE_PREFIX}user_attributes WHERE UserID = ".$db->quote($_POST['user_id']); $res = $db->query($sql); - if ($_POST['confirm'] == "yes") { - $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}users WHERE ID = ".$_POST['user_id']); - if ($res !== FALSE) { + if (isset($_POST['confirm']) && $_POST['confirm'] == "yes") { + $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}users WHERE ID = ".$db->quote($_POST['user_id']); + if ($res) { ?> - <div class="notice">User with ID: <?php print_r($_POST['user_id']);?> deleted</div> + <div class="notice">User with ID: <?php echo $_POST['user_id']; ?> deleted</div> <?php @@ -98,7 +95,7 @@ if ($_POST['frmaction'] == "delete") { ?> <div class="warning">Error deleting user</div> - <div class="warning"><?php print_r($db->errorInfo()) ?></div> + <div class="warning"><?php print_r($db->errorInfo()); ?></div> <?php diff --git a/webui/user-groups-add.php b/webui/user-groups-add.php index 56c034154e793b503d34083e09f7362a212f8748..16abc187fc5c126601a1ce43ed07afb6f96ddcf3 100644 --- a/webui/user-groups-add.php +++ b/webui/user-groups-add.php @@ -33,7 +33,7 @@ printHeader(array( if (isset($_SESSION['groups_user_id'])) { - if ($_POST['frmaction'] == "add") { + if (isset($_POST['frmaction']) && $_POST['frmaction'] == "add") { ?> <p class="pageheader">Available Groups</p> @@ -83,11 +83,11 @@ if (isset($_SESSION['groups_user_id'])) { ?> <tr class="resultsitem"> - <td><input type="radio" name="group_id" value="<?php echo $row->id ?>" /></td> - <td><?php echo $row->name ?></td> - <td><?php echo $row->priority ?></td> - <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no' ?></td> - <td><?php echo $row->comment ?></td> + <td><input type="radio" name="group_id" value="<?php echo $row->id; ?>" /></td> + <td><?php echo $row->name; ?></td> + <td><?php echo $row->priority; ?></td> + <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no'; ?></td> + <td><?php echo $row->comment; ?></td> </tr> <?php @@ -102,7 +102,7 @@ if (isset($_SESSION['groups_user_id'])) { <?php - } elseif ($_POST['frmaction'] == "add2") { + } elseif (isset($_POST['frmaction']) && $_POST['frmaction'] == "add2") { ?> @@ -112,11 +112,9 @@ if (isset($_SESSION['groups_user_id'])) { if (isset($_POST['group_id']) && !empty($_POST['users_to_groups_comment'])) { $stmt = $db->prepare("INSERT INTO ${DB_TABLE_PREFIX}users_to_groups (UserID,GroupID,Comment,Disabled) VALUES (?,?,?,?)"); - # Which user am I working with? - $groups_user_id = $_SESSION['groups_user_id']; $res = $stmt->execute(array( - $groups_user_id, + $_SESSION['groups_user_id'], $_POST['group_id'], $_POST['users_group_comment'], $_POST['users_group_disabled'], diff --git a/webui/user-groups-delete.php b/webui/user-groups-delete.php index 004e15c809341b19ab3f05cfb29391cae90bf20b..e0e99abbd8e6a7d7b42e046843d99157106f9a74 100644 --- a/webui/user-groups-delete.php +++ b/webui/user-groups-delete.php @@ -36,12 +36,13 @@ printHeader(array( )); - # Display delete confirm screen -if ($_POST['frmaction'] == "delete") { +if (isset($_POST['frmaction']) && $_POST['frmaction'] == "delete") { # Check a user was selected if (isset($_POST['group_id'])) { + ?> + <p class="pageheader">Remove Group Assignment</p> <form action="user-groups-delete.php" method="post"> @@ -55,50 +56,76 @@ if ($_POST['frmaction'] == "delete") { <input type="submit" name="confirm" value="no" /> </div> </form> + <?php + } else { + ?> + <div class="warning">No group assignment selected</div> -<?php - } +<?php + } # SQL Updates -} elseif ($_POST['frmaction'] == "delete2") { +} elseif (isset($_POST['frmaction']) && $_POST['frmaction'] == "delete2") { + ?> + <p class="pageheader">Group Assignment Removal Results</p> + <?php - if (isset($_POST['group_id'])) { - if ($_POST['confirm'] == "yes") { - $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}users_to_groups WHERE UserID = ".$_SESSION['groups_user_id']." AND GroupID = ".$_POST['group_id']); - if ($res !== FALSE) { + + if (isset($_POST['group_id']) && isset($_SESSION['groups_user_id'])) { + if (isset($_POST['confirm']) && $_POST['confirm'] == "yes") { + $res = $db->exec(" + DELETE FROM + ${DB_TABLE_PREFIX}users_to_groups + WHERE + UserID = ".$db->quote($_SESSION['groups_user_id'])." + AND + GroupID = ".$db->quote($_POST['group_id']) + ); + + if ($res) { + ?> + <div class="notice">Group with ID: <?php print_r($_POST['group_id']);?> deleted from user with ID: <?php print_r($_SESSION['groups_user_id']);?></div> + <?php + session_destroy(); } else { + ?> + <div class="warning">Error removing group assignment</div> - <div class="warning"><?php print_r($db->errorInfo()) ?></div> -<?php - } -?> + <div class="warning"><?php print_r($db->errorInfo()); ?></div> <?php + + } # Warn } else { + ?> + <div class="warning">Remove Group Assignment aborted</div> + <?php + } -?> -<?php } else { + ?> + <div class="warning">Invocation error, no group ID selected</div> + <?php - } + } } printFooter(); diff --git a/webui/user-groups.php b/webui/user-groups.php index 74a94750e63e2c528df7a9c01baaf336496fff9a..3b67642fef019d53f641cf758ea3eb7c6d1ed8a0 100644 --- a/webui/user-groups.php +++ b/webui/user-groups.php @@ -76,17 +76,15 @@ printHeader(array( <?php if (isset($_POST['user_id'])) { - $sql = "SELECT GroupID FROM ${DB_TABLE_PREFIX}users_to_groups WHERE UserID = ".$_POST['user_id']; + + # Store user_id for later use + $_SESSION['groups_user_id'] = $_POST['user_id']; + + $sql = "SELECT GroupID FROM ${DB_TABLE_PREFIX}users_to_groups WHERE UserID = ".$db->quote($_POST['user_id']); $res = $db->query($sql); - $rownums = 0; while ($row = $res->fetchObject()) { - if ($row->groupid != NULL) { - $rownums = $rownums + 1; - } else { - $rownums = $rownums - 1; - } - $sql = "SELECT ID, Name, Priority, Disabled, Comment FROM ${DB_TABLE_PREFIX}groups WHERE ID = ".$row->groupid; + $sql = "SELECT ID, Name, Priority, Disabled, Comment FROM ${DB_TABLE_PREFIX}groups WHERE ID = ".$db->quote($row->groupid); $result = $db->query($sql); while ($row = $result->fetchObject()) { @@ -94,11 +92,11 @@ printHeader(array( ?> <tr class="resultsitem"> - <td><input type="radio" name="group_id" value="<?php echo $row->id ?>"/></td> - <td><?php echo $row->name ?></td> - <td><?php echo $row->priority ?></td> - <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no' ?></td> - <td><?php echo $row->comment ?></td> + <td><input type="radio" name="group_id" value="<?php echo $row->id; ?>"/></td> + <td><?php echo $row->name; ?></td> + <td><?php echo $row->priority; ?></td> + <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no'; ?></td> + <td><?php echo $row->comment; ?></td> </tr> <?php @@ -107,8 +105,7 @@ printHeader(array( $result->closeCursor(); } - $res->closeCursor(); - if ($rownums <= 0) { + if ($res->rowCount() == 0) { ?> @@ -120,7 +117,7 @@ printHeader(array( <?php } - unset($rownums); + $res->closeCursor(); } else { ?> @@ -138,7 +135,6 @@ printHeader(array( <?php -$_SESSION['groups_user_id'] = $_POST['user_id']; printFooter(); diff --git a/webui/user-logs.php b/webui/user-logs.php index 32f72fc9aac034c50474e81ab7c661953cd1ad96..cb9d5d9107d1d66d9b168efd49a121377817c5d8 100644 --- a/webui/user-logs.php +++ b/webui/user-logs.php @@ -150,7 +150,7 @@ if (isset($_POST['user_id'])) { FROM ${DB_TABLE_PREFIX}accounting WHERE - Username = '$getuser' + Username = ".$db->quote($getuser)." $extraSQL ORDER BY EventTimestamp @@ -269,7 +269,7 @@ if (isset($_POST['user_id'])) { } $res->closeCursor(); ?> - </table> + </table> <?php } else { @@ -280,11 +280,6 @@ if (isset($_POST['user_id'])) { } -?> - - -<?php - printFooter(); diff --git a/webui/user-main.php b/webui/user-main.php index 066302c4c82df9b24f0db06373361bd3ba836227..f8b031a77cbae20384b9b2e0f9902f27beffb63f 100644 --- a/webui/user-main.php +++ b/webui/user-main.php @@ -73,13 +73,17 @@ if (!isset($_POST['frmaction'])) <td class="textcenter">Username</td> <td class="textcenter">Disabled</td> </tr> + <?php + $sql = "SELECT ID, Username, Disabled FROM ${DB_TABLE_PREFIX}users ORDER BY ID ASC"; $res = $db->query($sql); # List users while ($row = $res->fetchObject()) { + ?> + <tr class="resultsitem"> <td><input type="radio" name="user_id" value="<?php echo $row->id; ?>"/><?php echo $row->id; ?></td> <td><?php echo $row->username; ?></td> diff --git a/webui/wisp-multiuser-add.php b/webui/wisp-multiuser-add.php index 00b74a79675c833f9c17dedc2ba29722b6d97bbd..08526f3a2c0ad104531b91def1baf976a4c34e09 100644 --- a/webui/wisp-multiuser-add.php +++ b/webui/wisp-multiuser-add.php @@ -84,7 +84,7 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "insert") { <p class="pageheader">Add WiSP Users</p> <?php - + #FIXME # Perform checks on input if (isset($_POST['num_users']) && isset($_POST['session_timeout']) && isset($_POST['data_limit']) && isset($_POST['time_limit'])) { $db->beginTransaction(); @@ -116,10 +116,9 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "insert") { $userName = $randomString; $lookForUser = $db->query("SELECT ID FROM ${DB_TABLE_PREFIX}users WHERE Username LIKE '%$userName%'"); - $lookForUserRow = $lookForUser->fetchObject(); # If the user was found - if ($lookForUserRow) { + if ($lookForUser->rowCount() > 0) { $checkUsernameDuplicates = 1; } else { $checkUsernameDuplicates = 0; @@ -130,15 +129,13 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "insert") { $userName = $loginNamePrefix."_".$randomString; $lookForUser = $db->query("SELECT ID FROM ${DB_TABLE_PREFIX}users WHERE Username LIKE '%$userName%'"); - $lookForUserRow = $lookForUser->fetchObject(); # If the user was found - if ($lookForUserRow) { + if ($lookForUser->rowCount() > 0) { $checkUsernameDuplicates = 1; } else { $checkUsernameDuplicates = 0; } - } } while ($checkUsernameDuplicates > 0); diff --git a/webui/wisp-user-delete.php b/webui/wisp-user-delete.php index 75ac1b4cf34670548f93f892853ebb605594e826..2c23734a2a3a15810d04e096856153e4bcd12a16 100644 --- a/webui/wisp-user-delete.php +++ b/webui/wisp-user-delete.php @@ -77,14 +77,14 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "delete") { <?php if (isset($_POST['user_id'])) { - if ($_POST['confirm'] == "yes") { + if (isset($_POST['confirm']) && $_POST['confirm'] == "yes") { $db->beginTransaction(); # Delete user data - $userDataDeleteResult = $db->exec("DELETE FROM userdata WHERE UserID = ".$_POST['user_id']); + $userDataDeleteResult = $db->exec("DELETE FROM userdata WHERE UserID = ".$db->quote($_POST['user_id'])); # Delete user attributes - $attrDeleteResult = $db->exec("DELETE FROM user_attributes WHERE UserID = ".$_POST['user_id']); + $attrDeleteResult = $db->exec("DELETE FROM user_attributes WHERE UserID = ".$db->quote($_POST['user_id'])); # Delete from users - $userDeleteResult = $db->exec("DELETE FROM users WHERE ID = ".$_POST['user_id']); + $userDeleteResult = $db->exec("DELETE FROM users WHERE ID = ".$db->quote($_POST['user_id'])); if ($userDataDeleteResult && $attrDeleteResult && $userDeleteResult) { ?> diff --git a/webui/wisp-user-edit.php b/webui/wisp-user-edit.php index b2447176970821ddab0ca5885ac74e7f8bcc2c3f..1f641acba15cd1b897f6d434b2ed67ec6a090e06 100644 --- a/webui/wisp-user-edit.php +++ b/webui/wisp-user-edit.php @@ -35,7 +35,6 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "edit") { # Check a user was selected if (isset($_POST['user_id'])) { - # Prepare statements $userID = $_POST['user_id']; $sql = "SELECT FirstName, @@ -46,7 +45,7 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "edit") { FROM userdata WHERE - UserID = '$userID' + UserID = ".$db->quote($userID)." "; $userDataResult = $db->query($sql); @@ -57,7 +56,7 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "edit") { FROM user_attributes WHERE - UserID = '$userID' + UserID = ".$db->quote($userID)." AND Name = 'Framed-IP-Address' "; @@ -70,7 +69,7 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "edit") { FROM user_attributes WHERE - UserID = '$userID' + UserID = ".$db->quote($userID)." AND Name = 'Calling-Station-Id' "; @@ -84,7 +83,7 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "edit") { FROM user_attributes WHERE - UserID = '$userID' + UserID = ".$db->quote($userID)." AND Name = 'User-Password' "; @@ -98,7 +97,7 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "edit") { FROM user_attributes WHERE - UserID = '$userID' + UserID = ".$db->quote($userID)." AND Name = 'SMRadius-Capping-Traffic-Limit' "; @@ -112,7 +111,7 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "edit") { FROM user_attributes WHERE - UserID = '$userID' + UserID = ".$db->quote($userID)." AND Name = 'SMRadius-Capping-Time-Limit' "; diff --git a/webui/wisp-user-list.php b/webui/wisp-user-list.php index 10d1f7924b340f6c19cce41b203e31475d0e2a53..735bcf4ff8bb712a005dadf01d95f27d5b5ad622 100644 --- a/webui/wisp-user-list.php +++ b/webui/wisp-user-list.php @@ -233,16 +233,16 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "dofilter") { ?> <tr class="resultsitem"> - <td><input type="radio" name="user_id" value="<?php echo $row->id ?>"/><?php echo $row->id ?></td> - <td><?php echo $row->username ?></td> - <td><?php echo $row->firstname ?></td> - <td><?php echo $row->lastname ?></td> - <td><?php echo $row->email ?></td> - <td><?php echo $row->phone ?></td> - <td><?php echo $row->location ?></td> - <td><?php echo $dataCap ?> MB</td> - <td><?php echo $timeCap ?> Min</td> - <td><?php echo $userIP ?></td> + <td><input type="radio" name="user_id" value="<?php echo $row->id; ?>"/><?php echo $row->id; ?></td> + <td><?php echo $row->username; ?></td> + <td><?php echo $row->firstname; ?></td> + <td><?php echo $row->lastname; ?></td> + <td><?php echo $row->email; ?></td> + <td><?php echo $row->phone; ?></td> + <td><?php echo $row->location; ?></td> + <td><?php echo $dataCap; ?> MB</td> + <td><?php echo $timeCap; ?> Min</td> + <td><?php echo $userIP; ?></td> </tr> <?php diff --git a/webui/wisp-user-logs.php b/webui/wisp-user-logs.php index 39e9b75b523805384a136d6b1731f6509e620e1f..f3ef623b0506f3a985c1196e0d7c0a28b5f01c44 100644 --- a/webui/wisp-user-logs.php +++ b/webui/wisp-user-logs.php @@ -33,7 +33,6 @@ printHeader(array( )); - ?> <p class="pageheader">WiSP User Log</p> @@ -233,7 +232,7 @@ if (isset($_POST['user_id'])) { ?> <tr> - <td colspan="23" class="textcenter">No logs found for user: <?php echo $getuser ?></td> + <td colspan="23" class="textcenter">No logs found for user: <?php echo $getuser; ?></td> </tr> <?php