summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b732853)
raw | patch | inline | side by side (parent: b732853)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Nov 2006 13:32:11 +0000 (13:32 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Nov 2006 13:32:11 +0000 (13:32 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5036 594d385d-05f5-0310-b6e9-bd551577e9d8
html/setup.php | patch | blob | history | |
include/functions_setup.inc | patch | blob | history |
diff --git a/html/setup.php b/html/setup.php
index aec16d04da27f6ba50e3d8a87fd1b024d4e73e7d..b41669a239fe98ecbe5cf748c60689c34e0e8284 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 = "setup.php?js=true";';
echo '</script>';
$_SESSION['js']= FALSE;
-} else {
+} elseif(isset($_GET['js'])) {
$_SESSION['js']= TRUE;
}
// No Errors occured yet
$_SESSION['errors']= "";
+$_SESSION['errors'] = "";
+$_SESSION['errorsAlreadyPosted']= array();
+$_SESSION['LastError'] = "";
+
// Print out gosa.conf
//if(isset($_SESSION['classes'])) print "\$_SESSION['classes']=ok";
// and we call this func again, to output the error
// I hope this will work fine ^^
-if((!show_setup_page1(false))||($next == 1)) {
+if((show_setup_page1(false))||($next == 1)) {
show_setup_page1();
-} elseif((!show_setup_page2(false))||($next==2)) {
+} elseif((show_setup_page2(false))||($next==2)) {
show_setup_page2();
-} elseif((!show_setup_page3(false))||($next==3)) {
+} elseif((show_setup_page3(false))||($next==3)) {
show_setup_page3();
-} elseif((!show_setup_page4(false))||($next==4)) {
+} elseif((show_setup_page4(false))||($next==4)) {
show_setup_page4();
}
// This is called to test if we have an administrative Group with a User in it
index cabcbbdb1c9128883b402e4fe900c3d2757a03c0..8c19f8fa25c663d929fc843258029e0d708fd254 100644 (file)
/* Show setup_page 1 */
function show_setup_page1($withoutput = true)
{
- $faults = array();
+ $faults = false;
$smarty = get_smarty();
$smarty->assign ("content", get_template_path('setup_introduction.tpl'));
$smarty->assign ("tests", perform_php_checks($faults));
$smarty->display (get_template_path('setup.tpl'));
}
- return (!$faults);
+ return ($faults);
}
$smarty->display (get_template_path('setup.tpl'));
}
- return (!$faults);
+ return ($faults);
}
/* No error till now */
$fault = false;
- /* If we pushed the Button continue */
- if(isset($_POST['continue3'])){
- if(!isset($uri)) {
- $fault = true;
-
- /* Output the Error */
- if($withoutput) {
- print_red (_("You've to specify an ldap server before continuing!"));
- $smarty->assign ("content", get_template_path('setup_step3.tpl'));
- }
- }
- } elseif (!$ds = @ldap_connect (validate($uri))) {
+ if (!$ds = @ldap_connect (validate($uri))) {
$fault =true;
/* Output the Error */
$smarty->display (get_template_path('setup.tpl'));
}
- return (!$fault);
+ return ($fault);
}
{
$smarty= get_smarty();
+ /* check POST data */
+ if(isset($_POST['check'])) {
+
+ /* Check if all needed vars are submitted */
+ foreach($checkvars as $key) {
+ if($key == "peopleou"){
+ continue;
+ }
+ if($key == "groupou"){
+ continue;
+ }
+
+ if((isset($_POST[$key]))&&($_POST[$key]!="")) {
+ $_SESSION['ldapconf'][$key] = $_POST[$key];
+ } else {
+ if($withoutput) {
+ print_red(sprintf(_("You're missing the required attribute '%s' from this formular. Please complete!"), $key));
+ }
+ $fault = true;
+ }
+ }
+ }
+
+ /* Transfer base */
+ if(isset($_POST['base'])){
+ $_SESSION['ldapconf']['base']= $_POST['base'];
+ }
+
// ?
if(!isset($_SESSION['ldapconf']['base'])){
$_SESSION['ldapconf']['base']= $base;
/* If there are some empty vars in ldapconnect -
these values also represent out default values */
- if(!$ds = @ldap_connect (validate($uri))){
+ if(!$ds = @ldap_connect (validate($uri))){
$fault = true;
if($withoutput){
print_red (_("Can't connect to the specified LDAP server! Please make sure that is reachable for GOsa."));
} elseif(!@ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)){
$fault = true;
if($withoutput){
- print_red (_("Can't bind to the specified LDAP server! Please make sure that it is reachable for GOsa."));
+ print_red (_("Can't set ldap protocol version 3."));
}
} elseif(!$r= @ldap_bind ($ds)){
$fault = true;
if($withoutput){
- print_red (_("Can't bind to the specified LDAP server! Please make sure that it is reachable for GOsa."));
+ print_red (_("Could not bind to the specified LDAP server! Please make sure that it is reachable for GOsa."));
}
} else {
- $sr= @ldap_search ($ds, NULL, "objectClass=*", array("namingContexts"));
+ $sr= @ldap_search ($r, NULL, "objectClass=*", array("namingContexts"));
$attr= @ldap_get_entries($ds,$sr);
if((empty($attr))) {
- $base= "dc=example,dc=net";
if($withoutput){
- print_red(_("Bind to server successful, but the server seems to be completly empty, please check all information twice"));
+# print_red(_("Bind to server successful, but the server seems to be completly empty, please check all information twice"));
}
} else {
$_SESSION['ldapconf']['arr_crypts'] = $tmp['md5'];
}
- /* check POST data */
- if(isset($_POST['check'])) {
-
- /* Check if all needed vars are submitted */
- foreach($checkvars as $key) {
- if($key == "peopleou"){
- continue;
- }
- if($key == "groupou"){
- continue;
- }
-
- if((isset($_POST[$key]))&&($_POST[$key]!="")) {
- $_SESSION['ldapconf'][$key] = $_POST[$key];
- } else {
- if($withoutput) {
- print_red(sprintf(_("You're missing the required attribute '%s' from this formular. Please complete!"), $key));
- }
- $fault = true;
- }
- }
- }
-
- /* Transfer base */
- if(isset($_POST['base'])){
- $_SESSION['ldapconf']['base']= $_POST['base'];
- }
-
$smarty->assign("arr_cryptkeys",$_SESSION['ldapconf']['arr_cryptkeys']);
$smarty->assign("mail_methods", $_SESSION['ldapconf']['mail_methods']);
$smarty->assign($key,$val);
}
- if(isset($_POST['check'])) {
+ if(isset($_POST['check']) || (isset($_POST['admin'])) && isset($_POST['password'])) {
$ldap= new LDAP($_SESSION['ldapconf']['admin'],
$_SESSION['ldapconf']['password'],
$_SESSION['ldapconf']['uri']);
if($withoutput){
$smarty->display (get_template_path('setup.tpl'));
}
- return (!$fault);
+
+ return ($fault);
}