# -*-perl-*-
# Keitairc::Config
-# $Id: Config.pm,v 1.2 2008-01-09 18:45:53 morimoto Exp $
+# $Id: Config.pm,v 1.3 2008-01-13 12:12:55 morimoto Exp $
# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/Config.pm,v $
#
# Copyright (c) 2008 Jun Morimoto <morimoto@mrmt.net>
web_port web_title web_lines web_root
web_username web_password web_host
show_newmsgonly ping_delay reconnect_delay
+ smtp_server smtp_from smtp_to
template_dir version daemonize pid_dir plugin_dir)
);
--- /dev/null
+# -*-perl-*-
+# keitairc/lib/plugins/00postme
+# $Id: 00postme,v 1.1 2008-01-13 12:12:55 morimoto Exp $
+# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00postme,v $
+
+use Net::SMTP;
+
+$plugin = {
+ name => 'postme',
+ action_imprementation => sub {
+ my ($request, $name, $session_id, $param_string) = @_;
+ my $ci = new Keitairc::ClientInfo($request);
+ my $view = new Keitairc::View($::cf, $ci);
+
+ my $error = {};
+ $error->{no_smtp_server} = 1 unless $::cf->smtp_server();
+ $error->{no_smtp_from} = 1 unless $::cf->smtp_from();
+ $error->{no_smtp_to} = 1 unless $::cf->smtp_to();
+ if(keys(%{$error})){
+ $error->{has_error} = 1;
+ $error->{session_id} = $session_id;
+ return $view->render('postme.html', $error);
+ }
+
+ my $message = $request->content();
+ $message =~ s/^text=//;
+ $message =~ s/\+/ /g;
+ Encode::from_to($message, 'shiftjis', 'jis');
+
+ my $smtp = Net::SMTP->new($::cf->smtp_server());
+ $smtp->mail($::cf->smtp_from());
+ $smtp->to($::cf->smtp_to());
+ $smtp->data();
+ $smtp->datasend('To: ' . $::cf->smtp_to() . "\n");
+ $smtp->datasend("Subject: memo from keitairc\n");
+ $smtp->datasend("Content-Type: text/plain; charset=iso-2022-jp\n");
+ $smtp->datasend("MIME-Version: 1.0\n");
+ $smtp->datasend("\n");
+ $smtp->datasend($message);
+ $smtp->datasend("\n");
+ $smtp->dataend();
+ $smtp->quit();
+
+ my $p = {};
+ $p->{smtp_to} = $::cf->smtp_to();
+ $p->{session_id} = $session_id;
+ return $view->render('postme.html', $p);
+ }
+};
+
+1;
# -*-perl-*-
# keitairc/lib/plugins/10url
# URL\8f\88\97\9d
-# $Id: 10url,v 1.1 2008-01-09 19:30:34 morimoto Exp $
+# $Id: 10url,v 1.2 2008-01-13 12:12:55 morimoto Exp $
# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/10url,v $
$plugin = {
my $ci = new Keitairc::ClientInfo($request);
my $view = new Keitairc::View($::cf, $ci);
return $view->render('url.html', {
+ session_id => $session_id,
url => $param_string,
escaped_url => ::uri_escape($param_string),
ezweb => $ci->is_ezweb(),
# -*-perl-*-
# keitairc/lib/plugins/20mail
# \83\81\81[\83\8b\83A\83h\83\8c\83X
-# $Id: 20mail,v 1.1 2008-01-09 19:30:34 morimoto Exp $
+# $Id: 20mail,v 1.2 2008-01-13 12:12:55 morimoto Exp $
# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/20mail,v $
$plugin = {
my $ci = new Keitairc::ClientInfo($request);
my $view = new Keitairc::View($::cf, $ci);
return $view->render('mail.html', {
+ session_id => $session_id,
mail => $param_string,
});
}
# -*-perl-*-
# keitairc/lib/plugins/20phone
# \93d\98b\94Ô\8d\86
-# $Id: 20phone,v 1.2 2008-01-13 06:22:38 morimoto Exp $
+# $Id: 20phone,v 1.3 2008-01-13 12:12:55 morimoto Exp $
# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/20phone,v $
$plugin = {
my ($request, $name, $session_id, $param_string) = @_;
my $ci = new Keitairc::ClientInfo($request);
my $view = new Keitairc::View($::cf, $ci);
- return $view->render('phone.html', { phone => $param_string });
+ return $view->render('phone.html', {
+ session_id => $session_id,
+ phone => $param_string
+ });
}
};
Ò-Ù±ÄÞÚ½ <!-- tmpl_var mail -->
<hr />
- <form action="">
+ <form method="post" action="/<!-- tmpl_var session_id -->/postme">
<a accesskey="1" href="mailto:<!-- tmpl_var mail -->">[1] Ò-Ù\82ð\8dì\90¬</a><br />
Ò-Ù±ÄÞÚ½\82ðºËß-<br />
- <input type="text" value="<!-- tmpl_var mail -->" />
+ <input type="text" name="text" value="<!-- tmpl_var mail -->" />
+ <input type="submit" value="ÒÓ\91\97\90M"><br />
</form>
<hr />
- <a accesskey="8" href="../index">[8] Á¬ÈÙؽÄ</a>
+ <a accesskey="8" href="/<!-- tmpl_var session_id -->/index">[8] Á¬ÈÙؽÄ</a>
<hr />
<!-- tmpl_var timestamp --><br />
keitairc <!-- tmpl_var version -->
\93d\98b\94Ô\8d\86 <!-- tmpl_var phone -->
<hr />
- <form action="">
+ <form method="post" action="/<!-- tmpl_var session_id -->/postme">
<a accesskey="1" href="tel:<!-- tmpl_var phone -->">[1] \93d\98b\82ð\82©\82¯\82é</a><br />
<tmpl_if docomo>
<a accesskey="2" href="tel-av:<!-- tmpl_var phone -->">[2] TV\93d\98b\82ð\82©\82¯\82é</a><br />
</tmpl_if>
\93d\98b\94Ô\8d\86\82ðºËß-<br />
- <input type="text" value="<!-- tmpl_var phone -->" />
+ <input type="text" name="text" value="<!-- tmpl_var phone -->" />
+ <input type="submit" value="ÒÓ\91\97\90M"><br />
</form>
<hr />
- <a accesskey="8" href="../index">[8] Á¬ÈÙؽÄ</a>
+ <a accesskey="8" href="/<!-- tmpl_var session_id -->/index">[8] Á¬ÈÙؽÄ</a>
<hr />
<!-- tmpl_var timestamp --><br />
keitairc <!-- tmpl_var version -->
--- /dev/null
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" />
+ <meta http-equiv="Cache-Control" content="max-age=0" />
+ <tmpl_if viewport>
+ <meta name="viewport" content="width=device-width" />
+ <meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
+ </tmpl_if>
+ <title><!-- tmpl_var title -->: postme</title>
+ </head>
+ <body>
+
+ <tmpl_if has_error>
+ <tmpl_if no_smtp_server>
+ smtp_server\82ª\90Ý\92è\82³\82ê\82Ä\82¢\82Ü\82¹\82ñ\81B
+ </tmpl_if>
+ <tmpl_if no_smtp_from>
+ smtp_from\82ª\90Ý\92è\82³\82ê\82Ä\82¢\82Ü\82¹\82ñ\81B
+ </tmpl_if>
+ <tmpl_if no_smtp_to>
+ smtp_to\82ª\90Ý\92è\82³\82ê\82Ä\82¢\82Ü\82¹\82ñ\81B
+ </tmpl_if>
+ <tmpl_else>
+ <!-- tmpl_var smtp_to -->\82ÉÒ-Ù\82ð\91\97\90M\82µ\82Ü\82µ\82½\81B
+ </tmpl_if>
+
+ <hr />
+ <a accesskey="8" href="/<!-- tmpl_var session_id -->/index">[8] Á¬ÈÙؽÄ</a>
+ <hr />
+ <!-- tmpl_var timestamp --><br />
+ keitairc <!-- tmpl_var version -->
+ </body>
+</html>
<!-- tmpl_var url -->
<hr />
- <form action="">
+ <form method="post" action="/<!-- tmpl_var session_id -->/postme">
<a accesskey="1" href="<!-- tmpl_var url -->">
[1] \92¼\90Ú±¸¾½</a><br />
<a accesskey="2" href="http://mgw.hatena.ne.jp/?url=<!-- tmpl_var escaped_url -->&noimage=0&split=1">
[4] PC»²ÄËÞ-±\82ű¸¾½</a><br />
</tmpl_if>
URL\82ðºËß-<br />
- <input type="text" value="<!-- tmpl_var url -->" />
+ <input type="text" name="text" value="<!-- tmpl_var url -->" />
+ <input type="submit" value="ÒÓ\91\97\90M"><br />
</form>
<hr />
+ <a accesskey="8" href="/<!-- tmpl_var session_id -->/index">[8] Á¬ÈÙؽÄ</a>
+ <hr />
<!-- tmpl_var timestamp --><br />
keitairc <!-- tmpl_var version -->
</body>