v1.0 Initial commit of project
This commit is contained in:
45
pub/api/classes/API_usersavatar.php
Normal file
45
pub/api/classes/API_usersavatar.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace api\classes;
|
||||
|
||||
use api\classes\API;
|
||||
use api\classes\imageProcessor;
|
||||
|
||||
require_once 'API.php';
|
||||
|
||||
class API_usersavatar extends API
|
||||
{
|
||||
|
||||
public function createUserImage($imageRestrictions)
|
||||
{
|
||||
try {
|
||||
# Main image
|
||||
$imageProcessor = new imageProcessor('user_profile_picture');
|
||||
$imageProcessor->imageRestrictions = $imageRestrictions;
|
||||
$imageProcessor->validateAndProcess();
|
||||
$ImageData = $imageProcessor->returnBase64image();
|
||||
} catch (Exception $e) {
|
||||
$this->apiOutput(401, ['error' => 'Error: ' . $e->getMessage()]);
|
||||
}
|
||||
|
||||
return $ImageData;
|
||||
}
|
||||
|
||||
public function updateUserImage()
|
||||
{
|
||||
$query = "UPDATE vc_users SET
|
||||
user_profile_picture = ?,
|
||||
user_profile_picture_thumbnail = ?
|
||||
WHERE user_uuid = ?";
|
||||
|
||||
$stmt = $stmt = $this->prepareStatement($query);
|
||||
$stmt->bind_param("sss",
|
||||
$this->data['user_profile_picture'],
|
||||
$this->data['user_profile_picture_thumbnail'],
|
||||
$this->data['user_uuid']
|
||||
);
|
||||
$this->executeStatement($stmt);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user