[Affelio-cvs 1097] CVS update: affelio/apps/diary

Back to archive index

Yoshihisa Fukuhara higef****@users*****
2006年 3月 1日 (水) 17:13:44 JST


Index: affelio/apps/diary/edit_diary.cgi
diff -u affelio/apps/diary/edit_diary.cgi:1.12 affelio/apps/diary/edit_diary.cgi:removed
--- affelio/apps/diary/edit_diary.cgi:1.12	Tue Feb 21 00:54:04 2006
+++ affelio/apps/diary/edit_diary.cgi	Wed Mar  1 17:13:44 2006
@@ -1,97 +0,0 @@
-#!/usr/bin/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.
-
-require 'init.pl';
-#use Error qw(:try);
-
-$diary->checkAccess('write_diary');
-
-my $id = $afap->{cgi}->param('id') or $diary->errorExit('An article number was not specified');
-
-$diary->errorExit("The specified article does not exist") unless $diary->existsEntry($id);
-
-my $tmpl;
-
-# submitted
-if($afap->{cgi}->param('edit')) {
-#	try {
-		# send trackback ping
-		if ($afap->{cgi}->param('tping_url')) {
-			$diary->sendTrackbackPing($afap->{cgi}->param('tping_url'), $afap->{cgi}->param('title'), $afap->{cgi}->param('contents'), $id);
-		}
-	
-		$diary->updateEntry($id, $afap->{cgi}->param('title'), $afap->{cgi}->param('contents'));
-	
-		my $filename_1 = $afap->{cgi}->param('filename_1');
-		my $filename_2 = $afap->{cgi}->param('filename_2');
-
-		if ($afap->{cgi}->param('delete_images') or $filename_1 or $filename_2) {
-			$diary->removeUploadedImage($id);
-		}
-		if ($filename_1) {
-			$diary->saveUploadedImage($filename_1, $id);
-		}
-		if ($filename_2) {
-			$diary->saveUploadedImage($filename_2, $id);
-		}
-#	}
-#	catch Error with {
-#		my $e = shift;
-#		error($q, "Error: \n".$e);
-#	};
-
-	print $diary->getRedirection("show_diary.cgi?id=$id");
-	exit;
-}
-
-# deleted
-elsif($afap->{cgi}->param('delete')) {
-#	try {
-		$diary->removeEntry($id);
-#	}
-#	catch Error with {
-#		my $e = shift;
-#		error($q, "Error: \n".$e);
-#	};
-
-	print $diary->getRedirection("list_diary.cgi");
-	exit;
-}
-
-# confirm
-elsif($afap->{cgi}->param("delete_confirm")) {
-	$tmpl = HTML::Template->new(filename => "./templates/edit_diary_delete_confirm.tmpl");
-	my $entry = $diary->getEntry($id);
-	$tmpl->param(ID => $entry->{id});
-}
-
-# edit
-else {
-	$tmpl = HTML::Template->new(filename => "./templates/edit_diary_edit.tmpl");
-	my $entry = $diary->getEntry($id);
-	$entry->{contents} =~ s/<br[^>]*>/\n/g;
-	$tmpl->param(
-		ID => $entry->{id},
-		TITLE => $entry->{title}, 
-		CONTENTS => $entry->{contents},
-		DATETIME => "$entry->{year}/$entry->{month}/$entry->{day}",
-	);
-}
-
-print $diary->translate_templateL10N($diary->get_HTML_header);
-print $diary->translate_templateL10N($tmpl->output);
-print $diary->get_HTML_footer;
Index: affelio/apps/diary/external_blog.cgi
diff -u affelio/apps/diary/external_blog.cgi:1.10 affelio/apps/diary/external_blog.cgi:removed
--- affelio/apps/diary/external_blog.cgi:1.10	Fri Nov  4 16:41:09 2005
+++ affelio/apps/diary/external_blog.cgi	Wed Mar  1 17:13:44 2006
@@ -1,137 +0,0 @@
-#!/usr/bin/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.
-
-require 'init.pl';
-
-use Error qw(:try);
-
-my $urlfile = $diary->{datadir}.'url';
-
-my $writable = 0;
-if($afap->check_access("write_diary")){
-	$writable = 1;
-}
-
-eval { require XML::Parser; } or $diary->errorExit("XML::Parser is not available");
-
-# print header
-my $header =	
-	"Content-type: text/html; charset=UTF-8\n".
-	"Pragma: no-cache\n\n".
-	$afap->get_HTML_header($diary->{header_titile});
-
-# set url
-if ($afap->{cgi}->param('set_url')) {
-	$diary->setRDFURL($afap->{cgi}->param('url'));
-}
-# unset url
-elsif ($afap->{cgi}->param('remove_urlfile')) {
-	$diary->unsetRDFURL;
-	print $diary->getRedirection('list_diary.cgi');
-	exit;
-}
-
-# load rss file and get url of rdf
-my $rssfile = $diary->getRDFURL;
-
-# if file was not found, show configuration file
-unless ($rssfile) {
-	$diary->checkAccess('write_diary');
-	my $tmpl = new HTML::Template(filename => "./templates/external_blog_conf.tmpl");
-	print $header;
-	print $diary->translate_templateL10N($tmpl->output);
-	print $diary->get_HTML_footer;
-	exit;
-}
-
-# send request 
-my $req = new HTTP::Request(GET => $rssfile);
-my $ua  = new LWP::UserAgent;
-my $res = $ua->request($req);
-my $str;
-if ($res->is_success) {
-	$str = $res->content;
-	$str =~ s/&/&amp;/g; # escape '&'
-}
-else {
-	unlink($urlfile) if (-f $urlfile);
-	print $diary->errorExit("Failed to get RDF File");
-}
-
-# parse and output
-use lib 'extlib';
-use lib '../../extlib';
-use XML::RSS;
-
-my $rss = new XML::RSS;
-unless (eval { $rss->parse($str); }) {
-	$diary->unsetRDFURL;
-	$diary->errorExit("Failed to parse RDF File");
-}
-
-my @entries;
-my @entry_list;
-my $i = 0;
-foreach (@{ $rss->{items} }) {
-	push @entries, {
-		TITLE	=> $_->{'title'},
-		LINK	=> $_->{'link'},
-		CONTENTS=> &escape_html($_->{'description'}),
-		DATE	=> $_->{dc}->{'date'},
-	};
-	push @entry_list, {
-		TITLE	=> $_->{'title'},
-		LINK	=> $_->{'link'},
-	};
-	last if (++$i >= 10);
-}
-
-my $tmpl = new HTML::Template(filename => "./templates/external_blog.tmpl");
-$tmpl->param(
-	WRITABLE	=> $writable,
-	RSS_URL		=> $rssfile,
-	TITLE_MAIN	=> $rss->channel('title'),
-	LINK_MAIN	=> $rss->channel('link'),
-	ENTRIES		=> \@entries,
-	ENTRY_LIST	=> \@entry_list,
-);
-
-print $header;
-print $diary->translate_templateL10N($tmpl->output);
-print $diary->get_HTML_footer;
-
-sub escape_html {
-	my $html = shift;
-
-	if ($html =~ /&lt;/) {
-		$html =~ s/&lt;(.*)&gt;//g;
-		$html =~ s/&amp;/&/g;
-		$html =~ s/&(quot|apos);/"/g;
-	}
-
-	$html =~ s/&/&amp;/g;
-	$html =~ s/['"]/&quot;/g;
-	$html =~ s/<[^>]*>//g;
-	$html =~ s/</&lt;/g;
-	$html =~ s/>/&gt;/g;
-	
-	# allow <br>,<p>,<a>,<i>,<b>,<strong>,<em>,<u>,<font>
-#	$html =~ s/&lt;(\/?)(br|p|a|i|b|strong|em|u|font)[^&]*&gt;/<$1$2$3>/gi;
-#	$html =~ s/&lt;a +href=&quot;([^&]*)&quot;([^&]*)&gt;/<a href="$1" $2>/gi;
-	
-	return $html;
-}
Index: affelio/apps/diary/init.pl
diff -u affelio/apps/diary/init.pl:1.9 affelio/apps/diary/init.pl:removed
--- affelio/apps/diary/init.pl:1.9	Wed Jan 25 11:30:51 2006
+++ affelio/apps/diary/init.pl	Wed Mar  1 17:13:44 2006
@@ -1,47 +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 Affelio::misc::CGIError;
-#use Affelio::App::Admin;
-#
-use Diary;
-
-our $cgi = new CGI();
-
-our $afap = new AffelioApp(ConfigDir => Cwd::getcwd(),
-			   cgi => $cgi);
-
-if(our $mymode eq "owner"){
-    $afap->set_owner_mode();
-}
-
-our $diary = new Diary($afap);
-
-unless ($afap->check_access("DF_access")) {
-	$diary->accessErrorExit('Access Denied. You don\'t have permission to this application.');
-}
-
-##########################################################################
-1;
Index: affelio/apps/diary/no_output.cgi
diff -u affelio/apps/diary/no_output.cgi:1.2 affelio/apps/diary/no_output.cgi:removed
--- affelio/apps/diary/no_output.cgi:1.2	Fri Jul  1 11:06:39 2005
+++ affelio/apps/diary/no_output.cgi	Wed Mar  1 17:13:44 2006
@@ -1,26 +0,0 @@
-#!/usr/bin/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.
-
-require './common/header.pl';
-
-print "<table>\n<tr><th colspan=\"2\">Debug info</th></tr>\n";
-while(my ($key, $value) = each %{$afap->{cgi}->{'.fieldnames'}}) {
-	print "<tr><td>$key</td><td>$value</td></tr>\n";
-}
-print "</table>\n";
-
-require './common/footer.pl';
Index: affelio/apps/diary/show_diary.cgi
diff -u affelio/apps/diary/show_diary.cgi:1.10 affelio/apps/diary/show_diary.cgi:removed
--- affelio/apps/diary/show_diary.cgi:1.10	Tue Feb 21 00:54:04 2006
+++ affelio/apps/diary/show_diary.cgi	Wed Mar  1 17:13:44 2006
@@ -1,68 +0,0 @@
-#!/usr/bin/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.
-
-require 'init.pl';
-
-print $diary->translate_templateL10N($diary->get_HTML_header);
-
-my $id = $afap->{cgi}->param('id') or $diary->errorExit("An article number was not specified");
-
-$diary->errorExit("The specified article does not exist") unless $diary->existsEntry($id);
-
-my $entry = $diary->getEntry($id);
-
-my $tmpl = HTML::Template->new(filename => "./templates/show_diary.tmpl");
-
-# Diary
-$tmpl->param(
-	ID	=> $entry->{id},
-	MONTH	=> $entry->{month},
-	DAY	=> $entry->{day},
-	TITLE	=> $entry->{title},
-	CONTENTS=> $entry->{contents},
-	IMAGES	=> $diary->getUploadedImages($entry->{id}, 300, 300),
-);
-
-# Comment
-if($diary->getCommentsNo($id) > 0) {
-	$tmpl->param(HAS_COMMENTS => 1);
-	my @comments_param;
-	my @comments = $diary->getComments($id);
-	foreach(@comments) {
-		my ($sec, $min, $hour, $mday, $mon, $year) = localtime($_->{timestamp});
-		$mon += 1;
-
-		push @comments_param,
-		{
-			UNAME => $_->{user},
-			COMMENT_TIME => "$mon月$mday日$hour:$min",
-			COMMENT => $_->{comment}
-		};
-	}
-	$tmpl->param(COMMENTS => \@comments_param);
-}
-
-if($afap->check_access("write_comment")){
-    $tmpl->param("comment_write" => "true");
-}
-
-# Notify Trackback Ping URL
-print $diary->getURLDescription($id);
-
-print $diary->translate_templateL10N($tmpl->output);
-
-print $diary->get_HTML_footer;
Index: affelio/apps/diary/show_trackback.cgi
diff -u affelio/apps/diary/show_trackback.cgi:1.7 affelio/apps/diary/show_trackback.cgi:removed
--- affelio/apps/diary/show_trackback.cgi:1.7	Wed Jul  6 07:06:14 2005
+++ affelio/apps/diary/show_trackback.cgi	Wed Mar  1 17:13:44 2006
@@ -1,42 +0,0 @@
-#!/usr/bin/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.
-
-require 'init.pl';
-
-my $id = $afap->{cgi}->param('id') or $diary->errorExit('An article number was not specified');
-
-my $tmpl = HTML::Template->new(filename => "./templates/show_trackback.tmpl");
-
-my @ts = $diary->getTrackbacks($id);
-my @trackbacks;
-foreach (@ts) {
-	my ($sec, $min, $hour, $mday, $mon, $year) = localtime($_->{timestamp});
-	$year += 1900; $mon += 1;
-	push @trackbacks, {
-		TITLE		=> $diary->escape($_->{title}),
-		BLOG_NAME	=> $diary->escape($_->{blog_name}),
-		URL		=> $_->{url},
-		EXCERPT		=> $diary->escape($_->{excerpt}),
-		DATE		=> "$year-$mon-$mday",
-	};
-}
-$tmpl->param(PING_URL => $afap->get_site_info("web_root") . "/apps/$diary->{afap}->{install_name}/tb.cgi/$id", TRACKBACKS => \@trackbacks);
-
-print $diary->get_HTML_header;
-print $diary->getURLDescription($id);
-print $diary->translate_templateL10N($tmpl->output);
-print $diary->get_HTML_footer;
Index: affelio/apps/diary/write_comment.cgi
diff -u affelio/apps/diary/write_comment.cgi:1.12 affelio/apps/diary/write_comment.cgi:removed
--- affelio/apps/diary/write_comment.cgi:1.12	Tue Jul 12 06:05:15 2005
+++ affelio/apps/diary/write_comment.cgi	Wed Mar  1 17:13:44 2006
@@ -1,68 +0,0 @@
-#!/usr/bin/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.
-
-require 'init.pl';
-
-use Error qw(:try);
-
-$diary->checkAccess('write_comment');
-
-my $id = $afap->{cgi}->param('id') or $diary->errorExit('An article number was not specified');
-
-$diary->errorExit("The specified article does not exist") unless $diary->existsEntry($id);
-
-my $user = $afap->get_visitor_info("nickname");
-
-# Confirm
-if($afap->{cgi}->param('comment_confirm')) {
-	my $tmpl = HTML::Template->new(filename => "./templates/write_comment_confirm.tmpl");
-	$tmpl->param(COMMENT_SHOW => $diary->escape_comment($afap->{cgi}->param('comment')), COMMENT => $afap->{cgi}->param('comment'), ID => $id);
-	$tmpl->param(REQUIRE_NAME => 1) unless ($user);
-	print $diary->get_HTML_header;
-	print $diary->translate_templateL10N($diary->translate_templateL10N($tmpl->output));
-	print $diary->get_HTML_footer;
-}
-
-# Commit
-elsif($afap->{cgi}->param('comment_commit')) {
-
-	if(!$user){
-		$user = $diary->escape_comment($afap->{cgi}->param('visitor_name'));
-	}else{
-		$url = $afap->get_visitor_info('afid');
-		if ($url =~ /<a href="([^"]*)"/) {
-			$url = $1;
-		}
-		$url = $afap->get_site_info('web_root').'/outgoing.cgi?dest_url='.$url;
-		$user = "<a href=\"$url\">".$afap->get_visitor_info("nickname")."</a>";
-	}
-
-	try {
-		$diary->addComment($id, $user, $afap->{cgi}->param('comment'));
-	}
-	catch Error with {
-		my $e = shift;
-		error($q, "Error: \n".$e);
-	};
-
-	print $diary->getRedirection("show_diary.cgi?id=$id");
-	exit;
-}
-
-else {
-	$diary->errorExit('Invalid Access');
-}
Index: affelio/apps/diary/write_diary.cgi
diff -u affelio/apps/diary/write_diary.cgi:1.15 affelio/apps/diary/write_diary.cgi:removed
--- affelio/apps/diary/write_diary.cgi:1.15	Tue Feb 21 00:54:04 2006
+++ affelio/apps/diary/write_diary.cgi	Wed Mar  1 17:13:44 2006
@@ -1,89 +0,0 @@
-#!/usr/bin/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.
-
-our $mymode="owner";
-
-require 'init.pl';
-
-# Error handling causes "Internal Server Error" ... 
-# use Error qw(:try);
-
-$diary->checkAccess('write_diary');
-
-my $title = $afap->{cgi}->param('title');
-my $contents = $afap->{cgi}->param('contents');
-
-my $tmpl;
-if($afap->{cgi}->param('submit')) {
-#	try {
-		# add entry
-		$diary->addEntry($title, $contents);
-
-		$afap->post_news($title, 
-				 "", 
-				 $afap->get_visitor_info("nickname"),
-				 $afap->get_site_info("web_root") . "/apps/". 
-				 $afap->{install_name} . "/list_diary.cgi");
-	
-		# send trackback ping
-		if ($afap->{cgi}->param('tping_url')) {
-			$diary->sendTrackbackPing($afap->{cgi}->param('tping_url'), $title, $contents);
-		}
-
-		# update images
-		$diary->removeUploadedImage;
-		if ($afap->{cgi}->param('filename_1')) {
-			$diary->saveUploadedImage($afap->{cgi}->param('filename_1'));
-		}
-		if ($afap->{cgi}->param('filename_2')) {
-			$diary->saveUploadedImage($afap->{cgi}->param('filename_2'));
-		}
-		
-#	}
-#	catch Error with {
-#		my $e = shift;
-#		error($q, "Error: \n".$e);
-#	};
-
-	print $diary->getRedirection('list_diary.cgi');
-	exit;
-}
-else {
-    print $diary->translate_templateL10N($diary->get_HTML_header);
-
-	if($afap->{cgi}->param('confirm')) {
-		$tmpl =  new HTML::Template(filename => "./templates/write_diary_confirm.tmpl");
-		$tmpl->param(
-			TITLE_SHOW => $diary->escape($title),
-			CONTENTS_SHOW => $diary->escape($contents),
-		);
-	}
-	else { # edit
-		$tmpl =  new HTML::Template(filename => "./templates/write_diary_edit.tmpl");
-	}
-}
-
-if ($contents) {
-	$tmpl->param(
-		TITLE => $title,
-		CONTENTS => $contents,
-	);
-}
-
-print $diary->translate_templateL10N($tmpl->output);
-
-print $diary->get_HTML_footer;


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