# HG changeset patch # User ARAKI Tsuyohito # Date 1436963520 -32400 # Node ID b5fc067681306b0d6700ad0f01785ffeb6d0ee3e # Parent 9a3f2bd8c9e0d80a58bd4c024550ed23403b4b9b .htaccess 2014 diff -r 9a3f2bd8c9e0 -r b5fc06768130 oasis2015/admin/.htaccess --- a/oasis2015/admin/.htaccess Wed Jul 15 21:30:14 2015 +0900 +++ b/oasis2015/admin/.htaccess Wed Jul 15 21:32:00 2015 +0900 @@ -2,7 +2,7 @@ AddType "text/html; charset=utf-8" .rb AddType "text/html; charset=utf-8" .html Options +ExecCGI -AuthUserFile /home/www/skip/oasis2015/admin2/.htpasswd +AuthUserFile /home/www/skip/2014OC/admin/.htpasswd AuthGroupFile /dev/null AuthName "HOGE" AuthType Basic diff -r 9a3f2bd8c9e0 -r b5fc06768130 oasis2015/admin/.htpasswd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oasis2015/admin/.htpasswd Wed Jul 15 21:32:00 2015 +0900 @@ -0,0 +1,1 @@ +c113007:QRf28ARYqd/FY diff -r 9a3f2bd8c9e0 -r b5fc06768130 oasis2015/admin2/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oasis2015/admin2/.htaccess Wed Jul 15 21:32:00 2015 +0900 @@ -0,0 +1,9 @@ +AddHandler cgi-script .rb +AddType "text/html; charset=utf-8" .rb +AddType "text/html; charset=utf-8" .html +Options +ExecCGI +AuthUserFile /home/www/skip/2014OC/admin/.htpasswd +AuthGroupFile /dev/null +AuthName "ǧ¾Ú¥µ¥¤¥È" +AuthType Basic +require valid-user diff -r 9a3f2bd8c9e0 -r b5fc06768130 oasis2015/admin2/.htpasswd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oasis2015/admin2/.htpasswd Wed Jul 15 21:32:00 2015 +0900 @@ -0,0 +1,2 @@ +Murakami:7Y005Wtya7Ogw +test:tebUY14UFwMKg diff -r 9a3f2bd8c9e0 -r b5fc06768130 oasis2015/admin2/drawLots.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oasis2015/admin2/drawLots.html Wed Jul 15 21:32:00 2015 +0900 @@ -0,0 +1,24 @@ + + + +Database delete + + + + + +

抽é¸ç”¨ãƒšãƒ¼ã‚¸

+

実行ã™ã‚‹ã¨ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ãŒæ›¸ã変ãˆã‚‰ã‚Œã¾ã™ã€‚

+

実行ã™ã‚‹éš›ã¯æ³¨æ„ã—ã¦ãã ã•ã„。

+
+

抽é¸ã‚’è¡Œã„ã¾ã™ã‹?
+ã¯ã„ +ã„ã„㈠+

+ + +
+

データ閲覧ページã«æˆ»ã‚‹

+ + diff -r 9a3f2bd8c9e0 -r b5fc06768130 oasis2015/admin2/drawLots.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oasis2015/admin2/drawLots.rb Wed Jul 15 21:32:00 2015 +0900 @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# -*- coding: utf-8 -*- + +require 'sqlite3' +require 'cgi' +require 'date' + +c = CGI.new(:tag_maker => "html5", :accept_charest => "UTF-8") +db = SQLite3::Database.new("../sql/stamp.sq3") + +add = ENV["REMOTE_ADDR"] + +if /^(172\.19\.5\.|172\.17\.54\.|172\.21\.90\.)|118.21.142.107|202.214.125.107|192.168.43.255/ =~ add +check = c['check'] + +printf("Content-type: text/html; charset=UTF-8\n\n") + +sum = 'SELECT SUM(rank) FROM main WHERE NOT id=1;' +rank_sum = db.execute(sum).flatten(2)[0].to_i + +t = Time.now +expires = Time.local(2014, 8, 17, 8, 50) +expires2 = Time.local(2014, 10, 25, 0, 00) +if t > expires && t < expires2 && rank_sum == 0 +else + check = "" + puts check +end + +if check == "OK" + begin + result = db.execute("select id,exp,rank from main;") + rescue + exit + end + all = Array.new + for id,lv,rank in result + if id == 1 || lv == 0 || rank.to_i != 0 + next + end + lv.to_i.times do + all << id + end + end + + tousen = Array.new(0) + atari1 = rand(all.length) + tousen << all[atari1] + all.delete_if {|x| x == tousen[0]} + + sql = "update main set rank = 1 where id = ?;" + db.execute(sql,tousen[0]) + + sql = "update main set rank = 2 where id = ?;" + while tousen.length < 4 + srand + atari2 = rand(all.length) + hoge = all[atari2] + tousen << all[atari2] + all.delete_if {|x| x == hoge} + db.execute(sql,hoge) + end + + i=0 + + printf("

1ç­‰ã¯IDãŒ%04dã®æ–¹!ãŠã‚ã§ã¨ãƒ¼!

\n",tousen[i].to_i-1) + printf("

2ç­‰ã¯IDãŒ%04dã¨%04dã¨%04dã®æ–¹!ãŠã‚ã§ã¨ãƒ¼!

\n",tousen[i+=1].to_i-1,tousen[i+=1].to_i-1,tousen[i+=1].to_i-1) +else + print"

抽é¸ã¯ã¾ã è¡Œã„ã¾ã›ã‚“よ

\n" +end +print'

抽é¸ãƒšãƒ¼ã‚¸ã«æˆ»ã‚‹

+

データ閲覧ページã«æˆ»ã‚‹

+' +else + printf("Content-type: text/html; charset=UTF-8\n\n") + + printf' + + +Delete table + + + +

管ç†è€…用ページã®ãŸã‚閲覧ã§ãã¾ã›ã‚“。

' +end +print'' diff -r 9a3f2bd8c9e0 -r b5fc06768130 oasis2015/admin2/monitor.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oasis2015/admin2/monitor.rb Wed Jul 15 21:32:00 2015 +0900 @@ -0,0 +1,91 @@ +#!/usr/bin/env ruby +#coding:utf-8 + +require'cgi' +require'sqlite3' + +db = SQLite3::Database.new("../sql/stamp.sq3") + +c = CGI.new(:accept_charaset => "UTF-8") + +add = ENV["REMOTE_ADDR"] + +if /^(172\.19\.5\.|172\.17\.54\.|172\.21\.90\.)|118.21.142.107|202.214.125.107/ =~ add +rank = c["rank"] +flag = 0 +text = "

登録者一覧を表示ã—ã¾ã™

\n" +begin + if rank == "y" + rank_reset = 'UPDATE main SET rank=0 WHERE NOT id=1;' + db.execute(rank_reset) + end + result = db.execute("select * from main;") + log = 'select * from logs;' + logs = db.execute(log) +rescue + flag = 1 + text = "

データãŒã‚ã‚Šã¾ã›ã‚“

\n" +end + +#rank = "n" + +printf("Content-type: text/html; charset=UTF-8\n\n") + +printf' + + + +Delete table + + +

データ閲覧ページ

' +puts text +if flag == 1 +else + print"\n" + result.each do |line| + printf("\n",line[0].to_i-1,line[1],line[2],line[3],line[4],line[8],line[9]) + end + print'
%04d%s%s%s%s%s%s
' + print'

+rankをリセットã—ã¾ã™ã‹?
+NO / +YES
+ +

+' +end + +print'

ログã®é–²è¦§

' +if flag == 1 +else + print'' + logs.each do |line| + hour = line[3].to_i/3600 + min = line[3].to_i%3600/60 + sec = line[3].to_i%3600%60 + printf("\n",line[0],line[1].to_i-1,line[2],hour,min,sec) + end + print"
%s%04d%s%d:%d:%d
" + print'

ãã®ä»–ã®æ“作

+ + + +
データ削除DELETE
抽é¸DRAW
+' +end +else + printf("Content-type: text/html; charset=UTF-8\n\n") + + printf' + + +Delete table + + +

管ç†è€…用ページã®ãŸã‚閲覧ã§ãã¾ã›ã‚“。

' +end + +print'' diff -r 9a3f2bd8c9e0 -r b5fc06768130 oasis2015/admin2/operation.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oasis2015/admin2/operation.html Wed Jul 15 21:32:00 2015 +0900 @@ -0,0 +1,27 @@ + + + +Database delete + + + + + +

データベース消去用

+

実行ã™ã‚‹ã¨ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ãŒå‰Šé™¤ã•ã‚Œã¾ã™ã€‚

+

実行ã™ã‚‹éš›ã¯æ³¨æ„ã—ã¦ãã ã•ã„。

+
+

本当ã«æ¶ˆã—ã¾ã™ã‹?
+ã¯ã„ +ã„ã„㈠+

+ + +
+

データ閲覧ページã«æˆ»ã‚‹

+ +
c111126@g.koeki-u.ac.jp
+ + + diff -r 9a3f2bd8c9e0 -r b5fc06768130 oasis2015/admin2/operation.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oasis2015/admin2/operation.rb Wed Jul 15 21:32:00 2015 +0900 @@ -0,0 +1,52 @@ +#!/usr/bin/env ruby +# -*- coding: utf-8 -*- + +require 'sqlite3' +require 'cgi' + +db = SQLite3::Database.new("../sql/stamp.sq3") +c = CGI.new(:accept_charaset => "UTF-8") + +add = ENV["REMOTE_ADDR"] + +printf("Content-type: text/html; charset=UTF-8\n\n") + +if /^(172\.19\.5\.|172\.17\.54\.|172\.21\.90\.)|118.21.142.107|202.214.125.107/ =~ add +check = c['check'] +if check == "OK" + begin + db.execute("drop table main;") + db.execute("drop table logs;") + text = "

データを削除ã—ã¾ã—ãŸã€‚

" + rescue + text = "

データãŒã‚ã‚Šã¾ã›ã‚“。

" + end +else + text = "データã¯å‰Šé™¤ã•ã‚Œã¾ã›ã‚“" +end + +printf(" + + +Delete table + + + +%s +

データ閲覧ページã¸

+

+ +", text) +print"

データ閲覧ページã«æˆ»ã‚‹

" +print"

削除ページã«æˆ»ã‚‹

" +else + printf' + + +Delete table + + + +

管ç†è€…用ページã®ãŸã‚閲覧ã§ãã¾ã›ã‚“。

' +end