GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( 3d3ece...f480fa )
by gyeong-won
09:44
created
modules/spamfilter/spamfilter.model.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
46 46
 		$ipaddress = $_SERVER['REMOTE_ADDR'];
47 47
 
48 48
 		$ip_list = $this->getDeniedIPList();
49
-		if(!count($ip_list)) return new BaseObject();
49
+		if (!count($ip_list)) return new BaseObject();
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 BaseObject(-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 BaseObject(-1, 'msg_alert_registered_denied_ip');
56 56
 		}
57 57
 
58 58
 		return new BaseObject();
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
77 77
 	function isDeniedWord($text)
78 78
 	{
79 79
 		$word_list = $this->getDeniedWordList();
80
-		if(!count($word_list)) return new BaseObject();
80
+		if (!count($word_list)) return new BaseObject();
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 BaseObject(-1,sprintf(Context::getLang('msg_alert_denied_word'), $word));
90
+				return new BaseObject(-1, sprintf(Context::getLang('msg_alert_denied_word'), $word));
91 91
 			}
92 92
 		}
93 93
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	{
102 102
 		$config = $this->getConfig();
103 103
 
104
-		if($config->limits != 'Y') return new BaseObject(); 
104
+		if ($config->limits != 'Y') return new BaseObject(); 
105 105
 		$limit_count = '3';
106 106
 		$interval = '10';
107 107
 
@@ -109,16 +109,16 @@  discard block
 block discarded – undo
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 BaseObject(-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
 block discarded – undo
142 142
 	{
143 143
 		$oTrackbackModel = getModel('trackback');
144 144
 		$count = $oTrackbackModel->getTrackbackCountByIPAddress($document_srl, $_SERVER['REMOTE_ADDR']);
145
-		if($count>0) return new BaseObject(-1, 'msg_alert_trackback_denied');
145
+		if ($count > 0) return new BaseObject(-1, 'msg_alert_trackback_denied');
146 146
 
147 147
 		return new BaseObject();
148 148
 	}
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
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;
Please login to merge, or discard this patch.
Braces   +31 added lines, -12 removed lines patch added patch discarded remove patch
@@ -33,8 +33,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
46 50
 		$ipaddress = $_SERVER['REMOTE_ADDR'];
47 51
 
48 52
 		$ip_list = $this->getDeniedIPList();
49
-		if(!count($ip_list)) return new BaseObject();
53
+		if(!count($ip_list)) {
54
+			return new BaseObject();
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 BaseObject(-1,'msg_alert_registered_denied_ip');
61
+			if(preg_match('/^'.$ip.'$/', $ipaddress, $matches)) {
62
+				return new BaseObject(-1,'msg_alert_registered_denied_ip');
63
+			}
56 64
 		}
57 65
 
58 66
 		return new BaseObject();
@@ -66,8 +74,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
77 89
 	function isDeniedWord($text)
78 90
 	{
79 91
 		$word_list = $this->getDeniedWordList();
80
-		if(!count($word_list)) return new BaseObject();
92
+		if(!count($word_list)) {
93
+			return new BaseObject();
94
+		}
81 95
 
82 96
 		$count = count($word_list);
83 97
 		for($i=0;$i<$count;$i++)
@@ -101,7 +115,9 @@  discard block
 block discarded – undo
101 115
 	{
102 116
 		$config = $this->getConfig();
103 117
 
104
-		if($config->limits != 'Y') return new BaseObject(); 
118
+		if($config->limits != 'Y') {
119
+			return new BaseObject();
120
+		}
105 121
 		$limit_count = '3';
106 122
 		$interval = '10';
107 123
 
@@ -121,8 +137,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
142 157
 	{
143 158
 		$oTrackbackModel = getModel('trackback');
144 159
 		$count = $oTrackbackModel->getTrackbackCountByIPAddress($document_srl, $_SERVER['REMOTE_ADDR']);
145
-		if($count>0) return new BaseObject(-1, 'msg_alert_trackback_denied');
160
+		if($count>0) {
161
+			return new BaseObject(-1, 'msg_alert_trackback_denied');
162
+		}
146 163
 
147 164
 		return new BaseObject();
148 165
 	}
@@ -152,7 +169,9 @@  discard block
 block discarded – undo
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);
Please login to merge, or discard this patch.
modules/module/module.view.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 		$skin = Context::get('skin');
26 26
 		// Get modules/skin information
27 27
 		$module_path = sprintf("./modules/%s/", $selected_module);
28
-		if(!is_dir($module_path)) $this->stop("msg_invalid_request");
28
+		if (!is_dir($module_path)) $this->stop("msg_invalid_request");
29 29
 
30 30
 		$skin_info_xml = sprintf("%sskins/%s/skin.xml", $module_path, $skin);
31
-		if(!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
31
+		if (!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
32 32
 
33 33
 		$oModuleModel = getModel('module');
34 34
 		$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
35
-		Context::set('skin_info',$skin_info);
35
+		Context::set('skin_info', $skin_info);
36 36
 
37 37
 		$this->setLayoutFile("popup_layout");
38 38
 		$this->setTemplateFile("skin_info");
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	function dispModuleSelectList()
45 45
 	{
46
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
46
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
47 47
 
48 48
 		$oModuleModel = getModel('module');
49 49
 		$logged_info = Context::get('logged_info');
@@ -57,17 +57,17 @@  discard block
 block discarded – undo
57 57
 
58 58
 		$args = new stdClass();
59 59
 		$module_category_exists = false;
60
-		if($logged_info->is_admin == 'Y' && $site_keyword)
60
+		if ($logged_info->is_admin == 'Y' && $site_keyword)
61 61
 		{
62 62
 			$args->site_keyword = $site_keyword;
63 63
 		}
64 64
 		else
65 65
 		{
66
-			$args->site_srl = (int)$site_module_info->site_srl;
66
+			$args->site_srl = (int) $site_module_info->site_srl;
67 67
 			Context::set('site_keyword', null);
68 68
 		}
69 69
 
70
-		if($logged_info->is_admin == 'Y')
70
+		if ($logged_info->is_admin == 'Y')
71 71
 		{
72 72
 			$module_category_exists = true;
73 73
 		}
@@ -75,14 +75,14 @@  discard block
 block discarded – undo
75 75
 		// Get a list of modules at the site
76 76
 		$mid_list = array();
77 77
 		$output = executeQueryArray('module.getSiteModules', $args);
78
-		if(!$output->data) $output->data = array();
78
+		if (!$output->data) $output->data = array();
79 79
 
80
-		foreach($output->data as $key => $val)
80
+		foreach ($output->data as $key => $val)
81 81
 		{
82 82
 			$module = trim($val->module);
83
-			if(!$module) continue;
83
+			if (!$module) continue;
84 84
 
85
-			if(!$oModuleModel->getGrant($val, $logged_info)->access)
85
+			if (!$oModuleModel->getGrant($val, $logged_info)->access)
86 86
 			{
87 87
 				continue;
88 88
 			}
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 			$obj->browser_title = $val->browser_title;
94 94
 			$mid_list[$module]->list[$category][$val->mid] = $obj;
95 95
 
96
-			if(!$selected_module) $selected_module = $module;
97
-			if(!$mid_list[$module]->title)
96
+			if (!$selected_module) $selected_module = $module;
97
+			if (!$mid_list[$module]->title)
98 98
 			{
99 99
 				$xml_info = $oModuleModel->getModuleInfoXml($module);
100 100
 				$mid_list[$module]->title = $xml_info->title;
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
 	function dispModuleFileBox()
118 118
 	{
119 119
 		$logged_info = Context::get('logged_info');
120
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new BaseObject(-1, 'msg_not_permitted');
120
+		if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) return new BaseObject(-1, 'msg_not_permitted');
121 121
 
122 122
 		$input_name = Context::get('input');
123
-		if(!preg_match('/^[a-z0-9_]+$/i', $input_name))
123
+		if (!preg_match('/^[a-z0-9_]+$/i', $input_name))
124 124
 		{
125 125
 			return new BaseObject(-1, 'msg_invalid_request');
126 126
 		}
127 127
 
128
-		if(!$input_name) return new BaseObject(-1, 'msg_not_permitted');
128
+		if (!$input_name) return new BaseObject(-1, 'msg_not_permitted');
129 129
 
130 130
 		$addscript = sprintf('<script>//<![CDATA[
131 131
 				var selected_filebox_input_name = "%s";
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		Context::set('filebox_list', $output->data);
138 138
 
139 139
 		$filter = Context::get('filter');
140
-		if($filter) Context::set('arrfilter',explode(',',$filter));
140
+		if ($filter) Context::set('arrfilter', explode(',', $filter));
141 141
 
142 142
 		Context::set('page_navigation', $output->page_navigation);
143 143
 		$this->setLayoutFile('popup_layout');
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
 	function dispModuleFileBoxAdd()
149 149
 	{
150 150
 		$logged_info = Context::get('logged_info');
151
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new BaseObject(-1, 'msg_not_permitted');
151
+		if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) return new BaseObject(-1, 'msg_not_permitted');
152 152
 
153 153
 		$filter = Context::get('filter');
154
-		if($filter) Context::set('arrfilter',explode(',',$filter));
154
+		if ($filter) Context::set('arrfilter', explode(',', $filter));
155 155
 
156 156
 		$this->setLayoutFile('popup_layout');
157 157
 		$this->setTemplateFile('filebox_add');
Please login to merge, or discard this patch.
Braces   +34 added lines, -13 removed lines patch added patch discarded remove patch
@@ -25,10 +25,14 @@  discard block
 block discarded – undo
25 25
 		$skin = Context::get('skin');
26 26
 		// Get modules/skin information
27 27
 		$module_path = sprintf("./modules/%s/", $selected_module);
28
-		if(!is_dir($module_path)) $this->stop("msg_invalid_request");
28
+		if(!is_dir($module_path)) {
29
+			$this->stop("msg_invalid_request");
30
+		}
29 31
 
30 32
 		$skin_info_xml = sprintf("%sskins/%s/skin.xml", $module_path, $skin);
31
-		if(!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
33
+		if(!file_exists($skin_info_xml)) {
34
+			$this->stop("msg_invalid_request");
35
+		}
32 36
 
33 37
 		$oModuleModel = getModel('module');
34 38
 		$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
@@ -43,7 +47,9 @@  discard block
 block discarded – undo
43 47
 	 */
44 48
 	function dispModuleSelectList()
45 49
 	{
46
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
50
+		if(!Context::get('is_logged')) {
51
+			return new BaseObject(-1, 'msg_not_permitted');
52
+		}
47 53
 
48 54
 		$oModuleModel = getModel('module');
49 55
 		$logged_info = Context::get('logged_info');
@@ -60,8 +66,7 @@  discard block
 block discarded – undo
60 66
 		if($logged_info->is_admin == 'Y' && $site_keyword)
61 67
 		{
62 68
 			$args->site_keyword = $site_keyword;
63
-		}
64
-		else
69
+		} else
65 70
 		{
66 71
 			$args->site_srl = (int)$site_module_info->site_srl;
67 72
 			Context::set('site_keyword', null);
@@ -75,12 +80,16 @@  discard block
 block discarded – undo
75 80
 		// Get a list of modules at the site
76 81
 		$mid_list = array();
77 82
 		$output = executeQueryArray('module.getSiteModules', $args);
78
-		if(!$output->data) $output->data = array();
83
+		if(!$output->data) {
84
+			$output->data = array();
85
+		}
79 86
 
80 87
 		foreach($output->data as $key => $val)
81 88
 		{
82 89
 			$module = trim($val->module);
83
-			if(!$module) continue;
90
+			if(!$module) {
91
+				continue;
92
+			}
84 93
 
85 94
 			if(!$oModuleModel->getGrant($val, $logged_info)->access)
86 95
 			{
@@ -93,7 +102,9 @@  discard block
 block discarded – undo
93 102
 			$obj->browser_title = $val->browser_title;
94 103
 			$mid_list[$module]->list[$category][$val->mid] = $obj;
95 104
 
96
-			if(!$selected_module) $selected_module = $module;
105
+			if(!$selected_module) {
106
+				$selected_module = $module;
107
+			}
97 108
 			if(!$mid_list[$module]->title)
98 109
 			{
99 110
 				$xml_info = $oModuleModel->getModuleInfoXml($module);
@@ -117,7 +128,9 @@  discard block
 block discarded – undo
117 128
 	function dispModuleFileBox()
118 129
 	{
119 130
 		$logged_info = Context::get('logged_info');
120
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new BaseObject(-1, 'msg_not_permitted');
131
+		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) {
132
+			return new BaseObject(-1, 'msg_not_permitted');
133
+		}
121 134
 
122 135
 		$input_name = Context::get('input');
123 136
 		if(!preg_match('/^[a-z0-9_]+$/i', $input_name))
@@ -125,7 +138,9 @@  discard block
 block discarded – undo
125 138
 			return new BaseObject(-1, 'msg_invalid_request');
126 139
 		}
127 140
 
128
-		if(!$input_name) return new BaseObject(-1, 'msg_not_permitted');
141
+		if(!$input_name) {
142
+			return new BaseObject(-1, 'msg_not_permitted');
143
+		}
129 144
 
130 145
 		$addscript = sprintf('<script>//<![CDATA[
131 146
 				var selected_filebox_input_name = "%s";
@@ -137,7 +152,9 @@  discard block
 block discarded – undo
137 152
 		Context::set('filebox_list', $output->data);
138 153
 
139 154
 		$filter = Context::get('filter');
140
-		if($filter) Context::set('arrfilter',explode(',',$filter));
155
+		if($filter) {
156
+			Context::set('arrfilter',explode(',',$filter));
157
+		}
141 158
 
142 159
 		Context::set('page_navigation', $output->page_navigation);
143 160
 		$this->setLayoutFile('popup_layout');
@@ -148,10 +165,14 @@  discard block
 block discarded – undo
148 165
 	function dispModuleFileBoxAdd()
149 166
 	{
150 167
 		$logged_info = Context::get('logged_info');
151
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new BaseObject(-1, 'msg_not_permitted');
168
+		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) {
169
+			return new BaseObject(-1, 'msg_not_permitted');
170
+		}
152 171
 
153 172
 		$filter = Context::get('filter');
154
-		if($filter) Context::set('arrfilter',explode(',',$filter));
173
+		if($filter) {
174
+			Context::set('arrfilter',explode(',',$filter));
175
+		}
155 176
 
156 177
 		$this->setLayoutFile('popup_layout');
157 178
 		$this->setTemplateFile('filebox_add');
Please login to merge, or discard this patch.
modules/module/module.admin.view.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 		$oAutoinstallModel = getModel('autoinstall');
36 36
 
37 37
 		$module_list = $oModuleModel->getModuleList();
38
-		if(is_array($module_list))
38
+		if (is_array($module_list))
39 39
 		{
40
-			foreach($module_list as $key => $val)
40
+			foreach ($module_list as $key => $val)
41 41
 			{
42 42
 				$module_list[$key]->delete_url = $oAutoinstallModel->getRemoveUrlByPath($val->path);
43 43
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 				$module_list[$key]->need_autoinstall_update = $package[$packageSrl]->need_update;
48 48
 
49 49
 				// get easyinstall update url
50
-				if($module_list[$key]->need_autoinstall_update == 'Y')
50
+				if ($module_list[$key]->need_autoinstall_update == 'Y')
51 51
 				{
52 52
 					$module_list[$key]->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl);
53 53
 				}
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
 
59 59
 		$favoriteList = $output->get('favoriteList');
60 60
 		$favoriteModuleList = array();
61
-		if($favoriteList)
61
+		if ($favoriteList)
62 62
 		{
63
-			foreach($favoriteList as $favorite => $favorite_info)
63
+			foreach ($favoriteList as $favorite => $favorite_info)
64 64
 			{
65 65
 				$favoriteModuleList[] = $favorite_info->module;
66 66
 			}
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 		//Security
111 111
 		$security = new Security();
112 112
 
113
-		if($module_category_srl)
113
+		if ($module_category_srl)
114 114
 		{
115
-			$selected_category  = $oModuleModel->getModuleCategory($module_category_srl);
115
+			$selected_category = $oModuleModel->getModuleCategory($module_category_srl);
116 116
 			Context::set('selected_category', $selected_category);
117 117
 
118 118
 			//Security
@@ -164,15 +164,15 @@  discard block
 block discarded – undo
164 164
 	{
165 165
 		$module_srls = Context::get('module_srls');
166 166
 
167
-		$modules = explode(',',$module_srls);
168
-		if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
167
+		$modules = explode(',', $module_srls);
168
+		if (!count($modules)) if (!$module_srls) return new BaseObject(-1, 'msg_invalid_request');
169 169
 
170 170
 		$oModuleModel = getModel('module');
171 171
 		$columnList = array('module_srl', 'module');
172 172
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0], $columnList);
173 173
 		// Get a skin list of the module
174
-		$skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/'.$module_info->module);
175
-		Context::set('skin_list',$skin_list);
174
+		$skin_list = $oModuleModel->getSkins(_XE_PATH_.'modules/'.$module_info->module);
175
+		Context::set('skin_list', $skin_list);
176 176
 		// Get a layout list
177 177
 		$oLayoutModel = getModel('layout');
178 178
 		$layout_list = $oLayoutModel->getLayoutList();
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		Context::set('module_category', $module_category);
183 183
 
184 184
 		$security = new Security();
185
-		$security->encodeHTML('layout_list..title','layout_list..layout');
185
+		$security->encodeHTML('layout_list..title', 'layout_list..layout');
186 186
 		$security->encodeHTML('skin_list....');
187 187
 		$security->encodeHTML('module_category...');
188 188
 
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
 	{
201 201
 		$module_srls = Context::get('module_srls');
202 202
 
203
-		$modules = explode(',',$module_srls);
204
-		if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
203
+		$modules = explode(',', $module_srls);
204
+		if (!count($modules)) if (!$module_srls) return new BaseObject(-1, 'msg_invalid_request');
205 205
 		// pre-define variables because you can get contents from other module (call by reference)
206 206
 		$content = '';
207 207
 		// Call a trigger for additional settings
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 	{
224 224
 		$module_srls = Context::get('module_srls');
225 225
 
226
-		$modules = explode(',',$module_srls);
227
-		if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
226
+		$modules = explode(',', $module_srls);
227
+		if (!count($modules)) if (!$module_srls) return new BaseObject(-1, 'msg_invalid_request');
228 228
 
229 229
 		$oModuleModel = getModel('module');
230 230
 		$columnList = array('module_srl', 'module', 'site_srl');
@@ -234,12 +234,12 @@  discard block
 block discarded – undo
234 234
 		// Grant virtual permissions for access and manager
235 235
 		$grant_list->access->title = Context::getLang('grant_access');
236 236
 		$grant_list->access->default = 'guest';
237
-		if(count($source_grant_list))
237
+		if (count($source_grant_list))
238 238
 		{
239
-			foreach($source_grant_list as $key => $val)
239
+			foreach ($source_grant_list as $key => $val)
240 240
 			{
241
-				if(!$val->default) $val->default = 'guest';
242
-				if($val->default == 'root') $val->default = 'manager';
241
+				if (!$val->default) $val->default = 'guest';
242
+				if ($val->default == 'root') $val->default = 'manager';
243 243
 				$grant_list->{$key} = $val;
244 244
 			}
245 245
 		}
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 		// Get the language file of the current site
269 269
 		$site_module_info = Context::get('site_module_info');
270 270
 		$args = new stdClass();
271
-		$args->site_srl = (int)$site_module_info->site_srl;
271
+		$args->site_srl = (int) $site_module_info->site_srl;
272 272
 		$args->langCode = Context::get('lang_type');
273 273
 		$args->page = Context::get('page'); // /< Page
274 274
 		$args->list_count = 30; // /< the number of posts to display on a single page
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 		Context::set('lang_code_list', $output->data);
288 288
 		Context::set('page_navigation', $output->page_navigation);
289 289
 
290
-		if(Context::get('module') != 'admin')
290
+		if (Context::get('module') != 'admin')
291 291
 		{
292 292
 			$this->setLayoutPath('./common/tpl');
293 293
 			$this->setLayoutFile('popup_layout');
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		$oModuleModel = getModel('module');
302 302
 		$output = $oModuleModel->getModuleFileBoxList();
303 303
 		$page = Context::get('page');
304
-		$page = $page?$page:1;
304
+		$page = $page ? $page : 1;
305 305
 		Context::set('filebox_list', $output->data);
306 306
 		Context::set('page_navigation', $output->page_navigation);
307 307
 		Context::set('page', $page);
Please login to merge, or discard this patch.
Braces   +16 added lines, -7 removed lines patch added patch discarded remove patch
@@ -121,8 +121,7 @@  discard block
 block discarded – undo
121 121
 			// Set a template file
122 122
 			$this->setTemplateFile('category_update_form');
123 123
 			// If not selected, display a list of categories
124
-		}
125
-		else
124
+		} else
126 125
 		{
127 126
 			$category_list = $oModuleModel->getModuleCategories();
128 127
 			Context::set('category_list', $category_list);
@@ -165,7 +164,9 @@  discard block
 block discarded – undo
165 164
 		$module_srls = Context::get('module_srls');
166 165
 
167 166
 		$modules = explode(',',$module_srls);
168
-		if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
167
+		if(!count($modules)) {
168
+			if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
169
+		}
169 170
 
170 171
 		$oModuleModel = getModel('module');
171 172
 		$columnList = array('module_srl', 'module');
@@ -201,7 +202,9 @@  discard block
 block discarded – undo
201 202
 		$module_srls = Context::get('module_srls');
202 203
 
203 204
 		$modules = explode(',',$module_srls);
204
-		if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
205
+		if(!count($modules)) {
206
+			if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
207
+		}
205 208
 		// pre-define variables because you can get contents from other module (call by reference)
206 209
 		$content = '';
207 210
 		// Call a trigger for additional settings
@@ -224,7 +227,9 @@  discard block
 block discarded – undo
224 227
 		$module_srls = Context::get('module_srls');
225 228
 
226 229
 		$modules = explode(',',$module_srls);
227
-		if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
230
+		if(!count($modules)) {
231
+			if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
232
+		}
228 233
 
229 234
 		$oModuleModel = getModel('module');
230 235
 		$columnList = array('module_srl', 'module', 'site_srl');
@@ -238,8 +243,12 @@  discard block
 block discarded – undo
238 243
 		{
239 244
 			foreach($source_grant_list as $key => $val)
240 245
 			{
241
-				if(!$val->default) $val->default = 'guest';
242
-				if($val->default == 'root') $val->default = 'manager';
246
+				if(!$val->default) {
247
+					$val->default = 'guest';
248
+				}
249
+				if($val->default == 'root') {
250
+					$val->default = 'manager';
251
+				}
243 252
 				$grant_list->{$key} = $val;
244 253
 			}
245 254
 		}
Please login to merge, or discard this patch.
modules/communication/communication.controller.php 2 patches
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	function procCommunicationUpdateAllowMessage()
25 25
 	{
26
-		if(!Context::get('is_logged'))
26
+		if (!Context::get('is_logged'))
27 27
 		{
28 28
 			return new BaseObject(-1, 'msg_not_logged');
29 29
 		}
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 		$args = new stdClass();
32 32
 		$args->allow_message = Context::get('allow_message');
33 33
 
34
-		if(!in_array($args->allow_message, array('Y', 'N', 'F')))
34
+		if (!in_array($args->allow_message, array('Y', 'N', 'F')))
35 35
 		{
36 36
 			$args->allow_message = 'Y';
37 37
 		}
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	function procCommunicationSendMessage()
54 54
 	{
55 55
 		// Check login information
56
-		if(!Context::get('is_logged'))
56
+		if (!Context::get('is_logged'))
57 57
 		{
58 58
 			return new BaseObject(-1, 'msg_not_logged');
59 59
 		}
@@ -62,25 +62,25 @@  discard block
 block discarded – undo
62 62
 
63 63
 		// Check variables
64 64
 		$receiver_srl = Context::get('receiver_srl');
65
-		if(!$receiver_srl)
65
+		if (!$receiver_srl)
66 66
 		{
67 67
 			return new BaseObject(-1, 'msg_not_exists_member');
68 68
 		}
69 69
 
70 70
 		$title = trim(Context::get('title'));
71
-		if(!$title)
71
+		if (!$title)
72 72
 		{
73 73
 			return new BaseObject(-1, 'msg_title_is_null');
74 74
 		}
75 75
 
76 76
 		$content = trim(Context::get('content'));
77
-		if(!$content)
77
+		if (!$content)
78 78
 		{
79 79
 			return new BaseObject(-1, 'msg_content_is_null');
80 80
 		}
81 81
 
82 82
 		$send_mail = Context::get('send_mail');
83
-		if($send_mail != 'Y')
83
+		if ($send_mail != 'Y')
84 84
 		{
85 85
 			$send_mail = 'N';
86 86
 		}
@@ -90,28 +90,28 @@  discard block
 block discarded – undo
90 90
 		$oCommunicationModel = getModel('communication');
91 91
 		$config = $oCommunicationModel->getConfig();
92 92
 
93
-		if(!$oCommunicationModel->checkGrant($config->grant_write))
93
+		if (!$oCommunicationModel->checkGrant($config->grant_write))
94 94
 		{
95 95
 			return new BaseObject(-1, 'msg_not_permitted');
96 96
 		}
97 97
 
98 98
 		$receiver_member_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl);
99
-		if($receiver_member_info->member_srl != $receiver_srl)
99
+		if ($receiver_member_info->member_srl != $receiver_srl)
100 100
 		{
101 101
 			return new BaseObject(-1, 'msg_not_exists_member');
102 102
 		}
103 103
 
104 104
 		// check whether to allow to receive the message(pass if a top-administrator)
105
-		if($logged_info->is_admin != 'Y')
105
+		if ($logged_info->is_admin != 'Y')
106 106
 		{
107
-			if($receiver_member_info->allow_message == 'F')
107
+			if ($receiver_member_info->allow_message == 'F')
108 108
 			{
109
-				if(!$oCommunicationModel->isFriend($receiver_member_info->member_srl))
109
+				if (!$oCommunicationModel->isFriend($receiver_member_info->member_srl))
110 110
 				{
111 111
 					return new BaseObject(-1, 'msg_allow_message_to_friend');
112 112
 				}
113 113
 			}
114
-			else if($receiver_member_info->allow_message == 'N')
114
+			else if ($receiver_member_info->allow_message == 'N')
115 115
 			{
116 116
 				return new BaseObject(-1, 'msg_disallow_message');
117 117
 			}
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
 		// send a message
121 121
 		$output = $this->sendMessage($logged_info->member_srl, $receiver_srl, $title, $content);
122 122
 
123
-		if(!$output->toBool())
123
+		if (!$output->toBool())
124 124
 		{
125 125
 			return $output;
126 126
 		}
127 127
 
128 128
 		// send an e-mail
129
-		if($send_mail == 'Y')
129
+		if ($send_mail == 'Y')
130 130
 		{
131 131
 			$view_url = Context::getRequestUri();
132 132
 			$content = sprintf("%s<br /><br />From : <a href=\"%s\" target=\"_blank\">%s</a>", $content, $view_url, $view_url);
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
 			$oMail->send();
139 139
 		}
140 140
 
141
-		if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
141
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
142 142
 		{
143
-			if(Context::get('is_popup') != 'Y')
143
+			if (Context::get('is_popup') != 'Y')
144 144
 			{
145 145
 				global $lang;
146 146
 				htmlHeader();
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 			else
154 154
 			{
155 155
 				$this->setMessage('success_sended');
156
-				$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('','act', 'dispCommunicationMessages', 'message_type', 'S', 'receiver_srl', $receiver_srl, 'message_srl', '');
156
+				$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'act', 'dispCommunicationMessages', 'message_type', 'S', 'receiver_srl', $receiver_srl, 'message_srl', '');
157 157
 				$this->setRedirectUrl($returnUrl);
158 158
 			}
159 159
 		}
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		$receiver_args->related_srl = 0;
198 198
 		$receiver_args->list_order = $related_srl * -1;
199 199
 		$receiver_args->sender_srl = $sender_srl;
200
-		if(!$receiver_args->sender_srl)
200
+		if (!$receiver_args->sender_srl)
201 201
 		{
202 202
 			$receiver_args->sender_srl = $receiver_srl;
203 203
 		}
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 		$trigger_obj->content = $content;
219 219
 		$trigger_obj->sender_log = $sender_log;
220 220
 		$triggerOutput = ModuleHandler::triggerCall('communication.sendMessage', 'before', $trigger_obj);
221
-		if(!$triggerOutput->toBool())
221
+		if (!$triggerOutput->toBool())
222 222
 		{
223 223
 			return $triggerOutput;
224 224
 		}
@@ -227,10 +227,10 @@  discard block
 block discarded – undo
227 227
 		$oDB->begin();
228 228
 
229 229
 		// messages to save in the sendor's message box
230
-		if($sender_srl && $sender_log)
230
+		if ($sender_srl && $sender_log)
231 231
 		{
232 232
 			$output = executeQuery('communication.sendMessage', $sender_args);
233
-			if(!$output->toBool())
233
+			if (!$output->toBool())
234 234
 			{
235 235
 				$oDB->rollback();
236 236
 				return $output;
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
 		// messages to save in the receiver's message box
241 241
 		$output = executeQuery('communication.sendMessage', $receiver_args);
242
-		if(!$output->toBool())
242
+		if (!$output->toBool())
243 243
 		{
244 244
 			$oDB->rollback();
245 245
 			return $output;
@@ -247,14 +247,14 @@  discard block
 block discarded – undo
247 247
 
248 248
 		// Call a trigger (after)
249 249
 		$trigger_output = ModuleHandler::triggerCall('communication.sendMessage', 'after', $trigger_obj);
250
-		if(!$trigger_output->toBool())
250
+		if (!$trigger_output->toBool())
251 251
 		{
252 252
 			$oDB->rollback();
253 253
 			return $trigger_output;
254 254
 		}
255 255
 
256 256
 		// create a flag that message is sent (in file format) 
257
-		$flag_path = './files/member_extra_info/new_message_flags/' . getNumberingPath($receiver_srl);
257
+		$flag_path = './files/member_extra_info/new_message_flags/'.getNumberingPath($receiver_srl);
258 258
 		FileHandler::makeDir($flag_path);
259 259
 		$flag_file = sprintf('%s%s', $flag_path, $receiver_srl);
260 260
 		$flag_count = FileHandler::readFile($flag_file);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	function procCommunicationStoreMessage()
273 273
 	{
274 274
 		// Check login information
275
-		if(!Context::get('is_logged'))
275
+		if (!Context::get('is_logged'))
276 276
 		{
277 277
 			return new BaseObject(-1, 'msg_not_logged');
278 278
 		}
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 
281 281
 		// Check variable
282 282
 		$message_srl = Context::get('message_srl');
283
-		if(!$message_srl)
283
+		if (!$message_srl)
284 284
 		{
285 285
 			return new BaseObject(-1, 'msg_invalid_request');
286 286
 		}
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 		// get the message
289 289
 		$oCommunicationModel = getModel('communication');
290 290
 		$message = $oCommunicationModel->getSelectedMessage($message_srl);
291
-		if(!$message || $message->message_type != 'R')
291
+		if (!$message || $message->message_type != 'R')
292 292
 		{
293 293
 			return new BaseObject(-1, 'msg_invalid_request');
294 294
 		}
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 		$args->message_srl = $message_srl;
298 298
 		$args->receiver_srl = $logged_info->member_srl;
299 299
 		$output = executeQuery('communication.setMessageStored', $args);
300
-		if(!$output->toBool())
300
+		if (!$output->toBool())
301 301
 		{
302 302
 			return $output;
303 303
 		}
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 	function procCommunicationDeleteMessage()
313 313
 	{
314 314
 		// Check login information
315
-		if(!Context::get('is_logged'))
315
+		if (!Context::get('is_logged'))
316 316
 		{
317 317
 			return new BaseObject(-1, 'msg_not_logged');
318 318
 		}
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 
323 323
 		// Check the variable
324 324
 		$message_srl = Context::get('message_srl');
325
-		if(!$message_srl)
325
+		if (!$message_srl)
326 326
 		{
327 327
 			return new BaseObject(-1, 'msg_invalid_request');
328 328
 		}
@@ -330,23 +330,23 @@  discard block
 block discarded – undo
330 330
 		// Get the message
331 331
 		$oCommunicationModel = getModel('communication');
332 332
 		$message = $oCommunicationModel->getSelectedMessage($message_srl);
333
-		if(!$message)
333
+		if (!$message)
334 334
 		{
335 335
 			return new BaseObject(-1, 'msg_invalid_request');
336 336
 		}
337 337
 
338 338
 		// Check the grant
339
-		switch($message->message_type)
339
+		switch ($message->message_type)
340 340
 		{
341 341
 			case 'S':
342
-				if($message->sender_srl != $member_srl)
342
+				if ($message->sender_srl != $member_srl)
343 343
 				{
344 344
 					return new BaseObject(-1, 'msg_invalid_request');
345 345
 				}
346 346
 				break;
347 347
 
348 348
 			case 'R':
349
-				if($message->receiver_srl != $member_srl)
349
+				if ($message->receiver_srl != $member_srl)
350 350
 				{
351 351
 					return new BaseObject(-1, 'msg_invalid_request');
352 352
 				}
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 		$args = new stdClass();
358 358
 		$args->message_srl = $message_srl;
359 359
 		$output = executeQuery('communication.deleteMessage', $args);
360
-		if(!$output->toBool())
360
+		if (!$output->toBool())
361 361
 		{
362 362
 			return $output;
363 363
 		}
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	function procCommunicationDeleteMessages()
373 373
 	{
374 374
 		// Check login information
375
-		if(!Context::get('is_logged'))
375
+		if (!Context::get('is_logged'))
376 376
 		{
377 377
 			return new BaseObject(-1, 'msg_not_logged');
378 378
 		}
@@ -381,41 +381,41 @@  discard block
 block discarded – undo
381 381
 		$member_srl = $logged_info->member_srl;
382 382
 
383 383
 		// check variables
384
-		if(!Context::get('message_srl_list'))
384
+		if (!Context::get('message_srl_list'))
385 385
 		{
386 386
 			return new BaseObject(-1, 'msg_cart_is_null');
387 387
 		}
388 388
 
389 389
 		$message_srl_list = Context::get('message_srl_list');
390
-		if(!is_array($message_srl_list))
390
+		if (!is_array($message_srl_list))
391 391
 		{
392 392
 			$message_srl_list = explode('|@|', trim($message_srl_list));
393 393
 		}
394 394
 
395
-		if(!count($message_srl_list))
395
+		if (!count($message_srl_list))
396 396
 		{
397 397
 			return new BaseObject(-1, 'msg_cart_is_null');
398 398
 		}
399 399
 
400 400
 		$message_type = Context::get('message_type');
401
-		if(!$message_type || !in_array($message_type, array('R', 'S', 'T')))
401
+		if (!$message_type || !in_array($message_type, array('R', 'S', 'T')))
402 402
 		{
403 403
 			return new BaseObject(-1, 'msg_invalid_request');
404 404
 		}
405 405
 
406 406
 		$message_count = count($message_srl_list);
407 407
 		$target = array();
408
-		for($i = 0; $i < $message_count; $i++)
408
+		for ($i = 0; $i < $message_count; $i++)
409 409
 		{
410 410
 			$message_srl = (int) trim($message_srl_list[$i]);
411
-			if(!$message_srl)
411
+			if (!$message_srl)
412 412
 			{
413 413
 				continue;
414 414
 			}
415 415
 
416 416
 			$target[] = $message_srl;
417 417
 		}
418
-		if(!count($target))
418
+		if (!count($target))
419 419
 		{
420 420
 			return new BaseObject(-1, 'msg_cart_is_null');
421 421
 		}
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 		$args->message_srls = implode(',', $target);
426 426
 		$args->message_type = $message_type;
427 427
 
428
-		if($message_type == 'S')
428
+		if ($message_type == 'S')
429 429
 		{
430 430
 			$args->sender_srl = $member_srl;
431 431
 		}
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 		}
436 436
 
437 437
 		$output = executeQuery('communication.deleteMessages', $args);
438
-		if(!$output->toBool())
438
+		if (!$output->toBool())
439 439
 		{
440 440
 			return $output;
441 441
 		}
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 	function procCommunicationAddFriend()
454 454
 	{
455 455
 		// Check login information
456
-		if(!Context::get('is_logged'))
456
+		if (!Context::get('is_logged'))
457 457
 		{
458 458
 			return new BaseObject(-1, 'msg_not_logged');
459 459
 		}
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 		$logged_info = Context::get('logged_info');
462 462
 
463 463
 		$target_srl = (int) trim(Context::get('target_srl'));
464
-		if(!$target_srl)
464
+		if (!$target_srl)
465 465
 		{
466 466
 			return new BaseObject(-1, 'msg_invalid_request');
467 467
 		}
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 		$args->member_srl = $logged_info->member_srl;
475 475
 		$args->target_srl = $target_srl;
476 476
 		$output = executeQuery('communication.addFriend', $args);
477
-		if(!$output->toBool())
477
+		if (!$output->toBool())
478 478
 		{
479 479
 			return $output;
480 480
 		}
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 		$this->add('member_srl', $target_srl);
483 483
 		$this->setMessage('success_registed');
484 484
 
485
-		if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
485
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
486 486
 		{
487 487
 			global $lang;
488 488
 			htmlHeader();
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 	function procCommunicationMoveFriend()
502 502
 	{
503 503
 		// Check login information
504
-		if(!Context::get('is_logged'))
504
+		if (!Context::get('is_logged'))
505 505
 		{
506 506
 			return new BaseObject(-1, 'msg_not_logged');
507 507
 		}
@@ -510,27 +510,27 @@  discard block
 block discarded – undo
510 510
 
511 511
 		// Check variables
512 512
 		$friend_srl_list = Context::get('friend_srl_list');
513
-		if(!$friend_srl_list)
513
+		if (!$friend_srl_list)
514 514
 		{
515 515
 			return new BaseObject(-1, 'msg_cart_is_null');
516 516
 		}
517 517
 
518
-		if(!is_array($friend_srl_list))
518
+		if (!is_array($friend_srl_list))
519 519
 		{
520 520
 			$friend_srl_list = explode('|@|', $friend_srl_list);
521 521
 		}
522 522
 
523
-		if(!count($friend_srl_list))
523
+		if (!count($friend_srl_list))
524 524
 		{
525 525
 			return new BaseObject(-1, 'msg_cart_is_null');
526 526
 		}
527 527
 
528 528
 		$friend_count = count($friend_srl_list);
529 529
 		$target = array();
530
-		for($i = 0; $i < $friend_count; $i++)
530
+		for ($i = 0; $i < $friend_count; $i++)
531 531
 		{
532 532
 			$friend_srl = (int) trim($friend_srl_list[$i]);
533
-			if(!$friend_srl)
533
+			if (!$friend_srl)
534 534
 			{
535 535
 				continue;
536 536
 			}
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 			$target[] = $friend_srl;
539 539
 		}
540 540
 
541
-		if(!count($target))
541
+		if (!count($target))
542 542
 		{
543 543
 			return new BaseObject(-1, 'msg_cart_is_null');
544 544
 		}
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 		$args->friend_group_srl = Context::get('target_friend_group_srl');
551 551
 
552 552
 		$output = executeQuery('communication.moveFriend', $args);
553
-		if(!$output->toBool())
553
+		if (!$output->toBool())
554 554
 		{
555 555
 			return $output;
556 556
 		}
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 	function procCommunicationDeleteFriend()
569 569
 	{
570 570
 		// Check login information
571
-		if(!Context::get('is_logged'))
571
+		if (!Context::get('is_logged'))
572 572
 		{
573 573
 			return new BaseObject(-1, 'msg_not_logged');
574 574
 		}
@@ -579,12 +579,12 @@  discard block
 block discarded – undo
579 579
 		// Check variables
580 580
 		$friend_srl_list = Context::get('friend_srl_list');
581 581
 
582
-		if(!is_array($friend_srl_list))
582
+		if (!is_array($friend_srl_list))
583 583
 		{
584 584
 			$friend_srl_list = explode('|@|', $friend_srl_list);
585 585
 		}
586 586
 
587
-		if(!count($friend_srl_list))
587
+		if (!count($friend_srl_list))
588 588
 		{
589 589
 			return new BaseObject(-1, 'msg_cart_is_null');
590 590
 		}
@@ -592,10 +592,10 @@  discard block
 block discarded – undo
592 592
 		$friend_count = count($friend_srl_list);
593 593
 		$target = array();
594 594
 
595
-		for($i = 0; $i < $friend_count; $i++)
595
+		for ($i = 0; $i < $friend_count; $i++)
596 596
 		{
597 597
 			$friend_srl = (int) trim($friend_srl_list[$i]);
598
-			if(!$friend_srl)
598
+			if (!$friend_srl)
599 599
 			{
600 600
 				continue;
601 601
 			}
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 			$target[] = $friend_srl;
604 604
 		}
605 605
 
606
-		if(!count($target))
606
+		if (!count($target))
607 607
 		{
608 608
 			return new BaseObject(-1, 'msg_cart_is_null');
609 609
 		}
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 		$args->friend_srls = implode(',', $target);
614 614
 		$args->member_srl = $logged_info->member_srl;
615 615
 		$output = executeQuery('communication.deleteFriend', $args);
616
-		if(!$output->toBool())
616
+		if (!$output->toBool())
617 617
 		{
618 618
 			return $output;
619 619
 		}
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 	function procCommunicationAddFriendGroup()
632 632
 	{
633 633
 		// Check login information
634
-		if(!Context::get('is_logged'))
634
+		if (!Context::get('is_logged'))
635 635
 		{
636 636
 			return new BaseObject(-1, 'msg_not_logged');
637 637
 		}
@@ -645,13 +645,13 @@  discard block
 block discarded – undo
645 645
 		$args->title = Context::get('title');
646 646
 		$args->title = htmlspecialchars($args->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
647 647
 
648
-		if(!$args->title)
648
+		if (!$args->title)
649 649
 		{
650 650
 			return new BaseObject(-1, 'msg_invalid_request');
651 651
 		}
652 652
 
653 653
 		// modify if friend_group_srl exists.
654
-		if($args->friend_group_srl)
654
+		if ($args->friend_group_srl)
655 655
 		{
656 656
 			$output = executeQuery('communication.renameFriendGroup', $args);
657 657
 			$msg_code = 'success_updated';
@@ -663,9 +663,9 @@  discard block
 block discarded – undo
663 663
 			$msg_code = 'success_registed';
664 664
 		}
665 665
 
666
-		if(!$output->toBool())
666
+		if (!$output->toBool())
667 667
 		{
668
-			if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
668
+			if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
669 669
 			{
670 670
 				global $lang;
671 671
 				htmlHeader();
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 		}
683 683
 		else
684 684
 		{
685
-			if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
685
+			if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
686 686
 			{
687 687
 				global $lang;
688 688
 				htmlHeader();
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 	function procCommunicationRenameFriendGroup()
708 708
 	{
709 709
 		// Check login information
710
-		if(!Context::get('is_logged'))
710
+		if (!Context::get('is_logged'))
711 711
 		{
712 712
 			return new BaseObject(-1, 'msg_not_logged');
713 713
 		}
@@ -721,13 +721,13 @@  discard block
 block discarded – undo
721 721
 		$args->title = Context::get('title');
722 722
 		$args->title = htmlspecialchars($args->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
723 723
 
724
-		if(!$args->title)
724
+		if (!$args->title)
725 725
 		{
726 726
 			return new BaseObject(-1, 'msg_invalid_request');
727 727
 		}
728 728
 
729 729
 		$output = executeQuery('communication.renameFriendGroup', $args);
730
-		if(!$output->toBool())
730
+		if (!$output->toBool())
731 731
 		{
732 732
 			return $output;
733 733
 		}
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 	function procCommunicationDeleteFriendGroup()
743 743
 	{
744 744
 		// Check login information
745
-		if(!Context::get('is_logged'))
745
+		if (!Context::get('is_logged'))
746 746
 		{
747 747
 			return new BaseObject(-1, 'msg_not_logged');
748 748
 		}
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 		$args->friend_group_srl = Context::get('friend_group_srl');
755 755
 		$args->member_srl = $logged_info->member_srl;
756 756
 		$output = executeQuery('communication.deleteFriendGroup', $args);
757
-		if(!$output->toBool())
757
+		if (!$output->toBool())
758 758
 		{
759 759
 			return $output;
760 760
 		}
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -110,8 +110,7 @@  discard block
 block discarded – undo
110 110
 				{
111 111
 					return new BaseObject(-1, 'msg_allow_message_to_friend');
112 112
 				}
113
-			}
114
-			else if($receiver_member_info->allow_message == 'N')
113
+			} else if($receiver_member_info->allow_message == 'N')
115 114
 			{
116 115
 				return new BaseObject(-1, 'msg_disallow_message');
117 116
 			}
@@ -149,8 +148,7 @@  discard block
 block discarded – undo
149 148
 				htmlFooter();
150 149
 				Context::close();
151 150
 				exit;
152
-			}
153
-			else
151
+			} else
154 152
 			{
155 153
 				$this->setMessage('success_sended');
156 154
 				$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('','act', 'dispCommunicationMessages', 'message_type', 'S', 'receiver_srl', $receiver_srl, 'message_srl', '');
@@ -428,8 +426,7 @@  discard block
 block discarded – undo
428 426
 		if($message_type == 'S')
429 427
 		{
430 428
 			$args->sender_srl = $member_srl;
431
-		}
432
-		else
429
+		} else
433 430
 		{
434 431
 			$args->receiver_srl = $member_srl;
435 432
 		}
@@ -656,8 +653,7 @@  discard block
 block discarded – undo
656 653
 			$output = executeQuery('communication.renameFriendGroup', $args);
657 654
 			$msg_code = 'success_updated';
658 655
 			// add if not exists
659
-		}
660
-		else
656
+		} else
661 657
 		{
662 658
 			$output = executeQuery('communication.addFriendGroup', $args);
663 659
 			$msg_code = 'success_registed';
@@ -674,13 +670,11 @@  discard block
 block discarded – undo
674 670
 				htmlFooter();
675 671
 				Context::close();
676 672
 				exit;
677
-			}
678
-			else
673
+			} else
679 674
 			{
680 675
 				return $output;
681 676
 			}
682
-		}
683
-		else
677
+		} else
684 678
 		{
685 679
 			if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
686 680
 			{
@@ -692,8 +686,7 @@  discard block
 block discarded – undo
692 686
 				htmlFooter();
693 687
 				Context::close();
694 688
 				exit;
695
-			}
696
-			else
689
+			} else
697 690
 			{
698 691
 				$this->setMessage($msg_code);
699 692
 			}
Please login to merge, or discard this patch.
modules/trash/trash.admin.controller.php 2 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	function insertTrash($obj)
19 19
 	{
20
-		if(!Context::get('is_logged'))
20
+		if (!Context::get('is_logged'))
21 21
 		{
22 22
 			return new BaseObject(-1, 'msg_not_permitted');
23 23
 		}
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 		$oTrashVO = new TrashVO();
28 28
 		$oTrashVO = &$obj;
29 29
 
30
-		if(!$oTrashVO->getTrashSrl()) $oTrashVO->setTrashSrl(getNextSequence());
31
-		if(!is_string($oTrashVO->getSerializedObject())) $oTrashVO->setSerializedObject(serialize($oTrashVO->getSerializedObject()));
30
+		if (!$oTrashVO->getTrashSrl()) $oTrashVO->setTrashSrl(getNextSequence());
31
+		if (!is_string($oTrashVO->getSerializedObject())) $oTrashVO->setSerializedObject(serialize($oTrashVO->getSerializedObject()));
32 32
 		$oTrashVO->setIpaddress($_SERVER['REMOTE_ADDR']);
33 33
 		$oTrashVO->setRemoverSrl($logged_info->member_srl);
34 34
 		$oTrashVO->setRegdate(date('YmdHis'));
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
 		$tmpTrashSrls = Context::get('cart');
50 50
 
51 51
 		$trashSrls = array();
52
-		if($isAll != 'true')
52
+		if ($isAll != 'true')
53 53
 		{
54
-			if(is_array($tmpTrashSrls)) $trashSrls = $tmpTrashSrls;
54
+			if (is_array($tmpTrashSrls)) $trashSrls = $tmpTrashSrls;
55 55
 			else $trashSrls = explode('|@|', $tmpTrashSrls);
56 56
 		}
57 57
 
58 58
 		//module relation data delete...
59 59
 		$output = $this->_relationDataDelete($isAll, $trashSrls);
60
-		if(!$output->toBool()) return new BaseObject(-1, $output->message);
60
+		if (!$output->toBool()) return new BaseObject(-1, $output->message);
61 61
 
62
-		if(!$this->_emptyTrash($trashSrls)) return new BaseObject(-1, $lang->fail_empty);
62
+		if (!$this->_emptyTrash($trashSrls)) return new BaseObject(-1, $lang->fail_empty);
63 63
 
64 64
 		$this->setMessage('success_deleted', 'info');
65 65
 
@@ -76,17 +76,17 @@  discard block
 block discarded – undo
76 76
 	function _relationDataDelete($isAll, &$trashSrls)
77 77
 	{
78 78
 		$oTrashModel = getModel('trash');
79
-		if($isAll == 'true')
79
+		if ($isAll == 'true')
80 80
 		{
81 81
 			$output = $oTrashModel->getTrashAllList(array());
82
-			if(!$output->toBool())
82
+			if (!$output->toBool())
83 83
 			{
84 84
 				return new BaseObject(-1, $output->message);
85 85
 			}
86 86
 
87
-			if(is_array($output->data))
87
+			if (is_array($output->data))
88 88
 			{
89
-				foreach($output->data as $value)
89
+				foreach ($output->data as $value)
90 90
 				{
91 91
 					$trashSrls[] = $value->getTrashSrl();
92 92
 				}
@@ -97,29 +97,29 @@  discard block
 block discarded – undo
97 97
 			$args = new stdClass();
98 98
 			$args->trashSrl = $trashSrls;
99 99
 			$output = $oTrashModel->getTrashList($args);
100
-			if(!$output->toBool())
100
+			if (!$output->toBool())
101 101
 			{
102 102
 				return new BaseObject(-1, $output->message);
103 103
 			}
104 104
 		}
105 105
 
106
-		if(is_array($output->data))
106
+		if (is_array($output->data))
107 107
 		{
108
-			foreach($output->data as $oTrashVO)
108
+			foreach ($output->data as $oTrashVO)
109 109
 			{
110 110
 				//class file check
111 111
 				$classPath = ModuleHandler::getModulePath($oTrashVO->getOriginModule());
112
-				if(!is_dir(FileHandler::getRealPath($classPath))) return new BaseObject(-1, 'not exist restore module directory');
112
+				if (!is_dir(FileHandler::getRealPath($classPath))) return new BaseObject(-1, 'not exist restore module directory');
113 113
 
114 114
 				$classFile = sprintf('%s%s.admin.controller.php', $classPath, $oTrashVO->getOriginModule());
115 115
 				$classFile = FileHandler::getRealPath($classFile);
116
-				if(!file_exists($classFile)) return new BaseObject(-1, 'not exist restore module class file');
116
+				if (!file_exists($classFile)) return new BaseObject(-1, 'not exist restore module class file');
117 117
 
118 118
 				$oAdminController = getAdminController($oTrashVO->getOriginModule());
119
-				if(!method_exists($oAdminController, 'emptyTrash')) return new BaseObject(-1, 'not exist restore method in module class file');
119
+				if (!method_exists($oAdminController, 'emptyTrash')) return new BaseObject(-1, 'not exist restore method in module class file');
120 120
 
121 121
 				$output2 = $oAdminController->emptyTrash($oTrashVO->getSerializedObject());
122
-				if(!$output2->toBool()) return new BaseObject(-1, $output2->message);
122
+				if (!$output2->toBool()) return new BaseObject(-1, $output2->message);
123 123
 			}
124 124
 		}
125 125
 		return new BaseObject(0, $lang->success_deleted);
@@ -134,33 +134,33 @@  discard block
 block discarded – undo
134 134
 		global $lang;
135 135
 		$trashSrlList = Context::get('cart');
136 136
 
137
-		if(is_array($trashSrlList))
137
+		if (is_array($trashSrlList))
138 138
 		{
139 139
 			// begin transaction
140 140
 			$oDB = &DB::getInstance();
141 141
 			$oDB->begin();
142 142
 			// eache restore method call in each classfile
143
-			foreach($trashSrlList as $value)
143
+			foreach ($trashSrlList as $value)
144 144
 			{
145 145
 				$oTrashModel = getModel('trash');
146 146
 				$output = $oTrashModel->getTrash($value);
147
-				if(!$output->toBool()) return new BaseObject(-1, $output->message);
147
+				if (!$output->toBool()) return new BaseObject(-1, $output->message);
148 148
 
149 149
 				//class file check
150 150
 				$classPath = ModuleHandler::getModulePath($output->data->getOriginModule());
151
-				if(!is_dir(FileHandler::getRealPath($classPath))) return new BaseObject(-1, 'not exist restore module directory');
151
+				if (!is_dir(FileHandler::getRealPath($classPath))) return new BaseObject(-1, 'not exist restore module directory');
152 152
 
153 153
 				$classFile = sprintf('%s%s.admin.controller.php', $classPath, $output->data->getOriginModule());
154 154
 				$classFile = FileHandler::getRealPath($classFile);
155
-				if(!file_exists($classFile)) return new BaseObject(-1, 'not exist restore module class file');
155
+				if (!file_exists($classFile)) return new BaseObject(-1, 'not exist restore module class file');
156 156
 
157 157
 				$oAdminController = getAdminController($output->data->getOriginModule());
158
-				if(!method_exists($oAdminController, 'restoreTrash')) return new BaseObject(-1, 'not exist restore method in module class file');
158
+				if (!method_exists($oAdminController, 'restoreTrash')) return new BaseObject(-1, 'not exist restore method in module class file');
159 159
 
160 160
 				$originObject = unserialize($output->data->getSerializedObject());
161 161
 				$output = $oAdminController->restoreTrash($originObject);
162 162
 
163
-				if(!$output->toBool())
163
+				if (!$output->toBool())
164 164
 				{
165 165
 					$oDB->rollback();
166 166
 					return new BaseObject(-1, $output->message);
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 			}
169 169
 
170 170
 			// restore object delete in trash box
171
-			if(!$this->_emptyTrash($trashSrlList)) {
171
+			if (!$this->_emptyTrash($trashSrlList)) {
172 172
 				$oDB->rollback();
173 173
 				return new BaseObject(-1, $lang->fail_empty);
174 174
 			}
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
 	 */
188 188
 	function procTrashAdminGetList()
189 189
 	{
190
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
190
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
191 191
 		$trashSrls = Context::get('trash_srls');
192
-		if($trashSrls) $trashSrlList = explode(',', $trashSrls);
192
+		if ($trashSrls) $trashSrlList = explode(',', $trashSrls);
193 193
 
194
-		if(count($trashSrlList) > 0)
194
+		if (count($trashSrlList) > 0)
195 195
 		{
196 196
 			$oTrashModel = getModel('trash');
197 197
 			$args = new stdClass();
@@ -218,11 +218,11 @@  discard block
 block discarded – undo
218 218
 	 */
219 219
 	function _emptyTrash($trashSrls)
220 220
 	{
221
-		if(!is_array($trashSrls)) return false;
221
+		if (!is_array($trashSrls)) return false;
222 222
 		$args = new stdClass();
223 223
 		$args->trashSrls = $trashSrls;
224 224
 		$output = executeQuery('trash.deleteTrash', $args);
225
-		if(!$output->toBool()) return false;
225
+		if (!$output->toBool()) return false;
226 226
 
227 227
 		return true;
228 228
 	}
Please login to merge, or discard this patch.
Braces   +55 added lines, -22 removed lines patch added patch discarded remove patch
@@ -27,8 +27,12 @@  discard block
 block discarded – undo
27 27
 		$oTrashVO = new TrashVO();
28 28
 		$oTrashVO = &$obj;
29 29
 
30
-		if(!$oTrashVO->getTrashSrl()) $oTrashVO->setTrashSrl(getNextSequence());
31
-		if(!is_string($oTrashVO->getSerializedObject())) $oTrashVO->setSerializedObject(serialize($oTrashVO->getSerializedObject()));
30
+		if(!$oTrashVO->getTrashSrl()) {
31
+			$oTrashVO->setTrashSrl(getNextSequence());
32
+		}
33
+		if(!is_string($oTrashVO->getSerializedObject())) {
34
+			$oTrashVO->setSerializedObject(serialize($oTrashVO->getSerializedObject()));
35
+		}
32 36
 		$oTrashVO->setIpaddress($_SERVER['REMOTE_ADDR']);
33 37
 		$oTrashVO->setRemoverSrl($logged_info->member_srl);
34 38
 		$oTrashVO->setRegdate(date('YmdHis'));
@@ -51,15 +55,22 @@  discard block
 block discarded – undo
51 55
 		$trashSrls = array();
52 56
 		if($isAll != 'true')
53 57
 		{
54
-			if(is_array($tmpTrashSrls)) $trashSrls = $tmpTrashSrls;
55
-			else $trashSrls = explode('|@|', $tmpTrashSrls);
58
+			if(is_array($tmpTrashSrls)) {
59
+				$trashSrls = $tmpTrashSrls;
60
+			} else {
61
+				$trashSrls = explode('|@|', $tmpTrashSrls);
62
+			}
56 63
 		}
57 64
 
58 65
 		//module relation data delete...
59 66
 		$output = $this->_relationDataDelete($isAll, $trashSrls);
60
-		if(!$output->toBool()) return new BaseObject(-1, $output->message);
67
+		if(!$output->toBool()) {
68
+			return new BaseObject(-1, $output->message);
69
+		}
61 70
 
62
-		if(!$this->_emptyTrash($trashSrls)) return new BaseObject(-1, $lang->fail_empty);
71
+		if(!$this->_emptyTrash($trashSrls)) {
72
+			return new BaseObject(-1, $lang->fail_empty);
73
+		}
63 74
 
64 75
 		$this->setMessage('success_deleted', 'info');
65 76
 
@@ -91,8 +102,7 @@  discard block
 block discarded – undo
91 102
 					$trashSrls[] = $value->getTrashSrl();
92 103
 				}
93 104
 			}
94
-		}
95
-		else
105
+		} else
96 106
 		{
97 107
 			$args = new stdClass();
98 108
 			$args->trashSrl = $trashSrls;
@@ -109,17 +119,25 @@  discard block
 block discarded – undo
109 119
 			{
110 120
 				//class file check
111 121
 				$classPath = ModuleHandler::getModulePath($oTrashVO->getOriginModule());
112
-				if(!is_dir(FileHandler::getRealPath($classPath))) return new BaseObject(-1, 'not exist restore module directory');
122
+				if(!is_dir(FileHandler::getRealPath($classPath))) {
123
+					return new BaseObject(-1, 'not exist restore module directory');
124
+				}
113 125
 
114 126
 				$classFile = sprintf('%s%s.admin.controller.php', $classPath, $oTrashVO->getOriginModule());
115 127
 				$classFile = FileHandler::getRealPath($classFile);
116
-				if(!file_exists($classFile)) return new BaseObject(-1, 'not exist restore module class file');
128
+				if(!file_exists($classFile)) {
129
+					return new BaseObject(-1, 'not exist restore module class file');
130
+				}
117 131
 
118 132
 				$oAdminController = getAdminController($oTrashVO->getOriginModule());
119
-				if(!method_exists($oAdminController, 'emptyTrash')) return new BaseObject(-1, 'not exist restore method in module class file');
133
+				if(!method_exists($oAdminController, 'emptyTrash')) {
134
+					return new BaseObject(-1, 'not exist restore method in module class file');
135
+				}
120 136
 
121 137
 				$output2 = $oAdminController->emptyTrash($oTrashVO->getSerializedObject());
122
-				if(!$output2->toBool()) return new BaseObject(-1, $output2->message);
138
+				if(!$output2->toBool()) {
139
+					return new BaseObject(-1, $output2->message);
140
+				}
123 141
 			}
124 142
 		}
125 143
 		return new BaseObject(0, $lang->success_deleted);
@@ -144,18 +162,26 @@  discard block
 block discarded – undo
144 162
 			{
145 163
 				$oTrashModel = getModel('trash');
146 164
 				$output = $oTrashModel->getTrash($value);
147
-				if(!$output->toBool()) return new BaseObject(-1, $output->message);
165
+				if(!$output->toBool()) {
166
+					return new BaseObject(-1, $output->message);
167
+				}
148 168
 
149 169
 				//class file check
150 170
 				$classPath = ModuleHandler::getModulePath($output->data->getOriginModule());
151
-				if(!is_dir(FileHandler::getRealPath($classPath))) return new BaseObject(-1, 'not exist restore module directory');
171
+				if(!is_dir(FileHandler::getRealPath($classPath))) {
172
+					return new BaseObject(-1, 'not exist restore module directory');
173
+				}
152 174
 
153 175
 				$classFile = sprintf('%s%s.admin.controller.php', $classPath, $output->data->getOriginModule());
154 176
 				$classFile = FileHandler::getRealPath($classFile);
155
-				if(!file_exists($classFile)) return new BaseObject(-1, 'not exist restore module class file');
177
+				if(!file_exists($classFile)) {
178
+					return new BaseObject(-1, 'not exist restore module class file');
179
+				}
156 180
 
157 181
 				$oAdminController = getAdminController($output->data->getOriginModule());
158
-				if(!method_exists($oAdminController, 'restoreTrash')) return new BaseObject(-1, 'not exist restore method in module class file');
182
+				if(!method_exists($oAdminController, 'restoreTrash')) {
183
+					return new BaseObject(-1, 'not exist restore method in module class file');
184
+				}
159 185
 
160 186
 				$originObject = unserialize($output->data->getSerializedObject());
161 187
 				$output = $oAdminController->restoreTrash($originObject);
@@ -187,9 +213,13 @@  discard block
 block discarded – undo
187 213
 	 */
188 214
 	function procTrashAdminGetList()
189 215
 	{
190
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
216
+		if(!Context::get('is_logged')) {
217
+			return new BaseObject(-1,'msg_not_permitted');
218
+		}
191 219
 		$trashSrls = Context::get('trash_srls');
192
-		if($trashSrls) $trashSrlList = explode(',', $trashSrls);
220
+		if($trashSrls) {
221
+			$trashSrlList = explode(',', $trashSrls);
222
+		}
193 223
 
194 224
 		if(count($trashSrlList) > 0)
195 225
 		{
@@ -198,8 +228,7 @@  discard block
 block discarded – undo
198 228
 			$args->trashSrl = $trashSrlList;
199 229
 			$output = $oTrashModel->getTrashList($args);
200 230
 			$trashList = $output->data;
201
-		}
202
-		else
231
+		} else
203 232
 		{
204 233
 			global $lang;
205 234
 			$trashList = array();
@@ -218,11 +247,15 @@  discard block
 block discarded – undo
218 247
 	 */
219 248
 	function _emptyTrash($trashSrls)
220 249
 	{
221
-		if(!is_array($trashSrls)) return false;
250
+		if(!is_array($trashSrls)) {
251
+			return false;
252
+		}
222 253
 		$args = new stdClass();
223 254
 		$args->trashSrls = $trashSrls;
224 255
 		$output = executeQuery('trash.deleteTrash', $args);
225
-		if(!$output->toBool()) return false;
256
+		if(!$output->toBool()) {
257
+			return false;
258
+		}
226 259
 
227 260
 		return true;
228 261
 	}
Please login to merge, or discard this patch.
modules/trash/trash.admin.view.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
86 86
 
87 87
 		$oTrashModel = getModel('trash');
88 88
 		$output = $oTrashModel->getTrash($trash_srl);
89
-		if(!$output->data->getTrashSrl()) return new BaseObject(-1, 'msg_invalid_request');
89
+		if (!$output->data->getTrashSrl()) return new BaseObject(-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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,10 +86,14 @@
 block discarded – undo
86 86
 
87 87
 		$oTrashModel = getModel('trash');
88 88
 		$output = $oTrashModel->getTrash($trash_srl);
89
-		if(!$output->data->getTrashSrl()) return new BaseObject(-1, 'msg_invalid_request');
89
+		if(!$output->data->getTrashSrl()) {
90
+			return new BaseObject(-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);
Please login to merge, or discard this patch.
modules/trash/trash.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 		//$oDB = &DB::getInstance();
43 43
 		//$oModuleModel = getModel('module');
44 44
 
45
-		return new BaseObject(0,'success_updated');
45
+		return new BaseObject(0, 'success_updated');
46 46
 	}
47 47
 }
48 48
 /* End of file trash.class.php */
Please login to merge, or discard this patch.
classes/cache/CacheMemcache.class.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 	 *
36 36
 	 * Do not use this directly. You can use getInstance() instead.
37 37
 	 * @param string $url url of memcache
38
-	 * @return void
38
+	 * @return false|null
39 39
 	 */
40 40
 	function CacheMemcache($url)
41 41
 	{
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	function getInstance($url)
25 25
 	{
26
-		if(!$GLOBALS['__CacheMemcache__'])
26
+		if (!$GLOBALS['__CacheMemcache__'])
27 27
 		{
28 28
 			$GLOBALS['__CacheMemcache__'] = new CacheMemcache($url);
29 29
 		}
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
 	{
42 42
 		//$config['url'] = array('memcache://localhost:11211');
43 43
 		$config['url'] = is_array($url) ? $url : array($url);
44
-		if(class_exists('Memcached'))
44
+		if (class_exists('Memcached'))
45 45
 		{
46 46
 			$this->Memcache = new Memcached;
47 47
 			$this->SelectedExtension = 'Memcached';
48 48
 		}
49
-		elseif(class_exists('Memcache'))
49
+		elseif (class_exists('Memcache'))
50 50
 		{
51 51
 			$this->Memcache = new Memcache;
52 52
 			$this->SelectedExtension = 'Memcache';
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 			return false;
57 57
 		}
58 58
 
59
-		foreach($config['url'] as $url)
59
+		foreach ($config['url'] as $url)
60 60
 		{
61 61
 			$info = parse_url($url);
62 62
 			$this->Memcache->addServer($info['host'], $info['port']);
@@ -70,15 +70,15 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	function isSupport()
72 72
 	{
73
-		if(isset($GLOBALS['XE_MEMCACHE_SUPPORT']))
73
+		if (isset($GLOBALS['XE_MEMCACHE_SUPPORT']))
74 74
 		{
75 75
 			return $GLOBALS['XE_MEMCACHE_SUPPORT'];
76 76
 		}
77
-		if($this->SelectedExtension === 'Memcached')
77
+		if ($this->SelectedExtension === 'Memcached')
78 78
 		{
79 79
 			return $GLOBALS['XE_MEMCACHE_SUPPORT'] = $this->Memcache->set('xe', 'xe', 1); 
80 80
 		}
81
-		elseif($this->SelectedExtension === 'Memcache')
81
+		elseif ($this->SelectedExtension === 'Memcache')
82 82
 		{
83 83
 			return $GLOBALS['XE_MEMCACHE_SUPPORT'] = $this->Memcache->set('xe', 'xe', MEMCACHE_COMPRESSED, 1); 
84 84
 		}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	function getKey($key)
98 98
 	{
99
-		return md5(_XE_PATH_ . $key);
99
+		return md5(_XE_PATH_.$key);
100 100
 	}
101 101
 
102 102
 	/**
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	function put($key, $buff, $valid_time = 0)
120 120
 	{
121
-		if($valid_time == 0)
121
+		if ($valid_time == 0)
122 122
 		{
123 123
 			$valid_time = $this->valid_time;
124 124
 		}
125
-		if($this->SelectedExtension === 'Memcached')
125
+		if ($this->SelectedExtension === 'Memcached')
126 126
 		{
127 127
 			return $this->Memcache->set($this->getKey($key), array($_SERVER['REQUEST_TIME'], $buff), $valid_time);
128 128
 		}
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 		$_key = $this->getKey($key);
146 146
 
147 147
 		$obj = $this->Memcache->get($_key);
148
-		if(!$obj || !is_array($obj))
148
+		if (!$obj || !is_array($obj))
149 149
 		{
150 150
 			return false;
151 151
 		}
152 152
 		unset($obj[1]);
153 153
 
154
-		if($modified_time > 0 && $modified_time > $obj[0])
154
+		if ($modified_time > 0 && $modified_time > $obj[0])
155 155
 		{
156 156
 			$this->_delete($_key);
157 157
 			return false;
@@ -174,12 +174,12 @@  discard block
 block discarded – undo
174 174
 	{
175 175
 		$_key = $this->getKey($key);
176 176
 		$obj = $this->Memcache->get($_key);
177
-		if(!$obj || !is_array($obj))
177
+		if (!$obj || !is_array($obj))
178 178
 		{
179 179
 			return false;
180 180
 		}
181 181
 
182
-		if($modified_time > 0 && $modified_time > $obj[0])
182
+		if ($modified_time > 0 && $modified_time > $obj[0])
183 183
 		{
184 184
 			$this->_delete($_key);
185 185
 			return false;
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -45,13 +45,11 @@  discard block
 block discarded – undo
45 45
 		{
46 46
 			$this->Memcache = new Memcached;
47 47
 			$this->SelectedExtension = 'Memcached';
48
-		}
49
-		elseif(class_exists('Memcache'))
48
+		} elseif(class_exists('Memcache'))
50 49
 		{
51 50
 			$this->Memcache = new Memcache;
52 51
 			$this->SelectedExtension = 'Memcache';
53
-		}
54
-		else
52
+		} else
55 53
 		{
56 54
 			return false;
57 55
 		}
@@ -77,12 +75,10 @@  discard block
 block discarded – undo
77 75
 		if($this->SelectedExtension === 'Memcached')
78 76
 		{
79 77
 			return $GLOBALS['XE_MEMCACHE_SUPPORT'] = $this->Memcache->set('xe', 'xe', 1); 
80
-		}
81
-		elseif($this->SelectedExtension === 'Memcache')
78
+		} elseif($this->SelectedExtension === 'Memcache')
82 79
 		{
83 80
 			return $GLOBALS['XE_MEMCACHE_SUPPORT'] = $this->Memcache->set('xe', 'xe', MEMCACHE_COMPRESSED, 1); 
84
-		}
85
-		else
81
+		} else
86 82
 		{
87 83
 			return $GLOBALS['XE_MEMCACHE_SUPPORT'] = false;
88 84
 		}
@@ -125,8 +121,7 @@  discard block
 block discarded – undo
125 121
 		if($this->SelectedExtension === 'Memcached')
126 122
 		{
127 123
 			return $this->Memcache->set($this->getKey($key), array($_SERVER['REQUEST_TIME'], $buff), $valid_time);
128
-		}
129
-		else
124
+		} else
130 125
 		{
131 126
 			return $this->Memcache->set($this->getKey($key), array($_SERVER['REQUEST_TIME'], $buff), MEMCACHE_COMPRESSED, $valid_time);
132 127
 		}
Please login to merge, or discard this patch.
modules/addon/addon.class.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -37,19 +37,19 @@  discard block
 block discarded – undo
37 37
 		$oModuleModel = getModel('module');
38 38
 		$oModuleController = getController('module');
39 39
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
40
-		if($oModuleModel->needUpdate($version_update_id))
40
+		if ($oModuleModel->needUpdate($version_update_id))
41 41
 		{
42
-			if(!$oDB->isColumnExists("addons", "is_used_m"))
42
+			if (!$oDB->isColumnExists("addons", "is_used_m"))
43 43
 			{
44 44
 				return TRUE;
45 45
 			}
46
-			if(!$oDB->isColumnExists("addons_site", "is_used_m"))
46
+			if (!$oDB->isColumnExists("addons_site", "is_used_m"))
47 47
 			{
48 48
 				return TRUE;
49 49
 			}
50 50
 
51 51
 			// 2011. 7. 29. add is_fixed column
52
-			if(!$oDB->isColumnExists('addons', 'is_fixed'))
52
+			if (!$oDB->isColumnExists('addons', 'is_fixed'))
53 53
 			{
54 54
 				return TRUE;
55 55
 			}
@@ -72,27 +72,27 @@  discard block
 block discarded – undo
72 72
 		$oModuleModel = getModel('module');
73 73
 		$oModuleController = getController('module');
74 74
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
75
-		if($oModuleModel->needUpdate($version_update_id))
75
+		if ($oModuleModel->needUpdate($version_update_id))
76 76
 		{
77
-			if(!$oDB->isColumnExists("addons", "is_used_m"))
77
+			if (!$oDB->isColumnExists("addons", "is_used_m"))
78 78
 			{
79 79
 				$oDB->addColumn("addons", "is_used_m", "char", 1, "N", TRUE);
80 80
 			}
81
-			if(!$oDB->isColumnExists("addons_site", "is_used_m"))
81
+			if (!$oDB->isColumnExists("addons_site", "is_used_m"))
82 82
 			{
83 83
 				$oDB->addColumn("addons_site", "is_used_m", "char", 1, "N", TRUE);
84 84
 			}
85 85
 
86 86
 			// 2011. 7. 29. add is_fixed column
87
-			if(!$oDB->isColumnExists('addons', 'is_fixed'))
87
+			if (!$oDB->isColumnExists('addons', 'is_fixed'))
88 88
 			{
89 89
 				$oDB->addColumn('addons', 'is_fixed', 'char', 1, 'N', TRUE);
90 90
 
91 91
 				// move addon info to addon_site table
92 92
 				$output = executeQueryArray('addon.getAddons');
93
-				if($output->data)
93
+				if ($output->data)
94 94
 				{
95
-					foreach($output->data as $row)
95
+					foreach ($output->data as $row)
96 96
 					{
97 97
 						$args = new stdClass();
98 98
 						$args->site_srl = 0;
Please login to merge, or discard this patch.