Skip to content

Commit

Permalink
Added the possibility to redirect the user to a link if initial autho…
Browse files Browse the repository at this point in the history
…rization fails.
  • Loading branch information
SalimSalici committed May 24, 2017
1 parent 6064a37 commit 849c1d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
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
2 changes: 2 additions & 0 deletions scripts/filemanager.js
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 849c1d6

Please sign in to comment.