From: Ben Klang Date: Tue, 26 Jan 2010 16:24:50 +0000 (-0500) Subject: Shout: move the caller ID defaulting out of the driver X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=dcdf4d92dbabe6452aa8b9c554d2e0aace164776;p=horde.git Shout: move the caller ID defaulting out of the driver --- diff --git a/shout/lib/Driver/Sql.php b/shout/lib/Driver/Sql.php index a5f5f2f76..2f5f8292a 100644 --- a/shout/lib/Driver/Sql.php +++ b/shout/lib/Driver/Sql.php @@ -152,11 +152,6 @@ class Shout_Driver_Sql extends Shout_Driver $details['alias'] = $details['name']; $details['name'] = $details['devid']; unset($details['devid']); - // Default the caller id to something sane. - if (empty($details['callerid'])) { - $details['callerid'] = sprintf('"%s" <%s>', $details['alias'], - $details['mailbox']); - } $details['mailbox'] .= '@' . $context; // Prepare the SQL query and arguments diff --git a/shout/lib/Forms/DeviceForm.php b/shout/lib/Forms/DeviceForm.php index 11d1307ea..c8d4a04a6 100644 --- a/shout/lib/Forms/DeviceForm.php +++ b/shout/lib/Forms/DeviceForm.php @@ -69,11 +69,20 @@ class DeviceDetailsForm extends Horde_Form { } } + $callerid = $this->_vars->get('callerid'); + $name = $this->_vars->get('name'); + $mailbox = $this->_vars->get('mailbox'); + + // Default the caller id to something sane. + if ($callerid) { + $callerid = sprintf('"%s" <%s>', $name, $mailbox); + } + $details = array( 'devid' => $devid, 'name' => $this->_vars->get('name'), - 'mailbox' => $this->_vars->get('mailbox'), - 'callerid' => $this->_vars->get('callerid'), + 'mailbox' => $mailbox, + 'callerid' => $callerid, 'genauthtok' => $this->_vars->get('genauthtok'), 'password' => $password, );