Nextrek
Diff Revisions
374
vs
378
for /Android/SmartCharging/endPoints/nightly/registrazione_locale.php
|
@@ -4,6 +4,8 @@ |
4 |
4 |
|
header("Access-Control-Allow-Origin: *"); |
5 |
5 |
|
header('Content-Type: application/json; charset=UTF-8'); |
6 |
6 |
|
|
|
7 |
+ |
require_once("constants.php"); |
|
8 |
+ |
|
7 |
9 |
|
require_once("UserRepository.php"); |
8 |
10 |
|
require_once("User.php"); |
9 |
11 |
|
require_once("LocalRepository.php"); |
|
@@ -50,7 +52,7 @@ |
50 |
52 |
|
|
51 |
53 |
|
if ($params["avatar"] != "") { |
52 |
54 |
|
$imgExtention = substr(strrchr($params["avatar"],'.'),1); |
53 |
|
- |
$risposta["avatar_path"] = "./avatar/".sha1($strToHash)."-".strval(time()).".".$imgExtention; |
|
55 |
+ |
$risposta["avatar_name"] = uniqid().".".$imgExtention; |
54 |
56 |
|
} |
55 |
57 |
|
|
56 |
58 |
|
if ($statusUser["return"]!=0) { |
|
@@ -78,10 +80,10 @@ |
78 |
80 |
|
|
79 |
81 |
|
if ($risposta["return"] == 0 && count($localImgs)>0) { |
80 |
82 |
|
foreach($localImgs as $image) { |
81 |
|
- |
rename("./images/temp/".session_id()."/".$image, "./images/".$image); |
|
83 |
+ |
rename(TEMP_IMAGES_PATH.session_id()."/".$image, IMAGES_PATH.$image); |
82 |
84 |
|
} |
83 |
85 |
|
//rmdir("./images/temp/".session_id()."/"); |
84 |
|
- |
deleteDirectory("./images/temp/".session_id()."/"); |
|
86 |
+ |
deleteDirectory(TEMP_IMAGES_PATH.session_id()."/"); |
85 |
87 |
|
$local_repo->addImages($risposta["local_id"], $localImgs); |
86 |
88 |
|
} |
87 |
89 |
|
|