Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class User
- {
- private $userSession; // holds username session
- private $idSession; // holds user id session
- private $database; // holds database object
- private $isLoggedIn; // boolean for easy checking
- function __construct($userSession = NULL)
- {
- $this->userSession = $_SESSION['username']; // getting session of the user
- $this->idSession = $_SESSION['user_id']; // getting id session of the user
- $this->database = new DB (); // creates instance of the class DB
- $this->isLoggedIn = false; // just a property for easy work
- }
- public function isLogged($username){
- if($this->userSession == TRUE){
- $this->isLoggedIn = TRUE;
- }else{
- echo 'You are not logged in';
- }
- }
- public function changePassword(){
- }
- public function userLogout(){
- }
- public function userLogin(){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement