#8936: useStartTls and SSHA option is not available
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 7 Oct 2013 13:35:05 +0000 (15:35 +0200)
committerLars Kneschke <l.kneschke@metaways.de>
Tue, 8 Oct 2013 08:32:36 +0000 (10:32 +0200)
... in setup.php for ldap

- added options to setup.php
- fixed AD / LDAP accounts options (card layout)
- added strtoupper for SSL option (cyrus email backend)

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

Change-Id: I39e31b68921c9c3231b5bf07a9b45b9819c3716c
Reviewed-on: https://gerrit.tine20.org/tine20/2392
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
Reviewed-by: Lars Kneschke <l.kneschke@metaways.de>
tine20/Setup/js/AuthenticationPanel.js
tine20/Tinebase/EmailUser/Imap/Cyrus.php

index 7865cb3..c26227f 100644 (file)
@@ -186,7 +186,7 @@ Tine.Setup.AuthenticationPanel = Ext.extend(Tine.Tinebase.widgets.form.ConfigPan
      */
     getFormItems: function () {
         var setupRequired = Tine.Setup.registry.get('setupRequired');
-                
+        
         // common config for all combos in this setup
         var commonComboConfig = {
             xtype: 'combo',
@@ -322,12 +322,18 @@ Tine.Setup.AuthenticationPanel = Ext.extend(Tine.Tinebase.widgets.form.ConfigPan
                             name: 'authentication_Ldap_password',
                             fieldLabel: this.app.i18n._('Password'),
                             inputType: 'password'
-                        }, 
+                        },
                         Ext.applyIf({
                             name: 'authentication_Ldap_bindRequiresDn',
                             fieldLabel: this.app.i18n._('Bind requires DN'),
                             store: [['1', this.app.i18n._('Yes')], ['0', this.app.i18n._('No')]],
                             value: '1'
+                        }, commonComboConfig),
+                        Ext.applyIf({
+                            name: 'authentication_Ldap_useStartTls',
+                            fieldLabel: this.app.i18n._('Start TLS'),
+                            store: [[['0', this.app.i18n._('No'), '1', this.app.i18n._('Yes')]]],
+                            value: '0'
                         }, commonComboConfig), 
                         {
                             name: 'authentication_Ldap_baseDn',
@@ -376,45 +382,6 @@ Tine.Setup.AuthenticationPanel = Ext.extend(Tine.Tinebase.widgets.form.ConfigPan
                             name: 'authentication_Imap_domain',
                             fieldLabel: this.app.i18n._('Append domain to login name')
                         }
-    //                    {
-    //                        inputType: 'text',
-    //                        xtype: 'combo',
-    //                        width: 300,
-    //                        listWidth: 300,
-    //                        mode: 'local',
-    //                        forceSelection: true,
-    //                        allowEmpty: false,
-    //                        triggerAction: 'all',
-    //                        selectOnFocus:true,
-    //                        store: [['1', 'Yes'], ['0','No']],
-    //                        name: 'authentication_Sql_tryUsernameSplit',
-    //                        fieldLabel: this.app.i18n._('Try to split username'),
-    //                        value: '1'
-    //                    }, {
-    //                        inputType: 'text',
-    //                        xtype: 'combo',
-    //                        width: 300,
-    //                        listWidth: 300,
-    //                        mode: 'local',
-    //                        forceSelection: true,
-    //                        allowEmpty: false,
-    //                        triggerAction: 'all',
-    //                        selectOnFocus:true,
-    //                        store: [['2', 'ACCTNAME_FORM_USERNAME'], ['3','ACCTNAME_FORM_BACKSLASH'], ['4','ACCTNAME_FORM_PRINCIPAL']],
-    //                        name: 'authentication_Sql_accountCanonicalForm',
-    //                        fieldLabel: this.app.i18n._('Account canonical form'),
-    //                        value: '2'
-    //                    }, {
-    //                        name: 'authentication_Sql_accountDomainName',
-    //                        fieldLabel: this.app.i18n._('Account domain name '),
-    //                        inputType: 'text',
-    //                        tabIndex: 7
-    //                    }, {
-    //                        name: 'authentication_Sql_accountDomainNameShort',
-    //                        fieldLabel: this.app.i18n._('Account domain short name'),
-    //                        inputType: 'text',
-    //                        tabIndex: 8
-    //                    } 
                         ]
                     }]
                 }
@@ -446,16 +413,15 @@ Tine.Setup.AuthenticationPanel = Ext.extend(Tine.Tinebase.widgets.form.ConfigPan
                         items: [{
                             name: 'accounts_Sql_defaultUserGroupName',
                             fieldLabel: this.app.i18n._('Default user group name')
-                            //allowEmpty: false
                         }, {
                             name: 'accounts_Sql_defaultAdminGroupName',
                             fieldLabel: this.app.i18n._('Default admin group name')
-                            //allowEmpty: false
                         }]
-                    }]
-                },
-                this.getDirectoryOptions('Ldap', commonComboConfig),
-                this.getDirectoryOptions('ActiveDirectory', commonComboConfig)
+                    },
+                        this.getDirectoryOptions('Ldap', commonComboConfig),
+                        this.getDirectoryOptions('ActiveDirectory', commonComboConfig)
+                    ]
+                }
             ]
           }, {
             xtype: 'fieldset',
@@ -600,6 +566,29 @@ Tine.Setup.AuthenticationPanel = Ext.extend(Tine.Tinebase.widgets.form.ConfigPan
                 fieldLabel: this.app.i18n._('Bind requires DN'),
                 store: [['1', this.app.i18n._('Yes')], ['0', this.app.i18n._('No')]],
                 value: '1'
+            }, commonComboConfig),
+            Ext.applyIf({
+                name: 'accounts_' + type + 'useStartTls',
+                fieldLabel: this.app.i18n._('Start TLS'),
+                store: [[['0', this.app.i18n._('No'), '1', this.app.i18n._('Yes')]]],
+                value: '0'
+            }, commonComboConfig),
+            Ext.applyIf({
+                name: 'accounts_' + type + '_pwEncType',
+                fieldLabel: this.app.i18n._('Password encryption type'),
+                store: [
+                    ['des', this.app.i18n._('des')],
+                    ['blowfish_crypt', this.app.i18n._('blowfish_crypt')],
+                    ['md5_crypt', this.app.i18n._('md5_crypt')],
+                    ['ext_crypt', this.app.i18n._('ext_crypt')],
+                    ['md5', this.app.i18n._('md5')],
+                    ['smd5', this.app.i18n._('smd5')],
+                    ['sha', this.app.i18n._('sha')],
+                    ['ssha', this.app.i18n._('ssha')],
+                    ['ntpassword', this.app.i18n._('ntpassword')],
+                    ['plain', this.app.i18n._('plain')]
+                ],
+                value: 'ssha'
             }, commonComboConfig), 
             {
                 name: 'accounts_' + type + '_userDn',
index d83743e..3115ea1 100644 (file)
@@ -56,7 +56,7 @@ class Tinebase_EmailUser_Imap_Cyrus extends Tinebase_User_Plugin_Abstract
         $this->_config['domain'] = !empty($imapConfig['domain']) ? $imapConfig['domain'] : null;
         $this->_config['host']   = $imapConfig['host'];
         $this->_config['port']   = !empty($imapConfig['port']) ? $imapConfig['port'] : 143;
-        $this->_config['ssl']    = $imapConfig['ssl'] != 'none' ? $imapConfig['ssl'] : false;
+        $this->_config['ssl']    = $imapConfig['ssl'] != 'none' ? strtoupper($imapConfig['ssl']) : false;
         
         if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ 
             . ' cyrus imap config: ' . print_r($this->_config, true));