Browse files

login.cgi

  • Loading branch information...
1 parent 736177d commit 86b83725aa2adc4315d6be9d64d674e754b89e95 @nontan nontan committed Sep 25, 2012
Showing with 41 additions and 0 deletions.
  1. +41 −0 login.cgi
View
41 login.cgi
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+require './common.pl';
+use strict;
+use warnings;
+use DBI;
+
+# パラメータ取得
+my %data = Common::GetPara();
+my $login_name = $data{"login_name"};
+my $password = $data{"password"};
+
+# データベース接続
+my $conn = Common::ConnectDB();
+
+# ログイン認証処理
+my $login_id = Common::CheckLogin($conn, $login_name, $password);
+
+# データベースクローズ
+Common::CloseDB($conn);
+
+# データエスケープ
+$login_name =~ s/ /%20/g;
+$password =~ s/ /%20/g;
+
+# クッキーセット処理
+my $strCookie = "login_name=" . $login_name . " password=" . $password " login_id=" . $login_id;
+Common::SetCookie($strCookie, 3*60*60);
+
+print "Content-type: text/html\n\n";
+
+# 管理画面に移動させる
+print << "END_OF_HTML";
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=admin.cgi">
+</head>
+</html>
+END_OF_HTML
+
+exit;

0 comments on commit 86b8372

Please sign in to comment.