$cmd = "rm -rf $po";
exec("sudo $cmd");
-
+
$cmd = "svn update $po";
exec("sudo $cmd");
-
+
if (!@file_exists($po)) {
Translate_Display::warning(_("File doesn't exist ... ") . $po);
Translate_Display::info();
case 'wishes':
$result = $GLOBALS['registry']->callByPackage('genie', 'listUserItems', array($user));
- if ($result instanceof PEAR_Error) {
- return $result;
- } else {
- return count($result);
- }
+ return count($result);
case 'galleries':
return $GLOBALS['registry']->callByPackage('ansel', 'countGalleries', array('ansel', PERMS_SHOW, $user));
}
if (!eregi("^[_a-z0-9-]*$", $username)) {
- return PEAR::raiseError(_("Username can contain only alphanumeric characters, underscore and minus."));
+ throw new Horde_Exception(_("Username can contain only alphanumeric characters, underscore and minus."));
}
$_db = DB::connect($GLOBALS['conf']['sql'], true);
$result = $_db->getRow($query, array($username, $info['extra']['email']), DB_FETCHMODE_ASSOC);
if ($result instanceof PEAR_Error) {
- return $result;
+ throw new Horde_Exception($result);
} elseif (empty($result)) {
return $info;
} elseif ($result['user_uid'] == $username) {
- return PEAR::raiseError(_("There is already an user registered with this username"));
+ throw new Horde_Exception(_("There is already an user registered with this username"));
} elseif ($result['user_email'] == $info['extra']['email']) {
- return PEAR::raiseError(_("There is already an user registered with this email"));
+ throw new Horde_Exception(_("There is already an user registered with this email"));
}
return $info;
$result = $_db->query($query, $values);
if ($result instanceof PEAR_Error) {
- return $result;
+ throw new Horde_Exception($result);
}
require_once $GLOBALS['registry']->get('fileroot', 'folks') . '/lib/Folks.php';
}
} else {
$profile['count_' . $service] = Horde::callHook('_folks_hook_countService', array($service, $user), 'folks');
- if ($profile['count_' . $service] instanceof PEAR_Error) {
- return $profile['count_' . $service];
- } elseif (empty($profile['count_' . $service])) {
+ if (empty($profile['count_' . $service])) {
continue;
}
}
$profile['count_' . $service . '_list'] = Horde::callHook('_folks_hook_getService', array($service, $user), 'folks');
- if ($profile['count_' . $service . '_list'] instanceof PEAR_Error) {
- return PEAR::raiseError($profile['count_' . $service . '_list']);
- } elseif (empty($profile['count_' . $service . '_list'])) {
+ if (empty($profile['count_' . $service . '_list'])) {
$profile['count_' . $service] = 0;
}
}
require_once dirname(__FILE__) . '/lib/base.php';
/* Determine if compose mode is disabled. */
-$compose_disable = !empty($conf['hooks']['disable_compose']) &&
- Horde::callHook('_imp_hook_disable_compose', array(), 'imp');
+$compose_disable = !IMP::canCompose();
/* The headers of the message. */
$header = array();
}
/* Determine if compose mode is disabled. */
-$compose_disable = !empty($conf['hooks']['disable_compose']) &&
- Horde::callHook('_imp_hook_disable_compose', array(), 'imp');
+$compose_disable = !IMP::canCompose();
/* Set the current time zone. */
Horde_Nls::setTimeZone();
Horde_Nls::setTimeZone();
/* Determine if compose mode is disabled. */
-$compose_disable = !empty($conf['hooks']['disable_compose']) &&
- Horde::callHook('_imp_hook_disable_compose', array(), 'imp');
+$compose_disable = !IMP::canCompose();
/* Determine if mailboxes are readonly. */
$readonly_drafts = $readonly_sentmail = false;
/* Call post-sent hook. */
if (!empty($conf['hooks']['postsent'])) {
- Horde::callHook('_imp_hook_postsent', array($save_msg['msg'], $headers), 'imp', null);
+ try {
+ Horde::callHook('_imp_hook_postsent', array($save_msg['msg'], $headers), 'imp');
+ } catch (Horde_Exception $e) {}
}
return $sent_saved;
$recipients += isset($address['grounpname']) ? count($address['addresses']) : 1;
}
if ($recipients > $timelimit) {
- $error = @htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients within %d hours."), $timelimit, $conf['sentmail']['params']['limit_period']), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($conf['hooks']['permsdenied'])) {
- $error = Horde::callHook('_perms_hook_denied', array('imp:max_timelimit'), 'horde', $error);
+ try {
+ Horde::callHook('_perms_hook_denied', array('imp:max_timelimit'), 'horde');
+ } catch (Horde_Exception $e) {
+ throw new IMP_Compose_Exception($e);
+ }
}
- throw new IMP_Compose_Exception($error);
+ throw new IMP_Compose_Exception(@htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients within %d hours."), $timelimit, $conf['sentmail']['params']['limit_period']), ENT_COMPAT, Horde_Nls::getCharset()));
}
}
$num_recipients += count(explode(',', $recipient));
}
if ($num_recipients > $max_recipients) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients."), $max_recipients), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($conf['hooks']['permsdenied'])) {
- $message = Horde::callHook('_perms_hook_denied', array('imp:max_recipients'), 'horde', $message);
+ try {
+ Horde::callHook('_perms_hook_denied', array('imp:max_recipients'), 'horde');
+ } catch (Horde_Exception $e) {
+ throw new IMP_Compose_Exception($e);
+ }
}
- throw new IMP_Compose_Exception($message);
+ throw new IMP_Compose_Exception(@htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients."), $max_recipients), ENT_COMPAT, Horde_Nls::getCharset()));
}
}
}
/* If there is a user defined function, call it with the
* current trailer as an argument. */
if (!empty($GLOBALS['conf']['hooks']['trailer'])) {
- $trailer = Horde::callHook('_imp_hook_trailer', array($trailer), 'imp');
+ try {
+ $trailer = Horde::callHook('_imp_hook_trailer', array($trailer), 'imp');
+ } catch (Horde_Exception $e) {
+ throw new IMP_Compose_Exception($e);
+ }
}
$body .= $trailer;
/* Check permissions. */
if (!IMP::hasPermission('create_folders')) {
- $old_error = error_reporting(0);
- $message = htmlspecialchars(_("You are not allowed to create folders."), ENT_COMPAT, Horde_Nls::getCharset());
- error_reporting($old_error);
- if (!empty($conf['hooks']['permsdenied'])) {
- $message = Horde::callHook('_perms_hook_denied', array('imp:create_folders'), 'horde', $message);
+ try {
+ if (!empty($conf['hooks']['permsdenied'])) {
+ Horde::callHook('_perms_hook_denied', array('imp:create_folders'), 'horde', $message);
+ }
+ $message = @htmlspecialchars(_("You are not allowed to create folders."), ENT_COMPAT, Horde_Nls::getCharset());
+ } catch (Horde_Exception $e) {
+ $message = $e->getMessage();
}
$notification->push($message, 'horde.error', array('content.raw'));
return false;
} elseif (!IMP::hasPermission('max_folders')) {
- $old_error = error_reporting(0);
- $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), IMP::hasPermission('max_folders', true)), ENT_COMPAT, Horde_Nls::getCharset());
- error_reporting($old_error);
- if (!empty($conf['hooks']['permsdenied'])) {
- $message = Horde::callHook('_perms_hook_denied', array('imp:max_folders'), 'horde', $message);
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), IMP::hasPermission('max_folders', true)), ENT_COMPAT, Horde_Nls::getCharset());
+ try {
+ if (!empty($conf['hooks']['permsdenied'])) {
+ Horde::callHook('_perms_hook_denied', array('imp:max_folders'), 'horde', $message);
+ }
+ } catch (Horde_Exception $e) {
+ $message = $e->getMessage();
}
$notification->push($message, 'horde.error', array('content.raw'));
return false;
}
}
- if (empty($GLOBALS['conf']['hooks']['disable_compose']) ||
- !Horde::callHook('_imp_hook_disable_compose', array(false), 'imp')) {
+ if (IMP::canCompose()) {
$menu->add(self::composeLink(array('mailbox' => $GLOBALS['imp_mbox']['mailbox'])), _("_New Message"), 'compose.png');
}
return self::$newUrl ? self::$newUrl : Horde::selfUrl(true);
}
+ /**
+ * Determine the status of composing.
+ *
+ * @return boolean Is compose allowed?
+ */
+ static public function canCompose()
+ {
+ try {
+ return empty($conf['hooks']['disable_compose']) ||
+ !Horde::callHook('_imp_hook_disable_compose', array(), 'imp');
+ } catch (Horde_Exception $e) {
+ return true;
+ }
+ }
+
}
}
if (!empty($GLOBALS['conf']['hooks']['signature'])) {
- $val = Horde::callHook('_imp_hook_signature', array($val),
- 'imp', $val);
+ try {
+ $val = Horde::callHook('_imp_hook_signature', array($val), 'imp');
+ } catch (Horde_Exception $e) {}
}
$this->_signatures[$ident] = $val;
{
if (!isset($this->_readonly[$mailbox])) {
/* These tests work on both regular and search mailboxes. */
- $res = !empty($GLOBALS['conf']['hooks']['mbox_readonly']) &&
- Horde::callHook('_imp_hook_mbox_readonly', array($mailbox), 'imp');
+ try {
+ $res = !empty($GLOBALS['conf']['hooks']['mbox_readonly']) &&
+ Horde::callHook('_imp_hook_mbox_readonly', array($mailbox), 'imp');
+ } catch (Horde_Exception $e) {
+ $res = false;
+ }
/* This check can only be done for regular IMAP mailboxes. */
// TODO: POP3 also?
if ($_SESSION['imp']['protocol'] != 'pop') {
if (!empty($GLOBALS['conf']['hooks']['display_folder'])) {
- $this->_setInvisible($elt, !Horde::callHook('_imp_hook_display_folder', array($elt['v']), 'imp'));
+ try {
+ $this->_setInvisible($elt, !Horde::callHook('_imp_hook_display_folder', array($elt['v']), 'imp'));
+ } catch (Horde_Exception $e) {}
}
if ($elt['c'] != 0) {
}
if (!isset($mbox_icons)) {
- $mbox_icons = Horde::callHook('_imp_hook_mbox_icons', array(), 'imp', false);
- if (!$mbox_icons) {
- return false;
- }
+ try {
+ $mbox_icons = Horde::callHook('_imp_hook_mbox_icons', array(), 'imp', false);
+ if (!$mbox_icons) {
+ return false;
+ }
+ } catch (Horde_Exception $e) {}
}
if (isset($mbox_icons[$elt['v']])) {
$items[IMP::generateIMPUrl('mailbox-mimp.php', 'INBOX')] = _("Inbox");
}
- if (($page != 'compose') &&
- (empty($GLOBALS['conf']['hooks']['disable_compose']) ||
- Horde::callHook('_imp_hook_disable_compose', array(true), 'imp'))) {
-
+ if (($page != 'compose') && IMP::canCompose()) {
$items[Horde_Util::addParameter(Horde::applicationUrl('compose-mimp.php'), 'u', uniqid(mt_rand()))] = _("New Message");
}
* necessary. */
if (!empty($conf['hooks']['vinfo'])) {
try {
- $hook_user = Horde::callHook('_imp_hook_vinfo', array('username', $imapuser), 'imp');
- if (!is_a($hook_user, 'PEAR_Error')) {
- $imapuser = $hook_user;
- }
- } catch (Horde_Exception $e) {
- }
+ $imapuser = Horde::callHook('_imp_hook_vinfo', array('username', $imapuser), 'imp');
+ } catch (Horde_Exception $e) {}
}
/* Load the server configuration. */
$to = $GLOBALS['conf'][$action]['email'];
} elseif (!empty($GLOBALS['conf']['hooks']['spam_email'])) {
/* Call the email generation hook, if requested. */
- $to = Horde::callHook('_imp_hook_spam_email', array($action), 'imp');
+ try {
+ $to = Horde::callHook('_imp_hook_spam_email', array($action), 'imp');
+ } catch (Horde_Exception $e) {}
}
if ($to) {
/* Get all the flag information. */
if (!empty($GLOBALS['conf']['hooks']['msglist_flags'])) {
- $ob['flags'] = array_merge($ob['flags'], Horde::callHook('_imp_hook_msglist_flags', array($ob, 'dimp'), 'imp'));
+ try {
+ $ob['flags'] = array_merge($ob['flags'], Horde::callHook('_imp_hook_msglist_flags', array($ob, 'dimp'), 'imp'));
+ } catch (Horde_Exception $e) {}
}
$imp_flags = IMP_Imap_Flags::singleton();
/* Allow user to alter template array. */
if (!empty($GLOBALS['conf']['imp']['hooks']['mailboxarray'])) {
- $msgs = Horde::callHook('_imp_hook_mailboxarray', array($msgs, 'dimp'), 'imp');
+ try {
+ $msgs = Horde::callHook('_imp_hook_mailboxarray', array($msgs, 'dimp'), 'imp');
+ } catch (Horde_Exception $e) {}
}
return $msgs;
* Horde_Mime_Address::parseAddressList().
*
* @return array Array with the following keys: inner, personal, raw.
+ * @throws Horde_Exception
*/
private function _buildAddressList($addrlist)
{
}
if ($preview && !empty($GLOBALS['conf']['dimp']['hooks']['previewview'])) {
- $res = Horde::callHook('_imp_hook_dimp_previewview', array($result), 'imp');
- if (!empty($res)) {
- $result = $res[0];
- $result['js'] = $res[1];
- }
+ try {
+ $res = Horde::callHook('_imp_hook_dimp_previewview', array($result), 'imp');
+ if (!empty($res)) {
+ $result = $res[0];
+ $result['js'] = $res[1];
+ }
+ } catch (Horde_Exception $e) {}
} elseif (!$preview && !empty($GLOBALS['conf']['dimp']['hooks']['messageview'])) {
- $result = Horde::callHook('_imp_hook_dimp_messageview', array($result), 'imp');
+ try {
+ $result = Horde::callHook('_imp_hook_dimp_messageview', array($result), 'imp');
+ } catch (Horde_Exception $e) {}
}
if (!$preview) {
/* Allow user to alter template array. */
if (!empty($GLOBALS['conf']['imp']['hooks']['mailboxarray'])) {
- $msgs = Horde::callHook('_imp_hook_mailboxarray', array($msgs, 'imp'), 'imp');
+ try {
+ $msgs = Horde::callHook('_imp_hook_mailboxarray', array($msgs, 'imp'), 'imp');
+ } catch (Horde_Exception $e) {}
}
if (!isset($template)) {
$a_template->set('whitelist', Horde::widget('#', _("Whitelist"), 'widget whitelistAction', '', '', _("_Whitelist")));
}
- if (empty($conf['hooks']['disable_compose']) || !Horde::callHook('_imp_hook_disable_compose', array(), 'imp')) {
+ if (IMP::canCompose()) {
$a_template->set('forward', Horde::widget('#', _("Forward"), 'widget forwardAction', '', '', _("Fo_rward")));
}
/* Get all the flag information. */
if (!empty($GLOBALS['conf']['hooks']['msglist_flags'])) {
- $flags = Horde::callHook('_imp_hook_msglist_flags', array($ob, 'imp'), 'imp');
- if (!is_a($flags, 'PEAR_Error')) {
- $ob['flags'] = array_merge($ob['flags'], $flags);
- }
+ try {
+ $ob['flags'] = array_merge($ob['flags'], Horde::callHook('_imp_hook_msglist_flags', array($ob, 'imp'), 'imp'));
+ } catch (Horde_Exception $e) {}
}
$flag_parse = $imp_flags->parse(array(
}
/* Determine if compose mode is disabled. */
-$disable_compose = !empty($conf['hooks']['disable_compose']) &&
- !Horde::callHook('_imp_hook_disable_compose', array(), 'imp');
+$disable_compose = !IMP::canCompose();
if (!$disable_compose) {
$compose_args = array(
);
/* Add compose actions (Reply, Reply List, Reply All, Forward, Redirect). */
-if (empty($conf['hooks']['disable_compose']) ||
- !Horde::callHook('_imp_hook_disable_compose', array(), 'imp')) {
+if (IMP::canCompose()) {
$items = array(IMP::composeLink(array(), array('a' => 'r') + $compose_params) => _("Reply"));
if ($list_info['reply_list']) {
}
}
- $disable_compose = !empty($conf['hooks']['disable_compose']) &&
- Horde::callHook('_imp_hook_disable_compose', array(), 'imp');
+ $disable_compose = !IMP::canCompose();
if (!$disable_compose) {
$a_template->set('reply', Horde::widget(IMP::composeLink(array(), array('actionID' => 'reply') + $compose_params), _("Reply"), 'widget hasmenu', '', '', _("_Reply"), true));
$save_attach = $GLOBALS['prefs']->getValue('save_attachments');
/* Determine if compose mode is disabled. */
-$compose_disable = !empty($GLOBALS['conf']['hooks']['disable_compose']) &&
- Horde::callHook('_imp_hook_disable_compose', array(), 'imp');
+$compose_disable = !IMP::canCompose();
// Small utility function to simplify creating dimpactions buttons.
// As of right now, we don't show text only links.
'base_mbox' => IMP_Imap_Tree::BASE_ELT,
'buffer_pages' => intval($GLOBALS['conf']['dimp']['viewport']['buffer_pages']),
'debug' => intval(!empty($GLOBALS['conf']['dimp']['js']['debug'])),
- 'disable_compose' => intval(!empty($GLOBALS['conf']['hooks']['disable_compose']) && Horde::callHook('_imp_hook_disable_compose', array(), 'imp')),
+ 'disable_compose' => !IMP::canCompose(),
'filter_any' => intval($GLOBALS['prefs']->getValue('filter_any_mailbox')),
'fixed_folders' => empty($GLOBALS['conf']['server']['fixed_folders'])
? array()
case 'rule_copy':
if (!Ingo::hasPermission('allow_rules')) {
- $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, Horde_Nls::getCharset());
- if (!empty($conf['hooks']['permsdenied'])) {
- $message = Horde::callHook('_perms_hook_denied', array('ingo:allow_rules'), 'horde', $message);
+ try {
+ if (!empty($conf['hooks']['permsdenied'])) {
+ Horde::callHook('_perms_hook_denied', array('ingo:allow_rules'), 'horde', $message);
+ }
+ $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, Horde_Nls::getCharset());
+ } catch (Horde_Exception $e) {
+ $message = $e->getMessage();
}
$notification->push($message, 'horde.error', array('content.raw'));
break 2;
} elseif (Ingo::hasPermission('max_rules') !== true &&
Ingo::hasPermission('max_rules') <= count($filters->getFilterList())) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), Ingo::hasPermission('max_rules')), ENT_COMPAT, Horde_Nls::getCharset());
- if (!empty($conf['hooks']['permsdenied'])) {
- $message = Horde::callHook('_perms_hook_denied', array('ingo:max_rules'), 'horde', $message);
+ try {
+ if (!empty($conf['hooks']['permsdenied'])) {
+ Horde::callHook('_perms_hook_denied', array('ingo:max_rules'), 'horde', $message);
+ }
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), Ingo::hasPermission('max_rules')), ENT_COMPAT, Horde_Nls::getCharset());
+ } catch (Horde_Exception $e) {
+ $message = $e->getMessage();
}
$notification->push($message, 'horde.error', array('content.raw'));
break 2;
return $this->_addr;
}
- $addresses = Horde::callHook('_ingo_hook_vacation_addresses', array(Ingo::getUser()), 'ingo');
- if (is_a($addresses, 'PEAR_Error')) {
- $addresses = array();
+ try {
+ return Horde::callHook('_ingo_hook_vacation_addresses', array(Ingo::getUser()), 'ingo');
+ } catch (Horde_Exception $e) {
+ return array();
}
- return $addresses;
}
public function getVacationDays()
/* Check rule permissions. */
if (!Ingo::hasPermission('allow_rules')) {
- $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, Horde_Nls::getCharset());
- if (!empty($conf['hooks']['permsdenied'])) {
- $message = Horde::callHook('_perms_hook_denied', array('ingo:allow_rules'), 'horde', $message);
+ try {
+ if (!empty($conf['hooks']['permsdenied'])) {
+ Horde::callHook('_perms_hook_denied', array('ingo:allow_rules'), 'horde');
+ }
+ $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, Horde_Nls::getCharset());
+ } catch (Horde_Exception $e) {
+ $message = $e->getMessage();
}
$notification->push($message, 'horde.error', array('content.raw'));
header('Location: ' . Horde::applicationUrl('filters.php', true));
if (is_null($edit_number)) {
if (Ingo::hasPermission('max_rules') !== true &&
Ingo::hasPermission('max_rules') <= count($filters->getFilterList())) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), Ingo::hasPermission('max_rules')), ENT_COMPAT, Horde_Nls::getCharset());
- if (!empty($conf['hooks']['permsdenied'])) {
- $message = Horde::callHook('_perms_hook_denied', array('ingo:max_rules'), 'horde', $message);
+ try {
+ if (!empty($conf['hooks']['permsdenied'])) {
+ Horde::callHook('_perms_hook_denied', array('ingo:max_rules'), 'horde');
+ }
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), Ingo::hasPermission('max_rules')), ENT_COMPAT, Horde_Nls::getCharset());
+ } catch (Horde_Exception $e) {
+ $message = $e->getMessage();
}
$notification->push($message, 'horde.error', array('content.raw'));
header('Location: ' . Horde::applicationUrl('filters.php', true));
if ($pos !== false) {
$user = substr($user, 0, $pos);
}
- $user = Horde::callHook('_ingo_hook_smtpd_access_policy_username', $query, 'ingo', $user);
+
+ try {
+ $user = Horde::callHook('_ingo_hook_smtpd_access_policy_username', $query, 'ingo');
+ } catch (Horde_Exception $e) {}
// Get $user's rules if we don't have them already.
if (!isset($whitelists[$user])) {
);
if (Kronolith::hasPermission('max_events') !== true &&
Kronolith::hasPermission('max_events') <= Kronolith::countEvents()) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
- if (!empty($conf['hooks']['permsdenied'])) {
- $message = Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde', $message);
+ try {
+ if (!empty($conf['hooks']['permsdenied'])) {
+ Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde');
+ }
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
+ } catch (Horde_Exception $e) {
+ $message = $e->getMessage();
}
$notification->push($message, 'horde.warning', array('content.raw'));
$templates[Horde_Data::IMPORT_FILE] = array(KRONOLITH_TEMPLATES . '/data/export.inc');
foreach ($next_step as $row) {
if ($max_events !== true && $num_events >= $max_events) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
- if (!empty($conf['hooks']['permsdenied'])) {
- $message = Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde', $message);
+ try {
+ if (!empty($conf['hooks']['permsdenied'])) {
+ Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde');
+ }
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
+ } catch (Horde_Exception $e) {
+ $message = $e->getMessage();
}
$notification->push($message, 'horde.error', array('content.raw'));
break;
{
if (Kronolith::hasPermission('max_events') !== true &&
Kronolith::hasPermission('max_events') <= Kronolith::countEvents()) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
- if (!empty($GLOBALS['conf']['hooks']['permsdenied'])) {
- $message = Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde', $message);
+ try {
+ if (!empty($GLOBALS['conf']['hooks']['permsdenied'])) {
+ Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde');
+ }
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
+ } catch (Horde_Exception $e) {
+ $message = $e->getMessage();
}
$GLOBALS['notification']->push($message, 'horde.error', array('content.raw'));
return false;
/* Check permissions. */
if (Kronolith::hasPermission('max_events') !== true &&
Kronolith::hasPermission('max_events') <= Kronolith::countEvents()) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
- if (!empty($conf['hooks']['permsdenied'])) {
- $message = Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde', $message);
+ try {
+ if (!empty($conf['hooks']['permsdenied'])) {
+ Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde');
+ }
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
+ } catch (Horde_Exception $e) {
+ $message = $e->getMessage();
}
$notification->push($message, 'horde.error', array('content.raw'));
$url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php', array('month' => Horde_Util::getFormData('month'),