Skip to content

Commit

Permalink
Merge pull request #183 from SalimSalici/master
Browse files Browse the repository at this point in the history
Added redirect functionality for non authorized users
  • Loading branch information
psolom authored Jun 6, 2017
2 parents dfc96e5 + 849c1d6 commit a762398
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
3 changes: 3 additions & 0 deletions connectors/php/filemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
// Implement this function to authenticate the user, for example to check a
// password login, or restrict client IP address.
//
// If this function returns a string, the authenication will fail and
// the user will be redirected to the returned URL.
//
// This function only authorizes the user to connect and/or load the initial page.
// Authorization for individual files or dirs is provided by the two functions below.
//
Expand Down
12 changes: 6 additions & 6 deletions languages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"ERROR_CONFIG_FILE": "Error in the configuration file: %s",
"ERROR_COPYING_DIRECTORY": "Errore durante la copia della directory da %s a %s.",
"ERROR_COPYING_FILE": "Errore durante la copia del file da %s a %s.",
"ERROR_CREATING_ZIP": "Errore nel creare l'archivio ZIP.",
"ERROR_EXTRACTING_FILE": "Error extracting items from archive",
"ERROR_CREATING_ZIP": "Errore nella creazione dell'archivio ZIP.",
"ERROR_EXTRACTING_FILE": "Errore nell'estrazione degli elementi dall'archivio.",
"ERROR_OPENING_FILE": "Errore nell'apertura del file.",
"ERROR_MOVING_DIRECTORY": "Errore durante lo spostamento della directory da %s a %s.",
"ERROR_MOVING_FILE": "Errore durante lo spostamento del file da %s a %s.",
Expand Down Expand Up @@ -121,11 +121,11 @@
"unit_gb": "gb",
"unit_kb": "kb",
"unit_mb": "mb",
"upload_action_abort": "Abort",
"upload_action_delete": "Delete",
"upload_action_abort": "Annulla",
"upload_action_delete": "Cancella",
"upload_action_info": "Info",
"upload_action_resume": "Resume",
"upload_action_start": "Start",
"upload_action_resume": "Riprendi",
"upload_action_start": "Inizia",
"upload_aborted": "Il caricamento è stato interrotto. Il file non è stato scaricato o parzialmente scaricatod.",
"upload_choose_file": "Selezionare un file da caricare.",
"upload_dropzone_message": "Drop dei file da caricare qui",
Expand Down
8 changes: 5 additions & 3 deletions scripts/filemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ $.richFilemanagerPlugin = function(element, pluginOptions)
.then(function() {
return configure();
})
.then(function(conf_d, conf_u) {
return performInitialRequest();
})
.then(function() {
return localize();
})
.then(function(conf_d, conf_u) {
return performInitialRequest();
})
.then(function() {
return includeTemplates();
})
Expand Down Expand Up @@ -2758,6 +2758,8 @@ $.richFilemanagerPlugin = function(element, pluginOptions)
}
$.each(response.errors, function(i, errorObject) {
fm.error(formatServerError(errorObject));
if (errorObject.arguments.redirect)
window.location.href = errorObject.arguments.redirect;
});
}
};
Expand Down
4 changes: 2 additions & 2 deletions scripts/filemanager.min.js

Large diffs are not rendered by default.

0 comments on commit a762398

Please sign in to comment.