Changes adopted from version 0.5

This commit is contained in:
2023-02-13 10:42:09 +01:00
parent faf5f368f5
commit 76ccecca7f
198 changed files with 10261 additions and 5068 deletions

View File

@@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,46 +20,45 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// start page
// includes
include("includes.php");
// get id
$user_id = sanitize($_GET['user_id']);
// start output
include("header.php");
// set template
$tp = new Template("tpl/userview.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// get id
$user_id = $_GET['user_id'];
// setup user
// build query
$query = "SELECT
user.user_name AS user_name,
user.user_displayname AS user_displayname
FROM
user
WHERE
user.user_id=" . $user_id;
// run query
$user = $db->db_select($query);
// send to tpl
$tp->set("user_id", $user_id);
$tp->set("user_name", $user[0]['user_name']);
$tp->set("user_displayname", $user[0]['user_displayname']);
// check authorisation
$auth = auth("user", $config_auth_userview, $user_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/userview.tpl");
// set language variables
$tp->setvars($lang);
// get user info
$result = mysql_query("SELECT user_name, user_displayname, user_mac, user_lang FROM user WHERE user_id='$user_id'") or die(mysql_error());
$row=mysql_fetch_object($result);
$tp->set("user_id", $user_id);
$tp->set("user_name", $row->user_name);
$tp->set("user_displayname", $row->user_displayname);
$tp->set("user_mac", $row->user_mac);
$tp->set("user_lang", $row->user_lang);
// get userclass info
$result = mysql_query("SELECT uc.userclass_id, uc.userclass_name FROM userclass uc, useruserclass uuc WHERE uuc.user_id='$user_id' AND uuc.userclass_id=uc.userclass_id ORDER BY uc.userclass_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
$tp->set("userclass_id", $row->userclass_id);
$tp->set("userclass_name", $row->userclass_name);
$tp->set("userclasscount", $i+1);
$tp->parse("userclassrow");
}
if (($i>0) ? $tp->parse("userclass") : $tp->hide("userclass"));
// output
$tp->parse();
$tp->spit();
include("footer.php");
// end page
// output
$tp->parse();
$tp->spit();
// footer
include("footer.php");
?>