Changeset 1356
- Timestamp:
- 03/03/07 11:39:19 (2 years ago)
- Files:
-
- feedmelinks/bin/add-link.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks/bin/add-link.pl
r1325 r1356 1 1 #!/usr/local/bin/perl 2 use strict; 3 4 use DBD::mysql; 2 5 use FeedMeLinks::Environment; 3 use strict; 6 use LWP; 7 use POSIX qw(strftime); 8 4 9 # takes an email as stdin, "authenticates" the sender against 5 10 # the FML db, uses the subject as the link name, the first … … 7 12 # to the link 8 13 9 use LWP;10 use DBD::mysql;11 12 14 my $verbose = 0; 15 my $now = strftime "%a %b %e %H:%M:%S %Y", localtime; 13 16 14 17 # flags … … 79 82 80 83 if( ! $dbh ) { 81 print LOG " can't connect to DB, fatal error\n";84 print LOG "$now [link-by-mail cant connect to DB]\n"; 82 85 die( "can't connect to DB, fatal error\n" ); 83 86 } … … 106 109 my $linkID = $sth->fetchrow_array; 107 110 if( $linkID ) { 108 print LOG "$ dbUser inserted new link $linkID via email\n";111 print LOG "$now [successfull likn-by-mail] $dbUser, link $linkID\n"; 109 112 110 113 $qs = "SELECT ID FROM linksGroups WHERE name = ? AND userid = ? AND isPrivate IS NULL"; … … 147 150 148 151 } else { 149 print LOG " cant find a tag for this link, searching for '$tagName' failed, and adding a new one failed";152 print LOG "$now [link-by-mail no tag found] $dbUser, '$tagName'\n"; 150 153 die( "cant find a tag for this link, searching for '$tagName' failed, and adding a new one failed" ); 151 154 } 152 155 } 153 156 } else { 154 print LOG " The email address $submitter isn't registered with any Feed Me Links user. Perhaps you registered under another name?";157 print LOG "$now [unregistered link-by-mail attempt] $submitter\n"; 155 158 die( "The email address $submitter isn't registered with any Feed Me Links user. Perhaps you registered under another name?" ); 156 159 }