steffen: server/kolab/kolab/admin/server index.php,1.8,1.9

cvs at intevation.de cvs at intevation.de
Fri Apr 16 12:17:31 CEST 2004


Author: steffen

Update of /kolabrepository/server/kolab/kolab/admin/server
In directory doto:/tmp/cvs-serv22487/admin/server

Modified Files:
	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: index.php
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/admin/server/index.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- index.php	18 Jul 2003 01:42:03 -0000	1.8
+++ index.php	16 Apr 2004 10:17:28 -0000	1.9
@@ -1,23 +1,23 @@
-<?
+<?php
 /*
  (c) 2003 Tassilo Erlewein <tassilo.erlewein at erfrakon.de>
  (c) 2003 Martin Konold <martin.konold at erfrakon.de>
  This program is Free Software under the GNU General Public License (>=v2).
  Read the file COPYING that comes with this packages for details.
 */
-	$ifiles = get_included_files();
-	if ($ifiles[3] == '') {
-		include_once("head.php");
-		This("server/");
-		Head();
-		function debug ($a) {
-		//      print "debug: $a<br>\n";
-		}
-	}
+require_once('../include/authenticate.php');
+$ifiles = get_included_files();
+if ($ifiles[3] == '') {
+  include_once("head.php");
+  This("server/");
+  Head();
+}
+function debug ($a) {
+  //      print "debug: $a<br>\n";
+}
 ?>
-
 <div class="maintitle">Server Settings</div>
-<?
+<?php
 	
 debug("debug is on");
 
@@ -35,27 +35,18 @@
 if (isset($HTTP_GET_VARS['mydomain'])) $mydomain = trim(urldecode($HTTP_GET_VARS['mydomain']));
 if (isset($HTTP_GET_VARS['mynetworks'])) $mynetworks = trim(urldecode($HTTP_GET_VARS['mynetworks']));
 
-if (!($uid = $_SERVER["PHP_AUTH_USER"]) || 
-    !($password=$_SERVER['PHP_AUTH_PW']) ||
-    !($bind_dn = uid2dn($uid)) ||
-    !($group = uid2group($uid))) 
-   array_push($errors, "Internal Error: could not read credentials");
+// user authentication 
+$uid = $auth->uid();
+$bind_dn = $auth->dn();
+$group = $auth->group();
+$link = $ldap->connection;
 
 if ($group != "admin") array_push($errors, "Error: invalid permissions");
 
-if (isset($_SESSION['ldap_server'])) $ldap_server=$_SESSION['ldap_server'];
-   else $ldap_server = "127.0.0.1";
-if (isset($_SESSION['ldap_port'])) $ldap_port=$_SESSION['ldap_port'];
-   else $ldap_port = 389;
 if (isset($_SESSION['base_dn'])) $base_dn = $_SESSION['base_dn'];
    else $base_dn = 'k=kolab' ;
 
 $myself=$_SERVER['PHP_SELF'];
-
-if (!($link=ldap_connect($ldap_server,$ldap_port)) ||
-    !ldap_bind($link, $bind_dn, $password) ) {
-   array_push($errors, "LDAP Error: could not connect to ldap://$ldap_server:$ldap_port ".ldap_error($link));
-}
 
 if (!$errors) {
 





More information about the commits mailing list