steffen: server/kolab-webadmin/kolab-webadmin/www/admin/maintainer maintainer.php, 1.13, 1.14

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/maintainer
In directory doto:/tmp/cvs-serv29305/kolab-webadmin/www/admin/maintainer

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

Index: maintainer.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/maintainer/maintainer.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- maintainer.php	11 Mar 2005 09:11:15 -0000	1.13
+++ maintainer.php	13 Oct 2005 01:50:01 -0000	1.14
@@ -176,7 +176,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)));
   }
 }
 
@@ -223,12 +223,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 ) {
@@ -237,22 +237,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)));
 			 }
 		   }
 		 }
@@ -268,11 +268,12 @@
 		   $dn = "cn=".$ldap_object['cn'].",cn=internal,".$domain_dn;
 		   debug("Calling ldap_add with dn=$dn");
 		   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)));
 		   if( $dn && !ldap_mod_add($ldap->connection, 'cn=maintainer,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[] = _('Maintainer ').$ldap_object['dn']._(' successfully created');
@@ -320,20 +321,20 @@
    $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() != "maintainer" && $auth->group() != "admin") 
      array_push($errors, _("Error: you need administrative permissions to delete users"));
    
    if (!$errors) {
 	 if(!ldap_mod_del($ldap->connection, 'cn=maintainer,cn=internal,'.domain_dn(), array('member' => $dn ) )) {
-	   $errors[] = _("LDAP Error: Could not remove $dn from maintainer group: ")
-		 .ldap_error($ldap->connection);
+	   $errors[] = sprintf(_("LDAP Error: Could not remove %s from maintainer group: %s"), $dn,
+						   ldap_error($ldap->connection));
 	 }
 	 if( !$errors ) {
 	   $delete_template['kolabdeleteflag'] = 'TRUE';
 	   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