[Yapcom-commit] rev 120 - in yapcom/trunk: . lib/YAPC templates

[prev] [thread] [next] [lurker] [Date index for 2003/12/17]

From: svn
Subject: [Yapcom-commit] rev 120 - in yapcom/trunk: . lib/YAPC templates
Date: 17:57 on 17 Dec 2003
Author: gabor
Date: 2003-12-17 17:57:48 +0200 (Wed, 17 Dec 2003)
New Revision: 120

Modified:
   yapcom/trunk/README
   yapcom/trunk/lib/YAPC/Config.pm
   yapcom/trunk/lib/YAPC/Organizer.pm
   yapcom/trunk/templates/message.tmpl
Log:
add option to enable/disable submitting proposals

Modified: yapcom/trunk/README
===================================================================
--- yapcom/trunk/README	2003-12-17 14:58:29 UTC (rev 119)
+++ yapcom/trunk/README	2003-12-17 15:57:48 UTC (rev 120)
@@ -35,6 +35,8 @@
 	PROPOSAL_LENGTHS (5, 30, 60, 90, 180)		* multiple
 	PROPOSAL_LANGUAGES (English Hebrew)		* multiple
 
+        set the following value if you want to enable proposals
+        ENABLE_PROPOSALS=1
 - make
 - make test
 

Modified: yapcom/trunk/lib/YAPC/Config.pm
===================================================================
--- yapcom/trunk/lib/YAPC/Config.pm	2003-12-17 14:58:29 UTC (rev 119)
+++ yapcom/trunk/lib/YAPC/Config.pm	2003-12-17 15:57:48 UTC (rev 120)
@@ -4,6 +4,7 @@
 use warnings;
 our (@STORAGE, $dir, $db_dir, $db_file, $TIMEOUT, $templates_dir, $skins_dir, $email_address, $cgi_path);
 our (@proposal_languages, @proposal_lengths, @admins, $docs_path, $html_path, $files_path);
+our ($enable_proposals);
 
 my $skin = $ENV{'PATH_INFO'} || "";
 $skin =~ s#^/##;
@@ -30,12 +31,14 @@
 $skins_dir = "";
 $skins_dir = "$dir/skins/$skin" if -d "$dir/skins/$skin";
 
-$email_address = $config{'SITE_EMAIL'} || 'yapc@xxxx.xxx.xx';
-$cgi_path      = $config{'CGI_PATH'}   || '/YAPC/2004';
-$files_path    = $config{'FILES_PATH'} || '/YAPC_files';
-$html_path     = $config{'HTML_PATH'}  || '/YAPC_html';
-$docs_path     = $config{'DOCS_PATH'}  || '/YAPC_docs';
+$email_address = $config{SITE_EMAIL} || 'yapc@xxxx.xxx.xx';
+$cgi_path      = $config{CGI_PATH}   || '/YAPC/2004';
+$files_path    = $config{FILES_PATH} || '/YAPC_files';
+$html_path     = $config{HTML_PATH}  || '/YAPC_html';
+$docs_path     = $config{DOCS_PATH}  || '/YAPC_docs';
 
+$enable_proposals     = $config{ENABLE_PROPOSALS}  || 0;
+
 # list of e-mail address of administrators whom will have extra rights
 @admins = ($config{'SITE_ADMINS'}) ? split /[\s,]+/, $config{'SITE_ADMINS'} : qw(gabor@xxx.xx.xx);
 

Modified: yapcom/trunk/lib/YAPC/Organizer.pm
===================================================================
--- yapcom/trunk/lib/YAPC/Organizer.pm	2003-12-17 14:58:29 UTC (rev 119)
+++ yapcom/trunk/lib/YAPC/Organizer.pm	2003-12-17 15:57:48 UTC (rev 120)
@@ -585,6 +585,11 @@
    my $talk;
    my $id = $self->is_logged_in;
 
+   if (not $YAPC::Config::enable_proposals and
+       not $self->is_admin_user($id)) {
+       return $self->send_message('no_proposals'); 
+   }
+   
    my $t = $self->_server_page('proposal');
    $t->param(ADMIN => $self->is_admin_user($id));
 

Modified: yapcom/trunk/templates/message.tmpl
===================================================================
--- yapcom/trunk/templates/message.tmpl	2003-12-17 14:58:29 UTC (rev 119)
+++ yapcom/trunk/templates/message.tmpl	2003-12-17 15:57:48 UTC (rev 120)
@@ -17,4 +17,9 @@
 <TMPL_IF NAME="no_such_person">
 No such person.
 </TMPL_IF>
+<TMPL_IF NAME="no_proposals">
+Thank you but we do not accept more proposals nor do allow you to change the old once.
+<p>
+Maybe next time.
+</TMPL_IF>
 <TMPL_INCLUDE NAME="footer.tmpl">

Generated at 18:35 on 17 Dec 2003 by mariachi 0.52