diff --git a/contrib/man/fusiondirectory.pod b/contrib/man/fusiondirectory.pod index 838236b099833264d00918a02952837c042f720c..8d92691b86ce08c094410c43fdd9de619e8184a5 100644 --- a/contrib/man/fusiondirectory.pod +++ b/contrib/man/fusiondirectory.pod @@ -64,10 +64,6 @@ zone value should be a unix conform timezone value like in /etc/timezone. The strictNamingRules statement enables strict checking of uids and group names. If you need characters like . or - inside of your accounts, set this to false. -=item B<allowUidProposalModification> I<bool> - -The allowUidProposalModification statement enables the abilitiy to modify uid proposals when creating a new user from a template. - =item B<rfc2307bis> I<bool> The rfc2307bis statement enables rfc2307bis style groups in FusionDirectory. You can use member attributes instead of memberUid in this case. To make it work on unix diff --git a/html/index.php b/html/index.php index 8a6a2514666e2ecc60d709c0967ea358001e7eb5..29c073b85a5a613b9a12ef74ca37cc7e959d3709 100644 --- a/html/index.php +++ b/html/index.php @@ -98,7 +98,6 @@ function displayLogin() $smarty->assign("rtl", language_is_rtl($lang)); $smarty->display (get_template_path('headers.tpl')); - $smarty->assign("version", FD_VERSION); $smarty->display(get_template_path('login.tpl')); diff --git a/html/main.php b/html/main.php index 883c400c0f8eba9276283834f37ddca7e20ff7cf..be40713f37966057916de6d0ea65b8aef426ed3a 100644 --- a/html/main.php +++ b/html/main.php @@ -152,6 +152,7 @@ if (!session::global_is_set('plist')) { $config->loadPlist($plist); $config->get_departments(); $config->make_idepartments(); + $config->checkLdapConfig(); } $plist = session::global_get('plist'); diff --git a/html/themes/default/login.css b/html/themes/default/login.css index 7298f5ab5fb68b412980d3a4b0a4a01110a833f4..5b41f0b5ea63c5e0718fcc003edbe400dcbefafb 100644 --- a/html/themes/default/login.css +++ b/html/themes/default/login.css @@ -121,3 +121,4 @@ text-align:left; margin-bottom:0px; } } + diff --git a/ihtml/themes/default/msg_dialog.tpl b/ihtml/themes/default/msg_dialog.tpl index f55ef4a75b316d27adfa886292a83e8219a4af27..f6ddc99127d8c835a8d3a2ef0d280408ff2eac3e 100644 --- a/ihtml/themes/default/msg_dialog.tpl +++ b/ihtml/themes/default/msg_dialog.tpl @@ -14,6 +14,7 @@ <div id="trace_{$i_ID}" style="display:none;"> {$s_Trace} </div> + {/if} {if $i_Type == $smarty.const.INFO_DIALOG || $i_Type == $smarty.const.CONFIRM_DIALOG || $i_Type == $smarty.const.OK_CANCEL_DIALOG} @@ -74,4 +75,5 @@ <script type="text/javascript"> focus_field('MSG_OK{$i_ID}'); </script> + {/if} diff --git a/include/class_acl.inc b/include/class_acl.inc index 0ea71106204b2f62cc86e4c2bd9f975570b4fd5c..36485e8591f2dda5d951be09ce63f12749610259 100644 --- a/include/class_acl.inc +++ b/include/class_acl.inc @@ -1257,10 +1257,7 @@ class acl extends plugin 'plCategory' => array('acl' => array('description' => _('ACL').' & '._('ACL roles'), 'objectClass' => array('gosaAcl','gosaRole'))), 'plObjectType' => array( - 'acl' => array( - 'name' => _('ACL'), - 'filter' => 'objectClass=gosaAcl' - ), + 'acl' => array('name' => _('ACL'), 'filter' => 'objectClass=gosaAcl'), 'special' => array('name' => 'special') ), diff --git a/include/class_config.inc b/include/class_config.inc index 6c78a67f20af4602f9dc8469c22703f8f7e516f9..b7d6b8d5d770854a7df66075e824615f7fa080a0 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -106,12 +106,12 @@ class config { { /* Check if class_location.inc has changed, this is the case if we have installed or removed plugins. */ + $tmp = stat(CACHE_DIR."/".CLASS_CACHE); if (session::global_is_set("class_location.inc:timestamp")) { if ($tmp['mtime'] != session::global_get("class_location.inc:timestamp")) { session::global_un_set("plist"); } } - $tmp = stat(CACHE_DIR."/".CLASS_CACHE); session::global_set("class_location.inc:timestamp", $tmp['mtime']); if (($this->filename != "") && ((filemtime($this->filename) != $this->last_modified) || $force)) { @@ -544,7 +544,6 @@ class config { 'QUEUE_TABLE' => "queues", 'QUEUE_MEMBER_TABLE' => "queue_members" ); - if (isset($attrs['fdAsteriskDriver'][0])) { $entry['DRIVER'] = $attrs['fdAsteriskDriver'][0]; } @@ -1327,23 +1326,6 @@ class config { } } } - /* Read management info */ - if (isset($plInfo['plManages'])) { - foreach ($plInfo['plManages'] as $type) { - if (isset($this->data['OBJECTS'][strtoupper($type)])) { - $this->data['OBJECTS'][strtoupper($type)]['management'] = $class; - $cat = $this->data['OBJECTS'][strtoupper($type)]['aclCategory']; - $acl[] = $cat; - - if (!empty($plInfo['plProvidedAcls'])) { - $this->data['CATEGORIES'][$cat]['classes'][] = $class; - } - if (!in_array($cat, $plInfo['plCategory'])) { - $plInfo['plCategory'][] = $cat; - } - } - } - } @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, join(',', $acl), "Class $class categories"); /* Feed menu */ if (isset($plInfo['plSection'])) { @@ -1376,6 +1358,14 @@ class config { } $this->data['MENU'][$section][] = $attrs; } + /* Read management info */ + if (isset($plInfo['plManages'])) { + foreach ($plInfo['plManages'] as $type) { + if (isset($this->data['OBJECTS'][strtoupper($type)])) { + $this->data['OBJECTS'][strtoupper($type)]['management'] = $class; + } + } + } } unset($plInfo); asort($this->data['CATEGORIES']); diff --git a/include/class_msgPool.inc b/include/class_msgPool.inc index a1e314262b049caea8fa79f0374402479446a009..a35f27364ada2bd0cd1d55ebde4d7944c52ceefb 100644 --- a/include/class_msgPool.inc +++ b/include/class_msgPool.inc @@ -438,7 +438,7 @@ class msgPool { if (preg_match("$regex", $currentChar)) { $result .= $currentChar; } else { - $result .= "<div style='color:red;text-decoration:underline;'>".($currentChar)."</div>"; + $result .= '<span style="color:red;text-decoration:underline;">'.($currentChar).'</span>'; $mismatch .= $currentChar; } } diff --git a/include/class_msg_dialog.inc b/include/class_msg_dialog.inc index a18ab7d465ed13d558991f9f7d6a65d1f3aeef44..599611ea2856831f7b2df53289600e9f3d1e9a00 100644 --- a/include/class_msg_dialog.inc +++ b/include/class_msg_dialog.inc @@ -221,7 +221,6 @@ class msg_dialog $msg_dialogs = session::get('msg_dialogs'); foreach ($msg_dialogs as $key => $dialog) { if (preg_match("/".$dialog->get_ID()."/", $seen)) { - unset($msg_dialogs[$key]); } else { $return .= $dialog->execute(); @@ -230,7 +229,6 @@ class msg_dialog unset($msg_dialogs[$key]); } session::set('msg_dialogs', $msg_dialogs); - $dialog_ids = preg_replace("/,$/", "", $dialog_ids); $return .= "</div>"; diff --git a/include/class_objects.inc b/include/class_objects.inc index 6edcffde5334cdd8862658b9e123de7700c9ce61..1a9b4e1c30ffe069a1d47aa39602f88d51d34da5 100644 --- a/include/class_objects.inc +++ b/include/class_objects.inc @@ -48,10 +48,10 @@ class objects } else { $search_attrs = array($attrs); } - - $ldap = self::search($type, $search_attrs, $ou, $filter); - if ($ldap === FALSE) { - throw new Exception("Type '$type' has no LDAP filter defined"); + try { + $ldap = self::search($type, $search_attrs, $ou, $filter); + } catch (NonExistingBranchException $e) { + return array(); } $result = array(); while ($fetched_attrs = $ldap->fetch()) { @@ -112,7 +112,7 @@ class objects $infos = self::infos($type); if ($infos['filter'] == '') { - return FALSE; + throw new EmptyFilterException(); } $object_ou = $infos['ou']; @@ -121,6 +121,10 @@ class objects $ou = $object_ou.$ou; } } + $ldap = $config->get_ldap_link(); + if (!$ldap->dn_exists($ou)) { + throw new NonExistingBranchException(); + } if (empty($filter)) { $filter = $infos['filter']; } else { @@ -129,8 +133,6 @@ class objects } $filter = '(&'.$filter.$infos['filter'].')'; } - - $ldap = $config->get_ldap_link(); $ldap->cd($ou); $ldap->search($filter, $search_attrs); if (!$ldap->success()) { @@ -207,7 +209,6 @@ class objects if (!isset($config->data['OBJECTS'][strtoupper($type)])) { throw new NonExistingObjectTypeException('Non-existing type "'.$type.'"'); - } return $config->data['OBJECTS'][strtoupper($type)]; diff --git a/include/class_session.inc b/include/class_session.inc index de67138ecb066fffbd280bd4d2fda6e3d9b061d9..05954b971ab3a8a3196c7c4a1dd49e555b747e59 100644 --- a/include/class_session.inc +++ b/include/class_session.inc @@ -247,9 +247,9 @@ class session { /*! * \brief Start a session */ - public static function start() + public static function start($id = NULL) { - session_name("FusionDirectory"); + session_name("FusionDirectory"); /* Set cookie lifetime to one day (The parameter is in seconds ) */ session_set_cookie_params(24 * 60 * 60); @@ -259,9 +259,10 @@ class session { /* Set session max lifetime, to prevent the garbage collector to delete session before timeout. !! The garbage collector is a cron job on debian systems, the cronjob will fetch the timeout from the php.ini, so if you use debian, you must hardcode session.gc_maxlifetime in your php.ini */ - ini_set("session.gc_maxlifetime", 24 * 60 * 60); - session_name("FusionDirectory"); + if ($id !== NULL) { + session_id($id); + } session_start(); /* Check for changed browsers and bail out */ diff --git a/include/functions.inc b/include/functions.inc index 46f91712845ce58878436d0cbf9dec6c23e7faf5..367004215aaf32f22b40912eff5d3f33f8db3559 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -590,10 +590,6 @@ function ldap_login_user_htaccess ($username) /* Username is set, load subtreeACL's now */ $ui->loadACL(); - - /* TODO: check java script for htaccess authentication */ - session::global_set('js', TRUE); - return $ui; } @@ -1414,8 +1410,11 @@ function get_ou($name) "componentRDN" => "ou=netdevices,ou=systems,", "sambaMachineAccountRDN" => "ou=computers,", "mobilePhoneRDN" => "ou=mobile,ou=systems,", + "inventoryRDN" => "ou=inventory,", + "ipmiRDN" => "ou=ipmi,", + "faxBlocklistRDN" => "ou=gofax,ou=systems,", "aclRoleRDN" => "ou=aclroles,", "phoneMacroRDN" => "ou=macros,ou=asterisk,ou=configs,ou=systems,", @@ -1427,7 +1426,6 @@ function get_ou($name) "faiTemplateRDN" => "ou=templates,", "faiVariableRDN" => "ou=variables,", "faiProfileRDN" => "ou=profiles,", - "faiProfileRDN" => "ou=profiles,", "faiPackageRDN" => "ou=packages,", "faiPartitionRDN" => "ou=disk,", @@ -2054,9 +2052,9 @@ function netmask_to_bits($netmask) /*! - * \brief Recursion helper for gen_id() + * \brief Recursion helper for gen_uids() */ -function recurse($rule, $variables) +function _recurse_gen_uids($rule, $variables) { $result = array(); @@ -2071,7 +2069,7 @@ function recurse($rule, $variables) foreach ($val as $possibility) { $nrule = str_replace("{$key}", $possibility, $rule); - $result = array_merge($result, recurse($nrule, $variables)); + $result = array_merge($result, _recurse_gen_uids($nrule, $variables)); } return $result; @@ -2094,13 +2092,11 @@ function gen_uids($rule, $attributes) { global $config; - $attrs_object = new stdClass(); // Strip out non ascii chars foreach ($attributes as $name => $value) { $value = iconv('UTF-8', 'US-ASCII//TRANSLIT', $value); $value = preg_replace('/[^(\x20-\x7F)]*/', '', $value); - $attributes[$name] = $value; - $attrs_object->$name = $value; + $attributes[$name] = array($value); } /* Search for keys and fill the variables array with all @@ -2109,14 +2105,14 @@ function gen_uids($rule, $attributes) $variables = array(); for ($pos = 0; preg_match('/%([^%]+)%/', $stripped, $m, PREG_OFFSET_CAPTURE, $pos); ) { - $variables[$pos] = plugin::tpl_parse_mask($m[1][0], array($attrs_object)); + $variables[$pos] = plugin::tpl_parse_mask($m[1][0], $attributes); $replace = '{'.$pos.'}'; $stripped = substr_replace($stripped, $replace, $m[0][1], strlen($m[0][0])); $pos = $m[0][1] + strlen($replace); } /* Recurse through all possible combinations */ - $proposed = recurse($stripped, $variables); + $proposed = _recurse_gen_uids($stripped, $variables); /* Get list of used ID's */ $ldap = $config->get_ldap_link(); @@ -2872,7 +2868,7 @@ function get_languages($languages_in_own_language = FALSE, $strip_region_tag = F */ function language_is_rtl ($lang) { - //~ $lang = preg_replace('/\.UTF-8$/', '', $lang); + $lang = preg_replace('/\.UTF-8$/', '', $lang); if (preg_match('/^fa_/', $lang)) { return TRUE; diff --git a/include/php_setup.inc b/include/php_setup.inc index 5dae559d360fe34933036f1c59ea552573fb65d5..329aab559f06ec1cc5c4594a97331c05a81c8643 100644 --- a/include/php_setup.inc +++ b/include/php_setup.inc @@ -193,32 +193,32 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) $warning_path = (is_callable('get_template_path') ? get_template_path('images/warning.png') : 'images/warning.png'); - $error_collector = ' - <div class="error"> - <table width="100%"> - <tr> - <td> - <img src="'.$warning_path.'" alt="" class="center"/> - <strong style="font-size:14px">'. - _("Generating this page caused the PHP interpreter to raise some errors!").' - </strong> - </td> - <td align=right> - <a href="mailto:bugs@fusiondirectory.org?subject=FusionDirectory%20bugreport&body=%BUGBODY%"> - <img src="images/mailto.png" title="'._("Send bug report to the FusionDirectory Team"). - '" class="center" alt="'.("Mail icon").'"> '._("Send bugreport").' - </a> - </td> - <td align="right"> - <button onClick="$(\'errorbox\').toggle();">'. - _("Toggle information").' - </button> - </td> - </tr> - </table> - </div> - <div id="errorbox" style="position:absolute; z-index:150; display: none;">'; - } + $error_collector = ' + <div class="error"> + <table width="100%"> + <tr> + <td> + <img src="'.$warning_path.'" alt="" class="center"/> + <strong style="font-size:14px">'. + _("Generating this page caused the PHP interpreter to raise some errors!").' + </strong> + </td> + <td align=right> + <a href="mailto:bugs@fusiondirectory.org?subject=FusionDirectory%20bugreport&body=%BUGBODY%"> + <img src="images/mailto.png" title="'._("Send bug report to the FusionDirectory Team"). + '" class="center" alt="'.("Mail icon").'"> '._("Send bugreport").' + </a> + </td> + <td align="right"> + <button onClick="$(\'errorbox\').toggle();">'. + _("Toggle information").' + </button> + </td> + </tr> + </table> + </div> + <div id="errorbox" style="position:absolute; z-index:150; display: none;">'; + } /* Create error header */ $error_collector_mailto .= rawurlencode("=== Error === \n"); diff --git a/include/variables.inc b/include/variables.inc index 22957d37eca8932d2f214c43fab48631376f20ae..52c91ef4d0daca14f953a2a4c5444c14f7683a43 100644 --- a/include/variables.inc +++ b/include/variables.inc @@ -45,7 +45,6 @@ if (!defined("CONFIG_FILE")) { define("SMARTY", "/usr/share/php/smarty3/Smarty.class.php"); /*! - * \brief Smarty compile dir */ define ("SPOOL_DIR", "/var/spool/fusiondirectory/"); /* FusionDirectory spool directory */ diff --git a/plugins/admin/acl/acl-list.xml b/plugins/admin/acl/acl-list.xml index fa8dbe918e04f968a66d87b94a4999cfcf07f89b..c6c0e48f715837e7378c7d430d0d2551205e4175 100644 --- a/plugins/admin/acl/acl-list.xml +++ b/plugins/admin/acl/acl-list.xml @@ -79,7 +79,7 @@ <name>new</name> <type>entry</type> <image>plugins/acl/images/iconMini.png</image> - <label>Acl</label> + <label>Role</label> </action> </action>