steffen: server/kolab-webadmin/kolab-webadmin/www/admin/maintainer index.php, 1.1, 1.2 maintainer.php, 1.2, 1.3
cvs at intevation.de
cvs at intevation.de
Sun Jul 18 03:15:54 CEST 2004
Author: steffen
Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/maintainer
In directory doto:/tmp/cvs-serv9059/kolab-webadmin/www/admin/maintainer
Modified Files:
index.php maintainer.php
Log Message:
more gettext
Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/maintainer/index.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- index.php 17 May 2004 15:24:27 -0000 1.1
+++ index.php 18 Jul 2004 01:15:51 -0000 1.2
@@ -1,4 +1,11 @@
<?php
+/*
+ (c) 2004 Klarälvdalens Datakonsult AB
+
+ This program is Free Software under the GNU General Public License (>=v2).
+ Read the file COPYING that comes with this packages for details.
+*/
+
require_once('admin/include/mysmarty.php');
require_once('admin/include/headers.php');
require_once('admin/include/authenticate.php');
@@ -9,7 +16,7 @@
$sidx = 'maintainer';
if( $auth->group() != 'admin') {
- array_push($errors, "Error: You don't have Permissions to access this Menu");
+ array_push($errors, _("Error: You don't have Permissions to access this Menu"));
}
require_once('admin/include/menu.php');
@@ -36,7 +43,7 @@
$result = ldap_list($ldap->connection, $base_dn, $filter, array( 'uid', 'sn', 'cn', 'deleteflag' ));
if( $result ) {
- $title = 'Manage Maintainers ('.count($maintainers).' Maintainers)';
+ $title = _('Manage Maintainers (').count($maintainers)._(' Maintainers)');
// if there are more than 2000 entries, split in 26 categories for every letter,
// or if more than 50, put in groups, or else just show all.
if (false && $count > 2000) {
Index: maintainer.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/maintainer/maintainer.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- maintainer.php 16 Jul 2004 17:18:03 -0000 1.2
+++ maintainer.php 18 Jul 2004 01:15:51 -0000 1.3
@@ -1,4 +1,11 @@
<?php
+/*
+ (c) 2004 Klarälvdalens Datakonsult AB
+
+ This program is Free Software under the GNU General Public License (>=v2).
+ Read the file COPYING that comes with this packages for details.
+*/
+
require_once('admin/include/mysmarty.php');
require_once('admin/include/headers.php');
require_once('admin/include/authenticate.php');
@@ -28,7 +35,7 @@
if( is_unique( 'uid', $value ) ) {
return '';
} else {
- return 'User with this email address already exists';
+ return _('User with this email address already exists');
}
}
@@ -37,15 +44,15 @@
global $action;
if( $action == "firstsave" ) {
if( $key == 'password_0' ) {
- if( $value == '' ) return 'Password is empty';
+ if( $value == '' ) return _('Password is empty');
} else if( $key == 'password_1' ) {
if( $value != $_POST['password_0'] ) {
- return 'Passwords dont match';
+ return _('Passwords dont match');
}
}
} else {
if( $value != $_POST['password_0'] ) {
- return 'Passwords dont match';
+ return _('Passwords dont match');
}
}
return '';
@@ -114,39 +121,39 @@
// Get request data
if (!empty($_REQUEST['action']) &&
in_array($_REQUEST['action'],$valid_actions)) $action = trim(urldecode($_REQUEST['action']));
-else array_push($errors, "Error: need valid action to proceed");
+else array_push($errors, _("Error: need valid action to proceed"));
$dn="";
if (!empty($_REQUEST['dn'])) $dn = trim(urldecode($_REQUEST['dn']));
// Check auth
if (!$errors && $auth->group() != "admin" ) {
- array_push($errors, "Error: You don't have the required Permissions");
+ array_push($errors, _("Error: You don't have the required Permissions"));
}
// Fill in data
if ($action == "create") {
- $comment_mail_0 = 'Required, non volatile' ;
- $comment_password = 'Required';
+ $comment_mail_0 = _('Required, non volatile');
+ $comment_password = _('Required');
} else {
- $comment_mail_0 = 'non volatile' ;
- $comment_password = 'Leave blank to keep password unchanged';
+ $comment_mail_0 = _('non volatile');
+ $comment_password = _('Leave blank to keep password unchanged');
}
-$entries = array( 'firstname' => array( 'name' => 'First Name',
+$entries = array( 'firstname' => array( 'name' => _('First Name'),
'validation' => 'notempty',
- 'comment' => 'Required' ),
- 'lastname' => array( 'name' => 'Last Name',
+ 'comment' => _('Required') ),
+ 'lastname' => array( 'name' => _('Last Name'),
'validation' => 'notempty',
- 'comment' => 'Required' ),
- 'password_0' => array( 'name' => 'Password',
+ 'comment' => _('Required') ),
+ 'password_0' => array( 'name' => _('Password'),
'type' => 'password',
'validation' => 'checkpw',
'comment' => $comment_password ),
- 'password_1' => array( 'name' => 'Verify Password',
+ 'password_1' => array( 'name' => _('Verify Password'),
'type' => 'password',
'validation' => 'checkpw',
'comment' => $comment_password ),
- 'uid' => array( 'name' => 'Unique User ID',
+ 'uid' => array( 'name' => _('Unique User ID'),
'validation' => 'notempty',
'comment' => $comment_mail_0 ));
@@ -156,7 +163,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, _("LDAP Error: No such dn: $dn: ").ldap_error($ldap->connection));
}
}
@@ -201,10 +208,12 @@
($oldattrs=ldap_get_attributes($ldap->connection,$entry))) {
$ldap_object['uid'] = $oldattrs['uid'][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, _("LDAP Error: could not rename $dn to $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, _("LDAP Error: could not remove old entry $dn: ")
+ .ldap_error($ldap->connection));
}
}
if( !$errors ) {
@@ -212,28 +221,28 @@
$groupdn = 'cn=maintainer,'.$domain_dn;
if( !ldap_mod_delete($ldap->connection,$groupdn,
array( 'member' => $dn ) ) ) {
- $errors[] = "LDAP Error: Could not remove old group entry $dn: "
+ $errors[] = _("LDAP Error: Could not remove old group entry $dn: ")
.ldap_error($ldap->connection());
}
if( !$errors && ldap_mod_add( $ldap->connection,
$groupdn,
array( 'member' => $newdn ) ) ) {
- $errors[] = "LDAP Error: Could not add new group entry $newdn: "
+ $errors[] = _("LDAP Error: Could not add new group entry $newdn: ")
.ldap_error($ldap->connection());
}
}
$dn = $newdn;
- } else array_push($errors,"LDAP Error: could not read $dn "
+ } else array_push($errors,_("LDAP Error: could not read $dn ")
.ldap_error($ldap->connection));
} else {
if (!ldap_modify($ldap->connection, $dn, $ldap_object)) {
- array_push($errors, "LDAP Error: could not modify object $dn "
+ array_push($errors, _("LDAP Error: could not modify object $dn ")
.ldap_error($ldap->connection));
}
}
}
- $heading = 'Modify Maintainer';
- $messages[] = 'Maintainer '.$ldap_object['dn'].' successfully modified';
+ $heading = _('Modify Maintainer');
+ $messages[] = _('Maintainer ').$ldap_object['dn']._(' successfully modified');
$form->setValues();
$form->entries['action']['value'] = 'save';
$content = $form->outputForm();
@@ -244,20 +253,21 @@
$dn = "cn=".$ldap_object['cn'].",".$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, _("LDAP Error: could not add object $dn_ ").ldap_error($ldap->connection));
if( $dn && !ldap_mod_add($ldap->connection, 'cn=maintainer,'.$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, _("LDAP Error: could not add object $dn to maintainer group: ")
+ .ldap_error($ldap->connection));
}
if( !$errors ) {
- $messages[] = 'Maintainer '.$ldap_object['dn'].' successfully created';
- $heading = 'Create New Maintainer';
+ $messages[] = _('Maintainer ').$ldap_object['dn']._(' successfully created');
+ $heading = _('Create New Maintainer');
$form->entries['action']['value'] = 'firstsave';
$content = $form->outputForm();
break;
}
} else {
- $heading = 'Create New Maintainer';
+ $heading = _('Create New Maintainer');
$blacklist = array('mail');
$form->entries['action']['value'] = 'firstsave';
$form->outputForm();
@@ -268,7 +278,7 @@
break;
}
case 'create':
- $heading = 'Create New Maintainer';
+ $heading = _('Create New Maintainer');
if( !$dn ) {
$form->entries['action']['value'] = 'firstsave';
} else {
@@ -277,13 +287,13 @@
$content = $form->outputForm();
break;
case 'modify':
- $heading = 'Modify Maintainer';
+ $heading = _('Modify Maintainer');
fill_form_for_modify( $form, $ldap_object );
$form->entries['action']['value'] = 'save';
$content = $form->outputForm();
break;
case 'delete':
- $heading = 'Delete Maintainer';
+ $heading = _('Delete Maintainer');
foreach( $form->entries as $k => $v ) {
if( $v['type'] != 'hidden' ) {
$form->entries[$k]['attrs'] = 'readonly';
@@ -295,24 +305,25 @@
$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");
+ array_push($errors, _("Error: you need administrative permissions to delete users"));
if (!$errors) {
if(!ldap_mod_del($ldap->connection, 'cn=maintainer,'.domain_dn(), array('member' => $dn ) )) {
- $errors[] = "LDAP Error: Could not remove $dn from maintainer group: "
+ $errors[] = _("LDAP Error: Could not remove $dn from maintainer group: ")
.ldap_error($ldap->connection);
}
if( !$errors ) {
$delete_template['deleteflag'] = 'TRUE';
if( !$ldap->deleteObject($dn)) {
- array_push($errors, "LDAP Error: could not mark ".$dn." for deletion ".ldap_error($ldap->connection));
+ array_push($errors, _("LDAP Error: could not mark $dn for deletion ")
+ .ldap_error($ldap->connection));
}
}
}
if( !$errors ) {
- $heading = "Maintainer Deleted";
+ $heading = _('Maintainer Deleted');
$contenttemplate = 'maintainerdeleted.tpl';
}
break;
More information about the commits
mailing list