summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: db71e2b)
raw | patch | inline | side by side (parent: db71e2b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Jun 2005 08:31:19 +0000 (08:31 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Jun 2005 08:31:19 +0000 (08:31 +0000) |
html/setup.php | patch | blob | history | |
include/functions_setup.inc | patch | blob | history |
diff --git a/html/setup.php b/html/setup.php
index 200edac1a4d413cf6d34b1730260686479109cef..e7e8803c63c5999753c0ce766d2acac37311cc63 100644 (file)
--- a/html/setup.php
+++ b/html/setup.php
session_start();
$_SESSION['DEBUGLEVEL']= 1;
+
+if (!isset($_GET['js']) && !isset($_SESSION['js'])){
+ echo '<script language="JavaScript" type="text/javascript">';
+ echo ' location = "index.php?js=true";';
+ echo '</script>';
+
+ $_SESSION['js']= FALSE;
+} else {
+ $_SESSION['js']= TRUE;
+}
+
/* Load required includes */
require_once ("../include/php_setup.inc");
require_once ("functions.inc");
index 0a165b2f65cce0f08ddea6f3ddedbeb77da70a07..335ee204d766e3bb9538e9b7bcfaee0d7ffb5473 100644 (file)
return $message;
}
+function is_schema_readable($server, $admin, $password)
+{
+ $ds= ldap_connect ($server);
+ if (!$ds) {
+ return (false);
+ }
+ ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
+ $r= ldap_bind ($ds, $admin, $password);
+
+ /* Get base to look for schema */
+ $sr = @ldap_read ($ds, "", "objectClass=*", array("subschemaSubentry"));
+ $attr= @ldap_get_entries($ds,$sr);
+ if (!isset($attr[0]['subschemasubentry'][0])){
+ return (false);
+ }
+
+ $nb= $attr[0]['subschemasubentry'][0];
+ $objectclasses= array();
+ $sr= ldap_read ($ds, $nb, "objectClass=*", array("objectclasses"));
+ $attrs= ldap_get_entries($ds,$sr);
+ if (!isset($attrs[0])){
+ return (false);
+ }
+ return(true);
+}
function schema_check($server, $admin, $password, $aff=0)
{
$possible_plugins['webdav'][] = "'\n.*<tab.*webdav.*>.*\n'i";
$possible_plugins['phpgroupware'][]= "'\n.*<tab.*phpgroupware.*>.*\n'i";
- /* Header information
- Needed to send the generated gosa.conf to the browser
+ /*Header information
+ Needed to send the generated gosa.conf to the browser */
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache");
} else {
header('Content-Disposition: attachment; filename="gosa.conf"');
}
- */
+
if(!$fp=fopen(CONFIG_TEMPLATE_DIR."/gosa.conf","r")) {
echo "Can't open file ".CONFIG_TEMPLATE_DIR."/gosa.conf";
} else {
}
}
- return (nl2br(htmlentities($str)));
+ return ((($str)));
}
$_SESSION['ldapconf']['password']);
$_SESSION['classes']= $m;
+ if(!is_schema_readable($ldapconf['uri'],$ldapconf['admin'],$ldapconf['password'])){
+ if($withoutput){
+ print_red(_("Can't read schema informations, GOsa needs to know your schema setup. Pleasy verify taht it is readable for GOsa"));
+ }
+ $fault=true;
+ }
+
+
+
if ($ldap->error != "Success") {
if($withoutput) {
print_red(sprintf(_("Can't log into LDAP server. Reason was: %s."), $ldap->get_error()));
if($withoutput){
$smarty->display (get_template_path('setup.tpl'));
}
-
return (!$fault);
}