steffen: server/kolab/kolab/admin/login head.php, 1.6, 1.7 index.php, 1.9, 1.10
cvs at intevation.de
cvs at intevation.de
Fri Apr 16 12:17:30 CEST 2004
Author: steffen
Update of /kolabrepository/server/kolab/kolab/admin/login
In directory doto:/tmp/cvs-serv22487/admin/login
Modified Files:
head.php index.php
Log Message:
Started restructuring the webinterface. New classes:
KolabLdap: Class for accessing the ldap server, API not fully evolved yet
KolabAuth: Class for authenticating a user using the LDAP class
KolabForm: HTML form handling class. This is supposed to replace the many
long input forms in the webinterface. Currently it is only used in
user/ and some error-handling is missing
Index: head.php
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/admin/login/head.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- head.php 14 Jun 2003 13:23:59 -0000 1.6
+++ head.php 16 Apr 2004 10:17:28 -0000 1.7
@@ -12,9 +12,13 @@
idxSpace(2);
}
+if( !isset( $_POST['login'] ) ) {
+ $auth =& new KolabAuth(false);
+}
+
include("../include/headfoot.php");
- $uid=$_SERVER['PHP_AUTH_USER'];
- $group_id = uid2group($uid);
+//$uid=$_SERVER['PHP_AUTH_USER'];
+//$group_id = uid2group($uid);
Function Head() {
global $title;
Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/admin/login/index.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- index.php 14 Jun 2003 13:23:59 -0000 1.9
+++ index.php 16 Apr 2004 10:17:28 -0000 1.10
@@ -5,41 +5,44 @@
This program is Free Software under the GNU General Public License (>=v2).
Read the file COPYING that comes with this packages for details.
*/
- function authenticate() {
- header('WWW-Authenticate: Basic realm="Test Authentication System"');
- header('HTTP/1.0 401 Unauthorized');
- echo "You must enter a valid login ID and password to access this resource\n";
- exit;
- }
- if (!isset($_SERVER['PHP_AUTH_USER'])
- || ($_POST['SeenBefore'] == 1 &&
- $_POST['OldAuth'] ==
- $_SERVER['PHP_AUTH_USER'])) {
- authenticate();
- }
-
- include("head.php");
- $session_uid = $_SERVER['PHP_AUTH_USER'];
- //session_register( "$session_uid");
- $HTTP_SESSION_VARS["session_uid"] = $_SERVER['PHP_AUTH_USER'];
- This("login/");
- Head();
+require_once('../include/authenticate.php');
+
+include("head.php");
+This("login/");
+Head();
?>
<?
+ /*
$uid=$_SERVER['PHP_AUTH_USER'];
$group_id = uid2group($uid);
$cn = uid2cn($uid);
$fn = uid2fn($uid);
-
+ */
?>
<div class="maintitle">Welcome to the Kolab Server Webinterface.</div>
-<div class="contentsimple">
-<p>You are current logged in with the username <b><? print($uid)?></b> and belong to group <b><?echo "$group_id"?></b>.<br>
+<dbiv class="contentsimple">
+<?php
+if( $auth->isAuthenticated() ) {
+?>
+<p>You are current logged in with the username <b><? print($auth->uid()); ?></b> and belong to group <b><?print( $auth->group()); ?></b>.<br>
</p>
<p>
-If you whish to login as another user you <b>must</b> close all relevant browser windows. This is necessary because web browser cache the old credentials otherwise.
+If you whish to login as another user you <b>must</b> log out first here:<br/>
+<form method="POST">
+<input type="submit" name="logout" value="Logout"/>
+</form>
</p>
-<?
+<?php } else { ?>
+<?php if( isset( $_GET['error'] ) ) echo '<div>'.$_GET['error'].'</div>'; ?>
+<p>
+<form method="POST">
+Username: <input type="text" name="username"/><br/>
+Password: <input type="password" name="password"/><br/>
+<input type="submit" name="login" value="Login"/>
+</form>
+</p>
+<?php
+}
/*
echo "<hr><h1>Debug Output</h1>";
More information about the commits
mailing list