Skip to content

Commit

Permalink
Don't show new address book link if we can't create one.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jun 1, 2015
1 parent f997432 commit e491822
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion turba/lib/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ public function menu($menu)
*/
public function sidebar($sidebar)
{
global $conf, $cfgSources;

if (count($GLOBALS['addSources'])) {
$sidebar->addNewButton(_("_New Contact"), Horde::url('add.php'));
}
Expand All @@ -231,7 +233,9 @@ public function sidebar($sidebar)
),
);
if ($GLOBALS['registry']->getAuth() &&
$GLOBALS['session']->get('turba', 'has_share')) {
$GLOBALS['session']->get('turba', 'has_share') &&
!empty($conf['shares']['source']) &&
!empty($cfgSources[$conf['shares']['source']])) {
$sidebar->containers['my']['header']['add'] = array(
'url' => Horde::url('addressbooks/create.php'),
'label' => _("Create a new Address Book"),
Expand Down

0 comments on commit e491822

Please sign in to comment.