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( ...@@ -77,12 +77,22 @@ printHeader(array(
<?php <?php
$_SESSION['attr_user_id'] = $_POST['user_id'];
if (isset($_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); $res = $db->query($sql);
while ($row = $res->fetchObject()) { while ($row = $res->fetchObject()) {
?> ?>
......
...@@ -88,9 +88,7 @@ printHeader(array( ...@@ -88,9 +88,7 @@ printHeader(array(
$result = $db->query($sql); $result = $db->query($sql);
while ($row = $result->fetchObject()) { while ($row = $result->fetchObject()) {
?> ?>
<tr class="resultsitem"> <tr class="resultsitem">
<td><input type="radio" name="group_id" value="<?php echo $row->id; ?>"/></td> <td><input type="radio" name="group_id" value="<?php echo $row->id; ?>"/></td>
<td><?php echo $row->name; ?></td> <td><?php echo $row->name; ?></td>
...@@ -98,43 +96,29 @@ printHeader(array( ...@@ -98,43 +96,29 @@ printHeader(array(
<td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no'; ?></td> <td class="textcenter"><?php echo $row->disabled ? 'yes' : 'no'; ?></td>
<td><?php echo $row->comment; ?></td> <td><?php echo $row->comment; ?></td>
</tr> </tr>
<?php <?php
} }
$result->closeCursor(); $result->closeCursor();
} }
if ($res->rowCount() == 0) { if ($res->rowCount() == 0) {
?> ?>
<p />
<tr> <tr>
<td colspan="5" class="textcenter">User doesn't belong to any groups</td> <td>User does not belong to any groups</td>
</tr> </tr>
<?php <?php
} }
$res->closeCursor(); $res->closeCursor();
} else { } else {
?> ?>
<tr>
<div class="warning">Invocation error, no user ID selected</div> <td>Invocation error, no user ID selected</td>
</tr>
<?php <?php
} }
?> ?>
</table> </table>
</form> </form>
<?php <?php
printFooter(); 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