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 ( 359872...ce3ac6 )
by gyeong-won
48:25 queued 39:21
created
modules/document/document.view.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 	/**
54 54
 	 * Preview
55
-	 * @return void
55
+	 * @return BaseObject|null
56 56
 	 */
57 57
 	function dispDocumentPreview()
58 58
 	{
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
 	/**
157 157
 	 * Document temp saved list
158
-	 * @return void
158
+	 * @return ModuleObject|null
159 159
 	 */
160 160
 	function dispTempSavedList()
161 161
 	{
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
 		$oDocumentModel = getModel('document');
37 37
 		// Creates an object for displaying the selected document
38 38
 		$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
39
-		if(!$oDocument->isExists()) return new BaseObject(-1,'msg_invalid_request');
39
+		if (!$oDocument->isExists()) return new BaseObject(-1, 'msg_invalid_request');
40 40
 		// Check permissions
41
-		if(!$oDocument->isAccessible()) return new BaseObject(-1,'msg_not_permitted');
41
+		if (!$oDocument->isAccessible()) return new BaseObject(-1, 'msg_not_permitted');
42 42
 		// Information setting module
43 43
 		//Context::set('module_info', $module_info);	//module_info not use in UI
44 44
 		// Browser title settings
45 45
 		Context::setBrowserTitle($oDocument->getTitleText());
46 46
 		Context::set('oDocument', $oDocument);
47 47
 
48
-		Context::set('layout','none');
48
+		Context::set('layout', 'none');
49 49
 		$this->setTemplatePath($this->module_path.'tpl');
50 50
 		$this->setTemplateFile('print_page');
51 51
 	}
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
 	 */
57 57
 	function dispDocumentPreview()
58 58
 	{
59
-		if(!checkCSRF())
59
+		if (!checkCSRF())
60 60
 		{
61 61
 			return new BaseObject(-1, 'msg_invalid_request');
62 62
 		} 
63 63
 
64
-		if(Context::get('logged_info')->is_admin != 'Y')
64
+		if (Context::get('logged_info')->is_admin != 'Y')
65 65
 		{
66 66
 			Context::set('content', removeHackTag(Context::get('content')));
67 67
 		}
@@ -78,19 +78,19 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	function dispDocumentManageDocument()
80 80
 	{
81
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
81
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
82 82
 		// Taken from a list of selected sessions
83 83
 		$flag_list = $_SESSION['document_management'];
84
-		if(count($flag_list))
84
+		if (count($flag_list))
85 85
 		{
86
-			foreach($flag_list as $key => $val)
86
+			foreach ($flag_list as $key => $val)
87 87
 			{
88
-				if(!is_bool($val)) continue;
88
+				if (!is_bool($val)) continue;
89 89
 				$document_srl_list[] = $key;
90 90
 			}
91 91
 		}
92 92
 
93
-		if(count($document_srl_list))
93
+		if (count($document_srl_list))
94 94
 		{
95 95
 			$oDocumentModel = getModel('document');
96 96
 			$document_list = $oDocumentModel->getDocuments($document_srl_list, $this->grant->is_admin);
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
 
100 100
 		$oModuleModel = getModel('module');
101 101
 		// The combination of module categories list and the list of modules
102
-		if(count($module_list)>1) Context::set('module_list', $module_categories);
102
+		if (count($module_list) > 1) Context::set('module_list', $module_categories);
103 103
 
104
-		$module_srl=Context::get('module_srl');
105
-		Context::set('module_srl',$module_srl);
104
+		$module_srl = Context::get('module_srl');
105
+		Context::set('module_srl', $module_srl);
106 106
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
107
-		Context::set('mid',$module_info->mid);
108
-		Context::set('browser_title',$module_info->browser_title);
107
+		Context::set('mid', $module_info->mid);
108
+		Context::set('browser_title', $module_info->browser_title);
109 109
 
110 110
 		// Select Pop-up layout
111 111
 		$this->setLayoutPath('./common/tpl');
@@ -126,24 +126,24 @@  discard block
 block discarded – undo
126 126
 		$current_module_srl = Context::get('module_srl');
127 127
 		$current_module_srls = Context::get('module_srls');
128 128
 
129
-		if(!$current_module_srl && !$current_module_srls)
129
+		if (!$current_module_srl && !$current_module_srls)
130 130
 		{
131 131
 			// Get information of the current module
132 132
 			$current_module_info = Context::get('current_module_info');
133 133
 			$current_module_srl = $current_module_info->module_srl;
134
-			if(!$current_module_srl) return new BaseObject();
134
+			if (!$current_module_srl) return new BaseObject();
135 135
 		}
136 136
 
137 137
 		$oModuleModel = getModel('module');
138
-		if($current_module_srl)
138
+		if ($current_module_srl)
139 139
 		{
140 140
 			$document_config = $oModuleModel->getModulePartConfig('document', $current_module_srl);
141 141
 		}
142
-		if(!$document_config)
142
+		if (!$document_config)
143 143
 		{
144 144
 			$document_config = new stdClass();
145 145
 		}
146
-		if(!isset($document_config->use_history)) $document_config->use_history = 'N';
146
+		if (!isset($document_config->use_history)) $document_config->use_history = 'N';
147 147
 		Context::set('document_config', $document_config);
148 148
 
149 149
 		$oTemplate = &TemplateHandler::getInstance();
@@ -163,13 +163,13 @@  discard block
 block discarded – undo
163 163
 
164 164
 		$oMemberModel = getModel('member');
165 165
 		// A message appears if the user is not logged-in
166
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
166
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
167 167
 		// Get the saved document (module_srl is set to member_srl instead)
168 168
 		$logged_info = Context::get('logged_info');
169 169
 		$args = new stdClass();
170 170
 		$args->member_srl = $logged_info->member_srl;
171 171
 		$args->statusList = array($this->getConfigStatus('temp'));
172
-		$args->page = (int)Context::get('page');
172
+		$args->page = (int) Context::get('page');
173 173
 		$args->list_count = 10;
174 174
 
175 175
 		$oDocumentModel = getModel('document');
Please login to merge, or discard this patch.
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,9 +36,13 @@  discard block
 block discarded – undo
36 36
 		$oDocumentModel = getModel('document');
37 37
 		// Creates an object for displaying the selected document
38 38
 		$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
39
-		if(!$oDocument->isExists()) return new BaseObject(-1,'msg_invalid_request');
39
+		if(!$oDocument->isExists()) {
40
+			return new BaseObject(-1,'msg_invalid_request');
41
+		}
40 42
 		// Check permissions
41
-		if(!$oDocument->isAccessible()) return new BaseObject(-1,'msg_not_permitted');
43
+		if(!$oDocument->isAccessible()) {
44
+			return new BaseObject(-1,'msg_not_permitted');
45
+		}
42 46
 		// Information setting module
43 47
 		//Context::set('module_info', $module_info);	//module_info not use in UI
44 48
 		// Browser title settings
@@ -78,14 +82,18 @@  discard block
 block discarded – undo
78 82
 	 */
79 83
 	function dispDocumentManageDocument()
80 84
 	{
81
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
85
+		if(!Context::get('is_logged')) {
86
+			return new BaseObject(-1,'msg_not_permitted');
87
+		}
82 88
 		// Taken from a list of selected sessions
83 89
 		$flag_list = $_SESSION['document_management'];
84 90
 		if(count($flag_list))
85 91
 		{
86 92
 			foreach($flag_list as $key => $val)
87 93
 			{
88
-				if(!is_bool($val)) continue;
94
+				if(!is_bool($val)) {
95
+					continue;
96
+				}
89 97
 				$document_srl_list[] = $key;
90 98
 			}
91 99
 		}
@@ -99,7 +107,9 @@  discard block
 block discarded – undo
99 107
 
100 108
 		$oModuleModel = getModel('module');
101 109
 		// The combination of module categories list and the list of modules
102
-		if(count($module_list)>1) Context::set('module_list', $module_categories);
110
+		if(count($module_list)>1) {
111
+			Context::set('module_list', $module_categories);
112
+		}
103 113
 
104 114
 		$module_srl=Context::get('module_srl');
105 115
 		Context::set('module_srl',$module_srl);
@@ -131,7 +141,9 @@  discard block
 block discarded – undo
131 141
 			// Get information of the current module
132 142
 			$current_module_info = Context::get('current_module_info');
133 143
 			$current_module_srl = $current_module_info->module_srl;
134
-			if(!$current_module_srl) return new BaseObject();
144
+			if(!$current_module_srl) {
145
+				return new BaseObject();
146
+			}
135 147
 		}
136 148
 
137 149
 		$oModuleModel = getModel('module');
@@ -143,7 +155,9 @@  discard block
 block discarded – undo
143 155
 		{
144 156
 			$document_config = new stdClass();
145 157
 		}
146
-		if(!isset($document_config->use_history)) $document_config->use_history = 'N';
158
+		if(!isset($document_config->use_history)) {
159
+			$document_config->use_history = 'N';
160
+		}
147 161
 		Context::set('document_config', $document_config);
148 162
 
149 163
 		$oTemplate = &TemplateHandler::getInstance();
@@ -163,7 +177,9 @@  discard block
 block discarded – undo
163 177
 
164 178
 		$oMemberModel = getModel('member');
165 179
 		// A message appears if the user is not logged-in
166
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
180
+		if(!$oMemberModel->isLogged()) {
181
+			return $this->stop('msg_not_logged');
182
+		}
167 183
 		// Get the saved document (module_srl is set to member_srl instead)
168 184
 		$logged_info = Context::get('logged_info');
169 185
 		$args = new stdClass();
Please login to merge, or discard this patch.
modules/file/file.admin.controller.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	/**
57 57
 	 * Delete selected files from the administrator page
58 58
 	 *
59
-	 * @return BaseObject
59
+	 * @return ModuleObject|null
60 60
 	 */
61 61
 	function procFileAdminDeleteChecked()
62 62
 	{
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	/**
111 111
 	 * Add file information for each module
112 112
 	 *
113
-	 * @return void
113
+	 * @return BaseObject|null
114 114
 	 */
115 115
 	function procFileAdminInsertModuleConfig()
116 116
 	{
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -26,29 +26,29 @@  discard block
 block discarded – undo
26 26
 		$args = new stdClass();
27 27
 		$args->module_srl = $module_srl;
28 28
 		$columnList = array('file_srl', 'uploaded_filename');
29
-		$output = executeQueryArray('file.getModuleFiles',$args, $columnList);
30
-		if(!$output) return $output;
29
+		$output = executeQueryArray('file.getModuleFiles', $args, $columnList);
30
+		if (!$output) return $output;
31 31
 		$files = $output->data;
32 32
 		// Remove from the DB
33 33
 		$args->module_srl = $module_srl;
34 34
 		$output = executeQuery('file.deleteModuleFiles', $args);
35
-		if(!$output->toBool()) return $output;
35
+		if (!$output->toBool()) return $output;
36 36
 		// Remove the file
37
-		FileHandler::removeDir( sprintf("./files/attach/images/%s/", $module_srl) ) ;
38
-		FileHandler::removeDir( sprintf("./files/attach/binaries/%s/", $module_srl) );
37
+		FileHandler::removeDir(sprintf("./files/attach/images/%s/", $module_srl));
38
+		FileHandler::removeDir(sprintf("./files/attach/binaries/%s/", $module_srl));
39 39
 		// Remove the file list obtained from the DB
40 40
 		$path = array();
41 41
 		$cnt = count($files);
42
-		for($i=0;$i<$cnt;$i++)
42
+		for ($i = 0; $i < $cnt; $i++)
43 43
 		{
44 44
 			$uploaded_filename = $files[$i]->uploaded_filename;
45 45
 			FileHandler::removeFile($uploaded_filename);
46 46
 
47 47
 			$path_info = pathinfo($uploaded_filename);
48
-			if(!in_array($path_info['dirname'], $path)) $path[] = $path_info['dirname'];
48
+			if (!in_array($path_info['dirname'], $path)) $path[] = $path_info['dirname'];
49 49
 		}
50 50
 		// Remove a file directory of the document
51
-		for($i=0;$i<count($path);$i++) FileHandler::removeBlankDir($path[$i]);
51
+		for ($i = 0; $i < count($path); $i++) FileHandler::removeBlankDir($path[$i]);
52 52
 
53 53
 		return $output;
54 54
 	}
@@ -62,23 +62,23 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		// An error appears if no document is selected
64 64
 		$cart = Context::get('cart');
65
-		if(!$cart) return $this->stop('msg_file_cart_is_null');
66
-		if(!is_array($cart)) $file_srl_list= explode('|@|', $cart);
65
+		if (!$cart) return $this->stop('msg_file_cart_is_null');
66
+		if (!is_array($cart)) $file_srl_list = explode('|@|', $cart);
67 67
 		else $file_srl_list = $cart;
68 68
 		$file_count = count($file_srl_list);
69
-		if(!$file_count) return $this->stop('msg_file_cart_is_null');
69
+		if (!$file_count) return $this->stop('msg_file_cart_is_null');
70 70
 
71 71
 		$oFileController = getController('file');
72 72
 		// Delete the post
73
-		for($i=0;$i<$file_count;$i++)
73
+		for ($i = 0; $i < $file_count; $i++)
74 74
 		{
75 75
 			$file_srl = trim($file_srl_list[$i]);
76
-			if(!$file_srl) continue;
76
+			if (!$file_srl) continue;
77 77
 
78 78
 			$oFileController->deleteFile($file_srl);
79 79
 		}
80 80
 
81
-		$this->setMessage( sprintf(Context::getLang('msg_checked_file_is_deleted'), $file_count) );
81
+		$this->setMessage(sprintf(Context::getLang('msg_checked_file_is_deleted'), $file_count));
82 82
 
83 83
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispFileAdminList');
84 84
 		$this->setRedirectUrl($returnUrl);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		$config->allow_outlink_site = Context::get('allow_outlink_site');
102 102
 		// Create module Controller object
103 103
 		$oModuleController = getController('module');
104
-		$output = $oModuleController->insertModuleConfig('file',$config);
104
+		$output = $oModuleController->insertModuleConfig('file', $config);
105 105
 
106 106
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispFileAdminConfig');
107 107
 		return $this->setRedirectUrl($returnUrl, $output);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		// Get variables
118 118
 		$module_srl = Context::get('target_module_srl');
119 119
 		// In order to configure multiple modules at once
120
-		if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
120
+		if (preg_match('/^([0-9,]+)$/', $module_srl)) $module_srl = explode(',', $module_srl);
121 121
 		else $module_srl = array($module_srl);
122 122
 
123 123
 		$download_grant = Context::get('download_grant');
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		$file_config->allowed_attach_size = Context::get('allowed_attach_size');
131 131
 		$file_config->allowed_filetypes = str_replace(' ', '', Context::get('allowed_filetypes'));
132 132
 
133
-		if(!is_array($download_grant)) $file_config->download_grant = explode('|@|',$download_grant);
133
+		if (!is_array($download_grant)) $file_config->download_grant = explode('|@|', $download_grant);
134 134
 		else $file_config->download_grant = $download_grant;
135 135
 
136 136
 		//관리자가 허용한 첨부파일의 사이즈가 php.ini의 값보다 큰지 확인하기 - by ovclas
@@ -140,15 +140,15 @@  discard block
 block discarded – undo
140 140
 		$iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize'));
141 141
 		$iniMinSzie = min($iniPostMaxSize, $iniUploadMaxSize);
142 142
 
143
-		if($userFileAllowSize > $iniMinSzie || $userAttachAllowSize > $iniMinSzie)
143
+		if ($userFileAllowSize > $iniMinSzie || $userAttachAllowSize > $iniMinSzie)
144 144
 			return new BaseObject(-1, 'input size over than config in php.ini');
145 145
 
146 146
 		$oModuleController = getController('module');
147
-		for($i=0;$i<count($module_srl);$i++)
147
+		for ($i = 0; $i < count($module_srl); $i++)
148 148
 		{
149 149
 			$srl = trim($module_srl[$i]);
150
-			if(!$srl) continue;
151
-			$oModuleController->insertModulePartConfig('file',$srl,$file_config);
150
+			if (!$srl) continue;
151
+			$oModuleController->insertModulePartConfig('file', $srl, $file_config);
152 152
 		}
153 153
 
154 154
 		$this->setError(-1);
@@ -165,16 +165,16 @@  discard block
 block discarded – undo
165 165
 	 */
166 166
 	function procFileAdminAddCart()
167 167
 	{
168
-		$file_srl = (int)Context::get('file_srl');
168
+		$file_srl = (int) Context::get('file_srl');
169 169
 		//$fileSrlList = array(500, 502);
170 170
 
171 171
 		$oFileModel = getModel('file');
172 172
 		$output = $oFileModel->getFile($file_srl);
173 173
 		//$output = $oFileModel->getFile($fileSrlList);
174 174
 
175
-		if($output->file_srl)
175
+		if ($output->file_srl)
176 176
 		{
177
-			if($_SESSION['file_management'][$output->file_srl]) unset($_SESSION['file_management'][$output->file_srl]);
177
+			if ($_SESSION['file_management'][$output->file_srl]) unset($_SESSION['file_management'][$output->file_srl]);
178 178
 			else $_SESSION['file_management'][$output->file_srl] = true;
179 179
 		}
180 180
 	}
Please login to merge, or discard this patch.
Braces   +47 added lines, -18 removed lines patch added patch discarded remove patch
@@ -27,12 +27,16 @@  discard block
 block discarded – undo
27 27
 		$args->module_srl = $module_srl;
28 28
 		$columnList = array('file_srl', 'uploaded_filename');
29 29
 		$output = executeQueryArray('file.getModuleFiles',$args, $columnList);
30
-		if(!$output) return $output;
30
+		if(!$output) {
31
+			return $output;
32
+		}
31 33
 		$files = $output->data;
32 34
 		// Remove from the DB
33 35
 		$args->module_srl = $module_srl;
34 36
 		$output = executeQuery('file.deleteModuleFiles', $args);
35
-		if(!$output->toBool()) return $output;
37
+		if(!$output->toBool()) {
38
+			return $output;
39
+		}
36 40
 		// Remove the file
37 41
 		FileHandler::removeDir( sprintf("./files/attach/images/%s/", $module_srl) ) ;
38 42
 		FileHandler::removeDir( sprintf("./files/attach/binaries/%s/", $module_srl) );
@@ -45,10 +49,14 @@  discard block
 block discarded – undo
45 49
 			FileHandler::removeFile($uploaded_filename);
46 50
 
47 51
 			$path_info = pathinfo($uploaded_filename);
48
-			if(!in_array($path_info['dirname'], $path)) $path[] = $path_info['dirname'];
52
+			if(!in_array($path_info['dirname'], $path)) {
53
+				$path[] = $path_info['dirname'];
54
+			}
49 55
 		}
50 56
 		// Remove a file directory of the document
51
-		for($i=0;$i<count($path);$i++) FileHandler::removeBlankDir($path[$i]);
57
+		for($i=0;$i<count($path);$i++) {
58
+			FileHandler::removeBlankDir($path[$i]);
59
+		}
52 60
 
53 61
 		return $output;
54 62
 	}
@@ -62,18 +70,27 @@  discard block
 block discarded – undo
62 70
 	{
63 71
 		// An error appears if no document is selected
64 72
 		$cart = Context::get('cart');
65
-		if(!$cart) return $this->stop('msg_file_cart_is_null');
66
-		if(!is_array($cart)) $file_srl_list= explode('|@|', $cart);
67
-		else $file_srl_list = $cart;
73
+		if(!$cart) {
74
+			return $this->stop('msg_file_cart_is_null');
75
+		}
76
+		if(!is_array($cart)) {
77
+			$file_srl_list= explode('|@|', $cart);
78
+		} else {
79
+			$file_srl_list = $cart;
80
+		}
68 81
 		$file_count = count($file_srl_list);
69
-		if(!$file_count) return $this->stop('msg_file_cart_is_null');
82
+		if(!$file_count) {
83
+			return $this->stop('msg_file_cart_is_null');
84
+		}
70 85
 
71 86
 		$oFileController = getController('file');
72 87
 		// Delete the post
73 88
 		for($i=0;$i<$file_count;$i++)
74 89
 		{
75 90
 			$file_srl = trim($file_srl_list[$i]);
76
-			if(!$file_srl) continue;
91
+			if(!$file_srl) {
92
+				continue;
93
+			}
77 94
 
78 95
 			$oFileController->deleteFile($file_srl);
79 96
 		}
@@ -117,8 +134,11 @@  discard block
 block discarded – undo
117 134
 		// Get variables
118 135
 		$module_srl = Context::get('target_module_srl');
119 136
 		// In order to configure multiple modules at once
120
-		if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
121
-		else $module_srl = array($module_srl);
137
+		if(preg_match('/^([0-9,]+)$/',$module_srl)) {
138
+			$module_srl = explode(',',$module_srl);
139
+		} else {
140
+			$module_srl = array($module_srl);
141
+		}
122 142
 
123 143
 		$download_grant = Context::get('download_grant');
124 144
 
@@ -130,8 +150,11 @@  discard block
 block discarded – undo
130 150
 		$file_config->allowed_attach_size = Context::get('allowed_attach_size');
131 151
 		$file_config->allowed_filetypes = str_replace(' ', '', Context::get('allowed_filetypes'));
132 152
 
133
-		if(!is_array($download_grant)) $file_config->download_grant = explode('|@|',$download_grant);
134
-		else $file_config->download_grant = $download_grant;
153
+		if(!is_array($download_grant)) {
154
+			$file_config->download_grant = explode('|@|',$download_grant);
155
+		} else {
156
+			$file_config->download_grant = $download_grant;
157
+		}
135 158
 
136 159
 		//관리자가 허용한 첨부파일의 사이즈가 php.ini의 값보다 큰지 확인하기 - by ovclas
137 160
 		$userFileAllowSize = FileHandler::returnbytes($file_config->allowed_filesize.'M');
@@ -140,14 +163,17 @@  discard block
 block discarded – undo
140 163
 		$iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize'));
141 164
 		$iniMinSzie = min($iniPostMaxSize, $iniUploadMaxSize);
142 165
 
143
-		if($userFileAllowSize > $iniMinSzie || $userAttachAllowSize > $iniMinSzie)
144
-			return new BaseObject(-1, 'input size over than config in php.ini');
166
+		if($userFileAllowSize > $iniMinSzie || $userAttachAllowSize > $iniMinSzie) {
167
+					return new BaseObject(-1, 'input size over than config in php.ini');
168
+		}
145 169
 
146 170
 		$oModuleController = getController('module');
147 171
 		for($i=0;$i<count($module_srl);$i++)
148 172
 		{
149 173
 			$srl = trim($module_srl[$i]);
150
-			if(!$srl) continue;
174
+			if(!$srl) {
175
+				continue;
176
+			}
151 177
 			$oModuleController->insertModulePartConfig('file',$srl,$file_config);
152 178
 		}
153 179
 
@@ -174,8 +200,11 @@  discard block
 block discarded – undo
174 200
 
175 201
 		if($output->file_srl)
176 202
 		{
177
-			if($_SESSION['file_management'][$output->file_srl]) unset($_SESSION['file_management'][$output->file_srl]);
178
-			else $_SESSION['file_management'][$output->file_srl] = true;
203
+			if($_SESSION['file_management'][$output->file_srl]) {
204
+				unset($_SESSION['file_management'][$output->file_srl]);
205
+			} else {
206
+				$_SESSION['file_management'][$output->file_srl] = true;
207
+			}
179 208
 		}
180 209
 	}
181 210
 }
Please login to merge, or discard this patch.
modules/file/file.model.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 * It is used when a file list of the upload_target_srl is requested for creating/updating a document.
21 21
 	 * Attempt to replace with sever-side session if upload_target_srl is not yet determined
22 22
 	 *
23
-	 * @return void
23
+	 * @return BaseObject|null
24 24
 	 */
25 25
 	function getFileList()
26 26
 	{
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * Get file configurations
147 147
 	 *
148 148
 	 * @param int $module_srl If set this, returns specific module's configuration. Otherwise returns global configuration.
149
-	 * @return object Returns configuration.
149
+	 * @return stdClass Returns configuration.
150 150
 	 */
151 151
 	function getFileConfig($module_srl = null)
152 152
 	{
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	/**
277 277
 	 * Return configurations of the attachement (it automatically checks if an administrator is)
278 278
 	 *
279
-	 * @return object Returns a file configuration of current module. If user is admin, returns PHP's max file size and allow all file types.
279
+	 * @return stdClass Returns a file configuration of current module. If user is admin, returns PHP's max file size and allow all file types.
280 280
 	 */
281 281
 	function getUploadConfig()
282 282
 	{
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	 * Return file configuration of the module
331 331
 	 *
332 332
 	 * @param int $module_srl The sequence of module to get configuration
333
-	 * @return object
333
+	 * @return stdClass
334 334
 	 */
335 335
 	function getFileModuleConfig($module_srl)
336 336
 	{
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 		$mid = Context::get('mid');
30 30
 		$editor_sequence = Context::get('editor_sequence');
31 31
 		$upload_target_srl = Context::get('upload_target_srl');
32
-		if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
32
+		if (!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
33 33
 
34
-		if($upload_target_srl)
34
+		if ($upload_target_srl)
35 35
 		{
36 36
 			$oDocumentModel = getModel('document');
37 37
 			$oCommentModel = getModel('comment');
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 			$oDocument = $oDocumentModel->getDocument($upload_target_srl);
41 41
 
42 42
 			// comment 권한 확인
43
-			if(!$oDocument->isExists())
43
+			if (!$oDocument->isExists())
44 44
 			{
45 45
 				$oComment = $oCommentModel->getComment($upload_target_srl);
46
-				if($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted())
46
+				if ($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted())
47 47
 				{
48 48
 					return new BaseObject(-1, 'msg_not_permitted');
49 49
 				}
@@ -52,34 +52,34 @@  discard block
 block discarded – undo
52 52
 			}
53 53
 
54 54
 			// document 권한 확인
55
-			if($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted())
55
+			if ($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted())
56 56
 			{
57 57
 				return new BaseObject(-1, 'msg_not_permitted');
58 58
 			}
59 59
 
60 60
 			// 모듈 권한 확인
61
-			if($oDocument->isExists())
61
+			if ($oDocument->isExists())
62 62
 			{
63 63
 				$grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')), $logged_info);
64
-				if(!$grant->access)
64
+				if (!$grant->access)
65 65
 				{
66 66
 					return new BaseObject(-1, 'msg_not_permitted');
67 67
 				}
68 68
 			}
69 69
 
70 70
 			$tmp_files = $this->getFiles($upload_target_srl);
71
-			if(!$tmp_files) $tmp_files = array();
71
+			if (!$tmp_files) $tmp_files = array();
72 72
 
73
-			foreach($tmp_files as $file_info)
73
+			foreach ($tmp_files as $file_info)
74 74
 			{
75
-				if(!$file_info->file_srl) continue;
75
+				if (!$file_info->file_srl) continue;
76 76
 
77 77
 				$obj = new stdClass;
78 78
 				$obj->file_srl = $file_info->file_srl;
79 79
 				$obj->source_filename = $file_info->source_filename;
80 80
 				$obj->file_size = $file_info->file_size;
81 81
 				$obj->disp_file_size = FileHandler::filesize($file_info->file_size);
82
-				if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
82
+				if ($file_info->direct_download == 'N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
83 83
 				else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
84 84
 				$obj->direct_download = $file_info->direct_download;
85 85
 				$obj->cover_image = ($file_info->cover_image === 'Y') ? true : false;
@@ -99,17 +99,17 @@  discard block
 block discarded – undo
99 99
 		//$config = $oModuleModel->getModuleInfoByMid($mid);	//perhaps config varialbles not used
100 100
 
101 101
 		$file_config = $this->getUploadConfig();
102
-		$left_size = $file_config->allowed_attach_size*1024*1024 - $attached_size;
102
+		$left_size = $file_config->allowed_attach_size * 1024 * 1024 - $attached_size;
103 103
 		// Settings of required information
104 104
 		$attached_size = FileHandler::filesize($attached_size);
105
-		$allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size*1024*1024);
106
-		$allowed_filesize = FileHandler::filesize($file_config->allowed_filesize*1024*1024);
105
+		$allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024);
106
+		$allowed_filesize = FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024);
107 107
 		$allowed_filetypes = $file_config->allowed_filetypes;
108
-		$this->add("files",$files);
109
-		$this->add("editor_sequence",$editor_sequence);
110
-		$this->add("upload_target_srl",$upload_target_srl);
111
-		$this->add("upload_status",$upload_status);
112
-		$this->add("left_size",$left_size);
108
+		$this->add("files", $files);
109
+		$this->add("editor_sequence", $editor_sequence);
110
+		$this->add("upload_target_srl", $upload_target_srl);
111
+		$this->add("upload_status", $upload_status);
112
+		$this->add("left_size", $left_size);
113 113
 		$this->add('attached_size', $attached_size);
114 114
 		$this->add('allowed_attach_size', $allowed_attach_size);
115 115
 		$this->add('allowed_filesize', $allowed_filesize);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		$args = new stdClass();
128 128
 		$args->upload_target_srl = $upload_target_srl;
129 129
 		$output = executeQuery('file.getFilesCount', $args);
130
-		return (int)$output->data->count;
130
+		return (int) $output->data->count;
131 131
 	}
132 132
 
133 133
 	/**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * @param string $sid
138 138
 	 * @return string Returns a url
139 139
 	 */
140
-	function getDownloadUrl($file_srl, $sid, $module_srl="")
140
+	function getDownloadUrl($file_srl, $sid, $module_srl = "")
141 141
 	{
142 142
 		return sprintf('?module=%s&amp;act=%s&amp;file_srl=%s&amp;sid=%s&amp;module_srl=%s', 'file', 'procFileDownload', $file_srl, $sid, $module_srl);
143 143
 	}
@@ -155,12 +155,12 @@  discard block
 block discarded – undo
155 155
 
156 156
 		$file_module_config = $oModuleModel->getModuleConfig('file');
157 157
 
158
-		if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
159
-		if(!$file_config) $file_config = $file_module_config;
158
+		if ($module_srl) $file_config = $oModuleModel->getModulePartConfig('file', $module_srl);
159
+		if (!$file_config) $file_config = $file_module_config;
160 160
 
161 161
 		$config = new stdClass();
162 162
 
163
-		if($file_config)
163
+		if ($file_config)
164 164
 		{
165 165
 			$config->allowed_filesize = $file_config->allowed_filesize;
166 166
 			$config->allowed_attach_size = $file_config->allowed_attach_size;
@@ -171,31 +171,31 @@  discard block
 block discarded – undo
171 171
 			$config->allow_outlink_format = $file_config->allow_outlink_format;
172 172
 		}
173 173
 		// Property for all files comes first than each property
174
-		if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
175
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
176
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
177
-		if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
178
-		if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
179
-		if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
180
-		if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
174
+		if (!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
175
+		if (!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
176
+		if (!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
177
+		if (!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
178
+		if (!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
179
+		if (!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
180
+		if (!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
181 181
 		// Default setting if not exists
182
-		if(!$config->allowed_filesize) $config->allowed_filesize = '2';
183
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = '3';
184
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
185
-		if(!$config->allow_outlink) $config->allow_outlink = 'Y';
186
-		if(!$config->download_grant) $config->download_grant = array();
182
+		if (!$config->allowed_filesize) $config->allowed_filesize = '2';
183
+		if (!$config->allowed_attach_size) $config->allowed_attach_size = '3';
184
+		if (!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
185
+		if (!$config->allow_outlink) $config->allow_outlink = 'Y';
186
+		if (!$config->download_grant) $config->download_grant = array();
187 187
 
188 188
 		$size = ini_get('upload_max_filesize');
189 189
 		$unit = strtolower($size[strlen($size) - 1]);
190
-		$size = (float)$size;
191
-		if($unit == 'g') $size *= 1024;
192
-		if($unit == 'k') $size /= 1024;
190
+		$size = (float) $size;
191
+		if ($unit == 'g') $size *= 1024;
192
+		if ($unit == 'k') $size /= 1024;
193 193
 
194
-		if($config->allowed_filesize > $size) 
194
+		if ($config->allowed_filesize > $size) 
195 195
 		{	
196 196
 			$config->allowed_filesize = $size;
197 197
 		}
198
-		if($config->allowed_attach_size > $size) 
198
+		if ($config->allowed_attach_size > $size) 
199 199
 		{
200 200
 			$config->allowed_attach_size = $size;
201 201
 		}
@@ -215,10 +215,10 @@  discard block
 block discarded – undo
215 215
 		$args = new stdClass();
216 216
 		$args->file_srl = $file_srl;
217 217
 		$output = executeQueryArray('file.getFile', $args, $columnList);
218
-		if(!$output->toBool()) return $output;
218
+		if (!$output->toBool()) return $output;
219 219
 
220 220
 		// old version compatibility
221
-		if(count($output->data) == 1)
221
+		if (count($output->data) == 1)
222 222
 		{
223 223
 			$file = $output->data[0];
224 224
 			$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
 		{
230 230
 			$fileList = array();
231 231
 
232
-			if(is_array($output->data))
232
+			if (is_array($output->data))
233 233
 			{
234
-				foreach($output->data as $key=>$value)
234
+				foreach ($output->data as $key=>$value)
235 235
 				{
236 236
 					$file = $value;
237 237
 					$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
@@ -255,13 +255,13 @@  discard block
 block discarded – undo
255 255
 		$args = new stdClass();
256 256
 		$args->upload_target_srl = $upload_target_srl;
257 257
 		$args->sort_index = $sortIndex;
258
-		if($ckValid) $args->isvalid = 'Y';
258
+		if ($ckValid) $args->isvalid = 'Y';
259 259
 		$output = executeQueryArray('file.getFiles', $args, $columnList);
260
-		if(!$output->data) return;
260
+		if (!$output->data) return;
261 261
 
262 262
 		$file_list = $output->data;
263 263
 
264
-		if($file_list && !is_array($file_list)) $file_list = array($file_list);
264
+		if ($file_list && !is_array($file_list)) $file_list = array($file_list);
265 265
 
266 266
 		foreach ($file_list as &$file)
267 267
 		{
@@ -284,14 +284,14 @@  discard block
 block discarded – undo
284 284
 
285 285
 		$module_srl = Context::get('module_srl');
286 286
 		// Get the current module if module_srl doesn't exist
287
-		if(!$module_srl)
287
+		if (!$module_srl)
288 288
 		{
289 289
 			$current_module_info = Context::get('current_module_info');
290 290
 			$module_srl = $current_module_info->module_srl;
291 291
 		}
292 292
 		$file_config = $this->getFileConfig($module_srl);
293 293
 
294
-		if($logged_info->is_admin == 'Y')
294
+		if ($logged_info->is_admin == 'Y')
295 295
 		{
296 296
 			$iniPostMaxSize = FileHandler::returnbytes(ini_get('post_max_size'));
297 297
 			$iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize'));
@@ -317,9 +317,9 @@  discard block
 block discarded – undo
317 317
 			'%s : %s/ %s<br /> %s : %s (%s : %s)',
318 318
 			Context::getLang('allowed_attach_size'),
319 319
 			FileHandler::filesize($attached_size),
320
-			FileHandler::filesize($file_config->allowed_attach_size*1024*1024),
320
+			FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024),
321 321
 			Context::getLang('allowed_filesize'),
322
-			FileHandler::filesize($file_config->allowed_filesize*1024*1024),
322
+			FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024),
323 323
 			Context::getLang('allowed_filetypes'),
324 324
 			$file_config->allowed_filetypes
325 325
 		);
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
 	 */
347 347
 	function getFileGrant($file_info, $member_info)
348 348
 	{
349
-		if(!$file_info) return null;
349
+		if (!$file_info) return null;
350 350
 
351
-		if($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl])
351
+		if ($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl])
352 352
 		{
353 353
 			$file_grant->is_deletable = true;
354 354
 			return $file_grant;
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 
360 360
 		$oDocumentModel = getModel('document');
361 361
 		$oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl);
362
-		if($oDocument->isExists()) $document_grant = $oDocument->isGranted();
362
+		if ($oDocument->isExists()) $document_grant = $oDocument->isGranted();
363 363
 
364 364
 		$file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager);
365 365
 
Please login to merge, or discard this patch.
modules/importer/importer.admin.controller.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -276,7 +276,7 @@
 block discarded – undo
276 276
 
277 277
 	/**
278 278
 	 * Migrate data after completing xml file extraction
279
-	 * @return void
279
+	 * @return BaseObject|null
280 280
 	 */
281 281
 	function procImporterAdminImport()
282 282
 	{
Please login to merge, or discard this patch.
Spacing   +217 added lines, -217 removed lines patch added patch discarded remove patch
@@ -43,19 +43,19 @@  discard block
 block discarded – undo
43 43
 		$filename = Context::get('filename');
44 44
 		$isExists = 'false';
45 45
 
46
-		if(strncasecmp('http://', $filename, 7) === 0)
46
+		if (strncasecmp('http://', $filename, 7) === 0)
47 47
 		{
48
-			if(ini_get('allow_url_fopen'))
48
+			if (ini_get('allow_url_fopen'))
49 49
 			{
50 50
 				$fp = @fopen($filename, "r");
51
-				if($fp)
51
+				if ($fp)
52 52
 				{
53 53
 					$str = fgets($fp, 100);
54
-					if(strlen($str) > 0)
54
+					if (strlen($str) > 0)
55 55
 					{
56 56
 						$isExists = 'true';
57 57
 						$type = 'XML';
58
-						if(stristr($str, 'tattertools')) $type = 'TTXML';
58
+						if (stristr($str, 'tattertools')) $type = 'TTXML';
59 59
 
60 60
 						$this->add('type', $type);
61 61
 					}
@@ -72,16 +72,16 @@  discard block
 block discarded – undo
72 72
 		{
73 73
 			$realPath = FileHandler::getRealPath($filename);
74 74
 
75
-			if(file_exists($realPath) && is_file($realPath)) $isExists = 'true';
75
+			if (file_exists($realPath) && is_file($realPath)) $isExists = 'true';
76 76
 			$this->add('exists', $isExists);
77 77
 
78
-			if($isExists == 'true')
78
+			if ($isExists == 'true')
79 79
 			{
80 80
 				$type = 'XML';
81 81
 
82 82
 				$fp = fopen($realPath, "r");
83 83
 				$str = fgets($fp, 100);
84
-				if(stristr($str, 'tattertools')) $type = 'TTXML';
84
+				if (stristr($str, 'tattertools')) $type = 'TTXML';
85 85
 				fclose($fp);
86 86
 
87 87
 				$this->add('type', $type);
@@ -107,16 +107,16 @@  discard block
 block discarded – undo
107 107
 
108 108
 		/* DBMS가 CUBRID인 경우 MySQL과 동일한 방법으로는 문서 및 댓글에 대한 사용자 정보를 동기화 할 수 없으므로 예외 처리 합니다.
109 109
 		   CUBRID를 사용하지 않는 경우에만 보편적인 기존 질의문을 사용합니다. */
110
-		$db_info = Context::getDBInfo ();
111
-		if($db_info->db_type != "cubrid")
110
+		$db_info = Context::getDBInfo();
111
+		if ($db_info->db_type != "cubrid")
112 112
 		{
113 113
 			$output = executeQuery('importer.updateDocumentSync'.$postFix);
114 114
 			$output = executeQuery('importer.updateCommentSync'.$postFix);
115 115
 		}
116 116
 		else
117 117
 		{
118
-			$output = executeQueryArray ('importer.getDocumentMemberSrlWithUserID'.$postFix);
119
-			if(is_array ($output->data) && count ($output->data))
118
+			$output = executeQueryArray('importer.getDocumentMemberSrlWithUserID'.$postFix);
119
+			if (is_array($output->data) && count($output->data))
120 120
 			{
121 121
 				$success_count = 0;
122 122
 				$error_count = 0;
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 				{
126 126
 					$args->user_id = $val->user_id;
127 127
 					$args->member_srl = $val->member_srl;
128
-					$tmp = executeQuery ('importer.updateDocumentSyncForCUBRID'.$postFix, $args);
129
-					if($tmp->toBool () === true)
128
+					$tmp = executeQuery('importer.updateDocumentSyncForCUBRID'.$postFix, $args);
129
+					if ($tmp->toBool() === true)
130 130
 					{
131 131
 						$success_count++;
132 132
 					}
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 				}
139 139
 			} // documents section
140 140
 
141
-			$output = executeQueryArray ('importer.getCommentMemberSrlWithUserID'.$postFix);
142
-			if(is_array ($output->data) && count ($output->data))
141
+			$output = executeQueryArray('importer.getCommentMemberSrlWithUserID'.$postFix);
142
+			if (is_array($output->data) && count($output->data))
143 143
 			{
144 144
 				$success_count = 0;
145 145
 				$error_count = 0;
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
 				{
149 149
 					$args->user_id = $val->user_id;
150 150
 					$args->member_srl = $val->member_srl;
151
-					$tmp = executeQuery ('importer.updateCommentSyncForCUBRID'.$postFix, $args);
152
-					if($tmp->toBool () === true)
151
+					$tmp = executeQuery('importer.updateCommentSyncForCUBRID'.$postFix, $args);
152
+					if ($tmp->toBool() === true)
153 153
 					{
154 154
 						$success_count++;
155 155
 					}
@@ -178,15 +178,15 @@  discard block
 block discarded – undo
178 178
 		// Extract and cache information from the xml file
179 179
 		$oExtract = new extract();
180 180
 
181
-		switch($type)
181
+		switch ($type)
182 182
 		{
183 183
 			case 'member' :
184
-				$output = $oExtract->set($xml_file,'<members ', '</members>', '<member>', '</member>');
185
-				if($output->toBool()) $oExtract->saveItems();
184
+				$output = $oExtract->set($xml_file, '<members ', '</members>', '<member>', '</member>');
185
+				if ($output->toBool()) $oExtract->saveItems();
186 186
 				break;
187 187
 			case 'message' :
188
-				$output = $oExtract->set($xml_file,'<messages ', '</messages>', '<message>','</message>');
189
-				if($output->toBool()) $oExtract->saveItems();
188
+				$output = $oExtract->set($xml_file, '<messages ', '</messages>', '<message>', '</message>');
189
+				if ($output->toBool()) $oExtract->saveItems();
190 190
 				break;
191 191
 			case 'ttxml' :
192 192
 				// Category information
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
 					while (!feof($oExtract->fd))
200 200
 					{
201 201
 						$str = fgets($oExtract->fd, 1024);
202
-						if(strstr($str, '<category>'))
202
+						if (strstr($str, '<category>'))
203 203
 						{
204 204
 							$started = true;
205 205
 							$str = strstr($str, '<category>');
206 206
 						}
207
-						if(substr($str,0,strlen('<post ')) == '<post ') break;
207
+						if (substr($str, 0, strlen('<post ')) == '<post ') break;
208 208
 						if ($started) $buff .= $str;
209 209
 					}
210 210
 					$buff = '<categories>'.$buff.'</categories>';
@@ -214,22 +214,22 @@  discard block
 block discarded – undo
214 214
 
215 215
 					// Guestbook information
216 216
 					$output = $oExtract->set($xml_file, '', '', '', '');
217
-					if($output->toBool())
217
+					if ($output->toBool())
218 218
 					{
219 219
 						$started = false;
220 220
 						$buff = '';
221 221
 						while (!feof($oExtract->fd))
222 222
 						{
223 223
 							$str = fgets($oExtract->fd, 1024);
224
-							if(strstr($str, '<guestbook>'))
224
+							if (strstr($str, '<guestbook>'))
225 225
 							{
226 226
 								$started = true;
227 227
 								$str = strstr($str, '<guestbook>');
228 228
 							}
229
-							if($started)
229
+							if ($started)
230 230
 							{
231 231
 								$pos = strpos($str, '</guestbook>');
232
-								if($pos !== false)
232
+								if ($pos !== false)
233 233
 								{
234 234
 									$buff .= substr($str, 0, $pos + strlen('</guestbook>'));
235 235
 									break;
@@ -241,37 +241,37 @@  discard block
 block discarded – undo
241 241
 						$guestbook_filename = sprintf('%s/%s', $oExtract->cache_path, 'guestbook.xml');
242 242
 						FileHandler::writeFile($guestbook_filename, $buff);
243 243
 						// Individual items
244
-						$output = $oExtract->set($xml_file,'<blog', '</blog>', '<post ', '</post>');
245
-						if($output->toBool()) $oExtract->saveItems();
244
+						$output = $oExtract->set($xml_file, '<blog', '</blog>', '<post ', '</post>');
245
+						if ($output->toBool()) $oExtract->saveItems();
246 246
 					}
247 247
 				}
248 248
 				break;
249 249
 			default :
250 250
 				// First get category information
251
-				$output = $oExtract->set($xml_file,'<categories>', '</categories>', '<category','</category>');
252
-				if($output->toBool())
251
+				$output = $oExtract->set($xml_file, '<categories>', '</categories>', '<category', '</category>');
252
+				if ($output->toBool())
253 253
 				{
254 254
 					$oExtract->mergeItems('category.xml');
255 255
 					// Get each item
256
-					$output = $oExtract->set($xml_file,'<posts ', '</posts>', '<post>', '</post>');
257
-					if($output->toBool()) $oExtract->saveItems();
256
+					$output = $oExtract->set($xml_file, '<posts ', '</posts>', '<post>', '</post>');
257
+					if ($output->toBool()) $oExtract->saveItems();
258 258
 				}
259 259
 				break;
260 260
 		}
261 261
 
262
-		if(!$output->toBool())
262
+		if (!$output->toBool())
263 263
 		{
264
-			$this->add('error',0);
265
-			$this->add('status',-1);
264
+			$this->add('error', 0);
265
+			$this->add('status', -1);
266 266
 			$this->setMessage($output->getMessage());
267 267
 			return;
268 268
 		}
269 269
 		// Notify that all data completely extracted
270
-		$this->add('type',$type);
271
-		$this->add('total',$oExtract->getTotalCount());
272
-		$this->add('cur',0);
270
+		$this->add('type', $type);
271
+		$this->add('total', $oExtract->getTotalCount());
272
+		$this->add('cur', 0);
273 273
 		$this->add('key', $oExtract->getKey());
274
-		$this->add('status',0);
274
+		$this->add('status', 0);
275 275
 	}
276 276
 
277 277
 	/**
@@ -291,19 +291,19 @@  discard block
 block discarded – undo
291 291
 		$this->unit_count = Context::get('unit_count');
292 292
 		// Check if an index file exists
293 293
 		$index_file = './files/cache/importer/'.$key.'/index';
294
-		if(!file_exists($index_file)) return new BaseObject(-1, 'msg_invalid_xml_file');
294
+		if (!file_exists($index_file)) return new BaseObject(-1, 'msg_invalid_xml_file');
295 295
 
296
-		switch($type)
296
+		switch ($type)
297 297
 		{
298 298
 			case 'ttxml' :
299
-				if(!$target_module) return new BaseObject(-1,'msg_invalid_request');
299
+				if (!$target_module) return new BaseObject(-1, 'msg_invalid_request');
300 300
 
301 301
 				$oModuleModel = getModel('module');
302 302
 				$columnList = array('module_srl', 'module');
303 303
 				$target_module_info = $oModuleModel->getModuleInfoByModuleSrl($target_module, $columnList);
304 304
 
305
-				$ttimporter = FileHandler::exists(_XE_PATH_ . 'modules/importer/ttimport.class.php');
306
-				if($ttimporter) require_once($ttimporter);
305
+				$ttimporter = FileHandler::exists(_XE_PATH_.'modules/importer/ttimport.class.php');
306
+				if ($ttimporter) require_once($ttimporter);
307 307
 
308 308
 				$oTT = new ttimport();
309 309
 				$cur = $oTT->importModule($key, $cur, $index_file, $this->unit_count, $target_module, $guestbook_target_module, $user_id, $target_module_info->module);
@@ -316,23 +316,23 @@  discard block
 block discarded – undo
316 316
 				break;
317 317
 			case 'module' :
318 318
 				// Check if the target module exists
319
-				if(!$target_module) return new BaseObject(-1,'msg_invalid_request');
319
+				if (!$target_module) return new BaseObject(-1, 'msg_invalid_request');
320 320
 				$cur = $this->importModule($key, $cur, $index_file, $target_module);
321 321
 				break;
322 322
 		}
323 323
 		// Notify that all data completely extracted
324
-		$this->add('type',$type);
325
-		$this->add('total',$total);
326
-		$this->add('cur',$cur);
324
+		$this->add('type', $type);
325
+		$this->add('total', $total);
326
+		$this->add('cur', $cur);
327 327
 		$this->add('key', $key);
328 328
 		$this->add('target_module', $target_module);
329 329
 		// When completing, success message appears and remove the cache files
330
-		if($total <= $cur)
330
+		if ($total <= $cur)
331 331
 		{
332
-			$this->setMessage( sprintf(Context::getLang('msg_import_finished'), $cur, $total) );
332
+			$this->setMessage(sprintf(Context::getLang('msg_import_finished'), $cur, $total));
333 333
 			FileHandler::removeDir('./files/cache/importer/'.$key);
334 334
 		}
335
-		else $this->setMessage( sprintf(Context::getLang('msg_importing'), $total, $cur) );
335
+		else $this->setMessage(sprintf(Context::getLang('msg_importing'), $total, $cur));
336 336
 	}
337 337
 
338 338
 	/**
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 	 */
345 345
 	function importMember($key, $cur, $index_file)
346 346
 	{
347
-		if(!$cur) $cur = 0;
347
+		if (!$cur) $cur = 0;
348 348
 		// Create the xmlParser object
349 349
 		$oXmlParser = new XmlParser();
350 350
 		// Create objects for importing member information
@@ -357,30 +357,30 @@  discard block
 block discarded – undo
357 357
 		$oModuleModel = getModel('module');
358 358
 		$member_config = $oModuleModel->getModuleConfig('member');
359 359
 		// Open an index file
360
-		$f = fopen($index_file,"r");
360
+		$f = fopen($index_file, "r");
361 361
 		// Pass if already read
362
-		for($i=0;$i<$cur;$i++) fgets($f, 1024);
362
+		for ($i = 0; $i < $cur; $i++) fgets($f, 1024);
363 363
 		// Read by each line until the condition meets
364
-		for($idx=$cur;$idx<$cur+$this->unit_count;$idx++)
364
+		for ($idx = $cur; $idx < $cur + $this->unit_count; $idx++)
365 365
 		{
366
-			if(feof($f)) break;
366
+			if (feof($f)) break;
367 367
 			// Find a given location
368 368
 			$target_file = trim(fgets($f, 1024));
369 369
 			// Load and parse the file
370 370
 			$xmlObj = $oXmlParser->loadXmlFile($target_file);
371 371
 			FileHandler::removeFile($target_file);
372
-			if(!$xmlObj) continue;
372
+			if (!$xmlObj) continue;
373 373
 			// List Objects
374 374
 			$obj = new stdClass();
375 375
 			$obj->user_id = base64_decode($xmlObj->member->user_id->body);
376 376
 			$obj->password = base64_decode($xmlObj->member->password->body);
377 377
 			$obj->user_name = base64_decode($xmlObj->member->user_name->body);
378 378
 			$obj->nick_name = base64_decode($xmlObj->member->nick_name->body);
379
-			if(!$obj->user_name) $obj->user_name = $obj->nick_name;
379
+			if (!$obj->user_name) $obj->user_name = $obj->nick_name;
380 380
 			$obj->email = base64_decode($xmlObj->member->email->body);
381 381
 			$obj->homepage = base64_decode($xmlObj->member->homepage->body);
382 382
 			$obj->blog = base64_decode($xmlObj->member->blog->body);
383
-			$obj->birthday = substr(base64_decode($xmlObj->member->birthday->body),0,8);
383
+			$obj->birthday = substr(base64_decode($xmlObj->member->birthday->body), 0, 8);
384 384
 			$obj->allow_mailing = base64_decode($xmlObj->member->allow_mailing->body);
385 385
 			$obj->point = base64_decode($xmlObj->member->point->body);
386 386
 			$obj->image_nickname = base64_decode($xmlObj->member->image_nickname->buff->body);
@@ -390,26 +390,26 @@  discard block
 block discarded – undo
390 390
 			$obj->regdate = base64_decode($xmlObj->member->regdate->body);
391 391
 			$obj->last_login = base64_decode($xmlObj->member->last_login->body);
392 392
 
393
-			if($xmlObj->member->extra_vars)
393
+			if ($xmlObj->member->extra_vars)
394 394
 			{
395
-				foreach($xmlObj->member->extra_vars as $key => $val)
395
+				foreach ($xmlObj->member->extra_vars as $key => $val)
396 396
 				{
397
-					if(in_array($key, array('node_name','attrs','body'))) continue;
397
+					if (in_array($key, array('node_name', 'attrs', 'body'))) continue;
398 398
 					$obj->extra_vars->{$key} = base64_decode($val->body);
399 399
 				}
400 400
 			}
401 401
 			// Create url for homepage and blog
402
-			if($obj->homepage && strncasecmp('http://', $obj->homepage, 7) !== 0 && strncasecmp('https://', $obj->homepage, 8) !== 0) $obj->homepage = 'http://'.$obj->homepage;
402
+			if ($obj->homepage && strncasecmp('http://', $obj->homepage, 7) !== 0 && strncasecmp('https://', $obj->homepage, 8) !== 0) $obj->homepage = 'http://'.$obj->homepage;
403 403
 			// email address column
404 404
 			$obj->email_address = $obj->email;
405 405
 			list($obj->email_id, $obj->email_host) = explode('@', $obj->email);
406 406
 			// Set the mailing option
407
-			if($obj->allow_mailing!='Y') $obj->allow_mailing = 'N';
407
+			if ($obj->allow_mailing != 'Y') $obj->allow_mailing = 'N';
408 408
 			// Set the message option
409 409
 			$obj->allow_message = 'Y';
410
-			if(!in_array($obj->allow_message, array('Y','N','F'))) $obj->allow_message= 'Y';
410
+			if (!in_array($obj->allow_message, array('Y', 'N', 'F'))) $obj->allow_message = 'Y';
411 411
 			// Get member-join date if the last login time is not found
412
-			if(!$obj->last_login) $obj->last_login = $obj->regdate;
412
+			if (!$obj->last_login) $obj->last_login = $obj->regdate;
413 413
 			// Get a member_srl
414 414
 			$obj->member_srl = getNextSequence();
415 415
 			$obj->list_order = -1 * $obj->member_srl;
@@ -421,63 +421,63 @@  discard block
 block discarded – undo
421 421
 			$nick_args = new stdClass;
422 422
 			$nick_args->nick_name = $obj->nick_name;
423 423
 			$nick_output = executeQuery('member.getMemberSrl', $nick_args);
424
-			if(!$nick_output->toBool()) $obj->nick_name .= '_'.$obj->member_srl;
424
+			if (!$nick_output->toBool()) $obj->nick_name .= '_'.$obj->member_srl;
425 425
 			// Add a member
426 426
 			$output = executeQuery('member.insertMember', $obj);
427 427
 
428
-			if($output->toBool() && !($obj->password))
428
+			if ($output->toBool() && !($obj->password))
429 429
 			{
430 430
 				// Send a mail telling the user to reset his password.
431 431
 				$oMail = new Mail();
432
-				$oMail->setTitle("Password update for your " . getFullSiteUrl() . " account");
433
-				$webmaster_name = $member_config->webmaster_name?$member_config->webmaster_name:'Webmaster';
432
+				$oMail->setTitle("Password update for your ".getFullSiteUrl()." account");
433
+				$webmaster_name = $member_config->webmaster_name ? $member_config->webmaster_name : 'Webmaster';
434 434
 				$oMail->setContent("Dear $obj->user_name, <br /><br />
435 435
 						We recently migrated our phpBB forum to XpressEngine. Since you password was encrypted we could not migrate it too, so please reset it by following this link:
436
-						<a href='" . getFullSiteUrl() . "/?act=dispMemberFindAccount' >" . getFullSiteUrl() . "?act=dispMemberFindAccount</a>. You need to enter you email address and hit the 'Find account' button. You will then receive an email with a new, generated password that you can change after login. <br /><br />
436
+						<a href='".getFullSiteUrl()."/?act=dispMemberFindAccount' >".getFullSiteUrl()."?act=dispMemberFindAccount</a>. You need to enter you email address and hit the 'Find account' button. You will then receive an email with a new, generated password that you can change after login. <br /><br />
437 437
 
438 438
 						Thank you for your understanding,<br />
439 439
 						{$webmaster_name}"
440 440
 				);
441 441
 				$oMail->setSender($webmaster_name, $member_config->webmaster_email);
442
-				$oMail->setReceiptor( $obj->user_name, $obj->email);
442
+				$oMail->setReceiptor($obj->user_name, $obj->email);
443 443
 				$oMail->send();
444 444
 			}
445 445
 
446 446
 			// add group join/image name-mark-signiture and so on if a new member successfully added
447
-			if($output->toBool())
447
+			if ($output->toBool())
448 448
 			{
449 449
 				// Join to the default group
450 450
 				$obj->group_srl = $default_group_srl;
451
-				executeQuery('member.addMemberToGroup',$obj);
451
+				executeQuery('member.addMemberToGroup', $obj);
452 452
 				// Image name
453
-				if($obj->image_nickname)
453
+				if ($obj->image_nickname)
454 454
 				{
455 455
 					$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($obj->member_srl));
456 456
 					$target_filename = sprintf('%s%d.gif', $target_path, $obj->member_srl);
457 457
 					FileHandler::writeFile($target_filename, $obj->image_nickname);
458 458
 				}
459 459
 				// Image mark
460
-				if($obj->image_mark && file_exists($obj->image_mark))
460
+				if ($obj->image_mark && file_exists($obj->image_mark))
461 461
 				{
462 462
 					$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($obj->member_srl));
463 463
 					$target_filename = sprintf('%s%d.gif', $target_path, $obj->member_srl);
464 464
 					FileHandler::writeFile($target_filename, $obj->image_mark);
465 465
 				}
466 466
 				// Profile image
467
-				if($obj->profile_image)
467
+				if ($obj->profile_image)
468 468
 				{
469 469
 					$target_path = sprintf('files/member_extra_info/profile_image/%s/', getNumberingPath($obj->member_srl));
470 470
 					$target_filename = sprintf('%s%d.gif', $target_path, $obj->member_srl);
471 471
 					FileHandler::writeFile($target_filename, $obj->profile_image);
472 472
 				}
473 473
 				// Signiture
474
-				if($obj->signature)
474
+				if ($obj->signature)
475 475
 				{
476 476
 					$signature = removeHackTag($obj->signature);
477 477
 					$signature_buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
478 478
 
479 479
 					$target_path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($obj->member_srl));
480
-					if(!is_dir($target_path)) FileHandler::makeDir($target_path);
480
+					if (!is_dir($target_path)) FileHandler::makeDir($target_path);
481 481
 					$target_filename = sprintf('%s%d.signature.php', $target_path, $obj->member_srl);
482 482
 
483 483
 					FileHandler::writeFile($target_filename, $signature_buff);
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 
488 488
 		fclose($f);
489 489
 
490
-		return $idx-1;
490
+		return $idx - 1;
491 491
 	}
492 492
 
493 493
 	/**
@@ -499,58 +499,58 @@  discard block
 block discarded – undo
499 499
 	 */
500 500
 	function importMessage($key, $cur, $index_file)
501 501
 	{
502
-		if(!$cur) $cur = 0;
502
+		if (!$cur) $cur = 0;
503 503
 		// Create the xmlParser object
504 504
 		$oXmlParser = new XmlParser();
505 505
 		// Open an index file
506
-		$f = fopen($index_file,"r");
506
+		$f = fopen($index_file, "r");
507 507
 		// Pass if already read
508
-		for($i=0;$i<$cur;$i++) fgets($f, 1024);
508
+		for ($i = 0; $i < $cur; $i++) fgets($f, 1024);
509 509
 		// Read each line until the condition meets
510
-		for($idx=$cur;$idx<$cur+$this->unit_count;$idx++)
510
+		for ($idx = $cur; $idx < $cur + $this->unit_count; $idx++)
511 511
 		{
512
-			if(feof($f)) break;
512
+			if (feof($f)) break;
513 513
 			// Find a location
514 514
 			$target_file = trim(fgets($f, 1024));
515 515
 			// Load and parse the file
516 516
 			$xmlObj = $oXmlParser->loadXmlFile($target_file);
517 517
 			FileHandler::removeFile($target_file);
518
-			if(!$xmlObj) continue;
518
+			if (!$xmlObj) continue;
519 519
 			// List objects
520 520
 			$obj = null;
521 521
 			$obj->receiver = base64_decode($xmlObj->message->receiver->body);
522 522
 			$obj->sender = base64_decode($xmlObj->message->sender->body);
523 523
 			$obj->title = base64_decode($xmlObj->message->title->body);
524 524
 			$obj->content = base64_decode($xmlObj->message->content->body);
525
-			$obj->readed = base64_decode($xmlObj->message->readed->body)=='Y'?'Y':'N';
525
+			$obj->readed = base64_decode($xmlObj->message->readed->body) == 'Y' ? 'Y' : 'N';
526 526
 			$obj->regdate = base64_decode($xmlObj->message->regdate->body);
527 527
 			$obj->readed_date = base64_decode($xmlObj->message->readed_date->body);
528 528
 			// Get member_srl of sender/recipient (If not exists, pass)
529
-			if(!$obj->sender) continue;
529
+			if (!$obj->sender) continue;
530 530
 			$sender_args->user_id = $obj->sender;
531
-			$sender_output = executeQuery('member.getMemberInfo',$sender_args);
531
+			$sender_output = executeQuery('member.getMemberInfo', $sender_args);
532 532
 			$sender_srl = $sender_output->data->member_srl;
533
-			if(!$sender_srl)
533
+			if (!$sender_srl)
534 534
 			{
535 535
 				unset($sender_args);
536 536
 				$sender_args->email_address = $obj->sender;
537
-				$sender_output = executeQuery('member.getMemberInfoByEmailAddress',$sender_args);
537
+				$sender_output = executeQuery('member.getMemberInfoByEmailAddress', $sender_args);
538 538
 				$sender_srl = $sender_output->data->member_srl;
539 539
 			}
540
-			if(!$sender_srl) continue;
540
+			if (!$sender_srl) continue;
541 541
 
542 542
 			$receiver_args->user_id = $obj->receiver;
543
-			if(!$obj->receiver) continue;
544
-			$receiver_output = executeQuery('member.getMemberInfo',$receiver_args);
543
+			if (!$obj->receiver) continue;
544
+			$receiver_output = executeQuery('member.getMemberInfo', $receiver_args);
545 545
 			$receiver_srl = $receiver_output->data->member_srl;
546
-			if(!$receiver_srl)
546
+			if (!$receiver_srl)
547 547
 			{
548 548
 				unset($receiver_args);
549 549
 				$receiver_args->email_address = $obj->receiver;
550
-				$receiver_output = executeQuery('member.getMemberInfoByEmailAddress',$receiver_args);
550
+				$receiver_output = executeQuery('member.getMemberInfoByEmailAddress', $receiver_args);
551 551
 				$receiver_srl = $receiver_output->data->member_srl;
552 552
 			}
553
-			if(!$receiver_srl) continue;
553
+			if (!$receiver_srl) continue;
554 554
 			// Message to save into sender's message box
555 555
 			$sender_args->sender_srl = $sender_srl;
556 556
 			$sender_args->receiver_srl = $receiver_srl;
@@ -565,13 +565,13 @@  discard block
 block discarded – undo
565 565
 			$sender_args->list_order = $sender_args->message_srl * -1;
566 566
 
567 567
 			$output = executeQuery('communication.sendMessage', $sender_args);
568
-			if($output->toBool())
568
+			if ($output->toBool())
569 569
 			{
570 570
 				// Message to save into recipient's massage box
571 571
 				$receiver_args->message_srl = $sender_args->related_srl;
572
-				$receiver_args->list_order = $sender_args->related_srl*-1;
572
+				$receiver_args->list_order = $sender_args->related_srl * -1;
573 573
 				$receiver_args->sender_srl = $sender_srl;
574
-				if(!$receiver_args->sender_srl) $receiver_args->sender_srl = $receiver_srl;
574
+				if (!$receiver_args->sender_srl) $receiver_args->sender_srl = $receiver_srl;
575 575
 				$receiver_args->receiver_srl = $receiver_srl;
576 576
 				$receiver_args->message_type = 'R';
577 577
 				$receiver_args->title = $obj->title;
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 
586 586
 		fclose($f);
587 587
 
588
-		return $idx-1;
588
+		return $idx - 1;
589 589
 	}
590 590
 
591 591
 	/**
@@ -605,10 +605,10 @@  discard block
 block discarded – undo
605 605
 		$oDocumentModel = getModel('document');
606 606
 		$category_list = $category_titles = array();
607 607
 		$category_list = $oDocumentModel->getCategoryList($module_srl);
608
-		if(count($category_list)) foreach($category_list as $key => $val) $category_titles[$val->title] = $val->category_srl;
608
+		if (count($category_list)) foreach ($category_list as $key => $val) $category_titles[$val->title] = $val->category_srl;
609 609
 		// Extract category information
610 610
 		$category_file = preg_replace('/index$/i', 'category.xml', $index_file);
611
-		if(file_exists($category_file))
611
+		if (file_exists($category_file))
612 612
 		{
613 613
 			$buff = FileHandler::readFile($category_file);
614 614
 
@@ -616,14 +616,14 @@  discard block
 block discarded – undo
616 616
 			$xmlDoc = $this->oXmlParser->loadXmlFile($category_file);
617 617
 
618 618
 			$categories = $xmlDoc->items->category;
619
-			if($categories)
619
+			if ($categories)
620 620
 			{
621
-				if(!is_array($categories)) $categories = array($categories);
621
+				if (!is_array($categories)) $categories = array($categories);
622 622
 				$match_sequence = array();
623
-				foreach($categories as $k => $v)
623
+				foreach ($categories as $k => $v)
624 624
 				{
625 625
 					$category = trim(base64_decode($v->body));
626
-					if(!$category || $category_titles[$category]) continue;
626
+					if (!$category || $category_titles[$category]) continue;
627 627
 
628 628
 					$sequence = $v->attrs->sequence;
629 629
 					$parent = $v->attrs->parent;
@@ -631,10 +631,10 @@  discard block
 block discarded – undo
631 631
 					$obj = null;
632 632
 					$obj->title = $category;
633 633
 					$obj->module_srl = $module_srl;
634
-					if($parent) $obj->parent_srl = $match_sequence[$parent];
634
+					if ($parent) $obj->parent_srl = $match_sequence[$parent];
635 635
 
636 636
 					$output = $oDocumentController->insertCategory($obj);
637
-					if($output->toBool()) $match_sequence[$sequence] = $output->get('category_srl');
637
+					if ($output->toBool()) $match_sequence[$sequence] = $output->get('category_srl');
638 638
 				}
639 639
 				$oDocumentController = getController('document');
640 640
 				$oDocumentController->makeCategoryFile($module_srl);
@@ -644,31 +644,31 @@  discard block
 block discarded – undo
644 644
 
645 645
 		$category_list = $category_titles = array();
646 646
 		$category_list = $oDocumentModel->getCategoryList($module_srl);
647
-		if(count($category_list)) foreach($category_list as $key => $val) $category_titles[$val->title] = $val->category_srl;
647
+		if (count($category_list)) foreach ($category_list as $key => $val) $category_titles[$val->title] = $val->category_srl;
648 648
 
649 649
 		$ek_args->module_srl = $module_srl;
650 650
 		$output = executeQueryArray('document.getDocumentExtraKeys', $ek_args);
651
-		if($output->data)
651
+		if ($output->data)
652 652
 		{
653
-			foreach($output->data as $key => $val) $extra_keys[$val->eid] = true;
653
+			foreach ($output->data as $key => $val) $extra_keys[$val->eid] = true;
654 654
 		}
655 655
 
656
-		if(!$cur) $cur = 0;
656
+		if (!$cur) $cur = 0;
657 657
 		// Open an index file
658
-		$f = fopen($index_file,"r");
658
+		$f = fopen($index_file, "r");
659 659
 		// Pass if already read
660
-		for($i=0;$i<$cur;$i++) fgets($f, 1024);
660
+		for ($i = 0; $i < $cur; $i++) fgets($f, 1024);
661 661
 		// Read each line until the condition meets
662
-		for($idx=$cur;$idx<$cur+$this->unit_count;$idx++)
662
+		for ($idx = $cur; $idx < $cur + $this->unit_count; $idx++)
663 663
 		{
664
-			if(feof($f)) break;
664
+			if (feof($f)) break;
665 665
 			// Find a location
666 666
 			$target_file = trim(fgets($f, 1024));
667 667
 
668
-			if(!file_exists($target_file)) continue;
668
+			if (!file_exists($target_file)) continue;
669 669
 			// Importing data from now on
670
-			$fp = fopen($target_file,"r");
671
-			if(!$fp) continue;
670
+			$fp = fopen($target_file, "r");
671
+			if (!$fp) continue;
672 672
 
673 673
 			$obj = new stdClass;
674 674
 			$obj->module_srl = $module_srl;
@@ -680,51 +680,51 @@  discard block
 block discarded – undo
680 680
 			$started = false;
681 681
 			$buff = array();
682 682
 			// Start from the body data
683
-			while(!feof($fp))
683
+			while (!feof($fp))
684 684
 			{
685 685
 				$str = fgets($fp, 1024);
686 686
 				// Prepare an item
687
-				if(trim($str) == '<post>')
687
+				if (trim($str) == '<post>')
688 688
 				{
689 689
 					$started = true;
690 690
 					// Trackback inserted
691 691
 				}
692
-				else if(substr($str,0,11) == '<trackbacks')
692
+				else if (substr($str, 0, 11) == '<trackbacks')
693 693
 				{
694 694
 					$obj->trackback_count = $this->importTrackbacks($fp, $module_srl, $obj->document_srl);
695 695
 					continue;
696 696
 					// Comments inserted
697 697
 				}
698
-				else if(substr($str,0,9) == '<comments')
698
+				else if (substr($str, 0, 9) == '<comments')
699 699
 				{
700 700
 					$obj->comment_count = $this->importComments($fp, $module_srl, $obj->document_srl);
701 701
 					continue;
702 702
 					// Attachment inserted
703 703
 				}
704
-				else if(substr($str,0,9) == '<attaches')
704
+				else if (substr($str, 0, 9) == '<attaches')
705 705
 				{
706 706
 					$obj->uploaded_count = $this->importAttaches($fp, $module_srl, $obj->document_srl, $files);
707 707
 					continue;
708 708
 					// When starting extra variabls
709 709
 				}
710
-				elseif(trim($str) == '<extra_vars>')
710
+				elseif (trim($str) == '<extra_vars>')
711 711
 				{
712 712
 					$extra_vars = $this->importExtraVars($fp);
713 713
 					continue;
714 714
 				}
715 715
 
716
-				if($started) $buff[] = $str;
716
+				if ($started) $buff[] = $str;
717 717
 			}
718 718
 
719 719
 			$xmlDoc = $this->oXmlParser->parse(implode('', $buff));
720 720
 
721 721
 			$category = base64_decode($xmlDoc->post->category->body);
722
-			if($category_titles[$category]) $obj->category_srl = $category_titles[$category];
722
+			if ($category_titles[$category]) $obj->category_srl = $category_titles[$category];
723 723
 
724 724
 			$obj->member_srl = 0;
725 725
 
726
-			$obj->is_notice = base64_decode($xmlDoc->post->is_notice->body)=='Y'?'Y':'N';
727
-			$obj->status = base64_decode($xmlDoc->post->is_secret->body)=='Y'?$oDocumentModel->getConfigStatus('secret'):$oDocumentModel->getConfigStatus('public');
726
+			$obj->is_notice = base64_decode($xmlDoc->post->is_notice->body) == 'Y' ? 'Y' : 'N';
727
+			$obj->status = base64_decode($xmlDoc->post->is_secret->body) == 'Y' ? $oDocumentModel->getConfigStatus('secret') : $oDocumentModel->getConfigStatus('public');
728 728
 			$obj->title = base64_decode($xmlDoc->post->title->body);
729 729
 			$obj->content = base64_decode($xmlDoc->post->content->body);
730 730
 			$obj->readed_count = base64_decode($xmlDoc->post->readed_count->body);
@@ -733,39 +733,39 @@  discard block
 block discarded – undo
733 733
 			$obj->password = base64_decode($xmlDoc->post->password->body);
734 734
 			$obj->user_name = base64_decode($xmlDoc->post->user_name->body);
735 735
 			$obj->nick_name = base64_decode($xmlDoc->post->nick_name->body);
736
-			if(!$obj->user_name) $obj->user_name = $obj->nick_name;
736
+			if (!$obj->user_name) $obj->user_name = $obj->nick_name;
737 737
 			$obj->user_id = base64_decode($xmlDoc->post->user_id->body);
738 738
 			$obj->email_address = base64_decode($xmlDoc->post->email->body);
739 739
 			$obj->homepage = base64_decode($xmlDoc->post->homepage->body);
740
-			if($obj->homepage && strncasecmp('http://', $obj->homepage, 7) !== 0 && strncasecmp('https://', $obj->homepage, 8) !== 0) $obj->homepage = 'http://'.$obj->homepage;
740
+			if ($obj->homepage && strncasecmp('http://', $obj->homepage, 7) !== 0 && strncasecmp('https://', $obj->homepage, 8) !== 0) $obj->homepage = 'http://'.$obj->homepage;
741 741
 			$obj->tags = base64_decode($xmlDoc->post->tags->body);
742 742
 			$obj->regdate = base64_decode($xmlDoc->post->regdate->body);
743 743
 			$obj->last_update = base64_decode($xmlDoc->post->update->body);
744 744
 			$obj->last_updater = base64_decode($xmlDoc->post->last_updater->body);
745
-			if(!$obj->last_update) $obj->last_update = $obj->regdate;
745
+			if (!$obj->last_update) $obj->last_update = $obj->regdate;
746 746
 			$obj->ipaddress = base64_decode($xmlDoc->post->ipaddress->body);
747
-			$obj->list_order = $obj->update_order = $obj->document_srl*-1;
748
-			$obj->commentStatus = base64_decode($xmlDoc->post->allow_comment->body)!='N'?'ALLOW':'DENY';
749
-			$obj->allow_trackback = base64_decode($xmlDoc->post->allow_trackback->body)!='N'?'Y':'N';
747
+			$obj->list_order = $obj->update_order = $obj->document_srl * -1;
748
+			$obj->commentStatus = base64_decode($xmlDoc->post->allow_comment->body) != 'N' ? 'ALLOW' : 'DENY';
749
+			$obj->allow_trackback = base64_decode($xmlDoc->post->allow_trackback->body) != 'N' ? 'Y' : 'N';
750 750
 			$obj->notify_message = base64_decode($xmlDoc->post->is_notice->body);
751 751
 			// Change content information (attachment)
752
-			if(count($files))
752
+			if (count($files))
753 753
 			{
754
-				foreach($files as $key => $val)
754
+				foreach ($files as $key => $val)
755 755
 				{
756
-					$obj->content = preg_replace('/(src|href)\=(["\']?)'.preg_quote($key).'(["\']?)/i','$1="'.$val.'"',$obj->content);
757
-					$obj->content = preg_replace('/(["\']?).\/files\/(.+)\/'.preg_quote($key).'([^"\']+)(["\']?)/i','"'.$val.'"',$obj->content);
758
-					$obj->content = preg_replace('/(["\']?)files\/(.+)\/'.preg_quote($key).'([^"\']+)(["\']?)/i','"'.$val.'"',$obj->content);
756
+					$obj->content = preg_replace('/(src|href)\=(["\']?)'.preg_quote($key).'(["\']?)/i', '$1="'.$val.'"', $obj->content);
757
+					$obj->content = preg_replace('/(["\']?).\/files\/(.+)\/'.preg_quote($key).'([^"\']+)(["\']?)/i', '"'.$val.'"', $obj->content);
758
+					$obj->content = preg_replace('/(["\']?)files\/(.+)\/'.preg_quote($key).'([^"\']+)(["\']?)/i', '"'.$val.'"', $obj->content);
759 759
 				}
760 760
 			}
761 761
 
762 762
 			$output = executeQuery('document.insertDocument', $obj);
763 763
 
764
-			if($output->toBool() && $obj->tags)
764
+			if ($output->toBool() && $obj->tags)
765 765
 			{
766
-				$tag_list = explode(',',$obj->tags);
766
+				$tag_list = explode(',', $obj->tags);
767 767
 				$tag_count = count($tag_list);
768
-				for($i=0;$i<$tag_count;$i++)
768
+				for ($i = 0; $i < $tag_count; $i++)
769 769
 				{
770 770
 					$args = new stdClass;
771 771
 					$args->tag_srl = getNextSequence();
@@ -773,17 +773,17 @@  discard block
 block discarded – undo
773 773
 					$args->document_srl = $obj->document_srl;
774 774
 					$args->tag = trim($tag_list[$i]);
775 775
 					$args->regdate = $obj->regdate;
776
-					if(!$args->tag) continue;
776
+					if (!$args->tag) continue;
777 777
 					$output = executeQuery('tag.insertTag', $args);
778 778
 				}
779 779
 
780 780
 			}
781 781
 			// Add extra variables
782
-			if(count($extra_vars))
782
+			if (count($extra_vars))
783 783
 			{
784
-				foreach($extra_vars as $key => $val)
784
+				foreach ($extra_vars as $key => $val)
785 785
 				{
786
-					if(!$val->value) continue;
786
+					if (!$val->value) continue;
787 787
 					unset($e_args);
788 788
 					$e_args->module_srl = $module_srl;
789 789
 					$e_args->document_srl = $obj->document_srl;
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 					$e_args->lang_code = $val->lang_code;
793 793
 					$e_args->eid = $val->eid;
794 794
 					// Create a key for extra vars if not exists (except vars for title and content)
795
-					if(!preg_match('/^(title|content)_(.+)$/i',$e_args->eid) && !$extra_keys[$e_args->eid])
795
+					if (!preg_match('/^(title|content)_(.+)$/i', $e_args->eid) && !$extra_keys[$e_args->eid])
796 796
 					{
797 797
 						unset($ek_args);
798 798
 						$ek_args->module_srl = $module_srl;
@@ -816,9 +816,9 @@  discard block
 block discarded – undo
816 816
 
817 817
 		fclose($f);
818 818
 		// Sync category counts
819
-		if(count($category_list)) foreach($category_list as $key => $val) $oDocumentController->updateCategoryCount($module_srl, $val->category_srl);
819
+		if (count($category_list)) foreach ($category_list as $key => $val) $oDocumentController->updateCategoryCount($module_srl, $val->category_srl);
820 820
 
821
-		return $idx-1;
821
+		return $idx - 1;
822 822
 	}
823 823
 
824 824
 	/**
@@ -834,17 +834,17 @@  discard block
 block discarded – undo
834 834
 		$buff = null;
835 835
 		$cnt = 0;
836 836
 
837
-		while(!feof($fp))
837
+		while (!feof($fp))
838 838
 		{
839 839
 			$str = fgets($fp, 1024);
840 840
 			// If </trackbacks> is, break
841
-			if(trim($str) == '</trackbacks>') break;
841
+			if (trim($str) == '</trackbacks>') break;
842 842
 			// If <trackback>, start importing
843
-			if(trim($str) == '<trackback>') $started = true;
843
+			if (trim($str) == '<trackback>') $started = true;
844 844
 
845
-			if($started) $buff .= $str;
845
+			if ($started) $buff .= $str;
846 846
 			// If </trackback>, insert to the DB
847
-			if(trim($str) == '</trackback>')
847
+			if (trim($str) == '</trackback>')
848 848
 			{
849 849
 				$xmlDoc = $this->oXmlParser->parse($buff);
850 850
 
@@ -858,9 +858,9 @@  discard block
 block discarded – undo
858 858
 				$obj->excerpt = base64_decode($xmlDoc->trackback->excerpt->body);
859 859
 				$obj->regdate = base64_decode($xmlDoc->trackback->regdate->body);
860 860
 				$obj->ipaddress = base64_decode($xmlDoc->trackback->ipaddress->body);
861
-				$obj->list_order = -1*$obj->trackback_srl;
861
+				$obj->list_order = -1 * $obj->trackback_srl;
862 862
 				$output = executeQuery('trackback.insertTrackback', $obj);
863
-				if($output->toBool()) $cnt++;
863
+				if ($output->toBool()) $cnt++;
864 864
 
865 865
 				$buff = null;
866 866
 				$started = false;
@@ -884,13 +884,13 @@  discard block
 block discarded – undo
884 884
 
885 885
 		$sequences = array();
886 886
 
887
-		while(!feof($fp))
887
+		while (!feof($fp))
888 888
 		{
889 889
 			$str = fgets($fp, 1024);
890 890
 			// If </comments> is, break
891
-			if(trim($str) == '</comments>') break;
891
+			if (trim($str) == '</comments>') break;
892 892
 			// If <comment> is, start importing
893
-			if(trim($str) == '<comment>')
893
+			if (trim($str) == '<comment>')
894 894
 			{
895 895
 				$started = true;
896 896
 				$obj = new stdClass;
@@ -898,15 +898,15 @@  discard block
 block discarded – undo
898 898
 				$files = array();
899 899
 			}
900 900
 			// If <attaches is, start importing attachments
901
-			if(substr($str,0,9) == '<attaches')
901
+			if (substr($str, 0, 9) == '<attaches')
902 902
 			{
903 903
 				$obj->uploaded_count = $this->importAttaches($fp, $module_srl, $obj->comment_srl, $files);
904 904
 				continue;
905 905
 			}
906 906
 
907
-			if($started) $buff .= $str;
907
+			if ($started) $buff .= $str;
908 908
 			// If </comment> is, insert to the DB
909
-			if(trim($str) == '</comment>')
909
+			if (trim($str) == '</comment>')
910 910
 			{
911 911
 				$xmlDoc = $this->oXmlParser->parse($buff);
912 912
 
@@ -916,35 +916,35 @@  discard block
 block discarded – undo
916 916
 
917 917
 				$obj->module_srl = $module_srl;
918 918
 
919
-				if($parent) $obj->parent_srl = $sequences[$parent];
919
+				if ($parent) $obj->parent_srl = $sequences[$parent];
920 920
 				else $obj->parent_srl = 0;
921 921
 
922 922
 				$obj->document_srl = $document_srl;
923
-				$obj->is_secret = base64_decode($xmlDoc->comment->is_secret->body)=='Y'?'Y':'N';
924
-				$obj->notify_message = base64_decode($xmlDoc->comment->notify_message->body)=='Y'?'Y':'N';
923
+				$obj->is_secret = base64_decode($xmlDoc->comment->is_secret->body) == 'Y' ? 'Y' : 'N';
924
+				$obj->notify_message = base64_decode($xmlDoc->comment->notify_message->body) == 'Y' ? 'Y' : 'N';
925 925
 				$obj->content = base64_decode($xmlDoc->comment->content->body);
926 926
 				$obj->voted_count = base64_decode($xmlDoc->comment->voted_count->body);
927 927
 				$obj->blamed_count = base64_decode($xmlDoc->comment->blamed_count->body);
928 928
 				$obj->password = base64_decode($xmlDoc->comment->password->body);
929
-				$obj->user_name =base64_decode($xmlDoc->comment->user_name->body);
929
+				$obj->user_name = base64_decode($xmlDoc->comment->user_name->body);
930 930
 				$obj->nick_name = base64_decode($xmlDoc->comment->nick_name->body);
931
-				if(!$obj->user_name) $obj->user_name = $obj->nick_name;
931
+				if (!$obj->user_name) $obj->user_name = $obj->nick_name;
932 932
 				$obj->user_id = base64_decode($xmlDoc->comment->user_id->body);
933 933
 				$obj->member_srl = 0;
934 934
 				$obj->email_address = base64_decode($xmlDoc->comment->email->body);
935 935
 				$obj->homepage = base64_decode($xmlDoc->comment->homepage->body);
936 936
 				$obj->regdate = base64_decode($xmlDoc->comment->regdate->body);
937 937
 				$obj->last_update = base64_decode($xmlDoc->comment->update->body);
938
-				if(!$obj->last_update) $obj->last_update = $obj->regdate;
938
+				if (!$obj->last_update) $obj->last_update = $obj->regdate;
939 939
 				$obj->ipaddress = base64_decode($xmlDoc->comment->ipaddress->body);
940
-				$obj->status = base64_decode($xmlDoc->comment->status->body)==''?'1':base64_decode($xmlDoc->comment->status->body);
941
-				$obj->list_order = $obj->comment_srl*-1;
940
+				$obj->status = base64_decode($xmlDoc->comment->status->body) == '' ? '1' : base64_decode($xmlDoc->comment->status->body);
941
+				$obj->list_order = $obj->comment_srl * -1;
942 942
 				// Change content information (attachment)
943
-				if(count($files))
943
+				if (count($files))
944 944
 				{
945
-					foreach($files as $key => $val)
945
+					foreach ($files as $key => $val)
946 946
 					{
947
-						$obj->content = preg_replace('/(src|href)\=(["\']?)'.preg_quote($key).'(["\']?)/i','$1="'.$val.'"',$obj->content);
947
+						$obj->content = preg_replace('/(src|href)\=(["\']?)'.preg_quote($key).'(["\']?)/i', '$1="'.$val.'"', $obj->content);
948 948
 					}
949 949
 				}
950 950
 				// Comment list first
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 				$list_args->module_srl = $obj->module_srl;
955 955
 				$list_args->regdate = $obj->regdate;
956 956
 				// Set data directly if parent comment doesn't exist
957
-				if(!$obj->parent_srl)
957
+				if (!$obj->parent_srl)
958 958
 				{
959 959
 					$list_args->head = $list_args->arrange = $obj->comment_srl;
960 960
 					$list_args->depth = 0;
@@ -966,25 +966,25 @@  discard block
 block discarded – undo
966 966
 					$parent_args->comment_srl = $obj->parent_srl;
967 967
 					$parent_output = executeQuery('comment.getCommentListItem', $parent_args);
968 968
 					// Return if parent comment doesn't exist
969
-					if(!$parent_output->toBool() || !$parent_output->data) continue;
969
+					if (!$parent_output->toBool() || !$parent_output->data) continue;
970 970
 					$parent = $parent_output->data;
971 971
 
972 972
 					$list_args->head = $parent->head;
973
-					$list_args->depth = $parent->depth+1;
974
-					if($list_args->depth<2) $list_args->arrange = $obj->comment_srl;
973
+					$list_args->depth = $parent->depth + 1;
974
+					if ($list_args->depth < 2) $list_args->arrange = $obj->comment_srl;
975 975
 					else
976 976
 					{
977 977
 						$list_args->arrange = $parent->arrange;
978 978
 						$output = executeQuery('comment.updateCommentListArrange', $list_args);
979
-						if(!$output->toBool()) return $output;
979
+						if (!$output->toBool()) return $output;
980 980
 					}
981 981
 				}
982 982
 
983 983
 				$output = executeQuery('comment.insertCommentList', $list_args);
984
-				if($output->toBool())
984
+				if ($output->toBool())
985 985
 				{
986 986
 					$output = executeQuery('comment.insertComment', $obj);
987
-					if($output->toBool()) $cnt++;
987
+					if ($output->toBool()) $cnt++;
988 988
 				}
989 989
 
990 990
 				$buff = null;
@@ -1010,13 +1010,13 @@  discard block
 block discarded – undo
1010 1010
 		$buff = null;
1011 1011
 
1012 1012
 		$file_obj = new stdClass;
1013
-		while(!feof($fp))
1013
+		while (!feof($fp))
1014 1014
 		{
1015 1015
 			$str = trim(fgets($fp, 1024));
1016 1016
 			// If it ends with </attaches>, break
1017
-			if(trim($str) == '</attaches>') break;
1017
+			if (trim($str) == '</attaches>') break;
1018 1018
 			// If it starts with <attach>, collect attachments
1019
-			if(trim($str) == '<attach>')
1019
+			if (trim($str) == '<attach>')
1020 1020
 			{
1021 1021
 				$file_obj->file_srl = getNextSequence();
1022 1022
 				$file_obj->upload_target_srl = $upload_target_srl;
@@ -1026,26 +1026,26 @@  discard block
 block discarded – undo
1026 1026
 				$buff = null;
1027 1027
 				// If it starts with <file>, handle the attachement in xml file
1028 1028
 			}
1029
-			else if(trim($str) == '<file>')
1029
+			else if (trim($str) == '<file>')
1030 1030
 			{
1031 1031
 				$file_obj->file = $this->saveTemporaryFile($fp);
1032 1032
 				continue;
1033 1033
 			}
1034 1034
 
1035
-			if($started) $buff .= $str;
1035
+			if ($started) $buff .= $str;
1036 1036
 			// If it ends with </attach>, handle attachements
1037
-			if(trim($str) == '</attach>')
1037
+			if (trim($str) == '</attach>')
1038 1038
 			{
1039 1039
 				$xmlDoc = $this->oXmlParser->parse($buff.$str);
1040 1040
 
1041 1041
 				$file_obj->source_filename = base64_decode($xmlDoc->attach->filename->body);
1042 1042
 				$file_obj->download_count = base64_decode($xmlDoc->attach->download_count->body);
1043 1043
 
1044
-				if(!$file_obj->file)
1044
+				if (!$file_obj->file)
1045 1045
 				{
1046 1046
 					$url = base64_decode($xmlDoc->attach->url->body);
1047 1047
 					$path = base64_decode($xmlDoc->attach->path->body);
1048
-					if($path && file_exists($path)) $file_obj->file = $path;
1048
+					if ($path && file_exists($path)) $file_obj->file = $path;
1049 1049
 					else
1050 1050
 					{
1051 1051
 						$file_obj->file = $this->getTmpFilename();
@@ -1053,11 +1053,11 @@  discard block
 block discarded – undo
1053 1053
 					}
1054 1054
 				}
1055 1055
 
1056
-				if(file_exists($file_obj->file))
1056
+				if (file_exists($file_obj->file))
1057 1057
 				{
1058 1058
 					$random = new Password();
1059 1059
 					// Set upload path by checking if the attachement is an image or other kind of file
1060
-					if(preg_match("/\.(jpe?g|gif|png|wm[va]|mpe?g|avi|flv|mp[1-4]|as[fx]|wav|midi?|moo?v|qt|r[am]{1,2}|m4v)$/i", $file_obj->source_filename))
1060
+					if (preg_match("/\.(jpe?g|gif|png|wm[va]|mpe?g|avi|flv|mp[1-4]|as[fx]|wav|midi?|moo?v|qt|r[am]{1,2}|m4v)$/i", $file_obj->source_filename))
1061 1061
 					{
1062 1062
 						// Immediately remove the direct file if it has any kind of extensions for hacking
1063 1063
 						$file_obj->source_filename = preg_replace('/\.(php|phtm|phar|html?|cgi|pl|exe|jsp|asp|inc)/i', '$0-x', $file_obj->source_filename);
@@ -1065,14 +1065,14 @@  discard block
 block discarded – undo
1065 1065
 
1066 1066
 						$path = sprintf("./files/attach/images/%s/%s", $module_srl, getNumberingPath($upload_target_srl, 3));
1067 1067
 
1068
-						$ext = substr(strrchr($file_obj->source_filename,'.'),1);
1068
+						$ext = substr(strrchr($file_obj->source_filename, '.'), 1);
1069 1069
 						$_filename = $random->createSecureSalt(32, 'hex').'.'.$ext;
1070 1070
 						$filename  = $path.$_filename;
1071 1071
 
1072 1072
 						$idx = 1;
1073
-						while(file_exists($filename))
1073
+						while (file_exists($filename))
1074 1074
 						{
1075
-							$filename = $path.preg_replace('/\.([a-z0-9]+)$/i','_'.$idx.'.$1', $_filename);
1075
+							$filename = $path.preg_replace('/\.([a-z0-9]+)$/i', '_'.$idx.'.$1', $_filename);
1076 1076
 							$idx++;
1077 1077
 						}
1078 1078
 
@@ -1080,14 +1080,14 @@  discard block
 block discarded – undo
1080 1080
 					}
1081 1081
 					else
1082 1082
 					{
1083
-						$path = sprintf("./files/attach/binaries/%s/%s", $module_srl, getNumberingPath($upload_target_srl,3));
1083
+						$path = sprintf("./files/attach/binaries/%s/%s", $module_srl, getNumberingPath($upload_target_srl, 3));
1084 1084
 						$filename = $path.$random->createSecureSalt(32, 'hex');
1085 1085
 						$file_obj->direct_download = 'N';
1086 1086
 					}
1087 1087
 					// Create a directory
1088
-					if(!FileHandler::makeDir($path)) continue;
1088
+					if (!FileHandler::makeDir($path)) continue;
1089 1089
 
1090
-					if(strncmp('./files/cache/importer/', $file_obj->file, 23) === 0)
1090
+					if (strncmp('./files/cache/importer/', $file_obj->file, 23) === 0)
1091 1091
 					{
1092 1092
 						FileHandler::rename($file_obj->file, $filename);
1093 1093
 					}
@@ -1098,7 +1098,7 @@  discard block
 block discarded – undo
1098 1098
 
1099 1099
 					// Insert the file to the DB
1100 1100
 					unset($file_obj->file);
1101
-					if(file_exists($filename))
1101
+					if (file_exists($filename))
1102 1102
 					{
1103 1103
 						$file_obj->uploaded_filename = $filename;
1104 1104
 						$file_obj->file_size = filesize($filename);
@@ -1108,13 +1108,13 @@  discard block
 block discarded – undo
1108 1108
 						$file_obj->isvalid = 'Y';
1109 1109
 						$output = executeQuery('file.insertFile', $file_obj);
1110 1110
 
1111
-						if($output->toBool())
1111
+						if ($output->toBool())
1112 1112
 						{
1113 1113
 							$uploaded_count++;
1114 1114
 							$tmp_obj = null;
1115 1115
 							$tmp_obj->source_filename = $file_obj->source_filename;
1116
-							if($file_obj->direct_download == 'Y') $files[$file_obj->source_filename] = $file_obj->uploaded_filename;
1117
-							else $files[$file_obj->source_filename] = getUrl('','module','file','act','procFileDownload','file_srl',$file_obj->file_srl,'sid',$file_obj->sid);
1116
+							if ($file_obj->direct_download == 'Y') $files[$file_obj->source_filename] = $file_obj->uploaded_filename;
1117
+							else $files[$file_obj->source_filename] = getUrl('', 'module', 'file', 'act', 'procFileDownload', 'file_srl', $file_obj->file_srl, 'sid', $file_obj->sid);
1118 1118
 						}
1119 1119
 					}
1120 1120
 				}
@@ -1131,8 +1131,8 @@  discard block
 block discarded – undo
1131 1131
 	{
1132 1132
 		$path = "./files/cache/importer";
1133 1133
 		FileHandler::makeDir($path);
1134
-		$filename = sprintf("%s/%d", $path, rand(11111111,99999999));
1135
-		if(file_exists($filename)) $filename .= rand(111,999);
1134
+		$filename = sprintf("%s/%d", $path, rand(11111111, 99999999));
1135
+		if (file_exists($filename)) $filename .= rand(111, 999);
1136 1136
 		return $filename;
1137 1137
 	}
1138 1138
 
@@ -1147,14 +1147,14 @@  discard block
 block discarded – undo
1147 1147
 		$f = fopen($temp_filename, "w");
1148 1148
 
1149 1149
 		$buff = '';
1150
-		while(!feof($fp))
1150
+		while (!feof($fp))
1151 1151
 		{
1152 1152
 			$str = trim(fgets($fp, 1024));
1153
-			if(trim($str) == '</file>') break;
1153
+			if (trim($str) == '</file>') break;
1154 1154
 
1155 1155
 			$buff .= $str;
1156 1156
 
1157
-			if(substr($buff,-7)=='</buff>')
1157
+			if (substr($buff, -7) == '</buff>')
1158 1158
 			{
1159 1159
 				fwrite($f, base64_decode(substr($buff, 6, -7)));
1160 1160
 				$buff = '';
@@ -1173,23 +1173,23 @@  discard block
 block discarded – undo
1173 1173
 	function importExtraVars($fp)
1174 1174
 	{
1175 1175
 		$buff = null;
1176
-		while(!feof($fp))
1176
+		while (!feof($fp))
1177 1177
 		{
1178 1178
 			$buff .= $str = trim(fgets($fp, 1024));
1179
-			if(trim($str) == '</extra_vars>') break;
1179
+			if (trim($str) == '</extra_vars>') break;
1180 1180
 		}
1181
-		if(!$buff) return array();
1181
+		if (!$buff) return array();
1182 1182
 
1183 1183
 		$buff = '<extra_vars>'.$buff;
1184 1184
 		$oXmlParser = new XmlParser();
1185 1185
 		$xmlDoc = $this->oXmlParser->parse($buff);
1186
-		if(!count($xmlDoc->extra_vars->key)) return array();
1186
+		if (!count($xmlDoc->extra_vars->key)) return array();
1187 1187
 
1188 1188
 		$index = 1;
1189
-		foreach($xmlDoc->extra_vars->key as $k => $v)
1189
+		foreach ($xmlDoc->extra_vars->key as $k => $v)
1190 1190
 		{
1191 1191
 			unset($vobj);
1192
-			if($v->var_idx)
1192
+			if ($v->var_idx)
1193 1193
 			{
1194 1194
 				$vobj->var_idx = base64_decode($v->var_idx->body);
1195 1195
 				$vobj->lang_code = base64_decode($v->lang_code->body);
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
 				$vobj->eid = base64_decode($v->eid->body);
1198 1198
 
1199 1199
 			}
1200
-			else if($v->body)
1200
+			else if ($v->body)
1201 1201
 			{
1202 1202
 				$vobj->var_idx = $index;
1203 1203
 				$vobj->lang_code = Context::getLangType();
Please login to merge, or discard this patch.
Braces   +256 added lines, -111 removed lines patch added patch discarded remove patch
@@ -55,24 +55,29 @@  discard block
 block discarded – undo
55 55
 					{
56 56
 						$isExists = 'true';
57 57
 						$type = 'XML';
58
-						if(stristr($str, 'tattertools')) $type = 'TTXML';
58
+						if(stristr($str, 'tattertools')) {
59
+							$type = 'TTXML';
60
+						}
59 61
 
60 62
 						$this->add('type', $type);
61 63
 					}
62 64
 					fclose($fp);
63 65
 					$resultMessage = $lang->found_xml_file;
66
+				} else {
67
+					$resultMessage = $lang->cannot_url_file;
64 68
 				}
65
-				else $resultMessage = $lang->cannot_url_file;
69
+			} else {
70
+				$resultMessage = $lang->cannot_allow_fopen_in_phpini;
66 71
 			}
67
-			else $resultMessage = $lang->cannot_allow_fopen_in_phpini;
68 72
 
69 73
 			$this->add('exists', $isExists);
70
-		}
71
-		else
74
+		} else
72 75
 		{
73 76
 			$realPath = FileHandler::getRealPath($filename);
74 77
 
75
-			if(file_exists($realPath) && is_file($realPath)) $isExists = 'true';
78
+			if(file_exists($realPath) && is_file($realPath)) {
79
+				$isExists = 'true';
80
+			}
76 81
 			$this->add('exists', $isExists);
77 82
 
78 83
 			if($isExists == 'true')
@@ -81,13 +86,16 @@  discard block
 block discarded – undo
81 86
 
82 87
 				$fp = fopen($realPath, "r");
83 88
 				$str = fgets($fp, 100);
84
-				if(stristr($str, 'tattertools')) $type = 'TTXML';
89
+				if(stristr($str, 'tattertools')) {
90
+					$type = 'TTXML';
91
+				}
85 92
 				fclose($fp);
86 93
 
87 94
 				$this->add('type', $type);
88 95
 				$resultMessage = $lang->found_xml_file;
96
+			} else {
97
+				$resultMessage = $lang->not_found_xml_file;
89 98
 			}
90
-			else $resultMessage = $lang->not_found_xml_file;
91 99
 		}
92 100
 		$this->add('result_message', $resultMessage);
93 101
 	}
@@ -112,8 +120,7 @@  discard block
 block discarded – undo
112 120
 		{
113 121
 			$output = executeQuery('importer.updateDocumentSync'.$postFix);
114 122
 			$output = executeQuery('importer.updateCommentSync'.$postFix);
115
-		}
116
-		else
123
+		} else
117 124
 		{
118 125
 			$output = executeQueryArray ('importer.getDocumentMemberSrlWithUserID'.$postFix);
119 126
 			if(is_array ($output->data) && count ($output->data))
@@ -129,8 +136,7 @@  discard block
 block discarded – undo
129 136
 					if($tmp->toBool () === true)
130 137
 					{
131 138
 						$success_count++;
132
-					}
133
-					else
139
+					} else
134 140
 					{
135 141
 						$error_count++;
136 142
 					}
@@ -152,8 +158,7 @@  discard block
 block discarded – undo
152 158
 					if($tmp->toBool () === true)
153 159
 					{
154 160
 						$success_count++;
155
-					}
156
-					else
161
+					} else
157 162
 					{
158 163
 						$error_count++;
159 164
 					}
@@ -182,11 +187,15 @@  discard block
 block discarded – undo
182 187
 		{
183 188
 			case 'member' :
184 189
 				$output = $oExtract->set($xml_file,'<members ', '</members>', '<member>', '</member>');
185
-				if($output->toBool()) $oExtract->saveItems();
190
+				if($output->toBool()) {
191
+					$oExtract->saveItems();
192
+				}
186 193
 				break;
187 194
 			case 'message' :
188 195
 				$output = $oExtract->set($xml_file,'<messages ', '</messages>', '<message>','</message>');
189
-				if($output->toBool()) $oExtract->saveItems();
196
+				if($output->toBool()) {
197
+					$oExtract->saveItems();
198
+				}
190 199
 				break;
191 200
 			case 'ttxml' :
192 201
 				// Category information
@@ -204,8 +213,12 @@  discard block
 block discarded – undo
204 213
 							$started = true;
205 214
 							$str = strstr($str, '<category>');
206 215
 						}
207
-						if(substr($str,0,strlen('<post ')) == '<post ') break;
208
-						if ($started) $buff .= $str;
216
+						if(substr($str,0,strlen('<post ')) == '<post ') {
217
+							break;
218
+						}
219
+						if ($started) {
220
+							$buff .= $str;
221
+						}
209 222
 					}
210 223
 					$buff = '<categories>'.$buff.'</categories>';
211 224
 					$oExtract->closeFile();
@@ -242,7 +255,9 @@  discard block
 block discarded – undo
242 255
 						FileHandler::writeFile($guestbook_filename, $buff);
243 256
 						// Individual items
244 257
 						$output = $oExtract->set($xml_file,'<blog', '</blog>', '<post ', '</post>');
245
-						if($output->toBool()) $oExtract->saveItems();
258
+						if($output->toBool()) {
259
+							$oExtract->saveItems();
260
+						}
246 261
 					}
247 262
 				}
248 263
 				break;
@@ -254,7 +269,9 @@  discard block
 block discarded – undo
254 269
 					$oExtract->mergeItems('category.xml');
255 270
 					// Get each item
256 271
 					$output = $oExtract->set($xml_file,'<posts ', '</posts>', '<post>', '</post>');
257
-					if($output->toBool()) $oExtract->saveItems();
272
+					if($output->toBool()) {
273
+						$oExtract->saveItems();
274
+					}
258 275
 				}
259 276
 				break;
260 277
 		}
@@ -291,19 +308,25 @@  discard block
 block discarded – undo
291 308
 		$this->unit_count = Context::get('unit_count');
292 309
 		// Check if an index file exists
293 310
 		$index_file = './files/cache/importer/'.$key.'/index';
294
-		if(!file_exists($index_file)) return new BaseObject(-1, 'msg_invalid_xml_file');
311
+		if(!file_exists($index_file)) {
312
+			return new BaseObject(-1, 'msg_invalid_xml_file');
313
+		}
295 314
 
296 315
 		switch($type)
297 316
 		{
298 317
 			case 'ttxml' :
299
-				if(!$target_module) return new BaseObject(-1,'msg_invalid_request');
318
+				if(!$target_module) {
319
+					return new BaseObject(-1,'msg_invalid_request');
320
+				}
300 321
 
301 322
 				$oModuleModel = getModel('module');
302 323
 				$columnList = array('module_srl', 'module');
303 324
 				$target_module_info = $oModuleModel->getModuleInfoByModuleSrl($target_module, $columnList);
304 325
 
305 326
 				$ttimporter = FileHandler::exists(_XE_PATH_ . 'modules/importer/ttimport.class.php');
306
-				if($ttimporter) require_once($ttimporter);
327
+				if($ttimporter) {
328
+					require_once($ttimporter);
329
+				}
307 330
 
308 331
 				$oTT = new ttimport();
309 332
 				$cur = $oTT->importModule($key, $cur, $index_file, $this->unit_count, $target_module, $guestbook_target_module, $user_id, $target_module_info->module);
@@ -316,7 +339,9 @@  discard block
 block discarded – undo
316 339
 				break;
317 340
 			case 'module' :
318 341
 				// Check if the target module exists
319
-				if(!$target_module) return new BaseObject(-1,'msg_invalid_request');
342
+				if(!$target_module) {
343
+					return new BaseObject(-1,'msg_invalid_request');
344
+				}
320 345
 				$cur = $this->importModule($key, $cur, $index_file, $target_module);
321 346
 				break;
322 347
 		}
@@ -331,8 +356,9 @@  discard block
 block discarded – undo
331 356
 		{
332 357
 			$this->setMessage( sprintf(Context::getLang('msg_import_finished'), $cur, $total) );
333 358
 			FileHandler::removeDir('./files/cache/importer/'.$key);
359
+		} else {
360
+			$this->setMessage( sprintf(Context::getLang('msg_importing'), $total, $cur) );
334 361
 		}
335
-		else $this->setMessage( sprintf(Context::getLang('msg_importing'), $total, $cur) );
336 362
 	}
337 363
 
338 364
 	/**
@@ -344,7 +370,9 @@  discard block
 block discarded – undo
344 370
 	 */
345 371
 	function importMember($key, $cur, $index_file)
346 372
 	{
347
-		if(!$cur) $cur = 0;
373
+		if(!$cur) {
374
+			$cur = 0;
375
+		}
348 376
 		// Create the xmlParser object
349 377
 		$oXmlParser = new XmlParser();
350 378
 		// Create objects for importing member information
@@ -359,24 +387,32 @@  discard block
 block discarded – undo
359 387
 		// Open an index file
360 388
 		$f = fopen($index_file,"r");
361 389
 		// Pass if already read
362
-		for($i=0;$i<$cur;$i++) fgets($f, 1024);
390
+		for($i=0;$i<$cur;$i++) {
391
+			fgets($f, 1024);
392
+		}
363 393
 		// Read by each line until the condition meets
364 394
 		for($idx=$cur;$idx<$cur+$this->unit_count;$idx++)
365 395
 		{
366
-			if(feof($f)) break;
396
+			if(feof($f)) {
397
+				break;
398
+			}
367 399
 			// Find a given location
368 400
 			$target_file = trim(fgets($f, 1024));
369 401
 			// Load and parse the file
370 402
 			$xmlObj = $oXmlParser->loadXmlFile($target_file);
371 403
 			FileHandler::removeFile($target_file);
372
-			if(!$xmlObj) continue;
404
+			if(!$xmlObj) {
405
+				continue;
406
+			}
373 407
 			// List Objects
374 408
 			$obj = new stdClass();
375 409
 			$obj->user_id = base64_decode($xmlObj->member->user_id->body);
376 410
 			$obj->password = base64_decode($xmlObj->member->password->body);
377 411
 			$obj->user_name = base64_decode($xmlObj->member->user_name->body);
378 412
 			$obj->nick_name = base64_decode($xmlObj->member->nick_name->body);
379
-			if(!$obj->user_name) $obj->user_name = $obj->nick_name;
413
+			if(!$obj->user_name) {
414
+				$obj->user_name = $obj->nick_name;
415
+			}
380 416
 			$obj->email = base64_decode($xmlObj->member->email->body);
381 417
 			$obj->homepage = base64_decode($xmlObj->member->homepage->body);
382 418
 			$obj->blog = base64_decode($xmlObj->member->blog->body);
@@ -394,22 +430,32 @@  discard block
 block discarded – undo
394 430
 			{
395 431
 				foreach($xmlObj->member->extra_vars as $key => $val)
396 432
 				{
397
-					if(in_array($key, array('node_name','attrs','body'))) continue;
433
+					if(in_array($key, array('node_name','attrs','body'))) {
434
+						continue;
435
+					}
398 436
 					$obj->extra_vars->{$key} = base64_decode($val->body);
399 437
 				}
400 438
 			}
401 439
 			// Create url for homepage and blog
402
-			if($obj->homepage && strncasecmp('http://', $obj->homepage, 7) !== 0 && strncasecmp('https://', $obj->homepage, 8) !== 0) $obj->homepage = 'http://'.$obj->homepage;
440
+			if($obj->homepage && strncasecmp('http://', $obj->homepage, 7) !== 0 && strncasecmp('https://', $obj->homepage, 8) !== 0) {
441
+				$obj->homepage = 'http://'.$obj->homepage;
442
+			}
403 443
 			// email address column
404 444
 			$obj->email_address = $obj->email;
405 445
 			list($obj->email_id, $obj->email_host) = explode('@', $obj->email);
406 446
 			// Set the mailing option
407
-			if($obj->allow_mailing!='Y') $obj->allow_mailing = 'N';
447
+			if($obj->allow_mailing!='Y') {
448
+				$obj->allow_mailing = 'N';
449
+			}
408 450
 			// Set the message option
409 451
 			$obj->allow_message = 'Y';
410
-			if(!in_array($obj->allow_message, array('Y','N','F'))) $obj->allow_message= 'Y';
452
+			if(!in_array($obj->allow_message, array('Y','N','F'))) {
453
+				$obj->allow_message= 'Y';
454
+			}
411 455
 			// Get member-join date if the last login time is not found
412
-			if(!$obj->last_login) $obj->last_login = $obj->regdate;
456
+			if(!$obj->last_login) {
457
+				$obj->last_login = $obj->regdate;
458
+			}
413 459
 			// Get a member_srl
414 460
 			$obj->member_srl = getNextSequence();
415 461
 			$obj->list_order = -1 * $obj->member_srl;
@@ -421,7 +467,9 @@  discard block
 block discarded – undo
421 467
 			$nick_args = new stdClass;
422 468
 			$nick_args->nick_name = $obj->nick_name;
423 469
 			$nick_output = executeQuery('member.getMemberSrl', $nick_args);
424
-			if(!$nick_output->toBool()) $obj->nick_name .= '_'.$obj->member_srl;
470
+			if(!$nick_output->toBool()) {
471
+				$obj->nick_name .= '_'.$obj->member_srl;
472
+			}
425 473
 			// Add a member
426 474
 			$output = executeQuery('member.insertMember', $obj);
427 475
 
@@ -477,7 +525,9 @@  discard block
 block discarded – undo
477 525
 					$signature_buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
478 526
 
479 527
 					$target_path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($obj->member_srl));
480
-					if(!is_dir($target_path)) FileHandler::makeDir($target_path);
528
+					if(!is_dir($target_path)) {
529
+						FileHandler::makeDir($target_path);
530
+					}
481 531
 					$target_filename = sprintf('%s%d.signature.php', $target_path, $obj->member_srl);
482 532
 
483 533
 					FileHandler::writeFile($target_filename, $signature_buff);
@@ -499,23 +549,31 @@  discard block
 block discarded – undo
499 549
 	 */
500 550
 	function importMessage($key, $cur, $index_file)
501 551
 	{
502
-		if(!$cur) $cur = 0;
552
+		if(!$cur) {
553
+			$cur = 0;
554
+		}
503 555
 		// Create the xmlParser object
504 556
 		$oXmlParser = new XmlParser();
505 557
 		// Open an index file
506 558
 		$f = fopen($index_file,"r");
507 559
 		// Pass if already read
508
-		for($i=0;$i<$cur;$i++) fgets($f, 1024);
560
+		for($i=0;$i<$cur;$i++) {
561
+			fgets($f, 1024);
562
+		}
509 563
 		// Read each line until the condition meets
510 564
 		for($idx=$cur;$idx<$cur+$this->unit_count;$idx++)
511 565
 		{
512
-			if(feof($f)) break;
566
+			if(feof($f)) {
567
+				break;
568
+			}
513 569
 			// Find a location
514 570
 			$target_file = trim(fgets($f, 1024));
515 571
 			// Load and parse the file
516 572
 			$xmlObj = $oXmlParser->loadXmlFile($target_file);
517 573
 			FileHandler::removeFile($target_file);
518
-			if(!$xmlObj) continue;
574
+			if(!$xmlObj) {
575
+				continue;
576
+			}
519 577
 			// List objects
520 578
 			$obj = null;
521 579
 			$obj->receiver = base64_decode($xmlObj->message->receiver->body);
@@ -526,7 +584,9 @@  discard block
 block discarded – undo
526 584
 			$obj->regdate = base64_decode($xmlObj->message->regdate->body);
527 585
 			$obj->readed_date = base64_decode($xmlObj->message->readed_date->body);
528 586
 			// Get member_srl of sender/recipient (If not exists, pass)
529
-			if(!$obj->sender) continue;
587
+			if(!$obj->sender) {
588
+				continue;
589
+			}
530 590
 			$sender_args->user_id = $obj->sender;
531 591
 			$sender_output = executeQuery('member.getMemberInfo',$sender_args);
532 592
 			$sender_srl = $sender_output->data->member_srl;
@@ -537,10 +597,14 @@  discard block
 block discarded – undo
537 597
 				$sender_output = executeQuery('member.getMemberInfoByEmailAddress',$sender_args);
538 598
 				$sender_srl = $sender_output->data->member_srl;
539 599
 			}
540
-			if(!$sender_srl) continue;
600
+			if(!$sender_srl) {
601
+				continue;
602
+			}
541 603
 
542 604
 			$receiver_args->user_id = $obj->receiver;
543
-			if(!$obj->receiver) continue;
605
+			if(!$obj->receiver) {
606
+				continue;
607
+			}
544 608
 			$receiver_output = executeQuery('member.getMemberInfo',$receiver_args);
545 609
 			$receiver_srl = $receiver_output->data->member_srl;
546 610
 			if(!$receiver_srl)
@@ -550,7 +614,9 @@  discard block
 block discarded – undo
550 614
 				$receiver_output = executeQuery('member.getMemberInfoByEmailAddress',$receiver_args);
551 615
 				$receiver_srl = $receiver_output->data->member_srl;
552 616
 			}
553
-			if(!$receiver_srl) continue;
617
+			if(!$receiver_srl) {
618
+				continue;
619
+			}
554 620
 			// Message to save into sender's message box
555 621
 			$sender_args->sender_srl = $sender_srl;
556 622
 			$sender_args->receiver_srl = $receiver_srl;
@@ -571,7 +637,9 @@  discard block
 block discarded – undo
571 637
 				$receiver_args->message_srl = $sender_args->related_srl;
572 638
 				$receiver_args->list_order = $sender_args->related_srl*-1;
573 639
 				$receiver_args->sender_srl = $sender_srl;
574
-				if(!$receiver_args->sender_srl) $receiver_args->sender_srl = $receiver_srl;
640
+				if(!$receiver_args->sender_srl) {
641
+					$receiver_args->sender_srl = $receiver_srl;
642
+				}
575 643
 				$receiver_args->receiver_srl = $receiver_srl;
576 644
 				$receiver_args->message_type = 'R';
577 645
 				$receiver_args->title = $obj->title;
@@ -605,7 +673,9 @@  discard block
 block discarded – undo
605 673
 		$oDocumentModel = getModel('document');
606 674
 		$category_list = $category_titles = array();
607 675
 		$category_list = $oDocumentModel->getCategoryList($module_srl);
608
-		if(count($category_list)) foreach($category_list as $key => $val) $category_titles[$val->title] = $val->category_srl;
676
+		if(count($category_list)) {
677
+			foreach($category_list as $key => $val) $category_titles[$val->title] = $val->category_srl;
678
+		}
609 679
 		// Extract category information
610 680
 		$category_file = preg_replace('/index$/i', 'category.xml', $index_file);
611 681
 		if(file_exists($category_file))
@@ -618,12 +688,16 @@  discard block
 block discarded – undo
618 688
 			$categories = $xmlDoc->items->category;
619 689
 			if($categories)
620 690
 			{
621
-				if(!is_array($categories)) $categories = array($categories);
691
+				if(!is_array($categories)) {
692
+					$categories = array($categories);
693
+				}
622 694
 				$match_sequence = array();
623 695
 				foreach($categories as $k => $v)
624 696
 				{
625 697
 					$category = trim(base64_decode($v->body));
626
-					if(!$category || $category_titles[$category]) continue;
698
+					if(!$category || $category_titles[$category]) {
699
+						continue;
700
+					}
627 701
 
628 702
 					$sequence = $v->attrs->sequence;
629 703
 					$parent = $v->attrs->parent;
@@ -631,10 +705,14 @@  discard block
 block discarded – undo
631 705
 					$obj = null;
632 706
 					$obj->title = $category;
633 707
 					$obj->module_srl = $module_srl;
634
-					if($parent) $obj->parent_srl = $match_sequence[$parent];
708
+					if($parent) {
709
+						$obj->parent_srl = $match_sequence[$parent];
710
+					}
635 711
 
636 712
 					$output = $oDocumentController->insertCategory($obj);
637
-					if($output->toBool()) $match_sequence[$sequence] = $output->get('category_srl');
713
+					if($output->toBool()) {
714
+						$match_sequence[$sequence] = $output->get('category_srl');
715
+					}
638 716
 				}
639 717
 				$oDocumentController = getController('document');
640 718
 				$oDocumentController->makeCategoryFile($module_srl);
@@ -644,31 +722,45 @@  discard block
 block discarded – undo
644 722
 
645 723
 		$category_list = $category_titles = array();
646 724
 		$category_list = $oDocumentModel->getCategoryList($module_srl);
647
-		if(count($category_list)) foreach($category_list as $key => $val) $category_titles[$val->title] = $val->category_srl;
725
+		if(count($category_list)) {
726
+			foreach($category_list as $key => $val) $category_titles[$val->title] = $val->category_srl;
727
+		}
648 728
 
649 729
 		$ek_args->module_srl = $module_srl;
650 730
 		$output = executeQueryArray('document.getDocumentExtraKeys', $ek_args);
651 731
 		if($output->data)
652 732
 		{
653
-			foreach($output->data as $key => $val) $extra_keys[$val->eid] = true;
733
+			foreach($output->data as $key => $val) {
734
+				$extra_keys[$val->eid] = true;
735
+			}
654 736
 		}
655 737
 
656
-		if(!$cur) $cur = 0;
738
+		if(!$cur) {
739
+			$cur = 0;
740
+		}
657 741
 		// Open an index file
658 742
 		$f = fopen($index_file,"r");
659 743
 		// Pass if already read
660
-		for($i=0;$i<$cur;$i++) fgets($f, 1024);
744
+		for($i=0;$i<$cur;$i++) {
745
+			fgets($f, 1024);
746
+		}
661 747
 		// Read each line until the condition meets
662 748
 		for($idx=$cur;$idx<$cur+$this->unit_count;$idx++)
663 749
 		{
664
-			if(feof($f)) break;
750
+			if(feof($f)) {
751
+				break;
752
+			}
665 753
 			// Find a location
666 754
 			$target_file = trim(fgets($f, 1024));
667 755
 
668
-			if(!file_exists($target_file)) continue;
756
+			if(!file_exists($target_file)) {
757
+				continue;
758
+			}
669 759
 			// Importing data from now on
670 760
 			$fp = fopen($target_file,"r");
671
-			if(!$fp) continue;
761
+			if(!$fp) {
762
+				continue;
763
+			}
672 764
 
673 765
 			$obj = new stdClass;
674 766
 			$obj->module_srl = $module_srl;
@@ -688,38 +780,38 @@  discard block
 block discarded – undo
688 780
 				{
689 781
 					$started = true;
690 782
 					// Trackback inserted
691
-				}
692
-				else if(substr($str,0,11) == '<trackbacks')
783
+				} else if(substr($str,0,11) == '<trackbacks')
693 784
 				{
694 785
 					$obj->trackback_count = $this->importTrackbacks($fp, $module_srl, $obj->document_srl);
695 786
 					continue;
696 787
 					// Comments inserted
697
-				}
698
-				else if(substr($str,0,9) == '<comments')
788
+				} else if(substr($str,0,9) == '<comments')
699 789
 				{
700 790
 					$obj->comment_count = $this->importComments($fp, $module_srl, $obj->document_srl);
701 791
 					continue;
702 792
 					// Attachment inserted
703
-				}
704
-				else if(substr($str,0,9) == '<attaches')
793
+				} else if(substr($str,0,9) == '<attaches')
705 794
 				{
706 795
 					$obj->uploaded_count = $this->importAttaches($fp, $module_srl, $obj->document_srl, $files);
707 796
 					continue;
708 797
 					// When starting extra variabls
709
-				}
710
-				elseif(trim($str) == '<extra_vars>')
798
+				} elseif(trim($str) == '<extra_vars>')
711 799
 				{
712 800
 					$extra_vars = $this->importExtraVars($fp);
713 801
 					continue;
714 802
 				}
715 803
 
716
-				if($started) $buff[] = $str;
804
+				if($started) {
805
+					$buff[] = $str;
806
+				}
717 807
 			}
718 808
 
719 809
 			$xmlDoc = $this->oXmlParser->parse(implode('', $buff));
720 810
 
721 811
 			$category = base64_decode($xmlDoc->post->category->body);
722
-			if($category_titles[$category]) $obj->category_srl = $category_titles[$category];
812
+			if($category_titles[$category]) {
813
+				$obj->category_srl = $category_titles[$category];
814
+			}
723 815
 
724 816
 			$obj->member_srl = 0;
725 817
 
@@ -733,16 +825,22 @@  discard block
 block discarded – undo
733 825
 			$obj->password = base64_decode($xmlDoc->post->password->body);
734 826
 			$obj->user_name = base64_decode($xmlDoc->post->user_name->body);
735 827
 			$obj->nick_name = base64_decode($xmlDoc->post->nick_name->body);
736
-			if(!$obj->user_name) $obj->user_name = $obj->nick_name;
828
+			if(!$obj->user_name) {
829
+				$obj->user_name = $obj->nick_name;
830
+			}
737 831
 			$obj->user_id = base64_decode($xmlDoc->post->user_id->body);
738 832
 			$obj->email_address = base64_decode($xmlDoc->post->email->body);
739 833
 			$obj->homepage = base64_decode($xmlDoc->post->homepage->body);
740
-			if($obj->homepage && strncasecmp('http://', $obj->homepage, 7) !== 0 && strncasecmp('https://', $obj->homepage, 8) !== 0) $obj->homepage = 'http://'.$obj->homepage;
834
+			if($obj->homepage && strncasecmp('http://', $obj->homepage, 7) !== 0 && strncasecmp('https://', $obj->homepage, 8) !== 0) {
835
+				$obj->homepage = 'http://'.$obj->homepage;
836
+			}
741 837
 			$obj->tags = base64_decode($xmlDoc->post->tags->body);
742 838
 			$obj->regdate = base64_decode($xmlDoc->post->regdate->body);
743 839
 			$obj->last_update = base64_decode($xmlDoc->post->update->body);
744 840
 			$obj->last_updater = base64_decode($xmlDoc->post->last_updater->body);
745
-			if(!$obj->last_update) $obj->last_update = $obj->regdate;
841
+			if(!$obj->last_update) {
842
+				$obj->last_update = $obj->regdate;
843
+			}
746 844
 			$obj->ipaddress = base64_decode($xmlDoc->post->ipaddress->body);
747 845
 			$obj->list_order = $obj->update_order = $obj->document_srl*-1;
748 846
 			$obj->commentStatus = base64_decode($xmlDoc->post->allow_comment->body)!='N'?'ALLOW':'DENY';
@@ -773,7 +871,9 @@  discard block
 block discarded – undo
773 871
 					$args->document_srl = $obj->document_srl;
774 872
 					$args->tag = trim($tag_list[$i]);
775 873
 					$args->regdate = $obj->regdate;
776
-					if(!$args->tag) continue;
874
+					if(!$args->tag) {
875
+						continue;
876
+					}
777 877
 					$output = executeQuery('tag.insertTag', $args);
778 878
 				}
779 879
 
@@ -783,7 +883,9 @@  discard block
 block discarded – undo
783 883
 			{
784 884
 				foreach($extra_vars as $key => $val)
785 885
 				{
786
-					if(!$val->value) continue;
886
+					if(!$val->value) {
887
+						continue;
888
+					}
787 889
 					unset($e_args);
788 890
 					$e_args->module_srl = $module_srl;
789 891
 					$e_args->document_srl = $obj->document_srl;
@@ -816,7 +918,9 @@  discard block
 block discarded – undo
816 918
 
817 919
 		fclose($f);
818 920
 		// Sync category counts
819
-		if(count($category_list)) foreach($category_list as $key => $val) $oDocumentController->updateCategoryCount($module_srl, $val->category_srl);
921
+		if(count($category_list)) {
922
+			foreach($category_list as $key => $val) $oDocumentController->updateCategoryCount($module_srl, $val->category_srl);
923
+		}
820 924
 
821 925
 		return $idx-1;
822 926
 	}
@@ -838,11 +942,17 @@  discard block
 block discarded – undo
838 942
 		{
839 943
 			$str = fgets($fp, 1024);
840 944
 			// If </trackbacks> is, break
841
-			if(trim($str) == '</trackbacks>') break;
945
+			if(trim($str) == '</trackbacks>') {
946
+				break;
947
+			}
842 948
 			// If <trackback>, start importing
843
-			if(trim($str) == '<trackback>') $started = true;
949
+			if(trim($str) == '<trackback>') {
950
+				$started = true;
951
+			}
844 952
 
845
-			if($started) $buff .= $str;
953
+			if($started) {
954
+				$buff .= $str;
955
+			}
846 956
 			// If </trackback>, insert to the DB
847 957
 			if(trim($str) == '</trackback>')
848 958
 			{
@@ -860,7 +970,9 @@  discard block
 block discarded – undo
860 970
 				$obj->ipaddress = base64_decode($xmlDoc->trackback->ipaddress->body);
861 971
 				$obj->list_order = -1*$obj->trackback_srl;
862 972
 				$output = executeQuery('trackback.insertTrackback', $obj);
863
-				if($output->toBool()) $cnt++;
973
+				if($output->toBool()) {
974
+					$cnt++;
975
+				}
864 976
 
865 977
 				$buff = null;
866 978
 				$started = false;
@@ -888,7 +1000,9 @@  discard block
 block discarded – undo
888 1000
 		{
889 1001
 			$str = fgets($fp, 1024);
890 1002
 			// If </comments> is, break
891
-			if(trim($str) == '</comments>') break;
1003
+			if(trim($str) == '</comments>') {
1004
+				break;
1005
+			}
892 1006
 			// If <comment> is, start importing
893 1007
 			if(trim($str) == '<comment>')
894 1008
 			{
@@ -904,7 +1018,9 @@  discard block
 block discarded – undo
904 1018
 				continue;
905 1019
 			}
906 1020
 
907
-			if($started) $buff .= $str;
1021
+			if($started) {
1022
+				$buff .= $str;
1023
+			}
908 1024
 			// If </comment> is, insert to the DB
909 1025
 			if(trim($str) == '</comment>')
910 1026
 			{
@@ -916,8 +1032,11 @@  discard block
 block discarded – undo
916 1032
 
917 1033
 				$obj->module_srl = $module_srl;
918 1034
 
919
-				if($parent) $obj->parent_srl = $sequences[$parent];
920
-				else $obj->parent_srl = 0;
1035
+				if($parent) {
1036
+					$obj->parent_srl = $sequences[$parent];
1037
+				} else {
1038
+					$obj->parent_srl = 0;
1039
+				}
921 1040
 
922 1041
 				$obj->document_srl = $document_srl;
923 1042
 				$obj->is_secret = base64_decode($xmlDoc->comment->is_secret->body)=='Y'?'Y':'N';
@@ -928,14 +1047,18 @@  discard block
 block discarded – undo
928 1047
 				$obj->password = base64_decode($xmlDoc->comment->password->body);
929 1048
 				$obj->user_name =base64_decode($xmlDoc->comment->user_name->body);
930 1049
 				$obj->nick_name = base64_decode($xmlDoc->comment->nick_name->body);
931
-				if(!$obj->user_name) $obj->user_name = $obj->nick_name;
1050
+				if(!$obj->user_name) {
1051
+					$obj->user_name = $obj->nick_name;
1052
+				}
932 1053
 				$obj->user_id = base64_decode($xmlDoc->comment->user_id->body);
933 1054
 				$obj->member_srl = 0;
934 1055
 				$obj->email_address = base64_decode($xmlDoc->comment->email->body);
935 1056
 				$obj->homepage = base64_decode($xmlDoc->comment->homepage->body);
936 1057
 				$obj->regdate = base64_decode($xmlDoc->comment->regdate->body);
937 1058
 				$obj->last_update = base64_decode($xmlDoc->comment->update->body);
938
-				if(!$obj->last_update) $obj->last_update = $obj->regdate;
1059
+				if(!$obj->last_update) {
1060
+					$obj->last_update = $obj->regdate;
1061
+				}
939 1062
 				$obj->ipaddress = base64_decode($xmlDoc->comment->ipaddress->body);
940 1063
 				$obj->status = base64_decode($xmlDoc->comment->status->body)==''?'1':base64_decode($xmlDoc->comment->status->body);
941 1064
 				$obj->list_order = $obj->comment_srl*-1;
@@ -959,24 +1082,28 @@  discard block
 block discarded – undo
959 1082
 					$list_args->head = $list_args->arrange = $obj->comment_srl;
960 1083
 					$list_args->depth = 0;
961 1084
 					// Get parent_srl if parent comment exists
962
-				}
963
-				else
1085
+				} else
964 1086
 				{
965 1087
 					// Get parent comment infomation
966 1088
 					$parent_args->comment_srl = $obj->parent_srl;
967 1089
 					$parent_output = executeQuery('comment.getCommentListItem', $parent_args);
968 1090
 					// Return if parent comment doesn't exist
969
-					if(!$parent_output->toBool() || !$parent_output->data) continue;
1091
+					if(!$parent_output->toBool() || !$parent_output->data) {
1092
+						continue;
1093
+					}
970 1094
 					$parent = $parent_output->data;
971 1095
 
972 1096
 					$list_args->head = $parent->head;
973 1097
 					$list_args->depth = $parent->depth+1;
974
-					if($list_args->depth<2) $list_args->arrange = $obj->comment_srl;
975
-					else
1098
+					if($list_args->depth<2) {
1099
+						$list_args->arrange = $obj->comment_srl;
1100
+					} else
976 1101
 					{
977 1102
 						$list_args->arrange = $parent->arrange;
978 1103
 						$output = executeQuery('comment.updateCommentListArrange', $list_args);
979
-						if(!$output->toBool()) return $output;
1104
+						if(!$output->toBool()) {
1105
+							return $output;
1106
+						}
980 1107
 					}
981 1108
 				}
982 1109
 
@@ -984,7 +1111,9 @@  discard block
 block discarded – undo
984 1111
 				if($output->toBool())
985 1112
 				{
986 1113
 					$output = executeQuery('comment.insertComment', $obj);
987
-					if($output->toBool()) $cnt++;
1114
+					if($output->toBool()) {
1115
+						$cnt++;
1116
+					}
988 1117
 				}
989 1118
 
990 1119
 				$buff = null;
@@ -1014,7 +1143,9 @@  discard block
 block discarded – undo
1014 1143
 		{
1015 1144
 			$str = trim(fgets($fp, 1024));
1016 1145
 			// If it ends with </attaches>, break
1017
-			if(trim($str) == '</attaches>') break;
1146
+			if(trim($str) == '</attaches>') {
1147
+				break;
1148
+			}
1018 1149
 			// If it starts with <attach>, collect attachments
1019 1150
 			if(trim($str) == '<attach>')
1020 1151
 			{
@@ -1025,14 +1156,15 @@  discard block
 block discarded – undo
1025 1156
 				$started = true;
1026 1157
 				$buff = null;
1027 1158
 				// If it starts with <file>, handle the attachement in xml file
1028
-			}
1029
-			else if(trim($str) == '<file>')
1159
+			} else if(trim($str) == '<file>')
1030 1160
 			{
1031 1161
 				$file_obj->file = $this->saveTemporaryFile($fp);
1032 1162
 				continue;
1033 1163
 			}
1034 1164
 
1035
-			if($started) $buff .= $str;
1165
+			if($started) {
1166
+				$buff .= $str;
1167
+			}
1036 1168
 			// If it ends with </attach>, handle attachements
1037 1169
 			if(trim($str) == '</attach>')
1038 1170
 			{
@@ -1045,8 +1177,9 @@  discard block
 block discarded – undo
1045 1177
 				{
1046 1178
 					$url = base64_decode($xmlDoc->attach->url->body);
1047 1179
 					$path = base64_decode($xmlDoc->attach->path->body);
1048
-					if($path && file_exists($path)) $file_obj->file = $path;
1049
-					else
1180
+					if($path && file_exists($path)) {
1181
+						$file_obj->file = $path;
1182
+					} else
1050 1183
 					{
1051 1184
 						$file_obj->file = $this->getTmpFilename();
1052 1185
 						FileHandler::getRemoteFile($url, $file_obj->file);
@@ -1077,21 +1210,21 @@  discard block
 block discarded – undo
1077 1210
 						}
1078 1211
 
1079 1212
 						$file_obj->direct_download = 'Y';
1080
-					}
1081
-					else
1213
+					} else
1082 1214
 					{
1083 1215
 						$path = sprintf("./files/attach/binaries/%s/%s", $module_srl, getNumberingPath($upload_target_srl,3));
1084 1216
 						$filename = $path.$random->createSecureSalt(32, 'hex');
1085 1217
 						$file_obj->direct_download = 'N';
1086 1218
 					}
1087 1219
 					// Create a directory
1088
-					if(!FileHandler::makeDir($path)) continue;
1220
+					if(!FileHandler::makeDir($path)) {
1221
+						continue;
1222
+					}
1089 1223
 
1090 1224
 					if(strncmp('./files/cache/importer/', $file_obj->file, 23) === 0)
1091 1225
 					{
1092 1226
 						FileHandler::rename($file_obj->file, $filename);
1093
-					}
1094
-					else
1227
+					} else
1095 1228
 					{
1096 1229
 						copy($file_obj->file, $filename);
1097 1230
 					}
@@ -1113,8 +1246,11 @@  discard block
 block discarded – undo
1113 1246
 							$uploaded_count++;
1114 1247
 							$tmp_obj = null;
1115 1248
 							$tmp_obj->source_filename = $file_obj->source_filename;
1116
-							if($file_obj->direct_download == 'Y') $files[$file_obj->source_filename] = $file_obj->uploaded_filename;
1117
-							else $files[$file_obj->source_filename] = getUrl('','module','file','act','procFileDownload','file_srl',$file_obj->file_srl,'sid',$file_obj->sid);
1249
+							if($file_obj->direct_download == 'Y') {
1250
+								$files[$file_obj->source_filename] = $file_obj->uploaded_filename;
1251
+							} else {
1252
+								$files[$file_obj->source_filename] = getUrl('','module','file','act','procFileDownload','file_srl',$file_obj->file_srl,'sid',$file_obj->sid);
1253
+							}
1118 1254
 						}
1119 1255
 					}
1120 1256
 				}
@@ -1132,7 +1268,9 @@  discard block
 block discarded – undo
1132 1268
 		$path = "./files/cache/importer";
1133 1269
 		FileHandler::makeDir($path);
1134 1270
 		$filename = sprintf("%s/%d", $path, rand(11111111,99999999));
1135
-		if(file_exists($filename)) $filename .= rand(111,999);
1271
+		if(file_exists($filename)) {
1272
+			$filename .= rand(111,999);
1273
+		}
1136 1274
 		return $filename;
1137 1275
 	}
1138 1276
 
@@ -1150,7 +1288,9 @@  discard block
 block discarded – undo
1150 1288
 		while(!feof($fp))
1151 1289
 		{
1152 1290
 			$str = trim(fgets($fp, 1024));
1153
-			if(trim($str) == '</file>') break;
1291
+			if(trim($str) == '</file>') {
1292
+				break;
1293
+			}
1154 1294
 
1155 1295
 			$buff .= $str;
1156 1296
 
@@ -1176,14 +1316,20 @@  discard block
 block discarded – undo
1176 1316
 		while(!feof($fp))
1177 1317
 		{
1178 1318
 			$buff .= $str = trim(fgets($fp, 1024));
1179
-			if(trim($str) == '</extra_vars>') break;
1319
+			if(trim($str) == '</extra_vars>') {
1320
+				break;
1321
+			}
1322
+		}
1323
+		if(!$buff) {
1324
+			return array();
1180 1325
 		}
1181
-		if(!$buff) return array();
1182 1326
 
1183 1327
 		$buff = '<extra_vars>'.$buff;
1184 1328
 		$oXmlParser = new XmlParser();
1185 1329
 		$xmlDoc = $this->oXmlParser->parse($buff);
1186
-		if(!count($xmlDoc->extra_vars->key)) return array();
1330
+		if(!count($xmlDoc->extra_vars->key)) {
1331
+			return array();
1332
+		}
1187 1333
 
1188 1334
 		$index = 1;
1189 1335
 		foreach($xmlDoc->extra_vars->key as $k => $v)
@@ -1196,8 +1342,7 @@  discard block
 block discarded – undo
1196 1342
 				$vobj->value = base64_decode($v->value->body);
1197 1343
 				$vobj->eid = base64_decode($v->eid->body);
1198 1344
 
1199
-			}
1200
-			else if($v->body)
1345
+			} else if($v->body)
1201 1346
 			{
1202 1347
 				$vobj->var_idx = $index;
1203 1348
 				$vobj->lang_code = Context::getLangType();
Please login to merge, or discard this patch.
modules/layout/layout.admin.controller.php 3 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 	/**
421 421
 	 * insert image into user layout
422 422
 	 * @param int $layout_srl
423
-	 * @param object $source file data
423
+	 * @param string $source file data
424 424
 	 * @return boolean (true : success, false : fail)
425 425
 	 */
426 426
 	function insertUserLayoutImage($layout_srl,$source)
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 	/**
545 545
 	 * Add the widget code for faceoff into user layout file
546 546
 	 * @param int $layout_srl
547
-	 * @param object $arg
547
+	 * @param null|stdClass $arg
548 548
 	 * @param string $content
549 549
 	 * @return string
550 550
 	 */
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
 
587 587
 	/**
588 588
 	 * export user layout
589
-	 * @return void
589
+	 * @return BaseObject|null
590 590
 	 */
591 591
 	function procLayoutAdminUserLayoutExport()
592 592
 	{
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 	/**
683 683
 	 * faceoff import
684 684
 	 * @deprecated
685
-	 * @return void
685
+	 * @return ModuleObject|null
686 686
 	 */
687 687
 	function procLayoutAdminUserLayoutImport()
688 688
 	{
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 
710 710
 	/**
711 711
 	 * layout copy
712
-	 * @return void
712
+	 * @return BaseObject|null
713 713
 	 */
714 714
 	function procLayoutAdminCopyLayout()
715 715
 	{
@@ -843,7 +843,7 @@  discard block
 block discarded – undo
843 843
 	/**
844 844
 	 * Layout file copy
845 845
 	 * @param $sourceLayoutSrl origin layout number
846
-	 * @param $targetLayoutSrl origin layout number
846
+	 * @param integer $targetLayoutSrl origin layout number
847 847
 	 * @return void
848 848
 	 */
849 849
 	function _copyLayoutFile($sourceLayoutSrl, $targetLayoutSrl)
Please login to merge, or discard this patch.
Spacing   +144 added lines, -144 removed lines patch added patch discarded remove patch
@@ -23,20 +23,20 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	function procLayoutAdminInsert()
25 25
 	{
26
-		if(Context::get('layout') == 'faceoff') return $this->stop('not supported');
26
+		if (Context::get('layout') == 'faceoff') return $this->stop('not supported');
27 27
 
28 28
 		// Get information to create a layout
29 29
 		$site_module_info = Context::get('site_module_info');
30
-		$args->site_srl = (int)$site_module_info->site_srl;
30
+		$args->site_srl = (int) $site_module_info->site_srl;
31 31
 		$args->layout_srl = getNextSequence();
32 32
 		$args->layout = Context::get('layout');
33 33
 		$args->title = Context::get('title');
34 34
 		$args->layout_type = Context::get('_layout_type');
35
-		if(!$args->layout_type) $args->layout_type = "P";
35
+		if (!$args->layout_type) $args->layout_type = "P";
36 36
 
37 37
 		// Insert into the DB
38 38
 		$output = $this->insertLayout($args);
39
-		if(!$output->toBool()) return $output;
39
+		if (!$output->toBool()) return $output;
40 40
 
41 41
 		// initiate if it is faceoff layout
42 42
 		$this->initLayout($args->layout_srl, $args->layout);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	{
71 71
 		$oLayoutModel = getModel('layout');
72 72
 		// Import a sample layout if it is faceoff
73
-		if($oLayoutModel->useDefaultLayout($layout_name))
73
+		if ($oLayoutModel->useDefaultLayout($layout_name))
74 74
 		{
75 75
 			$this->importLayout($layout_srl, $this->module_path.'tpl/faceOff_sample.tar');
76 76
 			// Remove a directory
@@ -101,25 +101,25 @@  discard block
 block discarded – undo
101 101
 		$is_sitemap = $extra_vars->is_sitemap;
102 102
 		unset($extra_vars->is_sitemap);
103 103
 
104
-		$args = Context::gets('layout_srl','title');
104
+		$args = Context::gets('layout_srl', 'title');
105 105
 		// Get layout information
106 106
 		$oLayoutModel = getModel('layout');
107 107
 		$oMenuAdminModel = getAdminModel('menu');
108 108
 		$layout_info = $oLayoutModel->getLayout($args->layout_srl);
109 109
 
110
-		if($layout_info->menu)
110
+		if ($layout_info->menu)
111 111
 		{
112 112
 			$menus = get_object_vars($layout_info->menu);
113 113
 		}
114
-		if(count($menus))
114
+		if (count($menus))
115 115
 		{
116
-			foreach($menus as $menu_id => $val)
116
+			foreach ($menus as $menu_id => $val)
117 117
 			{
118 118
 				$menu_srl = Context::get($menu_id);
119
-				if(!$menu_srl) continue;
119
+				if (!$menu_srl) continue;
120 120
 
121 121
 				// if menu is -1, get default menu in site
122
-				if($menu_srl == -1)
122
+				if ($menu_srl == -1)
123 123
 				{
124 124
 					$oModuleModel = getModel('module');
125 125
 					$start_module = $oModuleModel->getSiteInfo(0, $columnList);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 					$tmpArgs->url = $start_module->mid;
128 128
 					$tmpArgs->site_srl = 0;
129 129
 					$output = executeQuery('menu.getMenuItemByUrl', $tmpArgs);
130
-					if(!$output->toBool())
130
+					if (!$output->toBool())
131 131
 					{
132 132
 						return new BaseObject(-1, 'fail_to_update');
133 133
 					}
@@ -143,31 +143,31 @@  discard block
 block discarded – undo
143 143
 				$apply_layout = Context::get('apply_layout');
144 144
 				$apply_mobile_view = Context::get('apply_mobile_view');
145 145
 
146
-				if($apply_layout=='Y' || $apply_mobile_view=='Y')
146
+				if ($apply_layout == 'Y' || $apply_mobile_view == 'Y')
147 147
 				{
148 148
 					$menu_args = new stdClass();
149 149
 					$menu_args->menu_srl = $menu_srl;
150 150
 					$menu_args->site_srl = $layout_info->site_srl;
151 151
 					$output = executeQueryArray('layout.getLayoutModules', $menu_args);
152
-					if($output->data)
152
+					if ($output->data)
153 153
 					{
154 154
 						$modules = array();
155
-						for($i=0;$i<count($output->data);$i++)
155
+						for ($i = 0; $i < count($output->data); $i++)
156 156
 						{
157 157
 							$modules[] = $output->data[$i]->module_srl;
158 158
 						}
159 159
 
160
-						if(count($modules))
160
+						if (count($modules))
161 161
 						{
162 162
 							$update_args = new stdClass();
163
-							$update_args->module_srls = implode(',',$modules);
164
-							if($apply_layout == "Y")
163
+							$update_args->module_srls = implode(',', $modules);
164
+							if ($apply_layout == "Y")
165 165
 							{
166 166
 								$update_args->layout_srl = $args->layout_srl;
167 167
 							}
168
-							if($layout_info->layout_type == "M")
168
+							if ($layout_info->layout_type == "M")
169 169
 							{
170
-								if(Context::get('apply_mobile_view') == "Y")
170
+								if (Context::get('apply_mobile_view') == "Y")
171 171
 								{
172 172
 									$update_args->use_mobile = "Y";
173 173
 								}
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 							}
180 180
 
181 181
 							$oCacheHandler = CacheHandler::getInstance('object', null, true);
182
-							if($oCacheHandler->isSupport())
182
+							if ($oCacheHandler->isSupport())
183 183
 							{
184 184
 								$oCacheHandler->invalidateGroupKey('site_and_module');
185 185
 							}
@@ -191,21 +191,21 @@  discard block
 block discarded – undo
191 191
 
192 192
 		$tmpDir = sprintf('./files/attach/images/%s/tmp', $args->layout_srl);
193 193
 		// Separately handle if a type of extra_vars is an image
194
-		if($layout_info->extra_var)
194
+		if ($layout_info->extra_var)
195 195
 		{
196
-			foreach($layout_info->extra_var as $name => $vars)
196
+			foreach ($layout_info->extra_var as $name => $vars)
197 197
 			{
198
-				if($vars->type!='image') continue;
198
+				if ($vars->type != 'image') continue;
199 199
 
200 200
 				$fileName = $extra_vars->{$name};
201
-				if($vars->value == $fileName)
201
+				if ($vars->value == $fileName)
202 202
 				{
203 203
 					continue;
204 204
 				}
205 205
 
206 206
 				FileHandler::removeFile($vars->value);
207 207
 
208
-				if(!$fileName)
208
+				if (!$fileName)
209 209
 				{
210 210
 					continue;
211 211
 				}
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 				$pathInfo = pathinfo($fileName);
214 214
 				$tmpFileName = sprintf('%s/tmp/%s', $pathInfo['dirname'], $pathInfo['basename']);
215 215
 
216
-				if(!FileHandler::moveFile($tmpFileName, $fileName))
216
+				if (!FileHandler::moveFile($tmpFileName, $fileName))
217 217
 				{
218 218
 					unset($extra_vars->{$name});
219 219
 				}
@@ -225,21 +225,21 @@  discard block
 block discarded – undo
225 225
 		$oModuleController = getController('module');
226 226
 		$layout_config = new stdClass();
227 227
 		$layout_config->header_script = Context::get('header_script');
228
-		$oModuleController->insertModulePartConfig('layout',$args->layout_srl,$layout_config);
228
+		$oModuleController->insertModulePartConfig('layout', $args->layout_srl, $layout_config);
229 229
 		// Save a title of the menu
230 230
 		$extra_vars->menu_name_list = $menu_name_list;
231 231
 		// Variable setting for DB insert
232 232
 		$args->extra_vars = serialize($extra_vars);
233 233
 
234 234
 		$output = $this->updateLayout($args);
235
-		if(!$output->toBool())
235
+		if (!$output->toBool())
236 236
 		{
237 237
 			return $output;
238 238
 		}
239 239
 
240 240
 		FileHandler::removeDir($tmpDir);
241 241
 
242
-		if(!$is_sitemap)
242
+		if (!$is_sitemap)
243 243
 		{
244 244
 			return $this->setRedirectUrl(Context::get('error_return_url'), $output);
245 245
 		}
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	 */
259 259
 	function updateLayout($args) {
260 260
 		$output = executeQuery('layout.updateLayout', $args);
261
-		if($output->toBool())
261
+		if ($output->toBool())
262 262
 		{
263 263
 			$oLayoutModel = getModel('layout');
264 264
 			$cache_file = $oLayoutModel->getUserLayoutCache($args->layout_srl, Context::getLangType());
@@ -289,13 +289,13 @@  discard block
 block discarded – undo
289 289
 	{
290 290
 		$oLayoutModel = getModel('layout');
291 291
 
292
-		if($force)
292
+		if ($force)
293 293
 		{
294 294
 			$layoutInfo = $oLayoutModel->getLayout($layout_srl);
295
-			if($layoutInfo)
295
+			if ($layoutInfo)
296 296
 			{
297 297
 				$layoutList = $oLayoutModel->getLayoutInstanceList($layoutInfo->site_srl, $layoutInfo->layout_type, $layoutInfo->layout, array('layout_srl', 'layout'));
298
-				if(count($layoutList) <= 1)
298
+				if (count($layoutList) <= 1)
299 299
 				{
300 300
 					// uninstall package
301 301
 					$path = $layoutInfo->path;
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 					$packageSrl = $oAutoinstallModel->getPackageSrlByPath($path);
305 305
 					$oAutoinstallAdminController = getAdminController('autoinstall');
306 306
 
307
-					if($packageSrl)
307
+					if ($packageSrl)
308 308
 					{
309 309
 						$output = $oAutoinstallAdminController->uninstallPackageByPackageSrl($packageSrl);
310 310
 					}
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 						$output = $oAutoinstallAdminController->uninstallPackageByPath($path);
314 314
 					}
315 315
 
316
-					if(!$output->toBool())
316
+					if (!$output->toBool())
317 317
 					{
318 318
 						return new BaseObject(-1, $output->message);
319 319
 					}
@@ -331,9 +331,9 @@  discard block
 block discarded – undo
331 331
 		$args->layout_srl = $layout_srl;
332 332
 		$output = executeQuery("layout.deleteLayout", $args);
333 333
 
334
-		if(!$output->toBool()) return $output;
334
+		if (!$output->toBool()) return $output;
335 335
 
336
-		return new BaseObject(0,'success_deleted');
336
+		return new BaseObject(0, 'success_deleted');
337 337
 	}
338 338
 
339 339
 	/**
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 		$code_css   = Context::get('code_css');
354 354
 		$is_post    = ($_SERVER['REQUEST_METHOD'] == 'POST');
355 355
 
356
-		if(!$layout_srl || !$code || !$is_post)
356
+		if (!$layout_srl || !$code || !$is_post)
357 357
 		{
358 358
 			return new BaseObject(-1, 'msg_invalid_request');
359 359
 		}
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 	function procLayoutAdminCodeReset()
377 377
 	{
378 378
 		$layout_srl = Context::get('layout_srl');
379
-		if(!$layout_srl) return new BaseObject(-1, 'msg_invalid_request');
379
+		if (!$layout_srl) return new BaseObject(-1, 'msg_invalid_request');
380 380
 
381 381
 		// delete user layout file
382 382
 		$oLayoutModel = getModel('layout');
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 		$info = $oLayoutModel->getLayout($layout_srl);
387 387
 
388 388
 		// if face off delete, tmp file
389
-		if($oLayoutModel->useDefaultLayout($info->layout))
389
+		if ($oLayoutModel->useDefaultLayout($info->layout))
390 390
 		{
391 391
 			$this->deleteUserLayoutTempFile($layout_srl);
392 392
 			$faceoff_css = $oLayoutModel->getUserLayoutFaceOffCss($layout_srl);
@@ -404,11 +404,11 @@  discard block
 block discarded – undo
404 404
 	 */
405 405
 	function procLayoutAdminUserImageUpload()
406 406
 	{
407
-		if(!Context::isUploaded()) exit();
407
+		if (!Context::isUploaded()) exit();
408 408
 
409 409
 		$image = Context::get('user_layout_image');
410 410
 		$layout_srl = Context::get('layout_srl');
411
-		if(!is_uploaded_file($image['tmp_name'])) exit();
411
+		if (!is_uploaded_file($image['tmp_name'])) exit();
412 412
 
413 413
 		$this->insertUserLayoutImage($layout_srl, $image);
414 414
 		$this->setTemplatePath($this->module_path.'tpl');
@@ -423,24 +423,24 @@  discard block
 block discarded – undo
423 423
 	 * @param object $source file data
424 424
 	 * @return boolean (true : success, false : fail)
425 425
 	 */
426
-	function insertUserLayoutImage($layout_srl,$source)
426
+	function insertUserLayoutImage($layout_srl, $source)
427 427
 	{
428 428
 		$oLayoutModel = getModel('layout');
429 429
 		$path = $oLayoutModel->getUserLayoutImagePath($layout_srl);
430
-		if(!is_dir($path)) FileHandler::makeDir($path);
430
+		if (!is_dir($path)) FileHandler::makeDir($path);
431 431
 
432 432
 		$filename = strtolower($source['name']);
433
-		if($filename != urlencode($filename))
433
+		if ($filename != urlencode($filename))
434 434
 		{
435
-			$ext = substr(strrchr($filename,'.'),1);
435
+			$ext = substr(strrchr($filename, '.'), 1);
436 436
 			$filename = sprintf('%s.%s', md5($filename), $ext);
437 437
 		}
438 438
 
439 439
 		// Check uploaded file
440
-		if(!checkUploadedFile($source['tmp_name'])) return false;
440
+		if (!checkUploadedFile($source['tmp_name'])) return false;
441 441
 		
442
-		if(file_exists($path .'/'. $filename)) @unlink($path . $filename);
443
-		if(!move_uploaded_file($source['tmp_name'], $path . $filename )) return false;
442
+		if (file_exists($path.'/'.$filename)) @unlink($path.$filename);
443
+		if (!move_uploaded_file($source['tmp_name'], $path.$filename)) return false;
444 444
 		return true;
445 445
 	}
446 446
 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	{
453 453
 		$filename = Context::get('filename');
454 454
 		$layout_srl = Context::get('layout_srl');
455
-		$this->removeUserLayoutImage($layout_srl,$filename);
455
+		$this->removeUserLayoutImage($layout_srl, $filename);
456 456
 		$this->setMessage('success_deleted');
457 457
 		$this->setRedirectUrl(Context::get('error_return_url'));
458 458
 	}
@@ -463,11 +463,11 @@  discard block
 block discarded – undo
463 463
 	 * @param string $filename
464 464
 	 * @return void
465 465
 	 */
466
-	function removeUserLayoutImage($layout_srl,$filename)
466
+	function removeUserLayoutImage($layout_srl, $filename)
467 467
 	{
468 468
 		$oLayoutModel = getModel('layout');
469 469
 		$path = $oLayoutModel->getUserLayoutImagePath($layout_srl);
470
-		@unlink($path . $filename);
470
+		@unlink($path.$filename);
471 471
 	}
472 472
 
473 473
 	// deprecated
@@ -482,19 +482,19 @@  discard block
 block discarded – undo
482 482
 		$oModuleModel = getModel('module');
483 483
 
484 484
 		$mid = Context::get('mid');
485
-		if(!$mid) return new BaseObject(-1, 'msg_invalid_request');
485
+		if (!$mid) return new BaseObject(-1, 'msg_invalid_request');
486 486
 
487 487
 		$site_module_info = Context::get('site_module_info');
488 488
 		$columnList = array('layout_srl');
489 489
 		$module_info = $oModuleModel->getModuleInfoByMid($mid, $site_module_info->site_srl, $columnList);
490 490
 		$layout_srl = $module_info->layout_srl;
491
-		if(!$layout_srl) return new BaseObject(-1, 'msg_invalid_request');
491
+		if (!$layout_srl) return new BaseObject(-1, 'msg_invalid_request');
492 492
 
493 493
 		$oLayoutModel = getModel('layout');
494 494
 
495 495
 		// save tmp?
496 496
 		$temp = Context::get('saveTemp');
497
-		if($temp =='Y')
497
+		if ($temp == 'Y')
498 498
 		{
499 499
 			$oLayoutModel->setUseUserLayoutTemp();
500 500
 		}
@@ -504,28 +504,28 @@  discard block
 block discarded – undo
504 504
 			$this->deleteUserLayoutTempFile($layout_srl);
505 505
 		}
506 506
 
507
-		$this->add('saveTemp',$temp);
507
+		$this->add('saveTemp', $temp);
508 508
 
509 509
 		// write user layout
510
-		$extension_obj = Context::gets('e1','e2','neck','knee');
510
+		$extension_obj = Context::gets('e1', 'e2', 'neck', 'knee');
511 511
 
512 512
 		$file = $oLayoutModel->getUserLayoutHtml($layout_srl);
513 513
 		$content = FileHandler::readFile($file);
514
-		$content = $this->addExtension($layout_srl,$extension_obj,$content);
515
-		FileHandler::writeFile($file,$content);
514
+		$content = $this->addExtension($layout_srl, $extension_obj, $content);
515
+		FileHandler::writeFile($file, $content);
516 516
 
517 517
 		// write faceoff.css
518 518
 		$css = stripslashes(Context::get('css'));
519 519
 
520 520
 		$css_file = $oLayoutModel->getUserLayoutFaceOffCss($layout_srl);
521
-		FileHandler::writeFile($css_file,$css);
521
+		FileHandler::writeFile($css_file, $css);
522 522
 
523 523
 		// write ini
524
-		$obj = Context::gets('type','align','column');
525
-		$obj = (array)$obj;
524
+		$obj = Context::gets('type', 'align', 'column');
525
+		$obj = (array) $obj;
526 526
 		$src = $oLayoutModel->getUserLayoutIniConfig($layout_srl);
527
-		foreach($obj as $key => $val) $src[$key] = $val;
528
-		$this->insertUserLayoutValue($layout_srl,$src);
527
+		foreach ($obj as $key => $val) $src[$key] = $val;
528
+		$this->insertUserLayoutValue($layout_srl, $src);
529 529
 	}
530 530
 
531 531
 	/**
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	 * @param object $arr layout ini
535 535
 	 * @return void
536 536
 	 */
537
-	function insertUserLayoutValue($layout_srl,$arr)
537
+	function insertUserLayoutValue($layout_srl, $arr)
538 538
 	{
539 539
 		$oLayoutModel = getModel('layout');
540 540
 		$file = $oLayoutModel->getUserLayoutIni($layout_srl);
@@ -548,24 +548,24 @@  discard block
 block discarded – undo
548 548
 	 * @param string $content
549 549
 	 * @return string
550 550
 	 */
551
-	function addExtension($layout_srl,$arg,$content)
551
+	function addExtension($layout_srl, $arg, $content)
552 552
 	{
553 553
 		$oLayoutModel = getModel('layout');
554 554
 		$reg = '/(<\!\-\- start\-e1 \-\->)(.*)(<\!\-\- end\-e1 \-\->)/i';
555
-		$extension_content =  '\1' .stripslashes($arg->e1) . '\3';
556
-		$content = preg_replace($reg,$extension_content,$content);
555
+		$extension_content = '\1'.stripslashes($arg->e1).'\3';
556
+		$content = preg_replace($reg, $extension_content, $content);
557 557
 
558 558
 		$reg = '/(<\!\-\- start\-e2 \-\->)(.*)(<\!\-\- end\-e2 \-\->)/i';
559
-		$extension_content =  '\1' .stripslashes($arg->e2) . '\3';
560
-		$content = preg_replace($reg,$extension_content,$content);
559
+		$extension_content = '\1'.stripslashes($arg->e2).'\3';
560
+		$content = preg_replace($reg, $extension_content, $content);
561 561
 
562 562
 		$reg = '/(<\!\-\- start\-neck \-\->)(.*)(<\!\-\- end\-neck \-\->)/i';
563
-		$extension_content =  '\1' .stripslashes($arg->neck) . '\3';
564
-		$content = preg_replace($reg,$extension_content,$content);
563
+		$extension_content = '\1'.stripslashes($arg->neck).'\3';
564
+		$content = preg_replace($reg, $extension_content, $content);
565 565
 
566 566
 		$reg = '/(<\!\-\- start\-knee \-\->)(.*)(<\!\-\- end\-knee \-\->)/i';
567
-		$extension_content =  '\1' .stripslashes($arg->knee) . '\3';
568
-		$content = preg_replace($reg,$extension_content,$content);
567
+		$extension_content = '\1'.stripslashes($arg->knee).'\3';
568
+		$content = preg_replace($reg, $extension_content, $content);
569 569
 		return $content;
570 570
 	}
571 571
 
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 	{
579 579
 		$oLayoutModel = getModel('layout');
580 580
 		$file_list = $oLayoutModel->getUserLayoutTempFileList($layout_srl);
581
-		foreach($file_list as $key => $file)
581
+		foreach ($file_list as $key => $file)
582 582
 		{
583 583
 			FileHandler::removeFile($file);
584 584
 		}
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 	function procLayoutAdminUserLayoutExport()
592 592
 	{
593 593
 		$layout_srl = Context::get('layout_srl');
594
-		if(!$layout_srl) return new BaseObject('-1','msg_invalid_request');
594
+		if (!$layout_srl) return new BaseObject('-1', 'msg_invalid_request');
595 595
 
596 596
 		require_once(_XE_PATH_.'libs/tar.class.php');
597 597
 		$oLayoutModel = getModel('layout');
@@ -606,30 +606,30 @@  discard block
 block discarded – undo
606 606
 		$file_list = $oLayoutModel->getUserLayoutFileList($layout_srl);
607 607
 		unset($file_list[2]);
608 608
 
609
-		foreach($file_list as $file)
609
+		foreach ($file_list as $file)
610 610
 		{
611
-			if(strncasecmp('images', $file, 6) === 0) continue;
611
+			if (strncasecmp('images', $file, 6) === 0) continue;
612 612
 
613 613
 			// replace path
614
-			$file = $target_path . $file;
614
+			$file = $target_path.$file;
615 615
 			$content = FileHandler::readFile($file);
616
-			$pattern = '/(http:\/\/[^ ]+)?(\.\/)?' . str_replace('/', '\/', (str_replace('./', '', $file_path))) . '/';
617
-			if(basename($file) == 'faceoff.css' || basename($file) == 'layout.css')
616
+			$pattern = '/(http:\/\/[^ ]+)?(\.\/)?'.str_replace('/', '\/', (str_replace('./', '', $file_path))).'/';
617
+			if (basename($file) == 'faceoff.css' || basename($file) == 'layout.css')
618 618
 				$content = preg_replace($pattern, '../', $content);
619 619
 			else
620 620
 				$content = preg_replace($pattern, './', $content);
621 621
 
622 622
 			// replace ini config
623
-			foreach($ini_config as $key => $value)
623
+			foreach ($ini_config as $key => $value)
624 624
 			{
625
-				$content = str_replace('{$layout_info->faceoff_ini_config[\'' . $key . '\']}', $value, $content);
625
+				$content = str_replace('{$layout_info->faceoff_ini_config[\''.$key.'\']}', $value, $content);
626 626
 			}
627 627
 
628 628
 			FileHandler::writeFile($file, $content);
629 629
 		}
630 630
 
631 631
 		// make info.xml
632
-		$info_file = $target_path . 'conf/info.xml';
632
+		$info_file = $target_path.'conf/info.xml';
633 633
 		FileHandler::copyFile('./modules/layout/faceoff/conf/info.xml', $info_file);
634 634
 		$content = FileHandler::readFile($info_file);
635 635
 		$content = str_replace('type="faceoff"', '', $content);
@@ -637,19 +637,19 @@  discard block
 block discarded – undo
637 637
 		$file_list[] = 'conf/info.xml';
638 638
 
639 639
 		// make css file
640
-		$css_file = $target_path . 'css/layout.css';
640
+		$css_file = $target_path.'css/layout.css';
641 641
 		FileHandler::copyFile('./modules/layout/faceoff/css/layout.css', $css_file);
642 642
 		$content = FileHandler::readFile('./modules/layout/tpl/css/widget.css');
643
-		FileHandler::writeFile($css_file, "\n" . $content, 'a');
644
-		$content = FileHandler::readFile($target_path . 'faceoff.css');
645
-		FileHandler::writeFile($css_file, "\n" . $content, 'a');
646
-		$content = FileHandler::readFile($target_path . 'layout.css');
647
-		FileHandler::writeFile($css_file, "\n" . $content, 'a');
643
+		FileHandler::writeFile($css_file, "\n".$content, 'a');
644
+		$content = FileHandler::readFile($target_path.'faceoff.css');
645
+		FileHandler::writeFile($css_file, "\n".$content, 'a');
646
+		$content = FileHandler::readFile($target_path.'layout.css');
647
+		FileHandler::writeFile($css_file, "\n".$content, 'a');
648 648
 
649 649
 		// css load
650
-		$content = FileHandler::readFile($target_path . 'layout.html');
651
-		$content = "<load target=\"css/layout.css\" />\n" . $content;
652
-		FileHandler::writeFile($target_path . 'layout.html', $content);
650
+		$content = FileHandler::readFile($target_path.'layout.html');
651
+		$content = "<load target=\"css/layout.css\" />\n".$content;
652
+		FileHandler::writeFile($target_path.'layout.html', $content);
653 653
 		unset($file_list[3]);
654 654
 		unset($file_list[1]);
655 655
 		$file_list[] = 'css/layout.css';
@@ -658,16 +658,16 @@  discard block
 block discarded – undo
658 658
 		$tar = new tar();
659 659
 		$user_layout_path = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath(0));
660 660
 		chdir($user_layout_path);
661
-		foreach($file_list as $key => $file) $tar->addFile($file);
661
+		foreach ($file_list as $key => $file) $tar->addFile($file);
662 662
 
663 663
 		$stream = $tar->toTarStream();
664
-		$filename = 'faceoff_' . date('YmdHis') . '.tar';
664
+		$filename = 'faceoff_'.date('YmdHis').'.tar';
665 665
 		header("Cache-Control: ");
666 666
 		header("Pragma: ");
667 667
 		header("Content-Type: application/x-compressed");
668
-		header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
668
+		header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
669 669
 		//            header("Content-Length: " .strlen($stream)); ?? why??
670
-		header('Content-Disposition: attachment; filename="'. $filename .'"');
670
+		header('Content-Disposition: attachment; filename="'.$filename.'"');
671 671
 		header("Content-Transfer-Encoding: binary\n");
672 672
 		echo $stream;
673 673
 		// Close Context and then exit
@@ -689,18 +689,18 @@  discard block
 block discarded – undo
689 689
 		return $this->stop('not supported');
690 690
 
691 691
 		// check upload
692
-		if(!Context::isUploaded()) exit();
692
+		if (!Context::isUploaded()) exit();
693 693
 		$file = Context::get('file');
694
-		if(!is_uploaded_file($file['tmp_name']) || !checkUploadedFile($file['tmp_name'])) exit();
694
+		if (!is_uploaded_file($file['tmp_name']) || !checkUploadedFile($file['tmp_name'])) exit();
695 695
 
696
-		if(substr_compare($file['name'], '.tar', -4) !== 0) exit();
696
+		if (substr_compare($file['name'], '.tar', -4) !== 0) exit();
697 697
 
698 698
 		$layout_srl = Context::get('layout_srl');
699
-		if(!$layout_srl) exit();
699
+		if (!$layout_srl) exit();
700 700
 
701 701
 		$oLayoutModel = getModel('layout');
702 702
 		$user_layout_path = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath($layout_srl));
703
-		if(!move_uploaded_file($file['tmp_name'], $user_layout_path . 'faceoff.tar')) exit();
703
+		if (!move_uploaded_file($file['tmp_name'], $user_layout_path.'faceoff.tar')) exit();
704 704
 
705 705
 		$this->importLayout($layout_srl, $user_layout_path.'faceoff.tar');
706 706
 
@@ -714,12 +714,12 @@  discard block
 block discarded – undo
714 714
 	function procLayoutAdminCopyLayout()
715 715
 	{
716 716
 		$sourceArgs = Context::getRequestVars();
717
-		if($sourceArgs->layout == 'faceoff')
717
+		if ($sourceArgs->layout == 'faceoff')
718 718
 		{
719 719
 			return $this->stop('not supported');
720 720
 		}
721 721
 
722
-		if(!$sourceArgs->layout_srl)
722
+		if (!$sourceArgs->layout_srl)
723 723
 		{
724 724
 			return $this->stop('msg_empty_origin_layout');
725 725
 		}
@@ -727,12 +727,12 @@  discard block
 block discarded – undo
727 727
 		$oLayoutModel = getModel('layout');
728 728
 		$layout = $oLayoutModel->getLayout($sourceArgs->layout_srl);
729 729
 
730
-		if(!$sourceArgs->title)
730
+		if (!$sourceArgs->title)
731 731
 		{
732 732
 			$sourceArgs->title = array($layout->title.'_'.$this->_makeRandomMid());
733 733
 		}
734 734
 
735
-		if(!is_array($sourceArgs->title) || count($sourceArgs->title) == 0)
735
+		if (!is_array($sourceArgs->title) || count($sourceArgs->title) == 0)
736 736
 		{
737 737
 			return $this->stop('msg_empty_target_layout');
738 738
 		}
@@ -742,11 +742,11 @@  discard block
 block discarded – undo
742 742
 		$args->extra_vars = $output->extra_vars;
743 743
 		$extra_vars = unserialize($args->extra_vars);
744 744
 		
745
-		if($layout->extra_var_count) {
745
+		if ($layout->extra_var_count) {
746 746
 			$reg = "/^.\/files\/attach\/images\/([0-9]+)\/(.*)/";
747
-			if($extra_vars) foreach($extra_vars as $key => $val) {
748
-				if($layout->extra_var->{$key}->type == 'image') {
749
-					if(!preg_match($reg,$val,$matches)) continue;
747
+			if ($extra_vars) foreach ($extra_vars as $key => $val) {
748
+				if ($layout->extra_var->{$key}->type == 'image') {
749
+					if (!preg_match($reg, $val, $matches)) continue;
750 750
 					$image_list[$key]->filename = $matches[2];
751 751
 					$image_list[$key]->old_file = $val;
752 752
 				}
@@ -758,19 +758,19 @@  discard block
 block discarded – undo
758 758
 		$layout_config->header_script = $extra_vars->header_script;
759 759
 
760 760
 		// Get information to create a layout
761
-		$args->site_srl = (int)$layout->site_srl;
761
+		$args->site_srl = (int) $layout->site_srl;
762 762
 		$args->layout = $layout->layout;
763 763
 		$args->layout_type = $layout->layout_type;
764
-		if(!$args->layout_type) $args->layout_type = "P";
764
+		if (!$args->layout_type) $args->layout_type = "P";
765 765
 
766 766
 		$oDB = &DB::getInstance();
767 767
 		$oDB->begin();
768 768
 
769
-		if(is_array($sourceArgs->title))
769
+		if (is_array($sourceArgs->title))
770 770
 		{
771
-			foreach($sourceArgs->title AS $key=>$value)
771
+			foreach ($sourceArgs->title AS $key=>$value)
772 772
 			{
773
-				if(!trim($value))
773
+				if (!trim($value))
774 774
 				{
775 775
 					continue;
776 776
 				}
@@ -778,9 +778,9 @@  discard block
 block discarded – undo
778 778
 				$args->layout_srl = getNextSequence();
779 779
 				$args->title = $value;
780 780
 
781
-				if(is_array($image_list)) {
782
-					foreach($image_list as $key=>$val) {
783
-						$new_file = sprintf("./files/attach/images/%s/%s", $args->layout_srl,$val->filename);
781
+				if (is_array($image_list)) {
782
+					foreach ($image_list as $key=>$val) {
783
+						$new_file = sprintf("./files/attach/images/%s/%s", $args->layout_srl, $val->filename);
784 784
 						FileHandler::copyFile($val->old_file, $new_file);
785 785
 						$extra_vars->{$key} = $new_file;
786 786
 					}
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 
793 793
 				// Insert into the DB
794 794
 				$output = $this->insertLayout($args);
795
-				if(!$output->toBool())
795
+				if (!$output->toBool())
796 796
 				{
797 797
 					$oDB->rollback();
798 798
 					return $output;
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 		$oDB->commit();
816 816
 
817 817
 		$this->setMessage('success_registed');
818
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
818
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
819 819
 			global $lang;
820 820
 			htmlHeader();
821 821
 			alertScript($lang->success_registed);
@@ -831,9 +831,9 @@  discard block
 block discarded – undo
831 831
 	{
832 832
 		$time = $_SERVER['REQUEST_TIME'];
833 833
 		$randomString = "";
834
-		for($i=0;$i<4;$i++)
834
+		for ($i = 0; $i < 4; $i++)
835 835
 		{
836
-			$doc = rand()%26+65;
836
+			$doc = rand() % 26 + 65;
837 837
 			$randomString .= chr($doc);
838 838
 		}
839 839
 
@@ -857,12 +857,12 @@  discard block
 block discarded – undo
857 857
 		FileHandler::makeDir($targetImagePath);
858 858
 
859 859
 		$sourceFileList = $oLayoutModel->getUserLayoutFileList($sourceLayoutSrl);
860
-		foreach($sourceFileList as $key => $file)
860
+		foreach ($sourceFileList as $key => $file)
861 861
 		{
862
-			if(is_readable($sourceLayoutPath.$file))
862
+			if (is_readable($sourceLayoutPath.$file))
863 863
 			{
864 864
 				FileHandler::copyFile($sourceLayoutPath.$file, $targetLayoutPath.$file);
865
-				if($file == 'layout.html' || $file == 'layout.css')
865
+				if ($file == 'layout.html' || $file == 'layout.css')
866 866
 				{
867 867
 					$this->_changeFilepathInSource($targetLayoutPath.$file, $sourceImagePath, $targetImagePath);
868 868
 				}
@@ -893,9 +893,9 @@  discard block
 block discarded – undo
893 893
 		$oLayoutModel = getModel('layout');
894 894
 		$user_layout_path = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath($layout_srl));
895 895
 		$file_list = $oLayoutModel->getUserLayoutFileList($layout_srl);
896
-		foreach($file_list as $key => $file)
896
+		foreach ($file_list as $key => $file)
897 897
 		{
898
-			FileHandler::removeFile($user_layout_path . $file);
898
+			FileHandler::removeFile($user_layout_path.$file);
899 899
 		}
900 900
 
901 901
 		require_once(_XE_PATH_.'libs/tar.class.php');
@@ -904,12 +904,12 @@  discard block
 block discarded – undo
904 904
 		$tar = new tar();
905 905
 		$tar->openTAR($source_file);
906 906
 		// If layout.ini file does not exist
907
-		if(!$tar->getFile('layout.ini')) return;
907
+		if (!$tar->getFile('layout.ini')) return;
908 908
 
909
-		$replace_path = getNumberingPath($layout_srl,3);
910
-		foreach($tar->files as $key => $info)
909
+		$replace_path = getNumberingPath($layout_srl, 3);
910
+		foreach ($tar->files as $key => $info)
911 911
 		{
912
-			FileHandler::writeFile($user_layout_path . $info['name'],str_replace('__LAYOUT_PATH__',$replace_path,$info['file']));
912
+			FileHandler::writeFile($user_layout_path.$info['name'], str_replace('__LAYOUT_PATH__', $replace_path, $info['file']));
913 913
 		}
914 914
 		// Remove uploaded file
915 915
 		FileHandler::removeFile($source_file);
@@ -927,32 +927,32 @@  discard block
 block discarded – undo
927 927
 		$this->setTemplatePath($this->module_path.'tpl');
928 928
 		$this->setTemplateFile("after_upload_config_image.html");
929 929
 
930
-		if(!$img['tmp_name'] || !is_uploaded_file($img['tmp_name']) || !checkUploadedFile($img['tmp_name']))
930
+		if (!$img['tmp_name'] || !is_uploaded_file($img['tmp_name']) || !checkUploadedFile($img['tmp_name']))
931 931
 		{
932 932
 			Context::set('msg', Context::getLang('upload failed'));
933 933
 			return;
934 934
 		}
935 935
 
936
-		if(!preg_match('/\.(jpg|jpeg|gif|png)$/i', $img['name']))
936
+		if (!preg_match('/\.(jpg|jpeg|gif|png)$/i', $img['name']))
937 937
 		{
938 938
 			Context::set('msg', Context::getLang('msg_layout_image_target'));
939 939
 			return;
940 940
 		}
941 941
 
942 942
 		$path = sprintf('./files/attach/images/%s/', $layoutSrl);
943
-		$tmpPath = $path . 'tmp/';
944
-		if(!FileHandler::makeDir($tmpPath))
943
+		$tmpPath = $path.'tmp/';
944
+		if (!FileHandler::makeDir($tmpPath))
945 945
 		{
946 946
 			Context::set('msg', Context::getLang('make directory failed'));
947 947
 			return;
948 948
 		}
949 949
 
950
-		$ext = substr(strrchr($img['name'],'.'),1);
951
-		$_fileName = md5(crypt(rand(1000000,900000), rand(0,100))).'.'.$ext;
952
-		$fileName = $path . $_fileName;
953
-		$tmpFileName = $tmpPath . $_fileName;
950
+		$ext = substr(strrchr($img['name'], '.'), 1);
951
+		$_fileName = md5(crypt(rand(1000000, 900000), rand(0, 100))).'.'.$ext;
952
+		$fileName = $path.$_fileName;
953
+		$tmpFileName = $tmpPath.$_fileName;
954 954
 
955
-		if(!move_uploaded_file($img['tmp_name'], $tmpFileName))
955
+		if (!move_uploaded_file($img['tmp_name'], $tmpFileName))
956 956
 		{
957 957
 			Context::set('msg', Context::getLang('move file failed'));
958 958
 			return;
@@ -977,9 +977,9 @@  discard block
 block discarded – undo
977 977
 		$oModel = getModel('layout');
978 978
 		$layoutInfo = $oModel->getLayout($layoutSrl);
979 979
 
980
-		if($layoutInfo->extra_var_count)
980
+		if ($layoutInfo->extra_var_count)
981 981
 		{
982
-			foreach($layoutInfo->extra_var as $varId => $val)
982
+			foreach ($layoutInfo->extra_var as $varId => $val)
983 983
 			{
984 984
 				$newLayoutInfo->{$varId} = $val->value;
985 985
 			}
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
 		$args->layout_srl = $layoutSrl;
991 991
 		$args->extra_vars = serialize($newLayoutInfo);
992 992
 		$output = $this->updateLayout($args);
993
-		if(!$output->toBool())
993
+		if (!$output->toBool())
994 994
 		{
995 995
 			Context::set('msg', Context::getLang($output->getMessage()));
996 996
 			return $output;
Please login to merge, or discard this patch.
Braces   +94 added lines, -42 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	function procLayoutAdminInsert()
25 25
 	{
26
-		if(Context::get('layout') == 'faceoff') return $this->stop('not supported');
26
+		if(Context::get('layout') == 'faceoff') {
27
+			return $this->stop('not supported');
28
+		}
27 29
 
28 30
 		// Get information to create a layout
29 31
 		$site_module_info = Context::get('site_module_info');
@@ -32,11 +34,15 @@  discard block
 block discarded – undo
32 34
 		$args->layout = Context::get('layout');
33 35
 		$args->title = Context::get('title');
34 36
 		$args->layout_type = Context::get('_layout_type');
35
-		if(!$args->layout_type) $args->layout_type = "P";
37
+		if(!$args->layout_type) {
38
+			$args->layout_type = "P";
39
+		}
36 40
 
37 41
 		// Insert into the DB
38 42
 		$output = $this->insertLayout($args);
39
-		if(!$output->toBool()) return $output;
43
+		if(!$output->toBool()) {
44
+			return $output;
45
+		}
40 46
 
41 47
 		// initiate if it is faceoff layout
42 48
 		$this->initLayout($args->layout_srl, $args->layout);
@@ -44,7 +50,9 @@  discard block
 block discarded – undo
44 50
 		// update layout info
45 51
 		Context::set('layout_srl', $args->layout_srl);
46 52
 		$output = $this->procLayoutAdminUpdate();
47
-		if (!$output->toBool()) return $output;
53
+		if (!$output->toBool()) {
54
+			return $output;
55
+		}
48 56
 
49 57
 		return $this->setRedirectUrl(Context::get('success_return_url'), $output);
50 58
 	}
@@ -74,8 +82,7 @@  discard block
 block discarded – undo
74 82
 		{
75 83
 			$this->importLayout($layout_srl, $this->module_path.'tpl/faceOff_sample.tar');
76 84
 			// Remove a directory
77
-		}
78
-		else
85
+		} else
79 86
 		{
80 87
 			FileHandler::removeDir($oLayoutModel->getUserLayoutPath($layout_srl));
81 88
 		}
@@ -116,7 +123,9 @@  discard block
 block discarded – undo
116 123
 			foreach($menus as $menu_id => $val)
117 124
 			{
118 125
 				$menu_srl = Context::get($menu_id);
119
-				if(!$menu_srl) continue;
126
+				if(!$menu_srl) {
127
+					continue;
128
+				}
120 129
 
121 130
 				// if menu is -1, get default menu in site
122 131
 				if($menu_srl == -1)
@@ -172,8 +181,7 @@  discard block
 block discarded – undo
172 181
 									$update_args->use_mobile = "Y";
173 182
 								}
174 183
 								$output = executeQuery('layout.updateModuleMLayout', $update_args);
175
-							}
176
-							else
184
+							} else
177 185
 							{
178 186
 								$output = executeQuery('layout.updateModuleLayout', $update_args);
179 187
 							}
@@ -195,7 +203,9 @@  discard block
 block discarded – undo
195 203
 		{
196 204
 			foreach($layout_info->extra_var as $name => $vars)
197 205
 			{
198
-				if($vars->type!='image') continue;
206
+				if($vars->type!='image') {
207
+					continue;
208
+				}
199 209
 
200 210
 				$fileName = $extra_vars->{$name};
201 211
 				if($vars->value == $fileName)
@@ -242,8 +252,7 @@  discard block
 block discarded – undo
242 252
 		if(!$is_sitemap)
243 253
 		{
244 254
 			return $this->setRedirectUrl(Context::get('error_return_url'), $output);
245
-		}
246
-		else
255
+		} else
247 256
 		{
248 257
 			$context = Context::getInstance();
249 258
 			$context->setRequestMethod('JSON');
@@ -307,8 +316,7 @@  discard block
 block discarded – undo
307 316
 					if($packageSrl)
308 317
 					{
309 318
 						$output = $oAutoinstallAdminController->uninstallPackageByPackageSrl($packageSrl);
310
-					}
311
-					else
319
+					} else
312 320
 					{
313 321
 						$output = $oAutoinstallAdminController->uninstallPackageByPath($path);
314 322
 					}
@@ -331,7 +339,9 @@  discard block
 block discarded – undo
331 339
 		$args->layout_srl = $layout_srl;
332 340
 		$output = executeQuery("layout.deleteLayout", $args);
333 341
 
334
-		if(!$output->toBool()) return $output;
342
+		if(!$output->toBool()) {
343
+			return $output;
344
+		}
335 345
 
336 346
 		return new BaseObject(0,'success_deleted');
337 347
 	}
@@ -376,7 +386,9 @@  discard block
 block discarded – undo
376 386
 	function procLayoutAdminCodeReset()
377 387
 	{
378 388
 		$layout_srl = Context::get('layout_srl');
379
-		if(!$layout_srl) return new BaseObject(-1, 'msg_invalid_request');
389
+		if(!$layout_srl) {
390
+			return new BaseObject(-1, 'msg_invalid_request');
391
+		}
380 392
 
381 393
 		// delete user layout file
382 394
 		$oLayoutModel = getModel('layout');
@@ -404,11 +416,15 @@  discard block
 block discarded – undo
404 416
 	 */
405 417
 	function procLayoutAdminUserImageUpload()
406 418
 	{
407
-		if(!Context::isUploaded()) exit();
419
+		if(!Context::isUploaded()) {
420
+			exit();
421
+		}
408 422
 
409 423
 		$image = Context::get('user_layout_image');
410 424
 		$layout_srl = Context::get('layout_srl');
411
-		if(!is_uploaded_file($image['tmp_name'])) exit();
425
+		if(!is_uploaded_file($image['tmp_name'])) {
426
+			exit();
427
+		}
412 428
 
413 429
 		$this->insertUserLayoutImage($layout_srl, $image);
414 430
 		$this->setTemplatePath($this->module_path.'tpl');
@@ -427,7 +443,9 @@  discard block
 block discarded – undo
427 443
 	{
428 444
 		$oLayoutModel = getModel('layout');
429 445
 		$path = $oLayoutModel->getUserLayoutImagePath($layout_srl);
430
-		if(!is_dir($path)) FileHandler::makeDir($path);
446
+		if(!is_dir($path)) {
447
+			FileHandler::makeDir($path);
448
+		}
431 449
 
432 450
 		$filename = strtolower($source['name']);
433 451
 		if($filename != urlencode($filename))
@@ -437,10 +455,16 @@  discard block
 block discarded – undo
437 455
 		}
438 456
 
439 457
 		// Check uploaded file
440
-		if(!checkUploadedFile($source['tmp_name'])) return false;
458
+		if(!checkUploadedFile($source['tmp_name'])) {
459
+			return false;
460
+		}
441 461
 		
442
-		if(file_exists($path .'/'. $filename)) @unlink($path . $filename);
443
-		if(!move_uploaded_file($source['tmp_name'], $path . $filename )) return false;
462
+		if(file_exists($path .'/'. $filename)) {
463
+			@unlink($path . $filename);
464
+		}
465
+		if(!move_uploaded_file($source['tmp_name'], $path . $filename )) {
466
+			return false;
467
+		}
444 468
 		return true;
445 469
 	}
446 470
 
@@ -482,13 +506,17 @@  discard block
 block discarded – undo
482 506
 		$oModuleModel = getModel('module');
483 507
 
484 508
 		$mid = Context::get('mid');
485
-		if(!$mid) return new BaseObject(-1, 'msg_invalid_request');
509
+		if(!$mid) {
510
+			return new BaseObject(-1, 'msg_invalid_request');
511
+		}
486 512
 
487 513
 		$site_module_info = Context::get('site_module_info');
488 514
 		$columnList = array('layout_srl');
489 515
 		$module_info = $oModuleModel->getModuleInfoByMid($mid, $site_module_info->site_srl, $columnList);
490 516
 		$layout_srl = $module_info->layout_srl;
491
-		if(!$layout_srl) return new BaseObject(-1, 'msg_invalid_request');
517
+		if(!$layout_srl) {
518
+			return new BaseObject(-1, 'msg_invalid_request');
519
+		}
492 520
 
493 521
 		$oLayoutModel = getModel('layout');
494 522
 
@@ -497,8 +525,7 @@  discard block
 block discarded – undo
497 525
 		if($temp =='Y')
498 526
 		{
499 527
 			$oLayoutModel->setUseUserLayoutTemp();
500
-		}
501
-		else
528
+		} else
502 529
 		{
503 530
 			// delete temp files
504 531
 			$this->deleteUserLayoutTempFile($layout_srl);
@@ -524,7 +551,9 @@  discard block
 block discarded – undo
524 551
 		$obj = Context::gets('type','align','column');
525 552
 		$obj = (array)$obj;
526 553
 		$src = $oLayoutModel->getUserLayoutIniConfig($layout_srl);
527
-		foreach($obj as $key => $val) $src[$key] = $val;
554
+		foreach($obj as $key => $val) {
555
+			$src[$key] = $val;
556
+		}
528 557
 		$this->insertUserLayoutValue($layout_srl,$src);
529 558
 	}
530 559
 
@@ -591,7 +620,9 @@  discard block
 block discarded – undo
591 620
 	function procLayoutAdminUserLayoutExport()
592 621
 	{
593 622
 		$layout_srl = Context::get('layout_srl');
594
-		if(!$layout_srl) return new BaseObject('-1','msg_invalid_request');
623
+		if(!$layout_srl) {
624
+			return new BaseObject('-1','msg_invalid_request');
625
+		}
595 626
 
596 627
 		require_once(_XE_PATH_.'libs/tar.class.php');
597 628
 		$oLayoutModel = getModel('layout');
@@ -608,16 +639,19 @@  discard block
 block discarded – undo
608 639
 
609 640
 		foreach($file_list as $file)
610 641
 		{
611
-			if(strncasecmp('images', $file, 6) === 0) continue;
642
+			if(strncasecmp('images', $file, 6) === 0) {
643
+				continue;
644
+			}
612 645
 
613 646
 			// replace path
614 647
 			$file = $target_path . $file;
615 648
 			$content = FileHandler::readFile($file);
616 649
 			$pattern = '/(http:\/\/[^ ]+)?(\.\/)?' . str_replace('/', '\/', (str_replace('./', '', $file_path))) . '/';
617
-			if(basename($file) == 'faceoff.css' || basename($file) == 'layout.css')
618
-				$content = preg_replace($pattern, '../', $content);
619
-			else
620
-				$content = preg_replace($pattern, './', $content);
650
+			if(basename($file) == 'faceoff.css' || basename($file) == 'layout.css') {
651
+							$content = preg_replace($pattern, '../', $content);
652
+			} else {
653
+							$content = preg_replace($pattern, './', $content);
654
+			}
621 655
 
622 656
 			// replace ini config
623 657
 			foreach($ini_config as $key => $value)
@@ -658,7 +692,9 @@  discard block
 block discarded – undo
658 692
 		$tar = new tar();
659 693
 		$user_layout_path = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath(0));
660 694
 		chdir($user_layout_path);
661
-		foreach($file_list as $key => $file) $tar->addFile($file);
695
+		foreach($file_list as $key => $file) {
696
+			$tar->addFile($file);
697
+		}
662 698
 
663 699
 		$stream = $tar->toTarStream();
664 700
 		$filename = 'faceoff_' . date('YmdHis') . '.tar';
@@ -689,18 +725,28 @@  discard block
 block discarded – undo
689 725
 		return $this->stop('not supported');
690 726
 
691 727
 		// check upload
692
-		if(!Context::isUploaded()) exit();
728
+		if(!Context::isUploaded()) {
729
+			exit();
730
+		}
693 731
 		$file = Context::get('file');
694
-		if(!is_uploaded_file($file['tmp_name']) || !checkUploadedFile($file['tmp_name'])) exit();
732
+		if(!is_uploaded_file($file['tmp_name']) || !checkUploadedFile($file['tmp_name'])) {
733
+			exit();
734
+		}
695 735
 
696
-		if(substr_compare($file['name'], '.tar', -4) !== 0) exit();
736
+		if(substr_compare($file['name'], '.tar', -4) !== 0) {
737
+			exit();
738
+		}
697 739
 
698 740
 		$layout_srl = Context::get('layout_srl');
699
-		if(!$layout_srl) exit();
741
+		if(!$layout_srl) {
742
+			exit();
743
+		}
700 744
 
701 745
 		$oLayoutModel = getModel('layout');
702 746
 		$user_layout_path = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath($layout_srl));
703
-		if(!move_uploaded_file($file['tmp_name'], $user_layout_path . 'faceoff.tar')) exit();
747
+		if(!move_uploaded_file($file['tmp_name'], $user_layout_path . 'faceoff.tar')) {
748
+			exit();
749
+		}
704 750
 
705 751
 		$this->importLayout($layout_srl, $user_layout_path.'faceoff.tar');
706 752
 
@@ -744,9 +790,11 @@  discard block
 block discarded – undo
744 790
 		
745 791
 		if($layout->extra_var_count) {
746 792
 			$reg = "/^.\/files\/attach\/images\/([0-9]+)\/(.*)/";
747
-			if($extra_vars) foreach($extra_vars as $key => $val) {
793
+			if($extra_vars) {
794
+				foreach($extra_vars as $key => $val) {
748 795
 				if($layout->extra_var->{$key}->type == 'image') {
749 796
 					if(!preg_match($reg,$val,$matches)) continue;
797
+			}
750 798
 					$image_list[$key]->filename = $matches[2];
751 799
 					$image_list[$key]->old_file = $val;
752 800
 				}
@@ -761,7 +809,9 @@  discard block
 block discarded – undo
761 809
 		$args->site_srl = (int)$layout->site_srl;
762 810
 		$args->layout = $layout->layout;
763 811
 		$args->layout_type = $layout->layout_type;
764
-		if(!$args->layout_type) $args->layout_type = "P";
812
+		if(!$args->layout_type) {
813
+			$args->layout_type = "P";
814
+		}
765 815
 
766 816
 		$oDB = &DB::getInstance();
767 817
 		$oDB->begin();
@@ -904,7 +954,9 @@  discard block
 block discarded – undo
904 954
 		$tar = new tar();
905 955
 		$tar->openTAR($source_file);
906 956
 		// If layout.ini file does not exist
907
-		if(!$tar->getFile('layout.ini')) return;
957
+		if(!$tar->getFile('layout.ini')) {
958
+			return;
959
+		}
908 960
 
909 961
 		$replace_path = getNumberingPath($layout_srl,3);
910 962
 		foreach($tar->files as $key => $info)
Please login to merge, or discard this patch.
modules/layout/layout.admin.view.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 	/**
134 134
 	 * Display list of pc layout instance
135
-	 * @return void|BaseObject (void : success, BaseObject : fail)
135
+	 * @return ModuleObject|null (void : success, BaseObject : fail)
136 136
 	 */
137 137
 	function dispLayoutAdminInstanceList()
138 138
 	{
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	/**
162 162
 	 * Layout setting page
163 163
 	 * Once select a layout with empty value in the DB, then adjust values
164
-	 * @return void|BaseObject (void : success, BaseObject : fail)
164
+	 * @return ModuleObject|null (void : success, BaseObject : fail)
165 165
 	 */
166 166
 	function dispLayoutAdminInsert()
167 167
 	{
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -28,20 +28,20 @@  discard block
 block discarded – undo
28 28
 		// Set a layout list
29 29
 		$oLayoutModel = getModel('layout');
30 30
 		$layout_list = $oLayoutModel->getDownloadedLayoutList($type, true);
31
-		if(!is_array($layout_list))
31
+		if (!is_array($layout_list))
32 32
 		{
33 33
 			$layout_list = array();
34 34
 		}
35 35
 
36
-		if($type == 'P')
36
+		if ($type == 'P')
37 37
 		{
38 38
 			// get Theme layout
39 39
 			$oAdminModel = getAdminModel('admin');
40 40
 			$themeList = $oAdminModel->getThemeList();
41 41
 			$themeLayoutList = array();
42
-			foreach($themeList as $themeInfo)
42
+			foreach ($themeList as $themeInfo)
43 43
 			{
44
-				if(strpos($themeInfo->layout_info->name, '.') === false) continue;
44
+				if (strpos($themeInfo->layout_info->name, '.') === false) continue;
45 45
 				$themeLayoutList[] = $oLayoutModel->getLayoutInfo($themeInfo->layout_info->name, null, 'P');
46 46
 			}
47 47
 			$layout_list = array_merge($layout_list, $themeLayoutList);
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
 
60 60
 		//Security
61 61
 		$security = new Security();
62
-		$security->encodeHTML('layout_list..layout','layout_list..title');
62
+		$security->encodeHTML('layout_list..layout', 'layout_list..title');
63 63
 
64
-		foreach($layout_list as $no => $layout_info)
64
+		foreach ($layout_list as $no => $layout_info)
65 65
 		{
66 66
 			$layout_list[$no]->description = nl2br(trim($layout_info->description));
67 67
 		}
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	{
77 77
 		$type = Context::get('type');
78 78
 
79
-		if(!in_array($type, array('P', 'M'))) $type = 'P';
79
+		if (!in_array($type, array('P', 'M'))) $type = 'P';
80 80
 
81 81
 		$oLayoutModel = getModel('layout');
82 82
 
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 		$_layout_list = $oLayoutModel->getLayoutInstanceList(0, $type, null, $columnList);
90 90
 
91 91
 		$layout_list = array();
92
-		foreach($_layout_list as $item)
92
+		foreach ($_layout_list as $item)
93 93
 		{
94
-			if(!$layout_list[$item->layout])
94
+			if (!$layout_list[$item->layout])
95 95
 			{
96 96
 				$layout_list[$item->layout] = array();
97 97
 				$layout_info = $oLayoutModel->getLayoutInfo($item->layout, null, $type);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		$aTitle = strtolower($a['title']);
123 123
 		$bTitle = strtolower($b['title']);
124 124
 
125
-		if($aTitle == $bTitle)
125
+		if ($aTitle == $bTitle)
126 126
 		{
127 127
 			return 0;
128 128
 		}
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
 		$type = Context::get('type');
140 140
 		$layout = Context::get('layout');
141 141
 
142
-		if(!in_array($type, array('P', 'M'))) $type = 'P';
143
-		if(!$layout) return $this->stop('msg_invalid_request');
142
+		if (!in_array($type, array('P', 'M'))) $type = 'P';
143
+		if (!$layout) return $this->stop('msg_invalid_request');
144 144
 
145 145
 		$oLayoutModel = getModel('layout');
146 146
 		$layout_info = $oLayoutModel->getLayoutInfo($layout, null, $type);
147
-		if(!$layout_info) return $this->stop('msg_invalid_request');
147
+		if (!$layout_info) return $this->stop('msg_invalid_request');
148 148
 
149 149
 		Context::set('layout_info', $layout_info);
150 150
 
@@ -167,18 +167,18 @@  discard block
 block discarded – undo
167 167
 	{
168 168
 		$oModel = getModel('layout');
169 169
 		$type = Context::get('type');
170
-		if(!in_array($type, array('P', 'M'))) $type = 'P';
170
+		if (!in_array($type, array('P', 'M'))) $type = 'P';
171 171
 
172 172
 		//Security
173 173
 		$security = new Security();
174
-		$security->encodeHTML('layout_list..layout','layout_list..title');
174
+		$security->encodeHTML('layout_list..layout', 'layout_list..title');
175 175
 
176 176
 		// Get layout info
177 177
 		$layout = Context::get('layout');
178
-		if($layout == 'faceoff') return $this->stop('not supported');
178
+		if ($layout == 'faceoff') return $this->stop('not supported');
179 179
 
180 180
 		$layout_info = $oModel->getLayoutInfo($layout, null, $type);
181
-		if(!$layout_info) return $this->stop('msg_invalid_request');
181
+		if (!$layout_info) return $this->stop('msg_invalid_request');
182 182
 
183 183
 		// get Menu list
184 184
 		$oMenuAdminModel = getAdminModel('menu');
@@ -192,10 +192,10 @@  discard block
 block discarded – undo
192 192
 		$layout_info = $security->encodeHTML('.', 'author..', 'extra_var..', 'extra_var....');
193 193
 
194 194
 		$layout_info->description = nl2br(trim($layout_info->description));
195
-		if(!is_object($layout_info->extra_var)) $layout_info->extra_var = new StdClass();
196
-		foreach($layout_info->extra_var as $var_name => $val)
195
+		if (!is_object($layout_info->extra_var)) $layout_info->extra_var = new StdClass();
196
+		foreach ($layout_info->extra_var as $var_name => $val)
197 197
 		{
198
-			if(isset($layout_info->{$var_name}->description))
198
+			if (isset($layout_info->{$var_name}->description))
199 199
 				$layout_info->{$var_name}->description = nl2br(trim($val->description));
200 200
 		}
201 201
 		Context::set('selected_layout', $layout_info);
@@ -234,24 +234,24 @@  discard block
 block discarded – undo
234 234
 		$oLayoutModel = getModel('layout');
235 235
 		$layout_info = $oLayoutModel->getLayout($layout_srl);
236 236
 		// Error appears if there is no layout information is registered
237
-		if(!$layout_info) return $this->dispLayoutAdminInstalledList();
237
+		if (!$layout_info) return $this->dispLayoutAdminInstalledList();
238 238
 
239 239
 		// Get Layout Code
240
-		if($oLayoutModel->useDefaultLayout($layout_info->layout_srl))
240
+		if ($oLayoutModel->useDefaultLayout($layout_info->layout_srl))
241 241
 		{
242
-			$layout_file  = $oLayoutModel->getDefaultLayoutHtml($layout_info->layout);
243
-			$layout_css_file  = $oLayoutModel->getDefaultLayoutCss($layout_info->layout);
242
+			$layout_file = $oLayoutModel->getDefaultLayoutHtml($layout_info->layout);
243
+			$layout_css_file = $oLayoutModel->getDefaultLayoutCss($layout_info->layout);
244 244
 		}
245 245
 		else
246 246
 		{
247 247
 			$layout_file = $oLayoutModel->getUserLayoutHtml($layout_info->layout_srl);
248 248
 			$layout_css_file = $oLayoutModel->getUserLayoutCss($layout_info->layout_srl);
249 249
 
250
-			if(!file_exists($layout_file)) $layout_file = $layout_info->path . 'layout.html';
251
-			if(!file_exists($layout_css_file)) $layout_css_file = $layout_info->path . 'layout.css';
250
+			if (!file_exists($layout_file)) $layout_file = $layout_info->path.'layout.html';
251
+			if (!file_exists($layout_css_file)) $layout_css_file = $layout_info->path.'layout.css';
252 252
 		}
253 253
 
254
-		if(file_exists($layout_css_file))
254
+		if (file_exists($layout_css_file))
255 255
 		{
256 256
 			$layout_code_css = FileHandler::readFile($layout_css_file);
257 257
 			Context::set('layout_code_css', $layout_code_css);
@@ -295,30 +295,30 @@  discard block
 block discarded – undo
295 295
 		$layout_srl = Context::get('layout_srl');
296 296
 		$code = Context::get('code');
297 297
 		$code_css = Context::get('code_css');
298
-		if(!$layout_srl || !$code) return new BaseObject(-1, 'msg_invalid_request');
298
+		if (!$layout_srl || !$code) return new BaseObject(-1, 'msg_invalid_request');
299 299
 		// Get the layout information
300 300
 		$oLayoutModel = getModel('layout');
301 301
 		$layout_info = $oLayoutModel->getLayout($layout_srl);
302
-		if(!$layout_info) return new BaseObject(-1, 'msg_invalid_request');
302
+		if (!$layout_info) return new BaseObject(-1, 'msg_invalid_request');
303 303
 		// Separately handle the layout if its type is faceoff
304
-		if($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
304
+		if ($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
305 305
 		// Apply CSS directly
306 306
 		Context::addHtmlHeader("<style type=\"text/css\" charset=\"UTF-8\">".$code_css."</style>");
307 307
 		// Set names and values of extra_vars to $layout_info
308
-		if($layout_info->extra_var_count)
308
+		if ($layout_info->extra_var_count)
309 309
 		{
310
-			foreach($layout_info->extra_var as $var_id => $val)
310
+			foreach ($layout_info->extra_var as $var_id => $val)
311 311
 			{
312 312
 				$layout_info->{$var_id} = $val->value;
313 313
 			}
314 314
 		}
315 315
 		// menu in layout information becomes an argument for Context:: set
316
-		if($layout_info->menu_count)
316
+		if ($layout_info->menu_count)
317 317
 		{
318
-			foreach($layout_info->menu as $menu_id => $menu)
318
+			foreach ($layout_info->menu as $menu_id => $menu)
319 319
 			{
320 320
 				$menu->php_file = FileHandler::getRealPath($menu->php_file);
321
-				if(FileHandler::exists($menu->php_file)) include($menu->php_file);
321
+				if (FileHandler::exists($menu->php_file)) include($menu->php_file);
322 322
 				Context::set($menu_id, $menu);
323 323
 			}
324 324
 		}
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 		$layout_file = 'layout';
337 337
 
338 338
 		$layout_tpl = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file);
339
-		Context::set('layout','none');
339
+		Context::set('layout', 'none');
340 340
 		// Convert widgets and others
341 341
 		$oContext = &Context::getInstance();
342 342
 		Context::set('layout_tpl', $layout_tpl);
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 		// Remove the remaining tmp files because of temporarily saving
360 360
 		// This part needs to be modified
361 361
 		$delete_tmp = Context::get('delete_tmp');
362
-		if($delete_tmp =='Y')
362
+		if ($delete_tmp == 'Y')
363 363
 		{
364 364
 			$oLayoutAdminController = getAdminController('layout');
365 365
 			$oLayoutAdminController->deleteUserLayoutTempFile($layout_srl);
@@ -373,24 +373,24 @@  discard block
 block discarded – undo
373 373
 
374 374
 		$css = FileHandler::readFile($faceoffcss);
375 375
 		$match = null;
376
-		preg_match_all('/([^\{]+)\{([^\}]*)\}/is',$css,$match);
377
-		for($i=0,$c=count($match[1]);$i<$c;$i++)
376
+		preg_match_all('/([^\{]+)\{([^\}]*)\}/is', $css, $match);
377
+		for ($i = 0, $c = count($match[1]); $i < $c; $i++)
378 378
 		{
379 379
 			$name = trim($match[1][$i]);
380 380
 			$css = trim($match[2][$i]);
381
-			if(!$css) continue;
382
-			$css = str_replace('./images/',Context::getRequestUri().$oLayoutModel->getUserLayoutImagePath($layout_srl),$css);
383
-			$style[] .= sprintf('"%s":"%s"',$name,$css);
381
+			if (!$css) continue;
382
+			$css = str_replace('./images/', Context::getRequestUri().$oLayoutModel->getUserLayoutImagePath($layout_srl), $css);
383
+			$style[] .= sprintf('"%s":"%s"', $name, $css);
384 384
 		}
385 385
 
386
-		if(count($style))
386
+		if (count($style))
387 387
 		{
388
-			$script = '<script type="text/javascript"> var faceOffStyle = {'.implode(',',$style).'}; </script>';
388
+			$script = '<script type="text/javascript"> var faceOffStyle = {'.implode(',', $style).'}; </script>';
389 389
 			Context::addHtmlHeader($script);
390 390
 		}
391 391
 
392 392
 		$oTemplate = &TemplateHandler::getInstance();
393
-		Context::set('content', $oTemplate->compile($this->module_path.'tpl','about_faceoff'));
393
+		Context::set('content', $oTemplate->compile($this->module_path.'tpl', 'about_faceoff'));
394 394
 		// Change widget codes in Javascript mode
395 395
 		$oWidgetController = getController('widget');
396 396
 		$oWidgetController->setWidgetCodeInJavascriptMode();
Please login to merge, or discard this patch.
Braces   +55 added lines, -21 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 			$themeLayoutList = array();
42 42
 			foreach($themeList as $themeInfo)
43 43
 			{
44
-				if(strpos($themeInfo->layout_info->name, '.') === false) continue;
44
+				if(strpos($themeInfo->layout_info->name, '.') === false) {
45
+					continue;
46
+				}
45 47
 				$themeLayoutList[] = $oLayoutModel->getLayoutInfo($themeInfo->layout_info->name, null, 'P');
46 48
 			}
47 49
 			$layout_list = array_merge($layout_list, $themeLayoutList);
@@ -76,7 +78,9 @@  discard block
 block discarded – undo
76 78
 	{
77 79
 		$type = Context::get('type');
78 80
 
79
-		if(!in_array($type, array('P', 'M'))) $type = 'P';
81
+		if(!in_array($type, array('P', 'M'))) {
82
+			$type = 'P';
83
+		}
80 84
 
81 85
 		$oLayoutModel = getModel('layout');
82 86
 
@@ -139,12 +143,18 @@  discard block
 block discarded – undo
139 143
 		$type = Context::get('type');
140 144
 		$layout = Context::get('layout');
141 145
 
142
-		if(!in_array($type, array('P', 'M'))) $type = 'P';
143
-		if(!$layout) return $this->stop('msg_invalid_request');
146
+		if(!in_array($type, array('P', 'M'))) {
147
+			$type = 'P';
148
+		}
149
+		if(!$layout) {
150
+			return $this->stop('msg_invalid_request');
151
+		}
144 152
 
145 153
 		$oLayoutModel = getModel('layout');
146 154
 		$layout_info = $oLayoutModel->getLayoutInfo($layout, null, $type);
147
-		if(!$layout_info) return $this->stop('msg_invalid_request');
155
+		if(!$layout_info) {
156
+			return $this->stop('msg_invalid_request');
157
+		}
148 158
 
149 159
 		Context::set('layout_info', $layout_info);
150 160
 
@@ -167,7 +177,9 @@  discard block
 block discarded – undo
167 177
 	{
168 178
 		$oModel = getModel('layout');
169 179
 		$type = Context::get('type');
170
-		if(!in_array($type, array('P', 'M'))) $type = 'P';
180
+		if(!in_array($type, array('P', 'M'))) {
181
+			$type = 'P';
182
+		}
171 183
 
172 184
 		//Security
173 185
 		$security = new Security();
@@ -175,10 +187,14 @@  discard block
 block discarded – undo
175 187
 
176 188
 		// Get layout info
177 189
 		$layout = Context::get('layout');
178
-		if($layout == 'faceoff') return $this->stop('not supported');
190
+		if($layout == 'faceoff') {
191
+			return $this->stop('not supported');
192
+		}
179 193
 
180 194
 		$layout_info = $oModel->getLayoutInfo($layout, null, $type);
181
-		if(!$layout_info) return $this->stop('msg_invalid_request');
195
+		if(!$layout_info) {
196
+			return $this->stop('msg_invalid_request');
197
+		}
182 198
 
183 199
 		// get Menu list
184 200
 		$oMenuAdminModel = getAdminModel('menu');
@@ -192,11 +208,14 @@  discard block
 block discarded – undo
192 208
 		$layout_info = $security->encodeHTML('.', 'author..', 'extra_var..', 'extra_var....');
193 209
 
194 210
 		$layout_info->description = nl2br(trim($layout_info->description));
195
-		if(!is_object($layout_info->extra_var)) $layout_info->extra_var = new StdClass();
211
+		if(!is_object($layout_info->extra_var)) {
212
+			$layout_info->extra_var = new StdClass();
213
+		}
196 214
 		foreach($layout_info->extra_var as $var_name => $val)
197 215
 		{
198
-			if(isset($layout_info->{$var_name}->description))
199
-				$layout_info->{$var_name}->description = nl2br(trim($val->description));
216
+			if(isset($layout_info->{$var_name}->description)) {
217
+							$layout_info->{$var_name}->description = nl2br(trim($val->description));
218
+			}
200 219
 		}
201 220
 		Context::set('selected_layout', $layout_info);
202 221
 
@@ -234,21 +253,26 @@  discard block
 block discarded – undo
234 253
 		$oLayoutModel = getModel('layout');
235 254
 		$layout_info = $oLayoutModel->getLayout($layout_srl);
236 255
 		// Error appears if there is no layout information is registered
237
-		if(!$layout_info) return $this->dispLayoutAdminInstalledList();
256
+		if(!$layout_info) {
257
+			return $this->dispLayoutAdminInstalledList();
258
+		}
238 259
 
239 260
 		// Get Layout Code
240 261
 		if($oLayoutModel->useDefaultLayout($layout_info->layout_srl))
241 262
 		{
242 263
 			$layout_file  = $oLayoutModel->getDefaultLayoutHtml($layout_info->layout);
243 264
 			$layout_css_file  = $oLayoutModel->getDefaultLayoutCss($layout_info->layout);
244
-		}
245
-		else
265
+		} else
246 266
 		{
247 267
 			$layout_file = $oLayoutModel->getUserLayoutHtml($layout_info->layout_srl);
248 268
 			$layout_css_file = $oLayoutModel->getUserLayoutCss($layout_info->layout_srl);
249 269
 
250
-			if(!file_exists($layout_file)) $layout_file = $layout_info->path . 'layout.html';
251
-			if(!file_exists($layout_css_file)) $layout_css_file = $layout_info->path . 'layout.css';
270
+			if(!file_exists($layout_file)) {
271
+				$layout_file = $layout_info->path . 'layout.html';
272
+			}
273
+			if(!file_exists($layout_css_file)) {
274
+				$layout_css_file = $layout_info->path . 'layout.css';
275
+			}
252 276
 		}
253 277
 
254 278
 		if(file_exists($layout_css_file))
@@ -295,13 +319,19 @@  discard block
 block discarded – undo
295 319
 		$layout_srl = Context::get('layout_srl');
296 320
 		$code = Context::get('code');
297 321
 		$code_css = Context::get('code_css');
298
-		if(!$layout_srl || !$code) return new BaseObject(-1, 'msg_invalid_request');
322
+		if(!$layout_srl || !$code) {
323
+			return new BaseObject(-1, 'msg_invalid_request');
324
+		}
299 325
 		// Get the layout information
300 326
 		$oLayoutModel = getModel('layout');
301 327
 		$layout_info = $oLayoutModel->getLayout($layout_srl);
302
-		if(!$layout_info) return new BaseObject(-1, 'msg_invalid_request');
328
+		if(!$layout_info) {
329
+			return new BaseObject(-1, 'msg_invalid_request');
330
+		}
303 331
 		// Separately handle the layout if its type is faceoff
304
-		if($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
332
+		if($layout_info && $layout_info->type == 'faceoff') {
333
+			$oLayoutModel->doActivateFaceOff($layout_info);
334
+		}
305 335
 		// Apply CSS directly
306 336
 		Context::addHtmlHeader("<style type=\"text/css\" charset=\"UTF-8\">".$code_css."</style>");
307 337
 		// Set names and values of extra_vars to $layout_info
@@ -318,7 +348,9 @@  discard block
 block discarded – undo
318 348
 			foreach($layout_info->menu as $menu_id => $menu)
319 349
 			{
320 350
 				$menu->php_file = FileHandler::getRealPath($menu->php_file);
321
-				if(FileHandler::exists($menu->php_file)) include($menu->php_file);
351
+				if(FileHandler::exists($menu->php_file)) {
352
+					include($menu->php_file);
353
+				}
322 354
 				Context::set($menu_id, $menu);
323 355
 			}
324 356
 		}
@@ -378,7 +410,9 @@  discard block
 block discarded – undo
378 410
 		{
379 411
 			$name = trim($match[1][$i]);
380 412
 			$css = trim($match[2][$i]);
381
-			if(!$css) continue;
413
+			if(!$css) {
414
+				continue;
415
+			}
382 416
 			$css = str_replace('./images/',Context::getRequestUri().$oLayoutModel->getUserLayoutImagePath($layout_srl),$css);
383 417
 			$style[] .= sprintf('"%s":"%s"',$name,$css);
384 418
 		}
Please login to merge, or discard this patch.
modules/member/member.admin.controller.php 3 patches
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 	/**
778 778
 	 * Move up/down the member join form and modify it
779 779
 	 * @deprecated
780
-	 * @return void
780
+	 * @return BaseObject|null
781 781
 	 */
782 782
 	function procMemberAdminUpdateJoinForm()
783 783
 	{
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
 
1115 1115
 	/**
1116 1116
 	 * Insert a group
1117
-	 * @param object $args
1117
+	 * @param null|stdClass $args
1118 1118
 	 * @return BaseObject
1119 1119
 	 */
1120 1120
 	function insertGroup($args)
@@ -1311,6 +1311,9 @@  discard block
 block discarded – undo
1311 1311
 		return executeQuery('member.insertDeniedID', $args);
1312 1312
 	}
1313 1313
 
1314
+	/**
1315
+	 * @param string $nick_name
1316
+	 */
1314 1317
 	function insertDeniedNickName($nick_name, $description = '')
1315 1318
 	{
1316 1319
 		$args = new stdClass();
Please login to merge, or discard this patch.
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -24,31 +24,31 @@  discard block
 block discarded – undo
24 24
 		// if(Context::getRequestMethod() == "GET") return new BaseObject(-1, "msg_invalid_request");
25 25
 		// Extract the necessary information in advance
26 26
 		$logged_info = Context::get('logged_info');
27
-		if($logged_info->is_admin != 'Y' || !checkCSRF())
27
+		if ($logged_info->is_admin != 'Y' || !checkCSRF())
28 28
 		{
29 29
 			return new BaseObject(-1, 'msg_invalid_request');
30 30
 		}
31 31
 
32
-		$args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date');
33
-		$oMemberModel = &getModel ('member');
34
-		$config = $oMemberModel->getMemberConfig ();
32
+		$args = Context::gets('member_srl', 'email_address', 'find_account_answer', 'allow_mailing', 'allow_message', 'denied', 'is_admin', 'description', 'group_srl_list', 'limit_date');
33
+		$oMemberModel = &getModel('member');
34
+		$config = $oMemberModel->getMemberConfig();
35 35
 		$getVars = array();
36
-		if($config->signupForm)
36
+		if ($config->signupForm)
37 37
 		{
38
-			foreach($config->signupForm as $formInfo)
38
+			foreach ($config->signupForm as $formInfo)
39 39
 			{
40
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
40
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
41 41
 				{
42 42
 					$getVars[] = $formInfo->name;
43 43
 				}
44 44
 			}
45 45
 		}
46
-		foreach($getVars as $val)
46
+		foreach ($getVars as $val)
47 47
 		{
48 48
 			$args->{$val} = Context::get($val);
49 49
 		}
50 50
 		$args->member_srl = Context::get('member_srl');
51
-		if(Context::get('reset_password'))
51
+		if (Context::get('reset_password'))
52 52
 			$args->password = Context::get('reset_password');
53 53
 		else unset($args->password);
54 54
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		unset($all_args->error_return_url);
61 61
 		unset($all_args->success_return_url);
62 62
 		unset($all_args->ruleset);
63
-		if(!isset($args->limit_date)) $args->limit_date = "";
63
+		if (!isset($args->limit_date)) $args->limit_date = "";
64 64
 		unset($all_args->password);
65 65
 		unset($all_args->password2);
66 66
 		unset($all_args->reset_password);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		$extra_vars = delObjectVars($all_args, $args);
69 69
 		$args->extra_vars = serialize($extra_vars);
70 70
 		// Check if an original member exists having the member_srl
71
-		if($args->member_srl)
71
+		if ($args->member_srl)
72 72
 		{
73 73
 			// Create a member model object
74 74
 			$oMemberModel = getModel('member');
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
76 76
 			$columnList = array('member_srl');
77 77
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList);
78 78
 			// If no original member exists, make a new one
79
-			if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
79
+			if ($member_info->member_srl != $args->member_srl) unset($args->member_srl);
80 80
 		}
81 81
 
82 82
 		// remove whitespace
83 83
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
84
-		foreach($checkInfos as $val)
84
+		foreach ($checkInfos as $val)
85 85
 		{
86
-			if(isset($args->{$val}))
86
+			if (isset($args->{$val}))
87 87
 			{
88 88
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
89 89
 			}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 		$oMemberController = getController('member');
93 93
 		// Execute insert or update depending on the value of member_srl
94
-		if(!$args->member_srl)
94
+		if (!$args->member_srl)
95 95
 		{
96 96
 			$args->password = Context::get('password');
97 97
 			$output = $oMemberController->insertMember($args);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			$msg_code = 'success_updated';
104 104
 		}
105 105
 
106
-		if(!$output->toBool()) return $output;
106
+		if (!$output->toBool()) return $output;
107 107
 		// Save Signature
108 108
 		$signature = Context::get('signature');
109 109
 		$oMemberController->putSignature($args->member_srl, $signature);
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 		$this->setMessage($msg_code);
113 113
 
114 114
 		$profile_image = $_FILES['profile_image'];
115
-		if(is_uploaded_file($profile_image['tmp_name']))
115
+		if (is_uploaded_file($profile_image['tmp_name']))
116 116
 		{
117 117
 			$oMemberController->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
118 118
 		}
119 119
 
120 120
 		$image_mark = $_FILES['image_mark'];
121
-		if(is_uploaded_file($image_mark['tmp_name']))
121
+		if (is_uploaded_file($image_mark['tmp_name']))
122 122
 		{
123 123
 			$oMemberController->insertImageMark($args->member_srl, $image_mark['tmp_name']);
124 124
 		}
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 
145 145
 		$oMemberController = getController('member');
146 146
 		$output = $oMemberController->deleteMember($member_srl);
147
-		if(!$output->toBool()) return $output;
147
+		if (!$output->toBool()) return $output;
148 148
 
149
-		$this->add('page',Context::get('page'));
149
+		$this->add('page', Context::get('page'));
150 150
 		$this->setMessage("success_deleted");
151 151
 	}
152 152
 
@@ -165,26 +165,26 @@  discard block
 block discarded – undo
165 165
 		);
166 166
 		
167 167
 		$oPassword = new Password();
168
-		if(!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms()))
168
+		if (!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms()))
169 169
 		{
170 170
 			$args->password_hashing_algorithm = 'md5';
171 171
 		}
172 172
 		
173 173
 		$args->password_hashing_work_factor = intval($args->password_hashing_work_factor, 10);
174
-		if($args->password_hashing_work_factor < 4)
174
+		if ($args->password_hashing_work_factor < 4)
175 175
 		{
176 176
 			$args->password_hashing_work_factor = 4;
177 177
 		}
178
-		if($args->password_hashing_work_factor > 16)
178
+		if ($args->password_hashing_work_factor > 16)
179 179
 		{
180 180
 			$args->password_hashing_work_factor = 16;
181 181
 		}
182
-		if($args->password_hashing_auto_upgrade != 'Y')
182
+		if ($args->password_hashing_auto_upgrade != 'Y')
183 183
 		{
184 184
 			$args->password_hashing_auto_upgrade = 'N';
185 185
 		}
186 186
 
187
-		if((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y')
187
+		if ((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y')
188 188
 		{
189 189
 			return new BaseObject(-1, 'msg_mail_authorization');
190 190
 		}
@@ -219,20 +219,20 @@  discard block
 block discarded – undo
219 219
 		$usable_list = Context::get('usable_list');
220 220
 		$all_args = Context::getRequestVars();
221 221
 
222
-		$args->limit_day = (int)$args->limit_day;
223
-		if(!trim(strip_tags($args->agreement)))
222
+		$args->limit_day = (int) $args->limit_day;
223
+		if (!trim(strip_tags($args->agreement)))
224 224
 		{
225
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
225
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
226 226
 			FileHandler::removeFile($agreement_file);
227 227
 			$args->agreement = NULL;
228 228
 		}
229 229
 
230
-		if($args->redirect_url)
230
+		if ($args->redirect_url)
231 231
 		{
232 232
 			$oModuleModel = getModel('module');
233 233
 			$redirectModuleInfo = $oModuleModel->getModuleInfoByModuleSrl($args->redirect_url, array('mid'));
234 234
 
235
-			if(!$redirectModuleInfo)
235
+			if (!$redirectModuleInfo)
236 236
 			{
237 237
 				return new BaseObject('-1', 'msg_exist_selected_module');
238 238
 			}
@@ -256,28 +256,28 @@  discard block
 block discarded – undo
256 256
 		$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark', 'profile_image_max_width', 'profile_image_max_height', 'image_name_max_width', 'image_name_max_height', 'image_mark_max_width', 'image_mark_max_height');
257 257
 		$mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question');
258 258
 		$extendItems = $oMemberModel->getJoinFormList();
259
-		foreach($list_order as $key)
259
+		foreach ($list_order as $key)
260 260
 		{
261 261
 			$signupItem = new stdClass();
262 262
 			$signupItem->isIdentifier = ($key == $all_args->identifier);
263 263
 			$signupItem->isDefaultForm = in_array($key, $items);
264 264
 
265 265
 			$signupItem->name = $key;
266
-			if(!in_array($key, $items)) $signupItem->title = $key;
266
+			if (!in_array($key, $items)) $signupItem->title = $key;
267 267
 			else $signupItem->title = $lang->{$key};
268 268
 			$signupItem->mustRequired = in_array($key, $mustRequireds);
269 269
 			$signupItem->imageType = (strpos($key, 'image') !== false);
270 270
 			$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier;
271 271
 			$signupItem->isUse = in_array($key, $usable_list) || $signupItem->required;
272 272
 			$signupItem->isPublic = ($all_args->{'is_'.$key.'_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N';
273
-			if($signupItem->imageType)
273
+			if ($signupItem->imageType)
274 274
 			{
275 275
 				$signupItem->max_width = $all_args->{$key.'_max_width'};
276 276
 				$signupItem->max_height = $all_args->{$key.'_max_height'};
277 277
 			}
278 278
 
279 279
 			// set extends form
280
-			if(!$signupItem->isDefaultForm)
280
+			if (!$signupItem->isDefaultForm)
281 281
 			{
282 282
 				$extendItem = $extendItems[$all_args->{$key.'_member_join_form_srl'}];
283 283
 				$signupItem->type = $extendItem->column_type;
@@ -286,13 +286,13 @@  discard block
 block discarded – undo
286 286
 				$signupItem->description = $extendItem->description;
287 287
 
288 288
 				// check usable value change, required/option
289
-				if($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y'))
289
+				if ($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y'))
290 290
 				{
291 291
 					unset($update_args);
292 292
 					$update_args = new stdClass;
293 293
 					$update_args->member_join_form_srl = $extendItem->member_join_form_srl;
294
-					$update_args->is_active = $signupItem->isUse?'Y':'N';
295
-					$update_args->required = $signupItem->required?'Y':'N';
294
+					$update_args->is_active = $signupItem->isUse ? 'Y' : 'N';
295
+					$update_args->required = $signupItem->required ? 'Y' : 'N';
296 296
 
297 297
 					$update_output = executeQuery('member.updateJoinForm', $update_args);
298 298
 				}
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 		$this->_createFindAccountByQuestion($args->identifier);
310 310
 
311 311
 		// check agreement value exist
312
-		if($args->agreement)
312
+		if ($args->agreement)
313 313
 		{
314
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
314
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
315 315
 			$output = FileHandler::writeFile($agreement_file, $args->agreement);
316 316
 
317 317
 			unset($args->agreement);
@@ -339,16 +339,16 @@  discard block
 block discarded – undo
339 339
 			'after_logout_url'
340 340
 		);
341 341
 
342
-		if(!$args->change_password_date)
342
+		if (!$args->change_password_date)
343 343
 		{
344 344
 			$args->change_password_date = 0;
345 345
 		}
346 346
 
347
-		if(!trim(strip_tags($args->after_login_url)))
347
+		if (!trim(strip_tags($args->after_login_url)))
348 348
 		{
349 349
 			$args->after_login_url = NULL;
350 350
 		}
351
-		if(!trim(strip_tags($args->after_logout_url)))
351
+		if (!trim(strip_tags($args->after_logout_url)))
352 352
 		{
353 353
 			$args->after_logout_url = NULL;
354 354
 		}
@@ -375,17 +375,17 @@  discard block
 block discarded – undo
375 375
 		);
376 376
 
377 377
 		$args->layout_srl = $args->layout_srl ? $args->layout_srl : NULL;
378
-		if(!$args->skin)
378
+		if (!$args->skin)
379 379
 		{
380 380
 			$args->skin = 'default';
381 381
 		}
382
-		if(!$args->colorset)
382
+		if (!$args->colorset)
383 383
 		{
384 384
 			$args->colorset = 'white';
385 385
 		}
386 386
 
387 387
 		$args->mlayout_srl = $args->mlayout_srl ? $args->mlayout_srl : NULL;
388
-		if(!$args->mskin)
388
+		if (!$args->mskin)
389 389
 		{
390 390
 			$args->mskin = 'default';
391 391
 		}
@@ -408,12 +408,12 @@  discard block
 block discarded – undo
408 408
 		$extendItems = $oMemberModel->getJoinFormList();
409 409
 
410 410
 		$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark');
411
-		$mustRequireds = array('email_address', 'nick_name','password', 'find_account_question');
411
+		$mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question');
412 412
 		$orgRequireds = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name');
413 413
 		$orgUse = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name', 'homepage', 'blog', 'birthday');
414 414
 		$list_order = array();
415 415
 
416
-		foreach($items as $key)
416
+		foreach ($items as $key)
417 417
 		{
418 418
 			unset($signupItem);
419 419
 			$signupItem = new stdClass;
@@ -425,23 +425,23 @@  discard block
 block discarded – undo
425 425
 			$signupItem->required = in_array($key, $orgRequireds);
426 426
 			$signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse);
427 427
 			$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
428
-			if(in_array($key, array('find_account_question', 'password', 'email_address')))
428
+			if (in_array($key, array('find_account_question', 'password', 'email_address')))
429 429
 			{
430 430
 				$signupItem->isPublic = 'N';
431 431
 			}
432 432
 			$signupItem->isIdentifier = ($key == $identifier);
433
-			if ($signupItem->imageType){
433
+			if ($signupItem->imageType) {
434 434
 				$signupItem->max_width = $config->{$key.'_max_width'};
435 435
 				$signupItem->max_height = $config->{$key.'_max_height'};
436 436
 			}
437
-			if($signupItem->isIdentifier)
437
+			if ($signupItem->isIdentifier)
438 438
 				array_unshift($list_order, $signupItem);
439 439
 			else
440 440
 				$list_order[] = $signupItem;
441 441
 		}
442
-		if(is_array($extendItems))
442
+		if (is_array($extendItems))
443 443
 		{
444
-			foreach($extendItems as $form_srl=>$item_info)
444
+			foreach ($extendItems as $form_srl=>$item_info)
445 445
 			{
446 446
 				unset($signupItem);
447 447
 				$signupItem = new stdClass;
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 				$signupItem->isUse = ($item_info->is_active == 'Y');
455 455
 				$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
456 456
 				$signupItem->description = $item_info->description;
457
-				if($signupItem->imageType)
457
+				if ($signupItem->imageType)
458 458
 				{
459 459
 					$signupItem->max_width = $config->{$key.'_max_width'};
460 460
 					$signupItem->max_height = $config->{$key.'_max_height'};
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
 	 * @param string $agreement
473 473
 	 * @return void
474 474
 	 */
475
-	function _createSignupRuleset($signupForm, $agreement = null){
475
+	function _createSignupRuleset($signupForm, $agreement = null) {
476 476
 		$xml_file = './files/ruleset/insertMember.xml';
477
-		$buff = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL.
478
-			'<ruleset version="1.5.0">' . PHP_EOL.
479
-			'<customrules>' . PHP_EOL.
480
-			'</customrules>' . PHP_EOL.
481
-			'<fields>' . PHP_EOL . '%s' . PHP_EOL . '</fields>' . PHP_EOL.
477
+		$buff = '<?xml version="1.0" encoding="utf-8"?>'.PHP_EOL.
478
+			'<ruleset version="1.5.0">'.PHP_EOL.
479
+			'<customrules>'.PHP_EOL.
480
+			'</customrules>'.PHP_EOL.
481
+			'<fields>'.PHP_EOL.'%s'.PHP_EOL.'</fields>'.PHP_EOL.
482 482
 			'</ruleset>';
483 483
 
484 484
 		$fields = array();
@@ -487,41 +487,41 @@  discard block
 block discarded – undo
487 487
 		{
488 488
 			$fields[] = '<field name="accept_agreement"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /></field>';
489 489
 		}
490
-		foreach($signupForm as $formInfo)
490
+		foreach ($signupForm as $formInfo)
491 491
 		{
492
-			if($formInfo->required || $formInfo->mustRequired)
492
+			if ($formInfo->required || $formInfo->mustRequired)
493 493
 			{
494
-				if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
494
+				if ($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
495 495
 				{
496 496
 					$fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name);
497 497
 				}
498
-				else if($formInfo->name == 'password')
498
+				else if ($formInfo->name == 'password')
499 499
 				{
500 500
 					$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>';
501 501
 					$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
502 502
 				}
503
-				else if($formInfo->name == 'find_account_question')
503
+				else if ($formInfo->name == 'find_account_question')
504 504
 				{
505 505
 					$fields[] = '<field name="find_account_question"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
506 506
 					$fields[] = '<field name="find_account_answer" length=":250"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
507 507
 				}
508
-				else if($formInfo->name == 'email_address')
508
+				else if ($formInfo->name == 'email_address')
509 509
 				{
510 510
 					$fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name);
511 511
 				}
512
-				else if($formInfo->name == 'user_id')
512
+				else if ($formInfo->name == 'user_id')
513 513
 				{
514 514
 					$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name);
515 515
 				}
516
-				else if($formInfo->name == 'nick_name')
516
+				else if ($formInfo->name == 'nick_name')
517 517
 				{
518 518
 					$fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name);
519 519
 				}
520
-				else if(strpos($formInfo->name, 'image') !== false)
520
+				else if (strpos($formInfo->name, 'image') !== false)
521 521
 				{
522 522
 					$fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' &amp;&amp; $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name);
523 523
 				}
524
-				else if($formInfo->name == 'signature')
524
+				else if ($formInfo->name == 'signature')
525 525
 				{
526 526
 					$fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>';
527 527
 				}
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 		FileHandler::writeFile($xml_file, $xml_buff);
537 537
 		unset($xml_buff);
538 538
 
539
-		$validator   = new Validator($xml_file);
539
+		$validator = new Validator($xml_file);
540 540
 		$validator->setCacheDir('files/cache');
541 541
 		$validator->getJsPath();
542 542
 	}
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 		$xml_buff = sprintf($buff, implode('', $fields));
565 565
 		Filehandler::writeFile($xml_file, $xml_buff);
566 566
 
567
-		$validator   = new Validator($xml_file);
567
+		$validator = new Validator($xml_file);
568 568
 		$validator->setCacheDir('files/cache');
569 569
 		$validator->getJsPath();
570 570
 	}
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 			'</ruleset>';
586 586
 
587 587
 		$fields = array();
588
-		if($identifier == 'user_id')
588
+		if ($identifier == 'user_id')
589 589
 			$fields[] = '<field name="user_id" required="true" rule="userid" />';
590 590
 
591 591
 		$fields[] = '<field name="email_address" required="true" rule="email" />';
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 		$xml_buff = sprintf($buff, implode('', $fields));
596 596
 		Filehandler::writeFile($xml_file, $xml_buff);
597 597
 
598
-		$validator   = new Validator($xml_file);
598
+		$validator = new Validator($xml_file);
599 599
 		$validator->setCacheDir('files/cache');
600 600
 		$validator->getJsPath();
601 601
 	}
@@ -606,12 +606,12 @@  discard block
 block discarded – undo
606 606
 	 */
607 607
 	function procMemberAdminInsertGroup()
608 608
 	{
609
-		$args = Context::gets('title','description','is_default','image_mark');
609
+		$args = Context::gets('title', 'description', 'is_default', 'image_mark');
610 610
 		$output = $this->insertGroup($args);
611
-		if(!$output->toBool()) return $output;
611
+		if (!$output->toBool()) return $output;
612 612
 
613
-		$this->add('group_srl','');
614
-		$this->add('page',Context::get('page'));
613
+		$this->add('group_srl', '');
614
+		$this->add('page', Context::get('page'));
615 615
 		$this->setMessage('success_registed');
616 616
 
617 617
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -626,13 +626,13 @@  discard block
 block discarded – undo
626 626
 	{
627 627
 		$group_srl = Context::get('group_srl');
628 628
 
629
-		$args = Context::gets('group_srl','title','description','is_default','image_mark');
629
+		$args = Context::gets('group_srl', 'title', 'description', 'is_default', 'image_mark');
630 630
 		$args->site_srl = 0;
631 631
 		$output = $this->updateGroup($args);
632
-		if(!$output->toBool()) return $output;
632
+		if (!$output->toBool()) return $output;
633 633
 
634
-		$this->add('group_srl','');
635
-		$this->add('page',Context::get('page'));
634
+		$this->add('group_srl', '');
635
+		$this->add('page', Context::get('page'));
636 636
 		$this->setMessage('success_updated');
637 637
 
638 638
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -648,10 +648,10 @@  discard block
 block discarded – undo
648 648
 		$group_srl = Context::get('group_srl');
649 649
 
650 650
 		$output = $this->deleteGroup($group_srl);
651
-		if(!$output->toBool()) return $output;
651
+		if (!$output->toBool()) return $output;
652 652
 
653
-		$this->add('group_srl','');
654
-		$this->add('page',Context::get('page'));
653
+		$this->add('group_srl', '');
654
+		$this->add('page', Context::get('page'));
655 655
 		$this->setMessage('success_deleted');
656 656
 
657 657
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -673,10 +673,10 @@  discard block
 block discarded – undo
673 673
 		$args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value')));
674 674
 		$args->required = Context::get('required');
675 675
 		$args->is_active = (isset($args->required));
676
-		if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N';
676
+		if (!in_array(strtoupper($args->required), array('Y', 'N')))$args->required = 'N';
677 677
 		$args->description = Context::get('description') ? Context::get('description') : '';
678 678
 		// Default values
679
-		if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value))
679
+		if (in_array($args->column_type, array('checkbox', 'select', 'radio')) && count($args->default_value))
680 680
 		{
681 681
 			$args->default_value = serialize($args->default_value);
682 682
 		}
@@ -688,17 +688,17 @@  discard block
 block discarded – undo
688 688
 		// Check ID duplicated
689 689
 		$oMemberModel = getModel('member');
690 690
 		$config = $oMemberModel->getMemberConfig();
691
-		foreach($config->signupForm as $item)
691
+		foreach ($config->signupForm as $item)
692 692
 		{
693
-			if($item->name == $args->column_name)
693
+			if ($item->name == $args->column_name)
694 694
 			{
695
-				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
696
-				return new BaseObject(-1,'msg_exists_user_id');
695
+				if ($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
696
+				return new BaseObject(-1, 'msg_exists_user_id');
697 697
 			}
698 698
 		}
699 699
 		// Fix if member_join_form_srl exists. Add if not exists.
700 700
 		$isInsert;
701
-		if(!$args->member_join_form_srl)
701
+		if (!$args->member_join_form_srl)
702 702
 		{
703 703
 			$isInsert = true;
704 704
 			$args->list_order = $args->member_join_form_srl = getNextSequence();
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 			$output = executeQuery('member.updateJoinForm', $args);
710 710
 		}
711 711
 
712
-		if(!$output->toBool()) return $output;
712
+		if (!$output->toBool()) return $output;
713 713
 
714 714
 		// memberConfig update
715 715
 		$signupItem = new stdClass();
@@ -726,15 +726,15 @@  discard block
 block discarded – undo
726 726
 		$config = $oMemberModel->getMemberConfig();
727 727
 		unset($config->agreement);
728 728
 
729
-		if($isInsert)
729
+		if ($isInsert)
730 730
 		{
731 731
 			$config->signupForm[] = $signupItem;
732 732
 		}
733 733
 		else
734 734
 		{
735
-			foreach($config->signupForm as $key=>$val)
735
+			foreach ($config->signupForm as $key=>$val)
736 736
 			{
737
-				if($val->member_join_form_srl == $signupItem->member_join_form_srl)
737
+				if ($val->member_join_form_srl == $signupItem->member_join_form_srl)
738 738
 				{
739 739
 					$config->signupForm[$key] = $signupItem;
740 740
 				}
@@ -762,9 +762,9 @@  discard block
 block discarded – undo
762 762
 		$config = $oMemberModel->getMemberConfig();
763 763
 		unset($config->agreement);
764 764
 
765
-		foreach($config->signupForm as $key=>$val)
765
+		foreach ($config->signupForm as $key=>$val)
766 766
 		{
767
-			if($val->member_join_form_srl == $member_join_form_srl)
767
+			if ($val->member_join_form_srl == $member_join_form_srl)
768 768
 			{
769 769
 				unset($config->signupForm[$key]);
770 770
 				break;
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 		$member_join_form_srl = Context::get('member_join_form_srl');
785 785
 		$mode = Context::get('mode');
786 786
 
787
-		switch($mode)
787
+		switch ($mode)
788 788
 		{
789 789
 			case 'up' :
790 790
 				$output = $this->moveJoinFormUp($member_join_form_srl);
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 			case 'update' :
802 802
 				break;
803 803
 		}
804
-		if(!$output->toBool()) return $output;
804
+		if (!$output->toBool()) return $output;
805 805
 
806 806
 		$this->setMessage($msg_code);
807 807
 	}
@@ -820,40 +820,40 @@  discard block
 block discarded – undo
820 820
 		$oDB->begin();
821 821
 
822 822
 		$oMemberController = getController('member');
823
-		foreach($members as $key=>$member_srl)
823
+		foreach ($members as $key=>$member_srl)
824 824
 		{
825 825
 			$args = new stdClass();
826 826
 			$args->member_srl = $member_srl;
827
-			switch($var->type)
827
+			switch ($var->type)
828 828
 			{
829 829
 				case 'modify':
830 830
 					{
831
-						if(count($groups) > 0)
831
+						if (count($groups) > 0)
832 832
 						{
833 833
 							$args->site_srl = 0;
834 834
 							// One of its members to delete all the group
835 835
 							$output = executeQuery('member.deleteMemberGroupMember', $args);
836
-							if(!$output->toBool())
836
+							if (!$output->toBool())
837 837
 							{
838 838
 								$oDB->rollback();
839 839
 								return $output;
840 840
 							}
841 841
 							// Enter one of the loop a
842
-							foreach($groups as $group_srl)
842
+							foreach ($groups as $group_srl)
843 843
 							{
844
-								$output = $oMemberController->addMemberToGroup($args->member_srl,$group_srl);
845
-								if(!$output->toBool())
844
+								$output = $oMemberController->addMemberToGroup($args->member_srl, $group_srl);
845
+								if (!$output->toBool())
846 846
 								{
847 847
 									$oDB->rollback();
848 848
 									return $output;
849 849
 								}
850 850
 							}
851 851
 						}
852
-						if($var->denied)
852
+						if ($var->denied)
853 853
 						{
854 854
 							$args->denied = $var->denied;
855 855
 							$output = executeQuery('member.updateMemberDeniedInfo', $args);
856
-							if(!$output->toBool())
856
+							if (!$output->toBool())
857 857
 							{
858 858
 								$oDB->rollback();
859 859
 								return $output;
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 					{
867 867
 						$oMemberController->memberInfo = null;
868 868
 						$output = $oMemberController->deleteMember($member_srl);
869
-						if(!$output->toBool())
869
+						if (!$output->toBool())
870 870
 						{
871 871
 							$oDB->rollback();
872 872
 							return $output;
@@ -879,15 +879,15 @@  discard block
 block discarded – undo
879 879
 
880 880
 		$message = $var->message;
881 881
 		// Send a message
882
-		if($message)
882
+		if ($message)
883 883
 		{
884 884
 			$oCommunicationController = getController('communication');
885 885
 
886 886
 			$logged_info = Context::get('logged_info');
887
-			$title = cut_str($message,10,'...');
887
+			$title = cut_str($message, 10, '...');
888 888
 			$sender_member_srl = $logged_info->member_srl;
889 889
 
890
-			foreach($members as $member_srl)
890
+			foreach ($members as $member_srl)
891 891
 			{
892 892
 				$oCommunicationController->sendMessage($sender_member_srl, $member_srl, $title, $message, false);
893 893
 			}
@@ -904,14 +904,14 @@  discard block
 block discarded – undo
904 904
 	function procMemberAdminDeleteMembers()
905 905
 	{
906 906
 		$target_member_srls = Context::get('target_member_srls');
907
-		if(!$target_member_srls) return new BaseObject(-1, 'msg_invalid_request');
907
+		if (!$target_member_srls) return new BaseObject(-1, 'msg_invalid_request');
908 908
 		$member_srls = explode(',', $target_member_srls);
909 909
 		$oMemberController = getController('member');
910 910
 
911
-		foreach($member_srls as $member)
911
+		foreach ($member_srls as $member)
912 912
 		{
913 913
 			$output = $oMemberController->deleteMember($member);
914
-			if(!$output->toBool())
914
+			if (!$output->toBool())
915 915
 			{
916 916
 				$this->setMessage('failed_deleted');
917 917
 				return $output;
@@ -928,11 +928,11 @@  discard block
 block discarded – undo
928 928
 	function procMemberAdminUpdateMembersGroup()
929 929
 	{
930 930
 		$member_srl = Context::get('member_srl');
931
-		if(!$member_srl) return new BaseObject(-1,'msg_invalid_request');
932
-		$member_srls = explode(',',$member_srl);
931
+		if (!$member_srl) return new BaseObject(-1, 'msg_invalid_request');
932
+		$member_srls = explode(',', $member_srl);
933 933
 
934 934
 		$group_srl = Context::get('group_srls');
935
-		if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
935
+		if (!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
936 936
 		else $group_srls = $group_srl;
937 937
 
938 938
 		$oDB = &DB::getInstance();
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 		$args = new stdClass;
942 942
 		$args->member_srl = $member_srl;
943 943
 		$output = executeQuery('member.deleteMembersGroup', $args);
944
-		if(!$output->toBool())
944
+		if (!$output->toBool())
945 945
 		{
946 946
 			$oDB->rollback();
947 947
 			return $output;
@@ -949,21 +949,21 @@  discard block
 block discarded – undo
949 949
 		// Add to a selected group
950 950
 		$group_count = count($group_srls);
951 951
 		$member_count = count($member_srls);
952
-		for($j=0;$j<$group_count;$j++)
952
+		for ($j = 0; $j < $group_count; $j++)
953 953
 		{
954
-			$group_srl = (int)trim($group_srls[$j]);
955
-			if(!$group_srl) continue;
956
-			for($i=0;$i<$member_count;$i++)
954
+			$group_srl = (int) trim($group_srls[$j]);
955
+			if (!$group_srl) continue;
956
+			for ($i = 0; $i < $member_count; $i++)
957 957
 			{
958
-				$member_srl = (int)trim($member_srls[$i]);
959
-				if(!$member_srl) continue;
958
+				$member_srl = (int) trim($member_srls[$i]);
959
+				if (!$member_srl) continue;
960 960
 
961 961
 				$args = new stdClass;
962 962
 				$args->member_srl = $member_srl;
963 963
 				$args->group_srl = $group_srl;
964 964
 
965 965
 				$output = executeQuery('member.addMemberToGroup', $args);
966
-				if(!$output->toBool())
966
+				if (!$output->toBool())
967 967
 				{
968 968
 					$oDB->rollback();
969 969
 					return $output;
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 
977 977
 		$this->setMessage('success_updated');
978 978
 
979
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
979
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
980 980
 		{
981 981
 			global $lang;
982 982
 			htmlHeader();
@@ -997,19 +997,19 @@  discard block
 block discarded – undo
997 997
 	{
998 998
 		$user_ids = Context::get('user_id');
999 999
 
1000
-		$user_ids = explode(',',$user_ids);
1000
+		$user_ids = explode(',', $user_ids);
1001 1001
 		$success_ids = array();
1002 1002
 
1003
-		foreach($user_ids as $val)
1003
+		foreach ($user_ids as $val)
1004 1004
 		{
1005 1005
 			$val = trim($val);
1006
-			if(!$val) continue;
1006
+			if (!$val) continue;
1007 1007
 
1008 1008
 			$output = $this->insertDeniedID($val, '');
1009
-			if($output->toBool()) $success_ids[] = $val;
1009
+			if ($output->toBool()) $success_ids[] = $val;
1010 1010
 		}
1011 1011
 
1012
-		$this->add('user_ids', implode(',',$success_ids));
1012
+		$this->add('user_ids', implode(',', $success_ids));
1013 1013
 
1014 1014
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminDeniedIDList');
1015 1015
 		$this->setRedirectUrl($returnUrl);
@@ -1026,10 +1026,10 @@  discard block
 block discarded – undo
1026 1026
 		$mode = Context::get('mode');
1027 1027
 		$mode = $mode ? $mode : 'insert';
1028 1028
 
1029
-		if($mode == 'delete')
1029
+		if ($mode == 'delete')
1030 1030
 		{
1031 1031
 			$output = $this->deleteDeniedNickName($nick_name);
1032
-			if(!$output->toBool())
1032
+			if (!$output->toBool())
1033 1033
 			{
1034 1034
 				return $output;
1035 1035
 			}
@@ -1038,19 +1038,19 @@  discard block
 block discarded – undo
1038 1038
 		}
1039 1039
 		else
1040 1040
 		{
1041
-			$nick_names = explode(',',$nick_name);
1041
+			$nick_names = explode(',', $nick_name);
1042 1042
 			$success_nick_names = array();
1043 1043
 
1044
-			foreach($nick_names as $val)
1044
+			foreach ($nick_names as $val)
1045 1045
 			{
1046 1046
 				$val = trim($val);
1047
-				if(!$val) continue;
1047
+				if (!$val) continue;
1048 1048
 
1049 1049
 				$output = $this->insertDeniedNickName($val, '');
1050
-				if($output->toBool()) $success_nick_names[] = $val;
1050
+				if ($output->toBool()) $success_nick_names[] = $val;
1051 1051
 			}
1052 1052
 
1053
-			$this->add('nick_names', implode(',',$success_nick_names));
1053
+			$this->add('nick_names', implode(',', $success_nick_names));
1054 1054
 		}
1055 1055
 	}
1056 1056
 
@@ -1063,16 +1063,16 @@  discard block
 block discarded – undo
1063 1063
 		$user_id = Context::get('user_id');
1064 1064
 		$mode = Context::get('mode');
1065 1065
 
1066
-		switch($mode)
1066
+		switch ($mode)
1067 1067
 		{
1068 1068
 			case 'delete' :
1069 1069
 				$output = $this->deleteDeniedID($user_id);
1070
-				if(!$output->toBool()) return $output;
1070
+				if (!$output->toBool()) return $output;
1071 1071
 				$msg_code = 'success_deleted';
1072 1072
 				break;
1073 1073
 		}
1074 1074
 
1075
-		$this->add('page',Context::get('page'));
1075
+		$this->add('page', Context::get('page'));
1076 1076
 		$this->setMessage($msg_code);
1077 1077
 	}
1078 1078
 
@@ -1119,24 +1119,24 @@  discard block
 block discarded – undo
1119 1119
 	 */
1120 1120
 	function insertGroup($args)
1121 1121
 	{
1122
-		if(!$args->site_srl) $args->site_srl = 0;
1122
+		if (!$args->site_srl) $args->site_srl = 0;
1123 1123
 		// Check the value of is_default.
1124
-		if($args->is_default != 'Y')
1124
+		if ($args->is_default != 'Y')
1125 1125
 		{
1126 1126
 			$args->is_default = 'N';
1127 1127
 		}
1128 1128
 		else
1129 1129
 		{
1130 1130
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1131
-			if(!$output->toBool()) return $output;
1131
+			if (!$output->toBool()) return $output;
1132 1132
 		}
1133 1133
 
1134
-		if(!isset($args->list_order) || $args->list_order=='')
1134
+		if (!isset($args->list_order) || $args->list_order == '')
1135 1135
 		{
1136 1136
 			$args->list_order = $args->group_srl;
1137 1137
 		}
1138 1138
 
1139
-		if(!$args->group_srl) $args->group_srl = getNextSequence();
1139
+		if (!$args->group_srl) $args->group_srl = getNextSequence();
1140 1140
 		$args->list_order = $args->group_srl;
1141 1141
 		$output = executeQuery('member.insertGroup', $args);
1142 1142
 		$this->_deleteMemberGroupCache($args->site_srl);
@@ -1151,17 +1151,17 @@  discard block
 block discarded – undo
1151 1151
 	 */
1152 1152
 	function updateGroup($args)
1153 1153
 	{
1154
-		if(!$args->site_srl) $args->site_srl = 0;
1154
+		if (!$args->site_srl) $args->site_srl = 0;
1155 1155
 		// Check the value of is_default.
1156
-		if(!$args->group_srl) return new BaseObject(-1, 'lang->msg_not_founded');
1157
-		if($args->is_default!='Y')
1156
+		if (!$args->group_srl) return new BaseObject(-1, 'lang->msg_not_founded');
1157
+		if ($args->is_default != 'Y')
1158 1158
 		{
1159 1159
 			$args->is_default = 'N';
1160 1160
 		}
1161 1161
 		else
1162 1162
 		{
1163 1163
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1164
-			if(!$output->toBool()) return $output;
1164
+			if (!$output->toBool()) return $output;
1165 1165
 		}
1166 1166
 
1167 1167
 		$output = executeQuery('member.updateGroup', $args);
@@ -1184,8 +1184,8 @@  discard block
 block discarded – undo
1184 1184
 		$columnList = array('group_srl', 'is_default');
1185 1185
 		$group_info = $oMemberModel->getGroup($group_srl, $columnList);
1186 1186
 
1187
-		if(!$group_info) return new BaseObject(-1, 'lang->msg_not_founded');
1188
-		if($group_info->is_default == 'Y') return new BaseObject(-1, 'msg_not_delete_default');
1187
+		if (!$group_info) return new BaseObject(-1, 'lang->msg_not_founded');
1188
+		if ($group_info->is_default == 'Y') return new BaseObject(-1, 'msg_not_delete_default');
1189 1189
 
1190 1190
 		// Get groups where is_default == 'Y'
1191 1191
 		$columnList = array('site_srl', 'group_srl');
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
 		$defaultGroup = $oMemberModel->getDefaultGroup(0);
1223 1223
 		$defaultGroupSrl = $defaultGroup->group_srl;
1224 1224
 		$group_srls = $vars->group_srls;
1225
-		foreach($group_srls as $order=>$group_srl)
1225
+		foreach ($group_srls as $order=>$group_srl)
1226 1226
 		{
1227 1227
 			$isInsert = false;
1228 1228
 			$update_args = new stdClass();
@@ -1231,9 +1231,9 @@  discard block
 block discarded – undo
1231 1231
 			$update_args->image_mark = $vars->image_marks[$order];
1232 1232
 			$update_args->list_order = $order + 1;
1233 1233
 
1234
-			if(!$update_args->title) continue;
1234
+			if (!$update_args->title) continue;
1235 1235
 
1236
-			if(is_numeric($group_srl)) {
1236
+			if (is_numeric($group_srl)) {
1237 1237
 				$update_args->group_srl = $group_srl;
1238 1238
 				$output = $this->updateGroup($update_args);
1239 1239
 			}
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 				$output = $this->insertGroup($update_args);
1243 1243
 			}
1244 1244
 
1245
-			if($vars->defaultGroup == $group_srl) {
1245
+			if ($vars->defaultGroup == $group_srl) {
1246 1246
 				$defaultGroupSrl = $update_args->group_srl;
1247 1247
 			}
1248 1248
 		}
@@ -1268,7 +1268,7 @@  discard block
 block discarded – undo
1268 1268
 	{
1269 1269
 		$vars = Context::getRequestVars();
1270 1270
 
1271
-		foreach($vars->group_srls as $key => $val)
1271
+		foreach ($vars->group_srls as $key => $val)
1272 1272
 		{
1273 1273
 			$args = new stdClass;
1274 1274
 			$args->group_srl = $val;
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 	{
1290 1290
 		//remove from cache
1291 1291
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1292
-		if($oCacheHandler->isSupport())
1292
+		if ($oCacheHandler->isSupport())
1293 1293
 		{
1294 1294
 			$oCacheHandler->invalidateGroupKey('member');
1295 1295
 		}
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
 		$args = new stdClass();
1307 1307
 		$args->user_id = $user_id;
1308 1308
 		$args->description = $description;
1309
-		$args->list_order = -1*getNextSequence();
1309
+		$args->list_order = -1 * getNextSequence();
1310 1310
 
1311 1311
 		return executeQuery('member.insertDeniedID', $args);
1312 1312
 	}
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
 	 */
1328 1328
 	function deleteDeniedID($user_id)
1329 1329
 	{
1330
-		if(!$user_id) unset($user_id);
1330
+		if (!$user_id) unset($user_id);
1331 1331
 
1332 1332
 		$args = new stdClass;
1333 1333
 		$args->user_id = $user_id;
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 	 */
1342 1342
 	function deleteDeniedNickName($nick_name)
1343 1343
 	{
1344
-		if(!$nick_name) unset($nick_name);
1344
+		if (!$nick_name) unset($nick_name);
1345 1345
 
1346 1346
 		$args = new stdClass;
1347 1347
 		$args->nick_name = $nick_name;
@@ -1380,16 +1380,16 @@  discard block
 block discarded – undo
1380 1380
 		// Get a list of all join forms
1381 1381
 		$join_form_list = $oMemberModel->getJoinFormList();
1382 1382
 		$join_form_srl_list = array_keys($join_form_list);
1383
-		if(count($join_form_srl_list)<2) return new BaseObject();
1383
+		if (count($join_form_srl_list) < 2) return new BaseObject();
1384 1384
 
1385 1385
 		$prev_member_join_form = NULL;
1386
-		foreach($join_form_list as $key => $val)
1386
+		foreach ($join_form_list as $key => $val)
1387 1387
 		{
1388
-			if($val->member_join_form_srl == $member_join_form_srl) break;
1388
+			if ($val->member_join_form_srl == $member_join_form_srl) break;
1389 1389
 			$prev_member_join_form = $val;
1390 1390
 		}
1391 1391
 		// Return if no previous join form exists
1392
-		if(!$prev_member_join_form) return new BaseObject();
1392
+		if (!$prev_member_join_form) return new BaseObject();
1393 1393
 		// Information of the join form
1394 1394
 		$cur_args = new stdClass;
1395 1395
 		$cur_args->member_join_form_srl = $member_join_form_srl;
@@ -1400,10 +1400,10 @@  discard block
 block discarded – undo
1400 1400
 		$prev_args->list_order = $list_order;
1401 1401
 		// Execute Query
1402 1402
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1403
-		if(!$output->toBool()) return $output;
1403
+		if (!$output->toBool()) return $output;
1404 1404
 
1405 1405
 		executeQuery('member.updateMemberJoinFormListorder', $prev_args);
1406
-		if(!$output->toBool()) return $output;
1406
+		if (!$output->toBool()) return $output;
1407 1407
 
1408 1408
 		return new BaseObject();
1409 1409
 	}
@@ -1427,16 +1427,16 @@  discard block
 block discarded – undo
1427 1427
 		// Get information of all join forms
1428 1428
 		$join_form_list = $oMemberModel->getJoinFormList();
1429 1429
 		$join_form_srl_list = array_keys($join_form_list);
1430
-		if(count($join_form_srl_list)<2) return new BaseObject();
1430
+		if (count($join_form_srl_list) < 2) return new BaseObject();
1431 1431
 
1432
-		for($i=0;$i<count($join_form_srl_list);$i++)
1432
+		for ($i = 0; $i < count($join_form_srl_list); $i++)
1433 1433
 		{
1434
-			if($join_form_srl_list[$i]==$member_join_form_srl) break;
1434
+			if ($join_form_srl_list[$i] == $member_join_form_srl) break;
1435 1435
 		}
1436 1436
 
1437
-		$next_member_join_form_srl = $join_form_srl_list[$i+1];
1437
+		$next_member_join_form_srl = $join_form_srl_list[$i + 1];
1438 1438
 		// Return if no previous join form exists
1439
-		if(!$next_member_join_form_srl) return new BaseObject();
1439
+		if (!$next_member_join_form_srl) return new BaseObject();
1440 1440
 		$next_member_join_form = $join_form_list[$next_member_join_form_srl];
1441 1441
 		// Information of the join form
1442 1442
 		$cur_args = new stdClass;
@@ -1448,10 +1448,10 @@  discard block
 block discarded – undo
1448 1448
 		$next_args->list_order = $list_order;
1449 1449
 		// Execute Query
1450 1450
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1451
-		if(!$output->toBool()) return $output;
1451
+		if (!$output->toBool()) return $output;
1452 1452
 
1453 1453
 		$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
1454
-		if(!$output->toBool()) return $output;
1454
+		if (!$output->toBool()) return $output;
1455 1455
 
1456 1456
 		return new BaseObject();
1457 1457
 	}
Please login to merge, or discard this patch.
Braces   +162 added lines, -86 removed lines patch added patch discarded remove patch
@@ -48,9 +48,11 @@  discard block
 block discarded – undo
48 48
 			$args->{$val} = Context::get($val);
49 49
 		}
50 50
 		$args->member_srl = Context::get('member_srl');
51
-		if(Context::get('reset_password'))
52
-			$args->password = Context::get('reset_password');
53
-		else unset($args->password);
51
+		if(Context::get('reset_password')) {
52
+					$args->password = Context::get('reset_password');
53
+		} else {
54
+			unset($args->password);
55
+		}
54 56
 
55 57
 		// Remove some unnecessary variables from all the vars
56 58
 		$all_args = Context::getRequestVars();
@@ -60,7 +62,9 @@  discard block
 block discarded – undo
60 62
 		unset($all_args->error_return_url);
61 63
 		unset($all_args->success_return_url);
62 64
 		unset($all_args->ruleset);
63
-		if(!isset($args->limit_date)) $args->limit_date = "";
65
+		if(!isset($args->limit_date)) {
66
+			$args->limit_date = "";
67
+		}
64 68
 		unset($all_args->password);
65 69
 		unset($all_args->password2);
66 70
 		unset($all_args->reset_password);
@@ -76,7 +80,9 @@  discard block
 block discarded – undo
76 80
 			$columnList = array('member_srl');
77 81
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList);
78 82
 			// If no original member exists, make a new one
79
-			if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
83
+			if($member_info->member_srl != $args->member_srl) {
84
+				unset($args->member_srl);
85
+			}
80 86
 		}
81 87
 
82 88
 		// remove whitespace
@@ -96,14 +102,15 @@  discard block
 block discarded – undo
96 102
 			$args->password = Context::get('password');
97 103
 			$output = $oMemberController->insertMember($args);
98 104
 			$msg_code = 'success_registed';
99
-		}
100
-		else
105
+		} else
101 106
 		{
102 107
 			$output = $oMemberController->updateMember($args);
103 108
 			$msg_code = 'success_updated';
104 109
 		}
105 110
 
106
-		if(!$output->toBool()) return $output;
111
+		if(!$output->toBool()) {
112
+			return $output;
113
+		}
107 114
 		// Save Signature
108 115
 		$signature = Context::get('signature');
109 116
 		$oMemberController->putSignature($args->member_srl, $signature);
@@ -144,7 +151,9 @@  discard block
 block discarded – undo
144 151
 
145 152
 		$oMemberController = getController('member');
146 153
 		$output = $oMemberController->deleteMember($member_srl);
147
-		if(!$output->toBool()) return $output;
154
+		if(!$output->toBool()) {
155
+			return $output;
156
+		}
148 157
 
149 158
 		$this->add('page',Context::get('page'));
150 159
 		$this->setMessage("success_deleted");
@@ -263,8 +272,11 @@  discard block
 block discarded – undo
263 272
 			$signupItem->isDefaultForm = in_array($key, $items);
264 273
 
265 274
 			$signupItem->name = $key;
266
-			if(!in_array($key, $items)) $signupItem->title = $key;
267
-			else $signupItem->title = $lang->{$key};
275
+			if(!in_array($key, $items)) {
276
+				$signupItem->title = $key;
277
+			} else {
278
+				$signupItem->title = $lang->{$key};
279
+			}
268 280
 			$signupItem->mustRequired = in_array($key, $mustRequireds);
269 281
 			$signupItem->imageType = (strpos($key, 'image') !== false);
270 282
 			$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier;
@@ -434,10 +446,11 @@  discard block
 block discarded – undo
434 446
 				$signupItem->max_width = $config->{$key.'_max_width'};
435 447
 				$signupItem->max_height = $config->{$key.'_max_height'};
436 448
 			}
437
-			if($signupItem->isIdentifier)
438
-				array_unshift($list_order, $signupItem);
439
-			else
440
-				$list_order[] = $signupItem;
449
+			if($signupItem->isIdentifier) {
450
+							array_unshift($list_order, $signupItem);
451
+			} else {
452
+							$list_order[] = $signupItem;
453
+			}
441 454
 		}
442 455
 		if(is_array($extendItems))
443 456
 		{
@@ -494,38 +507,30 @@  discard block
 block discarded – undo
494 507
 				if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
495 508
 				{
496 509
 					$fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name);
497
-				}
498
-				else if($formInfo->name == 'password')
510
+				} else if($formInfo->name == 'password')
499 511
 				{
500 512
 					$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>';
501 513
 					$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
502
-				}
503
-				else if($formInfo->name == 'find_account_question')
514
+				} else if($formInfo->name == 'find_account_question')
504 515
 				{
505 516
 					$fields[] = '<field name="find_account_question"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
506 517
 					$fields[] = '<field name="find_account_answer" length=":250"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
507
-				}
508
-				else if($formInfo->name == 'email_address')
518
+				} else if($formInfo->name == 'email_address')
509 519
 				{
510 520
 					$fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name);
511
-				}
512
-				else if($formInfo->name == 'user_id')
521
+				} else if($formInfo->name == 'user_id')
513 522
 				{
514 523
 					$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name);
515
-				}
516
-				else if($formInfo->name == 'nick_name')
524
+				} else if($formInfo->name == 'nick_name')
517 525
 				{
518 526
 					$fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name);
519
-				}
520
-				else if(strpos($formInfo->name, 'image') !== false)
527
+				} else if(strpos($formInfo->name, 'image') !== false)
521 528
 				{
522 529
 					$fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' &amp;&amp; $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name);
523
-				}
524
-				else if($formInfo->name == 'signature')
530
+				} else if($formInfo->name == 'signature')
525 531
 				{
526 532
 					$fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>';
527
-				}
528
-				else
533
+				} else
529 534
 				{
530 535
 					$fields[] = sprintf('<field name="%s" required="true" />', $formInfo->name);
531 536
 				}
@@ -585,8 +590,9 @@  discard block
 block discarded – undo
585 590
 			'</ruleset>';
586 591
 
587 592
 		$fields = array();
588
-		if($identifier == 'user_id')
589
-			$fields[] = '<field name="user_id" required="true" rule="userid" />';
593
+		if($identifier == 'user_id') {
594
+					$fields[] = '<field name="user_id" required="true" rule="userid" />';
595
+		}
590 596
 
591 597
 		$fields[] = '<field name="email_address" required="true" rule="email" />';
592 598
 		$fields[] = '<field name="find_account_question" required="true" />';
@@ -608,7 +614,9 @@  discard block
 block discarded – undo
608 614
 	{
609 615
 		$args = Context::gets('title','description','is_default','image_mark');
610 616
 		$output = $this->insertGroup($args);
611
-		if(!$output->toBool()) return $output;
617
+		if(!$output->toBool()) {
618
+			return $output;
619
+		}
612 620
 
613 621
 		$this->add('group_srl','');
614 622
 		$this->add('page',Context::get('page'));
@@ -629,7 +637,9 @@  discard block
 block discarded – undo
629 637
 		$args = Context::gets('group_srl','title','description','is_default','image_mark');
630 638
 		$args->site_srl = 0;
631 639
 		$output = $this->updateGroup($args);
632
-		if(!$output->toBool()) return $output;
640
+		if(!$output->toBool()) {
641
+			return $output;
642
+		}
633 643
 
634 644
 		$this->add('group_srl','');
635 645
 		$this->add('page',Context::get('page'));
@@ -648,7 +658,9 @@  discard block
 block discarded – undo
648 658
 		$group_srl = Context::get('group_srl');
649 659
 
650 660
 		$output = $this->deleteGroup($group_srl);
651
-		if(!$output->toBool()) return $output;
661
+		if(!$output->toBool()) {
662
+			return $output;
663
+		}
652 664
 
653 665
 		$this->add('group_srl','');
654 666
 		$this->add('page',Context::get('page'));
@@ -673,14 +685,15 @@  discard block
 block discarded – undo
673 685
 		$args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value')));
674 686
 		$args->required = Context::get('required');
675 687
 		$args->is_active = (isset($args->required));
676
-		if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N';
688
+		if(!in_array(strtoupper($args->required), array('Y','N'))) {
689
+			$args->required = 'N';
690
+		}
677 691
 		$args->description = Context::get('description') ? Context::get('description') : '';
678 692
 		// Default values
679 693
 		if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value))
680 694
 		{
681 695
 			$args->default_value = serialize($args->default_value);
682
-		}
683
-		else
696
+		} else
684 697
 		{
685 698
 			$args->default_value = '';
686 699
 		}
@@ -692,7 +705,9 @@  discard block
 block discarded – undo
692 705
 		{
693 706
 			if($item->name == $args->column_name)
694 707
 			{
695
-				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
708
+				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) {
709
+					continue;
710
+				}
696 711
 				return new BaseObject(-1,'msg_exists_user_id');
697 712
 			}
698 713
 		}
@@ -703,13 +718,14 @@  discard block
 block discarded – undo
703 718
 			$isInsert = true;
704 719
 			$args->list_order = $args->member_join_form_srl = getNextSequence();
705 720
 			$output = executeQuery('member.insertJoinForm', $args);
706
-		}
707
-		else
721
+		} else
708 722
 		{
709 723
 			$output = executeQuery('member.updateJoinForm', $args);
710 724
 		}
711 725
 
712
-		if(!$output->toBool()) return $output;
726
+		if(!$output->toBool()) {
727
+			return $output;
728
+		}
713 729
 
714 730
 		// memberConfig update
715 731
 		$signupItem = new stdClass();
@@ -729,8 +745,7 @@  discard block
 block discarded – undo
729 745
 		if($isInsert)
730 746
 		{
731 747
 			$config->signupForm[] = $signupItem;
732
-		}
733
-		else
748
+		} else
734 749
 		{
735 750
 			foreach($config->signupForm as $key=>$val)
736 751
 			{
@@ -801,7 +816,9 @@  discard block
 block discarded – undo
801 816
 			case 'update' :
802 817
 				break;
803 818
 		}
804
-		if(!$output->toBool()) return $output;
819
+		if(!$output->toBool()) {
820
+			return $output;
821
+		}
805 822
 
806 823
 		$this->setMessage($msg_code);
807 824
 	}
@@ -904,7 +921,9 @@  discard block
 block discarded – undo
904 921
 	function procMemberAdminDeleteMembers()
905 922
 	{
906 923
 		$target_member_srls = Context::get('target_member_srls');
907
-		if(!$target_member_srls) return new BaseObject(-1, 'msg_invalid_request');
924
+		if(!$target_member_srls) {
925
+			return new BaseObject(-1, 'msg_invalid_request');
926
+		}
908 927
 		$member_srls = explode(',', $target_member_srls);
909 928
 		$oMemberController = getController('member');
910 929
 
@@ -928,12 +947,17 @@  discard block
 block discarded – undo
928 947
 	function procMemberAdminUpdateMembersGroup()
929 948
 	{
930 949
 		$member_srl = Context::get('member_srl');
931
-		if(!$member_srl) return new BaseObject(-1,'msg_invalid_request');
950
+		if(!$member_srl) {
951
+			return new BaseObject(-1,'msg_invalid_request');
952
+		}
932 953
 		$member_srls = explode(',',$member_srl);
933 954
 
934 955
 		$group_srl = Context::get('group_srls');
935
-		if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
936
-		else $group_srls = $group_srl;
956
+		if(!is_array($group_srl)) {
957
+			$group_srls = explode('|@|', $group_srl);
958
+		} else {
959
+			$group_srls = $group_srl;
960
+		}
937 961
 
938 962
 		$oDB = &DB::getInstance();
939 963
 		$oDB->begin();
@@ -952,11 +976,15 @@  discard block
 block discarded – undo
952 976
 		for($j=0;$j<$group_count;$j++)
953 977
 		{
954 978
 			$group_srl = (int)trim($group_srls[$j]);
955
-			if(!$group_srl) continue;
979
+			if(!$group_srl) {
980
+				continue;
981
+			}
956 982
 			for($i=0;$i<$member_count;$i++)
957 983
 			{
958 984
 				$member_srl = (int)trim($member_srls[$i]);
959
-				if(!$member_srl) continue;
985
+				if(!$member_srl) {
986
+					continue;
987
+				}
960 988
 
961 989
 				$args = new stdClass;
962 990
 				$args->member_srl = $member_srl;
@@ -1003,10 +1031,14 @@  discard block
 block discarded – undo
1003 1031
 		foreach($user_ids as $val)
1004 1032
 		{
1005 1033
 			$val = trim($val);
1006
-			if(!$val) continue;
1034
+			if(!$val) {
1035
+				continue;
1036
+			}
1007 1037
 
1008 1038
 			$output = $this->insertDeniedID($val, '');
1009
-			if($output->toBool()) $success_ids[] = $val;
1039
+			if($output->toBool()) {
1040
+				$success_ids[] = $val;
1041
+			}
1010 1042
 		}
1011 1043
 
1012 1044
 		$this->add('user_ids', implode(',',$success_ids));
@@ -1035,8 +1067,7 @@  discard block
 block discarded – undo
1035 1067
 			}
1036 1068
 			$msg_code = 'success_deleted';
1037 1069
 			$this->setMessage($msg_code);
1038
-		}
1039
-		else
1070
+		} else
1040 1071
 		{
1041 1072
 			$nick_names = explode(',',$nick_name);
1042 1073
 			$success_nick_names = array();
@@ -1044,10 +1075,14 @@  discard block
 block discarded – undo
1044 1075
 			foreach($nick_names as $val)
1045 1076
 			{
1046 1077
 				$val = trim($val);
1047
-				if(!$val) continue;
1078
+				if(!$val) {
1079
+					continue;
1080
+				}
1048 1081
 
1049 1082
 				$output = $this->insertDeniedNickName($val, '');
1050
-				if($output->toBool()) $success_nick_names[] = $val;
1083
+				if($output->toBool()) {
1084
+					$success_nick_names[] = $val;
1085
+				}
1051 1086
 			}
1052 1087
 
1053 1088
 			$this->add('nick_names', implode(',',$success_nick_names));
@@ -1067,7 +1102,9 @@  discard block
 block discarded – undo
1067 1102
 		{
1068 1103
 			case 'delete' :
1069 1104
 				$output = $this->deleteDeniedID($user_id);
1070
-				if(!$output->toBool()) return $output;
1105
+				if(!$output->toBool()) {
1106
+					return $output;
1107
+				}
1071 1108
 				$msg_code = 'success_deleted';
1072 1109
 				break;
1073 1110
 		}
@@ -1119,16 +1156,19 @@  discard block
 block discarded – undo
1119 1156
 	 */
1120 1157
 	function insertGroup($args)
1121 1158
 	{
1122
-		if(!$args->site_srl) $args->site_srl = 0;
1159
+		if(!$args->site_srl) {
1160
+			$args->site_srl = 0;
1161
+		}
1123 1162
 		// Check the value of is_default.
1124 1163
 		if($args->is_default != 'Y')
1125 1164
 		{
1126 1165
 			$args->is_default = 'N';
1127
-		}
1128
-		else
1166
+		} else
1129 1167
 		{
1130 1168
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1131
-			if(!$output->toBool()) return $output;
1169
+			if(!$output->toBool()) {
1170
+				return $output;
1171
+			}
1132 1172
 		}
1133 1173
 
1134 1174
 		if(!isset($args->list_order) || $args->list_order=='')
@@ -1136,7 +1176,9 @@  discard block
 block discarded – undo
1136 1176
 			$args->list_order = $args->group_srl;
1137 1177
 		}
1138 1178
 
1139
-		if(!$args->group_srl) $args->group_srl = getNextSequence();
1179
+		if(!$args->group_srl) {
1180
+			$args->group_srl = getNextSequence();
1181
+		}
1140 1182
 		$args->list_order = $args->group_srl;
1141 1183
 		$output = executeQuery('member.insertGroup', $args);
1142 1184
 		$this->_deleteMemberGroupCache($args->site_srl);
@@ -1151,17 +1193,22 @@  discard block
 block discarded – undo
1151 1193
 	 */
1152 1194
 	function updateGroup($args)
1153 1195
 	{
1154
-		if(!$args->site_srl) $args->site_srl = 0;
1196
+		if(!$args->site_srl) {
1197
+			$args->site_srl = 0;
1198
+		}
1155 1199
 		// Check the value of is_default.
1156
-		if(!$args->group_srl) return new BaseObject(-1, 'lang->msg_not_founded');
1200
+		if(!$args->group_srl) {
1201
+			return new BaseObject(-1, 'lang->msg_not_founded');
1202
+		}
1157 1203
 		if($args->is_default!='Y')
1158 1204
 		{
1159 1205
 			$args->is_default = 'N';
1160
-		}
1161
-		else
1206
+		} else
1162 1207
 		{
1163 1208
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1164
-			if(!$output->toBool()) return $output;
1209
+			if(!$output->toBool()) {
1210
+				return $output;
1211
+			}
1165 1212
 		}
1166 1213
 
1167 1214
 		$output = executeQuery('member.updateGroup', $args);
@@ -1184,8 +1231,12 @@  discard block
 block discarded – undo
1184 1231
 		$columnList = array('group_srl', 'is_default');
1185 1232
 		$group_info = $oMemberModel->getGroup($group_srl, $columnList);
1186 1233
 
1187
-		if(!$group_info) return new BaseObject(-1, 'lang->msg_not_founded');
1188
-		if($group_info->is_default == 'Y') return new BaseObject(-1, 'msg_not_delete_default');
1234
+		if(!$group_info) {
1235
+			return new BaseObject(-1, 'lang->msg_not_founded');
1236
+		}
1237
+		if($group_info->is_default == 'Y') {
1238
+			return new BaseObject(-1, 'msg_not_delete_default');
1239
+		}
1189 1240
 
1190 1241
 		// Get groups where is_default == 'Y'
1191 1242
 		$columnList = array('site_srl', 'group_srl');
@@ -1231,13 +1282,14 @@  discard block
 block discarded – undo
1231 1282
 			$update_args->image_mark = $vars->image_marks[$order];
1232 1283
 			$update_args->list_order = $order + 1;
1233 1284
 
1234
-			if(!$update_args->title) continue;
1285
+			if(!$update_args->title) {
1286
+				continue;
1287
+			}
1235 1288
 
1236 1289
 			if(is_numeric($group_srl)) {
1237 1290
 				$update_args->group_srl = $group_srl;
1238 1291
 				$output = $this->updateGroup($update_args);
1239
-			}
1240
-			else {
1292
+			} else {
1241 1293
 				$update_args->group_srl = getNextSequence();
1242 1294
 				$output = $this->insertGroup($update_args);
1243 1295
 			}
@@ -1327,7 +1379,9 @@  discard block
 block discarded – undo
1327 1379
 	 */
1328 1380
 	function deleteDeniedID($user_id)
1329 1381
 	{
1330
-		if(!$user_id) unset($user_id);
1382
+		if(!$user_id) {
1383
+			unset($user_id);
1384
+		}
1331 1385
 
1332 1386
 		$args = new stdClass;
1333 1387
 		$args->user_id = $user_id;
@@ -1341,7 +1395,9 @@  discard block
 block discarded – undo
1341 1395
 	 */
1342 1396
 	function deleteDeniedNickName($nick_name)
1343 1397
 	{
1344
-		if(!$nick_name) unset($nick_name);
1398
+		if(!$nick_name) {
1399
+			unset($nick_name);
1400
+		}
1345 1401
 
1346 1402
 		$args = new stdClass;
1347 1403
 		$args->nick_name = $nick_name;
@@ -1380,16 +1436,22 @@  discard block
 block discarded – undo
1380 1436
 		// Get a list of all join forms
1381 1437
 		$join_form_list = $oMemberModel->getJoinFormList();
1382 1438
 		$join_form_srl_list = array_keys($join_form_list);
1383
-		if(count($join_form_srl_list)<2) return new BaseObject();
1439
+		if(count($join_form_srl_list)<2) {
1440
+			return new BaseObject();
1441
+		}
1384 1442
 
1385 1443
 		$prev_member_join_form = NULL;
1386 1444
 		foreach($join_form_list as $key => $val)
1387 1445
 		{
1388
-			if($val->member_join_form_srl == $member_join_form_srl) break;
1446
+			if($val->member_join_form_srl == $member_join_form_srl) {
1447
+				break;
1448
+			}
1389 1449
 			$prev_member_join_form = $val;
1390 1450
 		}
1391 1451
 		// Return if no previous join form exists
1392
-		if(!$prev_member_join_form) return new BaseObject();
1452
+		if(!$prev_member_join_form) {
1453
+			return new BaseObject();
1454
+		}
1393 1455
 		// Information of the join form
1394 1456
 		$cur_args = new stdClass;
1395 1457
 		$cur_args->member_join_form_srl = $member_join_form_srl;
@@ -1400,10 +1462,14 @@  discard block
 block discarded – undo
1400 1462
 		$prev_args->list_order = $list_order;
1401 1463
 		// Execute Query
1402 1464
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1403
-		if(!$output->toBool()) return $output;
1465
+		if(!$output->toBool()) {
1466
+			return $output;
1467
+		}
1404 1468
 
1405 1469
 		executeQuery('member.updateMemberJoinFormListorder', $prev_args);
1406
-		if(!$output->toBool()) return $output;
1470
+		if(!$output->toBool()) {
1471
+			return $output;
1472
+		}
1407 1473
 
1408 1474
 		return new BaseObject();
1409 1475
 	}
@@ -1427,16 +1493,22 @@  discard block
 block discarded – undo
1427 1493
 		// Get information of all join forms
1428 1494
 		$join_form_list = $oMemberModel->getJoinFormList();
1429 1495
 		$join_form_srl_list = array_keys($join_form_list);
1430
-		if(count($join_form_srl_list)<2) return new BaseObject();
1496
+		if(count($join_form_srl_list)<2) {
1497
+			return new BaseObject();
1498
+		}
1431 1499
 
1432 1500
 		for($i=0;$i<count($join_form_srl_list);$i++)
1433 1501
 		{
1434
-			if($join_form_srl_list[$i]==$member_join_form_srl) break;
1502
+			if($join_form_srl_list[$i]==$member_join_form_srl) {
1503
+				break;
1504
+			}
1435 1505
 		}
1436 1506
 
1437 1507
 		$next_member_join_form_srl = $join_form_srl_list[$i+1];
1438 1508
 		// Return if no previous join form exists
1439
-		if(!$next_member_join_form_srl) return new BaseObject();
1509
+		if(!$next_member_join_form_srl) {
1510
+			return new BaseObject();
1511
+		}
1440 1512
 		$next_member_join_form = $join_form_list[$next_member_join_form_srl];
1441 1513
 		// Information of the join form
1442 1514
 		$cur_args = new stdClass;
@@ -1448,10 +1520,14 @@  discard block
 block discarded – undo
1448 1520
 		$next_args->list_order = $list_order;
1449 1521
 		// Execute Query
1450 1522
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1451
-		if(!$output->toBool()) return $output;
1523
+		if(!$output->toBool()) {
1524
+			return $output;
1525
+		}
1452 1526
 
1453 1527
 		$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
1454
-		if(!$output->toBool()) return $output;
1528
+		if(!$output->toBool()) {
1529
+			return $output;
1530
+		}
1455 1531
 
1456 1532
 		return new BaseObject();
1457 1533
 	}
Please login to merge, or discard this patch.
modules/member/member.controller.php 4 patches
Doc Comments   +20 added lines, -9 removed lines patch added patch discarded remove patch
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 	/**
727 727
 	 * Add a profile image
728 728
 	 *
729
-	 * @return void|BaseObject (void : success, BaseObject : fail)
729
+	 * @return ModuleObject|null (void : success, BaseObject : fail)
730 730
 	 */
731 731
 	function procMemberInsertProfileImage()
732 732
 	{
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 	/**
806 806
 	 * Add an image name
807 807
 	 *
808
-	 * @return void|BaseObject (void : success, BaseObject : fail)
808
+	 * @return ModuleObject|null (void : success, BaseObject : fail)
809 809
 	 */
810 810
 	function procMemberInsertImageName()
811 811
 	{
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 	/**
891 891
 	 * Delete Image name
892 892
 	 *
893
-	 * @return void
893
+	 * @return BaseObject
894 894
 	 */
895 895
 	function procMemberDeleteImageName($_memberSrl = 0)
896 896
 	{
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 	/**
915 915
 	 * Add an image to mark
916 916
 	 *
917
-	 * @return void|BaseObject (void : success, BaseObject : fail)
917
+	 * @return ModuleObject|null (void : success, BaseObject : fail)
918 918
 	 */
919 919
 	function procMemberInsertImageMark()
920 920
 	{
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
 	 * Execute finding ID/Passoword
1182 1182
 	 * When clicking the link in the verification email, a method is called to change the old password and to authenticate it
1183 1183
 	 *
1184
-	 * @return void|BaseObject (void : success, BaseObject : fail)
1184
+	 * @return ModuleObject|null (void : success, BaseObject : fail)
1185 1185
 	 */
1186 1186
 	function procMemberAuthAccount()
1187 1187
 	{
@@ -1412,6 +1412,9 @@  discard block
 block discarded – undo
1412 1412
 		$this->setRedirectUrl($returnUrl);
1413 1413
 	}
1414 1414
 
1415
+	/**
1416
+	 * @param stdClass $auth_args
1417
+	 */
1415 1418
 	function _sendAuthMail($auth_args, $member_info)
1416 1419
 	{
1417 1420
 		$oMemberModel = getModel('member');
@@ -1544,7 +1547,7 @@  discard block
 block discarded – undo
1544 1547
 	 * @param int $member_srl
1545 1548
 	 * @param string $signature
1546 1549
 	 *
1547
-	 * @return void
1550
+	 * @return boolean|null
1548 1551
 	 */
1549 1552
 	function putSignature($member_srl, $signature)
1550 1553
 	{
@@ -1946,6 +1949,8 @@  discard block
 block discarded – undo
1946 1949
 	/**
1947 1950
 	 * Logged method for providing a personalized menu
1948 1951
 	 * Login information is used in the output widget, or personalized page
1952
+	 * @param string $act
1953
+	 * @param string $str
1949 1954
 	 */
1950 1955
 	function addMemberMenu($act, $str)
1951 1956
 	{
@@ -1976,6 +1981,7 @@  discard block
 block discarded – undo
1976 1981
 
1977 1982
 	/**
1978 1983
 	 * Add users to the member table
1984
+	 * @param stdClass $args
1979 1985
 	 */
1980 1986
 	function insertMember(&$args, $password_is_hashed = false)
1981 1987
 	{
@@ -2176,6 +2182,7 @@  discard block
 block discarded – undo
2176 2182
 	 * Modify member information
2177 2183
 	 *
2178 2184
 	 * @param bool $is_admin , modified 2013-11-22
2185
+	 * @param stdClass $args
2179 2186
 	 */
2180 2187
 	function updateMember($args, $is_admin = FALSE)
2181 2188
 	{
@@ -2380,6 +2387,7 @@  discard block
 block discarded – undo
2380 2387
 
2381 2388
 	/**
2382 2389
 	 * Modify member password
2390
+	 * @param stdClass $args
2383 2391
 	 */
2384 2392
 	function updateMemberPassword($args)
2385 2393
 	{
@@ -2414,6 +2422,9 @@  discard block
 block discarded – undo
2414 2422
 		return $output;
2415 2423
 	}
2416 2424
 
2425
+	/**
2426
+	 * @param string $answer
2427
+	 */
2417 2428
 	function updateFindAccountAnswer($member_srl, $answer)
2418 2429
 	{
2419 2430
 		$oPassword =  new Password();
@@ -2673,7 +2684,7 @@  discard block
 block discarded – undo
2673 2684
 	 *
2674 2685
 	 * @param array &$menu_list
2675 2686
 	 *
2676
-	 * @return object
2687
+	 * @return BaseObject
2677 2688
 	**/
2678 2689
 	function triggerGetDocumentMenu(&$menu_list)
2679 2690
 	{
@@ -2703,7 +2714,7 @@  discard block
 block discarded – undo
2703 2714
 	 *
2704 2715
 	 * @param array &$menu_list
2705 2716
 	 *
2706
-	 * @return object
2717
+	 * @return BaseObject
2707 2718
 	**/
2708 2719
 	function triggerGetCommentMenu(&$menu_list)
2709 2720
 	{
@@ -2731,7 +2742,7 @@  discard block
 block discarded – undo
2731 2742
 	/**
2732 2743
 	 * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
2733 2744
 	 *
2734
-	 * @return object
2745
+	 * @return BaseObject
2735 2746
 	**/
2736 2747
 	function procMemberSpammerManage()
2737 2748
 	{
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2674,7 +2674,7 @@  discard block
 block discarded – undo
2674 2674
 	 * @param array &$menu_list
2675 2675
 	 *
2676 2676
 	 * @return object
2677
-	**/
2677
+	 **/
2678 2678
 	function triggerGetDocumentMenu(&$menu_list)
2679 2679
 	{
2680 2680
 		if(!Context::get('is_logged')) return new BaseObject();
@@ -2704,7 +2704,7 @@  discard block
 block discarded – undo
2704 2704
 	 * @param array &$menu_list
2705 2705
 	 *
2706 2706
 	 * @return object
2707
-	**/
2707
+	 **/
2708 2708
 	function triggerGetCommentMenu(&$menu_list)
2709 2709
 	{
2710 2710
 		if(!Context::get('is_logged')) return new BaseObject();
@@ -2732,7 +2732,7 @@  discard block
 block discarded – undo
2732 2732
 	 * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
2733 2733
 	 *
2734 2734
 	 * @return object
2735
-	**/
2735
+	 **/
2736 2736
 	function procMemberSpammerManage()
2737 2737
 	{
2738 2738
 		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
@@ -2798,7 +2798,7 @@  discard block
 block discarded – undo
2798 2798
 	 * @param int $member_srl
2799 2799
 	 *
2800 2800
 	 * @return object
2801
-	**/
2801
+	 **/
2802 2802
 	private function _spammerMember($member_srl) {
2803 2803
 		$logged_info = Context::get('logged_info');
2804 2804
 		$spam_description = trim( Context::get('spam_description') );
@@ -2839,7 +2839,7 @@  discard block
 block discarded – undo
2839 2839
 	 * @param bool $isMoveToTrash
2840 2840
 	 *
2841 2841
 	 * @return object
2842
-	**/
2842
+	 **/
2843 2843
 	private function _spammerDocuments($member_srl, $isMoveToTrash) {
2844 2844
 		$oDocumentController = getController('document');
2845 2845
 		$oDocumentModel = getModel('document');
Please login to merge, or discard this patch.
Spacing   +458 added lines, -458 removed lines patch added patch discarded remove patch
@@ -34,25 +34,25 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	function procMemberLogin($user_id = null, $password = null, $keep_signed = null)
36 36
 	{
37
-		if(!$user_id && !$password && Context::getRequestMethod() == 'GET')
37
+		if (!$user_id && !$password && Context::getRequestMethod() == 'GET')
38 38
 		{
39 39
 			$this->setRedirectUrl(getNotEncodedUrl(''));
40 40
 			return new BaseObject(-1, 'null_user_id');
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if (!$user_id) $user_id = Context::get('user_id');
45 45
 		$user_id = trim($user_id);
46 46
 
47
-		if(!$password) $password = Context::get('password');
47
+		if (!$password) $password = Context::get('password');
48 48
 		$password = trim($password);
49 49
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
50
+		if (!$keep_signed) $keep_signed = Context::get('keep_signed');
51 51
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new BaseObject(-1,'null_user_id');
53
-		if(!$password) return new BaseObject(-1,'null_password');
52
+		if (!$user_id) return new BaseObject(-1, 'null_user_id');
53
+		if (!$password) return new BaseObject(-1, 'null_password');
54 54
 
55
-		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
55
+		$output = $this->doLogin($user_id, $password, $keep_signed == 'Y' ?true:false);
56 56
 		if (!$output->toBool()) return $output;
57 57
 
58 58
 		$oModuleModel = getModel('module');
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 		$limit_date = $config->change_password_date;
63 63
 
64 64
 		// Check if change_password_date is set
65
-		if($limit_date > 0)
65
+		if ($limit_date > 0)
66 66
 		{
67 67
 			$oMemberModel = getModel('member');
68
-			if($this->memberInfo->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day')))
68
+			if ($this->memberInfo->change_password_date < date('YmdHis', strtotime('-'.$limit_date.' day')))
69 69
 			{
70 70
 				$msg = sprintf(Context::getLang('msg_change_password_date'), $limit_date);
71
-				return $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword'), new BaseObject(-1, $msg));
71
+				return $this->setRedirectUrl(getNotEncodedUrl('', 'vid', Context::get('vid'), 'mid', Context::get('mid'), 'act', 'dispMemberModifyPassword'), new BaseObject(-1, $msg));
72 72
 			}
73 73
 		}
74 74
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$args->member_srl = $this->memberInfo->member_srl;
78 78
 		executeQuery('member.deleteAuthMail', $args);
79 79
 
80
-		if(!$config->after_login_url)
80
+		if (!$config->after_login_url)
81 81
 		{
82 82
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83 83
 		}
@@ -98,18 +98,18 @@  discard block
 block discarded – undo
98 98
 		// Call a trigger before log-out (before)
99 99
 		$logged_info = Context::get('logged_info');
100 100
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
101
+		if (!$trigger_output->toBool()) return $trigger_output;
102 102
 		// Destroy session information
103 103
 		$this->destroySessionInfo();
104 104
 		// Call a trigger after log-out (after)
105 105
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
106
+		if (!$trigger_output->toBool()) return $trigger_output;
107 107
 
108 108
 		$output = new BaseObject();
109 109
 
110 110
 		$oModuleModel = getModel('module');
111 111
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
112
+		if ($config->after_logout_url)
113 113
 			$output->redirect_url = $config->after_logout_url;
114 114
 
115 115
 		$this->_clearMemberCache($logged_info->member_srl);
@@ -127,18 +127,18 @@  discard block
 block discarded – undo
127 127
 		$oModuleModel = &getModel('module');
128 128
 
129 129
 		// Check login information
130
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
130
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
131 131
 		$logged_info = Context::get('logged_info');
132 132
 
133
-		$document_srl = (int)Context::get('document_srl');
134
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
135
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
133
+		$document_srl = (int) Context::get('document_srl');
134
+		if (!$document_srl) $document_srl = (int) Context::get('target_srl');
135
+		if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request');
136 136
 
137 137
 		// Get document
138 138
 		$oDocumentModel = getModel('document');
139 139
 		$oDocument = $oDocumentModel->getDocument($document_srl);
140 140
 
141
-		if($oDocument->isSecret() && !$oDocument->isGranted())
141
+		if ($oDocument->isSecret() && !$oDocument->isGranted())
142 142
 		{
143 143
 			return new BaseObject(-1, 'msg_is_secret');
144 144
 		}
@@ -147,19 +147,19 @@  discard block
 block discarded – undo
147 147
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl'));
148 148
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
149 149
 
150
-		if(!$grant->access)
150
+		if (!$grant->access)
151 151
 		{
152 152
 			return new BaseObject(-1, 'msg_not_permitted');
153 153
 		}
154 154
 
155 155
 		// 게시판 모듈에서 글 목록 보기 권한이 없으면 스크랩 제한
156
-		if($module_info->module === 'board' && isset($grant->list) && !$grant->list)
156
+		if ($module_info->module === 'board' && isset($grant->list) && !$grant->list)
157 157
 		{
158 158
 			return new BaseObject(-1, 'msg_not_permitted');
159 159
 		}
160 160
 
161 161
 		// 게시판 모듈에서 상담 기능 사용 시 권한이 없는 게시물(타인의 게시물) 스크랩 제한
162
-		if($module_info->module === 'board' &&
162
+		if ($module_info->module === 'board' &&
163 163
 			$module_info->consultation === 'Y' &&
164 164
 			isset($grant->consultation_read) &&
165 165
 			!$grant->consultation_read && !$oDocument->isGranted()
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
 
181 181
 		// Check if already scrapped
182 182
 		$output = executeQuery('member.getScrapDocument', $args);
183
-		if($output->data->count) return new BaseObject(-1, 'msg_alreay_scrapped');
183
+		if ($output->data->count) return new BaseObject(-1, 'msg_alreay_scrapped');
184 184
 
185 185
 		// Insert
186 186
 		$output = executeQuery('member.addScrapDocument', $args);
187
-		if(!$output->toBool()) return $output;
187
+		if (!$output->toBool()) return $output;
188 188
 
189 189
 		$this->setError(-1);
190 190
 		$this->setMessage('success_registed');
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 	function procMemberDeleteScrap()
199 199
 	{
200 200
 		// Check login information
201
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
201
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
202 202
 		$logged_info = Context::get('logged_info');
203 203
 
204
-		$document_srl = (int)Context::get('document_srl');
205
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
204
+		$document_srl = (int) Context::get('document_srl');
205
+		if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request');
206 206
 		// Variables
207 207
 		$args = new stdClass;
208 208
 		$args->member_srl = $logged_info->member_srl;
@@ -228,23 +228,23 @@  discard block
 block discarded – undo
228 228
 	function procMemberDeleteSavedDocument()
229 229
 	{
230 230
 		// Check login information
231
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
231
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
232 232
 		$logged_info = Context::get('logged_info');
233 233
 
234
-		$document_srl = (int)Context::get('document_srl');
235
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
234
+		$document_srl = (int) Context::get('document_srl');
235
+		if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request');
236 236
 
237 237
 		$oDocumentModel = getModel('document');
238 238
 		$oDocument = $oDocumentModel->getDocument($document_srl);
239 239
 		if ($oDocument->get('member_srl') != $logged_info->member_srl)
240 240
 		{
241
-			return new BaseObject(-1,'msg_invalid_request');
241
+			return new BaseObject(-1, 'msg_invalid_request');
242 242
 		}
243 243
 
244 244
 		$configStatusList = $oDocumentModel->getStatusList();
245 245
 		if ($oDocument->get('status') != $configStatusList['temp'])
246 246
 		{
247
-			return new BaseObject(-1,'msg_invalid_request');
247
+			return new BaseObject(-1, 'msg_invalid_request');
248 248
 		}
249 249
 
250 250
 		$oDocumentController = getController('document');
@@ -260,37 +260,37 @@  discard block
 block discarded – undo
260 260
 	{
261 261
 		$name = Context::get('name');
262 262
 		$value = Context::get('value');
263
-		if(!$value) return;
263
+		if (!$value) return;
264 264
 
265 265
 		$oMemberModel = getModel('member');
266 266
 		// Check if logged-in
267 267
 		$logged_info = Context::get('logged_info');
268 268
 
269 269
 
270
-		switch($name)
270
+		switch ($name)
271 271
 		{
272 272
 			case 'user_id' :
273 273
 				// Check denied ID
274
-				if($oMemberModel->isDeniedID($value)) return new BaseObject(0,'denied_user_id');
274
+				if ($oMemberModel->isDeniedID($value)) return new BaseObject(0, 'denied_user_id');
275 275
 				// Check if duplicated
276 276
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
277
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_user_id');
277
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_user_id');
278 278
 				break;
279 279
 			case 'nick_name' :
280 280
 				// Check denied ID
281
-				if($oMemberModel->isDeniedNickName($value))
281
+				if ($oMemberModel->isDeniedNickName($value))
282 282
 				{
283
-					return new BaseObject(0,'denied_nick_name');
283
+					return new BaseObject(0, 'denied_nick_name');
284 284
 				}
285 285
 				// Check if duplicated
286 286
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
287
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_nick_name');
287
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_nick_name');
288 288
 
289 289
 				break;
290 290
 			case 'email_address' :
291 291
 				// Check if duplicated
292 292
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
293
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_email_address');
293
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_email_address');
294 294
 				break;
295 295
 		}
296 296
 	}
@@ -302,25 +302,25 @@  discard block
 block discarded – undo
302 302
 	 */
303 303
 	function procMemberInsert()
304 304
 	{
305
-		if (Context::getRequestMethod () == "GET") return new BaseObject(-1, "msg_invalid_request");
306
-		$oMemberModel = &getModel ('member');
305
+		if (Context::getRequestMethod() == "GET") return new BaseObject(-1, "msg_invalid_request");
306
+		$oMemberModel = &getModel('member');
307 307
 		$config = $oMemberModel->getMemberConfig();
308 308
 
309 309
 		// call a trigger (before)
310
-		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
311
-		if(!$trigger_output->toBool ()) return $trigger_output;
310
+		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config);
311
+		if (!$trigger_output->toBool()) return $trigger_output;
312 312
 		// Check if an administrator allows a membership
313
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
313
+		if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
314 314
 		// Check if the user accept the license terms (only if terms exist)
315
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
315
+		if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement');
316 316
 
317 317
 		// Extract the necessary information in advance
318 318
 		$getVars = array();
319
-		if($config->signupForm)
319
+		if ($config->signupForm)
320 320
 		{
321
-			foreach($config->signupForm as $formInfo)
321
+			foreach ($config->signupForm as $formInfo)
322 322
 			{
323
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
323
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
324 324
 				{
325 325
 					$getVars[] = $formInfo->name;
326 326
 				}
@@ -328,22 +328,22 @@  discard block
 block discarded – undo
328 328
 		}
329 329
 
330 330
 		$args = new stdClass;
331
-		foreach($getVars as $val)
331
+		foreach ($getVars as $val)
332 332
 		{
333 333
 			$args->{$val} = Context::get($val);
334
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
334
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
335 335
 		}
336 336
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
337
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
337
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
338 338
 
339 339
 		$args->find_account_answer = Context::get('find_account_answer');
340 340
 		$args->allow_mailing = Context::get('allow_mailing');
341 341
 		$args->allow_message = Context::get('allow_message');
342 342
 
343
-		if($args->password1) $args->password = $args->password1;
343
+		if ($args->password1) $args->password = $args->password1;
344 344
 
345 345
 		// check password strength
346
-		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
346
+		if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
347 347
 		{
348 348
 			$message = Context::getLang('about_password_strength');
349 349
 			return new BaseObject(-1, $message[$config->password_strength]);
@@ -369,58 +369,58 @@  discard block
 block discarded – undo
369 369
 		unset($all_args->secret_text);
370 370
 
371 371
 		// Set the user state as "denied" when using mail authentication
372
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
372
+		if ($config->enable_confirm == 'Y') $args->denied = 'Y';
373 373
 		// Add extra vars after excluding necessary information from all the requested arguments
374 374
 		$extra_vars = delObjectVars($all_args, $args);
375 375
 		$args->extra_vars = serialize($extra_vars);
376 376
 
377 377
 		// remove whitespace
378 378
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
379
-		foreach($checkInfos as $val)
379
+		foreach ($checkInfos as $val)
380 380
 		{
381
-			if(isset($args->{$val}))
381
+			if (isset($args->{$val}))
382 382
 			{
383 383
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
384 384
 			}
385 385
 		}
386 386
 		$output = $this->insertMember($args);
387
-		if(!$output->toBool()) return $output;
387
+		if (!$output->toBool()) return $output;
388 388
 
389 389
 		// insert ProfileImage, ImageName, ImageMark
390 390
 		$profile_image = $_FILES['profile_image'];
391
-		if(is_uploaded_file($profile_image['tmp_name']))
391
+		if (is_uploaded_file($profile_image['tmp_name']))
392 392
 		{
393 393
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
394 394
 		}
395 395
 
396 396
 		$image_mark = $_FILES['image_mark'];
397
-		if(is_uploaded_file($image_mark['tmp_name']))
397
+		if (is_uploaded_file($image_mark['tmp_name']))
398 398
 		{
399 399
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
400 400
 		}
401 401
 
402 402
 		$image_name = $_FILES['image_name'];
403
-		if(is_uploaded_file($image_name['tmp_name']))
403
+		if (is_uploaded_file($image_name['tmp_name']))
404 404
 		{
405 405
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
406 406
 		}
407 407
 
408 408
 		// If a virtual site, join the site
409 409
 		$site_module_info = Context::get('site_module_info');
410
-		if($site_module_info->site_srl > 0)
410
+		if ($site_module_info->site_srl > 0)
411 411
 		{
412 412
 			$columnList = array('site_srl', 'group_srl');
413 413
 			$default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
414
-			if($default_group->group_srl)
414
+			if ($default_group->group_srl)
415 415
 			{
416 416
 				$this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl);
417 417
 			}
418 418
 
419 419
 		}
420 420
 		// Log-in
421
-		if($config->enable_confirm != 'Y')
421
+		if ($config->enable_confirm != 'Y')
422 422
 		{
423
-			if($config->identifier == 'email_address')
423
+			if ($config->identifier == 'email_address')
424 424
 			{
425 425
 				$output = $this->doLogin($args->email_address);
426 426
 			}
@@ -428,8 +428,8 @@  discard block
 block discarded – undo
428 428
 			{
429 429
 				$output = $this->doLogin($args->user_id);
430 430
 			}
431
-			if(!$output->toBool()) {
432
-				if($output->error == -9)
431
+			if (!$output->toBool()) {
432
+				if ($output->error == -9)
433 433
 					$output->error = -11;
434 434
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
435 435
 			}
@@ -437,8 +437,8 @@  discard block
 block discarded – undo
437 437
 
438 438
 		// Results
439 439
 		$this->add('member_srl', $args->member_srl);
440
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
441
-		if($config->enable_confirm == 'Y')
440
+		if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
441
+		if ($config->enable_confirm == 'Y')
442 442
 		{
443 443
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
444 444
 			$this->setMessage($msg);
@@ -447,19 +447,19 @@  discard block
 block discarded – undo
447 447
 		else $this->setMessage('success_registed');
448 448
 		// Call a trigger (after)
449 449
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
450
-		if(!$trigger_output->toBool()) return $trigger_output;
450
+		if (!$trigger_output->toBool()) return $trigger_output;
451 451
 
452
-		if($config->redirect_url)
452
+		if ($config->redirect_url)
453 453
 		{
454 454
 			$returnUrl = $config->redirect_url;
455 455
 		}
456 456
 		else
457 457
 		{
458
-			if(Context::get('success_return_url'))
458
+			if (Context::get('success_return_url'))
459 459
 			{
460 460
 				$returnUrl = Context::get('success_return_url');
461 461
 			}
462
-			else if($_COOKIE['XE_REDIRECT_URL'])
462
+			else if ($_COOKIE['XE_REDIRECT_URL'])
463 463
 			{
464 464
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
465 465
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -473,26 +473,26 @@  discard block
 block discarded – undo
473 473
 
474 474
 	function procMemberModifyInfoBefore()
475 475
 	{
476
-		if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
476
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
477 477
 		{
478 478
 			return $this->stop('msg_invalid_request');
479 479
 		}
480 480
 
481
-		if(!Context::get('is_logged'))
481
+		if (!Context::get('is_logged'))
482 482
 		{
483 483
 			return $this->stop('msg_not_logged');
484 484
 		}
485 485
 
486 486
 		$password = Context::get('password');
487 487
 
488
-		if(!$password)
488
+		if (!$password)
489 489
 		{
490 490
 			return $this->stop('msg_invalid_request');
491 491
 		}
492 492
 
493 493
 		$oMemberModel = getModel('member');
494 494
 
495
-		if(!$this->memberInfo->password)
495
+		if (!$this->memberInfo->password)
496 496
 		{
497 497
 			// Get information of logged-in user
498 498
 			$logged_info = Context::get('logged_info');
@@ -503,14 +503,14 @@  discard block
 block discarded – undo
503 503
 			$this->memberInfo->password = $memberInfo->password;
504 504
 		}
505 505
 		// Verify the current password
506
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
506
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
507 507
 		{
508 508
 			return new BaseObject(-1, 'invalid_password');
509 509
 		}
510 510
 
511 511
 		$_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD';
512 512
 
513
-		if(Context::get('success_return_url'))
513
+		if (Context::get('success_return_url'))
514 514
 		{
515 515
 			$redirectUrl = Context::get('success_return_url');
516 516
 		}
@@ -528,12 +528,12 @@  discard block
 block discarded – undo
528 528
 	 */
529 529
 	function procMemberModifyInfo()
530 530
 	{
531
-		if(!Context::get('is_logged'))
531
+		if (!Context::get('is_logged'))
532 532
 		{
533 533
 			return $this->stop('msg_not_logged');
534 534
 		}
535 535
 
536
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
536
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
537 537
 		{
538 538
 			return $this->stop('msg_invalid_request');
539 539
 		}
@@ -541,13 +541,13 @@  discard block
 block discarded – undo
541 541
 
542 542
 		// Extract the necessary information in advance
543 543
 		$oMemberModel = getModel('member');
544
-		$config = $oMemberModel->getMemberConfig ();
545
-		$getVars = array('find_account_answer','allow_mailing','allow_message');
546
-		if($config->signupForm)
544
+		$config = $oMemberModel->getMemberConfig();
545
+		$getVars = array('find_account_answer', 'allow_mailing', 'allow_message');
546
+		if ($config->signupForm)
547 547
 		{
548
-			foreach($config->signupForm as $formInfo)
548
+			foreach ($config->signupForm as $formInfo)
549 549
 			{
550
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
550
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
551 551
 				{
552 552
 					$getVars[] = $formInfo->name;
553 553
 				}
@@ -555,11 +555,11 @@  discard block
 block discarded – undo
555 555
 		}
556 556
 
557 557
 		$args = new stdClass;
558
-		foreach($getVars as $val)
558
+		foreach ($getVars as $val)
559 559
 		{
560 560
 			$args->{$val} = Context::get($val);
561
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
562
-			if($val == 'find_account_answer' && !Context::get($val)) {
561
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
562
+			if ($val == 'find_account_answer' && !Context::get($val)) {
563 563
 				unset($args->{$val});
564 564
 			}
565 565
 		}
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 		$logged_info = Context::get('logged_info');
569 569
 		$args->member_srl = $logged_info->member_srl;
570 570
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
571
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
571
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
572 572
 
573 573
 		// Remove some unnecessary variables from all the vars
574 574
 		$all_args = Context::getRequestVars();
@@ -593,9 +593,9 @@  discard block
 block discarded – undo
593 593
 
594 594
 		// remove whitespace
595 595
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
596
-		foreach($checkInfos as $val)
596
+		foreach ($checkInfos as $val)
597 597
 		{
598
-			if(isset($args->{$val}))
598
+			if (isset($args->{$val}))
599 599
 			{
600 600
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
601 601
 			}
@@ -603,22 +603,22 @@  discard block
 block discarded – undo
603 603
 
604 604
 		// Execute insert or update depending on the value of member_srl
605 605
 		$output = $this->updateMember($args);
606
-		if(!$output->toBool()) return $output;
606
+		if (!$output->toBool()) return $output;
607 607
 
608 608
 		$profile_image = $_FILES['profile_image'];
609
-		if(is_uploaded_file($profile_image['tmp_name']))
609
+		if (is_uploaded_file($profile_image['tmp_name']))
610 610
 		{
611 611
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
612 612
 		}
613 613
 
614 614
 		$image_mark = $_FILES['image_mark'];
615
-		if(is_uploaded_file($image_mark['tmp_name']))
615
+		if (is_uploaded_file($image_mark['tmp_name']))
616 616
 		{
617 617
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
618 618
 		}
619 619
 
620 620
 		$image_name = $_FILES['image_name'];
621
-		if(is_uploaded_file($image_name['tmp_name']))
621
+		if (is_uploaded_file($image_name['tmp_name']))
622 622
 		{
623 623
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
624 624
 		}
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 
634 634
 		// Call a trigger after successfully log-in (after)
635 635
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
636
-		if(!$trigger_output->toBool()) return $trigger_output;
636
+		if (!$trigger_output->toBool()) return $trigger_output;
637 637
 
638 638
 		$this->setSessionInfo();
639 639
 		// Return result
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
 	 */
655 655
 	function procMemberModifyPassword()
656 656
 	{
657
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
657
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
658 658
 		// Extract the necessary information in advance
659 659
 		$current_password = trim(Context::get('current_password'));
660 660
 		$password = trim(Context::get('password1'));
@@ -668,17 +668,17 @@  discard block
 block discarded – undo
668 668
 
669 669
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
670 670
 		// Verify the cuttent password
671
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new BaseObject(-1, 'invalid_password');
671
+		if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new BaseObject(-1, 'invalid_password');
672 672
 
673 673
 		// Check if a new password is as same as the previous password
674
-		if($current_password == $password) return new BaseObject(-1, 'invalid_new_password');
674
+		if ($current_password == $password) return new BaseObject(-1, 'invalid_new_password');
675 675
 
676 676
 		// Execute insert or update depending on the value of member_srl
677 677
 		$args = new stdClass;
678 678
 		$args->member_srl = $member_srl;
679 679
 		$args->password = $password;
680 680
 		$output = $this->updateMemberPassword($args);
681
-		if(!$output->toBool()) return $output;
681
+		if (!$output->toBool()) return $output;
682 682
 
683 683
 		$this->add('member_srl', $args->member_srl);
684 684
 		$this->setMessage('success_updated');
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 	 */
695 695
 	function procMemberLeave()
696 696
 	{
697
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
697
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
698 698
 		// Extract the necessary information in advance
699 699
 		$password = trim(Context::get('password'));
700 700
 		// Get information of logged-in user
@@ -703,17 +703,17 @@  discard block
 block discarded – undo
703 703
 		// Create a member model object
704 704
 		$oMemberModel = getModel('member');
705 705
 		// Get information of member_srl
706
-		if(!$this->memberInfo->password)
706
+		if (!$this->memberInfo->password)
707 707
 		{
708 708
 			$columnList = array('member_srl', 'password');
709 709
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
710 710
 			$this->memberInfo->password = $memberInfo->password;
711 711
 		}
712 712
 		// Verify the cuttent password
713
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new BaseObject(-1, 'invalid_password');
713
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new BaseObject(-1, 'invalid_password');
714 714
 
715 715
 		$output = $this->deleteMember($member_srl);
716
-		if(!$output->toBool()) return $output;
716
+		if (!$output->toBool()) return $output;
717 717
 		// Destroy all session information
718 718
 		$this->destroySessionInfo();
719 719
 		// Return success message
@@ -732,17 +732,17 @@  discard block
 block discarded – undo
732 732
 	{
733 733
 		// Check if the file is successfully uploaded
734 734
 		$file = $_FILES['profile_image'];
735
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
735
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
736 736
 		// Ignore if member_srl is invalid or doesn't exist.
737 737
 		$member_srl = Context::get('member_srl');
738
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
738
+		if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
739 739
 
740 740
 		$logged_info = Context::get('logged_info');
741
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
741
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
742 742
 		// Return if member module is set not to use an image name or the user is not an administrator ;
743 743
 		$oModuleModel = getModel('module');
744 744
 		$config = $oModuleModel->getModuleConfig('member');
745
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
745
+		if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
746 746
 
747 747
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
748 748
 		// Page refresh
@@ -764,25 +764,25 @@  discard block
 block discarded – undo
764 764
 	{
765 765
 
766 766
 		// Check uploaded file
767
-		if(!checkUploadedFile($target_file)) return;
767
+		if (!checkUploadedFile($target_file)) return;
768 768
 
769 769
 		$oMemberModel = getModel('member');
770 770
 		$config = $oMemberModel->getMemberConfig();
771 771
 
772 772
 		// Get an image size
773 773
 		$max_width = $config->profile_image_max_width;
774
-		if(!$max_width) $max_width = "90";
774
+		if (!$max_width) $max_width = "90";
775 775
 		$max_height = $config->profile_image_max_height;
776
-		if(!$max_height) $max_height = "90";
776
+		if (!$max_height) $max_height = "90";
777 777
 		// Get a target path to save
778 778
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
779 779
 		FileHandler::makeDir($target_path);
780 780
 
781 781
 		// Get file information
782 782
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
783
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
784
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
785
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
783
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
784
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
785
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
786 786
 		else
787 787
 		{
788 788
 			return;
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 
793 793
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
794 794
 		// Convert if the image size is larger than a given size or if the format is not a gif
795
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
795
+		if (($width > $max_width || $height > $max_height) && $type != 1)
796 796
 		{
797 797
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
798 798
 		}
@@ -811,17 +811,17 @@  discard block
 block discarded – undo
811 811
 	{
812 812
 		// Check if the file is successfully uploaded
813 813
 		$file = $_FILES['image_name'];
814
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
814
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
815 815
 		// Ignore if member_srl is invalid or doesn't exist.
816 816
 		$member_srl = Context::get('member_srl');
817
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
817
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
818 818
 
819 819
 		$logged_info = Context::get('logged_info');
820
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
820
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
821 821
 		// Return if member module is set not to use an image name or the user is not an administrator ;
822 822
 		$oModuleModel = getModel('module');
823 823
 		$config = $oModuleModel->getModuleConfig('member');
824
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
824
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
825 825
 
826 826
 		$this->insertImageName($member_srl, $file['tmp_name']);
827 827
 		// Page refresh
@@ -842,15 +842,15 @@  discard block
 block discarded – undo
842 842
 	function insertImageName($member_srl, $target_file)
843 843
 	{
844 844
 		// Check uploaded file
845
-		if(!checkUploadedFile($target_file)) return;
845
+		if (!checkUploadedFile($target_file)) return;
846 846
 
847 847
 		$oModuleModel = getModel('module');
848 848
 		$config = $oModuleModel->getModuleConfig('member');
849 849
 		// Get an image size
850 850
 		$max_width = $config->image_name_max_width;
851
-		if(!$max_width) $max_width = "90";
851
+		if (!$max_width) $max_width = "90";
852 852
 		$max_height = $config->image_name_max_height;
853
-		if(!$max_height) $max_height = "20";
853
+		if (!$max_height) $max_height = "20";
854 854
 		// Get a target path to save
855 855
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
856 856
 		FileHandler::makeDir($target_path);
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 		// Get file information
860 860
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
861 861
 		// Convert if the image size is larger than a given size or if the format is not a gif
862
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
862
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
863 863
 		else @copy($target_file, $target_filename);
864 864
 	}
865 865
 
@@ -871,20 +871,20 @@  discard block
 block discarded – undo
871 871
 	function procMemberDeleteProfileImage($_memberSrl = 0)
872 872
 	{
873 873
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
874
-		if(!$member_srl)
874
+		if (!$member_srl)
875 875
 		{
876
-			return new BaseObject(0,'success');
876
+			return new BaseObject(0, 'success');
877 877
 		}
878 878
 
879 879
 		$logged_info = Context::get('logged_info');
880 880
 
881
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
881
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
882 882
 		{
883 883
 			$oMemberModel = getModel('member');
884 884
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
885 885
 			FileHandler::removeFile($profile_image->file);
886 886
 		}
887
-		return new BaseObject(0,'success');
887
+		return new BaseObject(0, 'success');
888 888
 	}
889 889
 
890 890
 	/**
@@ -895,20 +895,20 @@  discard block
 block discarded – undo
895 895
 	function procMemberDeleteImageName($_memberSrl = 0)
896 896
 	{
897 897
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
898
-		if(!$member_srl)
898
+		if (!$member_srl)
899 899
 		{
900
-			return new BaseObject(0,'success');
900
+			return new BaseObject(0, 'success');
901 901
 		}
902 902
 
903 903
 		$logged_info = Context::get('logged_info');
904 904
 
905
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
905
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
906 906
 		{
907 907
 			$oMemberModel = getModel('member');
908 908
 			$image_name = $oMemberModel->getImageName($member_srl);
909 909
 			FileHandler::removeFile($image_name->file);
910 910
 		}
911
-		return new BaseObject(0,'success');
911
+		return new BaseObject(0, 'success');
912 912
 	}
913 913
 
914 914
 	/**
@@ -920,17 +920,17 @@  discard block
 block discarded – undo
920 920
 	{
921 921
 		// Check if the file is successfully uploaded
922 922
 		$file = $_FILES['image_mark'];
923
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
923
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
924 924
 		// Ignore if member_srl is invalid or doesn't exist.
925 925
 		$member_srl = Context::get('member_srl');
926
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
926
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
927 927
 
928 928
 		$logged_info = Context::get('logged_info');
929
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
929
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
930 930
 		// Membership in the images mark the module using the ban was set by an administrator or return;
931 931
 		$oModuleModel = getModel('module');
932 932
 		$config = $oModuleModel->getModuleConfig('member');
933
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
933
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
934 934
 
935 935
 		$this->insertImageMark($member_srl, $file['tmp_name']);
936 936
 		// Page refresh
@@ -951,15 +951,15 @@  discard block
 block discarded – undo
951 951
 	function insertImageMark($member_srl, $target_file)
952 952
 	{
953 953
 		// Check uploaded file
954
-		if(!checkUploadedFile($target_file)) return;
954
+		if (!checkUploadedFile($target_file)) return;
955 955
 
956 956
 		$oModuleModel = getModel('module');
957 957
 		$config = $oModuleModel->getModuleConfig('member');
958 958
 		// Get an image size
959 959
 		$max_width = $config->image_mark_max_width;
960
-		if(!$max_width) $max_width = "20";
960
+		if (!$max_width) $max_width = "20";
961 961
 		$max_height = $config->image_mark_max_height;
962
-		if(!$max_height) $max_height = "20";
962
+		if (!$max_height) $max_height = "20";
963 963
 
964 964
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
965 965
 		FileHandler::makeDir($target_path);
@@ -968,7 +968,7 @@  discard block
 block discarded – undo
968 968
 		// Get file information
969 969
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
970 970
 
971
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
971
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
972 972
 		else @copy($target_file, $target_filename);
973 973
 	}
974 974
 
@@ -980,20 +980,20 @@  discard block
 block discarded – undo
980 980
 	function procMemberDeleteImageMark($_memberSrl = 0)
981 981
 	{
982 982
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
983
-		if(!$member_srl)
983
+		if (!$member_srl)
984 984
 		{
985
-			return new BaseObject(0,'success');
985
+			return new BaseObject(0, 'success');
986 986
 		}
987 987
 
988 988
 		$logged_info = Context::get('logged_info');
989 989
 
990
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
990
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
991 991
 		{
992 992
 			$oMemberModel = getModel('member');
993 993
 			$image_mark = $oMemberModel->getImageMark($member_srl);
994 994
 			FileHandler::removeFile($image_mark->file);
995 995
 		}
996
-		return new BaseObject(0,'success');
996
+		return new BaseObject(0, 'success');
997 997
 	}
998 998
 
999 999
 	/**
@@ -1004,26 +1004,26 @@  discard block
 block discarded – undo
1004 1004
 	function procMemberFindAccount()
1005 1005
 	{
1006 1006
 		$email_address = Context::get('email_address');
1007
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1007
+		if (!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1008 1008
 
1009 1009
 		$oMemberModel = getModel('member');
1010 1010
 		$oModuleModel = getModel('module');
1011 1011
 
1012 1012
 		// Check if a member having the same email address exists
1013 1013
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1014
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1014
+		if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1015 1015
 
1016 1016
 		// Get information of the member
1017 1017
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
1018 1018
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1019 1019
 
1020 1020
 		// Check if possible to find member's ID and password
1021
-		if($member_info->denied == 'Y')
1021
+		if ($member_info->denied == 'Y')
1022 1022
 		{
1023 1023
 			$chk_args = new stdClass;
1024 1024
 			$chk_args->member_srl = $member_info->member_srl;
1025 1025
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1026
-			if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1026
+			if ($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1027 1027
 		}
1028 1028
 
1029 1029
 		// Insert data into the authentication DB
@@ -1036,19 +1036,19 @@  discard block
 block discarded – undo
1036 1036
 		$args->is_register = 'N';
1037 1037
 
1038 1038
 		$output = executeQuery('member.insertAuthMail', $args);
1039
-		if(!$output->toBool()) return $output;
1039
+		if (!$output->toBool()) return $output;
1040 1040
 		// Get content of the email to send a member
1041 1041
 		Context::set('auth_args', $args);
1042 1042
 
1043 1043
 		$member_config = $oModuleModel->getModuleConfig('member');
1044 1044
 		$memberInfo = array();
1045 1045
 		global $lang;
1046
-		if(is_array($member_config->signupForm))
1046
+		if (is_array($member_config->signupForm))
1047 1047
 		{
1048
-			$exceptForm=array('password', 'find_account_question');
1049
-			foreach($member_config->signupForm as $form)
1048
+			$exceptForm = array('password', 'find_account_question');
1049
+			foreach ($member_config->signupForm as $form)
1050 1050
 			{
1051
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1051
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1052 1052
 				{
1053 1053
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1054 1054
 				}
@@ -1063,15 +1063,15 @@  discard block
 block discarded – undo
1063 1063
 		}
1064 1064
 		Context::set('memberInfo', $memberInfo);
1065 1065
 
1066
-		if(!$member_config->skin) $member_config->skin = "default";
1067
-		if(!$member_config->colorset) $member_config->colorset = "white";
1066
+		if (!$member_config->skin) $member_config->skin = "default";
1067
+		if (!$member_config->colorset) $member_config->colorset = "white";
1068 1068
 
1069 1069
 		Context::set('member_config', $member_config);
1070 1070
 
1071 1071
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1072
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1072
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1073 1073
 
1074
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1074
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1075 1075
 		Context::set('find_url', $find_url);
1076 1076
 
1077 1077
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1081,19 +1081,19 @@  discard block
 block discarded – undo
1081 1081
 		$member_config = $oModuleModel->getModuleConfig('member');
1082 1082
 		// Send a mail
1083 1083
 		$oMail = new Mail();
1084
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1084
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1085 1085
 		$oMail->setContent($content);
1086
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1087
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1086
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1087
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1088 1088
 		$oMail->send();
1089 1089
 		// Return message
1090 1090
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1091
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1091
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1092 1092
 		{
1093 1093
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1094 1094
 			$this->setRedirectUrl($returnUrl);
1095 1095
 		}
1096
-		return new BaseObject(0,$msg);
1096
+		return new BaseObject(0, $msg);
1097 1097
 	}
1098 1098
 
1099 1099
 	/**
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
 	function procMemberFindAccountByQuestion()
1105 1105
 	{
1106 1106
 		$oMemberModel = getModel('member');
1107
-		$oPassword =  new Password();
1107
+		$oPassword = new Password();
1108 1108
 		$config = $oMemberModel->getMemberConfig();
1109 1109
 
1110 1110
 		$email_address = Context::get('email_address');
@@ -1112,49 +1112,49 @@  discard block
 block discarded – undo
1112 1112
 		$find_account_question = trim(Context::get('find_account_question'));
1113 1113
 		$find_account_answer = trim(Context::get('find_account_answer'));
1114 1114
 
1115
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1115
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1116 1116
 
1117 1117
 		$oModuleModel = getModel('module');
1118 1118
 		// Check if a member having the same email address exists
1119 1119
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1120
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1120
+		if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1121 1121
 
1122 1122
 		// Get information of the member
1123 1123
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1124 1124
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1125 1125
 
1126 1126
 		// Display a message if no answer is entered
1127
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1127
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1128 1128
 
1129 1129
 		// 답변 확인
1130 1130
 		$hashed = $oPassword->checkAlgorithm($member_info->find_account_answer);
1131 1131
 		$authed = true;
1132 1132
 		$member_info->find_account_question = trim($member_info->find_account_question);
1133
-		if($member_info->find_account_question != $find_account_question)
1133
+		if ($member_info->find_account_question != $find_account_question)
1134 1134
 		{
1135 1135
 			$authed = false;
1136 1136
 		}
1137
-		else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1137
+		else if ($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1138 1138
 		{
1139 1139
 			$authed = false;
1140 1140
 		}
1141
-		else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1141
+		else if (!$hashed && $find_account_answer != $member_info->find_account_answer)
1142 1142
 		{
1143 1143
 			$authed = false;
1144 1144
 		}
1145 1145
 
1146
-		if(!$authed)
1146
+		if (!$authed)
1147 1147
 		{
1148 1148
 			return new BaseObject(-1, 'msg_answer_not_matches');
1149 1149
 		}
1150 1150
 
1151 1151
 		// answer가 동일하고 hash 되지 않았으면 hash 값으로 저장
1152
-		if($authed && !$hashed)
1152
+		if ($authed && !$hashed)
1153 1153
 		{
1154 1154
 			$this->updateFindAccountAnswer($member_srl, $find_account_answer);
1155 1155
 		}
1156 1156
 
1157
-		if($config->identifier == 'email_address')
1157
+		if ($config->identifier == 'email_address')
1158 1158
 		{
1159 1159
 			$user_id = $email_address;
1160 1160
 		}
@@ -1167,11 +1167,11 @@  discard block
 block discarded – undo
1167 1167
 		$args->password = $temp_password;
1168 1168
 		$args->change_password_date = '1';
1169 1169
 		$output = $this->updateMemberPassword($args);
1170
-		if(!$output->toBool()) return $output;
1170
+		if (!$output->toBool()) return $output;
1171 1171
 
1172
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1172
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1173 1173
 
1174
-		$this->add('user_id',$user_id);
1174
+		$this->add('user_id', $user_id);
1175 1175
 
1176 1176
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1177 1177
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
 		$member_srl = Context::get('member_srl');
1192 1192
 		$auth_key = Context::get('auth_key');
1193 1193
 
1194
-		if(!$member_srl || !$auth_key)
1194
+		if (!$member_srl || !$auth_key)
1195 1195
 		{
1196 1196
 			return $this->stop('msg_invalid_request');
1197 1197
 		}
@@ -1202,9 +1202,9 @@  discard block
 block discarded – undo
1202 1202
 		$args->auth_key = $auth_key;
1203 1203
 		$output = executeQuery('member.getAuthMail', $args);
1204 1204
 
1205
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1205
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1206 1206
 		{
1207
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1207
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1208 1208
 			{
1209 1209
 				executeQuery('member.deleteAuthMail', $args);
1210 1210
 			}
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
 			return $this->stop('msg_invalid_auth_key');
1213 1213
 		}
1214 1214
 
1215
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1215
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1216 1216
 		{
1217 1217
 			executeQuery('member.deleteAuthMail', $args);
1218 1218
 			return $this->stop('msg_invalid_auth_key');
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
 		$args->password = $output->data->new_password;
1222 1222
 
1223 1223
 		// If credentials are correct, change the password to a new one
1224
-		if($output->data->is_register == 'Y')
1224
+		if ($output->data->is_register == 'Y')
1225 1225
 		{
1226 1226
 			$args->denied = 'N';
1227 1227
 		}
@@ -1234,13 +1234,13 @@  discard block
 block discarded – undo
1234 1234
 		$is_register = $output->data->is_register;
1235 1235
 
1236 1236
 		$output = executeQuery('member.updateMemberPassword', $args);
1237
-		if(!$output->toBool())
1237
+		if (!$output->toBool())
1238 1238
 		{
1239 1239
 			return $this->stop($output->getMessage());
1240 1240
 		}
1241 1241
 
1242 1242
 		// Remove all values having the member_srl from authentication table
1243
-		executeQuery('member.deleteAuthMail',$args);
1243
+		executeQuery('member.deleteAuthMail', $args);
1244 1244
 
1245 1245
 		$this->_clearMemberCache($args->member_srl);
1246 1246
 
@@ -1259,33 +1259,33 @@  discard block
 block discarded – undo
1259 1259
 	{
1260 1260
 		// Get an email_address
1261 1261
 		$email_address = Context::get('email_address');
1262
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1262
+		if (!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1263 1263
 		// Log test by using email_address
1264 1264
 		$oMemberModel = getModel('member');
1265 1265
 
1266 1266
 		$args = new stdClass;
1267 1267
 		$args->email_address = $email_address;
1268 1268
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1269
-		if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1269
+		if (!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1270 1270
 
1271 1271
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1272 1272
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1273 1273
 
1274 1274
 		$oModuleModel = getModel('module');
1275 1275
 		$member_config = $oModuleModel->getModuleConfig('member');
1276
-		if(!$member_config->skin) $member_config->skin = "default";
1277
-		if(!$member_config->colorset) $member_config->colorset = "white";
1276
+		if (!$member_config->skin) $member_config->skin = "default";
1277
+		if (!$member_config->colorset) $member_config->colorset = "white";
1278 1278
 
1279 1279
 		// Check if a authentication mail has been sent previously
1280 1280
 		$chk_args = new stdClass;
1281 1281
 		$chk_args->member_srl = $member_info->member_srl;
1282 1282
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1283
-		if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1283
+		if ($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1284 1284
 
1285 1285
 		$auth_args = new stdClass;
1286 1286
 		$auth_args->member_srl = $member_info->member_srl;
1287 1287
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1288
-		if(!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1288
+		if (!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1289 1289
 		$auth_info = $output->data[0];
1290 1290
 
1291 1291
 		// Update the regdate of authmail entry
@@ -1296,12 +1296,12 @@  discard block
 block discarded – undo
1296 1296
 
1297 1297
 		$memberInfo = array();
1298 1298
 		global $lang;
1299
-		if(is_array($member_config->signupForm))
1299
+		if (is_array($member_config->signupForm))
1300 1300
 		{
1301
-			$exceptForm=array('password', 'find_account_question');
1302
-			foreach($member_config->signupForm as $form)
1301
+			$exceptForm = array('password', 'find_account_question');
1302
+			foreach ($member_config->signupForm as $form)
1303 1303
 			{
1304
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1304
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1305 1305
 				{
1306 1306
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1307 1307
 				}
@@ -1320,19 +1320,19 @@  discard block
 block discarded – undo
1320 1320
 		Context::set('member_config', $member_config);
1321 1321
 
1322 1322
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1323
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1323
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1324 1324
 
1325
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1325
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1326 1326
 		Context::set('auth_url', $auth_url);
1327 1327
 
1328 1328
 		$oTemplate = &TemplateHandler::getInstance();
1329 1329
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1330 1330
 		// Send a mail
1331 1331
 		$oMail = new Mail();
1332
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1332
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1333 1333
 		$oMail->setContent($content);
1334
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1335
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1334
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1335
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1336 1336
 		$oMail->send();
1337 1337
 
1338 1338
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1347,23 +1347,23 @@  discard block
 block discarded – undo
1347 1347
 		$memberInfo = $_SESSION['auth_member_info'];
1348 1348
 		unset($_SESSION['auth_member_info']);
1349 1349
 
1350
-		if(!$memberInfo)
1350
+		if (!$memberInfo)
1351 1351
 		{
1352 1352
 			return $this->stop('msg_invalid_request');
1353 1353
 		}
1354 1354
 
1355 1355
 		$newEmail = Context::get('email_address');
1356 1356
 
1357
-		if(!$newEmail)
1357
+		if (!$newEmail)
1358 1358
 		{
1359 1359
 			return $this->stop('msg_invalid_request');
1360 1360
 		}
1361 1361
 
1362 1362
 		$oMemberModel = getModel('member');
1363 1363
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1364
-		if($member_srl)
1364
+		if ($member_srl)
1365 1365
 		{
1366
-			return new BaseObject(-1,'msg_exists_email_address');
1366
+			return new BaseObject(-1, 'msg_exists_email_address');
1367 1367
 		}
1368 1368
 
1369 1369
 		// remove all key by member_srl
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
 		$args->member_srl = $memberInfo->member_srl;
1372 1372
 		$output = executeQuery('member.deleteAuthMail', $args);
1373 1373
 
1374
-		if(!$output->toBool())
1374
+		if (!$output->toBool())
1375 1375
 		{
1376 1376
 			return $output;
1377 1377
 		}
@@ -1381,7 +1381,7 @@  discard block
 block discarded – undo
1381 1381
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1382 1382
 
1383 1383
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1384
-		if(!$output->toBool())
1384
+		if (!$output->toBool())
1385 1385
 		{
1386 1386
 			return $this->stop($output->getMessage());
1387 1387
 		}
@@ -1398,7 +1398,7 @@  discard block
 block discarded – undo
1398 1398
 		$auth_args->is_register = 'Y';
1399 1399
 
1400 1400
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1401
-		if(!$output->toBool()) return $output;
1401
+		if (!$output->toBool()) return $output;
1402 1402
 
1403 1403
 		$memberInfo->email_address = $newEmail;
1404 1404
 
@@ -1422,12 +1422,12 @@  discard block
 block discarded – undo
1422 1422
 		$memberInfo = array();
1423 1423
 
1424 1424
 		global $lang;
1425
-		if(is_array($member_config->signupForm))
1425
+		if (is_array($member_config->signupForm))
1426 1426
 		{
1427
-			$exceptForm=array('password', 'find_account_question');
1428
-			foreach($member_config->signupForm as $form)
1427
+			$exceptForm = array('password', 'find_account_question');
1428
+			foreach ($member_config->signupForm as $form)
1429 1429
 			{
1430
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1430
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1431 1431
 				{
1432 1432
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1433 1433
 				}
@@ -1442,25 +1442,25 @@  discard block
 block discarded – undo
1442 1442
 		}
1443 1443
 		Context::set('memberInfo', $memberInfo);
1444 1444
 
1445
-		if(!$member_config->skin) $member_config->skin = "default";
1446
-		if(!$member_config->colorset) $member_config->colorset = "white";
1445
+		if (!$member_config->skin) $member_config->skin = "default";
1446
+		if (!$member_config->colorset) $member_config->colorset = "white";
1447 1447
 
1448 1448
 		Context::set('member_config', $member_config);
1449 1449
 
1450 1450
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1451
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1451
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1452 1452
 
1453
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1453
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1454 1454
 		Context::set('auth_url', $auth_url);
1455 1455
 
1456 1456
 		$oTemplate = &TemplateHandler::getInstance();
1457 1457
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1458 1458
 		// Send a mail
1459 1459
 		$oMail = new Mail();
1460
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1460
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1461 1461
 		$oMail->setContent($content);
1462
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1463
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1462
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1463
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1464 1464
 		$oMail->send();
1465 1465
 	}
1466 1466
 
@@ -1473,7 +1473,7 @@  discard block
 block discarded – undo
1473 1473
 	{
1474 1474
 		$site_module_info = Context::get('site_module_info');
1475 1475
 		$logged_info = Context::get('logged_info');
1476
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1476
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request');
1477 1477
 
1478 1478
 		$oMemberModel = getModel('member');
1479 1479
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1492,13 +1492,13 @@  discard block
 block discarded – undo
1492 1492
 	{
1493 1493
 		$site_module_info = Context::get('site_module_info');
1494 1494
 		$logged_info = Context::get('logged_info');
1495
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1495
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request');
1496 1496
 
1497 1497
 		$args = new stdClass;
1498
-		$args->site_srl= $site_module_info->site_srl;
1498
+		$args->site_srl = $site_module_info->site_srl;
1499 1499
 		$args->member_srl = $logged_info->member_srl;
1500 1500
 		$output = executeQuery('member.deleteMembersGroup', $args);
1501
-		if(!$output->toBool()) return $output;
1501
+		if (!$output->toBool()) return $output;
1502 1502
 		$this->setMessage('success_deleted');
1503 1503
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1504 1504
 	}
@@ -1512,25 +1512,25 @@  discard block
 block discarded – undo
1512 1512
 	 */
1513 1513
 	function setMemberConfig($args)
1514 1514
 	{
1515
-		if(!$args->skin) $args->skin = "default";
1516
-		if(!$args->colorset) $args->colorset = "white";
1517
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1518
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1519
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1520
-		$args->enable_openid= 'N';
1521
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1522
-		if($args->image_name!='Y') $args->image_name = 'N';
1523
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1524
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1525
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1526
-		$args->limit_day = (int)$args->limit_day;
1515
+		if (!$args->skin) $args->skin = "default";
1516
+		if (!$args->colorset) $args->colorset = "white";
1517
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1518
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1519
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1520
+		$args->enable_openid = 'N';
1521
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1522
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1523
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1524
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1525
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1526
+		$args->limit_day = (int) $args->limit_day;
1527 1527
 
1528 1528
 		$agreement = trim($args->agreement);
1529 1529
 		unset($args->agreement);
1530 1530
 
1531 1531
 		$oModuleController = getController('module');
1532
-		$output = $oModuleController->insertModuleConfig('member',$args);
1533
-		if(!$output->toBool()) return $output;
1532
+		$output = $oModuleController->insertModuleConfig('member', $args);
1533
+		if (!$output->toBool()) return $output;
1534 1534
 
1535 1535
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1536 1536
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1551,11 +1551,11 @@  discard block
 block discarded – undo
1551 1551
 		$signature = trim(removeHackTag($signature));
1552 1552
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1553 1553
 
1554
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"), '', strip_tags($signature, '<img><object>')));
1554
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1555 1555
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1556 1556
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1557 1557
 
1558
-		if(!$check_signature) return FileHandler::removeFile($filename);
1558
+		if (!$check_signature) return FileHandler::removeFile($filename);
1559 1559
 
1560 1560
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1561 1561
 		FileHandler::makeDir($path);
@@ -1584,15 +1584,15 @@  discard block
 block discarded – undo
1584 1584
 	 *
1585 1585
 	 * @return BaseObject
1586 1586
 	 */
1587
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1587
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1588 1588
 	{
1589 1589
 		$args = new stdClass();
1590 1590
 		$args->member_srl = $member_srl;
1591 1591
 		$args->group_srl = $group_srl;
1592
-		if($site_srl) $args->site_srl = $site_srl;
1592
+		if ($site_srl) $args->site_srl = $site_srl;
1593 1593
 
1594 1594
 		// Add
1595
-		$output = executeQuery('member.addMemberToGroup',$args);
1595
+		$output = executeQuery('member.addMemberToGroup', $args);
1596 1596
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1597 1597
 
1598 1598
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1612,18 +1612,18 @@  discard block
 block discarded – undo
1612 1612
 	{
1613 1613
 		$obj = new stdClass;
1614 1614
 		$obj->site_srl = $args->site_srl;
1615
-		$obj->member_srl = implode(',',$args->member_srl);
1615
+		$obj->member_srl = implode(',', $args->member_srl);
1616 1616
 
1617 1617
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1618
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1618
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1619 1619
 
1620 1620
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1621
-		if(!$output->toBool()) return $output;
1621
+		if (!$output->toBool()) return $output;
1622 1622
 
1623 1623
 		$inserted_members = array();
1624
-		foreach($args->member_srl as $key => $val)
1624
+		foreach ($args->member_srl as $key => $val)
1625 1625
 		{
1626
-			if($inserted_members[$val]) continue;
1626
+			if ($inserted_members[$val]) continue;
1627 1627
 			$inserted_members[$val] = true;
1628 1628
 
1629 1629
 			unset($obj);
@@ -1633,7 +1633,7 @@  discard block
 block discarded – undo
1633 1633
 			$obj->site_srl = $args->site_srl;
1634 1634
 			$obj->regdate = $date[$obj->member_srl];
1635 1635
 			$output = executeQuery('member.addMemberToGroup', $obj);
1636
-			if(!$output->toBool()) return $output;
1636
+			if (!$output->toBool()) return $output;
1637 1637
 
1638 1638
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1639 1639
 		}
@@ -1655,9 +1655,9 @@  discard block
 block discarded – undo
1655 1655
 		// Get information of the key
1656 1656
 		$output = executeQuery('member.getAutologin', $args);
1657 1657
 		// If no information exists, delete a cookie
1658
-		if(!$output->toBool() || !$output->data)
1658
+		if (!$output->toBool() || !$output->data)
1659 1659
 		{
1660
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1660
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1661 1661
 			return;
1662 1662
 		}
1663 1663
 
@@ -1667,9 +1667,9 @@  discard block
 block discarded – undo
1667 1667
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1668 1668
 		$password = $output->data->password;
1669 1669
 
1670
-		if(!$user_id || !$password)
1670
+		if (!$user_id || !$password)
1671 1671
 		{
1672
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1672
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1673 1673
 			return;
1674 1674
 		}
1675 1675
 
@@ -1679,7 +1679,7 @@  discard block
 block discarded – undo
1679 1679
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1680 1680
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1681 1681
 
1682
-		if($check_key === substr($args->autologin_key, 32))
1682
+		if ($check_key === substr($args->autologin_key, 32))
1683 1683
 		{
1684 1684
 			// Check change_password_date
1685 1685
 			$oModuleModel = getModel('module');
@@ -1687,12 +1687,12 @@  discard block
 block discarded – undo
1687 1687
 			$limit_date = $member_config->change_password_date;
1688 1688
 
1689 1689
 			// Check if change_password_date is set
1690
-			if($limit_date > 0)
1690
+			if ($limit_date > 0)
1691 1691
 			{
1692 1692
 				$oMemberModel = getModel('member');
1693 1693
 				$columnList = array('member_srl', 'change_password_date');
1694 1694
 
1695
-				if($config->identifier == 'user_id')
1695
+				if ($config->identifier == 'user_id')
1696 1696
 				{
1697 1697
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1698 1698
 				}
@@ -1701,7 +1701,7 @@  discard block
 block discarded – undo
1701 1701
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1702 1702
 				}
1703 1703
 
1704
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1704
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1705 1705
 					$do_auto_login = true;
1706 1706
 				}
1707 1707
 
@@ -1712,14 +1712,14 @@  discard block
 block discarded – undo
1712 1712
 			}
1713 1713
 		}
1714 1714
 
1715
-		if($do_auto_login)
1715
+		if ($do_auto_login)
1716 1716
 		{
1717 1717
 			$output = $this->doLogin($user_id);
1718 1718
 		}
1719 1719
 		else
1720 1720
 		{
1721 1721
 			executeQuery('member.deleteAutologin', $args);
1722
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1722
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1723 1723
 		}
1724 1724
 	}
1725 1725
 
@@ -1735,13 +1735,13 @@  discard block
 block discarded – undo
1735 1735
 	function doLogin($user_id, $password = '', $keep_signed = false)
1736 1736
 	{
1737 1737
 		$user_id = strtolower($user_id);
1738
-		if(!$user_id) return new BaseObject(-1, 'null_user_id');
1738
+		if (!$user_id) return new BaseObject(-1, 'null_user_id');
1739 1739
 		// Call a trigger before log-in (before)
1740 1740
 		$trigger_obj = new stdClass();
1741 1741
 		$trigger_obj->user_id = $user_id;
1742 1742
 		$trigger_obj->password = $password;
1743 1743
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1744
-		if(!$trigger_output->toBool()) return $trigger_output;
1744
+		if (!$trigger_output->toBool()) return $trigger_output;
1745 1745
 		// Create a member model object
1746 1746
 		$oMemberModel = getModel('member');
1747 1747
 
@@ -1751,12 +1751,12 @@  discard block
 block discarded – undo
1751 1751
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1752 1752
 
1753 1753
 		// check identifier
1754
-		if($config->identifier == 'email_address')
1754
+		if ($config->identifier == 'email_address')
1755 1755
 		{
1756 1756
 			// Get user_id information
1757 1757
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1758 1758
 			// Set an invalid user if no value returned
1759
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1759
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1760 1760
 
1761 1761
 		}
1762 1762
 		else
@@ -1764,24 +1764,24 @@  discard block
 block discarded – undo
1764 1764
 			// Get user_id information
1765 1765
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1766 1766
 			// Set an invalid user if no value returned
1767
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1767
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1768 1768
 		}
1769 1769
 
1770 1770
 		$output = executeQuery('member.getLoginCountByIp', $args);
1771 1771
 		$errorCount = $output->data->count;
1772
-		if($errorCount >= $config->max_error_count)
1772
+		if ($errorCount >= $config->max_error_count)
1773 1773
 		{
1774 1774
 			$last_update = strtotime($output->data->last_update);
1775
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1776
-			if($term < $config->max_error_count_time)
1775
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1776
+			if ($term < $config->max_error_count_time)
1777 1777
 			{
1778 1778
 				$term = $config->max_error_count_time - $term;
1779
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1780
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1781
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1782
-				else $term = intval($term/86400).Context::getLang('unit_day');
1779
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1780
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1781
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1782
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1783 1783
 
1784
-				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1784
+				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1785 1785
 			}
1786 1786
 			else
1787 1787
 			{
@@ -1791,13 +1791,13 @@  discard block
 block discarded – undo
1791 1791
 		}
1792 1792
 
1793 1793
 		// Password Check
1794
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1794
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1795 1795
 		{
1796
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1796
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1797 1797
 		}
1798 1798
 
1799 1799
 		// If denied == 'Y', notify
1800
-		if($this->memberInfo->denied == 'Y')
1800
+		if ($this->memberInfo->denied == 'Y')
1801 1801
 		{
1802 1802
 			$args->member_srl = $this->memberInfo->member_srl;
1803 1803
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1805,12 +1805,12 @@  discard block
 block discarded – undo
1805 1805
 			{
1806 1806
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1807 1807
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1808
-				return $this->setRedirectUrl($redirectUrl, new BaseObject(-1,'msg_user_not_confirmed'));
1808
+				return $this->setRedirectUrl($redirectUrl, new BaseObject(-1, 'msg_user_not_confirmed'));
1809 1809
 			}
1810
-			return new BaseObject(-1,'msg_user_denied');
1810
+			return new BaseObject(-1, 'msg_user_denied');
1811 1811
 		}
1812 1812
 		// Notify if denied_date is less than the current time
1813
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1813
+		if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) return new BaseObject(-9, sprintf(Context::getLang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d")));
1814 1814
 		// Update the latest login time
1815 1815
 		$args->member_srl = $this->memberInfo->member_srl;
1816 1816
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1820,36 +1820,36 @@  discard block
 block discarded – undo
1820 1820
 
1821 1821
 		// Check if there is recoding table.
1822 1822
 		$oDB = &DB::getInstance();
1823
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1823
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1824 1824
 		{
1825 1825
 			// check if there is login fail records.
1826 1826
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1827
-			if($output->data && $output->data->content)
1827
+			if ($output->data && $output->data->content)
1828 1828
 			{
1829 1829
 				$title = Context::getLang('login_fail_report');
1830 1830
 				$message = '<ul>';
1831 1831
 				$content = unserialize($output->data->content);
1832
-				if(count($content) > $config->max_error_count)
1832
+				if (count($content) > $config->max_error_count)
1833 1833
 				{
1834
-					foreach($content as $val)
1834
+					foreach ($content as $val)
1835 1835
 					{
1836
-						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa',$val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1836
+						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa', $val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1837 1837
 					}
1838 1838
 					$message .= '</ul>';
1839
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1839
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1840 1840
 
1841 1841
 					//send message
1842 1842
 					$oCommunicationController = getController('communication');
1843 1843
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1844 1844
 
1845
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1845
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1846 1846
 					{
1847 1847
 						$view_url = Context::getRequestUri();
1848
-						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>",$content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1848
+						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>", $content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1849 1849
 						$oMail = new Mail();
1850 1850
 						$oMail->setTitle($title);
1851 1851
 						$oMail->setContent($content);
1852
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1852
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1853 1853
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1854 1854
 						$oMail->send();
1855 1855
 					}
@@ -1859,9 +1859,9 @@  discard block
 block discarded – undo
1859 1859
 		}
1860 1860
 		// Call a trigger after successfully log-in (after)
1861 1861
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1862
-		if(!$trigger_output->toBool()) return $trigger_output;
1862
+		if (!$trigger_output->toBool()) return $trigger_output;
1863 1863
 		// When user checked to use auto-login
1864
-		if($keep_signed)
1864
+		if ($keep_signed)
1865 1865
 		{
1866 1866
 			// Key generate for auto login
1867 1867
 			$oPassword = new Password();
@@ -1873,12 +1873,12 @@  discard block
 block discarded – undo
1873 1873
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1874 1874
 			executeQuery('member.deleteAutologin', $autologin_args);
1875 1875
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1876
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
1876
+			if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000);
1877 1877
 		}
1878
-		if($this->memberInfo->is_admin == 'Y')
1878
+		if ($this->memberInfo->is_admin == 'Y')
1879 1879
 		{
1880 1880
 			$oMemberAdminModel = getAdminModel('member');
1881
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1881
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1882 1882
 			{
1883 1883
 				$_SESSION['denied_admin'] = 'Y';
1884 1884
 			}
@@ -1896,18 +1896,18 @@  discard block
 block discarded – undo
1896 1896
 	{
1897 1897
 		$oMemberModel = getModel('member');
1898 1898
 		// If your information came through the current session information to extract information from the users
1899
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1899
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
1900 1900
 		{
1901 1901
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
1902 1902
 			// If you do not destroy the session Profile
1903
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
1903
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
1904 1904
 			{
1905 1905
 				$this->destroySessionInfo();
1906 1906
 				return;
1907 1907
 			}
1908 1908
 		}
1909 1909
 		// Stop using the session id is destroyed
1910
-		if($this->memberInfo->denied=='Y')
1910
+		if ($this->memberInfo->denied == 'Y')
1911 1911
 		{
1912 1912
 			$this->destroySessionInfo();
1913 1913
 			return;
@@ -1937,10 +1937,10 @@  discard block
 block discarded – undo
1937 1937
 		Context::set('logged_info', $this->memberInfo);
1938 1938
 
1939 1939
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
1940
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
1941
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1942
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
1943
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
1940
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
1941
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1942
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
1943
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
1944 1944
 	}
1945 1945
 
1946 1946
 	/**
@@ -1962,7 +1962,7 @@  discard block
 block discarded – undo
1962 1962
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1963 1963
 	{
1964 1964
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1965
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1965
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1966 1966
 
1967 1967
 		$obj = new stdClass;
1968 1968
 		$obj->url = $url;
@@ -1981,33 +1981,33 @@  discard block
 block discarded – undo
1981 1981
 	{
1982 1982
 		// Call a trigger (before)
1983 1983
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1984
-		if(!$output->toBool()) return $output;
1984
+		if (!$output->toBool()) return $output;
1985 1985
 		// Terms and Conditions portion of the information set up by members reaffirmed
1986 1986
 		$oModuleModel = getModel('module');
1987 1987
 		$config = $oModuleModel->getModuleConfig('member');
1988 1988
 
1989 1989
 		$logged_info = Context::get('logged_info');
1990 1990
 		// If the date of the temporary restrictions limit further information on the date of
1991
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
1991
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
1992 1992
 
1993 1993
 		$args->member_srl = getNextSequence();
1994 1994
 		$args->list_order = -1 * $args->member_srl;
1995 1995
 
1996 1996
 		// Execute insert or update depending on the value of member_srl
1997
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
1997
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
1998 1998
 		// Enter the user's identity changed to lowercase
1999 1999
 		else $args->user_id = strtolower($args->user_id);
2000
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2001
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2000
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2001
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
2002 2002
 
2003 2003
 		// Control of essential parameters
2004
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2005
-		if($args->denied!='Y') $args->denied = 'N';
2006
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2004
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2005
+		if ($args->denied != 'Y') $args->denied = 'N';
2006
+		if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y';
2007 2007
 
2008
-		if($logged_info->is_admin == 'Y')
2008
+		if ($logged_info->is_admin == 'Y')
2009 2009
 		{
2010
-			if($args->is_admin!='Y') $args->is_admin = 'N';
2010
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
2011 2011
 		}
2012 2012
 		else
2013 2013
 		{
@@ -2022,97 +2022,97 @@  discard block
 block discarded – undo
2022 2022
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2023 2023
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2024 2024
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2025
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2026
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2025
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2026
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
2027 2027
 
2028 2028
 		// Create a model object
2029 2029
 		$oMemberModel = getModel('member');
2030 2030
 
2031 2031
 		// Check password strength
2032
-		if($args->password && !$password_is_hashed)
2032
+		if ($args->password && !$password_is_hashed)
2033 2033
 		{
2034
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2034
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2035 2035
 			{
2036 2036
 				$message = Context::getLang('about_password_strength');
2037 2037
 				return new BaseObject(-1, $message[$config->password_strength]);
2038 2038
 			}
2039 2039
 			$args->password = $oMemberModel->hashPassword($args->password);
2040 2040
 		}
2041
-		elseif(!$args->password)
2041
+		elseif (!$args->password)
2042 2042
 		{
2043 2043
 			unset($args->password);
2044 2044
 		}
2045 2045
 
2046
-		if($args->find_account_answer && !$password_is_hashed)
2046
+		if ($args->find_account_answer && !$password_is_hashed)
2047 2047
 		{
2048 2048
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2049 2049
 		}
2050
-		elseif(!$args->find_account_answer)
2050
+		elseif (!$args->find_account_answer)
2051 2051
 		{
2052 2052
 			unset($args->find_account_answer);
2053 2053
 		}
2054 2054
 
2055 2055
 		// Check if ID is prohibited
2056
-		if($oMemberModel->isDeniedID($args->user_id))
2056
+		if ($oMemberModel->isDeniedID($args->user_id))
2057 2057
 		{
2058
-			return new BaseObject(-1,'denied_user_id');
2058
+			return new BaseObject(-1, 'denied_user_id');
2059 2059
 		}
2060 2060
 
2061 2061
 		// Check if ID is duplicate
2062 2062
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2063
-		if($member_srl)
2063
+		if ($member_srl)
2064 2064
 		{
2065
-			return new BaseObject(-1,'msg_exists_user_id');
2065
+			return new BaseObject(-1, 'msg_exists_user_id');
2066 2066
 		}
2067 2067
 
2068 2068
 		// Check if nickname is prohibited
2069
-		if($oMemberModel->isDeniedNickName($args->nick_name))
2069
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
2070 2070
 		{
2071
-			return new BaseObject(-1,'denied_nick_name');
2071
+			return new BaseObject(-1, 'denied_nick_name');
2072 2072
 		}
2073 2073
 
2074 2074
 		// Check if nickname is duplicate
2075 2075
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2076
-		if($member_srl)
2076
+		if ($member_srl)
2077 2077
 		{
2078
-			return new BaseObject(-1,'msg_exists_nick_name');
2078
+			return new BaseObject(-1, 'msg_exists_nick_name');
2079 2079
 		}
2080 2080
 
2081 2081
 		// Check if email address is duplicate
2082 2082
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2083
-		if($member_srl)
2083
+		if ($member_srl)
2084 2084
 		{
2085
-			return new BaseObject(-1,'msg_exists_email_address');
2085
+			return new BaseObject(-1, 'msg_exists_email_address');
2086 2086
 		}
2087 2087
 
2088 2088
 		// Insert data into the DB
2089 2089
 		$args->list_order = -1 * $args->member_srl;
2090 2090
 
2091
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2092
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2091
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2092
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2093 2093
 
2094 2094
 		$oDB = &DB::getInstance();
2095 2095
 		$oDB->begin();
2096 2096
 
2097 2097
 		$output = executeQuery('member.insertMember', $args);
2098
-		if(!$output->toBool())
2098
+		if (!$output->toBool())
2099 2099
 		{
2100 2100
 			$oDB->rollback();
2101 2101
 			return $output;
2102 2102
 		}
2103 2103
 
2104
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2104
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2105 2105
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2106 2106
 		// If no value is entered the default group, the value of group registration
2107
-		if(!$args->group_srl_list)
2107
+		if (!$args->group_srl_list)
2108 2108
 		{
2109 2109
 			$columnList = array('site_srl', 'group_srl');
2110 2110
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2111
-			if($default_group)
2111
+			if ($default_group)
2112 2112
 			{
2113 2113
 				// Add to the default group
2114
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2115
-				if(!$output->toBool())
2114
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2115
+				if (!$output->toBool())
2116 2116
 				{
2117 2117
 					$oDB->rollback();
2118 2118
 					return $output;
@@ -2122,11 +2122,11 @@  discard block
 block discarded – undo
2122 2122
 		}
2123 2123
 		else
2124 2124
 		{
2125
-			for($i=0;$i<count($group_srl_list);$i++)
2125
+			for ($i = 0; $i < count($group_srl_list); $i++)
2126 2126
 			{
2127
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2127
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2128 2128
 
2129
-				if(!$output->toBool())
2129
+				if (!$output->toBool())
2130 2130
 				{
2131 2131
 					$oDB->rollback();
2132 2132
 					return $output;
@@ -2136,7 +2136,7 @@  discard block
 block discarded – undo
2136 2136
 
2137 2137
 		$member_config = $oModuleModel->getModuleConfig('member');
2138 2138
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2139
-		if($args->denied == 'Y')
2139
+		if ($args->denied == 'Y')
2140 2140
 		{
2141 2141
 			// Insert data into the authentication DB
2142 2142
 			$oPassword = new Password();
@@ -2148,7 +2148,7 @@  discard block
 block discarded – undo
2148 2148
 			$auth_args->is_register = 'Y';
2149 2149
 
2150 2150
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2151
-			if(!$output->toBool())
2151
+			if (!$output->toBool())
2152 2152
 			{
2153 2153
 				$oDB->rollback();
2154 2154
 				return $output;
@@ -2156,10 +2156,10 @@  discard block
 block discarded – undo
2156 2156
 			$this->_sendAuthMail($auth_args, $args);
2157 2157
 		}
2158 2158
 		// Call a trigger (after)
2159
-		if($output->toBool())
2159
+		if ($output->toBool())
2160 2160
 		{
2161 2161
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2162
-			if(!$trigger_output->toBool())
2162
+			if (!$trigger_output->toBool())
2163 2163
 			{
2164 2164
 				$oDB->rollback();
2165 2165
 				return $trigger_output;
@@ -2181,41 +2181,41 @@  discard block
 block discarded – undo
2181 2181
 	{
2182 2182
 		// Call a trigger (before)
2183 2183
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2184
-		if(!$output->toBool()) return $output;
2184
+		if (!$output->toBool()) return $output;
2185 2185
 		// Create a model object
2186 2186
 		$oMemberModel = getModel('member');
2187 2187
 
2188 2188
 		$logged_info = Context::get('logged_info');
2189 2189
 		// Get what you want to modify the original information
2190
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2190
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2191 2191
 		// Control of essential parameters
2192
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2193
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2192
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2193
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2194 2194
 
2195
-		if($logged_info->is_admin == 'Y')
2195
+		if ($logged_info->is_admin == 'Y')
2196 2196
 		{
2197
-			if($args->denied!='Y') $args->denied = 'N';
2198
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2197
+			if ($args->denied != 'Y') $args->denied = 'N';
2198
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2199 2199
 		}
2200 2200
 		else
2201 2201
 		{
2202 2202
 			unset($args->is_admin);
2203
-			if($is_admin == false)
2203
+			if ($is_admin == false)
2204 2204
 				unset($args->denied);
2205
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2205
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2206 2206
 			{
2207 2207
 				return $this->stop('msg_invalid_request');
2208 2208
 			}
2209 2209
 		}
2210 2210
 
2211 2211
 		// Sanitize user ID, username, nickname, homepage, blog
2212
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2212
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2213 2213
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2214 2214
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2215 2215
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2216 2216
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2217
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2218
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2217
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2218
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2219 2219
 
2220 2220
 		// check member identifier form
2221 2221
 		$config = $oMemberModel->getMemberConfig();
@@ -2224,56 +2224,56 @@  discard block
 block discarded – undo
2224 2224
 		$orgMemberInfo = $output->data;
2225 2225
 
2226 2226
 		// Check if email address or user ID is duplicate
2227
-		if($config->identifier == 'email_address')
2227
+		if ($config->identifier == 'email_address')
2228 2228
 		{
2229 2229
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2230
-			if($member_srl && $args->member_srl != $member_srl)
2230
+			if ($member_srl && $args->member_srl != $member_srl)
2231 2231
 			{
2232
-				return new BaseObject(-1,'msg_exists_email_address');
2232
+				return new BaseObject(-1, 'msg_exists_email_address');
2233 2233
 			}
2234 2234
 			$args->email_address = $orgMemberInfo->email_address;
2235 2235
 		}
2236 2236
 		else
2237 2237
 		{
2238 2238
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2239
-			if($member_srl && $args->member_srl != $member_srl)
2239
+			if ($member_srl && $args->member_srl != $member_srl)
2240 2240
 			{
2241
-				return new BaseObject(-1,'msg_exists_user_id');
2241
+				return new BaseObject(-1, 'msg_exists_user_id');
2242 2242
 			}
2243 2243
 
2244 2244
 			$args->user_id = $orgMemberInfo->user_id;
2245 2245
 		}
2246 2246
 
2247
-		if($logged_info->is_admin !== 'Y')
2247
+		if ($logged_info->is_admin !== 'Y')
2248 2248
 		{
2249 2249
 			// Check if ID is prohibited
2250
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2250
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2251 2251
 			{
2252
-				return new BaseObject(-1,'denied_user_id');
2252
+				return new BaseObject(-1, 'denied_user_id');
2253 2253
 			}
2254 2254
 
2255 2255
 			// Check if nickname is prohibited
2256
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2256
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2257 2257
 			{
2258 2258
 				return new BaseObject(-1, 'denied_nick_name');
2259 2259
 			}
2260 2260
 		}
2261 2261
 
2262 2262
 		// Check if ID is duplicate
2263
-		if($args->user_id)
2263
+		if ($args->user_id)
2264 2264
 		{
2265 2265
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2266
-			if($member_srl && $args->member_srl != $member_srl)
2266
+			if ($member_srl && $args->member_srl != $member_srl)
2267 2267
 			{
2268
-				return new BaseObject(-1,'msg_exists_user_id');
2268
+				return new BaseObject(-1, 'msg_exists_user_id');
2269 2269
 			}
2270 2270
 		}
2271 2271
 
2272 2272
 		// Check if nickname is duplicate
2273 2273
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2274
- 		if($member_srl && $args->member_srl != $member_srl)
2274
+ 		if ($member_srl && $args->member_srl != $member_srl)
2275 2275
  		{
2276
- 			return new BaseObject(-1,'msg_exists_nick_name');
2276
+ 			return new BaseObject(-1, 'msg_exists_nick_name');
2277 2277
  		}
2278 2278
 
2279 2279
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2282,9 +2282,9 @@  discard block
 block discarded – undo
2282 2282
 		$oDB->begin();
2283 2283
 
2284 2284
 		// Check password strength
2285
-		if($args->password)
2285
+		if ($args->password)
2286 2286
 		{
2287
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2287
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2288 2288
 			{
2289 2289
 				$message = Context::getLang('about_password_strength');
2290 2290
 				return new BaseObject(-1, $message[$config->password_strength]);
@@ -2296,55 +2296,55 @@  discard block
 block discarded – undo
2296 2296
 			$args->password = $orgMemberInfo->password;
2297 2297
 		}
2298 2298
 
2299
-		if($args->find_account_answer) {
2299
+		if ($args->find_account_answer) {
2300 2300
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2301 2301
 		}
2302 2302
 		else
2303 2303
 		{
2304
-			$oPassword =  new Password();
2304
+			$oPassword = new Password();
2305 2305
 			$hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer);
2306 2306
 
2307
-			if($hashed) {
2307
+			if ($hashed) {
2308 2308
 				$args->find_account_answer = $orgMemberInfo->find_account_answer;
2309 2309
 			} else {
2310 2310
 				$args->find_account_answer = $oPassword->createHash($orgMemberInfo->find_account_answer);
2311 2311
 			}
2312 2312
 		}
2313 2313
 
2314
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2315
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2316
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2317
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2318
-		if(!$args->birthday) $args->birthday = '';
2314
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2315
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2316
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2317
+		if (!$args->description) $args->description = $orgMemberInfo->description;
2318
+		if (!$args->birthday) $args->birthday = '';
2319 2319
 
2320 2320
 		$output = executeQuery('member.updateMember', $args);
2321 2321
 
2322
-		if(!$output->toBool())
2322
+		if (!$output->toBool())
2323 2323
 		{
2324 2324
 			$oDB->rollback();
2325 2325
 			return $output;
2326 2326
 		}
2327 2327
 
2328
-		if($args->group_srl_list)
2328
+		if ($args->group_srl_list)
2329 2329
 		{
2330
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2330
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2331 2331
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2332 2332
 			// If the group information, group information changes
2333
-			if(count($group_srl_list) > 0)
2333
+			if (count($group_srl_list) > 0)
2334 2334
 			{
2335 2335
 				$args->site_srl = 0;
2336 2336
 				// One of its members to delete all the group
2337 2337
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2338
-				if(!$output->toBool())
2338
+				if (!$output->toBool())
2339 2339
 				{
2340 2340
 					$oDB->rollback();
2341 2341
 					return $output;
2342 2342
 				}
2343 2343
 				// Enter one of the loop a
2344
-				for($i=0;$i<count($group_srl_list);$i++)
2344
+				for ($i = 0; $i < count($group_srl_list); $i++)
2345 2345
 				{
2346
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2347
-					if(!$output->toBool())
2346
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2347
+					if (!$output->toBool())
2348 2348
 					{
2349 2349
 						$oDB->rollback();
2350 2350
 						return $output;
@@ -2356,9 +2356,9 @@  discard block
 block discarded – undo
2356 2356
 			}
2357 2357
 		}
2358 2358
 		// Call a trigger (after)
2359
-		if($output->toBool()) {
2359
+		if ($output->toBool()) {
2360 2360
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2361
-			if(!$trigger_output->toBool())
2361
+			if (!$trigger_output->toBool())
2362 2362
 			{
2363 2363
 				$oDB->rollback();
2364 2364
 				return $trigger_output;
@@ -2371,7 +2371,7 @@  discard block
 block discarded – undo
2371 2371
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2372 2372
 
2373 2373
 		// Save Session
2374
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2374
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2375 2375
 		$logged_info = Context::get('logged_info');
2376 2376
 
2377 2377
 		$output->add('member_srl', $args->member_srl);
@@ -2383,14 +2383,14 @@  discard block
 block discarded – undo
2383 2383
 	 */
2384 2384
 	function updateMemberPassword($args)
2385 2385
 	{
2386
-		if($args->password)
2386
+		if ($args->password)
2387 2387
 		{
2388 2388
 
2389 2389
 			// check password strength
2390 2390
 			$oMemberModel = getModel('member');
2391 2391
 			$config = $oMemberModel->getMemberConfig();
2392 2392
 
2393
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2393
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2394 2394
 			{
2395 2395
 				$message = Context::getLang('about_password_strength');
2396 2396
 				return new BaseObject(-1, $message[$config->password_strength]);
@@ -2398,13 +2398,13 @@  discard block
 block discarded – undo
2398 2398
 
2399 2399
 			$args->password = $oMemberModel->hashPassword($args->password);
2400 2400
 		}
2401
-		else if($args->hashed_password)
2401
+		else if ($args->hashed_password)
2402 2402
 		{
2403 2403
 			$args->password = $args->hashed_password;
2404 2404
 		}
2405 2405
 
2406 2406
 		$output = executeQuery('member.updateMemberPassword', $args);
2407
-		if($output->toBool())
2407
+		if ($output->toBool())
2408 2408
 		{
2409 2409
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2410 2410
 		}
@@ -2416,7 +2416,7 @@  discard block
 block discarded – undo
2416 2416
 
2417 2417
 	function updateFindAccountAnswer($member_srl, $answer)
2418 2418
 	{
2419
-		$oPassword =  new Password();
2419
+		$oPassword = new Password();
2420 2420
 
2421 2421
 		$args = new stdClass();
2422 2422
 		$args->member_srl = $member_srl;
@@ -2433,18 +2433,18 @@  discard block
 block discarded – undo
2433 2433
 		$trigger_obj = new stdClass();
2434 2434
 		$trigger_obj->member_srl = $member_srl;
2435 2435
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2436
-		if(!$output->toBool()) return $output;
2436
+		if (!$output->toBool()) return $output;
2437 2437
 		// Create a model object
2438 2438
 		$oMemberModel = getModel('member');
2439 2439
 		// Bringing the user's information
2440
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2440
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2441 2441
 		{
2442 2442
 			$columnList = array('member_srl', 'is_admin');
2443 2443
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2444 2444
 		}
2445
-		if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2445
+		if (!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2446 2446
 		// If managers can not be deleted
2447
-		if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2447
+		if ($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2448 2448
 
2449 2449
 		$oDB = &DB::getInstance();
2450 2450
 		$oDB->begin();
@@ -2453,7 +2453,7 @@  discard block
 block discarded – undo
2453 2453
 		$args->member_srl = $member_srl;
2454 2454
 		// Delete the entries in member_auth_mail
2455 2455
 		$output = executeQuery('member.deleteAuthMail', $args);
2456
-		if(!$output->toBool())
2456
+		if (!$output->toBool())
2457 2457
 		{
2458 2458
 			$oDB->rollback();
2459 2459
 			return $output;
@@ -2468,23 +2468,23 @@  discard block
 block discarded – undo
2468 2468
 		 */
2469 2469
 		// Delete the entries in member_group_member
2470 2470
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2471
-		if(!$output->toBool())
2471
+		if (!$output->toBool())
2472 2472
 		{
2473 2473
 			$oDB->rollback();
2474 2474
 			return $output;
2475 2475
 		}
2476 2476
 		// member removed from the table
2477 2477
 		$output = executeQuery('member.deleteMember', $args);
2478
-		if(!$output->toBool())
2478
+		if (!$output->toBool())
2479 2479
 		{
2480 2480
 			$oDB->rollback();
2481 2481
 			return $output;
2482 2482
 		}
2483 2483
 		// Call a trigger (after)
2484
-		if($output->toBool())
2484
+		if ($output->toBool())
2485 2485
 		{
2486 2486
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2487
-			if(!$trigger_output->toBool())
2487
+			if (!$trigger_output->toBool())
2488 2488
 			{
2489 2489
 				$oDB->rollback();
2490 2490
 				return $trigger_output;
@@ -2508,23 +2508,23 @@  discard block
 block discarded – undo
2508 2508
 	 */
2509 2509
 	function destroySessionInfo()
2510 2510
 	{
2511
-		if(!$_SESSION || !is_array($_SESSION)) return;
2511
+		if (!$_SESSION || !is_array($_SESSION)) return;
2512 2512
 
2513 2513
 		$memberInfo = Context::get('logged_info');
2514 2514
 		$memberSrl = $memberInfo->member_srl;
2515 2515
 
2516
-		foreach($_SESSION as $key => $val)
2516
+		foreach ($_SESSION as $key => $val)
2517 2517
 		{
2518 2518
 			$_SESSION[$key] = '';
2519 2519
 		}
2520 2520
 
2521 2521
 		session_destroy();
2522
-		setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000);
2523
-		setcookie('sso','',$_SERVER['REQUEST_TIME']-42000);
2524
-		setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000);
2522
+		setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000);
2523
+		setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000);
2524
+		setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000);
2525 2525
 		setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000);
2526 2526
 
2527
-		if($memberSrl || $_COOKIE['xeak'])
2527
+		if ($memberSrl || $_COOKIE['xeak'])
2528 2528
 		{
2529 2529
 			$args = new stdClass();
2530 2530
 			$args->member_srl = $memberSrl;
@@ -2540,22 +2540,22 @@  discard block
 block discarded – undo
2540 2540
 		$pointGroup = $pointModuleConfig->point_group;
2541 2541
 
2542 2542
 		$levelGroup = array();
2543
-		if(is_array($pointGroup) && count($pointGroup)>0)
2543
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2544 2544
 		{
2545 2545
 			$levelGroup = array_flip($pointGroup);
2546 2546
 			ksort($levelGroup);
2547 2547
 		}
2548 2548
 		$maxLevel = 0;
2549 2549
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2550
-		if(count($resultGroup) > 0)
2550
+		if (count($resultGroup) > 0)
2551 2551
 			$maxLevel = max(array_flip($resultGroup));
2552 2552
 
2553
-		if($maxLevel > 0)
2553
+		if ($maxLevel > 0)
2554 2554
 		{
2555 2555
 			$oPointModel = getModel('point');
2556 2556
 			$originPoint = $oPointModel->getPoint($memberSrl);
2557 2557
 
2558
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2558
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2559 2559
 			{
2560 2560
 				$oPointController = getController('point');
2561 2561
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2565,18 +2565,18 @@  discard block
 block discarded – undo
2565 2565
 
2566 2566
 	function procMemberModifyEmailAddress()
2567 2567
 	{
2568
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2568
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2569 2569
 
2570 2570
 		$member_info = Context::get('logged_info');
2571 2571
 		$newEmail = Context::get('email_address');
2572 2572
 
2573
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2573
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2574 2574
 
2575 2575
 		$oMemberModel = getModel('member');
2576 2576
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2577
-		if($member_srl) return new BaseObject(-1,'msg_exists_email_address');
2577
+		if ($member_srl) return new BaseObject(-1, 'msg_exists_email_address');
2578 2578
 
2579
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2579
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2580 2580
 		{
2581 2581
 			return $this->stop('msg_invalid_request');
2582 2582
 		}
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
 		$oDB = &DB::getInstance();
2593 2593
 		$oDB->begin();
2594 2594
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2595
-		if(!$output->toBool())
2595
+		if (!$output->toBool())
2596 2596
 		{
2597 2597
 			$oDB->rollback();
2598 2598
 			return $output;
@@ -2602,7 +2602,7 @@  discard block
 block discarded – undo
2602 2602
 		$member_config = $oModuleModel->getModuleConfig('member');
2603 2603
 
2604 2604
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2605
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2605
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2606 2606
 
2607 2607
 		global $lang;
2608 2608
 
@@ -2614,17 +2614,17 @@  discard block
 block discarded – undo
2614 2614
 
2615 2615
 		Context::set('newEmail', $newEmail);
2616 2616
 
2617
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2617
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2618 2618
 		Context::set('auth_url', $auth_url);
2619 2619
 
2620 2620
 		$oTemplate = &TemplateHandler::getInstance();
2621 2621
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2622 2622
 
2623 2623
 		$oMail = new Mail();
2624
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2624
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2625 2625
 		$oMail->setContent($content);
2626
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2627
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2626
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2627
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2628 2628
 		$result = $oMail->send();
2629 2629
 
2630 2630
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2638,16 +2638,16 @@  discard block
 block discarded – undo
2638 2638
 	{
2639 2639
 		$member_srl = Context::get('member_srl');
2640 2640
 		$auth_key = Context::get('auth_key');
2641
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2641
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2642 2642
 
2643 2643
 		// Test logs for finding password by user_id and authkey
2644 2644
 		$args = new stdClass;
2645 2645
 		$args->member_srl = $member_srl;
2646 2646
 		$args->auth_key = $auth_key;
2647 2647
 		$output = executeQuery('member.getAuthMail', $args);
2648
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2648
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2649 2649
 		{
2650
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2650
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2651 2651
 			return $this->stop('msg_invalid_modify_email_auth_key');
2652 2652
 		}
2653 2653
 
@@ -2656,10 +2656,10 @@  discard block
 block discarded – undo
2656 2656
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2657 2657
 
2658 2658
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2659
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2659
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2660 2660
 
2661 2661
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2662
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2662
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2663 2663
 
2664 2664
 		$this->_clearMemberCache($args->member_srl);
2665 2665
 
@@ -2677,7 +2677,7 @@  discard block
 block discarded – undo
2677 2677
 	**/
2678 2678
 	function triggerGetDocumentMenu(&$menu_list)
2679 2679
 	{
2680
-		if(!Context::get('is_logged')) return new BaseObject();
2680
+		if (!Context::get('is_logged')) return new BaseObject();
2681 2681
 
2682 2682
 		$logged_info = Context::get('logged_info');
2683 2683
 		$document_srl = Context::get('target_srl');
@@ -2688,12 +2688,12 @@  discard block
 block discarded – undo
2688 2688
 		$member_srl = $oDocument->get('member_srl');
2689 2689
 		$module_srl = $oDocument->get('module_srl');
2690 2690
 
2691
-		if(!$member_srl) return new BaseObject();
2692
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
2691
+		if (!$member_srl) return new BaseObject();
2692
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject();
2693 2693
 
2694 2694
 		$oDocumentController = getController('document');
2695
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2696
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2695
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2696
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2697 2697
 
2698 2698
 		return new BaseObject();
2699 2699
 	}
@@ -2707,7 +2707,7 @@  discard block
 block discarded – undo
2707 2707
 	**/
2708 2708
 	function triggerGetCommentMenu(&$menu_list)
2709 2709
 	{
2710
-		if(!Context::get('is_logged')) return new BaseObject();
2710
+		if (!Context::get('is_logged')) return new BaseObject();
2711 2711
 
2712 2712
 		$logged_info = Context::get('logged_info');
2713 2713
 		$comment_srl = Context::get('target_srl');
@@ -2718,12 +2718,12 @@  discard block
 block discarded – undo
2718 2718
 		$module_srl = $oComment->get('module_srl');
2719 2719
 		$member_srl = $oComment->get('member_srl');
2720 2720
 
2721
-		if(!$member_srl) return new BaseObject();
2722
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
2721
+		if (!$member_srl) return new BaseObject();
2722
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject();
2723 2723
 
2724 2724
 		$oCommentController = getController('comment');
2725
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2726
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2725
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2726
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2727 2727
 
2728 2728
 		return new BaseObject();
2729 2729
 	}
@@ -2735,7 +2735,7 @@  discard block
 block discarded – undo
2735 2735
 	**/
2736 2736
 	function procMemberSpammerManage()
2737 2737
 	{
2738
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
2738
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
2739 2739
 
2740 2740
 		$logged_info = Context::get('logged_info');
2741 2741
 		$member_srl = Context::get('member_srl');
@@ -2743,7 +2743,7 @@  discard block
 block discarded – undo
2743 2743
 		$cnt_loop = Context::get('cnt_loop');
2744 2744
 		$proc_type = Context::get('proc_type');
2745 2745
 		$isMoveToTrash = true;
2746
-		if($proc_type == "delete")
2746
+		if ($proc_type == "delete")
2747 2747
 			$isMoveToTrash = false;
2748 2748
 
2749 2749
 		// check grant
@@ -2752,7 +2752,7 @@  discard block
 block discarded – undo
2752 2752
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2753 2753
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2754 2754
 
2755
-		if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
2755
+		if (!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
2756 2756
 
2757 2757
 		$proc_msg = "";
2758 2758
 
@@ -2761,10 +2761,10 @@  discard block
 block discarded – undo
2761 2761
 
2762 2762
 		// delete or trash destination
2763 2763
 		// proc member
2764
-		if($cnt_loop == 1)
2764
+		if ($cnt_loop == 1)
2765 2765
 			$this->_spammerMember($member_srl);
2766 2766
 		// proc document and comment
2767
-		elseif($cnt_loop>1)
2767
+		elseif ($cnt_loop > 1)
2768 2768
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2769 2769
 
2770 2770
 		// get destination count
@@ -2773,11 +2773,11 @@  discard block
 block discarded – undo
2773 2773
 
2774 2774
 		$total_count = Context::get('total_count');
2775 2775
 		$remain_count = $cnt_document + $cnt_comment;
2776
-		if($cnt_loop == 1) $total_count = $remain_count;
2776
+		if ($cnt_loop == 1) $total_count = $remain_count;
2777 2777
 
2778 2778
 		// get progress percent
2779
-		if($total_count > 0)
2780
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2779
+		if ($total_count > 0)
2780
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2781 2781
 		else
2782 2782
 			$progress = 100;
2783 2783
 
@@ -2801,7 +2801,7 @@  discard block
 block discarded – undo
2801 2801
 	**/
2802 2802
 	private function _spammerMember($member_srl) {
2803 2803
 		$logged_info = Context::get('logged_info');
2804
-		$spam_description = trim( Context::get('spam_description') );
2804
+		$spam_description = trim(Context::get('spam_description'));
2805 2805
 
2806 2806
 		$oMemberModel = getModel('member');
2807 2807
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2820,10 +2820,10 @@  discard block
 block discarded – undo
2820 2820
 		$args->user_id = $member_info->user_id;
2821 2821
 		$args->nick_name = $member_info->nick_name;
2822 2822
 		$args->denied = "Y";
2823
-		$args->description = trim( $member_info->description );
2824
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2823
+		$args->description = trim($member_info->description);
2824
+		if ($args->description != "") $args->description .= "\n"; // add new line
2825 2825
 
2826
-		$args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]";
2826
+		$args->description .= Context::getLang('cmd_spammer')."[".date("Y-m-d H:i:s")." from:".$logged_info->user_id." info:".$spam_description." docuemnts count:".$total_count."]";
2827 2827
 
2828 2828
 		$output = $this->updateMember($args, true);
2829 2829
 
@@ -2852,21 +2852,21 @@  discard block
 block discarded – undo
2852 2852
 		// 1. proc comment, 2. proc document
2853 2853
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2854 2854
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2855
-		if($cnt_comment > 0)
2855
+		if ($cnt_comment > 0)
2856 2856
 		{
2857 2857
 			$columnList = array();
2858 2858
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2859
-			if($commentList) {
2860
-				foreach($commentList as $v) {
2859
+			if ($commentList) {
2860
+				foreach ($commentList as $v) {
2861 2861
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2862 2862
 				}
2863 2863
 			}
2864
-		} elseif($cnt_document > 0) {
2864
+		} elseif ($cnt_document > 0) {
2865 2865
 			$columnList = array();
2866 2866
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2867
-			if($documentList) {
2868
-				foreach($documentList as $v) {
2869
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2867
+			if ($documentList) {
2868
+				foreach ($documentList as $v) {
2869
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2870 2870
 					else $oDocumentController->deleteDocument($v->document_srl);
2871 2871
 				}
2872 2872
 			}
@@ -2878,24 +2878,24 @@  discard block
 block discarded – undo
2878 2878
 	function _clearMemberCache($member_srl, $site_srl = 0)
2879 2879
 	{
2880 2880
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2881
-		if($oCacheHandler->isSupport())
2881
+		if ($oCacheHandler->isSupport())
2882 2882
 		{
2883
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2883
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2884 2884
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2885 2885
 			$oCacheHandler->delete($cache_key);
2886 2886
 
2887
-			if($site_srl !== 0)
2887
+			if ($site_srl !== 0)
2888 2888
 			{
2889
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2889
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2890 2890
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2891 2891
 				$oCacheHandler->delete($cache_key);
2892 2892
 			}
2893 2893
 		}
2894 2894
 
2895 2895
 		$oCacheHandler = CacheHandler::getInstance('object');
2896
-		if($oCacheHandler->isSupport())
2896
+		if ($oCacheHandler->isSupport())
2897 2897
 		{
2898
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2898
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2899 2899
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2900 2900
 			$oCacheHandler->delete($cache_key);
2901 2901
 		}
Please login to merge, or discard this patch.
Braces   +591 added lines, -254 removed lines patch added patch discarded remove patch
@@ -41,19 +41,31 @@  discard block
 block discarded – undo
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if(!$user_id) {
45
+			$user_id = Context::get('user_id');
46
+		}
45 47
 		$user_id = trim($user_id);
46 48
 
47
-		if(!$password) $password = Context::get('password');
49
+		if(!$password) {
50
+			$password = Context::get('password');
51
+		}
48 52
 		$password = trim($password);
49 53
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
54
+		if(!$keep_signed) {
55
+			$keep_signed = Context::get('keep_signed');
56
+		}
51 57
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new BaseObject(-1,'null_user_id');
53
-		if(!$password) return new BaseObject(-1,'null_password');
58
+		if(!$user_id) {
59
+			return new BaseObject(-1,'null_user_id');
60
+		}
61
+		if(!$password) {
62
+			return new BaseObject(-1,'null_password');
63
+		}
54 64
 
55 65
 		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
56
-		if (!$output->toBool()) return $output;
66
+		if (!$output->toBool()) {
67
+			return $output;
68
+		}
57 69
 
58 70
 		$oModuleModel = getModel('module');
59 71
 		$config = $oModuleModel->getModuleConfig('member');
@@ -80,8 +92,7 @@  discard block
 block discarded – undo
80 92
 		if(!$config->after_login_url)
81 93
 		{
82 94
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83
-		}
84
-		else
95
+		} else
85 96
 		{
86 97
 			$returnUrl = $config->after_login_url;
87 98
 		}
@@ -98,19 +109,24 @@  discard block
 block discarded – undo
98 109
 		// Call a trigger before log-out (before)
99 110
 		$logged_info = Context::get('logged_info');
100 111
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
112
+		if(!$trigger_output->toBool()) {
113
+			return $trigger_output;
114
+		}
102 115
 		// Destroy session information
103 116
 		$this->destroySessionInfo();
104 117
 		// Call a trigger after log-out (after)
105 118
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
119
+		if(!$trigger_output->toBool()) {
120
+			return $trigger_output;
121
+		}
107 122
 
108 123
 		$output = new BaseObject();
109 124
 
110 125
 		$oModuleModel = getModel('module');
111 126
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
113
-			$output->redirect_url = $config->after_logout_url;
127
+		if($config->after_logout_url) {
128
+					$output->redirect_url = $config->after_logout_url;
129
+		}
114 130
 
115 131
 		$this->_clearMemberCache($logged_info->member_srl);
116 132
 
@@ -127,12 +143,18 @@  discard block
 block discarded – undo
127 143
 		$oModuleModel = &getModel('module');
128 144
 
129 145
 		// Check login information
130
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
146
+		if(!Context::get('is_logged')) {
147
+			return new BaseObject(-1, 'msg_not_logged');
148
+		}
131 149
 		$logged_info = Context::get('logged_info');
132 150
 
133 151
 		$document_srl = (int)Context::get('document_srl');
134
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
135
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
152
+		if(!$document_srl) {
153
+			$document_srl = (int)Context::get('target_srl');
154
+		}
155
+		if(!$document_srl) {
156
+			return new BaseObject(-1,'msg_invalid_request');
157
+		}
136 158
 
137 159
 		// Get document
138 160
 		$oDocumentModel = getModel('document');
@@ -180,11 +202,15 @@  discard block
 block discarded – undo
180 202
 
181 203
 		// Check if already scrapped
182 204
 		$output = executeQuery('member.getScrapDocument', $args);
183
-		if($output->data->count) return new BaseObject(-1, 'msg_alreay_scrapped');
205
+		if($output->data->count) {
206
+			return new BaseObject(-1, 'msg_alreay_scrapped');
207
+		}
184 208
 
185 209
 		// Insert
186 210
 		$output = executeQuery('member.addScrapDocument', $args);
187
-		if(!$output->toBool()) return $output;
211
+		if(!$output->toBool()) {
212
+			return $output;
213
+		}
188 214
 
189 215
 		$this->setError(-1);
190 216
 		$this->setMessage('success_registed');
@@ -198,11 +224,15 @@  discard block
 block discarded – undo
198 224
 	function procMemberDeleteScrap()
199 225
 	{
200 226
 		// Check login information
201
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
227
+		if(!Context::get('is_logged')) {
228
+			return new BaseObject(-1, 'msg_not_logged');
229
+		}
202 230
 		$logged_info = Context::get('logged_info');
203 231
 
204 232
 		$document_srl = (int)Context::get('document_srl');
205
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
233
+		if(!$document_srl) {
234
+			return new BaseObject(-1,'msg_invalid_request');
235
+		}
206 236
 		// Variables
207 237
 		$args = new stdClass;
208 238
 		$args->member_srl = $logged_info->member_srl;
@@ -228,11 +258,15 @@  discard block
 block discarded – undo
228 258
 	function procMemberDeleteSavedDocument()
229 259
 	{
230 260
 		// Check login information
231
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
261
+		if(!Context::get('is_logged')) {
262
+			return new BaseObject(-1, 'msg_not_logged');
263
+		}
232 264
 		$logged_info = Context::get('logged_info');
233 265
 
234 266
 		$document_srl = (int)Context::get('document_srl');
235
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
267
+		if(!$document_srl) {
268
+			return new BaseObject(-1,'msg_invalid_request');
269
+		}
236 270
 
237 271
 		$oDocumentModel = getModel('document');
238 272
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -260,7 +294,9 @@  discard block
 block discarded – undo
260 294
 	{
261 295
 		$name = Context::get('name');
262 296
 		$value = Context::get('value');
263
-		if(!$value) return;
297
+		if(!$value) {
298
+			return;
299
+		}
264 300
 
265 301
 		$oMemberModel = getModel('member');
266 302
 		// Check if logged-in
@@ -271,10 +307,14 @@  discard block
 block discarded – undo
271 307
 		{
272 308
 			case 'user_id' :
273 309
 				// Check denied ID
274
-				if($oMemberModel->isDeniedID($value)) return new BaseObject(0,'denied_user_id');
310
+				if($oMemberModel->isDeniedID($value)) {
311
+					return new BaseObject(0,'denied_user_id');
312
+				}
275 313
 				// Check if duplicated
276 314
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
277
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_user_id');
315
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
316
+					return new BaseObject(0,'msg_exists_user_id');
317
+				}
278 318
 				break;
279 319
 			case 'nick_name' :
280 320
 				// Check denied ID
@@ -284,13 +324,17 @@  discard block
 block discarded – undo
284 324
 				}
285 325
 				// Check if duplicated
286 326
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
287
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_nick_name');
327
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
328
+					return new BaseObject(0,'msg_exists_nick_name');
329
+				}
288 330
 
289 331
 				break;
290 332
 			case 'email_address' :
291 333
 				// Check if duplicated
292 334
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
293
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_email_address');
335
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
336
+					return new BaseObject(0,'msg_exists_email_address');
337
+				}
294 338
 				break;
295 339
 		}
296 340
 	}
@@ -302,17 +346,25 @@  discard block
 block discarded – undo
302 346
 	 */
303 347
 	function procMemberInsert()
304 348
 	{
305
-		if (Context::getRequestMethod () == "GET") return new BaseObject(-1, "msg_invalid_request");
349
+		if (Context::getRequestMethod () == "GET") {
350
+			return new BaseObject(-1, "msg_invalid_request");
351
+		}
306 352
 		$oMemberModel = &getModel ('member');
307 353
 		$config = $oMemberModel->getMemberConfig();
308 354
 
309 355
 		// call a trigger (before)
310 356
 		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
311
-		if(!$trigger_output->toBool ()) return $trigger_output;
357
+		if(!$trigger_output->toBool ()) {
358
+			return $trigger_output;
359
+		}
312 360
 		// Check if an administrator allows a membership
313
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
361
+		if($config->enable_join != 'Y') {
362
+			return $this->stop ('msg_signup_disabled');
363
+		}
314 364
 		// Check if the user accept the license terms (only if terms exist)
315
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
365
+		if($config->agreement && Context::get('accept_agreement')!='Y') {
366
+			return $this->stop('msg_accept_agreement');
367
+		}
316 368
 
317 369
 		// Extract the necessary information in advance
318 370
 		$getVars = array();
@@ -331,16 +383,22 @@  discard block
 block discarded – undo
331 383
 		foreach($getVars as $val)
332 384
 		{
333 385
 			$args->{$val} = Context::get($val);
334
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
386
+			if($val == 'birthday') {
387
+				$args->birthday_ui = Context::get('birthday_ui');
388
+			}
335 389
 		}
336 390
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
337
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
391
+		if(!$args->birthday && $args->birthday_ui) {
392
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
393
+		}
338 394
 
339 395
 		$args->find_account_answer = Context::get('find_account_answer');
340 396
 		$args->allow_mailing = Context::get('allow_mailing');
341 397
 		$args->allow_message = Context::get('allow_message');
342 398
 
343
-		if($args->password1) $args->password = $args->password1;
399
+		if($args->password1) {
400
+			$args->password = $args->password1;
401
+		}
344 402
 
345 403
 		// check password strength
346 404
 		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
@@ -369,7 +427,9 @@  discard block
 block discarded – undo
369 427
 		unset($all_args->secret_text);
370 428
 
371 429
 		// Set the user state as "denied" when using mail authentication
372
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
430
+		if($config->enable_confirm == 'Y') {
431
+			$args->denied = 'Y';
432
+		}
373 433
 		// Add extra vars after excluding necessary information from all the requested arguments
374 434
 		$extra_vars = delObjectVars($all_args, $args);
375 435
 		$args->extra_vars = serialize($extra_vars);
@@ -384,7 +444,9 @@  discard block
 block discarded – undo
384 444
 			}
385 445
 		}
386 446
 		$output = $this->insertMember($args);
387
-		if(!$output->toBool()) return $output;
447
+		if(!$output->toBool()) {
448
+			return $output;
449
+		}
388 450
 
389 451
 		// insert ProfileImage, ImageName, ImageMark
390 452
 		$profile_image = $_FILES['profile_image'];
@@ -423,43 +485,46 @@  discard block
 block discarded – undo
423 485
 			if($config->identifier == 'email_address')
424 486
 			{
425 487
 				$output = $this->doLogin($args->email_address);
426
-			}
427
-			else
488
+			} else
428 489
 			{
429 490
 				$output = $this->doLogin($args->user_id);
430 491
 			}
431 492
 			if(!$output->toBool()) {
432
-				if($output->error == -9)
433
-					$output->error = -11;
493
+				if($output->error == -9) {
494
+									$output->error = -11;
495
+				}
434 496
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
435 497
 			}
436 498
 		}
437 499
 
438 500
 		// Results
439 501
 		$this->add('member_srl', $args->member_srl);
440
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
502
+		if($config->redirect_url) {
503
+			$this->add('redirect_url', $config->redirect_url);
504
+		}
441 505
 		if($config->enable_confirm == 'Y')
442 506
 		{
443 507
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
444 508
 			$this->setMessage($msg);
445 509
 			return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new BaseObject(-12, $msg));
510
+		} else {
511
+			$this->setMessage('success_registed');
446 512
 		}
447
-		else $this->setMessage('success_registed');
448 513
 		// Call a trigger (after)
449 514
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
450
-		if(!$trigger_output->toBool()) return $trigger_output;
515
+		if(!$trigger_output->toBool()) {
516
+			return $trigger_output;
517
+		}
451 518
 
452 519
 		if($config->redirect_url)
453 520
 		{
454 521
 			$returnUrl = $config->redirect_url;
455
-		}
456
-		else
522
+		} else
457 523
 		{
458 524
 			if(Context::get('success_return_url'))
459 525
 			{
460 526
 				$returnUrl = Context::get('success_return_url');
461
-			}
462
-			else if($_COOKIE['XE_REDIRECT_URL'])
527
+			} else if($_COOKIE['XE_REDIRECT_URL'])
463 528
 			{
464 529
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
465 530
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -513,8 +578,7 @@  discard block
 block discarded – undo
513 578
 		if(Context::get('success_return_url'))
514 579
 		{
515 580
 			$redirectUrl = Context::get('success_return_url');
516
-		}
517
-		else
581
+		} else
518 582
 		{
519 583
 			$redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
520 584
 		}
@@ -558,7 +622,9 @@  discard block
 block discarded – undo
558 622
 		foreach($getVars as $val)
559 623
 		{
560 624
 			$args->{$val} = Context::get($val);
561
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
625
+			if($val == 'birthday') {
626
+				$args->birthday_ui = Context::get('birthday_ui');
627
+			}
562 628
 			if($val == 'find_account_answer' && !Context::get($val)) {
563 629
 				unset($args->{$val});
564 630
 			}
@@ -568,7 +634,9 @@  discard block
 block discarded – undo
568 634
 		$logged_info = Context::get('logged_info');
569 635
 		$args->member_srl = $logged_info->member_srl;
570 636
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
571
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
637
+		if(!$args->birthday && $args->birthday_ui) {
638
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
639
+		}
572 640
 
573 641
 		// Remove some unnecessary variables from all the vars
574 642
 		$all_args = Context::getRequestVars();
@@ -603,7 +671,9 @@  discard block
 block discarded – undo
603 671
 
604 672
 		// Execute insert or update depending on the value of member_srl
605 673
 		$output = $this->updateMember($args);
606
-		if(!$output->toBool()) return $output;
674
+		if(!$output->toBool()) {
675
+			return $output;
676
+		}
607 677
 
608 678
 		$profile_image = $_FILES['profile_image'];
609 679
 		if(is_uploaded_file($profile_image['tmp_name']))
@@ -633,7 +703,9 @@  discard block
 block discarded – undo
633 703
 
634 704
 		// Call a trigger after successfully log-in (after)
635 705
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
636
-		if(!$trigger_output->toBool()) return $trigger_output;
706
+		if(!$trigger_output->toBool()) {
707
+			return $trigger_output;
708
+		}
637 709
 
638 710
 		$this->setSessionInfo();
639 711
 		// Return result
@@ -654,7 +726,9 @@  discard block
 block discarded – undo
654 726
 	 */
655 727
 	function procMemberModifyPassword()
656 728
 	{
657
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
729
+		if(!Context::get('is_logged')) {
730
+			return $this->stop('msg_not_logged');
731
+		}
658 732
 		// Extract the necessary information in advance
659 733
 		$current_password = trim(Context::get('current_password'));
660 734
 		$password = trim(Context::get('password1'));
@@ -668,17 +742,23 @@  discard block
 block discarded – undo
668 742
 
669 743
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
670 744
 		// Verify the cuttent password
671
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new BaseObject(-1, 'invalid_password');
745
+		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) {
746
+			return new BaseObject(-1, 'invalid_password');
747
+		}
672 748
 
673 749
 		// Check if a new password is as same as the previous password
674
-		if($current_password == $password) return new BaseObject(-1, 'invalid_new_password');
750
+		if($current_password == $password) {
751
+			return new BaseObject(-1, 'invalid_new_password');
752
+		}
675 753
 
676 754
 		// Execute insert or update depending on the value of member_srl
677 755
 		$args = new stdClass;
678 756
 		$args->member_srl = $member_srl;
679 757
 		$args->password = $password;
680 758
 		$output = $this->updateMemberPassword($args);
681
-		if(!$output->toBool()) return $output;
759
+		if(!$output->toBool()) {
760
+			return $output;
761
+		}
682 762
 
683 763
 		$this->add('member_srl', $args->member_srl);
684 764
 		$this->setMessage('success_updated');
@@ -694,7 +774,9 @@  discard block
 block discarded – undo
694 774
 	 */
695 775
 	function procMemberLeave()
696 776
 	{
697
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
777
+		if(!Context::get('is_logged')) {
778
+			return $this->stop('msg_not_logged');
779
+		}
698 780
 		// Extract the necessary information in advance
699 781
 		$password = trim(Context::get('password'));
700 782
 		// Get information of logged-in user
@@ -710,10 +792,14 @@  discard block
 block discarded – undo
710 792
 			$this->memberInfo->password = $memberInfo->password;
711 793
 		}
712 794
 		// Verify the cuttent password
713
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new BaseObject(-1, 'invalid_password');
795
+		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) {
796
+			return new BaseObject(-1, 'invalid_password');
797
+		}
714 798
 
715 799
 		$output = $this->deleteMember($member_srl);
716
-		if(!$output->toBool()) return $output;
800
+		if(!$output->toBool()) {
801
+			return $output;
802
+		}
717 803
 		// Destroy all session information
718 804
 		$this->destroySessionInfo();
719 805
 		// Return success message
@@ -732,17 +818,25 @@  discard block
 block discarded – undo
732 818
 	{
733 819
 		// Check if the file is successfully uploaded
734 820
 		$file = $_FILES['profile_image'];
735
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
821
+		if(!is_uploaded_file($file['tmp_name'])) {
822
+			return $this->stop('msg_not_uploaded_profile_image');
823
+		}
736 824
 		// Ignore if member_srl is invalid or doesn't exist.
737 825
 		$member_srl = Context::get('member_srl');
738
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
826
+		if(!$member_srl) {
827
+			return $this->stop('msg_not_uploaded_profile_image');
828
+		}
739 829
 
740 830
 		$logged_info = Context::get('logged_info');
741
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
831
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
832
+			return $this->stop('msg_not_uploaded_profile_image');
833
+		}
742 834
 		// Return if member module is set not to use an image name or the user is not an administrator ;
743 835
 		$oModuleModel = getModel('module');
744 836
 		$config = $oModuleModel->getModuleConfig('member');
745
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
837
+		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') {
838
+			return $this->stop('msg_not_uploaded_profile_image');
839
+		}
746 840
 
747 841
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
748 842
 		// Page refresh
@@ -764,26 +858,35 @@  discard block
 block discarded – undo
764 858
 	{
765 859
 
766 860
 		// Check uploaded file
767
-		if(!checkUploadedFile($target_file)) return;
861
+		if(!checkUploadedFile($target_file)) {
862
+			return;
863
+		}
768 864
 
769 865
 		$oMemberModel = getModel('member');
770 866
 		$config = $oMemberModel->getMemberConfig();
771 867
 
772 868
 		// Get an image size
773 869
 		$max_width = $config->profile_image_max_width;
774
-		if(!$max_width) $max_width = "90";
870
+		if(!$max_width) {
871
+			$max_width = "90";
872
+		}
775 873
 		$max_height = $config->profile_image_max_height;
776
-		if(!$max_height) $max_height = "90";
874
+		if(!$max_height) {
875
+			$max_height = "90";
876
+		}
777 877
 		// Get a target path to save
778 878
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
779 879
 		FileHandler::makeDir($target_path);
780 880
 
781 881
 		// Get file information
782 882
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
783
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
784
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
785
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
786
-		else
883
+		if(IMAGETYPE_PNG == $type) {
884
+			$ext = 'png';
885
+		} elseif(IMAGETYPE_JPEG == $type) {
886
+			$ext = 'jpg';
887
+		} elseif(IMAGETYPE_GIF == $type) {
888
+			$ext = 'gif';
889
+		} else
787 890
 		{
788 891
 			return;
789 892
 		}
@@ -795,8 +898,7 @@  discard block
 block discarded – undo
795 898
 		if(($width > $max_width || $height > $max_height ) && $type != 1)
796 899
 		{
797 900
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
798
-		}
799
-		else
901
+		} else
800 902
 		{
801 903
 			@copy($target_file, $target_filename);
802 904
 		}
@@ -811,17 +913,25 @@  discard block
 block discarded – undo
811 913
 	{
812 914
 		// Check if the file is successfully uploaded
813 915
 		$file = $_FILES['image_name'];
814
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
916
+		if(!is_uploaded_file($file['tmp_name'])) {
917
+			return $this->stop('msg_not_uploaded_image_name');
918
+		}
815 919
 		// Ignore if member_srl is invalid or doesn't exist.
816 920
 		$member_srl = Context::get('member_srl');
817
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
921
+		if(!$member_srl) {
922
+			return $this->stop('msg_not_uploaded_image_name');
923
+		}
818 924
 
819 925
 		$logged_info = Context::get('logged_info');
820
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
926
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
927
+			return $this->stop('msg_not_uploaded_image_name');
928
+		}
821 929
 		// Return if member module is set not to use an image name or the user is not an administrator ;
822 930
 		$oModuleModel = getModel('module');
823 931
 		$config = $oModuleModel->getModuleConfig('member');
824
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
932
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
933
+			return $this->stop('msg_not_uploaded_image_name');
934
+		}
825 935
 
826 936
 		$this->insertImageName($member_srl, $file['tmp_name']);
827 937
 		// Page refresh
@@ -842,15 +952,21 @@  discard block
 block discarded – undo
842 952
 	function insertImageName($member_srl, $target_file)
843 953
 	{
844 954
 		// Check uploaded file
845
-		if(!checkUploadedFile($target_file)) return;
955
+		if(!checkUploadedFile($target_file)) {
956
+			return;
957
+		}
846 958
 
847 959
 		$oModuleModel = getModel('module');
848 960
 		$config = $oModuleModel->getModuleConfig('member');
849 961
 		// Get an image size
850 962
 		$max_width = $config->image_name_max_width;
851
-		if(!$max_width) $max_width = "90";
963
+		if(!$max_width) {
964
+			$max_width = "90";
965
+		}
852 966
 		$max_height = $config->image_name_max_height;
853
-		if(!$max_height) $max_height = "20";
967
+		if(!$max_height) {
968
+			$max_height = "20";
969
+		}
854 970
 		// Get a target path to save
855 971
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
856 972
 		FileHandler::makeDir($target_path);
@@ -859,8 +975,11 @@  discard block
 block discarded – undo
859 975
 		// Get file information
860 976
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
861 977
 		// Convert if the image size is larger than a given size or if the format is not a gif
862
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
863
-		else @copy($target_file, $target_filename);
978
+		if($width > $max_width || $height > $max_height || $type!=1) {
979
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
980
+		} else {
981
+			@copy($target_file, $target_filename);
982
+		}
864 983
 	}
865 984
 
866 985
 	/**
@@ -920,17 +1039,25 @@  discard block
 block discarded – undo
920 1039
 	{
921 1040
 		// Check if the file is successfully uploaded
922 1041
 		$file = $_FILES['image_mark'];
923
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
1042
+		if(!is_uploaded_file($file['tmp_name'])) {
1043
+			return $this->stop('msg_not_uploaded_image_mark');
1044
+		}
924 1045
 		// Ignore if member_srl is invalid or doesn't exist.
925 1046
 		$member_srl = Context::get('member_srl');
926
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
1047
+		if(!$member_srl) {
1048
+			return $this->stop('msg_not_uploaded_image_mark');
1049
+		}
927 1050
 
928 1051
 		$logged_info = Context::get('logged_info');
929
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
1052
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
1053
+			return $this->stop('msg_not_uploaded_image_mark');
1054
+		}
930 1055
 		// Membership in the images mark the module using the ban was set by an administrator or return;
931 1056
 		$oModuleModel = getModel('module');
932 1057
 		$config = $oModuleModel->getModuleConfig('member');
933
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1058
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1059
+			return $this->stop('msg_not_uploaded_image_mark');
1060
+		}
934 1061
 
935 1062
 		$this->insertImageMark($member_srl, $file['tmp_name']);
936 1063
 		// Page refresh
@@ -951,15 +1078,21 @@  discard block
 block discarded – undo
951 1078
 	function insertImageMark($member_srl, $target_file)
952 1079
 	{
953 1080
 		// Check uploaded file
954
-		if(!checkUploadedFile($target_file)) return;
1081
+		if(!checkUploadedFile($target_file)) {
1082
+			return;
1083
+		}
955 1084
 
956 1085
 		$oModuleModel = getModel('module');
957 1086
 		$config = $oModuleModel->getModuleConfig('member');
958 1087
 		// Get an image size
959 1088
 		$max_width = $config->image_mark_max_width;
960
-		if(!$max_width) $max_width = "20";
1089
+		if(!$max_width) {
1090
+			$max_width = "20";
1091
+		}
961 1092
 		$max_height = $config->image_mark_max_height;
962
-		if(!$max_height) $max_height = "20";
1093
+		if(!$max_height) {
1094
+			$max_height = "20";
1095
+		}
963 1096
 
964 1097
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
965 1098
 		FileHandler::makeDir($target_path);
@@ -968,8 +1101,11 @@  discard block
 block discarded – undo
968 1101
 		// Get file information
969 1102
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
970 1103
 
971
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
972
-		else @copy($target_file, $target_filename);
1104
+		if($width > $max_width || $height > $max_height || $type!=1) {
1105
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
1106
+		} else {
1107
+			@copy($target_file, $target_filename);
1108
+		}
973 1109
 	}
974 1110
 
975 1111
 	/**
@@ -1004,14 +1140,18 @@  discard block
 block discarded – undo
1004 1140
 	function procMemberFindAccount()
1005 1141
 	{
1006 1142
 		$email_address = Context::get('email_address');
1007
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1143
+		if(!$email_address) {
1144
+			return new BaseObject(-1, 'msg_invalid_request');
1145
+		}
1008 1146
 
1009 1147
 		$oMemberModel = getModel('member');
1010 1148
 		$oModuleModel = getModel('module');
1011 1149
 
1012 1150
 		// Check if a member having the same email address exists
1013 1151
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1014
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1152
+		if(!$member_srl) {
1153
+			return new BaseObject(-1, 'msg_email_not_exists');
1154
+		}
1015 1155
 
1016 1156
 		// Get information of the member
1017 1157
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -1023,7 +1163,9 @@  discard block
 block discarded – undo
1023 1163
 			$chk_args = new stdClass;
1024 1164
 			$chk_args->member_srl = $member_info->member_srl;
1025 1165
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1026
-			if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1166
+			if($output->toBool() && $output->data->count != '0') {
1167
+				return new BaseObject(-1, 'msg_user_not_confirmed');
1168
+			}
1027 1169
 		}
1028 1170
 
1029 1171
 		// Insert data into the authentication DB
@@ -1036,7 +1178,9 @@  discard block
 block discarded – undo
1036 1178
 		$args->is_register = 'N';
1037 1179
 
1038 1180
 		$output = executeQuery('member.insertAuthMail', $args);
1039
-		if(!$output->toBool()) return $output;
1181
+		if(!$output->toBool()) {
1182
+			return $output;
1183
+		}
1040 1184
 		// Get content of the email to send a member
1041 1185
 		Context::set('auth_args', $args);
1042 1186
 
@@ -1053,8 +1197,7 @@  discard block
 block discarded – undo
1053 1197
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1054 1198
 				}
1055 1199
 			}
1056
-		}
1057
-		else
1200
+		} else
1058 1201
 		{
1059 1202
 			$memberInfo[$lang->user_id] = $args->user_id;
1060 1203
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1063,13 +1206,19 @@  discard block
 block discarded – undo
1063 1206
 		}
1064 1207
 		Context::set('memberInfo', $memberInfo);
1065 1208
 
1066
-		if(!$member_config->skin) $member_config->skin = "default";
1067
-		if(!$member_config->colorset) $member_config->colorset = "white";
1209
+		if(!$member_config->skin) {
1210
+			$member_config->skin = "default";
1211
+		}
1212
+		if(!$member_config->colorset) {
1213
+			$member_config->colorset = "white";
1214
+		}
1068 1215
 
1069 1216
 		Context::set('member_config', $member_config);
1070 1217
 
1071 1218
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1072
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1219
+		if(!is_dir($tpl_path)) {
1220
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1221
+		}
1073 1222
 
1074 1223
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1075 1224
 		Context::set('find_url', $find_url);
@@ -1112,19 +1261,25 @@  discard block
 block discarded – undo
1112 1261
 		$find_account_question = trim(Context::get('find_account_question'));
1113 1262
 		$find_account_answer = trim(Context::get('find_account_answer'));
1114 1263
 
1115
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1264
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1265
+			return new BaseObject(-1, 'msg_invalid_request');
1266
+		}
1116 1267
 
1117 1268
 		$oModuleModel = getModel('module');
1118 1269
 		// Check if a member having the same email address exists
1119 1270
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1120
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1271
+		if(!$member_srl) {
1272
+			return new BaseObject(-1, 'msg_email_not_exists');
1273
+		}
1121 1274
 
1122 1275
 		// Get information of the member
1123 1276
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1124 1277
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1125 1278
 
1126 1279
 		// Display a message if no answer is entered
1127
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1280
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1281
+			return new BaseObject(-1, 'msg_question_not_exists');
1282
+		}
1128 1283
 
1129 1284
 		// 답변 확인
1130 1285
 		$hashed = $oPassword->checkAlgorithm($member_info->find_account_answer);
@@ -1133,12 +1288,10 @@  discard block
 block discarded – undo
1133 1288
 		if($member_info->find_account_question != $find_account_question)
1134 1289
 		{
1135 1290
 			$authed = false;
1136
-		}
1137
-		else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1291
+		} else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1138 1292
 		{
1139 1293
 			$authed = false;
1140
-		}
1141
-		else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1294
+		} else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1142 1295
 		{
1143 1296
 			$authed = false;
1144 1297
 		}
@@ -1167,7 +1320,9 @@  discard block
 block discarded – undo
1167 1320
 		$args->password = $temp_password;
1168 1321
 		$args->change_password_date = '1';
1169 1322
 		$output = $this->updateMemberPassword($args);
1170
-		if(!$output->toBool()) return $output;
1323
+		if(!$output->toBool()) {
1324
+			return $output;
1325
+		}
1171 1326
 
1172 1327
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1173 1328
 
@@ -1224,8 +1379,7 @@  discard block
 block discarded – undo
1224 1379
 		if($output->data->is_register == 'Y')
1225 1380
 		{
1226 1381
 			$args->denied = 'N';
1227
-		}
1228
-		else
1382
+		} else
1229 1383
 		{
1230 1384
 			$args->password = $oMemberModel->hashPassword($args->password);
1231 1385
 		}
@@ -1259,33 +1413,45 @@  discard block
 block discarded – undo
1259 1413
 	{
1260 1414
 		// Get an email_address
1261 1415
 		$email_address = Context::get('email_address');
1262
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1416
+		if(!$email_address) {
1417
+			return new BaseObject(-1, 'msg_invalid_request');
1418
+		}
1263 1419
 		// Log test by using email_address
1264 1420
 		$oMemberModel = getModel('member');
1265 1421
 
1266 1422
 		$args = new stdClass;
1267 1423
 		$args->email_address = $email_address;
1268 1424
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1269
-		if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1425
+		if(!$memberSrl) {
1426
+			return new BaseObject(-1, 'msg_not_exists_member');
1427
+		}
1270 1428
 
1271 1429
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1272 1430
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1273 1431
 
1274 1432
 		$oModuleModel = getModel('module');
1275 1433
 		$member_config = $oModuleModel->getModuleConfig('member');
1276
-		if(!$member_config->skin) $member_config->skin = "default";
1277
-		if(!$member_config->colorset) $member_config->colorset = "white";
1434
+		if(!$member_config->skin) {
1435
+			$member_config->skin = "default";
1436
+		}
1437
+		if(!$member_config->colorset) {
1438
+			$member_config->colorset = "white";
1439
+		}
1278 1440
 
1279 1441
 		// Check if a authentication mail has been sent previously
1280 1442
 		$chk_args = new stdClass;
1281 1443
 		$chk_args->member_srl = $member_info->member_srl;
1282 1444
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1283
-		if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1445
+		if($output->toBool() && $output->data->count == '0') {
1446
+			return new BaseObject(-1, 'msg_invalid_request');
1447
+		}
1284 1448
 
1285 1449
 		$auth_args = new stdClass;
1286 1450
 		$auth_args->member_srl = $member_info->member_srl;
1287 1451
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1288
-		if(!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1452
+		if(!$output->data || !$output->data[0]->auth_key) {
1453
+			return new BaseObject(-1, 'msg_invalid_request');
1454
+		}
1289 1455
 		$auth_info = $output->data[0];
1290 1456
 
1291 1457
 		// Update the regdate of authmail entry
@@ -1306,8 +1472,7 @@  discard block
 block discarded – undo
1306 1472
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1307 1473
 				}
1308 1474
 			}
1309
-		}
1310
-		else
1475
+		} else
1311 1476
 		{
1312 1477
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1313 1478
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1320,7 +1485,9 @@  discard block
 block discarded – undo
1320 1485
 		Context::set('member_config', $member_config);
1321 1486
 
1322 1487
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1323
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1488
+		if(!is_dir($tpl_path)) {
1489
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1490
+		}
1324 1491
 
1325 1492
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1326 1493
 		Context::set('auth_url', $auth_url);
@@ -1398,7 +1565,9 @@  discard block
 block discarded – undo
1398 1565
 		$auth_args->is_register = 'Y';
1399 1566
 
1400 1567
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1401
-		if(!$output->toBool()) return $output;
1568
+		if(!$output->toBool()) {
1569
+			return $output;
1570
+		}
1402 1571
 
1403 1572
 		$memberInfo->email_address = $newEmail;
1404 1573
 
@@ -1432,8 +1601,7 @@  discard block
 block discarded – undo
1432 1601
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1433 1602
 				}
1434 1603
 			}
1435
-		}
1436
-		else
1604
+		} else
1437 1605
 		{
1438 1606
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1439 1607
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1442,13 +1610,19 @@  discard block
 block discarded – undo
1442 1610
 		}
1443 1611
 		Context::set('memberInfo', $memberInfo);
1444 1612
 
1445
-		if(!$member_config->skin) $member_config->skin = "default";
1446
-		if(!$member_config->colorset) $member_config->colorset = "white";
1613
+		if(!$member_config->skin) {
1614
+			$member_config->skin = "default";
1615
+		}
1616
+		if(!$member_config->colorset) {
1617
+			$member_config->colorset = "white";
1618
+		}
1447 1619
 
1448 1620
 		Context::set('member_config', $member_config);
1449 1621
 
1450 1622
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1451
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1623
+		if(!is_dir($tpl_path)) {
1624
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1625
+		}
1452 1626
 
1453 1627
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1454 1628
 		Context::set('auth_url', $auth_url);
@@ -1473,7 +1647,9 @@  discard block
 block discarded – undo
1473 1647
 	{
1474 1648
 		$site_module_info = Context::get('site_module_info');
1475 1649
 		$logged_info = Context::get('logged_info');
1476
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1650
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1651
+			return new BaseObject(-1,'msg_invalid_request');
1652
+		}
1477 1653
 
1478 1654
 		$oMemberModel = getModel('member');
1479 1655
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1492,13 +1668,17 @@  discard block
 block discarded – undo
1492 1668
 	{
1493 1669
 		$site_module_info = Context::get('site_module_info');
1494 1670
 		$logged_info = Context::get('logged_info');
1495
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1671
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1672
+			return new BaseObject(-1,'msg_invalid_request');
1673
+		}
1496 1674
 
1497 1675
 		$args = new stdClass;
1498 1676
 		$args->site_srl= $site_module_info->site_srl;
1499 1677
 		$args->member_srl = $logged_info->member_srl;
1500 1678
 		$output = executeQuery('member.deleteMembersGroup', $args);
1501
-		if(!$output->toBool()) return $output;
1679
+		if(!$output->toBool()) {
1680
+			return $output;
1681
+		}
1502 1682
 		$this->setMessage('success_deleted');
1503 1683
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1504 1684
 	}
@@ -1512,17 +1692,37 @@  discard block
 block discarded – undo
1512 1692
 	 */
1513 1693
 	function setMemberConfig($args)
1514 1694
 	{
1515
-		if(!$args->skin) $args->skin = "default";
1516
-		if(!$args->colorset) $args->colorset = "white";
1517
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1518
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1519
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1695
+		if(!$args->skin) {
1696
+			$args->skin = "default";
1697
+		}
1698
+		if(!$args->colorset) {
1699
+			$args->colorset = "white";
1700
+		}
1701
+		if(!$args->editor_skin) {
1702
+			$args->editor_skin= "ckeditor";
1703
+		}
1704
+		if(!$args->editor_colorset) {
1705
+			$args->editor_colorset = "moono";
1706
+		}
1707
+		if($args->enable_join!='Y') {
1708
+			$args->enable_join = 'N';
1709
+		}
1520 1710
 		$args->enable_openid= 'N';
1521
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1522
-		if($args->image_name!='Y') $args->image_name = 'N';
1523
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1524
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1525
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1711
+		if($args->profile_image !='Y') {
1712
+			$args->profile_image = 'N';
1713
+		}
1714
+		if($args->image_name!='Y') {
1715
+			$args->image_name = 'N';
1716
+		}
1717
+		if($args->image_mark!='Y') {
1718
+			$args->image_mark = 'N';
1719
+		}
1720
+		if($args->group_image_mark!='Y') {
1721
+			$args->group_image_mark = 'N';
1722
+		}
1723
+		if(!trim(strip_tags($args->agreement))) {
1724
+			$args->agreement = null;
1725
+		}
1526 1726
 		$args->limit_day = (int)$args->limit_day;
1527 1727
 
1528 1728
 		$agreement = trim($args->agreement);
@@ -1530,7 +1730,9 @@  discard block
 block discarded – undo
1530 1730
 
1531 1731
 		$oModuleController = getController('module');
1532 1732
 		$output = $oModuleController->insertModuleConfig('member',$args);
1533
-		if(!$output->toBool()) return $output;
1733
+		if(!$output->toBool()) {
1734
+			return $output;
1735
+		}
1534 1736
 
1535 1737
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1536 1738
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1555,7 +1757,9 @@  discard block
 block discarded – undo
1555 1757
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1556 1758
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1557 1759
 
1558
-		if(!$check_signature) return FileHandler::removeFile($filename);
1760
+		if(!$check_signature) {
1761
+			return FileHandler::removeFile($filename);
1762
+		}
1559 1763
 
1560 1764
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1561 1765
 		FileHandler::makeDir($path);
@@ -1589,7 +1793,9 @@  discard block
 block discarded – undo
1589 1793
 		$args = new stdClass();
1590 1794
 		$args->member_srl = $member_srl;
1591 1795
 		$args->group_srl = $group_srl;
1592
-		if($site_srl) $args->site_srl = $site_srl;
1796
+		if($site_srl) {
1797
+			$args->site_srl = $site_srl;
1798
+		}
1593 1799
 
1594 1800
 		// Add
1595 1801
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1615,15 +1821,21 @@  discard block
 block discarded – undo
1615 1821
 		$obj->member_srl = implode(',',$args->member_srl);
1616 1822
 
1617 1823
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1618
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1824
+		if($output->data) {
1825
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1826
+		}
1619 1827
 
1620 1828
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1621
-		if(!$output->toBool()) return $output;
1829
+		if(!$output->toBool()) {
1830
+			return $output;
1831
+		}
1622 1832
 
1623 1833
 		$inserted_members = array();
1624 1834
 		foreach($args->member_srl as $key => $val)
1625 1835
 		{
1626
-			if($inserted_members[$val]) continue;
1836
+			if($inserted_members[$val]) {
1837
+				continue;
1838
+			}
1627 1839
 			$inserted_members[$val] = true;
1628 1840
 
1629 1841
 			unset($obj);
@@ -1633,7 +1845,9 @@  discard block
 block discarded – undo
1633 1845
 			$obj->site_srl = $args->site_srl;
1634 1846
 			$obj->regdate = $date[$obj->member_srl];
1635 1847
 			$output = executeQuery('member.addMemberToGroup', $obj);
1636
-			if(!$output->toBool()) return $output;
1848
+			if(!$output->toBool()) {
1849
+				return $output;
1850
+			}
1637 1851
 
1638 1852
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1639 1853
 		}
@@ -1695,8 +1909,7 @@  discard block
 block discarded – undo
1695 1909
 				if($config->identifier == 'user_id')
1696 1910
 				{
1697 1911
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1698
-				}
1699
-				else
1912
+				} else
1700 1913
 				{
1701 1914
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1702 1915
 				}
@@ -1705,8 +1918,7 @@  discard block
 block discarded – undo
1705 1918
 					$do_auto_login = true;
1706 1919
 				}
1707 1920
 
1708
-			}
1709
-			else
1921
+			} else
1710 1922
 			{
1711 1923
 				$do_auto_login = true;
1712 1924
 			}
@@ -1715,8 +1927,7 @@  discard block
 block discarded – undo
1715 1927
 		if($do_auto_login)
1716 1928
 		{
1717 1929
 			$output = $this->doLogin($user_id);
1718
-		}
1719
-		else
1930
+		} else
1720 1931
 		{
1721 1932
 			executeQuery('member.deleteAutologin', $args);
1722 1933
 			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
@@ -1735,13 +1946,17 @@  discard block
 block discarded – undo
1735 1946
 	function doLogin($user_id, $password = '', $keep_signed = false)
1736 1947
 	{
1737 1948
 		$user_id = strtolower($user_id);
1738
-		if(!$user_id) return new BaseObject(-1, 'null_user_id');
1949
+		if(!$user_id) {
1950
+			return new BaseObject(-1, 'null_user_id');
1951
+		}
1739 1952
 		// Call a trigger before log-in (before)
1740 1953
 		$trigger_obj = new stdClass();
1741 1954
 		$trigger_obj->user_id = $user_id;
1742 1955
 		$trigger_obj->password = $password;
1743 1956
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1744
-		if(!$trigger_output->toBool()) return $trigger_output;
1957
+		if(!$trigger_output->toBool()) {
1958
+			return $trigger_output;
1959
+		}
1745 1960
 		// Create a member model object
1746 1961
 		$oMemberModel = getModel('member');
1747 1962
 
@@ -1756,15 +1971,18 @@  discard block
 block discarded – undo
1756 1971
 			// Get user_id information
1757 1972
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1758 1973
 			// Set an invalid user if no value returned
1759
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1974
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
1975
+				return $this->recordLoginError(-1, 'invalid_email_address');
1976
+			}
1760 1977
 
1761
-		}
1762
-		else
1978
+		} else
1763 1979
 		{
1764 1980
 			// Get user_id information
1765 1981
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1766 1982
 			// Set an invalid user if no value returned
1767
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1983
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
1984
+				return $this->recordLoginError(-1, 'invalid_user_id');
1985
+			}
1768 1986
 		}
1769 1987
 
1770 1988
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1776,14 +1994,18 @@  discard block
 block discarded – undo
1776 1994
 			if($term < $config->max_error_count_time)
1777 1995
 			{
1778 1996
 				$term = $config->max_error_count_time - $term;
1779
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1780
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1781
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1782
-				else $term = intval($term/86400).Context::getLang('unit_day');
1997
+				if($term < 60) {
1998
+					$term = intval($term).Context::getLang('unit_sec');
1999
+				} elseif(60 <= $term && $term < 3600) {
2000
+					$term = intval($term/60).Context::getLang('unit_min');
2001
+				} elseif(3600 <= $term && $term < 86400) {
2002
+					$term = intval($term/3600).Context::getLang('unit_hour');
2003
+				} else {
2004
+					$term = intval($term/86400).Context::getLang('unit_day');
2005
+				}
1783 2006
 
1784 2007
 				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1785
-			}
1786
-			else
2008
+			} else
1787 2009
 			{
1788 2010
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1789 2011
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1810,7 +2032,9 @@  discard block
 block discarded – undo
1810 2032
 			return new BaseObject(-1,'msg_user_denied');
1811 2033
 		}
1812 2034
 		// Notify if denied_date is less than the current time
1813
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
2035
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
2036
+			return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
2037
+		}
1814 2038
 		// Update the latest login time
1815 2039
 		$args->member_srl = $this->memberInfo->member_srl;
1816 2040
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1859,7 +2083,9 @@  discard block
 block discarded – undo
1859 2083
 		}
1860 2084
 		// Call a trigger after successfully log-in (after)
1861 2085
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1862
-		if(!$trigger_output->toBool()) return $trigger_output;
2086
+		if(!$trigger_output->toBool()) {
2087
+			return $trigger_output;
2088
+		}
1863 2089
 		// When user checked to use auto-login
1864 2090
 		if($keep_signed)
1865 2091
 		{
@@ -1873,7 +2099,9 @@  discard block
 block discarded – undo
1873 2099
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1874 2100
 			executeQuery('member.deleteAutologin', $autologin_args);
1875 2101
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1876
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2102
+			if($autologin_output->toBool()) {
2103
+				setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2104
+			}
1877 2105
 		}
1878 2106
 		if($this->memberInfo->is_admin == 'Y')
1879 2107
 		{
@@ -1962,7 +2190,9 @@  discard block
 block discarded – undo
1962 2190
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1963 2191
 	{
1964 2192
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1965
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2193
+		if(!is_array($member_popup_menu_list)) {
2194
+			$member_popup_menu_list = array();
2195
+		}
1966 2196
 
1967 2197
 		$obj = new stdClass;
1968 2198
 		$obj->url = $url;
@@ -1981,35 +2211,54 @@  discard block
 block discarded – undo
1981 2211
 	{
1982 2212
 		// Call a trigger (before)
1983 2213
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1984
-		if(!$output->toBool()) return $output;
2214
+		if(!$output->toBool()) {
2215
+			return $output;
2216
+		}
1985 2217
 		// Terms and Conditions portion of the information set up by members reaffirmed
1986 2218
 		$oModuleModel = getModel('module');
1987 2219
 		$config = $oModuleModel->getModuleConfig('member');
1988 2220
 
1989 2221
 		$logged_info = Context::get('logged_info');
1990 2222
 		// If the date of the temporary restrictions limit further information on the date of
1991
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2223
+		if($config->limit_day) {
2224
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2225
+		}
1992 2226
 
1993 2227
 		$args->member_srl = getNextSequence();
1994 2228
 		$args->list_order = -1 * $args->member_srl;
1995 2229
 
1996 2230
 		// Execute insert or update depending on the value of member_srl
1997
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2231
+		if(!$args->user_id) {
2232
+			$args->user_id = 't'.$args->member_srl;
2233
+		}
1998 2234
 		// Enter the user's identity changed to lowercase
1999
-		else $args->user_id = strtolower($args->user_id);
2000
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2001
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2235
+		else {
2236
+			$args->user_id = strtolower($args->user_id);
2237
+		}
2238
+		if(!$args->user_name) {
2239
+			$args->user_name = $args->member_srl;
2240
+		}
2241
+		if(!$args->nick_name) {
2242
+			$args->nick_name = $args->member_srl;
2243
+		}
2002 2244
 
2003 2245
 		// Control of essential parameters
2004
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2005
-		if($args->denied!='Y') $args->denied = 'N';
2006
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2246
+		if($args->allow_mailing!='Y') {
2247
+			$args->allow_mailing = 'N';
2248
+		}
2249
+		if($args->denied!='Y') {
2250
+			$args->denied = 'N';
2251
+		}
2252
+		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) {
2253
+			$args->allow_message = 'Y';
2254
+		}
2007 2255
 
2008 2256
 		if($logged_info->is_admin == 'Y')
2009 2257
 		{
2010
-			if($args->is_admin!='Y') $args->is_admin = 'N';
2011
-		}
2012
-		else
2258
+			if($args->is_admin!='Y') {
2259
+				$args->is_admin = 'N';
2260
+			}
2261
+		} else
2013 2262
 		{
2014 2263
 			unset($args->is_admin);
2015 2264
 		}
@@ -2022,8 +2271,12 @@  discard block
 block discarded – undo
2022 2271
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2023 2272
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2024 2273
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2025
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2026
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2274
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2275
+			$args->homepage = 'http://'.$args->homepage;
2276
+		}
2277
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2278
+			$args->blog = 'http://'.$args->blog;
2279
+		}
2027 2280
 
2028 2281
 		// Create a model object
2029 2282
 		$oMemberModel = getModel('member');
@@ -2037,8 +2290,7 @@  discard block
 block discarded – undo
2037 2290
 				return new BaseObject(-1, $message[$config->password_strength]);
2038 2291
 			}
2039 2292
 			$args->password = $oMemberModel->hashPassword($args->password);
2040
-		}
2041
-		elseif(!$args->password)
2293
+		} elseif(!$args->password)
2042 2294
 		{
2043 2295
 			unset($args->password);
2044 2296
 		}
@@ -2046,8 +2298,7 @@  discard block
 block discarded – undo
2046 2298
 		if($args->find_account_answer && !$password_is_hashed)
2047 2299
 		{
2048 2300
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2049
-		}
2050
-		elseif(!$args->find_account_answer)
2301
+		} elseif(!$args->find_account_answer)
2051 2302
 		{
2052 2303
 			unset($args->find_account_answer);
2053 2304
 		}
@@ -2088,8 +2339,12 @@  discard block
 block discarded – undo
2088 2339
 		// Insert data into the DB
2089 2340
 		$args->list_order = -1 * $args->member_srl;
2090 2341
 
2091
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2092
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2342
+		if(!$args->user_id) {
2343
+			$args->user_id = 't'.$args->member_srl;
2344
+		}
2345
+		if(!$args->user_name) {
2346
+			$args->user_name = $args->member_srl;
2347
+		}
2093 2348
 
2094 2349
 		$oDB = &DB::getInstance();
2095 2350
 		$oDB->begin();
@@ -2101,8 +2356,11 @@  discard block
 block discarded – undo
2101 2356
 			return $output;
2102 2357
 		}
2103 2358
 
2104
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2105
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2359
+		if(is_array($args->group_srl_list)) {
2360
+			$group_srl_list = $args->group_srl_list;
2361
+		} else {
2362
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2363
+		}
2106 2364
 		// If no value is entered the default group, the value of group registration
2107 2365
 		if(!$args->group_srl_list)
2108 2366
 		{
@@ -2119,8 +2377,7 @@  discard block
 block discarded – undo
2119 2377
 				}
2120 2378
 			}
2121 2379
 			// If the value is the value of the group entered the group registration
2122
-		}
2123
-		else
2380
+		} else
2124 2381
 		{
2125 2382
 			for($i=0;$i<count($group_srl_list);$i++)
2126 2383
 			{
@@ -2181,27 +2438,39 @@  discard block
 block discarded – undo
2181 2438
 	{
2182 2439
 		// Call a trigger (before)
2183 2440
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2184
-		if(!$output->toBool()) return $output;
2441
+		if(!$output->toBool()) {
2442
+			return $output;
2443
+		}
2185 2444
 		// Create a model object
2186 2445
 		$oMemberModel = getModel('member');
2187 2446
 
2188 2447
 		$logged_info = Context::get('logged_info');
2189 2448
 		// Get what you want to modify the original information
2190
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2449
+		if(!$this->memberInfo) {
2450
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2451
+		}
2191 2452
 		// Control of essential parameters
2192
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2193
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2453
+		if($args->allow_mailing!='Y') {
2454
+			$args->allow_mailing = 'N';
2455
+		}
2456
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2457
+			$args->allow_message = 'Y';
2458
+		}
2194 2459
 
2195 2460
 		if($logged_info->is_admin == 'Y')
2196 2461
 		{
2197
-			if($args->denied!='Y') $args->denied = 'N';
2198
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2199
-		}
2200
-		else
2462
+			if($args->denied!='Y') {
2463
+				$args->denied = 'N';
2464
+			}
2465
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2466
+				$args->is_admin = 'N';
2467
+			}
2468
+		} else
2201 2469
 		{
2202 2470
 			unset($args->is_admin);
2203
-			if($is_admin == false)
2204
-				unset($args->denied);
2471
+			if($is_admin == false) {
2472
+							unset($args->denied);
2473
+			}
2205 2474
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2206 2475
 			{
2207 2476
 				return $this->stop('msg_invalid_request');
@@ -2209,13 +2478,19 @@  discard block
 block discarded – undo
2209 2478
 		}
2210 2479
 
2211 2480
 		// Sanitize user ID, username, nickname, homepage, blog
2212
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2481
+		if($args->user_id) {
2482
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2483
+		}
2213 2484
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2214 2485
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2215 2486
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2216 2487
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2217
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2218
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2488
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2489
+			$args->homepage = 'http://'.$args->homepage;
2490
+		}
2491
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2492
+			$args->blog = 'http://'.$args->blog;
2493
+		}
2219 2494
 
2220 2495
 		// check member identifier form
2221 2496
 		$config = $oMemberModel->getMemberConfig();
@@ -2232,8 +2507,7 @@  discard block
 block discarded – undo
2232 2507
 				return new BaseObject(-1,'msg_exists_email_address');
2233 2508
 			}
2234 2509
 			$args->email_address = $orgMemberInfo->email_address;
2235
-		}
2236
-		else
2510
+		} else
2237 2511
 		{
2238 2512
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2239 2513
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2290,16 +2564,14 @@  discard block
 block discarded – undo
2290 2564
 				return new BaseObject(-1, $message[$config->password_strength]);
2291 2565
 			}
2292 2566
 			$args->password = $oMemberModel->hashPassword($args->password);
2293
-		}
2294
-		else
2567
+		} else
2295 2568
 		{
2296 2569
 			$args->password = $orgMemberInfo->password;
2297 2570
 		}
2298 2571
 
2299 2572
 		if($args->find_account_answer) {
2300 2573
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2301
-		}
2302
-		else
2574
+		} else
2303 2575
 		{
2304 2576
 			$oPassword =  new Password();
2305 2577
 			$hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer);
@@ -2311,11 +2583,21 @@  discard block
 block discarded – undo
2311 2583
 			}
2312 2584
 		}
2313 2585
 
2314
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2315
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2316
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2317
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2318
-		if(!$args->birthday) $args->birthday = '';
2586
+		if(!$args->user_name) {
2587
+			$args->user_name = $orgMemberInfo->user_name;
2588
+		}
2589
+		if(!$args->user_id) {
2590
+			$args->user_id = $orgMemberInfo->user_id;
2591
+		}
2592
+		if(!$args->nick_name) {
2593
+			$args->nick_name = $orgMemberInfo->nick_name;
2594
+		}
2595
+		if(!$args->description) {
2596
+			$args->description = $orgMemberInfo->description;
2597
+		}
2598
+		if(!$args->birthday) {
2599
+			$args->birthday = '';
2600
+		}
2319 2601
 
2320 2602
 		$output = executeQuery('member.updateMember', $args);
2321 2603
 
@@ -2327,8 +2609,11 @@  discard block
 block discarded – undo
2327 2609
 
2328 2610
 		if($args->group_srl_list)
2329 2611
 		{
2330
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2331
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2612
+			if(is_array($args->group_srl_list)) {
2613
+				$group_srl_list = $args->group_srl_list;
2614
+			} else {
2615
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2616
+			}
2332 2617
 			// If the group information, group information changes
2333 2618
 			if(count($group_srl_list) > 0)
2334 2619
 			{
@@ -2371,7 +2656,9 @@  discard block
 block discarded – undo
2371 2656
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2372 2657
 
2373 2658
 		// Save Session
2374
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2659
+		if(!$this->memberInfo) {
2660
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2661
+		}
2375 2662
 		$logged_info = Context::get('logged_info');
2376 2663
 
2377 2664
 		$output->add('member_srl', $args->member_srl);
@@ -2397,8 +2684,7 @@  discard block
 block discarded – undo
2397 2684
 			}
2398 2685
 
2399 2686
 			$args->password = $oMemberModel->hashPassword($args->password);
2400
-		}
2401
-		else if($args->hashed_password)
2687
+		} else if($args->hashed_password)
2402 2688
 		{
2403 2689
 			$args->password = $args->hashed_password;
2404 2690
 		}
@@ -2433,7 +2719,9 @@  discard block
 block discarded – undo
2433 2719
 		$trigger_obj = new stdClass();
2434 2720
 		$trigger_obj->member_srl = $member_srl;
2435 2721
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2436
-		if(!$output->toBool()) return $output;
2722
+		if(!$output->toBool()) {
2723
+			return $output;
2724
+		}
2437 2725
 		// Create a model object
2438 2726
 		$oMemberModel = getModel('member');
2439 2727
 		// Bringing the user's information
@@ -2442,9 +2730,13 @@  discard block
 block discarded – undo
2442 2730
 			$columnList = array('member_srl', 'is_admin');
2443 2731
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2444 2732
 		}
2445
-		if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2733
+		if(!$this->memberInfo) {
2734
+			return new BaseObject(-1, 'msg_not_exists_member');
2735
+		}
2446 2736
 		// If managers can not be deleted
2447
-		if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2737
+		if($this->memberInfo->is_admin == 'Y') {
2738
+			return new BaseObject(-1, 'msg_cannot_delete_admin');
2739
+		}
2448 2740
 
2449 2741
 		$oDB = &DB::getInstance();
2450 2742
 		$oDB->begin();
@@ -2508,7 +2800,9 @@  discard block
 block discarded – undo
2508 2800
 	 */
2509 2801
 	function destroySessionInfo()
2510 2802
 	{
2511
-		if(!$_SESSION || !is_array($_SESSION)) return;
2803
+		if(!$_SESSION || !is_array($_SESSION)) {
2804
+			return;
2805
+		}
2512 2806
 
2513 2807
 		$memberInfo = Context::get('logged_info');
2514 2808
 		$memberSrl = $memberInfo->member_srl;
@@ -2547,8 +2841,9 @@  discard block
 block discarded – undo
2547 2841
 		}
2548 2842
 		$maxLevel = 0;
2549 2843
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2550
-		if(count($resultGroup) > 0)
2551
-			$maxLevel = max(array_flip($resultGroup));
2844
+		if(count($resultGroup) > 0) {
2845
+					$maxLevel = max(array_flip($resultGroup));
2846
+		}
2552 2847
 
2553 2848
 		if($maxLevel > 0)
2554 2849
 		{
@@ -2565,16 +2860,22 @@  discard block
 block discarded – undo
2565 2860
 
2566 2861
 	function procMemberModifyEmailAddress()
2567 2862
 	{
2568
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2863
+		if(!Context::get('is_logged')) {
2864
+			return $this->stop('msg_not_logged');
2865
+		}
2569 2866
 
2570 2867
 		$member_info = Context::get('logged_info');
2571 2868
 		$newEmail = Context::get('email_address');
2572 2869
 
2573
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2870
+		if(!$newEmail) {
2871
+			return $this->stop('msg_invalid_request');
2872
+		}
2574 2873
 
2575 2874
 		$oMemberModel = getModel('member');
2576 2875
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2577
-		if($member_srl) return new BaseObject(-1,'msg_exists_email_address');
2876
+		if($member_srl) {
2877
+			return new BaseObject(-1,'msg_exists_email_address');
2878
+		}
2578 2879
 
2579 2880
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2580 2881
 		{
@@ -2602,7 +2903,9 @@  discard block
 block discarded – undo
2602 2903
 		$member_config = $oModuleModel->getModuleConfig('member');
2603 2904
 
2604 2905
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2605
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2906
+		if(!is_dir($tpl_path)) {
2907
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2908
+		}
2606 2909
 
2607 2910
 		global $lang;
2608 2911
 
@@ -2638,7 +2941,9 @@  discard block
 block discarded – undo
2638 2941
 	{
2639 2942
 		$member_srl = Context::get('member_srl');
2640 2943
 		$auth_key = Context::get('auth_key');
2641
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2944
+		if(!$member_srl || !$auth_key) {
2945
+			return $this->stop('msg_invalid_request');
2946
+		}
2642 2947
 
2643 2948
 		// Test logs for finding password by user_id and authkey
2644 2949
 		$args = new stdClass;
@@ -2647,7 +2952,9 @@  discard block
 block discarded – undo
2647 2952
 		$output = executeQuery('member.getAuthMail', $args);
2648 2953
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2649 2954
 		{
2650
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2955
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
2956
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
2957
+			}
2651 2958
 			return $this->stop('msg_invalid_modify_email_auth_key');
2652 2959
 		}
2653 2960
 
@@ -2656,7 +2963,9 @@  discard block
 block discarded – undo
2656 2963
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2657 2964
 
2658 2965
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2659
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2966
+		if(!$output->toBool()) {
2967
+			return $this->stop($output->getMessage());
2968
+		}
2660 2969
 
2661 2970
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2662 2971
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2677,7 +2986,9 @@  discard block
 block discarded – undo
2677 2986
 	**/
2678 2987
 	function triggerGetDocumentMenu(&$menu_list)
2679 2988
 	{
2680
-		if(!Context::get('is_logged')) return new BaseObject();
2989
+		if(!Context::get('is_logged')) {
2990
+			return new BaseObject();
2991
+		}
2681 2992
 
2682 2993
 		$logged_info = Context::get('logged_info');
2683 2994
 		$document_srl = Context::get('target_srl');
@@ -2688,8 +2999,12 @@  discard block
 block discarded – undo
2688 2999
 		$member_srl = $oDocument->get('member_srl');
2689 3000
 		$module_srl = $oDocument->get('module_srl');
2690 3001
 
2691
-		if(!$member_srl) return new BaseObject();
2692
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
3002
+		if(!$member_srl) {
3003
+			return new BaseObject();
3004
+		}
3005
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
3006
+			return new BaseObject();
3007
+		}
2693 3008
 
2694 3009
 		$oDocumentController = getController('document');
2695 3010
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2707,7 +3022,9 @@  discard block
 block discarded – undo
2707 3022
 	**/
2708 3023
 	function triggerGetCommentMenu(&$menu_list)
2709 3024
 	{
2710
-		if(!Context::get('is_logged')) return new BaseObject();
3025
+		if(!Context::get('is_logged')) {
3026
+			return new BaseObject();
3027
+		}
2711 3028
 
2712 3029
 		$logged_info = Context::get('logged_info');
2713 3030
 		$comment_srl = Context::get('target_srl');
@@ -2718,8 +3035,12 @@  discard block
 block discarded – undo
2718 3035
 		$module_srl = $oComment->get('module_srl');
2719 3036
 		$member_srl = $oComment->get('member_srl');
2720 3037
 
2721
-		if(!$member_srl) return new BaseObject();
2722
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
3038
+		if(!$member_srl) {
3039
+			return new BaseObject();
3040
+		}
3041
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
3042
+			return new BaseObject();
3043
+		}
2723 3044
 
2724 3045
 		$oCommentController = getController('comment');
2725 3046
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2735,7 +3056,9 @@  discard block
 block discarded – undo
2735 3056
 	**/
2736 3057
 	function procMemberSpammerManage()
2737 3058
 	{
2738
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
3059
+		if(!Context::get('is_logged')) {
3060
+			return new BaseObject(-1,'msg_not_permitted');
3061
+		}
2739 3062
 
2740 3063
 		$logged_info = Context::get('logged_info');
2741 3064
 		$member_srl = Context::get('member_srl');
@@ -2743,8 +3066,9 @@  discard block
 block discarded – undo
2743 3066
 		$cnt_loop = Context::get('cnt_loop');
2744 3067
 		$proc_type = Context::get('proc_type');
2745 3068
 		$isMoveToTrash = true;
2746
-		if($proc_type == "delete")
2747
-			$isMoveToTrash = false;
3069
+		if($proc_type == "delete") {
3070
+					$isMoveToTrash = false;
3071
+		}
2748 3072
 
2749 3073
 		// check grant
2750 3074
 		$oModuleModel = getModel('module');
@@ -2752,7 +3076,9 @@  discard block
 block discarded – undo
2752 3076
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2753 3077
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2754 3078
 
2755
-		if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
3079
+		if(!$grant->manager) {
3080
+			return new BaseObject(-1,'msg_not_permitted');
3081
+		}
2756 3082
 
2757 3083
 		$proc_msg = "";
2758 3084
 
@@ -2761,11 +3087,13 @@  discard block
 block discarded – undo
2761 3087
 
2762 3088
 		// delete or trash destination
2763 3089
 		// proc member
2764
-		if($cnt_loop == 1)
2765
-			$this->_spammerMember($member_srl);
3090
+		if($cnt_loop == 1) {
3091
+					$this->_spammerMember($member_srl);
3092
+		}
2766 3093
 		// proc document and comment
2767
-		elseif($cnt_loop>1)
2768
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
3094
+		elseif($cnt_loop>1) {
3095
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
3096
+		}
2769 3097
 
2770 3098
 		// get destination count
2771 3099
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2773,13 +3101,16 @@  discard block
 block discarded – undo
2773 3101
 
2774 3102
 		$total_count = Context::get('total_count');
2775 3103
 		$remain_count = $cnt_document + $cnt_comment;
2776
-		if($cnt_loop == 1) $total_count = $remain_count;
3104
+		if($cnt_loop == 1) {
3105
+			$total_count = $remain_count;
3106
+		}
2777 3107
 
2778 3108
 		// get progress percent
2779
-		if($total_count > 0)
2780
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2781
-		else
2782
-			$progress = 100;
3109
+		if($total_count > 0) {
3110
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
3111
+		} else {
3112
+					$progress = 100;
3113
+		}
2783 3114
 
2784 3115
 		$this->add('total_count', $total_count);
2785 3116
 		$this->add('remain_count', $remain_count);
@@ -2821,7 +3152,10 @@  discard block
 block discarded – undo
2821 3152
 		$args->nick_name = $member_info->nick_name;
2822 3153
 		$args->denied = "Y";
2823 3154
 		$args->description = trim( $member_info->description );
2824
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3155
+		if( $args->description != "" ) {
3156
+			$args->description .= "\n";
3157
+		}
3158
+		// add new line
2825 3159
 
2826 3160
 		$args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]";
2827 3161
 
@@ -2866,8 +3200,11 @@  discard block
 block discarded – undo
2866 3200
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2867 3201
 			if($documentList) {
2868 3202
 				foreach($documentList as $v) {
2869
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2870
-					else $oDocumentController->deleteDocument($v->document_srl);
3203
+					if($isMoveToTrash) {
3204
+						$oDocumentController->moveDocumentToTrash($v);
3205
+					} else {
3206
+						$oDocumentController->deleteDocument($v->document_srl);
3207
+					}
2871 3208
 				}
2872 3209
 			}
2873 3210
 		}
Please login to merge, or discard this patch.
modules/member/member.view.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -637,7 +637,7 @@
 block discarded – undo
637 637
 	/**
638 638
 	 * Spammer manage popup
639 639
 	 * 
640
-	 * @return void
640
+	 * @return BaseObject|null
641 641
 	**/
642 642
 	function dispMemberSpammer()
643 643
 	{
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -638,7 +638,7 @@
 block discarded – undo
638 638
 	 * Spammer manage popup
639 639
 	 * 
640 640
 	 * @return void
641
-	**/
641
+	 **/
642 642
 	function dispMemberSpammer()
643 643
 	{
644 644
 		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 		$skin = $this->member_config->skin;
27 27
 		// Set the template path
28
-		if(!$skin)
28
+		if (!$skin)
29 29
 		{
30 30
 			$skin = 'default';
31 31
 			$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 		$oLayoutModel = getModel('layout');
50 50
 		$layout_info = $oLayoutModel->getLayout($this->member_config->layout_srl);
51
-		if($layout_info)
51
+		if ($layout_info)
52 52
 		{
53 53
 			$this->module_info->layout_srl = $this->member_config->layout_srl;
54 54
 			$this->setLayoutPath($layout_info->path);
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 		$oMemberModel = getModel('member');
64 64
 		$logged_info = Context::get('logged_info');
65 65
 		// Don't display member info to non-logged user
66
-		if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
66
+		if (!$logged_info->member_srl) return $this->stop('msg_not_permitted');
67 67
 
68 68
 		$member_srl = Context::get('member_srl');
69
-		if(!$member_srl && Context::get('is_logged'))
69
+		if (!$member_srl && Context::get('is_logged'))
70 70
 		{
71 71
 			$member_srl = $logged_info->member_srl;
72 72
 		}
73
-		elseif(!$member_srl)
73
+		elseif (!$member_srl)
74 74
 		{
75 75
 			return $this->dispMemberSignUpForm();
76 76
 		}
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 		unset($member_info->email_id);
83 83
 		unset($member_info->email_host);
84 84
 
85
-		if($logged_info->is_admin != 'Y' && ($member_info->member_srl != $logged_info->member_srl))
85
+		if ($logged_info->is_admin != 'Y' && ($member_info->member_srl != $logged_info->member_srl))
86 86
 		{
87
-			$start = strpos($member_info->email_address, '@')+1;
87
+			$start = strpos($member_info->email_address, '@') + 1;
88 88
 			$replaceStr = str_repeat('*', (strlen($member_info->email_address) - $start));
89 89
 			$member_info->email_address = substr_replace($member_info->email_address, $replaceStr, $start);
90 90
 		}
91 91
 
92
-		if(!$member_info->member_srl) return $this->dispMemberSignUpForm();
92
+		if (!$member_info->member_srl) return $this->dispMemberSignUpForm();
93 93
 
94 94
 		Context::set('memberInfo', get_object_vars($member_info));
95 95
 
@@ -107,46 +107,46 @@  discard block
 block discarded – undo
107 107
 	{
108 108
 		$logged_info = Context::get('logged_info');
109 109
 		$displayDatas = array();
110
-		foreach($memberConfig->signupForm as $no=>$formInfo)
110
+		foreach ($memberConfig->signupForm as $no=>$formInfo)
111 111
 		{
112
-			if(!$formInfo->isUse)
112
+			if (!$formInfo->isUse)
113 113
 			{
114 114
 				continue;
115 115
 			}
116 116
 
117
-			if($formInfo->name == 'password' || $formInfo->name == 'find_account_question')
117
+			if ($formInfo->name == 'password' || $formInfo->name == 'find_account_question')
118 118
 			{
119 119
 				continue;
120 120
 			}
121 121
 
122
-			if($logged_info->is_admin != 'Y' && $memberInfo->member_srl != $logged_info->member_srl && $formInfo->isPublic != 'Y')
122
+			if ($logged_info->is_admin != 'Y' && $memberInfo->member_srl != $logged_info->member_srl && $formInfo->isPublic != 'Y')
123 123
 			{
124 124
 				continue;
125 125
 			}
126 126
 
127 127
 			$item = $formInfo;
128 128
 
129
-			if($formInfo->isDefaultForm)
129
+			if ($formInfo->isDefaultForm)
130 130
 			{
131 131
 				$item->title = Context::getLang($formInfo->name);
132 132
 				$item->value = $memberInfo->{$formInfo->name};
133 133
 
134
-				if($formInfo->name == 'profile_image' && $memberInfo->profile_image)
134
+				if ($formInfo->name == 'profile_image' && $memberInfo->profile_image)
135 135
 				{
136 136
 					$target = $memberInfo->profile_image;
137 137
 					$item->value = '<img src="'.$target->src.'" />';
138 138
 				}
139
-				elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
139
+				elseif ($formInfo->name == 'image_name' && $memberInfo->image_name)
140 140
 				{
141 141
 					$target = $memberInfo->image_name;
142 142
 					$item->value = '<img src="'.$target->src.'" />';
143 143
 				}
144
-				elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
144
+				elseif ($formInfo->name == 'image_mark' && $memberInfo->image_mark)
145 145
 				{
146 146
 					$target = $memberInfo->image_mark;
147 147
 					$item->value = '<img src="'.$target->src.'" />';
148 148
 				}
149
-				elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
149
+				elseif ($formInfo->name == 'birthday' && $memberInfo->birthday)
150 150
 				{
151 151
 					$item->value = zdate($item->value, 'Y-m-d');
152 152
 				}
@@ -155,19 +155,19 @@  discard block
 block discarded – undo
155 155
 			{
156 156
 				$item->title = $extendFormInfo[$formInfo->member_join_form_srl]->column_title;
157 157
 				$orgValue = $extendFormInfo[$formInfo->member_join_form_srl]->value;
158
-				if($formInfo->type=='tel' && is_array($orgValue))
158
+				if ($formInfo->type == 'tel' && is_array($orgValue))
159 159
 				{
160 160
 					$item->value = implode('-', $orgValue);
161 161
 				}
162
-				elseif($formInfo->type=='kr_zip' && is_array($orgValue))
162
+				elseif ($formInfo->type == 'kr_zip' && is_array($orgValue))
163 163
 				{
164 164
 					$item->value = implode(' ', $orgValue);
165 165
 				}
166
-				elseif($formInfo->type=='checkbox' && is_array($orgValue))
166
+				elseif ($formInfo->type == 'checkbox' && is_array($orgValue))
167 167
 				{
168
-					$item->value = implode(", ",$orgValue);
168
+					$item->value = implode(", ", $orgValue);
169 169
 				}
170
-				elseif($formInfo->type=='date')
170
+				elseif ($formInfo->type == 'date')
171 171
 				{
172 172
 					$item->value = zdate($orgValue, "Y-m-d");
173 173
 				}
@@ -198,12 +198,12 @@  discard block
 block discarded – undo
198 198
 
199 199
 		$oMemberModel = getModel('member');
200 200
 		// Get the member information if logged-in
201
-		if($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
201
+		if ($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
202 202
 		// call a trigger (before) 
203 203
 		$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $member_config);
204
-		if(!$trigger_output->toBool()) return $trigger_output;
204
+		if (!$trigger_output->toBool()) return $trigger_output;
205 205
 		// Error appears if the member is not allowed to join
206
-		if($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
206
+		if ($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
207 207
 
208 208
 		$oMemberAdminView = getAdminView('member');
209 209
 		$formTags = $oMemberAdminView->_getMemberInputTag($member_info);
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	{
227 227
 		$logged_info = Context::get('logged_info');
228 228
 		$oMemberModel = getModel('member');
229
-		if(!$oMemberModel->isLogged() || empty($logged_info))
229
+		if (!$oMemberModel->isLogged() || empty($logged_info))
230 230
 		{
231 231
 			return $this->stop('msg_not_logged');
232 232
 		}
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		$_SESSION['rechecked_password_step'] = 'INPUT_PASSWORD';
235 235
 
236 236
 		$templateFile = $this->getTemplatePath().'rechecked_password.html';
237
-		if(!is_readable($templateFile))
237
+		if (!is_readable($templateFile))
238 238
 		{
239 239
 			$templatePath = sprintf('%sskins/default', $this->module_path);
240 240
 			$this->setTemplatePath($templatePath);
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	 */
260 260
 	function dispMemberModifyInfo() 
261 261
 	{
262
-		if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
262
+		if ($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
263 263
 		{
264 264
 			$this->dispMemberModifyInfoBefore();
265 265
 			return;
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
 		$oMemberModel = getModel('member');
273 273
 		// A message appears if the user is not logged-in
274
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
274
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
275 275
 
276 276
 		$logged_info = Context::get('logged_info');
277 277
 		$member_srl = $logged_info->member_srl;
@@ -279,13 +279,13 @@  discard block
 block discarded – undo
279 279
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address', 'find_account_answer', 'homepage', 'blog', 'birthday', 'allow_mailing');
280 280
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
281 281
 		$member_info->signature = $oMemberModel->getSignature($member_srl);
282
-		Context::set('member_info',$member_info);
282
+		Context::set('member_info', $member_info);
283 283
 
284 284
 		// Get a list of extend join form
285 285
 		Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info));
286 286
 
287 287
 		// Editor of the module set for signing by calling getEditor
288
-		if($member_info->member_srl)
288
+		if ($member_info->member_srl)
289 289
 		{
290 290
 			$oEditorModel = getModel('editor');
291 291
 			$option = new stdClass();
@@ -330,15 +330,15 @@  discard block
 block discarded – undo
330 330
 	{
331 331
 		$oMemberModel = getModel('member');
332 332
 		// A message appears if the user is not logged-in
333
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
333
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
334 334
 
335 335
 		$logged_info = Context::get('logged_info');
336 336
 		$member_srl = $logged_info->member_srl;
337 337
 
338 338
 		$module_srl = Context::get('module_srl');
339
-		Context::set('module_srl',Context::get('selected_module_srl'));
340
-		Context::set('search_target','member_srl');
341
-		Context::set('search_keyword',$member_srl);
339
+		Context::set('module_srl', Context::get('selected_module_srl'));
340
+		Context::set('search_target', 'member_srl');
341
+		Context::set('search_keyword', $member_srl);
342 342
 
343 343
 		$oDocumentAdminView = getAdminView('document');
344 344
 		$oDocumentAdminView->dispDocumentAdminList();
@@ -357,12 +357,12 @@  discard block
 block discarded – undo
357 357
 	{
358 358
 		$oMemberModel = getModel('member');
359 359
 		// A message appears if the user is not logged-in
360
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
360
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
361 361
 
362 362
 		$logged_info = Context::get('logged_info');
363 363
 		$args = new stdClass();
364 364
 		$args->member_srl = $logged_info->member_srl;
365
-		$args->page = (int)Context::get('page');
365
+		$args->page = (int) Context::get('page');
366 366
 
367 367
 		$output = executeQuery('member.getScrapDocumentList', $args);
368 368
 		Context::set('total_count', $output->total_count);
@@ -384,12 +384,12 @@  discard block
 block discarded – undo
384 384
 	{
385 385
 		$oMemberModel = getModel('member');
386 386
 		// A message appears if the user is not logged-in
387
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
387
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
388 388
 		// Get the saved document(module_srl is set to member_srl instead)
389 389
 		$logged_info = Context::get('logged_info');
390 390
 		$args = new stdClass();
391 391
 		$args->member_srl = $logged_info->member_srl;
392
-		$args->page = (int)Context::get('page');
392
+		$args->page = (int) Context::get('page');
393 393
 		$args->statusList = array('TEMP');
394 394
 
395 395
 		$oDocumentModel = getModel('document');
@@ -408,9 +408,9 @@  discard block
 block discarded – undo
408 408
 	 */
409 409
 	function dispMemberLoginForm()
410 410
 	{
411
-		if(Context::get('is_logged'))
411
+		if (Context::get('is_logged'))
412 412
 		{
413
-			Context::set('redirect_url', getNotEncodedUrl('act',''));
413
+			Context::set('redirect_url', getNotEncodedUrl('act', ''));
414 414
 			$this->setTemplatePath($this->module_path.'tpl');
415 415
 			$this->setTemplateFile('redirect.html');
416 416
 			return;
@@ -423,10 +423,10 @@  discard block
 block discarded – undo
423 423
 
424 424
 		$XE_VALIDATOR_MESSAGE = Context::get('XE_VALIDATOR_MESSAGE');
425 425
 		$XE_VALIDATOR_ERROR = Context::get('XE_VALIDATOR_ERROR');
426
-		if($XE_VALIDATOR_ERROR == -11)
427
-			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
426
+		if ($XE_VALIDATOR_ERROR == -11)
427
+			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE.$config->limit_day_description);
428 428
 
429
-		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
429
+		if ($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
430 430
 			Context::set('referer_url', getUrl('')); 
431 431
 		else
432 432
 			Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 	{
443 443
 		$oMemberModel = getModel('member');
444 444
 		// A message appears if the user is not logged-in
445
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
445
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
446 446
 
447 447
 		$memberConfig = $this->member_config;
448 448
 
@@ -451,9 +451,9 @@  discard block
 block discarded – undo
451 451
 
452 452
 		$columnList = array('member_srl', 'user_id');
453 453
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
454
-		Context::set('member_info',$member_info);
454
+		Context::set('member_info', $member_info);
455 455
 
456
-		if($memberConfig->identifier == 'user_id')
456
+		if ($memberConfig->identifier == 'user_id')
457 457
 		{
458 458
 			Context::set('identifier', 'user_id');
459 459
 			Context::set('formValue', $member_info->user_id);
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 	{
475 475
 		$oMemberModel = getModel('member');
476 476
 		// A message appears if the user is not logged-in
477
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
477
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
478 478
 
479 479
 		$memberConfig = $this->member_config;
480 480
 
@@ -482,9 +482,9 @@  discard block
 block discarded – undo
482 482
 		$member_srl = $logged_info->member_srl;
483 483
 
484 484
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
485
-		Context::set('member_info',$member_info);
485
+		Context::set('member_info', $member_info);
486 486
 
487
-		if($memberConfig->identifier == 'user_id')
487
+		if ($memberConfig->identifier == 'user_id')
488 488
 		{
489 489
 			Context::set('identifier', 'user_id');
490 490
 			Context::set('formValue', $member_info->user_id);
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 	{
506 506
 		$oMemberController = getController('member');
507 507
 		$output = $oMemberController->procMemberLogout();
508
-		if(!$output->redirect_url)
508
+		if (!$output->redirect_url)
509 509
 			$this->setRedirectUrl(getNotEncodedUrl('act', ''));
510 510
 		else
511 511
 			$this->setRedirectUrl($output->redirect_url);
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 	 */
528 528
 	function dispMemberFindAccount()
529 529
 	{
530
-		if(Context::get('is_logged')) return $this->stop('already_logged');
530
+		if (Context::get('is_logged')) return $this->stop('already_logged');
531 531
 
532 532
 		$config = $this->member_config;
533 533
 
@@ -541,13 +541,13 @@  discard block
 block discarded – undo
541 541
 	 */
542 542
 	function dispMemberGetTempPassword()
543 543
 	{
544
-		if(Context::get('is_logged')) return $this->stop('already_logged');
544
+		if (Context::get('is_logged')) return $this->stop('already_logged');
545 545
 
546 546
 		$user_id = Context::get('user_id');
547 547
 		$temp_password = $_SESSION['xe_temp_password_'.$user_id];
548 548
 		unset($_SESSION['xe_temp_password_'.$user_id]);
549 549
 
550
-		if(!$user_id||!$temp_password) return new BaseObject(-1,'msg_invaild_request');
550
+		if (!$user_id || !$temp_password) return new BaseObject(-1, 'msg_invaild_request');
551 551
 
552 552
 		Context::set('temp_password', $temp_password);
553 553
 
@@ -562,12 +562,12 @@  discard block
 block discarded – undo
562 562
 		$authMemberSrl = $_SESSION['auth_member_srl'];
563 563
 		unset($_SESSION['auth_member_srl']);
564 564
 
565
-		if(Context::get('is_logged')) 
565
+		if (Context::get('is_logged')) 
566 566
 		{
567 567
 			return $this->stop('already_logged');
568 568
 		}
569 569
 
570
-		if($authMemberSrl)
570
+		if ($authMemberSrl)
571 571
 		{
572 572
 			$oMemberModel = getModel('member');
573 573
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($authMemberSrl);
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 
585 585
 	function dispMemberModifyEmailAddress()
586 586
 	{
587
-		if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
587
+		if ($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
588 588
 		{
589 589
 			Context::set('success_return_url', getUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyEmailAddress'));
590 590
 			$this->dispMemberModifyInfoBefore();
@@ -612,10 +612,10 @@  discard block
 block discarded – undo
612 612
 		$js_code[] = 'if(!validator) return false;';
613 613
 
614 614
 		$errorLang = array();
615
-		foreach($extraList as $val) 
615
+		foreach ($extraList as $val) 
616 616
 		{
617 617
 			$title = str_ireplace(array('<script', '</script'), array('<scr"+"ipt', '</scr"+"ipt'), addslashes($val->column_title));
618
-			if($val->column_type == 'kr_zip' || $val->column_type == 'tel')
618
+			if ($val->column_type == 'kr_zip' || $val->column_type == 'tel')
619 619
 			{
620 620
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s[]","%s"]);', $val->column_name, $title);
621 621
 			}
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 	**/
642 642
 	function dispMemberSpammer()
643 643
 	{
644
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
644
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
645 645
 
646 646
 		$member_srl = Context::get('member_srl');
647 647
 		$module_srl = Context::get('module_srl');
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
653 653
 		$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
654 654
 
655
-		if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
655
+		if (!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
656 656
 
657 657
 		$oMemberModel = getModel('member');
658 658
 
Please login to merge, or discard this patch.
Braces   +77 added lines, -58 removed lines patch added patch discarded remove patch
@@ -29,16 +29,14 @@  discard block
 block discarded – undo
29 29
 		{
30 30
 			$skin = 'default';
31 31
 			$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
32
-		}
33
-		else
32
+		} else
34 33
 		{
35 34
 			//check theme
36 35
 			$config_parse = explode('|@|', $skin);
37 36
 			if (count($config_parse) > 1)
38 37
 			{
39 38
 				$template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]);
40
-			}
41
-			else
39
+			} else
42 40
 			{
43 41
 				$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
44 42
 			}
@@ -63,14 +61,15 @@  discard block
 block discarded – undo
63 61
 		$oMemberModel = getModel('member');
64 62
 		$logged_info = Context::get('logged_info');
65 63
 		// Don't display member info to non-logged user
66
-		if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
64
+		if(!$logged_info->member_srl) {
65
+			return $this->stop('msg_not_permitted');
66
+		}
67 67
 
68 68
 		$member_srl = Context::get('member_srl');
69 69
 		if(!$member_srl && Context::get('is_logged'))
70 70
 		{
71 71
 			$member_srl = $logged_info->member_srl;
72
-		}
73
-		elseif(!$member_srl)
72
+		} elseif(!$member_srl)
74 73
 		{
75 74
 			return $this->dispMemberSignUpForm();
76 75
 		}
@@ -89,7 +88,9 @@  discard block
 block discarded – undo
89 88
 			$member_info->email_address = substr_replace($member_info->email_address, $replaceStr, $start);
90 89
 		}
91 90
 
92
-		if(!$member_info->member_srl) return $this->dispMemberSignUpForm();
91
+		if(!$member_info->member_srl) {
92
+			return $this->dispMemberSignUpForm();
93
+		}
93 94
 
94 95
 		Context::set('memberInfo', get_object_vars($member_info));
95 96
 
@@ -135,43 +136,35 @@  discard block
 block discarded – undo
135 136
 				{
136 137
 					$target = $memberInfo->profile_image;
137 138
 					$item->value = '<img src="'.$target->src.'" />';
138
-				}
139
-				elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
139
+				} elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
140 140
 				{
141 141
 					$target = $memberInfo->image_name;
142 142
 					$item->value = '<img src="'.$target->src.'" />';
143
-				}
144
-				elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
143
+				} elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
145 144
 				{
146 145
 					$target = $memberInfo->image_mark;
147 146
 					$item->value = '<img src="'.$target->src.'" />';
148
-				}
149
-				elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
147
+				} elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
150 148
 				{
151 149
 					$item->value = zdate($item->value, 'Y-m-d');
152 150
 				}
153
-			}
154
-			else
151
+			} else
155 152
 			{
156 153
 				$item->title = $extendFormInfo[$formInfo->member_join_form_srl]->column_title;
157 154
 				$orgValue = $extendFormInfo[$formInfo->member_join_form_srl]->value;
158 155
 				if($formInfo->type=='tel' && is_array($orgValue))
159 156
 				{
160 157
 					$item->value = implode('-', $orgValue);
161
-				}
162
-				elseif($formInfo->type=='kr_zip' && is_array($orgValue))
158
+				} elseif($formInfo->type=='kr_zip' && is_array($orgValue))
163 159
 				{
164 160
 					$item->value = implode(' ', $orgValue);
165
-				}
166
-				elseif($formInfo->type=='checkbox' && is_array($orgValue))
161
+				} elseif($formInfo->type=='checkbox' && is_array($orgValue))
167 162
 				{
168 163
 					$item->value = implode(", ",$orgValue);
169
-				}
170
-				elseif($formInfo->type=='date')
164
+				} elseif($formInfo->type=='date')
171 165
 				{
172 166
 					$item->value = zdate($orgValue, "Y-m-d");
173
-				}
174
-				else
167
+				} else
175 168
 				{
176 169
 					$item->value = nl2br($orgValue);
177 170
 				}
@@ -198,12 +191,18 @@  discard block
 block discarded – undo
198 191
 
199 192
 		$oMemberModel = getModel('member');
200 193
 		// Get the member information if logged-in
201
-		if($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
194
+		if($oMemberModel->isLogged()) {
195
+			return $this->stop('msg_already_logged');
196
+		}
202 197
 		// call a trigger (before) 
203 198
 		$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $member_config);
204
-		if(!$trigger_output->toBool()) return $trigger_output;
199
+		if(!$trigger_output->toBool()) {
200
+			return $trigger_output;
201
+		}
205 202
 		// Error appears if the member is not allowed to join
206
-		if($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
203
+		if($member_config->enable_join != 'Y') {
204
+			return $this->stop('msg_signup_disabled');
205
+		}
207 206
 
208 207
 		$oMemberAdminView = getAdminView('member');
209 208
 		$formTags = $oMemberAdminView->_getMemberInputTag($member_info);
@@ -244,8 +243,7 @@  discard block
 block discarded – undo
244 243
 		{
245 244
 			Context::set('identifierTitle', Context::getLang('email_address'));
246 245
 			Context::set('identifierValue', $logged_info->email_address); 
247
-		}
248
-		else
246
+		} else
249 247
 		{
250 248
 			Context::set('identifierTitle', Context::getLang('user_id'));
251 249
 			Context::set('identifierValue', $logged_info->user_id);
@@ -271,7 +269,9 @@  discard block
 block discarded – undo
271 269
 
272 270
 		$oMemberModel = getModel('member');
273 271
 		// A message appears if the user is not logged-in
274
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
272
+		if(!$oMemberModel->isLogged()) {
273
+			return $this->stop('msg_not_logged');
274
+		}
275 275
 
276 276
 		$logged_info = Context::get('logged_info');
277 277
 		$member_srl = $logged_info->member_srl;
@@ -330,7 +330,9 @@  discard block
 block discarded – undo
330 330
 	{
331 331
 		$oMemberModel = getModel('member');
332 332
 		// A message appears if the user is not logged-in
333
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
333
+		if(!$oMemberModel->isLogged()) {
334
+			return $this->stop('msg_not_logged');
335
+		}
334 336
 
335 337
 		$logged_info = Context::get('logged_info');
336 338
 		$member_srl = $logged_info->member_srl;
@@ -357,7 +359,9 @@  discard block
 block discarded – undo
357 359
 	{
358 360
 		$oMemberModel = getModel('member');
359 361
 		// A message appears if the user is not logged-in
360
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
362
+		if(!$oMemberModel->isLogged()) {
363
+			return $this->stop('msg_not_logged');
364
+		}
361 365
 
362 366
 		$logged_info = Context::get('logged_info');
363 367
 		$args = new stdClass();
@@ -384,7 +388,9 @@  discard block
 block discarded – undo
384 388
 	{
385 389
 		$oMemberModel = getModel('member');
386 390
 		// A message appears if the user is not logged-in
387
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
391
+		if(!$oMemberModel->isLogged()) {
392
+			return $this->stop('msg_not_logged');
393
+		}
388 394
 		// Get the saved document(module_srl is set to member_srl instead)
389 395
 		$logged_info = Context::get('logged_info');
390 396
 		$args = new stdClass();
@@ -423,13 +429,15 @@  discard block
 block discarded – undo
423 429
 
424 430
 		$XE_VALIDATOR_MESSAGE = Context::get('XE_VALIDATOR_MESSAGE');
425 431
 		$XE_VALIDATOR_ERROR = Context::get('XE_VALIDATOR_ERROR');
426
-		if($XE_VALIDATOR_ERROR == -11)
427
-			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
432
+		if($XE_VALIDATOR_ERROR == -11) {
433
+					Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
434
+		}
428 435
 
429
-		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
430
-			Context::set('referer_url', getUrl('')); 
431
-		else
432
-			Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
436
+		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21) {
437
+					Context::set('referer_url', getUrl(''));
438
+		} else {
439
+					Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
440
+		}
433 441
 
434 442
 		// Set a template file
435 443
 		$this->setTemplateFile('login_form');
@@ -442,7 +450,9 @@  discard block
 block discarded – undo
442 450
 	{
443 451
 		$oMemberModel = getModel('member');
444 452
 		// A message appears if the user is not logged-in
445
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
453
+		if(!$oMemberModel->isLogged()) {
454
+			return $this->stop('msg_not_logged');
455
+		}
446 456
 
447 457
 		$memberConfig = $this->member_config;
448 458
 
@@ -457,8 +467,7 @@  discard block
 block discarded – undo
457 467
 		{
458 468
 			Context::set('identifier', 'user_id');
459 469
 			Context::set('formValue', $member_info->user_id);
460
-		}
461
-		else
470
+		} else
462 471
 		{
463 472
 			Context::set('identifier', 'email_address');
464 473
 			Context::set('formValue', $member_info->email_address);
@@ -474,7 +483,9 @@  discard block
 block discarded – undo
474 483
 	{
475 484
 		$oMemberModel = getModel('member');
476 485
 		// A message appears if the user is not logged-in
477
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
486
+		if(!$oMemberModel->isLogged()) {
487
+			return $this->stop('msg_not_logged');
488
+		}
478 489
 
479 490
 		$memberConfig = $this->member_config;
480 491
 
@@ -488,8 +499,7 @@  discard block
 block discarded – undo
488 499
 		{
489 500
 			Context::set('identifier', 'user_id');
490 501
 			Context::set('formValue', $member_info->user_id);
491
-		}
492
-		else
502
+		} else
493 503
 		{
494 504
 			Context::set('identifier', 'email_address');
495 505
 			Context::set('formValue', $member_info->email_address);
@@ -505,10 +515,11 @@  discard block
 block discarded – undo
505 515
 	{
506 516
 		$oMemberController = getController('member');
507 517
 		$output = $oMemberController->procMemberLogout();
508
-		if(!$output->redirect_url)
509
-			$this->setRedirectUrl(getNotEncodedUrl('act', ''));
510
-		else
511
-			$this->setRedirectUrl($output->redirect_url);
518
+		if(!$output->redirect_url) {
519
+					$this->setRedirectUrl(getNotEncodedUrl('act', ''));
520
+		} else {
521
+					$this->setRedirectUrl($output->redirect_url);
522
+		}
512 523
 
513 524
 		return;
514 525
 	}
@@ -527,7 +538,9 @@  discard block
 block discarded – undo
527 538
 	 */
528 539
 	function dispMemberFindAccount()
529 540
 	{
530
-		if(Context::get('is_logged')) return $this->stop('already_logged');
541
+		if(Context::get('is_logged')) {
542
+			return $this->stop('already_logged');
543
+		}
531 544
 
532 545
 		$config = $this->member_config;
533 546
 
@@ -541,13 +554,17 @@  discard block
 block discarded – undo
541 554
 	 */
542 555
 	function dispMemberGetTempPassword()
543 556
 	{
544
-		if(Context::get('is_logged')) return $this->stop('already_logged');
557
+		if(Context::get('is_logged')) {
558
+			return $this->stop('already_logged');
559
+		}
545 560
 
546 561
 		$user_id = Context::get('user_id');
547 562
 		$temp_password = $_SESSION['xe_temp_password_'.$user_id];
548 563
 		unset($_SESSION['xe_temp_password_'.$user_id]);
549 564
 
550
-		if(!$user_id||!$temp_password) return new BaseObject(-1,'msg_invaild_request');
565
+		if(!$user_id||!$temp_password) {
566
+			return new BaseObject(-1,'msg_invaild_request');
567
+		}
551 568
 
552 569
 		Context::set('temp_password', $temp_password);
553 570
 
@@ -575,8 +592,7 @@  discard block
 block discarded – undo
575 592
 			$_SESSION['auth_member_info'] = $memberInfo;
576 593
 			Context::set('memberInfo', $memberInfo);
577 594
 			$this->setTemplateFile('reset_mail');
578
-		}
579
-		else
595
+		} else
580 596
 		{
581 597
 			$this->setTemplateFile('resend_auth_mail');
582 598
 		}
@@ -618,8 +634,7 @@  discard block
 block discarded – undo
618 634
 			if($val->column_type == 'kr_zip' || $val->column_type == 'tel')
619 635
 			{
620 636
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s[]","%s"]);', $val->column_name, $title);
621
-			}
622
-			else
637
+			} else
623 638
 			{
624 639
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s","%s"]);', $val->column_name, $title);
625 640
 			}
@@ -641,7 +656,9 @@  discard block
 block discarded – undo
641 656
 	**/
642 657
 	function dispMemberSpammer()
643 658
 	{
644
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
659
+		if(!Context::get('is_logged')) {
660
+			return new BaseObject(-1,'msg_not_permitted');
661
+		}
645 662
 
646 663
 		$member_srl = Context::get('member_srl');
647 664
 		$module_srl = Context::get('module_srl');
@@ -652,7 +669,9 @@  discard block
 block discarded – undo
652 669
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
653 670
 		$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
654 671
 
655
-		if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
672
+		if(!$grant->manager) {
673
+			return new BaseObject(-1,'msg_not_permitted');
674
+		}
656 675
 
657 676
 		$oMemberModel = getModel('member');
658 677
 
Please login to merge, or discard this patch.