// Lets see if we are even able to send the user an attachment.
if (!$conf['compose']['link_attachments']) {
- throw new Horde_Exception(_("Linked attachments are forbidden."));
+ throw new IMP_Exception(_("Linked attachments are forbidden."));
}
// Gather required form variables.
$time_stamp = Horde_Util::getFormData('t');
$file_name = Horde_Util::getFormData('f');
if (is_null($mail_user) || is_null($time_stamp) || is_null($file_name)) {
- throw new Horde_Exception(_("The attachment was not found."));
+ throw new IMP_Exception(_("The attachment was not found."));
}
// Initialize the VFS.
$vfsroot = VFS::singleton($conf['vfs']['type'], Horde::getDriverConfig('vfs', $conf['vfs']['type']));
if ($vfsroot instanceof PEAR_Error) {
- throw new Horde_Exception(sprintf(_("Could not create the VFS backend: %s"), $vfsroot->getMessage()));
+ throw new IMP_Exception(sprintf(_("Could not create the VFS backend: %s"), $vfsroot->getMessage()));
}
// Check if the file exists.
$file_name = escapeshellcmd(basename($file_name));
$full_path = sprintf(IMP_Compose::VFS_LINK_ATTACH_PATH . '/%s/%d', $mail_user, $time_stamp);
if (!$vfsroot->exists($full_path, $file_name)) {
- throw new Horde_Exception(_("The specified attachment does not exist. It may have been deleted by the original sender."));
+ throw new IMP_Exception(_("The specified attachment does not exist. It may have been deleted by the original sender."));
}
// Check to see if we need to send a verification message.
$file_data = $vfsroot->read($full_path, $file_name);
if ($file_data instanceof PEAR_Error) {
Horde::logMessage($file_data, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception(_("The specified file cannot be read."));
+ throw new IMP_Exception(_("The specified file cannot be read."));
}
$mime_type = Horde_Mime_Magic::analyzeData($file_data, isset($conf['mime']['magic_db']) ? $conf['mime']['magic_db'] : null);
if ($mime_type === false) {
//
// $session = ssh2_connect($host);
// if (!$session) {
-// throw new Horde_Exception(_("Connection to server failed."), 'horde.error');
+// throw new IMP_Exception(_("Connection to server failed."), 'horde.error');
// }
//
// if (!ssh2_auth_password($session, $user, $pass)) {
-// throw new Horde_Exception(_("Authentication failed."), 'horde.error');
+// throw new IMP_Exception(_("Authentication failed."), 'horde.error');
// }
//
// $stream = ssh2_exec($session, $command, false);
* Retrieves public S/MIME keys of message recipients.
*
* The hook will be called first when searching for the keys, and further
- * lookup techniques will only be used if the hook throws an excpetion or
+ * lookup techniques will only be used if the hook throws an exception or
* returns an empty result.
*
* @param string $address The email address of the recipient.
* Retrieves public PGP keys of message recipients.
*
* The hook will be called first when searching for the keys, and further
- * lookup techniques will only be used if the hook throws an excpetion or
+ * lookup techniques will only be used if the hook throws an exception or
* returns an empty result.
*
* @param string $address The email address of the recipient.
--- /dev/null
+<?php
+/**
+ * Base exception class for IMP.
+ *
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Michael Slusarz <jan@horde.org>
+ * @package IMP
+ */
+class IMP_Exception extends Horde_Exception
+{
+}
* It will only create a new instance if no instance currently exists.
*
* @return IMP_Imap_Acl The created concrete instance.
+ * @throws Horde_Exception
*/
static public function singleton()
{
/**
* Constructor.
+ *
+ * @throws Horde_Exception
*/
protected function __construct()
{
$contents = IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox'));
$mime_part = $contents->getMIMEPart(Horde_Util::getFormData('mime_id'));
if (empty($mime_part)) {
- throw new Horde_Exception('Cannot retrieve public key from message.');
+ throw new IMP_Exception('Cannot retrieve public key from message.');
}
/* Add the public key to the storage system. */
if (!$registry->hasMethod('images/selectGalleries') ||
!$registry->hasMethod('images/saveImage')) {
- throw new Horde_Exception(_("Image saving is not available."));
+ throw new IMP_Exception(_("Image saving is not available."));
}
/* Build the template. */
$contents = IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox'));
$mime_part = $contents->getMIMEPart(Horde_Util::getFormData('mime_id'));
if (empty($mime_part)) {
- throw new Horde_Exception('Cannot retrieve public key from message.');
+ throw new IMP_Exception('Cannot retrieve public key from message.');
}
/* Add the public key to the storage system. */