[Cpan-forum-commit] rev 21 - in trunk: . lib/CPAN templates
svn at pti.co.il
svn at pti.co.il
Sat Jan 15 23:44:55 IST 2005
Author: gabor
Date: 2005-01-15 23:44:55 +0200 (Sat, 15 Jan 2005)
New Revision: 21
Added:
trunk/templates/help.tmpl
Modified:
trunk/MANIFEST
trunk/lib/CPAN/Forum.pm
trunk/templates/editor.tmpl
trunk/templates/faq.tmpl
Log:
restrict subject line characters and provide a help page
Modified: trunk/MANIFEST
===================================================================
--- trunk/MANIFEST 2005-01-15 19:18:46 UTC (rev 20)
+++ trunk/MANIFEST 2005-01-15 21:44:55 UTC (rev 21)
@@ -31,6 +31,7 @@
t/lib/CGI/Application/Test.pm
templates/change_password.tmpl
+templates/help.tmpl
templates/pwreminder.tmpl
templates/register.tmpl
templates/editor.tmpl
Modified: trunk/lib/CPAN/Forum.pm
===================================================================
--- trunk/lib/CPAN/Forum.pm 2005-01-15 19:18:46 UTC (rev 20)
+++ trunk/lib/CPAN/Forum.pm 2005-01-15 21:44:55 UTC (rev 21)
@@ -464,6 +464,7 @@
about faq
posts threads dist users
search all
+ help
rss );
my @restricted_modes = qw(
new_post process_post
@@ -473,6 +474,7 @@
my @urls = qw(
logout
+ help
new_post pwreminder
login register
posts about
@@ -1152,6 +1154,9 @@
my $new_text = $q->param("new_text");
push @errors, "no_subject" if not $new_subject;
+ my $SUBJECT = qr{[\w .:~!@#\$%^&*\()+=-]+};
+ push @errors, "invalid_subject" if $new_subject and $new_subject !~ m{^$SUBJECT$};
+
push @errors, "no_text" if not $new_text;
push @errors, "subject_too_long" if $new_subject and length($new_subject) > 50;
return $self->posts(\@errors) if @errors;
@@ -1788,6 +1793,11 @@
return $_[0];
}
+
+sub help {
+ $_[0]->load_tmpl("help.tmpl")->output;
+}
+
1;
=head1 ACKNOWLEDGEMENTS
Modified: trunk/templates/editor.tmpl
===================================================================
--- trunk/templates/editor.tmpl 2005-01-15 19:18:46 UTC (rev 20)
+++ trunk/templates/editor.tmpl 2005-01-15 21:44:55 UTC (rev 21)
@@ -2,6 +2,8 @@
<div class="error">
<TMPL_IF no_group>No distribution name provided<br /></TMPL_IF>
<TMPL_IF no_subject>No subject provided<br /></TMPL_IF>
+ <TMPL_IF invalid_subject>The subject contained and invalid character
+ <a href="/help/">help</a><br /></TMPL_IF>
<TMPL_IF no_text>No text provided<br /></TMPL_IF>
<TMPL_IF bad_group>Bad distribution name<br /></TMPL_IF>
<TMPL_IF bad_data>Bad data<br /></TMPL_IF>
Modified: trunk/templates/faq.tmpl
===================================================================
--- trunk/templates/faq.tmpl 2005-01-15 19:18:46 UTC (rev 20)
+++ trunk/templates/faq.tmpl 2005-01-15 21:44:55 UTC (rev 21)
@@ -104,7 +104,7 @@
</ol>
When looking at the page of each module (/dist/Module-Name) you'll see a link to configure
the notification level for that module. By default you don't get any mail. When you want to change
- your subscription you can do it from <a href="/mypan">MyPAN</a>
+ your subscription you can do it from <a href="/mypan/">MyPAN</a>
</dd>
</dl>
</div>
Added: trunk/templates/help.tmpl
===================================================================
--- trunk/templates/help.tmpl 2005-01-15 19:18:46 UTC (rev 20)
+++ trunk/templates/help.tmpl 2005-01-15 21:44:55 UTC (rev 21)
@@ -0,0 +1,10 @@
+<TMPL_INCLUDE NAME="head.tmpl">
+<p id="pageTitle">Help</p>
+
+<TMPL_INCLUDE NAME="navigation.tmpl">
+<p>
+Currently the subject line is restricted to alphanumerical characters and some extra characters.
+If your favorite character is not in there, just send an e-mail, and we'll what can we do.
+</p>
+
+<TMPL_INCLUDE NAME="footer.tmpl">
More information about the Cpan-forum-commit
mailing list