Security bug fixed #1131 and refresh profile picture after uploaded
This commit is contained in:
parent
4d0912308d
commit
35483e0d30
|
@ -134,9 +134,8 @@
|
|||
contentType: false,
|
||||
processData: false
|
||||
}).done(function(data) {
|
||||
console.log(data);
|
||||
if (data.status==0) {
|
||||
$("#jsprofilePicturePreview").attr('src',json.absoluteURL+"?time="+Math.random());
|
||||
$("#jsprofilePicturePreview").attr('src',data.absoluteURL+"?time="+Math.random());
|
||||
} else {
|
||||
showAlert(data.message);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,10 @@ if ($username===false) {
|
|||
ajaxResponse(1, 'Error in username.');
|
||||
}
|
||||
|
||||
if ( ($login->role()!='admin') && ($login->username()!=$username) ) {
|
||||
ajaxResponse(1, 'Error in username.');
|
||||
}
|
||||
|
||||
if (!isset($_FILES['profilePictureInputFile'])) {
|
||||
ajaxResponse(1, 'Error trying to upload the profile picture.');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue