Commit cbb9c769 authored by bmortier's avatar bmortier

Merge branch '1.0.9-fixes'

parents df2d5dc3 3a8541df
FusionDirectory changelog
=========================
* FusionDirectory 1.0.9.1
[Feature] Bugs #4136: we should remove the samba.schema from our contrib directory in core source
[Fix] Bugs #4158: Fatal error after role creation
[Fix] Bugs #4168: Underscores in group names not allowed anymore
[Fix] Bugs #4169: Uncaught exception 'NonExistingObjectTypeException' with message 'Non-existing type "group"
[Fix] Bugs #4172: Filter for ogroups should be on groupOfNames
[Fix] Bugs #4173: When mixed group plugin is installed group and ogroup tabs should be merged
[Fix] Bugs #4179: st field seems to be reading correctling but not setting correctly in a template
[Fix] Bugs #4183: option host-name with winstations results in error
[Fix] Bugs #4184: We missed a foreignkey in system trust in unix tab for user
[Fix] Bugs #4185: The configuration is lost after upgrading to 1.0.9.1
[Fix] Bugs #4190: fusiondirectory-setup should be improved
[Fix] Bugs #4191: Error in the fusiondirectory-setup
[Fix] Bugs #4193: Remove gosaAccount with fusiondirectory-setup --migrate-users
[Fix] Bugs #4194: list of users membership in group when in mixed mode 1.0.9x is not showing the same info as in 1.0.8.9
[Fix] Bugs #4195: when going to the page groups and roles with mixedgroup plugin installed
[Fix] Bugs #4196: roles should no allow space in their name
[Fix] Bugs #4199: the logon hours page is not correctly constructed
[Fix] Wishlist #4180: on Droplist, put entries in alphetical order
[Fix] Bugs #4206: when a mixed group posixGroup and groupOfNames without the extra fd objectClass and attributes is opened then saved it tell me a group with the same name already exist
[Fix] Bugs #4208: list of group membership in user when in mixed mode 1.0.9x is not showing the same info as in 1.0.8.9
[Feature] Wishlist #4154: add support for displayName attribute
* FusionDirectory 1.0.9
[Feature] Bugs #955: write https support for PHP JSONRPC
......
......@@ -129,7 +129,7 @@ if (scalar(@schemas) == 0) {
usage("Missing schema list for -e option\n");
}
# insert the default schemas
@schemas = ("samba","core-fd","core-fd-conf","ldapns","template-fd");
@schemas = ("core-fd","core-fd-conf","ldapns","template-fd");
foreach my $schema (@schemas) {
if (system("$schema2ldif $path$schema.schema > $path$schema.ldif") == 0) {
push @gen_files, $path.$schema;
......@@ -414,7 +414,7 @@ but beware that you will not be able to see things like password prompts as the
fusion@catbert$ fusiondirectory-insert-schema -o "-H ldap://my.ldap.com -ZZ -D 'cn=admin,cn=config' -w password -x"
Connect to another ldap server to insert the schema
=head1 BUGS
Please report any bugs, or post any suggestions, to the fusiondirectory mailing list fusiondirectory-users or to
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5,8 +5,8 @@
# Attributes
attributetype ( 1.3.6.1.4.1.38414.38.1.1 NAME 'fdTemplateField'
DESC 'FusionDirectory - template field'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26)
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
# Objectclasses
objectclass (1.3.6.1.4.1.38414.38.2.1 NAME 'fdTemplate'
......
......@@ -1075,6 +1075,9 @@ class config {
foreach ($plInfo['plObjectType'] as $key => $value) {
if (is_numeric($key)) { // This is not the main tab
$tabclass = strtoupper($value)."TABS";
if (($tabclass == 'GROUPTABS') && class_available('mixedGroup')) {
$tabclass = 'OGROUP-USERTABS';
}
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $tabclass, "Adding $class to tab list");
if (!isset($this->data['TABS'][$tabclass])) {
$this->data['TABS'][$tabclass] = array();
......
This diff is collapsed.
......@@ -451,8 +451,12 @@ class Attribute
if (!is_numeric($key)) {
$ot = $key;
}
$oinfos = objects::infos($ot);
return $oinfos['filter'];
try {
$oinfos = objects::infos($ot);
return $oinfos['filter'];
} catch (NonExistingObjectTypeException $e) {
return '';
}
},
array_keys($infos['plObjectType']),
array_values($infos['plObjectType'])
......@@ -463,17 +467,23 @@ class Attribute
}
$filter = '(&'.$filter.implode($filters).')';
$ldap->search($filter, array($this->getLdapName()));
$branches = array_map(
function ($key, $ot)
{
if (!is_numeric($key)) {
$ot = $key;
}
$oinfos = objects::infos($ot);
return $oinfos['ou'];
},
array_keys($infos['plObjectType']),
array_values($infos['plObjectType'])
$branches = array_filter(
array_map(
function ($key, $ot)
{
if (!is_numeric($key)) {
$ot = $key;
}
try {
$oinfos = objects::infos($ot);
return $oinfos['ou'];
} catch (NonExistingObjectTypeException $e) {
return FALSE;
}
},
array_keys($infos['plObjectType']),
array_values($infos['plObjectType'])
)
);
while ($attrs = $ldap->fetch()) {
if ($attrs['dn'] != $this->plugin->dn) {
......
......@@ -579,9 +579,9 @@ class DialogButtonAttribute extends ButtonAttribute
{
protected $dialogClass = NULL;
function __construct ($label, $description, $ldapName, $required, $dialogClass, $buttonText, $defaultValue = "", $acl = "")
function __construct ($label, $description, $ldapName, $buttonText, $dialogClass, $defaultValue = '', $acl = '')
{
parent::__construct($label, $description, $ldapName, $required, $buttonText, $defaultValue, $acl);
parent::__construct($label, $description, $ldapName, $buttonText, NULL, $defaultValue, $acl);
$this->dialogClass = $dialogClass;
}
......@@ -597,7 +597,8 @@ class UserAttribute extends DialogButtonAttribute
{
function __construct ($label, $description, $ldapName, $required = FALSE, $defaultValue = "", $acl = "")
{
parent::__construct($label, $description, $ldapName, $required, 'SingleUserSelectDialog', '', $defaultValue, $acl);
parent::__construct($label, $description, $ldapName, '', 'SingleUserSelectDialog', $defaultValue, $acl);
$this->setRequired($required);
}
function handleDialogResult ($dn, $attrs)
......
......@@ -63,7 +63,7 @@ define("FPDF_FONTPATH", "/usr/share/php/fpdf/font/"); /*! Define fpdf font path
/*!
* \brief FusionDirectory Version
*/
define ("FD_VERSION", "1.0.9"); /*! Define FusionDirectory version */
define ("FD_VERSION", "1.0.9.1"); /*! Define FusionDirectory version */
/*!
* \brief FusionDirectory config object RDN
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -79,11 +79,11 @@ class dashboardUsers extends simplePlugin
}
}
}
$ldap->search("(&(objectClass=inetOrgPerson)(objectClass=gosaMailAccount))", array("cn"));
$ldap->search('(&(objectClass=inetOrgPerson)(objectClass=gosaMailAccount))', array('cn'));
$nb_mail_accounts = $ldap->count();
$ldap->search("(&(objectClass=inetOrgPerson)(objectClass=posixAccount))", array("cn"));
$ldap->search('(&(objectClass=inetOrgPerson)(objectClass=posixAccount))', array('cn'));
$nb_posix_accounts = $ldap->count();
$ldap->search("(&(objectClass=inetOrgPerson)(objectClass=sambaSamAccount))", array("cn"));
$ldap->search('(&(objectClass=inetOrgPerson)(objectClass=sambaSamAccount))', array('cn'));
$nb_samba_accounts = $ldap->count();
return array(
......@@ -136,8 +136,10 @@ class dashboardUsers extends simplePlugin
/* search all account with all date, mail, telephone */
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
$ldap->search('(&(|(objectClass=posixAccount)(objectClass=sambaSamAccount))(shadowExpire=*))',
array('uid','shadowExpire','mail','telephoneNumber','cn','manager'));
$ldap->search(
'(shadowExpire=*)',
array('uid','shadowExpire','mail','telephoneNumber','cn','manager')
);
$expired_accounts = array();
$next_expired_accounts = array();
......
......@@ -57,9 +57,10 @@ class group extends simplePlugin
'name' => _('Properties'),
'attrs' => array(
new BaseSelectorAttribute(get_ou('groupRDN')),
new HostNameAttribute(
new StringAttribute(
_('Name'), _('Name of this group'),
'cn', TRUE
'cn', TRUE,
'', '', (strict_uid_mode() ? '/^[a-z0-9_-]+$/' : '/^[a-z0-9_.-]+$/')
),
new TextAreaAttribute(
_('Description'), _('Short description of this group'),
......
......@@ -50,48 +50,53 @@ class groupManagement extends simpleManagement
static function filterProperties($row, $dn, $gosaGroupObjects = NULL)
{
if (!empty($gosaGroupObjects)) {
return self::filterGroupObjects($row, $gosaGroupObjects);
}
global $config;
static $grouptabs = array();
if (empty($grouptabs)) {
foreach ($config->data['TABS']['GROUPTABS'] as $plug) {
if ($plug['CLASS'] == 'group') {
continue;
}
if (class_available($plug['CLASS'])) {
$name = $plug['CLASS'];
$grouptabs[$name] = new $name($config, $dn);
}
}
}
// Load information if needed
$ldap = $config->get_ldap_link();
$ldap->cat($dn);
$result = "<input class='center' type='image' src='geticon.php?context=types&amp;icon=user-group&amp;size=16' ".
"alt='"._('Posix')."' title='"._('Edit posix properties')."' ".
"name='listing_edit_tab_group_$row' style='padding:1px'/>";
$result = '&nbsp;';
if ($attrs = $ldap->fetch()) {
if (!objects::isOfType($attrs, 'group')) {
if (objects::isOfType($attrs, 'ogroup')) {
if (empty($gosaGroupObjects)) {
return $result;
} else {
return self::filterGroupObjects($row, $gosaGroupObjects);
}
}
if (objects::isOfType($attrs, 'role')) {
return '<input class="center" type="image" src="geticon.php?context=types&amp;icon=role&amp;size=16" '.
'alt="'._('Role').'" title="'._('Edit role properties').'" '.
'name="listing_edit_'.$row.'" style="padding:1px"/>';
}
if (empty($grouptabs)) {
foreach ($config->data['TABS']['GROUPTABS'] as $plug) {
if ($plug['CLASS'] == 'group') {
continue;
}
if (class_available($plug['CLASS'])) {
$name = $plug['CLASS'];
$grouptabs[$name] = new $name($config, $dn);
}
}
}
$result = '<input class="center" type="image" src="geticon.php?context=types&amp;icon=user-group&amp;size=16" '.
'alt="'._('Posix').'" title="'._('Edit posix properties').'" '.
'name="listing_edit_tab_group_'.$row.'" style="padding:1px"/>';
foreach ($grouptabs as $class => $grouptab) {
if ($grouptab->is_this_account($attrs)) {
$infos = pluglist::pluginInfos($class);
if (isset($infos['plSmallIcon'])) {
$result .= "<input class='center' type='image' src='".htmlentities($infos['plSmallIcon'], ENT_COMPAT, 'UTF-8')."' ".
"alt='".$infos['plShortName']."' title='".$infos['plShortName']."' ".
"name='listing_edit_tab_".$class."_$row' style='padding:1px'/>";
$result .= '<input class="center" type="image" src="'.htmlentities($infos['plSmallIcon'], ENT_COMPAT, 'UTF-8').'" '.
'alt="'.$infos['plShortName'].'" title="'.$infos['plShortName'].'" '.
'name="listing_edit_tab_'.$class.'_'.$row.'" style="padding:1px"/>';
} else {
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $infos['plShortName']." ($class)", 'No icon for');
}
} else {
$result .= "<img src='images/empty.png' alt=' ' class='center optional $class' style='padding:1px'>";
$result .= '<img src="images/empty.png" alt=" " class="center optional '.$class.'" style="padding:1px"/>';
}
}
}
......@@ -101,8 +106,8 @@ class groupManagement extends simpleManagement
static function filterGroupObjects($row, $gosaGroupObjects)
{
$types = preg_replace("/[^a-z]/i", "", $gosaGroupObjects[0]);
$result = "";
$types = preg_replace('/[^a-z]/i', '', $gosaGroupObjects[0]);
$result = '';
for ($i = 0; $i < strlen($types); $i++) {
if ($types[$i] == 'I') {
continue;
......@@ -111,7 +116,7 @@ class groupManagement extends simpleManagement
$result .= '<img class="center" src="'.htmlentities($info['icon'], ENT_COMPAT, 'UTF-8').'" '.
'alt="'.$info['name'].'" title="'.$info['name'].'" style="padding:1px"/>';
}
if ($result == "") {
if ($result == '') {
return '&nbsp;';
}
return $result;
......@@ -123,12 +128,16 @@ class groupManagement extends simpleManagement
$filters = array(
array('id' => 'USER', 'label' => _('Show user groups')),
array('id' => 'PRIMARY', 'label' => _('Show primary groups')),
array('id' => 'SAMBA', 'label' => _('Show samba groups')),
array('id' => 'MAIL', 'label' => _('Show mail groups')),
array('id' => 'ROLE', 'label' => _('Show organizational roles')),
array('id' => 'APPLICATION', 'label' => _('Show application groups')),
array('id' => 'DEPARTMENT', 'label' => _('Show department groups')),
);
if (class_available('mailAccount')) {
$filters[]= array('id' => 'MAIL', 'label' => _('Show mail groups'));
}
if (class_available('sambaAccount')) {
$filters[]= array('id' => 'SAMBA', 'label' => _('Show samba groups'));
}
if (class_available('systemManagement')) {
$filters = array_merge(
$filters,
......
......@@ -41,7 +41,7 @@ class ObjectsAttribute extends GenericDialogAttribute
if (objects::isOfType($attrs, $objectType)) {
$infos = objects::infos($objectType);
$this->types[$i] = $code;
$this->displays[$i] = $attrs[$infos['mainAttr']][0];
$this->displays[$i] = $attrs[$infos['nameAttr']][0];
if (isset($attrs['description'][0])) {
$this->displays[$i] .= ' ['.$attrs['description'][0].']';
} elseif (isset($attrs['uid'][0])) {
......@@ -154,7 +154,7 @@ class ogroup extends simplePlugin
'name' => _('Group'),
'description' => _('Group'),
'ou' => get_ou('ogroupRDN'),
'filter' => 'objectClass=gosaGroupOfNames',
'filter' => 'objectClass=groupOfNames',
'icon' => 'geticon.php?context=types&icon=resource-group&size=16',
'tabClass' => 'ogrouptabs',
)),
......@@ -183,9 +183,10 @@ class ogroup extends simplePlugin
'name' => _('Properties'),
'attrs' => array(
new BaseSelectorAttribute(get_ou('ogroupRDN')),
new HostNameAttribute(
new StringAttribute(
_('Name'), _('Name of this group'),
'cn', TRUE
'cn', TRUE,
'', '', (strict_uid_mode() ? '/^[a-z0-9_-]+$/' : '/^[a-z0-9_.-]+$/')
),
new TextAreaAttribute(
_('Description'), _('Short description of this group'),
......@@ -271,6 +272,21 @@ class ogroup extends simplePlugin
return 'cn='.$this->attributesAccess['cn']->getValue().','.get_ou('ogroupRDN').$this->base;
}
/*! \brief This function returns an LDAP filter for this plugin object classes
*/
function getObjectClassFilter ()
{
return '(objectClass=groupOfNames)';
}
function is_this_account($attrs)
{
$this->objectclasses = array('groupOfNames');
$found = parent::is_this_account($attrs);
$this->objectclasses = array('groupOfNames', 'gosaGroupOfNames');
return $found;
}
function prepare_save()
{
$this->reload();
......
......@@ -56,15 +56,16 @@ class roleGeneric extends simplePlugin
'section1' => array(
'name' => _('Informations'),
'attrs' => array(
new StringAttribute (
_('Name'), _('Name of the role'),
'cn', TRUE
new BaseSelectorAttribute (get_ou('roleRDN')),
new StringAttribute(
_('Name'), _('Name of this group'),
'cn', TRUE,
'', '', (strict_uid_mode() ? '/^[a-z0-9_-]+$/i' : '/^[a-z0-9_.-]+$/i')
),
new StringAttribute (
_('Description'), _('Description of the role'),
'description'
),
new BaseSelectorAttribute (get_ou('roleRDN')),
new StringAttribute (
_('Phone number'), _('Phone number'),
'telephoneNumber'
......
......@@ -79,19 +79,30 @@ class userManagement extends simpleManagement
{
parent::configureFilter();
if (!class_available('mailAccount')) {
$classes = array('posixAccount');
if (class_available('mailAccount')) {
$classes[]= 'gosaMailAccount';
} else {
/* If mail plugin is not installed, ignore mail filter */
$this->filter->elements['MAIL']['unset'] = '';
$this->filter->elements['MAIL']['set'] = '';
/* The FUNCTIONAL filter must not use inexisting gosaMailAccount class */
$this->filter->elements['FUNCTIONAL']['set'] = '(!(|(objectClass=posixAccount)(objectClass=sambaSamAccount)))';
$this->filter->elements['MAIL']['unset'] = '';
$this->filter->elements['MAIL']['set'] = '';
}
if (class_available('sambaAccount')) {
$classes[]= 'sambaSamAccount';
} else {
/* If samba plugin is not installed, ignore samba filter */
$this->filter->elements['SAMBA']['unset'] = '';
$this->filter->elements['SAMBA']['set'] = '';
}
/* The FUNCTIONAL filter must not use inexisting classes */
$this->filter->elements['FUNCTIONAL']['set'] = '(!(|(objectClass='.implode(')(objectClass=', $classes).')))';
}
function renderList ()
{
$smarty = get_smarty();
$smarty->assign('USE_MAIL', class_available('mailAccount'));
$smarty->assign('USE_SAMBA', class_available('sambaAccount'));
return parent::renderList();
}
......
......@@ -12,7 +12,9 @@
{if $USE_MAIL}
{$MAIL}&nbsp;<label for='MAIL'>{t}Show Mail users{/t}</label><br/>
{/if}
{$SAMBA}&nbsp;<label for='SAMBA'>{t}Show Samba users{/t}</label><br/>
{if $USE_SAMBA}
{$SAMBA}&nbsp;<label for='SAMBA'>{t}Show Samba users{/t}</label><br/>
{/if}
<div style="width:100%;border-top:1px solid #AAAAAA"></div>
{$SCOPE}
......
......@@ -55,7 +55,8 @@
<tag>FUNCTIONAL</tag>
<default>true</default>
<unset></unset>
<set>(!(|(objectClass=posixAccount)(objectClass=sambaSamAccount)(objectClass=gosaMailAccount)))</set>
<!-- The set tag content is defined in userManagement::configureFilter -->
<set>UNSET</set>
</element>
<element>
......
......@@ -358,6 +358,10 @@ class user extends simplePlugin
'name' => _('Personal contact information'),
'icon' => 'geticon.php?context=types&icon=contact&size=16',
'attrs' => array(
new StringAttribute (
_('Display name'), _('Name this user should appear as. Used by Exchange.'),
'displayName', FALSE
),
new TextAreaAttribute (
_('Home address'), _('Home postal address'),
'homePostalAddress', FALSE
......
......@@ -68,7 +68,33 @@ class EpochDaysDateAttribute extends DateAttribute
class posixAccount extends simplePlugin
{
var $displayHeader = TRUE;
var $objectclasses = array("posixAccount", "shadowAccount");
var $objectclasses = array('posixAccount', 'shadowAccount');
static function plInfo()
{
return array(
'plShortName' => _('Unix'),
'plDescription' => _('Edit users POSIX settings'),
'plIcon' => 'geticon.php?context=applications&icon=os-linux&size=48',
'plSmallIcon' => 'geticon.php?context=applications&icon=os-linux&size=16',
'plSelfModify' => TRUE,
'plPriority' => 2,
'plObjectType' => array('user'),
'plForeignKeys' => array(
'gidNumber' => array(
array('group','gidNumber'),
array('mixedGroup','gidNumber'),
),
'host' => array(
array('serverGeneric', 'cn'),
array('workstationGeneric', 'cn'),
array('terminalGeneric', 'cn'),
)
),
'plProvidedAcls' => parent::generatePlProvidedAcls(self::getAttributesInfo())
);
}
// The main function : information about attributes
static function getAttributesInfo ()
......@@ -178,24 +204,6 @@ class posixAccount extends simplePlugin
);
}
static function plInfo()
{
return array(
'plShortName' => _('Unix'),
'plDescription' => _('Edit users POSIX settings'),
'plIcon' => 'geticon.php?context=applications&icon=os-linux&size=48',
'plSmallIcon' => 'geticon.php?context=applications&icon=os-linux&size=16',
'plSelfModify' => TRUE,
'plPriority' => 2,
'plObjectType' => array('user'),
'plForeignKeys' => array(
'gidNumber' => array('group','gidNumber')
),
'plProvidedAcls' => parent::generatePlProvidedAcls(self::getAttributesInfo())
);
}
function __construct (&$config, $dn = NULL, $object = NULL)
{
parent::__construct($config, $dn, $object);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
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