summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dcac370)
raw | patch | inline | side by side (parent: dcac370)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 12 Apr 2007 05:41:34 +0000 (05:41 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 12 Apr 2007 05:41:34 +0000 (05:41 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6016 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/html/index.php b/html/index.php
index 1fdcf4bb3b91d101f6385ad10e4d0de6828ffd21..2c882c20278cbca3dcd42ce0fac2c36276c355ad 100644 (file)
--- a/html/index.php
+++ b/html/index.php
$_SESSION['LastError'] = "";
/* Check if we need to run setup */
-if (!file_exists(CONFIG_DIR."/gosa.conf-trunk")){
+if (!file_exists(CONFIG_DIR."/".CONFIG_FILE)){
header("location:setup.php");
exit();
}
$_SESSION['js']= FALSE;
}
-/* Check if gosa.conf is accessible */
-if (!is_readable(CONFIG_DIR."/gosa.conf")){
- echo sprintf(_("GOsa configuration %s/gosa.conf is not readable. Aborted."), CONFIG_DIR);
+/* Check if gosa.conf (.CONFIG_FILE) is accessible */
+if (!is_readable(CONFIG_DIR."/".CONFIG_FILE)){
+ echo sprintf(_("GOsa configuration %s/%s is not readable. Aborted."), CONFIG_DIR,CONFIG_FILE);
exit();
}
/* Parse configuration file */
-$config= new config(CONFIG_DIR."/gosa.conf-trunk", $BASE_DIR);
+$config= new config(CONFIG_DIR."/".CONFIG_FILE, $BASE_DIR);
$_SESSION['DEBUGLEVEL']= $config->data['MAIN']['DEBUGLEVEL'];
if ($_SERVER["REQUEST_METHOD"] != "POST"){
@DEBUG (DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config");
diff --git a/include/functions.inc b/include/functions.inc
index 7d9185482ed165b87659bf973a7116e9d9932f47..4acc2419e139f5e12f46570541bdad03092454fd 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
/* Configuration file location */
define ("CONFIG_DIR", "/etc/gosa");
+define ("CONFIG_FILE", "gosa.conf-trunk");
define ("CONFIG_TEMPLATE_DIR", "../contrib/");
define ("HELP_BASEDIR", "/var/www/doc/");
diff --git a/setup/class_setup.inc b/setup/class_setup.inc
index d93bc4b6765e1e1e3e1590e6fe7089a59eefbe26..83311ed2f9dec5e12d61ae8a6a58242b77112090 100644 (file)
--- a/setup/class_setup.inc
+++ b/setup/class_setup.inc
$this->o_steps[8] = new setup_step_7();
$this->o_steps[9] = new setup_step_8();
- /* Ensure that setup is not reachable if gosa.conf */
- if(file_exists(CONFIG_DIR."/gosa.conf")){
+ /* Ensure that setup is not reachable if gosa.conf (CONFIG_FILE) */
+ if(file_exists(CONFIG_DIR."/".CONFIG_FILE)){
session_destroy();
header("Location: index.php") ;
exit();
index 0b0466c740832088e132cde7e0371e6159b02b20..a940e5efad0db489fcd1039675113fe356be9fc5 100644 (file)
class setup_step_1 extends setup_step
{
- var $lang = "en_EN";
+ var $lang = "";
var $languages = array();
var $attributes = array("lang","force_global_lang");
var $force_global_lang = FALSE;
function execute()
{
- $this->languages = array("de_DE" => _("German"),
+ $this->languages = array("" => _("Automatic detection"),
+ "de_DE" => _("German"),
"fr_FR" => _("French"),
"en_EN" => _("English"),
"ru_RU" => _("Russian"));
index 9a06f0ef9739aa97eba9952f0bf3192e9dc77ce7..c9eba18c4feccd319676e505798d96230b3cb866 100644 (file)
/* Check if we can create a config file.*/
$N = _("Configuration file writeable.");
$D = _("The Configuration file can't be written");
- $S = _("The GOsa reads its configuration from a file located in (/etc/gosa/gosa.conf). The setup can write the configuration directly in this file, if it is writeable.");
- $R = ( file_exists("/etc/gosa/gosa.conf") && is_writeable("/etc/gosa/gosa.conf")) // is there a config file ?
- || (!file_exists("/etc/gosa/gosa.conf") && is_writeable("/etc/gosa")); // There is non, but can we create a file there ?
+ $S = sprintf(_("The GOsa reads its configuration from a file located in (%s/%s). The setup can write the configuration directly in this file, if it is writeable."),CONFIG_DIR,CONFIG_FILE);
+ $R = ( file_exists(CONFIG_DIR."/".CONFIG_FILE) && is_writeable(CONFIG_DIR."/".CONFIG_FILE)) // is there a config file ?
+ || (!file_exists(CONFIG_DIR."/".CONFIG_FILE) && is_writeable(CONFIG_DIR)); // There is non, but can we create a file there ?
$M = FALSE;
$this->is_writeable[] = array("NAME" => $N , "DESC" => $D , "RESULT" => $R , "SOLUTION" => $S , "MUST" => $M );
# $N = _("No old configuration file.");
# $D = "";//_("");
# $S = _("If there is already a configuration file, this file will be overwritten when GOsa setup finishes. Please move your old config file away.");
-# $R = !file_exists("/etc/gosa/gosa.conf");
+# $R = !file_exists(CONFIG_DIR."/".CONFIG_FILE);
# $M = FALSE;
# $this->is_writeable[] = array("NAME" => $N , "DESC" => $D , "RESULT" => $R , "SOLUTION" => $S , "MUST" => $M );
# }
index 575c8b0a1aca6cccf673f8d932ccb36904c30a3b..9a7afae5a0fde5d69efaebb54246486da701dc33 100644 (file)
"pwminlen_active" => FALSE,
"pwdiffer" => 5,
"pwdiffer_active" => FALSE,
- "externalpwdhook" => "/usr/bin/sudo myscript",
+ "externalpwdhook" => "/path/to/your/script username oldpassword newpassword",
"externalpwdhook_active" => FALSE);
var $mail_settings = array("vacationdir" => "/etc/gosa/vacation",
index 72b6dffbbb6c4d331d579b51a7d3f0dadcd238e9..338c72c0502a1a6b0f7d7dcedaab58c1001abf5f 100644 (file)
class setup_step_8 extends setup_step
{
var $create_backup = TRUE;
- var $gosa_conf_name = "/gosa.conf";
+ var $gosa_conf_contrib = "/gosa.conf";
var $cfg_file_written = FALSE;
var $last_backup_name = "";
{
$smarty = get_smarty();
$smarty->assign("cv",$this->parent->captured_values);
- $str = $smarty->fetch(CONFIG_TEMPLATE_DIR.$this->gosa_conf_name);
+ $str = $smarty->fetch(CONFIG_TEMPLATE_DIR.$this->gosa_conf_contrib);
return($str);
}
/* Check if there is currently an active gosa.conf
*/
- $exists = file_exists(CONFIG_DIR.$this->gosa_conf_name);
+ $exists = file_exists(CONFIG_DIR."/".CONFIG_FILE);
/* Check if existing config file is writeable */
if($exists){
- $writeable = is_writeable(CONFIG_DIR.$this->gosa_conf_name);
+ $writeable = is_writeable(CONFIG_DIR."/".CONFIG_FILE);
}else{
$writeable = is_writeable(CONFIG_DIR);
}
if (preg_match('/MSIE 5.5/', $_SERVER['HTTP_USER_AGENT']) ||
preg_match('/MSIE 6.0/', $_SERVER['HTTP_USER_AGENT'])){
- header('Content-Disposition: filename="gosa.conf"');
+ header('Content-Disposition: filename="'.CONFIG_FILE.'"');
} else {
- header('Content-Disposition: attachment; filename="gosa.conf"');
+ header('Content-Disposition: attachment; filename="'.CONFIG_FILE.'"');
}
$str = $this->get_conf_data();
if(!$abort){
/* Try to create file handle */
- $fp = @fopen(CONFIG_DIR.$this->gosa_conf_name, "w");
+ $fp = @fopen(CONFIG_DIR."/".CONFIG_FILE, "w");
if(!$fp){
- $err_msg = sprintf(_("Can not create handle on file '%s', the configuration could not be written. Please check folder permission and try again. Or use the manual method if this can not be fixed anyway."),CONFIG_DIR.$this->gosa_conf_name);
+ $err_msg = sprintf(_("Can not create handle on file '%s', the configuration could not be written. Please check folder permission and try again. Or use the manual method if this can not be fixed anyway."),CONFIG_DIR."/".CONFIG_FILE);
$abort =TRUE;
}else{
$data = $this->get_conf_data();
if(!fwrite($fp,$data)){
- $err_msg = sprintf(_("Can not write file '%s'. Please check folder permission and try again. Or use the manual method if this can not be fixed anyway."),CONFIG_DIR.$this->gosa_conf_name);
+ $err_msg = sprintf(_("Can not write file '%s'. Please check folder permission and try again. Or use the manual method if this can not be fixed anyway."),CONFIG_DIR."/".CONFIG_FILE);
$abort =TRUE;
}else{
- @chgrp(CONFIG_DIR.$this->gosa_conf_name,$webgroup);
- @chown(CONFIG_DIR.$this->gosa_conf_name,"root");
- @chmod(CONFIG_DIR.$this->gosa_conf_name,0640);
+ @chgrp(CONFIG_DIR."/".CONFIG_FILE,$webgroup);
+ @chown(CONFIG_DIR."/".CONFIG_FILE,"root");
+ @chmod(CONFIG_DIR."/".CONFIG_FILE,0640);
}
}
}
}
- if($exists && $this->is_world_readable(CONFIG_DIR.$this->gosa_conf_name)){
+ if($exists && $this->is_world_readable(CONFIG_DIR."/".CONFIG_FILE)){
$err_msg = _("Your configuration file is currently world readable. This is a big security risk. Please updated the file permissions as shown in the manual configuration part below.");
}
$smarty->assign("save_requested", isset($_POST['saveconf']));
$smarty->assign("err_msg",$err_msg);
$smarty->assign("webgroup", $webgroup);
- $smarty->assign("gosa_conf_name" , $this->gosa_conf_name);
$smarty->assign("create_backup" , $this->create_backup);
$smarty->assign("CONFIG_DIR",CONFIG_DIR);
+ $smarty->assign("CONFIG_FILE" , CONFIG_FILE);
$smarty->assign("exists",$exists);
+
+ $smarty->assign("msg1", sprintf(_("If you want the setup routine to write the configuration file, use the 'Save configuration' button below. If you prefer to copy the '%s' manually to '%s' you can download the configuration file by using the 'Download configuration' button."), CONFIG_FILE,CONFIG_DIR));
+
+ $smarty->assign("msg2", sprintf(_("After placing the file under %s, place make sure that the webserver user is able to read %s, while other users shouldn't. You may want to execute these commands to achieve this requirement"),CONFIG_DIR,CONFIG_FILE));
+
$smarty->assign("last_backup_name",$this->last_backup_name);
$smarty->assign("writeable",$writeable);
$smarty->assign("cv",$this->parent->captured_values);
{
$info= posix_getgrgid(posix_getgid());
$webgroup = $info['name'];
- if(is_writeable(CONFIG_DIR) && is_writeable(CONFIG_DIR.$this->gosa_conf_name)){
- $src = CONFIG_DIR.$this->gosa_conf_name;
- $dst = CONFIG_DIR.$this->gosa_conf_name."_".date("Ymd");
+ if(is_writeable(CONFIG_DIR) && is_writeable(CONFIG_DIR."/".CONFIG_FILE)){
+ $src = CONFIG_DIR."/".CONFIG_FILE;
+ $dst = CONFIG_DIR."/".CONFIG_FILE."_".date("Ymd");
$dst_backup= $dst;
$i = 1;
while(file_exists($dst)){
diff --git a/setup/setup_step8.tpl b/setup/setup_step8.tpl
index 83636f7540528601b948e3a886d7dcacbdda905b..0e82254eb3c2cc49a3bd544625fc1337cece48e5 100644 (file)
--- a/setup/setup_step8.tpl
+++ b/setup/setup_step8.tpl
{t}GOsa setup has collected all data needed to create an initial configuration file.{/t}
</p>
<p>
- {t}If you want the setup routine to write the configuration file, use the 'Save configuration' button below. If you prefer to copy the 'gosa.conf' manually to '/etc/gosa/' you can download the configuration file by using the 'Download configuration' button.{/t}
+ {$msg1}
</p>
<p>
<b>{t}Automatically write configuration{/t}</b>
<pre>
{$msg_permissions}
{$CONFIG_DIR}
- {$CONFIG_DIR}{$gosa_conf_name}
+ {$CONFIG_DIR}/{$CONFIG_FILE}
</pre>
{/if}
</p>
<input type='submit' name='getconf' value='{t}Download configuration{/t}'>
</p>
<p>
- {t}After placing the file under /etc/gosa, place make sure that the webserver user is able to read gosa.conf, while other users shouldn't. You may want to execute these commands to achieve this requirement:{/t}
+ {$msg2}
</p>
<pre>
- # chown root.{$webgroup} /etc/gosa/gosa.conf
- # chmod 640 /etc/gosa/gosa.conf
+ # chown root.{$webgroup} {$CONFIG_DIR}/{$CONFIG_FILE}
+ # chmod 640 {$CONFIG_DIR}/{$CONFIG_FILE}
</pre>
</p>