steffen: server/kolab-webadmin/kolab-webadmin/www/admin/user user.php, 1.7, 1.8

cvs at intevation.de cvs at intevation.de
Mon Jun 14 04:13:05 CEST 2004


Author: steffen

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

Modified Files:
	user.php 
Log Message:
more group stuff

Index: user.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user/user.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- user.php	4 Jun 2004 10:46:47 -0000	1.7
+++ user.php	14 Jun 2004 02:13:02 -0000	1.8
@@ -104,6 +104,15 @@
   $form->entries['mail_0']['value'] = $mail_0;
   $form->entries['mail_0']['attrs'] = 'readonly';
 
+  $dncomp = split( ',', $dn );
+  if( in_array('cn=groups',$dncomp) ) {
+	$form->entries['accttype']['value'] = 1;
+  } else if( in_array('cn=resources',$dncomp) ) {
+	$form->entries['accttype']['value'] = 2;	
+  } else {
+	$form->entries['accttype']['value'] = 0;
+  }
+
   $internaldn = 'cn=internal,'.domain_dn();
   debug("<br/>internaldn=$internaldn");
   debug("<br/>ldap_object['dn']=$dn");
@@ -209,6 +218,10 @@
 								 'validation' => 'notempty',
 								 'comment' => $comment_homeserver,
 								 'value' => $_SESSION['fqhostname'] ),
+		  'accttype' => array( 'name' => 'Account Type',
+								 'type' => 'select',
+								 'options' => array( 'User Account', 'Group Account', 'Resource Account' ),
+								 'value'   => 0 ),
 		  'title_0' => array( 'name' => 'Title' ) );
 $entries['alias'] = array( 'name' => 'Email Aliases', 
 						   'type' => 'textarea',
@@ -235,6 +248,7 @@
 } else {
   $entries['alias']['attrs'] = 'readonly';
   $entries['homeserver']['attrs'] = 'readonly';
+  $entries['accttype']['attrs'] = 'readonly';
 }
 $entries['action'] = array( 'name' => 'action',
 			    'type' => 'hidden' );
@@ -301,8 +315,11 @@
 		   }
 		 }
 		 if (!$visible) $dn_add = ",cn=internal";		
-       } 
-       $domain_dn = domain_dn();
+		 if( $_POST['accttype'] == 0 ) $dn_accttype='';
+		 else if( $_POST['accttype'] == 1 ) $dn_accttype='cn=groups,';
+		 else if( $_POST['accttype'] == 2 ) $dn_accttype='cn=resources,';
+       }
+       $domain_dn = $dn_accttype.domain_dn();
 	   
        if ($action == "save") {
 		 if (!$errors) {
@@ -310,7 +327,7 @@
 		   else $newdn = $dn;
 		   if (!$visible && !strstr($newdn,$dn_add)) {
 			 list($cn,$rest) = split(',', $newdn, 2); 
-			 $newdn = $cn.$dn_add.",".$rest;
+			 $newdn = $cn.$dn_add.','.$rest;
 		   } 
 		   if (strcmp($dn,$newdn) != 0) {
 			 if (($result=ldap_read($ldap->connection,$dn,"(objectclass=*)")) &&





More information about the commits mailing list