summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_event.php38
-rw-r--r--modules/gallery/helpers/module.php8
2 files changed, 22 insertions, 24 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"))
diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php
index 595f600b..f680ff6a 100644
--- a/modules/gallery/helpers/module.php
+++ b/modules/gallery/helpers/module.php
@@ -120,17 +120,17 @@ class module_Core {
}
/**
- * Check that the module can be installed. (i.e. all the prerequistes exist)
+ * Check that the module can be activated. (i.e. all the prerequistes exist)
* @param string $module_name
* @return array an array of warning or error messages to be displayed
*/
- static function check_environment($module_name) {
+ static function can_activate($module_name) {
module::_add_to_path($module_name);
$messages = array();
$installer_class = "{$module_name}_installer";
- if (method_exists($installer_class, "check_environment")) {
- $messages = call_user_func(array($installer_class, "check_environment"));
+ if (method_exists($installer_class, "can_activate")) {
+ $messages = call_user_func(array($installer_class, "can_activate"));
}
// Remove it from the active path