HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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;		
	}
}