X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=11bb1ef4faf53c7cbb22a2949581efda04d3bd80;hb=40eef626fb2ba34aeb8cadb1568cc989c41cd4c7;hp=a019ae4b8b388520f6d28554e9323669037166dd;hpb=ec106ddfe653ea6da6d65d537d38f19a9a7776e7;p=mirrors%2FSokoMan.git diff --git a/index.php b/index.php index a019ae4..11bb1ef 100755 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ require_once('sklad.conf.php'); set_include_path(DIR_LIB.PATH_SEPARATOR.get_include_path()); -require_once('Sklad_LMS-fake.class.php'); +require_once('Sklad_Auth.class/common.php'); require_once('HTTP_Auth.class.php'); require_once('Locale.class.php'); require_once('Barcode.class.php'); @@ -34,13 +34,17 @@ require_once('Barcode.class.php'); * @author Tomas Mudrunka */ class HTML { - function row($row) { - $html=''; + function row($row,$type=false) { + $html = ''; + if($type) $html.="<$type>"; + $html.=''; + $td = $type == 'thead' ? 'th' : 'td'; foreach($row as $var) { if(trim($var) == '') $var = ' '; - $html.="$var"; + $html.="<$td>$var"; } $html.=''; + if($type) $html.=""; return $html; } @@ -49,7 +53,7 @@ class HTML { $header=true; foreach($table as $row) { if($header) { - $html.=$this->row(array_keys($row)); + $html.=$this->row(array_keys($row),'thead'); $header=false; } $html.=$this->row($row); @@ -147,20 +151,32 @@ class HTML { * @author Tomas Mudrunka */ class Sklad_HTML extends HTML { //TODO: Split into few more methods - function header($title='') { + function header($title='', $user=array()) { $home = URL_HOME; $script = $_SERVER['SCRIPT_NAME']; $search = htmlspecialchars(@trim($_GET['q'])); $message = strip_tags(@trim($_GET['message']),''); $instance = INSTANCE_ID != '' ? '/'.INSTANCE_ID : ''; + $user_id = htmlspecialchars($user['id']); + $user_gid = htmlspecialchars($user['gid']); + $user_name = htmlspecialchars($user['name']); + $time = date('r'); //$title = T($title); //TODO $html = $this->head("SōkoMan$title"); $html .= <<SōkoMan$instance$title +

SōkoMan$instance$title

+
+ Logged in as $user_name [UID: $user_id; GID: $user_gid]
+ Page loaded at $time +