steffen: server/kolab-webadmin/kolab-webadmin/www/admin/administrator admin.php, 1.11, 1.12

cvs at intevation.de cvs at intevation.de
Thu Oct 13 03:50:03 CEST 2005


Author: steffen

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

Modified Files:
	admin.php 
Log Message:
Fix for issue886 (i18n problem)

Index: admin.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/administrator/admin.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- admin.php	11 Mar 2005 09:11:15 -0000	1.11
+++ admin.php	13 Oct 2005 01:50:01 -0000	1.12
@@ -95,7 +95,7 @@
   if( $uid == 'manager' ) {
 	unset($form->entries['password_1']);
 	$form->entries['password_0']['type'] = 'comment';
-	$form->entries['password_0']['value'] = _('Manager\'s password can\'t be changed from the webgui'); 
+	$form->entries['password_0']['value'] = _("Manager's password can't be changed from the webgui"); 
   }
 
   /*
@@ -183,7 +183,7 @@
 if( $dn ) {
   $ldap_object = $ldap->read( $dn );
   if( !$ldap_object ) {
-    array_push($errors, _("LDAP Error: No such dn: $dn: ").ldap_error($ldap->connection));
+    array_push($errors, sprintf(_("LDAP Error: No such dn: %s: %s"), $dn, ldap_error($ldap->connection)));
   }
 }
 
@@ -230,10 +230,12 @@
 			   if( empty($ldap_object['userPassword']) )
 				 $ldap_object['userPassword'] = $oldattrs['userPassword'][0];
 			   if (!ldap_add($ldap->connection,$newdn, $ldap_object) )
-				 array_push($errors, _("LDAP Error: could not rename $dn to $newdn: ").ldap_error($ldap->connection));
+				 array_push($errors, sprintf( _("LDAP Error: could not rename %1\$s to %2\$s: %3\$s"), $dn, 
+											  $newdn, ldap_error($ldap->connection)));
 			   if( !$errors ) {
 				 if( !ldap_delete($ldap->connection,$dn)) {
-				   array_push($errors, _("LDAP Error: could not remove old entry $dn: ").ldap_error($ldap->connection));
+				   array_push($errors, sprintf(_("LDAP Error: could not remove old entry %s: %s"), $dn, 
+											   ldap_error($ldap->connection)));
 				 }
 			   }
 			   if( !$errors ) {
@@ -242,22 +244,22 @@
 				 if( !ldap_mod_add( $ldap->connection,
 											   $groupdn,
 											   array( 'member' => $newdn ) ) ) {
-				   $errors[] = _("LDAP Error: Could not add new group entry $newdn: ")
-					 .ldap_error($ldap->connection);
+				   $errors[] = sprintf(_("LDAP Error: Could not add new group entry %s: %s"), $newdn,
+									   ldap_error($ldap->connection));
 				 }
 				 if( !$errors && !ldap_mod_del($ldap->connection,$groupdn,
 									  array( 'member' => $dn ) ) ) {
-				   $errors[] = _("LDAP Error: Could not remove old group entry $dn: ")
-					 .ldap_error($ldap->connection);
+				   $errors[] = sprintf( _("LDAP Error: Could not remove old group entry %s: %s"), $dn, 
+										ldap_error($ldap->connection));
 				 }
 			   }			   
 			   $dn = $newdn;
-			 } else array_push($errors,_("LDAP Error: could not read $dn ")
-							   .ldap_error($ldap->connection));
+			 } else array_push($errors,sprintf(_("LDAP Error: could not read %s: %s"), $dn,
+											   ldap_error($ldap->connection)));
 		   } else {
 			 if (!ldap_modify($ldap->connection, $dn, $ldap_object)) {
-			   array_push($errors, _("LDAP Error: could not modify object $dn ")
-						  .ldap_error($ldap->connection));
+			   array_push($errors, sprintf(_("LDAP Error: could not modify object %s: %s"), $dn.
+										   ldap_error($ldap->connection)));
 			 }
 		   }
 		 }
@@ -274,12 +276,14 @@
 		   debug("Calling ldap_add with dn=$dn");
 		   // Add object to db
 		   if ($dn && !ldap_add($ldap->connection, $dn, $ldap_object)) 
-			 array_push($errors, _("LDAP Error: could not add object $dn: ").ldap_error($ldap->connection));
+			 array_push($errors, sprintf(_("LDAP Error: could not add object %s: %s"), $dn, 
+										 ldap_error($ldap->connection)));
 
 		   // Add object to admin group
 		   if( $dn && !ldap_mod_add($ldap->connection, 'cn=admin,cn=internal,'.$domain_dn, 
 									array( 'member' => $dn ) ) ) {
-			 array_push($errors, _("LDAP Error: could not add object $dn to maintainer group: ").ldap_error($ldap->connection));
+			 array_push($errors, sprintf( _("LDAP Error: could not add object %s to maintainer group: %s"), $dn,
+										  ldap_error($ldap->connection)));
 		   }
 		   if( !$errors ) {
 			 $messages[] = _('Administrator ').$ldap_object['dn']._(' successfully created');
@@ -327,18 +331,19 @@
    $content = $form->outputForm();
    break;
  case 'kill':
-   if (!$dn) array_push($errors, _("Error: need dn for delete operation"));
+   if (!$dn) array_push($errors, _("Error: need DN for delete operation"));
    elseif ($auth->group() != "admin") 
      array_push($errors, _("Error: you need administrative permissions to delete administrators"));
    
    if (!$errors) {
 	 if(!ldap_mod_del($ldap->connection, 'cn=admin,cn=internal,'.domain_dn(), array('member' => $dn ) )) {
-	   $errors[] = _("LDAP Error: Could not remove $dn from admin group: ")
-		 .ldap_error($ldap->connection);
+	   $errors[] = sprintf(_("LDAP Error: Could not remove %s from admin group: %s"), $dn,
+							ldap_error($ldap->connection));
 	 }
 	 if( !$errors ) {
 	   if( !$ldap->deleteObject($dn) ) {
-		 array_push($errors, _("LDAP Error: could not mark $dn for deletion ").ldap_error($ldap->connection));
+		 array_push($errors, sprintf(_("LDAP Error: could not mark %s for deletion: %s"), $dn,
+									 ldap_error($ldap->connection)));
 	   }
 	 }
    }





More information about the commits mailing list