Merge pull request #1 from xpressengine/develop

Develop
This commit is contained in:
MinSoo Kim 2015-02-16 13:02:03 +09:00
commit c5893358d5
144 changed files with 9608 additions and 444 deletions

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
}
}

View file

@ -1,6 +1,5 @@
language: php
php:
- 5.2
- 5.3
- 5.4
- 5.5

View file

@ -172,15 +172,6 @@ module.exports = function(grunt) {
'modules/widget/tpl/js/*.js',
],
options : {
globalstrict: false,
undef : false,
eqeqeq: false,
browser : true,
globals: {
"jQuery" : true,
"console" : true,
"window" : true
},
ignores : [
'**/jquery*.js',
'**/swfupload.js',
@ -324,7 +315,7 @@ module.exports = function(grunt) {
// changed
grunt.util.spawn({
cmd: "git",
args: ['diff', '--name-only', target]
args: ['diff', '--name-only', '--diff-filter' ,'ACM', target]
}, function (error, result, code) {
diff = result.stdout;

View file

@ -30,8 +30,10 @@ if($_REQUEST['act'] != 'api')
// 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(!$GLOBALS['HTTP_RAW_POST_DATA'])
if(!$xml)
{
$content = getXmlRpcFailure(1, 'Invalid Method Call');
printContent($content);
@ -39,7 +41,14 @@ if(!$GLOBALS['HTTP_RAW_POST_DATA'])
// xmlprc parsing
// Parse the requested xmlrpc
$xml = new SimpleXMLElement($GLOBALS['HTTP_RAW_POST_DATA']);
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;

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"version":3,"file":"captcha.min.js","sources":["captcha.js"],"names":["calledArgs","$","xeCaptcha","each","i","isSubmitHook","this","attr","indexOf","act","find","val","captchaTargetAct","length","append","current_url","submit","event","preventDefault","self","e","focus","params","Array","current_mid","window","oldExecXml","captchaXE","show","document","body","fc_isIE","navigator","appVersion","fc_isWin","toLowerCase","fc_isOpera","userAgent","_swfURL_","request_uri","_object_","appendTo","top_left","screen","width","$div","click","hide","swf","audio","setQuery","Date","getTime","setSoundTarget","exec","module","callback_func","response_tags","callback_func_arg","fo_obj","doCheck","key","compare","ret_obj","html","css","ready","exec_xml","jQuery"],"mappings":"A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W0D,kBAAmB1D,WAAW2D,WAIxK,MAAOhC,GArKR,GAAIA,GAAY,IAwKhB1B,GAAEwB,QAAQyC,MAAM,WACXzC,OAAOC,aACVD,OAAOC,WAAaD,OAAO0C,SAC3B1C,OAAO0C,SAAWjE,IAAYoD,WAI/Bc"}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"version":3,"file":"captcha.min.js","sources":["captcha.js"],"names":["calledArgs","$","xeCaptcha","each","i","isSubmitHook","this","attr","indexOf","act","find","val","captchaTargetAct","length","append","current_url","submit","event","preventDefault","self","e","focus","params","Array","current_mid","window","oldExecXml","captchaXE","show","document","body","fc_isIE","navigator","appVersion","fc_isWin","toLowerCase","fc_isOpera","userAgent","_swfURL_","request_uri","_object_","appendTo","top_left","screen","width","$div","click","hide","swf","audio","setQuery","Date","getTime","setSoundTarget","exec","module","callback_func","response_tags","callback_func_arg","fo_obj","doCheck","key","compare","ret_obj","html","css","ready","exec_xml","jQuery"],"mappings":"AACA,GAAIA,YAAa,MACjB,SAAUC,GACTA,EAAE,WAGD,QAASC,KACRD,EAAE,QAAQE,KAAK,SAASC,GAEvB,GAAIC,IAAe,CACnB,KAAKJ,EAAEK,MAAMC,KAAK,aAAgBN,EAAEK,MAAMC,KAAK,YAAYC,QAAQ,cAAgB,EAGlF,IAAI,GADAC,GAAMR,EAAEK,MAAMI,KAAK,mBAAmBC,MAClCP,EAAI,EAAGA,EAAEQ,iBAAiBC,OAAQT,IAEzC,GAAGQ,iBAAiBR,IAAMK,EAC1B,CACCJ,GAAe,CACf,OAKCA,IAEHJ,EAAEK,MAAMQ,OAAO,6DACXb,EAAEK,MAAMI,KAAK,iCAChBT,EAAEK,MAAMQ,OAAO,uDAAuDC,YAAY,QACnFd,EAAEK,MAAMU,OAAO,SAASC,GACvB,GAAIhB,EAAEK,MAAMI,KAAK,2BAA2BC,MAE3C,OAAO,CAGRM,GAAMC,gBACN,IAAIC,GAAOb,IAEXL,GAAE,uBACDe,OAAO,SAASI,GA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AK,QAAQwD,EAAsB,cAC7D9D,EAAE,sCAAsC+D,KAAKD,EAAmB,WAChE9D,EAAE,gCAAgC+D,KAAKD,EAAoB,YAC3D9D,EAAE,kBAAkBM,KAAK,MAAOQ,YAAYmC,SAAS,iBAAiB,gBAAgBA,SAAS,OAAO,GAAKC,OAAMC,YACjHP,EAAKnC,KAAK,oBAAoBC,IAAI,IAAIU,QACtCpB,EAAE,cAAcgE,IAAI,SAAS,SAG9BtC,EAAUmC,QAAU,WACnB,GAAIxC,GAAS,GAAIC,MACjBD,GAAuB,eAAI,iBAC3BA,EAAY,IAAIE,YAChBF,EAAoB,YAAIrB,EAAE,gBAAgBU,MAC1Cc,OAAOC,WAAW1B,WAAWuD,OAAOvD,WAAWS,IAAIa,EAAQ,WAC1DrB,EAAE,kBAAkB8C,OACpBtB,OAAOC,WAAW1B,WAAWuD,OAAQvD,WAAWS,IAAKT,WAAWsB,OAAQtB,WAAWwD,cAAexD,WAAWyD,cAAezD,WAAW0D,kBAAmB1D,WAAW2D,WAIxK,MAAOhC,GArKR,GAAIA,GAAY,IAwKhB1B,GAAEwB,QAAQyC,MAAM,WACXzC,OAAOC,aACVD,OAAOC,WAAaD,OAAO0C,SAC3B1C,OAAO0C,SAAWjE,IAAYoD,WAI/Bc"}

View file

@ -781,12 +781,6 @@
from: 'htmlstring'
}
}),
new $.fn.oembed.OEmbedProvider("gravtar", "photo", ["mailto:.+"], null, {
templateRegex: /mailto:([^\/]+).*/,
template: function (wm, email) {
return '<img src="http://gravatar.com/avatar/' + email.md5() + '.jpg" alt="on Gravtar" class="jqoaImg">';
}
}),
//Rich
new $.fn.oembed.OEmbedProvider("twitter", "rich", ["twitter.com/.+"], "https://api.twitter.com/1/statuses/oembed.json"),
@ -1062,137 +1056,3 @@
})
];
})(jQuery);
//This is needed for gravatar :(
String.prototype.md5 = function () {
var a = function (a, b) {
var c = (a & 65535) + (b & 65535);
var d = (a >> 16) + (b >> 16) + (c >> 16);
return d << 16 | c & 65535
};
var b = function (a, b) {
return a << b | a >>> 32 - b
};
var c = function (c, d, e, f, g, h) {
return a(b(a(a(d, c), a(f, h)), g), e)
};
var d = function (a, b, d, e, f, g, h) {
return c(b & d | ~b & e, a, b, f, g, h)
};
var e = function (a, b, d, e, f, g, h) {
return c(b & e | d & ~e, a, b, f, g, h)
};
var f = function (a, b, d, e, f, g, h) {
return c(b ^ d ^ e, a, b, f, g, h)
};
var g = function (a, b, d, e, f, g, h) {
return c(d ^ (b | ~e), a, b, f, g, h)
};
var h = function (b) {
var c, h, i, j, k, l = b.length;
var m = 1732584193;
var n = -271733879;
var o = -1732584194;
var p = 271733878;
for(k = 0; k < l; k += 16) {
c = m;
h = n;
i = o;
j = p;
m = d(m, n, o, p, b[k + 0], 7, -680876936);
p = d(p, m, n, o, b[k + 1], 12, -389564586);
o = d(o, p, m, n, b[k + 2], 17, 606105819);
n = d(n, o, p, m, b[k + 3], 22, -1044525330);
m = d(m, n, o, p, b[k + 4], 7, -176418897);
p = d(p, m, n, o, b[k + 5], 12, 1200080426);
o = d(o, p, m, n, b[k + 6], 17, -1473231341);
n = d(n, o, p, m, b[k + 7], 22, -45705983);
m = d(m, n, o, p, b[k + 8], 7, 1770035416);
p = d(p, m, n, o, b[k + 9], 12, -1958414417);
o = d(o, p, m, n, b[k + 10], 17, -42063);
n = d(n, o, p, m, b[k + 11], 22, -1990404162);
m = d(m, n, o, p, b[k + 12], 7, 1804603682);
p = d(p, m, n, o, b[k + 13], 12, -40341101);
o = d(o, p, m, n, b[k + 14], 17, -1502002290);
n = d(n, o, p, m, b[k + 15], 22, 1236535329);
m = e(m, n, o, p, b[k + 1], 5, -165796510);
p = e(p, m, n, o, b[k + 6], 9, -1069501632);
o = e(o, p, m, n, b[k + 11], 14, 643717713);
n = e(n, o, p, m, b[k + 0], 20, -373897302);
m = e(m, n, o, p, b[k + 5], 5, -701558691);
p = e(p, m, n, o, b[k + 10], 9, 38016083);
o = e(o, p, m, n, b[k + 15], 14, -660478335);
n = e(n, o, p, m, b[k + 4], 20, -405537848);
m = e(m, n, o, p, b[k + 9], 5, 568446438);
p = e(p, m, n, o, b[k + 14], 9, -1019803690);
o = e(o, p, m, n, b[k + 3], 14, -187363961);
n = e(n, o, p, m, b[k + 8], 20, 1163531501);
m = e(m, n, o, p, b[k + 13], 5, -1444681467);
p = e(p, m, n, o, b[k + 2], 9, -51403784);
o = e(o, p, m, n, b[k + 7], 14, 1735328473);
n = e(n, o, p, m, b[k + 12], 20, -1926607734);
m = f(m, n, o, p, b[k + 5], 4, -378558);
p = f(p, m, n, o, b[k + 8], 11, -2022574463);
o = f(o, p, m, n, b[k + 11], 16, 1839030562);
n = f(n, o, p, m, b[k + 14], 23, -35309556);
m = f(m, n, o, p, b[k + 1], 4, -1530992060);
p = f(p, m, n, o, b[k + 4], 11, 1272893353);
o = f(o, p, m, n, b[k + 7], 16, -155497632);
n = f(n, o, p, m, b[k + 10], 23, -1094730640);
m = f(m, n, o, p, b[k + 13], 4, 681279174);
p = f(p, m, n, o, b[k + 0], 11, -358537222);
o = f(o, p, m, n, b[k + 3], 16, -722521979);
n = f(n, o, p, m, b[k + 6], 23, 76029189);
m = f(m, n, o, p, b[k + 9], 4, -640364487);
p = f(p, m, n, o, b[k + 12], 11, -421815835);
o = f(o, p, m, n, b[k + 15], 16, 530742520);
n = f(n, o, p, m, b[k + 2], 23, -995338651);
m = g(m, n, o, p, b[k + 0], 6, -198630844);
p = g(p, m, n, o, b[k + 7], 10, 1126891415);
o = g(o, p, m, n, b[k + 14], 15, -1416354905);
n = g(n, o, p, m, b[k + 5], 21, -57434055);
m = g(m, n, o, p, b[k + 12], 6, 1700485571);
p = g(p, m, n, o, b[k + 3], 10, -1894986606);
o = g(o, p, m, n, b[k + 10], 15, -1051523);
n = g(n, o, p, m, b[k + 1], 21, -2054922799);
m = g(m, n, o, p, b[k + 8], 6, 1873313359);
p = g(p, m, n, o, b[k + 15], 10, -30611744);
o = g(o, p, m, n, b[k + 6], 15, -1560198380);
n = g(n, o, p, m, b[k + 13], 21, 1309151649);
m = g(m, n, o, p, b[k + 4], 6, -145523070);
p = g(p, m, n, o, b[k + 11], 10, -1120210379);
o = g(o, p, m, n, b[k + 2], 15, 718787259);
n = g(n, o, p, m, b[k + 9], 21, -343485551);
m = a(m, c);
n = a(n, h);
o = a(o, i);
p = a(p, j)
}
return [m, n, o, p]
};
var i = function (a) {
var b = "0123456789abcdef",
c = "",
d, e = a.length * 4;
for(d = 0; d < e; d++) {
c += b.charAt(a[d >> 2] >> d % 4 * 8 + 4 & 15) + b.charAt(a[d >> 2] >> d % 4 * 8 & 15)
}
return c
};
var j = function (a) {
var b = (a.length + 8 >> 6) + 1;
var c = [],
d, e = b * 16,
f, g = a.length;
for(d = 0; d < e; d++) {
c.push(0)
}
for(f = 0; f < g; f++) {
c[f >> 2] |= (a.charCodeAt(f) & 255) << f % 4 * 8
}
c[f >> 2] |= 128 << f % 4 * 8;
c[b * 16 - 2] = g * 8;
return c
};
return i(h(j(this)))
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1,2 @@
!function(a){var b="(https?|ftp|news|telnet|irc|mms)://",c="(?:[\\w\\-]+\\.)+(?:[a-z]+)",d="(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9]?[0-9])",e="(?:"+d+"\\.){3}"+d,f="(?::([0-9]+))?",g="(?:/~[\\w-]+)?",h='((?:/[\\w!"$-/:-@]+)*)',i="(?:#([\\w!-@]+))?",j=new RegExp("("+b+"("+c+"|"+e+"|localhost)"+f+g+h+i+")","ig"),k=xe.createPlugin("OEmbed",{targets:[],init:function(){this.targets=[],this.enableAutoLink=!1,this.castedOembedA=!1,this.embedSetting=[]},API_ONREADY:function(){var b=this;this.extractTargets(a(".xe_content")),this.oApp.getPlugin("autolink").length&&(this.enableAutoLink=!0),b.cast("OEMBEDA"),this.enableAutoLink||a(this.targets).each(function(){b.cast("OEMBED",[this])})},API_BEFORE_AUTOLINK:function(){var a=this;a.cast("OEMBEDA")},API_AFTER_AUTOLINK:function(a,b){this.oembed(b[0])},API_OEMBED:function(b,c){if(!this.enableAutoLink){var d=c[0];if(!a(d).parent().length||"a"==a(d).parent().get(0).nodeName.toLowerCase())return void this.oembed(a(d));var e=d.nodeValue,f=a("<span>");e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(j,'<a href="$1" target="_blank">$1</a>'),a(d).before(f),a(d).replaceWith(e),c[0]=f.next("a"),f.remove(),this.oembed(c[0])}},API_OEMBEDA:function(){if(!this.castedOembedA){var b=this;this.castedOembedA=!0,a(".read_body a").not("_oembed").each(function(){b.oembed(a(this))})}},oembed:function(b){var c=this;this.embedSetting.maxWidth||(this.embedSetting.maxWidth=a(".xe_content").width()),b&&(b&&3==b.nodeType&&(b=a(b)),b.oembed(null,c.embedSetting).addClass("_oembed"))},extractTargets:function(b){var c=this,d=a(".xe_content",b);return d.length?void this.extractTargets(d):void a(b).contents().each(function(){var b=this.nodeName.toLowerCase();if(-1==a.inArray(b,["a","pre","xml","textarea","input","select","option","code","script","style","iframe","button","img","embed","object","ins"]))if(j.exec(""),3==this.nodeType){var d=this.nodeValue;if(d.length<5)return;if(!/(http|https|ftp|news|telnet|irc|mms):\/\//i.test(d))return;c.targets.push(this)}else c.extractTargets(this)})}});xe.registerPlugin(new k)}(jQuery);
!function(a){var b="(https?|ftp|news|telnet|irc|mms)://",c="(?:[\\w\\-]+\\.)+(?:[a-z]+)",d="(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9]?[0-9])",e="(?:"+d+"\\.){3}"+d,f="(?::([0-9]+))?",g="(?:/~[\\w-]+)?",h='((?:/[\\w!"$-/:-@]+)*)',i="(?:#([\\w!-@]+))?",j=new RegExp("("+b+"("+c+"|"+e+"|localhost)"+f+g+h+i+")","ig"),k=xe.createPlugin("OEmbed",{targets:[],init:function(){this.targets=[],this.enableAutoLink=!1,this.castedOembedA=!1,this.embedSetting=[]},API_ONREADY:function(){var b=this;this.extractTargets(a(".xe_content")),this.oApp.getPlugin("autolink").length&&(this.enableAutoLink=!0),b.cast("OEMBEDA"),this.enableAutoLink||a(this.targets).each(function(){b.cast("OEMBED",[this])})},API_BEFORE_AUTOLINK:function(){var a=this;a.cast("OEMBEDA")},API_AFTER_AUTOLINK:function(a,b){this.oembed(b[0])},API_OEMBED:function(b,c){if(!this.enableAutoLink){var d=c[0];if(!a(d).parent().length||"a"==a(d).parent().get(0).nodeName.toLowerCase())return void this.oembed(a(d));var e=d.nodeValue,f=a("<span>");e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(j,'<a href="$1" target="_blank">$1</a>'),a(d).before(f),a(d).replaceWith(e),c[0]=f.next("a"),f.remove(),this.oembed(c[0])}},API_OEMBEDA:function(){if(!this.castedOembedA){var b=this;this.castedOembedA=!0,a(".read_body a").not("_oembed").each(function(){b.oembed(a(this))})}},oembed:function(b){var c=this;this.embedSetting.maxWidth||(this.embedSetting.maxWidth=a(".xe_content").width()),b&&(b&&3==b.nodeType&&(b=a(b)),b.oembed(null,c.embedSetting).addClass("_oembed"))},extractTargets:function(b){var c=this,d=a(".xe_content",b);return d.length?void this.extractTargets(d):void a(b).contents().each(function(){var b=this.nodeName.toLowerCase();if(-1==a.inArray(b,["a","pre","xml","textarea","input","select","option","code","script","style","iframe","button","img","embed","object","ins"]))if(j.exec(""),3==this.nodeType){var d=this.nodeValue;if(d.length<5)return;if(!/(http|https|ftp|news|telnet|irc|mms):\/\//i.test(d))return;c.targets.push(this)}else c.extractTargets(this)})}});xe.registerPlugin(new k)}(jQuery);
//# sourceMappingURL=oembed.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"oembed.min.js","sources":["oembed.js"],"names":["$","protocol_re","domain_re","max_255_re","ip_re","port_re","user_re","path_re","hash_re","url_regex","RegExp","OEmbed","xe","createPlugin","targets","init","this","enableAutoLink","castedOembedA","embedSetting","API_ONREADY","thisPlugin","extractTargets","oApp","getPlugin","length","cast","each","API_BEFORE_AUTOLINK","API_AFTER_AUTOLINK","oSender","params","oembed","API_OEMBED","textNode","parent","get","nodeName","toLowerCase","content","nodeValue","dummy","replace","before","replaceWith","next","remove","API_OEMBEDA","not","target","maxWidth","width","nodeType","addClass","obj","wrap","contents","node_name","inArray","exec","test","push","registerPlugin","jQuery"],"mappings":"CAKA,SAAUA,GACT,GAAIC,GAAc,sCACdC,EAAc,8BACdC,EAAc,gDACdC,EAAc,MAAMD,EAAW,UAAUA,EACzCE,EAAc,iBACdC,EAAc,iBACdC,EAAc,yBACdC,EAAc,oBAEdC,EAAY,GAAIC,QAAO,IAAIT,EAAY,IAAIC,EAAU,IAAIE,EAAM,cAAiBC,EAAQC,EAAQC,EAAQC,EAAQ,IAAK,MAErHG,EAASC,GAAGC,aAAa,UAC5BC,WACAC,KAAO,WACNC,KAAKF,WACLE,KAAKC,gBAAiB,EACtBD,KAAKE,eAAgB,EACrBF,KAAKG,iBAGNC,YAAc,WACb,GAAIC,GAAaL,IAGjBA,MAAKM,eAAetB,EAAE,gBAEnBgB,KAAKO,KAAKC,UAAU,YAAYC,SAElCT,KAAKC,gBAAiB,GAEvBI,EAAWK,KAAK,WAEZV,KAAKC,gBAERjB,EAAEgB,KAAKF,SAASa,KAAK,WACpBN,EAAWK,KAAK,UAAWV,UAI9BY,oBAAsB,WACrB,GAAIP,GAAaL,IACjBK,GAAWK,KAAK,YAEjBG,mBAAqB,SAASC,EAASC,GACtCf,KAAKgB,OAAOD,EAAO,KAEpBE,WAAa,SAASH,EAASC,GAC9B,IAAGf,KAAKC,eAAR,CACA,GAEIiB,GAAWH,EAAO,EACtB,KAAI/B,EAAEkC,GAAUC,SAASV,QAAgE,KAAtDzB,EAAEkC,GAAUC,SAASC,IAAI,GAAGC,SAASC,cAGvE,WADAtB,MAAKgB,OAAOhC,EAAEkC,GAGf,IAAIK,GAAWL,EAASM,UACpBC,EAAWzC,EAAE,SAEjBuC,GAAUA,EAAQG,QAAQ,KAAM,QAAQA,QAAQ,KAAM,QACtDH,EAA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_holder"),e=a("#xe_gallery_closebtn"),f=a("#xe_gallery_prevbtn"),g=a("#xe_gallery_nextbtn")):(d=a("<div>").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:.7}),b=a("<div>").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510}),f=a('<button type="button" id="xe_gallery_prevbtn" />').css({left:"10px",backgroundPosition:"0 -64px"}).click(function(){d.xePrev()}).appendTo(b),e=a('<button type="button" id="xe_gallery_closebtn" />').css({top:"10px",backgroundPosition:"0 0"}).click(function(){d.xeHide()}).appendTo(b),g=a('<button type="button" id="xe_gallery_nextbtn" />').attr("id","xe_gallery_nextbtn").css({right:"10px",backgroundPosition:"0 -128px"}).click(function(){d.xeNext()}).appendTo(b),b.find(">button").css({position:"absolute",width:"64px",height:"64px",zIndex:530,cursor:"pointer",border:0,margin:0,padding:0,backgroundColor:"transparent",backgroundImage:"url("+request_uri+"addons/resize_image/btn.png)",backgroundRepeat:"no-repeat",opacity:".5",filter:"alpha(opacity=50)"}).mouseover(function(){a(this).css({opacity:"1",filter:"alpha(opacity=100)"})}).mouseout(function(){a(this).css({opacity:".5",filter:"alpha(opacity=50)"})}).focus(function(){a(this).trigger("mouseover")}).blur(function(){a(this).trigger("mouseout")}),c=a(new Image),c.attr("id","xe_gallery_holder").css({border:"5px solid white",zindex:520,maxWidth:"none",borderRadius:"5px",boxShadow:"0 0 10px #000"}).appendTo(b).draggable(),h.append(d).append(b),c.live("load",function(){var b=a(window).width(),d=a(window).height();c.css({left:b/2-c.width()/2+"px",top:d/2-c.height()/2+"px"})}),d.xeShow=function(){var b=(a(window).width(),a(window).height());a("#xe_gallery_controls,#xe_gallery_screen").show().css({top:0,right:0,bottom:0,left:0}),a("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round(b/2-32)+"px"),this.xeMove(0)},d.xeHide=function(){d.hide(),b.hide()},d.xePrev=function(){this.xeMove(-1)},d.xeNext=function(){this.xeMove(1)},d.xeMove=function(b){var d=a(window).width(),h=a(window).height();this.index+=b,f.css("visibility",this.index>0?"visible":"hidden"),g.css("visibility",this.index<this.list.size()-1?"visible":"hidden");var i=this.list.eq(this.index).attr("rawsrc");i||(i=this.list.eq(this.index).attr("src")),c.attr("src",i).removeAttr("width").removeAttr("height"),c.width()>0&&c.css({left:d/2-c.width()/2+"px",top:h/2-c.height()/2+"px"}),e.css({left:d/2-32+"px",top:"10px"}).focus()},a(document).keydown(function(a){return 27==a.which?(d.xeHide(),!1):!0})),d}function c(){var c=a(this).closest(".xe_content"),d=c.find("img[rel=xe_gallery]"),e=a.inArray(a(this).get(0),d.get()),f=b();f.list=d,f.index=e,f.xeShow()}var d=null;a(window).load(function(){function b(a,c){if(c||(c=0),!(c>=10)){var d=this,e={width:d.width(),height:d.height()};if(!e.width||!e.height)return void setTimeout(function(){b.call(d,a,++c)},200);if(!(e.width<=a)){var f=a/e.width;d.removeAttr("width").removeAttr("height").css({width:a,height:parseInt(e.height*f,10)})}}}var d=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i,e=/(?:common\/tpl\/images\/blank\.gif$)/i,f=a('<div style="height:1px;overflow:hidden;opacity:0;display:block;clear:both"></div>');a(".xe_content").each(function(){var g=f.appendTo(this).width();f.remove(),g&&(a("img",this).each(function(){var c=a(this),f=c.attr("src");(!d.test(f)||e.test(f))&&(c.attr("rel","xe_gallery"),b.call(c,g))}),a("img[rel=xe_gallery]",this).live("mouseover",function(){var b=a(this);b.parent("a").length||b.attr("onclick")||b.css("cursor","pointer").click(c)}))})})}(jQuery);
!function(a){function b(){var b,c,e,f,g,h=a(document.body);return d?(b=a("#xe_gallery_controls"),c=a("#xe_gallery_holder"),e=a("#xe_gallery_closebtn"),f=a("#xe_gallery_prevbtn"),g=a("#xe_gallery_nextbtn")):(d=a("<div>").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:.7}),b=a("<div>").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510}),f=a('<button type="button" id="xe_gallery_prevbtn" />').css({left:"10px",backgroundPosition:"0 -64px"}).click(function(){d.xePrev()}).appendTo(b),e=a('<button type="button" id="xe_gallery_closebtn" />').css({top:"10px",backgroundPosition:"0 0"}).click(function(){d.xeHide()}).appendTo(b),g=a('<button type="button" id="xe_gallery_nextbtn" />').attr("id","xe_gallery_nextbtn").css({right:"10px",backgroundPosition:"0 -128px"}).click(function(){d.xeNext()}).appendTo(b),b.find(">button").css({position:"absolute",width:"64px",height:"64px",zIndex:530,cursor:"pointer",border:0,margin:0,padding:0,backgroundColor:"transparent",backgroundImage:"url("+request_uri+"addons/resize_image/btn.png)",backgroundRepeat:"no-repeat",opacity:".5",filter:"alpha(opacity=50)"}).mouseover(function(){a(this).css({opacity:"1",filter:"alpha(opacity=100)"})}).mouseout(function(){a(this).css({opacity:".5",filter:"alpha(opacity=50)"})}).focus(function(){a(this).trigger("mouseover")}).blur(function(){a(this).trigger("mouseout")}),c=a(new Image),c.attr("id","xe_gallery_holder").css({border:"5px solid white",zindex:520,maxWidth:"none",borderRadius:"5px",boxShadow:"0 0 10px #000"}).appendTo(b).draggable(),h.append(d).append(b),c.live("load",function(){var b=a(window).width(),d=a(window).height();c.css({left:b/2-c.width()/2+"px",top:d/2-c.height()/2+"px"})}),d.xeShow=function(){var b=(a(window).width(),a(window).height());a("#xe_gallery_controls,#xe_gallery_screen").show().css({top:0,right:0,bottom:0,left:0}),a("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round(b/2-32)+"px"),this.xeMove(0)},d.xeHide=function(){d.hide(),b.hide()},d.xePrev=function(){this.xeMove(-1)},d.xeNext=function(){this.xeMove(1)},d.xeMove=function(b){var d=a(window).width(),h=a(window).height();this.index+=b,f.css("visibility",this.index>0?"visible":"hidden"),g.css("visibility",this.index<this.list.size()-1?"visible":"hidden");var i=this.list.eq(this.index).attr("rawsrc");i||(i=this.list.eq(this.index).attr("src")),c.attr("src",i).removeAttr("width").removeAttr("height"),c.width()>0&&c.css({left:d/2-c.width()/2+"px",top:h/2-c.height()/2+"px"}),e.css({left:d/2-32+"px",top:"10px"}).focus()},a(document).keydown(function(a){return 27==a.which?(d.xeHide(),!1):!0})),d}function c(){var c=a(this).closest(".xe_content"),d=c.find("img[rel=xe_gallery]"),e=a.inArray(a(this).get(0),d.get()),f=b();f.list=d,f.index=e,f.xeShow()}var d=null;a(window).load(function(){function b(a,c){if(c||(c=0),!(c>=10)){var d=this,e={width:d.width(),height:d.height()};if(!e.width||!e.height)return void setTimeout(function(){b.call(d,a,++c)},200);if(!(e.width<=a)){var f=a/e.width;d.removeAttr("width").removeAttr("height").css({width:a,height:parseInt(e.height*f,10)})}}}var d=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i,e=/(?:common\/tpl\/images\/blank\.gif$)/i,f=a('<div style="height:1px;overflow:hidden;opacity:0;display:block;clear:both"></div>');a(".xe_content").each(function(){var g=f.appendTo(this).width();f.remove(),g&&(a("img",this).each(function(){var c=a(this),f=c.attr("src");(!d.test(f)||e.test(f))&&(c.attr("rel","xe_gallery"),b.call(c,g))}),a("img[rel=xe_gallery]",this).live("mouseover",function(){var b=a(this);b.parent("a").length||b.attr("onclick")||b.css("cursor","pointer").click(c)}))})})}(jQuery);
//# sourceMappingURL=resize_image.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"resize_image.min.js","sources":["resize_image.js"],"names":["$","getScreen","controls","imgframe","closebtn","prevbtn","nextbtn","body","document","xScreen","attr","css","position","display","backgroundColor","zIndex","opacity","overflow","left","backgroundPosition","click","xePrev","appendTo","top","xeHide","right","xeNext","find","width","height","cursor","border","margin","padding","backgroundImage","request_uri","backgroundRepeat","filter","mouseover","this","mouseout","focus","trigger","blur","Image","zindex","maxWidth","borderRadius","boxShadow","draggable","append","live","clientWidth","window","clientHeight","xeShow","show","bottom","Math","round","xeMove","hide","val","index","list","size","src","eq","removeAttr","keydown","e","which","slideshow","container","closest","imglist","currentIdx","inArray","get","load","doResize","contentWidth","count","$img","beforSize","setTimeout","call","resize_ratio","parseInt","regx_skip","regx_allow_i6pngfix","dummy","each","remove","imgSrc","test","parent","length","jQuery"],"mappings":"CAGA,SAAUA,GAKV,QAASC,KACR,GACIC,GAAUC,EAAUC,EAAUC,EAASC,EADvCC,EAAUP,EAAEQ,SAASD,KAiLzB,OA9KKE,IAwKJP,EAAWF,EAAE,wBACbG,EAAWH,EAAE,sBACbI,EAAWJ,EAAE,wBACbK,EAAWL,EAAE,uBACbM,EAAWN,EAAE,yBA1KbS,EAAUT,EAAE,SACVU,KAAK,KAAK,qBACVC,KACAC,SAAS,QACTC,QAAQ,OACRC,gBAAgB,QAChBC,OAAO,IACPC,QAAQ,KAIVd,EAAWF,EAAE,SACXU,KAAK,KAAK,uBACVC,KACAC,SAAS,QACTC,QAAQ,OACRI,SAAS,SACTF,OAAO,MAITV,EAAUL,EAAE,oDACVW,KACAO,KAAM,OACNC,mBAAoB,YAEpBC,MAAM,WAAWX,EAAQY,WACzBC,SAASpB,GAGXE,EAAWJ,EAAE,qDACXW,KACAY,IAAK,OACLJ,mBAAoB,QAEpBC,MAAM,WAAWX,EAAQe,WACzBF,SAASpB,GAGXI,EAAUN,EAAE,oDACVU,KAAK,KAAM,sBACXC,KACAc,MAAO,OACPN,mBAAoB,aAEpBC,MAAM,WAAWX,EAAQiB,WACzBJ,SAASpB,GAGXA,EAASyB,KAAK,WACZhB,KACAC,SAAW,WACXgB,MAAQ,OACRC,OAAS,OACTd,OAAS,IACTe,OAAS,UACTC,OAAS,EACTC,OAAS,EACTC,QAAU,EACVnB,gBAAiB,cACjBoB,gBAAiB,OAASC,YAAc,+BACxCC,iBAAkB,YAClBpB,QAAS,KACTqB,OAAQ,sBAERC,UAAU,WACVtC,EAAEuC,MAAM5B,KACPK,QAAS,IACTqB,OAAQ,yBAGTG,SAAS,WACTxC,EAAEuC,MAAM5B,KACPK,QAAS,KAC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AAE,oFAkCdA,GAAE,eAAe4F,KAAK,WACrB,GAAIX,GAAeU,EAAMrE,SAASiB,MAAMX,OACxC+D,GAAME,SACFZ,IAEJjF,EAAE,MAAOuC,MAAMqD,KAAK,WACnB,GAAIT,GAAOnF,EAAEuC,MACTuD,EAASX,EAAKzE,KAAK,SACpB+E,EAAUM,KAAKD,IAAYJ,EAAoBK,KAAKD,MACvDX,EAAKzE,KAAK,MAAO,cACjBsE,EAASM,KAAKH,EAAMF,MAIrBjF,EAAE,sBAAuBuC,MAAMY,KAAK,YAAa,WAChD,GAAIgC,GAAOnF,EAAEuC,KACT4C,GAAKa,OAAO,KAAKC,QAAWd,EAAKzE,KAAK,YACzCyE,EAAKxE,IAAI,SAAU,WAAWS,MAAMoD,WAMrC0B"}

View file

@ -1113,7 +1113,7 @@ class Context
{
is_a($this, 'Context') ? $self = $this : $self = self::getInstance();
$self->js_callback_func = isset($_GET['xe_js_callback']) ? $_GET['xe_js_callback'] : $_POST['xe_js_callback'];
$self->js_callback_func = $self->getJSCallbackFunc();
($type && $self->request_method = $type) or
(strpos($_SERVER['CONTENT_TYPE'], 'json') && $self->request_method = 'JSON') or
@ -1240,8 +1240,15 @@ class Context
return;
}
$xml = $GLOBALS['HTTP_RAW_POST_DATA'];
if(Security::detectingXEE($xml))
{
header("HTTP/1.0 400 Bad Request");
exit;
}
$oXml = new XmlParser();
$xml_obj = $oXml->parse();
$xml_obj = $oXml->parse($xml);
$params = $xml_obj->methodcall->params;
unset($params->node_name, $params->attrs, $params->body);
@ -1277,16 +1284,11 @@ class Context
return $stack;
}
$body = $this->_filterRequestVar($key, trim($val->body ? $val->body : ''), 0);
if($body)
{
return $body;
}
$body = $val->body;
unset($val->node_name, $val->attrs, $val->body);
if(!count(get_object_vars($val)))
{
return NULL;
return $this->_filterRequestVar($key, $body, 0);
}
$stack = new stdClass();
@ -1458,7 +1460,16 @@ class Context
function getJSCallbackFunc()
{
is_a($this, 'Context') ? $self = $this : $self = self::getInstance();
return $self->js_callback_func;
$js_callback_func = isset($_GET['xe_js_callback']) ? $_GET['xe_js_callback'] : $_POST['xe_js_callback'];
if(!preg_match('/^[a-z0-9\.]+$/i', $js_callback_func))
{
unset($js_callback_func);
unset($_GET['xe_js_callback']);
unset($_POST['xe_js_callback']);
}
return $js_callback_func;
}
/**
@ -1658,7 +1669,7 @@ class Context
}
elseif($_use_ssl == 'optional')
{
$ssl_mode = ($get_vars['act'] && $self->isExistsSSLAction($get_vars['act'])) ? ENFORCE_SSL : RELEASE_SSL;
$ssl_mode = (($self->get('module') === 'admin') || ($get_vars['module'] === 'admin') || (isset($get_vars['act']) && $self->isExistsSSLAction($get_vars['act']))) ? ENFORCE_SSL : RELEASE_SSL;
$query = $self->getRequestUri($ssl_mode, $domain) . $query;
// no SSL
}

View file

@ -432,7 +432,7 @@ class HTMLDisplayHandler
{
$oContext->loadFile(array('./modules/admin/tpl/css/admin.min.css', '', '', 10), true);
$oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true);
$oContext->loadFile(array("./modules/admin/tpl/css/admin.iefix.min.css", '', 'ie', 10), true);
$oContext->loadFile(array("./modules/admin/tpl/css/admin.iefix.css", '', 'ie', 10), true);
$oContext->loadFile('./modules/admin/tpl/js/admin.min.js', true);
$oContext->loadFile(array('./modules/admin/tpl/css/admin.bootstrap.min.css', '', '', 1), true);
$oContext->loadFile(array('./modules/admin/tpl/js/jquery.tmpl.js', '', '', 1), true);

View file

@ -14,8 +14,8 @@ class VirtualXMLDisplayHandler
$message = $oModule->getMessage();
$redirect_url = $oModule->get('redirect_url');
$request_uri = Context::get('xeRequestURI');
$request_url = Context::get('xeVirtualRequestUrl');
$output = new stdClass;
$request_url = Context::getRequestUri();
$output = new stdClass();
if(substr_compare($request_url, '/', -1) !== 0)
{

View file

@ -297,7 +297,7 @@ class ExtraItem
return ($value) ? sprintf('<a href="mailto:%s">%s</a>', $value, $value) : "";
case 'tel' :
return sprintf('%s - %s - %s', $value[0], $value[1], $value[2]);
return sprintf('%s-%s-%s', $value[0], $value[1], $value[2]);
case 'textarea' :
return nl2br($value);

View file

@ -635,18 +635,13 @@ class FileHandler
*/
function returnBytes($val)
{
$last = strtolower(substr(trim($val), -1));
switch ($last)
$unit = strtoupper(substr($val, -1));
$val = (int)$val;
switch ($unit)
{
case 'g':
$val *= 1024 * 1024 * 1024;
break;
case 'm':
$val *= 1024 * 1024;
break;
case 'k':
$val *= 1024;
break;
case 'G': $val *= 1024;
case 'M': $val *= 1024;
case 'K': $val *= 1024;
}
return $val;

View file

@ -175,6 +175,55 @@ class Security
return $var;
}
/**
* @brief check XML External Entity
*
* @see from drupal. https://github.com/drupal/drupal/commit/90e884ad0f7f2cf269d953f7d70966de9fd821ff
*
* @param string $xml
* @return bool
*/
static function detectingXEE($xml)
{
if(!$xml) return FALSE;
if(strpos($xml, '<!ENTITY') !== FALSE)
{
return TRUE;
}
// Strip XML declaration.
$header = preg_replace('/<\?xml.*?\?'.'>/s', '', substr($xml, 0, 100), 1);
$xml = trim(substr_replace($xml, $header, 0, 100));
if($xml == '')
{
return TRUE;
}
// Strip DTD.
$header = preg_replace('/^<!DOCTYPE[^>]*+>/i', '', substr($xml, 0, 200), 1);
$xml = trim(substr_replace($xml, $header, 0, 200));
if($xml == '')
{
return TRUE;
}
// Confirm the XML now starts with a valid root tag. A root tag can end in [> \t\r\n]
$root_tag = substr($xml, 0, strcspn(substr($xml, 0, 20), "> \t\r\n"));
// Reject a second DTD.
if(strtoupper($root_tag) == '<!DOCTYPE')
{
return TRUE;
}
if(!in_array($root_tag, array('<methodCall', '<methodResponse', '<fault')))
{
return TRUE;
}
return FALSE;
}
}
/* End of file : Security.class.php */
/* Location: ./classes/security/Security.class.php */

View file

@ -596,14 +596,36 @@ function doDocumentLoad(obj) {
}
/* 저장된 게시글의 선택 */
function doDocumentSelect(document_srl) {
function doDocumentSelect(document_srl, module) {
if(!opener || !opener.objForSavedDoc) {
window.close();
return;
}
if(module===undefined) {
module = 'document';
}
// 게시글을 가져와서 등록하기
opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite');
switch(module) {
case 'page' :
var url = opener.current_url;
url = url.setQuery('document_srl', document_srl);
if(url.getQuery('act') === 'dispPageAdminMobileContentModify')
{
url = url.setQuery('act', 'dispPageAdminMobileContentModify');
}
else
{
url = url.setQuery('act', 'dispPageAdminContentModify');
}
opener.location.href = url;
break;
default :
opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite');
break;
}
window.close();
}

3
common/js/x.min.js vendored

File diff suppressed because one or more lines are too long

1
common/js/x.min.map Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

9
common/js/xe.min.js vendored

File diff suppressed because one or more lines are too long

1
common/js/xe.min.map Normal file

File diff suppressed because one or more lines are too long

View file

@ -3950,7 +3950,7 @@
<value xml:lang="en"><![CDATA[License agree]]></value>
</item>
<item name="license">
<value xml:lang="ko"><![CDATA[<p>Copyright (C) NAVER &lt;http://www.navercorp.com&gt;</p> <p>"XpressEngine (XE)"은 자유 소프트웨어이며, 오픈 소스 프로젝트로 개발되고 있습니다. 자세한 내용은 아래 링크를 참조하시기 바랍니다.</p> <ul> <li>공식 사이트: <a href="http://www.xpressengine.com">http://www.xpressengine.com</a></li> <li>공식 저장소: <a href="http://github.com/xpressengine">http://github.com/xpressengine</a></li> </ul> <p>"XpressEngine (XE)"은 자유 소프트웨어입니다. 소프트웨어의 피양도자는 자유 소프트웨어 재단이 공표한 GNU 약소 일반 공중 사용 허가서 2.1판 또는 그 이후 판을 임의로 선택해서, 그 규정에 따라 소프트웨어를 개작하거나 재배포할 수 있습니다.</p> <p>이 소프트웨어는 유용하게 사용될 수 있으리라는 희망에서 배포되고 있지만, 특정한 목적에 맞는 적합성 여부나 판매용으로 사용할 수 있으리라는 묵시적인 보증을 포함한 어떠한 형태의 보증도 제공하지 않습니다. 보다 자세한 사항에 대해서는 GNU 약소 일반 공중 사용 허가서를 참고하시기 바랍니다.</p> <p>GNU 약소 일반 공중 사용 허가서는 이 라이브러리와 함께 제공됩니다. 만약, 이 문서가 누락되어 있다면 자유 소프트웨어 재단으로 문의하시기 바랍니다. (자유 소프트웨어 재단: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA)</p> <ul> <li>한국어 번역문 (비공식) : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> <li>영문 (공식 원본) : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> </ul>]]></value>
<value xml:lang="ko"><![CDATA[<p>Copyright (C) NAVER &lt;http://www.navercorp.com&gt;</p> <p>"XpressEngine (XE)"은 자유 소프트웨어이며, 오픈 소스 프로젝트로 개발되고 있습니다. 자세한 내용은 아래 링크를 참조하시기 바랍니다.</p> <ul> <li>공식 사이트: <a href="http://www.xpressengine.com">http://www.xpressengine.com</a></li> <li>공식 저장소: <a href="http://github.com/xpressengine">http://github.com/xpressengine</a></li> </ul> <p>"XpressEngine (XE)"은 자유 소프트웨어입니다. 소프트웨어의 피양도자는 자유 소프트웨어 재단이 공표한 GNU 약소 일반 공중 사용 허가서 2.1판 또는 그 이후 판을 임의로 선택해서, 그 규정에 따라 소프트웨어를 개작하거나 재배포할 수 있습니다.</p> <p>이 소프트웨어는 유용하게 사용될 수 있으리라는 희망에서 배포되고 있지만, 특정한 목적에 맞는 적합성 여부나 판매용으로 사용할 수 있으리라는 묵시적인 보증을 포함한 어떠한 형태의 보증도 제공하지 않습니다. 보다 자세한 사항에 대해서는 GNU 약소 일반 공중 사용 허가서를 참고하시기 바랍니다.</p> <p>GNU 약소 일반 공중 사용 허가서는 이 라이브러리와 함께 제공됩니다. 만약, 이 문서가 누락되어 있다면 자유 소프트웨어 재단으로 문의하시기 바랍니다. (자유 소프트웨어 재단: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA)</p> <ul> <li>한국어 번역문 (비공식) : <a href="http://korea.gnu.org/people/chsong/copyleft/lgpl.ko.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> <li>영문 (공식 원본) : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> </ul>]]></value>
<value xml:lang="en"><![CDATA[<p>Copyright (C) NAVER &lt;http://www.navercorp.com&gt;</p> <p>"XpressEngine (XE)" is an opensource and being developed in the opensource project. For more information, please see the link below.</p> <ul> <li>Official website: <a href="http://www.xpressengine.com">http://www.xpressengine.com</a></li> <li>Official Repository: <a href="http://github.com/xpressengine">http://github.com/xpressengine</a></li> </ul> <p>"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.</p> <p>This software 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.</p> <p>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</p> <ul> <li>License : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> </ul>]]></value>
</item>
<item name="cmd_license_agree">

View file

@ -29,7 +29,7 @@ define('__ZBXE__', __XE__);
/**
* Display XE's full version.
*/
define('__XE_VERSION__', '1.7.8');
define('__XE_VERSION__', '1.7.10');
define('__XE_VERSION_ALPHA__', (stripos(__XE_VERSION__, 'alpha') !== false));
define('__XE_VERSION_BETA__', (stripos(__XE_VERSION__, 'beta') !== false));
define('__XE_VERSION_RC__', (stripos(__XE_VERSION__, 'rc') !== false));

View file

@ -714,9 +714,43 @@ function zdate($str, $format = 'Y-m-d H:i:s', $conversion = TRUE)
}
}
$date = new DateTime($str);
$string = $date->format($format);
// If year value is less than 1970, handle it separately.
if((int) substr($str, 0, 4) < 1970)
{
$hour = (int) substr($str, 8, 2);
$min = (int) substr($str, 10, 2);
$sec = (int) substr($str, 12, 2);
$year = (int) substr($str, 0, 4);
$month = (int) substr($str, 4, 2);
$day = (int) substr($str, 6, 2);
// leading zero?
$lz = create_function('$n', 'return ($n>9?"":"0").$n;');
$trans = array(
'Y' => $year,
'y' => $lz($year % 100),
'm' => $lz($month),
'n' => $month,
'd' => $lz($day),
'j' => $day,
'G' => $hour,
'H' => $lz($hour),
'g' => $hour % 12,
'h' => $lz($hour % 12),
'i' => $lz($min),
's' => $lz($sec),
'M' => getMonthName($month),
'F' => getMonthName($month, FALSE)
);
$string = strtr($format, $trans);
}
else
{
// if year value is greater than 1970, get unixtime by using ztime() for date() function's argument.
$string = date($format, ztime($str));
}
// change day and am/pm for each language
$unit_week = Context::getLang('unit_week');
$unit_meridiem = Context::getLang('unit_meridiem');
@ -1067,8 +1101,22 @@ function removeHackTag($content)
*/
$content = preg_replace_callback('@<(/?)([a-z]+[0-9]?)((?>"[^"]*"|\'[^\']*\'|[^>])*?\b(?:on[a-z]+|data|style|background|href|(?:dyn|low)?src)\s*=[\s\S]*?)(/?)($|>|<)@i', 'removeSrcHack', $content);
// xmp tag ?뺤씤 <20>??<3F>붽?
$content = checkXmpTag($content);
$content = blockWidgetCode($content);
return $content;
}
/**
* blocking widget code
*
* @param string $content Taget content
* @return string
**/
function blockWidgetCode($content)
{
$content = preg_replace('/(<(?:img|div)(?:[^>]*))(widget)(?:(=([^>]*?)>))/is', '$1blocked-widget$3', $content);
return $content;
}
@ -1505,7 +1553,7 @@ function requirePear()
}
else
{
set_include_path(_XE_PATH_ . "libs/PEAR.1.9");
set_include_path(_XE_PATH_ . "libs/PEAR.1.9.5");
}
}

View file

@ -0,0 +1,55 @@
<?php
require_once 'HTTP/Request2.php';
class HTTP_Request extends HTTP_Request2
{
private $reponse = null;
public function addHeader($name, $value)
{
$this->setHeader($name, $value);
}
public function sendRequest($saveBody = true)
{
$response = $this->send();
$this->response = $response;
return $response;
}
public function getResponseCode() {
if($this->response)
{
return $this->response->getStatus();
}
}
public function getResponseHeader() {
if($this->response)
{
return $this->response->getHeader();
}
}
public function getResponseBody() {
if($this->response)
{
return $this->response->getBody();
}
}
public function getResponseCookies() {
if($this->response)
{
return $this->response->getCookies();
}
}
public function addPostData($name, $value, $preencoded = false)
{
$this->addPostParameter($name, $value);
}
}
?>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,137 @@
<?php
/**
* Base class for HTTP_Request2 adapters
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Class representing a HTTP response
*/
require_once 'HTTP/Request2/Response.php';
/**
* Base class for HTTP_Request2 adapters
*
* HTTP_Request2 class itself only defines methods for aggregating the request
* data, all actual work of sending the request to the remote server and
* receiving its response is performed by adapters.
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
abstract class HTTP_Request2_Adapter
{
/**
* A list of methods that MUST NOT have a request body, per RFC 2616
* @var array
*/
protected static $bodyDisallowed = array('TRACE');
/**
* Methods having defined semantics for request body
*
* Content-Length header (indicating that the body follows, section 4.3 of
* RFC 2616) will be sent for these methods even if no body was added
*
* @var array
* @link http://pear.php.net/bugs/bug.php?id=12900
* @link http://pear.php.net/bugs/bug.php?id=14740
*/
protected static $bodyRequired = array('POST', 'PUT');
/**
* Request being sent
* @var HTTP_Request2
*/
protected $request;
/**
* Request body
* @var string|resource|HTTP_Request2_MultipartBody
* @see HTTP_Request2::getBody()
*/
protected $requestBody;
/**
* Length of the request body
* @var integer
*/
protected $contentLength;
/**
* Sends request to the remote server and returns its response
*
* @param HTTP_Request2 $request HTTP request message
*
* @return HTTP_Request2_Response
* @throws HTTP_Request2_Exception
*/
abstract public function sendRequest(HTTP_Request2 $request);
/**
* Calculates length of the request body, adds proper headers
*
* @param array &$headers associative array of request headers, this method
* will add proper 'Content-Length' and 'Content-Type'
* headers to this array (or remove them if not needed)
*/
protected function calculateRequestLength(&$headers)
{
$this->requestBody = $this->request->getBody();
if (is_string($this->requestBody)) {
$this->contentLength = strlen($this->requestBody);
} elseif (is_resource($this->requestBody)) {
$stat = fstat($this->requestBody);
$this->contentLength = $stat['size'];
rewind($this->requestBody);
} else {
$this->contentLength = $this->requestBody->getLength();
$headers['content-type'] = 'multipart/form-data; boundary=' .
$this->requestBody->getBoundary();
$this->requestBody->rewind();
}
if (in_array($this->request->getMethod(), self::$bodyDisallowed)
|| 0 == $this->contentLength
) {
// No body: send a Content-Length header nonetheless (request #12900),
// but do that only for methods that require a body (bug #14740)
if (in_array($this->request->getMethod(), self::$bodyRequired)) {
$headers['content-length'] = 0;
} else {
unset($headers['content-length']);
// if the method doesn't require a body and doesn't have a
// body, don't send a Content-Type header. (request #16799)
unset($headers['content-type']);
}
} else {
if (empty($headers['content-type'])) {
$headers['content-type'] = 'application/x-www-form-urlencoded';
}
// Content-Length should not be sent for chunked Transfer-Encoding (bug #20125)
if (!isset($headers['transfer-encoding'])) {
$headers['content-length'] = $this->contentLength;
}
}
}
}
?>

View file

@ -0,0 +1,567 @@
<?php
/**
* Adapter for HTTP_Request2 wrapping around cURL extension
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Base class for HTTP_Request2 adapters
*/
require_once 'HTTP/Request2/Adapter.php';
/**
* Adapter for HTTP_Request2 wrapping around cURL extension
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_Adapter_Curl extends HTTP_Request2_Adapter
{
/**
* Mapping of header names to cURL options
* @var array
*/
protected static $headerMap = array(
'accept-encoding' => CURLOPT_ENCODING,
'cookie' => CURLOPT_COOKIE,
'referer' => CURLOPT_REFERER,
'user-agent' => CURLOPT_USERAGENT
);
/**
* Mapping of SSL context options to cURL options
* @var array
*/
protected static $sslContextMap = array(
'ssl_verify_peer' => CURLOPT_SSL_VERIFYPEER,
'ssl_cafile' => CURLOPT_CAINFO,
'ssl_capath' => CURLOPT_CAPATH,
'ssl_local_cert' => CURLOPT_SSLCERT,
'ssl_passphrase' => CURLOPT_SSLCERTPASSWD
);
/**
* Mapping of CURLE_* constants to Exception subclasses and error codes
* @var array
*/
protected static $errorMap = array(
CURLE_UNSUPPORTED_PROTOCOL => array('HTTP_Request2_MessageException',
HTTP_Request2_Exception::NON_HTTP_REDIRECT),
CURLE_COULDNT_RESOLVE_PROXY => array('HTTP_Request2_ConnectionException'),
CURLE_COULDNT_RESOLVE_HOST => array('HTTP_Request2_ConnectionException'),
CURLE_COULDNT_CONNECT => array('HTTP_Request2_ConnectionException'),
// error returned from write callback
CURLE_WRITE_ERROR => array('HTTP_Request2_MessageException',
HTTP_Request2_Exception::NON_HTTP_REDIRECT),
CURLE_OPERATION_TIMEOUTED => array('HTTP_Request2_MessageException',
HTTP_Request2_Exception::TIMEOUT),
CURLE_HTTP_RANGE_ERROR => array('HTTP_Request2_MessageException'),
CURLE_SSL_CONNECT_ERROR => array('HTTP_Request2_ConnectionException'),
CURLE_LIBRARY_NOT_FOUND => array('HTTP_Request2_LogicException',
HTTP_Request2_Exception::MISCONFIGURATION),
CURLE_FUNCTION_NOT_FOUND => array('HTTP_Request2_LogicException',
HTTP_Request2_Exception::MISCONFIGURATION),
CURLE_ABORTED_BY_CALLBACK => array('HTTP_Request2_MessageException',
HTTP_Request2_Exception::NON_HTTP_REDIRECT),
CURLE_TOO_MANY_REDIRECTS => array('HTTP_Request2_MessageException',
HTTP_Request2_Exception::TOO_MANY_REDIRECTS),
CURLE_SSL_PEER_CERTIFICATE => array('HTTP_Request2_ConnectionException'),
CURLE_GOT_NOTHING => array('HTTP_Request2_MessageException'),
CURLE_SSL_ENGINE_NOTFOUND => array('HTTP_Request2_LogicException',
HTTP_Request2_Exception::MISCONFIGURATION),
CURLE_SSL_ENGINE_SETFAILED => array('HTTP_Request2_LogicException',
HTTP_Request2_Exception::MISCONFIGURATION),
CURLE_SEND_ERROR => array('HTTP_Request2_MessageException'),
CURLE_RECV_ERROR => array('HTTP_Request2_MessageException'),
CURLE_SSL_CERTPROBLEM => array('HTTP_Request2_LogicException',
HTTP_Request2_Exception::INVALID_ARGUMENT),
CURLE_SSL_CIPHER => array('HTTP_Request2_ConnectionException'),
CURLE_SSL_CACERT => array('HTTP_Request2_ConnectionException'),
CURLE_BAD_CONTENT_ENCODING => array('HTTP_Request2_MessageException'),
);
/**
* Response being received
* @var HTTP_Request2_Response
*/
protected $response;
/**
* Whether 'sentHeaders' event was sent to observers
* @var boolean
*/
protected $eventSentHeaders = false;
/**
* Whether 'receivedHeaders' event was sent to observers
* @var boolean
*/
protected $eventReceivedHeaders = false;
/**
* Position within request body
* @var integer
* @see callbackReadBody()
*/
protected $position = 0;
/**
* Information about last transfer, as returned by curl_getinfo()
* @var array
*/
protected $lastInfo;
/**
* Creates a subclass of HTTP_Request2_Exception from curl error data
*
* @param resource $ch curl handle
*
* @return HTTP_Request2_Exception
*/
protected static function wrapCurlError($ch)
{
$nativeCode = curl_errno($ch);
$message = 'Curl error: ' . curl_error($ch);
if (!isset(self::$errorMap[$nativeCode])) {
return new HTTP_Request2_Exception($message, 0, $nativeCode);
} else {
$class = self::$errorMap[$nativeCode][0];
$code = empty(self::$errorMap[$nativeCode][1])
? 0 : self::$errorMap[$nativeCode][1];
return new $class($message, $code, $nativeCode);
}
}
/**
* Sends request to the remote server and returns its response
*
* @param HTTP_Request2 $request HTTP request message
*
* @return HTTP_Request2_Response
* @throws HTTP_Request2_Exception
*/
public function sendRequest(HTTP_Request2 $request)
{
if (!extension_loaded('curl')) {
throw new HTTP_Request2_LogicException(
'cURL extension not available', HTTP_Request2_Exception::MISCONFIGURATION
);
}
$this->request = $request;
$this->response = null;
$this->position = 0;
$this->eventSentHeaders = false;
$this->eventReceivedHeaders = false;
try {
if (false === curl_exec($ch = $this->createCurlHandle())) {
$e = self::wrapCurlError($ch);
}
} catch (Exception $e) {
}
if (isset($ch)) {
$this->lastInfo = curl_getinfo($ch);
curl_close($ch);
}
$response = $this->response;
unset($this->request, $this->requestBody, $this->response);
if (!empty($e)) {
throw $e;
}
if ($jar = $request->getCookieJar()) {
$jar->addCookiesFromResponse($response, $request->getUrl());
}
if (0 < $this->lastInfo['size_download']) {
$request->setLastEvent('receivedBody', $response);
}
return $response;
}
/**
* Returns information about last transfer
*
* @return array associative array as returned by curl_getinfo()
*/
public function getInfo()
{
return $this->lastInfo;
}
/**
* Creates a new cURL handle and populates it with data from the request
*
* @return resource a cURL handle, as created by curl_init()
* @throws HTTP_Request2_LogicException
* @throws HTTP_Request2_NotImplementedException
*/
protected function createCurlHandle()
{
$ch = curl_init();
curl_setopt_array($ch, array(
// setup write callbacks
CURLOPT_HEADERFUNCTION => array($this, 'callbackWriteHeader'),
CURLOPT_WRITEFUNCTION => array($this, 'callbackWriteBody'),
// buffer size
CURLOPT_BUFFERSIZE => $this->request->getConfig('buffer_size'),
// connection timeout
CURLOPT_CONNECTTIMEOUT => $this->request->getConfig('connect_timeout'),
// save full outgoing headers, in case someone is interested
CURLINFO_HEADER_OUT => true,
// request url
CURLOPT_URL => $this->request->getUrl()->getUrl()
));
// set up redirects
if (!$this->request->getConfig('follow_redirects')) {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
} else {
if (!@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true)) {
throw new HTTP_Request2_LogicException(
'Redirect support in curl is unavailable due to open_basedir or safe_mode setting',
HTTP_Request2_Exception::MISCONFIGURATION
);
}
curl_setopt($ch, CURLOPT_MAXREDIRS, $this->request->getConfig('max_redirects'));
// limit redirects to http(s), works in 5.2.10+
if (defined('CURLOPT_REDIR_PROTOCOLS')) {
curl_setopt($ch, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
}
// works in 5.3.2+, http://bugs.php.net/bug.php?id=49571
if ($this->request->getConfig('strict_redirects') && defined('CURLOPT_POSTREDIR')) {
curl_setopt($ch, CURLOPT_POSTREDIR, 3);
}
}
// set local IP via CURLOPT_INTERFACE (request #19515)
if ($ip = $this->request->getConfig('local_ip')) {
curl_setopt($ch, CURLOPT_INTERFACE, $ip);
}
// request timeout
if ($timeout = $this->request->getConfig('timeout')) {
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
}
// set HTTP version
switch ($this->request->getConfig('protocol_version')) {
case '1.0':
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
break;
case '1.1':
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
}
// set request method
switch ($this->request->getMethod()) {
case HTTP_Request2::METHOD_GET:
curl_setopt($ch, CURLOPT_HTTPGET, true);
break;
case HTTP_Request2::METHOD_POST:
curl_setopt($ch, CURLOPT_POST, true);
break;
case HTTP_Request2::METHOD_HEAD:
curl_setopt($ch, CURLOPT_NOBODY, true);
break;
case HTTP_Request2::METHOD_PUT:
curl_setopt($ch, CURLOPT_UPLOAD, true);
break;
default:
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->request->getMethod());
}
// set proxy, if needed
if ($host = $this->request->getConfig('proxy_host')) {
if (!($port = $this->request->getConfig('proxy_port'))) {
throw new HTTP_Request2_LogicException(
'Proxy port not provided', HTTP_Request2_Exception::MISSING_VALUE
);
}
curl_setopt($ch, CURLOPT_PROXY, $host . ':' . $port);
if ($user = $this->request->getConfig('proxy_user')) {
curl_setopt(
$ch, CURLOPT_PROXYUSERPWD,
$user . ':' . $this->request->getConfig('proxy_password')
);
switch ($this->request->getConfig('proxy_auth_scheme')) {
case HTTP_Request2::AUTH_BASIC:
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
break;
case HTTP_Request2::AUTH_DIGEST:
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_DIGEST);
}
}
if ($type = $this->request->getConfig('proxy_type')) {
switch ($type) {
case 'http':
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
break;
case 'socks5':
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
break;
default:
throw new HTTP_Request2_NotImplementedException(
"Proxy type '{$type}' is not supported"
);
}
}
}
// set authentication data
if ($auth = $this->request->getAuth()) {
curl_setopt($ch, CURLOPT_USERPWD, $auth['user'] . ':' . $auth['password']);
switch ($auth['scheme']) {
case HTTP_Request2::AUTH_BASIC:
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
break;
case HTTP_Request2::AUTH_DIGEST:
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
}
}
// set SSL options
foreach ($this->request->getConfig() as $name => $value) {
if ('ssl_verify_host' == $name && null !== $value) {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $value? 2: 0);
} elseif (isset(self::$sslContextMap[$name]) && null !== $value) {
curl_setopt($ch, self::$sslContextMap[$name], $value);
}
}
$headers = $this->request->getHeaders();
// make cURL automagically send proper header
if (!isset($headers['accept-encoding'])) {
$headers['accept-encoding'] = '';
}
if (($jar = $this->request->getCookieJar())
&& ($cookies = $jar->getMatching($this->request->getUrl(), true))
) {
$headers['cookie'] = (empty($headers['cookie'])? '': $headers['cookie'] . '; ') . $cookies;
}
// set headers having special cURL keys
foreach (self::$headerMap as $name => $option) {
if (isset($headers[$name])) {
curl_setopt($ch, $option, $headers[$name]);
unset($headers[$name]);
}
}
$this->calculateRequestLength($headers);
if (isset($headers['content-length']) || isset($headers['transfer-encoding'])) {
$this->workaroundPhpBug47204($ch, $headers);
}
// set headers not having special keys
$headersFmt = array();
foreach ($headers as $name => $value) {
$canonicalName = implode('-', array_map('ucfirst', explode('-', $name)));
$headersFmt[] = $canonicalName . ': ' . $value;
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $headersFmt);
return $ch;
}
/**
* Workaround for PHP bug #47204 that prevents rewinding request body
*
* The workaround consists of reading the entire request body into memory
* and setting it as CURLOPT_POSTFIELDS, so it isn't recommended for large
* file uploads, use Socket adapter instead.
*
* @param resource $ch cURL handle
* @param array &$headers Request headers
*/
protected function workaroundPhpBug47204($ch, &$headers)
{
// no redirects, no digest auth -> probably no rewind needed
if (!$this->request->getConfig('follow_redirects')
&& (!($auth = $this->request->getAuth())
|| HTTP_Request2::AUTH_DIGEST != $auth['scheme'])
) {
curl_setopt($ch, CURLOPT_READFUNCTION, array($this, 'callbackReadBody'));
} else {
// rewind may be needed, read the whole body into memory
if ($this->requestBody instanceof HTTP_Request2_MultipartBody) {
$this->requestBody = $this->requestBody->__toString();
} elseif (is_resource($this->requestBody)) {
$fp = $this->requestBody;
$this->requestBody = '';
while (!feof($fp)) {
$this->requestBody .= fread($fp, 16384);
}
}
// curl hangs up if content-length is present
unset($headers['content-length']);
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->requestBody);
}
}
/**
* Callback function called by cURL for reading the request body
*
* @param resource $ch cURL handle
* @param resource $fd file descriptor (not used)
* @param integer $length maximum length of data to return
*
* @return string part of the request body, up to $length bytes
*/
protected function callbackReadBody($ch, $fd, $length)
{
if (!$this->eventSentHeaders) {
$this->request->setLastEvent(
'sentHeaders', curl_getinfo($ch, CURLINFO_HEADER_OUT)
);
$this->eventSentHeaders = true;
}
if (in_array($this->request->getMethod(), self::$bodyDisallowed)
|| 0 == $this->contentLength || $this->position >= $this->contentLength
) {
return '';
}
if (is_string($this->requestBody)) {
$string = substr($this->requestBody, $this->position, $length);
} elseif (is_resource($this->requestBody)) {
$string = fread($this->requestBody, $length);
} else {
$string = $this->requestBody->read($length);
}
$this->request->setLastEvent('sentBodyPart', strlen($string));
$this->position += strlen($string);
return $string;
}
/**
* Callback function called by cURL for saving the response headers
*
* @param resource $ch cURL handle
* @param string $string response header (with trailing CRLF)
*
* @return integer number of bytes saved
* @see HTTP_Request2_Response::parseHeaderLine()
*/
protected function callbackWriteHeader($ch, $string)
{
// we may receive a second set of headers if doing e.g. digest auth
if ($this->eventReceivedHeaders || !$this->eventSentHeaders) {
// don't bother with 100-Continue responses (bug #15785)
if (!$this->eventSentHeaders
|| $this->response->getStatus() >= 200
) {
$this->request->setLastEvent(
'sentHeaders', curl_getinfo($ch, CURLINFO_HEADER_OUT)
);
}
$upload = curl_getinfo($ch, CURLINFO_SIZE_UPLOAD);
// if body wasn't read by a callback, send event with total body size
if ($upload > $this->position) {
$this->request->setLastEvent(
'sentBodyPart', $upload - $this->position
);
$this->position = $upload;
}
if ($upload && (!$this->eventSentHeaders
|| $this->response->getStatus() >= 200)
) {
$this->request->setLastEvent('sentBody', $upload);
}
$this->eventSentHeaders = true;
// we'll need a new response object
if ($this->eventReceivedHeaders) {
$this->eventReceivedHeaders = false;
$this->response = null;
}
}
if (empty($this->response)) {
$this->response = new HTTP_Request2_Response(
$string, false, curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)
);
} else {
$this->response->parseHeaderLine($string);
if ('' == trim($string)) {
// don't bother with 100-Continue responses (bug #15785)
if (200 <= $this->response->getStatus()) {
$this->request->setLastEvent('receivedHeaders', $this->response);
}
if ($this->request->getConfig('follow_redirects') && $this->response->isRedirect()) {
$redirectUrl = new Net_URL2($this->response->getHeader('location'));
// for versions lower than 5.2.10, check the redirection URL protocol
if (!defined('CURLOPT_REDIR_PROTOCOLS') && $redirectUrl->isAbsolute()
&& !in_array($redirectUrl->getScheme(), array('http', 'https'))
) {
return -1;
}
if ($jar = $this->request->getCookieJar()) {
$jar->addCookiesFromResponse($this->response, $this->request->getUrl());
if (!$redirectUrl->isAbsolute()) {
$redirectUrl = $this->request->getUrl()->resolve($redirectUrl);
}
if ($cookies = $jar->getMatching($redirectUrl, true)) {
curl_setopt($ch, CURLOPT_COOKIE, $cookies);
}
}
}
$this->eventReceivedHeaders = true;
}
}
return strlen($string);
}
/**
* Callback function called by cURL for saving the response body
*
* @param resource $ch cURL handle (not used)
* @param string $string part of the response body
*
* @return integer number of bytes saved
* @throws HTTP_Request2_MessageException
* @see HTTP_Request2_Response::appendBody()
*/
protected function callbackWriteBody($ch, $string)
{
// cURL calls WRITEFUNCTION callback without calling HEADERFUNCTION if
// response doesn't start with proper HTTP status line (see bug #15716)
if (empty($this->response)) {
throw new HTTP_Request2_MessageException(
"Malformed response: {$string}",
HTTP_Request2_Exception::MALFORMED_RESPONSE
);
}
if ($this->request->getConfig('store_body')) {
$this->response->appendBody($string);
}
$this->request->setLastEvent('receivedBodyPart', $string);
return strlen($string);
}
}
?>

View file

@ -0,0 +1,166 @@
<?php
/**
* Mock adapter intended for testing
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Base class for HTTP_Request2 adapters
*/
require_once 'HTTP/Request2/Adapter.php';
/**
* Mock adapter intended for testing
*
* Can be used to test applications depending on HTTP_Request2 package without
* actually performing any HTTP requests. This adapter will return responses
* previously added via addResponse()
* <code>
* $mock = new HTTP_Request2_Adapter_Mock();
* $mock->addResponse("HTTP/1.1 ... ");
*
* $request = new HTTP_Request2();
* $request->setAdapter($mock);
*
* // This will return the response set above
* $response = $req->send();
* </code>
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_Adapter_Mock extends HTTP_Request2_Adapter
{
/**
* A queue of responses to be returned by sendRequest()
* @var array
*/
protected $responses = array();
/**
* Returns the next response from the queue built by addResponse()
*
* Only responses without explicit URLs or with URLs equal to request URL
* will be considered. If matching response is not found or the queue is
* empty then default empty response with status 400 will be returned,
* if an Exception object was added to the queue it will be thrown.
*
* @param HTTP_Request2 $request HTTP request message
*
* @return HTTP_Request2_Response
* @throws Exception
*/
public function sendRequest(HTTP_Request2 $request)
{
$requestUrl = (string)$request->getUrl();
$response = null;
foreach ($this->responses as $k => $v) {
if (!$v[1] || $requestUrl == $v[1]) {
$response = $v[0];
array_splice($this->responses, $k, 1);
break;
}
}
if (!$response) {
return self::createResponseFromString("HTTP/1.1 400 Bad Request\r\n\r\n");
} elseif ($response instanceof HTTP_Request2_Response) {
return $response;
} else {
// rethrow the exception
$class = get_class($response);
$message = $response->getMessage();
$code = $response->getCode();
throw new $class($message, $code);
}
}
/**
* Adds response to the queue
*
* @param mixed $response either a string, a pointer to an open file,
* an instance of HTTP_Request2_Response or Exception
* @param string $url A request URL this response should be valid for
* (see {@link http://pear.php.net/bugs/bug.php?id=19276})
*
* @throws HTTP_Request2_Exception
*/
public function addResponse($response, $url = null)
{
if (is_string($response)) {
$response = self::createResponseFromString($response);
} elseif (is_resource($response)) {
$response = self::createResponseFromFile($response);
} elseif (!$response instanceof HTTP_Request2_Response &&
!$response instanceof Exception
) {
throw new HTTP_Request2_Exception('Parameter is not a valid response');
}
$this->responses[] = array($response, $url);
}
/**
* Creates a new HTTP_Request2_Response object from a string
*
* @param string $str string containing HTTP response message
*
* @return HTTP_Request2_Response
* @throws HTTP_Request2_Exception
*/
public static function createResponseFromString($str)
{
$parts = preg_split('!(\r?\n){2}!m', $str, 2);
$headerLines = explode("\n", $parts[0]);
$response = new HTTP_Request2_Response(array_shift($headerLines));
foreach ($headerLines as $headerLine) {
$response->parseHeaderLine($headerLine);
}
$response->parseHeaderLine('');
if (isset($parts[1])) {
$response->appendBody($parts[1]);
}
return $response;
}
/**
* Creates a new HTTP_Request2_Response object from a file
*
* @param resource $fp file pointer returned by fopen()
*
* @return HTTP_Request2_Response
* @throws HTTP_Request2_Exception
*/
public static function createResponseFromFile($fp)
{
$response = new HTTP_Request2_Response(fgets($fp));
do {
$headerLine = fgets($fp);
$response->parseHeaderLine($headerLine);
} while ('' != trim($headerLine));
while (!feof($fp)) {
$response->appendBody(fread($fp, 8192));
}
return $response;
}
}
?>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,494 @@
<?php
/**
* Stores cookies and passes them between HTTP requests
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/** Class representing a HTTP request message */
require_once 'HTTP/Request2.php';
/**
* Stores cookies and passes them between HTTP requests
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: @package_version@
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_CookieJar implements Serializable
{
/**
* Array of stored cookies
*
* The array is indexed by domain, path and cookie name
* .example.com
* /
* some_cookie => cookie data
* /subdir
* other_cookie => cookie data
* .example.org
* ...
*
* @var array
*/
protected $cookies = array();
/**
* Whether session cookies should be serialized when serializing the jar
* @var bool
*/
protected $serializeSession = false;
/**
* Whether Public Suffix List should be used for domain matching
* @var bool
*/
protected $useList = true;
/**
* Array with Public Suffix List data
* @var array
* @link http://publicsuffix.org/
*/
protected static $psl = array();
/**
* Class constructor, sets various options
*
* @param bool $serializeSessionCookies Controls serializing session cookies,
* see {@link serializeSessionCookies()}
* @param bool $usePublicSuffixList Controls using Public Suffix List,
* see {@link usePublicSuffixList()}
*/
public function __construct(
$serializeSessionCookies = false, $usePublicSuffixList = true
) {
$this->serializeSessionCookies($serializeSessionCookies);
$this->usePublicSuffixList($usePublicSuffixList);
}
/**
* Returns current time formatted in ISO-8601 at UTC timezone
*
* @return string
*/
protected function now()
{
$dt = new DateTime();
$dt->setTimezone(new DateTimeZone('UTC'));
return $dt->format(DateTime::ISO8601);
}
/**
* Checks cookie array for correctness, possibly updating its 'domain', 'path' and 'expires' fields
*
* The checks are as follows:
* - cookie array should contain 'name' and 'value' fields;
* - name and value should not contain disallowed symbols;
* - 'expires' should be either empty parseable by DateTime;
* - 'domain' and 'path' should be either not empty or an URL where
* cookie was set should be provided.
* - if $setter is provided, then document at that URL should be allowed
* to set a cookie for that 'domain'. If $setter is not provided,
* then no domain checks will be made.
*
* 'expires' field will be converted to ISO8601 format from COOKIE format,
* 'domain' and 'path' will be set from setter URL if empty.
*
* @param array $cookie cookie data, as returned by
* {@link HTTP_Request2_Response::getCookies()}
* @param Net_URL2 $setter URL of the document that sent Set-Cookie header
*
* @return array Updated cookie array
* @throws HTTP_Request2_LogicException
* @throws HTTP_Request2_MessageException
*/
protected function checkAndUpdateFields(array $cookie, Net_URL2 $setter = null)
{
if ($missing = array_diff(array('name', 'value'), array_keys($cookie))) {
throw new HTTP_Request2_LogicException(
"Cookie array should contain 'name' and 'value' fields",
HTTP_Request2_Exception::MISSING_VALUE
);
}
if (preg_match(HTTP_Request2::REGEXP_INVALID_COOKIE, $cookie['name'])) {
throw new HTTP_Request2_LogicException(
"Invalid cookie name: '{$cookie['name']}'",
HTTP_Request2_Exception::INVALID_ARGUMENT
);
}
if (preg_match(HTTP_Request2::REGEXP_INVALID_COOKIE, $cookie['value'])) {
throw new HTTP_Request2_LogicException(
"Invalid cookie value: '{$cookie['value']}'",
HTTP_Request2_Exception::INVALID_ARGUMENT
);
}
$cookie += array('domain' => '', 'path' => '', 'expires' => null, 'secure' => false);
// Need ISO-8601 date @ UTC timezone
if (!empty($cookie['expires'])
&& !preg_match('/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+0000$/', $cookie['expires'])
) {
try {
$dt = new DateTime($cookie['expires']);
$dt->setTimezone(new DateTimeZone('UTC'));
$cookie['expires'] = $dt->format(DateTime::ISO8601);
} catch (Exception $e) {
throw new HTTP_Request2_LogicException($e->getMessage());
}
}
if (empty($cookie['domain']) || empty($cookie['path'])) {
if (!$setter) {
throw new HTTP_Request2_LogicException(
'Cookie misses domain and/or path component, cookie setter URL needed',
HTTP_Request2_Exception::MISSING_VALUE
);
}
if (empty($cookie['domain'])) {
if ($host = $setter->getHost()) {
$cookie['domain'] = $host;
} else {
throw new HTTP_Request2_LogicException(
'Setter URL does not contain host part, can\'t set cookie domain',
HTTP_Request2_Exception::MISSING_VALUE
);
}
}
if (empty($cookie['path'])) {
$path = $setter->getPath();
$cookie['path'] = empty($path)? '/': substr($path, 0, strrpos($path, '/') + 1);
}
}
if ($setter && !$this->domainMatch($setter->getHost(), $cookie['domain'])) {
throw new HTTP_Request2_MessageException(
"Domain " . $setter->getHost() . " cannot set cookies for "
. $cookie['domain']
);
}
return $cookie;
}
/**
* Stores a cookie in the jar
*
* @param array $cookie cookie data, as returned by
* {@link HTTP_Request2_Response::getCookies()}
* @param Net_URL2 $setter URL of the document that sent Set-Cookie header
*
* @throws HTTP_Request2_Exception
*/
public function store(array $cookie, Net_URL2 $setter = null)
{
$cookie = $this->checkAndUpdateFields($cookie, $setter);
if (strlen($cookie['value'])
&& (is_null($cookie['expires']) || $cookie['expires'] > $this->now())
) {
if (!isset($this->cookies[$cookie['domain']])) {
$this->cookies[$cookie['domain']] = array();
}
if (!isset($this->cookies[$cookie['domain']][$cookie['path']])) {
$this->cookies[$cookie['domain']][$cookie['path']] = array();
}
$this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']] = $cookie;
} elseif (isset($this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']])) {
unset($this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']]);
}
}
/**
* Adds cookies set in HTTP response to the jar
*
* @param HTTP_Request2_Response $response HTTP response message
* @param Net_URL2 $setter original request URL, needed for
* setting default domain/path
*/
public function addCookiesFromResponse(HTTP_Request2_Response $response, Net_URL2 $setter)
{
foreach ($response->getCookies() as $cookie) {
$this->store($cookie, $setter);
}
}
/**
* Returns all cookies matching a given request URL
*
* The following checks are made:
* - cookie domain should match request host
* - cookie path should be a prefix for request path
* - 'secure' cookies will only be sent for HTTPS requests
*
* @param Net_URL2 $url Request url
* @param bool $asString Whether to return cookies as string for "Cookie: " header
*
* @return array|string Matching cookies
*/
public function getMatching(Net_URL2 $url, $asString = false)
{
$host = $url->getHost();
$path = $url->getPath();
$secure = 0 == strcasecmp($url->getScheme(), 'https');
$matched = $ret = array();
foreach (array_keys($this->cookies) as $domain) {
if ($this->domainMatch($host, $domain)) {
foreach (array_keys($this->cookies[$domain]) as $cPath) {
if (0 === strpos($path, $cPath)) {
foreach ($this->cookies[$domain][$cPath] as $name => $cookie) {
if (!$cookie['secure'] || $secure) {
$matched[$name][strlen($cookie['path'])] = $cookie;
}
}
}
}
}
}
foreach ($matched as $cookies) {
krsort($cookies);
$ret = array_merge($ret, $cookies);
}
if (!$asString) {
return $ret;
} else {
$str = '';
foreach ($ret as $c) {
$str .= (empty($str)? '': '; ') . $c['name'] . '=' . $c['value'];
}
return $str;
}
}
/**
* Returns all cookies stored in a jar
*
* @return array
*/
public function getAll()
{
$cookies = array();
foreach (array_keys($this->cookies) as $domain) {
foreach (array_keys($this->cookies[$domain]) as $path) {
foreach ($this->cookies[$domain][$path] as $name => $cookie) {
$cookies[] = $cookie;
}
}
}
return $cookies;
}
/**
* Sets whether session cookies should be serialized when serializing the jar
*
* @param boolean $serialize serialize?
*/
public function serializeSessionCookies($serialize)
{
$this->serializeSession = (bool)$serialize;
}
/**
* Sets whether Public Suffix List should be used for restricting cookie-setting
*
* Without PSL {@link domainMatch()} will only prevent setting cookies for
* top-level domains like '.com' or '.org'. However, it will not prevent
* setting a cookie for '.co.uk' even though only third-level registrations
* are possible in .uk domain.
*
* With the List it is possible to find the highest level at which a domain
* may be registered for a particular top-level domain and consequently
* prevent cookies set for '.co.uk' or '.msk.ru'. The same list is used by
* Firefox, Chrome and Opera browsers to restrict cookie setting.
*
* Note that PSL is licensed differently to HTTP_Request2 package (refer to
* the license information in public-suffix-list.php), so you can disable
* its use if this is an issue for you.
*
* @param boolean $useList use the list?
*
* @link http://publicsuffix.org/learn/
*/
public function usePublicSuffixList($useList)
{
$this->useList = (bool)$useList;
}
/**
* Returns string representation of object
*
* @return string
*
* @see Serializable::serialize()
*/
public function serialize()
{
$cookies = $this->getAll();
if (!$this->serializeSession) {
for ($i = count($cookies) - 1; $i >= 0; $i--) {
if (empty($cookies[$i]['expires'])) {
unset($cookies[$i]);
}
}
}
return serialize(array(
'cookies' => $cookies,
'serializeSession' => $this->serializeSession,
'useList' => $this->useList
));
}
/**
* Constructs the object from serialized string
*
* @param string $serialized string representation
*
* @see Serializable::unserialize()
*/
public function unserialize($serialized)
{
$data = unserialize($serialized);
$now = $this->now();
$this->serializeSessionCookies($data['serializeSession']);
$this->usePublicSuffixList($data['useList']);
foreach ($data['cookies'] as $cookie) {
if (!empty($cookie['expires']) && $cookie['expires'] <= $now) {
continue;
}
if (!isset($this->cookies[$cookie['domain']])) {
$this->cookies[$cookie['domain']] = array();
}
if (!isset($this->cookies[$cookie['domain']][$cookie['path']])) {
$this->cookies[$cookie['domain']][$cookie['path']] = array();
}
$this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']] = $cookie;
}
}
/**
* Checks whether a cookie domain matches a request host.
*
* The method is used by {@link store()} to check for whether a document
* at given URL can set a cookie with a given domain attribute and by
* {@link getMatching()} to find cookies matching the request URL.
*
* @param string $requestHost request host
* @param string $cookieDomain cookie domain
*
* @return bool match success
*/
public function domainMatch($requestHost, $cookieDomain)
{
if ($requestHost == $cookieDomain) {
return true;
}
// IP address, we require exact match
if (preg_match('/^(?:\d{1,3}\.){3}\d{1,3}$/', $requestHost)) {
return false;
}
if ('.' != $cookieDomain[0]) {
$cookieDomain = '.' . $cookieDomain;
}
// prevents setting cookies for '.com' and similar domains
if (!$this->useList && substr_count($cookieDomain, '.') < 2
|| $this->useList && !self::getRegisteredDomain($cookieDomain)
) {
return false;
}
return substr('.' . $requestHost, -strlen($cookieDomain)) == $cookieDomain;
}
/**
* Removes subdomains to get the registered domain (the first after top-level)
*
* The method will check Public Suffix List to find out where top-level
* domain ends and registered domain starts. It will remove domain parts
* to the left of registered one.
*
* @param string $domain domain name
*
* @return string|bool registered domain, will return false if $domain is
* either invalid or a TLD itself
*/
public static function getRegisteredDomain($domain)
{
$domainParts = explode('.', ltrim($domain, '.'));
// load the list if needed
if (empty(self::$psl)) {
$path = '@data_dir@' . DIRECTORY_SEPARATOR . 'HTTP_Request2';
if (0 === strpos($path, '@' . 'data_dir@')) {
$path = realpath(
dirname(__FILE__) . DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data'
);
}
self::$psl = include_once $path . DIRECTORY_SEPARATOR . 'public-suffix-list.php';
}
if (!($result = self::checkDomainsList($domainParts, self::$psl))) {
// known TLD, invalid domain name
return false;
}
// unknown TLD
if (!strpos($result, '.')) {
// fallback to checking that domain "has at least two dots"
if (2 > ($count = count($domainParts))) {
return false;
}
return $domainParts[$count - 2] . '.' . $domainParts[$count - 1];
}
return $result;
}
/**
* Recursive helper method for {@link getRegisteredDomain()}
*
* @param array $domainParts remaining domain parts
* @param mixed $listNode node in {@link HTTP_Request2_CookieJar::$psl} to check
*
* @return string|null concatenated domain parts, null in case of error
*/
protected static function checkDomainsList(array $domainParts, $listNode)
{
$sub = array_pop($domainParts);
$result = null;
if (!is_array($listNode) || is_null($sub)
|| array_key_exists('!' . $sub, $listNode)
) {
return $sub;
} elseif (array_key_exists($sub, $listNode)) {
$result = self::checkDomainsList($domainParts, $listNode[$sub]);
} elseif (array_key_exists('*', $listNode)) {
$result = self::checkDomainsList($domainParts, $listNode['*']);
} else {
return $sub;
}
return (strlen($result) > 0) ? ($result . '.' . $sub) : null;
}
}
?>

View file

@ -0,0 +1,160 @@
<?php
/**
* Exception classes for HTTP_Request2 package
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Base class for exceptions in PEAR
*/
require_once 'PEAR/Exception.php';
/**
* Base exception class for HTTP_Request2 package
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=132
*/
class HTTP_Request2_Exception extends PEAR_Exception
{
/** An invalid argument was passed to a method */
const INVALID_ARGUMENT = 1;
/** Some required value was not available */
const MISSING_VALUE = 2;
/** Request cannot be processed due to errors in PHP configuration */
const MISCONFIGURATION = 3;
/** Error reading the local file */
const READ_ERROR = 4;
/** Server returned a response that does not conform to HTTP protocol */
const MALFORMED_RESPONSE = 10;
/** Failure decoding Content-Encoding or Transfer-Encoding of response */
const DECODE_ERROR = 20;
/** Operation timed out */
const TIMEOUT = 30;
/** Number of redirects exceeded 'max_redirects' configuration parameter */
const TOO_MANY_REDIRECTS = 40;
/** Redirect to a protocol other than http(s):// */
const NON_HTTP_REDIRECT = 50;
/**
* Native error code
* @var int
*/
private $_nativeCode;
/**
* Constructor, can set package error code and native error code
*
* @param string $message exception message
* @param int $code package error code, one of class constants
* @param int $nativeCode error code from underlying PHP extension
*/
public function __construct($message = null, $code = null, $nativeCode = null)
{
parent::__construct($message, $code);
$this->_nativeCode = $nativeCode;
}
/**
* Returns error code produced by underlying PHP extension
*
* For Socket Adapter this may contain error number returned by
* stream_socket_client(), for Curl Adapter this will contain error number
* returned by curl_errno()
*
* @return integer
*/
public function getNativeCode()
{
return $this->_nativeCode;
}
}
/**
* Exception thrown in case of missing features
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_NotImplementedException extends HTTP_Request2_Exception
{
}
/**
* Exception that represents error in the program logic
*
* This exception usually implies a programmer's error, like passing invalid
* data to methods or trying to use PHP extensions that weren't installed or
* enabled. Usually exceptions of this kind will be thrown before request even
* starts.
*
* The exception will usually contain a package error code.
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_LogicException extends HTTP_Request2_Exception
{
}
/**
* Exception thrown when connection to a web or proxy server fails
*
* The exception will not contain a package error code, but will contain
* native error code, as returned by stream_socket_client() or curl_errno().
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_ConnectionException extends HTTP_Request2_Exception
{
}
/**
* Exception thrown when sending or receiving HTTP message fails
*
* The exception may contain both package error code and native error code.
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_MessageException extends HTTP_Request2_Exception
{
}
?>

View file

@ -0,0 +1,268 @@
<?php
/**
* Helper class for building multipart/form-data request body
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/** Exception class for HTTP_Request2 package */
require_once 'HTTP/Request2/Exception.php';
/**
* Class for building multipart/form-data request body
*
* The class helps to reduce memory consumption by streaming large file uploads
* from disk, it also allows monitoring of upload progress (see request #7630)
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
* @link http://tools.ietf.org/html/rfc1867
*/
class HTTP_Request2_MultipartBody
{
/**
* MIME boundary
* @var string
*/
private $_boundary;
/**
* Form parameters added via {@link HTTP_Request2::addPostParameter()}
* @var array
*/
private $_params = array();
/**
* File uploads added via {@link HTTP_Request2::addUpload()}
* @var array
*/
private $_uploads = array();
/**
* Header for parts with parameters
* @var string
*/
private $_headerParam = "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n";
/**
* Header for parts with uploads
* @var string
*/
private $_headerUpload = "--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\nContent-Type: %s\r\n\r\n";
/**
* Current position in parameter and upload arrays
*
* First number is index of "current" part, second number is position within
* "current" part
*
* @var array
*/
private $_pos = array(0, 0);
/**
* Constructor. Sets the arrays with POST data.
*
* @param array $params values of form fields set via
* {@link HTTP_Request2::addPostParameter()}
* @param array $uploads file uploads set via
* {@link HTTP_Request2::addUpload()}
* @param bool $useBrackets whether to append brackets to array variable names
*/
public function __construct(array $params, array $uploads, $useBrackets = true)
{
$this->_params = self::_flattenArray('', $params, $useBrackets);
foreach ($uploads as $fieldName => $f) {
if (!is_array($f['fp'])) {
$this->_uploads[] = $f + array('name' => $fieldName);
} else {
for ($i = 0; $i < count($f['fp']); $i++) {
$upload = array(
'name' => ($useBrackets? $fieldName . '[' . $i . ']': $fieldName)
);
foreach (array('fp', 'filename', 'size', 'type') as $key) {
$upload[$key] = $f[$key][$i];
}
$this->_uploads[] = $upload;
}
}
}
}
/**
* Returns the length of the body to use in Content-Length header
*
* @return integer
*/
public function getLength()
{
$boundaryLength = strlen($this->getBoundary());
$headerParamLength = strlen($this->_headerParam) - 4 + $boundaryLength;
$headerUploadLength = strlen($this->_headerUpload) - 8 + $boundaryLength;
$length = $boundaryLength + 6;
foreach ($this->_params as $p) {
$length += $headerParamLength + strlen($p[0]) + strlen($p[1]) + 2;
}
foreach ($this->_uploads as $u) {
$length += $headerUploadLength + strlen($u['name']) + strlen($u['type']) +
strlen($u['filename']) + $u['size'] + 2;
}
return $length;
}
/**
* Returns the boundary to use in Content-Type header
*
* @return string
*/
public function getBoundary()
{
if (empty($this->_boundary)) {
$this->_boundary = '--' . md5('PEAR-HTTP_Request2-' . microtime());
}
return $this->_boundary;
}
/**
* Returns next chunk of request body
*
* @param integer $length Number of bytes to read
*
* @return string Up to $length bytes of data, empty string if at end
* @throws HTTP_Request2_LogicException
*/
public function read($length)
{
$ret = '';
$boundary = $this->getBoundary();
$paramCount = count($this->_params);
$uploadCount = count($this->_uploads);
while ($length > 0 && $this->_pos[0] <= $paramCount + $uploadCount) {
$oldLength = $length;
if ($this->_pos[0] < $paramCount) {
$param = sprintf(
$this->_headerParam, $boundary, $this->_params[$this->_pos[0]][0]
) . $this->_params[$this->_pos[0]][1] . "\r\n";
$ret .= substr($param, $this->_pos[1], $length);
$length -= min(strlen($param) - $this->_pos[1], $length);
} elseif ($this->_pos[0] < $paramCount + $uploadCount) {
$pos = $this->_pos[0] - $paramCount;
$header = sprintf(
$this->_headerUpload, $boundary, $this->_uploads[$pos]['name'],
$this->_uploads[$pos]['filename'], $this->_uploads[$pos]['type']
);
if ($this->_pos[1] < strlen($header)) {
$ret .= substr($header, $this->_pos[1], $length);
$length -= min(strlen($header) - $this->_pos[1], $length);
}
$filePos = max(0, $this->_pos[1] - strlen($header));
if ($filePos < $this->_uploads[$pos]['size']) {
while ($length > 0 && !feof($this->_uploads[$pos]['fp'])) {
if (false === ($chunk = fread($this->_uploads[$pos]['fp'], $length))) {
throw new HTTP_Request2_LogicException(
'Failed reading file upload', HTTP_Request2_Exception::READ_ERROR
);
}
$ret .= $chunk;
$length -= strlen($chunk);
}
}
if ($length > 0) {
$start = $this->_pos[1] + ($oldLength - $length) -
strlen($header) - $this->_uploads[$pos]['size'];
$ret .= substr("\r\n", $start, $length);
$length -= min(2 - $start, $length);
}
} else {
$closing = '--' . $boundary . "--\r\n";
$ret .= substr($closing, $this->_pos[1], $length);
$length -= min(strlen($closing) - $this->_pos[1], $length);
}
if ($length > 0) {
$this->_pos = array($this->_pos[0] + 1, 0);
} else {
$this->_pos[1] += $oldLength;
}
}
return $ret;
}
/**
* Sets the current position to the start of the body
*
* This allows reusing the same body in another request
*/
public function rewind()
{
$this->_pos = array(0, 0);
foreach ($this->_uploads as $u) {
rewind($u['fp']);
}
}
/**
* Returns the body as string
*
* Note that it reads all file uploads into memory so it is a good idea not
* to use this method with large file uploads and rely on read() instead.
*
* @return string
*/
public function __toString()
{
$this->rewind();
return $this->read($this->getLength());
}
/**
* Helper function to change the (probably multidimensional) associative array
* into the simple one.
*
* @param string $name name for item
* @param mixed $values item's values
* @param bool $useBrackets whether to append [] to array variables' names
*
* @return array array with the following items: array('item name', 'item value');
*/
private static function _flattenArray($name, $values, $useBrackets)
{
if (!is_array($values)) {
return array(array($name, $values));
} else {
$ret = array();
foreach ($values as $k => $v) {
if (empty($name)) {
$newName = $k;
} elseif ($useBrackets) {
$newName = $name . '[' . $k . ']';
} else {
$newName = $name;
}
$ret = array_merge($ret, self::_flattenArray($newName, $v, $useBrackets));
}
return $ret;
}
}
}
?>

View file

@ -0,0 +1,192 @@
<?php
/**
* An observer useful for debugging / testing.
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author David Jean Louis <izi@php.net>
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Exception class for HTTP_Request2 package
*/
require_once 'HTTP/Request2/Exception.php';
/**
* A debug observer useful for debugging / testing.
*
* This observer logs to a log target data corresponding to the various request
* and response events, it logs by default to php://output but can be configured
* to log to a file or via the PEAR Log package.
*
* A simple example:
* <code>
* require_once 'HTTP/Request2.php';
* require_once 'HTTP/Request2/Observer/Log.php';
*
* $request = new HTTP_Request2('http://www.example.com');
* $observer = new HTTP_Request2_Observer_Log();
* $request->attach($observer);
* $request->send();
* </code>
*
* A more complex example with PEAR Log:
* <code>
* require_once 'HTTP/Request2.php';
* require_once 'HTTP/Request2/Observer/Log.php';
* require_once 'Log.php';
*
* $request = new HTTP_Request2('http://www.example.com');
* // we want to log with PEAR log
* $observer = new HTTP_Request2_Observer_Log(Log::factory('console'));
*
* // we only want to log received headers
* $observer->events = array('receivedHeaders');
*
* $request->attach($observer);
* $request->send();
* </code>
*
* @category HTTP
* @package HTTP_Request2
* @author David Jean Louis <izi@php.net>
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_Observer_Log implements SplObserver
{
// properties {{{
/**
* The log target, it can be a a resource or a PEAR Log instance.
*
* @var resource|Log $target
*/
protected $target = null;
/**
* The events to log.
*
* @var array $events
*/
public $events = array(
'connect',
'sentHeaders',
'sentBody',
'receivedHeaders',
'receivedBody',
'disconnect',
);
// }}}
// __construct() {{{
/**
* Constructor.
*
* @param mixed $target Can be a file path (default: php://output), a resource,
* or an instance of the PEAR Log class.
* @param array $events Array of events to listen to (default: all events)
*
* @return void
*/
public function __construct($target = 'php://output', array $events = array())
{
if (!empty($events)) {
$this->events = $events;
}
if (is_resource($target) || $target instanceof Log) {
$this->target = $target;
} elseif (false === ($this->target = @fopen($target, 'ab'))) {
throw new HTTP_Request2_Exception("Unable to open '{$target}'");
}
}
// }}}
// update() {{{
/**
* Called when the request notifies us of an event.
*
* @param HTTP_Request2 $subject The HTTP_Request2 instance
*
* @return void
*/
public function update(SplSubject $subject)
{
$event = $subject->getLastEvent();
if (!in_array($event['name'], $this->events)) {
return;
}
switch ($event['name']) {
case 'connect':
$this->log('* Connected to ' . $event['data']);
break;
case 'sentHeaders':
$headers = explode("\r\n", $event['data']);
array_pop($headers);
foreach ($headers as $header) {
$this->log('> ' . $header);
}
break;
case 'sentBody':
$this->log('> ' . $event['data'] . ' byte(s) sent');
break;
case 'receivedHeaders':
$this->log(sprintf(
'< HTTP/%s %s %s', $event['data']->getVersion(),
$event['data']->getStatus(), $event['data']->getReasonPhrase()
));
$headers = $event['data']->getHeader();
foreach ($headers as $key => $val) {
$this->log('< ' . $key . ': ' . $val);
}
$this->log('< ');
break;
case 'receivedBody':
$this->log($event['data']->getBody());
break;
case 'disconnect':
$this->log('* Disconnected');
break;
}
}
// }}}
// log() {{{
/**
* Logs the given message to the configured target.
*
* @param string $message Message to display
*
* @return void
*/
protected function log($message)
{
if ($this->target instanceof Log) {
$this->target->debug($message);
} elseif (is_resource($this->target)) {
fwrite($this->target, $message . "\r\n");
}
}
// }}}
}
?>

View file

@ -0,0 +1,631 @@
<?php
/**
* Class representing a HTTP response
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Exception class for HTTP_Request2 package
*/
require_once 'HTTP/Request2/Exception.php';
/**
* Class representing a HTTP response
*
* The class is designed to be used in "streaming" scenario, building the
* response as it is being received:
* <code>
* $statusLine = read_status_line();
* $response = new HTTP_Request2_Response($statusLine);
* do {
* $headerLine = read_header_line();
* $response->parseHeaderLine($headerLine);
* } while ($headerLine != '');
*
* while ($chunk = read_body()) {
* $response->appendBody($chunk);
* }
*
* var_dump($response->getHeader(), $response->getCookies(), $response->getBody());
* </code>
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
* @link http://tools.ietf.org/html/rfc2616#section-6
*/
class HTTP_Request2_Response
{
/**
* HTTP protocol version (e.g. 1.0, 1.1)
* @var string
*/
protected $version;
/**
* Status code
* @var integer
* @link http://tools.ietf.org/html/rfc2616#section-6.1.1
*/
protected $code;
/**
* Reason phrase
* @var string
* @link http://tools.ietf.org/html/rfc2616#section-6.1.1
*/
protected $reasonPhrase;
/**
* Effective URL (may be different from original request URL in case of redirects)
* @var string
*/
protected $effectiveUrl;
/**
* Associative array of response headers
* @var array
*/
protected $headers = array();
/**
* Cookies set in the response
* @var array
*/
protected $cookies = array();
/**
* Name of last header processed by parseHederLine()
*
* Used to handle the headers that span multiple lines
*
* @var string
*/
protected $lastHeader = null;
/**
* Response body
* @var string
*/
protected $body = '';
/**
* Whether the body is still encoded by Content-Encoding
*
* cURL provides the decoded body to the callback; if we are reading from
* socket the body is still gzipped / deflated
*
* @var bool
*/
protected $bodyEncoded;
/**
* Associative array of HTTP status code / reason phrase.
*
* @var array
* @link http://tools.ietf.org/html/rfc2616#section-10
*/
protected static $phrases = array(
// 1xx: Informational - Request received, continuing process
100 => 'Continue',
101 => 'Switching Protocols',
// 2xx: Success - The action was successfully received, understood and
// accepted
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
// 3xx: Redirection - Further action must be taken in order to complete
// the request
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found', // 1.1
303 => 'See Other',
304 => 'Not Modified',
305 => 'Use Proxy',
307 => 'Temporary Redirect',
// 4xx: Client Error - The request contains bad syntax or cannot be
// fulfilled
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',
403 => 'Forbidden',
404 => 'Not Found',
405 => 'Method Not Allowed',
406 => 'Not Acceptable',
407 => 'Proxy Authentication Required',
408 => 'Request Timeout',
409 => 'Conflict',
410 => 'Gone',
411 => 'Length Required',
412 => 'Precondition Failed',
413 => 'Request Entity Too Large',
414 => 'Request-URI Too Long',
415 => 'Unsupported Media Type',
416 => 'Requested Range Not Satisfiable',
417 => 'Expectation Failed',
// 5xx: Server Error - The server failed to fulfill an apparently
// valid request
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
503 => 'Service Unavailable',
504 => 'Gateway Timeout',
505 => 'HTTP Version Not Supported',
509 => 'Bandwidth Limit Exceeded',
);
/**
* Returns the default reason phrase for the given code or all reason phrases
*
* @param int $code Response code
*
* @return string|array|null Default reason phrase for $code if $code is given
* (null if no phrase is available), array of all
* reason phrases if $code is null
* @link http://pear.php.net/bugs/18716
*/
public static function getDefaultReasonPhrase($code = null)
{
if (null === $code) {
return self::$phrases;
} else {
return isset(self::$phrases[$code]) ? self::$phrases[$code] : null;
}
}
/**
* Constructor, parses the response status line
*
* @param string $statusLine Response status line (e.g. "HTTP/1.1 200 OK")
* @param bool $bodyEncoded Whether body is still encoded by Content-Encoding
* @param string $effectiveUrl Effective URL of the response
*
* @throws HTTP_Request2_MessageException if status line is invalid according to spec
*/
public function __construct($statusLine, $bodyEncoded = true, $effectiveUrl = null)
{
if (!preg_match('!^HTTP/(\d\.\d) (\d{3})(?: (.+))?!', $statusLine, $m)) {
throw new HTTP_Request2_MessageException(
"Malformed response: {$statusLine}",
HTTP_Request2_Exception::MALFORMED_RESPONSE
);
}
$this->version = $m[1];
$this->code = intval($m[2]);
$this->reasonPhrase = !empty($m[3]) ? trim($m[3]) : self::getDefaultReasonPhrase($this->code);
$this->bodyEncoded = (bool)$bodyEncoded;
$this->effectiveUrl = (string)$effectiveUrl;
}
/**
* Parses the line from HTTP response filling $headers array
*
* The method should be called after reading the line from socket or receiving
* it into cURL callback. Passing an empty string here indicates the end of
* response headers and triggers additional processing, so be sure to pass an
* empty string in the end.
*
* @param string $headerLine Line from HTTP response
*/
public function parseHeaderLine($headerLine)
{
$headerLine = trim($headerLine, "\r\n");
if ('' == $headerLine) {
// empty string signals the end of headers, process the received ones
if (!empty($this->headers['set-cookie'])) {
$cookies = is_array($this->headers['set-cookie'])?
$this->headers['set-cookie']:
array($this->headers['set-cookie']);
foreach ($cookies as $cookieString) {
$this->parseCookie($cookieString);
}
unset($this->headers['set-cookie']);
}
foreach (array_keys($this->headers) as $k) {
if (is_array($this->headers[$k])) {
$this->headers[$k] = implode(', ', $this->headers[$k]);
}
}
} elseif (preg_match('!^([^\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]+):(.+)$!', $headerLine, $m)) {
// string of the form header-name: header value
$name = strtolower($m[1]);
$value = trim($m[2]);
if (empty($this->headers[$name])) {
$this->headers[$name] = $value;
} else {
if (!is_array($this->headers[$name])) {
$this->headers[$name] = array($this->headers[$name]);
}
$this->headers[$name][] = $value;
}
$this->lastHeader = $name;
} elseif (preg_match('!^\s+(.+)$!', $headerLine, $m) && $this->lastHeader) {
// continuation of a previous header
if (!is_array($this->headers[$this->lastHeader])) {
$this->headers[$this->lastHeader] .= ' ' . trim($m[1]);
} else {
$key = count($this->headers[$this->lastHeader]) - 1;
$this->headers[$this->lastHeader][$key] .= ' ' . trim($m[1]);
}
}
}
/**
* Parses a Set-Cookie header to fill $cookies array
*
* @param string $cookieString value of Set-Cookie header
*
* @link http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html
*/
protected function parseCookie($cookieString)
{
$cookie = array(
'expires' => null,
'domain' => null,
'path' => null,
'secure' => false
);
if (!strpos($cookieString, ';')) {
// Only a name=value pair
$pos = strpos($cookieString, '=');
$cookie['name'] = trim(substr($cookieString, 0, $pos));
$cookie['value'] = trim(substr($cookieString, $pos + 1));
} else {
// Some optional parameters are supplied
$elements = explode(';', $cookieString);
$pos = strpos($elements[0], '=');
$cookie['name'] = trim(substr($elements[0], 0, $pos));
$cookie['value'] = trim(substr($elements[0], $pos + 1));
for ($i = 1; $i < count($elements); $i++) {
if (false === strpos($elements[$i], '=')) {
$elName = trim($elements[$i]);
$elValue = null;
} else {
list ($elName, $elValue) = array_map('trim', explode('=', $elements[$i]));
}
$elName = strtolower($elName);
if ('secure' == $elName) {
$cookie['secure'] = true;
} elseif ('expires' == $elName) {
$cookie['expires'] = str_replace('"', '', $elValue);
} elseif ('path' == $elName || 'domain' == $elName) {
$cookie[$elName] = urldecode($elValue);
} else {
$cookie[$elName] = $elValue;
}
}
}
$this->cookies[] = $cookie;
}
/**
* Appends a string to the response body
*
* @param string $bodyChunk part of response body
*/
public function appendBody($bodyChunk)
{
$this->body .= $bodyChunk;
}
/**
* Returns the effective URL of the response
*
* This may be different from the request URL if redirects were followed.
*
* @return string
* @link http://pear.php.net/bugs/bug.php?id=18412
*/
public function getEffectiveUrl()
{
return $this->effectiveUrl;
}
/**
* Returns the status code
*
* @return integer
*/
public function getStatus()
{
return $this->code;
}
/**
* Returns the reason phrase
*
* @return string
*/
public function getReasonPhrase()
{
return $this->reasonPhrase;
}
/**
* Whether response is a redirect that can be automatically handled by HTTP_Request2
*
* @return bool
*/
public function isRedirect()
{
return in_array($this->code, array(300, 301, 302, 303, 307))
&& isset($this->headers['location']);
}
/**
* Returns either the named header or all response headers
*
* @param string $headerName Name of header to return
*
* @return string|array Value of $headerName header (null if header is
* not present), array of all response headers if
* $headerName is null
*/
public function getHeader($headerName = null)
{
if (null === $headerName) {
return $this->headers;
} else {
$headerName = strtolower($headerName);
return isset($this->headers[$headerName])? $this->headers[$headerName]: null;
}
}
/**
* Returns cookies set in response
*
* @return array
*/
public function getCookies()
{
return $this->cookies;
}
/**
* Returns the body of the response
*
* @return string
* @throws HTTP_Request2_Exception if body cannot be decoded
*/
public function getBody()
{
if (0 == strlen($this->body) || !$this->bodyEncoded
|| !in_array(strtolower($this->getHeader('content-encoding')), array('gzip', 'deflate'))
) {
return $this->body;
} else {
if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) {
$oldEncoding = mb_internal_encoding();
mb_internal_encoding('8bit');
}
try {
switch (strtolower($this->getHeader('content-encoding'))) {
case 'gzip':
$decoded = self::decodeGzip($this->body);
break;
case 'deflate':
$decoded = self::decodeDeflate($this->body);
}
} catch (Exception $e) {
}
if (!empty($oldEncoding)) {
mb_internal_encoding($oldEncoding);
}
if (!empty($e)) {
throw $e;
}
return $decoded;
}
}
/**
* Get the HTTP version of the response
*
* @return string
*/
public function getVersion()
{
return $this->version;
}
/**
* Decodes the message-body encoded by gzip
*
* The real decoding work is done by gzinflate() built-in function, this
* method only parses the header and checks data for compliance with
* RFC 1952
*
* @param string $data gzip-encoded data
*
* @return string decoded data
* @throws HTTP_Request2_LogicException
* @throws HTTP_Request2_MessageException
* @link http://tools.ietf.org/html/rfc1952
*/
public static function decodeGzip($data)
{
$length = strlen($data);
// If it doesn't look like gzip-encoded data, don't bother
if (18 > $length || strcmp(substr($data, 0, 2), "\x1f\x8b")) {
return $data;
}
if (!function_exists('gzinflate')) {
throw new HTTP_Request2_LogicException(
'Unable to decode body: gzip extension not available',
HTTP_Request2_Exception::MISCONFIGURATION
);
}
$method = ord(substr($data, 2, 1));
if (8 != $method) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: unknown compression method',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$flags = ord(substr($data, 3, 1));
if ($flags & 224) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: reserved bits are set',
HTTP_Request2_Exception::DECODE_ERROR
);
}
// header is 10 bytes minimum. may be longer, though.
$headerLength = 10;
// extra fields, need to skip 'em
if ($flags & 4) {
if ($length - $headerLength - 2 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$extraLength = unpack('v', substr($data, 10, 2));
if ($length - $headerLength - 2 - $extraLength[1] < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$headerLength += $extraLength[1] + 2;
}
// file name, need to skip that
if ($flags & 8) {
if ($length - $headerLength - 1 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$filenameLength = strpos(substr($data, $headerLength), chr(0));
if (false === $filenameLength || $length - $headerLength - $filenameLength - 1 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$headerLength += $filenameLength + 1;
}
// comment, need to skip that also
if ($flags & 16) {
if ($length - $headerLength - 1 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$commentLength = strpos(substr($data, $headerLength), chr(0));
if (false === $commentLength || $length - $headerLength - $commentLength - 1 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$headerLength += $commentLength + 1;
}
// have a CRC for header. let's check
if ($flags & 2) {
if ($length - $headerLength - 2 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$crcReal = 0xffff & crc32(substr($data, 0, $headerLength));
$crcStored = unpack('v', substr($data, $headerLength, 2));
if ($crcReal != $crcStored[1]) {
throw new HTTP_Request2_MessageException(
'Header CRC check failed',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$headerLength += 2;
}
// unpacked data CRC and size at the end of encoded data
$tmp = unpack('V2', substr($data, -8));
$dataCrc = $tmp[1];
$dataSize = $tmp[2];
// finally, call the gzinflate() function
// don't pass $dataSize to gzinflate, see bugs #13135, #14370
$unpacked = gzinflate(substr($data, $headerLength, -8));
if (false === $unpacked) {
throw new HTTP_Request2_MessageException(
'gzinflate() call failed',
HTTP_Request2_Exception::DECODE_ERROR
);
} elseif ($dataSize != strlen($unpacked)) {
throw new HTTP_Request2_MessageException(
'Data size check failed',
HTTP_Request2_Exception::DECODE_ERROR
);
} elseif ((0xffffffff & $dataCrc) != (0xffffffff & crc32($unpacked))) {
throw new HTTP_Request2_Exception(
'Data CRC check failed',
HTTP_Request2_Exception::DECODE_ERROR
);
}
return $unpacked;
}
/**
* Decodes the message-body encoded by deflate
*
* @param string $data deflate-encoded data
*
* @return string decoded data
* @throws HTTP_Request2_LogicException
*/
public static function decodeDeflate($data)
{
if (!function_exists('gzuncompress')) {
throw new HTTP_Request2_LogicException(
'Unable to decode body: gzip extension not available',
HTTP_Request2_Exception::MISCONFIGURATION
);
}
// RFC 2616 defines 'deflate' encoding as zlib format from RFC 1950,
// while many applications send raw deflate stream from RFC 1951.
// We should check for presence of zlib header and use gzuncompress() or
// gzinflate() as needed. See bug #15305
$header = unpack('n', substr($data, 0, 2));
return (0 == $header[1] % 31)? gzuncompress($data): gzinflate($data);
}
}
?>

View file

@ -0,0 +1,135 @@
<?php
/**
* SOCKS5 proxy connection class
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/** Socket wrapper class used by Socket Adapter */
require_once 'HTTP/Request2/SocketWrapper.php';
/**
* SOCKS5 proxy connection class (used by Socket Adapter)
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
* @link http://pear.php.net/bugs/bug.php?id=19332
* @link http://tools.ietf.org/html/rfc1928
*/
class HTTP_Request2_SOCKS5 extends HTTP_Request2_SocketWrapper
{
/**
* Constructor, tries to connect and authenticate to a SOCKS5 proxy
*
* @param string $address Proxy address, e.g. 'tcp://localhost:1080'
* @param int $timeout Connection timeout (seconds)
* @param array $contextOptions Stream context options
* @param string $username Proxy user name
* @param string $password Proxy password
*
* @throws HTTP_Request2_LogicException
* @throws HTTP_Request2_ConnectionException
* @throws HTTP_Request2_MessageException
*/
public function __construct(
$address, $timeout = 10, array $contextOptions = array(),
$username = null, $password = null
) {
parent::__construct($address, $timeout, $contextOptions);
if (strlen($username)) {
$request = pack('C4', 5, 2, 0, 2);
} else {
$request = pack('C3', 5, 1, 0);
}
$this->write($request);
$response = unpack('Cversion/Cmethod', $this->read(3));
if (5 != $response['version']) {
throw new HTTP_Request2_MessageException(
'Invalid version received from SOCKS5 proxy: ' . $response['version'],
HTTP_Request2_Exception::MALFORMED_RESPONSE
);
}
switch ($response['method']) {
case 2:
$this->performAuthentication($username, $password);
case 0:
break;
default:
throw new HTTP_Request2_ConnectionException(
"Connection rejected by proxy due to unsupported auth method"
);
}
}
/**
* Performs username/password authentication for SOCKS5
*
* @param string $username Proxy user name
* @param string $password Proxy password
*
* @throws HTTP_Request2_ConnectionException
* @throws HTTP_Request2_MessageException
* @link http://tools.ietf.org/html/rfc1929
*/
protected function performAuthentication($username, $password)
{
$request = pack('C2', 1, strlen($username)) . $username
. pack('C', strlen($password)) . $password;
$this->write($request);
$response = unpack('Cvn/Cstatus', $this->read(3));
if (1 != $response['vn'] || 0 != $response['status']) {
throw new HTTP_Request2_ConnectionException(
'Connection rejected by proxy due to invalid username and/or password'
);
}
}
/**
* Connects to a remote host via proxy
*
* @param string $remoteHost Remote host
* @param int $remotePort Remote port
*
* @throws HTTP_Request2_ConnectionException
* @throws HTTP_Request2_MessageException
*/
public function connect($remoteHost, $remotePort)
{
$request = pack('C5', 0x05, 0x01, 0x00, 0x03, strlen($remoteHost))
. $remoteHost . pack('n', $remotePort);
$this->write($request);
$response = unpack('Cversion/Creply/Creserved', $this->read(1024));
if (5 != $response['version'] || 0 != $response['reserved']) {
throw new HTTP_Request2_MessageException(
'Invalid response received from SOCKS5 proxy',
HTTP_Request2_Exception::MALFORMED_RESPONSE
);
} elseif (0 != $response['reply']) {
throw new HTTP_Request2_ConnectionException(
"Unable to connect to {$remoteHost}:{$remotePort} through SOCKS5 proxy",
0, $response['reply']
);
}
}
}
?>

View file

@ -0,0 +1,297 @@
<?php
/**
* Socket wrapper class used by Socket Adapter
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/** Exception classes for HTTP_Request2 package */
require_once 'HTTP/Request2/Exception.php';
/**
* Socket wrapper class used by Socket Adapter
*
* Needed to properly handle connection errors, global timeout support and
* similar things. Loosely based on Net_Socket used by older HTTP_Request.
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
* @link http://pear.php.net/bugs/bug.php?id=19332
* @link http://tools.ietf.org/html/rfc1928
*/
class HTTP_Request2_SocketWrapper
{
/**
* PHP warning messages raised during stream_socket_client() call
* @var array
*/
protected $connectionWarnings = array();
/**
* Connected socket
* @var resource
*/
protected $socket;
/**
* Sum of start time and global timeout, exception will be thrown if request continues past this time
* @var integer
*/
protected $deadline;
/**
* Global timeout value, mostly for exception messages
* @var integer
*/
protected $timeout;
/**
* Class constructor, tries to establish connection
*
* @param string $address Address for stream_socket_client() call,
* e.g. 'tcp://localhost:80'
* @param int $timeout Connection timeout (seconds)
* @param array $contextOptions Context options
*
* @throws HTTP_Request2_LogicException
* @throws HTTP_Request2_ConnectionException
*/
public function __construct($address, $timeout, array $contextOptions = array())
{
if (!empty($contextOptions)
&& !isset($contextOptions['socket']) && !isset($contextOptions['ssl'])
) {
// Backwards compatibility with 2.1.0 and 2.1.1 releases
$contextOptions = array('ssl' => $contextOptions);
}
$context = stream_context_create();
foreach ($contextOptions as $wrapper => $options) {
foreach ($options as $name => $value) {
if (!stream_context_set_option($context, $wrapper, $name, $value)) {
throw new HTTP_Request2_LogicException(
"Error setting '{$wrapper}' wrapper context option '{$name}'"
);
}
}
}
set_error_handler(array($this, 'connectionWarningsHandler'));
$this->socket = stream_socket_client(
$address, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context
);
restore_error_handler();
// if we fail to bind to a specified local address (see request #19515),
// connection still succeeds, albeit with a warning. Throw an Exception
// with the warning text in this case as that connection is unlikely
// to be what user wants and as Curl throws an error in similar case.
if ($this->connectionWarnings) {
if ($this->socket) {
fclose($this->socket);
}
$error = $errstr ? $errstr : implode("\n", $this->connectionWarnings);
throw new HTTP_Request2_ConnectionException(
"Unable to connect to {$address}. Error: {$error}", 0, $errno
);
}
}
/**
* Destructor, disconnects socket
*/
public function __destruct()
{
fclose($this->socket);
}
/**
* Wrapper around fread(), handles global request timeout
*
* @param int $length Reads up to this number of bytes
*
* @return string Data read from socket
* @throws HTTP_Request2_MessageException In case of timeout
*/
public function read($length)
{
if ($this->deadline) {
stream_set_timeout($this->socket, max($this->deadline - time(), 1));
}
$data = fread($this->socket, $length);
$this->checkTimeout();
return $data;
}
/**
* Reads until either the end of the socket or a newline, whichever comes first
*
* Strips the trailing newline from the returned data, handles global
* request timeout. Method idea borrowed from Net_Socket PEAR package.
*
* @param int $bufferSize buffer size to use for reading
* @param int $localTimeout timeout value to use just for this call
* (used when waiting for "100 Continue" response)
*
* @return string Available data up to the newline (not including newline)
* @throws HTTP_Request2_MessageException In case of timeout
*/
public function readLine($bufferSize, $localTimeout = null)
{
$line = '';
while (!feof($this->socket)) {
if (null !== $localTimeout) {
stream_set_timeout($this->socket, $localTimeout);
} elseif ($this->deadline) {
stream_set_timeout($this->socket, max($this->deadline - time(), 1));
}
$line .= @fgets($this->socket, $bufferSize);
if (null === $localTimeout) {
$this->checkTimeout();
} else {
$info = stream_get_meta_data($this->socket);
// reset socket timeout if we don't have request timeout specified,
// prevents further calls failing with a bogus Exception
if (!$this->deadline) {
$default = (int)@ini_get('default_socket_timeout');
stream_set_timeout($this->socket, $default > 0 ? $default : PHP_INT_MAX);
}
if ($info['timed_out']) {
throw new HTTP_Request2_MessageException(
"readLine() call timed out", HTTP_Request2_Exception::TIMEOUT
);
}
}
if (substr($line, -1) == "\n") {
return rtrim($line, "\r\n");
}
}
return $line;
}
/**
* Wrapper around fwrite(), handles global request timeout
*
* @param string $data String to be written
*
* @return int
* @throws HTTP_Request2_MessageException
*/
public function write($data)
{
if ($this->deadline) {
stream_set_timeout($this->socket, max($this->deadline - time(), 1));
}
$written = fwrite($this->socket, $data);
$this->checkTimeout();
// http://www.php.net/manual/en/function.fwrite.php#96951
if ($written < strlen($data)) {
throw new HTTP_Request2_MessageException('Error writing request');
}
return $written;
}
/**
* Tests for end-of-file on a socket
*
* @return bool
*/
public function eof()
{
return feof($this->socket);
}
/**
* Sets request deadline
*
* @param int $deadline Exception will be thrown if request continues
* past this time
* @param int $timeout Original request timeout value, to use in
* Exception message
*/
public function setDeadline($deadline, $timeout)
{
$this->deadline = $deadline;
$this->timeout = $timeout;
}
/**
* Turns on encryption on a socket
*
* @throws HTTP_Request2_ConnectionException
*/
public function enableCrypto()
{
$modes = array(
STREAM_CRYPTO_METHOD_TLS_CLIENT,
STREAM_CRYPTO_METHOD_SSLv3_CLIENT,
STREAM_CRYPTO_METHOD_SSLv23_CLIENT,
STREAM_CRYPTO_METHOD_SSLv2_CLIENT
);
foreach ($modes as $mode) {
if (stream_socket_enable_crypto($this->socket, true, $mode)) {
return;
}
}
throw new HTTP_Request2_ConnectionException(
'Failed to enable secure connection when connecting through proxy'
);
}
/**
* Throws an Exception if stream timed out
*
* @throws HTTP_Request2_MessageException
*/
protected function checkTimeout()
{
$info = stream_get_meta_data($this->socket);
if ($info['timed_out'] || $this->deadline && time() > $this->deadline) {
$reason = $this->deadline
? "after {$this->timeout} second(s)"
: 'due to default_socket_timeout php.ini setting';
throw new HTTP_Request2_MessageException(
"Request timed out {$reason}", HTTP_Request2_Exception::TIMEOUT
);
}
}
/**
* Error handler to use during stream_socket_client() call
*
* One stream_socket_client() call may produce *multiple* PHP warnings
* (especially OpenSSL-related), we keep them in an array to later use for
* the message of HTTP_Request2_ConnectionException
*
* @param int $errno error level
* @param string $errstr error message
*
* @return bool
*/
protected function connectionWarningsHandler($errno, $errstr)
{
if ($errno & E_WARNING) {
array_unshift($this->connectionWarnings, $errstr);
}
return true;
}
}
?>

1219
libs/PEAR.1.9.5/Net/URL2.php Normal file

File diff suppressed because it is too large Load diff

1063
libs/PEAR.1.9.5/PEAR.php Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,389 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
/**
* PEAR_Exception
*
* PHP versions 4 and 5
*
* @category pear
* @package PEAR
* @author Tomas V. V. Cox <cox@idecnet.com>
* @author Hans Lellelid <hans@velum.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.3.3
*/
/**
* Base PEAR_Exception Class
*
* 1) Features:
*
* - Nestable exceptions (throw new PEAR_Exception($msg, $prev_exception))
* - Definable triggers, shot when exceptions occur
* - Pretty and informative error messages
* - Added more context info available (like class, method or cause)
* - cause can be a PEAR_Exception or an array of mixed
* PEAR_Exceptions/PEAR_ErrorStack warnings
* - callbacks for specific exception classes and their children
*
* 2) Ideas:
*
* - Maybe a way to define a 'template' for the output
*
* 3) Inherited properties from PHP Exception Class:
*
* protected $message
* protected $code
* protected $line
* protected $file
* private $trace
*
* 4) Inherited methods from PHP Exception Class:
*
* __clone
* __construct
* getMessage
* getCode
* getFile
* getLine
* getTraceSafe
* getTraceSafeAsString
* __toString
*
* 5) Usage example
*
* <code>
* require_once 'PEAR/Exception.php';
*
* class Test {
* function foo() {
* throw new PEAR_Exception('Error Message', ERROR_CODE);
* }
* }
*
* function myLogger($pear_exception) {
* echo $pear_exception->getMessage();
* }
* // each time a exception is thrown the 'myLogger' will be called
* // (its use is completely optional)
* PEAR_Exception::addObserver('myLogger');
* $test = new Test;
* try {
* $test->foo();
* } catch (PEAR_Exception $e) {
* print $e;
* }
* </code>
*
* @category pear
* @package PEAR
* @author Tomas V.V.Cox <cox@idecnet.com>
* @author Hans Lellelid <hans@velum.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version Release: 1.9.5
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.3.3
*
*/
class PEAR_Exception extends Exception
{
const OBSERVER_PRINT = -2;
const OBSERVER_TRIGGER = -4;
const OBSERVER_DIE = -8;
protected $cause;
private static $_observers = array();
private static $_uniqueid = 0;
private $_trace;
/**
* Supported signatures:
* - PEAR_Exception(string $message);
* - PEAR_Exception(string $message, int $code);
* - PEAR_Exception(string $message, Exception $cause);
* - PEAR_Exception(string $message, Exception $cause, int $code);
* - PEAR_Exception(string $message, PEAR_Error $cause);
* - PEAR_Exception(string $message, PEAR_Error $cause, int $code);
* - PEAR_Exception(string $message, array $causes);
* - PEAR_Exception(string $message, array $causes, int $code);
* @param string exception message
* @param int|Exception|PEAR_Error|array|null exception cause
* @param int|null exception code or null
*/
public function __construct($message, $p2 = null, $p3 = null)
{
if (is_int($p2)) {
$code = $p2;
$this->cause = null;
} elseif (is_object($p2) || is_array($p2)) {
// using is_object allows both Exception and PEAR_Error
if (is_object($p2) && !($p2 instanceof Exception)) {
if (!class_exists('PEAR_Error') || !($p2 instanceof PEAR_Error)) {
throw new PEAR_Exception('exception cause must be Exception, ' .
'array, or PEAR_Error');
}
}
$code = $p3;
if (is_array($p2) && isset($p2['message'])) {
// fix potential problem of passing in a single warning
$p2 = array($p2);
}
$this->cause = $p2;
} else {
$code = null;
$this->cause = null;
}
parent::__construct($message, $code);
$this->signal();
}
/**
* @param mixed $callback - A valid php callback, see php func is_callable()
* - A PEAR_Exception::OBSERVER_* constant
* - An array(const PEAR_Exception::OBSERVER_*,
* mixed $options)
* @param string $label The name of the observer. Use this if you want
* to remove it later with removeObserver()
*/
public static function addObserver($callback, $label = 'default')
{
self::$_observers[$label] = $callback;
}
public static function removeObserver($label = 'default')
{
unset(self::$_observers[$label]);
}
/**
* @return int unique identifier for an observer
*/
public static function getUniqueId()
{
return self::$_uniqueid++;
}
private function signal()
{
foreach (self::$_observers as $func) {
if (is_callable($func)) {
call_user_func($func, $this);
continue;
}
settype($func, 'array');
switch ($func[0]) {
case self::OBSERVER_PRINT :
$f = (isset($func[1])) ? $func[1] : '%s';
printf($f, $this->getMessage());
break;
case self::OBSERVER_TRIGGER :
$f = (isset($func[1])) ? $func[1] : E_USER_NOTICE;
trigger_error($this->getMessage(), $f);
break;
case self::OBSERVER_DIE :
$f = (isset($func[1])) ? $func[1] : '%s';
die(printf($f, $this->getMessage()));
break;
default:
trigger_error('invalid observer type', E_USER_WARNING);
}
}
}
/**
* Return specific error information that can be used for more detailed
* error messages or translation.
*
* This method may be overridden in child exception classes in order
* to add functionality not present in PEAR_Exception and is a placeholder
* to define API
*
* The returned array must be an associative array of parameter => value like so:
* <pre>
* array('name' => $name, 'context' => array(...))
* </pre>
* @return array
*/
public function getErrorData()
{
return array();
}
/**
* Returns the exception that caused this exception to be thrown
* @access public
* @return Exception|array The context of the exception
*/
public function getCause()
{
return $this->cause;
}
/**
* Function must be public to call on caused exceptions
* @param array
*/
public function getCauseMessage(&$causes)
{
$trace = $this->getTraceSafe();
$cause = array('class' => get_class($this),
'message' => $this->message,
'file' => 'unknown',
'line' => 'unknown');
if (isset($trace[0])) {
if (isset($trace[0]['file'])) {
$cause['file'] = $trace[0]['file'];
$cause['line'] = $trace[0]['line'];
}
}
$causes[] = $cause;
if ($this->cause instanceof PEAR_Exception) {
$this->cause->getCauseMessage($causes);
} elseif ($this->cause instanceof Exception) {
$causes[] = array('class' => get_class($this->cause),
'message' => $this->cause->getMessage(),
'file' => $this->cause->getFile(),
'line' => $this->cause->getLine());
} elseif (class_exists('PEAR_Error') && $this->cause instanceof PEAR_Error) {
$causes[] = array('class' => get_class($this->cause),
'message' => $this->cause->getMessage(),
'file' => 'unknown',
'line' => 'unknown');
} elseif (is_array($this->cause)) {
foreach ($this->cause as $cause) {
if ($cause instanceof PEAR_Exception) {
$cause->getCauseMessage($causes);
} elseif ($cause instanceof Exception) {
$causes[] = array('class' => get_class($cause),
'message' => $cause->getMessage(),
'file' => $cause->getFile(),
'line' => $cause->getLine());
} elseif (class_exists('PEAR_Error') && $cause instanceof PEAR_Error) {
$causes[] = array('class' => get_class($cause),
'message' => $cause->getMessage(),
'file' => 'unknown',
'line' => 'unknown');
} elseif (is_array($cause) && isset($cause['message'])) {
// PEAR_ErrorStack warning
$causes[] = array(
'class' => $cause['package'],
'message' => $cause['message'],
'file' => isset($cause['context']['file']) ?
$cause['context']['file'] :
'unknown',
'line' => isset($cause['context']['line']) ?
$cause['context']['line'] :
'unknown',
);
}
}
}
}
public function getTraceSafe()
{
if (!isset($this->_trace)) {
$this->_trace = $this->getTrace();
if (empty($this->_trace)) {
$backtrace = debug_backtrace();
$this->_trace = array($backtrace[count($backtrace)-1]);
}
}
return $this->_trace;
}
public function getErrorClass()
{
$trace = $this->getTraceSafe();
return $trace[0]['class'];
}
public function getErrorMethod()
{
$trace = $this->getTraceSafe();
return $trace[0]['function'];
}
public function __toString()
{
if (isset($_SERVER['REQUEST_URI'])) {
return $this->toHtml();
}
return $this->toText();
}
public function toHtml()
{
$trace = $this->getTraceSafe();
$causes = array();
$this->getCauseMessage($causes);
$html = '<table style="border: 1px" cellspacing="0">' . "\n";
foreach ($causes as $i => $cause) {
$html .= '<tr><td colspan="3" style="background: #ff9999">'
. str_repeat('-', $i) . ' <b>' . $cause['class'] . '</b>: '
. htmlspecialchars($cause['message']) . ' in <b>' . $cause['file'] . '</b> '
. 'on line <b>' . $cause['line'] . '</b>'
. "</td></tr>\n";
}
$html .= '<tr><td colspan="3" style="background-color: #aaaaaa; text-align: center; font-weight: bold;">Exception trace</td></tr>' . "\n"
. '<tr><td style="text-align: center; background: #cccccc; width:20px; font-weight: bold;">#</td>'
. '<td style="text-align: center; background: #cccccc; font-weight: bold;">Function</td>'
. '<td style="text-align: center; background: #cccccc; font-weight: bold;">Location</td></tr>' . "\n";
foreach ($trace as $k => $v) {
$html .= '<tr><td style="text-align: center;">' . $k . '</td>'
. '<td>';
if (!empty($v['class'])) {
$html .= $v['class'] . $v['type'];
}
$html .= $v['function'];
$args = array();
if (!empty($v['args'])) {
foreach ($v['args'] as $arg) {
if (is_null($arg)) $args[] = 'null';
elseif (is_array($arg)) $args[] = 'Array';
elseif (is_object($arg)) $args[] = 'Object('.get_class($arg).')';
elseif (is_bool($arg)) $args[] = $arg ? 'true' : 'false';
elseif (is_int($arg) || is_double($arg)) $args[] = $arg;
else {
$arg = (string)$arg;
$str = htmlspecialchars(substr($arg, 0, 16));
if (strlen($arg) > 16) $str .= '&hellip;';
$args[] = "'" . $str . "'";
}
}
}
$html .= '(' . implode(', ',$args) . ')'
. '</td>'
. '<td>' . (isset($v['file']) ? $v['file'] : 'unknown')
. ':' . (isset($v['line']) ? $v['line'] : 'unknown')
. '</td></tr>' . "\n";
}
$html .= '<tr><td style="text-align: center;">' . ($k+1) . '</td>'
. '<td>{main}</td>'
. '<td>&nbsp;</td></tr>' . "\n"
. '</table>';
return $html;
}
public function toText()
{
$causes = array();
$this->getCauseMessage($causes);
$causeMsg = '';
foreach ($causes as $i => $cause) {
$causeMsg .= str_repeat(' ', $i) . $cause['class'] . ': '
. $cause['message'] . ' in ' . $cause['file']
. ' on line ' . $cause['line'] . "\n";
}
return $causeMsg . $this->getTraceAsString();
}
}

33
libs/PEAR.1.9.5/PEAR5.php Normal file
View file

@ -0,0 +1,33 @@
<?php
/**
* This is only meant for PHP 5 to get rid of certain strict warning
* that doesn't get hidden since it's in the shutdown function
*/
class PEAR5
{
/**
* If you have a class that's mostly/entirely static, and you need static
* properties, you can use this method to simulate them. Eg. in your method(s)
* do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar');
* You MUST use a reference, or they will not persist!
*
* @access public
* @param string $class The calling classname, to prevent clashes
* @param string $var The variable to retrieve.
* @return mixed A reference to the variable. If not set it will be
* auto initialised to NULL.
*/
static function &getStaticProperty($class, $var)
{
static $properties;
if (!isset($properties[$class])) {
$properties[$class] = array();
}
if (!array_key_exists($var, $properties[$class])) {
$properties[$class][$var] = null;
}
return $properties[$class][$var];
}
}

View file

@ -248,6 +248,9 @@ class adminAdminView extends admin
*/
function dispAdminIndex()
{
$db_info = Context::getDBInfo();
Context::set('db_info',$db_info);
// Get statistics
$args = new stdClass();
$args->date = date("Ymd000000", $_SERVER['REQUEST_TIME'] - 60 * 60 * 24);

View file

@ -1606,4 +1606,11 @@
<value xml:lang="en"><![CDATA[Your IP]]></value>
<value xml:lang="jp"><![CDATA[接続したIP]]></value>
</item>
<item name="sitelock_in_use">
<value xml:lang="ko"><![CDATA[사이트 잠금을 사용중입니다.]]></value>
<value xml:lang="en"><![CDATA[Site lock in use]]></value>
</item>
<item name="about_sitelock_in_use">
<value xml:lang="ko"><![CDATA[관리자 페이지에서 허용한 IP를 제외한 사용자는 접속할 수 없습니다.]]></value>
</item>
</lang>

View file

@ -19,6 +19,11 @@
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<div class="message error" cond="$db_info->use_sitelock == 'Y'">
<h2>{$lang->sitelock_in_use}</h2>
<p>{$lang->about_sitelock_in_use}</p>
</div>
<form action="./" method="post" class="message info x_clearfix" cond="!$isLicenseAgreement">
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', 'admin')}" />
<input type="hidden" name="module" value="install" />

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1,2 @@
function setStartModule(){var a=jQuery(".moduleIdList option:selected").text(),b=jQuery(".moduleIdList").val();jQuery("#_target_module").val(a),jQuery("#index_module_srl").val(b),jQuery(".moduleList,.moduleIdList, .site_keyword_search, #sitefind_addBtn").css("display","none")}function viewSiteSearch(){jQuery(".site_keyword_search").css("display","")}function getFTPList(a){var b=jQuery("#ftp_form").get(0);b.ftp_root_path.value="undefined"!=typeof a?a:!b.ftp_root_path.value&&"undefined"!=typeof b.sftp&&b.sftp.checked?xe_root:"/";var c=[];c.ftp_user=jQuery("#ftp_user").val(),c.ftp_password=jQuery("#ftp_password").val(),c.ftp_host=jQuery("#ftp_host").val(),c.ftp_port=jQuery("#ftp_port").val(),c.ftp_root_path=jQuery("#ftp_root_path").val(),c.sftp=jQuery("input[name=sftp]:checked").val(),exec_xml("admin","getAdminFTPList",c,completeGetFtpInfo,["list","error","message"],c,b)}function removeFTPInfo(){var a={};exec_xml("install","procInstallAdminRemoveFTPInfo",a,filterAlertMessage,["error","message"],a)}function completeGetFtpInfo(a){if(0!==a.error)return alert(a.error),void alert(a.message);var b=jQuery("#ftpSuggestion").empty(),c="";jQuery.isArray(a.list.item)||(a.list.item=[a.list.item]),pwd=jQuery("#ftp_form").get(0).ftp_root_path.value,"/"!=pwd&&(arr=pwd.split("/"),arr.pop(),arr.pop(),arr.push(""),target=arr.join("/"),c=c+"<li><button type='button' onclick=\"getFTPList('"+target+"')\">../</button></li>");for(var d=0;d<a.list.item.length;d++){var e=a.list.item[d];"../"!=e&&"./"!=e&&(c=c+"<li><button type='button' onclick=\"getFTPList('"+pwd+e+"')\">"+e+"</button></li>")}c="<ul>"+c+"</ul>",b.append(jQuery(c))}function deleteIcon(a){var b=[];b.iconname=a,exec_xml("admin","procAdminRemoveIcons",b,iconDeleteMessage,["error","message"],b),icon=a}function iconDeleteMessage(a){alert(a.message),"0"==a.error&&("favicon.ico"==icon?jQuery(".faviconPreview img").attr("src","modules/admin/tpl/img/faviconSample.png"):"mobicon.png"==icon&&jQuery(".mobiconPreview img").attr("src","modules/admin/tpl/img/mobiconSample.png"))}function doRecompileCacheFile(){if(confirm(xe.lang.confirm_run)){var a=[];exec_xml("admin","procAdminRecompileCacheFile",a,completeCacheMessage)}}function completeCacheMessage(a){alert(a.message)}function doResetAdminMenu(){if(confirm(xe.lang.confirm_reset_admin_menu)){var a=[];a.menu_srl=admin_menu_srl,exec_xml("admin","procAdminMenuReset",a,completeResetAdminMenu)}}function completeResetAdminMenu(){document.location.reload()}jQuery(function(a){a(".tgContent ul").bind("click",function(){a("#sitefind_addBtn").css("display","")})});var icon=null;
function setStartModule(){var a=jQuery(".moduleIdList option:selected").text(),b=jQuery(".moduleIdList").val();jQuery("#_target_module").val(a),jQuery("#index_module_srl").val(b),jQuery(".moduleList,.moduleIdList, .site_keyword_search, #sitefind_addBtn").css("display","none")}function viewSiteSearch(){jQuery(".site_keyword_search").css("display","")}function getFTPList(a){var b=jQuery("#ftp_form").get(0);b.ftp_root_path.value="undefined"!=typeof a?a:!b.ftp_root_path.value&&"undefined"!=typeof b.sftp&&b.sftp.checked?xe_root:"/";var c=[];c.ftp_user=jQuery("#ftp_user").val(),c.ftp_password=jQuery("#ftp_password").val(),c.ftp_host=jQuery("#ftp_host").val(),c.ftp_port=jQuery("#ftp_port").val(),c.ftp_root_path=jQuery("#ftp_root_path").val(),c.sftp=jQuery("input[name=sftp]:checked").val(),exec_xml("admin","getAdminFTPList",c,completeGetFtpInfo,["list","error","message"],c,b)}function removeFTPInfo(){var a={};exec_xml("install","procInstallAdminRemoveFTPInfo",a,filterAlertMessage,["error","message"],a)}function completeGetFtpInfo(a){if(0!==a.error)return alert(a.error),void alert(a.message);var b=jQuery("#ftpSuggestion").empty(),c="";jQuery.isArray(a.list.item)||(a.list.item=[a.list.item]),pwd=jQuery("#ftp_form").get(0).ftp_root_path.value,"/"!=pwd&&(arr=pwd.split("/"),arr.pop(),arr.pop(),arr.push(""),target=arr.join("/"),c=c+"<li><button type='button' onclick=\"getFTPList('"+target+"')\">../</button></li>");for(var d=0;d<a.list.item.length;d++){var e=a.list.item[d];"../"!=e&&"./"!=e&&(c=c+"<li><button type='button' onclick=\"getFTPList('"+pwd+e+"')\">"+e+"</button></li>")}c="<ul>"+c+"</ul>",b.append(jQuery(c))}function deleteIcon(a){var b=[];b.iconname=a,exec_xml("admin","procAdminRemoveIcons",b,iconDeleteMessage,["error","message"],b),icon=a}function iconDeleteMessage(a){alert(a.message),"0"==a.error&&("favicon.ico"==icon?jQuery(".faviconPreview img").attr("src","modules/admin/tpl/img/faviconSample.png"):"mobicon.png"==icon&&jQuery(".mobiconPreview img").attr("src","modules/admin/tpl/img/mobiconSample.png"))}function doRecompileCacheFile(){if(confirm(xe.lang.confirm_run)){var a=[];exec_xml("admin","procAdminRecompileCacheFile",a,completeCacheMessage)}}function completeCacheMessage(a){alert(a.message)}function doResetAdminMenu(){if(confirm(xe.lang.confirm_reset_admin_menu)){var a=[];a.menu_srl=admin_menu_srl,exec_xml("admin","procAdminMenuReset",a,completeResetAdminMenu)}}function completeResetAdminMenu(){document.location.reload()}jQuery(function(a){a(".tgContent ul").bind("click",function(){a("#sitefind_addBtn").css("display","")})});var icon=null;
//# sourceMappingURL=config.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"config.min.js","sources":["config.js"],"names":["setStartModule","target_module","jQuery","text","index_module_srl","val","css","viewSiteSearch","getFTPList","pwd","form","get","ftp_root_path","value","sftp","checked","xe_root","params","ftp_user","ftp_password","ftp_host","ftp_port","exec_xml","completeGetFtpInfo","removeFTPInfo","filterAlertMessage","ret_obj","error","alert","message","e","empty","list","isArray","item","arr","split","pop","push","target","join","i","length","v","append","deleteIcon","iconname","iconDeleteMessage","icon","attr","doRecompileCacheFile","confirm","xe","lang","confirm_run","completeCacheMessage","doResetAdminMenu","confirm_reset_admin_menu","menu_srl","admin_menu_srl","completeResetAdminMenu","document","location","reload","$","bind"],"mappings":"AAMA,QAASA,kBACR,GAAIC,GAAgBC,OAAO,iCAAiCC,OACxDC,EAAmBF,OAAO,iBAAiBG,KAC/CH,QAAO,mBAAmBG,IAAIJ,GAC9BC,OAAO,qBAAqBG,IAAID,GAChCF,OAAO,qEAAqEI,IAAI,UAAU,QAG3F,QAASC,kBACRL,OAAO,wBAAwBI,I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QA,EAAE,kBAGnFX,EAAO,OAAOA,EAAK,QACnBF,EAAEc,OAAO1C,OAAO8B,IAIjB,QAASa,YAAWC,GACnB,GAAI7B,KACJA,GAAO6B,SAAWA,EAClBxB,SAAS,QAAS,uBAAwBL,EAAQ8B,mBAAoB,QAAS,WAAY9B,GAC3F+B,KAAOF,EAER,QAASC,mBAAkBrB,GAC1BE,MAAMF,EAAQG,SAEO,KAAjBH,EAAQC,QAEC,eAARqB,KACH9C,OAAO,uBAAuB+C,KAAK,MAAO,2CACzB,eAARD,MACT9C,OAAO,uBAAuB+C,KAAK,MAAO,4CAI7C,QAASC,wBACR,GAAKC,QAAQC,GAAGC,KAAKC,aAArB,CACA,GAAIrC,KACJK,UAAS,QAAQ,8BAA+BL,EAAQsC,uBAEzD,QAASA,sBAAqB7B,GAC7BE,MAAMF,EAAQG,SAGf,QAAS2B,oBACR,GAAKL,QAAQC,GAAGC,KAAKI,0BAArB,CACA,GAAIxC,KACJA,GAAOyC,SAAWC,eAClBrC,SAAS,QAAQ,qBAAsBL,EAAQ2C,yBAEhD,QAASA,0BACRC,SAASC,SAASC,SAzInB7D,OAAO,SAAS8D,GACfA,EAAE,iBAAiBC,KAAK,QAAS,WAChCD,EAAE,oBAAoB1D,IAAI,UAAU,OAoGtC,IAAI0C,MAAO"}

View file

@ -1 +1,2 @@
jQuery(function(a){function b(b){var c;if(moduleList=b.menuList){var d=a("#menuNameList");for(var e in moduleList){var f=moduleList[e];c=a('<optgroup label="'+e+'" />').appendTo(d);for(var g in f)c.append('<option value="'+e+":"+g+'">'+f[g].title+"</option>")}}}var c,d,e=a("#editForm"),f=a("#listForm");a("a._add").click(function(){if(d=a(this).parent().prevAll("._item_key").val(),e.find("input[name=parent_srl]").val(d),!c){var f=[],g=["menuList"];exec_xml("menu","procMenuAdminAllActList",f,b,g)}}),a("a._parent_delete").click(function(){var b=a(this).parent().prevAll("._parent_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()}),a("a._child_delete").click(function(){var b=a(this).closest("li").find("._item_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()})}),jQuery(function(a){function b(a,b){for(var c=0,d=0;a&&a!=b;)c+=a.offsetTop,d+=a.offsetLeft,a=a.offsetParent;return{top:c,left:d}}a("form.adminMap").delegate("li:not(.placeholder)","dropped.st",function(){var b,c,d=a(this);b=d.find(">input._parent_key"),c=!!d.parent("ul").parent("li").length,b.val(c?d.parent("ul").parent("li").find(">input._item_key").val():"0")});var c=!1,d=a('<li class="placeholder">');a("form.adminMap>ul").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(e){var f,g,h,i,j,k,l,m,n,o;if(!a(e.target).is("a,input,label,textarea")&&1==e.which){for(c=!0,f=a(this),j=f.height(),i=f.width(),g=f.parentsUntil(".adminMap").filter("ul"),h=g.eq(-1),l={x:e.pageX,y:e.pageY},k=b(this,h.get(0)),$clone=f.clone(!0).attr("target",!0),n=g.length-1;n;n--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();return m=[],h.find("li").each(function(){if(f[0]===this||f.has(this).length)return!0;var c=b(this,h.get(0));m.push({top:c.top,bottom:c.top+32,$item:a(this)})}),$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:.6,width:i,height:j,left:k.left,top:k.top,zIndex:100}).appendTo(h.eq(0)),d.css({position:"absolute",opacity:.6,width:i,height:"10px",left:k.left,top:k.top,zIndex:99}).appendTo(h.eq(0)),f.css("opacity",.6),a(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,e,f,g;for(o=null,b={x:l.x-a.pageX,y:l.y-a.pageY},c=k.top-b.y,e=0,f=m.length;f>e;e++)g=m[e],g.top>c||g.bottom<c||(o={element:g.$item},g.$item.hasClass("parent")?(o.state="prepend",d.css("top",g.bottom-5)):g.top>c-12?(o.state="before",d.css("top",g.top-5)):(o.state="after",d.css("top",g.bottom-5)));$clone.css({top:c})}).bind("mouseup.st",function(){var b,e;c=!1,a(document).unbind("mousemove.st mouseup.st"),f.css("opacity",""),$clone.remove(),d.remove(),e=a("<li />").height(f.height()),o&&(b=a(o.element),f.before(e),"prepend"==o.state?(b.find(">ul").length||b.find(">.side").after("<ul>"),b.find(">ul").prepend(f.hide())):b[o.state](f.hide()),f.slideDown(100,function(){f.removeClass("active")}),e.slideUp(100,function(){var a=e.parent();e.remove(),a.children("li").length||a.remove()}),f.trigger("dropped.st"))}),!1}},"mouseover.st":function(){return c||a(this).addClass("active"),!1},"mouseout.st":function(){return c||a(this).removeClass("active"),!1}}).find("li li").prepend('<button type="button" class="moveTo">Move to</button>').end().end(),a('<div id="dropzone-marker" />').css({display:"none",position:"absolute",backgroundColor:"#000",opacity:.7}).appendTo("body")});
jQuery(function(a){function b(b){var c;if(moduleList=b.menuList){var d=a("#menuNameList");for(var e in moduleList){var f=moduleList[e];c=a('<optgroup label="'+e+'" />').appendTo(d);for(var g in f)c.append('<option value="'+e+":"+g+'">'+f[g].title+"</option>")}}}var c,d,e=a("#editForm"),f=a("#listForm");a("a._add").click(function(){if(d=a(this).parent().prevAll("._item_key").val(),e.find("input[name=parent_srl]").val(d),!c){var f=[],g=["menuList"];exec_xml("menu","procMenuAdminAllActList",f,b,g)}}),a("a._parent_delete").click(function(){var b=a(this).parent().prevAll("._parent_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()}),a("a._child_delete").click(function(){var b=a(this).closest("li").find("._item_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()})}),jQuery(function(a){function b(a,b){for(var c=0,d=0;a&&a!=b;)c+=a.offsetTop,d+=a.offsetLeft,a=a.offsetParent;return{top:c,left:d}}a("form.adminMap").delegate("li:not(.placeholder)","dropped.st",function(){var b,c,d=a(this);b=d.find(">input._parent_key"),c=!!d.parent("ul").parent("li").length,b.val(c?d.parent("ul").parent("li").find(">input._item_key").val():"0")});var c=!1,d=a('<li class="placeholder">');a("form.adminMap>ul").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(e){var f,g,h,i,j,k,l,m,n,o;if(!a(e.target).is("a,input,label,textarea")&&1==e.which){for(c=!0,f=a(this),j=f.height(),i=f.width(),g=f.parentsUntil(".adminMap").filter("ul"),h=g.eq(-1),l={x:e.pageX,y:e.pageY},k=b(this,h.get(0)),$clone=f.clone(!0).attr("target",!0),n=g.length-1;n;n--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();return m=[],h.find("li").each(function(){if(f[0]===this||f.has(this).length)return!0;var c=b(this,h.get(0));m.push({top:c.top,bottom:c.top+32,$item:a(this)})}),$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:.6,width:i,height:j,left:k.left,top:k.top,zIndex:100}).appendTo(h.eq(0)),d.css({position:"absolute",opacity:.6,width:i,height:"10px",left:k.left,top:k.top,zIndex:99}).appendTo(h.eq(0)),f.css("opacity",.6),a(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,e,f,g;for(o=null,b={x:l.x-a.pageX,y:l.y-a.pageY},c=k.top-b.y,e=0,f=m.length;f>e;e++)g=m[e],g.top>c||g.bottom<c||(o={element:g.$item},g.$item.hasClass("parent")?(o.state="prepend",d.css("top",g.bottom-5)):g.top>c-12?(o.state="before",d.css("top",g.top-5)):(o.state="after",d.css("top",g.bottom-5)));$clone.css({top:c})}).bind("mouseup.st",function(){var b,e;c=!1,a(document).unbind("mousemove.st mouseup.st"),f.css("opacity",""),$clone.remove(),d.remove(),e=a("<li />").height(f.height()),o&&(b=a(o.element),f.before(e),"prepend"==o.state?(b.find(">ul").length||b.find(">.side").after("<ul>"),b.find(">ul").prepend(f.hide())):b[o.state](f.hide()),f.slideDown(100,function(){f.removeClass("active")}),e.slideUp(100,function(){var a=e.parent();e.remove(),a.children("li").length||a.remove()}),f.trigger("dropped.st"))}),!1}},"mouseover.st":function(){return c||a(this).addClass("active"),!1},"mouseout.st":function(){return c||a(this).removeClass("active"),!1}}).find("li li").prepend('<button type="button" class="moveTo">Move to</button>').end().end(),a('<div id="dropzone-marker" />').css({display:"none",position:"absolute",backgroundColor:"#000",opacity:.7}).appendTo("body")});
//# sourceMappingURL=menu_setup.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"menu_setup.min.js","sources":["menu_setup.js"],"names":["jQuery","$","completeGetActList","obj","$optgroup","moduleList","menuList","menuNameList","x","appendTo","y","append","title","parentSrl","editForm","listForm","click","this","parent","prevAll","val","find","params","response_tags","exec_xml","menu_item_srl","submit","closest","getOffset","elem","offsetParent","top","left","offsetTop","offsetLeft","delegate","$pkey","is_child","$this","length","dragging","$holder","mousedown.st","event","$uls","$ul","width","height","offset","position","offsets","i","dropzone","target","is","which","parentsUntil","filter","eq","pageX","pageY","get","$clone","clone","attr","wrap","each","has","o","push","bottom","$item","remove","end","addClass","css","opacity","zIndex","document","unbind","bind","diff","nTop","c","element","hasClass","state","$dropzone","$li","before","after","prepend","hide","slideDown","removeClass","slideUp","$par","children","trigger","mouseover.st","mouseout.st","display","backgroundColor"],"mappings":"AAAAA,OAAO,SAASC,GAiBf,QAASC,GAAmBC,GAE3B,GAAIC,EAGJ,IADAC,WAAaF,EAAIG,SAEjB,CACC,GAAIC,GAAeN,EAAE,gBACrB,KAAI,GAAIO,KAAKH,YACb,CACC,GAAIC,GAAWD,WAAWG,EAC1BJ,GAAYH,EAAE,oBAAoBO,EAAE,QAAQC,SAASF,EACrD,KAAI,GAAIG,KAAKJ,GAEZF,EAAUO,OAAO,kBAAkBH,EAAE,IAAIE,EAAE,KAAKJ,EAASI,GAAGE,MAAM,eA9BtE,GAAIN,GACAO,EACAC,EAAWb,EAAE,aACbc,EAAWd,EAAE,YAEjBA,GAAE,UAAUe,MAAM,WAGjB,GAFAH,EAAYZ,EAAEgB,MAAMC,SAASC,QAAQ,cAAcC,MACnDN,EAASO,KAAK,0BAA0BD,IAAIP,IACxCP,EACJ,CACC,GAAIgB,MACAC,GAAiB,WACrBC,UAAS,OAAO,0BAA2BF,EAAQpB,EAAoBqB,MAwBzEtB,EAAE,oBAAoBe,MAAM,WAC3B,GAAIS,GAAgBxB,EA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ardCatogoryList(&$oModule) {
function dispBoardCategoryList(&$oModule) {
$oModule->add('category_list',Context::get('category_list'));
}
@ -97,10 +97,18 @@ class boardAPI extends board {
function arrangeContent($content) {
$oBoardView = getView('board');
$output = new stdClass;
if($content){
$output = $content->gets('document_srl','category_srl','member_srl','nick_name','user_id','user_name','title','content','tags','readed_count','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars','status');
if(!$oBoardView->grant->view)
{
unset($output->content);
unset($output->tags);
unset($output->extra_vars);
}
$t_width = Context::get('thumbnail_width');
$t_height = Context::get('thumbnail_height');
$t_type = Context::get('thumbnail_type');

View file

@ -212,6 +212,13 @@ class boardView extends board
// check if the use_category option is enabled
if($this->module_info->use_category=='Y')
{
// check the grant
if(!$this->grant->list)
{
Context::set('category_list', array());
return;
}
$oDocumentModel = getModel('document');
Context::set('category_list', $oDocumentModel->getCategoryList($this->module_srl));
@ -323,6 +330,59 @@ class boardView extends board
* @brief display the document file list (can be used by API)
**/
function dispBoardContentFileList(){
/**
* check the access grant (all the grant has been set by the module object)
**/
if(!$this->grant->access)
{
return $this->dispBoardMessage('msg_not_permitted');
}
// check document view grant
$this->dispBoardContentView();
// Check if a permission for file download is granted
// Get configurations (using module model object)
$oModuleModel = getModel('module');
$file_module_config = $oModuleModel->getModulePartConfig('file',$this->module_srl);
$downloadGrantCount = 0;
if(is_array($file_module_config->download_grant))
{
foreach($file_module_config->download_grant AS $value)
if($value) $downloadGrantCount++;
}
if(is_array($file_module_config->download_grant) && $downloadGrantCount>0)
{
if(!Context::get('is_logged')) return $this->stop('msg_not_permitted_download');
$logged_info = Context::get('logged_info');
if($logged_info->is_admin != 'Y')
{
$oModuleModel =& getModel('module');
$columnList = array('module_srl', 'site_srl');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($this->module_srl, $columnList);
if(!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl))
{
$oMemberModel =& getModel('member');
$member_groups = $oMemberModel->getMemberGroups($logged_info->member_srl, $module_info->site_srl);
$is_permitted = false;
for($i=0;$i<count($file_module_config->download_grant);$i++)
{
$group_srl = $file_module_config->download_grant[$i];
if($member_groups[$group_srl])
{
$is_permitted = true;
break;
}
}
if(!$is_permitted) return $this->stop('msg_not_permitted_download');
}
}
}
$oDocumentModel = getModel('document');
$document_srl = Context::get('document_srl');
$oDocument = $oDocumentModel->getDocument($document_srl);
@ -336,6 +396,9 @@ class boardView extends board
* @brief display the document comment list (can be used by API)
**/
function dispBoardContentCommentList(){
// check document view grant
$this->dispBoardContentView();
$oDocumentModel = getModel('document');
$document_srl = Context::get('document_srl');
$oDocument = $oDocumentModel->getDocument($document_srl);
@ -360,6 +423,13 @@ class boardView extends board
* @brief display notice list (can be used by API)
**/
function dispBoardNoticeList(){
// check the grant
if(!$this->grant->list)
{
Context::set('notice_list', array());
return;
}
$oDocumentModel = getModel('document');
$args = new stdClass();
$args->module_srl = $this->module_srl;

View file

@ -60,7 +60,7 @@
<action name="dispBoardNoticeList" type="view" />
<action name="dispBoardContentList" type="view" />
<action name="dispBoardContentView" type="view" />
<action name="dispBoardCatogoryList" type="view" />
<action name="dispBoardCategoryList" type="view" />
<action name="dispBoardContentCommentList" type="view" />
<action name="dispBoardContentFileList" type="view" />

File diff suppressed because one or more lines are too long

View file

@ -1 +1,2 @@
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").parent().after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").parent().after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
//# sourceMappingURL=mboard.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"mboard.min.js","sources":["mboard.js"],"names":["completeInsertComment","ret_obj","mid","error","message","document_srl","comment_srl","url","current_url","setQuery","location","href","completeDocumentInserted","category_srl","completeGetPage","ret_val","jQuery","remove","parent","after","html","loadPage","page","params","cpage","current_mid","exec_json","completeDeleteComment","completeDeleteDocument"],"mappings":"AAAA,QAASA,uBAAs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AAS,MAAMP,GAAKO,SAAS,MAAM,IAAIA,SAAS,eAAe,GAClFa,KAAMf,EAAMA,EAAIE,SAAS,OAAOa,IAEnCZ,SAASC,KAAOJ"}

View file

@ -1 +1,2 @@
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
//# sourceMappingURL=mboard.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"mboard.min.js","sources":["mboard.js"],"names":["completeInsertComment","ret_obj","mid","error","message","document_srl","comment_srl","url","current_url","setQuery","location","href","completeDocumentInserted","category_srl","completeGetPage","ret_val","jQuery","remove","after","html","loadPage","page","params","cpage","current_mid","exec_json","completeDeleteComment","completeDeleteDocument"],"mappings":"AAAA,QAASA,uBAAsBC,GAE9B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBC,EAAcL,EAAQK,YAEtBC,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,GAC5FH,KAAaC,EAAMA,EAAIE,SAAS,MAAMH,GAAa,YAAYA,GAElEI,SAASC,KAAOJ,EAGjB,QAASK,0BAAyBX,GAEjC,GAKIM,GAHAL,GAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBQ,EAAeZ,EAAQY,YAS1BN,GANGF,EAMGG,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,IAJrFD,YAAYC,SAAS,MAAMP,GAAKO,SAAS,MAAM,IAMnDI,IAAcN,EAAMA,EAAIE,SAAS,WAAWI,IAC/CH,SAASC,KAAOJ,EAGjB,QAASO,iBAAgBC,GAExBC,OAAO,OAAOC,SACdD,OAAO,SAASC,SAChBD,OAAO,QAAQE,MAAMH,EAAQI,MAG9B,QAASC,UAASf,EAAcgB,GAE/B,GAAIC,KAEJA,GAAOC,MAAQF,EACfC,EAAOjB,aAAeA,EACtBiB,EAAOpB,IAAMsB,YACbR,OAAOS,UAAU,4BAA6BH,EAAQR,iBAGvD,QAASY,uBAAsBzB,GAE9B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBgB,EAAOpB,EAAQoB,KAEfd,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,GAC5FY,KAAMd,EAAMA,EAAIE,SAAS,OAAOY,IAEnCX,SAASC,KAAOJ,EAGjB,QAASoB,wBAAuB1B,GAE/B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdmB,EAAOpB,EAAQoB,KAEfd,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,MAAM,IAAIA,SAAS,eAAe,GAClFY,KAAMd,EAAMA,EAAIE,SAAS,OAAOY,IAEnCX,SAASC,KAAOJ"}

View file

@ -1 +1,2 @@
jQuery(function(a){a(".board_list tr:last-child>td").css("border","0"),a(".read_footer .tags span:last-child").hide();var b=a(".board_search");b.hide().addClass("off"),a(".bsToggle").click(function(){b.hasClass("off")?b.show().removeClass("off").find(".iText").focus():b.hide().addClass("off")});var c=a(".item .iLabel").next(".iText");a(".item .iLabel").css("position","absolute"),c.focus(function(){a(this).prev(".iLabel").css("visibility","hidden")}).blur(function(){a(this).val()?a(this).prev(".iLabel").css("visibility","hidden"):a(this).prev(".iLabel").css("visibility","visible")}).change(function(){a(this).val()?a(this).prev(".iLabel").css("visibility","hidden"):a(this).prev(".iLabel").css("visibility","visible")}).blur(),a(".cTab>li>ul>li.on_").parents("li:first").addClass("on"),a(".feedback .xe_content>*:first-child").css("margin-top","0")}),function(a){a.fn.snspost=function(b){var c="";switch(b=a.extend({},{type:"twitter",event:"click",content:""},b),b.content=encodeURIComponent(b.content),b.type){case"facebook":c="http://www.facebook.com/share.php?t="+b.content+"&u="+encodeURIComponent(b.url||location.href);break;case"delicious":c="http://www.delicious.com/save?v=5&noui&jump=close&url="+encodeURIComponent(b.url||location.href)+"&title="+b.content;break;case"twitter":c="http://twitter.com/home?status="+b.content}this.bind(b.event,function(){return window.open(c),!1})},a.snspost=function(b,c){a.each(b,function(b,d){a(d).snspost(a.extend({},c,{type:b}))})}}(jQuery);
jQuery(function(a){a(".board_list tr:last-child>td").css("border","0"),a(".read_footer .tags span:last-child").hide();var b=a(".board_search");b.hide().addClass("off"),a(".bsToggle").click(function(){b.hasClass("off")?b.show().removeClass("off").find(".iText").focus():b.hide().addClass("off")});var c=a(".item .iLabel").next(".iText");a(".item .iLabel").css("position","absolute"),c.focus(function(){a(this).prev(".iLabel").css("visibility","hidden")}).blur(function(){a(this).val()?a(this).prev(".iLabel").css("visibility","hidden"):a(this).prev(".iLabel").css("visibility","visible")}).change(function(){a(this).val()?a(this).prev(".iLabel").css("visibility","hidden"):a(this).prev(".iLabel").css("visibility","visible")}).blur(),a(".cTab>li>ul>li.on_").parents("li:first").addClass("on"),a(".feedback .xe_content>*:first-child").css("margin-top","0")}),function(a){a.fn.snspost=function(b){var c="";switch(b=a.extend({},{type:"twitter",event:"click",content:""},b),b.content=encodeURIComponent(b.content),b.type){case"facebook":c="http://www.facebook.com/share.php?t="+b.content+"&u="+encodeURIComponent(b.url||location.href);break;case"delicious":c="http://www.delicious.com/save?v=5&noui&jump=close&url="+encodeURIComponent(b.url||location.href)+"&title="+b.content;break;case"twitter":c="http://twitter.com/home?status="+b.content}this.bind(b.event,function(){return window.open(c),!1})},a.snspost=function(b,c){a.each(b,function(b,d){a(d).snspost(a.extend({},c,{type:b}))})}}(jQuery);
//# sourceMappingURL=board.default.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"board.default.min.js","sources":["board.default.js"],"names":["jQuery","$","css","hide","bs","addClass","click","hasClass","show","removeClass","find","focus","iText","next","this","prev","blur","val","change","parents","fn","snspost","opts","loc","extend","type","event","content","encodeURIComponent","url","location","href","bind","window","open","selectors","action","each","key"],"mappings":"AAAAA,OAAO,SAASC,GAEfA,EAAE,gCAAgCC,IAAI,SAAS,KAE/CD,EAAE,sCAAsCE,MAExC,IAAIC,GAAKH,EAAE,gBACXG,GAAGD,OAAOE,SAAS,OACnBJ,EAAE,aAAaK,MAAM,WACjBF,EAAGG,SAAS,OACdH,EAAGI,OAAOC,YAAY,OAAOC,KAAK,UAAUC,QAE5CP,EAAGD,OAAOE,SAAS,QAIrB,IAAIO,GAAQX,EAAE,iBAAiBY,KAAK,SACpCZ,GAAE,iBAAiBC,IAAI,WAAW,YAClCU,EACED,MAAM,WACNV,EAAEa,MAAMC,KAAK,WAAWb,IAAI,aAAa,YAEzCc,KAAK,WACDf,EAAEa,MAAMG,MAGXhB,EAAEa,MAAMC,KAAK,WAAWb,IAAI,aAAa,UAFzCD,EAAEa,MAAMC,KAAK,WAAWb,IAAI,aAAa,aAK1CgB,OAAO,WACHjB,EAAEa,MAAMG,MAGXhB,EAAEa,MAAMC,KAAK,WAAWb,IAAI,aAAa,UAFzCD,EAAEa,MAAMC,KAAK,WAAWb,IAAI,aAAa,aAK1Cc,OAEFf,EAAE,sBAAsBkB,QAAQ,YAAYd,SAAS,MAErDJ,EAAE,uCAAuCC,IAAI,aAAa,OAI3D,SAAUD,GACTA,EAAEmB,GAAGC,QAAU,SAASC,GACvB,GAAIC,GAAM,EAGV,QAFAD,EAAOrB,EAAEuB,WAAYC,KAAK,UAAWC,MAAM,QAASC,QAAQ,IAAKL,GACjEA,EAAKK,QAAUC,mBAAmBN,EAAKK,SAChCL,EAAKG,MACX,IAAK,WACJF,EAAM,uCAAuCD,EAAKK,QAAQ,MAAMC,mBAAmBN,EAAKO,KAAKC,SAASC,KACtG,MACD,KAAK,YACJR,EAAM,yDAAyDK,mBAAmBN,EAAKO,KAAKC,SAASC,MAAM,UAAUT,EAAKK,OAC1H,MACD,KAAK,UACJJ,EAAM,kCAAkCD,EAAKK,QAG/Cb,KAAKkB,KAAKV,EAAKI,MAAO,WAErB,MADAO,QAAOC,KAAKX,IACL,KAGTtB,EAAEoB,QAAU,SAASc,EAAWC,GAC/BnC,EAAEoC,KAAKF,EAAW,SAASG,EAAIrB,GAC9BhB,EAAEgB,GAAKI,QAASpB,EAAEuB,UAAWY,GAASX,KAAKa,SAG3CtC"}

View file

@ -1 +1,2 @@
function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}function completeSearch(a,b,c,d){d.submit()}function completeVote(a){var b=(a.error,a.message);alert(b),location.href=location.href}function completeReload(a){a.error,a.message;location.href=location.href}function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteTrackback(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function doChangeCategory(){var a=jQuery("#board_category option:selected").val();location.href=decodeURI(current_url).setQuery("category",a).setQuery("page","")}function doScrap(a){var b=[];b.document_srl=a,jQuery.exec_json("member.procMemberScrapDocument",b)}jQuery(function(a){a(document.body).click(function(b){var c,d=a(b.target),e={};if(0!==d.parents(".layer_voted_member").length||d.is(".layer_voted_member")||a(".layer_voted_member").hide().remove(),d.is("a[class^=voted_member_]")){var f=parseInt(d.attr("class").replace(/[^0-9]/g,""));f&&(d.hasClass("comment")?(c="comment.getCommentVotedMemberList",e={comment_srl:f,point:d.hasClass("votedup")?1:-1}):(c="document.getDocumentVotedMemberList",e={document_srl:f,point:d.hasClass("votedup")?1:-1}),a.exec_json(c,e,function(c){var e=c.voted_member_list,f=[];e&&0!==e.length&&(a.each(e,function(){f.push(this.nick_name)}),d.after(a("<ul>").addClass("layer_voted_member").css({position:"absolute",top:b.pageY+5,left:b.pageX}).append("<li>"+f.join("</li><li>")+"</li>")))}))}})});
function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}function completeSearch(a,b,c,d){d.submit()}function completeVote(a){var b=(a.error,a.message);alert(b),location.href=location.href}function completeReload(a){a.error,a.message;location.href=location.href}function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteTrackback(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function doChangeCategory(){var a=jQuery("#board_category option:selected").val();location.href=decodeURI(current_url).setQuery("category",a).setQuery("page","")}function doScrap(a){var b=[];b.document_srl=a,jQuery.exec_json("member.procMemberScrapDocument",b)}jQuery(function(a){a(document.body).click(function(b){var c,d=a(b.target),e={};if(0!==d.parents(".layer_voted_member").length||d.is(".layer_voted_member")||a(".layer_voted_member").hide().remove(),d.is("a[class^=voted_member_]")){var f=parseInt(d.attr("class").replace(/[^0-9]/g,""));f&&(d.hasClass("comment")?(c="comment.getCommentVotedMemberList",e={comment_srl:f,point:d.hasClass("votedup")?1:-1}):(c="document.getDocumentVotedMemberList",e={document_srl:f,point:d.hasClass("votedup")?1:-1}),a.exec_json(c,e,function(c){var e=c.voted_member_list,f=[];e&&0!==e.length&&(a.each(e,function(){f.push(this.nick_name)}),d.after(a("<ul>").addClass("layer_voted_member").css({position:"absolute",top:b.pageY+5,left:b.pageX}).append("<li>"+f.join("</li><li>")+"</li>")))}))}})});
//# sourceMappingURL=board.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"board.min.js","sources":["board.js"],"names":["completeDocumentInserted","ret_obj","url","mid","error","message","document_srl","category_srl","current_url","setQuery","location","href","completeDeleteDocument","page","completeSearch","response_tags","params","fo_obj","submit","completeVote","alert","completeReload","completeInsertComment","comment_srl","completeDeleteComment","completeDeleteTrackback","doChangeCategory","jQuery","val","decodeURI","doScrap","exec_json","$","document","body","click","e","act","t","target","parents","length","is","hide","remove","srl","parseInt","attr","replace","hasClass","point","data","l","voted_member_list","ul","each","push","this","nick_name","after","addClass","css","position","top","pageY","left","pageX","append","join"],"mappings":"AAOA,QAASA,0BAAyBC,GAEjC,GAQIC,GANAC,GAFQF,EAAQG,MACNH,EAAQI,QACZJ,EAAQE,KACdG,EAAeL,EAAQK,aACvBC,EAAeN,EAAQM,YAW1BL,GANGI,EAMGE,YAAYC,SAAS,MAAMN,GAAKM,SAAS,eAAeH,GAAcG,SAAS,MAAM,IAJrFD,YAAYC,SAAS,MAAMN,GAAKM,SAAS,MAAM,IAMnDF,IAAcL,EAAMA,EAAIO,SAAS,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AS,MAAM,GAC5FI,KAAMX,EAAMA,EAAIO,SAAS,OAAOI,IAInCH,SAASC,KAAOT,EAIjB,QAASwB,oBAER,GAAInB,GAAeoB,OAAO,mCAAmCC,KAC7DlB,UAASC,KAAOkB,UAAUrB,aAAaC,SAAS,WAAWF,GAAcE,SAAS,OAAQ,IAI3F,QAASqB,SAAQxB,GAEhB,GAAIU,KACJA,GAAOV,aAAeA,EACtBqB,OAAOI,UAAU,iCAAkCf,GAGpDW,OAAO,SAASK,GACfA,EAAEC,SAASC,MAAMC,MAAM,SAASC,GAC/B,GAAqBC,GAAjBC,EAAIN,EAAEI,EAAEG,QAAcvB,IAM1B,IAJ+C,IAA5CsB,EAAEE,QAAQ,uBAAuBC,QAAiBH,EAAEI,GAAG,wBACzDV,EAAE,uBAAuBW,OAAOC,SAG7BN,EAAEI,GAAG,2BAAT,CAEA,GAAIG,GAAMC,SAASR,EAAES,KAAK,SAASC,QAAQ,UAAU,IACjDH,KAEDP,EAAEW,SAAS,YACbZ,EAAM,oCACNrB,GACCO,YAAcsB,EAAIK,MAASZ,EAAEW,SAAS,WAAW,EAAE,MAEpDZ,EAAM,sCACNrB,GACCV,aAAeuC,EAAIK,MAASZ,EAAEW,SAAS,WAAW,EAAE,KAGtDjB,EAAED,UAAUM,EAAKrB,EAAQ,SAASmC,GACjC,GAAIC,GAAID,EAAKE,kBACTC,IAEAF,IAAkB,IAAbA,EAAEX,SAEXT,EAAEuB,KAAKH,EAAE,WACRE,EAAGE,KAAKC,KAAKC,aAGdpB,EAAEqB,MAAM3B,EAAE,QACR4B,SAAS,sBACTC,KAAKC,SAAW,WAAWC,IAAM3B,EAAE4B,MAAM,EAAEC,KAAO7B,EAAE8B,QACpDC,OAAO,OAAOb,EAAGc,KAAK,aAAa"}

View file

@ -1 +1,2 @@
function completeInsertBoard(a){var b=(a.error,a.message),c=a.page,d=a.module_srl;alert(b);var e=current_url.setQuery("act","dispBoardAdminBoardInfo");d&&(e=e.setQuery("module_srl",d)),c&&e.setQuery("page",c),location.href=e}function completeDeleteBoard(a){var b=(a.error,a.message),c=a.page;alert(b);var d=current_url.setQuery("act","dispBoardAdminContent").setQuery("module_srl","");c&&(d=d.setQuery("page",c)),location.href=d}function doUpdateCategory(a,b,c){if("undefined"==typeof c||confirm(c)){var d=xGetElementById("fo_category_info");d.category_srl.value=a,d.mode.value=b,procFilter(d,update_category)}}function completeUpdateCategory(a){var b=(a.error,a.message),c=a.module_srl,d=a.page;alert(b);var e=current_url.setQuery("module_srl",c).setQuery("act","dispBoardAdminCategoryInfo");d&&e.setQuery("page",d),location.href=e}function doCartSetup(a){var b=[];jQuery("#fo_list input[name=cart]:checked").each(function(){b[b.length]=jQuery(this).val()}),b.length<1||(a+="&module_srls="+b.join(","),popopen(a,"modulesSetup"))}function doInsertItem(){var a=xGetElementById("targetItem"),b=xGetElementById("displayItem");if(a&&b){for(var c=a.options[a.selectedIndex].text,d=a.options[a.selectedIndex].value,e=0;e<b.options.length;e++)if(b.options[e].value==d)return;var f=new Option(c,d,!0,!0);b.options[b.options.length]=f}}function doDeleteItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;0>b||a.options.length<2||(a.remove(b),a.selectedIndex=b-1)}function doMoveUpItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;if(!(1>b)&&b){var c=a.options[b].text,d=a.options[b].value;a.options[b].text=a.options[b-1].text,a.options[b].value=a.options[b-1].value,a.options[b-1].text=c,a.options[b-1].value=d,a.selectedIndex=b-1}}function doMoveDownItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;if(!(b>=a.options.length-1)){var c=a.options[b].text,d=a.options[b].value;a.options[b].text=a.options[b+1].text,a.options[b].value=a.options[b+1].value,a.options[b+1].text=c,a.options[b+1].value=d,a.selectedIndex=b+1}}function doSaveListConfig(a){if(a){for(var b=xGetElementById("displayItem"),c=(b.selectedIndex,[]),d=0;d<b.options.length;d++)c[c.length]=b.options[d].value;if(!(c.length<1)){var e={};e.module_srl=a,e.list=c.join(",");{new Array("error","message")}exec_json("board.procBoardAdminInsertListConfig",e,function(){location.reload()})}}}
function completeInsertBoard(a){var b=(a.error,a.message),c=a.page,d=a.module_srl;alert(b);var e=current_url.setQuery("act","dispBoardAdminBoardInfo");d&&(e=e.setQuery("module_srl",d)),c&&e.setQuery("page",c),location.href=e}function completeDeleteBoard(a){var b=(a.error,a.message),c=a.page;alert(b);var d=current_url.setQuery("act","dispBoardAdminContent").setQuery("module_srl","");c&&(d=d.setQuery("page",c)),location.href=d}function doUpdateCategory(a,b,c){if("undefined"==typeof c||confirm(c)){var d=xGetElementById("fo_category_info");d.category_srl.value=a,d.mode.value=b,procFilter(d,update_category)}}function completeUpdateCategory(a){var b=(a.error,a.message),c=a.module_srl,d=a.page;alert(b);var e=current_url.setQuery("module_srl",c).setQuery("act","dispBoardAdminCategoryInfo");d&&e.setQuery("page",d),location.href=e}function doCartSetup(a){var b=[];jQuery("#fo_list input[name=cart]:checked").each(function(){b[b.length]=jQuery(this).val()}),b.length<1||(a+="&module_srls="+b.join(","),popopen(a,"modulesSetup"))}function doInsertItem(){var a=xGetElementById("targetItem"),b=xGetElementById("displayItem");if(a&&b){for(var c=a.options[a.selectedIndex].text,d=a.options[a.selectedIndex].value,e=0;e<b.options.length;e++)if(b.options[e].value==d)return;var f=new Option(c,d,!0,!0);b.options[b.options.length]=f}}function doDeleteItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;0>b||a.options.length<2||(a.remove(b),a.selectedIndex=b-1)}function doMoveUpItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;if(!(1>b)&&b){var c=a.options[b].text,d=a.options[b].value;a.options[b].text=a.options[b-1].text,a.options[b].value=a.options[b-1].value,a.options[b-1].text=c,a.options[b-1].value=d,a.selectedIndex=b-1}}function doMoveDownItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;if(!(b>=a.options.length-1)){var c=a.options[b].text,d=a.options[b].value;a.options[b].text=a.options[b+1].text,a.options[b].value=a.options[b+1].value,a.options[b+1].text=c,a.options[b+1].value=d,a.selectedIndex=b+1}}function doSaveListConfig(a){if(a){for(var b=xGetElementById("displayItem"),c=(b.selectedIndex,[]),d=0;d<b.options.length;d++)c[c.length]=b.options[d].value;if(!(c.length<1)){var e={};e.module_srl=a,e.list=c.join(",");{new Array("error","message")}exec_json("board.procBoardAdminInsertListConfig",e,function(){location.reload()})}}}
//# sourceMappingURL=board_admin.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"board_admin.min.js","sources":["board_admin.js"],"names":["completeInsertBoard","ret_obj","message","error","page","module_srl","alert","url","current_url","setQuery","location","href","completeDeleteBoard","doUpdateCategory","category_srl","mode","confirm","fo_obj","xGetElementById","value","procFilter","update_category","completeUpdateCategory","doCartSetup","jQuery","each","length","this","val","join","popopen","doInsertItem","target_obj","display_obj","text","options","selectedIndex","i","obj","Option","doDeleteItem","sel_obj","idx","remove","doMoveUpItem","doMoveDownItem","doSaveListConfig","list","params","Array","exec_json","reload"],"mappings":"AAMA,QAASA,qBAAoBC,GAE5B,GACIC,IADQD,EAAQE,MACNF,EAAQC,SAElBE,EAAOH,EAAQG,KACfC,EAAaJ,EAAQI,UAEzBC,OAAMJ,EAEN,IAAIK,GAAMC,YAAYC,SAAS,MAAM,0BAClCJ,KAAYE,EAAMA,EAAIE,SAAS,aAAaJ,IAC5CD,GAAMG,EAAIE,SAAS,OAAOL,GAC7BM,SAASC,KAAOJ,EAIjB,QAASK,qBAAoBX,GAE5B,GACIC,IADQD,EAAQE,MACNF,EAAQC,SAClBE,EAAOH,EAAQG,IACnBE,OAAMJ,EAEN,IAAIK,GAAMC,YAAYC,SAAS,MAAM,yBAAyBA,SAAS,aAAa,GACjFL,KAAMG,EAAMA,EAAIE,SAAS,OAAOL,IACnCM,SAASC,KAAOJ,EAIjB,QAASM,kBAAiBC,EAAcC,EAAMb,GAE7C,GAAoB,mBAAX,IAAyBc,QAAQd,GAA1C,CAEA,GAAIe,GAASC,gBAAgB,mBAC7BD,GAAOH,aAAaK,MA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AEjCsB,GAAQN,QAAQO,GAAKR,KAAOO,EAAQN,QAAQO,EAAI,GAAGR,KACnDO,EAAQN,QAAQO,GAAKvB,MAAQsB,EAAQN,QAAQO,EAAI,GAAGvB,MACpDsB,EAAQN,QAAQO,EAAI,GAAGR,KAAOA,EAC9BO,EAAQN,QAAQO,EAAI,GAAGvB,MAAQA,EAC/BsB,EAAQL,cAAgBM,EAAI,GAE7B,QAASG,kBAER,GAAIJ,GAAUvB,gBAAgB,eAC1BwB,EAAMD,EAAQL,aAClB,MAAGM,GAAKD,EAAQN,QAAQT,OAAO,GAA/B,CAEA,GAAIQ,GAAOO,EAAQN,QAAQO,GAAKR,KAC5Bf,EAAQsB,EAAQN,QAAQO,GAAKvB,KAEjCsB,GAAQN,QAAQO,GAAKR,KAAOO,EAAQN,QAAQO,EAAI,GAAGR,KACnDO,EAAQN,QAAQO,GAAKvB,MAAQsB,EAAQN,QAAQO,EAAI,GAAGvB,MACpDsB,EAAQN,QAAQO,EAAI,GAAGR,KAAOA,EAC9BO,EAAQN,QAAQO,EAAI,GAAGvB,MAAQA,EAC/BsB,EAAQL,cAAgBM,EAAI,GAG7B,QAASI,kBAAiBzC,GAEzB,GAAIA,EAAJ,CAKA,IAAI,GAJAoC,GAAUvB,gBAAgB,eAG1B6B,GAFMN,EAAQL,kBAGVC,EAAE,EAAEA,EAAEI,EAAQN,QAAQT,OAAOW,IAAKU,EAAKA,EAAKrB,QAAUe,EAAQN,QAAQE,GAAGlB,KACjF,MAAG4B,EAAKrB,OAAO,GAAf,CAEA,GAAIsB,KACJA,GAAO3C,WAAaA,EACpB2C,EAAOD,KAAOA,EAAKlB,KAAK,IAExB,EAAoB,GAAIoB,OAAM,QAAQ,WAEtCC,UAAU,uCAAwCF,EAAQ,WAAatC,SAASyC"}

View file

@ -443,7 +443,7 @@ class documentController extends document
if(Context::get('is_logged'))
{
$logged_info = Context::get('logged_info');
if($source_obj->get('member_srl')==$logged_info->member_srl || $bUseHistory)
if($source_obj->get('member_srl')==$logged_info->member_srl)
{
$obj->member_srl = $logged_info->member_srl;
$obj->user_name = htmlspecialchars_decode($logged_info->user_name);

View file

@ -562,18 +562,10 @@ class documentModel extends document
*/
function getDocumentCount($module_srl, $search_obj = NULL)
{
// Additional search options
$args =new stdClass();
$args->module_srl = $module_srl;
$args->s_title = $search_obj->s_title;
$args->s_content = $search_obj->s_content;
$args->s_user_name = $search_obj->s_user_name;
$args->s_member_srl = $search_obj->s_member_srl;
$args->s_ipaddress = $search_obj->s_ipaddress;
$args->s_regdate = $search_obj->s_regdate;
$args->category_srl = $search_obj->category_srl;
if(is_null($search_obj)) $search_obj = new stdClass();
$search_obj->module_srl = $module_srl;
$output = executeQuery('document.getDocumentCount', $args);
$output = executeQuery('document.getDocumentCount', $search_obj);
// Return total number of
$total_count = $output->data->count;
return (int)$total_count;
@ -586,17 +578,7 @@ class documentModel extends document
*/
function getDocumentCountByGroupStatus($search_obj = NULL)
{
// Additional search options
$args->module_srl = $search_obj->module_srl;
$args->s_title = $search_obj->s_title;
$args->s_content = $search_obj->s_content;
$args->s_user_name = $search_obj->s_user_name;
$args->s_member_srl = $search_obj->s_member_srl;
$args->s_ipaddress = $search_obj->s_ipaddress;
$args->s_regdate = $search_obj->s_regdate;
$args->category_srl = $search_obj->category_srl;
$output = executeQuery('document.getDocumentCountByGroupStatus', $args);
$output = executeQuery('document.getDocumentCountByGroupStatus', $search_obj);
if(!$output->toBool()) return array();
return $output->data;

View file

@ -8,7 +8,7 @@
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
<condition operation="notin" column="module_srl" var="exclude_module_srl" filter="number" pipe="and" />
<condition operation="equal" column="category_srl" var="category_srl" />
<condition operation="equal" column="category_srl" var="category_srl" filter="number" pipe="and" />
<condition operation="equal" column="is_notice" var="s_is_notice" pipe="and" />
<condition operation="equal" column="member_srl" var="member_srl" filter="number" pipe="and" />
<condition operation="in" column="status" var="statusList" pipe="and" />
@ -18,7 +18,7 @@
<condition operation="like" column="user_name" var="s_user_name" pipe="and" />
<condition operation="like" column="user_id" var="s_user_id" pipe="or" />
<condition operation="like" column="nick_name" var="s_nick_name" pipe="or" />
<condition operation="like" column="email_address" var="s_email_addres" pipe="or" />
<condition operation="like" column="email_address" var="s_email_address" pipe="or" />
<condition operation="like" column="homepage" var="s_homepage" pipe="or" />
<condition operation="like" column="tags" var="s_tags" pipe="or" />
<condition operation="equal" column="member_srl" var="s_member_srl" pipe="and" />

View file

@ -9,7 +9,7 @@
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" />
<condition operation="notin" column="module_srl" var="exclude_module_srl" filter="number" pipe="and" />
<condition operation="equal" column="category_srl" var="category_srl" />
<condition operation="equal" column="category_srl" var="category_srl" filter="number" pipe="and" />
<condition operation="equal" column="is_notice" var="s_is_notice" pipe="and" />
<condition operation="equal" column="member_srl" var="member_srl" filter="number" pipe="and" />
<condition operation="in" column="status" var="statusList" pipe="and" />
@ -19,7 +19,7 @@
<condition operation="like" column="user_name" var="s_user_name" pipe="and" />
<condition operation="like" column="user_id" var="s_user_id" pipe="or" />
<condition operation="like" column="nick_name" var="s_nick_name" pipe="or" />
<condition operation="like" column="email_address" var="s_email_addres" pipe="or" />
<condition operation="like" column="email_address" var="s_email_address" pipe="or" />
<condition operation="like" column="homepage" var="s_homepage" pipe="or" />
<condition operation="like" column="tags" var="s_tags" pipe="or" />
<condition operation="equal" column="member_srl" var="s_member_srl" pipe="and" />

View file

@ -26,7 +26,7 @@
<condition operation="like" column="d.user_name" var="s_user_name" pipe="or" />
<condition operation="like" column="d.user_id" var="s_user_id" pipe="or" />
<condition operation="like" column="d.nick_name" var="s_nick_name" pipe="or" />
<condition operation="like" column="d.email_address" var="s_email_addres" pipe="or" />
<condition operation="like" column="d.email_address" var="s_email_address" pipe="or" />
<condition operation="like" column="d.homepage" var="s_homepage" pipe="or" />
<condition operation="like" column="d.tags" var="s_tags" pipe="or" />
<condition operation="equal" column="d.is_secret" var="s_is_secret" pipe="or" />

View file

@ -25,7 +25,7 @@
<condition operation="like" column="user_name" var="s_user_name" pipe="or" />
<condition operation="like" column="user_id" var="s_user_id" pipe="or" />
<condition operation="like" column="nick_name" var="s_nick_name" pipe="or" />
<condition operation="like" column="email_address" var="s_email_addres" pipe="or" />
<condition operation="like" column="email_address" var="s_email_address" pipe="or" />
<condition operation="like" column="homepage" var="s_homepage" pipe="or" />
<condition operation="like" column="tags" var="s_tags" pipe="or" />
<condition operation="equal" column="member_srl" var="s_member_srl" pipe="or" />

View file

@ -15,7 +15,7 @@
<condition operation="like" column="documents.content" var="s_content" pipe="or" />
<condition operation="like" column="documents.user_name" var="s_user_name" pipe="or" />
<condition operation="like" column="documents.nick_name" var="s_nick_name" pipe="or" />
<condition operation="like" column="documents.email_address" var="s_email_addres" pipe="or" />
<condition operation="like" column="documents.email_address" var="s_email_address" pipe="or" />
<condition operation="like" column="documents.homepage" var="s_homepage" pipe="or" />
<condition operation="like" column="documents.tags" var="s_tags" pipe="or" />
<condition operation="equal" column="documents.is_notice" var="s_is_notice" pipe="or" />

View file

@ -14,6 +14,7 @@
<condition operation="in" column="documents.category_srl" var="category_srl" filter="number" pipe="and" />
<condition operation="equal" column="documents.member_srl" var="member_srl" filter="number" pipe="and" />
<condition operation="like" column="tags.tag" var="s_tags" notnull="notnull" pipe="and" />
<condition operation="in" column="documents.status" var="statusList" pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="documents.list_order" order="order_type" />

View file

@ -26,7 +26,7 @@
<condition operation="like" column="documents.user_name" var="s_user_name" pipe="or" />
<condition operation="like" column="documents.user_id" var="s_user_id" pipe="or" />
<condition operation="like" column="documents.nick_name" var="s_nick_name" pipe="or" />
<condition operation="like" column="documents.email_address" var="s_email_addres" pipe="or" />
<condition operation="like" column="documents.email_address" var="s_email_address" pipe="or" />
<condition operation="like" column="documents.homepage" var="s_homepage" pipe="or" />
<condition operation="like" column="documents.tags" var="s_tags" pipe="or" />
<condition operation="equal" column="documents.is_secret" var="s_is_secret" pipe="or" />

View file

@ -1 +1,2 @@
!function(a){var b=xe.createApp("Gallery",{_imgs:{},_styles:{},init:function(){this._imgs={}},API_ADD_IMAGE:function(a,b){var c=b[0],d=b[1],e="@"+c;/^files/.test(d)&&(d=request_uri+d),is_def(this._imgs[e])||(this._imgs[e]=[]),this._imgs[e].push({path:d,loaded:!1})},API_ONREADY:function(){var b,c,d,e,f=this._imgs;for(d in f)if(f.hasOwnProperty(d))for(b=0,c=f[d].length;c>b;b++)e=f[d][b],e.$obj=a("<img />").attr("src",e.path),e.$obj.load({img:e},function(a){var b=a.data.img;b.loaded=!0,b.$obj.unbind("load")})},API_GET_IMAGES:function(a,b){var c=b[0];return this._imgs["@"+c]||[]},API_SET_STYLE:function(a,b){var c=b[0],d=b[1];this._styles["@"+c]=d},API_ONLOAD:function(){var a,b;for(a in this._imgs)this._imgs.hasOwnProperty(a)&&(b=this._styles[a]||"list",this.cast("SHOW_"+b.toUpperCase(),[a.substr(1)]))}});xe.registerApp(new b)}(jQuery);
!function(a){var b=xe.createApp("Gallery",{_imgs:{},_styles:{},init:function(){this._imgs={}},API_ADD_IMAGE:function(a,b){var c=b[0],d=b[1],e="@"+c;/^files/.test(d)&&(d=request_uri+d),is_def(this._imgs[e])||(this._imgs[e]=[]),this._imgs[e].push({path:d,loaded:!1})},API_ONREADY:function(){var b,c,d,e,f=this._imgs;for(d in f)if(f.hasOwnProperty(d))for(b=0,c=f[d].length;c>b;b++)e=f[d][b],e.$obj=a("<img />").attr("src",e.path),e.$obj.load({img:e},function(a){var b=a.data.img;b.loaded=!0,b.$obj.unbind("load")})},API_GET_IMAGES:function(a,b){var c=b[0];return this._imgs["@"+c]||[]},API_SET_STYLE:function(a,b){var c=b[0],d=b[1];this._styles["@"+c]=d},API_ONLOAD:function(){var a,b;for(a in this._imgs)this._imgs.hasOwnProperty(a)&&(b=this._styles[a]||"list",this.cast("SHOW_"+b.toUpperCase(),[a.substr(1)]))}});xe.registerApp(new b)}(jQuery);
//# sourceMappingURL=gallery.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"gallery.min.js","sources":["gallery.js"],"names":["$","g","xe","createApp","_imgs","_styles","init","this","API_ADD_IMAGE","sender","params","srl","path","key","test","request_uri","is_def","push","loaded","API_ONREADY","i","c","img","imgs","hasOwnProperty","length","$obj","attr","load","event","im","data","unbind","API_GET_IMAGES","API_SET_STYLE","sty","API_ONLOAD","cast","toUpperCase","substr","registerApp","jQuery"],"mappings":"CAGA,SAAUA,GAEV,GAAIC,GAAIC,GAAGC,UAAU,WACpBC,SACAC,WAEAC,KAAO,WACNC,KAAKH,UAENI,cAAgB,SAASC,EAAQC,GAChC,GAAIC,GAAMD,EAAO,GAAIE,EAAOF,EAAO,GAAIG,EAAM,IAAIF,CAE9C,UAASG,KAAKF,KAAOA,EAAOG,YAAcH,GACzCI,OAAOT,KAAKH,MAAMS,MAAON,KAAKH,MAAMS,OAExCN,KAAKH,MAAMS,GAAKI,MAAML,KAAKA,EAAKM,QAAO,KAExCC,YAAc,WACb,GAAIC,GAAGC,EAAGR,EAAKS,EAAKC,EAAOhB,KAAKH,KAGhC,KAAIS,IAAOU,GACV,GAAIA,EAAKC,eAAeX,GAExB,IAAIO,EAAE,EAAEC,EAAEE,EAAKV,GAAKY,OAAYJ,EAAJD,EAAOA,IAClCE,EAAMC,EAAKV,GAAKO,GAChBE,EAAII,KAAO1B,EAAE,WAAW2B,KAAK,MAAOL,EAAIV,MACxCU,EAAII,KAAKE,MAAMN,IAAIA,GAAM,SAASO,GACjC,GAAIC,GAAKD,EAAME,KAAKT,GAEpBQ,GAAGZ,QAAS,EACZY,EAAGJ,KAAKM,OAAO,WAKnBC,eAAiB,SAASxB,EAAQC,GACjC,GAAIC,GAAMD,EAAO,EAEjB,OAAOH,MAAKH,MAAM,IAAIO,QAEvBuB,cAAgB,SAASzB,EAAQC,GAChC,GAAIC,GAAMD,EAAO,GAAIyB,EAAMzB,EAAO,EAElCH,MAAKF,QAAQ,IAAIM,GAAOwB,GAEzBC,WAAa,WACZ,GAAIvB,GAAKsB,CAET,KAAItB,IAAON,MAAKH,MACXG,KAAKH,MAAMoB,eAAeX,KAC9BsB,EAAM5B,KAAKF,QAAQQ,IAAQ,OAE3BN,KAAK8B,KAAK,QAAQF,EAAIG,eAAgBzB,EAAI0B,OAAO,QAKpDrC,IAAGsC,YAAY,GAAIvC,KAEhBwC"}

View file

@ -1 +1,2 @@
!function(a){var b=xe.createPlugin("list",{API_SHOW_LIST:function(b,c){var d,e,f,g,h,i,j,k,l,m,n=c[0];if(d=this.cast("GET_IMAGES",[n]),d.length)for(e=a("#zone_list_gallery_"+n).empty(),width=e.innerWidth(),f=0,g=d.length;g>f;f++)h=d[f],j=h.$obj.prop("width"),l=h.$obj.prop("height"),0==j&&(j=h.$obj.attr("width")),0==l&&(l=h.$obj.attr("height")),j>width-25&&(k=width-25,i=k/j,m=Math.floor(l*i),j=k,l=m,h.$obj.attr("rel","xe_gallery")),e.append(h.$obj),h.$obj.css({width:j+"px",height:l,margin:"0 10px",display:"block"})}}),c=xe.getApp("Gallery")[0];c&&c.registerPlugin(new b)}(jQuery);
!function(a){var b=xe.createPlugin("list",{API_SHOW_LIST:function(b,c){var d,e,f,g,h,i,j,k,l,m,n=c[0];if(d=this.cast("GET_IMAGES",[n]),d.length)for(e=a("#zone_list_gallery_"+n).empty(),width=e.innerWidth(),f=0,g=d.length;g>f;f++)h=d[f],j=h.$obj.prop("width"),l=h.$obj.prop("height"),0==j&&(j=h.$obj.attr("width")),0==l&&(l=h.$obj.attr("height")),j>width-25&&(k=width-25,i=k/j,m=Math.floor(l*i),j=k,l=m,h.$obj.attr("rel","xe_gallery")),e.append(h.$obj),h.$obj.css({width:j+"px",height:l,margin:"0 10px",display:"block"})}}),c=xe.getApp("Gallery")[0];c&&c.registerPlugin(new b)}(jQuery);
//# sourceMappingURL=list_gallery.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"list_gallery.min.js","sources":["list_gallery.js"],"names":["$","listShow","xe","createPlugin","API_SHOW_LIST","sender","params","imgs","$zone","i","c","im","scale","w1","w2","h1","h2","srl","this","cast","length","empty","width","innerWidth","$obj","prop","attr","Math","floor","append","css","height","margin","display","gallery","getApp","registerPlugin","jQuery"],"mappings":"CAMA,SAAUA,GAEV,GAAIC,GAAWC,GAAGC,aAAa,QAC9BC,cAAgB,SAASC,EAAQC,GAChC,GAAqBC,GAAMC,EAAOC,EAAGC,EAAGC,EAAIC,EAAOC,EAAIC,EAAIC,EAAIC,EAA3DC,EAAMX,EAAO,EAIjB,IAFAC,EAAOW,KAAKC,KAAK,cAAeF,IAE5BV,EAAKa,OAKT,IAHAZ,EAAQR,EAAE,sBAAsBiB,GAAKI,QACrCC,MAAQd,EAAMe,aAEVd,EAAE,EAAEC,EAAEH,EAAKa,OAAYV,EAAJD,EAAOA,IAC7BE,EAAKJ,EAAKE,GACVI,EAAKF,EAAGa,KAAKC,KAAK,SAClBV,EAAKJ,EAAGa,KAAKC,KAAK,UAER,GAANZ,IACHA,EAAKF,EAAGa,KAAKE,KAAK,UAEX,GAALX,IACFA,EAAKJ,EAAGa,KAAKE,KAAK,WAGhBb,EAAKS,MAAQ,KACfR,EAAKQ,MAAQ,GACbV,EAASE,EAAKD,EACdG,EAAKW,KAAKC,MAAMb,EAAKH,GAErBC,EAAKC,EAAIC,EAAKC,EACdL,EAAGa,KAAKE,KAAK,MAAO,eAGrBlB,EAAMqB,OAAOlB,EAAGa,MAChBb,EAAGa,KAAKM,KAAKR,MAAMT,EAAG,KAAMkB,OAAOhB,EAAIiB,OAAO,SAAUC,QAAQ,aAK/DC,EAAUhC,GAAGiC,OAAO,WAAW,EAChCD,IAASA,EAAQE,eAAe,GAAInC,KAEpCoC"}

View file

@ -1 +1,2 @@
function getSlideShow(){var a,b,c,d,e,f,g,h,i="";if("undefined"!=typeof opener){a=opener.editorPrevNode,b=jQuery(a),b.is("img")&&(selected_node=a,c=b.width(),d=b.attr("gallery_style"),e=b.attr("gallery_align")||"center",f=b.attr("border_color"),g=b.attr("bg_color"),h=b.attr("border_thickness")||1,get_by_id("width").value=c,get_by_id("gallery_style").selectedIndex="list"==d?1:0,get_by_id("gallery_align").selectedIndex="left"==e?1:"right"==e?2:0,get_by_id("border_thickness").value=h,get_by_id("border_color_input").value=f,get_by_id("bg_color_input").value=g,i=b.attr("images_list"));var j=get_by_id("fo"),k=j.editor_sequence.value,l=opener.get_by_id("uploaded_file_list_"+k);if(l)for(var m=get_by_id("image_list"),n=0;n<l.length;n++){var o=l.options[n],p=o.value;if(!p)return;var q=opener.uploadedFiles[p],r=q.download_url.replace(request_uri,"");if(/(jpg|jpeg|gif|png)$/i.test(r)){var s=!1;-1!=i.indexOf(r)&&(s=!0);var o=new Option(o.text,o.value,!1,s);m.options.add(o)}}}}function insertSlideShow(){if("undefined"!=typeof opener){for(var a=new Array,b=get_by_id("image_list"),c=0;c<b.length;c++){var d=b.options[c];if(d.selected){var e=d.value,f=opener.uploadedFiles[e],g=f.download_url.replace(request_uri,"");a[a.length]=g}}if(!a.length)return void window.close();for(var h=get_by_id("width").value,i=get_by_id("gallery_style").options[get_by_id("gallery_style").selectedIndex].value,j=get_by_id("gallery_align").options[get_by_id("gallery_align").selectedIndex].value,k=get_by_id("border_thickness").value,l=get_by_id("border_color_input").value,m=get_by_id("bg_color_input").value,n="",c=0;c<a.length;c++)n+=a[c].trim()+" ";if(selected_node)selected_node.setAttribute("width",h),selected_node.setAttribute("gallery_style",i),selected_node.setAttribute("align",j),selected_node.setAttribute("gallery_align",j),selected_node.setAttribute("border_thickness",k),selected_node.setAttribute("border_color",l),selected_node.setAttribute("bg_color",m),selected_node.setAttribute("images_list",n),selected_node.style.width=h+"px";else{var o='<img src="../../../../common/img/blank.gif" editor_component="image_gallery" width="'+h+'" gallery_style="'+i+'" align="'+j+'" gallery_align="'+j+'" border_thickness="'+k+'" border_color="'+l+'" bg_color="'+m+'" style="width:'+h+'px;border:2px dotted #4371B9;background:url(./modules/editor/components/image_gallery/tpl/image_gallery_component.gif) no-repeat center;" images_list="'+n+'" />';opener.editorFocus(opener.editorPrevSrl);var p=opener.editorGetIFrame(opener.editorPrevSrl);opener.editorReplaceHTML(p,o)}opener.editorFocus(opener.editorPrevSrl),window.close()}}function select_color(a,b){get_by_id(a+"_preview_color").style.backgroundColor="#"+b,get_by_id(a+"_color_input").value=b}var selected_node=null;jQuery(function(){getSlideShow()});
function getSlideShow(){var a,b,c,d,e,f,g,h,i="";if("undefined"!=typeof opener){a=opener.editorPrevNode,b=jQuery(a),b.is("img")&&(selected_node=a,c=b.width(),d=b.attr("gallery_style"),e=b.attr("gallery_align")||"center",f=b.attr("border_color"),g=b.attr("bg_color"),h=b.attr("border_thickness")||1,get_by_id("width").value=c,get_by_id("gallery_style").selectedIndex="list"==d?1:0,get_by_id("gallery_align").selectedIndex="left"==e?1:"right"==e?2:0,get_by_id("border_thickness").value=h,get_by_id("border_color_input").value=f,get_by_id("bg_color_input").value=g,i=b.attr("images_list"));var j=get_by_id("fo"),k=j.editor_sequence.value,l=opener.get_by_id("uploaded_file_list_"+k);if(l)for(var m=get_by_id("image_list"),n=0;n<l.length;n++){var o=l.options[n],p=o.value;if(!p)return;var q=opener.uploadedFiles[p],r=q.download_url.replace(request_uri,"");if(/(jpg|jpeg|gif|png)$/i.test(r)){var s=!1;-1!=i.indexOf(r)&&(s=!0);var o=new Option(o.text,o.value,!1,s);m.options.add(o)}}}}function insertSlideShow(){if("undefined"!=typeof opener){for(var a=new Array,b=get_by_id("image_list"),c=0;c<b.length;c++){var d=b.options[c];if(d.selected){var e=d.value,f=opener.uploadedFiles[e],g=f.download_url.replace(request_uri,"");a[a.length]=g}}if(!a.length)return void window.close();for(var h=get_by_id("width").value,i=get_by_id("gallery_style").options[get_by_id("gallery_style").selectedIndex].value,j=get_by_id("gallery_align").options[get_by_id("gallery_align").selectedIndex].value,k=get_by_id("border_thickness").value,l=get_by_id("border_color_input").value,m=get_by_id("bg_color_input").value,n="",c=0;c<a.length;c++)n+=a[c].trim()+" ";if(selected_node)selected_node.setAttribute("width",h),selected_node.setAttribute("gallery_style",i),selected_node.setAttribute("align",j),selected_node.setAttribute("gallery_align",j),selected_node.setAttribute("border_thickness",k),selected_node.setAttribute("border_color",l),selected_node.setAttribute("bg_color",m),selected_node.setAttribute("images_list",n),selected_node.style.width=h+"px";else{var o='<img src="../../../../common/img/blank.gif" editor_component="image_gallery" width="'+h+'" gallery_style="'+i+'" align="'+j+'" gallery_align="'+j+'" border_thickness="'+k+'" border_color="'+l+'" bg_color="'+m+'" style="width:'+h+'px;border:2px dotted #4371B9;background:url(./modules/editor/components/image_gallery/tpl/image_gallery_component.gif) no-repeat center;" images_list="'+n+'" />';opener.editorFocus(opener.editorPrevSrl);var p=opener.editorGetIFrame(opener.editorPrevSrl);opener.editorReplaceHTML(p,o)}opener.editorFocus(opener.editorPrevSrl),window.close()}}function select_color(a,b){get_by_id(a+"_preview_color").style.backgroundColor="#"+b,get_by_id(a+"_color_input").value=b}var selected_node=null;jQuery(function(){getSlideShow()});
//# sourceMappingURL=popup.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"popup.min.js","sources":["popup.js"],"names":["getSlideShow","node","$node","width","style","align","border_color","bg_color","thickness","selected_images","opener","editorPrevNode","jQuery","is","selected_node","attr","get_by_id","value","selectedIndex","fo","editor_sequence","parent_list_obj","list_obj","i","length","opt","options","file_srl","file_obj","uploadedFiles","filename","download_url","replace","request_uri","test","selected","indexOf","Option","text","add","insertSlideShow","list","Array","window","close","gallery_style","gallery_align","border_thickness","images_list","trim","setAttribute","editorFocus","editorPrevSrl","iframe_obj","editorGetIFrame","editorReplaceHTML","select_color","type","code","backgroundColor"],"mappings":"AACA,QAASA,gBACR,GAAIC,GAAMC,EAA6BC,EAAOC,EAAOC,EAAOC,EAAcC,EAAUC,EAAnEC,EAAkB,EAGhC,IAAmB,mBAAV,QAAT,CAGAR,EAAQS,OAAOC,eAClBT,EAAQU,OAAOX,GACTC,EAAMW,GAAG,SACRC,cAAgBb,EAEhBE,E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UAAUyC,EAAK,gBAAgBxC,MAAQyC,EAnHzC,GAAI5C,eAAgB,IAsHpBF,QAAO,WACNZ"}

View file

@ -1 +1,2 @@
!function(a){var b=xe.createPlugin("slideShow",{_holders:{},_thumbs:{},_current:{},init:function(){this._holders={},this._thumbs={},this._current={}},API_SHOW_SLIDE:function(b,c){var d,e,f,g,h,i,j=this,k=c[0],l="@"+k;if(d=this.cast("GET_IMAGES",[k]),d.length){for(var h=0,m=d.length;m>h;h++)if(!d[h].loaded)return void setTimeout(function(){j.cast("SHOW_SLIDE",c)},200);for(e=a("#zone_slide_gallery_"+k),g=e.find(".slide_gallery_placeholder").css("overflow","hidden"),e.find(".slide_gallery_loading_text").remove(),f=e.find(".slide_gallery_thumbnail_image_box").show(),h=0,i=d.length;i>h;h++)d[h].$obj.clone().css({cursor:"pointer",width:"60px",height:"60px",margin:"5px",opacity:.5}).click({idx:h},function(a){j.cast("SET_SLIDE",[k,a.data.idx])}).appendTo(f);a("#zone_gallery_navigator_status_"+k).click(function(){f.toggle()}),e.find(".__prev").click(function(){return j.cast("PREV_SLIDE",[k]),!1}).end().find(".__next").click(function(){return j.cast("NEXT_SLIDE",[k]),!1}),this._holders[l]=g,this._thumbs[l]=f,this._current[l]=0,this.cast("SET_SLIDE",[k,0])}},_showSideSlide:function(a,b){var c,d,e;c=this.cast("GET_IMAGES",[a]),c.length&&(d=this._current["@"+a],e=d+b,0>e?e=c.length-1:e>=c.length&&(e=0),this.cast("SET_SLIDE",[a,e]))},API_NEXT_SLIDE:function(a,b){this._showSideSlide(b[0],1)},API_PREV_SLIDE:function(a,b){this._showSideSlide(b[0],-1)},API_SET_SLIDE:function(b,c){var d,e,f,g,h,i,j,k,l,m=c[0],n=c[1];d=this.cast("GET_IMAGES",[m]),d.length&&is_def(e=d[n])&&(this._current["@"+m]=n,a("#zone_gallery_navigator_status_"+m).text(n+1+"/"+d.length),this._thumbs["@"+m].find("img").eq(n).animate({opacity:1}).end().not(":eq("+n+")").animate({opacity:.5}),f=this._holders["@"+m],g=f.parent().innerWidth(),h=e.$obj.prop("width"),j=e.$obj.prop("height"),0==h&&(h=e.$obj.attr("width")),0==j&&(j=e.$obj.attr("height")),h>g-20&&(i=g-20,l=i/h,k=Math.floor(j*l),h=i,j=k,e.$obj.css("cursor","pointer"),e.$obj.attr("rel","xe_gallery")),e.$obj.css({width:h,height:j,margin:"0 10px"}),f.empty().append(e.$obj))}}),c=xe.getApp("Gallery")[0];c&&c.registerPlugin(new b)}(jQuery);
!function(a){var b=xe.createPlugin("slideShow",{_holders:{},_thumbs:{},_current:{},init:function(){this._holders={},this._thumbs={},this._current={}},API_SHOW_SLIDE:function(b,c){var d,e,f,g,h,i,j=this,k=c[0],l="@"+k;if(d=this.cast("GET_IMAGES",[k]),d.length){for(var h=0,m=d.length;m>h;h++)if(!d[h].loaded)return void setTimeout(function(){j.cast("SHOW_SLIDE",c)},200);for(e=a("#zone_slide_gallery_"+k),g=e.find(".slide_gallery_placeholder").css("overflow","hidden"),e.find(".slide_gallery_loading_text").remove(),f=e.find(".slide_gallery_thumbnail_image_box").show(),h=0,i=d.length;i>h;h++)d[h].$obj.clone().css({cursor:"pointer",width:"60px",height:"60px",margin:"5px",opacity:.5}).click({idx:h},function(a){j.cast("SET_SLIDE",[k,a.data.idx])}).appendTo(f);a("#zone_gallery_navigator_status_"+k).click(function(){f.toggle()}),e.find(".__prev").click(function(){return j.cast("PREV_SLIDE",[k]),!1}).end().find(".__next").click(function(){return j.cast("NEXT_SLIDE",[k]),!1}),this._holders[l]=g,this._thumbs[l]=f,this._current[l]=0,this.cast("SET_SLIDE",[k,0])}},_showSideSlide:function(a,b){var c,d,e;c=this.cast("GET_IMAGES",[a]),c.length&&(d=this._current["@"+a],e=d+b,0>e?e=c.length-1:e>=c.length&&(e=0),this.cast("SET_SLIDE",[a,e]))},API_NEXT_SLIDE:function(a,b){this._showSideSlide(b[0],1)},API_PREV_SLIDE:function(a,b){this._showSideSlide(b[0],-1)},API_SET_SLIDE:function(b,c){var d,e,f,g,h,i,j,k,l,m=c[0],n=c[1];d=this.cast("GET_IMAGES",[m]),d.length&&is_def(e=d[n])&&(this._current["@"+m]=n,a("#zone_gallery_navigator_status_"+m).text(n+1+"/"+d.length),this._thumbs["@"+m].find("img").eq(n).animate({opacity:1}).end().not(":eq("+n+")").animate({opacity:.5}),f=this._holders["@"+m],g=f.parent().innerWidth(),h=e.$obj.prop("width"),j=e.$obj.prop("height"),0==h&&(h=e.$obj.attr("width")),0==j&&(j=e.$obj.attr("height")),h>g-20&&(i=g-20,l=i/h,k=Math.floor(j*l),h=i,j=k,e.$obj.css("cursor","pointer"),e.$obj.attr("rel","xe_gallery")),e.$obj.css({width:h,height:j,margin:"0 10px"}),f.empty().append(e.$obj))}}),c=xe.getApp("Gallery")[0];c&&c.registerPlugin(new b)}(jQuery);
//# sourceMappingURL=slide_gallery.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"slide_gallery.min.js","sources":["slide_gallery.js"],"names":["$","slideShow","xe","createPlugin","_holders","_thumbs","_current","init","this","API_SHOW_SLIDE","sender","params","imgs","$zone","$thumb","$holder","i","c","self","srl","key","cast","length","nLen","loaded","setTimeout","find","css","remove","show","$obj","clone","cursor","width","height","margin","opacity","click","idx","event","data","appendTo","toggle","end","_showSideSlide","pos","cur","side","API_NEXT_SLIDE","API_PREV_SLIDE","API_SET_SLIDE","im","iwidth","w1","w2","h1","h2","scale","is_def","text","eq","animate","not","parent","innerWidth","prop","attr","Math","floor","empty","append","gallery","getApp","registerPlugin","jQuery"],"mappings":"CAMA,SAAUA,GAEV,GAAIC,GAAYC,GAAGC,aAAa,aAC/BC,YACAC,WACAC,YAEAC,KAAO,WACNC,KAAKJ,YACLI,KAAKH,WACLG,KAAKF,aAGNG,eAAiB,SAASC,EAAQC,GACjC,GAA+CC,GAAMC,EAAOC,EAAQC,EAASC,EAAGC,EAA5EC,EAAKV,KAAMW,EAAMR,EAAO,GAAIS,EAAM,IAAID,CAG1C,IADAP,EAAOJ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GAAIxE,KAEpCyE"}

View file

@ -1,4 +1,4 @@
<filter name="insert_poll" module="poll" act="procInsert" confirm_msg_code="confirm_submit">
<filter name="insert_poll" module="poll" act="procPollInsert" confirm_msg_code="confirm_submit">
<form />
<parameter />
<response callback_func="completeInsertPoll">

View file

@ -1 +1,2 @@
function editorStartTextarea(a,b,c){var d=xGetElementById("editor_"+a),e=xGetElementById("htm_"+a).value;d.form.setAttribute("editor_sequence",a),d.style.width="100%",editorRelKeys[a]=new Array,editorRelKeys[a].primary=d.form[c],editorRelKeys[a].content=d.form[b],editorRelKeys[a].func=editorGetContentTextarea;var f=d.form[b].value;e&&(f=f.replace(/<br([^>]*)>/gi,"\n"),"br"!=e&&(f=f.replace(/&lt;/g,"<"),f=f.replace(/&gt;/g,">"),f=f.replace(/&quot;/g,'"'),f=f.replace(/&amp;/g,"&"))),d.value=f}function editorGetContentTextarea(a){var b=xGetElementById("editor_"+a),c=xGetElementById("htm_"+a).value,d=b.value.trim();return c&&("br"!=c&&(d=d.replace(/&/g,"&amp;"),d=d.replace(/</g,"&lt;"),d=d.replace(/>/g,"&gt;"),d=d.replace(/\"/g,"&quot;")),d=d.replace(/(\r\n|\n)/g,"<br />")),d}
function editorStartTextarea(a,b,c){var d=xGetElementById("editor_"+a),e=xGetElementById("htm_"+a).value;d.form.setAttribute("editor_sequence",a),d.style.width="100%",editorRelKeys[a]=new Array,editorRelKeys[a].primary=d.form[c],editorRelKeys[a].content=d.form[b],editorRelKeys[a].func=editorGetContentTextarea;var f=d.form[b].value;e&&(f=f.replace(/<br([^>]*)>/gi,"\n"),"br"!=e&&(f=f.replace(/&lt;/g,"<"),f=f.replace(/&gt;/g,">"),f=f.replace(/&quot;/g,'"'),f=f.replace(/&amp;/g,"&"))),d.value=f}function editorGetContentTextarea(a){var b=xGetElementById("editor_"+a),c=xGetElementById("htm_"+a).value,d=b.value.trim();return c&&("br"!=c&&(d=d.replace(/&/g,"&amp;"),d=d.replace(/</g,"&lt;"),d=d.replace(/>/g,"&gt;"),d=d.replace(/\"/g,"&quot;")),d=d.replace(/(\r\n|\n)/g,"<br />")),d}
//# sourceMappingURL=xe_textarea.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"xe_textarea.min.js","sources":["xe_textarea.js"],"names":["editorStartTextarea","editor_sequence","content_key","primary_key","obj","xGetElementById","use_html","value","form","setAttribute","style","width","editorRelKeys","Array","editorGetContentTextarea","content","replace","trim"],"mappings":"AAAA,QAASA,qBAAoBC,EAAiBC,EAAaC,GACvD,GAAIC,GAAMC,gBAAgB,UAAUJ,GAChCK,EAAWD,gBAAgB,OAAOJ,GAAiBM,KACvDH,GAAII,KAAKC,aAAa,kBAAmBR,GAEzCG,EAAIM,MAAMC,MAAQ,OAElBC,cAAcX,GAAmB,GAAIY,OACrCD,cAAcX,GAA0B,QAAIG,EAAII,KAAKL,GACrDS,cAAcX,GAA0B,QAAIG,EAAII,KAAKN,GACrDU,cAAcX,GAAuB,KAAIa,wBAEzC,IAAIC,GAAUX,EAAII,KAAKN,GAAaK,KACjCD,KACCS,EAAUA,EAAQC,QAAQ,gBAAgB,MAC7B,MAAVV,IACCS,EAAUA,EAAQC,QAAQ,QAAS,KACnCD,EAAUA,EAAQC,QAAQ,QAAS,KACnCD,EAAUA,EAAQC,QAAQ,UAAW,KACrCD,EAAUA,EAAQC,QAAQ,SAAU,OAG5CZ,EAAIG,MAAQQ,EAGhB,QAASD,0BAAyBb,GAC9B,GAAIG,GAAMC,gBAAgB,UAAUJ,GAChCK,EAAWD,gBAAgB,OAAOJ,GAAiBM,MACnDQ,EAAUX,EAAIG,MAAMU,MAUxB,OATGX,KACc,MAAVA,IACCS,EAAUA,EAAQC,QAAQ,KAAM,SAChCD,EAAUA,EAAQC,QAAQ,KAAM,QAChCD,EAAUA,EAAQC,QAAQ,KAAM,QAChCD,EAAUA,EAAQC,QAAQ,MAAO,WAErCD,EAAUA,EAAQC,QAAQ,aAAc,WAErCD"}

View file

@ -1,7 +1,5 @@
/*! Copyright (C) NAVER <http://www.navercorp.com> */
/**!
* @file common.js + js_app.js + xml_handler.js + xml_js_filter.js
* @brief XE Common JavaScript
* @concat Xpress_Editor.js + xe_interface.js
**/
(function($){

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1,2 @@
function getEditorSkinColorList(a,b,c,d){if(a.length>0){c=c||"document";var e=new Array("error","message","colorset");exec_xml("editor","dispEditorSkinColorset",{skin:a},resultGetEditorSkinColorList,e,{selected_colorset:b,type:c,testid:d})}}function resultGetEditorSkinColorList(a,b,c){var d=null;jQuery(function(b){if(d=c.testid?b("#"+c.testid).next("label").children("select"):b("document"==c.type?"select[name=sel_editor_colorset]":"select[name=sel_comment_editor_colorset]"),d.html(""),"document"==c.type?(b("select[name=sel_editor_colorset]").hide().removeAttr("name"),d.attr("name","sel_editor_colorset")):(b("select[name=sel_comment_editor_colorset]").hide().removeAttr("name"),d.attr("name","sel_comment_editor_colorset")),0==a.error&&a.colorset){var e=[],f=a.colorset.item;"undefined"==typeof f[0]?e[0]=f:e=f;for(var g=0;g<e.length;g++){var h=b('<option value="'+e[g].name+'" >'+e[g].title+"</option>");c.selected_colorset==e[g].name&&h.attr("selected","selected"),d.append(h)}d.show()}else d.hide(),d.html("")})}
function getEditorSkinColorList(a,b,c,d){if(a.length>0){c=c||"document";var e=new Array("error","message","colorset");exec_xml("editor","dispEditorSkinColorset",{skin:a},resultGetEditorSkinColorList,e,{selected_colorset:b,type:c,testid:d})}}function resultGetEditorSkinColorList(a,b,c){var d=null;jQuery(function(b){if(d=c.testid?b("#"+c.testid).next("label").children("select"):b("document"==c.type?"select[name=sel_editor_colorset]":"select[name=sel_comment_editor_colorset]"),d.html(""),"document"==c.type?(b("select[name=sel_editor_colorset]").hide().removeAttr("name"),d.attr("name","sel_editor_colorset")):(b("select[name=sel_comment_editor_colorset]").hide().removeAttr("name"),d.attr("name","sel_comment_editor_colorset")),0==a.error&&a.colorset){var e=[],f=a.colorset.item;"undefined"==typeof f[0]?e[0]=f:e=f;for(var g=0;g<e.length;g++){var h=b('<option value="'+e[g].name+'" >'+e[g].title+"</option>");c.selected_colorset==e[g].name&&h.attr("selected","selected"),d.append(h)}d.show()}else d.hide(),d.html("")})}
//# sourceMappingURL=editor_module_config.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"editor_module_config.min.js","sources":["editor_module_config.js"],"names":["getEditorSkinColorList","skin_name","selected_colorset","type","testid","length","response_tags","Array","exec_xml","skin","resultGetEditorSkinColorList","ret_obj","params","selectbox","jQuery","$","next","children","html","hide","removeAttr","attr","error","colorset","it","items","item","i","$options","name","title","append","show"],"mappings":"AAAA,QAASA,wBAAuBC,EAAUC,EAAkBC,EAAKC,GAChE,GAAGH,EAAUI,OAAO,EAAE,CACrBF,EAAOA,GAAQ,UACf,IAAIG,GAAgB,GAAIC,OAAM,QAAQ,UAAU,WAChDC,UAAS,SAAS,0BAA0BC,KAAKR,GAAWS,6BAA6BJ,GAAeJ,kBAAoBA,EAAkBC,KAAOA,EAAKC,OAASA,KAIrK,QAASM,8BAA6BC,EAAQL,EAAeM,GAC5D,GAAIC,GAAY,IAChBC,QAAO,SAASC,GAmBf,GAjBCF,EADED,EAAOR,OACGW,EAAE,IAAIH,EAAOR,QAAQY,KAAK,SAASC,SAAS,UAEdF,EAAd,YAAfH,EAAOT,KAAwB,mCAAwC,4CAErFU,EAAUK,KAAK,IAEG,YAAfN,EAAOT,MACTY,EAAE,oCAAoCI,OACpCC,WAAW,QACbP,EAAUQ,KAAK,OAAO,yBAEtBN,EAAE,4CAA4CI,OAC5CC,WAAW,QACbP,EAAUQ,KAAK,OAAO,gCAIH,GAAjBV,EAAQW,OAAcX,EAAQY,SAAS,CACzC,GAAIC,MACAC,EAAQd,EAAQY,SAASG,IACN,oBAAbD,GAAM,GACfD,EAAG,GAAKC,EAERD,EAAKC,CAIN,KAAI,GAAIE,GAAE,EAAEA,EAAEH,EAAGnB,OAAOsB,IAAI,CAC3B,GAAIC,GAAWb,EAAE,kBAAkBS,EAAGG,GAAGE,KAAK,MAAML,EAAGG,GAAGG,MAAM,YAE7DlB,GAAOV,mBAAqBsB,EAAGG,GAAGE,MACpCD,EAASP,KAAK,WAAY,YAG3BR,EAAUkB,OAAOH,GAElBf,EAAUmB,WAEVnB,GAAUM,OACVN,EAAUK,KAAK"}

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