@@ -35,22 +35,22 @@ discard block |
||
35 | 35 | $oDB = &DB::getInstance(); |
36 | 36 | $oModuleModel = getModel('module'); |
37 | 37 | // 2007.12.7 The triggers which try to perform spam filtering when new posts/comments/trackbacks are registered |
38 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) return true; |
|
39 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) return true; |
|
40 | - if(!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) return true; |
|
38 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) return true; |
|
39 | + if (!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) return true; |
|
40 | + if (!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) return true; |
|
41 | 41 | // 2008-12-17 Add a spamfilter for post modification actions |
42 | - if(!$oModuleModel->getTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) return true; |
|
43 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) return true; |
|
42 | + if (!$oModuleModel->getTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) return true; |
|
43 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) return true; |
|
44 | 44 | // 2013-11-14 The trigger which try to perform spam filtering when new message are registered |
45 | - if(!$oModuleModel->getTrigger('communication.sendMessage', 'spamfilter', 'controller', 'triggerSendMessage', 'before')) return true; |
|
45 | + if (!$oModuleModel->getTrigger('communication.sendMessage', 'spamfilter', 'controller', 'triggerSendMessage', 'before')) return true; |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * Add the hit count field (hit) |
49 | 49 | */ |
50 | - if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) return true; |
|
51 | - if(!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) return true; |
|
50 | + if (!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) return true; |
|
51 | + if (!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) return true; |
|
52 | 52 | |
53 | - if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) return true; |
|
53 | + if (!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) return true; |
|
54 | 54 | |
55 | 55 | return false; |
56 | 56 | } |
@@ -64,24 +64,24 @@ discard block |
||
64 | 64 | $oModuleModel = getModel('module'); |
65 | 65 | $oModuleController = getController('module'); |
66 | 66 | // 2007.12.7 The triggers which try to perform spam filtering when new posts/comments/trackbacks are registered |
67 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) |
|
67 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) |
|
68 | 68 | $oModuleController->insertTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); |
69 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) |
|
69 | + if (!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) |
|
70 | 70 | $oModuleController->insertTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); |
71 | - if(!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) |
|
71 | + if (!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) |
|
72 | 72 | $oModuleController->insertTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before'); |
73 | 73 | // 2008-12-17 Add a spamfilter for post modification actions |
74 | - if(!$oModuleModel->getTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) |
|
74 | + if (!$oModuleModel->getTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) |
|
75 | 75 | { |
76 | 76 | $oModuleController->insertTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); |
77 | 77 | } |
78 | 78 | // 2008-12-17 Add a spamfilter for post modification actions |
79 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) |
|
79 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) |
|
80 | 80 | { |
81 | 81 | $oModuleController->insertTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); |
82 | 82 | } |
83 | 83 | // 2013-11-14 The trigger which try to perform spam filtering when new message are registered |
84 | - if(!$oModuleModel->getTrigger('communication.sendMessage', 'spamfilter', 'controller', 'triggerSendMessage', 'before')) |
|
84 | + if (!$oModuleModel->getTrigger('communication.sendMessage', 'spamfilter', 'controller', 'triggerSendMessage', 'before')) |
|
85 | 85 | { |
86 | 86 | $oModuleController->insertTrigger('communication.sendMessage', 'spamfilter', 'controller', 'triggerSendMessage', 'before'); |
87 | 87 | } |
@@ -89,23 +89,23 @@ discard block |
||
89 | 89 | /** |
90 | 90 | * Add the hit count field (hit) |
91 | 91 | */ |
92 | - if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) |
|
92 | + if (!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) |
|
93 | 93 | { |
94 | - $oDB->addColumn('spamfilter_denied_word','hit','number',12,0,true); |
|
95 | - $oDB->addIndex('spamfilter_denied_word','idx_hit', 'hit'); |
|
94 | + $oDB->addColumn('spamfilter_denied_word', 'hit', 'number', 12, 0, true); |
|
95 | + $oDB->addIndex('spamfilter_denied_word', 'idx_hit', 'hit'); |
|
96 | 96 | } |
97 | - if(!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) |
|
97 | + if (!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) |
|
98 | 98 | { |
99 | - $oDB->addColumn('spamfilter_denied_word','latest_hit','date'); |
|
100 | - $oDB->addIndex('spamfilter_denied_word','idx_latest_hit', 'latest_hit'); |
|
99 | + $oDB->addColumn('spamfilter_denied_word', 'latest_hit', 'date'); |
|
100 | + $oDB->addIndex('spamfilter_denied_word', 'idx_latest_hit', 'latest_hit'); |
|
101 | 101 | } |
102 | 102 | |
103 | - if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) |
|
103 | + if (!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) |
|
104 | 104 | { |
105 | - $oDB->addColumn('spamfilter_denied_ip','description','varchar', 250); |
|
105 | + $oDB->addColumn('spamfilter_denied_ip', 'description', 'varchar', 250); |
|
106 | 106 | } |
107 | 107 | |
108 | - return new Object(0,'success_updated'); |
|
108 | + return new Object(0, 'success_updated'); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -35,22 +35,40 @@ discard block |
||
35 | 35 | $oDB = &DB::getInstance(); |
36 | 36 | $oModuleModel = getModel('module'); |
37 | 37 | // 2007.12.7 The triggers which try to perform spam filtering when new posts/comments/trackbacks are registered |
38 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) return true; |
|
39 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) return true; |
|
40 | - if(!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) return true; |
|
38 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) { |
|
39 | + return true; |
|
40 | + } |
|
41 | + if(!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) { |
|
42 | + return true; |
|
43 | + } |
|
44 | + if(!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) { |
|
45 | + return true; |
|
46 | + } |
|
41 | 47 | // 2008-12-17 Add a spamfilter for post modification actions |
42 | - if(!$oModuleModel->getTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) return true; |
|
43 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) return true; |
|
48 | + if(!$oModuleModel->getTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) { |
|
49 | + return true; |
|
50 | + } |
|
51 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) { |
|
52 | + return true; |
|
53 | + } |
|
44 | 54 | // 2013-11-14 The trigger which try to perform spam filtering when new message are registered |
45 | - if(!$oModuleModel->getTrigger('communication.sendMessage', 'spamfilter', 'controller', 'triggerSendMessage', 'before')) return true; |
|
55 | + if(!$oModuleModel->getTrigger('communication.sendMessage', 'spamfilter', 'controller', 'triggerSendMessage', 'before')) { |
|
56 | + return true; |
|
57 | + } |
|
46 | 58 | |
47 | 59 | /** |
48 | 60 | * Add the hit count field (hit) |
49 | 61 | */ |
50 | - if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) return true; |
|
51 | - if(!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) return true; |
|
62 | + if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) { |
|
63 | + return true; |
|
64 | + } |
|
65 | + if(!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) { |
|
66 | + return true; |
|
67 | + } |
|
52 | 68 | |
53 | - if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) return true; |
|
69 | + if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) { |
|
70 | + return true; |
|
71 | + } |
|
54 | 72 | |
55 | 73 | return false; |
56 | 74 | } |
@@ -64,12 +82,15 @@ discard block |
||
64 | 82 | $oModuleModel = getModel('module'); |
65 | 83 | $oModuleController = getController('module'); |
66 | 84 | // 2007.12.7 The triggers which try to perform spam filtering when new posts/comments/trackbacks are registered |
67 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) |
|
68 | - $oModuleController->insertTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); |
|
69 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) |
|
70 | - $oModuleController->insertTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); |
|
71 | - if(!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) |
|
72 | - $oModuleController->insertTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before'); |
|
85 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) { |
|
86 | + $oModuleController->insertTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); |
|
87 | + } |
|
88 | + if(!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) { |
|
89 | + $oModuleController->insertTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); |
|
90 | + } |
|
91 | + if(!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) { |
|
92 | + $oModuleController->insertTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before'); |
|
93 | + } |
|
73 | 94 | // 2008-12-17 Add a spamfilter for post modification actions |
74 | 95 | if(!$oModuleModel->getTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) |
75 | 96 | { |
@@ -33,8 +33,12 @@ discard block |
||
33 | 33 | $args->sort_index = "regdate"; |
34 | 34 | $args->page = Context::get('page')?Context::get('page'):1; |
35 | 35 | $output = executeQuery('spamfilter.getDeniedIPList', $args); |
36 | - if(!$output->data) return; |
|
37 | - if(!is_array($output->data)) return array($output->data); |
|
36 | + if(!$output->data) { |
|
37 | + return; |
|
38 | + } |
|
39 | + if(!is_array($output->data)) { |
|
40 | + return array($output->data); |
|
41 | + } |
|
38 | 42 | return $output->data; |
39 | 43 | } |
40 | 44 | |
@@ -46,13 +50,17 @@ discard block |
||
46 | 50 | $ipaddress = $_SERVER['REMOTE_ADDR']; |
47 | 51 | |
48 | 52 | $ip_list = $this->getDeniedIPList(); |
49 | - if(!count($ip_list)) return new Object(); |
|
53 | + if(!count($ip_list)) { |
|
54 | + return new Object(); |
|
55 | + } |
|
50 | 56 | |
51 | 57 | $count = count($ip_list); |
52 | 58 | for($i=0;$i<$count;$i++) |
53 | 59 | { |
54 | 60 | $ip = str_replace('.', '\.', str_replace('*','(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)',$ip_list[$i]->ipaddress)); |
55 | - if(preg_match('/^'.$ip.'$/', $ipaddress, $matches)) return new Object(-1,'msg_alert_registered_denied_ip'); |
|
61 | + if(preg_match('/^'.$ip.'$/', $ipaddress, $matches)) { |
|
62 | + return new Object(-1,'msg_alert_registered_denied_ip'); |
|
63 | + } |
|
56 | 64 | } |
57 | 65 | |
58 | 66 | return new Object(); |
@@ -66,8 +74,12 @@ discard block |
||
66 | 74 | $args = new stdClass(); |
67 | 75 | $args->sort_index = "hit"; |
68 | 76 | $output = executeQuery('spamfilter.getDeniedWordList', $args); |
69 | - if(!$output->data) return; |
|
70 | - if(!is_array($output->data)) return array($output->data); |
|
77 | + if(!$output->data) { |
|
78 | + return; |
|
79 | + } |
|
80 | + if(!is_array($output->data)) { |
|
81 | + return array($output->data); |
|
82 | + } |
|
71 | 83 | return $output->data; |
72 | 84 | } |
73 | 85 | |
@@ -77,7 +89,9 @@ discard block |
||
77 | 89 | function isDeniedWord($text) |
78 | 90 | { |
79 | 91 | $word_list = $this->getDeniedWordList(); |
80 | - if(!count($word_list)) return new Object(); |
|
92 | + if(!count($word_list)) { |
|
93 | + return new Object(); |
|
94 | + } |
|
81 | 95 | |
82 | 96 | $count = count($word_list); |
83 | 97 | for($i=0;$i<$count;$i++) |
@@ -101,7 +115,9 @@ discard block |
||
101 | 115 | { |
102 | 116 | $config = $this->getConfig(); |
103 | 117 | |
104 | - if($config->limits != 'Y') return new Object(); |
|
118 | + if($config->limits != 'Y') { |
|
119 | + return new Object(); |
|
120 | + } |
|
105 | 121 | $limit_count = '3'; |
106 | 122 | $interval = '10'; |
107 | 123 | |
@@ -121,8 +137,7 @@ discard block |
||
121 | 137 | if($isMessage) |
122 | 138 | { |
123 | 139 | $message = sprintf(Context::getLang('msg_alert_limited_message_by_config'), $interval); |
124 | - } |
|
125 | - else |
|
140 | + } else |
|
126 | 141 | { |
127 | 142 | $message = sprintf(Context::getLang('msg_alert_limited_by_config'), $interval); |
128 | 143 | } |
@@ -142,7 +157,9 @@ discard block |
||
142 | 157 | { |
143 | 158 | $oTrackbackModel = getModel('trackback'); |
144 | 159 | $count = $oTrackbackModel->getTrackbackCountByIPAddress($document_srl, $_SERVER['REMOTE_ADDR']); |
145 | - if($count>0) return new Object(-1, 'msg_alert_trackback_denied'); |
|
160 | + if($count>0) { |
|
161 | + return new Object(-1, 'msg_alert_trackback_denied'); |
|
162 | + } |
|
146 | 163 | |
147 | 164 | return new Object(); |
148 | 165 | } |
@@ -152,7 +169,9 @@ discard block |
||
152 | 169 | */ |
153 | 170 | function getLogCount($time = 60, $ipaddress='') |
154 | 171 | { |
155 | - if(!$ipaddress) $ipaddress = $_SERVER['REMOTE_ADDR']; |
|
172 | + if(!$ipaddress) { |
|
173 | + $ipaddress = $_SERVER['REMOTE_ADDR']; |
|
174 | + } |
|
156 | 175 | |
157 | 176 | $args->ipaddress = $ipaddress; |
158 | 177 | $args->regdate = date("YmdHis", $_SERVER['REQUEST_TIME']-$time); |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | { |
32 | 32 | $args = new stdClass(); |
33 | 33 | $args->sort_index = "regdate"; |
34 | - $args->page = Context::get('page')?Context::get('page'):1; |
|
34 | + $args->page = Context::get('page') ? Context::get('page') : 1; |
|
35 | 35 | $output = executeQuery('spamfilter.getDeniedIPList', $args); |
36 | - if(!$output->data) return; |
|
37 | - if(!is_array($output->data)) return array($output->data); |
|
36 | + if (!$output->data) return; |
|
37 | + if (!is_array($output->data)) return array($output->data); |
|
38 | 38 | return $output->data; |
39 | 39 | } |
40 | 40 | |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | $ipaddress = $_SERVER['REMOTE_ADDR']; |
47 | 47 | |
48 | 48 | $ip_list = $this->getDeniedIPList(); |
49 | - if(!count($ip_list)) return new Object(); |
|
49 | + if (!count($ip_list)) return new Object(); |
|
50 | 50 | |
51 | 51 | $count = count($ip_list); |
52 | - for($i=0;$i<$count;$i++) |
|
52 | + for ($i = 0; $i < $count; $i++) |
|
53 | 53 | { |
54 | - $ip = str_replace('.', '\.', str_replace('*','(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)',$ip_list[$i]->ipaddress)); |
|
55 | - if(preg_match('/^'.$ip.'$/', $ipaddress, $matches)) return new Object(-1,'msg_alert_registered_denied_ip'); |
|
54 | + $ip = str_replace('.', '\.', str_replace('*', '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)', $ip_list[$i]->ipaddress)); |
|
55 | + if (preg_match('/^'.$ip.'$/', $ipaddress, $matches)) return new Object(-1, 'msg_alert_registered_denied_ip'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | return new Object(); |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | $args = new stdClass(); |
67 | 67 | $args->sort_index = "hit"; |
68 | 68 | $output = executeQuery('spamfilter.getDeniedWordList', $args); |
69 | - if(!$output->data) return; |
|
70 | - if(!is_array($output->data)) return array($output->data); |
|
69 | + if (!$output->data) return; |
|
70 | + if (!is_array($output->data)) return array($output->data); |
|
71 | 71 | return $output->data; |
72 | 72 | } |
73 | 73 | |
@@ -77,17 +77,17 @@ discard block |
||
77 | 77 | function isDeniedWord($text) |
78 | 78 | { |
79 | 79 | $word_list = $this->getDeniedWordList(); |
80 | - if(!count($word_list)) return new Object(); |
|
80 | + if (!count($word_list)) return new Object(); |
|
81 | 81 | |
82 | 82 | $count = count($word_list); |
83 | - for($i=0;$i<$count;$i++) |
|
83 | + for ($i = 0; $i < $count; $i++) |
|
84 | 84 | { |
85 | 85 | $word = $word_list[$i]->word; |
86 | - if(preg_match('/'.preg_quote($word,'/').'/is', $text)) |
|
86 | + if (preg_match('/'.preg_quote($word, '/').'/is', $text)) |
|
87 | 87 | { |
88 | 88 | $args->word = $word; |
89 | 89 | $output = executeQuery('spamfilter.updateDeniedWordHit', $args); |
90 | - return new Object(-1,sprintf(Context::getLang('msg_alert_denied_word'), $word)); |
|
90 | + return new Object(-1, sprintf(Context::getLang('msg_alert_denied_word'), $word)); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | { |
102 | 102 | $config = $this->getConfig(); |
103 | 103 | |
104 | - if($config->limits != 'Y') return new Object(); |
|
104 | + if ($config->limits != 'Y') return new Object(); |
|
105 | 105 | $limit_count = '3'; |
106 | 106 | $interval = '10'; |
107 | 107 | |
@@ -109,16 +109,16 @@ discard block |
||
109 | 109 | |
110 | 110 | $ipaddress = $_SERVER['REMOTE_ADDR']; |
111 | 111 | // Ban the IP address if the interval is exceeded |
112 | - if($count>=$limit_count) |
|
112 | + if ($count >= $limit_count) |
|
113 | 113 | { |
114 | 114 | $oSpamFilterController = getController('spamfilter'); |
115 | 115 | $oSpamFilterController->insertIP($ipaddress, 'AUTO-DENIED : Over limit'); |
116 | 116 | return new Object(-1, 'msg_alert_registered_denied_ip'); |
117 | 117 | } |
118 | 118 | // If the number of limited posts is not reached, keep creating. |
119 | - if($count) |
|
119 | + if ($count) |
|
120 | 120 | { |
121 | - if($isMessage) |
|
121 | + if ($isMessage) |
|
122 | 122 | { |
123 | 123 | $message = sprintf(Context::getLang('msg_alert_limited_message_by_config'), $interval); |
124 | 124 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | { |
143 | 143 | $oTrackbackModel = getModel('trackback'); |
144 | 144 | $count = $oTrackbackModel->getTrackbackCountByIPAddress($document_srl, $_SERVER['REMOTE_ADDR']); |
145 | - if($count>0) return new Object(-1, 'msg_alert_trackback_denied'); |
|
145 | + if ($count > 0) return new Object(-1, 'msg_alert_trackback_denied'); |
|
146 | 146 | |
147 | 147 | return new Object(); |
148 | 148 | } |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | /** |
151 | 151 | * @brief Return the number of logs recorded within the interval for the specified IPaddress |
152 | 152 | */ |
153 | - function getLogCount($time = 60, $ipaddress='') |
|
153 | + function getLogCount($time = 60, $ipaddress = '') |
|
154 | 154 | { |
155 | - if(!$ipaddress) $ipaddress = $_SERVER['REMOTE_ADDR']; |
|
155 | + if (!$ipaddress) $ipaddress = $_SERVER['REMOTE_ADDR']; |
|
156 | 156 | |
157 | 157 | $args->ipaddress = $ipaddress; |
158 | - $args->regdate = date("YmdHis", $_SERVER['REQUEST_TIME']-$time); |
|
158 | + $args->regdate = date("YmdHis", $_SERVER['REQUEST_TIME'] - $time); |
|
159 | 159 | $output = executeQuery('spamfilter.getLogCount', $args); |
160 | 160 | $count = $output->data->count; |
161 | 161 | return $count; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $oModuleController = getController('module'); |
16 | 16 | $oDB = &DB::getInstance(); |
17 | 17 | |
18 | - $oDB->addIndex("tags","idx_tag", array("document_srl","tag")); |
|
18 | + $oDB->addIndex("tags", "idx_tag", array("document_srl", "tag")); |
|
19 | 19 | // 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument trigger property for |
20 | 20 | $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); |
21 | 21 | $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); |
@@ -36,15 +36,15 @@ discard block |
||
36 | 36 | $oModuleModel = getModel('module'); |
37 | 37 | $oDB = &DB::getInstance(); |
38 | 38 | // 2007. 10. 17 trigger registration, if registered upset |
39 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true; |
|
40 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true; |
|
41 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true; |
|
42 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true; |
|
43 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) return true; |
|
39 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true; |
|
40 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true; |
|
41 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true; |
|
42 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true; |
|
43 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) return true; |
|
44 | 44 | // 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag |
45 | - if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) return true; |
|
45 | + if (!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) return true; |
|
46 | 46 | // tag in the index column of the table tag |
47 | - if(!$oDB->isIndexExists("tags","idx_tag")) return true; |
|
47 | + if (!$oDB->isIndexExists("tags", "idx_tag")) return true; |
|
48 | 48 | |
49 | 49 | return false; |
50 | 50 | } |
@@ -58,26 +58,26 @@ discard block |
||
58 | 58 | $oModuleController = getController('module'); |
59 | 59 | $oDB = &DB::getInstance(); |
60 | 60 | // 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument trigger property for |
61 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) |
|
61 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) |
|
62 | 62 | $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); |
63 | 63 | |
64 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) |
|
64 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) |
|
65 | 65 | $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); |
66 | 66 | |
67 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) |
|
67 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) |
|
68 | 68 | $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); |
69 | 69 | |
70 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) |
|
70 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) |
|
71 | 71 | $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); |
72 | 72 | |
73 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) |
|
73 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) |
|
74 | 74 | $oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after'); |
75 | 75 | // 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag |
76 | - if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) |
|
76 | + if (!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) |
|
77 | 77 | $oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'); |
78 | 78 | // tag in the index column of the table tag |
79 | - if(!$oDB->isIndexExists("tags","idx_tag")) |
|
80 | - $oDB->addIndex("tags","idx_tag", array("document_srl","tag")); |
|
79 | + if (!$oDB->isIndexExists("tags", "idx_tag")) |
|
80 | + $oDB->addIndex("tags", "idx_tag", array("document_srl", "tag")); |
|
81 | 81 | |
82 | 82 | return new Object(0, 'success_updated'); |
83 | 83 | } |
@@ -36,15 +36,29 @@ discard block |
||
36 | 36 | $oModuleModel = getModel('module'); |
37 | 37 | $oDB = &DB::getInstance(); |
38 | 38 | // 2007. 10. 17 trigger registration, if registered upset |
39 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true; |
|
40 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true; |
|
41 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true; |
|
42 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true; |
|
43 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) return true; |
|
39 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) { |
|
40 | + return true; |
|
41 | + } |
|
42 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) { |
|
43 | + return true; |
|
44 | + } |
|
45 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) { |
|
46 | + return true; |
|
47 | + } |
|
48 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) { |
|
49 | + return true; |
|
50 | + } |
|
51 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) { |
|
52 | + return true; |
|
53 | + } |
|
44 | 54 | // 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag |
45 | - if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) return true; |
|
55 | + if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) { |
|
56 | + return true; |
|
57 | + } |
|
46 | 58 | // tag in the index column of the table tag |
47 | - if(!$oDB->isIndexExists("tags","idx_tag")) return true; |
|
59 | + if(!$oDB->isIndexExists("tags","idx_tag")) { |
|
60 | + return true; |
|
61 | + } |
|
48 | 62 | |
49 | 63 | return false; |
50 | 64 | } |
@@ -58,26 +72,33 @@ discard block |
||
58 | 72 | $oModuleController = getController('module'); |
59 | 73 | $oDB = &DB::getInstance(); |
60 | 74 | // 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument trigger property for |
61 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) |
|
62 | - $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); |
|
75 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) { |
|
76 | + $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); |
|
77 | + } |
|
63 | 78 | |
64 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) |
|
65 | - $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); |
|
79 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) { |
|
80 | + $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); |
|
81 | + } |
|
66 | 82 | |
67 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) |
|
68 | - $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); |
|
83 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) { |
|
84 | + $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); |
|
85 | + } |
|
69 | 86 | |
70 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) |
|
71 | - $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); |
|
87 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) { |
|
88 | + $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); |
|
89 | + } |
|
72 | 90 | |
73 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) |
|
74 | - $oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after'); |
|
91 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) { |
|
92 | + $oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after'); |
|
93 | + } |
|
75 | 94 | // 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag |
76 | - if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) |
|
77 | - $oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'); |
|
95 | + if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) { |
|
96 | + $oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'); |
|
97 | + } |
|
78 | 98 | // tag in the index column of the table tag |
79 | - if(!$oDB->isIndexExists("tags","idx_tag")) |
|
80 | - $oDB->addIndex("tags","idx_tag", array("document_srl","tag")); |
|
99 | + if(!$oDB->isIndexExists("tags","idx_tag")) { |
|
100 | + $oDB->addIndex("tags","idx_tag", array("document_srl","tag")); |
|
101 | + } |
|
81 | 102 | |
82 | 103 | return new Object(0, 'success_updated'); |
83 | 104 | } |
@@ -19,20 +19,20 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function triggerArrangeTag(&$obj) |
21 | 21 | { |
22 | - if(!$obj->tags) return new Object(); |
|
22 | + if (!$obj->tags) return new Object(); |
|
23 | 23 | // tags by variable |
24 | 24 | $tag_list = explode(',', $obj->tags); |
25 | 25 | $tag_count = count($tag_list); |
26 | 26 | $tag_list = array_unique($tag_list); |
27 | - if(!count($tag_list)) return new Object(); |
|
27 | + if (!count($tag_list)) return new Object(); |
|
28 | 28 | |
29 | - foreach($tag_list as $tag) |
|
29 | + foreach ($tag_list as $tag) |
|
30 | 30 | { |
31 | - if(!trim($tag)) continue; |
|
31 | + if (!trim($tag)) continue; |
|
32 | 32 | $arranged_tag_list[] = trim($tag); |
33 | 33 | } |
34 | - if(!count($arranged_tag_list)) $obj->tags = null; |
|
35 | - else $obj->tags = implode(',',$arranged_tag_list); |
|
34 | + if (!count($arranged_tag_list)) $obj->tags = null; |
|
35 | + else $obj->tags = implode(',', $arranged_tag_list); |
|
36 | 36 | return new Object(); |
37 | 37 | } |
38 | 38 | |
@@ -45,24 +45,24 @@ discard block |
||
45 | 45 | $module_srl = $obj->module_srl; |
46 | 46 | $document_srl = $obj->document_srl; |
47 | 47 | $tags = $obj->tags; |
48 | - if(!$document_srl) return new Object(); |
|
48 | + if (!$document_srl) return new Object(); |
|
49 | 49 | // Remove all tags that article |
50 | 50 | $output = $this->triggerDeleteTag($obj); |
51 | - if(!$output->toBool()) return $output; |
|
51 | + if (!$output->toBool()) return $output; |
|
52 | 52 | // Re-enter the tag |
53 | 53 | $args = new stdClass(); |
54 | 54 | $args->module_srl = $module_srl; |
55 | 55 | $args->document_srl = $document_srl; |
56 | 56 | |
57 | - $tag_list = explode(',',$tags); |
|
57 | + $tag_list = explode(',', $tags); |
|
58 | 58 | $tag_count = count($tag_list); |
59 | - for($i=0;$i<$tag_count;$i++) |
|
59 | + for ($i = 0; $i < $tag_count; $i++) |
|
60 | 60 | { |
61 | 61 | unset($args->tag); |
62 | 62 | $args->tag = trim($tag_list[$i]); |
63 | - if(!$args->tag) continue; |
|
63 | + if (!$args->tag) continue; |
|
64 | 64 | $output = executeQuery('tag.insertTag', $args); |
65 | - if(!$output->toBool()) return $output; |
|
65 | + if (!$output->toBool()) return $output; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | return new Object(); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | function triggerDeleteTag(&$obj) |
76 | 76 | { |
77 | 77 | $document_srl = $obj->document_srl; |
78 | - if(!$document_srl) return new Object(); |
|
78 | + if (!$document_srl) return new Object(); |
|
79 | 79 | |
80 | 80 | $args = new stdClass(); |
81 | 81 | $args->document_srl = $document_srl; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | function triggerDeleteModuleTags(&$obj) |
89 | 89 | { |
90 | 90 | $module_srl = $obj->module_srl; |
91 | - if(!$module_srl) return new Object(); |
|
91 | + if (!$module_srl) return new Object(); |
|
92 | 92 | |
93 | 93 | $oTagController = getAdminController('tag'); |
94 | 94 | return $oTagController->deleteModuleTags($module_srl); |
@@ -19,20 +19,29 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function triggerArrangeTag(&$obj) |
21 | 21 | { |
22 | - if(!$obj->tags) return new Object(); |
|
22 | + if(!$obj->tags) { |
|
23 | + return new Object(); |
|
24 | + } |
|
23 | 25 | // tags by variable |
24 | 26 | $tag_list = explode(',', $obj->tags); |
25 | 27 | $tag_count = count($tag_list); |
26 | 28 | $tag_list = array_unique($tag_list); |
27 | - if(!count($tag_list)) return new Object(); |
|
29 | + if(!count($tag_list)) { |
|
30 | + return new Object(); |
|
31 | + } |
|
28 | 32 | |
29 | 33 | foreach($tag_list as $tag) |
30 | 34 | { |
31 | - if(!trim($tag)) continue; |
|
35 | + if(!trim($tag)) { |
|
36 | + continue; |
|
37 | + } |
|
32 | 38 | $arranged_tag_list[] = trim($tag); |
33 | 39 | } |
34 | - if(!count($arranged_tag_list)) $obj->tags = null; |
|
35 | - else $obj->tags = implode(',',$arranged_tag_list); |
|
40 | + if(!count($arranged_tag_list)) { |
|
41 | + $obj->tags = null; |
|
42 | + } else { |
|
43 | + $obj->tags = implode(',',$arranged_tag_list); |
|
44 | + } |
|
36 | 45 | return new Object(); |
37 | 46 | } |
38 | 47 | |
@@ -45,10 +54,14 @@ discard block |
||
45 | 54 | $module_srl = $obj->module_srl; |
46 | 55 | $document_srl = $obj->document_srl; |
47 | 56 | $tags = $obj->tags; |
48 | - if(!$document_srl) return new Object(); |
|
57 | + if(!$document_srl) { |
|
58 | + return new Object(); |
|
59 | + } |
|
49 | 60 | // Remove all tags that article |
50 | 61 | $output = $this->triggerDeleteTag($obj); |
51 | - if(!$output->toBool()) return $output; |
|
62 | + if(!$output->toBool()) { |
|
63 | + return $output; |
|
64 | + } |
|
52 | 65 | // Re-enter the tag |
53 | 66 | $args = new stdClass(); |
54 | 67 | $args->module_srl = $module_srl; |
@@ -60,9 +73,13 @@ discard block |
||
60 | 73 | { |
61 | 74 | unset($args->tag); |
62 | 75 | $args->tag = trim($tag_list[$i]); |
63 | - if(!$args->tag) continue; |
|
76 | + if(!$args->tag) { |
|
77 | + continue; |
|
78 | + } |
|
64 | 79 | $output = executeQuery('tag.insertTag', $args); |
65 | - if(!$output->toBool()) return $output; |
|
80 | + if(!$output->toBool()) { |
|
81 | + return $output; |
|
82 | + } |
|
66 | 83 | } |
67 | 84 | |
68 | 85 | return new Object(); |
@@ -75,7 +92,9 @@ discard block |
||
75 | 92 | function triggerDeleteTag(&$obj) |
76 | 93 | { |
77 | 94 | $document_srl = $obj->document_srl; |
78 | - if(!$document_srl) return new Object(); |
|
95 | + if(!$document_srl) { |
|
96 | + return new Object(); |
|
97 | + } |
|
79 | 98 | |
80 | 99 | $args = new stdClass(); |
81 | 100 | $args->document_srl = $document_srl; |
@@ -88,7 +107,9 @@ discard block |
||
88 | 107 | function triggerDeleteModuleTags(&$obj) |
89 | 108 | { |
90 | 109 | $module_srl = $obj->module_srl; |
91 | - if(!$module_srl) return new Object(); |
|
110 | + if(!$module_srl) { |
|
111 | + return new Object(); |
|
112 | + } |
|
92 | 113 | |
93 | 114 | $oTagController = getAdminController('tag'); |
94 | 115 | return $oTagController->deleteModuleTags($module_srl); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | } |
25 | 25 | function getTitle() |
26 | 26 | { |
27 | - if(empty($this->title)) return $lang->untitle; |
|
27 | + if (empty($this->title)) return $lang->untitle; |
|
28 | 28 | return htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
29 | 29 | } |
30 | 30 | function setTitle($title) |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | function getOriginModule() |
35 | 35 | { |
36 | - if(empty($this->originModule)) return 'document'; |
|
36 | + if (empty($this->originModule)) return 'document'; |
|
37 | 37 | return $this->originModule; |
38 | 38 | } |
39 | 39 | function setOriginModule($originModule) |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | function getRegdate() |
100 | 100 | { |
101 | - if(empty($this->regdate)) return date('YmdHis'); |
|
101 | + if (empty($this->regdate)) return date('YmdHis'); |
|
102 | 102 | |
103 | 103 | return $this->regdate; |
104 | 104 | } |
@@ -24,7 +24,9 @@ discard block |
||
24 | 24 | } |
25 | 25 | function getTitle() |
26 | 26 | { |
27 | - if(empty($this->title)) return $lang->untitle; |
|
27 | + if(empty($this->title)) { |
|
28 | + return $lang->untitle; |
|
29 | + } |
|
28 | 30 | return htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
29 | 31 | } |
30 | 32 | function setTitle($title) |
@@ -33,7 +35,9 @@ discard block |
||
33 | 35 | } |
34 | 36 | function getOriginModule() |
35 | 37 | { |
36 | - if(empty($this->originModule)) return 'document'; |
|
38 | + if(empty($this->originModule)) { |
|
39 | + return 'document'; |
|
40 | + } |
|
37 | 41 | return $this->originModule; |
38 | 42 | } |
39 | 43 | function setOriginModule($originModule) |
@@ -98,7 +102,9 @@ discard block |
||
98 | 102 | } |
99 | 103 | function getRegdate() |
100 | 104 | { |
101 | - if(empty($this->regdate)) return date('YmdHis'); |
|
105 | + if(empty($this->regdate)) { |
|
106 | + return date('YmdHis'); |
|
107 | + } |
|
102 | 108 | |
103 | 109 | return $this->regdate; |
104 | 110 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | function init() |
18 | 18 | { |
19 | 19 | // 템플릿 경로 지정 (board의 경우 tpl에 관리자용 템플릿 모아놓음) |
20 | - $template_path = sprintf("%stpl/",$this->module_path); |
|
20 | + $template_path = sprintf("%stpl/", $this->module_path); |
|
21 | 21 | $this->setTemplatePath($template_path); |
22 | 22 | } |
23 | 23 | |
@@ -51,20 +51,20 @@ discard block |
||
51 | 51 | $oModuleModel = getModel('module'); |
52 | 52 | $module_list = array(); |
53 | 53 | $mod_srls = array(); |
54 | - foreach($output->data as $oTrashVO) |
|
54 | + foreach ($output->data as $oTrashVO) |
|
55 | 55 | { |
56 | 56 | $mod_srls[] = $oTrashVO->unserializedObject['module_srl']; |
57 | 57 | } |
58 | 58 | $mod_srls = array_unique($mod_srls); |
59 | 59 | // Module List |
60 | 60 | $mod_srls_count = count($mod_srls); |
61 | - if($mod_srls_count) |
|
61 | + if ($mod_srls_count) |
|
62 | 62 | { |
63 | 63 | $columnList = array('module_srl', 'mid', 'browser_title'); |
64 | 64 | $module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList); |
65 | - if($module_output && is_array($module_output)) |
|
65 | + if ($module_output && is_array($module_output)) |
|
66 | 66 | { |
67 | - foreach($module_output as $module) |
|
67 | + foreach ($module_output as $module) |
|
68 | 68 | { |
69 | 69 | $module_list[$module->module_srl] = $module; |
70 | 70 | } |
@@ -86,13 +86,13 @@ discard block |
||
86 | 86 | |
87 | 87 | $oTrashModel = getModel('trash'); |
88 | 88 | $output = $oTrashModel->getTrash($trash_srl); |
89 | - if(!$output->data->getTrashSrl()) return new Object(-1, 'msg_invalid_request'); |
|
89 | + if (!$output->data->getTrashSrl()) return new Object(-1, 'msg_invalid_request'); |
|
90 | 90 | |
91 | 91 | $originObject = unserialize($output->data->getSerializedObject()); |
92 | - if(is_array($originObject)) $originObject = (object)$originObject; |
|
92 | + if (is_array($originObject)) $originObject = (object) $originObject; |
|
93 | 93 | |
94 | - Context::set('oTrashVO',$output->data); |
|
95 | - Context::set('oOrigin',$originObject); |
|
94 | + Context::set('oTrashVO', $output->data); |
|
95 | + Context::set('oOrigin', $originObject); |
|
96 | 96 | |
97 | 97 | $oMemberModel = &getModel('member'); |
98 | 98 | $remover_info = $oMemberModel->getMemberInfoByMemberSrl($output->data->getRemoverSrl()); |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($originObject->module_srl); |
103 | 103 | Context::set('module_info', $module_info); |
104 | 104 | |
105 | - if($originObject) { |
|
105 | + if ($originObject) { |
|
106 | 106 | $args_extra->module_srl = $originObject->module_srl; |
107 | 107 | $args_extra->document_srl = $originObject->document_srl; |
108 | 108 | $output_extra = executeQueryArray('trash.getDocumentExtraVars', $args_extra); |
109 | - Context::set('oOriginExtraVars',$output_extra->data); |
|
109 | + Context::set('oOriginExtraVars', $output_extra->data); |
|
110 | 110 | } |
111 | 111 | $this->setTemplateFile('trash_view'); |
112 | 112 | } |
@@ -86,10 +86,14 @@ |
||
86 | 86 | |
87 | 87 | $oTrashModel = getModel('trash'); |
88 | 88 | $output = $oTrashModel->getTrash($trash_srl); |
89 | - if(!$output->data->getTrashSrl()) return new Object(-1, 'msg_invalid_request'); |
|
89 | + if(!$output->data->getTrashSrl()) { |
|
90 | + return new Object(-1, 'msg_invalid_request'); |
|
91 | + } |
|
90 | 92 | |
91 | 93 | $originObject = unserialize($output->data->getSerializedObject()); |
92 | - if(is_array($originObject)) $originObject = (object)$originObject; |
|
94 | + if(is_array($originObject)) { |
|
95 | + $originObject = (object)$originObject; |
|
96 | + } |
|
93 | 97 | |
94 | 98 | Context::set('oTrashVO',$output->data); |
95 | 99 | Context::set('oOrigin',$originObject); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | function getTrash($trashSrl, $columnList = array()) |
20 | 20 | { |
21 | 21 | $oTrashVO = new TrashVO(); |
22 | - if(!$trashSrl) return $oTrashVO; |
|
22 | + if (!$trashSrl) return $oTrashVO; |
|
23 | 23 | |
24 | 24 | $args = new stdClass(); |
25 | 25 | $args->trashSrl = $trashSrl; |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | { |
42 | 42 | $output = executeQueryArray('trash.getTrashList', $args, $columnList); |
43 | 43 | |
44 | - if(is_array($output->data)) |
|
44 | + if (is_array($output->data)) |
|
45 | 45 | { |
46 | - foreach($output->data AS $key=>$value) |
|
46 | + foreach ($output->data AS $key=>$value) |
|
47 | 47 | { |
48 | 48 | $oTrashVO = new TrashVO(); |
49 | 49 | $this->_setTrashObject($oTrashVO, $value); |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | { |
64 | 64 | $output = executeQueryArray('trash.getTrashAllList', $args, $columnList); |
65 | 65 | |
66 | - if(is_array($output->data)) |
|
66 | + if (is_array($output->data)) |
|
67 | 67 | { |
68 | - foreach($output->data AS $key=>$value) |
|
68 | + foreach ($output->data AS $key=>$value) |
|
69 | 69 | { |
70 | 70 | $oTrashVO = new TrashVO(); |
71 | 71 | $this->_setTrashObject($oTrashVO, $value); |
@@ -19,7 +19,9 @@ |
||
19 | 19 | function getTrash($trashSrl, $columnList = array()) |
20 | 20 | { |
21 | 21 | $oTrashVO = new TrashVO(); |
22 | - if(!$trashSrl) return $oTrashVO; |
|
22 | + if(!$trashSrl) { |
|
23 | + return $oTrashVO; |
|
24 | + } |
|
23 | 25 | |
24 | 26 | $args = new stdClass(); |
25 | 27 | $args->trashSrl = $trashSrl; |
@@ -32,8 +32,7 @@ discard block |
||
32 | 32 | if($widget->widget) |
33 | 33 | { |
34 | 34 | $widget_list[$no]->description = nl2br(trim($widget->description)); |
35 | - } |
|
36 | - else |
|
35 | + } else |
|
37 | 36 | { |
38 | 37 | unset($widget_list[$no]); |
39 | 38 | } |
@@ -59,7 +58,9 @@ discard block |
||
59 | 58 | function dispWidgetAdminAddContent() |
60 | 59 | { |
61 | 60 | $module_srl = Context::get('module_srl'); |
62 | - if(!$module_srl) return $this->stop("msg_invalid_request"); |
|
61 | + if(!$module_srl) { |
|
62 | + return $this->stop("msg_invalid_request"); |
|
63 | + } |
|
63 | 64 | |
64 | 65 | $document_srl = Context::get('document_srl'); |
65 | 66 | $oDocumentModel = getModel('document'); |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | $security = new Security($widget_list); |
28 | 28 | $widget_list = $security->encodeHTML('..', '..author..'); |
29 | 29 | |
30 | - foreach($widget_list as $no => $widget) |
|
30 | + foreach ($widget_list as $no => $widget) |
|
31 | 31 | { |
32 | - if($widget->widget) |
|
32 | + if ($widget->widget) |
|
33 | 33 | { |
34 | 34 | $widget_list[$no]->description = nl2br(trim($widget->description)); |
35 | 35 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | function dispWidgetAdminAddContent() |
60 | 60 | { |
61 | 61 | $module_srl = Context::get('module_srl'); |
62 | - if(!$module_srl) return $this->stop("msg_invalid_request"); |
|
62 | + if (!$module_srl) return $this->stop("msg_invalid_request"); |
|
63 | 63 | |
64 | 64 | $document_srl = Context::get('document_srl'); |
65 | 65 | $oDocumentModel = getModel('document'); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | Context::set('module_info', $module_info); |
73 | 73 | // Editors settings of the module by calling getEditor |
74 | 74 | $oEditorModel = getModel('editor'); |
75 | - $editor = $oEditorModel->getModuleEditor('document',$module_srl, $module_srl,'module_srl','content'); |
|
75 | + $editor = $oEditorModel->getModuleEditor('document', $module_srl, $module_srl, 'module_srl', 'content'); |
|
76 | 76 | Context::set('editor', $editor); |
77 | 77 | |
78 | 78 | $security = new Security(); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | $oModuleModel = getModel('module'); |
31 | 31 | // widget compile display.after trigger for further (04/14/2009) |
32 | - if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true; |
|
32 | + if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true; |
|
33 | 33 | |
34 | 34 | return false; |
35 | 35 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $oModuleModel = getModel('module'); |
43 | 43 | $oModuleController = getController('module'); |
44 | 44 | // widget compile display.after trigger for further (04/14/2009) |
45 | - if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) |
|
45 | + if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) |
|
46 | 46 | { |
47 | 47 | $oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before'); |
48 | 48 | } |
@@ -29,7 +29,9 @@ |
||
29 | 29 | { |
30 | 30 | $oModuleModel = getModel('module'); |
31 | 31 | // widget compile display.after trigger for further (04/14/2009) |
32 | - if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true; |
|
32 | + if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) { |
|
33 | + return true; |
|
34 | + } |
|
33 | 35 | |
34 | 36 | return false; |
35 | 37 | } |