diff --git a/contrib/fusiondirectory.conf b/contrib/fusiondirectory.conf index 92369dc2b1ea226034ca3bcdcb8f452a84bf6b9e..ba83be82113866a9037c2e502e8d3478f812b2dc 100644 --- a/contrib/fusiondirectory.conf +++ b/contrib/fusiondirectory.conf @@ -58,6 +58,7 @@ <!-- Section to enable addon plugins --> <section name="Addons"> + <plugin acl="configuration" class="configInLdap" /> <plugin acl="board" class="board" /> <plugin acl="server/serviceSyslog" class="rsyslog" /> <plugin acl="addressbook" class="addressbook" /> @@ -242,12 +243,6 @@ <tab class="govirusserver" /> <tab class="serviceDHCP" /> <tab class="serviceDNS" /> - <tab class="serviceSyslog" /> - <tab class="serviceApache" /> - <tab class="argonautServer" /> - <tab class="argonautDNSConfig" /> - <tab class="argonautMirrorConfig" /> - <tab class="argonautFuseConfig" /> <tab class="quotaService" /> </serverservice> @@ -376,193 +371,33 @@ --> <main default="{$cv.location}" {if $cv.optional.logging} - logging="true" + logging="TRUE" {else} - logging="false" -{/if} -{if $cv.optional.list_summary} - listSummary="true" -{else} - listSummary="false" -{/if} -{if $cv.pwd_rules.pwminlen_active} - passwordMinLength="{$cv.pwd_rules.pwminlen}" -{/if} -{if $cv.pwd_rules.pwdiffer_active} - passwordMinDiffer="{$cv.pwd_rules.pwdiffer}" -{/if} -{if $cv.pwd_rules.externalpwdhook_active} - passwordHook="{$cv.pwd_rules.externalpwdhook}" + logging="FALSE" {/if} {if $cv.errorlvl} - displayErrors="true" -{else} - displayErrors="false" -{/if} -{if $cv.enable_schema_check} - schemaCheck="true" + displayErrors="TRUE" {else} - schemaCheck="false" -{/if} -{if $cv.optional.enableCopyPaste} - copyPaste="true" -{else} - copyPaste="false" -{/if} -{if $cv.optional.forceglobals} - forceGlobals="true" -{else} - forceGlobals="false" + displayErrors="FALSE" {/if} {if $cv.optional.forcessl} - forceSSL="true" + forceSSL="TRUE" {else} - forceSSL="false" + forceSSL="FALSE" {/if} -{if $cv.optional.ldapstats} - ldapStats="true" -{else} - ldapStats="false" -{/if} -{if $cv.optional.warnssl} - warnSSL="true" -{else} - warnSSL="false" -{/if} - -{if $cv.optional.max_ldap_query_time_active} - ldapMaxQueryTime="{$cv.optional.max_ldap_query_time}" -{/if} -{if $cv.optional.noprimarygroup} - primaryGroupFilter="true" -{/if} -{if $cv.optional.user_filter_cookie} - storeFilterSettings="true" -{else} - storeFilterSettings="false" -{/if} -{if $cv.optional.uniq_identifier_active} - modificationDetectionAttribute="{$cv.optional.uniq_identifier}" -{else} - modificationDetectionAttribute="" -{/if} - language="{$cv.lang_selected}" - theme="{$cv.theme}" - sessionLifetime="{$cv.optional.session_lifetime}" templateCompileDirectory="{$cv.optional.compile}" debugLevel="{$cv.optional.debuglevel}" - sambaHashHook='{$cv.samba_settings.smbhash}' > <!-- Location definition --> <location name="{$cv.location}" - passwordDefaultHash="{$cv.encryption}" -{if $cv.cngen_active} - accountRDN="cn={$cv.cngen}" -{else} - accountPrimaryAttribute="{$cv.peopledn}" -{/if} - userRDN="{$cv.peopleou}" - groupRDN="{$cv.groupou}" - gidNumberBase="{$cv.uidbase}" - uidNumberBase="{$cv.uidbase}" {if $cv.optional.sudoou_active} sudoRDN="{$cv.optional.sudoou}" {/if} -{if $cv.optional.login_attribute} - loginAttribute="{$cv.optional.login_attribute}" -{else} - loginAttribute="uid" -{/if} -{if $cv.timezone} - timezone="{$cv.timezone}" -{/if} -{if $cv.optional.strict_units} - honourUnitTags="true" -{else} - honourUnitTags="false" -{/if} -{if $cv.krbsasl} - useSaslForKerberos="true" -{else} - useSaslForKerberos="false" -{/if} -{if $cv.rfc2307bis} - rfc2307bis="true" -{else} - rfc2307bis="false" -{/if} -{if $cv.include_personal_title} - personalTitleInDN="true" -{else} - personalTitleInDN="false" -{/if} -{if $cv.base_hook_active} - nextIdHook="{$cv.base_hook}" -{/if} -{if $cv.generic_settings.wws_ou_active} - sambaMachineAccountRDN="{$cv.generic_settings.wws_ou}" -{/if} -{if $cv.id_settings.idgen_active} - idGenerator="{$cv.id_settings.idgen}" -{/if} -{if $cv.strict} - strictNamingRules="true" -{else} - strictNamingRules="false" -{/if} -{if $cv.id_settings.minid_active} - minId="{$cv.id_settings.minid}" -{/if} - mailAttribute="{$cv.mail_attrib}" gosaSharedPrefix="" - mailUserCreation="" - mailFolderCreation="" - imapTimeout="10" -{if $cv.mail != "disabled"} - mailMethod="{$cv.mail}" -{if $cv.cyrusunixstyle} - cyrusUseSlashes="true" -{else} - cyrusUseSlashes="false" -{/if} -{if $cv.mail_settings.vacationdir_active} - vacationTemplateDirectory="{$cv.mail_settings.vacationdir}" -{/if} -{/if} {if $cv.tls} - ldapTLS="true" -{/if} -{if $cv.governmentmode} - honourIvbbAttributes="true" -{else} - honourIvbbAttributes="false" -{/if} -{if $cv.sambaidmapping} - sambaIdMapping="true" -{/if} -{if $cv.account_expiration} - handleExpiredAccounts="true" -{/if} -{if $cv.samba_settings.samba_sid_active} - sambaSID="{$cv.samba_settings.samba_sid}" -{/if} -{if $cv.samba_settings.samba_rid_active} - sambaRidBase="{$cv.samba_settings.samba_rid_active}" -{/if} -{if $cv.generic_settings.snapshot_active} - enableSnapshots="true" - snapshotBase="{$cv.generic_settings.snapshot_base}" - snapshotAdminDn="{$cv.generic_settings.snapshot_user}" - snapshotAdminPassword="{$cv.generic_settings.snapshot_password}" - snapshotURI="{$cv.generic_settings.snapshot_server}" -{else} - enableSnapshots="false" - snapshotBase="{$cv.generic_settings.snapshot_base}" - snapshotAdminDn="{$cv.generic_settings.snapshot_user}" - snapshotAdminPassword="secret" - snapshotURI="{$cv.generic_settings.snapshot_server}" + ldapTLS="TRUE" {/if} config="ou=gosa,ou=configs,ou=systems,{$cv.base}"> diff --git a/html/index.php b/html/index.php index a7661e302066c84435f73566404bbc115ddbfe90..55d3d1a881bfbca502eac5a7289ff56f30c33351 100644 --- a/html/index.php +++ b/html/index.php @@ -202,14 +202,14 @@ if (!isset($_SERVER['HTTPS']) || } /* If SSL is forced, just forward to the SSL enabled site */ -if ($config->get_cfg_value("forcessl") == 'true' && $ssl != ''){ +if ($config->get_cfg_value("forcessl") == "TRUE" && $ssl != ''){ header ("Location: $ssl"); exit; } /* Do we have htaccess authentification enabled? */ $htaccess_authenticated= FALSE; -if ($config->get_cfg_value("htaccessAuthentication") == "true" ){ +if ($config->get_cfg_value("htaccessAuthentication") == "TRUE" ){ if (!isset($_SERVER['REMOTE_USER'])){ msg_dialog::display(_("Configuration error"), _("There is a problem with the authentication setup!"), FATAL_ERROR_DIALOG); exit; @@ -255,9 +255,9 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces } /* Check for schema file presence */ - if ($config->get_cfg_value("schemaCheck") == "true"){ - $recursive = ($config->get_cfg_value("ldapFollowReferrals") == "true"); - $tls = ($config->get_cfg_value("ldapTLS") == "true"); + if ($config->get_cfg_value("schemaCheck") == "TRUE"){ + $recursive = ($config->get_cfg_value("ldapFollowReferrals") == "TRUE"); + $tls = ($config->get_cfg_value("ldapTLS") == "TRUE"); if(!count($ldap->get_objectclasses())){ msg_dialog::display(_("LDAP error"), _("Cannot detect information about the installed LDAP schema!"), ERROR_DIALOG); @@ -269,7 +269,7 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces $cfg['password'] = $config->current['ADMINPASSWORD']; $cfg['connection']= $config->current['SERVER']; $cfg['tls'] = $tls; - $str = check_schema($cfg, $config->get_cfg_value("rfc2307bis") == "true"); + $str = check_schema($cfg, $config->get_cfg_value("rfc2307bis") == "TRUE"); $checkarr = array(); foreach($str as $tr){ if(isset($tr['IS_MUST_HAVE']) && !$tr['STATUS']){ @@ -341,7 +341,7 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces session::global_set('config',$config); /* Restore filter settings from cookie, if available */ - if($config->get_cfg_value("storeFilterSettings") == "true"){ + if($config->get_cfg_value("storeFilterSettings") == "TRUE"){ if(isset($_COOKIE['FusionDirectory_Filter_Settings']) || isset($HTTP_COOKIE_VARS['FusionDirectory_Filter_Settings'])){ @@ -366,7 +366,7 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces } /* are we using accountexpiration */ - if ($config->get_cfg_value("handleExpiredAccounts") == "true"){ + if ($config->get_cfg_value("handleExpiredAccounts") == "TRUE"){ $expired= ldap_expired_account($config, $ui->dn, $ui->username); if ($expired == POSIX_ACCOUNT_EXPIRED){ diff --git a/html/logout.php b/html/logout.php index bb456d48282859bdf7381b1481a531e954ded7c1..29af961b18916377054b3b8fa3a45543f6e5594f 100644 --- a/html/logout.php +++ b/html/logout.php @@ -81,7 +81,7 @@ if (isset($_GET['request'])){ session::destroy (); /* If we're not using htaccess authentication, just redirect... */ - if (isset($config) && $config->get_cfg_value("htaccessAuthentication") == "true"){ + if (isset($config) && $config->get_cfg_value("htaccessAuthentication") == "TRUE"){ /* Else notice that the user has to close the browser... */ $smarty->assign("usePrototype", "false"); diff --git a/html/main.php b/html/main.php index efff54b66fcb9822330421743c33e5adc142d623..65b9e4a08e4fd3bed1a2195e0cd1736194320bd2 100644 --- a/html/main.php +++ b/html/main.php @@ -62,7 +62,6 @@ if ($_SERVER['REMOTE_ADDR'] != $ui->ip) { exit; } $config = session::global_get('config'); -$config->check_and_reload(); timezone::get_default_timezone(); /* Check for invalid sessions */ @@ -158,7 +157,7 @@ if (!session::global_is_set('plist')) { $plist= session::global_get('plist'); /* Check for register globals */ -if (isset($global_check) && $config->get_cfg_value("forceglobals") == "true") { +if (isset($global_check) && $config->get_cfg_value("forceglobals") == "TRUE") { msg_dialog::display( _("PHP configuration"), _("Fatal error: Register globals is on. FusionDirectory will refuse to login unless this is fixed by an administrator."), @@ -184,7 +183,7 @@ $plist->gen_menu(); /* check if we are using account expiration */ $smarty->assign("hideMenus", FALSE); -if ($config->get_cfg_value("handleExpiredAccounts") == "true") { +if ($config->get_cfg_value("handleExpiredAccounts") == "TRUE") { $expired= ldap_expired_account($config, $ui->dn, $ui->username); if ($expired == POSIX_WARN_ABOUT_EXPIRATION && !session::is_set('POSIX_WARN_ABOUT_EXPIRATION__DONE')) { @@ -439,7 +438,7 @@ if (isset($_COOKIE['FusionDirectory_Filter_Settings'])) { } /* Save filters? */ -if ($config->get_cfg_value("storeFilterSettings") == "true") { +if ($config->get_cfg_value("storeFilterSettings") == "TRUE") { $cookie_vars = array("MultiDialogFilters","CurrentMainBase"); foreach ($cookie_vars as $var) { if (session::global_is_set($var)) { diff --git a/include/class_SnapshotHandler.inc b/include/class_SnapshotHandler.inc index 57025d6a6c1901437dfbade8f4fa987e05573e08..1c822c65d1a9dd5ab3e64c423a075e38dce3b27b 100644 --- a/include/class_SnapshotHandler.inc +++ b/include/class_SnapshotHandler.inc @@ -23,7 +23,7 @@ /* * \file class_SnapshotHandler * Source code for class SnapshotHandler - */ + */ /*! * \brief This class contains all the function needed to handle @@ -43,10 +43,10 @@ class SnapshotHandler { */ function SnapshotHandler(&$config) { - $this->config = &$config; + $this->config = &$config; $config = $this->config; - if($config->get_cfg_value("enableSnapshots") == "true"){ + if($config->get_cfg_value("enableSnapshots") == "TRUE"){ /* Check if the snapshot_base is defined */ if ($config->get_cfg_value("snapshotBase") == ""){ @@ -102,17 +102,17 @@ class SnapshotHandler { * \brief Check if the snapshot is enable * * \return boolean TRUE if is enable, return FALSE otherwise - */ + */ function enabled() { return $this->isEnabled; - } + } /*! * \brief Set a new snapshot bases * * \param array $bases - */ + */ function setSnapshotBases($bases) { $this->snapshotBases= $bases; @@ -122,7 +122,7 @@ class SnapshotHandler { * \brief Get the current snapshot bases * * \return array $bases - */ + */ function getSnapshotBases() { return $this->snapshotBases; @@ -130,7 +130,7 @@ class SnapshotHandler { /*! * \brief Get a snapshot LDAP Multiplexer - */ + */ function get_snapshot_link() { $snapshotLdap= null; @@ -159,7 +159,7 @@ class SnapshotHandler { * \param string $objectBase * * \param boolean $raw false - */ + */ function getDeletedSnapshots($objectBase, $raw= false) { // Skip if not enabled @@ -223,7 +223,7 @@ class SnapshotHandler { * \brief Check if the DN has snapshots * * \return the numbers of snapshots - */ + */ function hasSnapshots($dn) { return (count($this->getSnapshots($dn)) > 0); @@ -235,7 +235,7 @@ class SnapshotHandler { * \param string $dn The DN * * \param string $raw false - */ + */ function getSnapshots($dn, $raw= false) { // Empty if disabled @@ -389,7 +389,7 @@ class SnapshotHandler { * \brief Remove a snapshot * * \param string $dn The DN - */ + */ function remove_snapshot($dn) { $ui = get_userinfo(); @@ -403,7 +403,7 @@ class SnapshotHandler { } $this->dn = $old_dn; } - + /*! * \brief Check if the snapshot is enabled * @@ -418,7 +418,7 @@ class SnapshotHandler { /*! * \brief Get the available snapshots - * + * * \return available snapshots for the given base */ function Available_SnapsShots($dn,$raw = false) @@ -483,7 +483,7 @@ class SnapshotHandler { * \param string $base_of_object * * \param boolean $raw false - */ + */ function getAllDeletedSnapshots($base_of_object,$raw = false) { if(!$this->snapshotEnabled()) return(array()); diff --git a/include/class_config.inc b/include/class_config.inc index 9aa9db4d602128fa2b9718b038f539adc8037873..f726098727f59ef151a1105eb67beeab35a9abc8 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -100,7 +100,7 @@ class config { * read the last time and reloads it. It uses the file mtime to check * weither the file changed or not. */ - function check_and_reload() + function check_and_reload($force = FALSE) { global $ui; @@ -116,7 +116,7 @@ class config { $tmp = stat(CACHE_DIR."/".CLASS_CACHE); session::global_set("class_location.inc:timestamp",$tmp['mtime']); - if($this->filename != "" && filemtime($this->filename) != $this->last_modified){ + if (($this->filename != "") && ((filemtime($this->filename) != $this->last_modified) || $force)) { $this->config_found= FALSE; $this->tags= array(); @@ -703,27 +703,29 @@ class config { } /* Get samba servers from LDAP */ - $this->data['SERVERS']['SAMBA']= array(); - $ldap->cd ($this->current['BASE']); - $ldap->search ("(objectClass=sambaDomain)"); - while ($attrs= $ldap->fetch()){ - $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]= array( "SID" =>"","RIDBASE" =>""); - if(isset($attrs["sambaSID"][0])){ - $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]["SID"] = $attrs["sambaSID"][0]; - } - if(isset($attrs["sambaAlgorithmicRidBase"][0])){ - $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]["RIDBASE"] = $attrs["sambaAlgorithmicRidBase"][0]; + if (class_available('sambaAccount')) { + $this->data['SERVERS']['SAMBA']= array(); + $ldap->cd ($this->current['BASE']); + $ldap->search ("(objectClass=sambaDomain)"); + while ($attrs= $ldap->fetch()){ + $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]= array( "SID" =>"","RIDBASE" =>""); + if(isset($attrs["sambaSID"][0])){ + $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]["SID"] = $attrs["sambaSID"][0]; + } + if(isset($attrs["sambaAlgorithmicRidBase"][0])){ + $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]["RIDBASE"] = $attrs["sambaAlgorithmicRidBase"][0]; + } } - } - /* If no samba servers are found, look for configured sid/ridbase */ - if (count($this->data['SERVERS']['SAMBA']) == 0){ - if (!isset($this->current["SAMBASID"]) || !isset($this->current["SAMBARIDBASE"])){ - msg_dialog::display(_("Configuration error"), _("sambaSID and/or sambaRidBase missing in the configuration!"), ERROR_DIALOG); - } else { - $this->data['SERVERS']['SAMBA']['DEFAULT']= array( - "SID" => $this->current["SAMBASID"], - "RIDBASE" => $this->current["SAMBARIDBASE"]); + /* If no samba servers are found, look for configured sid/ridbase */ + if (count($this->data['SERVERS']['SAMBA']) == 0) { + if (!isset($this->current["SAMBASID"]) || !isset($this->current["SAMBARIDBASE"])) { + msg_dialog::display(_("Configuration error"), _("sambaSID and/or sambaRidBase missing in the configuration!"), ERROR_DIALOG); + } else { + $this->data['SERVERS']['SAMBA']['DEFAULT']= array( + "SID" => $this->current["SAMBASID"], + "RIDBASE" => $this->current["SAMBARIDBASE"]); + } } } @@ -732,7 +734,7 @@ class config { function load_inldap_config() { $ldap = $this->get_ldap_link(); - $ldap->cat("cn=config,ou=configs,".$this->current['BASE']); + $ldap->cat(CONFIGRDN.$this->current['BASE']); if ($attrs = $ldap->fetch()) { for ($i = 0; $i < $attrs['count']; $i++) { $key = $attrs[$i]; @@ -1194,7 +1196,7 @@ class config { */ function snapshotEnabled() { - if($this->get_cfg_value("enableSnapshots") == "true"){ + if($this->get_cfg_value("enableSnapshots") == "TRUE"){ /* Check if the snapshot_base is defined */ if ($this->get_cfg_value("snapshotBase") == ""){ diff --git a/include/class_listing.inc b/include/class_listing.inc index cabb09fb065b9c9125402f14a8d4ac2cfa19946d..c763cc018b1259a28bb461b9076b8c3e75a0bee5 100644 --- a/include/class_listing.inc +++ b/include/class_listing.inc @@ -23,11 +23,11 @@ /*! * \file class_listing.inc * Source code for class listing - */ + */ /*! - * \brief This class contains all the function needed to make the list - * that show the objects inside FusionDirectory + * \brief This class contains all the function needed to make the list + * that show the objects inside FusionDirectory */ class listing { @@ -68,7 +68,7 @@ class listing { * \brief Create a listing * * \param string $filename - */ + */ function listing($filename) { global $config; @@ -93,7 +93,7 @@ class listing { } // Move footer information - $this->showFooter= ($config->get_cfg_value("listSummary") == "true"); + $this->showFooter= ($config->get_cfg_value("listSummary") == "TRUE"); // Register build in filters $this->registerElementFilter("objectType", "listing::filterObjectType"); @@ -121,7 +121,7 @@ class listing { * \param $handler The handler * * \see CopyPasteHandler - */ + */ function setCopyPasteHandler($handler) { $this->copyPasteHandler= &$handler; @@ -131,7 +131,7 @@ class listing { * \brief Set the height * * \param integer $height - */ + */ function setHeight($height) { $this->height= $height; @@ -143,7 +143,7 @@ class listing { * \param $handler The handler * * \see SnapshotHandler - */ + */ function setSnapshotHandler($handler) { $this->snapshotHandler= &$handler; @@ -155,7 +155,7 @@ class listing { * \param string $filter * * \see filter - */ + */ function setFilter($filter) { $this->filter= &$filter; @@ -172,7 +172,7 @@ class listing { * \param string $name * * \param string $call - */ + */ function registerElementFilter($name, $call) { if (!isset($this->filters[$name])) { @@ -187,7 +187,7 @@ class listing { * \brief Load a file * * \param string $filename - */ + */ function load($filename) { $contents = file_get_contents($filename); @@ -250,7 +250,7 @@ class listing { } } - return true; + return true; } @@ -310,7 +310,7 @@ class listing { /*! * \brief Render - */ + */ function render() { // Check for exeeded sizelimit @@ -333,7 +333,7 @@ class listing { $result.= "<input type='hidden' value='$this->height' id='d_height'>\n"; $height= $this->height; } - + $result.= "<div class='listContainer' id='d_scrollbody' style='border-top:1px solid #B0B0B0;border-right:1px solid #B0B0B0;width:100%;'>\n"; $result.= "<table summary='$this->headline' style='width:100%; table-layout:fixed' cellspacing='0' cellpadding='0' id='t_scrolltable'>\n"; $this->numColumns= count($this->colprops) + ($this->multiSelect?1:0); @@ -438,7 +438,7 @@ class listing { $result.="<tr>\n"; $result.= $entry['_rendered']; } - + $result.="</tr>\n"; $alt++; } @@ -504,7 +504,7 @@ class listing { /*! * \brief Update a listing - */ + */ function update() { global $config; @@ -639,7 +639,7 @@ class listing { * \brief Set a new base valor * * \param string $base - */ + */ function setBase($base) { $this->base= $base; @@ -652,7 +652,7 @@ class listing { * \brief Accessor of the base * * \return the base - */ + */ function getBase() { return $this->base; @@ -661,8 +661,8 @@ class listing { /*! * \brief Parse a layout * - * \param string $layout - */ + * \param string $layout + */ function parseLayout($layout) { $result= array(); @@ -834,7 +834,7 @@ class listing { * \param string $types * * \param string $classes - */ + */ function getObjectType($types, $classes) { // Walk thru types and see if there's something matching @@ -874,7 +874,7 @@ class listing { * \param string $dn The DN * * \param string $classes - * + * * \return string an empty string */ function filterObjectTypes($dn, $classes) @@ -892,7 +892,7 @@ class listing { * \param string $dn The DN * * \param string $classes - */ + */ function filterObjectType($dn, $classes) { // Walk thru classes and return on first match @@ -919,7 +919,7 @@ class listing { * \param string $row * * \param string $classes - */ + */ function filterActions($dn, $row, $classes) { // Do nothing if there's no menu defined @@ -1017,7 +1017,7 @@ class listing { * \param string $dn The DN * * \param array $description - */ + */ function filterDepartmentLink($row, $dn, $description) { $attr= $this->departments[$row]['sort-attribute']; @@ -1031,7 +1031,7 @@ class listing { /*! * \brief Filter link - */ + */ function filterLink() { $result= " "; @@ -1118,7 +1118,7 @@ class listing { /*! * \brief Get action - */ + */ function getAction() { // Do not do anything if this is not our PID, or there's even no PID available... @@ -1313,7 +1313,7 @@ class listing { * * \param string $classes * - */ + */ function hasActionPermission($action, $dn, $classes= null) { $ui= get_userinfo(); @@ -1393,7 +1393,7 @@ class listing { /*! * \brief Refresh the bases list - */ + */ function refreshBasesList() { global $config; @@ -1420,7 +1420,7 @@ class listing { /*! * Get the depatments - */ + */ function getDepartments() { $departments= array(); @@ -1511,7 +1511,7 @@ class listing { $result.= "<li$separator><a href='#'><img src='images/lists/paste-grey.png' alt='' border='0' class='center'> "._("Paste")."</a></li>"; } } - + return($result); } @@ -1677,7 +1677,7 @@ class listing { /*! * \brief Get listing entries - */ + */ function getEntries() { return $this->entries; @@ -1687,7 +1687,7 @@ class listing { * \brief Get type * * \param string $dn The DN - */ + */ function getType($dn) { if (isset($this->objectDnMapping[$dn])) { diff --git a/include/class_msg_dialog.inc b/include/class_msg_dialog.inc index 9626e16c57f57832530cab4badd02b4e6ed4b472..14f1eff4c6dc1361317d6244e51b09f4e48f9e38 100644 --- a/include/class_msg_dialog.inc +++ b/include/class_msg_dialog.inc @@ -22,7 +22,7 @@ /*! * \file class_msg_dialog.inc * Source code for class message dialog - */ + */ define("INFO_DIALOG" , 10001); define("WARNING_DIALOG" , 10002); @@ -31,7 +31,7 @@ define("CONFIRM_DIALOG" , 10004); define("OK_CANCEL_DIALOG" , 10005); define("FATAL_ERROR_DIALOG" , 10006); -/*! +/*! * \brief This class contains all the function needed to make messages * dialogs */ @@ -46,19 +46,19 @@ class msg_dialog /*! * \brief Message dialog constructor - * + * * \param string $s_title The title of the message dialog - * + * * \param string $s_message The message of the message dialog - * + * * \param string $i_type The type of the message dialog, by default = INFO_DIALOG - */ + */ public function __construct($s_title,$s_message,$i_type) { global $config; if(empty($s_message)) return; - + if(!in_array($i_type,array(INFO_DIALOG,WARNING_DIALOG,ERROR_DIALOG,CONFIRM_DIALOG,FATAL_ERROR_DIALOG,OK_CANCEL_DIALOG))){ trigger_error("Invalid msg_dialog type."); $i_type = INFO_DIALOG; @@ -76,15 +76,15 @@ class msg_dialog if($errorsAlreadyPosted[$s_title.$s_message] <=1 ){ - $this->i_ID = preg_replace("/[^0-9]*/","",microtime()); + $this->i_ID = preg_replace("/[^0-9]*/","",microtime()); $this->s_Title = $s_title; $this->s_Message = $s_message; $this->i_Type = $i_type; /* Append trace information, only if error messages are enabled */ - if( isset($config) && - is_object($config) && - $config->get_cfg_value("displayerrors") == "true" ){ + if( isset($config) && + is_object($config) && + $config->get_cfg_value("displayerrors") == "TRUE" ){ $this->a_Trace = debug_backtrace(); } if(!session::is_set('msg_dialogs')){ @@ -105,23 +105,23 @@ class msg_dialog /*! * \brief Display a message dialog - * + * * \param string $s_title The title of the message dialog - * + * * \param string $s_message The message of the message dialog - * + * * \param string $i_type The type of the message dialog, by default = INFO_DIALOG */ public static function display($s_title,$s_message,$i_type = INFO_DIALOG) { - new msg_dialog($s_title,$s_message,$i_type); + new msg_dialog($s_title,$s_message,$i_type); } /* * \brief Display checks - * + * * \param array $messages Contains messages - */ + */ public static function displayChecks($messages) { /* Assemble the message array to a plain string */ @@ -132,9 +132,9 @@ class msg_dialog /* * \brief Accessor of message dialog's identifier - * + * * \return The identifier of the message dialog - */ + */ public function get_ID() { return($this->i_ID); @@ -142,11 +142,11 @@ class msg_dialog /*! * \brief Run the message dialog - */ + */ public function execute() { if($this->i_Type == FATAL_ERROR_DIALOG) { - $display = + $display = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/transitional.dtd\"> <html><head> @@ -180,9 +180,9 @@ class msg_dialog /*! * \brief Check if the message is confirmed by user - * + * * \return True if is confirmed, else return false - */ + */ public function is_confirmed() { if(isset($_POST['MSG_OK'.$this->i_ID])){ @@ -191,10 +191,10 @@ class msg_dialog return(FALSE); } } - - /*! + + /*! * \brief Accessor of the message dialog - */ + */ public static function get_dialogs() { $return =""; diff --git a/include/functions.inc b/include/functions.inc index 0a8d0efbc7a05dae5d6e7f24a26573f945abc5b1..cfcaac3d4033f9007e0a573b5686ac0f043a46c5 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -514,7 +514,7 @@ function process_htaccess ($username, $kerberos= FALSE) $config->set_current($name); $mode= "kerberos"; - if ($config->get_cfg_value("useSaslForKerberos") == "true"){ + if ($config->get_cfg_value("useSaslForKerberos") == "TRUE"){ $mode= "sasl"; } @@ -1710,7 +1710,7 @@ function strict_uid_mode() global $config; if (isset($config)){ - return ($config->get_cfg_value("strictNamingRules") == "true"); + return ($config->get_cfg_value("strictNamingRules") == "TRUE"); } return (TRUE); } diff --git a/include/password-methods/class_password-methods.inc b/include/password-methods/class_password-methods.inc index 704ca88bfd62064df53a524695bbb50ee005e9d6..2c5ba7c7435194126c112a0ed0f24a125af5210b 100644 --- a/include/password-methods/class_password-methods.inc +++ b/include/password-methods/class_password-methods.inc @@ -416,7 +416,7 @@ class passwordMethod { global $config; - if ($config->get_cfg_value("strictPasswordRules") == "true") { + if ($config->get_cfg_value("strictPasswordRules") == "TRUE") { // Do we have UTF8 characters in the password? return ($password == utf8_decode($password)); } diff --git a/include/variables_common.inc b/include/variables_common.inc index ed5d018724a89c8e489de54f5ee8d80299bd525e..2fb484f49c324387fa6edf05f8a889effc0a26d2 100644 --- a/include/variables_common.inc +++ b/include/variables_common.inc @@ -80,4 +80,9 @@ define ("MKNTPWD", "/usr/sbin/fusiondirectory-mkntpassword"); /*! Define the nam * \brief FusionDirectory Version */ define ("FD_VERSION", "1.0.4"); /*! Define FusionDirectory version */ + +/*! + * \brief FusionDirectory config object RDN + */ +define ("CONFIGRDN", "cn=fusiondirectory,ou=configs,"); /*! Define FusionDirectory config object */ ?> diff --git a/plugins/admin/acl/class_aclManagement.inc b/plugins/admin/acl/class_aclManagement.inc index 2891c8d1544a4aaeb2f973e952a6af80a228791d..d58cfa56ddae89ba0469dd0c7384e00cfac7a99d 100644 --- a/plugins/admin/acl/class_aclManagement.inc +++ b/plugins/admin/acl/class_aclManagement.inc @@ -26,7 +26,7 @@ class aclManagement extends management var $plDescription = "Manage access control lists"; var $plIcon = "plugins/acl/images/plugin.png"; - // Tab definition + // Tab definition protected $tabClass = "aclroletab"; protected $tabType = "ACLROLETAB"; protected $aclCategory = "acl"; @@ -37,7 +37,7 @@ class aclManagement extends management { $this->config = $config; $this->ui = $ui; - + $this->storagePoints = array(get_ou("aclRoleRDN")); // ACLs are attached to department containers // Build filter @@ -58,7 +58,7 @@ class aclManagement extends management if ($this->config->boolValueIsTrue("main", "copyPaste")){ $this->cpHandler = new CopyPasteHandler($this->config); } - if($this->config->get_cfg_value("enableSnapshots") == "true"){ + if($this->config->get_cfg_value("enableSnapshots") == "TRUE"){ $this->snapHandler = new SnapshotHandler($this->config); } @@ -118,7 +118,7 @@ class aclManagement extends management { $this->skipFooter = TRUE; if(count($target) == 1){ - + // Set dummy tab object... $this->dn = array_pop($target); $headpage = $this->getHeadpage(); @@ -141,7 +141,7 @@ class aclManagement extends management if(isset($_POST['edit_role'])) $action['action'] = "edit_role"; return($action); } - + // A filter which allows to open a department by clicking on the departments name. static function filterLabel($row,$dn,$ou= array(),$pid=0,$base="") @@ -159,6 +159,6 @@ class aclManagement extends management } -} +} // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc index 7662f41a8614ca826424182fd8e05ea0dfbc8ac3..e84ad6f57441f80f80903924c1a2ad1afbac8cbf 100644 --- a/plugins/admin/departments/class_departmentManagement.inc +++ b/plugins/admin/departments/class_departmentManagement.inc @@ -26,7 +26,7 @@ class departmentManagement extends management var $plDescription = "Manage Departments"; var $plIcon = "plugins/departments/images/plugin.png"; - // Tab definition + // Tab definition protected $tabClass = "deptabs"; protected $tabType = "DEPTABS"; protected $aclCategory = "department"; @@ -37,7 +37,7 @@ class departmentManagement extends management { $this->config = $config; $this->ui = $ui; - + // Build filter if (session::global_is_set(get_class($this)."_filter")){ $filter= session::global_get(get_class($this)."_filter"); @@ -56,7 +56,7 @@ class departmentManagement extends management if ($this->config->boolValueIsTrue("main", "copyPaste")){ $this->cpHandler = new CopyPasteHandler($this->config); } - if($this->config->get_cfg_value("enableSnapshots") == "true"){ + if($this->config->get_cfg_value("enableSnapshots") == "TRUE"){ $this->snapHandler = new SnapshotHandler($this->config); } @@ -114,7 +114,7 @@ class departmentManagement extends management $str = management::saveChanges(); if(!empty($str)) return($str); - $this->refreshDeps(); + $this->refreshDeps(); /* // FIXME : what was this code for? Is it useful? What is department tagging? $plugname = $this->last_tabObject->base_name; @@ -127,17 +127,17 @@ class departmentManagement extends management */ } - + function refreshDeps() { - global $config; + global $config; $config->get_departments(); $config->make_idepartments(); $this->config = $config; $headpage = $this->getHeadpage(); $headpage->refreshBasesList(); } - + // An action handler which enables to switch into deparmtment by clicking the names. function openEntry($action,$entry) @@ -151,7 +151,7 @@ class departmentManagement extends management protected function removeEntryRequested($action="",$target=array(),$all=array()) { $target = array_remove_entries(array($this->config->current['BASE']),$target); - return(management::removeEntryRequested($action,$target,$all)); + return(management::removeEntryRequested($action,$target,$all)); } @@ -166,7 +166,7 @@ class departmentManagement extends management return("<a href='?plug=".$_GET['plug']."&PID=$pid&act=listing_open_$row' title='$dn'>$ou</a>"); } - + // Finally remove departments and update departmnet browsers function removeEntryConfirmed($action="",$target=array(),$all=array(),$altTabClass="",$altTabType="",$altAclCategory="") { @@ -179,20 +179,20 @@ class departmentManagement extends management */ public static function get_support_departments() { - /* Domain - */ + /* Domain + */ $types = array(); - $types['domain']['ACL'] = "domain"; - $types['domain']['CLASS'] = "domain"; - $types['domain']['ATTR'] = "dc"; - $types['domain']['TAB'] = "DOMAIN_TABS"; - $types['domain']['OC'] = "domain"; - $types['domain']['IMG'] = "plugins/departments/images/domain.png"; - $types['domain']['IMG_FULL']= "plugins/departments/images/domain.png"; - $types['domain']['TITLE'] = _("Domain"); - $types['domain']['TPL'] = "domain.tpl"; - - /* Domain component + $types['domain']['ACL'] = "domain"; + $types['domain']['CLASS'] = "domain"; + $types['domain']['ATTR'] = "dc"; + $types['domain']['TAB'] = "DOMAIN_TABS"; + $types['domain']['OC'] = "domain"; + $types['domain']['IMG'] = "plugins/departments/images/domain.png"; + $types['domain']['IMG_FULL']= "plugins/departments/images/domain.png"; + $types['domain']['TITLE'] = _("Domain"); + $types['domain']['TPL'] = "domain.tpl"; + + /* Domain component */ $types['dcObject']['ACL'] = "dcObject"; $types['dcObject']['CLASS'] = "dcObject"; @@ -253,6 +253,6 @@ class departmentManagement extends management $types['organizationalUnit']['TPL'] = "generic.tpl"; return($types); } -} +} // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/groups/class_group.inc b/plugins/admin/groups/class_group.inc index 0c621f8f581116fc253feeda6433064a2660175d..93f419e4f90946e018b0dec7047d594707b3f209 100644 --- a/plugins/admin/groups/class_group.inc +++ b/plugins/admin/groups/class_group.inc @@ -78,7 +78,7 @@ class group extends plugin function group (&$config, $dn= NULL) { /* Set rfc2307bis flag */ - if ($config->get_cfg_value("rfc2307bis") == "true"){ + if ($config->get_cfg_value("rfc2307bis") == "TRUE"){ $this->rfc2307bis= TRUE; $this->attributes[]= "member"; $this->objectclasses[]= "groupOfNames"; @@ -922,7 +922,7 @@ class group extends plugin /* User wants me to fake the idMappings? This is useful for making winbind resolve the group names in a reasonable amount of time in combination with larger databases. */ - if ($this->config->get_cfg_value("sambaidmapping") == "true"){ + if ($this->config->get_cfg_value("sambaidmapping") == "TRUE"){ $this->attrs['objectClass'][]= "sambaIdmapEntry"; } diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index 6f520c8eded84af8ad3ee2d154665924d10b32ca..2cd98a4bb902a2ef3ada5c82c97b287f963d0981 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -58,7 +58,7 @@ class groupManagement extends management if ($this->config->boolValueIsTrue("main", "copyPaste")){ $this->cpHandler = new CopyPasteHandler($this->config); } - if($this->config->get_cfg_value("enableSnapshots") == "true"){ + if($this->config->get_cfg_value("enableSnapshots") == "TRUE"){ $this->snapHandler = new SnapshotHandler($this->config); } parent::__construct($config, $ui, "groups", $headpage); diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index a06993254bef8bed00be73228ff9a8c3ce10dd48..9deece55fadce652fe6385311deb2561d3c42257 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -26,7 +26,7 @@ class ogroupManagement extends management var $plDescription = "Manage object groups"; var $plIcon = "plugins/ogroups/images/plugin.png"; - // Tab definition + // Tab definition protected $tabClass = "ogrouptabs"; protected $tabType = "OGROUPTABS"; protected $aclCategory = "ogroups"; @@ -58,7 +58,7 @@ class ogroupManagement extends management if ($this->config->boolValueIsTrue("main", "copyPaste")){ $this->cpHandler = new CopyPasteHandler($this->config); } - if($this->config->get_cfg_value("enableSnapshots") == "true"){ + if($this->config->get_cfg_value("enableSnapshots") == "TRUE"){ $this->snapHandler = new SnapshotHandler($this->config); } parent::__construct($config, $ui, "ogroups", $headpage); @@ -126,7 +126,7 @@ class ogroupManagement extends management if(class_available("DaemonEvent_notify")){ - // Resolv targets + // Resolv targets $targets = array(); $m_list = array(); $ldap = $this->config->get_ldap_link(); @@ -160,7 +160,7 @@ class ogroupManagement extends management } } } - + // We've at least one recipient if(count($targets)){ $events = DaemonEvent::get_event_types(USER_EVENT); @@ -202,6 +202,6 @@ class ogroupManagement extends management } return($result); } -} +} // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index 409c7120b22547d65956bb40f92399051861ef0a..2f4f0abb0ddd082f2508a3f5589d7e229699b2b6 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -77,7 +77,7 @@ class userManagement extends management if ($this->config->boolValueIsTrue("main", "copyPaste")){ $this->cpHandler = new CopyPasteHandler($this->config); } - if($this->config->get_cfg_value("enableSnapshots") == "true"){ + if($this->config->get_cfg_value("enableSnapshots") == "TRUE"){ $this->snapHandler = new SnapshotHandler($this->config); } diff --git a/plugins/config/class_configInLdap.inc b/plugins/config/class_configInLdap.inc index 6273d550d693232ad31c894013d271b965ba1dd1..7e0f0353580a85a8d874bf024592ec8780aa8015 100644 --- a/plugins/config/class_configInLdap.inc +++ b/plugins/config/class_configInLdap.inc @@ -389,12 +389,6 @@ class configInLdap extends simplePlugin } - function save() - { - parent::save(); - $this->config->check_and_reload(); - } - static function get_themes() { $themesdir = '../ihtml/themes/'; diff --git a/plugins/config/main.inc b/plugins/config/main.inc index feff68da3dce94024eec2a0a7b8bd71c65e49f33..65ba094bae66c8b4ae6a68e251b7440274555fdd 100644 --- a/plugins/config/main.inc +++ b/plugins/config/main.inc @@ -17,6 +17,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -$configBranch = 'ou=configs,'.$config->current['BASE']; -configInLdap::userMainInc('configInLdap', "cn=config,$configBranch", TRUE); + +configInLdap::userMainInc('configInLdap', CONFIGRDN.$config->current['BASE'], 'tabs_configInLdap'); ?> diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 805dec4b3f421543c7665a8d3bd66b1db782a1a2..c7a647aa010e2ee8f6fc3d7b6cfd3e8742f91c04 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -142,7 +142,7 @@ class user extends plugin $this->config= $config; /* Configuration is fine, allways */ - if($this->config->get_cfg_value("honourIvbbAttributes") == "true"){ + if($this->config->get_cfg_value("honourIvbbAttributes") == "TRUE"){ $this->governmentmode = TRUE; $this->attributes=array_merge($this->attributes,$this->govattrs); } @@ -1096,11 +1096,11 @@ class user extends plugin die ("Could not connect to LDAP server"); } ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); - if (function_exists("ldap_set_rebind_proc") && $this->config->get_cfg_value("ldapFollowReferrals") == "true") { + if (function_exists("ldap_set_rebind_proc") && $this->config->get_cfg_value("ldapFollowReferrals") == "TRUE") { ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1); ldap_set_rebind_proc($ds, array(&$this, "rebind")); } - if($this->config->get_cfg_value("ldapTLS") == "true"){ + if($this->config->get_cfg_value("ldapTLS") == "TRUE"){ ldap_start_tls($ds); } if (!($res = @ldap_bind($ds, $this->config->current['ADMIN'], @@ -1203,7 +1203,7 @@ class user extends plugin } else { $pt= ""; - if($this->config->get_cfg_value("personalTitleInDN") == "true"){ + if($this->config->get_cfg_value("personalTitleInDN") == "TRUE"){ if(!empty($this->personalTitle)){ $pt = $this->personalTitle." "; } @@ -1382,11 +1382,11 @@ class user extends plugin { $ds= ldap_connect($this->config->current['SERVER']); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); - if (function_exists("ldap_set_rebind_proc") && $this->config->get_cfg_value("ldapFollowReferrals") == "true"){ + if (function_exists("ldap_set_rebind_proc") && $this->config->get_cfg_value("ldapFollowReferrals") == "TRUE"){ ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1); ldap_set_rebind_proc($ds, array(&$this, "rebind")); } - if ($this->config->get_cfg_value("ldapTLS") == "true"){ + if ($this->config->get_cfg_value("ldapTLS") == "TRUE"){ ldap_start_tls($ds); } @@ -1683,7 +1683,7 @@ class user extends plugin /* Append government attributes if required */ global $config; - if($config->get_cfg_value("honourIvbbAttributes") == "true"){ + if($config->get_cfg_value("honourIvbbAttributes") == "TRUE"){ foreach($govattrs as $attr => $desc){ $ret["plProvidedAcls"][$attr] = $desc; } diff --git a/plugins/personal/password/class_password.inc b/plugins/personal/password/class_password.inc index 254dd8b73c53432d19141192fae9c3a23db5f9bf..ca7386a36215e7105cacbfb722f47f75e57f7e38 100644 --- a/plugins/personal/password/class_password.inc +++ b/plugins/personal/password/class_password.inc @@ -70,7 +70,7 @@ class password extends plugin /* Display expiration template */ $smarty->assign("passwordExpired", FALSE); - if ($this->config->get_cfg_value("handleExpiredAccounts") == "true"){ + if ($this->config->get_cfg_value("handleExpiredAccounts") == "TRUE"){ $expired= ldap_expired_account($this->config, $ui->dn, $ui->username); $smarty->assign("passwordExpired", $expired & POSIX_FORCE_PASSWORD_CHANGE); if($expired == POSIX_DISALLOW_PASSWORD_CHANGE){ @@ -152,8 +152,8 @@ class password extends plugin $ui->dn, $current_password, $this->config->current['SERVER'], - $this->config->get_cfg_value("ldapFollowReferrals") == "true", - $this->config->get_cfg_value("ldapTLS") == "true"); + $this->config->get_cfg_value("ldapFollowReferrals") == "TRUE", + $this->config->get_cfg_value("ldapTLS") == "TRUE"); /* connection Successfull ? */ if (!$tldap->success()){ diff --git a/setup/class_setup.inc b/setup/class_setup.inc index 62d89427e9eb2fab7ab3a35df1c7566138b3f678..fba14e46cce6eb1c7442b6ee739f6f4647c6460a 100644 --- a/setup/class_setup.inc +++ b/setup/class_setup.inc @@ -23,17 +23,17 @@ require_once("class_setupStep.inc"); -class setup +class setup { - var $i_steps = 9; // Number of setup steps + var $i_steps = 9; // Number of setup steps var $i_current= 1; // Current step var $i_last = 1; // Last setup step; - var $o_steps = array(); + var $o_steps = array(); var $captured_values = array(); function setup() { - $i = 1; + $i = 1; $this->o_steps[$i++] = new Step_Welcome(); $this->o_steps[$i++] = new Step_Language(); $this->o_steps[$i++] = new Step_Checks(); @@ -52,7 +52,7 @@ class setup header("Location: index.php") ; exit(); } - + foreach($this->o_steps as $key => $step){ $this->o_steps[$key]->parent = &$this; } @@ -112,27 +112,27 @@ class setup /* Check if step was selected */ if(isset($_GET['step']) || isset($_POST['next']) || isset($_POST['last'])){ - /* check if current setup step is completed now + /* check if current setup step is completed now and activate the next step if possible */ for($i = 1 ; $i <= $this->i_steps ; $i ++ ){ if($this->o_steps[$i]->is_completed()){ if(isset($this->o_steps[($i+1)])){ $this->o_steps[($i+1)]->set_enabled(); } - }else{ + } else { $this->disable_steps_from($i+1); } } } - + /* Disable all following steps, if one step isn't compelted right now .*/ for($i = 1 ; $i <= $this->i_steps ; $i ++ ){ if($this->o_steps[$i]->is_completed()){ - }else{ + } else { $this->disable_steps_from($i+1); } } - + $step = -1; if(isset($_POST['setup_goto_step'])){ @@ -146,7 +146,7 @@ class setup }elseif(isset($_POST['last'])){ $step = $this->i_current - 1; } - + $once = true; foreach($_POST as $name => $value){ if(preg_match("/^step_[0-9]*$/",$name) && $once ){ @@ -169,7 +169,7 @@ class setup $found = true; } - if($found){ + if($found){ $this->o_steps[$key]->set_enabled(false); $this->o_steps[$key]->set_completed(false); } @@ -192,48 +192,48 @@ class setup $b_completed= $step -> is_completed(); if($b_completed){ - $s = "<img src='images/true.png' alt='"._("Completed")."' class='center'> "; - }else{ + $s = "<img src='images/true.png' alt='"._("Completed")."' class='center'> "; + } else { $s = "<img src='images/empty.png' alt=' ' class='center'> "; } if(session::get('js')){ $str .="<div >"; - + if($b_enabled){ if($b_active){ $str .= "<div class='navigation_element_active'>"; $str .= "<div class='navigation_title_active'>".$s.$s_title."</div>"; $str .= "<div class='navigation_info'>".$s_info."</div>"; $str .= "</div>"; - }else{ + } else { $str .= "<div class='navigation_element'>"; $str .= "<div onClick='document.mainform.setup_goto_step.value=\"$key\";document.mainform.submit();' class='navigation_title_inactive'>".$s.$s_title."</div>"; $str .= "</div>"; } - }else{ + } else { $str .= "<div class='navigation_element'>"; $str .= "<div class='navigation_title_disabled'>".$s.$s_title."</div>"; $str .= "</div>"; } $str .= "</div>" ; - }else{ + } else { $str .="<div >"; if($b_enabled){ if($b_active){ $str .= "<div class='navigation_element_active'>"; - $str .= "<input style='text-align: left; color: #00008F; font-weight: bold; width:100%;' + $str .= "<input style='text-align: left; color: #00008F; font-weight: bold; width:100%;' type='button' value='".$s_title."' name='step_".$key."'>"; $str .= "</div>"; - }else{ + } else { $str .= "<div class='navigation_element'>"; - $str .= "<input style='text-align: left; color: #00008F; font-weight: bold; width:100%;' + $str .= "<input style='text-align: left; color: #00008F; font-weight: bold; width:100%;' type='submit' value='".$s_title."' name='step_".$key."'>"; $str .= "</div>"; } - }else{ + } else { $str .= "<div class='navigation_element'>"; $str .= "<div class='navigation_title_disabled'>".$s_title."</div>"; $str .= "</div>"; @@ -247,17 +247,17 @@ class setup function get_bottom_html() { - /* Skip adding forward/backward button, - * if the currently opened step is a sub dialog + /* Skip adding forward/backward button, + * if the currently opened step is a sub dialog */ if($this->o_steps[$this->i_current]->dialog){ $str =""; - }else{ + } else { $str ="<p class='seperator' style='margin-bottom:10px;'> </p>"; $str.=" <div style='text-align:right;float:top;'>"; if(isset($this->o_steps[$this->i_current -1]) && $this->o_steps[$this->i_current -1]->is_enabled()){ $str .= "<input type='submit' name='last' value='".msgPool::backButton()."'>"; - }else{ + } else { $str .= "<input type='button' name='last' value='".msgPool::backButton()."' disabled>"; } $str.= " "; @@ -294,7 +294,7 @@ class setup } return(0); } - + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/setup/class_setupStep.inc b/setup/class_setupStep.inc index 9b24053b3c9386b9dd3e000aa71a3789fa172a1c..6c06871aaadd56941f8cc5f16b4dabe83cd672d8 100644 --- a/setup/class_setupStep.inc +++ b/setup/class_setupStep.inc @@ -34,13 +34,13 @@ class setup_step extends plugin var $attributes = array(); var $parent = NULL; var $dialog = FALSE; - + function setup_step() { } function execute() - { + { } function save_object() @@ -49,20 +49,20 @@ class setup_step extends plugin } function get_title() - { + { return($this->s_title); } function get_long_title() - { + { return($this->s_title_long); } function get_small_info() - { + { return($this->s_info); } - + function is_active() { return($this->is_active); @@ -80,28 +80,28 @@ class setup_step extends plugin function set_active($value = TRUE) { - if($value){ - $this->is_active = TRUE; - }else{ - $this->is_active = FALSE; + if($value){ + $this->is_active = TRUE; + } else { + $this->is_active = FALSE; } } function set_enabled($value = TRUE) { - if($value){ - $this->is_enabled = TRUE; - }else{ - $this->is_enabled = FALSE; + if($value){ + $this->is_enabled = TRUE; + } else { + $this->is_enabled = FALSE; } } function set_completed($value = TRUE) { - if($value){ - $this->is_completed = TRUE; - }else{ - $this->is_completed = FALSE; + if($value){ + $this->is_completed = TRUE; + } else { + $this->is_completed = FALSE; } } diff --git a/setup/class_setupStep_Config1.inc b/setup/class_setupStep_Config1.inc index 96fcc8a8cf7745ba50b540a9c9aa53ffa81e1b8c..4fa917856ea985d5b998e6885bf3d0bd4d1df681 100644 --- a/setup/class_setupStep_Config1.inc +++ b/setup/class_setupStep_Config1.inc @@ -27,16 +27,15 @@ class Step_Config1 extends setup_step var $groupou = "ou=groups"; var $peopledn = "uid"; var $uidbase = 1100; - var $krbsasl = FALSE; var $strict = TRUE; var $cngen_active = FALSE; var $cngen = "%sn %givenName"; - var $header_image = "images/setup/server.png"; - var $account_expiration =FALSE; - var $base_hook = ""; - var $base_hook_active = FALSE; + var $header_image = "images/setup/server.png"; + var $account_expiration = FALSE; + var $base_hook = ""; + var $base_hook_active = FALSE; var $encryption = "crypt/md5"; var $theme = "default"; @@ -57,7 +56,7 @@ class Step_Config1 extends setup_step var $crypt_methods = array(); - var $attributes = array("peopleou","groupou","peopledn","uidbase","encryption","theme","krbsasl", + var $attributes = array("peopleou","groupou","peopledn","uidbase","encryption","theme", "base_hook","base_hook_active","account_expiration","strict","include_personal_title", "cngen_active","cngen"); @@ -66,7 +65,7 @@ class Step_Config1 extends setup_step $this->update_strings(); $tmp = passwordMethod::get_available_methods(); - foreach($tmp['name'] as $name){ + foreach ($tmp['name'] as $name) { $this->crypt_methods[$name] = $name; } } @@ -84,20 +83,20 @@ class Step_Config1 extends setup_step { global $BASE_DIR; $smarty = get_smarty(); - $smarty->assign("peopledns",array("uid","cn")); - $smarty->assign("id_settings", reverse_html_entities($this->id_settings)); - $smarty->assign("crypt_methods", reverse_html_entities($this->crypt_methods)); - $smarty->assign("themes", reverse_html_entities($this->get_themes())); - $smarty->assign("pwd_rules", reverse_html_entities($this->pwd_rules)); - $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes"))); - foreach($this->attributes as $attr){ - $smarty->assign($attr,htmlentities($this->$attr,ENT_QUOTES,"UTF-8")); + $smarty->assign("peopledns", array("uid","cn")); + $smarty->assign("id_settings", reverse_html_entities($this->id_settings)); + $smarty->assign("crypt_methods", reverse_html_entities($this->crypt_methods)); + $smarty->assign("themes", reverse_html_entities($this->get_themes())); + $smarty->assign("pwd_rules", reverse_html_entities($this->pwd_rules)); + $smarty->assign("bool", array(FALSE => _("No"), TRUE => _("Yes"))); + foreach ($this->attributes as $attr) { + $smarty->assign($attr, htmlentities($this->$attr, ENT_QUOTES, "UTF-8")); } /* !!! Attention strict is inverse. If you change this, * don't forget to change save_object too */ - $smarty->assign("strict",!$this->strict); + $smarty->assign("strict", !$this->strict); return $smarty->fetch("$BASE_DIR/setup/setup_config1.tpl"); } @@ -106,50 +105,50 @@ class Step_Config1 extends setup_step { $dir = opendir( "../ihtml/themes/"); $themes = array(); - while (($file = readdir($dir)) !== false){ - if(is_dir("../ihtml/themes/".$file) && !preg_match("/^\./",$file)){ + while (($file = readdir($dir)) !== FALSE) { + if (is_dir("../ihtml/themes/".$file) && !preg_match("/^\./", $file)) { $themes[$file] = $file; } } - return($themes); + return $themes; } function check() { $message = array(); - if(isset($this->id_settings['minid_active']) && !is_numeric($this->id_settings['minid'])){ - $message[] = sprintf(_("The specified value for '%s' must be a numeric value"),_("GID / UID min id")); + if (isset($this->id_settings['minid_active']) && !is_numeric($this->id_settings['minid'])) { + $message[] = sprintf(_("The specified value for '%s' must be a numeric value"), _("GID / UID min id")); } - if(preg_match("/,$/",$this->peopleou)){ - $message[] =sprintf(_("Don't add a trailing comma to '%s'."),_("People storage ou")); + if (preg_match("/,$/", $this->peopleou)) { + $message[] = sprintf(_("Don't add a trailing comma to '%s'."), _("People storage ou")); } - if(preg_match("/,$/",$this->groupou)){ - $message[] =sprintf(_("Don't add a trailing comma to '%s'."),_("Group storage ou")); + if (preg_match("/,$/", $this->groupou)) { + $message[] = sprintf(_("Don't add a trailing comma to '%s'."), _("Group storage ou")); } - if(!is_numeric($this->uidbase)){ + if (!is_numeric($this->uidbase)) { $message[] = _("Uid base must be numeric"); } - if(($this->pwd_rules['pwminlen_active']) && !is_numeric($this->pwd_rules['pwminlen'])){ + if (($this->pwd_rules['pwminlen_active']) && !is_numeric($this->pwd_rules['pwminlen'])) { $message[] = _("The given password minimum length is not numeric."); } - if(($this->pwd_rules['pwdiffer_active']) && !is_numeric($this->pwd_rules['pwdiffer'])){ + if (($this->pwd_rules['pwdiffer_active']) && !is_numeric($this->pwd_rules['pwdiffer'])) { $message[] = _("The given password differ value is not numeric."); } - return($message); + return $message; } function save_object() { - if(isset($_POST['step5_posted'])){ + if (isset($_POST['step5_posted'])) { /* Get attributes */ - foreach($this->attributes as $attr){ - if(isset($_POST[$attr])){ + foreach ($this->attributes as $attr) { + if (isset($_POST[$attr])) { $this->$attr = validate(get_post($attr)); } } @@ -157,70 +156,70 @@ class Step_Config1 extends setup_step /* !!! Attention strict is inverse. If you change this, * don't forget to change the smarty assignment too */ - if(isset($_POST['strict'])){ - if($_POST['strict']){ + if (isset($_POST['strict'])) { + if ($_POST['strict']) { $this->strict = FALSE; - }else{ + } else { $this->strict = TRUE; } } - if(isset($_POST['minid_active'])){ + if (isset($_POST['minid_active'])) { $this->id_settings['minid_active'] = TRUE; - if(isset($_POST['minid'])){ + if (isset($_POST['minid'])) { $this->id_settings['minid'] = get_post('minid'); } - }else{ + } else { $this->id_settings['minid_active'] = FALSE; } /* Generic settings */ - if(isset($_POST['idgen_active'])){ + if (isset($_POST['idgen_active'])) { $this->id_settings['idgen_active'] = TRUE; - if(isset($_POST['idgen'])){ + if (isset($_POST['idgen'])) { $this->id_settings['idgen'] = get_post('idgen'); } - }else{ + } else { $this->id_settings['idgen_active'] = FALSE; } /* Get password settings */ - if(isset($_POST['pwdiffer_active'])){ + if (isset($_POST['pwdiffer_active'])) { $this->pwd_rules['pwdiffer_active'] = TRUE; - if(isset($_POST['pwdiffer'])){ + if (isset($_POST['pwdiffer'])) { $this->pwd_rules['pwdiffer'] = get_post('pwdiffer'); } - }else{ + } else { $this->pwd_rules['pwdiffer_active'] = FALSE; } /* Get password minimum length posts */ - if(isset($_POST['pwminlen_active'])){ + if (isset($_POST['pwminlen_active'])) { $this->pwd_rules['pwminlen_active'] = TRUE; - if(isset($_POST['pwminlen'])){ + if (isset($_POST['pwminlen'])) { $this->pwd_rules['pwminlen'] = get_post('pwminlen'); } - }else{ + } else { $this->pwd_rules['pwminlen_active'] = FALSE; } /* External pwd settings */ - if(isset($_POST['externalpwdhook_active'])){ + if (isset($_POST['externalpwdhook_active'])) { $this->pwd_rules['externalpwdhook_active'] = TRUE; - if(isset($_POST['externalpwdhook'])){ + if (isset($_POST['externalpwdhook'])) { $this->pwd_rules['externalpwdhook'] = get_post('externalpwdhook'); } - }else{ + } else { $this->pwd_rules['externalpwdhook_active'] = FALSE; } /* base hook settings */ -/* if(isset($_POST['base_hook_active'])){ +/* if (isset($_POST['base_hook_active'])) { $this->pwd_rules['base_hook_active'] = TRUE; - if(isset($_POST['base_hook'])){ + if (isset($_POST['base_hook'])) { $this->pwd_rules['base_hook'] = get_post('base_hook'); } - }else{*/ + } else {*/ $this->pwd_rules['base_hook_active'] = FALSE; /* }*/ @@ -235,9 +234,9 @@ class Step_Config1 extends setup_step } $tmp = $this->check(); - if(count($tmp) == 0){ + if (count($tmp) == 0) { $this->is_completed = TRUE; - }else{ + } else { $this->is_completed = FALSE; } } // if template posted @@ -247,12 +246,11 @@ class Step_Config1 extends setup_step function get_attributes() { $tmp = setup_step::get_attributes(); - foreach(array("pwd_rules","id_settings") as $attr){ - $tmp[$attr]= $this->$attr; + foreach (array("pwd_rules","id_settings") as $attr) { + $tmp[$attr] = $this->$attr; } - return($tmp); + return $tmp; } -}// CLass +} -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/setup/class_setupStep_Config2.inc b/setup/class_setupStep_Config2.inc index 966f5bbd0196a29c9daf03ee0d2d0fad23b1ab4b..cda5ff8ed5eea994fad2bc136a723239d1444307 100644 --- a/setup/class_setupStep_Config2.inc +++ b/setup/class_setupStep_Config2.inc @@ -25,52 +25,25 @@ class Step_Config2 extends setup_step { var $governmentmode = FALSE; var $sambaidmapping = FALSE; - var $header_image = "images/setup/server.png"; + var $header_image = "images/setup/server.png"; - var $cyrusunixstyle = FALSE; - var $mail = "none"; - var $mail_attrib = ""; - var $mail_methods = array(); - var $mail_settings = array("vacationdir" => VACATION_DIR, - "vacationdir_active" => FALSE); - - var $generic_settings = array( "wws_ou" => "ou=computers", - "wws_ou_active" => FALSE, - "snapshot_active" => FALSE, + var $generic_settings = array( "snapshot_active" => FALSE, "snapshot_base" => "ou=snapshots,%base%", "snapshot_user" => "%admin%", "snapshot_password" => "", "snapshot_server" => "%connection%"); - var $samba_settings = array( "samba_sid" => "0-815-4711", - "samba_sid_active" => FALSE, - "samba_rid" => 1000, - "smbhash" => 'SMBHASH', - "samba_rid_active" => FALSE); - - var $sambaDomain_found = FALSE; var $timezone = "Europe/Paris"; var $timezones = array(); - var $attributes = array("mail_attrib","sambaidmapping","cyrusunixstyle","mail","timezone"); + var $attributes = array("timezone"); var $called = FALSE; function Step_Config2() { $this->update_strings(); - $this->mail_methods = $this->get_available_mail_classes(); - - /* Look for samba password generation method */ - if(file_exists(MKNTPWD)){ - $pwdhash = MKNTPWD; - } elseif (preg_match("/^Usage: fusiondirectory-mkntpassword <password>/", shell_exec (MKNTPWD))){ - $pwdhash = MKNTPWD; - } else { - $pwdhash = 'perl -MCrypt::SmbHash -e "print join(q[:], ntlmgen \$ARGV[0]), $/;"'; - } $this->timezones = timezone::_get_tz_zones(); - $this->samba_settings['smbhash'] = $pwdhash; } @@ -85,146 +58,69 @@ class Step_Config2 extends setup_step function execute() { global $BASE_DIR; - $this->mail_methods = $this->get_available_mail_classes(); - /* On first call check for rid/sid base */ - $cv = $this->parent->captured_values; - $ldap_l = new LDAP($cv['admin'], - $cv['password'], - $cv['connection'], - FALSE, - $cv['tls']); - - $ldap = new ldapMultiplexer($ldap_l); - - $ldap->cd($cv['base']); - $ldap->search("(objectClass=sambaDomain)",array("dn")); - if($ldap->count()){ - $this->sambaDomain_found =TRUE; - }else{ - $this->sambaDomain_found =FALSE; - } - - if(!$this->called){ - if(!$this->sambaDomain_found){ - $this->samba_settings['samba_sid_active'] = TRUE; - $this->samba_settings['samba_rid_active'] = TRUE; - } - - $this->called = TRUE; - } /* Update snapshot values, with already collected values */ - foreach($this->generic_settings as $key => $value){ - foreach(array("snapshot_base","snapshot_user","snapshot_server") as $attr){ - foreach($this->parent->captured_values as $replace_name => $replace_value){ - if(is_string($replace_value)) { - $this->generic_settings[$attr] = preg_replace("/%".$replace_name."%/",$replace_value,$this->generic_settings[$attr]); + foreach ($this->generic_settings as $key => $value) { + foreach (array("snapshot_base","snapshot_user","snapshot_server") as $attr) { + foreach ($this->parent->captured_values as $replace_name => $replace_value) { + if (is_string($replace_value)) { + $this->generic_settings[$attr] = preg_replace("/%".$replace_name."%/", $replace_value, $this->generic_settings[$attr]); } } } } $smarty = get_smarty(); - $smarty->assign("sambaDomain_found", $this->sambaDomain_found); $smarty->assign("generic_settings", reverse_html_entities($this->generic_settings)); - $smarty->assign("mail_settings", reverse_html_entities($this->mail_settings)); - $smarty->assign("mail_methods", reverse_html_entities($this->mail_methods)); - $smarty->assign("samba_settings", reverse_html_entities($this->samba_settings)); - $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes"))); - foreach($this->attributes as $attr){ - $smarty->assign($attr,reverse_html_entities($this->$attr)); + $smarty->assign("bool", array(FALSE => _("No"), TRUE => _("Yes"))); + + foreach ($this->attributes as $attr) { + $smarty->assign($attr, reverse_html_entities($this->$attr)); } - $smarty->assign("timezone" ,$this->timezone); - $smarty->assign("timezones" ,$this->timezones); + $smarty->assign("timezone", $this->timezone); + $smarty->assign("timezones", $this->timezones); return $smarty->fetch("$BASE_DIR/setup/setup_config2.tpl"); } function save_object() { - if(isset($_POST['step6_posted'])){ + if (isset($_POST['step6_posted'])) { - if(isset($_POST['timezone']) && isset($this->timezones[$_POST['timezone']])){ + if (isset($_POST['timezone']) && isset($this->timezones[$_POST['timezone']])) { $this->timezone = $_POST['timezone']; } - $old_mail = $this->mail; - /* Get attributes */ - foreach($this->attributes as $attr){ - if(isset($_POST[$attr])){ + foreach ($this->attributes as $attr) { + if (isset($_POST[$attr])) { $this->$attr = validate(get_post($attr)); } } - /* Mail settings */ - if(isset($_POST['vacationdir_active'])){ - $this->mail_settings['vacationdir_active'] = TRUE; - if(isset($_POST['vacationdir'])){ - $this->mail_settings['vacationdir'] = get_post('vacationdir'); - } - }else{ - $this->mail_settings['vacationdir_active'] = FALSE; - } - - if(isset($_POST['wws_ou_active'])){ - $this->generic_settings['wws_ou_active'] = TRUE; - if(isset($_POST['wws_ou'])){ - $this->generic_settings['wws_ou'] = get_post('wws_ou'); - } - }else{ - $this->generic_settings['wws_ou_active'] = FALSE; - } - - if(isset($_POST['snapshot_active'])){ + if (isset($_POST['snapshot_active'])) { $this->generic_settings['snapshot_active'] = TRUE; - if(isset($_POST['snapshot_base'])){ + if (isset($_POST['snapshot_base'])) { $this->generic_settings['snapshot_base'] = get_post('snapshot_base'); } - if(isset($_POST['snapshot_user'])){ + if (isset($_POST['snapshot_user'])) { $this->generic_settings['snapshot_user'] = get_post('snapshot_user'); } - if(isset($_POST['snapshot_password'])){ + if (isset($_POST['snapshot_password'])) { $this->generic_settings['snapshot_password'] = get_post('snapshot_password'); } - if(isset($_POST['snapshot_server'])){ + if (isset($_POST['snapshot_server'])) { $this->generic_settings['snapshot_server'] = get_post('snapshot_server'); } - }else{ + } else { $this->generic_settings['snapshot_active'] = FALSE; } - - /* Samba settings */ - if(isset($_POST['samba_sid_active'])){ - $this->samba_settings['samba_sid_active'] = TRUE; - if(isset($_POST['samba_sid'])){ - $this->samba_settings['samba_sid'] = get_post('samba_sid'); - } - }else{ - $this->samba_settings['samba_sid_active'] = FALSE; - } - if(isset($_POST['samba_rid_active'])){ - $this->samba_settings['samba_rid_active'] = TRUE; - if(isset($_POST['samba_rid'])){ - $this->samba_settings['samba_rid'] = get_post('samba_rid'); - } - }else{ - $this->samba_settings['samba_rid_active'] = FALSE; - } - if(isset($_POST['smbhash'])){ - $this->samba_settings['smbhash'] = get_post('smbhash'); - } - - if(!$this->sambaDomain_found){ - $this->samba_settings['samba_sid_active'] = TRUE; - $this->samba_settings['samba_rid_active'] = TRUE; - } } $tmp = $this->check(); - if(count($tmp) == 0){ + if (count($tmp) == 0) { $this->is_completed = TRUE; - }else{ + } else { $this->is_completed = FALSE; } } @@ -232,8 +128,7 @@ class Step_Config2 extends setup_step function check() { - $message = array(); - return($message); + return array(); } @@ -241,34 +136,11 @@ class Step_Config2 extends setup_step function get_attributes() { $tmp = setup_step::get_attributes(); - foreach(array("samba_settings","generic_settings","mail_settings") as $attr){ - $tmp[$attr]= $this->$attr; - } - return($tmp); - } - - - /* Returns the classnames auf the mail classes */ - function get_available_mail_classes() - { - global $class_mapping; - - /* Check if we have the mail classes/plugins installed */ - if(!class_available("mailMethod")){ - return(array()); - } - $methods = array(); - foreach($class_mapping as $name => $file){ - if(preg_match("/^mailMethod.*$/i",$name)){ - $name = preg_replace("/^mailMethod/","",$name); - if(!empty($name)){ - $methods[$name]['name'] = $name; - } - } + foreach (array("generic_settings") as $attr) { + $tmp[$attr] = $this->$attr; } - return($methods); + return $tmp; } } -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/setup/class_setupStep_Config3.inc b/setup/class_setupStep_Config3.inc index 46ce7fec9f3aaa4cb79a66da79c0e38d626f10ec..e12040971909859ee85f941c202c277b90000070 100644 --- a/setup/class_setupStep_Config3.inc +++ b/setup/class_setupStep_Config3.inc @@ -25,37 +25,37 @@ class Step_Config3 extends setup_step { var $header_image = "images/setup/server.png"; - var $errorlvl = false; + var $errorlvl = FALSE; var $login_attributes = array("uid" => "uid", "mail" => "mail", "uid,mail" => "both"); var $optional = array( - "login_attribute" => "uid", - "strict_units" => false, - "list_summary" => true, - "forceglobals" => true, - "forcessl" => false, - "ldapstats" => false, - "warnssl" => true, - "user_filter_cookie" => true, - "debuglevel" => 0, - "session_lifetime" => 1800, - "compile" => SPOOL_DIR, - "max_ldap_query_time" => "5.0", - "max_ldap_query_time_active" => FALSE, - - "mailQueueScriptPath_active" => FALSE, - "notifydir_active" => FALSE, - "ppd_path_active" => FALSE, - "kioskpath_active" => FALSE, - "gosaSupportURI_active" => FALSE, - "kioskpath_active" => FALSE, - - "enableCopyPaste" => FALSE, - "logging" => TRUE, - "uniq_identifier" => "entryCSN", - "uniq_identifier_active" => TRUE, + "login_attribute" => "uid", + "strict_units" => FALSE, + "list_summary" => TRUE, + "forceglobals" => TRUE, + "forcessl" => FALSE, + "ldapstats" => FALSE, + "warnssl" => TRUE, + "user_filter_cookie" => TRUE, + "debuglevel" => 0, + "session_lifetime" => 1800, + "compile" => SPOOL_DIR, + "max_ldap_query_time" => "5.0", + "max_ldap_query_time_active" => FALSE, + + "mailQueueScriptPath_active" => FALSE, + "notifydir_active" => FALSE, + "ppd_path_active" => FALSE, + "kioskpath_active" => FALSE, + "gosaSupportURI_active" => FALSE, + "kioskpath_active" => FALSE, + + "enableCopyPaste" => FALSE, + "logging" => TRUE, + "uniq_identifier" => "entryCSN", + "uniq_identifier_active" => TRUE, "sudoou_active" => FALSE, @@ -83,46 +83,46 @@ class Step_Config3 extends setup_step $cv = $this->parent->captured_values; /*$this->optional['sudoou'] = preg_replace("/%BASE%/",$cv['base'],$this->optional['sudoou']);*/ $smarty = get_smarty(); - $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes"))); - $smarty->assign("uniq_identifiers",array( "entryCSN" => "entryCSN", - "contextCSN"=>"contextCSN" )); + $smarty->assign("bool", array(FALSE => _("No"), TRUE => _("Yes"))); + $smarty->assign("uniq_identifiers", array("entryCSN" => "entryCSN", + "contextCSN" => "contextCSN" )); - $smarty->assign("logging",$this->optional['logging']); + $smarty->assign("logging", $this->optional['logging']); $smarty->assign("optional", reverse_html_entities($this->optional)); - foreach($this->attributes as $attr){ - $smarty->assign($attr,reverse_html_entities($this->$attr)); + foreach ($this->attributes as $attr) { + $smarty->assign($attr, reverse_html_entities($this->$attr)); } - $smarty->assign("login_attributes",$this->login_attributes); + $smarty->assign("login_attributes", $this->login_attributes); return $smarty->fetch("$BASE_DIR/setup/setup_config3.tpl"); } function save_object() { - if(isset($_POST['step6a_posted'])){ + if (isset($_POST['step6a_posted'])) { /* Get attributes */ - foreach($this->attributes as $attr){ - if(isset($_POST[$attr])){ + foreach ($this->attributes as $attr) { + if (isset($_POST[$attr])) { $this->$attr = validate(get_post($attr)); } } - foreach(array("login_attribute","list_summary","strict_units","noprimarygroup","forceglobals","forcessl","ldapstats","user_filter_cookie","warnssl","compile","debuglevel","session_lifetime","enableCopyPaste","logging") as $name){ - if(isset($_POST[$name])){ + foreach (array("login_attribute","list_summary","strict_units","noprimarygroup","forceglobals","forcessl","ldapstats","user_filter_cookie","warnssl","compile","debuglevel","session_lifetime","enableCopyPaste","logging") as $name) { + if (isset($_POST[$name])) { $this->optional[$name] = get_post($name); } } $this->optional['ppd_path_active'] = FALSE; - if(isset($_POST['max_ldap_query_time_active'])){ + if (isset($_POST['max_ldap_query_time_active'])) { $this->optional['max_ldap_query_time_active'] = TRUE; - if(isset($_POST['max_ldap_query_time'])){ + if (isset($_POST['max_ldap_query_time'])) { $this->optional['max_ldap_query_time'] = get_post('max_ldap_query_time'); } - }else{ + } else { $this->optional['max_ldap_query_time_active'] = FALSE; } @@ -136,45 +136,144 @@ class Step_Config3 extends setup_step $this->optional['gosaSupportURI_active'] = FALSE; - if(isset($_POST['enableCopyPaste'])){ + if (isset($_POST['enableCopyPaste'])) { $this->optional['enableCopyPaste'] = get_post('enableCopyPaste'); } /* Get logging */ - $this->optional['logging'] = isset($_POST['logging']); + $this->optional['logging'] = isset($_POST['logging']); - if(isset($_POST['uniq_identifier_active'])){ + if (isset($_POST['uniq_identifier_active'])) { $this->optional['uniq_identifier_active'] = TRUE; - if(isset($_POST['uniq_identifier'])){ + if (isset($_POST['uniq_identifier'])) { $this->optional['uniq_identifier'] = get_post('uniq_identifier'); } - }else{ + } else { $this->optional['uniq_identifier_active'] = FALSE; } } $tmp = $this->check(); - if(count($tmp) == 0){ + if (count($tmp) == 0) { + $error = $this->save_config_in_ldap(); + if (!empty($error)) { + msg_dialog::display(_("Setup error"), $error, ERROR_DIALOG); + } $this->is_completed = TRUE; - }else{ + } else { $this->is_completed = FALSE; } } + function save_config_in_ldap () + { + $cv = $this->parent->captured_values; + + $attrs = array( + 'objectClass' => 'fusionDirectoryConf', + 'fdPasswordDefaultHash' => $cv['encryption'], + 'fdUserRDN' => $cv['peopleou'], + 'fdGroupRDN' => $cv['groupou'], + 'fdGidNumberBase' => $cv['uidbase'], + 'fdUidNumberBase' => $cv['uidbase'], + ); + if ($cv['cngen_active']) { + $attrs['fdAccountRDN'] = 'cn='.$cv['cngen']; + } else { + $attrs['fdAccountPrimaryAttribute'] = $cv['peopledn']; + } + + if ($this->optional['login_attribute']) { + $attrs['fdLoginAttribute'] = $this->optional['login_attribute']; + } else { + $attrs['fdLoginAttribute'] = 'uid'; + } + if ($cv['timezone']) { + $attrs['fdTimezone'] = $cv['timezone']; + } + $attrs['fdHonourUnitTags'] = ($this->optional['strict_units']?"TRUE":"FALSE"); + $attrs['fdRfc2307bis'] = ($cv['rfc2307bis']?"TRUE":"FALSE"); + $attrs['fdPersonalTitleInDN'] = ($cv['include_personal_title']?"TRUE":"FALSE"); + if ($cv['base_hook_active']) { + $attrs['fdNextIdHook'] = $cv['base_hook']; + } + if ($cv['id_settings']['idgen_active']) { + $attrs['fdIdGenerator'] = $cv['id_settings']['idgen']; + } + $attrs['fdStrictNamingRules'] = ($cv['strict']?"TRUE":"FALSE"); + if ($cv['id_settings']['minid_active']) { + $attrs['fdMinId'] = $cv['id_settings']['minid']; + } + //~ $attrs['fdGosaSharedPrefix'] = ""; + //~ $attrs['fdLdapTLS'] = ($cv['tls']?"TRUE":"FALSE"); + //~ $attrs['fdHonourIvbbAttributes'] = ($cv['governmentmode']?"TRUE":"FALSE"); + $attrs['fdHandleExpiredAccounts'] = ($cv['account_expiration']?"TRUE":"FALSE"); + $attrs['fdEnableSnapshots'] = ($cv['generic_settings']['snapshot_active']?"TRUE":"FALSE"); + $attrs['fdSnapshotBase'] = $cv['generic_settings']['snapshot_base']; + $attrs['fdSnapshotAdminDn'] = $cv['generic_settings']['snapshot_user']; + $attrs['fdSnapshotAdminPassword'] = $cv['generic_settings']['snapshot_password']; + $attrs['fdSnapshotURI'] = $cv['generic_settings']['snapshot_server']; + + $attrs['fdLanguage'] = $cv['lang_selected']; + $attrs['fdTheme'] = $cv['theme']; + + if ($this->optional['max_ldap_query_time_active']) { + $attrs['fdLdapMaxQueryTime'] = $this->optional['max_ldap_query_time']; + } + $attrs['fdPrimaryGroupFilter'] = ($this->optional['noprimarygroup']?"TRUE":"FALSE"); + $attrs['fdStoreFilterSettings'] = ($this->optional['user_filter_cookie']?"TRUE":"FALSE"); + if ($this->optional['uniq_identifier_active']) { + $attrs['fdModificationDetectionAttribute'] = $this->optional['uniq_identifier']; + } + $attrs['fdCopyPaste'] = ($this->optional['enableCopyPaste']?"TRUE":"FALSE"); + $attrs['fdListSummary'] = ($this->optional['list_summary']?"TRUE":"FALSE"); + $attrs['fdLdapStats'] = ($this->optional['ldapstats']?"TRUE":"FALSE"); + $attrs['fdWarnSSL'] = ($this->optional['warnssl']?"TRUE":"FALSE"); + + if ($cv['pwd_rules']['pwminlen_active']) { + $attrs['fdPasswordMinLength'] = $cv['pwd_rules']['pwminlen']; + } + if ($cv['pwd_rules']['pwdiffer_active']) { + $attrs['fdPasswordMinDiffer'] = $cv['pwd_rules']['pwdiffer']; + } + if ($cv['pwd_rules']['externalpwdhook_active']) { + $attrs['fdPasswordHook'] = $cv['pwd_rules']['externalpwdhook']; + } + $attrs['fdSchemaCheck'] = ($cv['enable_schema_check']?"TRUE":"FALSE"); + + $attrs['fdLogging'] = ($this->optional['logging']?"TRUE":"FALSE"); + $attrs['fdDisplayErrors'] = ($cv['errorlvl']?"TRUE":"FALSE"); + $attrs['fdSessionLifetime'] = $this->optional['session_lifetime']; + $attrs['fdDebugLevel'] = $this->optional['debuglevel']; + + $ldap_l = new LDAP( + $cv['admin'], $cv['password'], $cv['connection'], + FALSE, $cv['tls'] + ); + + $ldap = new ldapMultiplexer($ldap_l); + $ldap->cd(CONFIGRDN.$cv['base']); + $ldap->rmdir(CONFIGRDN.$cv['base']); + $ldap->add($attrs); + if (!$ldap->success()) { + return msgPool::ldaperror($ldap->get_error(), CONFIGRDN.$cv['base'], 'add', get_class()); + } + } + function check() { $message = array(); - if(!is_numeric( $this->optional['session_lifetime'])){ + if (!is_numeric($this->optional['session_lifetime'])) { $message[] = _("Session lifetime must be a numeric value!"); } - if(!is_numeric( $this->optional['max_ldap_query_time'])){ + if (!is_numeric($this->optional['max_ldap_query_time'])) { $message[] = _("Maximum LDAP query time must be a numeric value!"); } - return($message); + return $message; } @@ -182,13 +281,12 @@ class Step_Config3 extends setup_step function get_attributes() { $tmp = setup_step::get_attributes(); - foreach(array("optional") as $attr){ - $tmp[$attr]= $this->$attr; + foreach (array("optional") as $attr) { + $tmp[$attr] = $this->$attr; } return($tmp); } } -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/setup/class_setupStep_Finish.inc b/setup/class_setupStep_Finish.inc index 73a104934fce5c09e9423c05f41ff86ec4235295..3fc6fc3695b274fa52f611ba23fdfb4c29252474 100644 --- a/setup/class_setupStep_Finish.inc +++ b/setup/class_setupStep_Finish.inc @@ -54,7 +54,7 @@ class Step_Finish extends setup_step global $BASE_DIR; if(!function_exists("posix_getgrgid")){ $webgroup = ""; - }else{ + } else { $info= posix_getgrgid(posix_getgid()); $webgroup = $info['name']; } diff --git a/setup/class_setupStep_Ldap.inc b/setup/class_setupStep_Ldap.inc index d5127383de21177ab3af46939950973dc5985dfa..dde905435e62ecce2dc8bd2bfaad41f83eb7612d 100644 --- a/setup/class_setupStep_Ldap.inc +++ b/setup/class_setupStep_Ldap.inc @@ -104,7 +104,7 @@ class Step_Ldap extends setup_step if(@ldap_start_tls($this->connect_id)) $this->bind_id = @ldap_bind($this->connect_id, $this->admin, $this->password); @ldap_set_option($this->connect_id, LDAP_OPT_PROTOCOL_VERSION, 3); - }else{ + } else { @ldap_set_option($this->connect_id, LDAP_OPT_PROTOCOL_VERSION, 3); $this->bind_id = @ldap_bind($this->connect_id, $this->admin, $this->password); } @@ -115,11 +115,11 @@ class Step_Ldap extends setup_step $str = sprintf(_("Bind as user '%s' failed!"),$this->admin,$this->connection); } return("<font color='red'>".$str."</font>"); - }else{ + } else { if(empty($this->admin)){ $str = sprintf(_("Anonymous bind to server '%s' succeeded."), $this->connection); return("<font color='blue'>".$str."</font> <font color='red'>"._("Please specify user and password!")."</font>"); - }else{ + } else { $str = sprintf(_("Bind as user '%s' to server '%s' succeeded!"),$this->admin,$this->connection); return("<font color='green'>".$str."</font>"); } @@ -194,7 +194,7 @@ class Step_Ldap extends setup_step if(isset($_POST['append_base_to_admin_dn'])){ $this->append_base_to_admin_dn = TRUE; - }else{ + } else { $this->append_base_to_admin_dn = FALSE; } @@ -204,14 +204,14 @@ class Step_Ldap extends setup_step $base = ",".$base; } $this->admin = $this->admin_given.$base; - }else{ + } else { $this->admin = $this->admin_given; } $this->get_connection_status(); if($this->bind_id && !empty($this->admin) && !empty($this->base)){ $this->is_completed =TRUE; - }else{ + } else { $this->is_completed =FALSE; } diff --git a/setup/class_setupStep_Migrate.inc b/setup/class_setupStep_Migrate.inc index 640a85ee77f159cbf3afafc8a4a556c5183d1f7b..121abeae67dcf7ea467f97cefac06df98587a963 100644 --- a/setup/class_setupStep_Migrate.inc +++ b/setup/class_setupStep_Migrate.inc @@ -261,7 +261,7 @@ class Step_Migrate extends setup_step $this->checks['uidNumber_usage']['ERROR_MSG'] = sprintf(_("Found %s duplicate values for attribute 'uidNumber'."),count($this->check_uidNumbers)); return(false); - }else{ + } else { $this->checks['uidNumber_usage']['STATUS'] = TRUE; $this->checks['uidNumber_usage']['STATUS_MSG']= _("Ok"); $this->checks['uidNumber_usage']['ERROR_MSG'] = ""; @@ -313,7 +313,7 @@ class Step_Migrate extends setup_step $this->checks['gidNumber_usage']['ERROR_MSG'] = sprintf(_("Found %s duplicate values for attribute 'gidNumber'."),count($this->check_gidNumbers)); return(false); - }else{ + } else { $this->checks['gidNumber_usage']['STATUS'] = TRUE; $this->checks['gidNumber_usage']['STATUS_MSG']= _("Ok"); $this->checks['gidNumber_usage']['ERROR_MSG'] = ""; @@ -339,13 +339,13 @@ class Step_Migrate extends setup_step /* Get winstation ou */ if($cv['generic_settings']['wws_ou_active']) { $winstation_ou = $cv['generic_settings']['wws_ou']; - }else{ + } else { $winstation_ou = "ou=computers"; } if($cv['samba_version'] == 3){ $oc = "sambaSamAccount"; - }else{ + } else { $oc = "sambaAccount"; } @@ -374,7 +374,7 @@ class Step_Migrate extends setup_step sprintf(_("Found %s winstations outside the predefined computers department ou '%s'."),count($this->outside_winstations),$winstation_ou); $this->checks['outside_winstations']['ERROR_MSG'].= "<input type='submit' name='outside_winstations_dialog' value='"._("Migrate")."...'>"; return(false); - }else{ + } else { $this->checks['outside_winstations']['STATUS'] = TRUE; $this->checks['outside_winstations']['STATUS_MSG']= _("Ok"); $this->checks['outside_winstations']['ERROR_MSG'] = ""; @@ -447,7 +447,7 @@ class Step_Migrate extends setup_step sprintf(_("Found %s groups outside the configured tree '%s'."),count($this->outside_groups),$group_ou); $this->checks['outside_groups']['ERROR_MSG'].= " <input type='submit' name='outside_groups_dialog' value='"._("Move")."...'>"; return(false); - }else{ + } else { $this->checks['outside_groups']['STATUS'] = TRUE; $this->checks['outside_groups']['STATUS_MSG']= _("Ok"); $this->checks['outside_groups']['ERROR_MSG'] = ""; @@ -524,7 +524,7 @@ class Step_Migrate extends setup_step sprintf(_("Found %s user(s) outside the configured tree '%s'."),count($this->outside_users),$people_ou); $this->checks['outside_users']['ERROR_MSG'].= "<input type='submit' name='outside_users_dialog' value='"._("Move")."...'>"; return(false); - }else{ + } else { $this->checks['outside_users']['STATUS'] = TRUE; $this->checks['outside_users']['STATUS_MSG']= _("Ok"); $this->checks['outside_users']['ERROR_MSG'] = ""; @@ -656,7 +656,7 @@ class Step_Migrate extends setup_step $this->checks['users_visible']['STATUS'] = TRUE; $this->checks['users_visible']['STATUS_MSG']= _("Ok"); $this->checks['users_visible']['ERROR_MSG'] = ""; - }else{ + } else { $this->checks['users_visible']['STATUS'] = FALSE; $this->checks['users_visible']['STATUS_MSG']= "<font style='color:#F0A500'>"._("Warning")."</font>"; $this->checks['users_visible']['ERROR_MSG'] = sprintf(_("Found %s user(s) that will not be visible in FusionDirectory or which are incomplete."), @@ -706,7 +706,7 @@ class Step_Migrate extends setup_step if($only_ldif){ $this->users_to_migrate[$key]['before'] = $this->array_to_ldif($attrs); $this->users_to_migrate[$key]['after'] = $this->array_to_ldif($new_attrs); - }else{ + } else { $ldap->cd($attrs['dn']); if(!$ldap->modify($new_attrs)){ msg_dialog::display(_("Migration error"), sprintf(_("Cannot migrate department '%s':")."<br><br><i>%s</i>",LDAP::fix($attrs['dn']),$ldap->get_error()), ERROR_DIALOG); @@ -797,7 +797,7 @@ class Step_Migrate extends setup_step $this->checks['deps_visible']['STATUS'] = TRUE; $this->checks['deps_visible']['STATUS_MSG']= _("Ok"); $this->checks['deps_visible']['ERROR_MSG'] = ""; - }else{ + } else { $this->checks['deps_visible']['STATUS'] = TRUE; $this->checks['deps_visible']['STATUS_MSG']= '<font style="color:#FFA500">'._("Warning").'</font>'; $this->checks['deps_visible']['ERROR_MSG'] = sprintf(_("Found %s department(s) that will not be visible in FusionDirectory."),count($this->deps_to_migrate)); @@ -849,7 +849,7 @@ class Step_Migrate extends setup_step if($only_ldif){ $this->deps_to_migrate[$key]['before'] = $this->array_to_ldif($attrs); $this->deps_to_migrate[$key]['after'] = $this->array_to_ldif($new_attrs); - }else{ + } else { $ldap->cd($attrs['dn']); if(!$ldap->modify($new_attrs)){ msg_dialog::display(_("Migration error"), sprintf(_("Cannot migrate department '%s':")."<br><br><i>%s</i>",LDAP::fix($attrs['dn']), $ldap->get_error()), ERROR_DIALOG); @@ -889,7 +889,7 @@ class Step_Migrate extends setup_step $this->checks['acls']['STATUS'] = FALSE; $this->checks['acls']['STATUS_MSG']= _("LDAP query failed"); $this->checks['acls']['ERROR_MSG'] = _("Possibly the 'root object' is missing."); - }else{ + } else { $GOsa_26_found = false; // GOsa 2.6 Account found $GOsa_25_found = false; // GOsa 2.5 Account found, allow migration @@ -1043,7 +1043,7 @@ class Step_Migrate extends setup_step $this->checks['acls']['STATUS'] = TRUE; $this->checks['acls']['STATUS_MSG']= _("Ok"); $this->checks['acls']['ERROR_MSG'] = $str; - }else{ + } else { $this->checks['acls']['STATUS'] = FALSE; $this->checks['acls']['STATUS_MSG']= _("Failed"); $this->checks['acls']['ERROR_MSG']= _("There is no FusionDirectory administrator account inside your LDAP.")." "; @@ -1111,13 +1111,13 @@ class Step_Migrate extends setup_step $this->acl_create_changes.=$this->array_to_ldif($attrs)."\n"; $this->acl_create_changes.="\n".($ldap->fix($cv['base']))."\n"; $this->acl_create_changes.=$this->array_to_ldif($attrs_new); - }else{ + } else { $ldap->cd($cv['base']); if(!$ldap->modify($attrs_new)){ msg_dialog::display(_("Migration error"), sprintf(_("Cannot add ACL for user '%s':")."<br><br><i>%s</i>", LDAP::fix($dn), $ldap->get_error()), ERROR_DIALOG); return(FALSE); - }else{ + } else { return(TRUE); } } @@ -1178,7 +1178,7 @@ class Step_Migrate extends setup_step if($cv['peopledn'] == "cn"){ $dn = "cn=System Administrator-".$uid.",".$people_ou.$cv['base']; - }else{ + } else { $dn = "uid=".$uid.",".$people_ou.$cv['base']; } @@ -1234,7 +1234,7 @@ class Step_Migrate extends setup_step /* Check if there was a destination department posted */ if(isset($_POST['move_winstation_to'])){ $destination_dep = $_POST['move_winstation_to']; - }else{ + } else { msg_dialog::display(_("LDAP error"), _("Cannot move users to the requested department!"), ERROR_DIALOG); return(false); } @@ -1259,7 +1259,7 @@ class Step_Migrate extends setup_step $this->outside_winstations[$b_dn]['ldif'] .= "<br /><br /><i>"._("Updating following references too").":</i>".$refs; } - }else{ + } else { $this->move($dn,$d_dn); } } @@ -1283,7 +1283,7 @@ class Step_Migrate extends setup_step /* Check if there was a destination department posted */ if(isset($_POST['move_group_to'])){ $destination_dep = $_POST['move_group_to']; - }else{ + } else { msg_dialog::display(_("LDAP error"), _("Cannot move users to the requested department!"), ERROR_DIALOG); return(false); } @@ -1308,7 +1308,7 @@ class Step_Migrate extends setup_step $this->outside_groups[$b_dn]['ldif'] .= "<br /><br /><i>"._("Updating following references too").":</i>".$refs; } - }else{ + } else { $this->move($dn,$d_dn); } } @@ -1332,7 +1332,7 @@ class Step_Migrate extends setup_step /* Check if there was a destination department posted */ if(isset($_POST['move_user_to'])){ $destination_dep = $_POST['move_user_to']; - }else{ + } else { msg_dialog::display(_("LDAP error"), _("Cannot move users to the requested department!"), ERROR_DIALOG); return(false); } @@ -1356,7 +1356,7 @@ class Step_Migrate extends setup_step $this->outside_users[$b_dn]['ldif'] .= "<br /><br /><i>"._("The following references will be updated").":</i>".$refs; } - }else{ + } else { $this->move($dn,$d_dn); } } @@ -1893,7 +1893,7 @@ class Step_Migrate extends setup_step foreach($this->outside_winstations as $dn => $data){ if(isset($_POST['select_winstation_'.$dn])){ $this->outside_winstations[$dn]['selected'] = TRUE; - }else{ + } else { $this->outside_winstations[$dn]['selected'] = FALSE; } } @@ -1904,7 +1904,7 @@ class Step_Migrate extends setup_step foreach($this->outside_groups as $dn => $data){ if(isset($_POST['select_group_'.$dn])){ $this->outside_groups[$dn]['selected'] = TRUE; - }else{ + } else { $this->outside_groups[$dn]['selected'] = FALSE; } } @@ -1915,7 +1915,7 @@ class Step_Migrate extends setup_step foreach($this->outside_users as $dn => $data){ if(isset($_POST['select_user_'.$dn])){ $this->outside_users[$dn]['selected'] = TRUE; - }else{ + } else { $this->outside_users[$dn]['selected'] = FALSE; } } @@ -1934,7 +1934,7 @@ class Step_Migrate extends setup_step foreach($this->deps_to_migrate as $id => $data){ if(isset($_POST['migrate_'.$id])){ $this->deps_to_migrate[$id]['checked'] = TRUE; - }else{ + } else { $this->deps_to_migrate[$id]['checked'] = FALSE; } } @@ -1945,7 +1945,7 @@ class Step_Migrate extends setup_step foreach($this->users_to_migrate as $id => $data){ if(isset($_POST['migrate_'.$id])){ $this->users_to_migrate[$id]['checked'] = TRUE; - }else{ + } else { $this->users_to_migrate[$id]['checked'] = FALSE; } } @@ -1989,7 +1989,7 @@ class Step_Migrate extends setup_step $this->checks['root']['ERROR_MSG'] = _("The LDAP root object is missing. It is required to use your LDAP service.").' '; $this->checks['root']['ERROR_MSG'].= "<input type='submit' name='retry_root_create' value='"._("Try to create root object")."'>"; return(FALSE); - }else{ + } else { /* Add root object */ $ldap->cd($cv['base']); @@ -2131,7 +2131,7 @@ class Step_Migrate extends setup_step name='root_add_objectclasses' value='"._("Migrate")."'>"; return(FALSE); - }else{ + } else { /* Add root object */ $ldap->cd($cv['base']); @@ -2143,7 +2143,7 @@ class Step_Migrate extends setup_step $this->checkBaseOC(); $this->check_administrativeAccount(); return($res); - }else{ + } else { trigger_error("No modifications to make... "); } } @@ -2174,7 +2174,7 @@ class Step_Migrate extends setup_step foreach($value as $a_val){ $ret .= $name.": ". $a_val."\n"; } - }else{ + } else { $ret .= $name.": ". $value."\n"; } } @@ -2282,7 +2282,7 @@ class Step_Migrate extends setup_step /* Get winstation ou */ if($cv['generic_settings']['wws_ou_active']) { $winstation_ou = $cv['generic_settings']['wws_ou']; - }else{ + } else { $winstation_ou = "ou=computers"; } @@ -2358,7 +2358,7 @@ class Step_Migrate extends setup_step $tmp[base64_encode($attrs['dn'])] = $ldap->fix($attrs['dn']); } } - }else{ + } else { /************ * If group ou is empty * Get all valid gosaDepartments @@ -2436,7 +2436,7 @@ class Step_Migrate extends setup_step /* Display warning if copy failed */ if(!$res){ msg_dialog::display(_("LDAP error"), sprintf(_("Copy '%s' to '%s' failed:")."<br><br><i>%s</i>", LDAP::fix($source), LDAP::fix($destination), $ldap->get_error()), ERROR_DIALOG); - }else{ + } else { $res = $ldap->rmDir($source); if (!$ldap->success()){ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $source, LDAP_DEL, get_class())); @@ -2473,7 +2473,7 @@ class Step_Migrate extends setup_step foreach($this->device as $key => $device){ if(isset($_POST["migrate_".$key])){ $this->device[$key]['DETAILS'] =TRUE; - }else{ + } else { $this->device[$key]['DETAILS'] =FALSE; } } @@ -2539,7 +2539,7 @@ class Step_Migrate extends setup_step for ($c= 0; $c < $attrs['gotoHotplugDevice']['count']; $c++){ if($c == $j){ $current.= "<b>gotoHotplugDevice: ".$attrs['gotoHotplugDevice'][$c]."</b>\n"; - }else{ + } else { $current.= "gotoHotplugDevice: ".$attrs['gotoHotplugDevice'][$c]."\n"; } } @@ -2572,7 +2572,7 @@ class Step_Migrate extends setup_step $this->checks['old_style_devices']['ERROR_MSG'] = sprintf(_("There are %s devices that need to be migrated."),count($this->device)). "<input type='submit' name='device_dialog' value='"._("Migrate")."'>"; - }else{ + } else { $this->checks['old_style_devices']['STATUS'] = TRUE; $this->checks['old_style_devices']['STATUS_MSG']= _("Ok"); $this->checks['old_style_devices']['ERROR_MSG'] = ""; @@ -2633,7 +2633,7 @@ class Step_Migrate extends setup_step sprintf(_("Adding '%s' to the LDAP failed: %s"), "<b>".LDAP::fix($newdn)."</b>", "<br><br><i>".$ldap->get_error()."</i>"), ERROR_DIALOG); - }else{ + } else { /* Remove old style device definition from source object. */ @@ -2653,7 +2653,7 @@ class Step_Migrate extends setup_step sprintf(_("Updating '%s' failed: %s"), "<b>".LDAP::fix($device['DN'])."</b>", "<br><br><i>".$ldap->get_error()."</b>"), ERROR_DIALOG); - }else{ + } else { unset($this->device[$key]); } } @@ -2726,7 +2726,7 @@ class Step_Migrate extends setup_step sprintf(_("There are %s services that need to be migrated."), count($this->service)). "<input type='submit' name='service_dialog' value='"._("Migrate")."'>"; - }else{ + } else { $this->checks['old_style_services']['STATUS'] = TRUE; $this->checks['old_style_services']['STATUS_MSG']= _("Ok"); $this->checks['old_style_services']['ERROR_MSG'] = ""; @@ -2770,7 +2770,7 @@ class Step_Migrate extends setup_step sprintf(_("Updating '%s' failed: %s"), "<b>".LDAP::fix($service['DN'])."</b>", "<br><br><i>".$ldap->get_error()."</b>"), ERROR_DIALOG); - }else{ + } else { /* Remove action from list */ @@ -2794,7 +2794,7 @@ class Step_Migrate extends setup_step foreach($this->service as $key => $service){ if(isset($_POST["migrate_".$key])){ $this->service[$key]['DETAILS'] =TRUE; - }else{ + } else { $this->service[$key]['DETAILS'] =FALSE; } } @@ -3056,7 +3056,7 @@ class Step_Migrate extends setup_step $this->checks['old_style_menus']['STATUS_MSG']= "<font style='color:#F0A500'>"._("Warning")."</font>"; $this->checks['old_style_menus']['ERROR_MSG'] = sprintf(_("There are %s application menus which have to be migrated."), count($this->menu))."<input type='submit' name='menu_dialog' value='"._("Migrate")."'>"; - }else{ + } else { $this->checks['old_style_menus']['STATUS'] = TRUE; $this->checks['old_style_menus']['STATUS_MSG']= _("Ok"); $this->checks['old_style_menus']['ERROR_MSG'] = ""; @@ -3072,7 +3072,7 @@ class Step_Migrate extends setup_step foreach($this->menu as $key => $menu){ if(isset($_POST["migrate_".$key])){ $this->menu[$key]['DETAILS'] =TRUE; - }else{ + } else { $this->menu[$key]['DETAILS'] =FALSE; } } @@ -3210,7 +3210,7 @@ class Step_Migrate extends setup_step $this->checks['acls']['STATUS'] = FALSE; $this->checks['acls']['STATUS_MSG']= _("Failed"); $this->checks['acls']['ERROR_MSG'] = "<br>".msgPool::ldaperror($cv['base'],$ldap->get_error(),LDAP_MOD); - }else{ + } else { $this->check_administrativeAccount(); } } diff --git a/setup/setup_config1.tpl b/setup/setup_config1.tpl index 7bf32613eaa48e70bbae689a5efd1640f2b815d4..4c09d09825602af90eb1753d906da9703965941d 100644 --- a/setup/setup_config1.tpl +++ b/setup/setup_config1.tpl @@ -181,17 +181,6 @@ </div> </div> - <div class='step4_container'> - <div class='step4_name'> - {t}Use SASL for kerberos{/t} - </div> - <div class='step4_value'> - <select name="krbsasl" size="1" title=""> - {html_options options=$bool selected=$krbsasl} - </select> - </div> - </div> - <div class='step4_container'> <div class='step4_name'> {t}Use account expiration{/t} diff --git a/setup/setup_config2.tpl b/setup/setup_config2.tpl index 9993696cd5950d7eec6a5acb805741206f28b948..45771fa2601e59decd1122406bcf4e2f2613b530 100644 --- a/setup/setup_config2.tpl +++ b/setup/setup_config2.tpl @@ -1,31 +1,4 @@ <div class='default' style='margin:12px; '> - <p><b>{t}Samba settings{/t}</b></p> - - <div class='step4_container'> - <div class='step4_name'> - {t}Windows workstation branch{/t} - </div> - <div class='step4_value'> - {if $generic_settings.wws_ou_active == FALSE} - <input type='checkbox' value='1' name='wws_ou_active' - onClick='changeState("wws_ou");'> - <input size=40 id='wws_ou' name='wws_ou' type='text' value='{$generic_settings.wws_ou}' disabled> - {else} - <input type='checkbox' value='1' name='wws_ou_active' checked> - <input size=40 id='wws_ou' name='wws_ou' type='text' value='{$generic_settings.wws_ou}' > - {/if} - </div> - </div> - <div class='step4_container'> - <div class='step4_name'> - {t}Samba SID mapping{/t} - </div> - <div class='step4_value'> - <select name="sambaidmapping" size="1" title=""> - {html_options options=$bool selected=$sambaidmapping} - </select> - </div> - </div> <div class='step4_container'> <div class='step4_name'> {t}Timezone{/t} @@ -40,76 +13,16 @@ </div> </div> - <p><b>{t}Mail settings{/t}</b></p> - - <div class='step4_container'> - <div class='step4_name'> - {t}Mail method{/t} - </div> - <div class='step4_value'> - <select name="mail" size="1" title="" onChange="document.mainform.submit();"> - <option value="disabled">{t}disabled{/t}</option> - {foreach from=$mail_methods item=item} - <option value="{$item.name}" {if $mail == $item.name} selected {/if}>{$item.name}</option> - {/foreach} - </select> - </div> - <div class='step4_status'> - </div> - </div> - - <div class='step4_container'> - <div class='step4_name'> - {t}Account identification attribute{/t} - </div> - <div class='step4_value'> - <select name="mail_attrib" size="1" {if $mail == "disabled"} disabled {/if}> - <option value="mail" {if $mail_attrib == "mail"} selected {/if} >mail</option> - <option value="uid" {if $mail_attrib == "uid"} selected {/if} >uid</option> - </select> - </div> - <div class='step4_status'> - </div> - </div> - - <div class='step4_container'> - <div class='step4_name'> - {t}Vacation templates{/t} - </div> - <div class='step4_value'> - {if $mail_settings.vacationdir_active == FALSE} - <input type='checkbox' value='1' name='vacationdir_active' - onClick='changeState("vacationdir");'> - <input size=40 id='vacationdir' name='vacationdir' type='text' value='{$mail_settings.vacationdir}' disabled> - {else} - <input type='checkbox' value='1' name='vacationdir_active' checked> - <input size=40 id='vacationdir' name='vacationdir' type='text' value='{$mail_settings.vacationdir}' > - {/if} - </div> - </div> - - <div class='step4_container'> - <div class='step4_name'> - {t}Use Cyrus UNIX style{/t} - </div> - <div class='step4_value'> - <select name="cyrusunixstyle" size="1" title=""> - {html_options options=$bool selected=$cyrusunixstyle} - </select> - </div> - </div> - - <p><b>{t}Snapshots / Undo{/t}</b></p> {if $generic_settings.snapshot_active == FALSE} <div class='step4_container'> <div class='step4_name'> <input type='checkbox' value='1' name='snapshot_active' onClick=' - changeState("snapshot_base"); - changeState("snapshot_server"); - changeState("snapshot_user"); - changeState("snapshot_password");'>{t}Enable snapshots{/t} + changeState("snapshot_base"); + changeState("snapshot_server"); + changeState("snapshot_user"); + changeState("snapshot_password");'>{t}Enable snapshots{/t} </div> </div> <div style='margin-left:10px;'>