define("P_USERMOD", 2);
define("P_ADMIN", 2);
define("P_GROUNDSMAN", 1);
+define("P_BIKEMOD", 1);
class User {
private $data = array('login' => 'Anonymous', 'privileges' => -1, 'id' => -1);
public function __construct( $login = null, $passwd = null) {
if (is_null($login)) return;
if (!is_null($passwd)) $AND = " AND `password` = SHA1(?)"; else $AND = "";
- $query = DB::query("SELECT * FROM `users` WHERE LOWER(`login`) = LOWER(?) $AND;");
+ $query = DB::query("SELECT *,
+ SUBSTRING(`room`,1,1) AS `building`,
+ SUBSTRING(`room`,2,CHAR_LENGTH(`room`)-3) AS `floor`,
+ SUBSTRING(`room`,-2) AS `roomNumber`
+ FROM `users` WHERE LOWER(`login`) = LOWER(?) $AND;");
$query->set(0, $login);
if (!is_null($passwd)) $query->set(1, $passwd);
$res = $query->commit();
$conf['mysql_user'] = "kolarny_krakonos";
$conf['mysql_password'] = "aicoocoong";
$conf['mysql_database'] = "kolarny_krakonos_org";
+$conf['mysql_log'] = 'log.sql';
$conf['http_base'] = "http://kolarny.krakonos.org/";
if (($auth->verify(P_USERMOD)) && (isset($_GET['mod']))) {
$user = new User($_GET['mod']);
-} else if ($auth->verify() && (!isset($_GET['mod']))) {
+} else if ($auth->verify() && ((!isset($_GET['mod'])) || ($_GET['mod'] == $auth->login))) {
$user = $auth->user;
} else {
redir("403");
<?php
- include "msgbox.php";
+ require_once "msgbox.php";
if (!$auth->verify(2)) die("Not authorized.");
+<h1><?=tr("Upravit údaje uživatele")?></h1>
<?php
include "fmaker.inc";
?>
+<h1><?=tr("Správa uživatelů")?></h1>
<table id="userlist">
<tr>
- <th>login</th>
- <th>name</th>
- <th>room</th>
- <th>email</th>
- <th>phone</th>
- <th>privileges</th>
- <th>action</th>
+ <th><?=tr("Login")?></th>
+ <th><?=tr("Jméno")?></th>
+ <th><?=tr("Pokoj")?></th>
+ <th><?=tr("Email")?></th>
+ <th><?=tr("Telefon")?></th>
+ <th><?=tr("Práva")?></th>
+ <th><?=tr("Akce")?></th>
</tr>
<? foreach ($users as $user) { ?>
<tr>