steffen: server/kolab-webadmin/kolab-webadmin/www/admin/user forward.php, 1.1, 1.2 index.php, 1.1, 1.2 user.php, 1.14, 1.15 vacation.php, 1.1, 1.2
cvs at intevation.de
cvs at intevation.de
Sun Jul 18 03:36:15 CEST 2004
Author: steffen
Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user
In directory doto:/tmp/cvs-serv9269/kolab-webadmin/www/admin/user
Modified Files:
forward.php index.php user.php vacation.php
Log Message:
more gettext
Index: forward.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user/forward.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- forward.php 17 May 2004 15:24:27 -0000 1.1
+++ forward.php 18 Jul 2004 01:36:13 -0000 1.2
@@ -1,4 +1,11 @@
<?php
+/*
+ (c) 2004 Klarlvdalens 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';
@@ -14,8 +21,8 @@
$errors = array();
if( (@include_once 'admin/include/Sieve.php' ) === false ) {
- $errors[] = 'Net/Sieve.php is missing. Without that, vacation settings are not available';
- $errors[] = 'Suggest your system administrator to run "/kolab/bin/pear install http://pear.php.net/get/Net_Sieve" on the server';
+ $errors[] = _('Net/Sieve.php is missing. Without that, vacation settings are not available');
+ $errors[] = _('Suggest your system administrator to run "/kolab/bin/pear install http://pear.php.net/get/Net_Sieve" on the server');
}
/**** Authentication etc. ***/
@@ -40,13 +47,13 @@
$active = isset($_REQUEST['active']);
if( empty( $address ) ) {
- $errors[] = 'Please enter an email address';
+ $errors[] = _('Please enter an email address');
} else {
$script =
"redirect \"".addslashes($address)."\";".($keep?" keep;":"");
if( PEAR::isError( $res = $sieve->installScript( $scriptname, $script, $active ) ) ) {
$errors[] = $res->getMessage();
- $errors[] = 'Script was:';
+ $errors[] = _('Script was:');
$errors[] = '<pre>'.htmlentities($script).'</pre>';
}
if( !$active && $sieve->getActive() === $scriptname ) {
@@ -54,8 +61,8 @@
}
if( !$errors ) {
- if( $active ) $messages[] = 'Forwarding to '.$address.' successfully activated';
- else $messages[] = 'Forwarding to '.$address.' successfully deactivated';
+ if( $active ) $messages[] = _("Forwarding to '$address' successfully activated");
+ else $messages[] = _("Forwarding to '$address' successfully deactivated");
}
}
}
Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user/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:36:13 -0000 1.2
@@ -1,4 +1,11 @@
<?php
+/*
+ (c) 2004 Klarlvdalens 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 = 'user';
if( $auth->group() != 'maintainer' && $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');
@@ -38,7 +45,7 @@
if( $result ) {
$count = ldap_count_entries($ldap->connection, $result);
- $title = "Manage Email User ($count Users)";
+ $title = _("Manage Email User ($count Users)");
// 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: user.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user/user.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- user.php 16 Jul 2004 17:18:03 -0000 1.14
+++ user.php 18 Jul 2004 01:36:13 -0000 1.15
@@ -1,4 +1,11 @@
<?php
+/*
+ (c) 2004 Klarlvdalens 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');
@@ -42,7 +49,7 @@
debug("checkuniquemail( $form, $key, $value )");
global $ldap;
if( $ldap->countMail( $_SESSION['base_dn'], $value ) > 0 ) {
- return 'User or distribution list with this email address already exists';
+ return _('User or distribution list with this email address already exists');
} else {
return '';
}
@@ -59,7 +66,7 @@
foreach( $lst as $alias ) {
debug( "looking at $alias, exluding $dn" );
if( $ldap->countMail( $_SESSION['base_dn'], $alias, $excludedn ) > 0 ) {
- $str .= 'Mail address '.htmlentities($alias).' already exists<br />';
+ $str .= _('Mail address ').htmlentities($alias)._(' already exists<br />');
}
}
return $str;
@@ -74,7 +81,7 @@
$str = '';
foreach( $lst as $delegate ) {
if( $ldap->count( $ldap->search( $_SESSION['base_dn'], '(uid='.$ldap->escape($delegate).')' ) ) == 0 ) {
- return "Delegate $delegate does not exist";
+ return _("Delegate $delegate does not exist");
}
}
return '';
@@ -85,15 +92,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 '';
@@ -204,7 +211,7 @@
// 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']));
@@ -215,78 +222,78 @@
// Check auth
if (!$errors && $auth->group() != 'maintainer' && $auth->group() != 'admin' &&
!($auth->group() == 'user' && $dn == $auth->dn() )) {
- array_push($errors, "Error: You don't have the required Permissions");
+ array_push($errors, _("Error: You don't have the required Permissions") );
}
if( !$errors && $auth->group() == 'user' && ($action == 'firstsave' || $action == 'kill' ) ) {
- $errors[] = "Error: You don't have the required Permissions";
+ $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_homeserver = 'Required, non volatile';
+ $comment_mail_0 = _('Required, non volatile');
+ $comment_password = _('Required');
+ $comment_homeserver = _('Required, non volatile');
} else {
- $comment_mail_0 = 'Non volatile' ;
- $comment_password = 'Leave blank to keep password unchanged';
- $comment_homeserver = 'Non volatile';
+ $comment_mail_0 = _('Non volatile');
+ $comment_password = _('Leave blank to keep password unchanged');
+ $comment_homeserver = _('Non volatile');
}
-$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 ),
- 'mail_0' => array( 'name' => 'Primary Email Address',
+ 'mail_0' => array( 'name' => _('Primary Email Address'),
'validation' => 'notempty',
'comment' => $comment_mail_0 ),
- 'uid' => array( 'name' => 'Unique Identity (UID)',
+ 'uid' => array( 'name' => _('Unique Identity (UID)'),
#'validation' => '',
- 'comment' => 'Optional - Defaults to Primary Email Address' ),
- 'homeserver' => array( 'name' => 'Mailbox Home Server',
+ 'comment' => _('Optional - Defaults to Primary Email Address') ),
+ 'homeserver' => array( 'name' => _('Mailbox Home Server'),
'validation' => 'notempty',
'comment' => $comment_homeserver,
'value' => $_SESSION['fqhostname'] ),
- 'accttype' => array( 'name' => 'Account Type',
+ 'accttype' => array( 'name' => _('Account Type'),
'type' => 'select',
- 'options' => array( 'User Account', 'Group Account', 'Resource Account' ),
+ 'options' => array( _('User Account'), _('Group Account'), _('Resource Account') ),
'value' => 0 ),
- 'title_0' => array( 'name' => 'Title' ) );
-$entries['alias'] = array( 'name' => 'Email Aliases',
+ 'title_0' => array( 'name' => _('Title') ) );
+$entries['alias'] = array( 'name' => _('Email Aliases'),
'type' => 'textarea',
'validation' => 'checkuniquealias',
- 'comment' => 'One address per line' );
-$entries['delegate'] =array( 'name' => 'Delegates',
+ 'comment' => _('One address per line') );
+$entries['delegate'] =array( 'name' => _('Delegates'),
'type' => 'textarea',
'validation' => 'checkdelegate',
- 'comment' => 'One UID per line' );
-$entries['o_0'] = array( 'name' => 'Organisation' );
-$entries['ou_0'] = array( 'name' => 'Organisational Unit' );
-$entries['roomNumber_0'] = array( 'name' => 'Room Number' );
-$entries['street_0'] = array( 'name' => 'Street Address' );
-$entries['postOfficeBox_0'] = array( 'name' => 'Postbox' );
-$entries['postalCode_0'] = array( 'name' => 'Postal Code' );
-$entries['l_0'] = array( 'name' => 'City' );
-$entries['c_0'] = array( 'name' => 'Country' );
-$entries['telephoneNumber_0'] = array( 'name' => 'Telephone Number' );
-$entries['facsimileTelephoneNumber_0'] = array( 'name' => 'Fax Number' );
-$entries['visible'] = array( 'name' => 'Addressbook',
+ 'comment' => _('One UID per line') );
+$entries['o_0'] = array( 'name' => _('Organisation') );
+$entries['ou_0'] = array( 'name' => _('Organisational Unit') );
+$entries['roomNumber_0'] = array( 'name' => _('Room Number') );
+$entries['street_0'] = array( 'name' => _('Street Address') );
+$entries['postOfficeBox_0'] = array( 'name' => _('Postbox') );
+$entries['postalCode_0'] = array( 'name' => _('Postal Code') );
+$entries['l_0'] = array( 'name' => _('City') );
+$entries['c_0'] = array( 'name' => _('Country') );
+$entries['telephoneNumber_0'] = array( 'name' => _('Telephone Number') );
+$entries['facsimileTelephoneNumber_0'] = array( 'name' => _('Fax Number') );
+$entries['visible'] = array( 'name' => _('Addressbook'),
'type' => 'checkbox',
'value' => true,
- 'comment' => 'check here to make this users address <br> visible in the address book');
+ 'comment' => _('Check here to make this users address <br> visible in the address book'));
if( $auth->group() == "admin" || $auth->group() == "maintainer" ) {
- $entries['userquota'] = array( 'name' => 'User Quota in KB',
- 'comment' => 'Leave blank for unlimited' );
+ $entries['userquota'] = array( 'name' => _('User Quota in KB'),
+ 'comment' => _('Leave blank for unlimited') );
} else {
$entries['alias']['attrs'] = 'readonly';
$entries['homeserver']['attrs'] = 'readonly';
@@ -298,7 +305,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));
}
}
@@ -327,13 +334,13 @@
$pubkeydata=file_get_contents("/kolab/etc/kolab/res_pub.pem" );
$pkey = openssl_pkey_get_public( $pubkeydata );
if( $pkey === false ) {
- $sslerr = "Could not read resource encryption public key file://kolab/etc/kolab/res_pub.pem: ";
+ $sslerr = _("Could not read resource encryption public key file://kolab/etc/kolab/res_pub.pem: ");
while( $msg = openssl_error_string() )
$sslerr .= $msg.' ';
$errors[] = $sslerr;
} else {
if( !openssl_public_encrypt( $_POST['password_0'], $encpw, $pkey ) ) {
- $sslerr = "Could not encrypt password: ";
+ $sslerr = _("Could not encrypt password: ");
while( $msg = openssl_error_string() )
$sslerr .= $msg.' ';
$errors[] = $sslerr;
@@ -417,15 +424,18 @@
if( $ldap_object['delegate'] == array() ) unset( $ldap_object['delegate'] );
if( $ldap_object['alias'] == array() ) unset( $ldap_object['alias'] );
if ( !$errors && !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));
}
}
$dn = $newdn;
- } else array_push($errors,"LDAP Error: Could not read $dn ".ldap_error($ldap->connection));
+ } else array_push($errors,_("LDAP Error: Could not read $dn: ")
+ .ldap_error($ldap->connection));
} else {
//$ldap_object = fill_up($ldap_object);
if ($auth->group() == "user") {
@@ -434,7 +444,8 @@
unset($ldap_object['mail']);
}
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, _("LDAP Error: Could not modify object $dn: ")
+ .ldap_error($ldap->connection));
}
}
// Check for collisions on alias
@@ -445,14 +456,14 @@
$newalias = md5sum( $dn.$alias ).'@'.substr( $alias, 0, strpos( $alias, '@' ) );
$ldap_object['alias'][$i] = $newalias;
if (!ldap_modify($ldap->connection, $dn, $ldap_object)) {
- $errors[] = "LDAP Error: Could not modify object $dn ".ldap_error($ldap->connection);
+ $errors[] = _("LDAP Error: Could not modify object $dn: ").ldap_error($ldap->connection);
}
- $error[] = "Mid-air collision detected, alias $alias renamed to $newalias";
+ $error[] = _("Mid-air collision detected, alias $alias renamed to $newalias");
}
}
}
- $heading = 'Modify User';
- if( !$errors ) $messages[] = 'User '.$dn.' successfully modified';
+ $heading = _('Modify User');
+ if( !$errors ) $messages[] = _("User '$dn' successfully modified");
$form->setValues();
$form->entries['mail_0']['attrs'] = 'readonly';
$form->entries['homeserver']['attrs'] = 'readonly';
@@ -468,7 +479,7 @@
if( $ldap_object['userquota'] == array() ) unset( $ldap_object['userquota'] );
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));
// Check for mid-air collisions on mail
if( $ldap->countMail( $_SESSION['base_dn'], $ldap_object['mail'], $dn ) > 0 ) {
@@ -477,9 +488,9 @@
$newmail = md5sum( $dn.$mail ).'@'.substr( $mail, 0, strpos( $mail, '@' ) );
$ldap_object['uid'] = $ldap_object['mail'] = $newmail;
if (!ldap_modify($ldap->connection, $dn, $ldap_object)) {
- $errors[] = "LDAP Error: Could not modify object $dn ".ldap_error($ldap->connection);
+ $errors[] = _("LDAP Error: Could not modify object $dn: ").ldap_error($ldap->connection);
}
- $error[] = "Mid-air collision detected, email address $mail renamed to $newmail";
+ $error[] = _("Mid-air collision detected, email address $mail renamed to $newmail");
}
// Check for collisions on alias
@@ -490,21 +501,21 @@
$newalias = md5sum( $dn.$alias ).'@'.substr( $alias, 0, strpos( $alias, '@' ) );
$ldap_object['alias'][$i] = $newalias;
if (!ldap_modify($ldap->connection, $dn, $ldap_object)) {
- $errors[] = "LDAP Error: Could not modify object $dn ".ldap_error($ldap->connection);
+ $errors[] = _("LDAP Error: Could not modify object $dn: ").ldap_error($ldap->connection);
}
- $error[] = "Mid-air collision detected, alias $alias renamed to $newalias";
+ $error[] = _("Mid-air collision detected, alias $alias renamed to $newalias");
}
}
if( !$errors ) {
- $messages[] = 'User '.$ldap_object['dn'].' successfully created';
- $heading = 'Create New User';
+ $messages[] = _('User ').$ldap_object['dn']._(' successfully created');
+ $heading = _('Create New User');
$form->entries['action']['value'] = 'firstsave';
$content = $form->outputForm();
break;
}
} else {
- $heading = 'Create New User';
+ $heading = _('Create New User');
$blacklist = array('mail');
$form->entries['action']['value'] = 'firstsave';
$form->outputForm();
@@ -515,7 +526,7 @@
break;
}
case 'create':
- $heading = 'Create New User';
+ $heading = _('Create New User');
if( !$dn ) {
$form->entries['action']['value'] = 'firstsave';
} else {
@@ -524,13 +535,13 @@
$content = $form->outputForm();
break;
case 'modify':
- $heading = 'Modify User';
+ $heading = _('Modify User');
fill_form_for_modify( $form, $dn, $ldap_object );
$form->entries['action']['value'] = 'save';
$content = $form->outputForm();
break;
case 'delete':
- $heading = 'Delete User';
+ $heading = _('Delete User');
foreach( $form->entries as $k => $v ) {
if( $v['type'] != 'hidden' ) {
$form->entries[$k]['attrs'] = 'readonly';
@@ -538,19 +549,19 @@
}
fill_form_for_modify( $form, $dn, $ldap_object );
$form->entries['action']['value'] = 'kill';
- $form->submittext = 'Delete';
+ $form->submittext = _('Delete');
$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->deleteObject($dn)) {
- array_push($errors, "LDAP Error: could not mark ".$dn." for deletion ".$ldap->error());
+ array_push($errors, _("LDAP Error: could not mark '$dn' for deletion: ").$ldap->error());
} else {
- $heading = "User Deleted";
+ $heading = _("User Deleted");
$contenttemplate = 'userdeleted.tpl';
}
}
Index: vacation.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user/vacation.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- vacation.php 17 May 2004 15:24:27 -0000 1.1
+++ vacation.php 18 Jul 2004 01:36:13 -0000 1.2
@@ -1,4 +1,11 @@
<?php
+/*
+ (c) 2004 Klarlvdalens 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';
@@ -14,8 +21,8 @@
$errors = array();
if( (@include_once 'admin/include/Sieve.php' ) === false ) {
- $errors[] = 'Net/Sieve.php is missing. Without that, vacation settings are not available';
- $errors[] = 'Suggest your system administrator to run "/kolab/bin/pear install http://pear.php.net/get/Net_Sieve" on the server';
+ $errors[] = _('Net/Sieve.php is missing. Without that, vacation settings are not available');
+ $errors[] = _('Suggest your system administrator to run "/kolab/bin/pear install http://pear.php.net/get/Net_Sieve" on the server');
}
/**** Authentication etc. ***/
@@ -52,8 +59,8 @@
}
if( !$errors ) {
- if( $active ) $messages[] = 'Vacation message successfully activated';
- else $messages[] = 'Vacation message successfully deactivated';
+ if( $active ) $messages[] = _('Vacation message successfully activated');
+ else $messages[] = _('Vacation message successfully deactivated');
}
}
@@ -83,14 +90,14 @@
if( !$days ) $days = 7;
if( !$text ) {
$date = strftime(_('%x'));
- $text = "I am out of office till $date.\r\n".
+ $text = _("I am out of office till $date.\r\n".
"In urgent cases, please contact Mrs. <vacation replacement>\r\n\r\n".
"email: <email address of vacation replacement>\r\n".
"phone: +49 711 1111 11\r\n".
"fax.: +49 711 1111 12\r\n\r\n".
"Yours sincerely,\r\n".
"-- \r\n".
- "<enter your name and email address here>";
+ "<enter your name and email address here>");
}
$active = ( $sieve->getActive() === $scriptname );
}
More information about the commits
mailing list