Tadashi Okoshi
slash****@users*****
2005年 10月 25日 (火) 04:20:46 JST
Index: affelio_farm/admin/skelton/affelio/apps/diary/common/checkwrite.pl
diff -u affelio_farm/admin/skelton/affelio/apps/diary/common/checkwrite.pl:1.1.1.1 affelio_farm/admin/skelton/affelio/apps/diary/common/checkwrite.pl:removed
--- affelio_farm/admin/skelton/affelio/apps/diary/common/checkwrite.pl:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/apps/diary/common/checkwrite.pl Tue Oct 25 04:20:46 2005
@@ -1,33 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# æ¸ãè¾¼ã¿ã¢ã¯ã»ã¹æ¨©éããã§ãã¯
-
-unless ($afap->check_access("write_diary")) {
-
-print<<ACCESS_ERR;
-<div id="afMain">
-<div class="information">
-<h3>ã¨ã©ã¼</h3>
-<p>ããªãã«ã¯ãã®ãã¼ã¸ã®æ¸ãè¾¼ã¿æ¨©éãããã¾ãã</p>
-</div>
-</div>
-ACCESS_ERR
-
-require ("./common/footer.pl");
-exit;
-}
-
Index: affelio_farm/admin/skelton/affelio/apps/diary/common/diary.pl
diff -u affelio_farm/admin/skelton/affelio/apps/diary/common/diary.pl:1.1.1.1 affelio_farm/admin/skelton/affelio/apps/diary/common/diary.pl:removed
--- affelio_farm/admin/skelton/affelio/apps/diary/common/diary.pl:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/apps/diary/common/diary.pl Tue Oct 25 04:20:46 2005
@@ -1,47 +0,0 @@
-#!/usr/bin/env perl
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-use strict;
-
-use Diary;
-
-my $diary = new Diary("ensf");
-
-if($ARGV[0] eq '-r') {
- my @res = $diary->getEntries($ARGV[1], $ARGV[2], $ARGV[3]);
- foreach(@res) {
- print "title: ".$_->{title}."\n\n".$_->{contents}."\n";
- }
-}
-elsif($ARGV[0] eq '-w') {
- $diary->addEntry($ARGV[1], $ARGV[2]);
- print "title: ".$ARGV[1]."\n\n".$ARGV[2]."\n";
-}
-elsif($ARGV[0] eq '-cw') {
- $diary->addComment($ARGV[1], $ARGV[2], $ARGV[3]);
- print "id => $ARGV[1]\nuser: $ARGV[2]\n$ARGV[3]\n";
-}
-elsif($ARGV[0] eq '-cr') {
- my @res = $diary->getComments($ARGV[1]);
- foreach(@res) {
- print "user: $_->{user}\n$_->{comment}\n";
- }
-}
-else {
- die("invalid arguments\n");
-}
-
Index: affelio_farm/admin/skelton/affelio/apps/diary/common/footer.pl
diff -u affelio_farm/admin/skelton/affelio/apps/diary/common/footer.pl:1.1.1.1 affelio_farm/admin/skelton/affelio/apps/diary/common/footer.pl:removed
--- affelio_farm/admin/skelton/affelio/apps/diary/common/footer.pl:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/apps/diary/common/footer.pl Tue Oct 25 04:20:46 2005
@@ -1,22 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-##########################################################################
-
-#HTML Footer Partãåºå
-print "\n</div>\n</div>\n\n";
-print $afap->get_HTML_footer();
-
-1;
Index: affelio_farm/admin/skelton/affelio/apps/diary/common/header.pl
diff -u affelio_farm/admin/skelton/affelio/apps/diary/common/header.pl:1.1.1.1 affelio_farm/admin/skelton/affelio/apps/diary/common/header.pl:removed
--- affelio_farm/admin/skelton/affelio/apps/diary/common/header.pl:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/apps/diary/common/header.pl Tue Oct 25 04:20:46 2005
@@ -1,118 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-use strict;
-
-use lib("../../extlib");
-use HTML::Template;
-use CGI;
-use Cwd;
-#
-use lib("../../lib");
-use AffelioApp;
-#
-use Diary;
-
-
-our $cgi = new CGI();
-
-#AffelioAppãåæå
-our $afap = new AffelioApp(ConfigDir => Cwd::getcwd(),
- cgi => $cgi);
-
-if(our $mymode eq "owner"){
- $afap->set_owner_mode();
-}
-
-#Content-typeãåºå
-print "Content-type: text/html; charset=UTF-8\n";
-print "Pragma: no-cache", "\n\n";
-
-#HTML Header Partãåºå
-print $afap->get_HTML_header("Affelio Diary");
-# èªã¿è¾¼ã¿ã¢ã¯ã»ã¹æ¨©éããã§ãã¯
-unless ($afap->check_access("DF_access")) {
- print "<div><div>";
- &errorExit("ããªãã«ã¯ãã®ãã¼ã¸ã®èªã¿è¾¼ã¿æ¨©éãããã¾ãã");
-}
-
-my $tmpl = HTML::Template->new(filename => "./templates/menu.tmpl");
-
-# ã«ã¬ã³ãã¼ã表示
-our $diary = new Diary($afap);
-
-my $calender = "";
-if($afap->{cgi}->param('year') and $afap->{cgi}->param('month')) {
- $calender = $diary->getCalender($afap->{cgi}->param('year'), $afap->{cgi}->param('month'));
-}
-elsif($afap->{cgi}->param('id')) {
- my $id =
- my @date = $diary->getall("SELECT year, month FROM $diary->{entry_table} WHERE id = ".$afap->{cgi}->param('id'));
- $calender = $diary->getCalender($date[0]->{year}, $date[0]->{month});
-}
-else {
- $calender = $diary->getCalender;
-}
-
-# ã¢ã¼ã«ã¤ããåå¾
-my @archives = $diary->getall("SELECT DISTINCT year, month FROM $diary->{entry_table} LIMIT 10");
-if($#archives >= 0) {
- shift @archives unless $archives[0]->{year};
- $tmpl->param(HAS_ARCHIVE => "1", ARCHIVES => \@archives);
-}
-
-# æè¿ã®ã¨ã³ããªã¼ãåå¾
-my @entries = $diary->getall("SELECT id, title FROM $diary->{entry_table} ORDER BY timestamp DESC LIMIT 5");
-if($#entries >= 0) {
- $tmpl->param(HAS_ENTRY => "1", RECENT_ENTRIES => \@entries);
-}
-
-$tmpl->param(CALENDER => $calender, RSS => $afap->get_site_info("web_root") . "/apps/diary/get_rss.cgi");
-
-$tmpl->param(access_control_URL => $afap->get_URL("access_control"));
-
-
-print $tmpl->output;
-
-# ã¨ã©ã¼ãåãã¦çµãã
-sub errorExit {
- my $msg = shift;
-print<<ACCESS_ERR;
-<div class="information">
-<h3>ã¨ã©ã¼</h3>
-<p>$msg</p>
-</div>
-ACCESS_ERR
-require ("./common/footer.pl");
- exit;
-}
-
-sub getParam {
- my $key = shift;
- my $val = $afap->{cgi}->param($key);
- if ($val) {
- $afap->set_session_param($key, $val);
- return $val;
- }
- return $afap->get_session_param($key);
-}
-
-sub unsetParam {
- my $key = shift;
- $afap->set_session_param($key, "");
-}
-
-##########################################################################
-1;
Index: affelio_farm/admin/skelton/affelio/apps/diary/common/rss.pl
diff -u affelio_farm/admin/skelton/affelio/apps/diary/common/rss.pl:1.1.1.1 affelio_farm/admin/skelton/affelio/apps/diary/common/rss.pl:removed
--- affelio_farm/admin/skelton/affelio/apps/diary/common/rss.pl:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/apps/diary/common/rss.pl Tue Oct 25 04:20:46 2005
@@ -1,55 +0,0 @@
-# RSSè§£æããã°ã©ã
-# ãã®ããã°ã©ã ã¯ä»¥ä¸ã®ãµã¤ãã«ãããã®ãå©ç¨ããã¦ããã ãã¾ããã
-# http://digit.que.ne.jp/work/index.cgi
-
-use strict;
-use Jcode;
-use Time::Local;
-
-sub parse_rss {
- my ($rss, $num) = @_;
- my @items = ();
- return unless ($rss);
- $num = 0 unless ($num =~ /^\d+$/);
- foreach my $item ($rss =~ /<item\b.*?>.*?<\/item>/gis) {
- my $parsed = {};
- foreach my $tag qw(title link description dc:date) {
- if ($item =~ /<$tag\b.*?>(.*?)<\/$tag>/is) {
- $parsed->{$tag} = &sanitize($1);
- }
- }
- $parsed->{'time'} = &date_to_time($parsed->{'dc:date'});
- push(@items, $parsed);
- last if ($num and @items >= $num);
- }
- return @items;
-}
-
-sub sanitize {
- my $str = shift;
- # remove tags and unescape
- my $re_tag_ = q{[^"'<>]*(?:"[^"]*"[^"'<>]*|'[^']*'[^"'<>]*)*(?:>|(?=<)|$(?!\n))}; #'};
- my $re_comment = '<!(?:--[^-]*-(?:[^-]+-)*?-(?:[^>-]*(?:-[^>-]+)*?)??)*(?:>|$(?!\n)|--.*$)';
- my $re_tag = qq{$re_comment|<$re_tag_};
- $str =~ s/$re_tag//g;
- # resanitize
- my %unescaped = ('<' => '<', '>' => '>', '"' => '"', ''' => "'", '©' => '(c)', '&' => '&');
- my %escaped = ('<' => '<', '>' => '>', '"' => '"', ''' => "'", '&' => '&');
- $str =~ s/&(lt|gt|quot|apos|copy|amp);/$unescaped{$1}/gio;
- $str =~ s/([<>"'&])/$escaped{$1}/go;
- return $str;
-}
-
-sub date_to_time {
- my $date = shift;
- if ($date =~ /^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d))?)?(Z|([+-]\d{2}):(\d{2}))?)?)?)?$/) {
- my ($year, $month, $day, $hour, $min, $sec) = ($1, ($2 ? $2 : 1), ($3 ? $3 : 1), $4, $5);
- my $offset = (abs($8) * 60 + $9) * ($8 >= 0 ? 60 : -60) if ($7);
- my $time = ($7) ? &Time::Local::timegm($sec, $min, $hour, $day, $month - 1, $year) - $offset
- : &Time::Local::timelocal($sec, $min, $hour, $day, $month - 1, $year) - $offset;
- return $time;
- }
- return undef;
-}
-
-1;
Index: affelio_farm/admin/skelton/affelio/apps/diary/common/util.pl
diff -u affelio_farm/admin/skelton/affelio/apps/diary/common/util.pl:1.1.1.1 affelio_farm/admin/skelton/affelio/apps/diary/common/util.pl:removed
--- affelio_farm/admin/skelton/affelio/apps/diary/common/util.pl:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/apps/diary/common/util.pl Tue Oct 25 04:20:46 2005
@@ -1,23 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-sub markupURL {
- my $text = shift;
- $text =~ s/(s?https?:\/\/[-_.!~*'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/<a href="$1">$1<\/a>/g;
- return $text;
-}
-
-1;