only show pin protection checkbox if second factor is active
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 27 Jul 2017 13:02:33 +0000 (15:02 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 27 Jul 2017 12:58:45 +0000 (14:58 +0200)
Change-Id: I894912a69fdd4b8f99ed2115065d521388365ead
Reviewed-on: http://gerrit.tine20.com/customers/5343
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Filemanager/js/GrantsPanel.js
tine20/Tinebase/Frontend/Json.php
tine20/Tinebase/js/LoginPanel.js

index cc32b02..4576c86 100644 (file)
@@ -45,9 +45,8 @@ Tine.Filemanager.GrantsPanel = Ext.extend(Ext.Panel, {
         });
         this.pinProtectionCheckbox = new Ext.form.Checkbox({
             disabled: true,
+            hidden: ! Tine.Tinebase.registry.get('secondFactor'),
             boxLabel: this.app.i18n._('This folder is pin protected')
-            // TODO needed?
-            //listeners: {scope: this, check: this.onPinProtectionCheck}
         });
         this.pinProtectionDescription = new Ext.form.Label({
             text: this.app.i18n._("If pin protection is enabled, users have to authenticate with their pin before they can access the folder contents.")
index 563e58b..e46e216 100644 (file)
@@ -787,8 +787,9 @@ class Tinebase_Frontend_Json extends Tinebase_Frontend_Json_Abstract
 
             // secondfactor config
             // TODO pass sf config as array (but don't send everything to client)
-            'secondFactor'     => $secondFactorConfig && $secondFactorConfig->active && $secondFactorConfig->login,
-            'secondFactorSessionLifetime'  => $secondFactorConfig && $secondFactorConfig->sessionLifetime
+            'secondFactor' => $secondFactorConfig && $secondFactorConfig->active,
+            'secondFactorLogin' => $secondFactorConfig && $secondFactorConfig->active && $secondFactorConfig->login,
+            'secondFactorSessionLifetime' => $secondFactorConfig && $secondFactorConfig->sessionLifetime
                 ? $secondFactorConfig->sessionLifetime
                 : 15,
             'secondFactorPinChangeAllowed' => $secondFactorConfig
index c184d6b..148720f 100644 (file)
@@ -64,7 +64,7 @@ Tine.Tinebase.LoginPanel = Ext.extend(Ext.Panel, {
     getLoginPanel: function () {
         //Do we have a cutom Logo for branding?
         var modSsl = Tine.Tinebase.registry.get('modSsl'),
-            secondFactor = Tine.Tinebase.registry.get('secondFactor'),
+            secondFactor = Tine.Tinebase.registry.get('secondFactorLogin'),
             logo = this.loginLogo ? this.loginLogo : Tine.logo;
         
         if (! this.loginPanel) {