Skip to content

Commit

Permalink
Fix fatal errors if activesync configuration is incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jul 17, 2014
1 parent f8d1ef3 commit d481ffc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions horde/admin/activesync.php
Expand Up @@ -18,10 +18,12 @@
'permission' => array('horde:administration:activesync')
));

if (empty($conf['activesync']['enabled'])) {
try {
$state = $injector->getInstance('Horde_ActiveSyncState');
} catch (Horde_Exception $e) {
throw new Horde_Exception_PermissionDenied(_("ActiveSync not activated."));
}
$state = $injector->getInstance('Horde_ActiveSyncState');

$state->setLogger($injector->getInstance('Horde_Log_Logger'));

/** Check for any actions **/
Expand Down
8 changes: 5 additions & 3 deletions horde/lib/Prefs/Special/Activesync.php
Expand Up @@ -24,12 +24,14 @@ public function init(Horde_Core_Prefs_Ui $ui)
*/
public function display(Horde_Core_Prefs_Ui $ui)
{
global $conf, $injector, $page_output, $prefs, $registry;
global $injector, $page_output, $prefs, $registry;

if (empty($conf['activesync']['enabled'])) {
try {
$state = $injector->getInstance('Horde_ActiveSyncState');
} catch (Horde_Exception $e) {
return _("ActiveSync not activated.");
}
$state = $injector->getInstance('Horde_ActiveSyncState');

$devices = $state->listDevices($registry->getAuth());

$view = new Horde_View(array(
Expand Down

0 comments on commit d481ffc

Please sign in to comment.