File: D:/HostingSpaces/SBogers10/komma-mediadesign.nl/wwwroot/beheer/app/models/login/m_user.php
<?php
/*
Handles all tasks regarding userdata
*/
class User
{
/**
*
* @var class Database Handler object for executing basic queries
*/
private $_dbh;
/**
*
* @var array Contains all userdata for this class.
*/
private $_data = array('id'=>'','user'=>'','email'=>'','rank'=>'');
/**
* Constructor
*/
public function __construct()
{
$this->_dbh = new DatabaseHandler();
$this->_dbh->setTableName('kms_admin');
$this->_dbh->setOrder('user','ASC');
$this->_dbh->setData($this->_data);
}
/**
* Sets the data[id] of this class to the current user
* This can be done by getting the first bit of the admin string
*
* @access public
* @param
* @return null
*/
public function getThisUser()
{
if(isset($_SESSION['admin_string']))
{
$temp = explode($_SESSION['admin_string']);
$id = $temp[0];
return $id;
}
}
/**
* Returns the data array
*
* @access public
* @param
* @return
*/
public function getData($key = NULL, $value = NULL)
{
$this->_dbh->addRule($key, $value);
if($this->_data = $this->_dbh->select())
{
return $this->_data;
}
return FALSE;
}
}