diff options
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/block_manager.php | 1 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 28 |
2 files changed, 24 insertions, 5 deletions
diff --git a/modules/gallery/helpers/block_manager.php b/modules/gallery/helpers/block_manager.php index f26c3660..0e78661a 100644 --- a/modules/gallery/helpers/block_manager.php +++ b/modules/gallery/helpers/block_manager.php @@ -36,7 +36,6 @@ class block_manager_Core { $block_class = "{$module_name}_block"; if (method_exists($block_class, "get_site_list")) { $blocks = call_user_func(array($block_class, "get_site_list")); - Kohana::log("error", Kohana::debug($blocks)); foreach (array_keys($blocks) as $block_id) { self::add("site.sidebar", $module_name, $block_id); } diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 582e3267..67a6f41f 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -31,15 +31,35 @@ class gallery_event_Core { static function user_deleted($user) { $admin = identity::admin_user(); $db = Database::instance(); - $db->query("UPDATE {tasks} SET owner_id = {$admin->id} where owner_id = {$user->id}"); - $db->query("UPDATE {items} SET owner_id = {$admin->id} where owner_id = {$user->id}"); + $db->from("tasks") + ->set(array("owner_id" => $admin->id)) + ->where(array("owner_id" => $user->id)) + ->update(); + $db->from("items") + ->set(array("owner_id" => $admin->id)) + ->where(array("owner_id" => $user->id)) + ->update(); + $db->from("logs") + ->set(array("user_id" => $admin->id)) + ->where(array("user_id" => $user->id)) + ->update(); } static function identity_provider_changed($old_provider, $new_provider) { $admin = identity::admin_user(); $db = Database::instance(); - $db->query("UPDATE {tasks} SET owner_id = {$admin->id}"); - $db->query("UPDATE {items} SET owner_id = {$admin->id}"); + $db->from("tasks") + ->set(array("owner_id" => $admin->id)) + ->where("1 = 1") + ->update(); + $db->from("items") + ->set(array("owner_id" => $admin->id)) + ->where("1 = 1") + ->update(); + $db->from("logs") + ->set(array("user_id" => $admin->id)) + ->where("1 = 1") + ->update(); } static function group_created($group) { |