From 3f3cf6bc65d3e72ae19a3c8a78aba533e5186232 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 5 Jun 2012 09:15:23 +0200 Subject: [PATCH] Use Roundcube Framework where applicable, so we can use this code out of Roundcube --- plugins/libkolab/lib/kolab_format.php | 2 +- plugins/libkolab/lib/kolab_format_xcal.php | 4 ++-- plugins/libkolab/lib/kolab_storage_cache.php | 4 ++-- plugins/libkolab/lib/kolab_storage_folder.php | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/libkolab/lib/kolab_format.php b/plugins/libkolab/lib/kolab_format.php index b6215e03..db815772 100644 --- a/plugins/libkolab/lib/kolab_format.php +++ b/plugins/libkolab/lib/kolab_format.php @@ -186,7 +186,7 @@ abstract class kolab_format } if ($log) { - raise_error(array( + rcube::raise_error(array( 'code' => 660, 'type' => 'php', 'file' => __FILE__, diff --git a/plugins/libkolab/lib/kolab_format_xcal.php b/plugins/libkolab/lib/kolab_format_xcal.php index 1eb2acf8..19d29215 100644 --- a/plugins/libkolab/lib/kolab_format_xcal.php +++ b/plugins/libkolab/lib/kolab_format_xcal.php @@ -249,7 +249,7 @@ abstract class kolab_format_xcal extends kolab_format $attendees->push($att); } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Invalid event attendee: " . json_encode($attendee), @@ -316,7 +316,7 @@ abstract class kolab_format_xcal extends kolab_format $this->obj->setExceptionDates($exdates); } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Invalid event recurrence rule: " . json_encode($object['recurrence']), diff --git a/plugins/libkolab/lib/kolab_storage_cache.php b/plugins/libkolab/lib/kolab_storage_cache.php index cc9b38c8..d1ec64e4 100644 --- a/plugins/libkolab/lib/kolab_storage_cache.php +++ b/plugins/libkolab/lib/kolab_storage_cache.php @@ -230,7 +230,7 @@ class kolab_storage_cache ); if (!$this->db->affected_rows($result)) { - rcmail::raise_error(array( + rcube::raise_error(array( 'code' => 900, 'type' => 'php', 'message' => "Failed to write to kolab cache" ), true); @@ -551,7 +551,7 @@ class kolab_storage_cache " VALUES $buffer" ); if (!$this->db->affected_rows($result)) { - rcmail::raise_error(array( + rcube::raise_error(array( 'code' => 900, 'type' => 'php', 'message' => "Failed to write to kolab cache" ), true); diff --git a/plugins/libkolab/lib/kolab_storage_folder.php b/plugins/libkolab/lib/kolab_storage_folder.php index 684ed35b..cd049d9f 100644 --- a/plugins/libkolab/lib/kolab_storage_folder.php +++ b/plugins/libkolab/lib/kolab_storage_folder.php @@ -148,7 +148,7 @@ class kolab_storage_folder switch ($info['namespace']) { case 'personal': - $this->owner = $rcmail->user->get_username(); + $this->owner = $rcmail->get_user_name(); break; case 'shared': @@ -159,7 +159,7 @@ class kolab_storage_folder $owner = ''; list($prefix, $user) = explode($this->imap->get_hierarchy_delimiter(), $info['name']); if (strpos($user, '@') === false) { - $domain = strstr($rcmail->user->get_username(), '@'); + $domain = strstr($rcmail->get_user_name(), '@'); if (!empty($domain)) $user .= $domain; } @@ -422,7 +422,7 @@ class kolab_storage_folder } if (!$xml) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, @@ -470,7 +470,7 @@ class kolab_storage_folder if (preg_match('!(.+)!Uims', $xml, $m)) $msgadd = " UID = " . trim(strip_tags($m[1])); - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, @@ -606,7 +606,7 @@ class kolab_storage_folder return true; } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Failed to move message $msguid to $target_folder: " . $this->imap->get_error_str(),