0013296: only show "Computers" if manageSAM is configured
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 3 Jul 2017 13:15:24 +0000 (15:15 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 3 Jul 2017 14:27:14 +0000 (16:27 +0200)
!usermanual

https://forge.tine20.org/view.php?id=13296

Change-Id: I732205f1d822162dc0d3c3da91f080511c82743f
Reviewed-on: http://gerrit.tine20.com/customers/4995
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Admin/Controller/SambaMachine.php
tine20/Admin/Frontend/Json.php
tine20/Admin/js/Admin.js

index 349ed01..5e90c4f 100644 (file)
@@ -60,7 +60,7 @@ class Admin_Controller_SambaMachine extends Tinebase_Controller_Abstract impleme
         if (!Tinebase_Core::getConfig()->samba) {
             throw new Admin_Exception('No samba settings defined in config.');
         }
-        if(Tinebase_User::getConfiguredBackend() != Tinebase_User::LDAP) {
+        if (Tinebase_User::getConfiguredBackend() != Tinebase_User::LDAP) {
             throw new Admin_Exception('Works only with LDAP user backend.');
         }
         
index 3f90e22..32a42bd 100644 (file)
@@ -53,11 +53,7 @@ class Admin_Frontend_Json extends Tinebase_Frontend_Json_Abstract
         if (isset(Tinebase_Core::getConfig()->samba)) {
             $this->_manageSAM = Tinebase_Core::getConfig()->samba->get('manageSAM', false);
         }
-        
-        if (Tinebase_User::getConfiguredBackend() == Tinebase_User::ACTIVEDIRECTORY) {
-           $this->_manageSAM = array(); 
-        }
-        
+
         // manage email user settings
         if (Tinebase_EmailUser::manages(Tinebase_Config::IMAP)) {
             $this->_manageImapEmailUser = TRUE;
index 2762333..1e070df 100644 (file)
@@ -68,7 +68,8 @@ Tine.Admin = function () {
             children: [],
             leaf: null,
             expanded: true,
-            dataPanelType: 'computers', 
+            dataPanelType: 'computers',
+            hidden: ! Tine.Admin.registry.get('manageSAM'),
             viewRight: 'computers'
         }, {
             text: translation.gettext('Applications'),