diff --git a/Controller/Component/NetCommonsVisualCaptchaComponent.php b/Controller/Component/NetCommonsVisualCaptchaComponent.php new file mode 100644 index 00000000..88c43424 --- /dev/null +++ b/Controller/Component/NetCommonsVisualCaptchaComponent.php @@ -0,0 +1,164 @@ + + * @author Shohei Nakajima + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +use visualCaptcha\Captcha; +use visualCaptcha\Session; + +App::uses('Component', 'Controller'); + +App::import('Vendor', 'Captcha', array( + 'file' => 'visualcaptcha' . DS . 'src' . DS . 'visualCaptcha' . DS . 'Captcha.php' +)); +App::import('Vendor', 'Session', array( + 'file' => 'visualcaptcha' . DS . 'src' . DS . 'visualCaptcha' . DS . 'Session.php' +)); + +/** + * NetCommonsVisualCaptcha Component + * + * @author Shohei Nakajima + * @package NetCommons\NetCommons\Controller\Component + */ +class NetCommonsVisualCaptchaComponent extends Component { + +/** + * call controller w/ associations + * + * @var object + */ + public $controller = null; + +/** + * assetPath /r associations + * + * @var string + */ + public $assetPath = null; + +/** + * imageField Answer /r associations + * + * @var string + */ + public $imageField = null; + +/** + * audioField Answer /r associations + * + * @var string + */ + public $audioField = null; + +/** + * Called before the Controller::beforeFilter(). + * + * @param Controller $controller Instantiating controller + * @return void + */ + public function initialize(Controller $controller) { + $this->controller = $controller; + // if Security component is used + if (array_key_exists('Security', $this->controller->components)) { + $this->imageField = $this->controller->Session->read('visualcaptcha.frontendData.imageFieldName'); + $this->audioField = $this->controller->Session->read('visualcaptcha.frontendData.audioFieldName'); + + if ($this->imageField && $this->audioField) { + $this->controller->Security->unlockedFields = array( + $this->imageField, + $this->audioField + ); + } + } + } + +/** + * Called after the Controller::beforeFilter() and before the controller action + * + * @param Controller $controller Controller with components to startup + * @return void + * @throws ForbiddenException + */ + public function startup(Controller $controller) { + //$assetsPath = VENDORS . 'emotionloop' . DS . 'visualcaptcha' . DS . 'src' . DS . 'visualCaptcha' . DS . 'assets'; + $this->assetPath = App::pluginPath('NetCommons') . 'Vendor' . DS . 'visual_captcha'; + } + +/** + * generate visual captcha data and return it + * + * @param int $count display image count + * @return string + */ + public function generate($count = 5) { + $session = new Session(); + $lang = Configure::read('Config.language'); + $imageJsonPath = $this->assetPath . DS . $lang . DS . 'images.json'; + $audioJsonPath = $this->assetPath . DS . $lang . DS . 'audios.json'; + $captcha = new Captcha($session, $this->assetPath, $this->__utilReadJSON($imageJsonPath), $this->__utilReadJSON($audioJsonPath)); + $captcha->generate($count); + return json_encode($captcha->getFrontEndData()); + } + +/** + * generate visual captcha image data and return it + * + * @param int $index display image index + * @return string + */ + public function image($index) { + $session = new Session(); + $captcha = new Captcha($session, $this->assetPath); + return $captcha->streamImage(array(), $index, 0); + } + +/** + * generate audio captcha data and return it + * + * @return streaming data + */ + public function audio() { + $session = new Session(); + $captcha = new Captcha($session, $this->assetPath); + return $captcha->streamAudio(array(), 'mp3'); + } + +/** + * check input response + * + * @return bool + */ + public function check() { + $reqData = $this->controller->request->data; + $session = new Session(); + $captcha = new Captcha($session, $this->assetPath); + + if (isset($reqData[$this->imageField])) { + return $captcha->validateImage($reqData[$this->imageField]); + } elseif (isset($reqData[$this->audioField])) { + return $captcha->validateAudio($reqData[$this->audioField]); + } + + return false; + } + +/** + * Read input file as JSON + * + * @param string $filePath json file path + * @return object + */ + private function __utilReadJSON($filePath) { + if (!file_exists($filePath)) { + return null; + } + return json_decode(file_get_contents($filePath), true); + } +} diff --git a/Locale/jpn/LC_MESSAGES/net_commons.mo b/Locale/jpn/LC_MESSAGES/net_commons.mo index 92fd87a0..b3c6a449 100644 Binary files a/Locale/jpn/LC_MESSAGES/net_commons.mo and b/Locale/jpn/LC_MESSAGES/net_commons.mo differ diff --git a/Locale/jpn/LC_MESSAGES/net_commons.po b/Locale/jpn/LC_MESSAGES/net_commons.po index d4967dc7..2fabff48 100644 --- a/Locale/jpn/LC_MESSAGES/net_commons.po +++ b/Locale/jpn/LC_MESSAGES/net_commons.po @@ -335,3 +335,31 @@ msgstr "閉じる" #: Videos/View/VideoBlockSettings/index.ctp:43 Videos/View/Videos/index.ctp:55 msgid "Add" msgstr "追加" + +#: View/Elements/visual_captcha.ctp:34 +msgid "Sound icon" +msgstr "音声" + +#: View/Elements/visual_captcha.ctp:35 +msgid "Accessibility option: listen to a question and answer it!" +msgstr "アクセシビリティ対応:音声を聞いて答える" + +#: View/Elements/visual_captcha.ctp:36 +msgid "" +"Type below the answer to what you hear. Numbers or words:" +msgstr "" +"質問の音声を聞いて、下の回答欄に答えの数字・または言葉を入力" +"してください。" + +#: View/Elements/visual_captcha.ctp:37 +msgid "Click or touch the ANSWER" +msgstr "" +"ANSWERのアイコンをクリックまたはタッチして、決定してください" + +#: View/Elements/visual_captcha.ctp:38 +msgid "Refresh/reload icon" +msgstr "再読み込み" + +#: View/Elements/visual_captcha.ctp:39 +msgid "Refresh/reload: get new images and accessibility option!" +msgstr "再読み込み:新しい絵や音声に変えます" diff --git a/Locale/net_commons.pot b/Locale/net_commons.pot index 9ccaf40a..46cd3381 100644 --- a/Locale/net_commons.pot +++ b/Locale/net_commons.pot @@ -365,3 +365,26 @@ msgstr "" msgid "Add" msgstr "" +#: View/Elements/visual_captcha.ctp:34 +msgid "Sound icon" +msgstr "" + +#: View/Elements/visual_captcha.ctp:35 +msgid "Accessibility option: listen to a question and answer it!" +msgstr "" + +#: View/Elements/visual_captcha.ctp:36 +msgid "Type below the answer to what you hear. Numbers or words:" +msgstr "" + +#: View/Elements/visual_captcha.ctp:37 +msgid "Click or touch the ANSWER" +msgstr "" + +#: View/Elements/visual_captcha.ctp:38 +msgid "Refresh/reload icon" +msgstr "" + +#: View/Elements/visual_captcha.ctp:39 +msgid "Refresh/reload: get new images and accessibility option!" +msgstr "" diff --git a/Vendor/visual_captcha/audios/12times2.mp3 b/Vendor/visual_captcha/audios/12times2.mp3 new file mode 100644 index 00000000..9bc5faf1 Binary files /dev/null and b/Vendor/visual_captcha/audios/12times2.mp3 differ diff --git a/Vendor/visual_captcha/audios/12times2.ogg b/Vendor/visual_captcha/audios/12times2.ogg new file mode 100644 index 00000000..f89dd03d Binary files /dev/null and b/Vendor/visual_captcha/audios/12times2.ogg differ diff --git a/Vendor/visual_captcha/audios/12times2_ja.mp3 b/Vendor/visual_captcha/audios/12times2_ja.mp3 new file mode 100644 index 00000000..afd6a107 Binary files /dev/null and b/Vendor/visual_captcha/audios/12times2_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/2times10.mp3 b/Vendor/visual_captcha/audios/2times10.mp3 new file mode 100644 index 00000000..a32268b1 Binary files /dev/null and b/Vendor/visual_captcha/audios/2times10.mp3 differ diff --git a/Vendor/visual_captcha/audios/2times10.ogg b/Vendor/visual_captcha/audios/2times10.ogg new file mode 100644 index 00000000..c67e1eaa Binary files /dev/null and b/Vendor/visual_captcha/audios/2times10.ogg differ diff --git a/Vendor/visual_captcha/audios/2times10_ja.mp3 b/Vendor/visual_captcha/audios/2times10_ja.mp3 new file mode 100644 index 00000000..61861c3a Binary files /dev/null and b/Vendor/visual_captcha/audios/2times10_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/2times10_ja.ogg b/Vendor/visual_captcha/audios/2times10_ja.ogg new file mode 100644 index 00000000..4a391a10 Binary files /dev/null and b/Vendor/visual_captcha/audios/2times10_ja.ogg differ diff --git a/Vendor/visual_captcha/audios/4plus1.mp3 b/Vendor/visual_captcha/audios/4plus1.mp3 new file mode 100644 index 00000000..78df9f6c Binary files /dev/null and b/Vendor/visual_captcha/audios/4plus1.mp3 differ diff --git a/Vendor/visual_captcha/audios/4plus1.ogg b/Vendor/visual_captcha/audios/4plus1.ogg new file mode 100644 index 00000000..a07c8044 Binary files /dev/null and b/Vendor/visual_captcha/audios/4plus1.ogg differ diff --git a/Vendor/visual_captcha/audios/4plus1_ja.mp3 b/Vendor/visual_captcha/audios/4plus1_ja.mp3 new file mode 100644 index 00000000..137d1eba Binary files /dev/null and b/Vendor/visual_captcha/audios/4plus1_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/4plus3.mp3 b/Vendor/visual_captcha/audios/4plus3.mp3 new file mode 100644 index 00000000..add6b6c8 Binary files /dev/null and b/Vendor/visual_captcha/audios/4plus3.mp3 differ diff --git a/Vendor/visual_captcha/audios/4plus3.ogg b/Vendor/visual_captcha/audios/4plus3.ogg new file mode 100644 index 00000000..e529ea67 Binary files /dev/null and b/Vendor/visual_captcha/audios/4plus3.ogg differ diff --git a/Vendor/visual_captcha/audios/4plus3_ja.mp3 b/Vendor/visual_captcha/audios/4plus3_ja.mp3 new file mode 100644 index 00000000..50715245 Binary files /dev/null and b/Vendor/visual_captcha/audios/4plus3_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/5plus1.mp3 b/Vendor/visual_captcha/audios/5plus1.mp3 new file mode 100644 index 00000000..6910d847 Binary files /dev/null and b/Vendor/visual_captcha/audios/5plus1.mp3 differ diff --git a/Vendor/visual_captcha/audios/5plus1.ogg b/Vendor/visual_captcha/audios/5plus1.ogg new file mode 100644 index 00000000..6886129a Binary files /dev/null and b/Vendor/visual_captcha/audios/5plus1.ogg differ diff --git a/Vendor/visual_captcha/audios/5plus1_ja.mp3 b/Vendor/visual_captcha/audios/5plus1_ja.mp3 new file mode 100644 index 00000000..5a54998d Binary files /dev/null and b/Vendor/visual_captcha/audios/5plus1_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/5times2.mp3 b/Vendor/visual_captcha/audios/5times2.mp3 new file mode 100644 index 00000000..33ae9cea Binary files /dev/null and b/Vendor/visual_captcha/audios/5times2.mp3 differ diff --git a/Vendor/visual_captcha/audios/5times2.ogg b/Vendor/visual_captcha/audios/5times2.ogg new file mode 100644 index 00000000..b7a76d15 Binary files /dev/null and b/Vendor/visual_captcha/audios/5times2.ogg differ diff --git a/Vendor/visual_captcha/audios/5times2_ja.mp3 b/Vendor/visual_captcha/audios/5times2_ja.mp3 new file mode 100644 index 00000000..f6a6f142 Binary files /dev/null and b/Vendor/visual_captcha/audios/5times2_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/6plus6.mp3 b/Vendor/visual_captcha/audios/6plus6.mp3 new file mode 100644 index 00000000..fc8a43ef Binary files /dev/null and b/Vendor/visual_captcha/audios/6plus6.mp3 differ diff --git a/Vendor/visual_captcha/audios/6plus6.ogg b/Vendor/visual_captcha/audios/6plus6.ogg new file mode 100644 index 00000000..9545631f Binary files /dev/null and b/Vendor/visual_captcha/audios/6plus6.ogg differ diff --git a/Vendor/visual_captcha/audios/6plus6_ja.mp3 b/Vendor/visual_captcha/audios/6plus6_ja.mp3 new file mode 100644 index 00000000..6f621ddd Binary files /dev/null and b/Vendor/visual_captcha/audios/6plus6_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/99plus1.mp3 b/Vendor/visual_captcha/audios/99plus1.mp3 new file mode 100644 index 00000000..1e559ac3 Binary files /dev/null and b/Vendor/visual_captcha/audios/99plus1.mp3 differ diff --git a/Vendor/visual_captcha/audios/99plus1.ogg b/Vendor/visual_captcha/audios/99plus1.ogg new file mode 100644 index 00000000..771831b8 Binary files /dev/null and b/Vendor/visual_captcha/audios/99plus1.ogg differ diff --git a/Vendor/visual_captcha/audios/99plus1_ja.mp3 b/Vendor/visual_captcha/audios/99plus1_ja.mp3 new file mode 100644 index 00000000..3626241e Binary files /dev/null and b/Vendor/visual_captcha/audios/99plus1_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/add3to1.mp3 b/Vendor/visual_captcha/audios/add3to1.mp3 new file mode 100644 index 00000000..2793b5c7 Binary files /dev/null and b/Vendor/visual_captcha/audios/add3to1.mp3 differ diff --git a/Vendor/visual_captcha/audios/add3to1.ogg b/Vendor/visual_captcha/audios/add3to1.ogg new file mode 100644 index 00000000..1c961c59 Binary files /dev/null and b/Vendor/visual_captcha/audios/add3to1.ogg differ diff --git a/Vendor/visual_captcha/audios/add3to1_ja.mp3 b/Vendor/visual_captcha/audios/add3to1_ja.mp3 new file mode 100644 index 00000000..79f95e36 Binary files /dev/null and b/Vendor/visual_captcha/audios/add3to1_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/addblueandyellow.mp3 b/Vendor/visual_captcha/audios/addblueandyellow.mp3 new file mode 100644 index 00000000..32e5730a Binary files /dev/null and b/Vendor/visual_captcha/audios/addblueandyellow.mp3 differ diff --git a/Vendor/visual_captcha/audios/addblueandyellow.ogg b/Vendor/visual_captcha/audios/addblueandyellow.ogg new file mode 100644 index 00000000..3225787b Binary files /dev/null and b/Vendor/visual_captcha/audios/addblueandyellow.ogg differ diff --git a/Vendor/visual_captcha/audios/addblueandyellow_ja.mp3 b/Vendor/visual_captcha/audios/addblueandyellow_ja.mp3 new file mode 100644 index 00000000..be880a82 Binary files /dev/null and b/Vendor/visual_captcha/audios/addblueandyellow_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/after2.mp3 b/Vendor/visual_captcha/audios/after2.mp3 new file mode 100644 index 00000000..110c4971 Binary files /dev/null and b/Vendor/visual_captcha/audios/after2.mp3 differ diff --git a/Vendor/visual_captcha/audios/after2.ogg b/Vendor/visual_captcha/audios/after2.ogg new file mode 100644 index 00000000..b5a4b479 Binary files /dev/null and b/Vendor/visual_captcha/audios/after2.ogg differ diff --git a/Vendor/visual_captcha/audios/after2_ja.mp3 b/Vendor/visual_captcha/audios/after2_ja.mp3 new file mode 100644 index 00000000..703b68f8 Binary files /dev/null and b/Vendor/visual_captcha/audios/after2_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/capitaloffrance.mp3 b/Vendor/visual_captcha/audios/capitaloffrance.mp3 new file mode 100644 index 00000000..5b73d4fa Binary files /dev/null and b/Vendor/visual_captcha/audios/capitaloffrance.mp3 differ diff --git a/Vendor/visual_captcha/audios/capitaloffrance.ogg b/Vendor/visual_captcha/audios/capitaloffrance.ogg new file mode 100644 index 00000000..ad40999e Binary files /dev/null and b/Vendor/visual_captcha/audios/capitaloffrance.ogg differ diff --git a/Vendor/visual_captcha/audios/divide4by2.mp3 b/Vendor/visual_captcha/audios/divide4by2.mp3 new file mode 100644 index 00000000..72aa6c4b Binary files /dev/null and b/Vendor/visual_captcha/audios/divide4by2.mp3 differ diff --git a/Vendor/visual_captcha/audios/divide4by2.ogg b/Vendor/visual_captcha/audios/divide4by2.ogg new file mode 100644 index 00000000..07fa8fb9 Binary files /dev/null and b/Vendor/visual_captcha/audios/divide4by2.ogg differ diff --git a/Vendor/visual_captcha/audios/divide4by2_ja.mp3 b/Vendor/visual_captcha/audios/divide4by2_ja.mp3 new file mode 100644 index 00000000..737198f3 Binary files /dev/null and b/Vendor/visual_captcha/audios/divide4by2_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/firstletteralphabet.mp3 b/Vendor/visual_captcha/audios/firstletteralphabet.mp3 new file mode 100644 index 00000000..d5d8bbd2 Binary files /dev/null and b/Vendor/visual_captcha/audios/firstletteralphabet.mp3 differ diff --git a/Vendor/visual_captcha/audios/firstletteralphabet.ogg b/Vendor/visual_captcha/audios/firstletteralphabet.ogg new file mode 100644 index 00000000..c1a6e2ea Binary files /dev/null and b/Vendor/visual_captcha/audios/firstletteralphabet.ogg differ diff --git a/Vendor/visual_captcha/audios/firstletteralphabet_ja.mp3 b/Vendor/visual_captcha/audios/firstletteralphabet_ja.mp3 new file mode 100644 index 00000000..3e69d722 Binary files /dev/null and b/Vendor/visual_captcha/audios/firstletteralphabet_ja.mp3 differ diff --git a/Vendor/visual_captcha/audios/milkcolor.mp3 b/Vendor/visual_captcha/audios/milkcolor.mp3 new file mode 100644 index 00000000..5a4768eb Binary files /dev/null and b/Vendor/visual_captcha/audios/milkcolor.mp3 differ diff --git a/Vendor/visual_captcha/audios/milkcolor.ogg b/Vendor/visual_captcha/audios/milkcolor.ogg new file mode 100644 index 00000000..58895ecb Binary files /dev/null and b/Vendor/visual_captcha/audios/milkcolor.ogg differ diff --git a/Vendor/visual_captcha/audios/skycolor.mp3 b/Vendor/visual_captcha/audios/skycolor.mp3 new file mode 100644 index 00000000..1816ff3f Binary files /dev/null and b/Vendor/visual_captcha/audios/skycolor.mp3 differ diff --git a/Vendor/visual_captcha/audios/skycolor.ogg b/Vendor/visual_captcha/audios/skycolor.ogg new file mode 100644 index 00000000..3f8f5c29 Binary files /dev/null and b/Vendor/visual_captcha/audios/skycolor.ogg differ diff --git a/Vendor/visual_captcha/audios/skynight.mp3 b/Vendor/visual_captcha/audios/skynight.mp3 new file mode 100644 index 00000000..77e06d8d Binary files /dev/null and b/Vendor/visual_captcha/audios/skynight.mp3 differ diff --git a/Vendor/visual_captcha/audios/skynight.ogg b/Vendor/visual_captcha/audios/skynight.ogg new file mode 100644 index 00000000..1209b283 Binary files /dev/null and b/Vendor/visual_captcha/audios/skynight.ogg differ diff --git a/Vendor/visual_captcha/audios/sunastar.mp3 b/Vendor/visual_captcha/audios/sunastar.mp3 new file mode 100644 index 00000000..93a56ac3 Binary files /dev/null and b/Vendor/visual_captcha/audios/sunastar.mp3 differ diff --git a/Vendor/visual_captcha/audios/sunastar.ogg b/Vendor/visual_captcha/audios/sunastar.ogg new file mode 100644 index 00000000..b3297226 Binary files /dev/null and b/Vendor/visual_captcha/audios/sunastar.ogg differ diff --git a/Vendor/visual_captcha/audios/thirdmonth.mp3 b/Vendor/visual_captcha/audios/thirdmonth.mp3 new file mode 100644 index 00000000..430d3228 Binary files /dev/null and b/Vendor/visual_captcha/audios/thirdmonth.mp3 differ diff --git a/Vendor/visual_captcha/audios/thirdmonth.ogg b/Vendor/visual_captcha/audios/thirdmonth.ogg new file mode 100644 index 00000000..96717d07 Binary files /dev/null and b/Vendor/visual_captcha/audios/thirdmonth.ogg differ diff --git a/Vendor/visual_captcha/audios/yourobot.mp3 b/Vendor/visual_captcha/audios/yourobot.mp3 new file mode 100644 index 00000000..80e004df Binary files /dev/null and b/Vendor/visual_captcha/audios/yourobot.mp3 differ diff --git a/Vendor/visual_captcha/audios/yourobot.ogg b/Vendor/visual_captcha/audios/yourobot.ogg new file mode 100644 index 00000000..8e193ecb Binary files /dev/null and b/Vendor/visual_captcha/audios/yourobot.ogg differ diff --git a/Vendor/visual_captcha/eng/audios.json b/Vendor/visual_captcha/eng/audios.json new file mode 100644 index 00000000..2c5d801d --- /dev/null +++ b/Vendor/visual_captcha/eng/audios.json @@ -0,0 +1,82 @@ +[ + { + "path": "5times2.mp3", + "value": "10" + }, + { + "path": "2times10.mp3", + "value": "20" + }, + { + "path": "5plus1.mp3", + "value": "6" + }, + { + "path": "4plus1.mp3", + "value": "5" + }, + { + "path": "4plus3.mp3", + "value": "7" + }, + { + "path": "6plus6.mp3", + "value": "12" + }, + { + "path": "12times2.mp3", + "value": "24" + }, + { + "path": "99plus1.mp3", + "value": "100" + }, + { + "path": "add3to1.mp3", + "value": "4" + }, + { + "path": "addblueandyellow.mp3", + "value": "green" + }, + { + "path": "after2.mp3", + "value": "3" + }, + { + "path": "divide4by2.mp3", + "value": "2" + }, + { + "path": "milkcolor.mp3", + "value": "white" + }, + { + "path": "skycolor.mp3", + "value": "blue" + }, + { + "path": "sunastar.mp3", + "value": "yes" + }, + { + "path": "yourobot.mp3", + "value": "no" + }, + { + "path": "capitaloffrance.mp3", + "value": "paris" + }, + { + "path": "skynight.mp3", + "value": "black" + }, + { + "path": "thirdmonth.mp3", + "value": "march" + }, + { + "path": "firstletteralphabet.mp3", + "value": "a" + } +] \ No newline at end of file diff --git a/Vendor/visual_captcha/eng/images.json b/Vendor/visual_captcha/eng/images.json new file mode 100644 index 00000000..d79b11dd --- /dev/null +++ b/Vendor/visual_captcha/eng/images.json @@ -0,0 +1,150 @@ +[ + { + "name": "Airplane", + "path": "airplane.png" + }, + { + "name": "Balloons", + "path": "balloons.png" + }, + { + "name": "Camera", + "path": "camera.png" + }, + { + "name": "Car", + "path": "car.png" + }, + { + "name": "Cat", + "path": "cat.png" + }, + { + "name": "Chair", + "path": "chair.png" + }, + { + "name": "Clip", + "path": "clip.png" + }, + { + "name": "Clock", + "path": "clock.png" + }, + { + "name": "Cloud", + "path": "cloud.png" + }, + { + "name": "Computer", + "path": "computer.png" + }, + { + "name": "Envelope", + "path": "envelope.png" + }, + { + "name": "Eye", + "path": "eye.png" + }, + { + "name": "Flag", + "path": "flag.png" + }, + { + "name": "Folder", + "path": "folder.png" + }, + { + "name": "Foot", + "path": "foot.png" + }, + { + "name": "Graph", + "path": "graph.png" + }, + { + "name": "House", + "path": "house.png" + }, + { + "name": "Key", + "path": "key.png" + }, + { + "name": "Leaf", + "path": "leaf.png" + }, + { + "name": "Light Bulb", + "path": "light-bulb.png" + }, + { + "name": "Lock", + "path": "lock.png" + }, + { + "name": "Magnifying Glass", + "path": "magnifying-glass.png" + }, + { + "name": "Man", + "path": "man.png" + }, + { + "name": "Music Note", + "path": "music-note.png" + }, + { + "name": "Pants", + "path": "pants.png" + }, + { + "name": "Pencil", + "path": "pencil.png" + }, + { + "name": "Printer", + "path": "printer.png" + }, + { + "name": "Robot", + "path": "robot.png" + }, + { + "name": "Scissors", + "path": "scissors.png" + }, + { + "name": "Sunglasses", + "path": "sunglasses.png" + }, + { + "name": "Tag", + "path": "tag.png" + }, + { + "name": "Tree", + "path": "tree.png" + }, + { + "name": "Truck", + "path": "truck.png" + }, + { + "name": "T-Shirt", + "path": "t-shirt.png" + }, + { + "name": "Umbrella", + "path": "umbrella.png" + }, + { + "name": "Woman", + "path": "woman.png" + }, + { + "name": "World", + "path": "world.png" + } +] \ No newline at end of file diff --git a/Vendor/visual_captcha/images/airplane.png b/Vendor/visual_captcha/images/airplane.png new file mode 100644 index 00000000..dbe9aac4 Binary files /dev/null and b/Vendor/visual_captcha/images/airplane.png differ diff --git a/Vendor/visual_captcha/images/airplane@2x.png b/Vendor/visual_captcha/images/airplane@2x.png new file mode 100644 index 00000000..3c21b06c Binary files /dev/null and b/Vendor/visual_captcha/images/airplane@2x.png differ diff --git a/Vendor/visual_captcha/images/balloons.png b/Vendor/visual_captcha/images/balloons.png new file mode 100644 index 00000000..2c77a279 Binary files /dev/null and b/Vendor/visual_captcha/images/balloons.png differ diff --git a/Vendor/visual_captcha/images/balloons@2x.png b/Vendor/visual_captcha/images/balloons@2x.png new file mode 100644 index 00000000..f93017c5 Binary files /dev/null and b/Vendor/visual_captcha/images/balloons@2x.png differ diff --git a/Vendor/visual_captcha/images/camera.png b/Vendor/visual_captcha/images/camera.png new file mode 100644 index 00000000..9f2d2929 Binary files /dev/null and b/Vendor/visual_captcha/images/camera.png differ diff --git a/Vendor/visual_captcha/images/camera@2x.png b/Vendor/visual_captcha/images/camera@2x.png new file mode 100644 index 00000000..c00175fb Binary files /dev/null and b/Vendor/visual_captcha/images/camera@2x.png differ diff --git a/Vendor/visual_captcha/images/car.png b/Vendor/visual_captcha/images/car.png new file mode 100644 index 00000000..6d917c63 Binary files /dev/null and b/Vendor/visual_captcha/images/car.png differ diff --git a/Vendor/visual_captcha/images/car@2x.png b/Vendor/visual_captcha/images/car@2x.png new file mode 100644 index 00000000..ef317c41 Binary files /dev/null and b/Vendor/visual_captcha/images/car@2x.png differ diff --git a/Vendor/visual_captcha/images/cat.png b/Vendor/visual_captcha/images/cat.png new file mode 100644 index 00000000..98f11217 Binary files /dev/null and b/Vendor/visual_captcha/images/cat.png differ diff --git a/Vendor/visual_captcha/images/cat@2x.png b/Vendor/visual_captcha/images/cat@2x.png new file mode 100644 index 00000000..29d28069 Binary files /dev/null and b/Vendor/visual_captcha/images/cat@2x.png differ diff --git a/Vendor/visual_captcha/images/chair.png b/Vendor/visual_captcha/images/chair.png new file mode 100644 index 00000000..96b040a1 Binary files /dev/null and b/Vendor/visual_captcha/images/chair.png differ diff --git a/Vendor/visual_captcha/images/chair@2x.png b/Vendor/visual_captcha/images/chair@2x.png new file mode 100644 index 00000000..c0b8dc6b Binary files /dev/null and b/Vendor/visual_captcha/images/chair@2x.png differ diff --git a/Vendor/visual_captcha/images/clip.png b/Vendor/visual_captcha/images/clip.png new file mode 100644 index 00000000..cdb14bb1 Binary files /dev/null and b/Vendor/visual_captcha/images/clip.png differ diff --git a/Vendor/visual_captcha/images/clip@2x.png b/Vendor/visual_captcha/images/clip@2x.png new file mode 100644 index 00000000..7ecba5b1 Binary files /dev/null and b/Vendor/visual_captcha/images/clip@2x.png differ diff --git a/Vendor/visual_captcha/images/clock.png b/Vendor/visual_captcha/images/clock.png new file mode 100644 index 00000000..ce7e2731 Binary files /dev/null and b/Vendor/visual_captcha/images/clock.png differ diff --git a/Vendor/visual_captcha/images/clock@2x.png b/Vendor/visual_captcha/images/clock@2x.png new file mode 100644 index 00000000..b30f18aa Binary files /dev/null and b/Vendor/visual_captcha/images/clock@2x.png differ diff --git a/Vendor/visual_captcha/images/cloud.png b/Vendor/visual_captcha/images/cloud.png new file mode 100644 index 00000000..81ad1f2c Binary files /dev/null and b/Vendor/visual_captcha/images/cloud.png differ diff --git a/Vendor/visual_captcha/images/cloud@2x.png b/Vendor/visual_captcha/images/cloud@2x.png new file mode 100644 index 00000000..35f03a1e Binary files /dev/null and b/Vendor/visual_captcha/images/cloud@2x.png differ diff --git a/Vendor/visual_captcha/images/computer.png b/Vendor/visual_captcha/images/computer.png new file mode 100644 index 00000000..0686f7f8 Binary files /dev/null and b/Vendor/visual_captcha/images/computer.png differ diff --git a/Vendor/visual_captcha/images/computer@2x.png b/Vendor/visual_captcha/images/computer@2x.png new file mode 100644 index 00000000..07dd0fcf Binary files /dev/null and b/Vendor/visual_captcha/images/computer@2x.png differ diff --git a/Vendor/visual_captcha/images/envelope.png b/Vendor/visual_captcha/images/envelope.png new file mode 100644 index 00000000..8c5d59cc Binary files /dev/null and b/Vendor/visual_captcha/images/envelope.png differ diff --git a/Vendor/visual_captcha/images/envelope@2x.png b/Vendor/visual_captcha/images/envelope@2x.png new file mode 100644 index 00000000..915896f0 Binary files /dev/null and b/Vendor/visual_captcha/images/envelope@2x.png differ diff --git a/Vendor/visual_captcha/images/eye.png b/Vendor/visual_captcha/images/eye.png new file mode 100644 index 00000000..1b8ed6b3 Binary files /dev/null and b/Vendor/visual_captcha/images/eye.png differ diff --git a/Vendor/visual_captcha/images/eye@2x.png b/Vendor/visual_captcha/images/eye@2x.png new file mode 100644 index 00000000..749c6c29 Binary files /dev/null and b/Vendor/visual_captcha/images/eye@2x.png differ diff --git a/Vendor/visual_captcha/images/flag.png b/Vendor/visual_captcha/images/flag.png new file mode 100644 index 00000000..3acb3f0d Binary files /dev/null and b/Vendor/visual_captcha/images/flag.png differ diff --git a/Vendor/visual_captcha/images/flag@2x.png b/Vendor/visual_captcha/images/flag@2x.png new file mode 100644 index 00000000..d2b01ece Binary files /dev/null and b/Vendor/visual_captcha/images/flag@2x.png differ diff --git a/Vendor/visual_captcha/images/folder.png b/Vendor/visual_captcha/images/folder.png new file mode 100644 index 00000000..9c1f5cd8 Binary files /dev/null and b/Vendor/visual_captcha/images/folder.png differ diff --git a/Vendor/visual_captcha/images/folder@2x.png b/Vendor/visual_captcha/images/folder@2x.png new file mode 100644 index 00000000..39479975 Binary files /dev/null and b/Vendor/visual_captcha/images/folder@2x.png differ diff --git a/Vendor/visual_captcha/images/foot.png b/Vendor/visual_captcha/images/foot.png new file mode 100644 index 00000000..56e519e2 Binary files /dev/null and b/Vendor/visual_captcha/images/foot.png differ diff --git a/Vendor/visual_captcha/images/foot@2x.png b/Vendor/visual_captcha/images/foot@2x.png new file mode 100644 index 00000000..d7879aa6 Binary files /dev/null and b/Vendor/visual_captcha/images/foot@2x.png differ diff --git a/Vendor/visual_captcha/images/graph.png b/Vendor/visual_captcha/images/graph.png new file mode 100644 index 00000000..5dfabc02 Binary files /dev/null and b/Vendor/visual_captcha/images/graph.png differ diff --git a/Vendor/visual_captcha/images/graph@2x.png b/Vendor/visual_captcha/images/graph@2x.png new file mode 100644 index 00000000..4daacf35 Binary files /dev/null and b/Vendor/visual_captcha/images/graph@2x.png differ diff --git a/Vendor/visual_captcha/images/house.png b/Vendor/visual_captcha/images/house.png new file mode 100644 index 00000000..eabbebe9 Binary files /dev/null and b/Vendor/visual_captcha/images/house.png differ diff --git a/Vendor/visual_captcha/images/house@2x.png b/Vendor/visual_captcha/images/house@2x.png new file mode 100644 index 00000000..afd23d95 Binary files /dev/null and b/Vendor/visual_captcha/images/house@2x.png differ diff --git a/Vendor/visual_captcha/images/key.png b/Vendor/visual_captcha/images/key.png new file mode 100644 index 00000000..30d726c1 Binary files /dev/null and b/Vendor/visual_captcha/images/key.png differ diff --git a/Vendor/visual_captcha/images/key@2x.png b/Vendor/visual_captcha/images/key@2x.png new file mode 100644 index 00000000..135bb2a4 Binary files /dev/null and b/Vendor/visual_captcha/images/key@2x.png differ diff --git a/Vendor/visual_captcha/images/leaf.png b/Vendor/visual_captcha/images/leaf.png new file mode 100644 index 00000000..8c1d24a9 Binary files /dev/null and b/Vendor/visual_captcha/images/leaf.png differ diff --git a/Vendor/visual_captcha/images/leaf@2x.png b/Vendor/visual_captcha/images/leaf@2x.png new file mode 100644 index 00000000..dc1631ca Binary files /dev/null and b/Vendor/visual_captcha/images/leaf@2x.png differ diff --git a/Vendor/visual_captcha/images/light-bulb.png b/Vendor/visual_captcha/images/light-bulb.png new file mode 100644 index 00000000..6cfe3811 Binary files /dev/null and b/Vendor/visual_captcha/images/light-bulb.png differ diff --git a/Vendor/visual_captcha/images/light-bulb@2x.png b/Vendor/visual_captcha/images/light-bulb@2x.png new file mode 100644 index 00000000..13014bad Binary files /dev/null and b/Vendor/visual_captcha/images/light-bulb@2x.png differ diff --git a/Vendor/visual_captcha/images/lock.png b/Vendor/visual_captcha/images/lock.png new file mode 100644 index 00000000..ada8d846 Binary files /dev/null and b/Vendor/visual_captcha/images/lock.png differ diff --git a/Vendor/visual_captcha/images/lock@2x.png b/Vendor/visual_captcha/images/lock@2x.png new file mode 100644 index 00000000..893a58b5 Binary files /dev/null and b/Vendor/visual_captcha/images/lock@2x.png differ diff --git a/Vendor/visual_captcha/images/magnifying-glass.png b/Vendor/visual_captcha/images/magnifying-glass.png new file mode 100644 index 00000000..14bea5cf Binary files /dev/null and b/Vendor/visual_captcha/images/magnifying-glass.png differ diff --git a/Vendor/visual_captcha/images/magnifying-glass@2x.png b/Vendor/visual_captcha/images/magnifying-glass@2x.png new file mode 100644 index 00000000..92c3419e Binary files /dev/null and b/Vendor/visual_captcha/images/magnifying-glass@2x.png differ diff --git a/Vendor/visual_captcha/images/man.png b/Vendor/visual_captcha/images/man.png new file mode 100644 index 00000000..0ac1c4fc Binary files /dev/null and b/Vendor/visual_captcha/images/man.png differ diff --git a/Vendor/visual_captcha/images/man@2x.png b/Vendor/visual_captcha/images/man@2x.png new file mode 100644 index 00000000..65d0db8c Binary files /dev/null and b/Vendor/visual_captcha/images/man@2x.png differ diff --git a/Vendor/visual_captcha/images/music-note.png b/Vendor/visual_captcha/images/music-note.png new file mode 100644 index 00000000..f44d8efe Binary files /dev/null and b/Vendor/visual_captcha/images/music-note.png differ diff --git a/Vendor/visual_captcha/images/music-note@2x.png b/Vendor/visual_captcha/images/music-note@2x.png new file mode 100644 index 00000000..1d7f31c2 Binary files /dev/null and b/Vendor/visual_captcha/images/music-note@2x.png differ diff --git a/Vendor/visual_captcha/images/pants.png b/Vendor/visual_captcha/images/pants.png new file mode 100644 index 00000000..0a345237 Binary files /dev/null and b/Vendor/visual_captcha/images/pants.png differ diff --git a/Vendor/visual_captcha/images/pants@2x.png b/Vendor/visual_captcha/images/pants@2x.png new file mode 100644 index 00000000..77fea8d2 Binary files /dev/null and b/Vendor/visual_captcha/images/pants@2x.png differ diff --git a/Vendor/visual_captcha/images/pencil.png b/Vendor/visual_captcha/images/pencil.png new file mode 100644 index 00000000..b0e89517 Binary files /dev/null and b/Vendor/visual_captcha/images/pencil.png differ diff --git a/Vendor/visual_captcha/images/pencil@2x.png b/Vendor/visual_captcha/images/pencil@2x.png new file mode 100644 index 00000000..a95f9985 Binary files /dev/null and b/Vendor/visual_captcha/images/pencil@2x.png differ diff --git a/Vendor/visual_captcha/images/printer.png b/Vendor/visual_captcha/images/printer.png new file mode 100644 index 00000000..63348f80 Binary files /dev/null and b/Vendor/visual_captcha/images/printer.png differ diff --git a/Vendor/visual_captcha/images/printer@2x.png b/Vendor/visual_captcha/images/printer@2x.png new file mode 100644 index 00000000..bec9c43e Binary files /dev/null and b/Vendor/visual_captcha/images/printer@2x.png differ diff --git a/Vendor/visual_captcha/images/robot.png b/Vendor/visual_captcha/images/robot.png new file mode 100644 index 00000000..96b4df17 Binary files /dev/null and b/Vendor/visual_captcha/images/robot.png differ diff --git a/Vendor/visual_captcha/images/robot@2x.png b/Vendor/visual_captcha/images/robot@2x.png new file mode 100644 index 00000000..cb2df1de Binary files /dev/null and b/Vendor/visual_captcha/images/robot@2x.png differ diff --git a/Vendor/visual_captcha/images/scissors.png b/Vendor/visual_captcha/images/scissors.png new file mode 100644 index 00000000..60bf9b58 Binary files /dev/null and b/Vendor/visual_captcha/images/scissors.png differ diff --git a/Vendor/visual_captcha/images/scissors@2x.png b/Vendor/visual_captcha/images/scissors@2x.png new file mode 100644 index 00000000..6701869d Binary files /dev/null and b/Vendor/visual_captcha/images/scissors@2x.png differ diff --git a/Vendor/visual_captcha/images/sunglasses.png b/Vendor/visual_captcha/images/sunglasses.png new file mode 100644 index 00000000..6d70113d Binary files /dev/null and b/Vendor/visual_captcha/images/sunglasses.png differ diff --git a/Vendor/visual_captcha/images/sunglasses@2x.png b/Vendor/visual_captcha/images/sunglasses@2x.png new file mode 100644 index 00000000..df2ca66d Binary files /dev/null and b/Vendor/visual_captcha/images/sunglasses@2x.png differ diff --git a/Vendor/visual_captcha/images/t-shirt.png b/Vendor/visual_captcha/images/t-shirt.png new file mode 100644 index 00000000..3f60be5f Binary files /dev/null and b/Vendor/visual_captcha/images/t-shirt.png differ diff --git a/Vendor/visual_captcha/images/t-shirt@2x.png b/Vendor/visual_captcha/images/t-shirt@2x.png new file mode 100644 index 00000000..49077f3b Binary files /dev/null and b/Vendor/visual_captcha/images/t-shirt@2x.png differ diff --git a/Vendor/visual_captcha/images/tag.png b/Vendor/visual_captcha/images/tag.png new file mode 100644 index 00000000..da35359d Binary files /dev/null and b/Vendor/visual_captcha/images/tag.png differ diff --git a/Vendor/visual_captcha/images/tag@2x.png b/Vendor/visual_captcha/images/tag@2x.png new file mode 100644 index 00000000..ac5b6495 Binary files /dev/null and b/Vendor/visual_captcha/images/tag@2x.png differ diff --git a/Vendor/visual_captcha/images/tree.png b/Vendor/visual_captcha/images/tree.png new file mode 100644 index 00000000..8b14461a Binary files /dev/null and b/Vendor/visual_captcha/images/tree.png differ diff --git a/Vendor/visual_captcha/images/tree@2x.png b/Vendor/visual_captcha/images/tree@2x.png new file mode 100644 index 00000000..e2d0eb18 Binary files /dev/null and b/Vendor/visual_captcha/images/tree@2x.png differ diff --git a/Vendor/visual_captcha/images/truck.png b/Vendor/visual_captcha/images/truck.png new file mode 100644 index 00000000..e500be6a Binary files /dev/null and b/Vendor/visual_captcha/images/truck.png differ diff --git a/Vendor/visual_captcha/images/truck@2x.png b/Vendor/visual_captcha/images/truck@2x.png new file mode 100644 index 00000000..66ae5073 Binary files /dev/null and b/Vendor/visual_captcha/images/truck@2x.png differ diff --git a/Vendor/visual_captcha/images/umbrella.png b/Vendor/visual_captcha/images/umbrella.png new file mode 100644 index 00000000..e284a206 Binary files /dev/null and b/Vendor/visual_captcha/images/umbrella.png differ diff --git a/Vendor/visual_captcha/images/umbrella@2x.png b/Vendor/visual_captcha/images/umbrella@2x.png new file mode 100644 index 00000000..4a832c1e Binary files /dev/null and b/Vendor/visual_captcha/images/umbrella@2x.png differ diff --git a/Vendor/visual_captcha/images/woman.png b/Vendor/visual_captcha/images/woman.png new file mode 100644 index 00000000..06309986 Binary files /dev/null and b/Vendor/visual_captcha/images/woman.png differ diff --git a/Vendor/visual_captcha/images/woman@2x.png b/Vendor/visual_captcha/images/woman@2x.png new file mode 100644 index 00000000..83be4954 Binary files /dev/null and b/Vendor/visual_captcha/images/woman@2x.png differ diff --git a/Vendor/visual_captcha/images/world.png b/Vendor/visual_captcha/images/world.png new file mode 100644 index 00000000..26ed3cf5 Binary files /dev/null and b/Vendor/visual_captcha/images/world.png differ diff --git a/Vendor/visual_captcha/images/world@2x.png b/Vendor/visual_captcha/images/world@2x.png new file mode 100644 index 00000000..c5c0e5af Binary files /dev/null and b/Vendor/visual_captcha/images/world@2x.png differ diff --git a/Vendor/visual_captcha/ja/audios.json b/Vendor/visual_captcha/ja/audios.json new file mode 100644 index 00000000..43e4fea5 --- /dev/null +++ b/Vendor/visual_captcha/ja/audios.json @@ -0,0 +1,54 @@ +[ + { + "path": "5times2_ja.mp3", + "value": "10" + }, + { + "path": "2times10_ja.mp3", + "value": "20" + }, + { + "path": "5plus1_ja.mp3", + "value": "6" + }, + { + "path": "4plus1_ja.mp3", + "value": "5" + }, + { + "path": "4plus3_ja.mp3", + "value": "7" + }, + { + "path": "6plus6_ja.mp3", + "value": "12" + }, + { + "path": "12times2_ja.mp3", + "value": "24" + }, + { + "path": "99plus1_ja.mp3", + "value": "100" + }, + { + "path": "add3to1_ja.mp3", + "value": "4" + }, + { + "path": "addblueandyellow_ja.mp3", + "value": "みどり" + }, + { + "path": "after2_ja.mp3", + "value": "3" + }, + { + "path": "divide4by2_ja.mp3", + "value": "2" + }, + { + "path": "firstletteralphabet_ja.mp3", + "value": "あ" + } +] \ No newline at end of file diff --git a/Vendor/visual_captcha/ja/images.json b/Vendor/visual_captcha/ja/images.json new file mode 100644 index 00000000..5e6908e6 --- /dev/null +++ b/Vendor/visual_captcha/ja/images.json @@ -0,0 +1,150 @@ +[ + { + "name": "ひこうき", + "path": "airplane.png" + }, + { + "name": "ふうせん", + "path": "balloons.png" + }, + { + "name": "カメラ", + "path": "camera.png" + }, + { + "name": "車", + "path": "car.png" + }, + { + "name": "ねこ", + "path": "cat.png" + }, + { + "name": "いす", + "path": "chair.png" + }, + { + "name": "クリップ", + "path": "clip.png" + }, + { + "name": "とけい", + "path": "clock.png" + }, + { + "name": "くも", + "path": "cloud.png" + }, + { + "name": "コンピューター", + "path": "computer.png" + }, + { + "name": "ふうとう", + "path": "envelope.png" + }, + { + "name": "目", + "path": "eye.png" + }, + { + "name": "はた", + "path": "flag.png" + }, + { + "name": "フォルダー", + "path": "folder.png" + }, + { + "name": "足", + "path": "foot.png" + }, + { + "name": "グラフ", + "path": "graph.png" + }, + { + "name": "家", + "path": "house.png" + }, + { + "name": "かぎ", + "path": "key.png" + }, + { + "name": "葉っぱ", + "path": "leaf.png" + }, + { + "name": "電球", + "path": "light-bulb.png" + }, + { + "name": "南京錠", + "path": "lock.png" + }, + { + "name": "むしめがね", + "path": "magnifying-glass.png" + }, + { + "name": "男の人", + "path": "man.png" + }, + { + "name": "ト音記号", + "path": "music-note.png" + }, + { + "name": "ズボン", + "path": "pants.png" + }, + { + "name": "鉛筆", + "path": "pencil.png" + }, + { + "name": "プリンター", + "path": "printer.png" + }, + { + "name": "ロボット", + "path": "robot.png" + }, + { + "name": "はさみ", + "path": "scissors.png" + }, + { + "name": "サングラス", + "path": "sunglasses.png" + }, + { + "name": "タグ", + "path": "tag.png" + }, + { + "name": "木", + "path": "tree.png" + }, + { + "name": "トラック", + "path": "truck.png" + }, + { + "name": "Tシャツ", + "path": "t-shirt.png" + }, + { + "name": "かさ", + "path": "umbrella.png" + }, + { + "name": "女の人", + "path": "woman.png" + }, + { + "name": "地球", + "path": "world.png" + } +] \ No newline at end of file diff --git a/View/Elements/visual_captcha.ctp b/View/Elements/visual_captcha.ctp new file mode 100644 index 00000000..efff8047 --- /dev/null +++ b/View/Elements/visual_captcha.ctp @@ -0,0 +1,44 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + */ +?> +
+ + + + + + + \ No newline at end of file