Skip to content
Snippets Groups Projects
Commit eca4267a authored by Robert Anderson's avatar Robert Anderson
Browse files

Improved formatting

Fixed $_POST['user_id'] defined in user_attributes.php
parent 2462ebe5
No related branches found
No related tags found
No related merge requests found
......@@ -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()) {
?>
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment