You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(30) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(2) |
Feb
(5) |
Mar
(11) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <ag...@us...> - 2008-09-04 10:57:10
|
Revision: 54 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=54&view=rev Author: agrassi Date: 2008-09-04 10:57:21 +0000 (Thu, 04 Sep 2008) Log Message: ----------- Password handling improved HTTPS detection centralized and moved to $status Modified Paths: -------------- trunk/includes/functions.php trunk/index.php trunk/modules/email/modify/chpw.php trunk/modules/email/modifynwl/chpw.php trunk/tpl/header.php Added Paths: ----------- trunk/tpl/password.php Modified: trunk/includes/functions.php =================================================================== --- trunk/includes/functions.php 2008-07-03 11:23:18 UTC (rev 53) +++ trunk/includes/functions.php 2008-09-04 10:57:21 UTC (rev 54) @@ -36,7 +36,8 @@ 'data', 'scookie', 'page', - 'subuser' + 'subuser', + 'https' ); // Link creation function @@ -77,7 +78,7 @@ global $status; - $link = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?"; + $link = "http" . $status->https . "://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?"; for ($i = 0; $i < sizeof($fields); $i++) { $field = $fields[$i]; Modified: trunk/index.php =================================================================== --- trunk/index.php 2008-07-03 11:23:18 UTC (rev 53) +++ trunk/index.php 2008-09-04 10:57:21 UTC (rev 54) @@ -32,6 +32,12 @@ // Fill $status with command line $status = decode_status(); +if($_SERVER['HTTPS'] == 'on') { + $status->https = 's'; +} else { + $status->https = ''; +} + if(!is_loggedin()){ if($_POST['username'] && $_POST['password']){ do_login($_POST['username'],$_POST['password']); Modified: trunk/modules/email/modify/chpw.php =================================================================== --- trunk/modules/email/modify/chpw.php 2008-07-03 11:23:18 UTC (rev 53) +++ trunk/modules/email/modify/chpw.php 2008-09-04 10:57:21 UTC (rev 54) @@ -24,18 +24,23 @@ $status->message = _("Insert the new password for the local mailbox "). $status->user."@".$status->domain; $status->ask = true; $status->cancel_to = make_link(array('mode','domain','user','op')); - $status->body = 'input'; + $status->body = 'password'; return; } // Password has been supplied, scookie is ok -if (changePassword("$status->user@$status->domain", $status->data)) { - $status->title = _("Operation successful."); - $status->message = _("The password for the address ") . $status->user."@".$status->domain ." has been updated."; +if($status->data[1] == $status->data[2]) { + if (changePassword("$status->user@$status->domain", $status->data[1])) { + $status->title = _("Operation successful."); + $status->message = _("The password for the address ") . $status->user."@".$status->domain ." has been updated."; + } else { + $status->title = _("Error"); + $status->message = _("Error while updating the password for the address ") . $status->user."@".$status->domain; + + } } else { - $status->title = _("Error"); - $status->message = _("Error while updating the password for the address ") . $status->user."@".$status->domain; - + $status->title = _("Error"); + $status->message = _("Supplied passwords don't match"); } $status->body = 'message'; Modified: trunk/modules/email/modifynwl/chpw.php =================================================================== --- trunk/modules/email/modifynwl/chpw.php 2008-07-03 11:23:18 UTC (rev 53) +++ trunk/modules/email/modifynwl/chpw.php 2008-09-04 10:57:21 UTC (rev 54) @@ -29,12 +29,17 @@ } // Password has been supplied, scookie is ok -if (changeNWLPassword("$status->user@$status->domain", $status->data)) { - $status->title = _("Operation successful."); - $status->message = _("The password for the newsletter "). "$status->user@$status->domain" . _(" has been updated."); +if($status->data[1] == $status->data[2]) { + if (changeNWLPassword("$status->user@$status->domain", $status->data)) { + $status->title = _("Operation successful."); + $status->message = _("The password for the newsletter "). "$status->user@$status->domain" . _(" has been updated."); + } else { + $status->title = _("Error"); + $status->message = _("Error while updating the password for the newsletter") . "$status->user@$status->domain"; + } } else { - $status->title = _("Error"); - $status->message = _("Error while updating the password for the newsletter") . "$status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Supplied passwords don't match"); } $status->body = 'message'; Modified: trunk/tpl/header.php =================================================================== --- trunk/tpl/header.php 2008-07-03 11:23:18 UTC (rev 53) +++ trunk/tpl/header.php 2008-09-04 10:57:21 UTC (rev 54) @@ -19,7 +19,6 @@ */ ?> <?= '<?xml version="1.0"?>' ?> -<? if($_SERVER['HTTPS'] == 'on') { $is_https="s"; } else { $is_https=""; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" @@ -38,7 +37,7 @@ <a href='<?= make_link(array()).'?mode=email' ?>'>e-mail</a> <a href='<?= make_link(array()).'?mode=domain' ?>'><?= _("domains") ?></a> <a href='<?= make_link(array()).'?mode=domainalias' ?>'><?= _("alias domains") ?></a> - <a href='<?= "http" . $is_https . "://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/nwadmin" ?>' target="_blank">newsletter</a> + <a href='<?= "http" . $status->is_https . "://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/nwadmin" ?>' target="_blank">newsletter</a> <? if(is_administrator()) { ?> <br /> <a href='<?= make_link(array()).'?mode=users' ?>'><?= _("users") ?></a> Added: trunk/tpl/password.php =================================================================== --- trunk/tpl/password.php (rev 0) +++ trunk/tpl/password.php 2008-09-04 10:57:21 UTC (rev 54) @@ -0,0 +1,34 @@ +<? +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +?> + <h4><?= $status->title ?></h4> + <p><?= $status->message ?></p> + <form name='input' method='get' action='#'> + <p> + <?= make_hidden_fields(array ('mode', 'op', 'domain', 'user', 'subop', 'scookie')) ?> + <input type='password' name='data[1].' value='<?= $status->data[1] ?>' /><br /> + <?= _("Repeat password: ") ?> <br /><input type='password' name='data[2].' value='<?= $status->data[1] ?>' /><br /> + + </p> + <p> + [<a href='#' onclick='input.submit()'>ok</a>] + [<a href='<?= $status->cancel_to ?>'><?= _("cancel") ?></a>] + </p> + </form> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mn...@us...> - 2008-07-03 11:23:21
|
Revision: 53 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=53&view=rev Author: mnencia Date: 2008-07-03 04:23:18 -0700 (Thu, 03 Jul 2008) Log Message: ----------- Body of newsletter emails are now a bytea field Modified Paths: -------------- trunk/nwadmin/backend/functions.php trunk/nwadmin/moderation.php trunk/nwadmin/send.php trunk/setup/bin/newsletter trunk/setup/sql/create.sql Modified: trunk/nwadmin/backend/functions.php =================================================================== --- trunk/nwadmin/backend/functions.php 2008-03-21 18:29:18 UTC (rev 52) +++ trunk/nwadmin/backend/functions.php 2008-07-03 11:23:18 UTC (rev 53) @@ -119,7 +119,7 @@ // Utility to create links based on cmdline variables function make_get_link($fields) { // Take the fields to copy as array argument if($_SERVER['HTTPS'] == 'on') { $is_https = "s"; } else { $is_https = ""; }; - + $link = "http" . $is_https . "://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?"; // Build my own url for ($i = 0; $i < sizeof($fields); $i++) { // For each field $field = $fields[$i]; @@ -190,33 +190,33 @@ global $dbh; // Get the full email body, comprehensive of headers - $fullbody = $dbh->getOne('SELECT body FROM newsletter_mails WHERE id = ? AND nwl_id = get_nwl_id(?)',array($mailid,$nwl)); + $fullbody = stripcslashes($dbh->getOne('SELECT body FROM newsletter_mails WHERE id = ? AND nwl_id = get_nwl_id(?)',array($mailid,$nwl))); // Prepare an object for the decoded full body - $obj = new Mail_mimeDecode($fullbody); + $decoder = new Mail_mimeDecode($fullbody); - // Empty args - $decode_args = array(); + $parts = $decoder->getSendArray(); + + if (!PEAR::isError($parts)) { + list($recipents,$headers,$body) = $parts; + + // Get SMTP hostname from config.php + $params['host'] = SMTP_SMARTHOST; + + // Prepare the mail to be sent + $mail_object =& Mail::factory('smtp',$params); - // Set options for the decoding operation - $decode_args['decode_headers'] = true; - $decode_args['decode_bodies'] = true; - $decode_args['include_bodies'] = true; - $result = $obj->decode($decode_args); // Decode the full body + // Send the mail + $mail_object->send($stack,$headers,$body); - // Delete the first line from the headers (From blah blah) - array_shift($result->headers); + } + else { + echo "<pre>\n"; + echo "{$parts->message}\n"; + echo "</pre>\n"; + die; + } - // Get SMTP hostname from config.php - $params['host'] = SMTP_SMARTHOST; - - // Prepare the mail to be sent - $mail_object =& Mail::factory('smtp',$params); - - // Send the mail - $mail_object->send($stack,$result->headers,$result->body); - - } // send_stacked_mail() ?> Modified: trunk/nwadmin/moderation.php =================================================================== --- trunk/nwadmin/moderation.php 2008-03-21 18:29:18 UTC (rev 52) +++ trunk/nwadmin/moderation.php 2008-07-03 11:23:18 UTC (rev 53) @@ -17,15 +17,14 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -require_once('backend/functions.php'); -define('XML_HTMLSAX3', "backend/classes/"); -require_once('backend/classes/safehtml.php'); - // If the script invoked by the browser has the same name of the real file if (isset($_SERVER['SCRIPT_FILENAME']) && (__FILE__ == $_SERVER['SCRIPT_FILENAME'])) { exit(_("Direct access not allowed")) ; // Die brutally (invoked script should always be index.php) } +define('XML_HTMLSAX3', "backend/classes/"); +require_once('backend/classes/safehtml.php'); + $safehtml =& new safehtml(); // Store the mail ID into a local variable @@ -40,7 +39,7 @@ <li><b>Data</b>: <?= $mails[$num]['arrived'] ?></li> <br /> <pre> -<?= $safehtml->parse($mails[$num]['body']) ?> +<?= $safehtml->parse(stripcslashes($mails[$num]['body'])) ?> </pre> <br /> Modified: trunk/nwadmin/send.php =================================================================== --- trunk/nwadmin/send.php 2008-03-21 18:29:18 UTC (rev 52) +++ trunk/nwadmin/send.php 2008-07-03 11:23:18 UTC (rev 53) @@ -22,6 +22,11 @@ exit(_("Direct access not allowed")) ; // Die brutally (invoked script should always be index.php) } +define('XML_HTMLSAX3', "backend/classes/"); +require_once('backend/classes/safehtml.php'); + +$safehtml =& new safehtml(); + // Store the mail id into a local variable $num = $_GET['mail']; @@ -38,7 +43,7 @@ <li><b><?= _("Date") ?></b>: <?= $mails[$num]['arrived'] ?></li> <br /> <pre> -<?= $mails[$num]['body'] ?> +<?= $safehtml->parse(stripcslashes($mails[$num]['body'])) ?> </pre> [<a href="<?= make_get_link(array('mode', 'mail')) . "&scookie=" . $_SESSION['scookie'] ?> ">ok</a>] [<a href="index.php?mode=moderation&mail=<?= $num ?>"><?= _("cancel") ?></a>] Modified: trunk/setup/bin/newsletter =================================================================== --- trunk/setup/bin/newsletter 2008-03-21 18:29:18 UTC (rev 52) +++ trunk/setup/bin/newsletter 2008-07-03 11:23:18 UTC (rev 53) @@ -17,9 +17,10 @@ use strict; use Mail::Internet; # Debian: libmailtools-perl -use DBI; # Debian: libdbi-perl, libdbd-pg-perl; +use DBI; # Debian: libdbi-perl, libdbd-pg-perl use Date::Parse; # Debian: libtimedate-perl use Date::Format; # Debian: libtimedate-perl +use DBD::Pg qw(:pg_types); # Debian: libdbd-pg-perl my $configfile = "/srv/vmail/etc/newsletter.conf"; @@ -69,7 +70,13 @@ $date = time2str("%Y-%m-%d %H:%M:%S", str2time($date)); $sth = $dbh->prepare("INSERT INTO $table (nwl_id, sender, subject, arrived, body) VALUES (?,?,?,?,?)"); -unless ($sth->execute($newsletter_id, $sender, $subject, $date, $fullText)) { +$sth->bind_param(1, $newsletter_id); +$sth->bind_param(2, $sender); +$sth->bind_param(3, $subject); +$sth->bind_param(4, $date); +$sth->bind_param(5, $fullText, { pg_type => PG_BYTEA }); + +unless ($sth->execute) { print "CRITICAL: Cannot store email for newsletter $destination: " . $DBI::errstr . "\n" ; exit 75; # EX_TEMPFAIL } Modified: trunk/setup/sql/create.sql =================================================================== --- trunk/setup/sql/create.sql 2008-03-21 18:29:18 UTC (rev 52) +++ trunk/setup/sql/create.sql 2008-07-03 11:23:18 UTC (rev 53) @@ -73,12 +73,12 @@ ); CREATE TABLE newsletter_mails ( - id serial PRIMARY KEY NOT NULL, + id serial PRIMARY KEY NOT NULL, nwl_id integer REFERENCES newsletter_maps(id) ON DELETE CASCADE NOT NULL, sender text NOT NULL, subject text, arrived timestamp NOT NULL, - body text, - sent boolean NOT NULL DEFAULT FALSE + body bytea, + sent boolean NOT NULL DEFAULT FALSE ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mn...@us...> - 2008-03-21 18:29:19
|
Revision: 52 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=52&view=rev Author: mnencia Date: 2008-03-21 11:29:18 -0700 (Fri, 21 Mar 2008) Log Message: ----------- Happy Easter! Read it: I need the weekend... Modified Paths: -------------- trunk/setup/bin/vmaild Modified: trunk/setup/bin/vmaild =================================================================== --- trunk/setup/bin/vmaild 2008-03-21 18:19:51 UTC (rev 51) +++ trunk/setup/bin/vmaild 2008-03-21 18:29:18 UTC (rev 52) @@ -80,10 +80,10 @@ if ( !mkdir($dir)) { logmsg( 'warning', "warning: cannot create '$dir' directory: $!"); } - if ( !chown( $uid, $gid, @to_be_created ) ) { + if ( !chown( $uid, $gid, $dir ) ) { logmsg( 'warning', "warning: cannot chown '$dir' to $uid:$gid: $!"); } - if ( !chmod( $mode, @to_be_created ) ) { + if ( !chmod( $mode, $dir ) ) { logmsg( 'warning', "warning: cannot chmod '$dir' to $mode: $!" ); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mn...@us...> - 2008-03-21 18:19:52
|
Revision: 51 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=51&view=rev Author: mnencia Date: 2008-03-21 11:19:51 -0700 (Fri, 21 Mar 2008) Log Message: ----------- Corrected bug in directory creation logic Now all created directories are chowned/chmodded correctly Modified Paths: -------------- trunk/setup/bin/vmaild Modified: trunk/setup/bin/vmaild =================================================================== --- trunk/setup/bin/vmaild 2008-03-20 09:26:37 UTC (rev 50) +++ trunk/setup/bin/vmaild 2008-03-21 18:19:51 UTC (rev 51) @@ -55,9 +55,6 @@ # filesystem functions use File::Spec::Functions qw(:ALL); -# for mkpath -use File::Path; - ####################### SUBROUTINES ################################ sub logmsg($$;@) { @@ -69,6 +66,30 @@ } } +sub make_path($$$@) { + my ($mode, $uid, $gid, @paths) = @_; + + foreach my $path (@paths) { + my @to_be_created; + my $dir = "$path"; + while ( $dir ne "" and $dir ne "/" and ! -d $dir ) { + unshift @to_be_created, $dir; + $dir =~ s@[^/]+/*$@@; + } + for $dir (@to_be_created) { + if ( !mkdir($dir)) { + logmsg( 'warning', "warning: cannot create '$dir' directory: $!"); + } + if ( !chown( $uid, $gid, @to_be_created ) ) { + logmsg( 'warning', "warning: cannot chown '$dir' to $uid:$gid: $!"); + } + if ( !chmod( $mode, @to_be_created ) ) { + logmsg( 'warning', "warning: cannot chmod '$dir' to $mode: $!" ); + } + } + } +} + sub check_sieve($) { my ($path) = @_; @@ -94,9 +115,9 @@ my $sieve_file = "sieve/.dovecot.sieve.sieve"; if ( ! -d "$path/sieve/tmp" ) { - mkpath("$path/sieve/tmp", 0, 0700); + make_path( 0700, $vuid, $vgid, "$path/sieve/tmp" ); } - + # Special content: sieve script if ( open( FILE, ">$path/$sieve_file" ) ) { print FILE $sieve_script; @@ -107,21 +128,18 @@ $ok = 0; } - if ( !symlink( "$sieve_file", $path . "/.dovecot.sieve" ) ) { - logmsg( 'warning', "warning: cannot symlink '$path/.dovecot.sieve' to '$sieve_file': $!" - ); - $ok = 0; + if ( !symlink( "$sieve_file", "$path/.dovecot.sieve" ) ) { + logmsg( 'warning', "warning: cannot symlink '$path/.dovecot.sieve' to '$sieve_file': $!"); + $ok = 0; } if ( !chown( $vuid, $vgid, "$path/$sieve_file" ) ) { - logmsg( 'warning', "warning: cannot chown '$path/$sieve_file' to $vuid:$vgid: $!" - ); - $ok = 0; + logmsg( 'warning', "warning: cannot chown '$path/$sieve_file' to $vuid:$vgid: $!"); + $ok = 0; } if ( !chmod( 0600, "$path/$sieve_file" ) ) { - logmsg( 'warning', - "warning: cannot chmod '$path/$sieve_file' to 0600: $!" ); - $ok = 0; + logmsg( 'warning', "warning: cannot chmod '$path/$sieve_file' to 0600: $!"); + $ok = 0; } return $ok; @@ -170,7 +188,7 @@ my $ok = 1; if (! -d $path ) { - mkpath( $path, 0, 0700 ); + make_path( 0700, $vuid, $vgid, $path ); } foreach my $dir (@dirs) { @@ -301,11 +319,11 @@ # test 0: directory presence unless ( -d $domaindir ) { logmsg( 'notice', "creating root domain directory: $domaindir" ); - mkpath( $domaindir, 0, 0700); + make_path( 0700, $vuid, $vgid, $domaindir ); } unless ( -d $deldir ) { logmsg( 'notice', "creating root trash directory: $deldir" ); - mkpath( $deldir, 0, 0700); + make_path( 0700, $vuid, $vgid, $deldir ); } # test 1: presenza di directory di dominio per domini This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-03-20 09:26:40
|
Revision: 50 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=50&view=rev Author: agrassi Date: 2008-03-20 02:26:37 -0700 (Thu, 20 Mar 2008) Log Message: ----------- Even more SSl detection Removed obsolete howto Updated howto, removed udeless instructions Modified Paths: -------------- trunk/doc/INSTALL trunk/extra/libnewsletter.php Removed Paths: ------------- trunk/doc/CONFIGURATION Deleted: trunk/doc/CONFIGURATION =================================================================== --- trunk/doc/CONFIGURATION 2008-03-18 10:40:55 UTC (rev 49) +++ trunk/doc/CONFIGURATION 2008-03-20 09:26:37 UTC (rev 50) @@ -1,97 +0,0 @@ - - - ~~~~~ Additional software configuration ~~~~~ - - Both dovecot and postfix have to be configured to use Postgres. - - - - 1- Postfix configuration - - - main.cf should look like this: - - virtual_alias_domains = pgsql:/etc/postfix/sql/virtual_alias_domains.pg - virtual_alias_maps = pgsql:/etc/postfix/sql/virtual_alias_maps.pg - virtual_mailbox_domains = pgsql:/etc/postfix/sql/virtual_mailbox_domains.pg - transport_maps = pgsql:/etc/postfix/sql/transport.pg - - virtual_transport = dovecot - - - virtual_alias_domains: - - query = SELECT 'DUMMY_IGNORED'::text FROM virtual_domains - WHERE name = '%s' AND NOT deleted - UNION - SELECT 'DUMMY_IGNORED'::text FROM alias_domains WHERE name = '%s'; - - - virtual_alias_maps: - - query = SELECT '@'||destination FROM alias_domains WHERE ('@'||name) = '%s' - UNION - SELECT unknown_to FROM virtual_domains - WHERE ('@'||name) = '%s' AND have_default_delivery('%s') AND NOT deleted - UNION - SELECT COALESCE( - u.name||'@localdelivery.%d'||' '||destination, - destination, - u.name||'@localdelivery.%d' - ) - FROM virtual_domain_users AS u NATURAL FULL JOIN virtual_domain_aliases AS a - WHERE id_domain = get_id_domain('%d') AND name = '%u' - UNION - SELECT name||'@transportdelivery.%d' FROM newsletter_maps - WHERE id_domain = get_id_domain('%d') AND name = '%u'; - - - - virtual_mailbox_domains: - - query = SELECT 'DUMMY_IGNORED'::text FROM virtual_domains - WHERE ('localdelivery.'||name) = '%s' AND NOT deleted - - - - virtual_mailbox_maps: - - query = SELECT maildir FROM virtual_domain_users - WHERE id_domain = get_id_domain_local('%d') AND name = '%u'; - - - transport: - - query = SELECT 'newsletter:' FROM newsletter_maps WHERE id = get_nwl_id('%s'); - - - - - - Every single of these sql scripts should begin with the following lines: - - hosts = localhost - dbname = vmail - user = vmail - password = vmailpass - - - - - 2- Dovecot configuration - - Here are the example lines for dovecot's query: - - - For authentication via pop/imap: - - password_query = SELECT 'dovecot-sieve' AS sieve, 107 AS userdb_uid, 110 AS userdb_gid, - name AS user, passwd AS password, '/srv/vmail/domains/'||maildir as userdb_home, - 'maildir:/srv/vmail/domains/'||maildir AS userdb_mail, 'maildir:storage='||quota_kb AS userdb_quota - FROM virtual_domain_users WHERE name = '%n' AND id_domain = get_id_domain('%d') - - - For local delivery: - - user_query = SELECT 'dovecot-sieve' AS sieve, 107 AS uid, 110 AS gid, - '/srv/vmail/domains/'||maildir as home, 'maildir:/srv/vmail/domains/'||maildir as mail, - 'maildir:storage='||quota_kb as quota FROM virtual_domain_users WHERE name = '%n' - AND id_domain = get_id_domain('%14.d') - - password_query = SELECT name as user, passwd AS password FROM virtual_domain_users - WHERE name = '%n' AND id_domain = get_id_domain('%14.d') - - See dovecot documentation for more informations - - \ No newline at end of file Modified: trunk/doc/INSTALL =================================================================== --- trunk/doc/INSTALL 2008-03-18 10:40:55 UTC (rev 49) +++ trunk/doc/INSTALL 2008-03-20 09:26:37 UTC (rev 50) @@ -121,13 +121,7 @@ For this, we will enable a few stuff, and then we will create a few database files with SQL instructions, and tell postfix what-is-what. -First to be enabled are regexps: - # vi /etc/postfix/dynamicmaps.cf -Add the following: - pcre /usr/lib/postfix/dict_pcre.so dict_pcre_open - - -Then we edit main.cf +First we edit main.cf # vi /etc/postfix/main.cf And tell him where to look up domains and all Modified: trunk/extra/libnewsletter.php =================================================================== --- trunk/extra/libnewsletter.php 2008-03-18 10:40:55 UTC (rev 49) +++ trunk/extra/libnewsletter.php 2008-03-20 09:26:37 UTC (rev 50) @@ -20,9 +20,15 @@ // Hardcode this to the central newsletter handler define('ABSOLUTE_URL','http://localhost/p/newsletters/'); +if($_SERVER['HTTPS'] == 'on') { + $is_https = 's'; +} else { + $is_https = ''; +} + function subscribe($email,$newsletter) { - $confirm_url = "http://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/confirm.php"; + $confirm_url = "http" . $is_https . "://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/confirm.php"; $sock = fopen(ABSOLUTE_URL . "/subscribe.php?" . "&email=" . $email . @@ -60,7 +66,7 @@ function unsubscribe($email,$newsletter) { - $confirm_url = "http://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/confirm.php"; + $confirm_url = "http" . $is_https . "://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/confirm.php"; $sock = fopen(ABSOLUTE_URL . "/unsubscribe.php?" . "&email=" . $email . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-03-18 10:40:49
|
Revision: 49 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=49&view=rev Author: agrassi Date: 2008-03-18 03:40:55 -0700 (Tue, 18 Mar 2008) Log Message: ----------- This is the previous commit content. The comment for the previous was https autodetection Modified Paths: -------------- trunk/setup/sql/functions.sql Modified: trunk/setup/sql/functions.sql =================================================================== --- trunk/setup/sql/functions.sql 2008-03-18 10:26:53 UTC (rev 48) +++ trunk/setup/sql/functions.sql 2008-03-18 10:40:55 UTC (rev 49) @@ -378,7 +378,8 @@ CREATE OR REPLACE FUNCTION get_nwl_id(text) RETURNS integer AS $$ SELECT id FROM newsletter_maps - WHERE name = extract_user($1) - AND id_domain = get_id_domain($1) - OR id_domain = get_id_domain(substring($1 from E'transportdelivery\\.([^@]*)$')); + WHERE name = extract_user($1) AND ( + id_domain = get_id_domain($1) + OR id_domain = get_id_domain(substring($1 from E'transportdelivery\\.([^@]*)$')) + ); $$ LANGUAGE sql STABLE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-03-18 10:26:50
|
Revision: 48 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=48&view=rev Author: agrassi Date: 2008-03-18 03:26:53 -0700 (Tue, 18 Mar 2008) Log Message: ----------- Fixed operator precedence bug in get_nwl_id() Modified Paths: -------------- trunk/nwadmin/backend/functions.php Modified: trunk/nwadmin/backend/functions.php =================================================================== --- trunk/nwadmin/backend/functions.php 2008-03-17 14:03:39 UTC (rev 47) +++ trunk/nwadmin/backend/functions.php 2008-03-18 10:26:53 UTC (rev 48) @@ -118,7 +118,9 @@ // Utility to create links based on cmdline variables function make_get_link($fields) { // Take the fields to copy as array argument - $link = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?"; // Build my own url + if($_SERVER['HTTPS'] == 'on') { $is_https = "s"; } else { $is_https = ""; }; + + $link = "http" . $is_https . "://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?"; // Build my own url for ($i = 0; $i < sizeof($fields); $i++) { // For each field $field = $fields[$i]; if ($_GET[$field]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-03-17 14:03:34
|
Revision: 47 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=47&view=rev Author: agrassi Date: 2008-03-17 07:03:39 -0700 (Mon, 17 Mar 2008) Log Message: ----------- yet another. Modified Paths: -------------- trunk/extra/confirm.php Modified: trunk/extra/confirm.php =================================================================== --- trunk/extra/confirm.php 2008-03-17 14:02:27 UTC (rev 46) +++ trunk/extra/confirm.php 2008-03-17 14:03:39 UTC (rev 47) @@ -39,7 +39,7 @@ Confirming code <?= $_GET["code"] ?>.... <? $res = confirm($_GET["code"]); - $res == "TRUE" ? printf("done! $res") : printf("failed: $res"); + $res == "TRUE" ? printf("done!") : printf("failed: $res"); } else { echo "No code supplied"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-03-17 14:02:22
|
Revision: 46 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=46&view=rev Author: agrassi Date: 2008-03-17 07:02:27 -0700 (Mon, 17 Mar 2008) Log Message: ----------- forgot some debugging variables Modified Paths: -------------- trunk/extra/subscribe.php trunk/extra/unsubscribe.php Modified: trunk/extra/subscribe.php =================================================================== --- trunk/extra/subscribe.php 2008-03-17 13:57:19 UTC (rev 45) +++ trunk/extra/subscribe.php 2008-03-17 14:02:27 UTC (rev 46) @@ -39,7 +39,7 @@ Subscribing you to the newsletter... <? $res = subscribe($_GET["email"],$_GET["nwl"]); - $res == "TRUE" ? printf("done! $res") : printf("failed: $res"); + $res == "TRUE" ? printf("done!") : printf("failed: $res"); } else { ?> Modified: trunk/extra/unsubscribe.php =================================================================== --- trunk/extra/unsubscribe.php 2008-03-17 13:57:19 UTC (rev 45) +++ trunk/extra/unsubscribe.php 2008-03-17 14:02:27 UTC (rev 46) @@ -39,7 +39,7 @@ Unsubscribing you from the newsletter... <? $res = unsubscribe($_GET["email"],$_GET["nwl"]); - $res == "TRUE" ? printf("done! $res") : printf("failed: $res"); + $res == "TRUE" ? printf("done!") : printf("failed: $res"); } else { ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-03-17 13:57:15
|
Revision: 45 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=45&view=rev Author: agrassi Date: 2008-03-17 06:57:19 -0700 (Mon, 17 Mar 2008) Log Message: ----------- Added newsletter (un)subscription templates Fixed small bug in header.php with https detection Modified Paths: -------------- trunk/extra/libnewsletter.php trunk/tpl/header.php Added Paths: ----------- trunk/extra/confirm.php trunk/extra/subscribe.php trunk/extra/unsubscribe.php Added: trunk/extra/confirm.php =================================================================== --- trunk/extra/confirm.php (rev 0) +++ trunk/extra/confirm.php 2008-03-17 13:57:19 UTC (rev 45) @@ -0,0 +1,49 @@ +<?php + +require_once("libnewsletter.php"); + + +$nwl_array = array("fu...@bu...", + "un...@du...e", + "ci...@li...", + "oom...@du...") ; + +function gen_sub_form($arr) { +?> +<form name="input" action="#"> +e-mail: <input type="text" name="email"> <br /> +newsletter: +<select name="nwl"> +<? + foreach($arr as $nwl) { +?> + <option value="<?= $nwl ?>"><?= $nwl ?></option> +<? } ?> +</select> +<input type="submit" value="Submit"> +</form> +<? +} +?> + +<html> +<head> +<title>Mailing list subscription form</title> +</head> + +<body> + +<? + if($_GET["code"]) { +?> +Confirming code <?= $_GET["code"] ?>.... +<? + $res = confirm($_GET["code"]); + $res == "TRUE" ? printf("done! $res") : printf("failed: $res"); + } + else { + echo "No code supplied"; + die; + } ?> +</body> +</html> Modified: trunk/extra/libnewsletter.php =================================================================== --- trunk/extra/libnewsletter.php 2008-03-06 11:38:15 UTC (rev 44) +++ trunk/extra/libnewsletter.php 2008-03-17 13:57:19 UTC (rev 45) @@ -18,7 +18,7 @@ */ // Hardcode this to the central newsletter handler -define('ABSOLUTE_URL','http://localhost/panda/newsletters/'); +define('ABSOLUTE_URL','http://localhost/p/newsletters/'); function subscribe($email,$newsletter) { @@ -35,7 +35,7 @@ fclose($sock); if($result == 'TRUE') { - return TRUE; + return "TRUE"; } else { return $result; } @@ -51,7 +51,7 @@ fclose($sock); if($result == 'TRUE') { - return TRUE; + return "TRUE"; } else { return $result; } @@ -73,12 +73,11 @@ fclose($sock); if($result == 'TRUE') { - return TRUE; + return "TRUE"; } else { return $result; } } - ?> Added: trunk/extra/subscribe.php =================================================================== --- trunk/extra/subscribe.php (rev 0) +++ trunk/extra/subscribe.php 2008-03-17 13:57:19 UTC (rev 45) @@ -0,0 +1,50 @@ +<?php + +require_once("libnewsletter.php"); + + +$nwl_array = array("fu...@bu...", + "un...@du...e", + "ci...@li...", + "oom...@du...") ; + +function gen_sub_form($arr) { +?> +<form name="input" action="#"> +e-mail: <input type="text" name="email"> <br /> +newsletter: +<select name="nwl"> +<? + foreach($arr as $nwl) { +?> + <option value="<?= $nwl ?>"><?= $nwl ?></option> +<? } ?> +</select> +<input type="submit" value="Submit"> +</form> +<? +} +?> + +<html> +<head> +<title>Mailing list subscription form</title> +</head> + +<body> + +<? + if($_GET["email"]) { +?> +Subscribing you to the newsletter... +<? + $res = subscribe($_GET["email"],$_GET["nwl"]); + $res == "TRUE" ? printf("done! $res") : printf("failed: $res"); + } + else { +?> +Enter the email address to be subscribed:<br /> +<? gen_sub_form($nwl_array); + } ?> +</body> +</html> Added: trunk/extra/unsubscribe.php =================================================================== --- trunk/extra/unsubscribe.php (rev 0) +++ trunk/extra/unsubscribe.php 2008-03-17 13:57:19 UTC (rev 45) @@ -0,0 +1,50 @@ +<?php + +require_once("libnewsletter.php"); + + +$nwl_array = array("fu...@bu...", + "un...@du...e", + "ci...@li...", + "oom...@du...") ; + +function gen_sub_form($arr) { +?> +<form name="input" action="#"> +e-mail: <input type="text" name="email"> <br /> +newsletter: +<select name="nwl"> +<? + foreach($arr as $nwl) { +?> + <option value="<?= $nwl ?>"><?= $nwl ?></option> +<? } ?> +</select> +<input type="submit" value="Submit"> +</form> +<? +} +?> + +<html> +<head> +<title>Mailing list subscription form</title> +</head> + +<body> + +<? + if($_GET["email"]) { +?> +Unsubscribing you from the newsletter... +<? + $res = unsubscribe($_GET["email"],$_GET["nwl"]); + $res == "TRUE" ? printf("done! $res") : printf("failed: $res"); + } + else { +?> +Enter the email address to be unsubscribed:<br /> +<? gen_sub_form($nwl_array); + } ?> +</body> +</html> Modified: trunk/tpl/header.php =================================================================== --- trunk/tpl/header.php 2008-03-06 11:38:15 UTC (rev 44) +++ trunk/tpl/header.php 2008-03-17 13:57:19 UTC (rev 45) @@ -19,7 +19,7 @@ */ ?> <?= '<?xml version="1.0"?>' ?> - +<? if($_SERVER['HTTPS'] == 'on') { $is_https="s"; } else { $is_https=""; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" @@ -38,7 +38,7 @@ <a href='<?= make_link(array()).'?mode=email' ?>'>e-mail</a> <a href='<?= make_link(array()).'?mode=domain' ?>'><?= _("domains") ?></a> <a href='<?= make_link(array()).'?mode=domainalias' ?>'><?= _("alias domains") ?></a> - <a href='<?= "http://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/nwadmin" ?>' target="_blank">newsletter</a> + <a href='<?= "http" . $is_https . "://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/nwadmin" ?>' target="_blank">newsletter</a> <? if(is_administrator()) { ?> <br /> <a href='<?= make_link(array()).'?mode=users' ?>'><?= _("users") ?></a> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-03-06 11:38:08
|
Revision: 44 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=44&view=rev Author: agrassi Date: 2008-03-06 03:38:15 -0800 (Thu, 06 Mar 2008) Log Message: ----------- Tagged release candidate 2 for 1.0 This is a release candidate. Not like previous. Added Paths: ----------- tags/panda-admin-1.0rc2/ tags/panda-admin-1.0rc2/config.php tags/panda-admin-1.0rc2/doc/TODO tags/panda-admin-1.0rc2/extra/scripts/compile-po.sh tags/panda-admin-1.0rc2/extra/scripts/update-po.sh tags/panda-admin-1.0rc2/index.php tags/panda-admin-1.0rc2/locale/ tags/panda-admin-1.0rc2/modules/domain.php tags/panda-admin-1.0rc2/modules/domainalias.php tags/panda-admin-1.0rc2/modules/email/add.php tags/panda-admin-1.0rc2/modules/email/modifynwl/chpw.php tags/panda-admin-1.0rc2/modules/email.php tags/panda-admin-1.0rc2/modules/users/add.php tags/panda-admin-1.0rc2/modules/users.php tags/panda-admin-1.0rc2/tpl/email/listmails.php tags/panda-admin-1.0rc2/tpl/header.php tags/panda-admin-1.0rc2/tpl/users/modify.php Removed Paths: ------------- tags/panda-admin-1.0rc2/config.php tags/panda-admin-1.0rc2/doc/TODO tags/panda-admin-1.0rc2/extra/scripts/gettextize.sh tags/panda-admin-1.0rc2/index.php tags/panda-admin-1.0rc2/modules/domain.php tags/panda-admin-1.0rc2/modules/domainalias.php tags/panda-admin-1.0rc2/modules/email/add.php tags/panda-admin-1.0rc2/modules/email/modifynwl/chpw.php tags/panda-admin-1.0rc2/modules/email.php tags/panda-admin-1.0rc2/modules/users/add.php tags/panda-admin-1.0rc2/modules/users.php tags/panda-admin-1.0rc2/tpl/email/listmails.php tags/panda-admin-1.0rc2/tpl/header.php tags/panda-admin-1.0rc2/tpl/users/modify.php Copied: tags/panda-admin-1.0rc2 (from rev 41, trunk) Deleted: tags/panda-admin-1.0rc2/config.php =================================================================== --- trunk/config.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/config.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,41 +0,0 @@ -<? -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -// Database connection string -define('DSN', 'pgsql://vmail:vpass@dbserver:5432/vmail'); - -// How many emails are to be displayed in the lists? -define('EMAIL_PER_PAGE', 20); - -// Are the domain to be linked as bar.com -> foo.com (FALSE) or b -> f (TRUE)? -define('DOMAIN_ONLY_FIRST_LETTER',TRUE); - -// Separator for the domain list (bar.com [separator] foo.com) -define('DOMAIN_SEPARATOR', " -> "); - -// Stuff related to newsletter [un]subscription email to be sent -define('MAIL_FROM','new...@gr...'); -define('SMTP_HOST','smtp.fastweb.it'); - -// Encryption algorythm for mailboxes passwords -// currently 'crypt-md5' and 'crypt-des' are supported -define('CRYPT_ALGO','crypt-md5'); - -?> Copied: tags/panda-admin-1.0rc2/config.php (from rev 43, trunk/config.php) =================================================================== --- tags/panda-admin-1.0rc2/config.php (rev 0) +++ tags/panda-admin-1.0rc2/config.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,50 @@ +<? +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +// Database connection string +define('DSN', 'pgsql://vmail:vpass@dbserver:5432/vmail'); + +// How many emails are to be displayed in the lists? +define('EMAIL_PER_PAGE', 20); + +// Are the domain to be linked as bar.com -> foo.com (FALSE) or b -> f (TRUE)? +define('DOMAIN_ONLY_FIRST_LETTER',TRUE); + +// Separator for the domain list (bar.com [separator] foo.com) +define('DOMAIN_SEPARATOR', " -> "); + +// Stuff related to newsletter [un]subscription email to be sent +define('MAIL_FROM','new...@gr...'); +define('SMTP_HOST','smtp.fastweb.it'); + +// Encryption algorythm for mailboxes passwords +// currently 'crypt-md5' and 'crypt-des' are supported +define('CRYPT_ALGO','crypt-md5'); + +// Language +// Currently supported are it_IT/C +// Warning: To use a locale, you need the right locale support on the server. +// it_IT, for example could be either "it", "it_IT", "it_IT.UTF-8", "it_IT@euro".. +// Make a few tests before production deployment. +// If you don't know what to write here, just type "C", and you'll have an english interface. +// example: define('PANDA_LANG','it_IT.UTF-8'); +define('PANDA_LANG','C'); + +?> Deleted: tags/panda-admin-1.0rc2/doc/TODO =================================================================== --- trunk/doc/TODO 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/doc/TODO 2008-03-06 11:38:15 UTC (rev 44) @@ -1,20 +0,0 @@ - - Things that need to be done: - - - Sometime mkpath results in unreadable directory from mailserver, - investigate. - - - Let users have the ability to enable/disable newsletter support - - - E-mails listed should be differenced from each other (email,alias,newsletter etc) - with a better heuristic, and a better (more clear) graphic way (currently it uses bold/italic) - - - When users change their own password, we should verify the old password, and possibly - have a form with a "password" field with double insert - - - Anything else you may want to implement - - - If you have ideas, patches, questions to tell us, feel free to contact - (see CREDITS) - \ No newline at end of file Copied: tags/panda-admin-1.0rc2/doc/TODO (from rev 42, trunk/doc/TODO) =================================================================== --- tags/panda-admin-1.0rc2/doc/TODO (rev 0) +++ tags/panda-admin-1.0rc2/doc/TODO 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,17 @@ + + Things that need to be done: + + - Sometime mkpath results in unreadable directory from mailserver, + investigate. + + - Let users have the ability to enable/disable newsletter support + + - When users change their own password, we should verify the old password, and possibly + have a form with a "password" field with double insert + + - Anything else you may want to implement + + + If you have ideas, patches, questions to tell us, feel free to contact + (see CREDITS) + \ No newline at end of file Copied: tags/panda-admin-1.0rc2/extra/scripts/compile-po.sh (from rev 42, trunk/extra/scripts/compile-po.sh) =================================================================== --- tags/panda-admin-1.0rc2/extra/scripts/compile-po.sh (rev 0) +++ tags/panda-admin-1.0rc2/extra/scripts/compile-po.sh 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ ! -d "locale" ]; then + echo "You must launch this from the top source directory" + exit +fi + +echo -n "Updating language:" +for lang in locale/*; do + lcpath="${lang}/LC_MESSAGES" + echo -n " ${lang#locale/}" + msgfmt ${lcpath}/messages.po -o ${lcpath}/messages.mo +done + +echo . Deleted: tags/panda-admin-1.0rc2/extra/scripts/gettextize.sh =================================================================== --- trunk/extra/scripts/gettextize.sh 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/extra/scripts/gettextize.sh 2008-03-06 11:38:15 UTC (rev 44) @@ -1,11 +0,0 @@ -#!/bin/sh - -lang=$1 - -[ -z $lang ] && echo "Usage: $0 <lang>\n(e.g. $0 fr)" && exit - -lcpath="./locale/${lang}/LC_MESSAGES" -mkdir -p ${lcpath} - -find -not -type 'd' -name \*.php | xgettext -L php -D . -f - -o ${lcpath}/messages.po - Copied: tags/panda-admin-1.0rc2/extra/scripts/update-po.sh (from rev 42, trunk/extra/scripts/update-po.sh) =================================================================== --- tags/panda-admin-1.0rc2/extra/scripts/update-po.sh (rev 0) +++ tags/panda-admin-1.0rc2/extra/scripts/update-po.sh 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,19 @@ +#!/bin/sh + +lang=$1 + +[ -z $lang ] && echo "Usage: $0 <lang>\n(e.g. $0 fr)" && exit + +lcpath="./locale/${lang}/LC_MESSAGES" + +if [ ! -d "locale" ]; then + echo "You must launch this from the top source directory" + exit +fi + +mkdir -p ${lcpath} + +touch ${lcpath}/messages.po + +find . -iname "*.php" -exec xgettext --omit-header -j -o ${lcpath}/messages.po --keyword=_ {} \; + Deleted: tags/panda-admin-1.0rc2/index.php =================================================================== --- trunk/index.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/index.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,57 +0,0 @@ -<? -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -require_once ('config.php'); -require_once ('includes/functions.php'); - - -// Fill $status with command line -$status = decode_status(); - -if(!is_loggedin()){ - if($_POST['username'] && $_POST['password']){ - do_login($_POST['username'],$_POST['password']); - } - else{ - require('tpl/login.php'); - exit; - } -} - -switch ($status->mode) { - case 'logout': - case 'email' : - case 'domain' : - case 'domainalias' : - case 'users' : - case 'chmypw' : - case 'newsletters' : - break; - default : - $status = new_status(); - $status->mode = 'email'; -} - -require ("modules/$status->mode.php"); - -include ('tpl/header.php'); -include ("tpl/$status->body.php"); -include ('tpl/footer.php'); -?> Copied: tags/panda-admin-1.0rc2/index.php (from rev 42, trunk/index.php) =================================================================== --- tags/panda-admin-1.0rc2/index.php (rev 0) +++ tags/panda-admin-1.0rc2/index.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,64 @@ +<? +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +require_once ('config.php'); +require_once ('includes/functions.php'); + +if(setlocale(LC_ALL, PANDA_LANG)) { + bindtextdomain("messages","locale"); + textdomain("messages"); +} else { + echo "Unsupported locale: " . PANDA_LANG; + die; +} + +// Fill $status with command line +$status = decode_status(); + +if(!is_loggedin()){ + if($_POST['username'] && $_POST['password']){ + do_login($_POST['username'],$_POST['password']); + } + else{ + require('tpl/login.php'); + exit; + } +} + +switch ($status->mode) { + case 'logout': + case 'email' : + case 'domain' : + case 'domainalias' : + case 'users' : + case 'chmypw' : + case 'newsletters' : + break; + default : + $status = new_status(); + $status->mode = 'email'; +} + +require ("modules/$status->mode.php"); + +include ('tpl/header.php'); +include ("tpl/$status->body.php"); +include ('tpl/footer.php'); +?> Copied: tags/panda-admin-1.0rc2/locale (from rev 42, trunk/locale) Deleted: tags/panda-admin-1.0rc2/modules/domain.php =================================================================== --- trunk/modules/domain.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/modules/domain.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,56 +0,0 @@ -<? -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// Load virtual domains -$virtual_domains = load_domain_list(); - -add_navigation_link('domain management', - make_link(array ('mode')) . "&op=listdomains"); - -// If the specified domain doesn't exist, or user doesn't have rights, fall back to domain list -if ($status->domain) { - check_permission('domain',$status->domain); - if ($status->domain_id = search_array_field($virtual_domains, "name", $status->domain)) { - add_navigation_link($status->domain, make_link(array ( - 'mode', - 'domain' - ))); - } else { - $status->op = 'listdomains'; - } -} - -switch ($status->op) { - case 'delete' : - case 'add' : - if (!is_administrator()) { - forbidden(); - } - case 'modify' : - require ("modules/".$status->mode."/".$status->op.".php"); - break; - default : - $status->op = 'listdomains'; -} - -if ($status->op == 'listdomains') { - require ("modules/".$status->mode."/".$status->op.".php"); -} - -?> Copied: tags/panda-admin-1.0rc2/modules/domain.php (from rev 42, trunk/modules/domain.php) =================================================================== --- tags/panda-admin-1.0rc2/modules/domain.php (rev 0) +++ tags/panda-admin-1.0rc2/modules/domain.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,56 @@ +<? +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +// Load virtual domains +$virtual_domains = load_domain_list(); + +add_navigation_link(_('domain management'), + make_link(array ('mode')) . "&op=listdomains"); + +// If the specified domain doesn't exist, or user doesn't have rights, fall back to domain list +if ($status->domain) { + check_permission('domain',$status->domain); + if ($status->domain_id = search_array_field($virtual_domains, "name", $status->domain)) { + add_navigation_link($status->domain, make_link(array ( + 'mode', + 'domain' + ))); + } else { + $status->op = 'listdomains'; + } +} + +switch ($status->op) { + case 'delete' : + case 'add' : + if (!is_administrator()) { + forbidden(); + } + case 'modify' : + require ("modules/".$status->mode."/".$status->op.".php"); + break; + default : + $status->op = 'listdomains'; +} + +if ($status->op == 'listdomains') { + require ("modules/".$status->mode."/".$status->op.".php"); +} + +?> Deleted: tags/panda-admin-1.0rc2/modules/domainalias.php =================================================================== --- trunk/modules/domainalias.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/modules/domainalias.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,55 +0,0 @@ -<? -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -$alias_domains = load_alias_domain_list(); - -add_navigation_link('alias domain management', - make_link(array ('mode')) . "&op=listdomains"); - -// If specified domain doesn't exist or user doesn't have rights, fall back to domain list -if ($status->domain) { - check_permission('aliasdomain',$status->domain); - if (array_key_exists($status->domain, $alias_domains)) { - add_navigation_link($status->domain, make_link(array ( - 'mode', - 'domain' - ))); - } else { - $status->op = 'listdomains'; - } -} - -switch ($status->op) { - case 'add' : - case 'delete' : - if (!is_administrator()) { - forbidden(); - } - case 'modify' : - require ("modules/".$status->mode."/".$status->op.".php"); - break; - default : - $status->op = 'listdomains'; -} - -if ($status->op == 'listdomains') { - require ("modules/".$status->mode."/".$status->op.".php"); -} - -?> Copied: tags/panda-admin-1.0rc2/modules/domainalias.php (from rev 42, trunk/modules/domainalias.php) =================================================================== --- tags/panda-admin-1.0rc2/modules/domainalias.php (rev 0) +++ tags/panda-admin-1.0rc2/modules/domainalias.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,55 @@ +<? +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +$alias_domains = load_alias_domain_list(); + +add_navigation_link(_('alias domain management'), + make_link(array ('mode')) . "&op=listdomains"); + +// If specified domain doesn't exist or user doesn't have rights, fall back to domain list +if ($status->domain) { + check_permission('aliasdomain',$status->domain); + if (array_key_exists($status->domain, $alias_domains)) { + add_navigation_link($status->domain, make_link(array ( + 'mode', + 'domain' + ))); + } else { + $status->op = 'listdomains'; + } +} + +switch ($status->op) { + case 'add' : + case 'delete' : + if (!is_administrator()) { + forbidden(); + } + case 'modify' : + require ("modules/".$status->mode."/".$status->op.".php"); + break; + default : + $status->op = 'listdomains'; +} + +if ($status->op == 'listdomains') { + require ("modules/".$status->mode."/".$status->op.".php"); +} + +?> Deleted: tags/panda-admin-1.0rc2/modules/email/add.php =================================================================== --- trunk/modules/email/add.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/modules/email/add.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,58 +0,0 @@ -<?php -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the )); - - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -add_navigation_link('nuovo indirizzo', make_link('mode', 'op', 'domain')); - -// If no user has been specified, display -// the add page -if (!$status->subop || !$status->user) { - $status->body = 'email/add'; - return; -} - -// Check if user already exists -if (isset ($emails[$status->user])) { - $status->title = _("Error"); - $status->message = _("Address already existing"); - unset ($status->user); - $status->body = 'message'; - return; -} - -// check if user is valid -if (!is_email("$status->user@$status->domain")) { - $status->title = _("Error"); - $status->message = _("The name '") . $status->user . _("' is not valid."); - unset ($status->user); - $status->body = 'message'; -} - -// Select the right operation from the user type -switch ($status->subop) { - case "local" : - case "remote" : - case "newsletter" : - require ("modules/email/add/" . $status->subop . ".php"); - break; - default : - $status->body = 'email/add'; - break; -} -?> Copied: tags/panda-admin-1.0rc2/modules/email/add.php (from rev 42, trunk/modules/email/add.php) =================================================================== --- tags/panda-admin-1.0rc2/modules/email/add.php (rev 0) +++ tags/panda-admin-1.0rc2/modules/email/add.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,58 @@ +<?php +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the )); + + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +add_navigation_link(_("new address"), make_link('mode', 'op', 'domain')); + +// If no user has been specified, display +// the add page +if (!$status->subop || !$status->user) { + $status->body = 'email/add'; + return; +} + +// Check if user already exists +if (isset ($emails[$status->user])) { + $status->title = _("Error"); + $status->message = _("Address already existing"); + unset ($status->user); + $status->body = 'message'; + return; +} + +// check if user is valid +if (!is_email("$status->user@$status->domain")) { + $status->title = _("Error"); + $status->message = _("The name '") . $status->user . _("' is not valid."); + unset ($status->user); + $status->body = 'message'; +} + +// Select the right operation from the user type +switch ($status->subop) { + case "local" : + case "remote" : + case "newsletter" : + require ("modules/email/add/" . $status->subop . ".php"); + break; + default : + $status->body = 'email/add'; + break; +} +?> Deleted: tags/panda-admin-1.0rc2/modules/email/modifynwl/chpw.php =================================================================== --- trunk/modules/email/modifynwl/chpw.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/modules/email/modifynwl/chpw.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,41 +0,0 @@ -<?php -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// If no password has been given, ask for it -if (empty ($status->data) || !check_scookie()) { - create_scookie(); - $status->title = _("Password change"); - $status->message = _("Insert the new password for te newsletter ")."$status->user@$status->domain"; - $status->ask = true; - $status->cancel_to = make_link(array('mode','domain','user','op')); - $status->body = 'input'; - return; -} - -// Password has been supplied, scookie is ok -if (changeNWLPassword("$status->user@$status->domain", $status->data)) { - $status->title = _("Operation successful."); - $status->message = _("The password for the newsletter "). "$status->user@$status->domain" . _(" has been updated."); -} else { - $status->title = _("Error"); - $status->message = _("Error while updating the password for the newsletter") . "$status->user@$status->domain"; -} -$status->body = 'message'; - -?> Copied: tags/panda-admin-1.0rc2/modules/email/modifynwl/chpw.php (from rev 42, trunk/modules/email/modifynwl/chpw.php) =================================================================== --- tags/panda-admin-1.0rc2/modules/email/modifynwl/chpw.php (rev 0) +++ tags/panda-admin-1.0rc2/modules/email/modifynwl/chpw.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,41 @@ +<?php +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +// If no password has been given, ask for it +if (empty ($status->data) || !check_scookie()) { + create_scookie(); + $status->title = _("Password change"); + $status->message = _("Insert the new password for the newsletter ")."$status->user@$status->domain"; + $status->ask = true; + $status->cancel_to = make_link(array('mode','domain','user','op')); + $status->body = 'input'; + return; +} + +// Password has been supplied, scookie is ok +if (changeNWLPassword("$status->user@$status->domain", $status->data)) { + $status->title = _("Operation successful."); + $status->message = _("The password for the newsletter "). "$status->user@$status->domain" . _(" has been updated."); +} else { + $status->title = _("Error"); + $status->message = _("Error while updating the password for the newsletter") . "$status->user@$status->domain"; +} +$status->body = 'message'; + +?> Deleted: tags/panda-admin-1.0rc2/modules/email.php =================================================================== --- trunk/modules/email.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/modules/email.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,56 +0,0 @@ -<? -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -$virtual_domains = load_domain_list(); - -add_navigation_link('e-mail management', - make_link(array ('mode')) . "&op=listdomains"); - -// If specified domain doesn't exist or user doesn't have rights, fall back to domain list -if ($status->domain) { - check_permission('domain',$status->domain); - if (search_array_field($virtual_domains, "name", $status->domain)) { - add_navigation_link($status->domain, make_link(array ( - 'mode', - 'domain' - )) . "&op=listmails"); - $emails = load_domain($status->domain); - } else { - $status->op = 'listdomains'; - } -} - -switch ($status->op) { - case 'add' : - case 'modify' : - case 'modifynwl' : - case 'delete' : - case 'deletenwl' : - case 'listmails' : - require ("modules/".$status->mode."/".$status->op.".php"); - break; - default : - $status->op = 'listdomains'; -} - -if ($status->op == 'listdomains') { - require ("modules/".$status->mode."/".$status->op.".php"); -} - -?> Copied: tags/panda-admin-1.0rc2/modules/email.php (from rev 42, trunk/modules/email.php) =================================================================== --- tags/panda-admin-1.0rc2/modules/email.php (rev 0) +++ tags/panda-admin-1.0rc2/modules/email.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,56 @@ +<? +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +$virtual_domains = load_domain_list(); + +add_navigation_link(_('e-mail management'), + make_link(array ('mode')) . "&op=listdomains"); + +// If specified domain doesn't exist or user doesn't have rights, fall back to domain list +if ($status->domain) { + check_permission('domain',$status->domain); + if (search_array_field($virtual_domains, "name", $status->domain)) { + add_navigation_link($status->domain, make_link(array ( + 'mode', + 'domain' + )) . "&op=listmails"); + $emails = load_domain($status->domain); + } else { + $status->op = 'listdomains'; + } +} + +switch ($status->op) { + case 'add' : + case 'modify' : + case 'modifynwl' : + case 'delete' : + case 'deletenwl' : + case 'listmails' : + require ("modules/".$status->mode."/".$status->op.".php"); + break; + default : + $status->op = 'listdomains'; +} + +if ($status->op == 'listdomains') { + require ("modules/".$status->mode."/".$status->op.".php"); +} + +?> Deleted: tags/panda-admin-1.0rc2/modules/users/add.php =================================================================== --- trunk/modules/users/add.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/modules/users/add.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,92 +0,0 @@ -<?php -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the )); - - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -add_navigation_link('nuovo utente', make_link('mode', 'op')); - -// If no user or action has been specified, show main add page -if (!$status->data[4]|| !$status->data[0]) { - $status->body = 'users/add'; - return; -} - -// Check for a valid unix name -if(!is_user($status->data[0])) { - $status->title = _("Error"); - $status->message = _("The supplied user is not valid"); - $status->body = 'message'; - return; -} - -if(empty($status->data[3]) || empty($status->data[2])) { - $status->title = _("Error"); - $status->message = _("The supplied password is not valid"); - $status->body = 'message'; - return; -} - - -// Check if user already exists -if (isset ($users[$status->data[0]])) { - $status->title = _("Error"); - $status->message = _("User already existing"); - unset ($status->data[0]); - $status->body = 'message'; - return; -} - -if(empty($status->data[1])) { - $status->data[1] = NULL; -} - -// Check if passwords are equal -if($status->data[2] != $status->data[3]) { - $status->title = _("Error"); - $status->message = _("Supplied passwords don't match"); - $status->body = 'message'; - return; -} - - -switch ($status->data[4]) { - case "admin" : - $user_admin = 'TRUE'; - break; - case "normal" : - $user_admin = 'FALSE'; - break; - default : - $status->body = 'users/add'; - break; -} - -// Finally create the user -if(create_user($status->data[0],md5($status->data[2]),$status->data[1],$user_admin)){ - $status->title = _("Operation successful."); - $status->message = _("Successfully created user ") . $status->data[0]; -} else{ - $status->title = _("Error"); - $status->message = _("Error while creating user ") . $status->data[0]; -} - -$status->body = 'message'; - -unset($status->op); - -?> Copied: tags/panda-admin-1.0rc2/modules/users/add.php (from rev 42, trunk/modules/users/add.php) =================================================================== --- tags/panda-admin-1.0rc2/modules/users/add.php (rev 0) +++ tags/panda-admin-1.0rc2/modules/users/add.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,92 @@ +<?php +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the )); + + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +add_navigation_link(_("new user"), make_link('mode', 'op')); + +// If no user or action has been specified, show main add page +if (!$status->data[4]|| !$status->data[0]) { + $status->body = 'users/add'; + return; +} + +// Check for a valid unix name +if(!is_user($status->data[0])) { + $status->title = _("Error"); + $status->message = _("The supplied user is not valid"); + $status->body = 'message'; + return; +} + +if(empty($status->data[3]) || empty($status->data[2])) { + $status->title = _("Error"); + $status->message = _("The supplied password is not valid"); + $status->body = 'message'; + return; +} + + +// Check if user already exists +if (isset ($users[$status->data[0]])) { + $status->title = _("Error"); + $status->message = _("User already existing"); + unset ($status->data[0]); + $status->body = 'message'; + return; +} + +if(empty($status->data[1])) { + $status->data[1] = NULL; +} + +// Check if passwords are equal +if($status->data[2] != $status->data[3]) { + $status->title = _("Error"); + $status->message = _("Supplied passwords don't match"); + $status->body = 'message'; + return; +} + + +switch ($status->data[4]) { + case "admin" : + $user_admin = 'TRUE'; + break; + case "normal" : + $user_admin = 'FALSE'; + break; + default : + $status->body = 'users/add'; + break; +} + +// Finally create the user +if(create_user($status->data[0],md5($status->data[2]),$status->data[1],$user_admin)){ + $status->title = _("Operation successful."); + $status->message = _("Successfully created user ") . $status->data[0]; +} else{ + $status->title = _("Error"); + $status->message = _("Error while creating user ") . $status->data[0]; +} + +$status->body = 'message'; + +unset($status->op); + +?> Deleted: tags/panda-admin-1.0rc2/modules/users.php =================================================================== --- trunk/modules/users.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/modules/users.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,42 +0,0 @@ -<? -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -$users = load_users(); - -add_navigation_link('user management', - make_link(array ('mode')) . "&op=listusers"); - -switch ($status->op) { - case 'add' : - case 'modify' : - case 'delete' : - case 'listusers' : - case 'assign' : - case 'aliassign' : - require ("modules/".$status->mode."/".$status->op.".php"); - break; - default : - $status->op = 'listusers'; -} - -if ($status->op == 'listusers') { - require ("modules/".$status->mode."/".$status->op.".php"); -} - -?> Copied: tags/panda-admin-1.0rc2/modules/users.php (from rev 42, trunk/modules/users.php) =================================================================== --- tags/panda-admin-1.0rc2/modules/users.php (rev 0) +++ tags/panda-admin-1.0rc2/modules/users.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,42 @@ +<? +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +$users = load_users(); + +add_navigation_link(_('user management'), + make_link(array ('mode')) . "&op=listusers"); + +switch ($status->op) { + case 'add' : + case 'modify' : + case 'delete' : + case 'listusers' : + case 'assign' : + case 'aliassign' : + require ("modules/".$status->mode."/".$status->op.".php"); + break; + default : + $status->op = 'listusers'; +} + +if ($status->op == 'listusers') { + require ("modules/".$status->mode."/".$status->op.".php"); +} + +?> Deleted: tags/panda-admin-1.0rc2/tpl/email/listmails.php =================================================================== --- trunk/tpl/email/listmails.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/tpl/email/listmails.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,83 +0,0 @@ -<? -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -?> - <h4><?= _("Domain management for ") ?> <?= $status->domain ?></h4> - <p> - <?= _("Mailbox list from ") ?> <?= $ids[$begin]."@$status->domain" ?> <?= _(" to ") ?><?= $ids[$end - 1]."@$status->domain" ?>.<br /> - <?= _("Press 'M' to modify, 'X' to delete.") ?> - </p> - <p> -<? - - -for ($i = $begin; $i < $end; $i++) { -$tmp = $ids[$i]; - -?> -<? if(!empty($emails[$tmp]['id'])) { ?> - [<a href='<?= make_link(array('mode','domain'))."&op=modifynwl&user=$ids[$i]" ?>'>M</a>] - [<a href='<?= make_link(array('mode','domain'))."&op=deletenwl&user=$ids[$i]" ?>'>X</a>] -<? } else { ?> - [<a href='<?= make_link(array('mode','domain'))."&op=modify&user=$ids[$i]" ?>'>M</a>] - [<a href='<?= make_link(array('mode','domain'))."&op=delete&user=$ids[$i]" ?>'>X</a>] -<? } ?> -<? -if (!empty($emails[$tmp]['maildir'])) { -?> - <b><?= $ids[$i] ?></b> -<? } elseif (!empty($emails[$tmp]['id'])) { ?> - <i><u><?= $ids[$i] ?></u></i> -<? } else { ?> - <?= $ids[$i] . '*' ?> -<? } ?> - <br /> -<? } ?> - </p> - <p> - [<a href='<?= make_link(array('mode','domain'))."&op=add" ?>'>aggiungi</a>] - </p> -<? - - - if (numPages(count($ids)) > 1) { -?> - <p> - <?= _("Other mailboxes in the domain ") ?><?= $status->domain ?>: - </p> - <ul> -<? - - - for ($i = 0; $i < numPages(count($ids)); $i++) { - if ($i == $status->page) { -?> - <li><?=$ids[beginPage($i)] . " -> " . $ids[endPage($i, count($ids)) - 1] ?></li> -<? - } - else { -?> - <li><a href='<?= make_link(array('mode','op','domain'))."&page=$i" ?>'><?= - $ids[beginPage($i)] . " -> " . $ids[endPage($i, count($ids)) - 1] ?></a></li> -<? - } - } - } -?> - </ul> Copied: tags/panda-admin-1.0rc2/tpl/email/listmails.php (from rev 42, trunk/tpl/email/listmails.php) =================================================================== --- tags/panda-admin-1.0rc2/tpl/email/listmails.php (rev 0) +++ tags/panda-admin-1.0rc2/tpl/email/listmails.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,84 @@ +<? +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +?> + <h4><?= _("Domain management for ") ?> <?= $status->domain ?></h4> + <p> + <?= _("Mailbox list from ") ?> <?= $ids[$begin]."@$status->domain" ?> <?= _(" to ") ?><?= $ids[$end - 1]."@$status->domain" ?>.<br /> + <?= _("<b>Bold</b> mailboxes are stored locally, starred* mailboxes contain aliases, <i>italic</i> are newsletters.") ?> <br /> + <?= _("Press 'M' to modify, 'X' to delete.") ?> + </p> + <p> +<? + + +for ($i = $begin; $i < $end; $i++) { +$tmp = $ids[$i]; + +?> +<? if(!empty($emails[$tmp]['id'])) { ?> + [<a href='<?= make_link(array('mode','domain'))."&op=modifynwl&user=$ids[$i]" ?>'>M</a>] + [<a href='<?= make_link(array('mode','domain'))."&op=deletenwl&user=$ids[$i]" ?>'>X</a>] +<? } else { ?> + [<a href='<?= make_link(array('mode','domain'))."&op=modify&user=$ids[$i]" ?>'>M</a>] + [<a href='<?= make_link(array('mode','domain'))."&op=delete&user=$ids[$i]" ?>'>X</a>] +<? } ?> +<? +if (!empty($emails[$tmp]['maildir'])) { +?> + <b><?= $ids[$i] ?></b> +<? } elseif (!empty($emails[$tmp]['id'])) { ?> + <i><u><?= $ids[$i] ?></u></i> +<? } else { ?> + <?= $ids[$i] . '*' ?> +<? } ?> + <br /> +<? } ?> + </p> + <p> + [<a href='<?= make_link(array('mode','domain'))."&op=add" ?>'>aggiungi</a>] + </p> +<? + + + if (numPages(count($ids)) > 1) { +?> + <p> + <?= _("Other mailboxes in the domain ") ?><?= $status->domain ?>: + </p> + <ul> +<? + + + for ($i = 0; $i < numPages(count($ids)); $i++) { + if ($i == $status->page) { +?> + <li><?=$ids[beginPage($i)] . " -> " . $ids[endPage($i, count($ids)) - 1] ?></li> +<? + } + else { +?> + <li><a href='<?= make_link(array('mode','op','domain'))."&page=$i" ?>'><?= + $ids[beginPage($i)] . " -> " . $ids[endPage($i, count($ids)) - 1] ?></a></li> +<? + } + } + } +?> + </ul> Deleted: tags/panda-admin-1.0rc2/tpl/header.php =================================================================== --- trunk/tpl/header.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/tpl/header.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,81 +0,0 @@ -<? -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -?> -<?= '<?xml version="1.0"?>' ?> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xml:lang="it" - lang="it"> -<SCRIPT TYPE="text/javascript"> -<!-- -function popup(mylink, windowname) -{ -if (! window.focus)return true; -var href; -if (typeof(mylink) == 'string') - href=mylink; -else - href=mylink.href; -window.open(href, windowname, 'toolbar=0,menubar=0,directories=0,location=0,scrollbars=yes,status=0,resizable=1'); -return false; -} -//--> -</SCRIPT> - <head> - <title>PaNDA - <?= key($status->path[0]) ?></title> - <link title="Default Stilesheet" media="all" rel="stylesheet" href="default.css" type="text/css" /> - </head> - <body> - <div class="header">PaNDA Administration</div> - <div class="middle"> - <div class="menu"> - <h3><?= _("Menu") ?></h3> - <div class="insidemenu"> - <a href='<?= make_link(array()).'?mode=email' ?>'>e-mail</a> - <a href='<?= make_link(array()).'?mode=domain' ?>'><?= _("domains") ?></a> - <a href='<?= make_link(array()).'?mode=domainalias' ?>'><?= _("alias domains") ?></a> - <a href='<?= "http://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/nwadmin" ?>' onClick="return popup('/nwadmin','newsletter')">newsletter</a> -<? if(is_administrator()) { ?> - <br /> - <a href='<?= make_link(array()).'?mode=users' ?>'><?= _("users") ?></a> -<? } ?> - <br /> - <a href='<?= make_link(array()).'?mode=chmypw' ?>'>password</a> - <a href='<?= make_link(array()).'?mode=logout' ?>'>logout</a> - </div> - </div> - <div class="content"> - <div class="insidecontent"> - <div class="location"><? - -$deepth = count($status->path) - 1; -for ($i = 0; $i <= $deepth; $i++) { - $item = $status->path[$i]; - if ($i != 0) - print (" -> "); - if ($i != $deepth) - print ("<a href='" . current($item) . "'>"); - print (key($item)); - if ($i != $deepth) - print ("</a>"); -} -?></div> Copied: tags/panda-admin-1.0rc2/tpl/header.php (from rev 42, trunk/tpl/header.php) =================================================================== --- tags/panda-admin-1.0rc2/tpl/header.php (rev 0) +++ tags/panda-admin-1.0rc2/tpl/header.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,66 @@ +<? +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +?> +<?= '<?xml version="1.0"?>' ?> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" + xml:lang="it" + lang="it"> + <head> + <title>PaNDA - <?= key($status->path[0]) ?></title> + <link title="Default Stilesheet" media="all" rel="stylesheet" href="default.css" type="text/css" /> + </head> + <body> + <div class="header">PaNDA Administration</div> + <div class="middle"> + <div class="menu"> + <h3><?= _("Menu") ?></h3> + <div class="insidemenu"> + <a href='<?= make_link(array()).'?mode=email' ?>'>e-mail</a> + <a href='<?= make_link(array()).'?mode=domain' ?>'><?= _("domains") ?></a> + <a href='<?= make_link(array()).'?mode=domainalias' ?>'><?= _("alias domains") ?></a> + <a href='<?= "http://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/nwadmin" ?>' target="_blank">newsletter</a> +<? if(is_administrator()) { ?> + <br /> + <a href='<?= make_link(array()).'?mode=users' ?>'><?= _("users") ?></a> +<? } ?> + <br /> + <a href='<?= make_link(array()).'?mode=chmypw' ?>'>password</a> + <a href='<?= make_link(array()).'?mode=logout' ?>'>logout</a> + </div> + </div> + <div class="content"> + <div class="insidecontent"> + <div class="location"><? + +$deepth = count($status->path) - 1; +for ($i = 0; $i <= $deepth; $i++) { + $item = $status->path[$i]; + if ($i != 0) + print (" -> "); + if ($i != $deepth) + print ("<a href='" . current($item) . "'>"); + print (key($item)); + if ($i != $deepth) + print ("</a>"); +} +?></div> Deleted: tags/panda-admin-1.0rc2/tpl/users/modify.php =================================================================== --- trunk/tpl/users/modify.php 2008-02-28 11:31:35 UTC (rev 41) +++ tags/panda-admin-1.0rc2/tpl/users/modify.php 2008-03-06 11:38:15 UTC (rev 44) @@ -1,48 +0,0 @@ -<? -/* - Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -?> - <h4><?= _("Modify user") ?></h4> - <form name="newuser" method="get" action="#"> - <p> - <?= make_hidden_fields(array('mode','op')) ?> - <?= _("User name: ") ?>:<br /> - <input type="text" name="user" value="<?= $status->user ?>" /> <br /> - <?= _("E-mail address: ") ?>:<br /> - <input type="text" name="data[1]" value="<?= $users[$status->user][email] ?>" /><br /><br /> - <?= _("New password: ") ?><br /> - <input type="password" name="data[2]" value="<?= $status->data[2] ?>" /> <br /> - <?= _("Repeat new password: ") ?><br /> - <input type="password" name="data[3]" value="<?= $status->data[3] ?>" /> - </p> - <p> - <?= _("Select user's access level: ") ?><br /><br /> -<? if($users[$status->user][is_administrator] == 't') { ?> - <input type="radio" name="data[4]" value="normal"/><?= _("normal") ?> - <input type="radio" name="data[4]" value="admin" CHECKED/><?= _("administrator") ?><br /> -<? } else { ?> - <input type="radio" name="data[4]" value="normal" CHECKED/><?= _("normal") ?> - <input type="radio" name="data[4]" value="admin"/><?= _("administrator") ?><br /> -<? } ?> - </p> - <p> - [<a href='<?= make_link(array('mode'))."&op=listusers" ?>'><?= _("cancel") ?></a>] - [<a href="#" onclick="newuser.submit()"><?= _("submit") ?> >></a>] - </p> - </form> Copied: tags/panda-admin-1.0rc2/tpl/users/modify.php (from rev 42, trunk/tpl/users/modify.php) =================================================================== --- tags/panda-admin-1.0rc2/tpl/users/modify.php (rev 0) +++ tags/panda-admin-1.0rc2/tpl/users/modify.php 2008-03-06 11:38:15 UTC (rev 44) @@ -0,0 +1,48 @@ +<? +/* + Copyright (C) 2007 - Marco Nenciarini <mn...@gr...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +?> + <h4><?= _("Modify user") ?></h4> + <form name="newuser" method="get" action="#"> + <p> + <?= make_hidden_fields(array('mode','op')) ?> + <?= _("User name: ") ?><br /> + <input type="text" name="user" value="<?= $status->user ?>" /> <br /> + <?= _("E-mail address: ") ?><br /> + <input type="text" name="data[1]" value="<?= $users[$status->user][email] ?>" /><br /><br /> + <?= _("New password: ") ?><br /> + <input type="password" name="data[2]" value="<?= $status->data[2] ?>" /> <br /> + <?= _("Repeat new password: ") ?><br /> + <input type="password" name="data[3]" value="<?= $status->data[3] ?>" /> + </p> + <p> + <?= _("Select user's access level: ") ?><br /><br /> +<? if($users[$status->user][is_administrator] == 't') { ?> + <input type="radio" name="data[4]" value="normal"/><?= _("normal") ?> + <input type="radio" name="data[4]" value="admin" CHECKED/><?= _("administrator") ?><br /> +<? } else { ?> + <input type="radio" name="data[4]" value="normal" CHECKED/><?= _("normal") ?> + <input type="radio" name="data[4]" value="admin"/><?= _("administrator") ?><br /> +<? } ?> + </p> + <p> + [<a href='<?= make_link(array('mode'))."&op=listusers" ?>'><?= _("cancel") ?></a>] + [<a href="#" onclick="newuser.submit()"><?= _("submit") ?> >></a>] + </p> + </form> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-03-06 11:32:24
|
Revision: 43 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=43&view=rev Author: agrassi Date: 2008-03-06 03:32:28 -0800 (Thu, 06 Mar 2008) Log Message: ----------- Set default language to C Modified Paths: -------------- trunk/config.php Modified: trunk/config.php =================================================================== --- trunk/config.php 2008-03-06 11:04:12 UTC (rev 42) +++ trunk/config.php 2008-03-06 11:32:28 UTC (rev 43) @@ -45,6 +45,6 @@ // Make a few tests before production deployment. // If you don't know what to write here, just type "C", and you'll have an english interface. // example: define('PANDA_LANG','it_IT.UTF-8'); -define('PANDA_LANG','it_IT.UTF-8'); +define('PANDA_LANG','C'); ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-03-06 11:04:07
|
Revision: 42 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=42&view=rev Author: agrassi Date: 2008-03-06 03:04:12 -0800 (Thu, 06 Mar 2008) Log Message: ----------- Big commit, indeed: - Added a few forgotten strings to gettext control - Added italian language support - Renamed gettextize to "update-po" - Added compile-po to quicken po compilation - Added legend for mailbox types - Improved locale support check - Fixed bug in nwadmin linking Modified Paths: -------------- trunk/config.php trunk/doc/TODO trunk/index.php trunk/modules/domain.php trunk/modules/domainalias.php trunk/modules/email/add.php trunk/modules/email/modifynwl/chpw.php trunk/modules/email.php trunk/modules/users/add.php trunk/modules/users.php trunk/tpl/email/listmails.php trunk/tpl/header.php trunk/tpl/users/modify.php Added Paths: ----------- trunk/extra/scripts/compile-po.sh trunk/extra/scripts/update-po.sh trunk/locale/ trunk/locale/it/ trunk/locale/it/LC_MESSAGES/ trunk/locale/it/LC_MESSAGES/messages.mo trunk/locale/it/LC_MESSAGES/messages.po Removed Paths: ------------- trunk/extra/scripts/gettextize.sh Modified: trunk/config.php =================================================================== --- trunk/config.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/config.php 2008-03-06 11:04:12 UTC (rev 42) @@ -38,4 +38,13 @@ // currently 'crypt-md5' and 'crypt-des' are supported define('CRYPT_ALGO','crypt-md5'); +// Language +// Currently supported are it_IT/C +// Warning: To use a locale, you need the right locale support on the server. +// it_IT, for example could be either "it", "it_IT", "it_IT.UTF-8", "it_IT@euro".. +// Make a few tests before production deployment. +// If you don't know what to write here, just type "C", and you'll have an english interface. +// example: define('PANDA_LANG','it_IT.UTF-8'); +define('PANDA_LANG','it_IT.UTF-8'); + ?> Modified: trunk/doc/TODO =================================================================== --- trunk/doc/TODO 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/doc/TODO 2008-03-06 11:04:12 UTC (rev 42) @@ -6,9 +6,6 @@ - Let users have the ability to enable/disable newsletter support - - E-mails listed should be differenced from each other (email,alias,newsletter etc) - with a better heuristic, and a better (more clear) graphic way (currently it uses bold/italic) - - When users change their own password, we should verify the old password, and possibly have a form with a "password" field with double insert Added: trunk/extra/scripts/compile-po.sh =================================================================== --- trunk/extra/scripts/compile-po.sh (rev 0) +++ trunk/extra/scripts/compile-po.sh 2008-03-06 11:04:12 UTC (rev 42) @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ ! -d "locale" ]; then + echo "You must launch this from the top source directory" + exit +fi + +echo -n "Updating language:" +for lang in locale/*; do + lcpath="${lang}/LC_MESSAGES" + echo -n " ${lang#locale/}" + msgfmt ${lcpath}/messages.po -o ${lcpath}/messages.mo +done + +echo . Property changes on: trunk/extra/scripts/compile-po.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/plain Deleted: trunk/extra/scripts/gettextize.sh =================================================================== --- trunk/extra/scripts/gettextize.sh 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/extra/scripts/gettextize.sh 2008-03-06 11:04:12 UTC (rev 42) @@ -1,11 +0,0 @@ -#!/bin/sh - -lang=$1 - -[ -z $lang ] && echo "Usage: $0 <lang>\n(e.g. $0 fr)" && exit - -lcpath="./locale/${lang}/LC_MESSAGES" -mkdir -p ${lcpath} - -find -not -type 'd' -name \*.php | xgettext -L php -D . -f - -o ${lcpath}/messages.po - Copied: trunk/extra/scripts/update-po.sh (from rev 41, trunk/extra/scripts/gettextize.sh) =================================================================== --- trunk/extra/scripts/update-po.sh (rev 0) +++ trunk/extra/scripts/update-po.sh 2008-03-06 11:04:12 UTC (rev 42) @@ -0,0 +1,19 @@ +#!/bin/sh + +lang=$1 + +[ -z $lang ] && echo "Usage: $0 <lang>\n(e.g. $0 fr)" && exit + +lcpath="./locale/${lang}/LC_MESSAGES" + +if [ ! -d "locale" ]; then + echo "You must launch this from the top source directory" + exit +fi + +mkdir -p ${lcpath} + +touch ${lcpath}/messages.po + +find . -iname "*.php" -exec xgettext --omit-header -j -o ${lcpath}/messages.po --keyword=_ {} \; + Property changes on: trunk/extra/scripts/update-po.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/plain Modified: trunk/index.php =================================================================== --- trunk/index.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/index.php 2008-03-06 11:04:12 UTC (rev 42) @@ -21,6 +21,13 @@ require_once ('config.php'); require_once ('includes/functions.php'); +if(setlocale(LC_ALL, PANDA_LANG)) { + bindtextdomain("messages","locale"); + textdomain("messages"); +} else { + echo "Unsupported locale: " . PANDA_LANG; + die; +} // Fill $status with command line $status = decode_status(); Added: trunk/locale/it/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Property changes on: trunk/locale/it/LC_MESSAGES/messages.mo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/locale/it/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/it/LC_MESSAGES/messages.po (rev 0) +++ trunk/locale/it/LC_MESSAGES/messages.po 2008-03-06 11:04:12 UTC (rev 42) @@ -0,0 +1,982 @@ +#: tpl/domain/delete.php:21 tpl/users/assign/delete.php:21 +msgid "Domain deletion" +msgstr "Eliminazione dominio" + +#: tpl/domain/delete.php:22 +msgid "It has been asked to delete the domain " +msgstr "E' stato richiesto di eliminare il dominio " + +#: tpl/domain/delete.php:26 +msgid "WARNING! All the mailboxes in the domain" +msgstr "ATTENZIOEN! Tutte le caselle di posta nel dominio" + +#: tpl/domain/delete.php:27 +msgid "will be deleted, without recovery possibility." +msgstr "saranno eliminate, senza possibilità di recupero." + +#: tpl/domain/delete.php:30 +msgid "Do you really want to continue?" +msgstr "Si desidera continuare?" + +#: tpl/domain/delete.php:34 tpl/domain/add.php:34 tpl/domain/modify.php:38 +#: tpl/users/delete.php:29 tpl/users/add.php:40 +#: tpl/users/aliassign/delete.php:29 tpl/users/modify.php:45 +#: tpl/users/assign/delete.php:29 tpl/input.php:30 tpl/domainalias/add.php:33 +#: tpl/message.php:30 tpl/email/delete.php:61 tpl/email/add.php:36 +#: tpl/email/deletefromnwl.php:30 tpl/email/deletenwl.php:31 +#: nwadmin/send.php:44 +msgid "cancel" +msgstr "annulla" + +#: tpl/domain/add.php:21 +msgid "New domain creation" +msgstr "Creazione nuovo dominio" + +#: tpl/domain/add.php:25 +msgid "Insert new domain name (for example test.com)" +msgstr "Inserire il nome del nuovo dominio (ad esempio prova.it)" + +#: tpl/domain/add.php:29 +msgid "If desired, it is possible to have a default destination" +msgstr "" +"Se lo si desidera, è possibile avere una destinazione di default" + +#: tpl/domain/add.php:30 +msgid "for the unknown addresses of a domain (for example de...@de...)" +msgstr "" +"per gli indirizzi sconosciuti di un dominio (ad esempio de...@de...)" + +#: tpl/domain/add.php:35 tpl/users/add.php:41 tpl/users/modify.php:46 +#: tpl/domainalias/add.php:34 tpl/email/add.php:37 index.php:37 +msgid "submit" +msgstr "continua" + +#: tpl/domain/modify.php:21 +msgid "Domain modify" +msgstr "Modifica dominio" + +#: tpl/domain/modify.php:24 +msgid "Insert the new default destination for the domain" +msgstr "Inserire la nuova destinazione di default per il dominio" + +#: tpl/domain/modify.php:25 modules/domain/modify.php:24 +msgid "(leave the field empty to delete the default destination)" +msgstr "(lasciare il campo vuoto per eliminare la destinazione di default)" + +#: tpl/domain/modify.php:31 +msgid "Insert the new default quota for the domain " +msgstr "Inserire la nuova quota per il dominio " + +#: tpl/domain/listdomains.php:21 tpl/domainalias/listdomains.php:21 +#: tpl/email/listdomains.php:20 +msgid "Domain list" +msgstr "Lista dei domini" + +#: tpl/domain/listdomains.php:23 tpl/domainalias/listdomains.php:23 +#: tpl/email/listdomains.php:22 +msgid "List of administrable domains: " +msgstr "Lista dei domini amministrabili: " + +#: tpl/domain/listdomains.php:47 tpl/users/aliassign.php:55 +#: tpl/users/assign.php:58 tpl/domainalias/listdomains.php:48 +#: tpl/email/modify.php:86 +msgid "add" +msgstr "aggiungi" + +#: tpl/domain/listdomains.php:55 tpl/domainalias/listdomains.php:56 +#: tpl/email/listdomains.php:38 +msgid "Other domains: " +msgstr "Altri domini: " + +#: tpl/header.php:51 +msgid "Menu" +msgstr "Menù" + +#: tpl/header.php:54 +msgid "domains" +msgstr "domini" + +#: tpl/header.php:55 +msgid "alias domains" +msgstr "domini alias" + +#: tpl/header.php:59 +msgid "users" +msgstr "utenti" + +#: tpl/users/delete.php:21 +msgid "User deletion" +msgstr "Eliminazione utente" + +#: tpl/users/delete.php:22 +msgid "It has been requested to delete the user " +msgstr "E' stato richiesto di eliminare l'utente " + +#: tpl/users/delete.php:25 +msgid "This operation is not reversible." +msgstr "Questa operazione non è reversibile." + +#: tpl/users/delete.php:26 tpl/users/aliassign/delete.php:26 +#: tpl/users/assign/delete.php:26 tpl/email/deletefromnwl.php:27 +#: tpl/email/deletenwl.php:27 modules/email/modify/rmbox.php:25 +#: modules/email/modify/rmalias.php:32 +msgid "Do you want to proceed?" +msgstr "Si desidera procedere?" + +#: tpl/users/add.php:21 +msgid "New user creation" +msgstr "Creazione nuovo utente" + +#: tpl/users/add.php:25 +msgid "Insert the new user name (e.g. 'foo' to create foo)" +msgstr "Inserire il nome del nuovo utente (ad esempio prova per creare prova)" + +#: tpl/users/add.php:27 +msgid "Insert new user's e-mail: " +msgstr "Inserire l'indirizzo e-mail del nuovo utente: " + +#: tpl/users/add.php:29 +msgid "Insert new user's password: " +msgstr "Inserire la password: " + +#: tpl/users/add.php:31 +msgid "Repeat password: " +msgstr "Ripetere la password: " + +#: tpl/users/add.php:35 +msgid "Select new user's access level: " +msgstr "Selezionare i permessi del nuovo utente: " + +#: tpl/users/aliassign/delete.php:21 tpl/domainalias/delete.php:21 +msgid "Alias domain deletion" +msgstr "Eliminazione dominio alias" + +#: tpl/users/aliassign/delete.php:22 +msgid "It has been requested to delete the alias domain " +msgstr "E' stato richiesto di eliminare il dominio alias " + +#: tpl/users/aliassign/delete.php:22 tpl/users/assign/delete.php:22 +msgid " from the user " +msgstr " dall'utente " + +#: tpl/users/aliassign.php:21 +msgid "Modify user-alias domain associations" +msgstr "Modifica associazioni utente-dominio alias" + +#: tpl/users/aliassign.php:22 tpl/users/assign.php:22 +msgid "It has been requested to modify the associations of the user " +msgstr "E' stato richiesto di modificare le associazioni dell'utente " + +#: tpl/users/aliassign.php:26 +msgid "At the moment, associated alias domains are the following: " +msgstr "Al momento, i domini alias associati sono i seguenti: " + +#: tpl/users/aliassign.php:41 tpl/users/assign.php:42 +msgid "Add a domain: " +msgstr "Agigungi un dominio: " + +#: tpl/users/aliassign.php:57 tpl/users/assign.php:61 +msgid "" +"This user has all domains associated, so it's not possible to add any others." +msgstr "" +"Questo utente ha tutti i domini associati a sé, quindi non è " +"possibile aggiungerne altri." + +#: tpl/users/aliassign.php:61 tpl/users/assign.php:64 +#: tpl/email/modifynwl.php:48 tpl/email/modify.php:89 nwadmin/send.php:51 +#: nwadmin/moderation.php:34 +msgid "back" +msgstr "indietro" + +#: tpl/users/modify.php:21 +msgid "Modify user" +msgstr "Modifica utente" + +#: tpl/users/modify.php:25 +msgid "User name: " +msgstr "Nome utente: " + +#: tpl/users/modify.php:27 +msgid "E-mail address: " +msgstr "Indirizzo e-mail: " + +#: tpl/users/modify.php:29 +msgid "New password: " +msgstr "Nuova password: " + +#: tpl/users/modify.php:31 +msgid "Repeat new password: " +msgstr "Ripetere nuova password: " + +#: tpl/users/modify.php:35 +msgid "Select user's access level: " +msgstr "Selezionare i permessi dell'utente: " + +#: tpl/users/modify.php:37 tpl/users/modify.php:40 +msgid "normal" +msgstr "normale" + +#: tpl/users/modify.php:38 tpl/users/modify.php:41 +msgid "administrator" +msgstr "amministratore" + +#: tpl/users/assign/delete.php:22 +msgid "It has been requested to delete the domain " +msgstr "E' stato richiesto di eliminare il dominio " + +#: tpl/users/listusers.php:21 +msgid "User management" +msgstr "Gestione utenti" + +#: tpl/users/listusers.php:23 +msgid "User list from " +msgstr "Lista degli utenti da " + +#: tpl/users/listusers.php:23 tpl/email/listmails.php:23 +msgid " to " +msgstr " a " + +#: tpl/users/listusers.php:24 +msgid "<b>Bold</b> users are <b>administrators</b>." +msgstr "Gli utenti in <b>grassetto</b> sono <b>amministratori</b>." + +#: tpl/users/listusers.php:25 tpl/email/listmails.php:24 +#: tpl/email/listmails.php:25 +msgid "Press 'M' to modify, 'X' to delete." +msgstr "Premere 'M' per modificare, 'X' per eliminare." + +#: tpl/users/listusers.php:67 +msgid "Other users: " +msgstr "Altri utenti: " + +#: tpl/users/assign.php:21 +msgid "Modify user-domain associations" +msgstr "Modific adelle associazioni utente-dominio" + +#: tpl/users/assign.php:26 +msgid "At the moment, associated domains are the following: " +msgstr "Al momento, i domini associati sono i seguenti: " + +#: tpl/domainalias/delete.php:22 +msgid "It has been asked to delete the alias domain " +msgstr "E' stato richiesto di eliminare il dominio alias " + +#: tpl/domainalias/delete.php:26 +msgid "At the moment every message for this domain" +msgstr "Al momento, ogni messaggio per questo dominio" + +#: tpl/domainalias/delete.php:27 +msgid "is being delivered to the domain " +msgstr "viene inoltrato al dominio " + +#: tpl/domainalias/add.php:21 +msgid "New alias domain creation" +msgstr "Creazione nuovo dominio alias" + +#: tpl/domainalias/add.php:25 +msgid "Insert the new alias domain (e.g. test.com)" +msgstr "Inserire il nuovo dominio alias (ad esempio prova.it)" + +#: tpl/domainalias/add.php:29 +msgid "Insert the domain destination (e.g. destination.com)" +msgstr "Inserire la destinazione del dominio (ad esempio destinazione.it)" + +#: tpl/email/delete.php:21 +msgid "Address deletion" +msgstr "Eliminazione indirizzo" + +#: tpl/email/delete.php:22 +msgid "It has been requested to delete the address" +msgstr "E' stato richiesto di eliminare l'indirizzo" + +#: tpl/email/delete.php:26 tpl/email/modify.php:26 +msgid "At the moment, every message for this address is processed this way: " +msgstr "" +"Al momento, ogni messaggio per questo indirizzo viene processato in questo " +"modo: " + +#: tpl/email/delete.php:33 tpl/email/modify.php:32 +msgid "Messages are stored in the local mailbox." +msgstr "I messaggi vengono memorizzati localmente." + +#: tpl/email/delete.php:45 tpl/email/modify.php:66 +msgid "A copy is being forwarded to the address " +msgstr "Una copia viene inoltrata all'indirizzo " + +#: tpl/email/delete.php:53 +msgid "" +"This operation will delete every message actually stored in this mailbox." +msgstr "" +"Questa operazione eliminerà tutti i messaggi memorizzati in questa " +"casella." + +#: tpl/email/delete.php:54 +msgid "Do you want to continue?" +msgstr "Si desidera continuare?" + +#: tpl/email/add.php:21 +msgid "New address creation" +msgstr "Creazione nuovo indirizzo" + +#: tpl/email/add.php:26 +msgid "Insert the new address name (e.g. 'test' to create test@" +msgstr "" +"Inserire il nome del nuovo indirizzo (ad esempio prova per creare prova@" + +#: tpl/email/add.php:30 +msgid "Select address type: " +msgstr "Selezionare il tipo di indirizzo: " + +#: tpl/email/modifynwl.php:21 +msgid "Newsletter modify" +msgstr "Modifica newsletter" + +#: tpl/email/modifynwl.php:22 +msgid "It has been requested to modify the newsletter " +msgstr "E' stato richiesto di modificare la newsletter " + +#: tpl/email/modifynwl.php:24 +msgid "change password" +msgstr "cambio password" + +#: tpl/email/modifynwl.php:28 +msgid "Current subscriptions: " +msgstr "Sottoscrizioni attuali: " + +#: tpl/email/modifynwl.php:32 +msgid "There are no subscriptions." +msgstr "Non ci sono sottoscrizioni." + +#: tpl/email/modify.php:21 +msgid "Mailbox modify" +msgstr "Modifica mailbox" + +#: tpl/email/modify.php:22 +msgid "It has been requested to modify the mailbox " +msgstr "E' stato richiesto di modificare la mailbox " + +#: tpl/email/modify.php:33 +msgid "Change password" +msgstr "Cambia password" + +#: tpl/email/modify.php:37 +msgid "Change quota" +msgstr "Cambia quota" + +#: tpl/email/modify.php:45 +msgid "Delete local mailbox" +msgstr "Elimina mailbox locale" + +#: tpl/email/modify.php:54 +msgid "Messages are not being stored." +msgstr "I messaggi non vengono memorizzati." + +#: tpl/email/modify.php:55 +msgid "Create local mailbox" +msgstr "Crea mailbox locale" + +#: tpl/email/modify.php:70 +msgid "delete destination" +msgstr "elimina destinazione" + +#: tpl/email/modify.php:81 +msgid "Add new destination: " +msgstr "Aggiungi nuova destinazione: " + +#: tpl/email/deletefromnwl.php:21 +msgid "Delete subscription" +msgstr "Elimina sottoscrizione" + +#: tpl/email/deletefromnwl.php:22 +msgid "It has been requested to delete the subscription " +msgstr "E' stato richeisto di eliminare la sottoscrizione " + +#: tpl/email/deletefromnwl.php:24 modules/email/modifynwl/del.php:46 +msgid " from the newsletter " +msgstr " dalla newsletter " + +#: tpl/email/deletenwl.php:21 +msgid "Newsletter deletion" +msgstr "Eliminazione newsletter" + +#: tpl/email/deletenwl.php:22 +msgid "It has been requested to delete the newsletter " +msgstr "E' stato richiesto di eliminare la newsletter " + +#: tpl/email/deletenwl.php:26 +msgid "This will cause the loss of all subscriptions." +msgstr "Questo causerà la perdita di tutte le sottoscrizioni." + +#: tpl/email/listmails.php:21 +msgid "Domain management for " +msgstr "Gestione dominio per " + +#: tpl/email/listmails.php:23 +msgid "Mailbox list from " +msgstr "Lista delle mailbox da " + +#: tpl/email/listmails.php:62 tpl/email/listmails.php:63 +msgid "Other mailboxes in the domain " +msgstr "Altre mailbox nel dominio " + +#: tpl/logout.php:36 nwadmin/logout.php:29 +msgid "Successfully logged out." +msgstr "Logout eseguito con successo." + +#: modules/domain/delete.php:29 modules/domain/add.php:62 +#: modules/domain/modify.php:47 modules/domain/modify.php:63 +#: modules/domainalias/delete.php:29 modules/domainalias/add.php:59 +#: modules/domainalias/modify.php:44 modules/email/add/local.php:40 +msgid "Operation successful" +msgstr "Operazione conclusa con successo" + +#: modules/domain/delete.php:30 modules/domain/add.php:63 +#: modules/users/assign/delete.php:43 modules/users/assign/assign.php:37 +msgid "The domain " +msgstr "Il dominio " + +#: modules/domain/delete.php:30 modules/users/delete.php:42 +msgid " has been deleted" +msgstr " è stato eliminato" + +#: modules/domain/delete.php:32 modules/domain/add.php:32 +#: modules/domain/add.php:44 modules/domain/add.php:65 +#: modules/domain/modify.php:56 modules/domain/modify.php:72 +#: modules/users/delete.php:44 modules/users/add.php:31 +#: modules/users/add.php:38 modules/users/add.php:47 modules/users/add.php:60 +#: modules/users/add.php:84 modules/users/aliassign/delete.php:45 +#: modules/users/aliassign/assign.php:39 modules/users/modify.php:42 +#: modules/users/modify.php:56 modules/users/modify.php:81 +#: modules/users/modify.php:91 modules/users/assign/delete.php:45 +#: modules/users/assign/assign.php:39 modules/chmypw.php:47 +#: modules/domainalias/delete.php:32 modules/domainalias/add.php:32 +#: modules/domainalias/add.php:41 modules/domainalias/add.php:50 +#: modules/domainalias/add.php:62 modules/domainalias/modify.php:34 +#: modules/domainalias/modify.php:48 modules/email/delete.php:45 +#: modules/email/add.php:32 modules/email/add.php:41 +#: modules/email/modifynwl/del.php:45 modules/email/modifynwl/chpw.php:36 +#: modules/email/add/remote.php:21 modules/email/add/remote.php:42 +#: modules/email/add/remote.php:50 modules/email/add/remote.php:61 +#: modules/email/add/newsletter.php:21 modules/email/add/newsletter.php:42 +#: modules/email/add/local.php:22 modules/email/add/local.php:43 +#: modules/email/modify/rmbox.php:38 modules/email/modify/rmalias.php:58 +#: modules/email/modify/chnwlpw.php:36 modules/email/modify/mkbox.php:41 +#: modules/email/modify/mkalias.php:22 modules/email/modify/mkalias.php:30 +#: modules/email/modify/mkalias.php:38 modules/email/modify/mkalias.php:61 +#: modules/email/modify/chpw.php:36 modules/email/modify/chquota.php:41 +#: modules/email/deletenwl.php:45 +msgid "Error" +msgstr "Errore" + +#: modules/domain/delete.php:33 +msgid "Error while deleting " +msgstr "Errore nell'eliminazione di " + +#: modules/domain/add.php:21 +msgid "new domain" +msgstr "nuovo dominio" + +#: modules/domain/add.php:33 modules/domainalias/add.php:33 +msgid "The domain '" +msgstr "Il dominio '" + +#: modules/domain/add.php:33 +msgid "' is not valid" +msgstr "' non è valido" + +#: modules/domain/add.php:45 modules/domain/modify.php:39 +msgid "The default destination '" +msgstr "La destinazione di default '" + +#: modules/domain/add.php:45 +msgid "' is not a valid email address" +msgstr "' non è un'email valida" + +#: modules/domain/add.php:54 +msgid "Domain already existing." +msgstr "Dominio già esistente." + +#: modules/domain/add.php:63 +msgid " has been created." +msgstr " è stato creato." + +#: modules/domain/add.php:66 +msgid "Error while creating domain " +msgstr "Errore nella creazione del dominio " + +#: modules/domain/modify.php:23 +msgid "Insert the new default destination for the domain " +msgstr "Inserire la nuova destinazione di default per il dominio " + +#: modules/domain/modify.php:39 +msgid "' is not a valid email address." +msgstr "' non è un'email valida." + +#: modules/domain/modify.php:49 modules/domain/modify.php:52 +msgid "The default destination for the domain " +msgstr "La destinazione di default per il dominio " + +#: modules/domain/modify.php:49 modules/domain/modify.php:65 +msgid " has been removed" +msgstr " è stata rimossa" + +#: modules/domain/modify.php:52 modules/domainalias/modify.php:45 +#: modules/email/modify/chquota.php:39 +msgid " has been modified." +msgstr " è stata modificata." + +#: modules/domain/modify.php:53 modules/domainalias/modify.php:46 +msgid "The new destination is " +msgstr "La nuova destinazione è " + +#: modules/domain/modify.php:57 +msgid "Error while updating the default destination for the domain " +msgstr "" +"Errore nell'aggiornamento della destinazione di default per il dominio " + +#: modules/domain/modify.php:65 modules/domain/modify.php:68 +msgid "The quota for the domain " +msgstr "La quota per il dominio " + +#: modules/domain/modify.php:68 +msgid " has been modified to " +msgstr " è stata modificata a " + +#: modules/domain/modify.php:73 +msgid "Error while modifying quota for the domain " +msgstr "Errore nella modifica della quota per il dominio " + +#: modules/users/delete.php:41 modules/users/add.php:81 +#: modules/users/aliassign/delete.php:42 modules/users/aliassign/assign.php:36 +#: modules/users/modify.php:78 modules/users/modify.php:88 +#: modules/users/assign/delete.php:42 modules/users/assign/assign.php:36 +#: modules/chmypw.php:44 modules/email/delete.php:42 +#: modules/email/modifynwl/del.php:42 modules/email/modifynwl/chpw.php:33 +#: modules/email/add/remote.php:58 modules/email/add/newsletter.php:39 +#: modules/email/modify/rmbox.php:35 modules/email/modify/rmalias.php:55 +#: modules/email/modify/chnwlpw.php:33 modules/email/modify/mkbox.php:38 +#: modules/email/modify/mkalias.php:58 modules/email/modify/chpw.php:33 +#: modules/email/modify/chquota.php:38 modules/email/deletenwl.php:42 +msgid "Operation successful." +msgstr "Operazione conclusa con successo." + +#: modules/users/delete.php:42 +msgid "The user " +msgstr "L'utente " + +#: modules/users/delete.php:45 +msgid "Error while deleting user " +msgstr "Errore nell'eliminazione dell'utente " + +#: modules/users/add.php:32 +msgid "The supplied user is not valid" +msgstr "L'utente specificato non è valido" + +#: modules/users/add.php:39 +msgid "The supplied password is not valid" +msgstr "La password specificata non è valida" + +#: modules/users/add.php:48 +msgid "User already existing" +msgstr "Utente già esistente" + +#: modules/users/add.php:61 modules/users/modify.php:57 +msgid "Supplied passwords don't match" +msgstr "Le password inserite non corrispondono" + +#: modules/users/add.php:82 +msgid "Successfully created user " +msgstr "Creato con successo l'utente " + +#: modules/users/add.php:85 +msgid "Error while creating user " +msgstr "Errore nell'eliminazione dell'utente " + +#: modules/users/aliassign/delete.php:43 modules/users/aliassign/assign.php:37 +#: modules/domainalias/delete.php:30 modules/domainalias/add.php:60 +msgid "The alias domain " +msgstr "Il dominio alias " + +#: modules/users/aliassign/delete.php:43 modules/users/assign/delete.php:43 +msgid " has been deleted from the user " +msgstr " è stato eliminato dall'utente " + +#: modules/users/aliassign/delete.php:46 modules/domainalias/delete.php:33 +msgid "Error while deleting the alias domain " +msgstr "Errore nella cancellazione del dominio alias " + +#: modules/users/aliassign/delete.php:46 modules/users/assign/delete.php:46 +msgid " from the user" +msgstr " dall'utente" + +#: modules/users/aliassign/assign.php:37 modules/users/assign/assign.php:37 +msgid "has been added to user " +msgstr "è stato aggiunto all'utente " + +#: modules/users/aliassign/assign.php:40 +msgid "Error while adding the alias domain " +msgstr "Errore nell'aggiunta del dominio alias " + +#: modules/users/modify.php:43 +msgid "Supplied password is not valid" +msgstr "La password inserita non è valida" + +#: modules/users/modify.php:79 modules/users/modify.php:89 +msgid "Successfully updated user " +msgstr "Aggiornato con successo l'utente " + +#: modules/users/modify.php:82 modules/users/modify.php:92 +msgid "Error while updating user " +msgstr "Errore nell'aggiornamento dell'utente " + +#: modules/users/assign/delete.php:46 +msgid "Error while deleting the domain " +msgstr "Errore nell'eliminazione del dominio " + +#: modules/users/assign/assign.php:40 +msgid "Error while adding the domain " +msgstr "Errore nell'aggiunta del dominio " + +#: modules/chmypw.php:26 +msgid "password change" +msgstr "cambio password" + +#: modules/chmypw.php:32 modules/email/modifynwl/chpw.php:23 +#: modules/email/modify/chnwlpw.php:23 modules/email/modify/chpw.php:23 +msgid "Password change" +msgstr "Cambio password" + +#: modules/chmypw.php:33 +msgid "Insert new password for user " +msgstr "Inserire la nuova password per l'utente " + +#: modules/chmypw.php:45 +msgid "The password has been updated" +msgstr "La password è stata aggiornata" + +#: modules/chmypw.php:48 +msgid "Error while updating password" +msgstr "Errore nell'aggiornamento della password" + +#: modules/domainalias/delete.php:30 modules/email/delete.php:43 +msgid " has been deleted." +msgstr " è stato eliminato." + +#: modules/domainalias/add.php:21 +msgid "new alias domain" +msgstr "nuovo dominio alias" + +#: modules/domainalias/add.php:33 modules/email/add.php:42 +msgid "' is not valid." +msgstr "' non è valido." + +#: modules/domainalias/add.php:42 modules/domainalias/modify.php:35 +msgid "The destination '" +msgstr "La destinazione '" + +#: modules/domainalias/add.php:42 +msgid "' is not a valid domain" +msgstr "' non è un dominio valido" + +#: modules/domainalias/add.php:51 +msgid "Already existing domain" +msgstr "Dominio già esistente" + +#: modules/domainalias/add.php:60 +msgid " has been created" +msgstr " è stato creato" + +#: modules/domainalias/add.php:63 +msgid "Error while creating the alias domain " +msgstr "Errore nella creazione del dominio alias " + +#: modules/domainalias/modify.php:23 +msgid "Modify alias domain" +msgstr "Modifica dominio alias" + +#: modules/domainalias/modify.php:24 +msgid "Insert new destination for alias domain " +msgstr "Inserire la nuova destinazione per il dominio alias " + +#: modules/domainalias/modify.php:35 +msgid "' is not a valid domain." +msgstr "' non è un dominio valido." + +#: modules/domainalias/modify.php:45 +msgid "The default destination for alias domain " +msgstr "La destinazione di default per il dominio alias " + +#: modules/domainalias/modify.php:49 +msgid "Error while updating the destination for the alias domain " +msgstr "Errore nell'aggiornamento della destinazione per il dominio alias " + +#: modules/email/delete.php:43 modules/email/modifynwl/del.php:43 +#: modules/email/add/remote.php:59 modules/email/modify/rmalias.php:56 +#: modules/email/modify/mkalias.php:59 +msgid "The address " +msgstr "L'indirizzo " + +#: modules/email/delete.php:46 +msgid "Error while deleting address " +msgstr "Errore nell'eliminazione dell'indirizzo " + +#: modules/email/add.php:33 +msgid "Address already existing" +msgstr "Indirizzo già esistente" + +#: modules/email/add.php:42 +msgid "The name '" +msgstr "Il nome '" + +#: modules/email/modifynwl/del.php:43 +msgid " has been deleted from the newsletter " +msgstr " è stato eliminato dalla newsletter " + +#: modules/email/modifynwl/del.php:46 +msgid "Error while deleting the address " +msgstr "Errore nell'eliminazione dell'indirizzo " + +#: modules/email/modifynwl/chpw.php:24 modules/email/modify/chnwlpw.php:24 +msgid "Insert the new password for the newsletter " +msgstr "Inserire la nuova password per la newsletter " + +#: modules/email/modifynwl/chpw.php:34 modules/email/modify/chnwlpw.php:34 +msgid "The password for the newsletter " +msgstr "La password per la newsletter " + +#: modules/email/modifynwl/chpw.php:34 +msgid " has been updated." +msgstr " è stata aggiornata." + +#: modules/email/modifynwl/chpw.php:37 +msgid "Error while updating the password for the newsletter" +msgstr "Errore nell'aggiornamento della password per la newsletter" + +#: modules/email/add/remote.php:22 modules/email/add/newsletter.php:22 +#: modules/email/add/local.php:23 +msgid "" +"The name 'postmaster' is reserved and cannot be used for normal email " +"addresses." +msgstr "" +"Il nome 'postmaster' è riservato e non può essere usato per " +"indirizzi email normali" + +#: modules/email/add/remote.php:30 +msgid "Alias creation" +msgstr "" + +#: modules/email/add/remote.php:31 +msgid "Insert the mail destination for " +msgstr "Inserire la nuova destinazione per " + +#: modules/email/add/remote.php:43 +msgid "The supplied destination is not a valid email address" +msgstr "La destinazione inserita non è un indirizzo email valido" + +#: modules/email/add/remote.php:51 modules/email/modify/mkalias.php:31 +msgid "The alias can't have itself as destination" +msgstr "L'alias non può avere sé stesso come destinazione" + +#: modules/email/add/remote.php:59 +msgid " has been added to the destination list of " +msgstr " è stato aggiunto alla lista dei destinatari di " + +#: modules/email/add/remote.php:62 modules/email/modify/rmalias.php:59 +#: modules/email/modify/mkalias.php:62 +msgid "Error while updating the destination list for " +msgstr "Errore nell'aggiornamento delle destinazioni per " + +#: modules/email/add/newsletter.php:40 +msgid "A newsletter has been created on the address " +msgstr "Una newsletter è stata careata sull'indirizzo " + +#: modules/email/add/newsletter.php:43 +msgid "Error while creating a newsletter on the address " +msgstr "Errore nella creazione della newsletter sull'indirizzo " + +#: modules/email/add/local.php:31 modules/email/modify/mkbox.php:23 +msgid "Mailbox creation" +msgstr "Creazione mailbox" + +#: modules/email/add/local.php:32 modules/email/modify/mkbox.php:24 +#: modules/email/modify/chpw.php:24 +msgid "Insert the new password for the local mailbox " +msgstr "Inserire la nuova password per la mailbox locale " + +#: modules/email/add/local.php:41 +msgid "A new local mailbox has been created for the address " +msgstr "Una nuova mailbox locale è stata creata per l'indirizzo " + +#: modules/email/add/local.php:44 +msgid "Error while creating the local mailbox for the email address " +msgstr "Errore nella creazione della mailbox locale per l'indirizzo email " + +#: modules/email/modify/rmbox.php:23 modules/email/modify/rmalias.php:29 +msgid "Warning" +msgstr "Attenzione" + +#: modules/email/modify/rmbox.php:24 +msgid "It has been requested to no longer store the mail for " +msgstr "E' stato richiesto di non memorizzare più' la posta per " + +#: modules/email/modify/rmbox.php:25 +msgid "" +"This operation will delete every message actually stored in the mailbox." +msgstr "" +"Questa operazione eliminerà tutti i messaggi memorizzati in questo " +"momento nella casella di posta." + +#: modules/email/modify/rmbox.php:36 +msgid "The local mailbox has been deleted for the address " +msgstr "La mailbox locale è stata eliminata per l'indirizzo " + +#: modules/email/modify/rmbox.php:39 +msgid "Error while deleting local mailbox for address " +msgstr "Errore nell'eliminazione della mailbox locale per l'indirizzo " + +#: modules/email/modify/rmalias.php:30 +msgid "It has been requested not to deliver anymore mail for " +msgstr "E' stato richiesto di non consegnare piu' la posta per " + +#: modules/email/modify/rmalias.php:31 +msgid " to the address " +msgstr " all'indirizzo " + +#: modules/email/modify/rmalias.php:56 +msgid " has been removed from the destinations of the address " +msgstr " è stato rimosso dalle destinazioni dell'indirizzo " + +#: modules/email/modify/chnwlpw.php:37 +msgid "Error while updating the password for the newsletter " +msgstr "Errore nell'aggiornamento della password per la newsletter " + +#: modules/email/modify/mkbox.php:39 +msgid "A local mailbox has been created for the address " +msgstr "Una mailbox locale è stata create per l'indirizzo " + +#: modules/email/modify/mkbox.php:42 +msgid "Error while creating a local mailbox for the address " +msgstr "Errore nella creazione della mailbox locale per l'indirizzo " + +#: modules/email/modify/mkalias.php:23 +msgid "The supplied destination is not a valid e-mail address" +msgstr "La destinazione inserita non è un indirizzo e-mail valido" + +#: modules/email/modify/mkalias.php:39 +msgid "The supplied address already exists" +msgstr "L'indirizzo inserito è già esistente" + +#: modules/email/modify/mkalias.php:59 +msgid " has been added to the destination list for " +msgstr " è stato aggiunto alla lista delle destinazioni di " + +#: modules/email/modify/chpw.php:34 +msgid "The password for the address " +msgstr "La password per l'indirizzo " + +#: modules/email/modify/chpw.php:37 +msgid "Error while updating the password for the address " +msgstr "Errore nell'aggiornamento della password per l'indirizzo " + +#: modules/email/modify/chquota.php:28 +msgid "Quota change" +msgstr "Cambio quota" + +#: modules/email/modify/chquota.php:29 +msgid "Insert the new quota for the local mailbox " +msgstr "Inserire la nuova quota per la mailbox locale " + +#: modules/email/modify/chquota.php:39 +msgid "The quota for the address " +msgstr "La quota per l'indirizzo " + +#: modules/email/modify/chquota.php:42 +msgid "Error while updating quota for address " +msgstr "Errore nell'aggiornamento della quota per l'indirizzo " + +#: modules/email/deletenwl.php:43 +msgid "The newsletter " +msgstr "La newsletter " + +#: modules/email/deletenwl.php:43 +msgid " has been emptied and deleted." +msgstr " è stata svuotata ed eliminata." + +#: modules/email/deletenwl.php:46 +msgid "Error while deleting the newsletter" +msgstr "Errore nella cancellazione della newsletter" + +#: nwadmin/delete.php:22 nwadmin/login.php:23 nwadmin/config.php:22 +#: nwadmin/send.php:22 nwadmin/listmails.php:22 nwadmin/moderation.php:26 +#: nwadmin/logout.php:22 +msgid "Direct access not allowed" +msgstr "Accesso diretto non consentito" + +#: nwadmin/index.php:52 +msgid "Access denied." +msgstr "Accesso non consentito" + +#: nwadmin/index.php:53 +msgid "Back" +msgstr "Indietro" + +#: nwadmin/send.php:33 +msgid "Are you sure you want to send this e-mail to the newsletter?" +msgstr "Si è sicuri di voler inviare questa e-mail alla newsletter?" + +#: nwadmin/send.php:36 +msgid "Sender" +msgstr "Mittente" + +#: nwadmin/send.php:37 +msgid "Subject" +msgstr "Oggetto" + +#: nwadmin/send.php:38 +msgid "Date" +msgstr "Data" + +#: nwadmin/send.php:50 +msgid "The e-mails have been queued." +msgstr "Le e-mail sono state messe in coda." + +#: nwadmin/logout.php:35 +msgid "Logout error." +msgstr "Errore nel logout." + +#: nwadmin/logout.php:36 +msgid "Contact administrators" +msgstr "Contattare gli amministratori" + +#: modules/email.php:22 +msgid "e-mail management" +msgstr "gestione e-mail" + +#: modules/domain.php:23 +msgid "domain management" +msgstr "gestione domini" + +#: modules/users/add.php:21 +msgid "new user" +msgstr "nuovo utente" + +#: modules/domainalias.php:22 +msgid "alias domain management" +msgstr "gestione domini alias" + +#: modules/email/add.php:21 +msgid "new address" +msgstr "nuovo indirizzo" + +#: modules/users.php:22 +msgid "user management" +msgstr "gestione utenti" + +#: tpl/email/listmails.php:24 +msgid "" +"<b>Bold</b> mailboxes are stored locally, starred* mailboxes contain " +"aliases, <i>italic</i> are newsletters." +msgstr "" +"Le caselle di posta in <b>grassetto</b> vengono memorizzate localmente, le " +"caselle con un asterisco* contengono alias, quelle in <i>corsivo</i> sono " +"newsletter." Modified: trunk/modules/domain.php =================================================================== --- trunk/modules/domain.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/modules/domain.php 2008-03-06 11:04:12 UTC (rev 42) @@ -20,7 +20,7 @@ // Load virtual domains $virtual_domains = load_domain_list(); -add_navigation_link('domain management', +add_navigation_link(_('domain management'), make_link(array ('mode')) . "&op=listdomains"); // If the specified domain doesn't exist, or user doesn't have rights, fall back to domain list Modified: trunk/modules/domainalias.php =================================================================== --- trunk/modules/domainalias.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/modules/domainalias.php 2008-03-06 11:04:12 UTC (rev 42) @@ -19,7 +19,7 @@ $alias_domains = load_alias_domain_list(); -add_navigation_link('alias domain management', +add_navigation_link(_('alias domain management'), make_link(array ('mode')) . "&op=listdomains"); // If specified domain doesn't exist or user doesn't have rights, fall back to domain list Modified: trunk/modules/email/add.php =================================================================== --- trunk/modules/email/add.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/modules/email/add.php 2008-03-06 11:04:12 UTC (rev 42) @@ -18,7 +18,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -add_navigation_link('nuovo indirizzo', make_link('mode', 'op', 'domain')); +add_navigation_link(_("new address"), make_link('mode', 'op', 'domain')); // If no user has been specified, display // the add page Modified: trunk/modules/email/modifynwl/chpw.php =================================================================== --- trunk/modules/email/modifynwl/chpw.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/modules/email/modifynwl/chpw.php 2008-03-06 11:04:12 UTC (rev 42) @@ -21,7 +21,7 @@ if (empty ($status->data) || !check_scookie()) { create_scookie(); $status->title = _("Password change"); - $status->message = _("Insert the new password for te newsletter ")."$status->user@$status->domain"; + $status->message = _("Insert the new password for the newsletter ")."$status->user@$status->domain"; $status->ask = true; $status->cancel_to = make_link(array('mode','domain','user','op')); $status->body = 'input'; Modified: trunk/modules/email.php =================================================================== --- trunk/modules/email.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/modules/email.php 2008-03-06 11:04:12 UTC (rev 42) @@ -19,7 +19,7 @@ $virtual_domains = load_domain_list(); -add_navigation_link('e-mail management', +add_navigation_link(_('e-mail management'), make_link(array ('mode')) . "&op=listdomains"); // If specified domain doesn't exist or user doesn't have rights, fall back to domain list Modified: trunk/modules/users/add.php =================================================================== --- trunk/modules/users/add.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/modules/users/add.php 2008-03-06 11:04:12 UTC (rev 42) @@ -18,7 +18,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -add_navigation_link('nuovo utente', make_link('mode', 'op')); +add_navigation_link(_("new user"), make_link('mode', 'op')); // If no user or action has been specified, show main add page if (!$status->data[4]|| !$status->data[0]) { Modified: trunk/modules/users.php =================================================================== --- trunk/modules/users.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/modules/users.php 2008-03-06 11:04:12 UTC (rev 42) @@ -19,7 +19,7 @@ $users = load_users(); -add_navigation_link('user management', +add_navigation_link(_('user management'), make_link(array ('mode')) . "&op=listusers"); switch ($status->op) { Modified: trunk/tpl/email/listmails.php =================================================================== --- trunk/tpl/email/listmails.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/tpl/email/listmails.php 2008-03-06 11:04:12 UTC (rev 42) @@ -21,6 +21,7 @@ <h4><?= _("Domain management for ") ?> <?= $status->domain ?></h4> <p> <?= _("Mailbox list from ") ?> <?= $ids[$begin]."@$status->domain" ?> <?= _(" to ") ?><?= $ids[$end - 1]."@$status->domain" ?>.<br /> + <?= _("<b>Bold</b> mailboxes are stored locally, starred* mailboxes contain aliases, <i>italic</i> are newsletters.") ?> <br /> <?= _("Press 'M' to modify, 'X' to delete.") ?> </p> <p> Modified: trunk/tpl/header.php =================================================================== --- trunk/tpl/header.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/tpl/header.php 2008-03-06 11:04:12 UTC (rev 42) @@ -25,21 +25,6 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it"> -<SCRIPT TYPE="text/javascript"> -<!-- -function popup(mylink, windowname) -{ -if (! window.focus)return true; -var href; -if (typeof(mylink) == 'string') - href=mylink; -else - href=mylink.href; -window.open(href, windowname, 'toolbar=0,menubar=0,directories=0,location=0,scrollbars=yes,status=0,resizable=1'); -return false; -} -//--> -</SCRIPT> <head> <title>PaNDA - <?= key($status->path[0]) ?></title> <link title="Default Stilesheet" media="all" rel="stylesheet" href="default.css" type="text/css" /> @@ -53,7 +38,7 @@ <a href='<?= make_link(array()).'?mode=email' ?>'>e-mail</a> <a href='<?= make_link(array()).'?mode=domain' ?>'><?= _("domains") ?></a> <a href='<?= make_link(array()).'?mode=domainalias' ?>'><?= _("alias domains") ?></a> - <a href='<?= "http://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/nwadmin" ?>' onClick="return popup('/nwadmin','newsletter')">newsletter</a> + <a href='<?= "http://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . "/nwadmin" ?>' target="_blank">newsletter</a> <? if(is_administrator()) { ?> <br /> <a href='<?= make_link(array()).'?mode=users' ?>'><?= _("users") ?></a> Modified: trunk/tpl/users/modify.php =================================================================== --- trunk/tpl/users/modify.php 2008-02-28 11:31:35 UTC (rev 41) +++ trunk/tpl/users/modify.php 2008-03-06 11:04:12 UTC (rev 42) @@ -22,9 +22,9 @@ <form name="newuser" method="get" action="#"> <p> <?= make_hidden_fields(array('mode','op')) ?> - <?= _("User name: ") ?>:<br /> + <?= _("User name: ") ?><br /> <input type="text" name="user" value="<?= $status->user ?>" /> <br /> - <?= _("E-mail address: ") ?>:<br /> + <?= _("E-mail address: ") ?><br /> <input type="text" name="data[1]" value="<?= $users[$status->user][email] ?>" /><br /><br /> <?= _("New password: ") ?><br /> <input type="password" name="data[2]" value="<?= $status->data[2] ?>" /> <br /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-02-28 11:31:31
|
Revision: 41 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=41&view=rev Author: agrassi Date: 2008-02-28 03:31:35 -0800 (Thu, 28 Feb 2008) Log Message: ----------- Common typo. Modified Paths: -------------- trunk/extra/scripts/gettextize.sh Modified: trunk/extra/scripts/gettextize.sh =================================================================== --- trunk/extra/scripts/gettextize.sh 2008-02-28 11:22:17 UTC (rev 40) +++ trunk/extra/scripts/gettextize.sh 2008-02-28 11:31:35 UTC (rev 41) @@ -7,5 +7,5 @@ lcpath="./locale/${lang}/LC_MESSAGES" mkdir -p ${lcpath} -for i in `find -not -type 'd' -name \*.php` ; do mkfifo /tmp/$(basename $i) | cat $i > $_ | xgettext -L php -D . -f - -o ${lcpath}/messages.po +find -not -type 'd' -name \*.php | xgettext -L php -D . -f - -o ${lcpath}/messages.po This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-02-28 11:22:12
|
Revision: 40 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=40&view=rev Author: agrassi Date: 2008-02-28 03:22:17 -0800 (Thu, 28 Feb 2008) Log Message: ----------- Added gettextizing script Added Paths: ----------- trunk/extra/scripts/ trunk/extra/scripts/gettextize.sh Added: trunk/extra/scripts/gettextize.sh =================================================================== --- trunk/extra/scripts/gettextize.sh (rev 0) +++ trunk/extra/scripts/gettextize.sh 2008-02-28 11:22:17 UTC (rev 40) @@ -0,0 +1,11 @@ +#!/bin/sh + +lang=$1 + +[ -z $lang ] && echo "Usage: $0 <lang>\n(e.g. $0 fr)" && exit + +lcpath="./locale/${lang}/LC_MESSAGES" +mkdir -p ${lcpath} + +for i in `find -not -type 'd' -name \*.php` ; do mkfifo /tmp/$(basename $i) | cat $i > $_ | xgettext -L php -D . -f - -o ${lcpath}/messages.po + Property changes on: trunk/extra/scripts/gettextize.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/plain This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-02-28 09:13:41
|
Revision: 39 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=39&view=rev Author: agrassi Date: 2008-02-28 01:13:41 -0800 (Thu, 28 Feb 2008) Log Message: ----------- _("Gettexted.") Minor corrections Modified Paths: -------------- trunk/default.css trunk/includes/security.php trunk/modules/chmypw.php trunk/modules/domain/add.php trunk/modules/domain/delete.php trunk/modules/domain/modify.php trunk/modules/domain.php trunk/modules/domainalias/add.php trunk/modules/domainalias/delete.php trunk/modules/domainalias/modify.php trunk/modules/domainalias.php trunk/modules/email/add/local.php trunk/modules/email/add/newsletter.php trunk/modules/email/add/remote.php trunk/modules/email/add.php trunk/modules/email/delete.php trunk/modules/email/deletenwl.php trunk/modules/email/modify/chnwlpw.php trunk/modules/email/modify/chpw.php trunk/modules/email/modify/chquota.php trunk/modules/email/modify/mkalias.php trunk/modules/email/modify/mkbox.php trunk/modules/email/modify/rmalias.php trunk/modules/email/modify/rmbox.php trunk/modules/email/modifynwl/chpw.php trunk/modules/email/modifynwl/del.php trunk/modules/email.php trunk/modules/users/add.php trunk/modules/users/aliassign/assign.php trunk/modules/users/aliassign/delete.php trunk/modules/users/assign/assign.php trunk/modules/users/assign/delete.php trunk/modules/users/delete.php trunk/modules/users/modify.php trunk/modules/users.php trunk/nwadmin/.project trunk/nwadmin/config.php trunk/nwadmin/default.css trunk/nwadmin/delete.php trunk/nwadmin/index.php trunk/nwadmin/listmails.php trunk/nwadmin/login.php trunk/nwadmin/logout.php trunk/nwadmin/moderation.php trunk/nwadmin/send.php trunk/tpl/domain/add.php trunk/tpl/domain/delete.php trunk/tpl/domain/listdomains.php trunk/tpl/domain/modify.php trunk/tpl/domainalias/add.php trunk/tpl/domainalias/delete.php trunk/tpl/domainalias/listdomains.php trunk/tpl/email/add.php trunk/tpl/email/delete.php trunk/tpl/email/deletefromnwl.php trunk/tpl/email/deletenwl.php trunk/tpl/email/listdomains.php trunk/tpl/email/listmails.php trunk/tpl/email/modify.php trunk/tpl/email/modifynwl.php trunk/tpl/footer.php trunk/tpl/header.php trunk/tpl/input.php trunk/tpl/logout.php trunk/tpl/message.php trunk/tpl/users/add.php trunk/tpl/users/aliassign/delete.php trunk/tpl/users/aliassign.php trunk/tpl/users/assign/delete.php trunk/tpl/users/assign.php trunk/tpl/users/delete.php trunk/tpl/users/listusers.php trunk/tpl/users/modify.php Modified: trunk/default.css =================================================================== --- trunk/default.css 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/default.css 2008-02-28 09:13:41 UTC (rev 39) @@ -16,93 +16,104 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +body { + margin: 0px; + font-family: Arial, Helvetica, sans-serif; + background-color: rgb(255, 255, 204); + width: 100%; +} - body { margin: 0px; - font-family: Arial,Helvetica,sans-serif; - background-color: rgb(255, 255, 204); - width: 100%; - } +A:visited { + color: rgb(0, 0, 200); +} - A:visited { - color: rgb(0,0,200); - } - - A:link { - color: rgb(0,0,200); - } - - A:active { - color: rgb(200,0,0); - } +A:link { + color: rgb(0, 0, 200); +} - .header { padding: 5px; - background-color: rgb(255, 255, 153); - font-weight: bold; - font-size: large; - display: block; - width: 100%; - clear: both; - float: left; - } +A:active { + color: rgb(200, 0, 0); +} - .middle { padding: 5px; - float: left; - clear: both; - background-color: rgb(255, 255, 153); - display: block; - width: 100%; - } +.header { + padding: 5px; + background-color: rgb(255, 255, 153); + font-weight: bold; + font-size: large; + display: block; + width: 100%; + clear: both; + float: left; +} - .menu { padding-bottom: 5px; - padding-top: 5px; - clear: none; - font-size: small; - display: block; - border-style: solid; - border-width: 1px; - float: left; - width: 9%; - min-width: 5em; - border-color: rgb(60,60,60); - } +.middle { + padding: 5px; + float: left; + clear: both; + background-color: rgb(255, 255, 153); + display: block; + width: 100%; +} - .menu A { white-space: nowrap; - display: list-item; - list-style-position: outside; - list-style-type: square; - text-decoration: underline; - color: rgb(0,0,0); - } +.menu { + padding-bottom: 5px; + padding-top: 5px; + clear: none; + font-size: small; + display: block; + border-style: solid; + border-width: 1px; + float: left; + width: 9%; + min-width: 5em; + border-color: rgb(60, 60, 60); +} - .menu A:hover { color: rgb(200, 0, 0); - } +.menu A { + white-space: nowrap; + display: list-item; + list-style-position: outside; + list-style-type: square; + text-decoration: underline; + color: rgb(0, 0, 0); +} - .menu H3 { text-align: center; - margin: 0; - } +.menu A:hover { + color: rgb(200, 0, 0); +} - .insidemenu { margin: 5px 15px 5px 25px; - } - - .content { margin-left: 0.5%; - background-color: rgb(255, 255, 204); - display: block; - width: 89%; - float: left; - } +.menu H3 { + text-align: center; + margin: 0; +} - .insidecontent { margin: 5px; - } +.insidemenu { + margin: 5px 15px 5px 25px; +} - .location { font-size: small; - } +.content { + margin-left: 0.5%; + background-color: rgb(255, 255, 204); + display: block; + width: 89%; + float: left; +} - .footer { padding: 3px; - clear: both; - float: left; - width: 100%; - background-color: rgb(255, 255, 153); - text-align: right; - font-size: x-small; - display: block; - } +.insidecontent { + margin: 5px; +} + +.location { + font-size: small; +} + +.footer { + padding: 3px; + clear: both; + float: left; + width: 100%; + background-color: rgb(255, 255, 153); + text-align: right; + font-size: x-small; + display: block; +} \ No newline at end of file Modified: trunk/includes/security.php =================================================================== --- trunk/includes/security.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/includes/security.php 2008-02-28 09:13:41 UTC (rev 39) @@ -19,7 +19,7 @@ // Exit if user doesn't have sufficient rights function forbidden($msg='Forbidden.') { - print $msg; + print _($msg); exit; } // forbidden() Modified: trunk/modules/chmypw.php =================================================================== --- trunk/modules/chmypw.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/chmypw.php 2008-02-28 09:13:41 UTC (rev 39) @@ -23,14 +23,14 @@ */ -add_navigation_link('cambio password', +add_navigation_link(_("password change"), make_link(array ('mode'))); // If there is no password, ask for it if (empty ($status->data) || !check_scookie()) { create_scookie(); - $status->title = "Cambio Password"; - $status->message = "Inserire la nuova password per l'utente " . whoami(); + $status->title = _("Password change"); + $status->message = _("Insert new password for user ") . whoami(); $status->ask = true; $status->cancel_to = make_link(array('user')); $status->body = 'input'; @@ -41,11 +41,11 @@ // If there's a password, and scookie is ok if (changemypw(md5($status->data))) { - $status->title = "Operazione completata"; - $status->message = "La password è stata modificata."; + $status->title = _("Operation successful."); + $status->message = _("The password has been updated"); } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiornamento della password"; + $status->title = _("Error"); + $status->message = _("Error while updating password"); } $status->body = 'message'; Modified: trunk/modules/domain/add.php =================================================================== --- trunk/modules/domain/add.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/domain/add.php 2008-02-28 09:13:41 UTC (rev 39) @@ -18,7 +18,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -add_navigation_link('nuovo dominio', make_link('mode', 'op')); +add_navigation_link(_('new domain'), make_link('mode', 'op')); // If no domain or no destination have been specified, display // the add page @@ -29,8 +29,8 @@ // check if domain is valid if (!is_domain($status->data[0])) { - $status->title = "Errore"; - $status->message = "Il dominio '" . $status->data[1] . "' non è valido."; + $status->title = _("Error"); + $status->message = _("The domain '") . $status->data[1] . _("' is not valid"); unset ($status->data[0]); $status->body = 'message'; return; @@ -41,8 +41,8 @@ // check if default destination is empty or an invalid email if (!empty($status->data[1]) && !is_email($status->data[1])) { - $status->title = "Errore"; - $status->message = "La destinazione di default '" . $status->data[1] . "' non è un'email valida."; + $status->title = _("Error"); + $status->message = _("The default destination '") . $status->data[1] . _("' is not a valid email address"); unset ($status->data[1]); $status->body = 'message'; return; @@ -51,7 +51,7 @@ // check if domain already exists if (check_domain($status->data[0])) { $status->title = "Errore"; - $status->message = "Dominio gia esistente."; + $status->message = _("Domain already existing."); unset ($status->data[0]); $status->body = 'message'; return; @@ -59,11 +59,11 @@ // scookie ok, create the domain if (createDomain($status->data[0], $status->data[1])) { - $status->title = 'Operazione completata'; - $status->message = "Il dominio ".$status->data[0]." è stato creato."; + $status->title = _("Operation successful"); + $status->message = _("The domain ") .$status->data[0]._(" has been created."); } else { - $status->title = 'Errore'; - $status->message = "Errore durante la creazione del dominio ".$status->data[0]; + $status->title = _("Error"); + $status->message = _("Error while creating domain ").$status->data[0]; } $status->body = 'message'; Modified: trunk/modules/domain/delete.php =================================================================== --- trunk/modules/domain/delete.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/domain/delete.php 2008-02-28 09:13:41 UTC (rev 39) @@ -26,11 +26,11 @@ // scookie ok, delete the domain if (deleteDomain($status->domain)) { - $status->title = 'Operazione completata'; - $status->message = "Il dominio $status->domain è stato eliminato."; + $status->title = _("Operation successful"); + $status->message = _("The domain ") . $status->domain . _(" has been deleted"); } else { - $status->title = 'Errore'; - $status->message = "Errore durante la cancellazione del dominio $status->domain"; + $status->title = _("Error"); + $status->message = _("Error while deleting ") . $status->domain; } $status->body = 'message'; Modified: trunk/modules/domain/modify.php =================================================================== --- trunk/modules/domain/modify.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/domain/modify.php 2008-02-28 09:13:41 UTC (rev 39) @@ -20,8 +20,8 @@ // if no destination has been specified, ask for it if (!check_scookie()) { create_scookie(); - $status->message = "Inserire la nuova destinazione di default per il dominio $status->domain<br />". - "(lasciare il campo vuoto per eliminare la destinazione di default)"; + $status->message = _("Insert the new default destination for the domain ") . $status->domain . "<br />". + _("(leave the field empty to delete the default destination)"); $status->ask = true; $status->data[0] = $virtual_domains[$status->domain_id]['unknown_to']; if(is_administrator()) { $status->data[1] = $virtual_domains[$status->domain_id]['quota']; } @@ -36,7 +36,7 @@ // check if default destination is empty or a valid email if (!empty($status->data[0]) && !is_email($status->data[0])) { $status->title = "Errore"; - $status->message = "La destinazione di default '" . $status->data[0] . "' non è un'email valida."; + $status->message = _("The default destination '") . $status->data[0] . _("' is not a valid email address."); unset ($status->data); $status->body = 'message'; return; @@ -44,33 +44,33 @@ // If there's a new destination and scookie is ok if (updateDomain($status->domain, $status->data[0])) { - $status->title = "Operazione completata"; + $status->title = _("Operation successful"); if (empty($status->data[0])) { - $status->message = "La destinazione di default per il dominio $status->domain è stata rimossa. <br />"; + $status->message = _("The default destination for the domain ") . $status->domain . _(" has been removed") . "<br />"; } else { - $status->message = "La destinazione di default per il dominio $status->domain è stata modificata.<br />". - "La nuova destinazione è ". $status->data[0] . "<br />"; + $status->message = _("The default destination for the domain ") . $status->domain . _(" has been modified.") . "<br />". + _("The new destination is ") . $status->data[0] . "<br />"; } } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiornamento della destinazione per il dominio alias $status->domain"; + $status->title = _("Error"); + $status->message = _("Error while updating the default destination for the domain ") . $status->domain; } // If we are admin, update quota too if(is_administrator()) { if(set_global_quota($status->domain,$status->data[1])) { - $status->title = "Operazione completata"; + $status->title = _("Operation successful"); if(empty($status->data[1])) { - $status->message = "La quota per il dominio " . $status->domain . "è stata rimossa <br />"; + $status->message = _("The quota for the domain ") . $status->domain . _(" has been removed"). "<br />"; } else { - $status->message = "La quota per il dominio" . $status->domain . "è stata modificata a " . $status->data[1] . "<br />"; + $status->message = _("The quota for the domain ") . $status->domain . _(" has been modified to ") . $status->data[1] . "<br />"; } } else{ - $status->title = 'Errore'; - $status->message = "Errore durante la modifica della quota per il dominio " . $status->domain; + $status->title = _("Error"); + $status->message = _("Error while modifying quota for the domain ") . $status->domain; } } Modified: trunk/modules/domain.php =================================================================== --- trunk/modules/domain.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/domain.php 2008-02-28 09:13:41 UTC (rev 39) @@ -20,7 +20,7 @@ // Load virtual domains $virtual_domains = load_domain_list(); -add_navigation_link('gestione domini', +add_navigation_link('domain management', make_link(array ('mode')) . "&op=listdomains"); // If the specified domain doesn't exist, or user doesn't have rights, fall back to domain list Modified: trunk/modules/domainalias/add.php =================================================================== --- trunk/modules/domainalias/add.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/domainalias/add.php 2008-02-28 09:13:41 UTC (rev 39) @@ -18,7 +18,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -add_navigation_link('nuovo dominio alias', make_link('mode', 'op')); +add_navigation_link(_("new alias domain"), make_link('mode', 'op')); // If no domain or no destination have been specified, display // the add page @@ -29,8 +29,8 @@ // check if domain is valid if (!is_domain($status->data[0])) { - $status->title = "Errore"; - $status->message = "Il dominio '" . $status->data[1] . "' non è valido."; + $status->title = _("Error"); + $status->message = _("The domain '") . $status->data[1] . _("' is not valid."); unset ($status->data[0]); $status->body = 'message'; return; @@ -38,8 +38,8 @@ // check if default destination is valid if (!is_domain($status->data[1])) { - $status->title = "Errore"; - $status->message = "La destinazione '" . $status->data[1] . "' non è un dominio valido."; + $status->title = _("Error"); + $status->message = _("The destination '") . $status->data[1] . _("' is not a valid domain"); unset ($status->data[1]); $status->body = 'message'; return; @@ -47,8 +47,8 @@ // check if domain already exists if (check_domain($status->data[0])) { - $status->title = "Errore"; - $status->message = "Dominio gia esistente."; + $status->title = _("Error"); + $status->message = _("Already existing domain"); unset ($status->data[0]); $status->body = 'message'; return; @@ -56,11 +56,11 @@ // scookie ok, create the alias domain if (createAliasDomain($status->data[0], $status->data[1])) { - $status->title = 'Operazione completata'; - $status->message = "Il dominio alias ".$status->data[0]." è stato creato."; + $status->title = _("Operation successful"); + $status->message = _("The alias domain ") .$status->data[0]._(" has been created"); } else { - $status->title = 'Errore'; - $status->message = "Errore durante la creazione del dominio alias ".$status->data[0]; + $status->title = _("Error"); + $status->message = _("Error while creating the alias domain ") .$status->data[0]; } $status->body = 'message'; Modified: trunk/modules/domainalias/delete.php =================================================================== --- trunk/modules/domainalias/delete.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/domainalias/delete.php 2008-02-28 09:13:41 UTC (rev 39) @@ -26,11 +26,11 @@ // scookie ok, delete the alias domain if (deleteAliasDomain($status->domain)) { - $status->title = 'Operazione completata'; - $status->message = "Il dominio alias $status->domain è stato eliminato."; + $status->title = _("Operation successful"); + $status->message = _("The alias domain ") . $status->domain . _(" has been deleted."); } else { - $status->title = 'Errore'; - $status->message = "Errore durante la cancellazione del dominio alias $status->domain"; + $status->title = _("Error"); + $status->message = _("Error while deleting the alias domain ") . $status->domain; } $status->body = 'message'; Modified: trunk/modules/domainalias/modify.php =================================================================== --- trunk/modules/domainalias/modify.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/domainalias/modify.php 2008-02-28 09:13:41 UTC (rev 39) @@ -20,8 +20,8 @@ // if no destination has been specified, ask for it if (empty ($status->data) || !check_scookie()) { create_scookie(); - $status->title = "Modifica dominio alias"; - $status->message = "Inserire la nuova destinazione per il dominio alias $status->domain"; + $status->title = _("Modify alias domain"); + $status->message = _("Insert new destination for alias domain ") . $status->domain; $status->ask = true; $status->data = $alias_domains[$status->domain]; $status->cancel_to = make_link(array('mode')); @@ -31,8 +31,8 @@ // check if default destination is valid if (!is_domain($status->data)) { - $status->title = "Errore"; - $status->message = "La destinazione '" . $status->data . "' non è un dominio valido."; + $status->title = _("Error"); + $status->message = _("The destination '") . $status->data . _("' is not a valid domain."); unset ($status->data); $status->body = 'message'; return; @@ -41,12 +41,12 @@ // If there's a new destination and scookie is ok if (updateAliasDomain($status->domain, $status->data)) { - $status->title = "Operazione completata"; - $status->message = "La destinazione del dominio alias $status->domain è stata modificata.<br />". - "La nuova destinazione è $status->data"; + $status->title = _("Operation successful"); + $status->message = _("The default destination for alias domain ") . $status->domain . _(" has been modified.") . "<br />". + _("The new destination is ") . $status->data; } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiornamento della destinazione per il dominio alias $status->domain"; + $status->title = _("Error"); + $status->message = _("Error while updating the destination for the alias domain "). $status->domain; } $status->body = 'message'; Modified: trunk/modules/domainalias.php =================================================================== --- trunk/modules/domainalias.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/domainalias.php 2008-02-28 09:13:41 UTC (rev 39) @@ -19,7 +19,7 @@ $alias_domains = load_alias_domain_list(); -add_navigation_link('gestione domini alias', +add_navigation_link('alias domain management', make_link(array ('mode')) . "&op=listdomains"); // If specified domain doesn't exist or user doesn't have rights, fall back to domain list Modified: trunk/modules/email/add/local.php =================================================================== --- trunk/modules/email/add/local.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/add/local.php 2008-02-28 09:13:41 UTC (rev 39) @@ -19,8 +19,8 @@ // User tried to add postmaster as a local email!? if($status->user == 'postmaster') { - $status->title = 'Errore'; - $status->message = "Il nome 'postmaster' è riservato e non può essere usato per le email normali"; + $status->title = _("Error"); + $status->message = _("The name 'postmaster' is reserved and cannot be used for normal email addresses."); $status->body = 'message'; return; // No way } @@ -28,8 +28,8 @@ // If no password has been given, ask for it if (empty ($status->data) || !check_scookie()) { create_scookie(); - $status->title = "Creazione Mailbox"; - $status->message = "Inserire la nuova password per la mailbox locale $status->user@$status->domain"; + $status->title = _("Mailbox creation"); + $status->message = _("Insert the new password for the local mailbox ") . $status->user . "@" . $status->domain; $status->cancel_to = make_link(array('mode','domain','user','op')); $status->body = 'input'; return; @@ -37,11 +37,11 @@ // Password has been supplied, scookie is ok if (createMbox("$status->user@$status->domain", $status->data)) { - $status->title = "Operazione completata"; - $status->message = "È stata creata una mailbox locale per l'indirizzo $status->user@$status->domain"; + $status->title = _("Operation successful"); + $status->message = _("A new local mailbox has been created for the address ") . $status->user."@".$status->domain; } else { - $status->title = 'Errore'; - $status->message = "Errore durante la creazione della mailbox locale per l'indirizzo $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while creating the local mailbox for the email address ") . $status->user."@".$status->domain; } $status->body = 'message'; Modified: trunk/modules/email/add/newsletter.php =================================================================== --- trunk/modules/email/add/newsletter.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/add/newsletter.php 2008-02-28 09:13:41 UTC (rev 39) @@ -18,10 +18,10 @@ */ if($status->user == 'postmaster') { - $status->title = 'Errore'; - $status->message = "Il nome 'postmaster' è riservato e non può essere usato per le email normali"; + $status->title = _("Error"); + $status->message = _("The name 'postmaster' is reserved and cannot be used for normal email addresses."); $status->body = 'message'; - return; + return; // No way } // If no password has been given, ask for it @@ -36,11 +36,11 @@ // Password has been supplied, scookie is ok if (createNWL("$status->user@$status->domain", $status->data)) { - $status->title = "Operazione completata"; - $status->message = "È stata creata una newsletter sull'indirizzo $status->user@$status->domain"; + $status->title = _("Operation successful."); + $status->message = _("A newsletter has been created on the address ") . $status->user."@".$status->domain; } else { - $status->title = 'Errore'; - $status->message = "Errore durante la creazione della newsletter sull'indirizzo $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while creating a newsletter on the address ").$status->user."@".$status->domain; } $status->body = 'message'; Modified: trunk/modules/email/add/remote.php =================================================================== --- trunk/modules/email/add/remote.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/add/remote.php 2008-02-28 09:13:41 UTC (rev 39) @@ -18,8 +18,8 @@ */ if($status->user == 'postmaster') { - $status->title = 'Errore'; - $status->message = "Il nome 'postmaster' è riservato e non può essere usato per le email normali"; + $status->title = _("Error"); + $status->message = _("The name 'postmaster' is reserved and cannot be used for normal email addresses."); $status->body = 'message'; return; } @@ -27,8 +27,8 @@ // If no password has been given, ask for it if (empty ($status->data) || !check_scookie()) { create_scookie(); - $status->title = "Creazione Alias"; - $status->message = "Inserire la destinazione remota a cui spedire la posta di $status->user@$status->domain"; + $status->title = _("Alias creation"); + $status->message = _("Insert the mail destination for ").$status->user."@".$status->domain; $status->cancel_to = make_link(array('mode','domain','user','op')); $status->body = 'input'; return; @@ -39,27 +39,27 @@ // Return an error if destination is not a valid email if (!is_email($data)) { - $status->title = "Errore"; - $status->message = "La destinazione inserita non è un indirizzo e-mail valido."; + $status->title = _("Error"); + $status->message = _("The supplied destination is not a valid email address"); $status->body = 'message'; return; } // Return an error if the destination is the same as the alias if ($data == "$status->user@$status->domain" || $data == "$status->user@localdelivery.$status->domain") { - $status->title = "Errore"; - $status->message = "L'alias non può avere se stesso come destinazione."; + $status->title = _("Error"); + $status->message = _("The alias can't have itself as destination"); $status->body = 'message'; return; } // ok, create the alias if (createAlias("$status->user@$status->domain", $data)) { - $status->title = "Operazione completata"; - $status->message = "L'indirizzo $data è stato aggiunto alla lista dei destinatari per l'indirizzo $status->user@$status->domain"; + $status->title = _("Operation successful."); + $status->message = _("The address ") . $data . _(" has been added to the destination list of ").$status->user."@".$status->domain; } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiornamento dei destinatari per l'indirizzi $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while updating the destination list for ") . $status->user."@".$status->domain; } $status->body = 'message'; Modified: trunk/modules/email/add.php =================================================================== --- trunk/modules/email/add.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/add.php 2008-02-28 09:13:41 UTC (rev 39) @@ -29,8 +29,8 @@ // Check if user already exists if (isset ($emails[$status->user])) { - $status->title = "Errore"; - $status->message = "Indirizzo gia esistente."; + $status->title = _("Error"); + $status->message = _("Address already existing"); unset ($status->user); $status->body = 'message'; return; @@ -38,8 +38,8 @@ // check if user is valid if (!is_email("$status->user@$status->domain")) { - $status->title = "Errore"; - $status->message = "Il nome '" . $status->user . "' non è valido."; + $status->title = _("Error"); + $status->message = _("The name '") . $status->user . _("' is not valid."); unset ($status->user); $status->body = 'message'; } Modified: trunk/modules/email/delete.php =================================================================== --- trunk/modules/email/delete.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/delete.php 2008-02-28 09:13:41 UTC (rev 39) @@ -39,11 +39,11 @@ // scookie ok, delete the email if (deleteEmail("$status->user@$status->domain")) { - $status->title = 'Operazione completata'; - $status->message = "L'indirizzo $status->user@$status->domain è stato eliminato."; + $status->title = _("Operation successful."); + $status->message = _("The address ")."$status->user@$status->domain". _(" has been deleted."); } else { - $status->title = 'Errore'; - $status->message = "Errore durante la cancellazione dell'indirizzo $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while deleting address "). "$status->user@$status->domain"; } $status->body = 'message'; Modified: trunk/modules/email/deletenwl.php =================================================================== --- trunk/modules/email/deletenwl.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/deletenwl.php 2008-02-28 09:13:41 UTC (rev 39) @@ -39,11 +39,11 @@ // scookie ok, delete the email if (deleteNWL("$status->user@$status->domain")) { - $status->title = 'Operazione completata'; - $status->message = "La newsletter $status->user@$status->domain è stata svuotata ed eliminata."; + $status->title = _("Operation successful."); + $status->message = _("The newsletter "). "$status->user@$status->domain" . _(" has been emptied and deleted."); } else { - $status->title = 'Errore'; - $status->message = "Errore durante la cancellazione della newsletter $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while deleting the newsletter") . "$status->user@$status->domain"; } $status->body = 'message'; Modified: trunk/modules/email/modify/chnwlpw.php =================================================================== --- trunk/modules/email/modify/chnwlpw.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/modify/chnwlpw.php 2008-02-28 09:13:41 UTC (rev 39) @@ -20,8 +20,8 @@ // If no password has been given, ask for it if (empty ($status->data) || !check_scookie()) { create_scookie(); - $status->title = "Cambio Password"; - $status->message = "Inserire la nuova password per la newsletter $status->user@$status->domain"; + $status->title = _("Password change"); + $status->message = _("Insert the new password for the newsletter "). $status->user."@".$status->domain; $status->ask = true; $status->cancel_to = make_link(array('mode','domain','user','op')); $status->body = 'input'; @@ -30,11 +30,11 @@ // Password has been supplied, scookie is ok if (changeNWLPassword("$status->user@$status->domain", $status->data)) { - $status->title = "Operazione completata"; - $status->message = "La password dell indirizzo $status->user@$status->domain è stata modificata."; + $status->title = _("Operation successful."); + $status->message = _("The password for the newsletter ") . $status->user."@".$status->domain ." has been updated."; } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiornamento della password per l'indirizzo $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while updating the password for the newsletter ") . $status->user."@".$status->domain; } $status->body = 'message'; Modified: trunk/modules/email/modify/chpw.php =================================================================== --- trunk/modules/email/modify/chpw.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/modify/chpw.php 2008-02-28 09:13:41 UTC (rev 39) @@ -20,8 +20,8 @@ // If no password has been given, ask for it if (empty ($status->data) || !check_scookie()) { create_scookie(); - $status->title = "Cambio Password"; - $status->message = "Inserire la nuova password per la mailbox locale $status->user@$status->domain"; + $status->title = _("Password change"); + $status->message = _("Insert the new password for the local mailbox "). $status->user."@".$status->domain; $status->ask = true; $status->cancel_to = make_link(array('mode','domain','user','op')); $status->body = 'input'; @@ -30,11 +30,12 @@ // Password has been supplied, scookie is ok if (changePassword("$status->user@$status->domain", $status->data)) { - $status->title = "Operazione completata"; - $status->message = "La password dell indirizzo $status->user@$status->domain è stata modificata."; + $status->title = _("Operation successful."); + $status->message = _("The password for the address ") . $status->user."@".$status->domain ." has been updated."; } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiornamento della password per l'indirizzo $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while updating the password for the address ") . $status->user."@".$status->domain; + } $status->body = 'message'; Modified: trunk/modules/email/modify/chquota.php =================================================================== --- trunk/modules/email/modify/chquota.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/modify/chquota.php 2008-02-28 09:13:41 UTC (rev 39) @@ -25,8 +25,8 @@ if (empty ($status->data) || !check_scookie()) { create_scookie(); $status->data = $emails[$status->user]['quota_kb']; - $status->title = "Cambio quota"; - $status->message = "Inserire la nuova quota per la mailbox locale $status->user@$status->domain"; + $status->title = _("Quota change"); + $status->message = _("Insert the new quota for the local mailbox ") . $status->user."@".$status->domain; $status->ask = true; $status->cancel_to = make_link(array('mode','domain','user','op')); $status->body = 'input'; @@ -35,11 +35,11 @@ // Quota has been supplied, scookie is ok if (set_mail_quota("$status->user@$status->domain", $status->data)) { - $status->title = "Operazione completata"; - $status->message = "La quota dell indirizzo $status->user@$status->domain è stata modificata."; + $status->title = _("Operation successful."); + $status->message = _("The quota for the address ") . $status->user."@".$status->domain . _(" has been modified."); } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiornamento della quota per l'indirizzo $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while updating quota for address "). $status->user."@".$status->domain; } $status->body = 'message'; Modified: trunk/modules/email/modify/mkalias.php =================================================================== --- trunk/modules/email/modify/mkalias.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/modify/mkalias.php 2008-02-28 09:13:41 UTC (rev 39) @@ -19,24 +19,24 @@ // Check if destination looks like an email if (!is_email($status->data)) { - $status->title = "Errore"; - $status->message = "La destinazione inserita non è un indirizzo e-mail valido."; + $status->title = _("Error"); + $status->message = _("The supplied destination is not a valid e-mail address"); $status->body = 'message'; return; } // Check that destination != alias if ($status->data == "$status->user@$status->domain" || $status->data == "$status->user@localdelivery.$status->domain") { - $status->title = "Errore"; - $status->message = "L'alias non può avere se stesso come destinazione."; + $status->title = _("Error"); + $status->message = _("The alias can't have itself as destination"); $status->body = 'message'; return; } // Check email doesn't exist already if (preg_match("/\b$status->data\b/i", $emails[$status->user]['destination'])) { - $status->title = "Errore"; - $status->message = "L'alias inserito è gia presente."; + $status->title = _("Error"); + $status->message = _("The supplied address already exists"); $status->body = 'message'; return; } @@ -55,11 +55,11 @@ } if ($ok) { - $status->title = "Operazione completata"; - $status->message = "L'indirizzo $status->data è stato aggiunto alla lista dei destinatari per l'indirizzo $status->user@$status->domain"; + $status->title = _("Operation successful."); + $status->message = _("The address ") . $status->data . _(" has been added to the destination list for ") . $status->user."@".$status->domain; } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiornamento dei destinatari per l'indirizzi $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while updating the destination list for "). $status->user."@".$status->domain; } $status->body = 'message'; Modified: trunk/modules/email/modify/mkbox.php =================================================================== --- trunk/modules/email/modify/mkbox.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/modify/mkbox.php 2008-02-28 09:13:41 UTC (rev 39) @@ -20,8 +20,8 @@ // If no password has been given, ask for it if (empty ($status->data) || !check_scookie()) { create_scookie(); - $status->title = "Creazione Mailbox"; - $status->message = "Inserire la nuova password per la mailbox locale $status->user@$status->domain"; + $status->title = _("Mailbox creation"); + $status->message = _("Insert the new password for the local mailbox ") . $status->user ."@".$status->domain; $status->ask = true; $status->cancel_to = make_link(array('mode','domain','user','op')); $status->body = 'input'; @@ -35,11 +35,11 @@ $ok = false; if ($ok) { - $status->title = "Operazione completata"; - $status->message = "È stata creata una mailbox locale per l'indirizzo $status->user@$status->domain"; + $status->title = _("Operation successful."); + $status->message = _("A local mailbox has been created for the address ") . $status->user ."@". $status->domain; } else { - $status->title = 'Errore'; - $status->message = "Errore durante la creazione della mailbox locale per l'indirizzo $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while creating a local mailbox for the address "). $status->user."@".$status->domain; } $status->body = 'message'; Modified: trunk/modules/email/modify/rmalias.php =================================================================== --- trunk/modules/email/modify/rmalias.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/modify/rmalias.php 2008-02-28 09:13:41 UTC (rev 39) @@ -26,10 +26,10 @@ // If there's no scookie ask for confirmation if (!check_scookie()) { create_scookie(); - $status->title = "Attenzione"; - $status->message = "È stato richiesto di non consegnare più la posta indirizzata a " . - "$status->user@$status->domain all' indirizzo $status->data " . - "<br>\n<br>\n Si vuole procedere?<br>\n"; + $status->title = _("Warning"); + $status->message = _("It has been requested not to deliver anymore mail for "). + "$status->user@$status->domain". _(" to the address ") . $status->data . + "<br>\n<br>\n " ._("Do you want to proceed?")."<br>\n"; $status->ask = true; $status->body = 'message'; return; @@ -52,11 +52,11 @@ } if ($ok) { - $status->title = "Operazione completata"; - $status->message = "L'indirizzo $status->data è stato rimosso dalla lista dei destinatari per l'indirizzo $status->user@$status->domain"; + $status->title = _("Operation successful."); + $status->message = _("The address "). $status->data ._(" has been removed from the destinations of the address "). "$status->user@$status->domain"; } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiornamento dei destinatari per l'indirizzi $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while updating the destination list for "). "$status->user@$status->domain"; } $status->body = 'message'; Modified: trunk/modules/email/modify/rmbox.php =================================================================== --- trunk/modules/email/modify/rmbox.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/modify/rmbox.php 2008-02-28 09:13:41 UTC (rev 39) @@ -20,9 +20,9 @@ // If there is no scookie ask for confirmation if (!check_scookie()) { create_scookie(); - $status->title = "Attenzione"; - $status->message = "È stato richiesto di non memorizzare più localmente la posta indirizzata a $status->user@$status->domain" . - "<br>\n<br>\nQuesta operazione cancellerà tutti i messaggi attualmente presenti nella casella di posta.<br>\n<br>\nSi vuole procedere?<br>\n"; + $status->title = _("Warning"); + $status->message = _("It has been requested to no longer store the mail for ") . "$status->user@$status->domain" . + "<br>\n<br>\n". _("This operation will delete every message actually stored in the mailbox.")."<br>\n<br>\n"._("Do you want to proceed?")."<br>\n"; $status->ask = true; $status->body = 'message'; return; @@ -32,11 +32,11 @@ $ok = true; if (deleteMbox("$status->user@$status->domain")) { - $status->title = "Operazione completata"; - $status->message = "È stata eliminata la mailbox locale per l'indirizzo $status->user@$status->domain"; + $status->title = _("Operation successful."); + $status->message = _("The local mailbox has been deleted for the address ")."$status->user@$status->domain"; } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'eliminazione della mailbox locale per l'indirizzo $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while deleting local mailbox for address ")."$status->user@$status->domain"; } $status->body = 'message'; Modified: trunk/modules/email/modifynwl/chpw.php =================================================================== --- trunk/modules/email/modifynwl/chpw.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/modifynwl/chpw.php 2008-02-28 09:13:41 UTC (rev 39) @@ -20,8 +20,8 @@ // If no password has been given, ask for it if (empty ($status->data) || !check_scookie()) { create_scookie(); - $status->title = "Cambio Password"; - $status->message = "Inserire la nuova password per la newsletter $status->user@$status->domain"; + $status->title = _("Password change"); + $status->message = _("Insert the new password for te newsletter ")."$status->user@$status->domain"; $status->ask = true; $status->cancel_to = make_link(array('mode','domain','user','op')); $status->body = 'input'; @@ -30,11 +30,11 @@ // Password has been supplied, scookie is ok if (changeNWLPassword("$status->user@$status->domain", $status->data)) { - $status->title = "Operazione completata"; - $status->message = "La password della newsletter $status->user@$status->domain è stata modificata."; + $status->title = _("Operation successful."); + $status->message = _("The password for the newsletter "). "$status->user@$status->domain" . _(" has been updated."); } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiornamento della password per la newsletter $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while updating the password for the newsletter") . "$status->user@$status->domain"; } $status->body = 'message'; Modified: trunk/modules/email/modifynwl/del.php =================================================================== --- trunk/modules/email/modifynwl/del.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email/modifynwl/del.php 2008-02-28 09:13:41 UTC (rev 39) @@ -39,11 +39,11 @@ // scookie ok, delete the email if (deleteFromNWLEmail("$status->user@$status->domain","$status->subuser")) { - $status->title = 'Operazione completata'; - $status->message = "L'indirizzo $status->subuser è stato eliminato dalla newsletter $status->user@$status->domain ."; + $status->title = _("Operation successful."); + $status->message = _("The address ") . $status->subuser ._(" has been deleted from the newsletter "). "$status->user@$status->domain ."; } else { - $status->title = 'Errore'; - $status->message = "Errore durante la cancellazione dell'indirizzo $status->subuser dalla newsletter $status->user@$status->domain"; + $status->title = _("Error"); + $status->message = _("Error while deleting the address "). $status->subuser ._(" from the newsletter ")."$status->user@$status->domain"; } $status->body = 'message'; Modified: trunk/modules/email.php =================================================================== --- trunk/modules/email.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/email.php 2008-02-28 09:13:41 UTC (rev 39) @@ -19,7 +19,7 @@ $virtual_domains = load_domain_list(); -add_navigation_link('gestione e-mail', +add_navigation_link('e-mail management', make_link(array ('mode')) . "&op=listdomains"); // If specified domain doesn't exist or user doesn't have rights, fall back to domain list Modified: trunk/modules/users/add.php =================================================================== --- trunk/modules/users/add.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/users/add.php 2008-02-28 09:13:41 UTC (rev 39) @@ -28,15 +28,15 @@ // Check for a valid unix name if(!is_user($status->data[0])) { - $status->title = "Errore"; - $status->message = "L'utente inserito non è valido"; + $status->title = _("Error"); + $status->message = _("The supplied user is not valid"); $status->body = 'message'; return; } if(empty($status->data[3]) || empty($status->data[2])) { - $status->title = "Errore"; - $status->message = "La password non e' stata inserita correttamente"; + $status->title = _("Error"); + $status->message = _("The supplied password is not valid"); $status->body = 'message'; return; } @@ -44,8 +44,8 @@ // Check if user already exists if (isset ($users[$status->data[0]])) { - $status->title = "Errore"; - $status->message = "Utente gia esistente."; + $status->title = _("Error"); + $status->message = _("User already existing"); unset ($status->data[0]); $status->body = 'message'; return; @@ -57,8 +57,8 @@ // Check if passwords are equal if($status->data[2] != $status->data[3]) { - $status->title = "Errore"; - $status->message = "Le password inserite non sono uguali"; + $status->title = _("Error"); + $status->message = _("Supplied passwords don't match"); $status->body = 'message'; return; } @@ -78,11 +78,11 @@ // Finally create the user if(create_user($status->data[0],md5($status->data[2]),$status->data[1],$user_admin)){ - $status->title = "Operazione completata"; - $status->message = "È stato creato l'utente " . $status->data[0]; + $status->title = _("Operation successful."); + $status->message = _("Successfully created user ") . $status->data[0]; } else{ - $status->title = 'Errore'; - $status->message = "Errore durante la creazione dell'utente " . $status->data[0]; + $status->title = _("Error"); + $status->message = _("Error while creating user ") . $status->data[0]; } $status->body = 'message'; Modified: trunk/modules/users/aliassign/assign.php =================================================================== --- trunk/modules/users/aliassign/assign.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/users/aliassign/assign.php 2008-02-28 09:13:41 UTC (rev 39) @@ -33,11 +33,11 @@ // If user is ok, assign the domain to him if (assign_alias_domain($status->user,$status->data)) { - $status->title = 'Operazione completata'; - $status->message = "Il dominio alias $status->data è stato aggiunto all'utente $status->user."; + $status->title = _("Operation successful."); + $status->message = _("The alias domain ") . $status->data . _("has been added to user "). "$status->user."; } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiunta del dominio alias $status->data dall'utente $status->user"; + $status->title = _("Error"); + $status->message = _("Error while adding the alias domain ") . $status->data ."to user ". $status->user; } $status->body = 'message'; Modified: trunk/modules/users/aliassign/delete.php =================================================================== --- trunk/modules/users/aliassign/delete.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/users/aliassign/delete.php 2008-02-28 09:13:41 UTC (rev 39) @@ -39,11 +39,11 @@ // scookie ok, unassign domain if (unassign_alias_domain($status->user,$status->domain)) { - $status->title = 'Operazione completata'; - $status->message = "Il dominio alias $status->domain è stato eliminato dall'utente $status->user."; + $status->title = _("Operation successful."); + $status->message = _("The alias domain ") . $status->domain . _(" has been deleted from the user "). $status->user; } else { - $status->title = 'Errore'; - $status->message = "Errore durante la cancellazione del dominio alias $status->domain dall'utente $status->user"; + $status->title = _("Error"); + $status->message = _("Error while deleting the alias domain "). $status->domain ._(" from the user"). $status->user; } $status->body = 'message'; Modified: trunk/modules/users/assign/assign.php =================================================================== --- trunk/modules/users/assign/assign.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/users/assign/assign.php 2008-02-28 09:13:41 UTC (rev 39) @@ -33,11 +33,11 @@ // If user is ok, assign the domain to him if (assign_domain($status->user,$status->data)) { - $status->title = 'Operazione completata'; - $status->message = "Il dominio $status->data è stato aggiunto all'utente $status->user."; + $status->title = _("Operation successful."); + $status->message = _("The domain ") . $status->data . _("has been added to user "). "$status->user."; } else { - $status->title = 'Errore'; - $status->message = "Errore durante l'aggiunta del dominio $status->data dall'utente $status->user"; + $status->title = _("Error"); + $status->message = _("Error while adding the domain ") . $status->data ."to user ". $status->user; } $status->body = 'message'; Modified: trunk/modules/users/assign/delete.php =================================================================== --- trunk/modules/users/assign/delete.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/users/assign/delete.php 2008-02-28 09:13:41 UTC (rev 39) @@ -39,11 +39,11 @@ // scookie ok, unassign domain if (unassign_domain($status->user,$status->domain)) { - $status->title = 'Operazione completata'; - $status->message = "Il dominio $status->domain è stato eliminato dall'utente $status->user."; + $status->title = _("Operation successful."); + $status->message = _("The domain ") . $status->domain . _(" has been deleted from the user "). $status->user; } else { - $status->title = 'Errore'; - $status->message = "Errore durante la cancellazione del dominio $status->domain dall'utente $status->user"; + $status->title = _("Error"); + $status->message = _("Error while deleting the domain "). $status->domain ._(" from the user"). $status->user; } $status->body = 'message'; Modified: trunk/modules/users/delete.php =================================================================== --- trunk/modules/users/delete.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/users/delete.php 2008-02-28 09:13:41 UTC (rev 39) @@ -38,11 +38,11 @@ // scookie ok, delete the user if (delete_user("$status->user")) { - $status->title = 'Operazione completata'; - $status->message = "L'utente $status->user è stato eliminato."; + $status->title = _("Operation successful."); + $status->message = _("The user ") . $status->user. _(" has been deleted"); } else { - $status->title = 'Errore'; - $status->message = "Errore durante la cancellazione dell'utente $status->user"; + $status->title = _("Error"); + $status->message = _("Error while deleting user ") . $status->user; } $status->body = 'message'; Modified: trunk/modules/users/modify.php =================================================================== --- trunk/modules/users/modify.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/users/modify.php 2008-02-28 09:13:41 UTC (rev 39) @@ -39,8 +39,8 @@ // Password has not been specified correctly if ( (empty($status->data[3]) && !empty($status->data[2])) || (!empty($status->data[3]) && empty($status->data[2])) ) { - $status->title = "Errore"; - $status->message = "La password non e' stata inserita correttamente"; + $status->title = _("Error"); + $status->message = _("Supplied password is not valid"); $status->body = 'message'; return; } @@ -53,8 +53,8 @@ // Check if passwords are equal if($status->data[2] != $status->data[3]) { - $status->title = "Errore"; - $status->message = "Le password inserite non sono uguali"; + $status->title = _("Error"); + $status->message = _("Supplied passwords don't match"); $status->body = 'message'; return; } @@ -75,21 +75,21 @@ if(!empty($status->data[3]) && !empty($status->data[2])) { // Password has to be changed if(update_user($status->user, $status->data[1],$user_admin,$status->data[2])) { - $status->title = "Operazione completata"; - $status->message = "È stato modificato l'utente " . $status->user; + $status->title = _("Operation successful."); + $status->message = _("Successfully updated user ") . $status->user; } else{ - $status->title = 'Errore'; - $status->message = "Errore durante la modifica dell'utente " . $status->user; + $status->title = _("Error"); + $status->message = _("Error while updating user ") . $status->user; } } else { // No need to change password if(update_user($status->user,$status->data[1],$user_admin)) { - $status->title = "Operazione completata"; - $status->message = "È stato modificato l'utente " . $status->user; + $status->title = _("Operation successful."); + $status->message = _("Successfully updated user ") . $status->user; } else{ - $status->title = 'Errore'; - $status->message = "Errore durante la modifica dell'utente " . $status->user; + $status->title = _("Error"); + $status->message = _("Error while updating user ") . $status->user; } } Modified: trunk/modules/users.php =================================================================== --- trunk/modules/users.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/modules/users.php 2008-02-28 09:13:41 UTC (rev 39) @@ -19,7 +19,7 @@ $users = load_users(); -add_navigation_link('gestione utenti', +add_navigation_link('user management', make_link(array ('mode')) . "&op=listusers"); switch ($status->op) { Modified: trunk/nwadmin/.project =================================================================== --- trunk/nwadmin/.project 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/nwadmin/.project 2008-02-28 09:13:41 UTC (rev 39) @@ -2,13 +2,11 @@ <projectDescription> <name>nwadmin</name> <comment></comment> - <projects> - </projects> + <projects></projects> <buildSpec> <buildCommand> <name>net.sourceforge.phpeclipse.parserbuilder</name> - <arguments> - </arguments> + <arguments></arguments> </buildCommand> </buildSpec> <natures> Modified: trunk/nwadmin/config.php =================================================================== --- trunk/nwadmin/config.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/nwadmin/config.php 2008-02-28 09:13:41 UTC (rev 39) @@ -19,7 +19,7 @@ // If the script invoked by the browser has the same name of the real file if (isset($_SERVER['SCRIPT_FILENAME']) && (__FILE__ == $_SERVER['SCRIPT_FILENAME'])) { - exit('Accesso diretto non consentito') ; // Die brutally (invoked script should always be index.php) + exit(_("Direct access not allowed")) ; // Die brutally (invoked script should always be index.php) } Modified: trunk/nwadmin/default.css =================================================================== --- trunk/nwadmin/default.css 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/nwadmin/default.css 2008-02-28 09:13:41 UTC (rev 39) @@ -16,93 +16,104 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +body { + margin: 0px; + font-family: Arial, Helvetica, sans-serif; + background-color: rgb(255, 255, 204); + width: 100%; +} - body { margin: 0px; - font-family: Arial,Helvetica,sans-serif; - background-color: rgb(255, 255, 204); - width: 100%; - } +A:visited { + color: rgb(0, 0, 200); +} - A:visited { - color: rgb(0,0,200); - } - - A:link { - color: rgb(0,0,200); - } - - A:active { - color: rgb(200,0,0); - } +A:link { + color: rgb(0, 0, 200); +} - .header { padding: 5px; - background-color: rgb(255, 255, 153); - font-weight: bold; - font-size: large; - display: block; - width: 100%; - clear: both; - float: left; - } +A:active { + color: rgb(200, 0, 0); +} - .middle { padding: 5px; - float: left; - clear: both; - background-color: rgb(255, 255, 153); - display: block; - width: 100%; - } +.header { + padding: 5px; + background-color: rgb(255, 255, 153); + font-weight: bold; + font-size: large; + display: block; + width: 100%; + clear: both; + float: left; +} - .menu { padding-bottom: 5px; - padding-top: 5px; - clear: none; - font-size: small; - display: block; - border-style: solid; - border-width: 1px; - float: left; - width: 9%; - min-width: 5em; - border-color: rgb(60,60,60); - } +.middle { + padding: 5px; + float: left; + clear: both; + background-color: rgb(255, 255, 153); + display: block; + width: 100%; +} - .menu A { white-space: nowrap; - display: list-item; - list-style-position: outside; - list-style-type: square; - text-decoration: underline; - color: rgb(0,0,0); - } +.menu { + padding-bottom: 5px; + padding-top: 5px; + clear: none; + font-size: small; + display: block; + border-style: solid; + border-width: 1px; + float: left; + width: 9%; + min-width: 5em; + border-color: rgb(60, 60, 60); +} - .menu A:hover { color: rgb(200, 0, 0); - } +.menu A { + white-space: nowrap; + display: list-item; + list-style-position: outside; + list-style-type: square; + text-decoration: underline; + color: rgb(0, 0, 0); +} - .menu H3 { text-align: center; - margin: 0; - } +.menu A:hover { + color: rgb(200, 0, 0); +} - .insidemenu { margin: 5px 15px 5px 25px; - } - - .content { margin-left: 0.5%; - background-color: rgb(255, 255, 204); - display: block; - width: 89%; - float: left; - } +.menu H3 { + text-align: center; + margin: 0; +} - .insidecontent { margin: 5px; - } +.insidemenu { + margin: 5px 15px 5px 25px; +} - .location { font-size: small; - } +.content { + margin-left: 0.5%; + background-color: rgb(255, 255, 204); + display: block; + width: 89%; + float: left; +} - .footer { padding: 3px; - clear: both; - float: left; - width: 100%; - background-color: rgb(255, 255, 153); - text-align: right; - font-size: x-small; - display: block; - } +.insidecontent { + margin: 5px; +} + +.location { + font-size: small; +} + +.footer { + padding: 3px; + clear: both; + float: left; + width: 100%; + background-color: rgb(255, 255, 153); + text-align: right; + font-size: x-small; + display: block; +} \ No newline at end of file Modified: trunk/nwadmin/delete.php =================================================================== --- trunk/nwadmin/delete.php 2008-02-26 10:43:27 UTC (rev 38) +++ trunk/nwadmin/delete.php 2008-02-28 09:13:41 UTC (rev 39) @@ -19,7 +19,7 @@ // If the script invoked by the browser has the same name of the real file if (isset($_SERVER['SCRIPT_FILENAME']) && (__FILE__ == $_SERVER['SCRIPT_FILENAME'])) { - exit('Accesso diretto non consentito') ; // Die brutally (invoked script should always be index.php) + exit(_("Direct access not allowed")) ; // Die brutally (invoked script should always be index.php) } // Store the mail id into a local variable Modified: trunk/nwadmin/index.php =================================================================== --- tr... [truncated message content] |
From: <ag...@us...> - 2008-02-26 10:43:22
|
Revision: 38 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=38&view=rev Author: agrassi Date: 2008-02-26 02:43:27 -0800 (Tue, 26 Feb 2008) Log Message: ----------- Merged CREDITS into INSTALL Modified Paths: -------------- trunk/doc/INSTALL Removed Paths: ------------- trunk/doc/CREDITS Deleted: trunk/doc/CREDITS =================================================================== --- trunk/doc/CREDITS 2008-02-26 10:07:25 UTC (rev 37) +++ trunk/doc/CREDITS 2008-02-26 10:43:27 UTC (rev 38) @@ -1,14 +0,0 @@ - - ~~~~ PANDA Credits ~~~~~ - - Panda was initially created as a stub by Marco Nenciarini, and developed - by Alessandro Grassi with some help from Marco - - We thank grafica-web.it for having sponsored our project til the first release - - - Contacts: - - Alessandro Grassi <ale...@gr...> (xstasi @ irc.freenode.org) - Marco Nenciarini <mn...@gr...> (mnencia @ irc.freenode.org) - \ No newline at end of file Modified: trunk/doc/INSTALL =================================================================== --- trunk/doc/INSTALL 2008-02-26 10:07:25 UTC (rev 37) +++ trunk/doc/INSTALL 2008-02-26 10:43:27 UTC (rev 38) @@ -1,81 +1,549 @@ - ~~~~~ PANDA Installation Procedure ~~~~~ + + PaNDA Web Administrator installation howto + + +Table of contents: + +1. About PaNDA +2. Having a PaNDA-compliant system +2.1 PostgreSQL +2.2 Postfix +2.3 Dovecot +2.4 ClamAV +2.5 Amavisd-new +3. Installing PaNDA +4. Anything else +5. Copyright and Credits + + + + + +1. ~~~~~~~~~~ About PaNDA ~~~~~~~~~~ + +PaNDA is a tool for the management of email domains, email addresses and newsletters. +It is thought with security, ease and lightweightness in mind. + +The project started as a replacement for the Qmail/qpopmail/whatnot system, +but i'm not telling you this. + + + + +2. ~~~~~~~~~~ Having a PaNDA-compliant system ~~~~~~~~~~ + +You can use a single server, or separate machines. +In the following howto, we will use different servers running Debian etch. +We will use vmail/vpass as DB user/pass, "dbserver" as DB server, and /srv/vmail as mailbox base. + +We recommend using both Debian's volatile repository, and our dovecot repository, which hosts +newer stable releases of Dovecot, with managesieve patch already included, gently packaged and +maintained by Marco Nenciarini. +You can have more informations on this by checking out our home page: http://panda-admin.sourceforge.net + + +First of all, we need the following packages on the mail server: + + # apt-get install dovecot-{imapd,pop3d} postfix postfix-{pcre,pgsql} + +If we want antispam/antivirus support, we should install these too: + + # apt-get install amavisd-new spamassassin clamav clamav-daemon lha arj unrar zoo lzop cabextract unzip libdbd-pg-perl + +Install the PostgreSQL DBMS on the DB server: + + # apt-get install postgresql-8.1 + +Install apache2 and the required modules on the webserver: + + # apt-get install apache2-mpm-prefork apache2 libapache2-mod-php5 php-db php-mail php-mail-mime php-net-smtp php-pear php5-pgsql + +Once the system is ready with all the packages installed, we set up the mail system. + +On our mailserver, we should create the UID/GID couple for dovecot, like this: + # adduser --system --home /srv/vmail --group vmail +Remember the UID and GID it prints, because you will need them in the near future. + +If you make use of the newsletter feature, you should also install the newsletter handler: + # cp panda-x.y/setup/bin/newsletter /srv/vmail/bin/ + # cp panda-x.y/setup/bin/newsletter.conf /srv/vmail/etc + +You may need to edit newsletter and newsletter.conf to suit your needs. + +Done with the preparations, we can go on and configure our engines + + + +2.1 ~~~~~~~~~~ PostgreSQL ~~~~~~~~~~ + + +First of all, if the database is on a separate machine, we need to tell him to listen to the network interface too: + + # vi /etc/postgresql/8.1/main/pg_hba.conf + +Under this line: + host all all 127.0.0.1/32 md5 +We should add a line such as: + host all all 192.168.99.0/24 md5 + + +Then, we edit the main configuration: + + # vi /etc/postgresql/8.1/main/postgresql.conf + +And add the following line: + listen_addresses = 'localhost,192.168.99.16' + +After PG is configured, we have to prepare it to be used by PaNDA: +Here we assume to have PaNDA's SQL scripts in /tmp/sql + + # su - postgres + $ createuser vmail + $ createdb -O vmail vmail + $ createlang plpgsql vmail + $ psql + =# ALTER ROLE vmail WITH PASSWORD 'vpass' INHERIT LOGIN; + =# \q + $ cd /tmp/sql + $ psql -h localhost -U vmail vmail + => \i create.sql + => \i functions.sql + => \i users.sql + => \q + +Now Postgres is ready. + + +2.2 ~~~~~~~~~~ Postfix ~~~~~~~~~~ + +We need to tell postfix where the virtual users and domains are. +For this, we will enable a few stuff, and then we will create a few database files with SQL instructions, +and tell postfix what-is-what. + +First to be enabled are regexps: + # vi /etc/postfix/dynamicmaps.cf +Add the following: + pcre /usr/lib/postfix/dict_pcre.so dict_pcre_open + + +Then we edit main.cf + # vi /etc/postfix/main.cf +And tell him where to look up domains and all + + # Alias domains and mailboxes + virtual_alias_domains = proxy:pgsql:/etc/postfix/sql/virtual_alias_domains.pg + virtual_alias_maps = proxy:pgsql:/etc/postfix/sql/virtual_alias_maps.pg + + # Real mailboxes and transports + virtual_mailbox_domains = proxy:pgsql:/etc/postfix/sql/virtual_mailbox_domains.pg + transport_maps = proxy:pgsql:/etc/postfix/sql/transport.pg + + # Dovecot relays mail, not postfix + virtual_transport = dovecot + + # Without this, CC/Bcc won't work + dovecot_destination_recipient_limit = 1 + +If we use amavisd, add this too: + + content_filter = smtp-amavis:[127.0.0.1]:10024 + + +Done this, we edit master.cf + # vi /etc/postfix/master.cf +And add the following: + + submission inet n - - - - smtpd + -o smtpd_enforce_tls=yes + -o smtpd_sasl_auth_enable=yes + -o smtpd_client_restrictions=permit_sasl_authenticated,reject + -o cleanup_service_name=pre-cleanup + dovecot unix - n n - - pipe + flags=ORhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -n -m ${extension} + pre-cleanup unix n - - - 0 cleanup + -o virtual_alias_maps= + -o canonical_maps= + -o sender_canonical_maps= + -o recipient_canonical_maps= + -o masquerade_domains= + + # Panda newsletters + newsletter unix - n n - - pipe + flags= user=vmail argv=/srv/vmail/bin/newsletter + ${sender} ${recipient} + + +If we use amavisd, add this too: + + smtp-amavis unix - - n - 4 lmtp + -o lmtp_data_done_timeout=1200 + -o lmtp_send_xforward_command=yes + -o disable_dns_lookups=yes + -o max_use=20 + + 127.0.0.1:10025 inet n - n - - smtpd + -o content_filter= + -o local_recipient_maps= + -o relay_recipient_maps= + -o smtpd_restriction_classes= + -o smtpd_delay_reject=no + -o smtpd_client_restrictions=permit_mynetworks,reject + -o smtpd_helo_restrictions= + -o smtpd_sender_restrictions= + -o smtpd_recipient_restrictions=permit_mynetworks,reject + -o smtpd_data_restrictions=reject_unauth_pipelining + -o smtpd_end_of_data_restrictions= + -o mynetworks=127.0.0.0/8 + -o smtpd_error_sleep_time=0 + -o smtpd_soft_error_limit=1001 + -o smtpd_hard_error_limit=1000 + -o smtpd_client_connection_count_limit=0 + -o smtpd_client_connection_rate_limit=0 + -o strict_rfc821_envelopes=yes + -o smtpd_authorized_xforward_hosts=127.0.0.0/8 + -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks + +Done with postfix' main configuration, we create the scripts that postfix has to use for lookups: +Every file must contain the DB informations, like this: + +hosts = dbserver +dbname = vmail +user = vmail +password = vmpass + +We fill all the files with these lines, and the needed query: + +---- /etc/postfix/sql/transport.pg +query = SELECT 'newsletter:' FROM newsletter_maps WHERE id = get_nwl_id('%s'); + +hosts = dbserver +dbname = vmail +user = vmail +password = vmpass # I will omit this part from now on + +---- /etc/postfix/sql/virtual_alias_maps.pg +query = SELECT '@'||destination FROM alias_domains WHERE ('@'||name) = '%s' + UNION + SELECT unknown_to FROM virtual_domains + WHERE ('@'||name) = '%s' AND have_default_delivery('%s') AND NOT deleted + UNION + SELECT COALESCE( + u.name||'@localdelivery.%d'||' '||destination, + destination, + u.name||'@localdelivery.%d' + ) + FROM virtual_domain_users AS u NATURAL FULL JOIN virtual_domain_aliases AS a + WHERE id_domain = get_id_domain('%d') AND name = extract_user('%s') + UNION + SELECT name||'@transportdelivery.%d' FROM newsletter_maps + WHERE id_domain = get_id_domain('%d') AND name = extract_user('%s'); + +---- /etc/postfix/sql/virtual_mailbox_domains.pg +query = SELECT 'DUMMY_IGNORED'::text FROM virtual_domains + WHERE ('localdelivery.'||name) = '%s' AND NOT deleted + +---- /etc/postfix/sql/virtual_mailbox_maps.pg +query = SELECT maildir FROM virtual_domain_users + WHERE id_domain = get_id_domain_local('%d') AND name = '%u'; + + +---- + + +We should now be able to safely shut down and restart postfix + # /etc/init.d/postfix restart + + +2.5 ~~~~~~~~~~ Amavisd-new ~~~~~~~~~~ + +For amavis to run correctly, it should be enough to add the following lines to /etc/amavis/conf.d/50-user, before the 1: + +# Enable spam and virus checks +@bypass_spam_checks_maps = ( + \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re); +@bypass_virus_checks_maps = ( + \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re); + +# Make spam go anyway into inbox, although marked +$final_spam_destiny = D_PASS; + +# Send scanned mail back to postfix +$forward_method = 'smtp:127.0.0.1:10025'; + +# local domain list +@lookup_sql_dsn = ( + ['DBI:Pg:database=vmail;host=localhost;port=5432','vmail','vmpass'], + ); + +$sql_select_policy = "SELECT 1 FROM virtual_domains WHERE NOT deleted AND '\@'||name IN (\%k)"; + +## Don't send mail +undef($virus_admin); + +That's it. + +2.3 ~~~~~~~~~~ Dovecot ~~~~~~~~~~ + +We need to tell Dovecot that the authentication system we use is on SQL, and what should he ask to Postgres to have +what he needs. +All is made with the following steps.... + + +/etc/dovecot/dovecot-sql.conf should look like this: + + driver = pgsql + connect = host=dbserver dbname=vmail user=vmail password=vmpass + default_pass_scheme = CRYPT + password_query = SELECT '.dovecot.sieve' AS sieve, 123 AS userdb_uid, 321 AS userdb_gid, name AS user, passwd AS password, + '/srv/vmail/domains/'||maildir as userdb_home, 'maildir:/srv/vmail/domains/'||maildir||'/Maildir' as userdb_mail, + 'maildir:storage='||quota_kb AS userdb_quota FROM virtual_domain_users WHERE name = '%n' AND id_domain = get_id_domain('%d') + +Dovecot needs a separate instance for the local delivery, so we copy dovecot-sql.conf to dovecot-sql-lda.conf, +and use these password/user_query fields: + + user_query = SELECT '.dovecot.sieve' AS sieve, 123 as uid, 321 as gid, '/srv/vmail/domains/'||maildir as home, + 'maildir:/srv/vmail/domains/'||maildir||'/Maildir' as mail, 'maildir:storage='||quota_kb as quota from virtual_domain_users + where name = '%n' and id_domain = get_id_domain('%14.d') + + password_query = SELECT '.dovecot.sieve' AS sieve, 123 AS userdb_uid, 321 AS userdb_gid, name AS user, passwd AS password, + '/srv/vmail/domains/'||maildir as userdb_home, 'maildir:/srv/vmail/domains/'||maildir||'/Maildir' as userdb_mail, + 'maildir:storage='||quota_kb AS userdb_quota FROM virtual_domain_users WHERE name = '%n' AND id_domain = get_id_domain('%14.d') + +Please note that in the above lines, uid is 123 and gid is 321, remind to adjust those numbers to your case (remember when i said to remember UID/GID?). +Also, be aware that SQL queries have to be written in just one line, so, even if I've written them in separate lines for the sake of readability, +you should join them in a single one. + +Now that the definition files are ready, we configure dovecot to use them. +Edit /etc/dovecot/dovecot.conf this way: + +Change + protocols = + listen = +To + protocols = imap imaps pop3 pop3s managesieve + listen = * + +And add the following lines, adjusting them to your needs: + + syslog_facility = mail + + ssl_disable = no + ssl_cert_file = /etc/ssl/certs/dovecot.pem + ssl_key_file = /etc/ssl/private/dovecot.pem + ssl_cipher_list = ALL:!LOW + verbose_ssl = no + + login_chroot = yes + login_user = dovecot + login_process_size = 64 + login_greeting = Foo Bar mail daemon ready. + + mail_location = maildir:/srv/mail/domains/ + + first_valid_uid = 123 # Insert vmail's uid/gid + last_valid_uid = 123 # + first_valid_gid = 321 # + last_valid_gid = 321 # + + maildir_stat_dirs = yes + + protocol managesieve { + listen = *:2000 + login_executable = /usr/lib/dovecot/managesieve-login + mail_executable = /usr/lib/dovecot/managesieve + sieve=~/.dovecot.sieve + sieve_storage=~/sieve + } + +< Under protocol imap {} > + + login_executable = /usr/lib/dovecot/imap-login + mail_executable = /usr/lib/dovecot/imap + mail_plugins = quota imap_quota + mail_plugin_dir = /usr/lib/dovecot/modules/imap +</> + +< Under protocol pop3 {} > + + login_executable = /usr/lib/dovecot/pop3-login + mail_executable = /usr/lib/dovecot/pop3 + mail_plugins = quota + mail_plugin_dir = /usr/lib/dovecot/modules/pop3 +</> + protocol lda { + postmaster_address = postmaster@yourdomain.xy + hostname = your.host.name + mail_plugins = quota cmusieve + mail_plugin_dir = /usr/lib/dovecot/modules/lda + auth_socket_path = /var/run/dovecot/auth-master-rewrite + } + + auth_executable = /usr/lib/dovecot/dovecot-auth + +< Under auth default {} > + Change + mechanisms = plain + To + mechanisms = plain login + + Delete or comment out + passdb pam {} + userdb passwd {} + + + passdb sql { + args = /etc/dovecot/dovecot-sql.conf + } + userdb prefetch { + } + + socket listen { + master { + path = /var/run/dovecot/auth-master + mode = 0600 + user = vmail + group = vmail + } + } +</> + + auth postfix { + + mechanisms = plain login + + userdb prefetch { + } + + passdb sql { + args = /etc/dovecot/dovecot-sql.conf + } + + socket listen { + client { + path = /var/spool/postfix/private/auth + mode = 0660 + + user = postfix + group = postfix + } + } + } + + auth other_with_listener { + userdb sql { + args = /etc/dovecot/dovecot-sql-lda.conf + } + passdb sql { + args = /etc/dovecot/dovecot-sql-lda.conf + } + user = root + + socket listen { + master { + path = /var/run/dovecot/auth-master-rewrite + mode = 0600 + user = vmail + group = vmail + } + } + } + +< Under plugin {} > + + quota = maildir + + + +This should be the end of dovecot configuration. + +2.4 ~~~~~~~~~~ ClamAV ~~~~~~~~~~ + +Clamav is quite easy to configure, but to make him live in symbiosis with amavis, you have to tweak a few settings +First file to edit: + /etc/clamav/clamd.conf +Change + User clamav +To + User amavis + +Delete the "NodalCoreAcceleration" line, if present + +Add the following lines: + + PhishingScanURLs true + PhishingRestrictedScan true + PhishingAlwaysBlockSSLMismatch false + PhishingAlwaysBlockCloak false + DetectPUA false +(Mind that these only work if you're using debian's volatile repository, or anyway lastest clamav version) +End of clamd.conf +Other file to edit: + /etc/clamav/freshclam.conf +Add the following lines: + LogTime false + User amavis + +This should be all with ClamAV + + +3. ~~~~~~~~~~ Installing PaNDA ~~~~~~~~~~ + +Once your mail system is ready, we can set up the GUI on the webserver. +This is a very easy task, all you need to do is unpacking the .tar.gz into your website. +We assume that PaNDA is being installed under /panda + + # cd /srv/www/mysite.com + # tar zxvf ~/panda-x.y.tar.gz + # cd panda + # vi config.php + +In config.php, we need to configure a few settings. +DSN is the Database connection string, in form: + psql://user:pass@dbserver:port/database +Which, in a standard installation, with the data we've used before, would be: + psql://vmail:vpass@dbserver:5432/vmail + +EMAIL_PER_PAGE sets how many email address per page are to be displayed under the mail management + +DOMAIN_ONLY_FIRST_LETTER is just a matter of taste. +If you like to see your domains sorted like a -> c (dictionary like), set this to TRUE +Otherwise, if you would like to have more detailed links (alpha.net -> charlie.biz), set this to FALSE + +DOMAIN_SEPARATOR is again a matter of taste. Normally the default (->) is ok + +MAIL_FROM is the address your newsletter subscription mails will come from, and +SMTP_HOST is the smarthost to be used for sending mails + +If you make use of the newsletters feature, mind configuring nwadmin/config.php, which has similar options. + +After you're done configuring panda, you can login on yoursite.com/panda (or where you've installed it) with admin/admin (default user/pass), +change them, create new users, add domains, and do whatever you like + + +4. ~~~~~~~~~~ Anything else... ~~~~~~~~~~ + +PaNDA comes with a very nice daemon, vmaild. +Whenever a new email is created, it creates the directory tree, sets up default anti-spam filter, sets up permissions and so on. +We recommend you to install it (say on /srv/vmail/bin/vmaild) and use the shipped init.d script + # cp vmaild-init.d /etc/init.d/vmaild + # cd /etc/rc2.d + # ln -s ../init.d/vmaild S80vmaild + + +5. ~~~~~~~~~~ Copyright and Credits ~~~~~~~~~~ + +PaNDA is distributed under the GNU General Public License, so you can do what you want with it, as long as you respect the GPL terms. + +PaNDA was initially created as a stub by Marco Nenciarini, and developed +by Alessandro Grassi with some help from Marco +We thank grafica-web.it for having sponsored our project til the first release - 1- General requirements for optimal work: + Contacts: - - Postfix (we use 2.3.8) - - PostgreSQL (8.1 or higher) - - Apache (we use 2.2, 1.x should work though) - - PHP5 - - Dovecot (We use 1.0, ATM 1.1 is not out, beware that you may encounter problems with it, since it changes a lot) - - AMAVIS (We use 2.4.2) - - 2- Apache/PHP5 requirements - - You should make sure that there is a working php5 environment in your apache, and that the - following mods are included: - - - php-pear - - php-db - - php-mail - - php-mail-mime - - php-net-smtp - - php5-pgsql - - 3- Installation (Web) - - PANDA is designed to be installed under any path, so feel free to do it - Copy the whole panda/ directory somewhere in your web space (e.g. /, reachable via /panda) - Please remember that setup/ is not necessary for daily usage, it only contains installation-related - files and contrib scripts, so you can (and should) delete it after install is complete - - - 4- Installation (DB) - - You should create an user and a database for panda, and also enable the 'plpgsql' language for that database. - Instructions on how to do it follow (assuming shell access is provided, platform used in examples is Debian): - - # su - postgres - $ createuser vmail - $ createdb -O vmail vmail - $ createlang plpgsql vmail - $ psql vmail - vmail=# ALTER ROLE vmail WITH PASSWORD 'vmailpass'; - - After the database is ready for setup, we can load the SQL dumps: - - $ cd /wherever/panda/setup/sql/ - $ psql -h localhost -U vmail vmail - vmail=> \i create.sql - vmail=> \i functions.sql - vmail=> \i users.sql - - Whenever you want to destroy all data in the DB, you can use drop.sql - If it gives you warnings about plpgsql language, be sure to have created it - - - 5- Installation (System) - - A few scripts are provided, here follows a list with description: - - - vmaild -- It checks once in a while for new mailboxes and changes in the DB, and - prepares the environment for them (ATM only premade anti-spam filters). + Alessandro Grassi <ale...@gr...> (xstasi @ irc.freenode.org) + Marco Nenciarini <mn...@gr...> (mnencia @ irc.freenode.org) - - vmaild-init.d -- Script for automatic vmaild launching (needs to be configured) - e.g.: # cp vmaild-init.d /etc/init.d/vmaild - # cd /etc/rc2.d - # ln -s ../init.d/vmaild S80vmaild - - - newsletter -- This script is meant to be the destination for newsletter addresses. - it simply takes mails and puts them in the DB, for further moderation - Please remember to modify newsletter.conf and install it in the same directory - - - 6- Memo - - - Once installed, PANDA is accessible from the web with credentials admin/admin (it is **HIGHLY** recommended - that you change them at first run) - - \ No newline at end of file + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2008-02-26 10:07:21
|
Revision: 37 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=37&view=rev Author: agrassi Date: 2008-02-26 02:07:25 -0800 (Tue, 26 Feb 2008) Log Message: ----------- Added newsletter administration support, nwadmin link made dynamic, made config.php more generic Modified Paths: -------------- trunk/config.php trunk/tpl/header.php Added Paths: ----------- trunk/nwadmin/ trunk/nwadmin/.project trunk/nwadmin/backend/ trunk/nwadmin/backend/classes/ trunk/nwadmin/backend/classes/HTMLSax3/ trunk/nwadmin/backend/classes/HTMLSax3/Decorators.php trunk/nwadmin/backend/classes/HTMLSax3/States.php trunk/nwadmin/backend/classes/HTMLSax3.php trunk/nwadmin/backend/classes/safehtml.php trunk/nwadmin/backend/functions.php trunk/nwadmin/backend/license.txt trunk/nwadmin/backend/readme.txt trunk/nwadmin/backend/safehtml.php trunk/nwadmin/config.php trunk/nwadmin/default.css trunk/nwadmin/delete.php trunk/nwadmin/index.php trunk/nwadmin/listmails.php trunk/nwadmin/login.php trunk/nwadmin/logout.php trunk/nwadmin/moderation.php trunk/nwadmin/send.php trunk/nwadmin/static/ trunk/nwadmin/static/footer.php trunk/nwadmin/static/header.php Modified: trunk/config.php =================================================================== --- trunk/config.php 2008-01-21 17:23:04 UTC (rev 36) +++ trunk/config.php 2008-02-26 10:07:25 UTC (rev 37) @@ -19,7 +19,7 @@ */ // Database connection string -define('DSN', 'pgsql://vmail:vmail@localhost:5432/vmail'); +define('DSN', 'pgsql://vmail:vpass@dbserver:5432/vmail'); // How many emails are to be displayed in the lists? define('EMAIL_PER_PAGE', 20); Added: trunk/nwadmin/.project =================================================================== --- trunk/nwadmin/.project (rev 0) +++ trunk/nwadmin/.project 2008-02-26 10:07:25 UTC (rev 37) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>nwadmin</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>net.sourceforge.phpeclipse.parserbuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>net.sourceforge.phpeclipse.phpnature</nature> + </natures> +</projectDescription> Property changes on: trunk/nwadmin/.project ___________________________________________________________________ Name: svn:mime-type + text/plain Added: trunk/nwadmin/backend/classes/HTMLSax3/Decorators.php =================================================================== --- trunk/nwadmin/backend/classes/HTMLSax3/Decorators.php (rev 0) +++ trunk/nwadmin/backend/classes/HTMLSax3/Decorators.php 2008-02-26 10:07:25 UTC (rev 37) @@ -0,0 +1,363 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +// +// +----------------------------------------------------------------------+ +// | PHP Version 4 | +// +----------------------------------------------------------------------+ +// | Copyright (c) 1997-2002 The PHP Group | +// +----------------------------------------------------------------------+ +// | This source file is subject to version 2.02 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/3_0.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | li...@ph... so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// | Authors: Alexander Zhukov <al...@ve...> Original port from Python | +// | Authors: Harry Fuecks <hf...@ph...> Port to PEAR + more | +// | Authors: Many @ Sitepointforums Advanced PHP Forums | +// +----------------------------------------------------------------------+ +// +// $Id: Decorators.php,v 1.1 2004/06/02 14:09:19 hfuecks Exp $ +// +/** +* Decorators for dealing with parser options +* @package XML_HTMLSax3 +* @version $Id: Decorators.php,v 1.1 2004/06/02 14:09:19 hfuecks Exp $ +* @see XML_HTMLSax3::set_option +*/ +/** +* Trims the contents of element data from whitespace at start and end +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_Trim { + /** + * Original handler object + * @var object + * @access private + */ + var $orig_obj; + /** + * Original handler method + * @var string + * @access private + */ + var $orig_method; + /** + * Constructs XML_HTMLSax3_Trim + * @param object handler object being decorated + * @param string original handler method + * @access protected + */ + function XML_HTMLSax3_Trim(&$orig_obj, $orig_method) { + $this->orig_obj =& $orig_obj; + $this->orig_method = $orig_method; + } + /** + * Trims the data + * @param XML_HTMLSax3 + * @param string element data + * @access protected + */ + function trimData(&$parser, $data) { + $data = trim($data); + if ($data != '') { + $this->orig_obj->{$this->orig_method}($parser, $data); + } + } +} +/** +* Coverts tag names to upper case +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_CaseFolding { + /** + * Original handler object + * @var object + * @access private + */ + var $orig_obj; + /** + * Original open handler method + * @var string + * @access private + */ + var $orig_open_method; + /** + * Original close handler method + * @var string + * @access private + */ + var $orig_close_method; + /** + * Constructs XML_HTMLSax3_CaseFolding + * @param object handler object being decorated + * @param string original open handler method + * @param string original close handler method + * @access protected + */ + function XML_HTMLSax3_CaseFolding(&$orig_obj, $orig_open_method, $orig_close_method) { + $this->orig_obj =& $orig_obj; + $this->orig_open_method = $orig_open_method; + $this->orig_close_method = $orig_close_method; + } + /** + * Folds up open tag callbacks + * @param XML_HTMLSax3 + * @param string tag name + * @param array tag attributes + * @access protected + */ + function foldOpen(&$parser, $tag, $attrs=array(), $empty = FALSE) { + $this->orig_obj->{$this->orig_open_method}($parser, strtoupper($tag), $attrs, $empty); + } + /** + * Folds up close tag callbacks + * @param XML_HTMLSax3 + * @param string tag name + * @access protected + */ + function foldClose(&$parser, $tag, $empty = FALSE) { + $this->orig_obj->{$this->orig_close_method}($parser, strtoupper($tag), $empty); + } +} +/** +* Breaks up data by linefeed characters, resulting in additional +* calls to the data handler +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_Linefeed { + /** + * Original handler object + * @var object + * @access private + */ + var $orig_obj; + /** + * Original handler method + * @var string + * @access private + */ + var $orig_method; + /** + * Constructs XML_HTMLSax3_LineFeed + * @param object handler object being decorated + * @param string original handler method + * @access protected + */ + function XML_HTMLSax3_LineFeed(&$orig_obj, $orig_method) { + $this->orig_obj =& $orig_obj; + $this->orig_method = $orig_method; + } + /** + * Breaks the data up by linefeeds + * @param XML_HTMLSax3 + * @param string element data + * @access protected + */ + function breakData(&$parser, $data) { + $data = explode("\n",$data); + foreach ( $data as $chunk ) { + $this->orig_obj->{$this->orig_method}($parser, $chunk); + } + } +} +/** +* Breaks up data by tab characters, resulting in additional +* calls to the data handler +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_Tab { + /** + * Original handler object + * @var object + * @access private + */ + var $orig_obj; + /** + * Original handler method + * @var string + * @access private + */ + var $orig_method; + /** + * Constructs XML_HTMLSax3_Tab + * @param object handler object being decorated + * @param string original handler method + * @access protected + */ + function XML_HTMLSax3_Tab(&$orig_obj, $orig_method) { + $this->orig_obj =& $orig_obj; + $this->orig_method = $orig_method; + } + /** + * Breaks the data up by linefeeds + * @param XML_HTMLSax3 + * @param string element data + * @access protected + */ + function breakData(&$parser, $data) { + $data = explode("\t",$data); + foreach ( $data as $chunk ) { + $this->orig_obj->{$this->orig_method}($this, $chunk); + } + } +} +/** +* Breaks up data by XML entities and parses them with html_entity_decode(), +* resulting in additional calls to the data handler<br /> +* Requires PHP 4.3.0+ +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_Entities_Parsed { + /** + * Original handler object + * @var object + * @access private + */ + var $orig_obj; + /** + * Original handler method + * @var string + * @access private + */ + var $orig_method; + /** + * Constructs XML_HTMLSax3_Entities_Parsed + * @param object handler object being decorated + * @param string original handler method + * @access protected + */ + function XML_HTMLSax3_Entities_Parsed(&$orig_obj, $orig_method) { + $this->orig_obj =& $orig_obj; + $this->orig_method = $orig_method; + } + /** + * Breaks the data up by XML entities + * @param XML_HTMLSax3 + * @param string element data + * @access protected + */ + function breakData(&$parser, $data) { + $data = preg_split('/(&.+?;)/',$data,-1,PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + foreach ( $data as $chunk ) { + $chunk = html_entity_decode($chunk,ENT_NOQUOTES); + $this->orig_obj->{$this->orig_method}($this, $chunk); + } + } +} +/** +* Compatibility with older PHP versions +*/ +if (version_compare(phpversion(), '4.3', '<') && !function_exists('html_entity_decode') ) { + function html_entity_decode($str, $style=ENT_NOQUOTES) { + return strtr($str, + array_flip(get_html_translation_table(HTML_ENTITIES,$style))); + } +} +/** +* Breaks up data by XML entities but leaves them unparsed, +* resulting in additional calls to the data handler<br /> +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_Entities_Unparsed { + /** + * Original handler object + * @var object + * @access private + */ + var $orig_obj; + /** + * Original handler method + * @var string + * @access private + */ + var $orig_method; + /** + * Constructs XML_HTMLSax3_Entities_Unparsed + * @param object handler object being decorated + * @param string original handler method + * @access protected + */ + function XML_HTMLSax3_Entities_Unparsed(&$orig_obj, $orig_method) { + $this->orig_obj =& $orig_obj; + $this->orig_method = $orig_method; + } + /** + * Breaks the data up by XML entities + * @param XML_HTMLSax3 + * @param string element data + * @access protected + */ + function breakData(&$parser, $data) { + $data = preg_split('/(&.+?;)/',$data,-1,PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + foreach ( $data as $chunk ) { + $this->orig_obj->{$this->orig_method}($this, $chunk); + } + } +} + +/** +* Strips the HTML comment markers or CDATA sections from an escape. +* If XML_OPTIONS_FULL_ESCAPES is on, this decorator is not used.<br /> +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_Escape_Stripper { + /** + * Original handler object + * @var object + * @access private + */ + var $orig_obj; + /** + * Original handler method + * @var string + * @access private + */ + var $orig_method; + /** + * Constructs XML_HTMLSax3_Entities_Unparsed + * @param object handler object being decorated + * @param string original handler method + * @access protected + */ + function XML_HTMLSax3_Escape_Stripper(&$orig_obj, $orig_method) { + $this->orig_obj =& $orig_obj; + $this->orig_method = $orig_method; + } + /** + * Breaks the data up by XML entities + * @param XML_HTMLSax3 + * @param string element data + * @access protected + */ + function strip(&$parser, $data) { + // Check for HTML comments first + if ( substr($data,0,2) == '--' ) { + $patterns = array( + '/^\-\-/', // Opening comment: -- + '/\-\-$/', // Closing comment: -- + ); + $data = preg_replace($patterns,'',$data); + + // Check for XML CDATA sections (note: don't do both!) + } else if ( substr($data,0,1) == '[' ) { + $patterns = array( + '/^\[.*CDATA.*\[/s', // Opening CDATA + '/\].*\]$/s', // Closing CDATA + ); + $data = preg_replace($patterns,'',$data); + } + + $this->orig_obj->{$this->orig_method}($this, $data); + } +} +?> \ No newline at end of file Added: trunk/nwadmin/backend/classes/HTMLSax3/States.php =================================================================== --- trunk/nwadmin/backend/classes/HTMLSax3/States.php (rev 0) +++ trunk/nwadmin/backend/classes/HTMLSax3/States.php 2008-02-26 10:07:25 UTC (rev 37) @@ -0,0 +1,287 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +// +// +----------------------------------------------------------------------+ +// | PHP Version 4 | +// +----------------------------------------------------------------------+ +// | Copyright (c) 1997-2002 The PHP Group | +// +----------------------------------------------------------------------+ +// | This source file is subject to version 2.02 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/3_0.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | li...@ph... so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// | Authors: Alexander Zhukov <al...@ve...> Original port from Python | +// | Authors: Harry Fuecks <hf...@ph...> Port to PEAR + more | +// | Authors: Many @ Sitepointforums Advanced PHP Forums | +// +----------------------------------------------------------------------+ +// +// $Id: States.php,v 1.2 2004/06/02 14:22:40 hfuecks Exp $ +// +/** +* Parsing states. +* @package XML_HTMLSax3 +* @version $Id: States.php,v 1.2 2004/06/02 14:22:40 hfuecks Exp $ +*/ +/** +* Define parser states +*/ +define('XML_HTMLSAX3_STATE_STOP', 0); +define('XML_HTMLSAX3_STATE_START', 1); +define('XML_HTMLSAX3_STATE_TAG', 2); +define('XML_HTMLSAX3_STATE_OPENING_TAG', 3); +define('XML_HTMLSAX3_STATE_CLOSING_TAG', 4); +define('XML_HTMLSAX3_STATE_ESCAPE', 6); +define('XML_HTMLSAX3_STATE_JASP', 7); +define('XML_HTMLSAX3_STATE_PI', 8); +/** +* StartingState searches for the start of any XML tag +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_StartingState { + /** + * @param XML_HTMLSax3_StateParser subclass + * @return constant XML_HTMLSAX3_STATE_TAG + * @access protected + */ + function parse(&$context) { + $data = $context->scanUntilString('<'); + if ($data != '') { + $context->handler_object_data-> + {$context->handler_method_data}($context->htmlsax, $data); + } + $context->IgnoreCharacter(); + return XML_HTMLSAX3_STATE_TAG; + } +} +/** +* Decides which state to move one from after StartingState +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_TagState { + /** + * @param XML_HTMLSax3_StateParser subclass + * @return constant the next state to move into + * @access protected + */ + function parse(&$context) { + switch($context->ScanCharacter()) { + case '/': + return XML_HTMLSAX3_STATE_CLOSING_TAG; + break; + case '?': + return XML_HTMLSAX3_STATE_PI; + break; + case '%': + return XML_HTMLSAX3_STATE_JASP; + break; + case '!': + return XML_HTMLSAX3_STATE_ESCAPE; + break; + default: + $context->unscanCharacter(); + return XML_HTMLSAX3_STATE_OPENING_TAG; + } + } +} +/** +* Dealing with closing XML tags +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_ClosingTagState { + /** + * @param XML_HTMLSax3_StateParser subclass + * @return constant XML_HTMLSAX3_STATE_START + * @access protected + */ + function parse(&$context) { + $tag = $context->scanUntilCharacters('/>'); + if ($tag != '') { + $char = $context->scanCharacter(); + if ($char == '/') { + $char = $context->scanCharacter(); + if ($char != '>') { + $context->unscanCharacter(); + } + } + $context->handler_object_element-> + {$context->handler_method_closing}($context->htmlsax, $tag, FALSE); + } + return XML_HTMLSAX3_STATE_START; + } +} +/** +* Dealing with opening XML tags +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_OpeningTagState { + /** + * Handles attributes + * @param string attribute name + * @param string attribute value + * @return void + * @access protected + * @see XML_HTMLSax3_AttributeStartState + */ + function parseAttributes(&$context) { + $Attributes = array(); + + $context->ignoreWhitespace(); + $attributename = $context->scanUntilCharacters("=/> \n\r\t"); + while ($attributename != '') { + $attributevalue = NULL; + $context->ignoreWhitespace(); + $char = $context->scanCharacter(); + if ($char == '=') { + $context->ignoreWhitespace(); + $char = $context->ScanCharacter(); + if ($char == '"') { + $attributevalue= $context->scanUntilString('"'); + $context->IgnoreCharacter(); + } else if ($char == "'") { + $attributevalue = $context->scanUntilString("'"); + $context->IgnoreCharacter(); + } else { + $context->unscanCharacter(); + $attributevalue = + $context->scanUntilCharacters("> \n\r\t"); + } + } else if ($char !== NULL) { + $attributevalue = NULL; + $context->unscanCharacter(); + } + $Attributes[$attributename] = $attributevalue; + + $context->ignoreWhitespace(); + $attributename = $context->scanUntilCharacters("=/> \n\r\t"); + } + return $Attributes; + } + + /** + * @param XML_HTMLSax3_StateParser subclass + * @return constant XML_HTMLSAX3_STATE_START + * @access protected + */ + function parse(&$context) { + $tag = $context->scanUntilCharacters("/> \n\r\t"); + if ($tag != '') { + $this->attrs = array(); + $Attributes = $this->parseAttributes($context); + $char = $context->scanCharacter(); + if ($char == '/') { + $char = $context->scanCharacter(); + if ($char != '>') { + $context->unscanCharacter(); + } + $context->handler_object_element-> + {$context->handler_method_opening}($context->htmlsax, $tag, + $Attributes, TRUE); + $context->handler_object_element-> + {$context->handler_method_closing}($context->htmlsax, $tag, + TRUE); + } else { + $context->handler_object_element-> + {$context->handler_method_opening}($context->htmlsax, $tag, + $Attributes, FALSE); + } + } + return XML_HTMLSAX3_STATE_START; + } +} + +/** +* Deals with XML escapes handling comments and CDATA correctly +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_EscapeState { + /** + * @param XML_HTMLSax3_StateParser subclass + * @return constant XML_HTMLSAX3_STATE_START + * @access protected + */ + function parse(&$context) { + $char = $context->ScanCharacter(); + if ($char == '-') { + $char = $context->ScanCharacter(); + if ($char == '-') { + $context->unscanCharacter(); + $context->unscanCharacter(); + $text = $context->scanUntilString('-->'); + $text .= $context->scanCharacter(); + $text .= $context->scanCharacter(); + } else { + $context->unscanCharacter(); + $text = $context->scanUntilString('>'); + } + } else if ( $char == '[') { + $context->unscanCharacter(); + $text = $context->scanUntilString(']>'); + $text.= $context->scanCharacter(); + } else { + $context->unscanCharacter(); + $text = $context->scanUntilString('>'); + } + + $context->IgnoreCharacter(); + if ($text != '') { + $context->handler_object_escape-> + {$context->handler_method_escape}($context->htmlsax, $text); + } + return XML_HTMLSAX3_STATE_START; + } +} +/** +* Deals with JASP/ASP markup +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_JaspState { + /** + * @param XML_HTMLSax3_StateParser subclass + * @return constant XML_HTMLSAX3_STATE_START + * @access protected + */ + function parse(&$context) { + $text = $context->scanUntilString('%>'); + if ($text != '') { + $context->handler_object_jasp-> + {$context->handler_method_jasp}($context->htmlsax, $text); + } + $context->IgnoreCharacter(); + $context->IgnoreCharacter(); + return XML_HTMLSAX3_STATE_START; + } +} +/** +* Deals with XML processing instructions +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_PiState { + /** + * @param XML_HTMLSax3_StateParser subclass + * @return constant XML_HTMLSAX3_STATE_START + * @access protected + */ + function parse(&$context) { + $target = $context->scanUntilCharacters(" \n\r\t"); + $data = $context->scanUntilString('?>'); + if ($data != '') { + $context->handler_object_pi-> + {$context->handler_method_pi}($context->htmlsax, $target, $data); + } + $context->IgnoreCharacter(); + $context->IgnoreCharacter(); + return XML_HTMLSAX3_STATE_START; + } +} +?> \ No newline at end of file Added: trunk/nwadmin/backend/classes/HTMLSax3.php =================================================================== --- trunk/nwadmin/backend/classes/HTMLSax3.php (rev 0) +++ trunk/nwadmin/backend/classes/HTMLSax3.php 2008-02-26 10:07:25 UTC (rev 37) @@ -0,0 +1,687 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +// +// +----------------------------------------------------------------------+ +// | PHP Version 4 | +// +----------------------------------------------------------------------+ +// | Copyright (c) 1997-2002 The PHP Group | +// +----------------------------------------------------------------------+ +// | This source file is subject to version 2.02 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/3_0.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | li...@ph... so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// | Authors: Alexander Zhukov <al...@ve...> Original port from Python | +// | Authors: Harry Fuecks <hf...@ph...> Port to PEAR + more | +// | Authors: Many @ Sitepointforums Advanced PHP Forums | +// +----------------------------------------------------------------------+ +// +// $Id: HTMLSax3.php,v 1.1 2004/06/02 14:09:19 hfuecks Exp $ +// +/** +* Main parser components +* @package XML_HTMLSax3 +* @version $Id: HTMLSax3.php,v 1.1 2004/06/02 14:09:19 hfuecks Exp $ +*/ +/** +* Required classes +*/ +if (!defined('XML_HTMLSAX3')) { + define('XML_HTMLSAX3', 'XML/'); +} +require_once(XML_HTMLSAX3 . 'HTMLSax3/States.php'); +require_once(XML_HTMLSAX3 . 'HTMLSax3/Decorators.php'); + +/** +* Base State Parser +* @package XML_HTMLSax3 +* @access protected +* @abstract +*/ +class XML_HTMLSax3_StateParser { + /** + * Instance of user front end class to be passed to callbacks + * @var XML_HTMLSax3 + * @access private + */ + var $htmlsax; + /** + * User defined object for handling elements + * @var object + * @access private + */ + var $handler_object_element; + /** + * User defined open tag handler method + * @var string + * @access private + */ + var $handler_method_opening; + /** + * User defined close tag handler method + * @var string + * @access private + */ + var $handler_method_closing; + /** + * User defined object for handling data in elements + * @var object + * @access private + */ + var $handler_object_data; + /** + * User defined data handler method + * @var string + * @access private + */ + var $handler_method_data; + /** + * User defined object for handling processing instructions + * @var object + * @access private + */ + var $handler_object_pi; + /** + * User defined processing instruction handler method + * @var string + * @access private + */ + var $handler_method_pi; + /** + * User defined object for handling JSP/ASP tags + * @var object + * @access private + */ + var $handler_object_jasp; + /** + * User defined JSP/ASP handler method + * @var string + * @access private + */ + var $handler_method_jasp; + /** + * User defined object for handling XML escapes + * @var object + * @access private + */ + var $handler_object_escape; + /** + * User defined XML escape handler method + * @var string + * @access private + */ + var $handler_method_escape; + /** + * User defined handler object or NullHandler + * @var object + * @access private + */ + var $handler_default; + /** + * Parser options determining parsing behavior + * @var array + * @access private + */ + var $parser_options = array(); + /** + * XML document being parsed + * @var string + * @access private + */ + var $rawtext; + /** + * Position in XML document relative to start (0) + * @var int + * @access private + */ + var $position; + /** + * Length of the XML document in characters + * @var int + * @access private + */ + var $length; + /** + * Array of state objects + * @var array + * @access private + */ + var $State = array(); + + /** + * Constructs XML_HTMLSax3_StateParser setting up states + * @var XML_HTMLSax3 instance of user front end class + * @access protected + */ + function XML_HTMLSax3_StateParser (& $htmlsax) { + $this->htmlsax = & $htmlsax; + $this->State[XML_HTMLSAX3_STATE_START] =& new XML_HTMLSax3_StartingState(); + + $this->State[XML_HTMLSAX3_STATE_CLOSING_TAG] =& new XML_HTMLSax3_ClosingTagState(); + $this->State[XML_HTMLSAX3_STATE_TAG] =& new XML_HTMLSax3_TagState(); + $this->State[XML_HTMLSAX3_STATE_OPENING_TAG] =& new XML_HTMLSax3_OpeningTagState(); + + $this->State[XML_HTMLSAX3_STATE_PI] =& new XML_HTMLSax3_PiState(); + $this->State[XML_HTMLSAX3_STATE_JASP] =& new XML_HTMLSax3_JaspState(); + $this->State[XML_HTMLSAX3_STATE_ESCAPE] =& new XML_HTMLSax3_EscapeState(); + } + + /** + * Moves the position back one character + * @access protected + * @return void + */ + function unscanCharacter() { + $this->position -= 1; + } + + /** + * Moves the position forward one character + * @access protected + * @return void + */ + function ignoreCharacter() { + $this->position += 1; + } + + /** + * Returns the next character from the XML document or void if at end + * @access protected + * @return mixed + */ + function scanCharacter() { + if ($this->position < $this->length) { + return $this->rawtext{$this->position++}; + } + } + + /** + * Returns a string from the current position to the next occurance + * of the supplied string + * @param string string to search until + * @access protected + * @return string + */ + function scanUntilString($string) { + $start = $this->position; + $this->position = strpos($this->rawtext, $string, $start); + if ($this->position === FALSE) { + $this->position = $this->length; + } + return substr($this->rawtext, $start, $this->position - $start); + } + + /** + * Returns a string from the current position until the first instance of + * one of the characters in the supplied string argument + * @param string string to search until + * @access protected + * @return string + * @abstract + */ + function scanUntilCharacters($string) {} + + /** + * Moves the position forward past any whitespace characters + * @access protected + * @return void + * @abstract + */ + function ignoreWhitespace() {} + + /** + * Begins the parsing operation, setting up any decorators, depending on + * parse options invoking _parse() to execute parsing + * @param string XML document to parse + * @access protected + * @return void + */ + function parse($data) { + if ($this->parser_options['XML_OPTION_TRIM_DATA_NODES']==1) { + $decorator =& new XML_HTMLSax3_Trim( + $this->handler_object_data, + $this->handler_method_data); + $this->handler_object_data =& $decorator; + $this->handler_method_data = 'trimData'; + } + if ($this->parser_options['XML_OPTION_CASE_FOLDING']==1) { + $open_decor =& new XML_HTMLSax3_CaseFolding( + $this->handler_object_element, + $this->handler_method_opening, + $this->handler_method_closing); + $this->handler_object_element =& $open_decor; + $this->handler_method_opening ='foldOpen'; + $this->handler_method_closing ='foldClose'; + } + if ($this->parser_options['XML_OPTION_LINEFEED_BREAK']==1) { + $decorator =& new XML_HTMLSax3_Linefeed( + $this->handler_object_data, + $this->handler_method_data); + $this->handler_object_data =& $decorator; + $this->handler_method_data = 'breakData'; + } + if ($this->parser_options['XML_OPTION_TAB_BREAK']==1) { + $decorator =& new XML_HTMLSax3_Tab( + $this->handler_object_data, + $this->handler_method_data); + $this->handler_object_data =& $decorator; + $this->handler_method_data = 'breakData'; + } + if ($this->parser_options['XML_OPTION_ENTITIES_UNPARSED']==1) { + $decorator =& new XML_HTMLSax3_Entities_Unparsed( + $this->handler_object_data, + $this->handler_method_data); + $this->handler_object_data =& $decorator; + $this->handler_method_data = 'breakData'; + } + if ($this->parser_options['XML_OPTION_ENTITIES_PARSED']==1) { + $decorator =& new XML_HTMLSax3_Entities_Parsed( + $this->handler_object_data, + $this->handler_method_data); + $this->handler_object_data =& $decorator; + $this->handler_method_data = 'breakData'; + } + // Note switched on by default + if ($this->parser_options['XML_OPTION_STRIP_ESCAPES']==1) { + $decorator =& new XML_HTMLSax3_Escape_Stripper( + $this->handler_object_escape, + $this->handler_method_escape); + $this->handler_object_escape =& $decorator; + $this->handler_method_escape = 'strip'; + } + $this->rawtext = $data; + $this->length = strlen($data); + $this->position = 0; + $this->_parse(); + } + + /** + * Performs the parsing itself, delegating calls to a specific parser + * state + * @param constant state object to parse with + * @access protected + * @return void + */ + function _parse($state = XML_HTMLSAX3_STATE_START) { + do { + $state = $this->State[$state]->parse($this); + } while ($state != XML_HTMLSAX3_STATE_STOP && + $this->position < $this->length); + } +} + +/** +* Parser for PHP Versions below 4.3.0. Uses a slower parsing mechanism than +* the equivalent PHP 4.3.0+ subclass of StateParser +* @package XML_HTMLSax3 +* @access protected +* @see XML_HTMLSax3_StateParser_Gtet430 +*/ +class XML_HTMLSax3_StateParser_Lt430 extends XML_HTMLSax3_StateParser { + /** + * Constructs XML_HTMLSax3_StateParser_Lt430 defining available + * parser options + * @var XML_HTMLSax3 instance of user front end class + * @access protected + */ + function XML_HTMLSax3_StateParser_Lt430(& $htmlsax) { + parent::XML_HTMLSax3_StateParser($htmlsax); + $this->parser_options['XML_OPTION_TRIM_DATA_NODES'] = 0; + $this->parser_options['XML_OPTION_CASE_FOLDING'] = 0; + $this->parser_options['XML_OPTION_LINEFEED_BREAK'] = 0; + $this->parser_options['XML_OPTION_TAB_BREAK'] = 0; + $this->parser_options['XML_OPTION_ENTITIES_PARSED'] = 0; + $this->parser_options['XML_OPTION_ENTITIES_UNPARSED'] = 0; + $this->parser_options['XML_OPTION_STRIP_ESCAPES'] = 0; + } + + /** + * Returns a string from the current position until the first instance of + * one of the characters in the supplied string argument + * @param string string to search until + * @access protected + * @return string + */ + function scanUntilCharacters($string) { + $startpos = $this->position; + while ($this->position < $this->length && strpos($string, $this->rawtext{$this->position}) === FALSE) { + $this->position++; + } + return substr($this->rawtext, $startpos, $this->position - $startpos); + } + + /** + * Moves the position forward past any whitespace characters + * @access protected + * @return void + */ + function ignoreWhitespace() { + while ($this->position < $this->length && + strpos(" \n\r\t", $this->rawtext{$this->position}) !== FALSE) { + $this->position++; + } + } + + /** + * Begins the parsing operation, setting up the unparsed XML entities + * decorator if necessary then delegating further work to parent + * @param string XML document to parse + * @access protected + * @return void + */ + function parse($data) { + parent::parse($data); + } +} + +/** +* Parser for PHP Versions equal to or greater than 4.3.0. Uses a faster +* parsing mechanism than the equivalent PHP < 4.3.0 subclass of StateParser +* @package XML_HTMLSax3 +* @access protected +* @see XML_HTMLSax3_StateParser_Lt430 +*/ +class XML_HTMLSax3_StateParser_Gtet430 extends XML_HTMLSax3_StateParser { + /** + * Constructs XML_HTMLSax3_StateParser_Gtet430 defining available + * parser options + * @var XML_HTMLSax3 instance of user front end class + * @access protected + */ + function XML_HTMLSax3_StateParser_Gtet430(& $htmlsax) { + parent::XML_HTMLSax3_StateParser($htmlsax); + $this->parser_options['XML_OPTION_TRIM_DATA_NODES'] = 0; + $this->parser_options['XML_OPTION_CASE_FOLDING'] = 0; + $this->parser_options['XML_OPTION_LINEFEED_BREAK'] = 0; + $this->parser_options['XML_OPTION_TAB_BREAK'] = 0; + $this->parser_options['XML_OPTION_ENTITIES_PARSED'] = 0; + $this->parser_options['XML_OPTION_ENTITIES_UNPARSED'] = 0; + $this->parser_options['XML_OPTION_STRIP_ESCAPES'] = 0; + } + /** + * Returns a string from the current position until the first instance of + * one of the characters in the supplied string argument. + * @param string string to search until + * @access protected + * @return string + */ + function scanUntilCharacters($string) { + $startpos = $this->position; + $length = strcspn($this->rawtext, $string, $startpos); + $this->position += $length; + return substr($this->rawtext, $startpos, $length); + } + + /** + * Moves the position forward past any whitespace characters + * @access protected + * @return void + */ + function ignoreWhitespace() { + $this->position += strspn($this->rawtext, " \n\r\t", $this->position); + } + + /** + * Begins the parsing operation, setting up the parsed and unparsed + * XML entity decorators if necessary then delegating further work + * to parent + * @param string XML document to parse + * @access protected + * @return void + */ + function parse($data) { + parent::parse($data); + } +} + +/** +* Default NullHandler for methods which were not set by user +* @package XML_HTMLSax3 +* @access protected +*/ +class XML_HTMLSax3_NullHandler { + /** + * Generic handler method which does nothing + * @access protected + * @return void + */ + function DoNothing() { + } +} + +/** +* User interface class. All user calls should only be made to this class +* @package XML_HTMLSax3 +* @access public +*/ +class XML_HTMLSax3 { + /** + * Instance of concrete subclass of XML_HTMLSax3_StateParser + * @var XML_HTMLSax3_StateParser + * @access private + */ + var $state_parser; + + /** + * Constructs XML_HTMLSax3 selecting concrete StateParser subclass + * depending on PHP version being used as well as setting the default + * NullHandler for all callbacks<br /> + * <b>Example:</b> + * <pre> + * $myHandler = & new MyHandler(); + * $parser = new XML_HTMLSax3(); + * $parser->set_object($myHandler); + * $parser->set_option('XML_OPTION_CASE_FOLDING'); + * $parser->set_element_handler('myOpenHandler','myCloseHandler'); + * $parser->set_data_handler('myDataHandler'); + * $parser->parser($xml); + * </pre> + * @access public + */ + function XML_HTMLSax3() { + if (version_compare(phpversion(), '4.3', 'ge')) { + $this->state_parser =& new XML_HTMLSax3_StateParser_Gtet430($this); + } else { + $this->state_parser =& new XML_HTMLSax3_StateParser_Lt430($this); + } + $nullhandler =& new XML_HTMLSax3_NullHandler(); + $this->set_object($nullhandler); + $this->set_element_handler('DoNothing', 'DoNothing'); + $this->set_data_handler('DoNothing'); + $this->set_pi_handler('DoNothing'); + $this->set_jasp_handler('DoNothing'); + $this->set_escape_handler('DoNothing'); + } + + /** + * Sets the user defined handler object. Returns a PEAR Error + * if supplied argument is not an object. + * @param object handler object containing SAX callback methods + * @access public + * @return mixed + */ + function set_object(&$object) { + if ( is_object($object) ) { + $this->state_parser->handler_default =& $object; + return true; + } else { + require_once('PEAR.php'); + PEAR::raiseError('XML_HTMLSax3::set_object requires '. + 'an object instance'); + } + } + + /** + * Sets a parser option. By default all options are switched off. + * Returns a PEAR Error if option is invalid<br /> + * <b>Available options:</b> + * <ul> + * <li>XML_OPTION_TRIM_DATA_NODES: trim whitespace off the beginning + * and end of data passed to the data handler</li> + * <li>XML_OPTION_LINEFEED_BREAK: linefeeds result in additional data + * handler calls</li> + * <li>XML_OPTION_TAB_BREAK: tabs result in additional data handler + * calls</li> + * <li>XML_OPTION_ENTITIES_UNPARSED: XML entities are returned as + * seperate data handler calls in unparsed form</li> + * <li>XML_OPTION_ENTITIES_PARSED: (PHP 4.3.0+ only) XML entities are + * returned as seperate data handler calls and are parsed with + * PHP's html_entity_decode() function</li> + * <li>XML_OPTION_STRIP_ESCAPES: strips out the -- -- comment markers + * or CDATA markup inside an XML escape, if found.</li> + * </ul> + * To get HTMLSax to behave in the same way as the native PHP SAX parser, + * using it's default state, you need to switch on XML_OPTION_LINEFEED_BREAK, + * XML_OPTION_ENTITIES_PARSED and XML_OPTION_CASE_FOLDING + * @param string name of parser option + * @param int (optional) 1 to switch on, 0 for off + * @access public + * @return boolean + */ + function set_option($name, $value=1) { + if ( array_key_exists($name,$this->state_parser->parser_options) ) { + $this->state_parser->parser_options[$name] = $value; + return true; + } else { + require_once('PEAR.php'); + PEAR::raiseError('XML_HTMLSax3::set_option('.$name.') illegal'); + } + } + + /** + * Sets the data handler method which deals with the contents of XML + * elements.<br /> + * The handler method must accept two arguments, the first being an + * instance of XML_HTMLSax3 and the second being the contents of an + * XML element e.g. + * <pre> + * function myDataHander(& $parser,$data){} + * </pre> + * @param string name of method + * @access public + * @return void + * @see set_object + */ + function set_data_handler($data_method) { + $this->state_parser->handler_object_data =& $this->state_parser->handler_default; + $this->state_parser->handler_method_data = $data_method; + } + + /** + * Sets the open and close tag handlers + * <br />The open handler method must accept three arguments; the parser, + * the tag name and an array of attributes e.g. + * <pre> + * function myOpenHander(& $parser,$tagname,$attrs=array()){} + * </pre> + * The close handler method must accept two arguments; the parser and + * the tag name e.g. + * <pre> + * function myCloseHander(& $parser,$tagname){} + * </pre> + * @param string name of open method + * @param string name of close method + * @access public + * @return void + * @see set_object + */ + function set_element_handler($opening_method, $closing_method) { + $this->state_parser->handler_object_element =& $this->state_parser->handler_default; + $this->state_parser->handler_method_opening = $opening_method; + $this->state_parser->handler_method_closing = $closing_method; + } + + /** + * Sets the processing instruction handler method e.g. for PHP open + * and close tags<br /> + * The handler method must accept three arguments; the parser, the + * PI target and data inside the PI + * <pre> + * function myPIHander(& $parser,$target, $data){} + * </pre> + * @param string name of method + * @access public + * @return void + * @see set_object + */ + function set_pi_handler($pi_method) { + $this->state_parser->handler_object_pi =& $this->state_parser->handler_default; + $this->state_parser->handler_method_pi = $pi_method; + } + + /** + * Sets the XML escape handler method e.g. for comments and doctype + * declarations<br /> + * The handler method must accept two arguments; the parser and the + * contents of the escaped section + * <pre> + * function myEscapeHander(& $parser, $data){} + * </pre> + * @param string name of method + * @access public + * @return void + * @see set_object + */ + function set_escape_handler($escape_method) { + $this->state_parser->handler_object_escape =& $this->state_parser->handler_default; + $this->state_parser->handler_method_escape = $escape_method; + } + + /** + * Sets the JSP/ASP markup handler<br /> + * The handler method must accept two arguments; the parser and + * body of the JASP tag + * <pre> + * function myJaspHander(& $parser, $data){} + * </pre> + * @param string name of method + * @access public + * @return void + * @see set_object + */ + function set_jasp_handler ($jasp_method) { + $this->state_parser->handler_object_jasp =& $this->state_parser->handler_default; + $this->state_parser->handler_method_jasp = $jasp_method; + } + + /** + * Returns the current string position of the "cursor" inside the XML + * document + * <br />Intended for use from within a user defined handler called + * via the $parser reference e.g. + * <pre> + * function myDataHandler(& $parser,$data) { + * echo( 'Current position: '.$parser->get_current_position() ); + * } + * </pre> + * @access public + * @return int + * @see get_length + */ + function get_current_position() { + return $this->state_parser->position; + } + + /** + * Returns the string length of the XML document being parsed + * @access public + * @return int + */ + function get_length() { + return $this->state_parser->length; + } + + /** + * Start parsing some XML + * @param string XML document + * @access public + * @return void + */ + function parse($data) { + $this->state_parser->parse($data); + } +} +?> \ No newline at end of file Added: trunk/nwadmin/backend/classes/safehtml.php =================================================================== --- trunk/nwadmin/backend/classes/safehtml.php (rev 0) +++ trunk/nwadmin/backend/classes/safehtml.php 2008-02-26 10:07:25 UTC (rev 37) @@ -0,0 +1,670 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ + +/** + * SafeHTML Parser + * + * PHP versions 4 and 5 + * + * @category HTML + * @package SafeHTML + * @author Roman Ivanov <th...@ma...> + * @copyright 2004-2005 Roman Ivanov + * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) + * @version 1.3.7 + * @link http://pixel-apes.com/safehtml/ + */ + + +/** + * This package requires HTMLSax3 package + */ +require_once(XML_HTMLSAX3 . 'HTMLSax3.php'); + + +/** + * + * SafeHTML Parser + * + * This parser strips down all potentially dangerous content within HTML: + * <ul> + * <li>opening tag without its closing tag</li> + * <li>closing tag without its opening tag</li> + * <li>any of these tags: "base", "basefont", "head", "html", "body", "applet", + * "object", "iframe", "frame", "frameset", "script", "layer", "ilayer", "embed", + * "bgsound", "link", "meta", "style", "title", "blink", "xml" etc.</li> + * <li>any of these attributes: on*, data*, dynsrc</li> + * <li>javascript:/vbscript:/about: etc. protocols</li> + * <li>expression/behavior etc. in styles</li> + * <li>any other active content</li> + * </ul> + * It also tries to convert code to XHTML valid, but htmltidy is far better + * solution for this task. + * + * <b>Example:</b> + * <pre> + * $parser =& new SafeHTML(); + * $result = $parser->parse($doc); + * </pre> + * + * @category HTML + * @package SafeHTML + * @author Roman Ivanov <th...@ma...> + * @copyright 1997-2005 Roman Ivanov + * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) + * @version Release: @package_version@ + * @link http://pear.php.net/package/SafeHTML + */ +class SafeHTML +{ + /** + * Storage for resulting HTML output + * + * @var string + * @access private + */ + var $_xhtml = ''; + + /** + * Array of counters for each tag + * + * @var array + * @access private + */ + var $_counter = array(); + + /** + * Stack of unclosed tags + * + * @var array + * @access private + */ + var $_stack = array(); + + /** + * Array of counters for tags that must be deleted with all content + * + * @var array + * @access private + */ + var $_dcCounter = array(); + + /** + * Stack of unclosed tags that must be deleted with all content + * + * @var array + * @access private + */ + var $_dcStack = array(); + + /** + * Stores level of list (ol/ul) nesting + * + * @var int + * @access private + */ + var $_listScope = 0; + + /** + * Stack of unclosed list tags + * + * @var array + * @access private + */ + var $_liStack = array(); + + /** + * Array of prepared regular expressions for protocols (schemas) matching + * + * @var array + * @access private + */ + var $_protoRegexps = array(); + + /** + * Array of prepared regular expressions for CSS matching + * + * @var array + * @access private + */ + var $_cssRegexps = array(); + + /** + * List of single tags ("<tag />") + * + * @var array + * @access public + */ + var $singleTags = array('area', 'br', 'img', 'input', 'hr', 'wbr', ); + + /** + * List of dangerous tags (such tags will be deleted) + * + * @var array + * @access public + */ + var $deleteTags = array( + 'applet', 'base', 'basefont', 'bgsound', 'blink', 'body', + 'embed', 'frame', 'frameset', 'head', 'html', 'ilayer', + 'iframe', 'layer', 'link', 'meta', 'object', 'style', + 'title', 'script', + ); + + /** + * List of dangerous tags (such tags will be deleted, and all content + * inside this tags will be also removed) + * + * @var array + * @access public + */ + var $deleteTagsContent = array('script', 'style', 'title', 'xml', ); + + /** + * Type of protocols filtering ('white' or 'black') + * + * @var string + * @access public + */ + var $protocolFiltering = 'white'; + + /** + * List of "dangerous" protocols (used for blacklist-filtering) + * + * @var array + * @access public + */ + var $blackProtocols = array( + 'about', 'chrome', 'data', 'disk', 'hcp', + 'help', 'javascript', 'livescript', 'lynxcgi', 'lynxexec', + 'ms-help', 'ms-its', 'mhtml', 'mocha', 'opera', + 'res', 'resource', 'shell', 'vbscript', 'view-source', + 'vnd.ms.radio', 'wysiwyg', + ); + + /** + * List of "safe" protocols (used for whitelist-filtering) + * + * @var array + * @access public + */ + var $whiteProtocols = array( + 'ed2k', 'file', 'ftp', 'gopher', 'http', 'https', + 'irc', 'mailto', 'news', 'nntp', 'telnet', 'webcal', + 'xmpp', 'callto', + ); + + /** + * List of attributes that can contain protocols + * + * @var array + * @access public + */ + var $protocolAttributes = array( + 'action', 'background', 'codebase', 'dynsrc', 'href', 'lowsrc', 'src', + ); + + /** + * List of dangerous CSS keywords + * + * Whole style="" attribute will be removed, if parser will find one of + * these keywords + * + * @var array + * @access public + */ + var $cssKeywords = array( + 'absolute', 'behavior', 'behaviour', 'content', 'expression', + 'fixed', 'include-source', 'moz-binding', + ); + + /** + * List of tags that can have no "closing tag" + * + * @var array + * @access public + * @deprecated XHTML does not allow such tags + */ + var $noClose = array(); + + /** + * List of block-level tags that terminates paragraph + * + * Paragraph will be closed when this tags opened + * + * @var array + * @access public + */ + var $closeParagraph = array( + 'address', 'blockquote', 'center', 'dd', 'dir', 'div', + 'dl', 'dt', 'h1', 'h2', 'h3', 'h4', + 'h5', 'h6', 'hr', 'isindex', 'listing', 'marquee', + 'menu', 'multicol', 'ol', 'p', 'plaintext', 'pre', + 'table', 'ul', 'xmp', + ); + + /** + * List of table tags, all table tags outside a table will be removed + * + * @var array + * @access public + */ + var $tableTags = array( + 'caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', + 'thead', 'tr', + ); + + /** + * List of list tags + * + * @var array + * @access public + */ + var $listTags = array('dir', 'menu', 'ol', 'ul', 'dl', ); + + /** + * List of dangerous attributes + * + * @var array + * @access public + */ + var $attributes = array('dynsrc', 'id', 'name', ); + + /** + * List of allowed "namespaced" attributes + * + * @var array + * @access public + */ + var $attributesNS = array('xml:lang', ); + + /** + * Constructs class + * + * @access public + */ + function SafeHTML() + { + //making regular expressions based on Proto & CSS arrays + foreach ($this->blackProtocols as $proto) { + $preg = "/[\s\x01-\x1F]*"; + for ($i=0; $i<strlen($proto); $i++) { + $preg .= $proto{$i} . "[\s\x01-\x1F]*"; + } + $preg .= ":/i"; + $this->_protoRegexps[] = $preg; + } + + foreach ($this->cssKeywords as $css) { + $this->_cssRegexps[] = '/' . $css . '/i'; + } + return true; + } + + /** + * Handles the writing of attributes - called from $this->_openHandler() + * + * @param array $attrs array of attributes $name => $value + * @return boolean + * @access private + */ + function _writeAttrs ($attrs) + { + if (is_array($attrs)) { + foreach ($attrs as $name => $value) { + + $name = strtolower($name); + + if (strpos($name, 'on') === 0) { + continue; + } + if (strpos($name, 'data') === 0) { + continue; + } + if (in_array($name, $this->attributes)) { + continue; + } + if (!preg_match("/^[a-z0-9]+$/i", $name)) { + if (!in_array($name, $this->attributesNS)) + { + continue; + } + } + + if (($value === TRUE) || (is_null($value))) { + $value = $name; + } + + if ($name == 'style') { + + // removes insignificant backslahes + $value = str_replace("\\", '', $value); + + // removes CSS comments + while (1) + { + $_value = preg_replace("!/\*.*?\*/!s", '', $value); + if ($_value == $value) break; + $value = $_value; + } + + // replace all & to & + $value = str_replace('&', '&', $value); + $value = str_replace('&', '&', $value); + + foreach ($this->_cssRegexps as $css) { + if (preg_match($css, $value)) { + continue 2; + } + } + foreach ($this->_protoRegexps as $proto) { + if (preg_match($proto, $value)) { + continue 2; + } + } + } + + $tempval = preg_replace('/&#(\d+);?/me', "chr('\\1')", $value); //"' + $tempval = preg_replace('/&#x([0-9a-f]+);?/mei', "chr(hexdec('\\1'))", $tempval); + + if ((in_array($name, $this->protocolAttributes)) && + (strpos($tempval, ':') !== false)) + { + if ($this->protocolFiltering == 'black') { + foreach ($this->_protoRegexps as $proto) { + if (preg_match($proto, $tempval)) continue 2; + } + } else { + $_tempval = explode(':', $tempval); + $proto = $_tempval[0]; + if (!in_array($proto, $this->whiteProtocols)) { + continue; + } + } + } + + $value = str_replace("\"", """, $value); + $this->_xhtml .= ' ' . $name . '="' . $value . '"'; + } + } + return true; + } + + /** + * Opening tag handler - called from HTMLSax + * + * @param object $parser HTML Parser + * @param string $name tag name + * @param array $attrs tag attributes + * @return boolean + * @access private + */ + function _openHandler(&$parser, $name, $attrs) + { + $name = strtolower($name); + + if (in_array($name, $this->deleteTagsContent)) { + array_push($this->_dcStack, $name); + $this->_dcCounter[$name] = isset($this->_dcCounter[$name]) ? $this->_dcCounter[$name]+1 : 1; + } + if (count($this->_dcStack) != 0) { + return true; + } + + if (in_array($name, $this->deleteTags)) { + return true; + } + + if (!preg_match("/^[a-z0-9]+$/i", $name)) { + if (preg_match("!(?:\@|://)!i", $name)) { + $this->_xhtml .= '<' . $name . '>'; + } + return true; + } + + if (in_array($name, $this->singleTags)) { + $this->_xhtml .= '<' . $name; + $this->_writeAttrs($attrs); + $this->_xhtml .= ' />'; + return true; + } + + // TABLES: cannot open table elements when we are not inside table + if ((isset($this->_counter['table'])) && ($this->_counter['table'] <= 0) + && (in_array($name, $this->tableTags))) + { + return true; + } + + // PARAGRAPHS: close paragraph when closeParagraph tags opening + if ((in_array($name, $this->closeParagraph)) && (in_array('p', $this->_stack))) { + $this->_closeHandler($parser, 'p'); + } + +... [truncated message content] |
From: <mn...@us...> - 2008-01-21 17:22:59
|
Revision: 36 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=36&view=rev Author: mnencia Date: 2008-01-21 09:23:04 -0800 (Mon, 21 Jan 2008) Log Message: ----------- Solved litle bug in sieve script creation Modified Paths: -------------- trunk/doc/TODO trunk/setup/bin/vmaild Modified: trunk/doc/TODO =================================================================== --- trunk/doc/TODO 2008-01-21 17:15:38 UTC (rev 35) +++ trunk/doc/TODO 2008-01-21 17:23:04 UTC (rev 36) @@ -1,6 +1,9 @@ Things that need to be done: + - Sometime mkpath results in unreadable directory from mailserver, + investigate. + - Let users have the ability to enable/disable newsletter support - E-mails listed should be differenced from each other (email,alias,newsletter etc) Modified: trunk/setup/bin/vmaild =================================================================== --- trunk/setup/bin/vmaild 2008-01-21 17:15:38 UTC (rev 35) +++ trunk/setup/bin/vmaild 2008-01-21 17:23:04 UTC (rev 36) @@ -93,6 +93,10 @@ my $sieve_file = "sieve/.dovecot.sieve.sieve"; + if ( ! -d "$path/sieve/tmp" ) { + mkpath("$path/sieve/tmp", 0, 0700); + } + # Special content: sieve script if ( open( FILE, ">$path/$sieve_file" ) ) { print FILE $sieve_script; @@ -150,8 +154,6 @@ $path . "/Maildir/.Trash/new", $path . "/Maildir/.Trash/cur", $path . "/Maildir/.Trash/tmp", - $path . "/sieve", - $path . "/sieve/tmp", ); my @files = ( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mn...@us...> - 2008-01-21 17:15:36
|
Revision: 35 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=35&view=rev Author: mnencia Date: 2008-01-21 09:15:38 -0800 (Mon, 21 Jan 2008) Log Message: ----------- Added eclipse metadata to svn:ignore Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svn:ignore + .settings .cache .project This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mn...@us...> - 2007-12-14 14:33:43
|
Revision: 34 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=34&view=rev Author: mnencia Date: 2007-12-14 06:33:48 -0800 (Fri, 14 Dec 2007) Log Message: ----------- Import script now detect and convert quota informations Modified Paths: -------------- trunk/setup/contrib/vpopmail2panda/import Modified: trunk/setup/contrib/vpopmail2panda/import =================================================================== --- trunk/setup/contrib/vpopmail2panda/import 2007-12-14 12:09:57 UTC (rev 33) +++ trunk/setup/contrib/vpopmail2panda/import 2007-12-14 14:33:48 UTC (rev 34) @@ -26,6 +26,7 @@ use File::Path; use File::Copy; +use POSIX; # for ceil # Conf my $configfile = $ARGV[0]; @@ -767,10 +768,17 @@ $user{"pop3_enabled"} = ($values[3] eq '0')?'t':'f'; if ($values[5] =~ m%$old_vpopmail_domains_location/([^/]+)/((.*/)*([^/]+))% ) { if ($domains_alias{$1}) { - $user{"maildir"} = "$old_vpopmail_domains_dir/".$domains_alias{$1}."/$2/Maildir"; + $user{'maildir'} = "$old_vpopmail_domains_dir/".$domains_alias{$1}."/$2/Maildir"; } else { - $user{"maildir"} = "$old_vpopmail_domains_dir/$1/$2/Maildir"; + $user{'maildir'} = "$old_vpopmail_domains_dir/$1/$2/Maildir"; } + # reading user quota + if (open (QUOTA, "<".$user{'maildir'}."/maildirsize")) { + my $quota = <QUOTA>; + chomp $quota; + close (QUOTA); + $user{'quota'} = POSIX::ceil(( grep { s/S\s*$// } split(/\s*,\s*/, $quota))[0] / 1024); + } $users{$values[0]} = \%user; } else { @@ -1063,7 +1071,8 @@ chown($vuid, $vgid, "$new_panda_domains_dir") or die "Non posso settare l'owner di $new_panda_domains_dir: $!"; } $sth = $dbh->prepare(qq| - INSERT INTO $db_virtual_domain_users (id_domain, name, passwd, maildir, pop3_enabled) VALUES (?, ?, ?, ?, ?); + INSERT INTO $db_virtual_domain_users (id_domain, name, passwd, maildir, pop3_enabled, quota_kb) + VALUES (?, ?, ?, ?, ?, ?); |) or die $dbh->errstr; open (OUT, ">$new_panda_confdump_dir/virtual-domain-users"); print(OUT "# File contenete le mailbox per i domini virtuali locali\n"); @@ -1102,7 +1111,9 @@ $user, $domains_real{$domain}->{"users"}->{$user}->{"password"}, $home, - $domains_real{$domain}->{"users"}->{$user}->{"pop3_enabled"}) or die $dbh->errstr; + $domains_real{$domain}->{"users"}->{$user}->{"pop3_enabled"}, + $domains_real{$domain}->{"users"}->{$user}->{"quota"} + ) or die $dbh->errstr; } $dbh->do("UPDATE $db_virtual_domains SET usercount = ? WHERE id = ?;", {}, $usercount, $id_domain) or die $dbh->errstr; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mn...@us...> - 2007-12-14 12:09:55
|
Revision: 33 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=33&view=rev Author: mnencia Date: 2007-12-14 04:09:57 -0800 (Fri, 14 Dec 2007) Log Message: ----------- Now subdirs are working in vmaild Modified Paths: -------------- trunk/setup/bin/vmaild Modified: trunk/setup/bin/vmaild =================================================================== --- trunk/setup/bin/vmaild 2007-12-13 17:15:39 UTC (rev 32) +++ trunk/setup/bin/vmaild 2007-12-14 12:09:57 UTC (rev 33) @@ -232,6 +232,7 @@ $prefix = ( $dircount % 62 ) . "/$prefix"; $dircount = POSIX::floor( $dircount / 62 ) - 1; } + $prefix =~ s%/$%%; return $prefix; } @@ -244,7 +245,7 @@ for ( my $i = 1 ; $i <= $usercount ; $i += 100 ) { $dir = $path; my $prefix = compute_dir($i); - $dir .= "/" . $prefix if $prefix; + $dir .= "/" . $prefix if $prefix ne ''; $dirlist{$dir} = 1; push @filelist, map { "$dir/$_" } filelist($dir) if -d $dir; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mn...@us...> - 2007-12-13 17:15:42
|
Revision: 32 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=32&view=rev Author: mnencia Date: 2007-12-13 09:15:39 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Mark the user of a moved directory as found. Modified Paths: -------------- trunk/setup/bin/vmaild Modified: trunk/setup/bin/vmaild =================================================================== --- trunk/setup/bin/vmaild 2007-12-13 17:05:41 UTC (rev 31) +++ trunk/setup/bin/vmaild 2007-12-13 17:15:39 UTC (rev 32) @@ -412,8 +412,6 @@ my $user = $maildir; $user =~ s%^.*/([^/]+)/?$%$1%; if ( $users{$user} ) { - $users{$user}->{found} = 1; - $users{$user}->{sieveok} = check_sieve($maildir); my $dbmaildir = "$domaindir/$users{$user}->{maildir}"; $dbmaildir =~ s%/$%%; if ($dbmaildir ne $maildir ) { @@ -426,12 +424,21 @@ else { logmsg( 'notice', "incongruence in home location found for user: $user\@$domain" ); if (sys_or_log("mv $maildir $dbmaildir")) { + $maildir = $dbmaildir; + $users{$user}->{found} = 1; + $users{$user}->{sieveok} = check_sieve($maildir); + } + else { my $deldate = POSIX::strftime( "%F-%H%M%S", gmtime ); sys_or_log("mv $maildir $deldir/${domain}_${user}_$deldate") or $ok = 0; } } } + else { + $users{$user}->{found} = 1; + $users{$user}->{sieveok} = check_sieve($maildir); + } } else { logmsg( 'notice', "invalid or deleted user: $user\@$domain " ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mn...@us...> - 2007-12-13 17:05:44
|
Revision: 31 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=31&view=rev Author: mnencia Date: 2007-12-13 09:05:41 -0800 (Thu, 13 Dec 2007) Log Message: ----------- If a maildir isn't in the correct positione try to correct the mistake before to delete it. Modified Paths: -------------- trunk/setup/bin/vmaild Modified: trunk/setup/bin/vmaild =================================================================== --- trunk/setup/bin/vmaild 2007-12-13 16:21:14 UTC (rev 30) +++ trunk/setup/bin/vmaild 2007-12-13 17:05:41 UTC (rev 31) @@ -411,15 +411,33 @@ foreach my $maildir (@maildirs) { my $user = $maildir; $user =~ s%^.*/([^/]+)/?$%$1%; - if ( !$users{$user} - || "$domaindir/$users{$user}->{maildir}" ne $maildir ) { + if ( $users{$user} ) { + $users{$user}->{found} = 1; + $users{$user}->{sieveok} = check_sieve($maildir); + my $dbmaildir = "$domaindir/$users{$user}->{maildir}"; + $dbmaildir =~ s%/$%%; + if ($dbmaildir ne $maildir ) { + if ( -d $dbmaildir) { + logmsg( 'notice', "duplicate home found for user: $user\@$domain" ); + my $deldate = POSIX::strftime( "%F-%H%M%S", gmtime ); + sys_or_log("mv $maildir $deldir/${domain}_${user}_$deldate") + or $ok = 0; + } + else { + logmsg( 'notice', "incongruence in home location found for user: $user\@$domain" ); + if (sys_or_log("mv $maildir $dbmaildir")) { + my $deldate = POSIX::strftime( "%F-%H%M%S", gmtime ); + sys_or_log("mv $maildir $deldir/${domain}_${user}_$deldate") + or $ok = 0; + } + } + } + } + else { logmsg( 'notice', "invalid or deleted user: $user\@$domain " ); my $deldate = POSIX::strftime( "%F-%H%M%S", gmtime ); sys_or_log("mv $maildir $deldir/${domain}_${user}_$deldate") or $ok = 0; - } else { - $users{$user}->{found} = 1; - $users{$user}->{sieveok} = check_sieve($maildir); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mn...@us...> - 2007-12-13 16:21:11
|
Revision: 30 http://panda-admin.svn.sourceforge.net/panda-admin/?rev=30&view=rev Author: mnencia Date: 2007-12-13 08:21:14 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Change default name for deleted user in vmaild Modified Paths: -------------- trunk/setup/bin/vmaild Modified: trunk/setup/bin/vmaild =================================================================== --- trunk/setup/bin/vmaild 2007-12-13 16:17:47 UTC (rev 29) +++ trunk/setup/bin/vmaild 2007-12-13 16:21:14 UTC (rev 30) @@ -415,7 +415,7 @@ || "$domaindir/$users{$user}->{maildir}" ne $maildir ) { logmsg( 'notice', "invalid or deleted user: $user\@$domain " ); my $deldate = POSIX::strftime( "%F-%H%M%S", gmtime ); - sys_or_log("mv $maildir $deldir/$user\@${domain}_$deldate") + sys_or_log("mv $maildir $deldir/${domain}_${user}_$deldate") or $ok = 0; } else { $users{$user}->{found} = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |