Skip to content

Commit

Permalink
Dev: add some information for forcedSuperAdmin
Browse files Browse the repository at this point in the history
Dev: can only reproduce with set .tmp/upload in readonly and debug=0
  • Loading branch information
Shnoulle committed May 31, 2019
1 parent d3eb007 commit 726a217
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions application/controllers/UploaderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ function run($actionID)
"success" => false,
"msg" => gT("Sorry, there was an error uploading your file.")
);
/* Show error code for user forcedSueprAdmin right */
/* Show error code for user forcedSuperAdmin right */
if( Permission::isForcedSuperAdmin(Permission::getUserId()) ) {
$return['message'] = sprintf(gT("Sorry, there was an error uploading your file, error code : %s."),$_FILES['uploadfile']['error']);
$return['msg'] = sprintf(gT("Sorry, there was an error uploading your file, error code : %s."),$_FILES['uploadfile']['error']);
}
//header('Content-Type: application/json');
echo ls_json_encode($return);
Expand Down Expand Up @@ -239,11 +239,15 @@ function run($actionID)
Yii::app()->end();
}
}
/* We get there : an unknow error happen … */
/* We get there : an unknow error happen … maybe a move_uploaded_file error (with debug=0) */
$return = array(
"success" => false,
"msg" => gT("An unknown error happen")
);
/* Add information for for user forcedSuperAdmin right */
if( Permission::isForcedSuperAdmin(Permission::getUserId()) ) {
$return['msg'] = sprintf(gT("An unknown error happen when moving file %s to %s."),$_FILES['uploadfile']['tmp_name'],$randfileloc);
}
//header('Content-Type: application/json');
echo ls_json_encode($return);
Yii::app()->end();
Expand Down

0 comments on commit 726a217

Please sign in to comment.