From eca4267a08f0764d9bc149635a2d9afd33bc43c6 Mon Sep 17 00:00:00 2001 From: Robert Anderson <randerson@lbsd.net> Date: Tue, 21 Apr 2009 07:01:23 +0000 Subject: [PATCH] Improved formatting Fixed $_POST['user_id'] defined in user_attributes.php --- webui/user-attributes.php | 16 +++++++++++++--- webui/user-groups.php | 24 ++++-------------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/webui/user-attributes.php b/webui/user-attributes.php index cc0f0d80..af4935bf 100644 --- a/webui/user-attributes.php +++ b/webui/user-attributes.php @@ -77,12 +77,22 @@ printHeader(array( <?php - $_SESSION['attr_user_id'] = $_POST['user_id']; if (isset($_POST['user_id'])) { + # Set to session for later use + $_SESSION['attr_user_id'] = $_POST['user_id']; + + # Get old attributes + $sql = "SELECT + ID, Name, Operator, Value, Disabled + FROM + ${DB_TABLE_PREFIX}user_attributes + WHERE + UserID = ".$db->quote($_POST['user_id'])." + 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); - while ($row = $res->fetchObject()) { ?> diff --git a/webui/user-groups.php b/webui/user-groups.php index 3b67642f..061943d9 100644 --- a/webui/user-groups.php +++ b/webui/user-groups.php @@ -88,9 +88,7 @@ printHeader(array( $result = $db->query($sql); while ($row = $result->fetchObject()) { - ?> - <tr class="resultsitem"> <td><input type="radio" name="group_id" value="<?php echo $row->id; ?>"/></td> <td><?php echo $row->name; ?></td> @@ -98,43 +96,29 @@ printHeader(array( <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no'; ?></td> <td><?php echo $row->comment; ?></td> </tr> - <?php - } $result->closeCursor(); } - if ($res->rowCount() == 0) { - ?> - - <p /> <tr> - <td colspan="5" class="textcenter">User doesn't belong to any groups</td> + <td>User does not belong to any groups</td> </tr> - <?php - } $res->closeCursor(); } else { - ?> - - <div class="warning">Invocation error, no user ID selected</div> - + <tr> + <td>Invocation error, no user ID selected</td> + </tr> <?php - } - ?> - </table> </form> - <?php - printFooter(); -- GitLab