password != $_SESSION['confwiz_masterpwd']) { require("../config/conflogin.php"); exit; } // check if user clicked on buttons if ($_POST['submit'] || $_POST['cancel']) { unset($error); unset($ret); if ($_POST['cancel']) { @unlink("../../config/" . $_SESSION['confwiz_config']->file . ".conf"); metarefresh('../config/conflogin.php'); } else { // check server URL if ($_SESSION['confwiz_config']->set_serverURL($_POST['serverurl'])) { // set Samba version if ($_POST['sambaversion'] == "2") $_SESSION['confwiz_config']->set_samba3("no"); else $_SESSION['confwiz_config']->set_samba3("yes"); $_SESSION['confwiz_config']->set_Adminstring($_POST['ldapadmin']); // save settings $_SESSION['confwiz_config']->save(); // create LDAP object and test connection $_SESSION['confwiz_ldap'] = new Ldap($_SESSION['confwiz_config']); $ret = $_SESSION['confwiz_ldap']->connect($_POST['ldapadmin'], $_POST['ldappwd']); if ($ret === 0) { metarefresh('server2.php'); } elseif ($ret === False) $error = _("Cannot connect to specified LDAP-Server. Please try again."); elseif ($ret == 81) $error = _("Cannot connect to specified LDAP-Server. Please try again."); elseif ($ret == 49) $error = _("Wrong Password/Username combination. Try again."); else $error = _("LDAP error, server says:") . "\n
($ret) " . ldap_err2str($ret); } else { $error = _("Server Address is empty!"); } // print error message if needed if ($error) { echo $_SESSION['header']; echo "\n"; echo "\n"; echo _("Configuration wizard"); echo "\n"; echo "\n"; StatusMessage("ERROR", $error, ""); echo "



" . _("Back to last page") . "

\n"; echo "\n"; } // if all ok, go to next page else { metarefresh('server2.php'); } } exit; } // check if back button was pressed $back = false; if ($_GET['back'] || $_POST['back']) { $back = true; $auth = $_SESSION['confwiz_ldap']->decrypt(); } echo $_SESSION['header']; echo "\n"; echo _("Configuration wizard"); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "

\n"; echo "\"LDAP\n"; echo "

\n"; echo "
\n"; // formular echo "
\n"; echo "

\n"; echo "\n"; // server URL echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; // admin user+password echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; // master password echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo _("Please enter the URL of your LDAP server.") . "

" . _("Examples") . ":

ldap://myserver.mydomain.org
ldaps:myserver.mydomain.org
localhost:389" . "\n"; echo "
 
\n"; echo "" . _("Server address") . ":\n"; echo "\n"; if ($back) echo "get_ServerURL() . "\">\n"; else echo "\n"; echo "
 
\n"; echo _("To connect to your LDAP server please enter now the DN of your administrative user and the password.") . "\n"; echo "
 
\n"; echo "" . _("LDAP admin DN") . ":\n"; echo "\n"; if ($back) echo "\n"; else echo "\n"; echo "
\n"; echo "" . _("Password") . ":\n"; echo "\n"; if ($back) echo "\n"; else echo "\n"; echo "
 
 
\n"; echo _("Which Samba version do you use?") . "\n"; echo "
 
\n"; echo "" . _("Samba version") . ":\n"; echo "\n"; echo "\n"; echo "
\n"; echo "


\n"; // next/cancel button echo "

\n"; echo "\n"; echo "\n"; echo "

\n"; echo "
\n"; echo "\n\n"; ?>