mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-27 10:14:32 -04:00
Improve IdentityProvider switching code, patch thanks to Reklov
Nesalk. Fixes #1834.
This commit is contained in:
@@ -85,6 +85,10 @@ class IdentityProvider_Core {
|
||||
call_user_func("{$new_provider}_installer::initialize");
|
||||
}
|
||||
|
||||
if (!$provider->admin_user()) {
|
||||
throw new Exception("IdentityProvider $new_provider: Couldn't find the admin user!");
|
||||
}
|
||||
|
||||
module::event("identity_provider_changed", $current_provider, $new_provider);
|
||||
|
||||
identity::set_active_user($provider->admin_user());
|
||||
@@ -100,7 +104,12 @@ class IdentityProvider_Core {
|
||||
// Make sure new provider is not in the database
|
||||
try {
|
||||
module::uninstall($new_provider);
|
||||
} catch (Exception $e2) {
|
||||
Kohana_Log::add("error", "Error uninstalling failed new provider\n" .
|
||||
$e2->getMessage() . "\n" . $e2->getTraceAsString());
|
||||
}
|
||||
|
||||
try {
|
||||
// Lets reset to the current provider so that the gallery installation is still
|
||||
// working.
|
||||
module::set_var("gallery", "identity_provider", null);
|
||||
|
||||
Reference in New Issue
Block a user