[Affelio-cvs 637] CVS update: affelio_farm/admin/skelton/affelio/apps/diary/common

Back to archive index

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 = ('&lt;' => '<', '&gt;' => '>', '&quot;' => '"', '&apos;' => "'", '&copy;' => '(c)', '&amp;' => '&');
-	my %escaped = ('<' => '&lt;', '>' => '&gt;', '"' => '&quot;', '&apos;' => "'", '&' => '&amp;');
-	$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;


Affelio-cvs メーリングリストの案内
Back to archive index