mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-18 16:18:04 +00:00
Changed user login strategy
This commit is contained in:
21
functions/user.php
Normal file
21
functions/user.php
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user