39 | _tpl_vars;
40 | $this->_smarty_include(array('smarty_include_tpl_file' => "menus.html", 'smarty_include_vars' => array()));
41 | $this->_tpl_vars = $_smarty_tpl_vars;
42 | unset($_smarty_tpl_vars);
43 | ?>
44 |
66 |
67 |
--------------------------------------------------------------------------------
/themes/default/templates/header.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
19 | {if $show.user.userId<1}
20 |
29 | {/if}
30 | {if $show.user.userId>0}
31 |
47 | {/if}
48 |
49 |
50 |
--------------------------------------------------------------------------------
/libs/internals/core.rm_auto.php:
--------------------------------------------------------------------------------
1 | $params['auto_base'],
28 | 'level' => 0,
29 | 'exp_time' => $params['exp_time']
30 | );
31 | require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
32 | $_res = smarty_core_rmdir($_params, $smarty);
33 | } else {
34 | $_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']);
35 |
36 | if(isset($params['auto_source'])) {
37 | if (isset($params['extensions'])) {
38 | $_res = false;
39 | foreach ((array)$params['extensions'] as $_extension)
40 | $_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']);
41 | } else {
42 | $_res = $smarty->_unlink($_tname, $params['exp_time']);
43 | }
44 | } elseif ($smarty->use_sub_dirs) {
45 | $_params = array(
46 | 'dirname' => $_tname,
47 | 'level' => 1,
48 | 'exp_time' => $params['exp_time']
49 | );
50 | require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
51 | $_res = smarty_core_rmdir($_params, $smarty);
52 | } else {
53 | // remove matching file names
54 | $_handle = opendir($params['auto_base']);
55 | $_res = true;
56 | while (false !== ($_filename = readdir($_handle))) {
57 | if($_filename == '.' || $_filename == '..') {
58 | continue;
59 | } elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) {
60 | $_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']);
61 | }
62 | }
63 | }
64 | }
65 |
66 | return $_res;
67 | }
68 |
69 | /* vim: set expandtab: */
70 |
71 | ?>
72 |
--------------------------------------------------------------------------------
/libs/internals/core.process_cached_inserts.php:
--------------------------------------------------------------------------------
1 | _smarty_md5.'{insert_cache (.*)}'.$smarty->_smarty_md5.'!Uis',
17 | $params['results'], $match);
18 | list($cached_inserts, $insert_args) = $match;
19 |
20 | for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) {
21 | if ($smarty->debugging) {
22 | $_params = array();
23 | require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
24 | $debug_start_time = smarty_core_get_microtime($_params, $smarty);
25 | }
26 |
27 | $args = unserialize($insert_args[$i]);
28 | $name = $args['name'];
29 |
30 | if (isset($args['script'])) {
31 | $_params = array('resource_name' => $smarty->_dequote($args['script']));
32 | require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
33 | if(!smarty_core_get_php_resource($_params, $smarty)) {
34 | return false;
35 | }
36 | $resource_type = $_params['resource_type'];
37 | $php_resource = $_params['php_resource'];
38 |
39 |
40 | if ($resource_type == 'file') {
41 | $smarty->_include($php_resource, true);
42 | } else {
43 | $smarty->_eval($php_resource);
44 | }
45 | }
46 |
47 | $function_name = $smarty->_plugins['insert'][$name][0];
48 | if (empty($args['assign'])) {
49 | $replace = $function_name($args, $smarty);
50 | } else {
51 | $smarty->assign($args['assign'], $function_name($args, $smarty));
52 | $replace = '';
53 | }
54 |
55 | $params['results'] = substr_replace($params['results'], $replace, strpos($params['results'], $cached_inserts[$i]), strlen($cached_inserts[$i]));
56 | if ($smarty->debugging) {
57 | $_params = array();
58 | require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
59 | $smarty->_smarty_debug_info[] = array('type' => 'insert',
60 | 'filename' => 'insert_'.$name,
61 | 'depth' => $smarty->_inclusion_depth,
62 | 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $debug_start_time);
63 | }
64 | }
65 |
66 | return $params['results'];
67 | }
68 |
69 | /* vim: set expandtab: */
70 |
71 | ?>
72 |
--------------------------------------------------------------------------------
/libs/internals/core.get_php_resource.php:
--------------------------------------------------------------------------------
1 | trusted_dir;
22 | $smarty->_parse_resource_name($params, $smarty);
23 |
24 | /*
25 | * Find out if the resource exists.
26 | */
27 |
28 | if ($params['resource_type'] == 'file') {
29 | $_readable = false;
30 | if(file_exists($params['resource_name']) && is_readable($params['resource_name'])) {
31 | $_readable = true;
32 | } else {
33 | // test for file in include_path
34 | $_params = array('file_path' => $params['resource_name']);
35 | require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
36 | if(smarty_core_get_include_path($_params, $smarty)) {
37 | $_include_path = $_params['new_file_path'];
38 | $_readable = true;
39 | }
40 | }
41 | } else if ($params['resource_type'] != 'file') {
42 | $_template_source = null;
43 | $_readable = is_callable($smarty->_plugins['resource'][$params['resource_type']][0][0])
44 | && call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][0],
45 | array($params['resource_name'], &$_template_source, &$smarty));
46 | }
47 |
48 | /*
49 | * Set the error function, depending on which class calls us.
50 | */
51 | if (method_exists($smarty, '_syntax_error')) {
52 | $_error_funcc = '_syntax_error';
53 | } else {
54 | $_error_funcc = 'trigger_error';
55 | }
56 |
57 | if ($_readable) {
58 | if ($smarty->security) {
59 | require_once(SMARTY_CORE_DIR . 'core.is_trusted.php');
60 | if (!smarty_core_is_trusted($params, $smarty)) {
61 | $smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted');
62 | return false;
63 | }
64 | }
65 | } else {
66 | $smarty->$_error_funcc($params['resource_type'] . ':' . $params['resource_name'] . ' is not readable');
67 | return false;
68 | }
69 |
70 | if ($params['resource_type'] == 'file') {
71 | $params['php_resource'] = $params['resource_name'];
72 | } else {
73 | $params['php_resource'] = $_template_source;
74 | }
75 | return true;
76 | }
77 |
78 | /* vim: set expandtab: */
79 |
80 | ?>
81 |
--------------------------------------------------------------------------------
/templates_c/%%1A^1AB^1AB9BADF%%login.html.php:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
XSS Platform
8 |
9 |
11 |
13 |
15 |
17 |
19 |
21 | function Login(){
22 | if($("#user").val()==""){
23 | ShowError("用户名不能为空");
24 | return false;
25 | }
26 | if($("#pwd").val()==""){
27 | ShowError("密码不能为空");
28 | return false;
29 | }
30 | }
31 | function ShowError(content){
32 | $("#contentShow").attr("class","error");
33 | $("#contentShow").html(content);
34 | }
35 |
36 | '; ?>
37 |
38 |
39 |
40 | _tpl_vars;
41 | $this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
42 | $this->_tpl_vars = $_smarty_tpl_vars;
43 | unset($_smarty_tpl_vars);
44 | ?>
45 |
46 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/libs/internals/core.create_dir_structure.php:
--------------------------------------------------------------------------------
1 | _dir_perms) && !is_dir($_new_dir)) {
69 | //$smarty->trigger_error("problem creating directory '" . $_new_dir . "'");
70 | //return false;
71 | }
72 | $_new_dir .= '/';
73 | }
74 | }
75 | }
76 |
77 | /* vim: set expandtab: */
78 |
79 | ?>
80 |
--------------------------------------------------------------------------------
/templates_c/%%95^95A^95A55B08%%project_create.html.php:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
XSS Platform
8 |
9 |
11 |
13 |
15 |
17 |
19 |
21 | function SubmitContent(){
22 | if($("#title").val()==""){
23 | ShowError("项目名称不能为空");
24 | return false;
25 | }
26 | $("#contentForm").submit();
27 | }
28 | function ShowError(content){
29 | $("#contentShow").attr("class","alert alert-danger");
30 | $("#contentShow").html(content);
31 | }
32 |
33 | '; ?>
34 |
35 |
36 |
37 | _tpl_vars;
38 | $this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
39 | $this->_tpl_vars = $_smarty_tpl_vars;
40 | unset($_smarty_tpl_vars);
41 | ?>
42 |
43 | _tpl_vars;
44 | $this->_smarty_include(array('smarty_include_tpl_file' => "menus.html", 'smarty_include_vars' => array()));
45 | $this->_tpl_vars = $_smarty_tpl_vars;
46 | unset($_smarty_tpl_vars);
47 | ?>
48 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/libs/internals/core.run_insert_handler.php:
--------------------------------------------------------------------------------
1 | debugging) {
19 | $_params = array();
20 | $_debug_start_time = smarty_core_get_microtime($_params, $smarty);
21 | }
22 |
23 | if ($smarty->caching) {
24 | $_arg_string = serialize($params['args']);
25 | $_name = $params['args']['name'];
26 | if (!isset($smarty->_cache_info['insert_tags'][$_name])) {
27 | $smarty->_cache_info['insert_tags'][$_name] = array('insert',
28 | $_name,
29 | $smarty->_plugins['insert'][$_name][1],
30 | $smarty->_plugins['insert'][$_name][2],
31 | !empty($params['args']['script']) ? true : false);
32 | }
33 | return $smarty->_smarty_md5."{insert_cache $_arg_string}".$smarty->_smarty_md5;
34 | } else {
35 | if (isset($params['args']['script'])) {
36 | $_params = array('resource_name' => $smarty->_dequote($params['args']['script']));
37 | require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
38 | if(!smarty_core_get_php_resource($_params, $smarty)) {
39 | return false;
40 | }
41 |
42 | if ($_params['resource_type'] == 'file') {
43 | $smarty->_include($_params['php_resource'], true);
44 | } else {
45 | $smarty->_eval($_params['php_resource']);
46 | }
47 | unset($params['args']['script']);
48 | }
49 |
50 | $_funcname = $smarty->_plugins['insert'][$params['args']['name']][0];
51 | $_content = $_funcname($params['args'], $smarty);
52 | if ($smarty->debugging) {
53 | $_params = array();
54 | require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
55 | $smarty->_smarty_debug_info[] = array('type' => 'insert',
56 | 'filename' => 'insert_'.$params['args']['name'],
57 | 'depth' => $smarty->_inclusion_depth,
58 | 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
59 | }
60 |
61 | if (!empty($params['args']["assign"])) {
62 | $smarty->assign($params['args']["assign"], $_content);
63 | } else {
64 | return $_content;
65 | }
66 | }
67 | }
68 |
69 | /* vim: set expandtab: */
70 |
71 | ?>
72 |
--------------------------------------------------------------------------------
/libs/plugins/outputfilter.trimwhitespace.php:
--------------------------------------------------------------------------------
1 |
12 | * Type: outputfilter
13 | * Name: trimwhitespace
14 | * Date: Jan 25, 2003
15 | * Purpose: trim leading white space and blank lines from
16 | * template source after it gets interpreted, cleaning
17 | * up code and saving bandwidth. Does not affect
18 | * <
> and blocks.
19 | * Install: Drop into the plugin directory, call
20 | *
$smarty->load_filter('output','trimwhitespace');
21 | * from application.
22 | * @author Monte Ohrt
23 | * @author Contributions from Lars Noschinski
24 | * @version 1.3
25 | * @param string
26 | * @param Smarty
27 | */
28 | function smarty_outputfilter_trimwhitespace($source, &$smarty)
29 | {
30 | // Pull out the script blocks
31 | preg_match_all("!!is", $source, $match);
32 | $_script_blocks = $match[0];
33 | $source = preg_replace("!!is",
34 | '@@@SMARTY:TRIM:SCRIPT@@@', $source);
35 |
36 | // Pull out the pre blocks
37 | preg_match_all("!]*?>.*? !is", $source, $match);
38 | $_pre_blocks = $match[0];
39 | $source = preg_replace("!]*?>.*? !is",
40 | '@@@SMARTY:TRIM:PRE@@@', $source);
41 |
42 | // Pull out the textarea blocks
43 | preg_match_all("!]*?>.*? !is", $source, $match);
44 | $_textarea_blocks = $match[0];
45 | $source = preg_replace("!]*?>.*? !is",
46 | '@@@SMARTY:TRIM:TEXTAREA@@@', $source);
47 |
48 | // remove all leading spaces, tabs and carriage returns NOT
49 | // preceeded by a php close tag.
50 | $source = trim(preg_replace('/((?)\n)[\s]+/m', '\1', $source));
51 |
52 | // replace textarea blocks
53 | smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:TEXTAREA@@@",$_textarea_blocks, $source);
54 |
55 | // replace pre blocks
56 | smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:PRE@@@",$_pre_blocks, $source);
57 |
58 | // replace script blocks
59 | smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:SCRIPT@@@",$_script_blocks, $source);
60 |
61 | return $source;
62 | }
63 |
64 | function smarty_outputfilter_trimwhitespace_replace($search_str, $replace, &$subject) {
65 | $_len = strlen($search_str);
66 | $_pos = 0;
67 | for ($_i=0, $_count=count($replace); $_i<$_count; $_i++)
68 | if (($_pos=strpos($subject, $search_str, $_pos))!==false)
69 | $subject = substr_replace($subject, $replace[$_i], $_pos, $_len);
70 | else
71 | break;
72 |
73 | }
74 |
75 | ?>
76 |
--------------------------------------------------------------------------------
/libs/plugins/function.math.php:
--------------------------------------------------------------------------------
1 |
13 | * Name: math
14 | * Purpose: handle math computations in template
15 | * @link http://smarty.php.net/manual/en/language.function.math.php {math}
16 | * (Smarty online manual)
17 | * @author Monte Ohrt
18 | * @param array
19 | * @param Smarty
20 | * @return string
21 | */
22 | function smarty_function_math($params, &$smarty)
23 | {
24 | // be sure equation parameter is present
25 | if (empty($params['equation'])) {
26 | $smarty->trigger_error("math: missing equation parameter");
27 | return;
28 | }
29 |
30 | // strip out backticks, not necessary for math
31 | $equation = str_replace('`','',$params['equation']);
32 |
33 | // make sure parenthesis are balanced
34 | if (substr_count($equation,"(") != substr_count($equation,")")) {
35 | $smarty->trigger_error("math: unbalanced parenthesis");
36 | return;
37 | }
38 |
39 | // match all vars in equation, make sure all are passed
40 | preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]+)!",$equation, $match);
41 | $allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10',
42 | 'max','min','pi','pow','rand','round','sin','sqrt','srand','tan');
43 |
44 | foreach($match[1] as $curr_var) {
45 | if ($curr_var && !in_array($curr_var, array_keys($params)) && !in_array($curr_var, $allowed_funcs)) {
46 | $smarty->trigger_error("math: function call $curr_var not allowed");
47 | return;
48 | }
49 | }
50 |
51 | foreach($params as $key => $val) {
52 | if ($key != "equation" && $key != "format" && $key != "assign") {
53 | // make sure value is not empty
54 | if (strlen($val)==0) {
55 | $smarty->trigger_error("math: parameter $key is empty");
56 | return;
57 | }
58 | if (!is_numeric($val)) {
59 | $smarty->trigger_error("math: parameter $key: is not numeric");
60 | return;
61 | }
62 | $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation);
63 | }
64 | }
65 |
66 | eval("\$smarty_math_result = ".$equation.";");
67 |
68 | if (empty($params['format'])) {
69 | if (empty($params['assign'])) {
70 | return $smarty_math_result;
71 | } else {
72 | $smarty->assign($params['assign'],$smarty_math_result);
73 | }
74 | } else {
75 | if (empty($params['assign'])){
76 | printf($params['format'],$smarty_math_result);
77 | } else {
78 | $smarty->assign($params['assign'],sprintf($params['format'],$smarty_math_result));
79 | }
80 | }
81 | }
82 |
83 | /* vim: set expandtab: */
84 |
85 | ?>
86 |
--------------------------------------------------------------------------------
/themes/default/templates/module_view.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | XSS Platform
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | {include file="header.html"}
15 |
16 | {include file="menus.html"}
17 |
18 |
19 |
查看模块信息
20 |
21 |
22 |
23 |
24 |
25 |
26 | 模块名称
27 |
28 |
29 |
30 | 模块描述
31 | {$module.description}
32 |
33 |
34 | 参数 (需要服务器接收的参数名)
35 |
40 |
41 |
42 | 配置参数 (使用此模块时需要配置的参数,如参数名为user,则代码引用:{literal}{set.user}{/literal})
43 |
48 |
49 |
50 | 代码 ({literal}{projectId}为项目id,{set.***}为***配置参数{/literal})
51 | {$module.code}
52 |
53 | {if $module.isOpen==0}
54 |
55 | 是否公开
56 | 私有
57 | 公开
58 |
59 |
60 | {/if}
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/templates_c/%%60^602^602CA7AB%%menus.html.php:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
8 |
9 |
10 | _tpl_vars['projects']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
11 | foreach ($_from as $this->_tpl_vars['v']):
12 | ?>
13 | _tpl_vars['v']['title']; ?>
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
26 |
27 |
28 | _tpl_vars['modules']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
29 | foreach ($_from as $this->_tpl_vars['v']):
30 | ?>
31 | _tpl_vars['v']['isOpen'] == 0 || ( $this->_tpl_vars['v']['isOpen'] == 1 && $this->_tpl_vars['v']['isAudit'] == 0 )): ?>
32 | _tpl_vars['v']['title']; ?>
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
45 |
46 |
47 | _tpl_vars['modules']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
48 | foreach ($_from as $this->_tpl_vars['v']):
49 | ?>
50 | _tpl_vars['v']['isOpen'] == 1 && $this->_tpl_vars['v']['isAudit'] == 1): ?>
51 | _tpl_vars['v']['title']; ?>
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/templates_c/%%71^714^714F4B17%%header.html.php:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
14 |
15 |
23 | _tpl_vars['show']['user']['userId'] < 1): ?>
24 |
35 |
36 | _tpl_vars['show']['user']['userId'] > 0): ?>
37 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/libs/plugins/modifier.escape.php:
--------------------------------------------------------------------------------
1 |
13 | * Name: escape
14 | * Purpose: Escape the string according to escapement type
15 | * @link http://smarty.php.net/manual/en/language.modifier.escape.php
16 | * escape (Smarty online manual)
17 | * @author Monte Ohrt
18 | * @param string
19 | * @param html|htmlall|url|quotes|hex|hexentity|javascript
20 | * @return string
21 | */
22 | function smarty_modifier_escape($string, $esc_type = 'html', $char_set = 'ISO-8859-1')
23 | {
24 | switch ($esc_type) {
25 | case 'html':
26 | return htmlspecialchars($string, ENT_QUOTES, $char_set);
27 |
28 | case 'htmlall':
29 | return htmlentities($string, ENT_QUOTES, $char_set);
30 |
31 | case 'url':
32 | return rawurlencode($string);
33 |
34 | case 'urlpathinfo':
35 | return str_replace('%2F','/',rawurlencode($string));
36 |
37 | case 'quotes':
38 | // escape unescaped single quotes
39 | return preg_replace("%(?'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n',''=>'<\/'));
66 |
67 | case 'mail':
68 | // safe way to display e-mail address on a web page
69 | return str_replace(array('@', '.'),array(' [AT] ', ' [DOT] '), $string);
70 |
71 | case 'nonstd':
72 | // escape non-standard chars, such as ms document quotes
73 | $_res = '';
74 | for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) {
75 | $_ord = ord(substr($string, $_i, 1));
76 | // non-standard char, escape it
77 | if($_ord >= 126){
78 | $_res .= '' . $_ord . ';';
79 | }
80 | else {
81 | $_res .= substr($string, $_i, 1);
82 | }
83 | }
84 | return $_res;
85 |
86 | default:
87 | return $string;
88 | }
89 | }
90 |
91 | /* vim: set expandtab: */
92 |
93 | ?>
94 |
--------------------------------------------------------------------------------
/templates_c/%%6D^6DE^6DE43985%%user_invite.html.php:
--------------------------------------------------------------------------------
1 |
3 | array(array('modifier', 'count', 'user_invite.html', 22, false),)), $this); ?>
5 |
6 |
7 |
8 |
9 | XSS Platform
10 |
11 |
13 |
15 |
17 |
19 |
21 |
22 |
23 | _tpl_vars;
24 | $this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
25 | $this->_tpl_vars = $_smarty_tpl_vars;
26 | unset($_smarty_tpl_vars);
27 | ?>
28 |
29 |
30 |
31 |
邀请码生成
32 |
33 |
未使用的邀请码
34 |
35 | 乌云币奖品邀请码 (_tpl_vars['codesWooyun']); ?>
36 | )
37 | 生成奖品邀请码
39 |
40 |
41 | 邀请码 (生成时间倒序排列)
42 |
43 |
44 |
45 | _tpl_vars['codesWooyun']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
46 | foreach ($_from as $this->_tpl_vars['v']):
47 | ?>
48 |
49 | _tpl_vars['v']['code']; ?>
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | 其它邀请码 (_tpl_vars['codesOther']); ?>
58 | ) 生成其它邀请码
60 |
61 |
62 | 邀请码 (生成时间倒序排列)
63 |
64 |
65 |
66 | _tpl_vars['codesOther']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
67 | foreach ($_from as $this->_tpl_vars['v']):
68 | ?>
69 |
70 | _tpl_vars['v']['code']; ?>
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/libs/plugins/modifier.debug_print_var.php:
--------------------------------------------------------------------------------
1 |
13 | * Name: debug_print_var
14 | * Purpose: formats variable contents for display in the console
15 | * @link http://smarty.php.net/manual/en/language.modifier.debug.print.var.php
16 | * debug_print_var (Smarty online manual)
17 | * @author Monte Ohrt
18 | * @param array|object
19 | * @param integer
20 | * @param integer
21 | * @return string
22 | */
23 | function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
24 | {
25 | $_replace = array(
26 | "\n" => '\n ',
27 | "\r" => '\r ',
28 | "\t" => '\t '
29 | );
30 |
31 | switch (gettype($var)) {
32 | case 'array' :
33 | $results = 'Array (' . count($var) . ') ';
34 | foreach ($var as $curr_key => $curr_val) {
35 | $results .= ' ' . str_repeat(' ', $depth * 2)
36 | . '' . strtr($curr_key, $_replace) . ' => '
37 | . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
38 | $depth--;
39 | }
40 | break;
41 | case 'object' :
42 | $object_vars = get_object_vars($var);
43 | $results = '' . get_class($var) . ' Object (' . count($object_vars) . ') ';
44 | foreach ($object_vars as $curr_key => $curr_val) {
45 | $results .= ' ' . str_repeat(' ', $depth * 2)
46 | . ' ->' . strtr($curr_key, $_replace) . ' = '
47 | . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
48 | $depth--;
49 | }
50 | break;
51 | case 'boolean' :
52 | case 'NULL' :
53 | case 'resource' :
54 | if (true === $var) {
55 | $results = 'true';
56 | } elseif (false === $var) {
57 | $results = 'false';
58 | } elseif (null === $var) {
59 | $results = 'null';
60 | } else {
61 | $results = htmlspecialchars((string) $var);
62 | }
63 | $results = '' . $results . ' ';
64 | break;
65 | case 'integer' :
66 | case 'float' :
67 | $results = htmlspecialchars((string) $var);
68 | break;
69 | case 'string' :
70 | $results = strtr($var, $_replace);
71 | if (strlen($var) > $length ) {
72 | $results = substr($var, 0, $length - 3) . '...';
73 | }
74 | $results = htmlspecialchars('"' . $results . '"');
75 | break;
76 | case 'unknown type' :
77 | default :
78 | $results = strtr((string) $var, $_replace);
79 | if (strlen($results) > $length ) {
80 | $results = substr($results, 0, $length - 3) . '...';
81 | }
82 | $results = htmlspecialchars($results);
83 | }
84 |
85 | return $results;
86 | }
87 |
88 | /* vim: set expandtab: */
89 |
90 | ?>
91 |
--------------------------------------------------------------------------------
/libs/plugins/block.textformat.php:
--------------------------------------------------------------------------------
1 |
12 | * Name: textformat
13 | * Purpose: format text a certain way with preset styles
14 | * or custom wrap/indent settings
15 | * @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat}
16 | * (Smarty online manual)
17 | * @param array
18 | *
19 | * Params: style: string (email)
20 | * indent: integer (0)
21 | * wrap: integer (80)
22 | * wrap_char string ("\n")
23 | * indent_char: string (" ")
24 | * wrap_boundary: boolean (true)
25 | *
26 | * @author Monte Ohrt
27 | * @param string contents of the block
28 | * @param Smarty clever simulation of a method
29 | * @return string string $content re-formatted
30 | */
31 | function smarty_block_textformat($params, $content, &$smarty)
32 | {
33 | if (is_null($content)) {
34 | return;
35 | }
36 |
37 | $style = null;
38 | $indent = 0;
39 | $indent_first = 0;
40 | $indent_char = ' ';
41 | $wrap = 80;
42 | $wrap_char = "\n";
43 | $wrap_cut = false;
44 | $assign = null;
45 |
46 | foreach ($params as $_key => $_val) {
47 | switch ($_key) {
48 | case 'style':
49 | case 'indent_char':
50 | case 'wrap_char':
51 | case 'assign':
52 | $$_key = (string)$_val;
53 | break;
54 |
55 | case 'indent':
56 | case 'indent_first':
57 | case 'wrap':
58 | $$_key = (int)$_val;
59 | break;
60 |
61 | case 'wrap_cut':
62 | $$_key = (bool)$_val;
63 | break;
64 |
65 | default:
66 | $smarty->trigger_error("textformat: unknown attribute '$_key'");
67 | }
68 | }
69 |
70 | if ($style == 'email') {
71 | $wrap = 72;
72 | }
73 |
74 | // split into paragraphs
75 | $_paragraphs = preg_split('![\r\n][\r\n]!',$content);
76 | $_output = '';
77 |
78 | for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) {
79 | if ($_paragraphs[$_x] == '') {
80 | continue;
81 | }
82 | // convert mult. spaces & special chars to single space
83 | $_paragraphs[$_x] = preg_replace(array('!\s+!','!(^\s+)|(\s+$)!'), array(' ',''), $_paragraphs[$_x]);
84 | // indent first line
85 | if($indent_first > 0) {
86 | $_paragraphs[$_x] = str_repeat($indent_char, $indent_first) . $_paragraphs[$_x];
87 | }
88 | // wordwrap sentences
89 | $_paragraphs[$_x] = wordwrap($_paragraphs[$_x], $wrap - $indent, $wrap_char, $wrap_cut);
90 | // indent lines
91 | if($indent > 0) {
92 | $_paragraphs[$_x] = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraphs[$_x]);
93 | }
94 | }
95 | $_output = implode($wrap_char . $wrap_char, $_paragraphs);
96 |
97 | return $assign ? $smarty->assign($assign, $_output) : $_output;
98 |
99 | }
100 |
101 | /* vim: set expandtab: */
102 |
103 | ?>
104 |
--------------------------------------------------------------------------------
/templates_c/%%77^774^774BE9C9%%index.html.php:
--------------------------------------------------------------------------------
1 |
3 | array(array('modifier', 'date_format', 'index.html', 36, false),)), $this); ?>
5 |
6 |
7 |
8 |
9 | XSS Platform
10 |
11 |
13 |
15 |
17 |
19 |
21 |
22 |
23 | _tpl_vars;
24 | $this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
25 | $this->_tpl_vars = $_smarty_tpl_vars;
26 | unset($_smarty_tpl_vars);
27 | ?>
28 |
29 | _tpl_vars;
30 | $this->_smarty_include(array('smarty_include_tpl_file' => "menus.html", 'smarty_include_vars' => array()));
31 | $this->_tpl_vars = $_smarty_tpl_vars;
32 | unset($_smarty_tpl_vars);
33 | ?>
34 |
35 |
36 |
38 |
39 |
40 |
41 | 项目名称
42 | 项目描述
43 | 内容数
44 | 创建时间
45 | 操作
46 |
47 |
48 |
49 | _tpl_vars['projects']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
50 | foreach ($_from as $this->_tpl_vars['v']):
51 | ?>
52 |
53 | _tpl_vars['v']['title']; ?>
56 |
57 | _tpl_vars['v']['description']; ?>
58 |
59 | _tpl_vars['v']['contentNum']; ?>
60 |
61 | _tpl_vars['v']['addTime'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
62 |
63 |
64 | 删除
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/source/class/Pager.class.php:
--------------------------------------------------------------------------------
1 | pNO=empty($pageNO) ? 1 : $pageNO;
15 | $this->pRN=intval($pRN);
16 | $this->pNavRN=empty($pNavRN) ? 5 : intval($pNavRN);
17 | $this->sql=$sql;
18 | $this->countSql=$countSql;
19 | $this->href=$href;
20 | $this->GetData();
21 | $this->GetNav();
22 | }
23 | /* data */
24 | private function GetData(){
25 | global $db;
26 | $this->sum=$db->FirstValue($this->countSql);
27 | $this->pSum=ceil($this->sum/$this->pRN);
28 | $this->data=$db->Dataset($this->sql.' LIMIT '.($this->pNO-1)*$this->pRN.','.$this->pRN);
29 | }
30 | /* page navigation */
31 | private function GetNav(){
32 | if(strrpos($this->href,'?')===false) $this->hrefC='?';
33 | //first
34 | if($this->pSum>1 && $this->pNO>1) $this->nav.='首页 ';
35 | //front
36 | if($this->pNO>1) $this->nav.='上一页 ';
37 | //num
38 | if($this->pSum<=$this->pNavRN){
39 | $this->PageNo(1,$this->pSum);
40 | }else{
41 | if($this->pNO<$this->pNavRN){
42 | $this->PageNo(1,$this->pNavRN);
43 | }elseif($this->pNO>=$this->pNavRN && $this->pNO<=$this->pSum-$this->pNavRN){
44 | $this->PageNo($this->pNO-$this->pNavRN+1,$this->pNO+$this->pNavRN-1);
45 | }elseif($this->pNO>$this->pSum-$this->pNavRN){
46 | $this->PageNo($this->pSum-$this->pNavRN,$this->pSum);
47 | }
48 | }
49 | //next
50 | if($this->pNO<$this->pSum) $this->nav.='下一页 ';
51 | //last
52 | if($this->pSum>1 && $this->pNO<$this->pSum) $this->nav.='尾页 ';
53 | }
54 | private function PageNo($first,$last){
55 | for($i=$first;$i<=$last;$i++){
56 | $this->pages[]=$i;
57 | if($this->pNO==$i) $this->nav.=''.$i.' ';
58 | else $this->nav.=''.$i.' ';
59 | }
60 | }
61 | /* page nav arr */
62 | public static function GetPageNav($sum,$pNO=1,$hrefPrefix='',$pRN=20,$pNavRN=5){
63 | $pNO=$pNO<=0 ? 1 : $pNO;
64 | $pSum=ceil($sum/$pRN);
65 | $pages=array();
66 | if($pSum<=$pNavRN){
67 | for($i=1;$i<=$pSum;$i++){
68 | $pages[]=$i;
69 | }
70 | }else{
71 | if($pNO<$pNavRN){
72 | for($i=1;$i<=$pNavRN;$i++){
73 | $pages[]=$i;
74 | }
75 | }elseif($pNO>=$pNavRN && $pNO<=$pSum-$pNavRN){
76 | for($i=$pNO-$pNavRN+1;$i<=$pNO+$pNavRN-1;$i++){
77 | $pages[]=$i;
78 | }
79 | }elseif($pNO>$pSum-$pNavRN){
80 | for($i=$pSum-$pNavRN;$i<=$pSum;$i++){
81 | $pages[]=$i;
82 | }
83 | }
84 | }
85 | $page=array(
86 | 'sum'=>$sum,
87 | 'pNO'=>$pNO,
88 | 'pSum'=>$pSum,
89 | 'hrefPrefix'=>$hrefPrefix,
90 | 'pages'=>$pages
91 | );
92 | return $page;
93 | }
94 | }
95 | ?>
--------------------------------------------------------------------------------
/templates_c/%%4D^4D3^4D30CF2A%%project_viewcode.html.php:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 | XSS Platform
8 |
9 |
11 |
13 |
15 |
17 |
19 |
21 | ul { margin:0}
22 |
23 | '; ?>
24 |
25 |
26 |
27 | _tpl_vars;
28 | $this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
29 | $this->_tpl_vars = $_smarty_tpl_vars;
30 | unset($_smarty_tpl_vars);
31 | ?>
32 |
33 | _tpl_vars;
34 | $this->_smarty_include(array('smarty_include_tpl_file' => "menus.html", 'smarty_include_vars' => array()));
35 | $this->_tpl_vars = $_smarty_tpl_vars;
36 | unset($_smarty_tpl_vars);
37 | ?>
38 |
39 |
40 |
项目代码
41 |
42 |
项目名称: _tpl_vars['project']['title']; ?>
43 |
44 |
45 | 项目代码:
46 |
47 | _tpl_vars['code']; ?>
48 |
49 |
50 |
51 |
如何使用:
52 |
将如下代码植入怀疑出现xss的地方(注意'的转义),即可在 项目内容 观看XSS效果。
55 |
56 | _tpl_vars['scriptShow1']; ?>
57 |
58 |
59 |
60 |
61 | 或者
62 |
63 |
64 |
65 | _tpl_vars['scriptShow2']; ?>
66 |
67 |
68 |
69 |
70 |
71 |
72 | 再或者以你任何想要的方式插入
73 |
74 |
75 |
76 |
77 |
78 | _tpl_vars['codeurl']; ?>
79 |
80 |
81 |
82 |
83 |
84 | *************************************************网址缩短*************************************************
85 |
86 |
87 |
88 | 再或者以你任何想要的方式插入
89 |
90 |
91 |
92 |
93 |
94 | _tpl_vars['shortShow1']; ?>
95 |
96 |
97 |
98 |
99 |
100 |
101 | _tpl_vars['ty'] == 'create'): ?>
102 |
104 |
105 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/source/class/Image.class.php:
--------------------------------------------------------------------------------
1 | imgObj=$imgObj;
14 | $this->imgType=FileSuffix($imgObj['name']);
15 | }
16 | }
17 | /**
18 | Upload 上传
19 | $imgName string 图片名称(上传到的位置)
20 | */
21 | public function Upload($imgName=''){
22 | if(empty($this->imgObj['tmp_name']) || $this->imgObj['size']<=0){
23 | $this->error='图片上传未成功,请重新选择图片';
24 | return false;
25 | }
26 | //判断图片格式
27 | if(!in_array($this->imgType,array('jpg','jpeg','png','gif')) || !in_array($this->imgObj['type'],array('image/jpeg','image/png','image/gif'))){
28 | $this->error='图片格式不正确';
29 | return false;
30 | }
31 | if(file_exists($imgName)) @unlink($imgName);
32 | //上传
33 | if(move_uploaded_file($this->imgObj['tmp_name'],$imgName)){
34 | return true;
35 | }else{
36 | $this->error='图片上传未成功,请重新选择图片';
37 | return false;
38 | }
39 | }
40 |
41 | /**
42 | Resize 生成缩略图
43 | */
44 | public static function Resize($oldImg,$width=200,$height=200,$newImg,$fixed=false){
45 | if(!file_exists($oldImg)) return false;
46 | //生成图片处理对象
47 | $pathInfo=pathinfo($oldImg);
48 | $imgType=strtolower($pathInfo['extension']);
49 | switch($imgType){
50 | case 'jpg':
51 | case 'jpeg':
52 | $im=@imagecreatefromjpeg($oldImg);
53 | break;
54 | case 'png':
55 | $im=@imagecreatefrompng($oldImg);
56 | break;
57 | case 'gif':
58 | $im=@imagecreatefromgif($oldImg);
59 | break;
60 | default:
61 | return false;
62 | break;
63 | }
64 | if($im){
65 | $w=imagesx($im);
66 | $h=imagesy($im);
67 | //计算新宽,高
68 | if($w>$width || $h>$height){
69 | if(!$fixed){
70 | if($w>$width){
71 | $widthRatio=$width/$w;
72 | }else{
73 | $widthRatio=1;
74 | }
75 | if($h>$height){
76 | $heightRatio=$height/$h;
77 | }else{
78 | $heightRatio=1;
79 | }
80 | $ratio=$widthRatio<$heightRatio ? $widthRatio : $heightRatio;
81 | $newWidth=$w*$ratio;
82 | $newHeight=$h*$ratio;
83 | }else{
84 | $newWidth=$width;
85 | $newHeight=$height;
86 | }
87 | }else{
88 | return false;
89 | }
90 | //开始缩略
91 | if(function_exists('imagecopyresampled')){
92 | $newim=imagecreatetruecolor($newWidth, $newHeight);
93 | imagecopyresampled($newim,$im,0,0,0,0,$newWidth,$newHeight,$w,$h);
94 | }else{
95 | $newim=imagecreate($newWidth,$newHeight);
96 | imagecopyresized($newim,$im,0,0,0,0,$newWidth,$newHeight,$w,$h);
97 | }
98 | if(file_exists($newImg)) @unlink($newImg);
99 | switch($imgType){
100 | case 'jpg':
101 | case 'jpeg':
102 | imagejpeg($newim,$newImg);
103 | break;
104 | case 'png':
105 | imagepng($newim,$newImg);
106 | break;
107 | case 'gif':
108 | imagegif($newim,$newImg);
109 | break;
110 | default:
111 | return false;
112 | break;
113 | }
114 | imagedestroy($newim);
115 | return true;
116 | }else{
117 | return false;
118 | }
119 | }
120 | }
121 | ?>
--------------------------------------------------------------------------------
/libs/internals/core.write_compiled_include.php:
--------------------------------------------------------------------------------
1 | caching && \!\$this->_cache_including\)\: echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\'; endif;';
19 | $_tag_end = 'if \(\$this->caching && \!\$this->_cache_including\)\: echo \'\{/nocache\:(\\2)#(\\3)\}\'; endif;';
20 |
21 | preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us',
22 | $params['compiled_content'], $_match_source, PREG_SET_ORDER);
23 |
24 | // no nocache-parts found: done
25 | if (count($_match_source)==0) return;
26 |
27 | // convert the matched php-code to functions
28 | $_include_compiled = "_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
29 | $_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n";
30 |
31 | $_compile_path = $params['include_file_path'];
32 |
33 | $smarty->_cache_serials[$_compile_path] = $params['cache_serial'];
34 | $_include_compiled .= "\$this->_cache_serials['".$_compile_path."'] = '".$params['cache_serial']."';\n\n?>";
35 |
36 | $_include_compiled .= $params['plugins_code'];
37 | $_include_compiled .= "= 5.0) ? '_smarty' : 'this';
40 | for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) {
41 | $_match =& $_match_source[$_i];
42 | $source = $_match[4];
43 | if ($this_varname == '_smarty') {
44 | /* rename $this to $_smarty in the sourcecode */
45 | $tokens = token_get_all('\n";
81 |
82 | $_params = array('filename' => $_compile_path,
83 | 'contents' => $_include_compiled, 'create_dirs' => true);
84 |
85 | require_once(SMARTY_CORE_DIR . 'core.write_file.php');
86 | smarty_core_write_file($_params, $smarty);
87 | return true;
88 | }
89 |
90 |
91 | ?>
92 |
--------------------------------------------------------------------------------
/source/register.php:
--------------------------------------------------------------------------------
1 | tbPrefix.'user';
18 | $userExisted=$db->FirstValue("SELECT COUNT(*) FROM {$tbUser} WHERE userName='{$username}'");
19 | $emailExisted=$db->FirstValue("SELECT COUNT(*) FROM {$tbUser} WHERE email='{$email}'");
20 | $keyError=0;
21 | if(REGISTER=='invite'){
22 | //判断key是否有效
23 | $tbInviteReg=$db->tbPrefix.'invite_reg';
24 | $inviteRow=$db->FirstRow("SELECT id,userId FROM {$tbInviteReg} WHERE inviteKey='{$key}' AND isUsed=0");
25 | if(empty($inviteRow)) $keyError=1;
26 | }
27 |
28 | echo $userExisted.'|'.$emailExisted.'|'.$keyError;
29 | break;
30 | case 'submit':
31 | if($user->userId>0) ShowError('您已登录,不能进行注册');
32 | $db=DBConnect();
33 | $key=Val('key','POST');
34 | if(!empty($key)){
35 | $tbInviteReg=$db->tbPrefix.'invite_reg';
36 | $inviteRow=$db->FirstRow("SELECT id,userId FROM {$tbInviteReg} WHERE inviteKey='{$key}' AND isUsed=0");
37 | }
38 | if(REGISTER=='invite'){
39 | if(empty($key)) ShowError('本站目前仅能邀请注册');
40 | if(empty($inviteRow)) ShowError('你的邀请码不正确或已作废');
41 | }
42 | $username=Val('user','POST');
43 | $email=Val('email','POST');
44 | $userpwd=Val('pwd','POST');
45 | $phone=Val('phone','POST');//获取手机号
46 | //判断格式
47 | if(empty($username) || !preg_match('/^[\w\x{4e00}-\x{9fa5}]{2,20}$/u',$username)) ShowError('用户格式不正确',$url['register'],'重新填写');
48 | if(empty($email) || !preg_match('/^(\w+\.)*?\w+@(\w+\.)+\w+$/',$email)) ShowError('邮箱格式不正确',$url['register'],'重新填写');
49 | if(!empty($phone) && !preg_match('/^(\d{11})$/',$phone)) ShowError('手机格式不正确',$url['register'],'重新填写');//手机验证
50 | if(empty($userpwd) || !preg_match('/^.{6,20}$/',$userpwd)) ShowError('密码应为6-20位字符',$url['register'],'重新填写');
51 | $tbUser=$db->tbPrefix.'user';
52 | //用户是否存在
53 | $userExisted=$db->FirstValue("SELECT COUNT(*) FROM {$tbUser} WHERE userName='{$username}'");
54 | if($userExisted>0) ShowError("用户{$username}已存在",$url['register'],'重新填写');
55 | //邮箱是否存在
56 | $emailExisted=$db->FirstValue("SELECT COUNT(*) FROM {$tbUser} WHERE email='{$email}'");
57 | if($emailExisted>0) ShowError("邮箱{$email}已存在",$url['register'],'重新填写');
58 | //入库
59 | $executeArr=array('userName'=>$username,'userPwd'=>OCEncrypt($userpwd),'email'=>$email,'phone'=>$phone,'addTime'=>time());
60 | if($db->AutoExecute($tbUser,$executeArr)){
61 | if(!empty($inviteRow)){
62 | $regUserId=$db->LastId();
63 | $db->Execute("UPDATE {$tbInviteReg} SET isUsed=1,regUserId='{$regUserId}',regTime='".time()."' WHERE id='{$inviteRow[id]}'");
64 | }
65 | //自动登录
66 | $user->Login($username,$userpwd,1);
67 | ShowSuccess('注册成功',$url['root']);
68 | }else{
69 | ShowError('出错了,请与管理员联系');
70 | }
71 | break;
72 | default:
73 | if($user->userId>0) ShowError('您已登录,不能进行注册!');
74 | $key=Val('key','GET');
75 | $smarty=InitSmarty();
76 | $smarty->assign('do',$do);
77 | $smarty->assign('register',REGISTER);
78 | $smarty->assign('key',$key);
79 | $smarty->assign('show',$show);
80 | $smarty->assign('url',$url);
81 | $smarty->display('register.html');
82 | break;
83 | }
84 | ?>
--------------------------------------------------------------------------------
/themes/default/templates/project_setcode.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | XSS Platform
6 |
7 |
8 |
9 |
10 |
11 |
12 |
25 |
26 |
27 | {include file="header.html"}
28 |
29 | {include file="menus.html"}
30 |
31 |
32 |
配置代码
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | 项目名称
41 |
{$project.title}
42 |
43 |
44 |
68 |
69 |
70 | 自定义代码
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/libs/plugins/function.cycle.php:
--------------------------------------------------------------------------------
1 |
12 | * Name: cycle
13 | * Date: May 3, 2002
14 | * Purpose: cycle through given values
15 | * Input:
16 | * - name = name of cycle (optional)
17 | * - values = comma separated list of values to cycle,
18 | * or an array of values to cycle
19 | * (this can be left out for subsequent calls)
20 | * - reset = boolean - resets given var to true
21 | * - print = boolean - print var or not. default is true
22 | * - advance = boolean - whether or not to advance the cycle
23 | * - delimiter = the value delimiter, default is ","
24 | * - assign = boolean, assigns to template var instead of
25 | * printed.
26 | *
27 | * Examples:
28 | *
29 | * {cycle values="#eeeeee,#d0d0d0d"}
30 | * {cycle name=row values="one,two,three" reset=true}
31 | * {cycle name=row}
32 | *
33 | * @link http://smarty.php.net/manual/en/language.function.cycle.php {cycle}
34 | * (Smarty online manual)
35 | * @author Monte Ohrt
36 | * @author credit to Mark Priatel
37 | * @author credit to Gerard
38 | * @author credit to Jason Sweat
39 | * @version 1.3
40 | * @param array
41 | * @param Smarty
42 | * @return string|null
43 | */
44 | function smarty_function_cycle($params, &$smarty)
45 | {
46 | static $cycle_vars;
47 |
48 | $name = (empty($params['name'])) ? 'default' : $params['name'];
49 | $print = (isset($params['print'])) ? (bool)$params['print'] : true;
50 | $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true;
51 | $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false;
52 |
53 | if (!in_array('values', array_keys($params))) {
54 | if(!isset($cycle_vars[$name]['values'])) {
55 | $smarty->trigger_error("cycle: missing 'values' parameter");
56 | return;
57 | }
58 | } else {
59 | if(isset($cycle_vars[$name]['values'])
60 | && $cycle_vars[$name]['values'] != $params['values'] ) {
61 | $cycle_vars[$name]['index'] = 0;
62 | }
63 | $cycle_vars[$name]['values'] = $params['values'];
64 | }
65 |
66 | $cycle_vars[$name]['delimiter'] = (isset($params['delimiter'])) ? $params['delimiter'] : ',';
67 |
68 | if(is_array($cycle_vars[$name]['values'])) {
69 | $cycle_array = $cycle_vars[$name]['values'];
70 | } else {
71 | $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']);
72 | }
73 |
74 | if(!isset($cycle_vars[$name]['index']) || $reset ) {
75 | $cycle_vars[$name]['index'] = 0;
76 | }
77 |
78 | if (isset($params['assign'])) {
79 | $print = false;
80 | $smarty->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
81 | }
82 |
83 | if($print) {
84 | $retval = $cycle_array[$cycle_vars[$name]['index']];
85 | } else {
86 | $retval = null;
87 | }
88 |
89 | if($advance) {
90 | if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) {
91 | $cycle_vars[$name]['index'] = 0;
92 | } else {
93 | $cycle_vars[$name]['index']++;
94 | }
95 | }
96 |
97 | return $retval;
98 | }
99 |
100 | /* vim: set expandtab: */
101 |
102 | ?>
103 |
--------------------------------------------------------------------------------
/source/api.php:
--------------------------------------------------------------------------------
1 | FirstRow("SELECT * FROM ".Tb('project')." WHERE urlKey='{$id}'");
13 | if(empty($project)) exit();
14 | //用户提供的content
15 | $content=array();
16 | //待接收的key
17 | $keys=array();
18 | /* 模块 begin */
19 | $moduleIds=array();
20 | if(!empty($project['modules'])) $moduleIds=json_decode($project['modules']);
21 | if(!empty($moduleIds)){
22 | $modulesStr=implode(',',$moduleIds);
23 | $modules=$db->Dataset("SELECT * FROM ".Tb('module')." WHERE id IN ($modulesStr)");
24 | if(!empty($modules)){
25 | foreach($modules as $module){
26 | if(!empty($module['keys'])) $keys=array_merge($keys,json_decode($module['keys']));
27 | }
28 | }
29 | }
30 | /* 模块 end */
31 | foreach($keys as $key){
32 | $content[$key]=Val($key,'REQUEST');
33 | }
34 | if(in_array('toplocation',$keys)){
35 | $content['toplocation']=!empty($content['toplocation']) ? $content['toplocation'] : $content['location'];
36 | }
37 |
38 | $judgeCookie=in_array('cookie',$keys) ? true : false;
39 | /* cookie hash */
40 | $cookieHash=md5($project['id'].'_'.$content['cookie'].'_'.$content['location'].'_'.$content['toplocation']);
41 | $cookieExisted=$db->FirstValue("SELECT COUNT(*) FROM ".Tb('project_content')." WHERE projectId='{$project[id]}' AND cookieHash='{$cookieHash}'");
42 | if(!$judgeCookie || $cookieExisted<=0){
43 | //服务器获取的content
44 | $serverContent=array();
45 | $serverContent['HTTP_REFERER']=$_SERVER['HTTP_REFERER'];
46 | $referers=@parse_url($serverContent['HTTP_REFERER']);
47 | $domain=$referers['host']?$referers['host']: '';
48 | $domain=StripStr($domain);
49 | $serverContent['HTTP_REFERER']=StripStr($_SERVER['HTTP_REFERER']);
50 | $serverContent['HTTP_USER_AGENT']=StripStr($_SERVER['HTTP_USER_AGENT']);
51 | $user_ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
52 | if ($user_ip==''){
53 | $user_ip=$_SERVER['REMOTE_ADDR'];
54 | }
55 | $serverContent['REMOTE_ADDR']=StripStr($user_ip);
56 | $values=array(
57 | 'projectId'=>$project['id'],
58 | 'content'=>JsonEncode($content),
59 | 'serverContent'=>JsonEncode($serverContent),
60 | 'domain'=>$domain,
61 | 'cookieHash'=>$cookieHash,
62 | 'num'=>1,
63 | 'addTime'=>time()
64 | );
65 | $judgeCookie=in_array('cookie',$keys) ? true : false;
66 |
67 | /* cookie hash */
68 | $Getcookie=$content['cookie'];
69 | //Getcookie在上面的变量里
70 |
71 | $db->AutoExecute(Tb('project_content'),$values);
72 |
73 | $uid = $project['userId'];
74 | $userInfo = $db->FirstRow("SELECT * FROM ".Tb('user')." WHERE id={$uid}");
75 | $msg=explode("|",$userInfo['message']);
76 | if($userInfo['phone'] && $msg[1]==1){
77 | SendSMS('150********','************',$userInfo['phone'],"尊敬的".$userInfo['userName'].",您在".URL_ROOT." 预订的猫饼干,Cookie:{$Getcookie}已经到货!详情请登录:".URL_ROOT." 查看!");
78 | //参数:发送的飞信号 飞信密码
79 | }
80 | if($userInfo['email'] && $msg[0]==1){
81 | $domain=explode("//", URL_ROOT);
82 | SendMail($userInfo['email'],"notification @ ".$domain[1] ,"尊敬的 ".$userInfo['userName']." ,您在 ".$domain[1]." 预订的零食 Cookie:{$Getcookie} 已经到货! 详情请登录:".URL_ROOT." 查看。");
83 | }
84 | }else{
85 | $db->Execute("UPDATE ".Tb('project_content')." SET num=num+1,updateTime='".time()."' WHERE projectId='{$project[id]}' AND cookieHash='{$cookieHash}'");
86 | }
87 |
88 | header("Location: $_SERVER[HTTP_REFERER] ");
89 | }
90 | ?>
91 |
--------------------------------------------------------------------------------
/libs/plugins/function.popup.php:
--------------------------------------------------------------------------------
1 |
13 | * Name: popup
14 | * Purpose: make text pop up in windows via overlib
15 | * @link http://smarty.php.net/manual/en/language.function.popup.php {popup}
16 | * (Smarty online manual)
17 | * @author Monte Ohrt
18 | * @param array
19 | * @param Smarty
20 | * @return string
21 | */
22 | function smarty_function_popup($params, &$smarty)
23 | {
24 | $append = '';
25 | foreach ($params as $_key=>$_value) {
26 | switch ($_key) {
27 | case 'text':
28 | case 'trigger':
29 | case 'function':
30 | case 'inarray':
31 | $$_key = (string)$_value;
32 | if ($_key == 'function' || $_key == 'inarray')
33 | $append .= ',' . strtoupper($_key) . ",'$_value'";
34 | break;
35 |
36 | case 'caption':
37 | case 'closetext':
38 | case 'status':
39 | $append .= ',' . strtoupper($_key) . ",'" . str_replace("'","\'",$_value) . "'";
40 | break;
41 |
42 | case 'fgcolor':
43 | case 'bgcolor':
44 | case 'textcolor':
45 | case 'capcolor':
46 | case 'closecolor':
47 | case 'textfont':
48 | case 'captionfont':
49 | case 'closefont':
50 | case 'fgbackground':
51 | case 'bgbackground':
52 | case 'caparray':
53 | case 'capicon':
54 | case 'background':
55 | case 'frame':
56 | $append .= ',' . strtoupper($_key) . ",'$_value'";
57 | break;
58 |
59 | case 'textsize':
60 | case 'captionsize':
61 | case 'closesize':
62 | case 'width':
63 | case 'height':
64 | case 'border':
65 | case 'offsetx':
66 | case 'offsety':
67 | case 'snapx':
68 | case 'snapy':
69 | case 'fixx':
70 | case 'fixy':
71 | case 'padx':
72 | case 'pady':
73 | case 'timeout':
74 | case 'delay':
75 | $append .= ',' . strtoupper($_key) . ",$_value";
76 | break;
77 |
78 | case 'sticky':
79 | case 'left':
80 | case 'right':
81 | case 'center':
82 | case 'above':
83 | case 'below':
84 | case 'noclose':
85 | case 'autostatus':
86 | case 'autostatuscap':
87 | case 'fullhtml':
88 | case 'hauto':
89 | case 'vauto':
90 | case 'mouseoff':
91 | case 'followmouse':
92 | case 'closeclick':
93 | if ($_value) $append .= ',' . strtoupper($_key);
94 | break;
95 |
96 | default:
97 | $smarty->trigger_error("[popup] unknown parameter $_key", E_USER_WARNING);
98 | }
99 | }
100 |
101 | if (empty($text) && !isset($inarray) && empty($function)) {
102 | $smarty->trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required");
103 | return false;
104 | }
105 |
106 | if (empty($trigger)) { $trigger = "onmouseover"; }
107 |
108 | $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\'';
109 | $retval .= $append . ');"';
110 | if ($trigger == 'onmouseover')
111 | $retval .= ' onmouseout="nd();"';
112 |
113 |
114 | return $retval;
115 | }
116 |
117 | /* vim: set expandtab: */
118 |
119 | ?>
120 |
--------------------------------------------------------------------------------
/libs/internals/core.write_cache_file.php:
--------------------------------------------------------------------------------
1 | _cache_info['timestamp'] = time();
26 | if ($smarty->cache_lifetime > -1){
27 | // expiration set
28 | $smarty->_cache_info['expires'] = $smarty->_cache_info['timestamp'] + $smarty->cache_lifetime;
29 | } else {
30 | // cache will never expire
31 | $smarty->_cache_info['expires'] = -1;
32 | }
33 |
34 | // collapse nocache.../nocache-tags
35 | if (preg_match_all('!\{(/?)nocache\:[0-9a-f]{32}#\d+\}!', $params['results'], $match, PREG_PATTERN_ORDER)) {
36 | // remove everything between every pair of outermost noache.../nocache-tags
37 | // and replace it by a single nocache-tag
38 | // this new nocache-tag will be replaced by dynamic contents in
39 | // smarty_core_process_compiled_includes() on a cache-read
40 |
41 | $match_count = count($match[0]);
42 | $results = preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_SPLIT_DELIM_CAPTURE);
43 |
44 | $level = 0;
45 | $j = 0;
46 | for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) {
47 | if ($results[$i] == $match[0][$j]) {
48 | // nocache tag
49 | if ($match[1][$j]) { // closing tag
50 | $level--;
51 | unset($results[$i]);
52 | } else { // opening tag
53 | if ($level++ > 0) unset($results[$i]);
54 | }
55 | $j++;
56 | } elseif ($level > 0) {
57 | unset($results[$i]);
58 | }
59 | }
60 | $params['results'] = implode('', $results);
61 | }
62 | $smarty->_cache_info['cache_serials'] = $smarty->_cache_serials;
63 |
64 | // prepend the cache header info into cache file
65 | $_cache_info = serialize($smarty->_cache_info);
66 | $params['results'] = strlen($_cache_info) . "\n" . $_cache_info . $params['results'];
67 |
68 | if (!empty($smarty->cache_handler_func)) {
69 | // use cache_handler function
70 | call_user_func_array($smarty->cache_handler_func,
71 | array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], $smarty->_cache_info['expires']));
72 | } else {
73 | // use local cache file
74 |
75 | if(!@is_writable($smarty->cache_dir)) {
76 | // cache_dir not writable, see if it exists
77 | if(!@is_dir($smarty->cache_dir)) {
78 | $smarty->trigger_error('the $cache_dir \'' . $smarty->cache_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
79 | return false;
80 | }
81 | $smarty->trigger_error('unable to write to $cache_dir \'' . realpath($smarty->cache_dir) . '\'. Be sure $cache_dir is writable by the web server user.', E_USER_ERROR);
82 | return false;
83 | }
84 |
85 | $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
86 | $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
87 | $_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true);
88 | require_once(SMARTY_CORE_DIR . 'core.write_file.php');
89 | smarty_core_write_file($_params, $smarty);
90 | return true;
91 | }
92 | }
93 |
94 | /* vim: set expandtab: */
95 |
96 | ?>
97 |
--------------------------------------------------------------------------------
/libs/internals/core.read_cache_file.php:
--------------------------------------------------------------------------------
1 | force_compile) {
26 | // force compile enabled, always regenerate
27 | return false;
28 | }
29 |
30 | if (isset($content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']])) {
31 | list($params['results'], $smarty->_cache_info) = $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']];
32 | return true;
33 | }
34 |
35 | if (!empty($smarty->cache_handler_func)) {
36 | // use cache_handler function
37 | call_user_func_array($smarty->cache_handler_func,
38 | array('read', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null));
39 | } else {
40 | // use local cache file
41 | $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
42 | $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
43 | $params['results'] = $smarty->_read_file($_cache_file);
44 | }
45 |
46 | if (empty($params['results'])) {
47 | // nothing to parse (error?), regenerate cache
48 | return false;
49 | }
50 |
51 | $_contents = $params['results'];
52 | $_info_start = strpos($_contents, "\n") + 1;
53 | $_info_len = (int)substr($_contents, 0, $_info_start - 1);
54 | $_cache_info = unserialize(substr($_contents, $_info_start, $_info_len));
55 | $params['results'] = substr($_contents, $_info_start + $_info_len);
56 |
57 | if ($smarty->caching == 2 && isset ($_cache_info['expires'])){
58 | // caching by expiration time
59 | if ($_cache_info['expires'] > -1 && (time() > $_cache_info['expires'])) {
60 | // cache expired, regenerate
61 | return false;
62 | }
63 | } else {
64 | // caching by lifetime
65 | if ($smarty->cache_lifetime > -1 && (time() - $_cache_info['timestamp'] > $smarty->cache_lifetime)) {
66 | // cache expired, regenerate
67 | return false;
68 | }
69 | }
70 |
71 | if ($smarty->compile_check) {
72 | $_params = array('get_source' => false, 'quiet'=>true);
73 | foreach (array_keys($_cache_info['template']) as $_template_dep) {
74 | $_params['resource_name'] = $_template_dep;
75 | if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) {
76 | // template file has changed, regenerate cache
77 | return false;
78 | }
79 | }
80 |
81 | if (isset($_cache_info['config'])) {
82 | $_params = array('resource_base_path' => $smarty->config_dir, 'get_source' => false, 'quiet'=>true);
83 | foreach (array_keys($_cache_info['config']) as $_config_dep) {
84 | $_params['resource_name'] = $_config_dep;
85 | if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) {
86 | // config file has changed, regenerate cache
87 | return false;
88 | }
89 | }
90 | }
91 | }
92 |
93 | $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $_cache_info);
94 |
95 | $smarty->_cache_info = $_cache_info;
96 | return true;
97 | }
98 |
99 | /* vim: set expandtab: */
100 |
101 | ?>
102 |
--------------------------------------------------------------------------------
/libs/debug.tpl:
--------------------------------------------------------------------------------
1 | {* Smarty *}
2 | {* debug.tpl, last updated version 2.1.0 *}
3 | {assign_debug_info}
4 | {capture assign=debug_output}
5 |
6 |
7 |
8 | Smarty Debug Console
9 | {literal}
10 |
90 | {/literal}
91 |
92 |
93 |
94 | Smarty Debug Console
95 |
96 | included templates & config files (load time in seconds)
97 |
98 |
99 | {section name=templates loop=$_debug_tpls}
100 | {section name=indent loop=$_debug_tpls[templates].depth} {/section}
101 |
102 | {$_debug_tpls[templates].filename|escape:html}
103 | {if isset($_debug_tpls[templates].exec_time)}
104 |
105 | ({$_debug_tpls[templates].exec_time|string_format:"%.5f"})
106 | {if %templates.index% eq 0}(total){/if}
107 |
108 | {/if}
109 |
110 | {sectionelse}
111 |
no templates included
112 | {/section}
113 |
114 |
115 | assigned template variables
116 |
117 |
118 | {section name=vars loop=$_debug_keys}
119 |
120 | {ldelim}${$_debug_keys[vars]|escape:'html'}{rdelim}
121 | {$_debug_vals[vars]|@debug_print_var}
122 | {sectionelse}
123 | no template variables assigned
124 | {/section}
125 |
126 |
127 | assigned config file variables (outer template scope)
128 |
129 |
130 | {section name=config_vars loop=$_debug_config_keys}
131 |
132 | {ldelim}#{$_debug_config_keys[config_vars]|escape:'html'}#{rdelim}
133 | {$_debug_config_vals[config_vars]|@debug_print_var}
134 | {sectionelse}
135 | no config vars assigned
136 | {/section}
137 |
138 |
139 |
140 | {/capture}
141 | {if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"}
142 | {$debug_output}
143 | {else}
144 |
157 | {/if}
--------------------------------------------------------------------------------
/libs/plugins/function.html_options.php:
--------------------------------------------------------------------------------
1 |
13 | * Name: html_options
14 | * Input:
15 | * - name (optional) - string default "select"
16 | * - values (required if no options supplied) - array
17 | * - options (required if no values supplied) - associative array
18 | * - selected (optional) - string default not set
19 | * - output (required if not options supplied) - array
20 | * Purpose: Prints the list of tags generated from
21 | * the passed parameters
22 | * @link http://smarty.php.net/manual/en/language.function.html.options.php {html_image}
23 | * (Smarty online manual)
24 | * @author Monte Ohrt
25 | * @param array
26 | * @param Smarty
27 | * @return string
28 | * @uses smarty_function_escape_special_chars()
29 | */
30 | function smarty_function_html_options($params, &$smarty)
31 | {
32 | require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
33 |
34 | $name = null;
35 | $values = null;
36 | $options = null;
37 | $selected = array();
38 | $output = null;
39 |
40 | $extra = '';
41 |
42 | foreach($params as $_key => $_val) {
43 | switch($_key) {
44 | case 'name':
45 | $$_key = (string)$_val;
46 | break;
47 |
48 | case 'options':
49 | $$_key = (array)$_val;
50 | break;
51 |
52 | case 'values':
53 | case 'output':
54 | $$_key = array_values((array)$_val);
55 | break;
56 |
57 | case 'selected':
58 | $$_key = array_map('strval', array_values((array)$_val));
59 | break;
60 |
61 | default:
62 | if(!is_array($_val)) {
63 | $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
64 | } else {
65 | $smarty->trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
66 | }
67 | break;
68 | }
69 | }
70 |
71 | if (!isset($options) && !isset($values))
72 | return ''; /* raise error here? */
73 |
74 | $_html_result = '';
75 |
76 | if (isset($options)) {
77 |
78 | foreach ($options as $_key=>$_val)
79 | $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
80 |
81 | } else {
82 |
83 | foreach ($values as $_i=>$_key) {
84 | $_val = isset($output[$_i]) ? $output[$_i] : '';
85 | $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
86 | }
87 |
88 | }
89 |
90 | if(!empty($name)) {
91 | $_html_result = '' . "\n" . $_html_result . ' ' . "\n";
92 | }
93 |
94 | return $_html_result;
95 |
96 | }
97 |
98 | function smarty_function_html_options_optoutput($key, $value, $selected) {
99 | if(!is_array($value)) {
100 | $_html_result = '' . "\n";
105 | } else {
106 | $_html_result = smarty_function_html_options_optgroup($key, $value, $selected);
107 | }
108 | return $_html_result;
109 | }
110 |
111 | function smarty_function_html_options_optgroup($key, $values, $selected) {
112 | $optgroup_html = ' ' . "\n";
113 | foreach ($values as $key => $value) {
114 | $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected);
115 | }
116 | $optgroup_html .= " \n";
117 | return $optgroup_html;
118 | }
119 |
120 | /* vim: set expandtab: */
121 |
122 | ?>
123 |
--------------------------------------------------------------------------------
/themes/default/templates/module_create.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | XSS Platform
6 |
7 |
8 |
9 |
10 |
11 |
12 | {literal}
13 |
62 | {/literal}
63 |
64 |
65 | {include file="header.html"}
66 |
67 | {include file="menus.html"}
68 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/source/class/DB.class.php:
--------------------------------------------------------------------------------
1 | host=$dbHost;
43 | $this->username=$dbUser;
44 | $this->password=$dbPwd;
45 | $this->database=$dbName;
46 | $this->charset=$dbCharset;
47 | $this->tbPrefix=$tbPrefix;
48 |
49 | $this->linkId=mysql_connect($this->host,$this->username,$this->password);
50 | if(!empty($this->linkId)){
51 | mysql_query("SET NAMES '".$this->charset."'",$this->linkId);
52 | if(mysql_select_db($this->database,$this->linkId)) return $this->linkId;
53 | }else{
54 | return false;
55 | }
56 | }
57 | /* disconnect to database */
58 | private function Disconnect(){
59 | if(!empty($this->linkId)){
60 | if(!empty($this->queryId)) mysql_free_result($this->queryId);
61 | return mysql_close($this->linkId);
62 | }
63 | }
64 | /* execute without result */
65 | public function Execute($sql){
66 | return mysql_query($sql,$this->linkId);
67 | }
68 | /* auto execute type=>insert/update */
69 | public function AutoExecute($table,$array=array(),$type='INSERT',$where=''){
70 | if(!empty($array) && !empty($table)){
71 | switch(strtoupper($type)){
72 | case 'INSERT':
73 | $sql="INSERT INTO {$table}(".implode(',',array_keys($array)).") VALUES('".implode("','",array_values($array))."')";
74 | break;
75 | case 'UPDATE':
76 | $sql="UPDATE {$table}";
77 | $updates=array();
78 | foreach($array as $key=>$value){
79 | $updates[]="{$key}='{$value}'";
80 | }
81 | $sql.=" SET ".implode(',',$updates);
82 | if(!empty($where)){
83 | $sql.=" WHERE {$where}";
84 | }
85 | break;
86 | default:break;
87 | }
88 | return $this->Execute($sql);
89 | }else{
90 | return false;
91 | }
92 | }
93 | /* return dataset of query */
94 | public function Dataset($sql){
95 | $this->rows=array();
96 | $this->queryId=mysql_query($sql,$this->linkId);
97 | while($row=mysql_fetch_assoc($this->queryId)){
98 | $this->rows[]=$row;
99 | }
100 | $this->rowsNum=count($this->rows);
101 | return $this->rows;
102 | }
103 | /* return first row */
104 | public function FirstRow($sql){
105 | $this->queryId=mysql_query($sql,$this->linkId);
106 | $row=mysql_fetch_assoc($this->queryId);
107 | if(!empty($row)){
108 | $this->rowsNum=1;
109 | return $row;
110 | }else{
111 | $this->rowsNum=0;
112 | return false;
113 | }
114 | }
115 | /* return first column (array) */
116 | public function FirstColumn($sql){
117 | $Columns=array();
118 | $this->queryId=mysql_query($sql,$this->linkId);
119 | while($row=@mysql_fetch_row($this->queryId)){
120 | $Columns[]=$row[0];
121 | }
122 | $this->rowsNum=count($Columns);
123 | return $Columns;
124 | }
125 | /* return first value */
126 | public function FirstValue($sql){
127 | $this->queryId=mysql_query($sql,$this->linkId);
128 | $row=@mysql_fetch_row($this->queryId);
129 | if(!empty($row)){
130 | $this->rowsNum=1;
131 | return $row[0];
132 | }else{
133 | $this->rowsNum=0;
134 | return false;
135 | }
136 | }
137 | /* last id */
138 | public function LastId(){
139 | return mysql_insert_id();
140 | }
141 | }
142 | ?>
--------------------------------------------------------------------------------
/templates_c/%%78^781^7810E20E%%module_view.html.php:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 | XSS Platform
8 |
9 |
11 |
13 |
15 |
17 |
19 |
20 |
21 | _tpl_vars;
22 | $this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
23 | $this->_tpl_vars = $_smarty_tpl_vars;
24 | unset($_smarty_tpl_vars);
25 | ?>
26 |
27 | _tpl_vars;
28 | $this->_smarty_include(array('smarty_include_tpl_file' => "menus.html", 'smarty_include_vars' => array()));
29 | $this->_tpl_vars = $_smarty_tpl_vars;
30 | unset($_smarty_tpl_vars);
31 | ?>
32 |
33 |
34 |
查看模块信息
35 |
37 |
39 |
41 |
42 |
43 |
44 | 模块名称
45 |
47 |
48 |
49 | 模块描述
50 | _tpl_vars['module']['description']; ?>
51 |
52 |
53 |
54 | 参数 (需要服务器接收的参数名)
55 |
64 |
65 |
66 | 配置参数 (使用此模块时需要配置的参数,如参数名为user,则代码引用:
67 | )
68 |
77 |
78 |
79 | 代码 (
80 | )
81 | _tpl_vars['module']['code']; ?>
82 |
83 |
84 | _tpl_vars['module']['isOpen'] == 0): ?>
85 |
86 | 是否公开
87 | _tpl_vars['module']['isOpen'] == 0): ?> checked="checked" /> 私有
88 | _tpl_vars['module']['isOpen'] == 1): ?> checked="checked" /> 公开
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/source/user.php:
--------------------------------------------------------------------------------
1 | userId<=0) ShowError('未登录或已超时',$url['login'],'重新登录');
11 |
12 | $act=Val('act','GET');
13 |
14 | switch($act){
15 | case 'invite':
16 | $inviteSum=5;
17 | $db=DBConnect();
18 | $tbInviteReg=$db->tbPrefix.'invite_reg';
19 | $invites=$db->Dataset("SELECT id,inviteKey as code,isWooyun,addTime FROM {$tbInviteReg} WHERE userId='".$user->userId."' AND isUsed=0 ORDER BY id DESC");
20 |
21 | $codesWooyun=array();
22 | $codesOther=array();
23 | foreach($invites as $k=>$v){
24 | if($v['isWooyun']==1){
25 | $codesWooyun[]=$v;
26 | }else{
27 | $codesOther[]=$v;
28 | }
29 | }
30 |
31 | $smarty=InitSmarty();
32 | $smarty->assign('codesWooyun',$codesWooyun);
33 | $smarty->assign('codesOther',$codesOther);
34 | $smarty->assign('do',$do);
35 | $smarty->assign('key',$key);
36 | $smarty->assign('show',$show);
37 | $smarty->assign('url',$url);
38 | $smarty->display('user_invite.html');
39 | exit;
40 | echo "可使用的邀请码(",count($invites),"): \n";
41 | if(count($invites)>0){
42 | foreach($invites as $key=>$value){
43 | echo $value['inviteKey']," \n";
44 | }
45 | }
46 | echo " \n",' ';
47 | break;
48 | case 'createinvite':
49 | if($user->adminLevel<=0) ShowError('没有操作权限',URL_ROOT.'/index.php?do=user&act=invite');
50 | $inviteSum=100;
51 | $isWooyun=Val('isWooyun','GET',1)==1 ? 1 : 0;
52 | //判断是否可以生成
53 | $db=DBConnect();
54 | $tbInviteReg=$db->tbPrefix.'invite_reg';
55 | $inviteCount=$db->FirstValue("SELECT COUNT(*) FROM {$tbInviteReg} WHERE userId='".$user->userId."' AND isUsed=0");
56 | if($inviteCount>=$inviteSum) ShowError('最多可生成'.$inviteSum.'条未使用的邀请链接',URL_ROOT.'/index.php?do=user&act=invite');
57 | $inviteKey=md5('oc_'.$user->userId.time().rand(100000,999999));
58 | $sqlValue=array(
59 | 'userId'=>$user->userId,
60 | 'inviteKey'=>$inviteKey,
61 | 'isWooyun'=>$isWooyun,
62 | 'addTime'=>time()
63 | );
64 | if($db->AutoExecute($tbInviteReg,$sqlValue)){
65 | ShowSuccess('操作成功',URL_ROOT.'/index.php?do=user&act=invite');
66 | }else{
67 | ShowError('操作失败',URL_ROOT.'/index.php?do=user&act=invite');
68 | }
69 | break;
70 | //用户个人设置
71 | case 'seting':
72 | $db=DBConnect();
73 | $userInfo=$db->FirstRow("SELECT * FROM ".Tb('user')." WHERE id='".$user->userId."'");
74 |
75 | $phone=$userInfo['phone'];
76 | $email=$userInfo['email'];
77 | if($userInfo['message']=='')
78 | {
79 | $emsg='0';
80 | $pmsg='0';
81 | }
82 | else
83 | {
84 | $msg=explode("|",$userInfo['message']);
85 | $emsg=$msg[0];
86 | $pmsg=$msg[1];
87 | }
88 |
89 | if($emsg=='1')
90 | $input1=" ";
91 | else
92 | $input1=" ";
93 |
94 | if($pmsg=='1')
95 | $input2=" ";
96 | else
97 | $input2=" ";
98 |
99 | include('common.php');
100 | $smarty=InitSmarty();
101 |
102 | $smarty->assign('do',$do);
103 | $smarty->assign('show',$show);
104 | $smarty->assign('url',$url);
105 | $smarty->assign('projects',$projects);
106 | $smarty->assign('modules',$modules);
107 |
108 | $smarty->assign('input1',$input1);
109 | $smarty->assign('input2',$input2);
110 |
111 | $smarty->assign('email',$email);
112 | $smarty->assign('phone',$phone);
113 | $smarty->assign('emsg',$emsg);
114 | $smarty->assign('pmsg',$pmsg);
115 | $smarty->display('user_seting.html');
116 | exit;
117 | break;
118 | case 'submit':
119 | $db=DBConnect();
120 | $phone=Val('phone','POST');
121 | $emsg=Val('emsg','POST');
122 | $pmsg=Val('pmsg','POST');
123 | if(!empty($phone) && !preg_match('/^(\d{11})$/',$phone)) ShowError('手机格式不正确',URL_ROOT.'/index.php?do=user&act=seting','重新填写');//手机验证
124 | if($emsg=='on') $emsg='1'; else $emsg='0';
125 | if($pmsg=='on') $pmsg='1'; else $pmsg='0';
126 | $db->Execute("UPDATE ".Tb('user')." SET phone='".$phone."',message='".$emsg."|".$pmsg."' WHERE id='".$user->userId."'");
127 | ShowSuccess('修改成功',URL_ROOT.'/index.php?do=user&act=seting');
128 | exit;
129 | break;
130 | default:break;
131 | }
132 | ?>
--------------------------------------------------------------------------------
/themes/default/templates/module_set.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | XSS Platform
6 |
7 |
8 |
9 |
10 |
11 |
12 | {literal}
13 |
62 | {/literal}
63 |
64 |
65 | {include file="header.html"}
66 |
67 | {include file="menus.html"}
68 |
120 |
121 |
122 |
--------------------------------------------------------------------------------