Compare commits

..

No commits in common. "master" and "1.8.0-beta.3" have entirely different histories.

6651 changed files with 208119 additions and 455581 deletions

View file

@ -1,23 +0,0 @@
root = true
[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
[*.md]
trim_trailing_whitespace = false
[*.py]
indent_style = space
indent_size = 4
[*.{json,yml,md}]
indent_style = space
indent_size = 2
[*.{jsx,tsx,svelte,vue}]
indent_style = space
indent_size = 2

8
.gitattributes vendored
View file

@ -1,6 +1,8 @@
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
codeception.dist.yml export-ignore
/tools/ export-ignore
/tests/ export-ignore
/common/vendor/bin/ export-ignore
/phpDoc/ export-ignore
Gruntfile.js export-ignore
package.json export-ignore
.travis.yml export-ignore

View file

@ -1,35 +0,0 @@
name: PHP Lint & Codeception
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
name: PHP ${{ matrix.php }}
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Install PHP
run: chmod +x .github/workflows/setup-php.sh && .github/workflows/setup-php.sh ${{ matrix.php }}
- name: Create test database
run: chmod +x .github/workflows/setup-mysql.sh && .github/workflows/setup-mysql.sh
- name: PHP Lint
run: if find . -name "*.php" ! -path "./common/vendor/*" -print0 | xargs -0 -n 1 -P 8 php -l | grep -v "No syntax errors detected"; then exit 1; fi
- name: Download codeception
run: wget https://res.rhymix.org/ci/php${{ matrix.php }}/codecept.phar
- name: Run PHP development server
run: php -S localhost:8000 &
- name: Build and run codeception
run: |
php codecept.phar build
php codecept.phar run --debug --fail-fast

View file

@ -1,14 +0,0 @@
#!/bin/bash
AUTH="-uroot -proot"
# Start MySQL
sudo systemctl start mysql.service
# Create default database
sudo mysql $AUTH -e "CREATE DATABASE rhymix CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"
sudo mysql $AUTH -e "CREATE USER rhymix@localhost IDENTIFIED WITH mysql_native_password BY 'rhymix'"
sudo mysql $AUTH -e "GRANT ALL ON rhymix.* to rhymix@localhost; FLUSH PRIVILEGES"
# Check MySQL version
sudo mysql $AUTH -e "SELECT VERSION()"

View file

@ -1,39 +0,0 @@
#!/bin/bash
# Based on https://github.com/nanasess/setup-php
sudo add-apt-repository -y ppa:ondrej/php
# Install all required packages
sudo apt -y install \
php$1-apcu \
php$1-bcmath \
php$1-cli \
php$1-common \
php$1-curl \
php$1-gd \
php$1-intl \
php$1-mbstring \
php$1-mysql \
php$1-readline \
php$1-sqlite3 \
php$1-xml \
php$1-zip
# Adjust php.ini settings
sudo bash -c "echo 'register_argc_argv = On' >> /etc/php/$1/cli/php.ini"
sudo bash -c "echo 'opcache.enable = 1' >> /etc/php/$1/cli/conf.d/10-opcache.ini"
sudo bash -c "echo 'opcache.enable_cli = 1' >> /etc/php/$1/cli/conf.d/10-opcache.ini"
sudo bash -c "echo 'opcache.jit = tracing' >> /etc/php/$1/cli/conf.d/10-opcache.ini"
sudo bash -c "echo 'opcache.jit_buffer_size = 128M' >> /etc/php/$1/cli/conf.d/10-opcache.ini"
# Enable APCu
if [ -f "/etc/php/$1/cli/conf.d/20-apcu.ini" ]; then
sudo bash -c "echo 'apc.enable_cli = 1' >> /etc/php/$1/cli/conf.d/20-apcu.ini"
fi
# Disable xdebug
sudo phpdismod -v ALL -s ALL xdebug
# Set and check default PHP version
sudo update-alternatives --set php /usr/bin/php$1
php -v

27
.gitignore vendored
View file

@ -1,27 +1,6 @@
.DS_Store
Thumbs.db
/config/config.user.inc.php
/config/install.config.php
config.user.inc.php
/files/
/build/
/libs/
codeception.yml
/tests/_output/
/tests/*.suite.yml
/tests/_support/InstallTester.php
/tests/_support/UnitTester.php
/tests/_support/_generated/
/node_modules/
/bower_components/
composer.phar
codecept.phar
.idea
*.sublime-workspace
*.sublime-project
.codeintel
.vscode
error_log
.DS_Store
Thumbs.db

View file

@ -1,19 +1,21 @@
RewriteEngine On
# block direct access to templates, XML schema files, config files, dotfiles, environment, etc.
RewriteCond %{REQUEST_URI} !/modules/editor/(skins|styles)/
RewriteRule ^(addons|common/tpl|files/(faceOff|ruleset)|(m\.)?layouts|modules|plugins|themes|widgets|widgetstyles)/.+\.(html|xml|blade\.php)$ - [L,F]
RewriteRule ^files/(attach|config|cache)/.+\.(ph(p|t|ar)?[0-9]?|p?html?|cgi|pl|exe|[aj]spx?|inc|bak)$ - [L,F]
RewriteRule ^files/(env|member_extra_info/(new_message_flags|point))/ - [L,F]
RewriteRule ^(\.git|\.ht|\.travis|codeception\.|composer\.|Gruntfile\.js|package\.json|CONTRIBUTING|COPYRIGHT|LICENSE|README) - [L,F]
# reserve XE Layout Template Source File (*.html)
RewriteRule ^(layouts|m.layouts)/(.+)\.html$ - [L,F]
# reserve XE Template Source Files (*.html)
RewriteCond %{REQUEST_URI} !/modules/editor/
RewriteRule /(skins|m.skins)/(.+)\.html$ - [L,F]
# conf, query, schema
RewriteRule ^(modules|addons|widgets)/(.+)/(conf|queries|schemas)/(.+)\.xml$ ./index.php [L]
# static files
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)/(addons|files|layouts|m\.layouts|modules|widgets|widgetstyles)/(.*) ./$2/$3 [L]
RewriteRule ^(.+)/files/(member_extra_info|attach|cache|faceOff)/(.*) ./files/$2/$3 [L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)\.min\.(css|js)$ ./$1.$2 [L]
RewriteRule ^(.+)/(files|modules|widgets|widgetstyles|layouts|m.layouts|addons)/(.*) ./$2/$3 [L]
# all other short URLs
# router
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule . index.php [L]
RewriteRule ^(.*)$ ./index.php [L]

9
.jshintignore Normal file
View file

@ -0,0 +1,9 @@
common/js/jquery*.js
common/js/modernizr.js
common/js/xe.js
common/js/x.js
common/js/*.min.js
common/js/unittest/*
common/js/plugins/*
common/js/foggyLayer.js
common/js/html5.js

68
.jshintrc Normal file
View file

@ -0,0 +1,68 @@
{
"globalstrict": false,
"undef": false,
"eqeqeq": false,
"browser": true,
"devel": true,
"jquery": true,
"evil": true,
"globals": {
"window": true,
"current_url": true,
"exec_json": true,
"exec_xml": true,
"procFilter": true,
"xe": true,
"request_uri": true,
"xAddEventListener": false,
"xResizeEvent": false,
"xScrollEvent": false,
"xAppendChild": false,
"xClientHeight": false,
"xClientWidth": false,
"xCreateElement": false,
"xDef": false,
"xDeleteCookie": false,
"xDisplay": false,
"xEvent": false,
"xFirstChild": false,
"xGetBodyWidth": false,
"xGetBodyHeight": false,
"xGetComputedStyle": false,
"xGetCookie": false,
"xGetElementById": false,
"xGetElementsByAttribute": false,
"xGetElementsByClassName": false,
"xGetElementsByTagName": false,
"xGetURLArguments": false,
"xHeight": false,
"xHex": false,
"xHide": false,
"xInnerHtml": false,
"xLeft": false,
"xMoveTo": false,
"xName": false,
"xNextSib": false,
"xNum": false,
"xOffsetLeft": false,
"xOffsetTop": false,
"xPad": false,
"xPageX": false,
"xPageY": false,
"xParent": false,
"xPreventDefault": false,
"xPrevSib": false,
"xRemoveEventListener": false,
"xResizeTo": false,
"xScrollLeft": false,
"xScrollTop": false,
"xSetCookie": false,
"xShow": false,
"xStr": false,
"xTop": false,
"xVisibility": false,
"xWidth": false,
"xZIndex": false,
"xStopPropagation": false
}
}

12
.travis.yml Normal file
View file

@ -0,0 +1,12 @@
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
before_script:
- npm install -g grunt-cli
- npm install
script:
- grunt lint

View file

@ -1,7 +1,25 @@
# 개발에 참여하고 싶으신 분들께 드리는 안내문
# Contribution Guide
이 파일의 내용은 공식 매뉴얼로 옮겨졌습니다.
## Issue 작성
Issue 작성 시 참고해주세요.
- [이슈 및 PR 작성 방법](https://rhymix.org/manual/contrib/github)
- [코딩 규칙](https://rhymix.org/manual/contrib/coding-standards)
- [GPL: 개발자, 디자이너, 사용자 등의 권리와 의무](https://rhymix.org/manual/contrib/license)
* 작성하려는 이슈가 이미 있는지 검색 후 등록해주세요. 비슷한 이슈가 있다면 댓글로 추가 내용을 덧붙일 수 있습니다.
* 이슈에는 하나의 문제 또는 제안을 작성해주세요. 절대 하나의 이슈에 2개 이상의 내용을 적지마세요.
* 이슈는 가능한 상세하고 간결하게 작성해주세요.
* 필요하다면 화면을 캡처하여 이미지를 업로드할 수 있습니다.
## Pull request(PR)
* `master` 브랜치의 코드는 수정하지마세요.
* PR은 `develop` 브랜치만 허용합니다.
* `develop` 브랜치를 부모로 한 토픽 브랜치를 활용하면 편리합니다.
## Coding Guidelines
코드를 기여할 때 Coding conventions을 따라야합니다.
* 모든 text 파일의 charset은 BOM이 없는 UTF-8입니다.
* newline은 UNIX type을 사용합니다. 일부 파일이 다른 type을 사용하더라도 절대 고치지 마세요!
* 들여쓰기는 1개의 탭으로 합니다.
* class 선언과 function, if, foreach, for, while 등 중괄호의 `{}`는 다음 줄에 있어야 합니다.
* 마찬가지로 선언 다음에는 공백을 두지 않습니다. ex) CORRECT `if(...)`, INCORRECT `if (...)`
* **Coding convention에 맞지 않는 코드를 발견 하더라도 목적과 관계 없는 코드는 절대 고치지 마세요.**

1
COPYRIGHT Normal file
View file

@ -0,0 +1 @@
Copyright (C) NAVER <http://www.navercorp.com>

376
Gruntfile.js Normal file
View file

@ -0,0 +1,376 @@
module.exports = function(grunt) {
"use strict";
var banner = '/*! Copyright (C) NAVER <http://www.navercorp.com> */\n';
var banner_xe_js = banner + '/**!\n * @concat modernizr.js + common.js + js_app.js + xml_handler.js + xml_js_filter.js\n * @brief XE Common JavaScript\n **/\n';
grunt.file.defaultEncoding = 'utf8';
grunt.initConfig({
clean: {
minify: [
'common/js/xe.js',
'common/js/xe.min.js',
'common/css/xe.min.css',
'common/css/mobile.min.css'
]
},
concat: {
'common-js': {
options: {
stripBanners: true,
banner: banner_xe_js
},
src: [
'common/js/modernizr.js',
'common/js/common.js',
'common/js/js_app.js',
'common/js/xml_handler.js',
'common/js/xml_js_filter.js'
],
dest: 'common/js/xe.js'
},
'xpresseditor': {
options: {
stripBanners: true,
banner: '/**!\n * @concat Xpress_Editor.js + xe_interface.js \n **/\n'
},
src: [
'modules/editor/skins/xpresseditor/js/Xpress_Editor.js',
'modules/editor/skins/xpresseditor/js/xe_interface.js',
],
dest: 'modules/editor/skins/xpresseditor/js/xpresseditor.js'
}
},
uglify: {
'common-js': {
options: {
banner: banner_xe_js
},
files: {
'common/js/xe.min.js': ['common/js/xe.js'],
}
},
'common-js-plugins': {
files: {
'common/js/plugins/jquery.fileupload/js/main.min.js': ['common/js/plugins/jquery.fileupload/js/main.js'],
}
},
'handlebars': {
files: {
'common/js/plugins/handlebars/handlebars.min.js': ['common/js/plugins/handlebars/handlebars.js'],
'common/js/plugins/handlebars.runtime/handlebars.runtime.min.js': ['common/js/plugins/handlebars.runtime/handlebars.runtime.js'],
}
},
'modules': {
files: {
'common/js/x.min.js' : ['common/js/x.js'],
// addon
'addons/captcha/captcha.min.js' : ['addons/captcha/captcha.js'],
'addons/captcha_member/captcha.min.js' : ['addons/captcha_member/captcha.js'],
'addons/resize_image/js/resize_image.min.js' : ['addons/resize_image/js/resize_image.js'],
// module/editor
'modules/editor/skins/xpresseditor/js/xpresseditor.min.js': ['modules/editor/skins/xpresseditor/js/xpresseditor.js'],
'modules/editor/skins/xpresseditor/js/xe_textarea.min.js': ['modules/editor/skins/xpresseditor/js/xe_textarea.js'],
'modules/editor/skins/ckeditor/js/default.min.js': ['modules/editor/skins/ckeditor/js/default.js'],
'modules/editor/skins/ckeditor/js/xe_interface.min.js': ['modules/editor/skins/ckeditor/js/xe_interface.js'],
'modules/editor/skins/ckeditor/js/xe_textarea.min.js': ['modules/editor/skins/ckeditor/js/xe_textarea.js'],
'modules/editor/tpl/js/editor_common.min.js': ['modules/editor/tpl/js/editor_common.js'],
'modules/editor/tpl/js/swfupload.min.js': ['modules/editor/tpl/js/swfupload.js'],
'modules/editor/tpl/js/uploader.min.js': ['modules/editor/tpl/js/uploader.js'],
'modules/editor/tpl/js/editor.min.js': ['modules/editor/tpl/js/editor.js'],
'modules/editor/tpl/js/editor_module_config.min.js': ['modules/editor/tpl/js/editor_module_config.js'],
'modules/editor/tpl/js/editor.app.min.js': ['modules/editor/tpl/js/editor.app.js'],
// module/admin
'modules/admin/tpl/js/admin.min.js': ['modules/admin/tpl/js/admin.js'],
'modules/admin/tpl/js/config.min.js': ['modules/admin/tpl/js/config.js'],
'modules/admin/tpl/js/menu_setup.min.js': ['modules/admin/tpl/js/menu_setup.js'],
//module/board
'modules/board/tpl/js/board.min.js': ['modules/board/tpl/js/board.js'],
'modules/board/tpl/js/board_admin.min.js': ['modules/board/tpl/js/board_admin.js'],
'modules/board/skins/default/board.default.min.js': ['modules/board/skins/default/board.default.js'],
'modules/board/m.skins/default/js/mboard.min.js': ['modules/board/m.skins/default/js/mboard.js'],
'modules/board/m.skins/simpleGray/js/mboard.min.js': ['modules/board/m.skins/simpleGray/js/mboard.js'],
// editor-component-image-gallery
'modules/editor/components/image_gallery/tpl/gallery.min.js' : ['modules/editor/components/image_gallery/tpl/gallery.js'],
'modules/editor/components/image_gallery/tpl/list_gallery.min.js' : ['modules/editor/components/image_gallery/tpl/list_gallery.js'],
'modules/editor/components/image_gallery/tpl/popup.min.js' : ['modules/editor/components/image_gallery/tpl/popup.js'],
'modules/editor/components/image_gallery/tpl/slide_gallery.min.js' : ['modules/editor/components/image_gallery/tpl/slide_gallery.js'],
// module/importer
'modules/importer/tpl/js/importer_admin.min.js': ['modules/importer/tpl/js/importer_admin.js'],
// modules/widget
'modules/widget/tpl/js/generate_code.min.js': ['modules/widget/tpl/js/generate_code.js'],
'modules/widget/tpl/js/widget.min.js': ['modules/widget/tpl/js/widget.js'],
'modules/widget/tpl/js/widget_admin.min.js': ['modules/widget/tpl/js/widget_admin.js'],
// modules/poll
'modules/poll/tpl/js/poll_admin.min.js': ['modules/poll/tpl/js/poll_admin.js'],
'modules/poll/tpl/js/poll.min.js': ['modules/poll/tpl/js/poll.js'],
'addons/oembed/jquery.oembed.min.js': ['addons/oembed/jquery.oembed.js'],
'addons/oembed/oembed.min.js': ['addons/oembed/oembed.js'],
}
},
},
cssmin: {
'common': {
files: {
'common/css/xe.min.css': ['common/css/xe.css'],
'common/css/mobile.min.css': ['common/css/mobile.css']
}
},
'modules': {
files: {
'modules/admin/tpl/css/admin.min.css': ['modules/admin/tpl/css/admin.css'],
'modules/editor/components/image_gallery/tpl/popup.min.css': ['modules/editor/components/image_gallery/tpl/popup.css'],
'modules/editor/components/image_gallery/tpl/slide_gallery.min.css': ['modules/editor/components/image_gallery/tpl/slide_gallery.css'],
'modules/widget/tpl/css/widget.min.css': ['modules/widget/tpl/css/widget.css'],
'modules/poll/tpl/css/poll.min.css': ['modules/poll/tpl/css/poll.css'],
'modules/poll/skins/default/css/poll.min.css': ['modules/poll/skins/default/css/poll.css'],
'modules/poll/skins/simple/css/poll.min.css': ['modules/poll/skins/simple/css/poll.css'],
'modules/editor/skins/xpresseditor/css/default.min.css': ['modules/editor/skins/xpresseditor/css/default.css'],
'modules/board/skins/default/board.default.min.css': ['modules/board/skins/default/board.default.css'],
'modules/board/m.skins/default/css/mboard.min.css': ['modules/board/m.skins/default/css/mboard.css'],
'modules/board/m.skins/simpleGray/css/mboard.min.css': ['modules/board/m.skins/simpleGray/css/mboard.css']
}
},
'addons': {
files: {
'addons/oembed/jquery.oembed.min.css': ['addons/oembed/jquery.oembed.css'],
}
},
},
jshint: {
files: [
'Gruntfile.js',
'common/js/*.js',
'modules/admin/tpl/js/*.js',
'modules/board/tpl/js/*.js',
'modules/editor/tpl/js/*.js',
'modules/menu/tpl/js/*.js',
'modules/widget/tpl/js/*.js',
],
options : {
ignores : [
'**/jquery*.js',
'**/swfupload.js',
'**/**.min.js',
'**/*-packed.js',
'**/*.compressed.js',
'**/jquery-*.js',
'**/jquery.*.js',
'common/js/html5.js',
'common/js/x.js',
'common/js/xe.js',
'common/js/modernizr.js',
]
}
},
csslint: {
'common-css': {
options: {
import : 2,
'adjoining-classes' : false,
'box-model' : false,
'duplicate-background-images' : false,
'ids' : false,
'important' : false,
'overqualified-elements' : false,
'qualified-headings' : false,
'star-property-hack' : false,
'underscore-property-hack' : false,
},
src: [
'common/css/*.css',
'!common/css/bootstrap.css',
'!common/css/bootstrap-responsive.css',
'!**/*.min.css',
]
}
},
phplint: {
default : {
options: {
phpCmd: "php",
},
src: [
"**/*.php",
"!files/**",
"!tests/**",
"!tools/**",
"!node_modules/**",
"!libs/**"
],
},
}
});
function createPackageChecksum(target_file) {
/* https://gist.github.com/onelaview/6475037 */
var fs = require('fs');
var crypto = require('crypto');
var md5 = crypto.createHash('md5');
var file = grunt.template.process(target_file);
var buffer = fs.readFileSync(file);
md5.update(buffer);
var md5Hash = md5.digest('hex');
grunt.verbose.writeln('file md5: ' + md5Hash);
var md5FileName = file + '.md5';
grunt.file.write(md5FileName, md5Hash);
grunt.verbose.writeln('File "' + md5FileName + '" created.').writeln('...');
}
grunt.registerTask('build', '', function(A, B) {
var _only_export = false;
var tasks = ['krzip', 'syndication'];
if(!A) {
grunt.fail.warn('Undefined build target.');
} else if(A && !B) {
_only_export = true;
}
if(!_only_export) {
tasks.push('changed');
target = A + '...' + B;
version = B;
} else {
target = A;
version = A;
}
var done = this.async();
var build_dir = 'build';
var archive_full = build_dir + '/xe.' + version + '.tar.gz';
var archive_changed = build_dir + '/xe.' + version + '.changed.tar.gz';
var diff, target, version;
var taskDone = function() {
tasks.pop();
grunt.verbose.writeln('remain tasks : '+tasks.length);
if(tasks.length === 0) {
grunt.util.spawn({
cmd: "tar",
args: ['cfz', '../xe.'+version+'.tar.gz', './'],
opts: {
cwd: 'build/xe',
cache: false
}
}, function (error, result, code) {
grunt.log.ok('Archived(full) : ' + build_dir + '/xe.'+version+'.tar.gz');
createPackageChecksum(build_dir + '/xe.'+version+'.tar.gz');
grunt.util.spawn({
cmd: "zip",
args: ['-r', '../xe.'+version+'.zip', './'],
opts: {
cwd: 'build/xe',
cache: false
}
}, function (error, result, code) {
grunt.log.ok('Archived(full) : ' + build_dir + '/xe.'+version+'.zip');
createPackageChecksum(build_dir + '/xe.'+version+'.zip');
grunt.file.delete('build/xe');
grunt.file.delete('build/temp.full.tar');
grunt.log.ok('Done!');
});
});
}
};
if(grunt.file.isDir(build_dir)) {
grunt.file.delete(build_dir);
}
grunt.file.mkdir(build_dir);
grunt.file.mkdir(build_dir + '/xe');
grunt.log.subhead('Archiving...');
grunt.log.writeln('Target : ' + target);
grunt.util.spawn({
cmd: "git",
args: ['archive', '--output=build/temp.full.tar', version, '.']
}, function (error, result, code){
if(!_only_export) {
// changed
grunt.util.spawn({
cmd: "git",
args: ['diff', '--name-only', '--diff-filter' ,'ACM', target]
}, function (error, result, code) {
diff = result.stdout;
if(diff) {
diff = diff.split(grunt.util.linefeed);
}
// changed
if(diff.length) {
var args_tar = ['archive', '-o', 'build/xe.'+version+'.changed.tar.gz', version];
var args_zip = ['archive', '-o', 'build/xe.'+version+'.changed.zip', version];
args_tar = args_tar.concat(diff);
args_zip = args_zip.concat(diff);
grunt.util.spawn({
cmd: "git",
args: args_tar
}, function (error, result, code) {
grunt.log.ok('Archived(changed) : ' + build_dir + '/xe.'+version+'.changed.tar.gz');
createPackageChecksum(build_dir + '/xe.'+version+'.changed.tar.gz');
grunt.util.spawn({
cmd: "git",
args: args_zip
}, function (error, result, code) {
grunt.log.ok('Archived(changed) : ' + build_dir + '/xe.'+version+'.changed.zip');
createPackageChecksum(build_dir + '/xe.'+version+'.changed.zip');
taskDone();
});
});
} else {
taskDone();
}
});
}
// full
grunt.util.spawn({
cmd: "tar",
args: ['xf', 'build/temp.full.tar', '-C', 'build/xe']
}, function (error, result, code) {
// krzip
grunt.util.spawn({
cmd: "git",
args: ['clone', '-b', 'master', 'git@github.com:xpressengine/xe-module-krzip.git', 'build/xe/modules/krzip']
}, function (error, result, code) {
grunt.file.delete('build/xe/modules/krzip/.git');
taskDone();
});
// syndication
grunt.util.spawn({
cmd: "git",
args: ['clone', '-b', 'master', 'git@github.com:xpressengine/xe-module-syndication.git', 'build/xe/modules/syndication']
}, function (error, result, code) {
grunt.file.delete('build/xe/modules/syndication/.git');
taskDone();
});
});
});
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-phplint');
grunt.registerTask('default', ['jshint', 'csslint']);
grunt.registerTask('lint', ['jshint', 'csslint', 'phplint']);
grunt.registerTask('minify', ['jshint', 'csslint', 'clean', 'concat', 'uglify', 'cssmin']);
};

650
LICENSE
View file

@ -1,221 +1,420 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) NAVER <http://www.navercorp.com>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
XE is an opensource and being developed in the opensource project.
For more information, please see the link below.
- Official website: http://www.xpressengine.com
- Official Repository: http://github.com/xpressengine/
"XpressEngine (XE)" is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-------
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
collective works based on the Library.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
5. You are not required to accept this License, since you have not
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
the Library or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
You are not responsible for enforcing compliance by third parties with
this License.
7. If, as a consequence of a court judgment or allegation of patent
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
@ -226,114 +425,57 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
END OF TERMS AND CONDITIONS

170
README.md
View file

@ -1,145 +1,57 @@
[![Rhymix](./common/img/logo.png)](https://rhymix.org)
XpressEngine
============
![PHP Lint & Codeception](https://github.com/rhymix/rhymix/workflows/PHP%20Lint%20&%20Codeception/badge.svg)
[![Build Status](https://travis-ci.org/xpressengine/xe-core.svg?branch=master)](https://travis-ci.org/xpressengine/xe-core)
[![License](http://img.shields.io/badge/license-GNU%20LGPL-brightgreen.svg)](http://www.gnu.org/licenses/gpl.html)
[![Latest release](http://img.shields.io/github/release/xpressengine/xe-core.svg)](https://github.com/xpressengine/xe-core/releases)
# 한국어
XpressEngine(XE)은 누구나 쉽고 편하고 자유롭게 콘텐츠를 발행을 할 수 있도록 하기 위한 CMS(Content Management System)입니다.
오픈소스 라이선스로 누구나 사용 또는 개작할 수 있으며, 개방형 프로젝트로서 누구나 개발에 참여할 수 있습니다.
Rhymix(라이믹스)는 누구든지 쉽고 자유롭게 독립적인 홈페이지를 만들어
자신을 표현하고 커뮤니티를 키워나갈 수 있도록 돕기 위한 CMS(content management system)입니다.
### 확장형 구조
[XpressEngine](https://xe1.xpressengine.com) 1.8 버전을 fork(가지치기)하여 진행하는 프로젝트로,
누구나 무료로 사용할 수 있고 개발에 참여할 수도 있는 자유 소프트웨어(free software)입니다.
XE 코어는 모듈, 애드온, 에디터 컴포넌트, 위젯, 레이아웃의 구조를 기반으로 결과물을 생성합니다.
Rhymix는 "시를 짓다, 운을 맞추다"라는 의미의 "rhyme"과
"조합하다, 변주하다"라는 의미의 "remix"를 합친 이름입니다.
라이믹스는 인터넷 공간에서 자유롭게 창작 활동을 하고
다양한 소프트웨어와 콘텐츠를 조합하여 새로운 것을 만들어내는 모든 사용자들을 응원합니다.
이렇게 각각의 기능과 디자인이 구조적으로 연결되는 모듈형 구조는 개발 및 유지보수를 쉽게 하도록 도와주며 관리자는 손쉽게 설정과 디자인을 변경할 수 있습니다.
### 개발 방향
레이아웃, 모듈 스킨 그리고 위젯의 스타일과 스킨을 활용하면 여러분만의 개성을 가진 웹 사이트를 만들 수 있습니다. XE와 함께 더 다채롭고 개성있는 웹사이트를 만들어보세요!
Rhymix는 개발자와 사용자가 서로의 권리와 책임을 존중하는 인터넷 생태계,
중앙집중형 SNS 플랫폼에 의존하지 않고도 누구나 내 목소리를 낼 수 있는 세상,
벤처기업이나 스타트업의 개발자들뿐 아니라 평범한 블로거, 동호회, 학생, 장애인 등도
사이버 공간에 당당하게 집을 짓고 서로 소통할 수 있는 미래를 만들어가길 원합니다.
### 오픈 소스 소프트웨어! 열린 프로젝트! (코드 공헌 가이드)
많은 분들께서 개발, 디자인, 마크업 등의 전문 분야는 물론 다국어 번역, 문제점 보고 등 기능 개선 및 문제 해결을 위해 많은 노력을 해주시고 계십니다.
개발자 위주, 서비스 제공자 위주로 나아가는 현대의 IT 동향을 무차별적으로 받아들이기보다는
사용자의 주권과 열린 인터넷 환경을 보호하는 기술을 집중적으로 발굴하며,
우리나라 인터넷 커뮤니티의 성장을 이끌었던 90년대 제로보드와 2000년대 XE의 정신을 이어받아
2020년대 현재 위기에 처한 오픈 웹을 지키고 회복시키는 일에 앞장서고자 합니다.
참여를 원하시는 분들은 버그 신고/제안 혹은 Pull Request 전에 [CONTRIBUTING.md](./CONTRIBUTING.md) 문서를 먼저 읽어주시기 바랍니다.
XpressEngine은 여러분들의 개발 참여를 기다립니다.
그러기 위해서는 다른 어떤 CMS보다도 일반 사용자를 위한 편리성이 가장 뛰어나야 합니다.
## Server Requirements
* PHP version 5.2.4 or greater (But recommend PHP >= 5.3.11)
* MYSQL version 4.1 or greater (But recommend MYSQL >= 5.x) , MS-SQL, CUBRID
* XML Library
* GD Library
* ICONV
* session.auto_start = Off (php.ini)
- 초보자도 쉽게 클릭 몇 번으로 웹사이트를 완성할 수 있을 만큼 편리한 CMS
- 최신 기술을 적극적으로 사용하고 속도가 빠르며 보안이 우수한 CMS
- 커뮤니티를 통해 사용자와 개발자의 건전한 의사소통을 돕는 CMS
- 애드온, 모듈, 위젯 등 기존 XE 서드파티 자료들과의 호환성을 최대한 보장하려고 노력합니다.
## Maintainers
@akasima @bnu @jhyeon1010 @khongchi @findstar @ngleader
### 설치 환경
## Contributors
http://www.xpressengine.com/contributors
Rhymix를 사용하려면 PHP 7.4 이상, MySQL 또는 MariaDB가 필요합니다.
자세한 설치 환경은 [매뉴얼](https://rhymix.org/manual/introduction/requirements)을 참고하십시오.
## Support
* Official site (Korean) : http://www.xpressengine.com/
### 개발 참여
## License
Copyright 2014 NAVER Corp. <http://www.navercorp.com>
Rhymix는 개발자, 디자이너, 번역가 등의 도움과 일반 사용자들의 버그 신고를 환영합니다.
참여를 원하시는 분은 질서있고 효율적인 프로젝트 운영을 위해
[이슈 및 PR 작성 방법](https://rhymix.org/manual/contrib/github)과
[코딩 규칙](https://rhymix.org/manual/contrib/coding-standards)을 먼저 읽어 주시기 바랍니다.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
보안 취약점을 발견하셨다면 해커들에게 알려지기 전에 먼저 패치를 작성할 수 있도록
devops@rhymix.org로 알려 주시면 감사하겠습니다.
### 공식 홈페이지
- Rhymix : https://rhymix.org
### 커뮤니티
- XETOWN : https://xetown.com
### 저작권 및 라이선스
Rhymix는 [GNU GPL v2](http://korea.gnu.org/documents/copyleft/gpl.ko.html)
또는 그 이후 버전 라이선스의 적용을 받는 자유 소프트웨어(free software)입니다.
자유 소프트웨어는 "오픈소스" 또는 "개방형"이라는 명칭으로도 알려져 있으며,
개발자와 사용자의 자유와 권리, 참여와 책임을 강조하는 프로그램으로
누구나 무료로 사용할 수 있고 개발에 참여할 수도 있습니다.
Rhymix는 [NAVER](https://www.navercorp.com/)가 일부 저작권을 가진
[XpressEngine](https://xe1.xpressengine.com)의 소스코드에 바탕을 두고 있습니다.
Rhymix 개발자들이 추가 및 변경한 부분의 저작권은 해당 개발자들에게 있습니다.
XpressEngine은 초창기에 GPL을 사용하다가 버전 1.4.0부터 LGPL로 전환했지만,
Rhymix는 사용자의 권리를 더욱 보호하고 자유 소프트웨어 본연의 정신에 충실하기 위해 라이선스를 GPL로 되돌렸습니다.
(라이선스 전환은 [LGPL v2.1 제3조](http://korea.gnu.org/documents/copyleft/lgpl.ko.html#term3)에서 허용하고 있습니다.)
GPL은 WordPress, Drupal, Joomla 등 세계적인 CMS들이 공통으로 채택하고 있는 라이선스이므로
사용자 및 개발자의 권리와 의무도 이러한 CMS들의 경우와 동일합니다.
홈페이지에 Rhymix를 사용하는 것만으로 소스코드를 공개할 의무가 발생하지는 않으며,
Rhymix의 소스코드를 수정하거나 확장 기능을 직접 개발하여 사용하더라도 마찬가지입니다.
그러나 직접 개발한 확장 기능을 제3자에게 배포 또는 판매할 경우에는 반드시 소스코드를 제공해야 하며,
이러한 소스코드는 모두 GPL 라이선스의 적용을 받습니다.
# English
Rhymix is a content management system (CMS) for everyone who wants to create independent homepages to express themselves and build their communities easily and freely.
Rhymix is a fork of [XpressEngine](https://xe1.xpressengine.com) version 1.8 and is free software that anyone can use for free and participate.
Rhymix is a combination of "rhyme" in the sense of "making a poem, adjusting the sound", and "remix" in the sense of "combining, changing".
Rhymix cheers everyone who freely creates and/or assembles new things in the Internet space by combining various software and contents.
### Development Direction
Rhymix developers want an Internet ecosystem where developers and users respect each other's rights and responsibilities,
a world where everyone can speak their voice without relying on a centralized SNS platform,
a future where ordinary bloggers, students, the disabled and others as well as developers of startups can build a home in cyberspace and communicate with each other.
Rather than indiscriminately accepting modern IT trends that are centered on developers and service providers,
we focused on technologies that protect users' sovereignty and open Internet environment. Taking the spirit of ZeroBoard and XpressEngine, which led the growth of the Korean Internet communities in the 1990s and 2000s respectively, Rhymix wants to take the lead in recovering and restoring the open web in the crisis of the 2020s.
This requires the most convenience for the average user over any other CMS.
- CMS that is convenient enough to create the website easily, even for beginners, with a few clicks
- CMS that is actively using the latest technology, fast and secure
- CMS to help users and developers communicate well through community
- We try to ensure maximum compatibility with existing XpressEngine third-party materials such as add-ons, modules and widgets.
### Installation Environment
Rhymix requires PHP 7.4 or higher, and MySQL or MariaDB.
Please see the [online manual](https://rhymix.org/manual/introduction/requirements) for more information on server requirements.
### Participation in Development
Rhymix welcomes developers, designers, translators, and bugs to the public.
If you would like to participate, please read [Issue and PR Submission Guide](https://rhymix.org/manual/contrib/github)
and [Coding Standards](https://rhymix.org/manual/contrib/coding-standards) first to ensure efficient and orderly project management.
If you have found a security vulnerability, please let us know at devops@rhymix.org so that we can make a patch before it is exploited.
### Official Website
- Rhymix : https://rhymix.org
### Community
- XETOWN (Korean) : https://xetown.com
### Copyright and License
Rhymix is a free software licensed under the [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) or later.
Free software is a program that emphasizes the rights and responsibilities of developers and users to participate or use in freedom.
Rhymix is based on the source code of [XpressEngine](https://xe1.xpressengine.com) ([Github](https://github.com/xpressengine/xe-core/)), which is free software partly owned by [NAVER](https://www.navercorp.com/).
Rhymix developers have copyrights on the added and modified code.
XpressEngine has been licensed under the GPL in its early days and switched to LGPL from version 1.4.0, but Rhymix has reverted its licenses to the GPL for further protection of the rights and spirit of free software.
(License conversion is allowed in [LGPL v2.1 Section 3](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html).)
The GPL is commonly adopted by global CMSes such as WordPress, Drupal, and Joomla. The rights and obligations of users and developers of Rhymix are the same as those CMSes.
The use of Rhymix on homepage does not impose a duty on you to release the source code, even if you modify the source code or develop the extension yourself.
However, distributing and/or selling the source code or extension according to the GPL license, you have to provide the source code.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

View file

@ -1,17 +0,0 @@
Security Policy
---------------
### Supported Versions
Only the latest version is actively supported.
## Reporting a Vulnerability
Please report possible vulnerabilities by email to devops@rhymix.org.
Please DO NOT use GitHub issues or pull requests for this purpose.
We do not consider it a vulnerability if the superuser (is_admin=Y) account
can insert scripts or delete information. That's what the superuser account is for!
It will, however, be considered a serious vulnerability if someone else can
trick a superuser to perform such actions inadvertently,
for example through a CSRF attack.

View file

@ -10,9 +10,9 @@ if(!defined('__XE__'))
* @brief admin log
*/
$logged_info = Context::get('logged_info');
if ($called_position === 'before_module_proc' && $logged_info->is_admin === 'Y' && stripos(Context::get('act') ?? '', 'admin') !== false)
if($logged_info && $logged_info->is_admin == 'Y' && stripos(Context::get('act'), 'admin') !== false && $called_position == 'before_module_proc')
{
$oAdminloggingController = adminloggingController::getInstance();
$oAdminloggingController = getController('adminlogging');
$oAdminloggingController->insertLog($this->module, $this->act);
}
/* End of file adminlogging.php */

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon version="0.2">
<title xml:lang="ko">어드민 메뉴 접근 로깅</title>
<title xml:lang="en">Logging Access to the Administrator Menu</title>
<title xml:lang="en">admin menu access logging</title>
<title xml:lang="zh-CN">后台访问日志</title>
<title xml:lang="zh-TW">管理選單訪問日誌</title>
<description xml:lang="ko">
@ -13,11 +13,8 @@
<description xml:lang="zh-TW">
管理選單訪問紀錄及登入日誌。
</description>
<description xml:lang="en">
This addon will record Rhymix administrators' access to the menu.
</description>
<version>RX_VERSION</version>
<date>RX_CORE</date>
<version>1.7</version>
<date>2013-11-27</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NAVER</name>

View file

@ -11,6 +11,11 @@ if(!defined('__XE__'))
*/
if($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML")
{
if(Mobile::isFromMobilePhone())
{
Context::addJsFile('./common/js/jquery.min.js', false, '', -1000000);
Context::addJsFile('./common/js/xe.min.js', false, '', -1000000);
}
Context::loadFile(array('./addons/autolink/autolink.js', 'body', '', null), true);
}
/* End of file autolink.addon.php */

View file

@ -4,14 +4,14 @@
* @author NAVER (developers@xpressengine.com)
*/
(function($){
var protocol_re = '(?:(?:https?|ftp|news|telnet|irc|mms)://)';
var domain_re = '(?:[^\\s./)>]+\\.)+[^\\s./)>]+';
var protocol_re = '(https?|ftp|news|telnet|irc|mms)://';
var domain_re = '(?:[\\w\\-]+\\.)+(?:[a-z]+)';
var max_255_re = '(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9]?[0-9])';
var ip_re = '(?:'+max_255_re+'\\.){3}'+max_255_re;
var port_re = '(?::([0-9]+))?';
var user_re = '(?:/~\\w+)?';
var path_re = '(?:/[^\\s]*)?';
var hash_re = '(?:#[^\\s]*)?';
var user_re = '(?:/~[\\w-]+)?';
var path_re = '((?:/[\\w!"$-/:-@]+)*)';
var hash_re = '(?:#([\\w!-@]+))?';
var url_regex = new RegExp('('+protocol_re+'('+domain_re+'|'+ip_re+'|localhost'+')'+port_re+user_re+path_re+hash_re+')', 'ig');
@ -24,7 +24,7 @@
var thisPlugin = this;
// extract target text nodes
this.extractTargets($('.rhymix_content, .xe_content'));
this.extractTargets($('.xe_content'));
$(this.targets).each(function(){
thisPlugin.cast('AUTOLINK', [this]);
@ -37,28 +37,7 @@
var dummy = $('<span>');
content = content.replace(/</g, '&lt;').replace(/>/g, '&gt;');
content = content.replace(url_regex, function(match, p1, offset, string) {
var match;
var suffix = '';
var attribute = '';
if (p1.indexOf('(') < 0 && p1.match(/\)$/)) {
p1 = p1.replace(/\)$/, '');
suffix = ')';
} else if (p1.indexOf('[') < 0 && p1.match(/\]$/)) {
p1 = p1.replace(/\]$/, '');
suffix = ']';
} else if (p1.indexOf('&lt;') < 0 && p1.match(/&gt;$/)) {
p1 = p1.replace(/&gt;$/, '');
suffix = '&gt;';
} else if (match = /^([\x21-\x7E]+\.[a-z]+)([가-힣]{1,3})$/.exec(p1)) {
p1 = match[1];
suffix = match[2];
}
if(!isSameOrigin(location.href, p1)) {
attribute = ' target="_blank"';
}
return '<a href="' + p1 + '"' + attribute + '>' + p1 + '</a>' + suffix;
});
content = content.replace(url_regex, '<a href="$1" target="_blank">$1</a>');
$(textNode).before(dummy);
$(textNode).replaceWith(content);
@ -67,13 +46,15 @@
},
extractTargets : function(obj) {
var thisPlugin = this;
var wrap = $('.rhymix_content, .xe_content', obj);
var wrap = $('.xe_content', obj);
if(wrap.length) {
this.extractTargets(wrap);
return;
}
$(obj).contents().each(function(){
$(obj)
.contents()
.each(function(){
var node_name = this.nodeName.toLowerCase();
if($.inArray(node_name, ['a', 'pre', 'xml', 'textarea', 'input', 'select', 'option', 'code', 'script', 'style', 'iframe', 'button', 'img', 'embed', 'object', 'ins']) != -1) return;
@ -96,16 +77,4 @@
});
xe.registerPlugin(new AutoLink());
$(document).on('click', '.rhymix_content a, .xe_content a', function() {
var $this = $(this);
var href = $this.attr('href');
if(!href || /^(?:javascript|mailto):|#/.test(href)) {
return;
}
if (!$this.attr("target") && !isSameOrigin(location.href, href)) {
$this.attr("target", "_blank");
}
});
})(jQuery);
})(jQuery);

View file

@ -36,8 +36,8 @@
<description xml:lang="zh-TW">
是種可將文章及回覆內容中的 URL 網址字串自動轉換成連結的附加元件。
</description>
<version>RX_VERSION</version>
<date>RX_CORE</date>
<version>1.7</version>
<date>2013-11-27</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NAVER</name>

View file

@ -0,0 +1,544 @@
<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
if(!defined('__XE__'))
exit();
/**
* @file blogapicounter.addon.php
* @author NAVER (developers@xpressengine.com)
* @brief Add blogAPI
*
* It enables to write a post by using an external tool such as ms live writer, firefox performancing, zoundry and so on.
* It should be called before executing the module(before_module_proc). If not, it is forced to shut down.
* */
// Insert a rsd tag when called_position is after_module_proc
if($called_position == 'after_module_proc')
{
// Create rsd address of the current module
$site_module_info = Context::get('site_module_info');
$rsd_url = getFullSiteUrl($site_module_info->domain, '', 'mid', $this->module_info->mid, 'act', 'api');
// Insert rsd tag into the header
Context::addHtmlHeader(" " . '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="' . $rsd_url . '" />');
}
// If act isnot api, just return
if($_REQUEST['act'] != 'api')
{
return;
}
// Read func file
require_once(_XE_PATH_ . 'addons/blogapi/blogapi.func.php');
$xml = $GLOBALS['HTTP_RAW_POST_DATA'];
// If HTTP_RAW_POST_DATA is NULL, Print error message
if(!$xml)
{
$content = getXmlRpcFailure(1, 'Invalid Method Call');
printContent($content);
}
// xmlprc parsing
// Parse the requested xmlrpc
if(Security::detectingXEE($xml))
{
header("HTTP/1.0 400 Bad Request");
exit;
}
if(version_compare(PHP_VERSION, '5.2.11', '<=')) libxml_disable_entity_loader(true);
$xml = new SimpleXMLElement($xml, LIBXML_NONET | LIBXML_NOENT);
$method_name = (string)$xml->methodName;
$params = $xml->params->param;
// Compatible with some of methodname
if(in_array($method_name, array('metaWeblog.deletePost', 'metaWeblog.getUsersBlogs', 'metaWeblog.getUserInfo')))
{
$method_name = str_replace('metaWeblog.', 'blogger.', $method_name);
}
// Get user_id, password and attempt log-in
$user_id = trim((string)$params[1]->value->string);
$password = trim((string)$params[2]->value->string);
// Before executing the module, authentication is processed.
if($called_position == 'before_module_init')
{
// Attempt log-in by using member controller
if($user_id && $password)
{
$oMemberController = getController('member');
$output = $oMemberController->doLogin($user_id, $password);
// If login fails, an error message appears
if(!$output->toBool())
{
$content = getXmlRpcFailure(1, $output->getMessage());
printContent($content);
}
}
else
{
$content = getXmlRpcFailure(1, 'not logged');
printContent($content);
}
}
// Before module processing, handle requests from blogapi tool and then terminate.
if($called_position == 'before_module_proc')
{
// Check writing permission
if(!$this->grant->write_document)
{
printContent(getXmlRpcFailure(1, 'no permission'));
}
// Get information of the categories
$oDocumentModel = getModel('document');
$category_list = $oDocumentModel->getCategoryList($this->module_srl);
// Specifies a temporary file storage
$tmp_uploaded_path = sprintf(_XE_PATH_ . 'files/cache/blogapi/%s/%s/', $this->mid, $user_id);
$uploaded_target_path = sprintf(_XE_PATH_ . 'files/cache/blogapi/%s/%s/', $this->mid, $user_id);
switch($method_name)
{
// Blog information
case 'blogger.getUsersBlogs' :
$obj = new stdClass();
$obj->url = getFullSiteUrl('');
$obj->blogid = $this->mid;
$obj->blogName = $this->module_info->browser_title;
$blog_list = array($obj);
$content = getXmlRpcResponse($blog_list);
printContent($content);
break;
// Return a list of categories
case 'metaWeblog.getCategories' :
$category_obj_list = array();
if($category_list)
{
foreach($category_list as $category_srl => $category_info)
{
$obj = new stdClass();
$obj->description = $category_info->title;
//$obj->htmlUrl = Context::getRequestUri().$this->mid.'/1';
//$obj->rssUrl= Context::getRequestUri().'rss/'.$this->mid.'/1';
$obj->title = $category_info->title;
$obj->categoryid = $category_srl;
$category_obj_list[] = $obj;
}
}
$content = getXmlRpcResponse($category_obj_list);
printContent($content);
break;
// Upload file
case 'metaWeblog.newMediaObject' :
// Check a file upload permission
$oFileModel = getModel('file');
$file_module_config = $oFileModel->getFileModuleConfig($this->module_srl);
if(is_array($file_module_config->download_grant) && count($file_module_config->download_grant) > 0)
{
$logged_info = Context::get('logged_info');
if($logged_info->is_admin != 'Y')
{
$is_permitted = false;
for($i = 0; $i < count($file_module_config->download_grant); $i++)
{
$group_srl = $file_module_config->download_grant[$i];
if($logged_info->group_list[$group_srl])
{
$is_permitted = true;
break;
}
}
if(!$is_permitted){
printContent(getXmlRpcFailure(1, 'no permission'));
}
}
}
$fileinfo = $params[3]->value->struct->member;
foreach($fileinfo as $key => $val)
{
$nodename = (string)$val->name;
if($nodename == 'bits')
$filedata = base64_decode((string)$val->value->base64);
elseif($nodename == 'name')
$filename = (string)$val->value->string;
}
$tmp_arr = explode('/', $filename);
$filename = array_pop($tmp_arr);
FileHandler::makeDir($tmp_uploaded_path);
$target_filename = sprintf('%s%s', $tmp_uploaded_path, $filename);
FileHandler::writeFile($target_filename, $filedata);
$obj = new stdClass();
$obj->url = Context::getRequestUri() . $target_filename;
$content = getXmlRpcResponse($obj);
printContent($content);
break;
// Get posts
case 'metaWeblog.getPost' :
$document_srl = (string)$params[0]->value->string;
if(!$document_srl)
{
printContent(getXmlRpcFailure(1, 'no permission'));
}
else
{
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
if(!$oDocument->isExists() || !$oDocument->isGranted())
{
printContent(getXmlRpcFailure(1, 'no permission'));
}
else
{
// Get a list of categories and set Context
$category = "";
if($oDocument->get('category_srl'))
{
$oDocumentModel = getModel('document');
$category_list = $oDocumentModel->getCategoryList($oDocument->get('module_srl'));
if($category_list[$oDocument->get('category_srl')])
{
$category = $category_list[$oDocument->get('category_srl')]->title;
}
}
$content = sprintf(
'<?xml version="1.0" encoding="utf-8"?>' .
'<methodResponse>' .
'<params>' .
'<param>' .
'<value>' .
'<struct>' .
'<member><name>categories</name><value><array><data><value><![CDATA[%s]]></value></data></array></value></member>' .
'<member><name>dateCreated</name><value><dateTime.iso8601>%s</dateTime.iso8601></value></member>' .
'<member><name>description</name><value><![CDATA[%s]]></value></member>' .
'<member><name>link</name><value>%s</value></member>' .
'<member><name>postid</name><value><string>%s</string></value></member>' .
'<member><name>title</name><value><![CDATA[%s]]></value></member>' .
'<member><name>publish</name><value><boolean>1</boolean></value></member>' .
'</struct>' .
'</value>' .
'</param>' .
'</params>' .
'</methodResponse>',
$category,
date("Ymd", $oDocument->getRegdateTime()) . 'T' . date("H:i:s", $oDocument->getRegdateTime()),
$oDocument->getContent(false, false, true, false),
getFullUrl('', 'document_srl', $oDocument->document_srl),
$oDocument->document_srl,
$oDocument->getTitleText()
);
printContent($content);
}
}
break;
// Write a new post
case 'metaWeblog.newPost' :
$obj = new stdClass();
$info = $params[3];
// Get information of post, title, and category
foreach($info->value->struct->member as $val)
{
switch((string)$val->name)
{
case 'title' :
$obj->title = (string)$val->value->string;
break;
case 'description' :
$obj->content = (string)$val->value->string;
break;
case 'categories' :
$categories = $val->value->array->data->value;
$category = (string)$categories[0]->string;
if($category && $category_list)
{
foreach($category_list as $category_srl => $category_info)
{
if($category_info->title == $category)
$obj->category_srl = $category_srl;
}
}
break;
case 'tagwords' :
$tags = $val->value->array->data->value;
foreach($tags as $tag)
{
$tag_list[] = (string)$tag->string;
}
if(count($tag_list))
$obj->tags = implode(',', $tag_list);
break;
}
}
// Set document srl
$document_srl = getNextSequence();
$obj->document_srl = $document_srl;
$obj->module_srl = $this->module_srl;
// Attachment
if(is_dir($tmp_uploaded_path))
{
$file_list = FileHandler::readDir($tmp_uploaded_path);
$file_count = count($file_list);
if($file_count)
{
$oFileController = getController('file');
for($i = 0; $i < $file_count; $i++)
{
$file_info['tmp_name'] = sprintf('%s%s', $tmp_uploaded_path, $file_list[$i]);
$file_info['name'] = $file_list[$i];
$fileOutput = $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true);
$uploaded_filename = $fileOutput->get('uploaded_filename');
$source_filename = $fileOutput->get('source_filename');
$obj->content = str_replace($uploaded_target_path . $source_filename, sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl, 3), $uploaded_filename), $obj->content);
}
$obj->uploaded_count = $file_count;
}
}
$oDocumentController = getController('document');
$obj->commentStatus = 'ALLOW';
$obj->allow_trackback = 'Y';
$logged_info = Context::get('logged_info');
$obj->member_srl = $logged_info->member_srl;
$obj->user_id = $logged_info->user_id;
$obj->user_name = $logged_info->user_name;
$obj->nick_name = $logged_info->nick_name;
$obj->email_address = $logged_info->email_address;
$obj->homepage = $logged_info->homepage;
$output = $oDocumentController->insertDocument($obj, TRUE);
if(!$output->toBool())
{
$content = getXmlRpcFailure(1, $output->getMessage());
}
else
{
$content = getXmlRpcResponse(strval($document_srl));
}
FileHandler::removeDir($tmp_uploaded_path);
printContent($content);
break;
// Edit post
case 'metaWeblog.editPost' :
$tmp_val = (string)$params[0]->value->string;
if(!$tmp_val)
$tmp_val = (string)$params[0]->value->i4;
if(!$tmp_val)
{
$content = getXmlRpcFailure(1, 'no permission');
break;
}
$tmp_arr = explode('/', $tmp_val);
$document_srl = array_pop($tmp_arr);
if(!$document_srl)
{
$content = getXmlRpcFailure(1, 'no permission');
break;
}
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
// Check if a permission to modify a document is granted
if(!$oDocument->isGranted())
{
$content = getXmlRpcFailure(1, 'no permission');
break;
}
$obj = $oDocument->getObjectVars();
$info = $params[3];
// Get information of post, title, and category
foreach($info->value->struct->member as $val)
{
switch((string)$val->name)
{
case 'title' :
$obj->title = (string)$val->value->string;
break;
case 'description' :
$obj->content = (string)$val->value->string;
break;
case 'categories' :
$categories = $val->value->array->data->value;
$category = (string)$categories[0]->string;
if($category && $category_list)
{
foreach($category_list as $category_srl => $category_info)
{
if($category_info->title == $category)
$obj->category_srl = $category_srl;
}
}
break;
case 'tagwords' :
$tags = $val->value->array->data->value;
foreach($tags as $tag)
{
$tag_list[] = (string)$tag->string;
}
if(count($tag_list))
$obj->tags = implode(',', $tag_list);
break;
}
}
// Document srl
$obj->document_srl = $document_srl;
$obj->module_srl = $this->module_srl;
// Attachment
if(is_dir($tmp_uploaded_path))
{
$file_list = FileHandler::readDir($tmp_uploaded_path);
$file_count = count($file_list);
if($file_count)
{
$oFileController = getController('file');
for($i = 0; $i < $file_count; $i++)
{
$file_info['tmp_name'] = sprintf('%s%s', $tmp_uploaded_path, $file_list[$i]);
$file_info['name'] = $file_list[$i];
$moved_filename = sprintf('./files/attach/images/%s/%s/%s', $this->module_srl, $document_srl, $file_info['name']);
if(file_exists($moved_filename))
continue;
$fileOutput = $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true);
$uploaded_filename = $fileOutput->get('uploaded_filename');
$source_filename = $fileOutput->get('source_filename');
$obj->content = str_replace($uploaded_target_path . $source_filename, sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl, 3), $uploaded_filename), $obj->content);
}
$obj->uploaded_count += $file_count;
}
}
$oDocumentController = getController('document');
$output = $oDocumentController->updateDocument($oDocument, $obj, TRUE);
if(!$output->toBool())
{
$content = getXmlRpcFailure(1, $output->getMessage());
}
else
{
$content = getXmlRpcResponse(true);
FileHandler::removeDir($tmp_uploaded_path);
}
printContent($content);
break;
// Delete the post
case 'blogger.deletePost' :
$tmp_val = (string)$params[1]->value->string;
$tmp_arr = explode('/', $tmp_val);
$document_srl = array_pop($tmp_arr);
// Get a document
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
// If the document exists
if(!$oDocument->isExists())
{
$content = getXmlRpcFailure(1, 'not exists');
// Check if a permission to delete a document is granted
}
elseif(!$oDocument->isGranted())
{
$content = getXmlRpcFailure(1, 'no permission');
break;
// Delete
}
else
{
$oDocumentController = getController('document');
$output = $oDocumentController->deleteDocument($document_srl);
if(!$output->toBool())
$content = getXmlRpcFailure(1, $output->getMessage());
else
$content = getXmlRpcResponse(true);
}
printContent($content);
break;
// Get recent posts
case 'metaWeblog.getRecentPosts' :
// Options to get a list
$args = new stdClass();
$args->module_srl = $this->module_srl; // /< module_srl of the current module
$args->page = 1;
$args->list_count = 20;
$args->sort_index = 'list_order'; // /< Sorting values
$logged_info = Context::get('logged_info');
$args->search_target = 'member_srl';
$args->search_keyword = $logged_info->member_srl;
$output = $oDocumentModel->getDocumentList($args);
if(!$output->toBool() || !$output->data)
{
$content = getXmlRpcFailure(1, 'post not founded');
}
else
{
$oEditorController = getController('editor');
$posts = array();
foreach($output->data as $key => $oDocument)
{
$post = new stdClass();
$post->categories = array();
$post->dateCreated = date("Ymd", $oDocument->getRegdateTime()) . 'T' . date("H:i:s", $oDocument->getRegdateTime());
$post->description = sprintf('<![CDATA[%s]]>',$oEditorController->transComponent($oDocument->getContent(false, false, true, false)));
$post->link = $post->permaLink = getFullUrl('', 'document_srl', $oDocument->document_srl);
$post->postid = $oDocument->document_srl;
$post->title = htmlspecialchars($oDocument->get('title'), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
$post->publish = 1;
$post->userid = $oDocument->get('user_id');
$post->mt_allow_pings = 0;
$post->mt_allow_comments = $oDocument->allowComment() ? 1 : 0;
$posts[] = $post;
}
$content = getXmlRpcResponse($posts);
printContent($content);
}
break;
// Display RSD if there is no request
default :
$homepagelink = getUrl('', 'mid', $this->mid);
$site_module_info = Context::get('site_module_info');
$api_url = getFullSiteUrl($site_module_info->domain, '', 'mid', $site_module_info->mid, 'act', 'api');
$content = <<<RSDContent
<?xml version="1.0" ?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd" >
<service>
<engineName>XpressEngine</engineName>
<engineLink>http://www.xpressengine.com/ </engineLink>
<homePageLink>{$homepagelink}</homePageLink>
<apis>
<api name="MetaWeblog" preferred="true" apiLink="{$api_url}" blogID="" />
</apis>
</service>
</rsd>
RSDContent;
printContent($content);
break;
}
}
/* End of file blogapi.addon.php */
/* Location: ./addons/blogapi/blogapi.addon.php */

View file

@ -0,0 +1,101 @@
<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
if(!defined('__XE__'))
exit();
/**
* @file ./addons/blogapi/blogapi.func.php
* @author NAVER (developers@xpressengine.com)
* @brief Function collections for the implementation of blogapi
* */
// Error messages
function getXmlRpcFailure($error, $message)
{
return
sprintf(
"<methodResponse>\n<fault><value><struct>\n<member>\n<name>faultCode</name>\n<value><int>%d</int></value>\n</member>\n<member>\n<name>faultString</name>\n<value><string>%s</string></value>\n</member>\n</struct></value></fault>\n</methodResponse>\n", $error, htmlspecialchars($message, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)
);
}
// Display results
function getXmlRpcResponse($params)
{
$buff = '<?xml version="1.0" encoding="utf-8"?>' . "\n<methodResponse><params>";
$buff .= _getEncodedVal($params);
$buff .= "</params>\n</methodResponse>\n";
return $buff;
}
// Encoding
function _getEncodedVal($val, $is_sub_set = false)
{
if(preg_match('/^\<\!\[CDATA\[/',$val))
{
$buff = sprintf("<value>%s</value>", $val);
}
elseif(is_int($val))
{
$buff = sprintf("<value><i4>%d</i4></value>", $val);
}
elseif(is_string($val) && preg_match('/^([0-9]+)T([0-9\:]+)$/', $val))
{
$buff = sprintf("<value><dateTime.iso8601>%s</dateTime.iso8601></value>\n", $val);
}
elseif(is_double($val))
{
$buff = sprintf("<value><double>%f</double></value>", $val);
}
elseif(is_bool($val))
{
$buff = sprintf("<value><boolean>%d</boolean></value>", $val ? 1 : 0);
}
elseif(is_object($val))
{
$values = get_object_vars($val);
$val_count = count($values);
$buff = "<value><struct>";
foreach($values as $k => $v)
{
$buff .= sprintf("<member>\n<name>%s</name>\n%s</member>\n", htmlspecialchars($k, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), _getEncodedVal($v, true));
}
$buff .= "</struct></value>\n";
}
elseif(is_array($val))
{
$val_count = count($val);
$buff = "<value><array>\n<data>";
for($i = 0; $i < $val_count; $i++)
{
$buff .= _getEncodedVal($val[$i], true);
}
$buff .= "</data>\n</array></value>";
}
else
{
$buff = sprintf("<value><string>%s</string></value>\n", $val);
}
if(!$is_sub_set)
{
return sprintf("<param>\n%s</param>", $buff);
}
return $buff;
}
// Display the result
function printContent($content)
{
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
print $content;
Context::close();
exit();
}
/* End of file blogapi.func.php */
/* Location: ./addons/blogapi/blogapi.func.php */

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon version="0.2">
<title xml:lang="ko">BlogAPI 애드온</title>
<title xml:lang="jp">BlogAPIアドオン</title>
<title xml:lang="zh-CN">BlogAPI</title>
<title xml:lang="en">Addon for BlogAPI</title>
<title xml:lang="vi">BlogAPI Addon</title>
<title xml:lang="ge">Addon für BlogAPI</title>
<title xml:lang="es">Addon para BlogAPI</title>
<title xml:lang="ru">Аддон для BlogAPI</title>
<title xml:lang="zh-TW">部落格 API</title>
<description xml:lang="ko">
metaWeblog를 지원하는 blogApi애드온입니다.
사용으로 설정하면 각 모듈마다 RSD 태그를 노출합니다.
api의 주소는 http://설치주소/모듈명/api 입니다.
사용으로 해야 RSD태그 및 api가 동작을 합니다.
</description>
<description xml:lang="jp">
MetaWeblogをサポートするBlog APIアドオンです。
「使用する」にチェックすると各モジュールごとにRSDのアドレスを表示します。
APIのアドレスは「http://インストールURL/モジュール名/api」です。
「使用する」に設定してから、RSDタグ、およびAPIが作動します。
</description>
<description xml:lang="zh-CN">
支持metaWeblog的 blogApi插件。
设置为"启用"时,会使每个模块都会显示RSD标签。
api地址为http://安装地址/模块名/api。
把状态设置为"使用"时才会激活RSD标签及api。
</description>
<description xml:lang="en">
This blogAPI addon supports metaWeblog.
By using this option, it lets the RSD tag to be exposed to each module.
URL to the API is http://setup_path/module_name/api.
RSD tag and the api will work only if you use this addon.
</description>
<description xml:lang="vi">
Addon BlogAPI này hỗ trợ metaWeblog..
Bằng việc sử dụng tùy chọn này, Tag RSD sẽ được hiển thị đến mỗi Module.
URL cho API có dạng http://setup_path/module_name/api.
RSD Tag và API chỉ làm việc khi Addon này được kích hoạt.
</description>
<description xml:lang="ge">
Diese blogApi addon metaWeblog unterstützt.
Durch die Verwendung dieser Option, die es ermöglicht RSD Tag ausgesetzt werden jedes Modul.
URL der api ist http://setup_path/module_name/api.
RSD-Tag und dem API arbeiten und nur dann, wenn Sie über dieses Addon.
</description>
<description xml:lang="es">
Este blogApi addon soporta el metaWeblog.
Si seleccionas la optión usar, cada módulo entregará la etiqueta RSD.
La dirección de api es http://dirección de la instalación/nombre de módulo/api.
Sólo si seleccionas la opción usar, funcionará la etiqueta RSD y api.
</description>
<description xml:lang="ru">
Этот blogApi аддон поддерживает metaWeblog.
Используя этот аддон, RSD тег становится доступным для каждого модуля.
URL для api - http://setup_path/module_name/api.
тег RSD и api работают только при включенном аддоне.
</description>
<description xml:lang="zh-TW">
支援 MetaWeblog 的部落格 API 附加元件。
設置成"啟用"時,會使每個模組都顯示 RSD 圖示。
API網址是 http://安裝位置/模組名稱/api。
將狀態設置成"啟用"時,才可使用 RSD 和 API
</description>
<version>1.7</version>
<date>2013-11-27</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NAVER</name>
<name xml:lang="vi">NAVER</name>
<name xml:lang="jp">NAVER</name>
<name xml:lang="zh-CN">NAVER</name>
<name xml:lang="en">NAVER</name>
<name xml:lang="ge">NAVER</name>
<name xml:lang="es">NAVER</name>
<name xml:lang="ru">NAVER</name>
<name xml:lang="zh-TW">NAVER</name>
</author>
</addon>

BIN
addons/captcha/audio/F_A.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_B.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_C.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_D.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_E.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_F.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_G.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_H.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_I.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_J.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_K.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_L.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_M.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_N.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_O.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_P.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_Q.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_R.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_S.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_T.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_U.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_V.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_W.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_X.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_Y.mp3 Executable file

Binary file not shown.

View file

@ -0,0 +1,404 @@
<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
if(!defined("__XE__")) exit();
/**
* @file captcha.addon.php
* @author NAVER (developers@xpressengine.com)
* @brief Captcha for a particular action
* English alphabets and voice verification added
* */
if(!class_exists('AddonCaptcha', false))
{
// On the mobile mode, XE Core does not load jquery and xe.js as normal.
if(Mobile::isFromMobilePhone())
{
Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true);
Context::loadFile(array('./common/js/xe.min.js', 'head', NULL, -100000), true);
}
class AddonCaptcha
{
var $addon_info;
var $target_acts = NULL;
function setInfo(&$addon_info)
{
$this->addon_info = $addon_info;
}
function before_module_proc()
{
if($this->addon_info->act_type == 'everytime' && $_SESSION['captcha_authed'])
{
unset($_SESSION['captcha_authed']);
}
}
function before_module_init(&$ModuleHandler)
{
$logged_info = Context::get('logged_info');
if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)
{
return false;
}
if($this->addon_info->target != 'all' && Context::get('is_logged'))
{
return false;
}
if($_SESSION['XE_VALIDATOR_ERROR'] == -1)
{
$_SESSION['captcha_authed'] = false;
}
if($_SESSION['captcha_authed'])
{
return false;
}
$type = Context::get('captchaType');
$this->target_acts = array('procBoardInsertDocument', 'procBoardInsertComment', 'procIssuetrackerInsertIssue', 'procIssuetrackerInsertHistory', 'procTextyleInsertComment');
if(Context::getRequestMethod() != 'XMLRPC' && Context::getRequestMethod() !== 'JSON')
{
if($type == 'inline')
{
if(!$this->compareCaptcha())
{
Context::loadLang(_XE_PATH_ . 'addons/captcha/lang');
$_SESSION['XE_VALIDATOR_ERROR'] = -1;
$_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied');
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
$_SESSION['XE_VALIDATOR_RETURN_URL'] = Context::get('error_return_url');
$ModuleHandler->_setInputValueToSession();
}
}
else
{
Context::addHtmlHeader('<script>
if(!captchaTargetAct) {var captchaTargetAct = [];}
captchaTargetAct.push("' . implode('","', $this->target_acts) . '");
</script>');
Context::loadFile(array('./addons/captcha/captcha.min.js', 'body', '', null), true);
}
}
// compare session when calling actions such as writing a post or a comment on the board/issue tracker module
if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $this->target_acts))
{
Context::loadLang(_XE_PATH_ . 'addons/captcha/lang');
$ModuleHandler->error = "captcha_denied";
}
return true;
}
function createKeyword()
{
$type = Context::get('captchaType');
if($type == 'inline' && $_SESSION['captcha_keyword'])
{
return;
}
$arr = range('A', 'Y');
shuffle($arr);
$arr = array_slice($arr, 0, 6);
$_SESSION['captcha_keyword'] = join('', $arr);
}
function before_module_init_setCaptchaSession()
{
if($_SESSION['captcha_authed'])
{
return false;
}
// Load language files
Context::loadLang(_XE_PATH_ . 'addons/captcha/lang');
// Generate keywords
$this->createKeyword();
$target = Context::getLang('target_captcha');
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
printf("<response>\r\n <error>0</error>\r\n <message>success</message>\r\n <about_captcha><![CDATA[%s]]></about_captcha>\r\n <captcha_reload><![CDATA[%s]]></captcha_reload>\r\n <captcha_play><![CDATA[%s]]></captcha_play>\r\n <cmd_input><![CDATA[%s]]></cmd_input>\r\n <cmd_cancel><![CDATA[%s]]></cmd_cancel>\r\n </response>"
, Context::getLang('about_captcha')
, Context::getLang('captcha_reload')
, Context::getLang('captcha_play')
, Context::getLang('cmd_input')
, Context::getLang('cmd_cancel')
);
Context::close();
exit();
}
function before_module_init_captchaImage()
{
if($_SESSION['captcha_authed'])
{
return false;
}
if(Context::get('renew'))
{
$this->createKeyword();
}
$keyword = $_SESSION['captcha_keyword'];
$im = $this->createCaptchaImage($keyword);
header("Cache-Control: ");
header("Pragma: ");
header("Content-Type: image/png");
imagepng($im);
imagedestroy($im);
Context::close();
exit();
}
function createCaptchaImage($string)
{
$arr = array();
for($i = 0, $c = strlen($string); $i < $c; $i++)
{
$arr[] = $string{$i};
}
// Font site
$w = 18;
$h = 25;
// Character length
$c = count($arr);
// Character image
$im = array();
// Create an image by total size
$im[] = imagecreate(($w + 2) * count($arr), $h);
$deg = range(-30, 30);
shuffle($deg);
// Create an image for each letter
foreach($arr as $i => $str)
{
$im[$i + 1] = @imagecreate($w, $h);
$background_color = imagecolorallocate($im[$i + 1], 255, 255, 255);
$text_color = imagecolorallocate($im[$i + 1], 0, 0, 0);
// Control font size
$ran = range(1, 20);
shuffle($ran);
if(function_exists('imagerotate'))
{
imagestring($im[$i + 1], (array_pop($ran) % 3) + 3, 2, (array_pop($ran) % 8), $str, $text_color);
$im[$i + 1] = imagerotate($im[$i + 1], array_pop($deg), 0);
$background_color = imagecolorallocate($im[$i + 1], 255, 255, 255);
imagecolortransparent($im[$i + 1], $background_color);
}
else
{
imagestring($im[$i + 1], (array_pop($ran) % 3) + 3, 2, (array_pop($ran) % 4), $str, $text_color);
}
}
// Combine images of each character
for($i = 1, $c = count($im); $i<$c; $i++)
{
imagecopy($im[0], $im[$i], (($w + 2) * ($i - 1)), 0, 0, 0, $w, $h);
imagedestroy($im[$i]);
}
// Larger image
$big_count = 2;
$big = imagecreatetruecolor(($w + 2) * $big_count * $c, $h * $big_count);
imagecopyresized($big, $im[0], 0, 0, 0, 0, ($w + 2) * $big_count * $c, $h * $big_count, ($w + 2) * $c, $h);
imagedestroy($im[0]);
if(function_exists('imageantialias'))
{
imageantialias($big, true);
}
// Background line
$line_color = imagecolorallocate($big, 0, 0, 0);
$w = ($w + 2) * $big_count * $c;
$h = $h * $big_count;
$d = array_pop($deg);
for($i = -abs($d); $i < $h + abs($d); $i = $i + 7)
{
imageline($big, 0, $i + $d, $w, $i, $line_color);
}
$x = range(0, ($w - 10));
shuffle($x);
for($i = 0; $i < 200; $i++)
{
imagesetpixel($big, $x[$i] % $w, $x[$i + 1] % $h, $line_color);
}
return $big;
}
function before_module_init_captchaAudio()
{
if($_SESSION['captcha_authed'])
{
return false;
}
$keyword = strtoupper($_SESSION['captcha_keyword']);
$data = $this->createCaptchaAudio($keyword);
header('Content-type: audio/mpeg');
header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\"");
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Expires: Sun, 1 Jan 2000 12:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Content-Length: ' . strlen($data));
echo $data;
Context::close();
exit();
}
function createCaptchaAudio($string)
{
$data = '';
$_audio = './addons/captcha/audio/F_%s.mp3';
for($i = 0, $c = strlen($string); $i < $c; $i++)
{
$_data = FileHandler::readFile(sprintf($_audio, $string{$i}));
$start = rand(5, 68); // Random start in 4-byte header and 64 byte data
$datalen = strlen($_data) - $start - 256; // Last unchanged 256 bytes
for($j = $start; $j < $datalen; $j+=64)
{
$ch = ord($_data{$j});
if($ch < 9 || $ch > 119)
{
continue;
}
$_data{$j} = chr($ch + rand(-8, 8));
}
$data .= $_data;
}
return $data;
}
function compareCaptcha()
{
if(!in_array(Context::get('act'), $this->target_acts)) return true;
if($_SESSION['captcha_authed'])
{
return true;
}
if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text')))
{
$_SESSION['captcha_authed'] = true;
return true;
}
unset($_SESSION['captcha_authed']);
return false;
}
function before_module_init_captchaCompare()
{
if(!$this->compareCaptcha())
{
return false;
}
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
print("<response>\r\n<error>0</error>\r\n<message>success</message>\r\n</response>");
Context::close();
exit();
}
function inlineDisplay()
{
unset($_SESSION['captcha_authed']);
$this->createKeyword();
$swfURL = getUrl() . 'addons/captcha/swf/play.swf';
Context::unloadFile('./addons/captcha/captcha.min.js');
Context::loadFile(array('./addons/captcha/inline_captcha.js', 'body'));
global $lang;
$tags = <<<EOD
<img src="%s" id="captcha_image" alt="CAPTCHA" width="240" height="50" style="width:240px; height:50px; border:1px solid #b0b0b0" />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="captcha_audio" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="quality" value="high" />
<param name="movie" value="%s" />
<param name="wmode" value="window" />
<param name="allowFullScreen" value="false">
<param name="bgcolor" value="#fffff" />
<embed src="%s" quality="high" wmode="window" allowFullScreen="false" bgcolor="#ffffff" width="0" height="0" name="captcha_audio" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<button type="button" class="captchaReload text">%s</button>
<button type="button" class="captchaPlay text">%s</button><br />
<input type="hidden" name="captchaType" value="inline" />
<input name="secret_text" type="text" id="secret_text" />
EOD;
$tags = sprintf($tags, getUrl('captcha_action', 'captchaImage', 'rand', mt_rand(10000, 99999))
, $swfURL
, $swfURL
, $lang->reload
, $lang->play);
return $tags;
}
}
$GLOBALS['__AddonCaptcha__'] = new AddonCaptcha;
$GLOBALS['__AddonCaptcha__']->setInfo($addon_info);
Context::set('oCaptcha', $GLOBALS['__AddonCaptcha__']);
}
$oAddonCaptcha = &$GLOBALS['__AddonCaptcha__'];
if(method_exists($oAddonCaptcha, $called_position))
{
if(!call_user_func_array(array(&$oAddonCaptcha, $called_position), array(&$this)))
{
return false;
}
}
$addon_act = Context::get('captcha_action');
if($addon_act && method_exists($oAddonCaptcha, $called_position . '_' . $addon_act))
{
if(!call_user_func_array(array(&$oAddonCaptcha, $called_position . '_' . $addon_act), array(&$this)))
{
return false;
}
}
/* End of file captcha.addon.php */
/* Location: ./addons/captcha/captcha.addon.php */

180
addons/captcha/captcha.js Normal file
View file

@ -0,0 +1,180 @@
/* procFilter 함수를 가로채서 captcha 이미지 및 폼을 출력 */
var calledArgs = null;
(function($){
$(function() {
var captchaXE = null;
function xeCaptcha() {
$('form').each(function(i)
{
var isSubmitHook = false;
if (!$(this).attr('onsubmit') || $(this).attr('onsubmit').indexOf('procFilter') < 0)
{
var act = $(this).find('input[name=act]').val()
for(var i = 0; i<captchaTargetAct.length; i++)
{
if(captchaTargetAct[i] == act)
{
isSubmitHook = true;
break;
}
}
}
if (isSubmitHook)
{
$(this).append('<input type="hidden" name="captchaType" value="inline" />');
if(!$(this).find('input[name=error_return_url]'))
$(this).append('<input type="hidden" name="error_return_url" value="'+current_url+'" />');
$(this).submit(function(event){
if ($(this).find('input[name=secret_text]').val())
{
return true;
}
event.preventDefault();
var self = this;
$('#captcha_layer form')
.submit(function(e){
e.preventDefault();
if(!$('#secret_text').val()){
$(this).find('input[type=text]').val('').focus();
return false;
}
$(self).append('<input type="hidden" name="secret_text" value="'+ $('#secret_text').val() +'" />');
$(self).submit();
});
var params = new Array();
params['captcha_action'] = 'setCaptchaSession';
params['mid'] = current_mid;
window.oldExecXml('', '', params, captchaXE.show,new Array('error','message','about_captcha','captcha_reload','captcha_play','cmd_input','cmd_cancel'));
});
}
});
var body = $(document.body);
var captchaIma;
if (!captchaXE) {
var fc_isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var fc_isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var fc_isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var _swfURL_ = request_uri + 'addons/captcha/swf/play.swf';
if(fc_isIE && fc_isWin && !fc_isOpera){
_object_ ='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="captcha_audio" align="middle">';
_object_ += '<param name="allowScriptAccess" value="always" />';
_object_ += '<param name="quality" value="high" />';
_object_ += '<param name="movie" value="'+_swfURL_+'" />';
_object_ += '<param name="wmode" value="window" />';
_object_ += '<param name="allowFullScreen" value="false">';
_object_ += '<param name="bgcolor" value="#fffff" />';
_object_ += '</object>';
}else{
_object_ = '<embed src="'+_swfURL_+'" quality="high" wmode="window" allowFullScreen="false" bgcolor="#ffffff" width="0" height="0" name="captcha_audio" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
}
captchaXE = $('<div id="captcha_layer" style="position:fixed; top:0; left:0; width:100%; height:100%;display:none;z-index:10">').appendTo(document.body);
var top_left = 'margin:-105px 0 0 -105px; top:50%; left:50%;';
if(screen.width<480) { top_left = ''; }
var $div = $('<div style="z-index:1000;position:absolute; width:310px;' + top_left + ' background:#fff; border:3px solid #ccc;">'+
'<form method="post" action="">'+
'<div style="position:relative; margin:25px 20px 15px 20px">'+
'<img src="about:blank" id="captcha_image" alt="CAPTCHA" width="240" height="50" style="display:block; width:240px; height:50px; border:1px solid #b0b0b0" />'+
'<button type="button" class="reload" title="" style="position:absolute; top:0; left:245px; width:25px; height:25px; padding:0; overflow:visible; border:1px solid #575757; background:#747474 url('+request_uri + 'addons/captcha/img/icon.gif) no-repeat center 5px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #444 inset;-moz-box-shadow:0 0 3px #444 inset;-webkit-box-shadow:0 0 3px #444 inset;"></button>'+
'<button type="button" class="play" title="" style="position:absolute; top:27px; left:245px; width:25px; height:25px; padding:0; overflow:visible; border:1px solid #575757; background:#747474 url('+request_uri + 'addons/captcha/img/icon.gif) no-repeat center -20px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #444 inset;-moz-box-shadow:0 0 3px #444 inset;-webkit-box-shadow:0 0 3px #444 inset;"></button>'+
'</div>'+
'<label id="captchaAbout" for="captcha" style="display:block; border-top:1px dashed #c5c5c5; padding:15px 0; margin:0 20px; font-size:12px; color:#5f5f5f;"></label>'+
'<input name="" type="text" id="secret_text" style="ime-mode:inactive;margin:0 20px; width:232px; border:1px solid #bdbdbd; padding:3px 4px; font-size:18px; font-weight:bold;" />'+
'<div style="margin:20px; border-top:1px dashed #c5c5c5; padding:15px 0 0 0; text-align:center">'+
'<button type="submit" style="height:31px; line-height:31px; padding:0 15px; margin:0 2px; font-size:12px; font-weight:bold; color:#fff; overflow:visible; border:1px solid #5c8a16; background:#6faa13;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #666 inset;-moz-box-shadow:0 0 3px #666 inset;-webkit-box-shadow:0 0 3px #666 inset;"></button>'+
'<button type="button" class="cancel" style="height:31px; line-height:31px; padding:0 15px; margin:0 2px; font-size:12px; font-weight:bold; color:#fff; overflow:visible; border:1px solid #575757; background:#747474;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #444 inset;-moz-box-shadow:0 0 3px #444 inset;-webkit-box-shadow:0 0 3px #444 inset;"></button>'+
'</div>'+
'</form>'+_object_ +
'</div>').appendTo(captchaXE);
$div.find('button.cancel')
.click(function(){ $('#captcha_layer').hide(); });
$div.find('button.play')
.click(function(){
var swf = window['captcha_audio'] || document['captcha_audio'];
var audio = current_url.setQuery('captcha_action','captchaAudio').setQuery('rnd', (new Date).getTime());
$div.find('input[type=text]').focus();
swf.setSoundTarget(audio,'1');
});
$div.find('button.reload')
.click(function(){
var params = new Array();
params['captcha_action'] = 'setCaptchaSession';
params['mid'] = current_mid;
window.oldExecXml('','',params, function() {
$("#captcha_image").attr("src", current_url.setQuery('captcha_action','captchaImage').setQuery('rnd', (new Date).getTime()));
});
});
captchaXE.exec = function(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj) {
var doCheck = false;
$.each(captchaTargetAct || {}, function(key,val){ if (val == act){ doCheck = true; return false; } });
if (doCheck) { /* captcha 를 사용하는 경우 */
$('#captcha_layer form')
.submit(function(e){
e.preventDefault();
if(!$('#secret_text').val()){
$(this).find('input[type=text]').val('').focus();
return false;
}
captchaXE.compare(); return false;
});
calledArgs = {'module':module,'act':act,'params':params,'callback_func':callback_func,'response_tags':response_tags,'callback_func_arg':callback_func_arg,'fo_obj':fo_obj};
var params = new Array();
params['captcha_action'] = 'setCaptchaSession';
params['mid'] = current_mid;
window.oldExecXml(module, act, params, captchaXE.show,new Array('error','message','about_captcha','captcha_reload','captcha_play','cmd_input','cmd_cancel'));
} else {
window.oldExecXml(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj);
}
return true;
};
captchaXE.show = function(ret_obj) {
$('#captcha_layer').show();
$("#captchaAbout").html(ret_obj['about_captcha']);
$("#captcha_layer .reload").attr('title',ret_obj['captcha_reload']);
$("#captcha_layer .play").attr('title',ret_obj['captcha_play']);
$("#captcha_layer button[type=submit]").html(ret_obj['cmd_input']);
$("#captcha_layer button.cancel").html(ret_obj['cmd_cancel']);
$("#captcha_image").attr("src", current_url.setQuery('captcha_action','captchaImage').setQuery('rnd', (new Date).getTime()));
$div.find('input[type=text]').val('').focus();
$('html, body').css('height','100%');
};
captchaXE.compare = function(e) {
var params = new Array();
params['captcha_action'] = 'captchaCompare';
params['mid'] = current_mid;
params['secret_text'] = $('#secret_text').val();
window.oldExecXml(calledArgs.module,calledArgs.act,params, function() {
$("#captcha_layer").hide();
window.oldExecXml(calledArgs.module, calledArgs.act, calledArgs.params, calledArgs.callback_func, calledArgs.response_tags, calledArgs.callback_func_arg, calledArgs.fo_obj);
} );
};
}
return captchaXE;
}
$(window).ready(function(){
if(!window.oldExecXml) {
window.oldExecXml = window.exec_xml;
window.exec_xml = xeCaptcha().exec;
}
});
});
})(jQuery);

1
addons/captcha/captcha.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon version="0.2">
<title xml:lang="ko">Captcha 애드온</title>
<title xml:lang="en">CAPTCHA</title>
<title xml:lang="vi">Captcha Addon</title>
<title xml:lang="zh-CN">验证码插件</title>
<title xml:lang="jp">Captchaアドオン</title>
<title xml:lang="ru">Аддон Captcha</title>
<title xml:lang="zh-TW">圖形驗證</title>
<description xml:lang="ko">
프로그램 글 등록기를 막기 위해 게시판/ issueTracker에서 글/ 댓글을 입력하려 할 때 알파벳을 입력해야 글/댓글이 입력되는 애드온 입니다.
</description>
<description xml:lang="en">
This addon helps to prevent spam messages to be posted by requesting non-logged-in users to type characters displayed in the image before submitting comments or posts.
</description>
<description xml:lang="vi">
Addon này tạo ra một hình ảnh xác nhận khi đăng kí, gửi bài, hay viết bình luận nếu thành viên không đăng nhập.
Addon này chỉ hoạt động khi được kích hoạt.
</description>
<description xml:lang="zh-CN">
为了解决互联网垃圾而开发的验证码机制。
非登录用户发布话题或评论时将会弹出验证图片选择框,选择正确的图片才可以正常发布(适用于版面/issueTracker)。
</description>
<description xml:lang="jp">
ボット(bot)がプログラムによるスパム行為を防ぐために、掲示板issueTrackerで書き込み・コメントを登録する際、ランダムな文字や数字の列を画面に表示し、表示されたものと一致した情報を入力した時、登録が出来るようにするアドオンです。
ログインしてない時だけ、動作します。
</description>
<description xml:lang="ru">
To block spam written by programs, let users to choose a suitable image to text when writing a posting or comment.
This addon applies only to not-logged-in users.
</description>
<description xml:lang="zh-TW">
可防止機器人程式的垃圾留言,非用戶要發表主題或回覆時,必須要輸入正確圖片中所顯示的文字才能發表。
</description>
<version>1.7</version>
<date>2013-11-27</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NAVER</name>
<name xml:lang="zh-CN">NAVER</name>
<name xml:lang="jp">NAVER</name>
<name xml:lang="zh-TW">NAVER</name>
<name xml:lang="en">NAVER</name>
<name xml:lang="ru">NAVER</name>
<name xml:lang="vi">NAVER</name>
</author>
<extra_vars>
<var name="target" type="select">
<title xml:lang="ko">Captcha 표시 대상</title>
<title xml:lang="zh-CN">应用对象</title>
<title xml:lang="jp">Captchaを表示する対象</title>
<title xml:lang="zh-TW">選擇目標</title>
<title xml:lang="en">Captcha Target</title>
<title xml:lang="ru">Captcha Target</title>
<title xml:lang="vi">Mục tiêu Captcha hiển thị</title>
<description xml:lang="ko">글/댓글 등록시 captcha가 동작할 대상을 정할 수 있습니다. 관리자는 무조건 제외됩니다</description>
<description xml:lang="zh-CN">可以指定验证码应用对象(管理员除外)。</description>
<description xml:lang="jp">管理者を除き、書き込み・コメントを入力する際にcaptchaイメージを見せる対象を設定します。</description>
<description xml:lang="zh-TW">除了管理員,可以選擇圖形驗證應用的對象。</description>
<description xml:lang="en">You can specify if CAPTCHA should be displayed when posting an article or comment. It will not apply to administrators.</description>
<description xml:lang="ru">You may specify targets CAPTCHA work. It's not applied when administrator writes.</description>
<description xml:lang="vi">Khi gửi bài, bình luận, Capcha sẽ hiển thị để xác nhận hành động của người sử dụng. Chức năng này không hoạt động với người quản lý.</description>
<options value="">
<title xml:lang="ko">로그인하지 않은 사용자</title>
<title xml:lang="zh-CN">非登录用户</title>
<title xml:lang="jp">ログインしてないユーザー</title>
<title xml:lang="zh-TW">非用戶</title>
<title xml:lang="en">Not logged-in users</title>
<title xml:lang="ru">Not logged-in users</title>
<title xml:lang="vi">Người dùng chưa đăng nhập</title>
</options>
<options value="all">
<title xml:lang="ko">모든 사용자</title>
<title xml:lang="zh-CN">所有用户</title>
<title xml:lang="jp">すべてのユーザー</title>
<title xml:lang="zh-TW">所有用戶</title>
<title xml:lang="en">All users</title>
<title xml:lang="ru">All users</title>
<title xml:lang="vi">Tất cả mọi người</title>
</options>
</var>
<var name="act_type" type="select">
<title xml:lang="ko">동작 방식</title>
<title xml:lang="zh-CN">验证方式</title>
<title xml:lang="jp">動作方式</title>
<title xml:lang="zh-TW">驗證模式</title>
<title xml:lang="en">How it works</title>
<title xml:lang="ru">How it works</title>
<title xml:lang="vi">Sử dụng</title>
<description xml:lang="ko">"1번만 동작"을 선택하면 1번만 동작후 상태를 저장해서 다음부터 물어보지 않고 그렇지 않으면 매번 물어보게 됩니다</description>
<description xml:lang="zh-CN">"一次"就是每个IP只出现一次验证。</description>
<description xml:lang="jp">「1回だけ表示」を選択すると、最初だけ動作した後、その情報を記憶して次回からはCaptchaを見せないようにします。また、もう一つのオプションは毎回Captchaを表示します。</description>
<description xml:lang="zh-TW">選擇"單次",下次不會再顯示;選擇"每次"則會一直顯示。</description>
<description xml:lang="en">If you choose "Once", CAPTCHA works only once for the user by storing status. Otherwise, this addon would show an image every time the user writes.</description>
<description xml:lang="ru">If you choose "Once", CAPTCHA works only once for the user by storing status. Otherwise, this addon would show an image every time the user writes.</description>
<description xml:lang="vi">Nếu chọn "Chỉ một lần" thì sau lần hiển thị đó Capcha sẽ không hiển thị với người sử dụng đó nữa.</description>
<options value="onetime">
<title xml:lang="ko">1번만 동작</title>
<title xml:lang="zh-CN">一次</title>
<title xml:lang="jp">1回だけ表示</title>
<title xml:lang="zh-TW">單次</title>
<title xml:lang="vi">Chỉ một lần</title>
<title xml:lang="en">once</title>
<title xml:lang="ru">1 раз</title>
</options>
<options value="everytime">
<title xml:lang="ko">매번 동작</title>
<title xml:lang="zh-CN">每次</title>
<title xml:lang="jp">毎回表示</title>
<title xml:lang="zh-TW">每次</title>
<title xml:lang="en">every time</title>
<title xml:lang="ru">каждый раз</title>
<title xml:lang="vi">Luôn sử dụng</title>
</options>
</var>
</extra_vars>
</addon>

BIN
addons/captcha/icon/airplane.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
addons/captcha/icon/apple.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
addons/captcha/icon/book.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
addons/captcha/icon/camera.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
addons/captcha/icon/dog.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
addons/captcha/icon/earth.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
addons/captcha/icon/flag.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
addons/captcha/icon/mobile.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
addons/captcha/icon/note.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
addons/captcha/icon/skeleton.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
addons/captcha/img/icon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

View file

@ -0,0 +1,17 @@
jQuery(function($){
$('button.captchaPlay')
.click(function(){
var swf = document['captcha_audio'] || window['captcha_audio'];
var audio = current_url.setQuery('captcha_action','captchaAudio').setQuery('rand', (new Date).getTime());
if(swf.length > 1) swf = swf[0];
$('input[type=text]#secret_text').focus();
swf.setSoundTarget(audio,'1');
});
$('button.captchaReload')
.click(function(){
$("#captcha_image").attr("src", current_url.setQuery('captcha_action','captchaImage').setQuery('rand', (new Date).getTime()).setQuery('renew',1));
});
});

View file

@ -0,0 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>
<lang>
<item name="about_captcha">
<value xml:lang="ko"><![CDATA[위 영어 알파벳을 순서대로 입력해 주세요. 대소문자는 구분하지 않습니다.]]></value>
<value xml:lang="en"><![CDATA[Please type the characters you see in the picture above. They are not case-sensitive.]]></value>
<value xml:lang="jp"><![CDATA[アルファベット順に入力してください。大文字、小文字は区別しません。]]></value>
<value xml:lang="zh-CN"><![CDATA[请依次输入图片中的文字,不区分大小写]]></value>
<value xml:lang="zh-TW"><![CDATA[請依序輸入圖片中的文字,不分大小寫。]]></value>
</item>
<item name="captcha_reload">
<value xml:lang="ko"><![CDATA[이미지 새로고침]]></value>
<value xml:lang="en"><![CDATA[Refresh the image]]></value>
<value xml:lang="jp"><![CDATA[リフレッシュ]]></value>
<value xml:lang="zh-CN"><![CDATA[刷新]]></value>
<value xml:lang="zh-TW"><![CDATA[更換]]></value>
</item>
<item name="captcha_play">
<value xml:lang="ko"><![CDATA[음성으로 듣기]]></value>
<value xml:lang="en"><![CDATA[Listen and type the letters you hear.]]></value>
<value xml:lang="jp"><![CDATA[音声]]></value>
<value xml:lang="zh-CN"><![CDATA[播放]]></value>
<value xml:lang="zh-TW"><![CDATA[播放]]></value>
</item>
<item name="captcha_denied">
<value xml:lang="ko"><![CDATA[잘못 입력했습니다]]></value>
<value xml:lang="en"><![CDATA[The characters you entered didn't match the word verification.]]></value>
<value xml:lang="jp"><![CDATA[正しく入力してください。]]></value>
<value xml:lang="zh-CN"><![CDATA[验证码错误]]></value>
<value xml:lang="zh-TW"><![CDATA[輸入錯誤]]></value>
</item>
</lang>

BIN
addons/captcha/swf/play.swf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,180 @@
/* procFilter 함수를 가로채서 captcha 이미지 및 폼을 출력 */
var calledArgs = null;
(function($){
$(function() {
var captchaXE = null;
function xeCaptcha() {
$('form').each(function(i)
{
var isSubmitHook = false;
if (!$(this).attr('onsubmit') || $(this).attr('onsubmit').indexOf('procFilter') < 0)
{
var act = $(this).find('input[name=act]').val()
for(var i = 0; i<captchaTargetAct.length; i++)
{
if(captchaTargetAct[i] == act)
{
isSubmitHook = true;
break;
}
}
}
if (isSubmitHook)
{
$(this).append('<input type="hidden" name="captchaType" value="inline" />');
if(!$(this).find('input[name=error_return_url]'))
$(this).append('<input type="hidden" name="error_return_url" value="'+current_url+'" />');
$(this).submit(function(event){
if ($(this).find('input[name=secret_text]').val())
{
return true;
}
event.preventDefault();
var self = this;
$('#captcha_layer form')
.submit(function(e){
e.preventDefault();
if(!$('#secret_text').val()){
$(this).find('input[type=text]').val('').focus();
return false;
}
$(self).append('<input type="hidden" name="secret_text" value="'+ $('#secret_text').val() +'" />');
$(self).submit();
});
var params = new Array();
params['captcha_action'] = 'setCaptchaSession';
params['mid'] = current_mid;
window.oldExecXml('', '', params, captchaXE.show,new Array('error','message','about_captcha','captcha_reload','captcha_play','cmd_input','cmd_cancel'));
});
}
});
var body = $(document.body);
var captchaIma;
if (!captchaXE) {
var fc_isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var fc_isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var fc_isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var _swfURL_ = request_uri + 'addons/captcha/swf/play.swf';
if(fc_isIE && fc_isWin && !fc_isOpera){
_object_ ='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="captcha_audio" align="middle">';
_object_ += '<param name="allowScriptAccess" value="always" />';
_object_ += '<param name="quality" value="high" />';
_object_ += '<param name="movie" value="'+_swfURL_+'" />';
_object_ += '<param name="wmode" value="window" />';
_object_ += '<param name="allowFullScreen" value="false">';
_object_ += '<param name="bgcolor" value="#fffff" />';
_object_ += '</object>';
}else{
_object_ = '<embed src="'+_swfURL_+'" quality="high" wmode="window" allowFullScreen="false" bgcolor="#ffffff" width="0" height="0" name="captcha_audio" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
}
captchaXE = $('<div id="captcha_layer" style="position:fixed; top:0; left:0; width:100%; height:100%;display:none;z-index:10">').appendTo(document.body);
var top_left = 'margin:-105px 0 0 -105px; top:50%; left:50%;';
if(screen.width<480) { top_left = ''; }
var $div = $('<div style="z-index:1000;position:absolute; width:310px;' + top_left + ' background:#fff; border:3px solid #ccc;">'+
'<form method="post" action="">'+
'<div style="position:relative; margin:25px 20px 15px 20px">'+
'<img src="about:blank" id="captcha_image" alt="CAPTCHA" width="240" height="50" style="display:block; width:240px; height:50px; border:1px solid #b0b0b0" />'+
'<button type="button" class="reload" title="" style="position:absolute; top:0; left:245px; width:25px; height:25px; padding:0; overflow:visible; border:1px solid #575757; background:#747474 url('+request_uri + 'addons/captcha/img/icon.gif) no-repeat center 5px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #444 inset;-moz-box-shadow:0 0 3px #444 inset;-webkit-box-shadow:0 0 3px #444 inset;"></button>'+
'<button type="button" class="play" title="" style="position:absolute; top:27px; left:245px; width:25px; height:25px; padding:0; overflow:visible; border:1px solid #575757; background:#747474 url('+request_uri + 'addons/captcha/img/icon.gif) no-repeat center -20px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #444 inset;-moz-box-shadow:0 0 3px #444 inset;-webkit-box-shadow:0 0 3px #444 inset;"></button>'+
'</div>'+
'<label id="captchaAbout" for="captcha" style="display:block; border-top:1px dashed #c5c5c5; padding:15px 0; margin:0 20px; font-size:12px; color:#5f5f5f;"></label>'+
'<input name="" type="text" id="secret_text" style="ime-mode:inactive;margin:0 20px; width:232px; border:1px solid #bdbdbd; padding:3px 4px; font-size:18px; font-weight:bold;" />'+
'<div style="margin:20px; border-top:1px dashed #c5c5c5; padding:15px 0 0 0; text-align:center">'+
'<button type="submit" style="height:31px; line-height:31px; padding:0 15px; margin:0 2px; font-size:12px; font-weight:bold; color:#fff; overflow:visible; border:1px solid #5c8a16; background:#6faa13;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #666 inset;-moz-box-shadow:0 0 3px #666 inset;-webkit-box-shadow:0 0 3px #666 inset;"></button>'+
'<button type="button" class="cancel" style="height:31px; line-height:31px; padding:0 15px; margin:0 2px; font-size:12px; font-weight:bold; color:#fff; overflow:visible; border:1px solid #575757; background:#747474;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #444 inset;-moz-box-shadow:0 0 3px #444 inset;-webkit-box-shadow:0 0 3px #444 inset;"></button>'+
'</div>'+
'</form>'+_object_ +
'</div>').appendTo(captchaXE);
$div.find('button.cancel')
.click(function(){ $('#captcha_layer').hide(); });
$div.find('button.play')
.click(function(){
var swf = window['captcha_audio'] || document['captcha_audio'];
var audio = current_url.setQuery('captcha_action','captchaAudio').setQuery('rnd', (new Date).getTime());
$div.find('input[type=text]').focus();
swf.setSoundTarget(audio,'1');
});
$div.find('button.reload')
.click(function(){
var params = new Array();
params['captcha_action'] = 'setCaptchaSession';
params['mid'] = current_mid;
window.oldExecXml('','',params, function() {
$("#captcha_image").attr("src", current_url.setQuery('captcha_action','captchaImage').setQuery('rnd', (new Date).getTime()));
});
});
captchaXE.exec = function(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj) {
var doCheck = false;
$.each(captchaTargetAct || {}, function(key,val){ if (val == act){ doCheck = true; return false; } });
if (doCheck) { /* captcha 를 사용하는 경우 */
$('#captcha_layer form')
.submit(function(e){
e.preventDefault();
if(!$('#secret_text').val()){
$(this).find('input[type=text]').val('').focus();
return false;
}
captchaXE.compare(); return false;
});
calledArgs = {'module':module,'act':act,'params':params,'callback_func':callback_func,'response_tags':response_tags,'callback_func_arg':callback_func_arg,'fo_obj':fo_obj};
var params = new Array();
params['captcha_action'] = 'setCaptchaSession';
params['mid'] = current_mid;
window.oldExecXml(module, act, params, captchaXE.show,new Array('error','message','about_captcha','captcha_reload','captcha_play','cmd_input','cmd_cancel'));
} else {
window.oldExecXml(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj);
}
return true;
};
captchaXE.show = function(ret_obj) {
$('#captcha_layer').show();
$("#captchaAbout").html(ret_obj['about_captcha']);
$("#captcha_layer .reload").attr('title',ret_obj['captcha_reload']);
$("#captcha_layer .play").attr('title',ret_obj['captcha_play']);
$("#captcha_layer button[type=submit]").html(ret_obj['cmd_input']);
$("#captcha_layer button.cancel").html(ret_obj['cmd_cancel']);
$("#captcha_image").attr("src", current_url.setQuery('captcha_action','captchaImage').setQuery('rnd', (new Date).getTime()));
$div.find('input[type=text]').val('').focus();
$('html, body').css('height','100%');
};
captchaXE.compare = function(e) {
var params = new Array();
params['captcha_action'] = 'captchaCompare';
params['mid'] = current_mid;
params['secret_text'] = $('#secret_text').val();
window.oldExecXml(calledArgs.module,calledArgs.act,params, function() {
$("#captcha_layer").hide();
window.oldExecXml(calledArgs.module, calledArgs.act, calledArgs.params, calledArgs.callback_func, calledArgs.response_tags, calledArgs.callback_func_arg, calledArgs.fo_obj);
} );
};
}
return captchaXE;
}
$(window).ready(function(){
if(!window.oldExecXml) {
window.oldExecXml = window.exec_xml;
window.exec_xml = xeCaptcha().exec;
}
});
});
})(jQuery);

1
addons/captcha_member/captcha.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,415 @@
<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
if(!defined("__XE__")) exit();
/**
* @file captcha.addon.php
* @author NAVER (developers@xpressengine.com)
* @brief Captcha for a particular action
* English alphabets and voice verification added
* */
if(!class_exists('AddonMemberCaptcha', false))
{
// On the mobile mode, XE Core does not load jquery and xe.js as normal.
if(Mobile::isFromMobilePhone())
{
Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true);
Context::loadFile(array('./common/js/xe.min.js', 'head', NULL, -100000), true);
}
class AddonMemberCaptcha
{
var $addon_info;
var $target_acts = NULL;
function setInfo(&$addon_info)
{
$this->addon_info = $addon_info;
}
function before_module_proc()
{
// if($_SESSION['member_captcha_authed'])
// {
unset($_SESSION['member_captcha_authed']);
// }
}
function before_module_init(&$ModuleHandler)
{
$logged_info = Context::get('logged_info');
if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)
{
return false;
}
// if($this->addon_info->target != 'all' && Context::get('is_logged'))
// {
// return false;
// }
if($_SESSION['XE_VALIDATOR_ERROR'] == -1)
{
$_SESSION['member_captcha_authed'] = false;
}
if($_SESSION['member_captcha_authed'])
{
return false;
}
$type = Context::get('captchaType');
$this->target_acts = array();
if($this->addon_info->apply_find_account == 'apply')
{
$this->target_acts[] = 'procMemberFindAccount';
}
if($this->addon_info->apply_resend_auth_mail == 'apply')
{
$this->target_acts[] = 'procMemberResendAuthMail';
}
if($this->addon_info->apply_signup == 'apply')
{
$this->target_acts[] = 'procMemberInsert';
}
if(Context::getRequestMethod() != 'XMLRPC' && Context::getRequestMethod() !== 'JSON')
{
if($type == 'inline')
{
if(!$this->compareCaptcha())
{
Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang');
$_SESSION['XE_VALIDATOR_ERROR'] = -1;
$_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied');
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
$_SESSION['XE_VALIDATOR_RETURN_URL'] = Context::get('error_return_url');
$ModuleHandler->_setInputValueToSession();
}
}
else
{
Context::addHtmlHeader('<script>
if(!captchaTargetAct) {var captchaTargetAct = [];}
captchaTargetAct.push("' . implode('","', $this->target_acts) . '");
</script>');
Context::loadFile(array('./addons/captcha_member/captcha.min.js', 'body', '', null), true);
}
}
// compare session when calling actions such as writing a post or a comment on the board/issue tracker module
if(!$_SESSION['member_captcha_authed'] && in_array(Context::get('act'), $this->target_acts))
{
Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang');
$ModuleHandler->error = "captcha_denied";
}
return true;
}
function createKeyword()
{
$type = Context::get('captchaType');
if($type == 'inline' && $_SESSION['captcha_keyword'])
{
return;
}
$arr = range('A', 'Y');
shuffle($arr);
$arr = array_slice($arr, 0, 6);
$_SESSION['captcha_keyword'] = join('', $arr);
}
function before_module_init_setCaptchaSession()
{
if($_SESSION['member_captcha_authed'])
{
return false;
}
// Load language files
Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang');
// Generate keywords
$this->createKeyword();
$target = Context::getLang('target_captcha');
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
printf("<response>\r\n <error>0</error>\r\n <message>success</message>\r\n <about_captcha><![CDATA[%s]]></about_captcha>\r\n <captcha_reload><![CDATA[%s]]></captcha_reload>\r\n <captcha_play><![CDATA[%s]]></captcha_play>\r\n <cmd_input><![CDATA[%s]]></cmd_input>\r\n <cmd_cancel><![CDATA[%s]]></cmd_cancel>\r\n </response>"
, Context::getLang('about_captcha')
, Context::getLang('captcha_reload')
, Context::getLang('captcha_play')
, Context::getLang('cmd_input')
, Context::getLang('cmd_cancel')
);
Context::close();
exit();
}
function before_module_init_captchaImage()
{
if($_SESSION['member_captcha_authed'])
{
return false;
}
if(Context::get('renew'))
{
$this->createKeyword();
}
$keyword = $_SESSION['captcha_keyword'];
$im = $this->createCaptchaImage($keyword);
header("Cache-Control: ");
header("Pragma: ");
header("Content-Type: image/png");
imagepng($im);
imagedestroy($im);
Context::close();
exit();
}
function createCaptchaImage($string)
{
$arr = array();
for($i = 0, $c = strlen($string); $i < $c; $i++)
{
$arr[] = $string{$i};
}
// Font site
$w = 18;
$h = 25;
// Character length
$c = count($arr);
// Character image
$im = array();
// Create an image by total size
$im[] = imagecreate(($w + 2) * count($arr), $h);
$deg = range(-30, 30);
shuffle($deg);
// Create an image for each letter
foreach($arr as $i => $str)
{
$im[$i + 1] = @imagecreate($w, $h);
$background_color = imagecolorallocate($im[$i + 1], 255, 255, 255);
$text_color = imagecolorallocate($im[$i + 1], 0, 0, 0);
// Control font size
$ran = range(1, 20);
shuffle($ran);
if(function_exists('imagerotate'))
{
imagestring($im[$i + 1], (array_pop($ran) % 3) + 3, 2, (array_pop($ran) % 8), $str, $text_color);
$im[$i + 1] = imagerotate($im[$i + 1], array_pop($deg), 0);
$background_color = imagecolorallocate($im[$i + 1], 255, 255, 255);
imagecolortransparent($im[$i + 1], $background_color);
}
else
{
imagestring($im[$i + 1], (array_pop($ran) % 3) + 3, 2, (array_pop($ran) % 4), $str, $text_color);
}
}
// Combine images of each character
for($i = 1; $i < count($im); $i++)
{
imagecopy($im[0], $im[$i], (($w + 2) * ($i - 1)), 0, 0, 0, $w, $h);
imagedestroy($im[$i]);
}
// Larger image
$big_count = 2;
$big = imagecreatetruecolor(($w + 2) * $big_count * $c, $h * $big_count);
imagecopyresized($big, $im[0], 0, 0, 0, 0, ($w + 2) * $big_count * $c, $h * $big_count, ($w + 2) * $c, $h);
imagedestroy($im[0]);
if(function_exists('imageantialias'))
{
imageantialias($big, true);
}
// Background line
$line_color = imagecolorallocate($big, 0, 0, 0);
$w = ($w + 2) * $big_count * $c;
$h = $h * $big_count;
$d = array_pop($deg);
for($i = -abs($d); $i < $h + abs($d); $i = $i + 7)
{
imageline($big, 0, $i + $d, $w, $i, $line_color);
}
$x = range(0, ($w - 10));
shuffle($x);
for($i = 0; $i < 200; $i++)
{
imagesetpixel($big, $x[$i] % $w, $x[$i + 1] % $h, $line_color);
}
return $big;
}
function before_module_init_captchaAudio()
{
if($_SESSION['member_captcha_authed'])
{
return false;
}
$keyword = strtoupper($_SESSION['captcha_keyword']);
$data = $this->createCaptchaAudio($keyword);
header('Content-type: audio/mpeg');
header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\"");
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Expires: Sun, 1 Jan 2000 12:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Content-Length: ' . strlen($data));
echo $data;
Context::close();
exit();
}
function createCaptchaAudio($string)
{
$data = '';
$_audio = './addons/captcha_member/audio/F_%s.mp3';
for($i = 0, $c = strlen($string); $i < $c; $i++)
{
$_data = FileHandler::readFile(sprintf($_audio, $string{$i}));
$start = rand(5, 68); // Random start in 4-byte header and 64 byte data
$datalen = strlen($_data) - $start - 256; // Last unchanged 256 bytes
for($j = $start; $j < $datalen; $j+=64)
{
$ch = ord($_data{$j});
if($ch < 9 || $ch > 119)
{
continue;
}
$_data{$j} = chr($ch + rand(-8, 8));
}
$data .= $_data;
}
return $data;
}
function compareCaptcha()
{
if(!in_array(Context::get('act'), $this->target_acts)) return true;
if($_SESSION['member_captcha_authed'])
{
return true;
}
if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text')))
{
$_SESSION['member_captcha_authed'] = true;
return true;
}
unset($_SESSION['member_captcha_authed']);
return false;
}
function before_module_init_captchaCompare()
{
if(!$this->compareCaptcha())
{
return false;
}
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
print("<response>\r\n<error>0</error>\r\n<message>success</message>\r\n</response>");
Context::close();
exit();
}
function inlineDisplay()
{
unset($_SESSION['member_captcha_authed']);
$this->createKeyword();
$swfURL = getUrl() . 'addons/captcha_member/swf/play.swf';
Context::unloadFile('./addons/captcha_member/captcha.min.js');
Context::loadFile(array('./addons/captcha_member/inline_captcha.js', 'body'));
global $lang;
$tags = <<<EOD
<img src="%s" id="captcha_image" alt="CAPTCHA" width="240" height="50" style="width:240px; height:50px; border:1px solid #b0b0b0" />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="captcha_audio" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="quality" value="high" />
<param name="movie" value="%s" />
<param name="wmode" value="window" />
<param name="allowFullScreen" value="false">
<param name="bgcolor" value="#fffff" />
<embed src="%s" quality="high" wmode="window" allowFullScreen="false" bgcolor="#ffffff" width="0" height="0" name="captcha_audio" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<button type="button" class="captchaReload text">%s</button>
<button type="button" class="captchaPlay text">%s</button><br />
<input type="hidden" name="captchaType" value="inline" />
<input name="secret_text" type="text" id="secret_text" />
EOD;
$tags = sprintf($tags, getUrl('captcha_action', 'captchaImage', 'rand', mt_rand(10000, 99999))
, $swfURL
, $swfURL
, $lang->reload
, $lang->play);
return $tags;
}
}
$GLOBALS['__AddonMemberCaptcha__'] = new AddonMemberCaptcha;
$GLOBALS['__AddonMemberCaptcha__']->setInfo($addon_info);
Context::set('oMemberCaptcha', $GLOBALS['__AddonMemberCaptcha__']);
}
$oAddonMemberCaptcha = &$GLOBALS['__AddonMemberCaptcha__'];
if(method_exists($oAddonMemberCaptcha, $called_position))
{
if(!call_user_func_array(array(&$oAddonMemberCaptcha, $called_position), array(&$this)))
{
return false;
}
}
$addon_act = Context::get('captcha_action');
if($addon_act && method_exists($oAddonMemberCaptcha, $called_position . '_' . $addon_act))
{
if(!call_user_func_array(array(&$oAddonMemberCaptcha, $called_position . '_' . $addon_act), array(&$this)))
{
return false;
}
}
/* End of file captcha_member.addon.php */
/* Location: ./addons/captcha_member/captcha_member.addon.php */

View file

@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon version="0.2">
<title xml:lang="ko">Captcha Member 애드온</title>
<title xml:lang="en">CAPTCHA Member</title>
<title xml:lang="vi">Captcha Member Addon</title>
<title xml:lang="zh-CN">验证码插件</title>
<title xml:lang="jp">Captchaアドオン</title>
<title xml:lang="ru">Аддон Captcha</title>
<title xml:lang="zh-TW">圖形驗證</title>
<description xml:lang="ko">
회원 가입 및 비밀번호 찾기, 인증메일 재발송을 요청할 때 알파벳을 입력하도록 하여 프로그램 등록기를 막는 애드온 입니다.
적용/비적용 대상 모듈을 지정하지 않아야 정상적으로 동작합니다.
</description>
<description xml:lang="en">
회원 가입 및 비밀번호 찾기, 인증메일 재발송을 요청할 때 알파벳을 입력하도록 하여 프로그램 등록기를 막는 애드온 입니다.
적용/비적용 대상 모듈을 지정하지 않아야 정상적으로 동작합니다.
</description>
<description xml:lang="vi">
회원 가입 및 비밀번호 찾기, 인증메일 재발송을 요청할 때 알파벳을 입력하도록 하여 프로그램 등록기를 막는 애드온 입니다.
적용/비적용 대상 모듈을 지정하지 않아야 정상적으로 동작합니다.
</description>
<description xml:lang="zh-CN">
회원 가입 및 비밀번호 찾기, 인증메일 재발송을 요청할 때 알파벳을 입력하도록 하여 프로그램 등록기를 막는 애드온 입니다.
적용/비적용 대상 모듈을 지정하지 않아야 정상적으로 동작합니다.
</description>
<description xml:lang="jp">
회원 가입 및 비밀번호 찾기, 인증메일 재발송을 요청할 때 알파벳을 입력하도록 하여 프로그램 등록기를 막는 애드온 입니다.
적용/비적용 대상 모듈을 지정하지 않아야 정상적으로 동작합니다.
</description>
<description xml:lang="ru">
회원 가입 및 비밀번호 찾기, 인증메일 재발송을 요청할 때 알파벳을 입력하도록 하여 프로그램 등록기를 막는 애드온 입니다.
적용/비적용 대상 모듈을 지정하지 않아야 정상적으로 동작합니다.
</description>
<description xml:lang="zh-TW">
회원 가입 및 비밀번호 찾기, 인증메일 재발송을 요청할 때 알파벳을 입력하도록 하여 프로그램 등록기를 막는 애드온 입니다.
적용/비적용 대상 모듈을 지정하지 않아야 정상적으로 동작합니다.
</description>
<version>1.7</version>
<date>2013-11-27</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NAVER</name>
<name xml:lang="zh-CN">NAVER</name>
<name xml:lang="jp">NAVER</name>
<name xml:lang="zh-TW">NAVER</name>
<name xml:lang="en">NAVER</name>
<name xml:lang="ru">NAVER</name>
<name xml:lang="vi">NAVER</name>
</author>
<extra_vars>
<var name="apply_signup" type="select">
<title xml:lang="ko">회원 가입 적용</title>
<title xml:lang="zh-CN">应用到用户注册表单</title>
<title xml:lang="jp">인증 메일 재발송 적용</title>
<title xml:lang="zh-TW">會員註冊</title>
<title xml:lang="en">Apply to member signup</title>
<title xml:lang="ru">Apply to member signup</title>
<title xml:lang="vi">Apply to member signup</title>
<description xml:lang="ko">적용으로 하면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다.</description>
<description xml:lang="zh-CN">启用此项功能可以有效地拦截自动注册软件的施虐。</description>
<description xml:lang="jp">적용으로 하면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다.</description>
<description xml:lang="zh-TW">開啟功能後在註冊時會顯示驗證碼。</description>
<description xml:lang="en">If you set this option as apply, CAPTCHA will work for signup action, too.</description>
<description xml:lang="ru">If you set this option as apply, CAPTCHA will work for signup action, too.</description>
<description xml:lang="vi">If you set this option as apply, CAPTCHA will work for signup action, too.</description>
<options value="">
<title xml:lang="ko">적용하지 않음</title>
<title xml:lang="zh-CN">不启用</title>
<title xml:lang="jp">적용하지 않음</title>
<title xml:lang="zh-TW">關閉</title>
<title xml:lang="en">Not apply</title>
<title xml:lang="ru">Not apply</title>
<title xml:lang="vi">Không áp dụng</title>
</options>
<options value="apply">
<title xml:lang="ko">적용</title>
<title xml:lang="zh-CN">启用</title>
<title xml:lang="jp">적용</title>
<title xml:lang="zh-TW">開啟</title>
<title xml:lang="en">Apply</title>
<title xml:lang="ru">Apply</title>
<title xml:lang="vi">Áp dụng</title>
</options>
</var>
<var name="apply_find_account" type="select">
<title xml:lang="ko">비밀번호 찾기 적용</title>
<title xml:lang="zh-CN">应用到查找密码功能</title>
<title xml:lang="jp">비밀번호 찾기 적용</title>
<title xml:lang="zh-TW">忘記密碼</title>
<title xml:lang="en">applying to an action finding account</title>
<title xml:lang="ru">applying to an action finding account</title>
<title xml:lang="vi">Khi lấy lại mật khẩu</title>
<description xml:lang="ko">적용으로 하면 비밀번호 찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-CN">启用此项功能可以有效地拦截以查找密码名义发送的垃圾邮件。</description>
<description xml:lang="jp">적용으로 하면 비밀번호찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-TW">開啟功能後在忘記密碼時會顯示驗證碼。</description>
<description xml:lang="en">If you set this option as apply, CAPTCHA will work for finding account action, too.</description>
<description xml:lang="ru">If you set this option as apply, CAPTCHA will work for finding account action, too.</description>
<description xml:lang="vi">Nếu áp dụng, khi thành viên cần lấy lại mật khẩu khi lỡ quên, Capcha sẽ hiện thị để xác nhận việc này.</description>
<options value="">
<title xml:lang="ko">적용하지 않음</title>
<title xml:lang="zh-CN">不启用</title>
<title xml:lang="jp">적용하지 않음</title>
<title xml:lang="zh-TW">關閉</title>
<title xml:lang="en">Not apply</title>
<title xml:lang="ru">Not apply</title>
<title xml:lang="vi">Không áp dụng</title>
</options>
<options value="apply">
<title xml:lang="ko">적용</title>
<title xml:lang="zh-CN">启用</title>
<title xml:lang="jp">적용</title>
<title xml:lang="zh-TW">開啟</title>
<title xml:lang="en">Apply</title>
<title xml:lang="ru">Apply</title>
<title xml:lang="vi">Áp dụng</title>
</options>
</var>
<var name="apply_resend_auth_mail" type="select">
<title xml:lang="ko">인증 메일 재발송 적용</title>
<title xml:lang="zh-CN">应用到认证邮件重新发送功能</title>
<title xml:lang="jp">인증 메일 재발송 적용</title>
<title xml:lang="zh-TW">重寄認證信</title>
<title xml:lang="en">apply to an action resending authmail</title>
<title xml:lang="ru">apply to an action resending authmail</title>
<title xml:lang="vi">Khi lấy lại mã kích hoạt</title>
<description xml:lang="ko">적용으로 하면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-CN">启用此项功能可以有效地拦截以重新发送认证邮件名义发送的垃圾邮件。</description>
<description xml:lang="jp">적용으로 하면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-TW">開啟功能後在重寄認證信時會顯示驗證碼。</description>
<description xml:lang="en">If you set this option as apply, CAPTCHA will work for resending authmail action, too.</description>
<description xml:lang="ru">If you set this option as apply, CAPTCHA will work for resending authmail action, too.</description>
<description xml:lang="vi">Nếu áp dụng, khi thành viên cần lấy lại mã kích hoạt thành viên, Capcha sẽ hiện thị để xác nhận việc này.</description>
<options value="">
<title xml:lang="ko">적용하지 않음</title>
<title xml:lang="zh-CN">不启用</title>
<title xml:lang="jp">적용하지 않음</title>
<title xml:lang="zh-TW">關閉</title>
<title xml:lang="en">Not apply</title>
<title xml:lang="ru">Not apply</title>
<title xml:lang="vi">Không áp dụng</title>
</options>
<options value="apply">
<title xml:lang="ko">적용</title>
<title xml:lang="zh-CN">启用</title>
<title xml:lang="jp">적용</title>
<title xml:lang="zh-TW">開啟</title>
<title xml:lang="en">Apply</title>
<title xml:lang="ru">Apply</title>
<title xml:lang="vi">Áp dụng</title>
</options>
</var>
</extra_vars>
</addon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Some files were not shown because too many files have changed in this diff Show more