summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64706f2)
raw | patch | inline | side by side (parent: 64706f2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 29 Nov 2005 09:18:28 +0000 (09:18 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 29 Nov 2005 09:18:28 +0000 (09:18 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2120 594d385d-05f5-0310-b6e9-bd551577e9d8
html/index.php | patch | blob | history |
diff --git a/html/index.php b/html/index.php
index dc788d494836b7300ef1f2bd867e6f523293b553..74591d847f0adeea7f4b7fe9e38ed5ba66fcc455 100644 (file)
--- a/html/index.php
+++ b/html/index.php
if (is_null($ldap) || (is_int($ldap) && $ldap == 0)){
print_red (_("Can't bind to LDAP. Please contact the system administrator."));
echo $_SESSION['errors'];
+ $smarty->display(get_template_path('login.tpl'));
exit();
}
$ldap->cd($config->current['BASE']);
$ldap->search("(&(objectClass=gosaObject)(gosaSubtreeACL=:all))");
if ($ldap->count() < 1){
-#FIXME: -> ldapsetup.tpl would be better
print_red(_("You're missing an administrative account for GOsa, you'll not be able to administrate anything!"));
- echo $_SESSION['errors'];
- exit;
+ displayLogin();
+ exit();
}
/* Check for valid input */
}
$smarty->display (get_template_path('login.tpl'));
+
+
+
+
+
+
+function displayLogin()
+{
+ global $smarty,$message,$config,$ssl,$error_collector;
+ error_reporting(E_ALL);
+ /* Fill template with required values */
+ $username = "";
+ if(isset($_POST["username"])){
+ $username= $_POST["username"];
+ }
+ $smarty->assign ('date', gmdate("D, d M Y H:i:s"));
+ $smarty->assign ('username', $username);
+ $smarty->assign ('personal_img', get_template_path('images/personal.png'));
+ $smarty->assign ('password_img', get_template_path('images/password.png'));
+ $smarty->assign ('directory_img', get_template_path('images/ldapserver.png'));
+
+ /* Some error to display? */
+ if (!isset($message)){
+ $message= "";
+ }
+ $smarty->assign ("message", $message);
+
+ /* Displasy SSL mode warning? */
+ if ($ssl != "" && $config->data['MAIN']['WARNSSL'] == 'true'){
+ $smarty->assign ("ssl", "<b>"._("Warning").":</b> "._("Session will not be encrypted.")." <a style=\"color:red;\" href=\"$ssl\"><b>"._("Enter SSL session")."</b></a>!");
+ } else {
+ $smarty->assign ("ssl", "");
+ }
+
+ /* Generate server list */
+ $servers= array();
+ if (isset($_POST['server'])){
+ $selected= validate($_POST['server']);
+ } else {
+ $selected= $config->data['MAIN']['DEFAULT'];
+ }
+ foreach ($config->data['LOCATIONS'] as $key => $ignored){
+ $servers[$key]= $key;
+ }
+ $smarty->assign ("server_options", $servers);
+ $smarty->assign ("server_id", $selected);
+
+ /* show login screen */
+ $smarty->display (get_template_path('headers.tpl'));
+ $smarty->assign ("PHPSESSID", session_id());
+ if (isset($_SESSION['errors'])){
+ $smarty->assign("errors", $_SESSION['errors']);
+ }
+ if ($error_collector != ""){
+ $smarty->assign("php_errors", $error_collector."</div>");
+ } else {
+ $smarty->assign("php_errors", "");
+ }
+
+ $smarty->display(get_template_path('login.tpl'));
+ exit();
+}
+
+
+
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>