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.php45
1 files changed, 21 insertions, 24 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index 679d65c2..6175e049 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) {
@@ -109,12 +111,11 @@ class gallery_event_Core {
->label(t("Login")));
} else {
$csrf = access::csrf_token();
- $item = $theme->item();
$menu->append(Menu::factory("dialog")
->id("user_menu_edit_profile")
->css_id("g-user-profile-link")
->view("login_current_user.html")
- ->url(url::site("form/edit/users/{$user->id}"))
+ ->url(url::site("form/edit/user/{$user->id}"))
->label($user->display_name()));
$menu->append(Menu::factory("link")
->id("user_menu_logout")
@@ -228,11 +229,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"))
@@ -305,7 +302,7 @@ class gallery_event_Core {
->append(
Menu::factory("ajax_link")
->id("rotate_ccw")
- ->label(t("Rotate 90° counter clockwise"))
+ ->label(t("Rotate 90° counter clockwise"))
->css_class("ui-icon-rotate-ccw")
->ajax_handler("function(data) { " .
"\$.gallery_replace_image(data, \$('$thumb_css_selector')) }")
@@ -313,7 +310,7 @@ class gallery_event_Core {
->append(
Menu::factory("ajax_link")
->id("rotate_cw")
- ->label(t("Rotate 90° clockwise"))
+ ->label(t("Rotate 90° clockwise"))
->css_class("ui-icon-rotate-cw")
->ajax_handler("function(data) { " .
"\$.gallery_replace_image(data, \$('$thumb_css_selector')) }")