mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Created helpers directory
This commit is contained in:
		@@ -146,7 +146,7 @@ class User{
 | 
			
		||||
	 * @param Integer $userID The user ID
 | 
			
		||||
	 * @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
 | 
			
		||||
		$tablesName = "utilisateurs";
 | 
			
		||||
		$conditions = "WHERE utilisateurs.ID = ?";
 | 
			
		||||
@@ -175,6 +175,9 @@ class User{
 | 
			
		||||
		$return['personnalWebsite'] = $userInfos[0]['site_web'];
 | 
			
		||||
		$return['isPublicFriendList'] = $userInfos[0]['liste_amis_publique'];
 | 
			
		||||
 | 
			
		||||
		//Add account image url
 | 
			
		||||
		$return['accountImage'] = path_user_data();
 | 
			
		||||
 | 
			
		||||
		//Only the user may get its mail address
 | 
			
		||||
		if(userID === $userID)
 | 
			
		||||
			$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;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user