From 496a22667d93dc40742333107538515deab348ee Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 13 Mar 2009 00:17:07 +0100 Subject: [PATCH] Remove .svn directory. --- folks/lib/Notification/.svn/all-wcprops | 29 ---- folks/lib/Notification/.svn/entries | 164 --------------------- folks/lib/Notification/.svn/format | 1 - .../.svn/prop-base/facebook.php.svn-base | 9 -- .../.svn/prop-base/letter.php.svn-base | 5 - .../Notification/.svn/prop-base/mail.php.svn-base | 5 - .../.svn/prop-base/tickets.php.svn-base | 9 -- .../.svn/text-base/facebook.php.svn-base | 149 ------------------- .../.svn/text-base/letter.php.svn-base | 83 ----------- .../Notification/.svn/text-base/mail.php.svn-base | 109 -------------- .../.svn/text-base/tickets.php.svn-base | 84 ----------- 11 files changed, 647 deletions(-) delete mode 100644 folks/lib/Notification/.svn/all-wcprops delete mode 100644 folks/lib/Notification/.svn/entries delete mode 100644 folks/lib/Notification/.svn/format delete mode 100644 folks/lib/Notification/.svn/prop-base/facebook.php.svn-base delete mode 100644 folks/lib/Notification/.svn/prop-base/letter.php.svn-base delete mode 100644 folks/lib/Notification/.svn/prop-base/mail.php.svn-base delete mode 100644 folks/lib/Notification/.svn/prop-base/tickets.php.svn-base delete mode 100644 folks/lib/Notification/.svn/text-base/facebook.php.svn-base delete mode 100644 folks/lib/Notification/.svn/text-base/letter.php.svn-base delete mode 100644 folks/lib/Notification/.svn/text-base/mail.php.svn-base delete mode 100644 folks/lib/Notification/.svn/text-base/tickets.php.svn-base diff --git a/folks/lib/Notification/.svn/all-wcprops b/folks/lib/Notification/.svn/all-wcprops deleted file mode 100644 index 6a26f4fab..000000000 --- a/folks/lib/Notification/.svn/all-wcprops +++ /dev/null @@ -1,29 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 49 -/svn/repos/!svn/ver/1343/folks/lib/Notification -END -facebook.php -K 25 -svn:wc:ra_dav:version-url -V 62 -/svn/repos/!svn/ver/1469/folks/lib/Notification/facebook.php -END -letter.php -K 25 -svn:wc:ra_dav:version-url -V 60 -/svn/repos/!svn/ver/1470/folks/lib/Notification/letter.php -END -mail.php -K 25 -svn:wc:ra_dav:version-url -V 58 -/svn/repos/!svn/ver/1469/folks/lib/Notification/mail.php -END -tickets.php -K 25 -svn:wc:ra_dav:version-url -V 61 -/svn/repos/!svn/ver/1469/folks/lib/Notification/tickets.php -END diff --git a/folks/lib/Notification/.svn/entries b/folks/lib/Notification/.svn/entries deleted file mode 100644 index cc50fc8fc..000000000 --- a/folks/lib/Notification/.svn/entries +++ /dev/null @@ -1,164 +0,0 @@ -9 - -dir -1367 -http://svn.obala.si/svn/repos/folks/lib/Notification -http://svn.obala.si/svn/repos - - - -2009-03-05T13:25:20.591445Z -1343 -duck - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -64c303f7-8c91-43f2-bf98-80ae1d46e4ff - -facebook.php -file -1469 - - - -2009-03-12T10:53:26.000000Z -844690b38a65f8179b23c1346190e245 -2009-03-12T10:51:11.048553Z -1469 -duck -has-props - - - - - - - - - - - - - - - - - - - - -4394 - -letter.php -file -1470 - - - -2009-03-12T10:54:40.000000Z -9b813aedf152b6d837b0ef06cd490e01 -2009-03-12T10:52:44.969970Z -1470 -duck -has-props - - - - - - - - - - - - - - - - - - - - -2400 - -mail.php -file -1469 - - - -2009-03-12T10:52:58.000000Z -f5dd1ba35c8bf2dcad0d3302e2296021 -2009-03-12T10:51:11.048553Z -1469 -duck -has-props - - - - - - - - - - - - - - - - - - - - -3138 - -tickets.php -file -1469 - - - -2009-03-12T10:53:26.000000Z -260a1d54eb98aae552e999095f083b7b -2009-03-12T10:51:11.048553Z -1469 -duck -has-props - - - - - - - - - - - - - - - - - - - - -2410 - diff --git a/folks/lib/Notification/.svn/format b/folks/lib/Notification/.svn/format deleted file mode 100644 index ec635144f..000000000 --- a/folks/lib/Notification/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/folks/lib/Notification/.svn/prop-base/facebook.php.svn-base b/folks/lib/Notification/.svn/prop-base/facebook.php.svn-base deleted file mode 100644 index 7b57b302a..000000000 --- a/folks/lib/Notification/.svn/prop-base/facebook.php.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/folks/lib/Notification/.svn/prop-base/letter.php.svn-base b/folks/lib/Notification/.svn/prop-base/letter.php.svn-base deleted file mode 100644 index 0f29ce6d0..000000000 --- a/folks/lib/Notification/.svn/prop-base/letter.php.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 2 -Id -V 3 -set -END diff --git a/folks/lib/Notification/.svn/prop-base/mail.php.svn-base b/folks/lib/Notification/.svn/prop-base/mail.php.svn-base deleted file mode 100644 index 0f29ce6d0..000000000 --- a/folks/lib/Notification/.svn/prop-base/mail.php.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 2 -Id -V 3 -set -END diff --git a/folks/lib/Notification/.svn/prop-base/tickets.php.svn-base b/folks/lib/Notification/.svn/prop-base/tickets.php.svn-base deleted file mode 100644 index 7b57b302a..000000000 --- a/folks/lib/Notification/.svn/prop-base/tickets.php.svn-base +++ /dev/null @@ -1,9 +0,0 @@ -K 13 -svn:eol-style -V 6 -native -K 12 -svn:keywords -V 23 -Author Date Id Revision -END diff --git a/folks/lib/Notification/.svn/text-base/facebook.php.svn-base b/folks/lib/Notification/.svn/text-base/facebook.php.svn-base deleted file mode 100644 index 279cc8a69..000000000 --- a/folks/lib/Notification/.svn/text-base/facebook.php.svn-base +++ /dev/null @@ -1,149 +0,0 @@ - - * @package Folks - */ -class Folks_Notification_facebook extends Folks_Notification { - - /** - * FB object - */ - private $_fb; - - /** - * FB connection parameters - */ - private $_fbp; - - /** - * Returns method human name - */ - public function getName() - { - return _("Facebook"); - } - - /** - * Checks if a driver is available for a certain notification type - * - * @param string $type Notification type - * - * @return boolean - */ - public function isAvailable($type) - { - // Check FB installation - if (!$GLOBALS['conf']['facebook']['enabled']) { - return false; - } - - // Chacke FB user config - $fbp = unserialize($GLOBALS['prefs']->getValue('facebook')); - if (!$fbp || empty($fbp['uid'])) { - return false; - } - - return true; - } - - /** - * Notify user - * - * @param mixed $user User or array of users to send notification to - * @param string $subject Subject of message - * @param string $body Body of message - * @param array $attachments Attached files - * - * @return true on succes, PEAR_Error on failure - */ - public function notify($user, $subject, $body, $attachments = array()) - { - if (!$this->_loadFB()) { - return $this->_fb; - } - - try { - $message = '' . $subject . ': ' . $body; - $result = $this->_fb->notifications->send(array($this->_fbp['uid']), $message, 'user_to_user'); - } catch (Horde_Service_Facebook_Exception $e) { - return PEAR::raiseError($e->getMessage(), $e->getCode()); - } - - return $result; - } - - /** - * Notify user - * - * @param mixed $user User or array of users to send notification to - * @param string $subject Subject of message - * @param string $body Body of message - * @param array $attachments Attached files - * - * @return true on succes, PEAR_Error on failure - */ - public function notifyFriends($user, $subject, $body, $attachments = array()) - { - if (!$this->_loadFB()) { - return $this->_fb; - } - - try { - $friends = $this->_fb->friends->get(null, $this->_fbp['uid']); - } catch (Horde_Service_Facebook_Exception $e) { - return PEAR::raiseError($e->getMessage(), $e->getCode()); - } - - try { - $message = '' . $subject . ': ' . $body; - $result = $this->_fb->notifications->send($friends, $message, 'user_to_user'); - } catch (Horde_Service_Facebook_Exception $e) { - return PEAR::raiseError($e->getMessage(), $e->getCode()); - } - - return $result; - } - - /** - * Load FB content - */ - private function _loadFB() - { - if ($this->_fb) { - return true; - } - - // Check FB installation - if (!$GLOBALS['conf']['facebook']['enabled']) { - $this->_fb = PEAR::raiseError(_("No Facebook integration exists.")); - return false; - } - - // Check FB user config - $this->_fbp = unserialize($GLOBALS['prefs']->getValue('facebook')); - if (!$this->_fbp || empty($this->_fbp['uid'])) { - $this->_fb = PEAR::raiseError(sprintf(_("Could not find authorization for %s to interact with your Facebook account."), $GLOBALS['registry']->get('name', 'horde'))); - return false; - } - - // Create FB Object - $this->_fb = new Horde_Service_Facebook($GLOBALS['conf']['facebook']['key'], - $GLOBALS['conf']['facebook']['secret'], - array('http_client' => new Horde_Http_Client(), - 'http_request' => new Horde_Controller_Request_Http())); - - // Set Auth user - $this->_fb->auth->setUser($this->_fbp['uid'], $this->_fbp['sid'], 0); - - return true; - } -} diff --git a/folks/lib/Notification/.svn/text-base/letter.php.svn-base b/folks/lib/Notification/.svn/text-base/letter.php.svn-base deleted file mode 100644 index 9569127c5..000000000 --- a/folks/lib/Notification/.svn/text-base/letter.php.svn-base +++ /dev/null @@ -1,83 +0,0 @@ - - * @package Folks - */ -class Folks_Notification_letter extends Folks_Notification { - - /** - * Returns method human name - */ - public function getName() - { - return $GLOBALS['registry']->get('name', 'letter'); - } - - /** - * Checks if a driver is available for a certain notification type - * - * @param string $type Notification type - * - * @return boolean - */ - public function isAvailable($type) - { - if ($type == 'friends') { - return $GLOBALS['registry']->hasMethod('users/getFriends'); - } - - return true; - } - - /** - * Notify user - * - * @param mixed $user User or array of users to send notification to - * @param string $subject Subject of message - * @param string $body Body of message - * @param array $attachments Attached files - * - * @return true on succes, PEAR_Error on failure - */ - public function notify($user, $subject, $body, $attachments = array()) - { - if (empty($user)) { - return true; - } - - return $GLOBALS['registry']->callByPackage( - 'letter', 'sendMessage', array($user, - array('title' => $subject, - 'content' => $body, - 'attachments' => $attachments))); - } - - /** - * Notify user's friends - * - * @param mixed $user User or array of users to send notification to - * @param string $subject Subject of message - * @param string $body Body of message - * @param array $attachments Attached files - * - * @return true on succes, PEAR_Error on failure - */ - public function notifyFriends($user, $subject, $body, $attachments = array()) - { - $friends = $GLOBALS['registry']->call('users/getFriends'); - if ($friends instanceof PEAR_Error) { - return $friends; - } - - return $this->notify($friends, $subject, $body, $attachments); - } -} diff --git a/folks/lib/Notification/.svn/text-base/mail.php.svn-base b/folks/lib/Notification/.svn/text-base/mail.php.svn-base deleted file mode 100644 index ab8b46916..000000000 --- a/folks/lib/Notification/.svn/text-base/mail.php.svn-base +++ /dev/null @@ -1,109 +0,0 @@ - - * @package Folks - */ -class Folks_Notification_mail extends Folks_Notification { - - /** - * Returns method human name - */ - public function getName() - { - return _("E-mail"); - } - - /** - * Checks if a driver is available for a certain notification type - * - * @param string $type Notification type - * - * @return boolean - */ - public function isAvailable($type) - { - if ($type == 'friends') { - return $GLOBALS['registry']->hasMethod('users/getFriends'); - } - - return true; - } - - /** - * Notify user - * - * @param mixed $user User or array of users to send notification to - * @param string $subject Subject of message - * @param string $body Body of message - * @param array $attachments Attached files - * - * @return true on succes, PEAR_Error on failure - */ - public function notify($user, $subject, $body, $attachments = array()) - { - if (empty($user)) { - return true; - } - - list($mail_driver, $mail_params) = Horde::getMailerConfig(); - require_once FOLKS_BASE . '/lib/version.php'; - - $mail = new Horde_Mime_Mail($subject, $body, null, - $this->_params['from_addr'], - NLS::getCharset()); - - $mail->addHeader('User-Agent', 'Folks ' . FOLKS_VERSION); - $mail->addHeader('X-Originating-IP', $_SERVER['REMOTE_ADDR']); - $mail->addHeader('X-Remote-Browser', $_SERVER['HTTP_USER_AGENT']); - - foreach ($attachments as $file) { - if (file_exists($file)) { - $mail->addAttachment($file, null, null, NLS::getCharset()); - } - } - - if (is_string($user)) { - $user = array($user); - } - - foreach ($user as $recipent) { - $to = $this->_getUserFromAddr($recipent); - if (empty($to)) { - continue; - } - $mail->addHeader('To', $to, NLS::getCharset(), true); - $mail->send($mail_driver, $mail_params); - } - - return true; - } - - /** - * Notify user's friends - * - * @param mixed $user User or array of users to send notification to - * @param string $subject Subject of message - * @param string $body Body of message - * @param array $attachments Attached files - * - * @return true on succes, PEAR_Error on failure - */ - public function notifyFriends($user, $subject, $body, $attachments = array()) - { - $friends = $GLOBALS['registry']->call('users/getFriends'); - if ($friends instanceof PEAR_Error) { - return $friends; - } - - return $this->notify($friends, $subject, $body, $attachments); - } -} diff --git a/folks/lib/Notification/.svn/text-base/tickets.php.svn-base b/folks/lib/Notification/.svn/text-base/tickets.php.svn-base deleted file mode 100644 index f813207a1..000000000 --- a/folks/lib/Notification/.svn/text-base/tickets.php.svn-base +++ /dev/null @@ -1,84 +0,0 @@ - - * @package Folks - */ -class Folks_Notification_tickets extends Folks_Notification { - - /** - * Returns method human name - */ - public function getName() - { - return $GLOBALS['registry']->get('name', 'whups'); - } - - /** - * Checks if a driver is available for a certain notification type - * - * @param string $type Notification type - * - * @return boolean - */ - public function isAvailable($type) - { - if (!$GLOBALS['registry']->hasInterface('tickets') || - $type == 'admins') { - return false; - } - - return false; - } - - /** - * Notify user - * - * @param mixed $user User or array of users to send notification to - * @param string $subject Subject of message - * @param string $body Body of message - * @param array $attachments Attached files - * - * @return true on succes, PEAR_Error on failure - */ - public function notify($user, $subject, $body, $attachments = array()) - { - global $registry; - - $info = array_merge($this->_params['ticket_params'], - array('summary' => $subject, - 'comment' => $body, - 'user_email' => $this->_getUserFromAddr())); - - $ticket_id = $registry->call('tickets/addTicket', array($info)); - if ($ticket_id instanceof PEAR_Error) { - return $ticket_id; - } - - if (empty($attachments) || - !$registry->hasMethod('tickets/addAttachment')) { - return $result; - } - - foreach ($attachments as $attachment) { - $result = $registry->call( - 'tickets/addAttachment', - array('ticket_id' => $ticket_id, - 'name' => $attachment['name'], - 'data' => file_get_contents($attachment['file']))); - if ($result instanceof PEAR_Error) { - return $result; - } - } - - return true; - } -} -- 2.11.0