qwikdoc 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +5 -0
- data/.rspec +2 -0
- data/CHANGES +3 -0
- data/COPYING +340 -0
- data/Gemfile +3 -0
- data/README.md +10 -0
- data/Rakefile +10 -0
- data/TextFormattingRules +137 -0
- data/TextFormattingRules.ja +143 -0
- data/bin/qwikdoc +34 -0
- data/lib/qwik_doc.rb +15 -0
- data/lib/qwik_doc/hack.rb +184 -0
- data/qwikdoc.gemspec +26 -0
- data/spec/qwik_doc_spec.rb +305 -0
- data/spec/spec_helper.rb +12 -0
- data/vendor/qwik/Makefile +63 -0
- data/vendor/qwik/Rakefile +17 -0
- data/vendor/qwik/act-aa.rb +83 -0
- data/vendor/qwik/act-archive.rb +386 -0
- data/vendor/qwik/act-attach.rb +304 -0
- data/vendor/qwik/act-backup.rb +236 -0
- data/vendor/qwik/act-basic.rb +325 -0
- data/vendor/qwik/act-book.rb +161 -0
- data/vendor/qwik/act-calc.rb +371 -0
- data/vendor/qwik/act-charset.rb +251 -0
- data/vendor/qwik/act-christel.rb +112 -0
- data/vendor/qwik/act-chronology.rb +149 -0
- data/vendor/qwik/act-code.rb +155 -0
- data/vendor/qwik/act-comment.rb +554 -0
- data/vendor/qwik/act-config.rb +49 -0
- data/vendor/qwik/act-counter.rb +125 -0
- data/vendor/qwik/act-day.rb +96 -0
- data/vendor/qwik/act-describe.rb +135 -0
- data/vendor/qwik/act-diary.rb +109 -0
- data/vendor/qwik/act-edit.rb +317 -0
- data/vendor/qwik/act-embed-html.rb +296 -0
- data/vendor/qwik/act-emode.rb +150 -0
- data/vendor/qwik/act-event.rb +187 -0
- data/vendor/qwik/act-file.rb +303 -0
- data/vendor/qwik/act-files.rb +771 -0
- data/vendor/qwik/act-getpass.rb +295 -0
- data/vendor/qwik/act-history.rb +136 -0
- data/vendor/qwik/act-html.rb +204 -0
- data/vendor/qwik/act-httpauth.rb +147 -0
- data/vendor/qwik/act-include.rb +142 -0
- data/vendor/qwik/act-interwiki.rb +189 -0
- data/vendor/qwik/act-isearch.rb +109 -0
- data/vendor/qwik/act-keywords.rb +137 -0
- data/vendor/qwik/act-lang.rb +81 -0
- data/vendor/qwik/act-license.rb +63 -0
- data/vendor/qwik/act-list.rb +287 -0
- data/vendor/qwik/act-login.rb +410 -0
- data/vendor/qwik/act-logout.rb +60 -0
- data/vendor/qwik/act-mail.rb +159 -0
- data/vendor/qwik/act-map.rb +292 -0
- data/vendor/qwik/act-md5.rb +42 -0
- data/vendor/qwik/act-mdlb.rb +741 -0
- data/vendor/qwik/act-media.rb +416 -0
- data/vendor/qwik/act-member.rb +157 -0
- data/vendor/qwik/act-menu.rb +142 -0
- data/vendor/qwik/act-metadata.rb +323 -0
- data/vendor/qwik/act-mlsubmitform.rb +49 -0
- data/vendor/qwik/act-monitor.rb +167 -0
- data/vendor/qwik/act-new.rb +418 -0
- data/vendor/qwik/act-pagelist.rb +248 -0
- data/vendor/qwik/act-password.rb +145 -0
- data/vendor/qwik/act-plan.rb +210 -0
- data/vendor/qwik/act-povray.rb +230 -0
- data/vendor/qwik/act-presen.rb +380 -0
- data/vendor/qwik/act-redirect.rb +133 -0
- data/vendor/qwik/act-ring.rb +1071 -0
- data/vendor/qwik/act-rrefs.rb +255 -0
- data/vendor/qwik/act-ruby.rb +116 -0
- data/vendor/qwik/act-sample.rb +170 -0
- data/vendor/qwik/act-save.rb +295 -0
- data/vendor/qwik/act-schedule.rb +374 -0
- data/vendor/qwik/act-search.rb +180 -0
- data/vendor/qwik/act-searchwords.rb +51 -0
- data/vendor/qwik/act-sendpass.rb +83 -0
- data/vendor/qwik/act-site.rb +89 -0
- data/vendor/qwik/act-sitebackup.rb +419 -0
- data/vendor/qwik/act-sitelog.rb +118 -0
- data/vendor/qwik/act-smil.rb +299 -0
- data/vendor/qwik/act-status.rb +220 -0
- data/vendor/qwik/act-style.rb +608 -0
- data/vendor/qwik/act-table.rb +263 -0
- data/vendor/qwik/act-tableform.rb +241 -0
- data/vendor/qwik/act-tag.rb +103 -0
- data/vendor/qwik/act-text.rb +70 -0
- data/vendor/qwik/act-textarea.rb +164 -0
- data/vendor/qwik/act-theme.rb +346 -0
- data/vendor/qwik/act-toc.rb +112 -0
- data/vendor/qwik/act-typekey.rb +198 -0
- data/vendor/qwik/act-under-const.rb +94 -0
- data/vendor/qwik/act-webservice.rb +321 -0
- data/vendor/qwik/act-wema.rb +558 -0
- data/vendor/qwik/act-wysiwyg.rb +238 -0
- data/vendor/qwik/action.rb +325 -0
- data/vendor/qwik/autoreload.rb +98 -0
- data/vendor/qwik/bench-bench.rb +28 -0
- data/vendor/qwik/bench-emode.rb +47 -0
- data/vendor/qwik/bench-format-xml.rb +70 -0
- data/vendor/qwik/bench-large-table.rb +62 -0
- data/vendor/qwik/bench-md5.rb +14 -0
- data/vendor/qwik/bench-module-session.rb +19 -0
- data/vendor/qwik/bench-page.rb +50 -0
- data/vendor/qwik/bench-s-md5.rb +28 -0
- data/vendor/qwik/bench-session.rb +25 -0
- data/vendor/qwik/bench-textformat.rb +31 -0
- data/vendor/qwik/catalog-factory.rb +91 -0
- data/vendor/qwik/catalog-ja.rb +479 -0
- data/vendor/qwik/catalog-ml-ja.rb +145 -0
- data/vendor/qwik/check-act-monitor.rb +112 -0
- data/vendor/qwik/check-act-monitor2.rb +46 -0
- data/vendor/qwik/check-act-theme.rb +27 -0
- data/vendor/qwik/check-event.rb +112 -0
- data/vendor/qwik/check-event2.rb +55 -0
- data/vendor/qwik/check-htree-rexml.rb +77 -0
- data/vendor/qwik/check-htree.rb +51 -0
- data/vendor/qwik/check-libxml.rb +135 -0
- data/vendor/qwik/check-many-pages.rb +47 -0
- data/vendor/qwik/check-monitor.rb +33 -0
- data/vendor/qwik/check-observer.rb +67 -0
- data/vendor/qwik/check-server.rb +61 -0
- data/vendor/qwik/check-uuencode.rb +33 -0
- data/vendor/qwik/check-webdav.rb +65 -0
- data/vendor/qwik/check-xml-xpath.rb +27 -0
- data/vendor/qwik/common-backtrace.rb +94 -0
- data/vendor/qwik/common-basic.rb +111 -0
- data/vendor/qwik/common-condition.rb +142 -0
- data/vendor/qwik/common-error.rb +48 -0
- data/vendor/qwik/common-gettext.rb +50 -0
- data/vendor/qwik/common-javascript.rb +45 -0
- data/vendor/qwik/common-notice.rb +132 -0
- data/vendor/qwik/common-plain.rb +105 -0
- data/vendor/qwik/common-plugin.rb +111 -0
- data/vendor/qwik/common-res.rb +76 -0
- data/vendor/qwik/common-resolve.rb +92 -0
- data/vendor/qwik/common-send.rb +171 -0
- data/vendor/qwik/common-session.rb +139 -0
- data/vendor/qwik/common-surface.rb +261 -0
- data/vendor/qwik/common-url.rb +90 -0
- data/vendor/qwik/compat/Makefile +12 -0
- data/vendor/qwik/compat/add_load_path.rb +1 -0
- data/vendor/qwik/config.rb +299 -0
- data/vendor/qwik/db-b-backup.rb +142 -0
- data/vendor/qwik/db-backup.rb +184 -0
- data/vendor/qwik/db-berkeley.rb +306 -0
- data/vendor/qwik/db-filesystem.rb +305 -0
- data/vendor/qwik/db-indexer.rb +154 -0
- data/vendor/qwik/db-searchwords.rb +238 -0
- data/vendor/qwik/description-ja.rb +267 -0
- data/vendor/qwik/description.rb +256 -0
- data/vendor/qwik/dev-add-copyright.rb +23 -0
- data/vendor/qwik/dev-backup.rb +24 -0
- data/vendor/qwik/dev-bench.rb +175 -0
- data/vendor/qwik/dev-calctime.rb +52 -0
- data/vendor/qwik/dev-css-compressor.rb +60 -0
- data/vendor/qwik/dev-extract-catalog.rb +102 -0
- data/vendor/qwik/dev-js-compressor.rb +73 -0
- data/vendor/qwik/dev-release.rb +235 -0
- data/vendor/qwik/dev-replace.rb +353 -0
- data/vendor/qwik/dev-sendmail.rb +25 -0
- data/vendor/qwik/farm.rb +283 -0
- data/vendor/qwik/gettext.rb +56 -0
- data/vendor/qwik/group-cond.rb +157 -0
- data/vendor/qwik/group-config.rb +247 -0
- data/vendor/qwik/group-confirm.rb +147 -0
- data/vendor/qwik/group-db.rb +326 -0
- data/vendor/qwik/group-mail.rb +195 -0
- data/vendor/qwik/group-member.rb +307 -0
- data/vendor/qwik/group-sendmail.rb +231 -0
- data/vendor/qwik/group-site.rb +374 -0
- data/vendor/qwik/group-sweep.rb +63 -0
- data/vendor/qwik/group.rb +157 -0
- data/vendor/qwik/helper.rb +6 -0
- data/vendor/qwik/html-generator.rb +104 -0
- data/vendor/qwik/html-to-wabisabi.rb +149 -0
- data/vendor/qwik/htree-diff.rb +87 -0
- data/vendor/qwik/htree-format-xml.rb +57 -0
- data/vendor/qwik/htree-generator.rb +144 -0
- data/vendor/qwik/htree-get.rb +251 -0
- data/vendor/qwik/htree-html-generator.rb +179 -0
- data/vendor/qwik/htree-template.rb +263 -0
- data/vendor/qwik/htree-to-wabisabi.rb +171 -0
- data/vendor/qwik/loadlib.rb +79 -0
- data/vendor/qwik/logger.rb +115 -0
- data/vendor/qwik/mail-body.rb +171 -0
- data/vendor/qwik/mail-header.rb +474 -0
- data/vendor/qwik/mail-multipart.rb +193 -0
- data/vendor/qwik/mail-parse.rb +147 -0
- data/vendor/qwik/mail.rb +341 -0
- data/vendor/qwik/mailaddress.rb +83 -0
- data/vendor/qwik/mdlb-model.rb +81 -0
- data/vendor/qwik/mdlb-sample.rb +324 -0
- data/vendor/qwik/ml-catalog-factory.rb +27 -0
- data/vendor/qwik/ml-exception.rb +15 -0
- data/vendor/qwik/ml-generator.rb +28 -0
- data/vendor/qwik/ml-gettext.rb +137 -0
- data/vendor/qwik/ml-logger.rb +82 -0
- data/vendor/qwik/ml-memory.rb +65 -0
- data/vendor/qwik/ml-msg-validator.rb +86 -0
- data/vendor/qwik/ml-processor.rb +609 -0
- data/vendor/qwik/ml-quickml-server.rb +122 -0
- data/vendor/qwik/ml-sendmail.rb +0 -0
- data/vendor/qwik/ml-server.rb +107 -0
- data/vendor/qwik/ml-session.rb +348 -0
- data/vendor/qwik/ml-sweeper.rb +101 -0
- data/vendor/qwik/mock-logger.rb +65 -0
- data/vendor/qwik/mock-sendmail.rb +78 -0
- data/vendor/qwik/mock-socket.rb +82 -0
- data/vendor/qwik/modulobe.rb +406 -0
- data/vendor/qwik/mongrel-server.rb +72 -0
- data/vendor/qwik/page-files.rb +249 -0
- data/vendor/qwik/page-generate.rb +82 -0
- data/vendor/qwik/page-get.rb +262 -0
- data/vendor/qwik/page-images.rb +168 -0
- data/vendor/qwik/page-put.rb +128 -0
- data/vendor/qwik/page-rrefs.rb +154 -0
- data/vendor/qwik/page-title.rb +0 -0
- data/vendor/qwik/page-wikidb.rb +234 -0
- data/vendor/qwik/page.rb +67 -0
- data/vendor/qwik/pages.rb +444 -0
- data/vendor/qwik/parse-plugin.rb +249 -0
- data/vendor/qwik/parser-emode.rb +116 -0
- data/vendor/qwik/parser-inline.rb +273 -0
- data/vendor/qwik/parser.rb +350 -0
- data/vendor/qwik/password.rb +183 -0
- data/vendor/qwik/periodic.rb +79 -0
- data/vendor/qwik/qp.rb +56 -0
- data/vendor/qwik/qwik-service.rb +341 -0
- data/vendor/qwik/qwik.rb +5 -0
- data/vendor/qwik/qwikweb-adduser.rb +34 -0
- data/vendor/qwik/qwikweb-catalog-validator.rb +110 -0
- data/vendor/qwik/qwikweb-incgen.rb +28 -0
- data/vendor/qwik/qwikweb-makesite.rb +41 -0
- data/vendor/qwik/qwikweb-server.rb +44 -0
- data/vendor/qwik/qwikweb-showpassword.rb +26 -0
- data/vendor/qwik/qwikweb-watchlog.rb +67 -0
- data/vendor/qwik/request-path.rb +304 -0
- data/vendor/qwik/request-ua.rb +76 -0
- data/vendor/qwik/request-webrick.rb +81 -0
- data/vendor/qwik/request.rb +91 -0
- data/vendor/qwik/resolve-tdiary.rb +292 -0
- data/vendor/qwik/resolve.rb +121 -0
- data/vendor/qwik/response.rb +228 -0
- data/vendor/qwik/server-memory.rb +57 -0
- data/vendor/qwik/server-webrick.rb +102 -0
- data/vendor/qwik/server.rb +252 -0
- data/vendor/qwik/site-config.rb +149 -0
- data/vendor/qwik/site-db.rb +136 -0
- data/vendor/qwik/site-event.rb +162 -0
- data/vendor/qwik/site-files.rb +86 -0
- data/vendor/qwik/site-group.rb +103 -0
- data/vendor/qwik/site-index.rb +47 -0
- data/vendor/qwik/site-log.rb +64 -0
- data/vendor/qwik/site-member.rb +230 -0
- data/vendor/qwik/site-monitor.rb +97 -0
- data/vendor/qwik/site-pages.rb +62 -0
- data/vendor/qwik/site-plan.rb +139 -0
- data/vendor/qwik/site-report.rb +282 -0
- data/vendor/qwik/site-resolve.rb +230 -0
- data/vendor/qwik/site-rrefs.rb +18 -0
- data/vendor/qwik/site-search.rb +180 -0
- data/vendor/qwik/site-timeline.rb +153 -0
- data/vendor/qwik/site-url.rb +189 -0
- data/vendor/qwik/site.rb +76 -0
- data/vendor/qwik/smil-time.rb +105 -0
- data/vendor/qwik/smtp-session.rb +331 -0
- data/vendor/qwik/template-generator.rb +149 -0
- data/vendor/qwik/template.rb +85 -0
- data/vendor/qwik/test-common.rb +10 -0
- data/vendor/qwik/test-ml-info.rb +225 -0
- data/vendor/qwik/test-module-ml.rb +142 -0
- data/vendor/qwik/test-module-path.rb +110 -0
- data/vendor/qwik/test-module-public.rb +70 -0
- data/vendor/qwik/test-module-server.rb +98 -0
- data/vendor/qwik/test-module-session.rb +264 -0
- data/vendor/qwik/test-module-suite.rb +91 -0
- data/vendor/qwik/test-ms-applemail.rb +59 -0
- data/vendor/qwik/test-ms-attach.rb +174 -0
- data/vendor/qwik/test-ms-basic.rb +40 -0
- data/vendor/qwik/test-ms-close.rb +35 -0
- data/vendor/qwik/test-ms-confirm.rb +75 -0
- data/vendor/qwik/test-ms-ignore-spam.rb +57 -0
- data/vendor/qwik/test-ms-japanese.rb +97 -0
- data/vendor/qwik/test-ms-jfilename.rb +82 -0
- data/vendor/qwik/test-ms-large.rb +58 -0
- data/vendor/qwik/test-ms-member.rb +103 -0
- data/vendor/qwik/test-ms-multipart.rb +84 -0
- data/vendor/qwik/test-ms-org.rb +129 -0
- data/vendor/qwik/test-ms-plan.rb +130 -0
- data/vendor/qwik/test-ms-post.rb +53 -0
- data/vendor/qwik/test-ms-quopri.rb +76 -0
- data/vendor/qwik/test-sub-quopri.rb +45 -0
- data/vendor/qwik/test-submit-base64.rb +59 -0
- data/vendor/qwik/test-submit-forward.rb +61 -0
- data/vendor/qwik/test-submit-html-mail.rb +52 -0
- data/vendor/qwik/test-submit-japanese.rb +135 -0
- data/vendor/qwik/test-submit-jfilename.rb +144 -0
- data/vendor/qwik/test-submit-uuencode.rb +71 -0
- data/vendor/qwik/test-suite-all.rb +8 -0
- data/vendor/qwik/test-suite-basic.rb +9 -0
- data/vendor/qwik/test-suite-ml.rb +9 -0
- data/vendor/qwik/test-typekey.rb +64 -0
- data/vendor/qwik/testunit.rb +45 -0
- data/vendor/qwik/tokenizer-inline.rb +294 -0
- data/vendor/qwik/tokenizer.rb +332 -0
- data/vendor/qwik/typekey.rb +160 -0
- data/vendor/qwik/util-basic.rb +135 -0
- data/vendor/qwik/util-charset.rb +332 -0
- data/vendor/qwik/util-css.rb +56 -0
- data/vendor/qwik/util-csv-tokenizer.rb +113 -0
- data/vendor/qwik/util-filename.rb +112 -0
- data/vendor/qwik/util-pathname.rb +202 -0
- data/vendor/qwik/util-pid.rb +58 -0
- data/vendor/qwik/util-safe.rb +67 -0
- data/vendor/qwik/util-sendmail.rb +273 -0
- data/vendor/qwik/util-string.rb +203 -0
- data/vendor/qwik/util-time.rb +125 -0
- data/vendor/qwik/util-webrick.rb +176 -0
- data/vendor/qwik/version.rb +11 -0
- data/vendor/qwik/wabisabi-basic.rb +163 -0
- data/vendor/qwik/wabisabi-diff.rb +130 -0
- data/vendor/qwik/wabisabi-format-xml.rb +310 -0
- data/vendor/qwik/wabisabi-generator.rb +262 -0
- data/vendor/qwik/wabisabi-index.rb +174 -0
- data/vendor/qwik/wabisabi-table.rb +212 -0
- data/vendor/qwik/wabisabi-template.rb +295 -0
- data/vendor/qwik/wabisabi-to-htree.rb +111 -0
- data/vendor/qwik/wabisabi-to-wiki.rb +690 -0
- data/vendor/qwik/wabisabi-traverse.rb +207 -0
- data/vendor/qwik/wabisabi-validator.rb +116 -0
- data/vendor/qwik/wabisabi.rb +5 -0
- metadata +416 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
# -*- coding: shift_jis -*-
|
|
2
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
|
3
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
|
4
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
|
5
|
+
|
|
6
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
|
7
|
+
require 'qwik/mail'
|
|
8
|
+
require 'qwik/password'
|
|
9
|
+
require 'qwik/act-httpauth'
|
|
10
|
+
require 'qwik/act-typekey'
|
|
11
|
+
require 'qwik/act-logout'
|
|
12
|
+
require 'qwik/act-getpass'
|
|
13
|
+
|
|
14
|
+
module Qwik
|
|
15
|
+
class Action
|
|
16
|
+
D_QwikWebLogin = {
|
|
17
|
+
:dt => 'qwikWeb login',
|
|
18
|
+
:dd => 'You can login by using three auth methods.',
|
|
19
|
+
:dc => "* How to
|
|
20
|
+
** Login by TypeKey
|
|
21
|
+
You can login by using TypeKey authentication.
|
|
22
|
+
In login screen, you see 'Log in by TypeKey' link.
|
|
23
|
+
Follow the link and login at the TypeKey authentication page.
|
|
24
|
+
Since the qwikWeb system uses your mailaddress for the authentication,
|
|
25
|
+
it is necessary to select to tell your mail address.
|
|
26
|
+
** Login by password
|
|
27
|
+
Please input your mail address as user ID and input your password.
|
|
28
|
+
The password to login qwikWeb is automatically generated by the system.
|
|
29
|
+
Please follow 'Get Password' link to get the password.
|
|
30
|
+
** Login by Basic Authentication
|
|
31
|
+
You can use Basic Authentication.
|
|
32
|
+
When you are using a mobile phone that only have Basic Authentication method,
|
|
33
|
+
please follow 'Log in by Basic Authentication.' link.
|
|
34
|
+
"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
D_QwikWebLogin_ja = {
|
|
38
|
+
:dt => 'qwikWeb�̃��O�C��',
|
|
39
|
+
:dd => 'qwikWeb�ł͎O��ނ̔F�ؕ��@���g���܂��B',
|
|
40
|
+
:dc => "* �g����
|
|
41
|
+
** TypeKey�ɂ�郍�O�C��
|
|
42
|
+
TypeKey�F�Ń��O�C�����邱�Ƃ��ł��܂��B���O�C����ʂ���uTypeKey�Ń�
|
|
43
|
+
�O�C������v�Ƃ��������N�����ǂ��Ă��������BTypeKey�ɂ��F�؉�ʂ���
|
|
44
|
+
����܂��̂ŁA���̉�ʂ��烍�O�C�����܂��BqwikWeb�ł́A���[���A�h��
|
|
45
|
+
�X�ɂ���ĔF�����Ă��邽�߁A���[���A�h���X���V�X�e���ɒʒm����K�v��
|
|
46
|
+
����܂��B
|
|
47
|
+
|
|
48
|
+
TypeKey�ł̃A�J�E���g���ł͂Ȃ��A���[���A�h���X�ɂ���ĔF���邽�߁A
|
|
49
|
+
�o�^����Ă��郁�[���A�h���X���A���̃O���[�v�ɓo�^����Ă��郁�[���A�h
|
|
50
|
+
���X�ƈ�v���Ă���K�v������܂��B
|
|
51
|
+
** �p�X���[�h���O�C��
|
|
52
|
+
���[�UID�̗��Ɏ����̃��[���A�h���X���A�܂��p�X���[�h���ɂ̓p�X���[�h��
|
|
53
|
+
���͂��Ă��������BqwikWeb�ɂ�����p�X���[�h�́A�V�X�e���������I�ɐ���
|
|
54
|
+
�����p�X���[�h���g���܂��B�u�p�X���[�h�����v�Ƃ��������N�����ǂ�ƁA
|
|
55
|
+
�p�X���[�h�����ł��܂��B
|
|
56
|
+
** BASIC�F�ɂ�郍�O�C��
|
|
57
|
+
BASIC�F���g���܂��B�g�ѓd�b�̂悤�ɁABASIC�F���������ł��Ȃ��ꍇ�́A
|
|
58
|
+
�uBASIC�F�v�̃����N�����ǂ��Ă��������B
|
|
59
|
+
"
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
# ============================== show status
|
|
63
|
+
def plg_login_status
|
|
64
|
+
if @req.user
|
|
65
|
+
return [:span, {:class=>'loginstatus'},
|
|
66
|
+
'user', ' | ', plg_login_user,
|
|
67
|
+
' (', [:a, {:href=>'.logout'}, ('Logout')], ')']
|
|
68
|
+
else
|
|
69
|
+
return login_create_login_link
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def nu_login_create_login_link(msg='Login')
|
|
74
|
+
sitename = @site.sitename
|
|
75
|
+
pagename = @req.base
|
|
76
|
+
href = '/.login'
|
|
77
|
+
href += "?site=#{sitename}" if sitename
|
|
78
|
+
href += "&page=#{pagename}" if pagename
|
|
79
|
+
return [:a, {:href=>href}, msg]
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def login_create_login_link
|
|
83
|
+
return [:a, {:href=>'.login'}, 'Login']
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def plg_login_user
|
|
87
|
+
return [:em, @req.user]
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# ============================== verify
|
|
91
|
+
# called from action.rb
|
|
92
|
+
def login_get_user
|
|
93
|
+
check_session # act-session: Check session id.
|
|
94
|
+
return if @req.user
|
|
95
|
+
|
|
96
|
+
check_cookie # Get user from cookie.
|
|
97
|
+
return if @req.user
|
|
98
|
+
|
|
99
|
+
check_basicauth # Get user from basicauth.
|
|
100
|
+
return if @req.user
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def check_cookie
|
|
104
|
+
userpass = @req.cookies['userpass']
|
|
105
|
+
if userpass
|
|
106
|
+
user, pass = userpass.split(',', 2)
|
|
107
|
+
else
|
|
108
|
+
user = @req.cookies['user']
|
|
109
|
+
pass = @req.cookies['pass']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if user
|
|
113
|
+
return if user.nil? || user.empty?
|
|
114
|
+
return unless MailAddress.valid?(user)
|
|
115
|
+
gen = @memory.passgen
|
|
116
|
+
return unless gen.match?(user, pass)
|
|
117
|
+
|
|
118
|
+
@req.user = user
|
|
119
|
+
@req.auth = 'cookie'
|
|
120
|
+
|
|
121
|
+
# Do not move to session id for now.
|
|
122
|
+
# sid = session_store(user) # Move to session id.
|
|
123
|
+
# @res.set_cookie('sid', sid) # Set Session id by cookie
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# called from action.rb
|
|
128
|
+
def login_invalid_user
|
|
129
|
+
c_nerror(_('Login Error')){[
|
|
130
|
+
[:p, [:strong, _('Invalid ID (E-mail) or Password.')]],
|
|
131
|
+
[:p, {:class=>'warning'},
|
|
132
|
+
_('If you have no password,'), _('Access here'), [:br],
|
|
133
|
+
[:a, {:href=>'.getpass'}, [:em, _('Get Password')]]],
|
|
134
|
+
login_page_form,
|
|
135
|
+
login_page_menu,
|
|
136
|
+
]}
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# ============================== login
|
|
140
|
+
def pre_act_login
|
|
141
|
+
if @req.user
|
|
142
|
+
return login_already_logged_in(@req.user)
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
user = @req.query['user'] # login from query
|
|
146
|
+
pass = @req.query['pass']
|
|
147
|
+
|
|
148
|
+
if ! user
|
|
149
|
+
return c_notice(_('Login')) {
|
|
150
|
+
login_show_login_page(@site.site_url) # show login page
|
|
151
|
+
}
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
begin
|
|
155
|
+
raise InvalidUserError if user.nil? || user.empty?
|
|
156
|
+
raise InvalidUserError unless MailAddress.valid?(user)
|
|
157
|
+
gen = @memory.passgen
|
|
158
|
+
raise InvalidUserError unless gen.match?(user, pass)
|
|
159
|
+
|
|
160
|
+
rescue InvalidUserError
|
|
161
|
+
@res.clear_cookies # IMPORTANT!
|
|
162
|
+
return login_invalid_user # password does not match
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
sid = session_store(user)
|
|
166
|
+
@res.set_cookie('sid', sid) # Set Session id by cookie.
|
|
167
|
+
|
|
168
|
+
return login_show_login_suceed_page
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def login_already_logged_in(user)
|
|
172
|
+
ar = []
|
|
173
|
+
ar << [:p, _('You are now logged in with this user id.'), [:br],
|
|
174
|
+
[:strong, user]]
|
|
175
|
+
ar << [:p, _('If you would like to log in on another account,'), [:br],
|
|
176
|
+
_('please log out first.')]
|
|
177
|
+
ar << logout_form
|
|
178
|
+
ar << [:hr]
|
|
179
|
+
ar << login_go_frontpage
|
|
180
|
+
return c_nerror(_('Already logged in.')){ar}
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
def login_go_frontpage
|
|
184
|
+
style = ''
|
|
185
|
+
return [:div, {:class=>'go_frontpage',:style=>''},
|
|
186
|
+
[:a, {:href=>'FrontPage.html', :style=>style}, 'FrontPage']]
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
def login_show_login_page(url)
|
|
190
|
+
login_msg = nil
|
|
191
|
+
if page = @site['_LoginMessage']
|
|
192
|
+
login_msg = [:div, {:class=>'warning'}, c_res(page.load)]
|
|
193
|
+
end
|
|
194
|
+
login_target_div = [:div,
|
|
195
|
+
[:h2, _('Log in to '), [:em, url]],
|
|
196
|
+
[:p, _('Please input ID (E-mail) and password.')]]
|
|
197
|
+
|
|
198
|
+
div = [:div, {:class=>'login_page'}]
|
|
199
|
+
div << login_target_div
|
|
200
|
+
div << login_msg if login_msg
|
|
201
|
+
|
|
202
|
+
div << login_page_form
|
|
203
|
+
|
|
204
|
+
div << [:hr]
|
|
205
|
+
div << [:div,
|
|
206
|
+
[:h2, _('If you have no password')],
|
|
207
|
+
[:p, _('Please input your mail address.')],
|
|
208
|
+
getpass_form('', '', ''),
|
|
209
|
+
# [:p, [:a, {:href=>'.sendpass'},
|
|
210
|
+
# _('You can send password for members.')]],
|
|
211
|
+
]
|
|
212
|
+
|
|
213
|
+
div << [:hr]
|
|
214
|
+
div << [:div,
|
|
215
|
+
[:h2, [:a, {:href=>'.typekey'}, _('Log in by TypeKey')]],
|
|
216
|
+
[:p, _('Please send mail address for authentication.')]]
|
|
217
|
+
|
|
218
|
+
div << [:hr]
|
|
219
|
+
div << [:div,
|
|
220
|
+
[:h2, [:a, {:href=>'.basicauth'}, _('Log in by Basic Authentication.')]],
|
|
221
|
+
[:p, _('For mobile phone users')]]
|
|
222
|
+
|
|
223
|
+
# div << [:hr]
|
|
224
|
+
# div << login_page_menu
|
|
225
|
+
|
|
226
|
+
style = [:style, '
|
|
227
|
+
.container {
|
|
228
|
+
margin-top: 20px;
|
|
229
|
+
}
|
|
230
|
+
']
|
|
231
|
+
|
|
232
|
+
return [style, div]
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
def login_show_login_suceed_page
|
|
236
|
+
url = 'FrontPage.html'
|
|
237
|
+
title = _('Login') + ' ' + _('Success')
|
|
238
|
+
return c_notice(title, url) {
|
|
239
|
+
[login_go_frontpage]
|
|
240
|
+
}
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
private
|
|
244
|
+
|
|
245
|
+
def login_page_form
|
|
246
|
+
return [:div, {:class=>'login'},
|
|
247
|
+
[:form, {:method=>'POST', :action=>'.login'},
|
|
248
|
+
[:dl,
|
|
249
|
+
[:dt, _('ID'), '(E-mail)', ': '],
|
|
250
|
+
[:dd, [:input, {:name=>'user', :istyle=>'3', :class=>'focus'}]],
|
|
251
|
+
[:dt, _('Password'), ': '],
|
|
252
|
+
[:dd, [:input, {:type=>'password', :name=>'pass'}]]],
|
|
253
|
+
[:p,
|
|
254
|
+
[:input, {:type=>'submit', :value=>_('Login')}]]]]
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
def login_page_menu
|
|
258
|
+
return [:ul,
|
|
259
|
+
# [:li, _("If you don't have password"), ' : ',
|
|
260
|
+
# [:a, {:href=>'.getpass'}, [:em, _('Get Password')]]],
|
|
261
|
+
[:li, _('For mobile phone users'), ' : ',
|
|
262
|
+
[:a, {:href=>'.basicauth'}, _('Log in by Basic Authentication.')]],
|
|
263
|
+
# [:li,
|
|
264
|
+
# [:a, {:href=>'.typekey'}, _('Log in by TypeKey')]]
|
|
265
|
+
]
|
|
266
|
+
end
|
|
267
|
+
end
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
if $0 == __FILE__
|
|
271
|
+
require 'qwik/test-common'
|
|
272
|
+
$test = true
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
if defined?($test) && $test
|
|
276
|
+
class TestActLogin < Test::Unit::TestCase
|
|
277
|
+
include TestSession
|
|
278
|
+
|
|
279
|
+
def assert_cookie(hash, cookies)
|
|
280
|
+
cookies.each {|cookie|
|
|
281
|
+
eq cookie.value, hash[cookie.name]
|
|
282
|
+
}
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
def test_private_site
|
|
286
|
+
t_add_user
|
|
287
|
+
|
|
288
|
+
# See FrontPage.
|
|
289
|
+
res = session('/test/') {|req|
|
|
290
|
+
req.cookies.clear
|
|
291
|
+
}
|
|
292
|
+
ok_title 'Login'
|
|
293
|
+
ok_xp([:meta, {:content=>'1; url=/test/.login',
|
|
294
|
+
'http-equiv'=>'Refresh'}],
|
|
295
|
+
'//meta[2]')
|
|
296
|
+
|
|
297
|
+
# See login page.
|
|
298
|
+
res = session('/test/.login') {|req|
|
|
299
|
+
req.cookies.clear
|
|
300
|
+
}
|
|
301
|
+
ok_title 'Login'
|
|
302
|
+
ok_xp([:input, {:istyle=>'3', :name=>'user', :class=>'focus'}],
|
|
303
|
+
'//input')
|
|
304
|
+
# ok_xp([:a, {:href=>'.getpass'}, [:em, 'Get Password']], '//a')
|
|
305
|
+
assert_cookie({'user'=>'', 'pass'=>''}, @res.cookies)
|
|
306
|
+
|
|
307
|
+
# Get password by e-mail. See act-getpass.
|
|
308
|
+
|
|
309
|
+
# Invalid mail address
|
|
310
|
+
res = session('/test/.login?user=test@example') {|req|
|
|
311
|
+
req.cookies.clear
|
|
312
|
+
}
|
|
313
|
+
assert_text('Invalid ID (E-mail) or Password.', 'p')
|
|
314
|
+
|
|
315
|
+
# Invalid password
|
|
316
|
+
res = session('/test/.login?user=user@e.com&pass=wrongpassword') {|req|
|
|
317
|
+
req.cookies.clear
|
|
318
|
+
}
|
|
319
|
+
assert_text('Invalid ID (E-mail) or Password.', 'p')
|
|
320
|
+
|
|
321
|
+
# Login by GET method. Set cookies and redirect to FrontPage.
|
|
322
|
+
res = session('/test/.login?user=user@e.com&pass=95988593') {|req|
|
|
323
|
+
req.cookies.clear
|
|
324
|
+
}
|
|
325
|
+
ok_title 'Login Success'
|
|
326
|
+
#assert_cookie({'user'=>'user@e.com', 'pass'=>'95988593'}, @res.cookies)
|
|
327
|
+
eq 'sid', @res.cookies[0].name
|
|
328
|
+
eq 32, @res.cookies[0].value.length
|
|
329
|
+
#pw('//head')
|
|
330
|
+
ok_xp([:meta, {:content=>'0; url=FrontPage.html',
|
|
331
|
+
'http-equiv'=>'Refresh'}],
|
|
332
|
+
'//meta[2]') # force redirect for security reason.
|
|
333
|
+
|
|
334
|
+
# Set the cookie
|
|
335
|
+
res = session('/test/') {|req|
|
|
336
|
+
req.cookies.update({'user'=>'user@e.com', 'pass'=>'95988593'})
|
|
337
|
+
}
|
|
338
|
+
ok_title 'FrontPage'
|
|
339
|
+
assert_cookie({'user'=>'user@e.com', 'pass'=>'95988593'},
|
|
340
|
+
@res.cookies)
|
|
341
|
+
#eq 'sid', @res.cookies[0].name
|
|
342
|
+
#eq 32, @res.cookies[0].value.length
|
|
343
|
+
|
|
344
|
+
# Use POST method to set user and pass by queries.
|
|
345
|
+
res = session('POST /test/.login?user=user@e.com&pass=95988593') {|req|
|
|
346
|
+
req.cookies.clear
|
|
347
|
+
}
|
|
348
|
+
ok_title 'Login Success'
|
|
349
|
+
eq 200, @res.status
|
|
350
|
+
#assert_cookie({'user'=>'user@e.com', 'pass'=>'95988593'}, @res.cookies)
|
|
351
|
+
eq 'sid', @res.cookies[0].name
|
|
352
|
+
eq 32, @res.cookies[0].value.length
|
|
353
|
+
ok_xp([:meta, {:content=>'0; url=FrontPage.html',
|
|
354
|
+
'http-equiv'=>'Refresh'}],
|
|
355
|
+
'//meta[2]') # force redirect for security reason.
|
|
356
|
+
|
|
357
|
+
# test_login_status
|
|
358
|
+
res = session('/test/')
|
|
359
|
+
ok_in(['user', ' | ', [:em, 'user@e.com'],
|
|
360
|
+
' (', [:a, {:href=>'.logout'}, 'Logout'], ')'],
|
|
361
|
+
"//span[@class='loginstatus']")
|
|
362
|
+
|
|
363
|
+
# See TextFormat
|
|
364
|
+
res = session('/test/TextFormat.html')
|
|
365
|
+
|
|
366
|
+
# See the Logout page.
|
|
367
|
+
res = session('/test/.logout')
|
|
368
|
+
ok_title 'Log out Confirm'
|
|
369
|
+
ok_xp([:form, {:action=>'.logout', :method=>'POST'},
|
|
370
|
+
[:input, {:value=>'yes', :type=>'hidden',
|
|
371
|
+
:name=>'confirm'}], [:input, {:value=>'Log out',
|
|
372
|
+
:type=>'submit', :class=>'focus'}]], '//form')
|
|
373
|
+
ok_xp([:input, {:value=>'yes', :type=>'hidden', :name=>'confirm'}],
|
|
374
|
+
'//input')
|
|
375
|
+
ok_xp([:input, {:value=>'Log out',
|
|
376
|
+
:type=>'submit', :class=>'focus'}], '//input[2]')
|
|
377
|
+
|
|
378
|
+
# Confirm Logout.
|
|
379
|
+
res = session('/test/.logout?confirm=yes')
|
|
380
|
+
ok_title 'Log out done.'
|
|
381
|
+
assert_text('Log out done.', 'h1')
|
|
382
|
+
ok_xp([:p, [:a, {:href=>'FrontPage.html'}, 'Go back']],
|
|
383
|
+
"//div[@class='section']/p")
|
|
384
|
+
assert_cookie({'user'=>'', 'pass'=>'', 'sid'=>''}, @res.cookies)
|
|
385
|
+
#eq 'sid', @res.cookies[0].name
|
|
386
|
+
#eq 32, @res.cookies[0].value.length
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
def test_open_site
|
|
390
|
+
t_add_user
|
|
391
|
+
t_site_open # OPEN site
|
|
392
|
+
|
|
393
|
+
# See FrontPage. Check login_status before login.
|
|
394
|
+
res = session('/test/') {|req|
|
|
395
|
+
req.cookies.clear
|
|
396
|
+
}
|
|
397
|
+
ok_title 'FrontPage'
|
|
398
|
+
ok_in(['Login'], "//div[@class='adminmenu']//a")
|
|
399
|
+
ok_in([[:a, {:href=>'.login'}, 'Login'],
|
|
400
|
+
["\n"], ["\n"]],
|
|
401
|
+
"//div[@class='adminmenu']")
|
|
402
|
+
|
|
403
|
+
# You can see login page before login.
|
|
404
|
+
res = session('/test/.login') {|req|
|
|
405
|
+
req.cookies.clear
|
|
406
|
+
}
|
|
407
|
+
ok_title 'Login'
|
|
408
|
+
end
|
|
409
|
+
end
|
|
410
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
|
4
|
+
|
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
|
6
|
+
|
|
7
|
+
module Qwik
|
|
8
|
+
class Action
|
|
9
|
+
def pre_act_logout
|
|
10
|
+
return basicauth_logout if @req.auth == 'basicauth'
|
|
11
|
+
|
|
12
|
+
confirm = @req.query['confirm']
|
|
13
|
+
if confirm.nil? || confirm != 'yes'
|
|
14
|
+
return logout_show_confirm
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
session_clear
|
|
18
|
+
|
|
19
|
+
@res.clear_cookie('user') # Remove cookies from browser.
|
|
20
|
+
@res.clear_cookie('pass')
|
|
21
|
+
@res.clear_cookie('sid')
|
|
22
|
+
|
|
23
|
+
return c_notice(_('Log out done.'), 'FrontPage.html') {
|
|
24
|
+
[:p, [:a, {:href=>'FrontPage.html'}, _('Go back')]]
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def logout_show_confirm
|
|
29
|
+
title = _('Log out')+' '+_('Confirm')
|
|
30
|
+
c_notice(title) {
|
|
31
|
+
[[:p, _('Push "Log out".')],
|
|
32
|
+
logout_form,
|
|
33
|
+
[:hr],
|
|
34
|
+
[:p, [:a, {:href=>'FrontPage.html'}, _('Go next')]]]
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def logout_form
|
|
39
|
+
return [:div, {:class=>'logout'},
|
|
40
|
+
[:form, {:method=>'POST', :action=>'.logout'},
|
|
41
|
+
[:input, {:type=>'hidden', :name=>'confirm', :value=>'yes'}],
|
|
42
|
+
[:input, {:type=>'submit', :value=>_('Log out'), :class=>'focus'}]]]
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
if $0 == __FILE__
|
|
48
|
+
require 'qwik/test-common'
|
|
49
|
+
$test = true
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
if defined?($test) && $test
|
|
53
|
+
class TestActLogout < Test::Unit::TestCase
|
|
54
|
+
include TestSession
|
|
55
|
+
|
|
56
|
+
def test_all
|
|
57
|
+
# The test for logout is already done in act-login.rb
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|