Changed user login strategy

This commit is contained in:
Pierre
2017-05-19 18:07:52 +02:00
parent 033da4e0e3
commit 6819628b3e
5 changed files with 99 additions and 39 deletions

21
functions/user.php Normal file
View File

@ -0,0 +1,21 @@
<?php
/**
* User functions
*
* @author Pierre HUBERT
*/
/**
* A function that check login information are specified,
* else it quit the scripts because of missing login
*
* @return Boolean True for a success
*/
function user_login_required(){
if(!defined("userID")){
Rest_fatal_error(401, "This function requires user to be logged in!");
}
//User logged in
return true;
}