return $addrinfo;
}
}
- return PEAR::raiseError(sprintf(_("No such address %s of type %s found."), $address, $type));
+ throw new Vilma_Exception(sprintf(_("No such address %s of type %s found."), $address, $type));
}
/**
escapeshellarg($info['password']));
$msg = system($cmd, $ec);
if ($msg === false) {
- return PEAR::raiseError(_("Error running authentication update script."));
+ throw new Vilma_Exception(_("Error running authentication update script."));
}
if ($ec != 0) {
if (empty($msg)) {
$msg = _("Unknown error running authentication update script.");
}
- return PEAR::raiseError($msg);
+ throw new Vilma_Exception($msg);
}
}
function deleteUser($user_id)
{
- return PEAR::raiseError(_("Vilma_Driver::deleteUser(): Method Not Implemented."));
+ throw new Vilma_Exception(_("Vilma_Driver::deleteUser(): Method Not Implemented."));
}
/**
$ret = Horde::callHook('_vilma_hook_savedomain', array($info), 'vilma');
if (!$ret) {
- return PEAR::raiseError(_("Domain added but an error was encountered while calling the configured hook. Contact your administrator for futher assistance."));
+ throw new Vilma_Exception(_("Domain added but an error was encountered while calling the configured hook. Contact your administrator for futher assistance."));
}
return $domain_id;
*/
function _saveDomain(&$info)
{
- return PEAR::raiseError(_("Not implemented."));
+ throw new Vilma_Exception(_("Not implemented."));
}
/**
array($domain_record['domain_name']),
'vilma');
if (!$ret) {
- return PEAR::raiseError(_("Error while calling hook to delete domain."));
+ throw new Vilma_Exception(_("Error while calling hook to delete domain."));
}
}
*/
function _deleteDomain($domain_id)
{
- return PEAR::raiseError(_("Not implemented."));
+ throw new Vilma_Exception(_("Not implemented."));
}
/**
--- /dev/null
+class Vilma_Exception extends Horde_Exception {}
\ No newline at end of file
}
if (!$this->_imapAdmin->mailboxExists($user . '@' . $domain)) {
- return PEAR::raiseError(sprintf(_("Mailbox '%s@%s' does not exist."), $user, $domain));
+ throw new Vilma_Exception(sprintf(_("Mailbox '%s@%s' does not exist."), $user, $domain));
}
}
{
if (empty($this->_params['mail_dir_base'])) {
require_once 'PEAR.php';
- return PEAR::raiseError(_("No 'mail_dir_base' parameter specified to maildrop driver."));
+ throw new Vilma_Exception(_("No 'mail_dir_base' parameter specified to maildrop driver."));
}
$dir = $this->_params['mail_dir_base'];
$usedomain = isset($this->_params['usedomain']) ? $this->_params['usedomain'] : false;
if (!$exists[$dir]) {
require_once 'PEAR.php';
- return PEAR::raiseError(sprintf(_("Maildrop directory \"%s\" does not exist."), $dir));
+ throw new Vilma_Exception(sprintf(_("Maildrop directory \"%s\" does not exist."), $dir));
}
return true;
}
if (empty($this->_params['system_user'])) {
require_once 'PEAR.php';
- return PEAR::raiseError(_("No 'system_user' parameter specified to maildrop driver."));
+ throw new Vilma_Exception(_("No 'system_user' parameter specified to maildrop driver."));
}
$create_function = sprintf('sudo -u %s maildirmake %s',
/*
if (empty($this->_params['mail_dir_base'])) {
require_once 'PEAR.php';
- return PEAR::raiseError(_("No 'mail_dir_base' parameter specified to maildrop driver."));
+ throw new Vilma_Exception(_("No 'mail_dir_base' parameter specified to maildrop driver."));
}
$dir = $this->_params['mail_dir_base'];
$usedomain = isset($this->_params['usedomain']) ? $this->_params['usedomain'] : false;
if (!$exists[$dir]) {
require_once 'PEAR.php';
- return PEAR::raiseError(sprintf(_("Maildrop directory \"%s\" does not exist."), $dir));
+ throw new Vilma_Exception(sprintf(_("Maildrop directory \"%s\" does not exist."), $dir));
}
*/
}
if (empty($this->_params['system_user'])) {
require_once 'PEAR.php';
- return PEAR::raiseError(_("No 'system_user' parameter specified to maildrop driver."));
+ throw new Vilma_Exception(_("No 'system_user' parameter specified to maildrop driver."));
}
$create_function = sprintf('sudo -u %s maildirmake %s',