Skip to content
Snippets Groups Projects
Commit 22de48c9 authored by K. Clair's avatar K. Clair
Browse files

cleaning up web_tt2 templates to only include the changes we need

parent f3488c54
Branches
No related tags found
No related merge requests found
Showing
with 130 additions and 279 deletions
--- confdef.pm.orig 2009-12-18 12:44:40.000000000 -0800
+++ src/lib/confdef.pm 2009-12-18 12:45:08.000000000 -0800
@@ -512,6 +512,11 @@
default => 'mailer-daemon|sympa|listserv|majordomo|smartlist|mailman',
vhost => '1',
},
+ {
+ name => 'db_list_cache',
+ default => '0',
+ advice => 'Whether or not to cache lists in the database',
+ },
{ title => 'Internationalization' },
{
name => 'lang',
--- Upgrade.pm.orig 2009-12-18 13:09:46.000000000 -0800
+++ src/lib/Upgrade.pm 2009-12-18 13:14:10.000000000 -0800
@@ -760,6 +760,18 @@
'label_conf' => 'varchar(80)',
'value_conf' => 'varchar(300)'}
},
+ 'lists_table' => {'name_list'=>'varchar(100)',
+ 'path_list'=>'varchar(100)',
+ 'robot_list'=>'varchar(100)',
+ 'status_list'=>"enum('open','closed','pending','error_config','family_closed')",
+ 'creation_email_list'=>'varchar(100)',
+ 'creation_epoch_list'=>'datetime',
+ 'subject_list'=>'varchar(100)',
+ 'web_archive_list'=>'tinyint(1)',
+ 'topics_list'=>'varchar(100)',
+ 'editors_list'=>'varchar(100)',
+ 'owners_list'=>'varchar(100)'},
'SQLite' => {'user_table' => {'email_user' => 'text',
'gecos_user' => 'text',
'password_user' => 'text',
@@ -851,6 +863,19 @@
'label_conf' => 'text',
'value_conf' => 'text'}
},
+ 'lists_table' => {'name_list'=>'varchar(100)',
+ 'path_list'=>'varchar(100)',
+ 'robot_list'=>'varchar(100)',
+ 'status_list'=>"enum('open','closed','pending','error_config','family_closed')",
+ 'creation_email_list'=>'varchar(100)',
+ 'creation_epoch_list'=>'datetime',
+ 'subject_list'=>'varchar(100)',
+ 'web_archive_list'=>'tinyint(1)',
+ 'topics_list'=>'varchar(100)',
+ 'editors_list'=>'varchar(100)',
+ 'owners_list'=>'varchar(100)'}
+
);
my %not_null = ('email_user' => 1,
@@ -877,6 +902,16 @@
'messagekey_bulkmailer' => 1,
'packetid_bulkmailer' => 1,
'messagekey_bulkspool' => 1,
+ 'name_list'=>1,
+ 'path_list'=>1,
+ 'robot_list'=>1,
+ 'status_list'=>1,
+ 'creation_email_list'=>1,
+ 'subject_list'=>1,
+ 'web_archive_list'=>1,
+ 'topics_list'=>1,
+ 'owners_list'=>1,
+ 'editors_list'=>1
);
my %primary = ('user_table' => ['email_user'],
@@ -888,7 +923,8 @@
'one_time_ticket_table' => ['ticket_one_time_ticket'],
'bulkmailer_table' => ['messagekey_bulkmailer','packetid_bulkmailer'],
'bulkspool_table' => ['messagekey_bulkspool'],
- 'conf_table' => ['robot_conf','label_conf']
+ 'conf_table' => ['robot_conf','label_conf'],
+ 'list_table'=> ['name_list','robot_list']
);
## List the required INDEXES
--- sympa.pl.orig 2009-12-18 13:15:43.000000000 -0800
+++ src/sympa.pl.in 2009-12-18 13:21:12.000000000 -0800
@@ -84,6 +84,8 @@
--dump=list\@dom|ALL : dumps subscribers
--make_alias_file : create file in /tmp with all aliases (usefull when aliases.tpl is changed)
--lowercase : lowercase email addresses in database
+ --sync_list_db[=listname] : syncs filesystem list configs to the database cache of list configs,
+ optionally sync an individual list if specified.
--md5_encode_password : rewrite password in database using md5 fingerprint. YOU CAN'T UNDO unless you save this table first
--create_list --robot=robot_name --input_file=/path/to/file.xml
: create a list with the xml file under robot_name
@@ -123,7 +125,7 @@
## Check --dump option
my %options;
unless (&GetOptions(\%main::options, 'dump=s', 'debug|d', ,'log_level=s','foreground', 'service=s','config|f=s',
- 'lang|l=s', 'mail|m', 'keepcopy|k=s', 'help', 'version', 'import=s','make_alias_file','lowercase','md5_encode_password',
+ 'lang|l=s', 'mail|m', 'keepcopy|k=s', 'help', 'version', 'import=s','make_alias_file','lowercase','sync_list_db','md5_encode_password',
'close_list=s','purge_list=s','create_list','instantiate_family=s','robot=s','add_list=s','modify_list=s','close_family=s','md5_digest=s',
'input_file=s','sync_include=s','upgrade','upgrade_shared','from=s','to=s','reload_list_config','list=s','quiet','close_unknown','test_database_message_buffer')) {
&fatal_err("Unknown options.");
@@ -152,7 +154,8 @@
$main::options{'upgrade'} ||
$main::options{'upgrade_shared'} ||
$main::options{'test_database_message_buffer'} ||
- $main::options{'reload_list_config'}
+ $main::options{'reload_list_config'} ||
+ $main::options{'sync_list_db'}
);
# Some option force foreground mode
@@ -872,6 +875,34 @@
print STDOUT $string;
exit 0;
}
+
+##########################################
+elsif ($main::options{'sync_list_db'}) {
+ unless ($Conf{'db_list_cache'}) {
+ print STDOUT "\nSympa not configured to use database list caching \n";
+ exit 1;
+ }
+ my $listname = $main::options{'sync_list_db'};
+ if (length($listname) > 1) {
+ my ($listname, $robot) = split /\@/, $listname;
+ my $list = new List ($listname, $robot);
+ unless (defined $list) {
+ print STDOUT "\nList '$list' does not exist. \n";
+ exit 1;
+ }
+ if (&List::_flush_list_db($listname)) {
+ $list->update_list_db;
+ }
+ } else {
+ &List::_flush_list_db();
+ my $all_lists = &List::get_lists('*');
+ foreach my $list (@$all_lists) {
+ $list->_update_list_db;
+ }
+ }
+ exit 0;
+}
+
## Do we have right access in the directory
--- Conf.pm.orig 2009-12-18 13:22:04.000000000 -0800
+++ src/lib/Conf.pm 2009-12-18 13:23:02.000000000 -0800
@@ -193,6 +193,10 @@
unless (defined $o{'tmpdir'}) {
$o{'tmpdir'}[0] = "$spool/tmp";
}
+ unless (defined $o{'db_list_cache'}){
+ $o{'db_list_cache'}[0] = 0;
+ }
+
## Check if we have unknown values.
foreach $i (sort keys %o) {
--- create_db.Sybase.orig 2009-12-18 13:24:36.000000000 -0800
+++ src/etc/script/create_db.Sybase 2009-12-18 13:25:07.000000000 -0800
@@ -189,3 +189,23 @@
create index messagekey_bulkspool_fk on bulkspool_table (messagekey_bulkspool)
go
+
+CREATE TABLE list_table (
+ name_list varchar(100) NOT NULL,
+ path_list varchar(100) NOT NULL,
+ robot_list varchar(100) NOT NULL,
+ status_list enum('open','closed','pending','error_config','family_closed') NOT NULL,
+ creation_email_list varchar(100) NOT NULL,
+ creation_epoch_list datetime ,
+ subject_list varchar(100) NOT NULL,
+ web_archive_list tinyint(1) NOT NULL,
+ topics_list varchar(100) NOT NULL,
+ editors_list varchar(100) NOT NULL,
+ owners_list varchar(100) NOT NULL,
+ CONSTRAINT ind_list PRIMARY KEY (name_list,robot_list)
+)
+go
+
+CREATE INDEX id_list_fk ON list_table(name_list, robot_list)
+go
+
--- create_db.SQLite.orig 2009-12-18 13:26:23.000000000 -0800
+++ src/etc/script/create_db.SQLite 2009-12-18 13:27:13.000000000 -0800
@@ -136,3 +136,20 @@
PRIMARY KEY (robot_conf,label_conf)
);
CREATE INDEX conf_idx ON conf_table(robot_conf,label_conf);
+
+CREATE TABLE list_table (
+ name_list varchar(100) NOT NULL,
+ path_list varchar(100) NOT NULL,
+ robot_list varchar(100) NOT NULL,
+ status_list enum('open','closed','pending','error_config','family_closed') NOT NULL,
+ creation_email_list varchar(100) NOT NULL,
+ creation_epoch_list datetime ,
+ subject_list varchar(100) NOT NULL,
+ web_archive_list tinyint(1) NOT NULL,
+ topics_list varchar(100) NOT NULL,
+ owners_list varchar(100) NOT NULL,
+ editors_list varchar(100) NOT NULL,
+ CONSTRAINT ind_list PRIMARY KEY (name_list,robot_list)
+);
+CREATE INDEX list_idx ON list_table(name_list, robot_list);
+
--- create_db.mysql.orig 2009-12-18 13:27:36.000000000 -0800
+++ src/etc/script/create_db.mysql 2009-12-18 13:27:54.000000000 -0800
@@ -136,3 +136,19 @@
value_conf varchar(300) default NULL,
PRIMARY KEY (robot_conf,label_conf)
);
+
+CREATE TABLE list_table (
+ name_list varchar(100) NOT NULL default '',
+ path_list varchar(100) NOT NULL default '',
+ robot_list varchar(100) NOT NULL default '',
+ status_list enum('open','closed','pending','error_config','family_closed') NOT NULL default 'closed',
+ creation_email_list varchar(100) NOT NULL default '',
+ creation_epoch_list datetime default NULL,
+ subject_list varchar(100) NOT NULL default '',
+ web_archive_list tinyint(1) NOT NULL default '0',
+ topics_list varchar(100) NOT NULL default '',
+ editors_list varchar(100) NOT NULL default '',
+ owners_list varchar(100) NOT NULL default '',
+ PRIMARY KEY (name_list,robot_list)
+);
+
--- create_db.Oracle.orig 2009-12-18 13:28:47.000000000 -0800
+++ src/etc/script/create_db.Oracle 2009-12-18 13:29:09.000000000 -0800
@@ -144,4 +144,20 @@
CONSTRAINT ind_conf primary key (robot_conf,label_conf)
);
+CREATE TABLE list_table (
+ name_list varchar(100) NOT NULL,
+ path_list varchar(100) NOT NULL,
+ robot_list varchar(100) NOT NULL,
+ status_list enum('open','closed','pending','error_config','family_closed') NOT NULL,
+ creation_email_list varchar(100) NOT NULL,
+ creation_epoch_list datetime ,
+ subject_list varchar(100) NOT NULL,
+ web_archive_list tinyint(1) NOT NULL,
+ topics_list varchar(100) NOT NULL,
+ editors_list varchar(100) NOT NULL,
+ owners_list varchar(100) NOT NULL,
+ CONSTRAINT ind_list PRIMARY KEY (name_list,robot_list)
+);
+
+
!
--- create_db.Pg.orig 2009-12-18 13:30:06.000000000 -0800
+++ src/etc/script/create_db.Pg 2009-12-18 13:30:35.000000000 -0800
@@ -156,4 +156,22 @@
value_conf varchar(300),
constraint ind_conf primary key (robot_conf,label_conf)
);
-CREATE INDEX robot_conf_idx ON conf_table(robot_conf,label_conf);
\ No newline at end of file
+CREATE INDEX robot_conf_idx ON conf_table(robot_conf,label_conf);
+
+DROP TABLE list_table;
+CREATE TABLE list_table (
+ name_list varchar(100) NOT NULL,
+ path_list varchar(100) NOT NULL,
+ robot_list varchar(100) NOT NULL,
+ status_list enum('open','closed','pending','error_config','family_closed') NOT NULL,
+ creation_email_list varchar(100) NOT NULL,
+ creation_epoch_list datetime ,
+ subject_list varchar(100) NOT NULL,
+ web_archive_list tinyint(1) NOT NULL,
+ topics_list varchar(100) NOT NULL,
+ owners_list varchar(100) NOT NULL,
+ editors_list varchar(100) NOT NULL,
+ CONSTRAINT ind_list PRIMARY KEY (name_list,robot_list)
+);
+CREATE INDEX list_idx ON list_table(name_list, robot_list);
+
Web interface customizations: (incomplete!)
* whole home.tt2 template
* logout button is moved from login_menu.tt2 to nav.tt2
* add custom quick tips to setlang.tt2 so they end up in left sidebar in non-list view
* remove list of lists tab from nav
* move preferences link to top nav
Blacklist
-----------
We do not want the term blacklist to occur in the interface.
Where possible, this is replaced with 'blocklist'. However, these strings
has not been translated yet:
Blocklist
blocklist
The current blocklist is empty
The current blocklist contains %1 line(s)
Reject and blocklist sender
edit blocklist
<changeme>Operation requested by users which email is listed in the blacklist file are rejected. The
blacklist is in use for the following operation
Needs Translation
------------------
Contact list admins (was Contact owners)
Lists by topic
First login? (was First login ?)
Lost password? (was Lost password ?)
New email address (was New email address :)
New password (was New password :)
Re-enter your new password (was Re-enter your new password :)
Password (was Password :)
Other email address (was Other email address :)
Login expiration (was Connection expiration period)
Picture upload
--------------
either disable ui or fix picture upload.
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
<!-- $Id: compose_mail.tt2 6098 2009-08-13 08:26:28Z olivier.salaun $ -->
<div class="block">
[% IF !subaction %]
<h2>[%|loc%]Sendind a message to the list[%END%] <a class="input" href="[% path_cgi %]/nomenu/help/sendmsg" title="[%|loc%]Open in a new window[%END%]" onclick="window.open('','wws_help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=200')" target="wws_help">[%|loc%]Help[%END%]</a></h3>
<br />
[% END %]
<p>
[%|loc(list,host)%]The best way to post an email to the list is to compose an email to the list email address <b>%1@%2</b> using your favourite email client. We also provide a form below to compose an email through the web interface.[%END%]
</p>
<form class="noborder" action="[% path_cgi %]" method="post" name="compose_mail">
[% IF subaction == "html_news_letter" %]
<h2>[%|loc%]Sending an html page to the list [%END%] <a class="input" href="[% path_cgi %]/nomenu/help/sendmsg" title="[%|loc%]Open in a new window[%END%]" onclick="window.open('','wws_help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=200')" target="wws_help">[%|loc%]Help[%END%]</a></h3>
<br />
[% END %]
<fieldset>
[%|loc(user.email)%]From: %1[%END%]<br />
[%|loc(mailto)%]To: %1[%END%]<br />
<label for="subject">[%|loc%]Subject:[%END%] <input id="subject" type="text" size="45" name="subject" value="[% subject %]" /></label>
[% IF subaction == "html_news_letter" %]
<input type="hidden" name="html_news_letter" value="[% subaction %]" />
[% END %]
<input type="hidden" name="action" value="send_mail"/>
<input class="MainMenuLinks" type="submit" name="sub_action_sendmailtolist" value="Send to the list" [%- IF topic_required -%] onclick="return checkbox_check_topic(compose_mail)" [% END %]/>
<input class="MainMenuLinks" type="submit" name="sub_action_sendmailtome" value="Send to me" [%- IF topic_required -%] onclick="return checkbox_check_topic(compose_mail)" [% END %]/>
<br />
<input type="hidden" name="in_reply_to" value="[% in_reply_to %]" />
<input type="hidden" name="message_id" value="[% message_id %]" />
<input type="hidden" name="list" value="[% list %]" />
[% SET counter = 0 %]
[% SET stringto = '' %]
[% FOREACH r = recipients %]
[% IF counter == 0 %]
[% stringto = r.value.local_to _ ' ' _ r.value.domain_to %]
[% counter = 1 %]
[% ELSE %]
[% stringto = stringto _ ',' _ r.value.local_to _ ' ' _ r.value.domain_to %]
[% END %]
[% END %]
<input type="hidden" name="to" value="[% stringto %]" />
[% IF request_topic %]
<br />
[%|loc%]This list is configured to require topic(s).[%END%]
<br />
[%|loc%]Please select one or more topic(s) that corresponds to your message:[%END%]
<br />
[% FOREACH t = available_topics %]
<input type="checkbox" name="topic_[%t.name%]" value="1"/> [% t.title %]
<br />
[% END %]
<br />
[% END %]
[% IF !subaction %]
<textarea name="body" cols="80" rows="25"></textarea>
[% END %]
[% IF subaction == "html_news_letter" %]
<label for="url">[%|loc%]URL:[%END%] <input id="url" type="text" size="45" name="url" value="[% url %]" /></label>
<br /><br />
[% END %]
</fieldset>
</form>
</div>
<!-- end compose_mail.tt2 -->
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment