Commit c011c829 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #5272 Add ability to select the default shell

Showing with 28 additions and 6 deletions
+28 -6
...@@ -394,7 +394,7 @@ attributetype ( 1.3.6.1.4.1.38414.8.18.2 NAME 'fdTabHook' ...@@ -394,7 +394,7 @@ attributetype ( 1.3.6.1.4.1.38414.8.18.2 NAME 'fdTabHook'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.38414.8.18.3 NAME 'fdShells' attributetype ( 1.3.6.1.4.1.38414.8.18.3 NAME 'fdShells'
DESC 'FusionDirectory - available shell' DESC 'FusionDirectory - available shells'
EQUALITY caseExactIA5Match EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
...@@ -423,6 +423,13 @@ attributetype ( 1.3.6.1.4.1.38414.8.18.7 NAME 'fdDepartmentCategories' ...@@ -423,6 +423,13 @@ attributetype ( 1.3.6.1.4.1.38414.8.18.7 NAME 'fdDepartmentCategories'
SUBSTR caseExactIA5SubstringsMatch SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.38414.8.18.8 NAME 'fdDefaultShell'
DESC 'FusionDirectory - default shell'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE)
# Plugins # Plugins
attributetype ( 1.3.6.1.4.1.38414.8.19.1 NAME 'fdOGroupRDN' attributetype ( 1.3.6.1.4.1.38414.8.19.1 NAME 'fdOGroupRDN'
...@@ -597,7 +604,7 @@ objectclass ( 1.3.6.1.4.1.38414.8.2.1 NAME 'fusionDirectoryConf' ...@@ -597,7 +604,7 @@ objectclass ( 1.3.6.1.4.1.38414.8.2.1 NAME 'fusionDirectoryConf'
fdHttpAuthActivated $ fdHttpHeaderAuthActivated $ fdHttpHeaderAuthHeaderName $ fdHttpAuthActivated $ fdHttpHeaderAuthActivated $ fdHttpHeaderAuthHeaderName $
fdDisplayErrors $ fdLdapMaxQueryTime $ fdLdapStats $ fdDebugLevel $ fdDisplayErrors $ fdLdapMaxQueryTime $ fdLdapStats $ fdDebugLevel $
fdEnableSnapshots $ fdSnapshotBase $ fdEnableSnapshots $ fdSnapshotBase $
fdTabHook $ fdShells $ fdDisplayHookOutput $ fdTabHook $ fdShells $ fdDefaultShell $ fdDisplayHookOutput $
fdAclTabOnObjects $ fdDepartmentCategories $ fdAclTabOnObjects $ fdDepartmentCategories $
fdRfc2307bis $ fdCopyPaste $ fdSnapshotURI $ fdRfc2307bis $ fdCopyPaste $ fdSnapshotURI $
fdSnapshotAdminDn $ fdSnapshotAdminPassword $ fdPersonalTitleInDN $ fdAccountRDN $ fdSnapshotAdminDn $ fdSnapshotAdminPassword $ fdPersonalTitleInDN $ fdAccountRDN $
......
...@@ -27,7 +27,7 @@ class departmentManagement extends simpleManagement ...@@ -27,7 +27,7 @@ class departmentManagement extends simpleManagement
protected $departmentRootVisible = FALSE; protected $departmentRootVisible = FALSE;
protected $baseMode = TRUE; protected $baseMode = TRUE;
/* Return plugin informations for acl handling */ /* Return plugin information for acl handling */
static function plInfo() static function plInfo()
{ {
return array( return array(
......
...@@ -458,6 +458,10 @@ class configInLdap extends simplePlugin ...@@ -458,6 +458,10 @@ class configInLdap extends simplePlugin
array('/bin/ash','/bin/bash','/bin/csh','/bin/sh','/bin/ksh', array('/bin/ash','/bin/bash','/bin/csh','/bin/sh','/bin/ksh',
'/bin/tcsh','/bin/dash','/bin/zsh','/sbin/nologin', '/bin/false', '/usr/bin/git-shell') '/bin/tcsh','/bin/dash','/bin/zsh','/sbin/nologin', '/bin/false', '/usr/bin/git-shell')
), ),
new SelectAttribute (
_('Default shell'), _('Shell used by default when activating Unix tab.'),
'fdDefaultShell', TRUE
),
new BooleanAttribute ( new BooleanAttribute (
_('Show ACL tab on all objects'), _('Show ACL tab on all objects'),
_('For very specific ACL rights setting where you might need to give right on a single object.'), _('For very specific ACL rights setting where you might need to give right on a single object.'),
...@@ -499,6 +503,8 @@ class configInLdap extends simplePlugin ...@@ -499,6 +503,8 @@ class configInLdap extends simplePlugin
$this->fusionConfigMd5 = md5_file(CACHE_DIR."/".CLASS_CACHE); $this->fusionConfigMd5 = md5_file(CACHE_DIR."/".CLASS_CACHE);
$this->attributesAccess['fdDefaultShell']->setChoices($this->fdShells);
$this->attributesAccess['fdHttpAuthActivated']->setManagedAttributes( $this->attributesAccess['fdHttpAuthActivated']->setManagedAttributes(
array( array(
'erase' => array ( 'erase' => array (
...@@ -564,6 +570,12 @@ class configInLdap extends simplePlugin ...@@ -564,6 +570,12 @@ class configInLdap extends simplePlugin
return $this->dn; return $this->dn;
} }
function save_object()
{
parent::save_object();
$this->attributesAccess['fdDefaultShell']->setChoices($this->fdShells);
}
static function get_themes() static function get_themes()
{ {
$themesdir = '../ihtml/themes/'; $themesdir = '../ihtml/themes/';
......
...@@ -109,6 +109,7 @@ class posixAccount extends simplePlugin ...@@ -109,6 +109,7 @@ class posixAccount extends simplePlugin
// The main function : information about attributes // The main function : information about attributes
static function getAttributesInfo () static function getAttributesInfo ()
{ {
global $config;
return array( return array(
'main' => array( 'main' => array(
'name' => _('Unix'), 'name' => _('Unix'),
...@@ -121,7 +122,9 @@ class posixAccount extends simplePlugin ...@@ -121,7 +122,9 @@ class posixAccount extends simplePlugin
new StringAttribute('gecos', 'gecos', 'gecos'), new StringAttribute('gecos', 'gecos', 'gecos'),
new SelectAttribute( new SelectAttribute(
_('Shell'), _('Which shell should be used when this user log in'), _('Shell'), _('Which shell should be used when this user log in'),
'loginShell', TRUE 'loginShell', TRUE,
$config->get_cfg_value('Shells', array(_('unconfigured'))),
$config->get_cfg_value('DefaultShell', '')
), ),
new SelectAttribute( new SelectAttribute(
_('Primary group'), _('Primary group for this user'), _('Primary group'), _('Primary group for this user'),
...@@ -287,11 +290,11 @@ class posixAccount extends simplePlugin ...@@ -287,11 +290,11 @@ class posixAccount extends simplePlugin
} }
/* Generate shell list from config */ /* Generate shell list from config */
$loginShellList = $config->get_cfg_value('Shells', array(_('unconfigured'))); $loginShellList = $this->attributesAccess['loginShell']->getChoices();
/* Insert possibly missing loginShell */ /* Insert possibly missing loginShell */
$loginShell = $this->attributesAccess['loginShell']->getValue(); $loginShell = $this->attributesAccess['loginShell']->getValue();
if ($loginShell != "" && !in_array($loginShell, $loginShellList)) { if (($loginShell != '') && !in_array($loginShell, $loginShellList)) {
$loginShellList[] = $loginShell; $loginShellList[] = $loginShell;
} }
$this->attributesAccess['loginShell']->setChoices($loginShellList); $this->attributesAccess['loginShell']->setChoices($loginShellList);
......
  • bmortier @bmortier

    mentioned in issue #1676

    By tbp on 2017-09-02T15:34:35 (imported from GitLab)

    ·

    mentioned in issue #1676

    By tbp on 2017-09-02T15:34:35 (imported from GitLab)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment