mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 13:59:29 +00:00
Created helpers directory
This commit is contained in:
parent
e000e59374
commit
83b0982068
@ -146,7 +146,7 @@ class User{
|
|||||||
* @param Integer $userID The user ID
|
* @param Integer $userID The user ID
|
||||||
* @return Array The result of the function (user informations) (empty one if it fails)
|
* @return Array The result of the function (user informations) (empty one if it fails)
|
||||||
*/
|
*/
|
||||||
public function getUserInfos($userID): array {
|
public function getUserInfos($userID) : array {
|
||||||
//Prepare database request
|
//Prepare database request
|
||||||
$tablesName = "utilisateurs";
|
$tablesName = "utilisateurs";
|
||||||
$conditions = "WHERE utilisateurs.ID = ?";
|
$conditions = "WHERE utilisateurs.ID = ?";
|
||||||
@ -175,6 +175,9 @@ class User{
|
|||||||
$return['personnalWebsite'] = $userInfos[0]['site_web'];
|
$return['personnalWebsite'] = $userInfos[0]['site_web'];
|
||||||
$return['isPublicFriendList'] = $userInfos[0]['liste_amis_publique'];
|
$return['isPublicFriendList'] = $userInfos[0]['liste_amis_publique'];
|
||||||
|
|
||||||
|
//Add account image url
|
||||||
|
$return['accountImage'] = path_user_data();
|
||||||
|
|
||||||
//Only the user may get its mail address
|
//Only the user may get its mail address
|
||||||
if(userID === $userID)
|
if(userID === $userID)
|
||||||
$return['mailAdress'] = $userInfos[0]['mail'];
|
$return['mailAdress'] = $userInfos[0]['mail'];
|
||||||
|
16
helpers/userData.php
Normal file
16
helpers/userData.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* User data helper
|
||||||
|
*
|
||||||
|
* @author Pierre HUBERT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get and returns the URL path to an userdata file
|
||||||
|
*
|
||||||
|
* @param String $fileURI Optionnal, defines the URI pointing on the file
|
||||||
|
* @return String The full URL to the userdata file
|
||||||
|
*/
|
||||||
|
function path_user_data($fileURI = ""){
|
||||||
|
return CS::get()->config->get("storage_url").$fileURI;
|
||||||
|
}
|
5
init.php
5
init.php
@ -18,6 +18,11 @@ foreach(glob(PROJECT_PATH."functions/*.php") as $funcFile){
|
|||||||
require_once $funcFile;
|
require_once $funcFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Include helpers
|
||||||
|
foreach(glob(PROJECT_PATH."helpers/*.php") as $funcFile){
|
||||||
|
require_once $funcFile;
|
||||||
|
}
|
||||||
|
|
||||||
//Create root object
|
//Create root object
|
||||||
$cs = new CS();
|
$cs = new CS();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user