To find the state of this project's repository at the time of any of these versions, check out the tags.
class_configInLdap.inc 21.08 KiB
<?php
/*
  This code is part of FusionDirectory (http://www.fusiondirectory.org/)
  Copyright (C) 2012-2016 FusionDirectory
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
/* Debug level is an OR combination of several values */
class DebugLevelAttribute extends SetAttribute
  protected function loadAttrValue (array $attrs)
    if (isset($attrs[$this->getLdapName()])) {
      $value = $attrs[$this->getLdapName()][0];
      $this->value = array();
      foreach ($this->attribute->getChoices() as $choice) {
        if ($value & $choice) {
          $this->value[] = $choice;
    } else {
      $this->resetToDefault();
  function computeLdapValue()
    $value = 0;
    foreach ($this->value as $v) {
      $value |= $v;
    return $value;
class configInLdap extends simplePlugin
  static function plInfo()
    return array(
      'plShortName'     => _('Configuration'),
      'plTitle'         => _('FusionDirectory configuration'),
      'plDescription'   => _('Configuration screen of FusionDirectory'),
      'plIcon'          => 'geticon.php?context=categories&icon=settings&size=48',
      'plObjectClass'   => array('fusionDirectoryConf'),
      'plObjectType'    => array(
        'configuration' => array(
          'name'      => _('FusionDirectory configuration'),
          'filter'    => 'objectClass=fusionDirectoryConf',
          'tabClass'  => 'tabs_configInLdap',
          'icon'      => 'geticon.php?context=categories&icon=settings&size=16',
          'mainAttr'  => FALSE,
          'ou'        => preg_replace('/^[^,]+,/', '', CONFIGRDN)
      'plSection'       => array('conf' => array('name' => _('Configuration'), 'priority' => 20)),
      'plManages'       => array('configuration'),
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
'plPriority' => 0, 'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo()) ); } static function getAttributesInfo () { global $config; $plugins = array(); if (session::global_is_set('plist')) { $plugins = array_keys(session::global_get('plist')->info); } sort($plugins); return array( 'look_n_feel' => array( 'name' => _('Look and feel'), 'attrs' => array( new SelectAttribute ( _('Language'), _('Language of the application. If \'automatic\' or not available, the one asked by the browser will be used. This setting can be overriden per user.'), 'fdLanguage', FALSE, array('') ), new SelectAttribute ( _('Theme'), _('Theme to be used'), 'fdTheme', TRUE, static::get_themes(), 'breezy' ), new SelectAttribute ( _('Timezone'), _('Timezone to be used'), 'fdTimezone', TRUE, array('America/New_York') ), new HiddenAttribute ('fusionConfigMd5'), ) ), 'core_settings' => array( 'name' => _('Core settings'), 'attrs' => array( new IntAttribute ( _('LDAP size limit'), _('Defines the number of entries to get from LDAP by default.'), 'fdLdapSizeLimit', FALSE, 0 /*min*/, FALSE /*no max*/, 200 ), new SelectAttribute ( _('Edit locking'), _('Check if a entry currently being edited has been modified outside of FusionDirectory in the meantime.'), 'fdModificationDetectionAttribute', FALSE, array('', 'entryCSN', 'contextCSN'), 'entryCSN' ), new BooleanAttribute ( _('Enable logging'), _('Event logging on FusionDirectory side.'), 'fdLogging', FALSE, TRUE ), new BooleanAttribute ( _('Schema validation'), _('Enables schema checking during login.'), 'fdSchemaCheck', FALSE, TRUE ), new BooleanAttribute ( _('Enable snapshots'), _('This enables you to save certain states of entries and restore them later on.'), 'fdEnableSnapshots', FALSE, TRUE ), new StringAttribute ( _('Snapshot base'), _('The base where snapshots should be stored inside of the LDAP.'),
141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
'fdSnapshotBase', FALSE, 'ou=snapshots,'.$config->current['BASE'] ), new BooleanAttribute ( _('Wildcard foreign keys'), _('Enables wildcard searches like member=* when moving a whole departement. This will open all existing groups and roles to make sure foreign keys are respected. Slow on big trees.'), 'fdWildcardForeignKeys', FALSE, TRUE ), ) ), 'password' => array( 'name' => _('Password settings'), 'attrs' => array( new SelectAttribute ( _('Password default hash'), _('Default hash to be used'), 'fdPasswordDefaultHash', TRUE, array('ssha') ), new BooleanAttribute ( _('Force default hash'), _('Force the use of the default password hash'), 'fdForcePasswordDefaultHash' ), new IntAttribute ( _('Password minimum length'), _('Minimum length of user passwords'), 'fdPasswordMinLength', FALSE, 0 /*min*/, FALSE /*no max*/ ), new IntAttribute ( _('Password minimum differs'), _('Minimum number of different characters from last password'), 'fdPasswordMinDiffer', FALSE, 0 /*min*/, FALSE /*no max*/ ), new BooleanAttribute ( _('Use account expiration'), _('Enables shadow attribute tests during the login to FusionDirectory and forces password renewal or account locking'), 'fdHandleExpiredAccounts' ), new StringAttribute ( _('SASL Realm'), _('SASL Realm'), 'fdSaslRealm' ), new StringAttribute ( _('SASL Exop'), _('Attribute to be stored in the userPassword attribute'), 'fdSaslExop' ), ) ), 'login' => array( 'name' => _('Login and session'), 'attrs' => array( new SelectAttribute ( _('Login attribute'), _('Which LDAP attribute should be used as the login name during login.'), 'fdLoginAttribute', TRUE, array('uid', 'mail', 'uid,mail'), 'uid', array('uid', 'mail', 'both') ), new BooleanAttribute ( _('Enforce encrypted connections'), _('Enables PHP security checks to force encrypted access (https) to the web interface.'), 'fdForceSSL' ), new BooleanAttribute ( _('Warn if session is not encrypted'), _('will display a warning to the user when http is used instead of https.'), 'fdWarnSSL', FALSE, TRUE ), new IntAttribute ( _('Session lifetime'), _('Defines when a session will expire in seconds (0 to disable).'),