summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery_event.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers/gallery_event.php')
-rw-r--r--modules/gallery/helpers/gallery_event.php38
1 files changed, 18 insertions, 20 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index b39be169..982bf094 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -30,21 +30,23 @@ class gallery_event_Core {
static function user_deleted($user) {
$admin = identity::admin_user();
- db::build()
- ->update("tasks")
- ->set("owner_id", $admin->id)
- ->where("owner_id", "=", $user->id)
- ->execute();
- db::build()
- ->update("items")
- ->set("owner_id", $admin->id)
- ->where("owner_id", "=", $user->id)
- ->execute();
- db::build()
- ->update("logs")
- ->set("user_id", $admin->id)
- ->where("user_id", "=", $user->id)
- ->execute();
+ if (!empty($admin)) { // could be empty if there is not identity provider
+ db::build()
+ ->update("tasks")
+ ->set("owner_id", $admin->id)
+ ->where("owner_id", "=", $user->id)
+ ->execute();
+ db::build()
+ ->update("items")
+ ->set("owner_id", $admin->id)
+ ->where("owner_id", "=", $user->id)
+ ->execute();
+ db::build()
+ ->update("logs")
+ ->set("user_id", $admin->id)
+ ->where("user_id", "=", $user->id)
+ ->execute();
+ }
}
static function identity_provider_changed($old_provider, $new_provider) {
@@ -228,11 +230,7 @@ class gallery_event_Core {
->append(Menu::factory("link")
->id("advanced")
->label(t("Advanced"))
- ->url(url::site("admin/advanced_settings")))
- ->append(Menu::factory("link")
- ->id("authentication")
- ->label(t("Authentication"))
- ->url(url::site("admin/identity"))))
+ ->url(url::site("admin/advanced_settings"))))
->append(Menu::factory("link")
->id("modules")
->label(t("Modules"))