<?php
/*
** Aratix
** Version 0.1.0beta8 (Anubis)
**
** Autor: Manuel Burghammer
** E-Mail: hide@address.com
** Homepage: http://www.xitara.net
**
** File: User.class.php - Version 0.1.0 build 32
** Position: /classes/
** Last Modified: 16.06.2006 - 16:19:34
*/
class User{
function __contruct(){
}
function overview(){
$user_list = $GLOBALS['db']->read_array(TB_USER, "*", "", "last_name, name ASC");
$counter = 0;
foreach($user_list as $user_data){
$status = $GLOBALS['db']->read(TB_SESSION, "session", "user='" . $user_data['login'] . "'");
if($status != "")
$user_list[$counter++]['status'] = "online";
else
$user_list[$counter++]['status'] = "offline";
}
return $user_list;
}
function get_username($user_id){
$user = $GLOBALS['db']->read(TB_USER, "last_name, name", "id='" . $user_id . "'");
return $user['last_name'] . " " . $user['name'];
}
function get_shortname($user_id){
$user = $GLOBALS['db']->read(TB_USER, "short_name", "id='" . $user_id . "'");
return $user['short_name'];
}
function get_login($user_id){
$user = $GLOBALS['db']->read(TB_USER, "login", "id='" . $user_id . "'");
return $user['login'];
}
function edit(){
$user = $GLOBALS['db']->read(TB_USER, "*", "id='" . get('user_id') . "'");
return $user;
}
function add(){
$user = $GLOBALS['db']->read(TB_USER, "*", "id='" . get('user_id') . "'");
return $user;
}
function group_array($groups){
if($groups != "99999"){
if($groups == "2")
$groups = "|2|";
$group_array = explode("|", $groups);
$group_list = array_slice($group_array, 1, -1);
$GLOBALS['debug']->write(DEBUG, "group_list: " . implode(";", $group_list), __FILE__, __CLASS__, __METHOD__, __FUNCTION__, __LINE__);
return $group_list;
}
else
return array("99999");
}
function status_array($status){
if($status != "99999"){
$status_array = explode("|", $status);
$status_list = array_slice($status_array, 1, -1);
$GLOBALS['debug']->write(DEBUG, "status_list: " . implode(";", $status_list), __FILE__, __CLASS__, __METHOD__, __FUNCTION__, __LINE__);
return $status_list;
}
else
return array("99999");
}
}
?>