summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@gmail.com>2009-11-01 11:25:08 -0700
committerChad Kieffer <ckieffer@gmail.com>2009-11-01 11:25:08 -0700
commit1202db1c3a67ff8232254989ece76e707b21d730 (patch)
tree2d55b73ec9bbd9d1f5dbc7d9e8972d9b05285a25 /modules/gallery/helpers
parent7ae4b35d787bf51ac98baf1c1818f580e0195016 (diff)
parent91c5a9abb7b617e45b547ced6a28c14a64ef760f (diff)
Merge branch 'master' of github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_block.php2
-rw-r--r--modules/gallery/helpers/gallery_event.php28
2 files changed, 25 insertions, 5 deletions
diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php
index 0052affc..b5c32ad2 100644
--- a/modules/gallery/helpers/gallery_block.php
+++ b/modules/gallery/helpers/gallery_block.php
@@ -72,7 +72,7 @@ class gallery_block_Core {
$block->content = new View("admin_block_platform.html");
if (is_readable("/proc/loadavg")) {
$block->content->load_average =
- join(" ", array_slice(split(" ", array_shift(file("/proc/loadavg"))), 0, 3));
+ join(" ", array_slice(explode(" ", array_shift(file("/proc/loadavg"))), 0, 3));
} else {
$block->content->load_average = t("Unavailable");
}
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) {