+ $error = write_config_db($new);
+ if ($error == -1)
+ display_error(_("Cannot open the configuration file - ") . $path_to_root . "/config_db.php");
+ else if ($error == -2)
+ display_error(_("Cannot write to the configuration file - ") . $path_to_root . "/config_db.php");
+ else if ($error == -3)
+ display_error(_("The configuration file ") . $path_to_root . "/config_db.php" . _(" is not writable. Change its permissions so it is, then re-run the operation."));
+ if ($error != 0)
+ {
+ return false;
+ }
+ $index = "<?php\nheader(\"Location: ../../index.php\");\n?>";
+
+ if ($new)
+ {
+ $cdir = $comp_path.'/'.$id;
+ @mkdir($cdir);
+ save_to_file($cdir.'/'.'index.php', 0, $index);
+
+ foreach($comp_subdirs as $dir)
+ {
+ @mkdir($cdir.'/'.$dir);
+ save_to_file($cdir.'/'.$dir.'/'.'index.php', 0, $index);
+ }
+ }