[Cpan-forum-commit] rev 232 - in trunk: . bin lib/CPAN lib/CPAN/Forum/RM templates www/cgi

svn at pti.co.il svn at pti.co.il
Mon Jul 2 09:01:42 IDT 2007


Author: gabor
Date: 2007-07-02 09:01:42 +0300 (Mon, 02 Jul 2007)
New Revision: 232

Modified:
   trunk/
   trunk/Changes
   trunk/bin/populate.pl
   trunk/bin/setup.pl
   trunk/lib/CPAN/Forum.pm
   trunk/lib/CPAN/Forum/RM/Admin.pm
   trunk/lib/CPAN/Forum/RM/Notify.pm
   trunk/templates/admin.tmpl
   trunk/www/cgi/index.pl
Log:
added option to diable all e-mail notification
more documentation on how to setup the forum
chmod the database to 0777



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:12752
   + 7bc34947-122d-0410-bc5a-f898d2bb5f81:/local/cpan-forum:4090
8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:12752

Modified: trunk/Changes
===================================================================
--- trunk/Changes	2007-03-26 07:16:56 UTC (rev 231)
+++ trunk/Changes	2007-07-02 06:01:42 UTC (rev 232)
@@ -1,3 +1,4 @@
+  Added option to disable all e-mail notifications
 
 v0.12 
 

Modified: trunk/bin/populate.pl
===================================================================
--- trunk/bin/populate.pl	2007-03-26 07:16:56 UTC (rev 231)
+++ trunk/bin/populate.pl	2007-07-02 06:01:42 UTC (rev 232)
@@ -16,9 +16,11 @@
 
 
 
-my %opts;
+my %opts = (
+    cpan => 'http://www.cpan.org',
+);
 
-GetOptions(\%opts, "sendmail", "source=s", "dir=s", "fetch", "help") 
+GetOptions(\%opts, "sendmail", "source=s", "dir=s", "fetch", "help", "cpan") 
     or usage();
 usage() if $opts{help};
 usage() if not $opts{dir};
@@ -43,7 +45,7 @@
     # must have downloaded and un-gzip-ed
     # ~/mirror/cpan/modules/02packages.details.txt.gz 
     print "Fecthing  $opts{source} from CPAN\n";
-    getstore("http://www.cpan.org/modules/02packages.details.txt.gz", "$opts{source}.gz");
+    getstore("$opts{cpan}/modules/02packages.details.txt.gz", "$opts{source}.gz");
     print "Unzipping $opts{source}\n";
     system("gunzip $opts{source}.gz");
 }
@@ -182,7 +184,14 @@
     --source FILE   path to the 02packages.details.txt
     --dir DIR       directory of the database
     --fetch
+    --cpan URL      (default http://www.cpan.org ) 
     --help          this help
+
+If you have a local mirror:
+ cp /home/gabor/download/cpan/02packages.details.txt.gz db/
+ gunzip db/02packages.details.txt.gz
+ perl bin/populate.pl --dir db/
+
 END_USAGE
     exit;
 }

Modified: trunk/bin/setup.pl
===================================================================
--- trunk/bin/setup.pl	2007-03-26 07:16:56 UTC (rev 231)
+++ trunk/bin/setup.pl	2007-07-02 06:01:42 UTC (rev 232)
@@ -39,7 +39,9 @@
 mkdir $opts{dir} if not -e $opts{dir};
 CPAN::Forum::DBI->myinit("dbi:SQLite:$dbfile");
 CPAN::Forum::DBI->init_db("schema/schema.sql", $dbfile);
-chmod 0755, $dbfile;
+print "Turning database directory and database word writable, for now\n";
+chmod 0777, $opts{dir};
+chmod 0777, $dbfile;
 
 
 my $from = delete $opt{from};

Modified: trunk/lib/CPAN/Forum/RM/Admin.pm
===================================================================
--- trunk/lib/CPAN/Forum/RM/Admin.pm	2007-03-26 07:16:56 UTC (rev 231)
+++ trunk/lib/CPAN/Forum/RM/Admin.pm	2007-07-02 06:01:42 UTC (rev 232)
@@ -59,7 +59,8 @@
     my $q = $self->query;
 
     # fields that can have only one value
-    foreach my $field (qw(rss_size per_page from flood_control_time_limit )) {
+    foreach my $field (qw(rss_size per_page from flood_control_time_limit 
+                disable_email_notification)) {
         if (my ($conf) = CPAN::Forum::DB::Configure->find_or_create({field => $field})) {
             $conf->value($q->param($field));
             $conf->update;

Modified: trunk/lib/CPAN/Forum/RM/Notify.pm
===================================================================
--- trunk/lib/CPAN/Forum/RM/Notify.pm	2007-03-26 07:16:56 UTC (rev 231)
+++ trunk/lib/CPAN/Forum/RM/Notify.pm	2007-07-02 06:01:42 UTC (rev 232)
@@ -12,6 +12,12 @@
     my ($self, $post_id) = @_;
     
     my $post = CPAN::Forum::DB::Posts->retrieve($post_id);
+    if ($self->config("disable_email_notification")) {
+        warn "disabled";
+    } else {
+        warn "enabled";
+    }
+    return $self->config("disable_email_notification");
 
     my $message = 
         $self->_text2mail ($post->text) .

Modified: trunk/lib/CPAN/Forum.pm
===================================================================
--- trunk/lib/CPAN/Forum.pm	2007-03-26 07:16:56 UTC (rev 231)
+++ trunk/lib/CPAN/Forum.pm	2007-07-02 06:01:42 UTC (rev 232)
@@ -161,7 +161,7 @@
 
 Run:
 
-    perl bin/setup.pl 
+    perl bin/setup.pl --config CONFIG --dir db
 
 (you can now delete the CONFIG file)
 

Modified: trunk/templates/admin.tmpl
===================================================================
--- trunk/templates/admin.tmpl	2007-03-26 07:16:56 UTC (rev 231)
+++ trunk/templates/admin.tmpl	2007-07-02 06:01:42 UTC (rev 232)
@@ -31,6 +31,8 @@
 </p>
 <table>
 <tr><td>From address:</td><td><input name="from" value="<TMPL_VAR from>" size="50"></td></tr>
+<tr><td>Disable e-mail notification:</td>
+    <td><input name="disable_email_notification" type="checkbox" <TMPL_IF disable_email_notification>CHECKED</TMPL_IF> size="50"></td></tr>
 <tr><td>Page size:</td><td><input name="per_page" value="<TMPL_VAR per_page>" size="5"></td></tr>
 <tr><td>RSS size:</td><td><input name="rss_size" value="<TMPL_VAR rss_size>" size="5"></td></tr>
 <tr><td>Status:</td><td><select name="status">


Property changes on: trunk/www/cgi/index.pl
___________________________________________________________________
Name: svn:executable
   + *




More information about the Cpan-forum-commit mailing list