steffen: server/kolab-webadmin/kolab-webadmin/www/admin index.php, 1.3, 1.4

cvs at intevation.de cvs at intevation.de
Sat Sep 11 04:46:02 CEST 2004


Author: steffen

Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin
In directory doto:/tmp/cvs-serv15387/kolab-webadmin/kolab-webadmin/www/admin

Modified Files:
	index.php 
Log Message:
GUI for adding system administrative aliases (dist. lists)

Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/index.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- index.php	9 Aug 2004 10:42:35 -0000	1.3
+++ index.php	11 Sep 2004 02:45:59 -0000	1.4
@@ -1,6 +1,6 @@
 <?php
 /*
- *  Copyright (c) 2004 Klarälvdalens Datakonsult AB
+ *  Copyright (c) 2004 Klarälvdalens Datakonsult AB
  *
  *    Written by Steffen Hansen <steffen at klaralvdalens-datakonsult.se>
  *
@@ -26,6 +26,24 @@
 
 require_once('admin/include/menu.php');
 
+function exists_group( $group ) {
+  global $ldap;
+  $filter = '(&(objectClass=kolabGroupOfNames)(cn='.$ldap->escape($group).'))';
+  $res = $ldap->search( $_SESSION['base_dn'], $filter, array( 'dn' ) );
+  return ( $ldap->count($res) > 0 );
+}
+
+/**** Check for system aliases ****/
+$maincontent = 'welcome.tpl';
+if( $auth->group() == 'admin' ) {
+  if( !exists_group( "hostmaster" ) ||
+	  !exists_group( "postmaster" ) ||
+	  !exists_group( "abuse" ) ) {
+	// Ok, user did not set up system aliases
+	$maincontent = 'systemaliasnagscreen.tpl';
+  }
+}
+
 /**** Insert into template and output ***/
 $smarty = new MySmarty();
 $smarty->assign( 'topdir', $topdir );
@@ -34,7 +52,7 @@
 $smarty->assign( 'page_title', 'Kolab' );
 $smarty->assign( 'menuitems', $menuitems );
 $smarty->assign( 'submenuitems', array() );
-$smarty->assign( 'maincontent', 'welcome.tpl' );
+$smarty->assign( 'maincontent', $maincontent );
 $smarty->display('page.tpl');
 
 /*





More information about the commits mailing list