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 ( 594959...601687 )
by gyeong-won
08:31
created
modules/admin/admin.admin.view.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	{
29 29
 		$db_info = Context::getDBInfo();
30 30
 
31
-		if(strpos($db_info->default_url, 'xn--') !== FALSE)
31
+		if (strpos($db_info->default_url, 'xn--') !== FALSE)
32 32
 		{
33 33
 			$xe_default_url = Context::decodeIdna($db_info->default_url);
34 34
 		}
@@ -48,13 +48,13 @@  discard block
 block discarded – undo
48 48
 		// forbit access if the user is not an administrator
49 49
 		$oMemberModel = getModel('member');
50 50
 		$logged_info = $oMemberModel->getLoggedInfo();
51
-		if($logged_info->is_admin != 'Y')
51
+		if ($logged_info->is_admin != 'Y')
52 52
 		{
53 53
 			return $this->stop("msg_is_not_administrator");
54 54
 		}
55 55
 
56 56
 		// change into administration layout
57
-		$this->setTemplatePath($this->module_path . 'tpl');
57
+		$this->setTemplatePath($this->module_path.'tpl');
58 58
 		$this->setLayoutPath($this->getTemplatePath());
59 59
 		$this->setLayoutFile('layout.html');
60 60
 
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
 		Context::set('use_db_session', $db_info->use_db_session == 'N' ? 'N' : 'Y');
75 75
 		Context::set('use_mobile_view', $db_info->use_mobile_view == 'Y' ? 'Y' : 'N');
76 76
 		Context::set('use_ssl', $db_info->use_ssl ? $db_info->use_ssl : "none");
77
-		if($db_info->http_port)
77
+		if ($db_info->http_port)
78 78
 		{
79 79
 			Context::set('http_port', $db_info->http_port);
80 80
 		}
81
-		if($db_info->https_port)
81
+		if ($db_info->https_port)
82 82
 		{
83 83
 			Context::set('https_port', $db_info->https_port);
84 84
 		}
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	function checkEasyinstall()
95 95
 	{
96 96
 		$lastTime = (int) FileHandler::readFile($this->easyinstallCheckFile);
97
-		if($lastTime > $_SERVER['REQUEST_TIME'] - 60 * 60 * 24 * 30)
97
+		if ($lastTime > $_SERVER['REQUEST_TIME'] - 60 * 60 * 24 * 30)
98 98
 		{
99 99
 			return;
100 100
 		}
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
 		$lUpdateDoc = $xml_lUpdate->parse($buff);
109 109
 		$updateDate = $lUpdateDoc->response->updatedate->body;
110 110
 
111
-		if(!$updateDate)
111
+		if (!$updateDate)
112 112
 		{
113 113
 			$this->_markingCheckEasyinstall();
114 114
 			return;
115 115
 		}
116 116
 
117 117
 		$item = $oAutoinstallModel->getLatestPackage();
118
-		if(!$item || $item->updatedate < $updateDate)
118
+		if (!$item || $item->updatedate < $updateDate)
119 119
 		{
120 120
 			$oController = getAdminController('autoinstall');
121 121
 			$oController->_updateinfo();
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
 		// Check is_shortcut column
146 146
 		$oDB = DB::getInstance();
147
-		if(!$oDB->isColumnExists('menu_item', 'is_shortcut'))
147
+		if (!$oDB->isColumnExists('menu_item', 'is_shortcut'))
148 148
 		{
149 149
 			return;
150 150
 		}
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
 		$currentAct = Context::get('act');
163 163
 		$subMenuTitle = '';
164 164
 
165
-		foreach((array) $moduleActionInfo->menu as $key => $value)
165
+		foreach ((array) $moduleActionInfo->menu as $key => $value)
166 166
 		{
167
-			if(isset($value->acts) && is_array($value->acts) && in_array($currentAct, $value->acts))
167
+			if (isset($value->acts) && is_array($value->acts) && in_array($currentAct, $value->acts))
168 168
 			{
169 169
 				$subMenuTitle = $value->title;
170 170
 				break;
@@ -173,21 +173,21 @@  discard block
 block discarded – undo
173 173
 		// get current menu's srl(=parentSrl)
174 174
 		$parentSrl = 0;
175 175
 		$oMenuAdminConroller = getAdminController('menu');
176
-		foreach((array) $menu->list as $parentKey => $parentMenu)
176
+		foreach ((array) $menu->list as $parentKey => $parentMenu)
177 177
 		{
178
-			if(!is_array($parentMenu['list']) || !count($parentMenu['list']))
178
+			if (!is_array($parentMenu['list']) || !count($parentMenu['list']))
179 179
 			{
180 180
 				continue;
181 181
 			}
182
-			if($parentMenu['href'] == '#' && count($parentMenu['list']))
182
+			if ($parentMenu['href'] == '#' && count($parentMenu['list']))
183 183
 			{
184 184
 				$firstChild = current($parentMenu['list']);
185 185
 				$menu->list[$parentKey]['href'] = $firstChild['href'];
186 186
 			}
187 187
 
188
-			foreach($parentMenu['list'] as $childKey => $childMenu)
188
+			foreach ($parentMenu['list'] as $childKey => $childMenu)
189 189
 			{
190
-				if($subMenuTitle == $childMenu['text'] && $parentSrl == 0)
190
+				if ($subMenuTitle == $childMenu['text'] && $parentSrl == 0)
191 191
 				{
192 192
 					$parentSrl = $childMenu['parent_srl'];
193 193
 				}
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 		$gnbTitleInfo->adminTitle = $objConfig->adminTitle ? $objConfig->adminTitle : 'XE Admin';
201 201
 		$gnbTitleInfo->adminLogo = $objConfig->adminLogo ? $objConfig->adminLogo : 'modules/admin/tpl/img/xe.h1.png';
202 202
 
203
-		$browserTitle = ($subMenuTitle ? $subMenuTitle : 'Dashboard') . ' - ' . $gnbTitleInfo->adminTitle;
203
+		$browserTitle = ($subMenuTitle ? $subMenuTitle : 'Dashboard').' - '.$gnbTitleInfo->adminTitle;
204 204
 
205 205
 		// Get list of favorite
206 206
 		$oAdminAdminModel = getAdminModel('admin');
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 		// move from index method, because use in admin footer
212 212
 		$newest_news_url = sprintf("http://news.xpressengine.com/%s/news.php?version=%s&package=%s", _XE_LOCATION_, __XE_VERSION__, _XE_PACKAGE_);
213 213
 		$cache_file = sprintf("%sfiles/cache/newest_news.%s.cache.php", _XE_PATH_, _XE_LOCATION_);
214
-		if(!file_exists($cache_file) || filemtime($cache_file) + 60 * 60 < $_SERVER['REQUEST_TIME'])
214
+		if (!file_exists($cache_file) || filemtime($cache_file) + 60 * 60 < $_SERVER['REQUEST_TIME'])
215 215
 		{
216 216
 			// Considering if data cannot be retrieved due to network problem, modify filemtime to prevent trying to reload again when refreshing administration page
217 217
 			// Ensure to access the administration page even though news cannot be displayed
@@ -219,20 +219,20 @@  discard block
 block discarded – undo
219 219
 			FileHandler::getRemoteFile($newest_news_url, $cache_file, null, 1, 'GET', 'text/html', array('REQUESTURL' => getFullUrl('')));
220 220
 		}
221 221
 
222
-		if(file_exists($cache_file))
222
+		if (file_exists($cache_file))
223 223
 		{
224 224
 			$oXml = new XmlParser();
225 225
 			$buff = $oXml->parse(FileHandler::readFile($cache_file));
226 226
 
227 227
 			$item = $buff->zbxe_news->item;
228
-			if($item)
228
+			if ($item)
229 229
 			{
230
-				if(!is_array($item))
230
+				if (!is_array($item))
231 231
 				{
232 232
 					$item = array($item);
233 233
 				}
234 234
 
235
-				foreach($item as $key => $val)
235
+				foreach ($item as $key => $val)
236 236
 				{
237 237
 					$obj = new stdClass();
238 238
 					$obj->title = $val->body;
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 					$news[] = $obj;
242 242
 				}
243 243
 				Context::set('news', $news);
244
-				if(isset($news) && is_array($news))
244
+				if (isset($news) && is_array($news))
245 245
 				{
246 246
 					Context::set('latestVersion', array_shift($news));
247 247
 				}
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 	function dispAdminIndex()
265 265
 	{
266 266
 		$db_info = Context::getDBInfo();
267
-		Context::set('db_info',$db_info);
267
+		Context::set('db_info', $db_info);
268 268
 
269 269
 		// Get statistics
270 270
 		$args = new stdClass();
@@ -301,9 +301,9 @@  discard block
 block discarded – undo
301 301
 		$args = new stdClass();
302 302
 		$args->list_count = 5;
303 303
 		$output = $oCommentModel->getNewestCommentList($args, $columnList);
304
-		if(is_array($output))
304
+		if (is_array($output))
305 305
 		{
306
-			foreach($output AS $key => $value)
306
+			foreach ($output AS $key => $value)
307 307
 			{
308 308
 				$value->content = strip_tags($value->content);
309 309
 			}
@@ -314,17 +314,17 @@  discard block
 block discarded – undo
314 314
 		// Get list of modules
315 315
 		$oModuleModel = getModel('module');
316 316
 		$module_list = $oModuleModel->getModuleList();
317
-		if(is_array($module_list))
317
+		if (is_array($module_list))
318 318
 		{
319 319
 			$needUpdate = FALSE;
320 320
 			$addTables = FALSE;
321
-			foreach($module_list AS $key => $value)
321
+			foreach ($module_list AS $key => $value)
322 322
 			{
323
-				if($value->need_install)
323
+				if ($value->need_install)
324 324
 				{
325 325
 					$addTables = TRUE;
326 326
 				}
327
-				if($value->need_update)
327
+				if ($value->need_update)
328 328
 				{
329 329
 					$needUpdate = TRUE;
330 330
 				}
@@ -335,12 +335,12 @@  discard block
 block discarded – undo
335 335
 		$oAutoinstallAdminModel = getAdminModel('autoinstall');
336 336
 		$needUpdateList = $oAutoinstallAdminModel->getNeedUpdateList();
337 337
 
338
-		if(is_array($needUpdateList))
338
+		if (is_array($needUpdateList))
339 339
 		{
340
-			foreach($needUpdateList AS $key => $value)
340
+			foreach ($needUpdateList AS $key => $value)
341 341
 			{
342 342
 				$helpUrl = './admin/help/index.html#';
343
-				switch($value->type)
343
+				switch ($value->type)
344 344
 				{
345 345
 					case 'addon':
346 346
 						$helpUrl .= 'UMAN_terminology_addon';
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
 
368 368
 		$site_module_info = Context::get('site_module_info');
369 369
 		$oAddonAdminModel = getAdminModel('addon');
370
-		$counterAddonActivated = $oAddonAdminModel->isActivatedAddon('counter', $site_module_info->site_srl );
371
-		if(!$counterAddonActivated)
370
+		$counterAddonActivated = $oAddonAdminModel->isActivatedAddon('counter', $site_module_info->site_srl);
371
+		if (!$counterAddonActivated)
372 372
 		{
373 373
 			$columnList = array('member_srl', 'nick_name', 'user_name', 'user_id', 'email_address');
374 374
 			$args = new stdClass;
@@ -391,9 +391,9 @@  discard block
 block discarded – undo
391 391
 
392 392
 		// gathering enviroment check
393 393
 		$mainVersion = join('.', array_slice(explode('.', __XE_VERSION__), 0, 2));
394
-		$path = FileHandler::getRealPath('./files/env/' . $mainVersion);
394
+		$path = FileHandler::getRealPath('./files/env/'.$mainVersion);
395 395
 		$isEnviromentGatheringAgreement = FALSE;
396
-		if(file_exists($path))
396
+		if (file_exists($path))
397 397
 		{
398 398
 			$isEnviromentGatheringAgreement = TRUE;
399 399
 		}
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 		$isLicenseAgreement = FALSE;
404 404
 		$path = FileHandler::getRealPath('./files/env/license_agreement');
405 405
 		$isLicenseAgreement = FALSE;
406
-		if(file_exists($path))
406
+		if (file_exists($path))
407 407
 		{
408 408
 			$isLicenseAgreement = TRUE;
409 409
 		}
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 
426 426
 		Context::set('selected_lang', $db_info->lang_type);
427 427
 
428
-		if(strpos($db_info->default_url, 'xn--') !== FALSE)
428
+		if (strpos($db_info->default_url, 'xn--') !== FALSE)
429 429
 		{
430 430
 			$db_info->default_url = Context::decodeIdna($db_info->default_url);
431 431
 		}
@@ -434,9 +434,9 @@  discard block
 block discarded – undo
434 434
 
435 435
 		// site lock
436 436
 		Context::set('IP', $_SERVER['REMOTE_ADDR']);
437
-		if(!$db_info->sitelock_title) $db_info->sitelock_title = 'Maintenance in progress...';
438
-		if(!in_array('127.0.0.1', $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = '127.0.0.1';
439
-		if(!in_array($_SERVER['REMOTE_ADDR'], $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = $_SERVER['REMOTE_ADDR'];
437
+		if (!$db_info->sitelock_title) $db_info->sitelock_title = 'Maintenance in progress...';
438
+		if (!in_array('127.0.0.1', $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = '127.0.0.1';
439
+		if (!in_array($_SERVER['REMOTE_ADDR'], $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = $_SERVER['REMOTE_ADDR'];
440 440
 		$db_info->sitelock_whitelist = array_unique($db_info->sitelock_whitelist);
441 441
 		Context::set('remote_addr', $_SERVER['REMOTE_ADDR']);
442 442
 		Context::set('use_sitelock', $db_info->use_sitelock);
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 		Context::set('sitelock_whitelist', $whitelist);
448 448
 
449 449
 
450
-		if($db_info->admin_ip_list) $admin_ip_list = implode("\r\n", $db_info->admin_ip_list);
450
+		if ($db_info->admin_ip_list) $admin_ip_list = implode("\r\n", $db_info->admin_ip_list);
451 451
 		else $admin_ip_list = '';
452 452
 		Context::set('admin_ip_list', $admin_ip_list);
453 453
 
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 		Context::set('htmlFooter', htmlspecialchars($config->htmlFooter));
471 471
 
472 472
 		// embed filter
473
-		require_once(_XE_PATH_ . 'classes/security/EmbedFilter.class.php');
473
+		require_once(_XE_PATH_.'classes/security/EmbedFilter.class.php');
474 474
 		$oEmbedFilter = EmbedFilter::getInstance();
475 475
 		context::set('embed_white_object', implode(PHP_EOL, $oEmbedFilter->whiteUrlList));
476 476
 		context::set('embed_white_iframe', implode(PHP_EOL, $oEmbedFilter->whiteIframeUrlList));
@@ -529,36 +529,36 @@  discard block
 block discarded – undo
529 529
 	 */
530 530
 	function showSendEnv()
531 531
 	{
532
-		if(Context::getResponseMethod() != 'HTML')
532
+		if (Context::getResponseMethod() != 'HTML')
533 533
 		{
534 534
 			return;
535 535
 		}
536 536
 
537 537
 		$server = 'http://collect.xpressengine.com/env/img.php?';
538 538
 		$path = './files/env/';
539
-		$install_env = $path . 'install';
539
+		$install_env = $path.'install';
540 540
 		$mainVersion = join('.', array_slice(explode('.', __XE_VERSION__), 0, 2));
541 541
 
542
-		if(file_exists(FileHandler::getRealPath($install_env)))
542
+		if (file_exists(FileHandler::getRealPath($install_env)))
543 543
 		{
544 544
 			$oAdminAdminModel = getAdminModel('admin');
545 545
 			$params = $oAdminAdminModel->getEnv('INSTALL');
546
-			$img = sprintf('<img src="%s" alt="" style="height:0px;width:0px" />', $server . $params);
546
+			$img = sprintf('<img src="%s" alt="" style="height:0px;width:0px" />', $server.$params);
547 547
 			Context::addHtmlFooter($img);
548 548
 
549
-			FileHandler::writeFile($path . $mainVersion, '1');
549
+			FileHandler::writeFile($path.$mainVersion, '1');
550 550
 		}
551
-		else if(isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path . $mainVersion)))
551
+		else if (isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path.$mainVersion)))
552 552
 		{
553
-			if($_SESSION['enviroment_gather'] == 'Y')
553
+			if ($_SESSION['enviroment_gather'] == 'Y')
554 554
 			{
555 555
 				$oAdminAdminModel = getAdminModel('admin');
556 556
 				$params = $oAdminAdminModel->getEnv();
557
-				$img = sprintf('<img src="%s" alt="" style="height:0px;width:0px" />', $server . $params);
557
+				$img = sprintf('<img src="%s" alt="" style="height:0px;width:0px" />', $server.$params);
558 558
 				Context::addHtmlFooter($img);
559 559
 			}
560 560
 
561
-			FileHandler::writeFile($path . $mainVersion, '1');
561
+			FileHandler::writeFile($path.$mainVersion, '1');
562 562
 			unset($_SESSION['enviroment_gather']);
563 563
 		}
564 564
 	}
@@ -576,64 +576,64 @@  discard block
 block discarded – undo
576 576
 		$tmp = explode("&", $envInfo);
577 577
 		$arrInfo = array();
578 578
 		$xe_check_env = array();
579
-		foreach($tmp as $value) {
579
+		foreach ($tmp as $value) {
580 580
 			$arr = explode("=", $value);
581
-			if($arr[0]=="type") {
581
+			if ($arr[0] == "type") {
582 582
 				continue;
583
-			}elseif($arr[0]=="phpext" ) {
583
+			}elseif ($arr[0] == "phpext") {
584 584
 				$str = urldecode($arr[1]);
585
-				$xe_check_env[$arr[0]]= str_replace("|", ", ", $str);
586
-			} elseif($arr[0]=="module" ) {
585
+				$xe_check_env[$arr[0]] = str_replace("|", ", ", $str);
586
+			} elseif ($arr[0] == "module") {
587 587
 				$str = urldecode($arr[1]);
588 588
 				$arrModuleName = explode("|", $str);
589 589
 				$oModuleModel = getModel("module");
590 590
 				$mInfo = array();
591
-				foreach($arrModuleName as $moduleName) {
591
+				foreach ($arrModuleName as $moduleName) {
592 592
 					$moduleInfo = $oModuleModel->getModuleInfoXml($moduleName);
593 593
 					$mInfo[] = "{$moduleName}({$moduleInfo->version})";
594 594
 				}
595
-				$xe_check_env[$arr[0]]= join(", ", $mInfo);
596
-			} elseif($arr[0]=="addon") {
595
+				$xe_check_env[$arr[0]] = join(", ", $mInfo);
596
+			} elseif ($arr[0] == "addon") {
597 597
 				$str = urldecode($arr[1]);
598 598
 				$arrAddonName = explode("|", $str);
599 599
 				$oAddonModel = getAdminModel("addon");
600 600
 				$mInfo = array();
601
-				foreach($arrAddonName as $addonName) {
601
+				foreach ($arrAddonName as $addonName) {
602 602
 					$addonInfo = $oAddonModel->getAddonInfoXml($addonName);
603 603
 					$mInfo[] = "{$addonName}({$addonInfo->version})";
604 604
 				}
605
-				$xe_check_env[$arr[0]]= join(", ", $mInfo);
606
-			} elseif($arr[0]=="widget") {
605
+				$xe_check_env[$arr[0]] = join(", ", $mInfo);
606
+			} elseif ($arr[0] == "widget") {
607 607
 				$str = urldecode($arr[1]);
608 608
 				$arrWidgetName = explode("|", $str);
609 609
 				$oWidgetModel = getModel("widget");
610 610
 				$mInfo = array();
611
-				foreach($arrWidgetName as $widgetName) {
611
+				foreach ($arrWidgetName as $widgetName) {
612 612
 					$widgetInfo = $oWidgetModel->getWidgetInfo($widgetName);
613 613
 					$mInfo[] = "{$widgetName}({$widgetInfo->version})";
614 614
 				}
615
-				$xe_check_env[$arr[0]]= join(", ", $mInfo);
616
-			} elseif($arr[0]=="widgetstyle") {
615
+				$xe_check_env[$arr[0]] = join(", ", $mInfo);
616
+			} elseif ($arr[0] == "widgetstyle") {
617 617
 				$str = urldecode($arr[1]);
618 618
 				$arrWidgetstyleName = explode("|", $str);
619 619
 				$oWidgetModel = getModel("widget");
620 620
 				$mInfo = array();
621
-				foreach($arrWidgetstyleName as $widgetstyleName) {
621
+				foreach ($arrWidgetstyleName as $widgetstyleName) {
622 622
 					$widgetstyleInfo = $oWidgetModel->getWidgetStyleInfo($widgetstyleName);
623 623
 					$mInfo[] = "{$widgetstyleName}({$widgetstyleInfo->version})";
624 624
 				}
625
-				$xe_check_env[$arr[0]]= join(", ", $mInfo);
625
+				$xe_check_env[$arr[0]] = join(", ", $mInfo);
626 626
 
627
-			} elseif($arr[0]=="layout") {
627
+			} elseif ($arr[0] == "layout") {
628 628
 				$str = urldecode($arr[1]);
629 629
 				$arrLayoutName = explode("|", $str);
630 630
 				$oLayoutModel = getModel("layout");
631 631
 				$mInfo = array();
632
-				foreach($arrLayoutName as $layoutName) {
632
+				foreach ($arrLayoutName as $layoutName) {
633 633
 					$layoutInfo = $oLayoutModel->getLayoutInfo($layoutName);
634 634
 					$mInfo[] = "{$layoutName}({$layoutInfo->version})";
635 635
 				}
636
-				$xe_check_env[$arr[0]]= join(", ", $mInfo);
636
+				$xe_check_env[$arr[0]] = join(", ", $mInfo);
637 637
 			} else {
638 638
 				$xe_check_env[$arr[0]] = urldecode($arr[1]);
639 639
 			}
@@ -647,15 +647,15 @@  discard block
 block discarded – undo
647 647
 		$php_core['memory_limit'] = "{$ini_info['memory_limit']['local_value']}";
648 648
 		$info['PHP_Core'] = $php_core;
649 649
 
650
-		$str_info = "[XE Server Environment " . date("Y-m-d") . "]\n\n";
650
+		$str_info = "[XE Server Environment ".date("Y-m-d")."]\n\n";
651 651
 		$str_info .= "realpath : ".realpath('./')."\n";
652
-		foreach( $info as $key=>$value )
652
+		foreach ($info as $key=>$value)
653 653
 		{
654
-			if( is_array( $value ) == false ) {
654
+			if (is_array($value) == false) {
655 655
 				$str_info .= "{$key} : {$value}\n";
656 656
 			} else {
657 657
 				//$str_info .= "\n{$key} \n";
658
-				foreach( $value as $key2=>$value2 )
658
+				foreach ($value as $key2=>$value2)
659 659
 					$str_info .= "{$key2} : {$value2}\n";
660 660
 			}
661 661
 		}
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 		Context::set('use_rewrite', $useRewrite); 
673 673
 
674 674
 		// nginx 체크, rewrite 사용법 안내
675
-		if($useRewrite == 'N' && stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) Context::set('use_nginx', 'Y');
675
+		if ($useRewrite == 'N' && stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) Context::set('use_nginx', 'Y');
676 676
 		
677 677
 		Context::set('useable', $oInstallController->checkInstallEnv());
678 678
 		$this->setTemplateFile('check_env.html');
Please login to merge, or discard this patch.
config/func.inc.php 1 patch
Spacing   +182 added lines, -182 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
  *
7 7
  * @author NAVER ([email protected])
8 8
  */
9
-if(!defined('__XE__'))
9
+if (!defined('__XE__'))
10 10
 {
11 11
 	exit();
12 12
 }
13 13
 
14 14
 // define an empty function to avoid errors when iconv function doesn't exist
15
-if(!function_exists('iconv'))
15
+if (!function_exists('iconv'))
16 16
 {
17 17
 	eval('
18 18
 		function iconv($in_charset, $out_charset, $str)
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 {
221 221
 	$oDB = DB::getInstance();
222 222
 	$output = $oDB->executeQuery($query_id, $args, $arg_columns);
223
-	if(!is_array($output->data) && count($output->data) > 0)
223
+	if (!is_array($output->data) && count($output->data) > 0)
224 224
 	{
225 225
 		$output->data = array($output->data);
226 226
 	}
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 function setUserSequence($seq)
251 251
 {
252 252
 	$arr_seq = array();
253
-	if(isset($_SESSION['seq']))
253
+	if (isset($_SESSION['seq']))
254 254
 	{
255 255
 		$arr_seq = $_SESSION['seq'];
256 256
 	}
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
  */
267 267
 function checkUserSequence($seq)
268 268
 {
269
-	if(!isset($_SESSION['seq']))
269
+	if (!isset($_SESSION['seq']))
270 270
 	{
271 271
 		return false;
272 272
 	}
273
-	if(!in_array($seq, $_SESSION['seq']))
273
+	if (!in_array($seq, $_SESSION['seq']))
274 274
 	{
275 275
 		return false;
276 276
 	}
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	$num_args = func_num_args();
297 297
 	$args_list = func_get_args();
298 298
 
299
-	if($num_args)
299
+	if ($num_args)
300 300
 		$url = Context::getUrl($num_args, $args_list);
301 301
 	else
302 302
 		$url = Context::getRequestUri();
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	$num_args = func_num_args();
316 316
 	$args_list = func_get_args();
317 317
 
318
-	if($num_args)
318
+	if ($num_args)
319 319
 	{
320 320
 		$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
321 321
 	}
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	$num_args = func_num_args();
339 339
 	$args_list = func_get_args();
340 340
 
341
-	if($num_args)
341
+	if ($num_args)
342 342
 	{
343 343
 		$url = Context::getUrl($num_args, $args_list, NULL, TRUE, TRUE);
344 344
 	}
@@ -360,16 +360,16 @@  discard block
 block discarded – undo
360 360
 	$num_args = func_num_args();
361 361
 	$args_list = func_get_args();
362 362
 	$request_uri = Context::getRequestUri();
363
-	if(!$num_args)
363
+	if (!$num_args)
364 364
 	{
365 365
 		return $request_uri;
366 366
 	}
367 367
 
368 368
 	$url = Context::getUrl($num_args, $args_list);
369
-	if(strncasecmp('http', $url, 4) !== 0)
369
+	if (strncasecmp('http', $url, 4) !== 0)
370 370
 	{
371 371
 		preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
372
-		return substr($match[0], 0, -1) . $url;
372
+		return substr($match[0], 0, -1).$url;
373 373
 	}
374 374
 	return $url;
375 375
 }
@@ -384,17 +384,17 @@  discard block
 block discarded – undo
384 384
 	$num_args = func_num_args();
385 385
 	$args_list = func_get_args();
386 386
 	$request_uri = Context::getRequestUri();
387
-	if(!$num_args)
387
+	if (!$num_args)
388 388
 	{
389 389
 		return $request_uri;
390 390
 	}
391 391
 
392 392
 	$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
393
-	if(strncasecmp('http', $url, 4) !== 0)
393
+	if (strncasecmp('http', $url, 4) !== 0)
394 394
 	{
395 395
 		preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
396 396
 		$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
397
-		return substr($match[0], 0, -1) . $url;
397
+		return substr($match[0], 0, -1).$url;
398 398
 	}
399 399
 	return $url;
400 400
 }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	$num_args = func_num_args();
411 411
 	$args_list = func_get_args();
412 412
 
413
-	if(!$num_args)
413
+	if (!$num_args)
414 414
 	{
415 415
 		return Context::getRequestUri();
416 416
 	}
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 	$num_args = func_num_args();
433 433
 	$args_list = func_get_args();
434 434
 
435
-	if(!$num_args)
435
+	if (!$num_args)
436 436
 	{
437 437
 		return Context::getRequestUri();
438 438
 	}
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 	$args_list = func_get_args();
455 455
 
456 456
 	$request_uri = Context::getRequestUri();
457
-	if(!$num_args)
457
+	if (!$num_args)
458 458
 	{
459 459
 		return $request_uri;
460 460
 	}
@@ -463,10 +463,10 @@  discard block
 block discarded – undo
463 463
 	$num_args = count($args_list);
464 464
 
465 465
 	$url = Context::getUrl($num_args, $args_list, $domain);
466
-	if(strncasecmp('http', $url, 4) !== 0)
466
+	if (strncasecmp('http', $url, 4) !== 0)
467 467
 	{
468 468
 		preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
469
-		return substr($match[0], 0, -1) . $url;
469
+		return substr($match[0], 0, -1).$url;
470 470
 	}
471 471
 	return $url;
472 472
 }
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 function getCurrentPageUrl()
480 480
 {
481 481
 	$protocol = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
482
-	$url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
482
+	$url = $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
483 483
 	return htmlspecialchars($url, ENT_COMPAT, 'UTF-8', FALSE);
484 484
 }
485 485
 
@@ -504,12 +504,12 @@  discard block
 block discarded – undo
504 504
  */
505 505
 function cut_str($string, $cut_size = 0, $tail = '...')
506 506
 {
507
-	if($cut_size < 1 || !$string)
507
+	if ($cut_size < 1 || !$string)
508 508
 	{
509 509
 		return $string;
510 510
 	}
511 511
 
512
-	if($GLOBALS['use_mb_strimwidth'] || function_exists('mb_strimwidth'))
512
+	if ($GLOBALS['use_mb_strimwidth'] || function_exists('mb_strimwidth'))
513 513
 	{
514 514
 		$GLOBALS['use_mb_strimwidth'] = TRUE;
515 515
 		return mb_strimwidth($string, 0, $cut_size + 4, $tail, 'utf-8');
@@ -523,16 +523,16 @@  discard block
 block discarded – undo
523 523
 	$char_count = 0;
524 524
 
525 525
 	$idx = 0;
526
-	while($idx < $string_length && $char_count < $cut_size && $char_width <= $max_width)
526
+	while ($idx < $string_length && $char_count < $cut_size && $char_width <= $max_width)
527 527
 	{
528 528
 		$c = ord(substr($string, $idx, 1));
529 529
 		$char_count++;
530
-		if($c < 128)
530
+		if ($c < 128)
531 531
 		{
532 532
 			$char_width += (int) $chars[$c - 32];
533 533
 			$idx++;
534 534
 		}
535
-		else if(191 < $c && $c < 224)
535
+		else if (191 < $c && $c < 224)
536 536
 		{
537 537
 			$char_width += $chars[4];
538 538
 			$idx += 2;
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 	}
546 546
 
547 547
 	$output = substr($string, 0, $idx);
548
-	if(strlen($output) < $string_length)
548
+	if (strlen($output) < $string_length)
549 549
 	{
550 550
 		$output .= $tail;
551 551
 	}
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 function zgap()
562 562
 {
563 563
 	$time_zone = $GLOBALS['_time_zone'];
564
-	if($time_zone < 0)
564
+	if ($time_zone < 0)
565 565
 	{
566 566
 		$to = -1;
567 567
 	}
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	$t_min = substr($time_zone, 3, 2) * $to;
575 575
 
576 576
 	$server_time_zone = date("O");
577
-	if($server_time_zone < 0)
577
+	if ($server_time_zone < 0)
578 578
 	{
579 579
 		$so = -1;
580 580
 	}
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
  */
602 602
 function ztime($str)
603 603
 {
604
-	if(!$str)
604
+	if (!$str)
605 605
 	{
606 606
 		return;
607 607
 	}
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 	$year = (int) substr($str, 0, 4);
613 613
 	$month = (int) substr($str, 4, 2);
614 614
 	$day = (int) substr($str, 6, 2);
615
-	if(strlen($str) <= 8)
615
+	if (strlen($str) <= 8)
616 616
 	{
617 617
 		$gap = 0;
618 618
 	}
@@ -636,19 +636,19 @@  discard block
 block discarded – undo
636 636
 	$gap = $_SERVER['REQUEST_TIME'] + zgap() - ztime($date);
637 637
 
638 638
 	$lang_time_gap = Context::getLang('time_gap');
639
-	if($gap < 60)
639
+	if ($gap < 60)
640 640
 	{
641 641
 		$buff = sprintf($lang_time_gap['min'], (int) ($gap / 60) + 1);
642 642
 	}
643
-	elseif($gap < 60 * 60)
643
+	elseif ($gap < 60 * 60)
644 644
 	{
645 645
 		$buff = sprintf($lang_time_gap['mins'], (int) ($gap / 60) + 1);
646 646
 	}
647
-	elseif($gap < 60 * 60 * 2)
647
+	elseif ($gap < 60 * 60 * 2)
648 648
 	{
649 649
 		$buff = sprintf($lang_time_gap['hour'], (int) ($gap / 60 / 60) + 1);
650 650
 	}
651
-	elseif($gap < 60 * 60 * 24)
651
+	elseif ($gap < 60 * 60 * 24)
652 652
 	{
653 653
 		$buff = sprintf($lang_time_gap['hours'], (int) ($gap / 60 / 60) + 1);
654 654
 	}
@@ -685,40 +685,40 @@  discard block
 block discarded – undo
685 685
 function zdate($str, $format = 'Y-m-d H:i:s', $conversion = TRUE)
686 686
 {
687 687
 	// return null if no target time is specified
688
-	if(!$str)
688
+	if (!$str)
689 689
 	{
690 690
 		return;
691 691
 	}
692 692
 	// convert the date format according to the language
693
-	if($conversion == TRUE)
693
+	if ($conversion == TRUE)
694 694
 	{
695
-		switch(Context::getLangType())
695
+		switch (Context::getLangType())
696 696
 		{
697 697
 			case 'en' :
698 698
 			case 'es' :
699
-				if($format == 'Y-m-d')
699
+				if ($format == 'Y-m-d')
700 700
 				{
701 701
 					$format = 'M d, Y';
702 702
 				}
703
-				elseif($format == 'Y-m-d H:i:s')
703
+				elseif ($format == 'Y-m-d H:i:s')
704 704
 				{
705 705
 					$format = 'M d, Y H:i:s';
706 706
 				}
707
-				elseif($format == 'Y-m-d H:i')
707
+				elseif ($format == 'Y-m-d H:i')
708 708
 				{
709 709
 					$format = 'M d, Y H:i';
710 710
 				}
711 711
 				break;
712 712
 			case 'vi' :
713
-				if($format == 'Y-m-d')
713
+				if ($format == 'Y-m-d')
714 714
 				{
715 715
 					$format = 'd-m-Y';
716 716
 				}
717
-				elseif($format == 'Y-m-d H:i:s')
717
+				elseif ($format == 'Y-m-d H:i:s')
718 718
 				{
719 719
 					$format = 'H:i:s d-m-Y';
720 720
 				}
721
-				elseif($format == 'Y-m-d H:i')
721
+				elseif ($format == 'Y-m-d H:i')
722 722
 				{
723 723
 					$format = 'H:i d-m-Y';
724 724
 				}
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 	}
728 728
 
729 729
 	// If year value is less than 1970, handle it separately.
730
-	if((int) substr($str, 0, 4) < 1970)
730
+	if ((int) substr($str, 0, 4) < 1970)
731 731
 	{
732 732
 		$hour = (int) substr($str, 8, 2);
733 733
 		$min = (int) substr($str, 10, 2);
@@ -777,9 +777,9 @@  discard block
 block discarded – undo
777 777
 function getEncodeEmailAddress($email)
778 778
 {
779 779
 	$return = '';
780
-	for($i = 0, $c = strlen($email); $i < $c; $i++)
780
+	for ($i = 0, $c = strlen($email); $i < $c; $i++)
781 781
 	{
782
-		$return .= '&#' . (rand(0, 1) == 0 ? ord($email[$i]) : 'X' . dechex(ord($email[$i]))) . ';';
782
+		$return .= '&#'.(rand(0, 1) == 0 ? ord($email[$i]) : 'X'.dechex(ord($email[$i]))).';';
783 783
 	}
784 784
 	return $return;
785 785
 }
@@ -799,25 +799,25 @@  discard block
 block discarded – undo
799 799
 {
800 800
 	static $debug_file;
801 801
 
802
-	if(!(__DEBUG__ & 1))
802
+	if (!(__DEBUG__ & 1))
803 803
 	{
804 804
 		return;
805 805
 	}
806 806
 
807 807
 	static $firephp;
808 808
 	$bt = debug_backtrace();
809
-	if(is_array($bt))
809
+	if (is_array($bt))
810 810
 	{
811 811
 		$bt_debug_print = array_shift($bt);
812 812
 		$bt_called_function = array_shift($bt);
813 813
 	}
814 814
 	$file_name = str_replace(_XE_PATH_, '', $bt_debug_print['file']);
815 815
 	$line_num = $bt_debug_print['line'];
816
-	$function = $bt_called_function['class'] . $bt_called_function['type'] . $bt_called_function['function'];
816
+	$function = $bt_called_function['class'].$bt_called_function['type'].$bt_called_function['function'];
817 817
 
818
-	if(__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1)
818
+	if (__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1)
819 819
 	{
820
-		if(!isset($firephp))
820
+		if (!isset($firephp))
821 821
 		{
822 822
 			$firephp = FirePHP::getInstance(TRUE);
823 823
 		}
@@ -826,16 +826,16 @@  discard block
 block discarded – undo
826 826
 		$label = sprintf('[%s:%d] %s() (Memory usage: current=%s, peak=%s)', $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage()), FileHandler::filesize(memory_get_peak_usage()));
827 827
 
828 828
 		// Check a FirePHP option
829
-		if($display_option === 'TABLE')
829
+		if ($display_option === 'TABLE')
830 830
 		{
831 831
 			$label = $display_option;
832 832
 		}
833
-		if($display_option === 'ERROR')
833
+		if ($display_option === 'ERROR')
834 834
 		{
835 835
 			$type = $display_option;
836 836
 		}
837 837
 		// Check if the IP specified by __DEBUG_PROTECT__ option is same as the access IP.
838
-		if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
838
+		if (__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
839 839
 		{
840 840
 			$debug_output = 'The IP address is not allowed. Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php';
841 841
 			$label = NULL;
@@ -845,52 +845,52 @@  discard block
 block discarded – undo
845 845
 	}
846 846
 	else
847 847
 	{
848
-		if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
848
+		if (__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
849 849
 		{
850 850
 			return;
851 851
 		}
852 852
 
853 853
 		$print = array();
854
-		if(!$debug_file)
854
+		if (!$debug_file)
855 855
 		{
856
-			$debug_file = _XE_PATH_ . 'files/' . $file;
856
+			$debug_file = _XE_PATH_.'files/'.$file;
857 857
 		}
858
-		if(!file_exists($debug_file)) $print[] = '<?php exit() ?>';
858
+		if (!file_exists($debug_file)) $print[] = '<?php exit() ?>';
859 859
 
860
-		if($display_option === TRUE || $display_option === 'ERROR')
860
+		if ($display_option === TRUE || $display_option === 'ERROR')
861 861
 		{
862
-			$print[] = sprintf("[%s %s:%d] %s() - mem(%s)", date('Y-m-d H:i:s'), $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage()));;
862
+			$print[] = sprintf("[%s %s:%d] %s() - mem(%s)", date('Y-m-d H:i:s'), $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage())); ;
863 863
 			$print[] = str_repeat('=', 80);
864 864
 		}
865 865
 		$type = gettype($debug_output);
866
-		if(!in_array($type, array('array', 'object', 'resource')))
866
+		if (!in_array($type, array('array', 'object', 'resource')))
867 867
 		{
868
-			if($display_option === 'ERROR')
868
+			if ($display_option === 'ERROR')
869 869
 			{
870
-				$print[] = 'ERROR : ' . var_export($debug_output, TRUE);
870
+				$print[] = 'ERROR : '.var_export($debug_output, TRUE);
871 871
 			}
872 872
 			else
873 873
 			{
874
-				$print[] = 'DEBUG : ' . $type . '(' . var_export($debug_output, TRUE) . ')';
874
+				$print[] = 'DEBUG : '.$type.'('.var_export($debug_output, TRUE).')';
875 875
 			}
876 876
 		}
877 877
 		else
878 878
 		{
879
-			$print[] = 'DEBUG : ' . trim(preg_replace('/\r?\n/', "\n" . '        ', print_r($debug_output, true)));
879
+			$print[] = 'DEBUG : '.trim(preg_replace('/\r?\n/', "\n".'        ', print_r($debug_output, true)));
880 880
 		}
881 881
 		$backtrace_args = defined('\DEBUG_BACKTRACE_IGNORE_ARGS') ? \DEBUG_BACKTRACE_IGNORE_ARGS : 0;
882 882
 		$backtrace = debug_backtrace($backtrace_args);
883 883
 
884
-		if(count($backtrace) > 1 && $backtrace[1]['function'] === 'debugPrint' && !$backtrace[1]['class'])
884
+		if (count($backtrace) > 1 && $backtrace[1]['function'] === 'debugPrint' && !$backtrace[1]['class'])
885 885
 		{
886 886
 			array_shift($backtrace);
887 887
 		}
888
-		foreach($backtrace as $val)
888
+		foreach ($backtrace as $val)
889 889
 		{
890
-			$print[] = '        - ' . $val['file'] . ' : ' . $val['line'];
890
+			$print[] = '        - '.$val['file'].' : '.$val['line'];
891 891
 		}
892 892
 		$print[] = PHP_EOL;
893
-		@file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND|LOCK_EX);
893
+		@file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND | LOCK_EX);
894 894
 	}
895 895
 }
896 896
 
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
  */
902 902
 function writeSlowlog($type, $elapsed_time, $obj)
903 903
 {
904
-	if(!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) return;
904
+	if (!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) return;
905 905
 
906 906
 	static $log_filename = array(
907 907
 		'query' => 'files/_slowlog_query.php',
@@ -911,47 +911,47 @@  discard block
 block discarded – undo
911 911
 	);
912 912
 	$write_file = true;
913 913
 
914
-	$log_file = _XE_PATH_ . $log_filename[$type];
914
+	$log_file = _XE_PATH_.$log_filename[$type];
915 915
 
916 916
 	$buff = array();
917 917
 	$buff[] = '<?php exit(); ?>';
918 918
 	$buff[] = date('c');
919 919
 
920
-	if($type == 'trigger' && __LOG_SLOW_TRIGGER__ > 0 && $elapsed_time > __LOG_SLOW_TRIGGER__)
920
+	if ($type == 'trigger' && __LOG_SLOW_TRIGGER__ > 0 && $elapsed_time > __LOG_SLOW_TRIGGER__)
921 921
 	{
922
-		$buff[] = "\tCaller : " . $obj->caller;
923
-		$buff[] = "\tCalled : " . $obj->called;
922
+		$buff[] = "\tCaller : ".$obj->caller;
923
+		$buff[] = "\tCalled : ".$obj->called;
924 924
 	}
925
-	else if($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__)
925
+	else if ($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__)
926 926
 	{
927
-		$buff[] = "\tAddon : " . $obj->called;
928
-		$buff[] = "\tCalled position : " . $obj->caller;
927
+		$buff[] = "\tAddon : ".$obj->called;
928
+		$buff[] = "\tCalled position : ".$obj->caller;
929 929
 	}
930
-	else if($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__)
930
+	else if ($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__)
931 931
 	{
932
-		$buff[] = "\tWidget : " . $obj->called;
932
+		$buff[] = "\tWidget : ".$obj->called;
933 933
 	}
934
-	else if($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
934
+	else if ($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
935 935
 	{
936 936
 
937 937
 		$buff[] = $obj->query;
938
-		$buff[] = "\tQuery ID   : " . $obj->query_id;
939
-		$buff[] = "\tCaller     : " . $obj->caller;
940
-		$buff[] = "\tConnection : " . $obj->connection;
938
+		$buff[] = "\tQuery ID   : ".$obj->query_id;
939
+		$buff[] = "\tCaller     : ".$obj->caller;
940
+		$buff[] = "\tConnection : ".$obj->connection;
941 941
 	}
942 942
 	else
943 943
 	{
944 944
 		$write_file = false;
945 945
 	}
946 946
 
947
-	if($write_file)
947
+	if ($write_file)
948 948
 	{
949 949
 		$buff[] = sprintf("\t%0.6f sec", $elapsed_time);
950
-		$buff[] = PHP_EOL . PHP_EOL;
950
+		$buff[] = PHP_EOL.PHP_EOL;
951 951
 		file_put_contents($log_file, implode(PHP_EOL, $buff), FILE_APPEND);
952 952
 	}
953 953
 
954
-	if($type != 'query')
954
+	if ($type != 'query')
955 955
 	{
956 956
 		$trigger_args = $obj;
957 957
 		$trigger_args->_log_type = $type;
@@ -991,11 +991,11 @@  discard block
 block discarded – undo
991 991
  */
992 992
 function delObjectVars($target_obj, $del_obj)
993 993
 {
994
-	if(!is_object($target_obj))
994
+	if (!is_object($target_obj))
995 995
 	{
996 996
 		return;
997 997
 	}
998
-	if(!is_object($del_obj))
998
+	if (!is_object($del_obj))
999 999
 	{
1000 1000
 		return;
1001 1001
 	}
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
 
1006 1006
 	$target = array_keys($target_vars);
1007 1007
 	$del = array_keys($del_vars);
1008
-	if(!count($target) || !count($del))
1008
+	if (!count($target) || !count($del))
1009 1009
 	{
1010 1010
 		return $target_obj;
1011 1011
 	}
@@ -1013,10 +1013,10 @@  discard block
 block discarded – undo
1013 1013
 	$return_obj = new stdClass();
1014 1014
 
1015 1015
 	$target_count = count($target);
1016
-	for($i = 0; $i < $target_count; $i++)
1016
+	for ($i = 0; $i < $target_count; $i++)
1017 1017
 	{
1018 1018
 		$target_key = $target[$i];
1019
-		if(!in_array($target_key, $del))
1019
+		if (!in_array($target_key, $del))
1020 1020
 		{
1021 1021
 			$return_obj->{$target_key} = $target_obj->{$target_key};
1022 1022
 		}
@@ -1029,10 +1029,10 @@  discard block
 block discarded – undo
1029 1029
 {
1030 1030
 	$del_vars = array('error_return_url', 'success_return_url', 'ruleset', 'xe_validator_id');
1031 1031
 
1032
-	foreach($del_vars as $var)
1032
+	foreach ($del_vars as $var)
1033 1033
 	{
1034
-		if(is_array($vars)) unset($vars[$var]);
1035
-		else if(is_object($vars)) unset($vars->$var);
1034
+		if (is_array($vars)) unset($vars[$var]);
1035
+		else if (is_object($vars)) unset($vars->$var);
1036 1036
 	}
1037 1037
 
1038 1038
 	return $vars;
@@ -1049,12 +1049,12 @@  discard block
 block discarded – undo
1049 1049
  */
1050 1050
 function handleError($errno, $errstr, $file, $line)
1051 1051
 {
1052
-	if(!__DEBUG__)
1052
+	if (!__DEBUG__)
1053 1053
 	{
1054 1054
 		return;
1055 1055
 	}
1056 1056
 	$errors = array(E_USER_ERROR, E_ERROR, E_PARSE);
1057
-	if(!in_array($errno, $errors))
1057
+	if (!in_array($errno, $errors))
1058 1058
 	{
1059 1059
 		return;
1060 1060
 	}
@@ -1074,8 +1074,8 @@  discard block
 block discarded – undo
1074 1074
 function getNumberingPath($no, $size = 3)
1075 1075
 {
1076 1076
 	$mod = pow(10, $size);
1077
-	$output = sprintf('%0' . $size . 'd/', $no % $mod);
1078
-	if($no >= $mod)
1077
+	$output = sprintf('%0'.$size.'d/', $no % $mod);
1078
+	if ($no >= $mod)
1079 1079
 	{
1080 1080
 		$output .= getNumberingPath((int) $no / $mod, $size);
1081 1081
 	}
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
 
1096 1096
 function purifierHtml(&$content)
1097 1097
 {
1098
-	require_once(_XE_PATH_ . 'classes/security/Purifier.class.php');
1098
+	require_once(_XE_PATH_.'classes/security/Purifier.class.php');
1099 1099
 	$oPurifier = Purifier::getInstance();
1100 1100
 	$oPurifier->purify($content);
1101 1101
 }
@@ -1108,7 +1108,7 @@  discard block
 block discarded – undo
1108 1108
  */
1109 1109
 function removeHackTag($content)
1110 1110
 {
1111
-	require_once(_XE_PATH_ . 'classes/security/EmbedFilter.class.php');
1111
+	require_once(_XE_PATH_.'classes/security/EmbedFilter.class.php');
1112 1112
 	$oEmbedFilter = EmbedFilter::getInstance();
1113 1113
 	$oEmbedFilter->check($content);
1114 1114
 
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
  */
1151 1151
 function checkUploadedFile($file)
1152 1152
 {
1153
-	require_once(_XE_PATH_ . 'classes/security/UploadFileFilter.class.php');
1153
+	require_once(_XE_PATH_.'classes/security/UploadFileFilter.class.php');
1154 1154
 	return UploadFileFilter::check($file);
1155 1155
 }
1156 1156
 
@@ -1164,13 +1164,13 @@  discard block
 block discarded – undo
1164 1164
 {
1165 1165
 	$content = preg_replace('@<(/?)xmp.*?>@i', '<\1xmp>', $content);
1166 1166
 
1167
-	if(($start_xmp = strrpos($content, '<xmp>')) !== FALSE)
1167
+	if (($start_xmp = strrpos($content, '<xmp>')) !== FALSE)
1168 1168
 	{
1169
-		if(($close_xmp = strrpos($content, '</xmp>')) === FALSE)
1169
+		if (($close_xmp = strrpos($content, '</xmp>')) === FALSE)
1170 1170
 		{
1171 1171
 			$content .= '</xmp>';
1172 1172
 		}
1173
-		else if($close_xmp < $start_xmp)
1173
+		else if ($close_xmp < $start_xmp)
1174 1174
 		{
1175 1175
 			$content .= '</xmp>';
1176 1176
 		}
@@ -1190,33 +1190,33 @@  discard block
 block discarded – undo
1190 1190
 	$tag = strtolower($match[2]);
1191 1191
 
1192 1192
 	// xmp tag ?뺣━
1193
-	if($tag == 'xmp')
1193
+	if ($tag == 'xmp')
1194 1194
 	{
1195 1195
 		return "<{$match[1]}xmp>";
1196 1196
 	}
1197
-	if($match[1])
1197
+	if ($match[1])
1198 1198
 	{
1199 1199
 		return $match[0];
1200 1200
 	}
1201
-	if($match[4])
1201
+	if ($match[4])
1202 1202
 	{
1203
-		$match[4] = ' ' . $match[4];
1203
+		$match[4] = ' '.$match[4];
1204 1204
 	}
1205 1205
 
1206 1206
 	$attrs = array();
1207
-	if(preg_match_all('/([\w:-]+)\s*=(?:\s*(["\']))?(?(2)(.*?)\2|([^ ]+))/s', $match[3], $m))
1207
+	if (preg_match_all('/([\w:-]+)\s*=(?:\s*(["\']))?(?(2)(.*?)\2|([^ ]+))/s', $match[3], $m))
1208 1208
 	{
1209
-		foreach($m[1] as $idx => $name)
1209
+		foreach ($m[1] as $idx => $name)
1210 1210
 		{
1211
-			if(strlen($name) >= 2 && substr_compare($name, 'on', 0, 2) === 0)
1211
+			if (strlen($name) >= 2 && substr_compare($name, 'on', 0, 2) === 0)
1212 1212
 			{
1213 1213
 				continue;
1214 1214
 			}
1215 1215
 
1216
-			$val = preg_replace_callback('/&#(?:x([a-fA-F0-9]+)|0*(\d+));/', function($n) {return chr($n[1] ? ('0x00' . $n[1]) : ($n[2] + 0)); }, $m[3][$idx] . $m[4][$idx]);
1216
+			$val = preg_replace_callback('/&#(?:x([a-fA-F0-9]+)|0*(\d+));/', function($n) {return chr($n[1] ? ('0x00'.$n[1]) : ($n[2] + 0)); }, $m[3][$idx].$m[4][$idx]);
1217 1217
 			$val = preg_replace('/^\s+|[\t\n\r]+/', '', $val);
1218 1218
 
1219
-			if(preg_match('/^[a-z]+script:/i', $val))
1219
+			if (preg_match('/^[a-z]+script:/i', $val))
1220 1220
 			{
1221 1221
 				continue;
1222 1222
 			}
@@ -1227,60 +1227,60 @@  discard block
 block discarded – undo
1227 1227
 
1228 1228
 	$filter_arrts = array('style', 'src', 'href');
1229 1229
 
1230
-	if($tag === 'object') array_push($filter_arrts, 'data');
1231
-	if($tag === 'param') array_push($filter_arrts, 'value');
1230
+	if ($tag === 'object') array_push($filter_arrts, 'data');
1231
+	if ($tag === 'param') array_push($filter_arrts, 'value');
1232 1232
 
1233
-	foreach($filter_arrts as $attr)
1233
+	foreach ($filter_arrts as $attr)
1234 1234
 	{
1235
-		if(!isset($attrs[$attr])) continue;
1235
+		if (!isset($attrs[$attr])) continue;
1236 1236
 
1237 1237
 		$attr_value = rawurldecode($attrs[$attr]);
1238 1238
 		$attr_value = htmlspecialchars_decode($attr_value, ENT_COMPAT);
1239 1239
 		$attr_value = preg_replace('/\s+|[\t\n\r]+/', '', $attr_value);
1240
-		if(preg_match('@(\?|&|;)(act=(\w+))@i', $attr_value, $m) && $m[3] !== 'procFileDownload')
1240
+		if (preg_match('@(\?|&|;)(act=(\w+))@i', $attr_value, $m) && $m[3] !== 'procFileDownload')
1241 1241
 		{
1242 1242
 			unset($attrs[$attr]);
1243 1243
 		}
1244 1244
 	}
1245 1245
 
1246
-	if(isset($attrs['style']) && preg_match('@(?:/\*|\*/|\n|:\s*expression\s*\()@i', $attrs['style']))
1246
+	if (isset($attrs['style']) && preg_match('@(?:/\*|\*/|\n|:\s*expression\s*\()@i', $attrs['style']))
1247 1247
 	{
1248 1248
 		unset($attrs['style']);
1249 1249
 	}
1250 1250
 
1251 1251
 	$attr = array();
1252
-	foreach($attrs as $name => $val)
1252
+	foreach ($attrs as $name => $val)
1253 1253
 	{
1254
-		if($tag == 'object' || $tag == 'embed' || $tag == 'a')
1254
+		if ($tag == 'object' || $tag == 'embed' || $tag == 'a')
1255 1255
 		{
1256 1256
 			$attribute = strtolower(trim($name));
1257
-			if($attribute == 'data' || $attribute == 'src' || $attribute == 'href')
1257
+			if ($attribute == 'data' || $attribute == 'src' || $attribute == 'href')
1258 1258
 			{
1259
-				if(stripos($val, 'data:') === 0)
1259
+				if (stripos($val, 'data:') === 0)
1260 1260
 				{
1261 1261
 					continue;
1262 1262
 				}
1263 1263
 			}
1264 1264
 		}
1265 1265
 
1266
-		if($tag == 'img')
1266
+		if ($tag == 'img')
1267 1267
 		{
1268 1268
 			$attribute = strtolower(trim($name));
1269
-			if(stripos($val, 'data:') === 0)
1269
+			if (stripos($val, 'data:') === 0)
1270 1270
 			{
1271 1271
 				continue;
1272 1272
 			}
1273 1273
 		}
1274 1274
 		$val = str_replace('"', '&quot;', $val);
1275
-		$attr[] = $name . "=\"{$val}\"";
1275
+		$attr[] = $name."=\"{$val}\"";
1276 1276
 	}
1277
-	$attr = count($attr) ? ' ' . implode(' ', $attr) : '';
1277
+	$attr = count($attr) ? ' '.implode(' ', $attr) : '';
1278 1278
 
1279 1279
 	return "<{$match[1]}{$tag}{$attr}{$match[4]}>";
1280 1280
 }
1281 1281
 
1282 1282
 // convert hexa value to RGB
1283
-if(!function_exists('hexrgb'))
1283
+if (!function_exists('hexrgb'))
1284 1284
 {
1285 1285
 
1286 1286
 	/**
@@ -1316,9 +1316,9 @@  discard block
 block discarded – undo
1316 1316
 
1317 1317
 	settype($password, "string");
1318 1318
 
1319
-	for($i = 0; $i < strlen($password); $i++)
1319
+	for ($i = 0; $i < strlen($password); $i++)
1320 1320
 	{
1321
-		if($password[$i] == ' ' || $password[$i] == '\t')
1321
+		if ($password[$i] == ' ' || $password[$i] == '\t')
1322 1322
 		{
1323 1323
 			continue;
1324 1324
 		}
@@ -1330,11 +1330,11 @@  discard block
 block discarded – undo
1330 1330
 	$result1 = sprintf("%08lx", $nr & ((1 << 31) - 1));
1331 1331
 	$result2 = sprintf("%08lx", $nr2 & ((1 << 31) - 1));
1332 1332
 
1333
-	if($result1 == '80000000')
1333
+	if ($result1 == '80000000')
1334 1334
 	{
1335 1335
 		$nr += 0x80000000;
1336 1336
 	}
1337
-	if($result2 == '80000000')
1337
+	if ($result2 == '80000000')
1338 1338
 	{
1339 1339
 		$nr2 += 0x80000000;
1340 1340
 	}
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
 function getScriptPath()
1351 1351
 {
1352 1352
 	static $url = NULL;
1353
-	if($url == NULL)
1353
+	if ($url == NULL)
1354 1354
 	{
1355 1355
 		$script_path = filter_var($_SERVER['SCRIPT_NAME'], FILTER_SANITIZE_STRING);
1356 1356
 		$url = str_ireplace('/tools/', '/', preg_replace('/index.php.*/i', '', str_replace('\\', '/', $script_path)));
@@ -1381,14 +1381,14 @@  discard block
 block discarded – undo
1381 1381
 	$decodedStr = '';
1382 1382
 	$pos = 0;
1383 1383
 	$len = strlen($source);
1384
-	while($pos < $len)
1384
+	while ($pos < $len)
1385 1385
 	{
1386 1386
 		$charAt = substr($source, $pos, 1);
1387
-		if($charAt == '%')
1387
+		if ($charAt == '%')
1388 1388
 		{
1389 1389
 			$pos++;
1390 1390
 			$charAt = substr($source, $pos, 1);
1391
-			if($charAt == 'u')
1391
+			if ($charAt == 'u')
1392 1392
 			{
1393 1393
 				// we got a unicode character
1394 1394
 				$pos++;
@@ -1422,21 +1422,21 @@  discard block
 block discarded – undo
1422 1422
  */
1423 1423
 function _code2utf($num)
1424 1424
 {
1425
-	if($num < 128)
1425
+	if ($num < 128)
1426 1426
 	{
1427 1427
 		return chr($num);
1428 1428
 	}
1429
-	if($num < 2048)
1429
+	if ($num < 2048)
1430 1430
 	{
1431
-		return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
1431
+		return chr(($num >> 6) + 192).chr(($num & 63) + 128);
1432 1432
 	}
1433
-	if($num < 65536)
1433
+	if ($num < 65536)
1434 1434
 	{
1435
-		return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
1435
+		return chr(($num >> 12) + 224).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128);
1436 1436
 	}
1437
-	if($num < 2097152)
1437
+	if ($num < 2097152)
1438 1438
 	{
1439
-		return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
1439
+		return chr(($num >> 18) + 240).chr((($num >> 12) & 63) + 128).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128);
1440 1440
 	}
1441 1441
 	return '';
1442 1442
 }
@@ -1451,7 +1451,7 @@  discard block
 block discarded – undo
1451 1451
  */
1452 1452
 function detectUTF8($string, $return_convert = FALSE, $urldecode = TRUE)
1453 1453
 {
1454
-	if($urldecode)
1454
+	if ($urldecode)
1455 1455
 	{
1456 1456
 		$string = urldecode($string);
1457 1457
 	}
@@ -1459,12 +1459,12 @@  discard block
 block discarded – undo
1459 1459
 	$sample = iconv('utf-8', 'utf-8', $string);
1460 1460
 	$is_utf8 = (md5($sample) === md5($string));
1461 1461
 
1462
-	if(!$urldecode)
1462
+	if (!$urldecode)
1463 1463
 	{
1464 1464
 		$string = urldecode($string);
1465 1465
 	}
1466 1466
 
1467
-	if($return_convert)
1467
+	if ($return_convert)
1468 1468
 	{
1469 1469
 		return ($is_utf8) ? $string : iconv('euc-kr', 'utf-8', $string);
1470 1470
 	}
@@ -1480,7 +1480,7 @@  discard block
 block discarded – undo
1480 1480
  */
1481 1481
 function json_encode2($data)
1482 1482
 {
1483
-	switch(gettype($data))
1483
+	switch (gettype($data))
1484 1484
 	{
1485 1485
 		case 'boolean':
1486 1486
 			return $data ? 'true' : 'false';
@@ -1488,15 +1488,15 @@  discard block
 block discarded – undo
1488 1488
 		case 'double':
1489 1489
 			return $data;
1490 1490
 		case 'string':
1491
-			return '"' . strtr($data, array('\\' => '\\\\', '"' => '\\"')) . '"';
1491
+			return '"'.strtr($data, array('\\' => '\\\\', '"' => '\\"')).'"';
1492 1492
 		case 'object':
1493 1493
 			$data = get_object_vars($data);
1494 1494
 		case 'array':
1495 1495
 			$rel = FALSE; // relative array?
1496 1496
 			$key = array_keys($data);
1497
-			foreach($key as $v)
1497
+			foreach ($key as $v)
1498 1498
 			{
1499
-				if(!is_int($v))
1499
+				if (!is_int($v))
1500 1500
 				{
1501 1501
 					$rel = TRUE;
1502 1502
 					break;
@@ -1504,12 +1504,12 @@  discard block
 block discarded – undo
1504 1504
 			}
1505 1505
 
1506 1506
 			$arr = array();
1507
-			foreach($data as $k => $v)
1507
+			foreach ($data as $k => $v)
1508 1508
 			{
1509
-				$arr[] = ($rel ? '"' . strtr($k, array('\\' => '\\\\', '"' => '\\"')) . '":' : '') . json_encode2($v);
1509
+				$arr[] = ($rel ? '"'.strtr($k, array('\\' => '\\\\', '"' => '\\"')).'":' : '').json_encode2($v);
1510 1510
 			}
1511 1511
 
1512
-			return $rel ? '{' . join(',', $arr) . '}' : '[' . join(',', $arr) . ']';
1512
+			return $rel ? '{'.join(',', $arr).'}' : '['.join(',', $arr).']';
1513 1513
 		default:
1514 1514
 			return '""';
1515 1515
 	}
@@ -1523,7 +1523,7 @@  discard block
 block discarded – undo
1523 1523
  */
1524 1524
 function isCrawler($agent = NULL)
1525 1525
 {
1526
-	if(!$agent)
1526
+	if (!$agent)
1527 1527
 	{
1528 1528
 		$agent = $_SERVER['HTTP_USER_AGENT'];
1529 1529
 	}
@@ -1533,9 +1533,9 @@  discard block
 block discarded – undo
1533 1533
 		/*'211.245.21.110-211.245.21.119' mixsh is closed */
1534 1534
 	);
1535 1535
 
1536
-	foreach($check_agent as $str)
1536
+	foreach ($check_agent as $str)
1537 1537
 	{
1538
-		if(stristr($agent, $str) != FALSE)
1538
+		if (stristr($agent, $str) != FALSE)
1539 1539
 		{
1540 1540
 			return TRUE;
1541 1541
 		}
@@ -1553,7 +1553,7 @@  discard block
 block discarded – undo
1553 1553
  */
1554 1554
 function stripEmbedTagForAdmin(&$content, $writer_member_srl)
1555 1555
 {
1556
-	if(!Context::get('is_logged'))
1556
+	if (!Context::get('is_logged'))
1557 1557
 	{
1558 1558
 		return;
1559 1559
 	}
@@ -1561,18 +1561,18 @@  discard block
 block discarded – undo
1561 1561
 	$oModuleModel = getModel('module');
1562 1562
 	$logged_info = Context::get('logged_info');
1563 1563
 
1564
-	if($writer_member_srl != $logged_info->member_srl && ($logged_info->is_admin == "Y" || $oModuleModel->isSiteAdmin($logged_info)))
1564
+	if ($writer_member_srl != $logged_info->member_srl && ($logged_info->is_admin == "Y" || $oModuleModel->isSiteAdmin($logged_info)))
1565 1565
 	{
1566
-		if($writer_member_srl)
1566
+		if ($writer_member_srl)
1567 1567
 		{
1568 1568
 			$oMemberModel = getModel('member');
1569 1569
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($writer_member_srl);
1570
-			if($member_info->is_admin == "Y")
1570
+			if ($member_info->is_admin == "Y")
1571 1571
 			{
1572 1572
 				return;
1573 1573
 			}
1574 1574
 		}
1575
-		$security_msg = "<div style='border: 1px solid #DDD; background: #FAFAFA; text-align:center; margin: 1em 0;'><p style='margin: 1em;'>" . Context::getLang('security_warning_embed') . "</p></div>";
1575
+		$security_msg = "<div style='border: 1px solid #DDD; background: #FAFAFA; text-align:center; margin: 1em 0;'><p style='margin: 1em;'>".Context::getLang('security_warning_embed')."</p></div>";
1576 1576
 		$content = preg_replace('/<object[^>]+>(.*?<\/object>)?/is', $security_msg, $content);
1577 1577
 		$content = preg_replace('/<embed[^>]+>(\s*<\/embed>)?/is', $security_msg, $content);
1578 1578
 		$content = preg_replace('/<img[^>]+editor_component="multimedia_link"[^>]*>(\s*<\/img>)?/is', $security_msg, $content);
@@ -1589,18 +1589,18 @@  discard block
 block discarded – undo
1589 1589
 function requirePear()
1590 1590
 {
1591 1591
 	static $required = false;
1592
-	if($required)
1592
+	if ($required)
1593 1593
 	{
1594 1594
 		return;
1595 1595
 	}
1596 1596
 
1597
-	if(version_compare(PHP_VERSION, "5.3.0") < 0)
1597
+	if (version_compare(PHP_VERSION, "5.3.0") < 0)
1598 1598
 	{
1599
-		set_include_path(_XE_PATH_ . "libs/PEAR" . PATH_SEPARATOR . get_include_path());
1599
+		set_include_path(_XE_PATH_."libs/PEAR".PATH_SEPARATOR.get_include_path());
1600 1600
 	}
1601 1601
 	else
1602 1602
 	{
1603
-		set_include_path(_XE_PATH_ . "libs/PEAR.1.9.5" . PATH_SEPARATOR . get_include_path());
1603
+		set_include_path(_XE_PATH_."libs/PEAR.1.9.5".PATH_SEPARATOR.get_include_path());
1604 1604
 	}
1605 1605
 
1606 1606
 	$required = true;
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
 
1609 1609
 function checkCSRF()
1610 1610
 {
1611
-	if($_SERVER['REQUEST_METHOD'] != 'POST')
1611
+	if ($_SERVER['REQUEST_METHOD'] != 'POST')
1612 1612
 	{
1613 1613
 		return FALSE;
1614 1614
 	}
@@ -1616,9 +1616,9 @@  discard block
 block discarded – undo
1616 1616
 	$default_url = Context::getDefaultUrl();
1617 1617
 	$referer = $_SERVER["HTTP_REFERER"];
1618 1618
 
1619
-	if(strpos($default_url, 'xn--') !== FALSE && strpos($referer, 'xn--') === FALSE)
1619
+	if (strpos($default_url, 'xn--') !== FALSE && strpos($referer, 'xn--') === FALSE)
1620 1620
 	{
1621
-		require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php');
1621
+		require_once(_XE_PATH_.'libs/idna_convert/idna_convert.class.php');
1622 1622
 		$IDN = new idna_convert(array('idn_version' => 2008));
1623 1623
 		$referer = $IDN->encode($referer);
1624 1624
 	}
@@ -1629,9 +1629,9 @@  discard block
 block discarded – undo
1629 1629
 	$oModuleModel = getModel('module');
1630 1630
 	$siteModuleInfo = $oModuleModel->getDefaultMid();
1631 1631
 
1632
-	if($siteModuleInfo->site_srl == 0)
1632
+	if ($siteModuleInfo->site_srl == 0)
1633 1633
 	{
1634
-		if($default_url['host'] !== $referer['host'])
1634
+		if ($default_url['host'] !== $referer['host'])
1635 1635
 		{
1636 1636
 			return FALSE;
1637 1637
 		}
@@ -1639,7 +1639,7 @@  discard block
 block discarded – undo
1639 1639
 	else
1640 1640
 	{
1641 1641
 		$virtualSiteInfo = $oModuleModel->getSiteInfo($siteModuleInfo->site_srl);
1642
-		if(strtolower($virtualSiteInfo->domain) != strtolower(Context::get('vid')) && !strstr(strtolower($virtualSiteInfo->domain), strtolower($referer['host'])))
1642
+		if (strtolower($virtualSiteInfo->domain) != strtolower(Context::get('vid')) && !strstr(strtolower($virtualSiteInfo->domain), strtolower($referer['host'])))
1643 1643
 		{
1644 1644
 			return FALSE;
1645 1645
 		}
@@ -1655,15 +1655,15 @@  discard block
 block discarded – undo
1655 1655
  */
1656 1656
 function recurciveExposureCheck(&$menu)
1657 1657
 {
1658
-	if(is_array($menu))
1658
+	if (is_array($menu))
1659 1659
 	{
1660
-		foreach($menu AS $key=>$value)
1660
+		foreach ($menu AS $key=>$value)
1661 1661
 		{
1662
-			if(!$value['isShow'])
1662
+			if (!$value['isShow'])
1663 1663
 			{
1664 1664
 				unset($menu[$key]);
1665 1665
 			}
1666
-			if(is_array($value['list']) && count($value['list']) > 0)
1666
+			if (is_array($value['list']) && count($value['list']) > 0)
1667 1667
 			{
1668 1668
 				recurciveExposureCheck($menu[$key]['list']);
1669 1669
 			}
@@ -1673,14 +1673,14 @@  discard block
 block discarded – undo
1673 1673
 
1674 1674
 function changeValueInUrl($key, $requestKey, $dbKey, $urlName = 'success_return_url')
1675 1675
 {
1676
-	if($requestKey != $dbKey)
1676
+	if ($requestKey != $dbKey)
1677 1677
 	{
1678 1678
 		$arrayUrl = parse_url(Context::get('success_return_url'));
1679
-		if($arrayUrl['query'])
1679
+		if ($arrayUrl['query'])
1680 1680
 		{
1681 1681
 			parse_str($arrayUrl['query'], $parsedStr);
1682 1682
 
1683
-			if(isset($parsedStr[$key]))
1683
+			if (isset($parsedStr[$key]))
1684 1684
 			{
1685 1685
 				$parsedStr[$key] = $requestKey;
1686 1686
 				$successReturnUrl .= $arrayUrl['path'].'?'.http_build_query($parsedStr);
@@ -1723,14 +1723,14 @@  discard block
 block discarded – undo
1723 1723
  */
1724 1724
 function alertScript($msg)
1725 1725
 {
1726
-	if(!$msg)
1726
+	if (!$msg)
1727 1727
 	{
1728 1728
 		return;
1729 1729
 	}
1730 1730
 
1731 1731
 	echo '<script type="text/javascript">
1732 1732
 //<![CDATA[
1733
-alert("' . $msg . '");
1733
+alert("' . $msg.'");
1734 1734
 //]]>
1735 1735
 </script>';
1736 1736
 }
@@ -1761,7 +1761,7 @@  discard block
 block discarded – undo
1761 1761
 
1762 1762
 	echo '<script type="text/javascript">
1763 1763
 //<![CDATA[
1764
-' . $reloadScript . '
1764
+' . $reloadScript.'
1765 1765
 //]]>
1766 1766
 </script>';
1767 1767
 }
Please login to merge, or discard this patch.
classes/mobile/Mobile.class.php 2 patches
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	function &getInstance()
24 24
 	{
25 25
 		static $theInstance;
26
-		if(!isset($theInstance))
26
+		if (!isset($theInstance))
27 27
 		{
28 28
 			$theInstance = new Mobile();
29 29
 		}
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	function _isFromMobilePhone()
50 50
 	{
51
-		if($this->ismobile !== NULL)
51
+		if ($this->ismobile !== NULL)
52 52
 		{
53 53
 			return $this->ismobile;
54 54
 		}
55
-		if(Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"])
55
+		if (Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"])
56 56
 		{
57 57
 			return ($this->ismobile = false);
58 58
 		}
@@ -63,22 +63,22 @@  discard block
 block discarded – undo
63 63
 		$this->ismobile = FALSE;
64 64
 
65 65
 		$m = Context::get('m');
66
-		if(strlen($m) == 1)
66
+		if (strlen($m) == 1)
67 67
 		{
68
-			if($m == "1")
68
+			if ($m == "1")
69 69
 			{
70 70
 				$this->ismobile = TRUE;
71 71
 			}
72
-			elseif($m == "0")
72
+			elseif ($m == "0")
73 73
 			{
74 74
 				$this->ismobile = FALSE;
75 75
 			}
76 76
 		}
77
-		elseif(isset($_COOKIE['mobile']))
77
+		elseif (isset($_COOKIE['mobile']))
78 78
 		{
79
-			if($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT']))
79
+			if ($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT']))
80 80
 			{
81
-				if($_COOKIE['mobile'] == 'true')
81
+				if ($_COOKIE['mobile'] == 'true')
82 82
 				{
83 83
 					$this->ismobile = TRUE;
84 84
 				}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 				$this->ismobile = FALSE;
93 93
 				setcookie("mobile", FALSE);
94 94
 				setcookie("user-agent", FALSE);
95
-				if(!$this->isMobilePadCheckByAgent() && $this->isMobileCheckByAgent())
95
+				if (!$this->isMobilePadCheckByAgent() && $this->isMobileCheckByAgent())
96 96
 				{
97 97
 					$this->ismobile = TRUE;
98 98
 				}
@@ -100,36 +100,36 @@  discard block
 block discarded – undo
100 100
 		}
101 101
 		else
102 102
 		{
103
-			if($this->isMobilePadCheckByAgent())
103
+			if ($this->isMobilePadCheckByAgent())
104 104
 			{
105 105
 				$this->ismobile = FALSE;
106 106
 			}
107 107
 			else
108 108
 			{
109
-				if($this->isMobileCheckByAgent())
109
+				if ($this->isMobileCheckByAgent())
110 110
 				{
111 111
 					$this->ismobile = TRUE;
112 112
 				}
113 113
 			}
114 114
 		}
115 115
 
116
-		if($this->ismobile !== NULL)
116
+		if ($this->ismobile !== NULL)
117 117
 		{
118
-			if($this->ismobile == TRUE)
118
+			if ($this->ismobile == TRUE)
119 119
 			{
120
-				if($_COOKIE['mobile'] != 'true')
120
+				if ($_COOKIE['mobile'] != 'true')
121 121
 				{
122 122
 					$_COOKIE['mobile'] = 'true';
123 123
 					setcookie("mobile", 'true');
124 124
 				}
125 125
 			}
126
-			elseif($_COOKIE['mobile'] != 'false')
126
+			elseif ($_COOKIE['mobile'] != 'false')
127 127
 			{
128 128
 				$_COOKIE['mobile'] = 'false';
129 129
 				setcookie("mobile", 'false');
130 130
 			}
131 131
 
132
-			if($_COOKIE['user-agent'] != md5($_SERVER['HTTP_USER_AGENT']))
132
+			if ($_COOKIE['user-agent'] != md5($_SERVER['HTTP_USER_AGENT']))
133 133
 			{
134 134
 				setcookie("user-agent", md5($_SERVER['HTTP_USER_AGENT']));
135 135
 			}
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	function isMobileCheckByAgent()
147 147
 	{
148 148
 		static $UACheck;
149
-		if(isset($UACheck))
149
+		if (isset($UACheck))
150 150
 		{
151 151
 			return $UACheck;
152 152
 		}
@@ -154,15 +154,15 @@  discard block
 block discarded – undo
154 154
 		$oMobile = Mobile::getInstance();
155 155
 		$mobileAgent = array('iPod', 'iPhone', 'Android', 'BlackBerry', 'SymbianOS', 'Bada', 'Tizen', 'Kindle', 'Wii', 'SCH-', 'SPH-', 'CANU-', 'Windows Phone', 'Windows CE', 'POLARIS', 'Palm', 'Dorothy Browser', 'Mobile', 'Opera Mobi', 'Opera Mini', 'Minimo', 'AvantGo', 'NetFront', 'Nokia', 'LGPlayer', 'SonyEricsson', 'HTC');
156 156
 
157
-		if($oMobile->isMobilePadCheckByAgent())
157
+		if ($oMobile->isMobilePadCheckByAgent())
158 158
 		{
159 159
 			$UACheck = TRUE;
160 160
 			return TRUE;
161 161
 		}
162 162
 
163
-		foreach($mobileAgent as $agent)
163
+		foreach ($mobileAgent as $agent)
164 164
 		{
165
-			if(stripos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
165
+			if (stripos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
166 166
 			{
167 167
 				$UACheck = TRUE;
168 168
 				return TRUE;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	function isMobilePadCheckByAgent()
181 181
 	{
182 182
 		static $UACheck;
183
-		if(isset($UACheck))
183
+		if (isset($UACheck))
184 184
 		{
185 185
 			return $UACheck;
186 186
 		}
@@ -190,21 +190,21 @@  discard block
 block discarded – undo
190 190
 		// $exceptionAgent[0] contains exception agents for all exceptions.
191 191
 		$exceptionAgent = array(0 => array('Opera Mini', 'Opera Mobi'), 'Android' => 'Mobile');
192 192
 
193
-		foreach($padAgent as $agent)
193
+		foreach ($padAgent as $agent)
194 194
 		{
195
-			if(strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
195
+			if (strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
196 196
 			{
197
-				if(!isset($exceptionAgent[$agent]))
197
+				if (!isset($exceptionAgent[$agent]))
198 198
 				{
199 199
 					$UACheck = TRUE;
200 200
 					return TRUE;
201 201
 				}
202
-				elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
202
+				elseif (strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
203 203
 				{
204 204
 					// If the agent is the Android, that can be either tablet and mobile phone.
205
-					foreach($exceptionAgent[0] as $val)
205
+					foreach ($exceptionAgent[0] as $val)
206 206
 					{
207
-						if(strpos($_SERVER['HTTP_USER_AGENT'], $val) !== FALSE)
207
+						if (strpos($_SERVER['HTTP_USER_AGENT'], $val) !== FALSE)
208 208
 						{
209 209
 							$UACheck = FALSE;
210 210
 							return FALSE;
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -68,26 +68,22 @@  discard block
 block discarded – undo
68 68
 			if($m == "1")
69 69
 			{
70 70
 				$this->ismobile = TRUE;
71
-			}
72
-			elseif($m == "0")
71
+			} elseif($m == "0")
73 72
 			{
74 73
 				$this->ismobile = FALSE;
75 74
 			}
76
-		}
77
-		elseif(isset($_COOKIE['mobile']))
75
+		} elseif(isset($_COOKIE['mobile']))
78 76
 		{
79 77
 			if($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT']))
80 78
 			{
81 79
 				if($_COOKIE['mobile'] == 'true')
82 80
 				{
83 81
 					$this->ismobile = TRUE;
84
-				}
85
-				else
82
+				} else
86 83
 				{
87 84
 					$this->ismobile = FALSE;
88 85
 				}
89
-			}
90
-			else
86
+			} else
91 87
 			{
92 88
 				$this->ismobile = FALSE;
93 89
 				setcookie("mobile", FALSE);
@@ -97,14 +93,12 @@  discard block
 block discarded – undo
97 93
 					$this->ismobile = TRUE;
98 94
 				}
99 95
 			}
100
-		}
101
-		else
96
+		} else
102 97
 		{
103 98
 			if($this->isMobilePadCheckByAgent())
104 99
 			{
105 100
 				$this->ismobile = FALSE;
106
-			}
107
-			else
101
+			} else
108 102
 			{
109 103
 				if($this->isMobileCheckByAgent())
110 104
 				{
@@ -122,8 +116,7 @@  discard block
 block discarded – undo
122 116
 					$_COOKIE['mobile'] = 'true';
123 117
 					setcookie("mobile", 'true');
124 118
 				}
125
-			}
126
-			elseif($_COOKIE['mobile'] != 'false')
119
+			} elseif($_COOKIE['mobile'] != 'false')
127 120
 			{
128 121
 				$_COOKIE['mobile'] = 'false';
129 122
 				setcookie("mobile", 'false');
@@ -198,8 +191,7 @@  discard block
 block discarded – undo
198 191
 				{
199 192
 					$UACheck = TRUE;
200 193
 					return TRUE;
201
-				}
202
-				elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
194
+				} elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
203 195
 				{
204 196
 					// If the agent is the Android, that can be either tablet and mobile phone.
205 197
 					foreach($exceptionAgent[0] as $val)
Please login to merge, or discard this patch.
classes/context/Context.class.php 2 patches
Braces   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -230,7 +230,9 @@  discard block
 block discarded – undo
230 230
 		$this->loadDBInfo();
231 231
 		if($this->db_info->use_sitelock == 'Y')
232 232
 		{
233
-			if(is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
233
+			if(is_array($this->db_info->sitelock_whitelist)) {
234
+				$whitelist = $this->db_info->sitelock_whitelist;
235
+			}
234 236
 
235 237
 			if(!IpFilter::filter($whitelist))
236 238
 			{
@@ -245,8 +247,7 @@  discard block
 block discarded – undo
245 247
 				if(FileHandler::exists(_XE_PATH_ . 'common/tpl/sitelock.user.html'))
246 248
 				{
247 249
 					include _XE_PATH_ . 'common/tpl/sitelock.user.html';
248
-				}
249
-				else
250
+				} else
250 251
 				{
251 252
 					include _XE_PATH_ . 'common/tpl/sitelock.html';
252 253
 				}
@@ -303,8 +304,7 @@  discard block
 block discarded – undo
303 304
 			{
304 305
 				setcookie('lang_type', $this->lang_type, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000);
305 306
 			}
306
-		}
307
-		elseif($_COOKIE['lang_type'])
307
+		} elseif($_COOKIE['lang_type'])
308 308
 		{
309 309
 			$this->lang_type = $_COOKIE['lang_type'];
310 310
 		}
@@ -341,7 +341,9 @@  discard block
 block discarded – undo
341 341
 			);
342 342
 		}
343 343
 
344
-		if($sess = $_POST[session_name()]) session_id($sess);
344
+		if($sess = $_POST[session_name()]) {
345
+			session_id($sess);
346
+		}
345 347
 		session_start();
346 348
 
347 349
 		// set authentication information in Context and session
@@ -394,22 +396,21 @@  discard block
 block discarded – undo
394 396
 						{
395 397
 							$url[] = $key . '[' . $k . ']=' . urlencode($v);
396 398
 						}
397
-					}
398
-					elseif($val)
399
+					} elseif($val)
399 400
 					{
400 401
 						$url[] = $key . '=' . urlencode($val);
401 402
 					}
402 403
 				}
403 404
 
404 405
 				$current_url = self::getRequestUri();
405
-				if($url) $current_url .= '?' . join('&', $url);
406
-			}
407
-			else
406
+				if($url) {
407
+					$current_url .= '?' . join('&', $url);
408
+				}
409
+			} else
408 410
 			{
409 411
 				$current_url = $this->getUrl();
410 412
 			}
411
-		}
412
-		else
413
+		} else
413 414
 		{
414 415
 			$current_url = self::getRequestUri();
415 416
 		}
@@ -490,18 +491,22 @@  discard block
 block discarded – undo
490 491
 			$db_info->use_prepared_statements = 'Y';
491 492
 		}
492 493
 
493
-		if(!$db_info->time_zone)
494
-			$db_info->time_zone = date('O');
494
+		if(!$db_info->time_zone) {
495
+					$db_info->time_zone = date('O');
496
+		}
495 497
 		$GLOBALS['_time_zone'] = $db_info->time_zone;
496 498
 
497
-		if($db_info->qmail_compatibility != 'Y')
498
-			$db_info->qmail_compatibility = 'N';
499
+		if($db_info->qmail_compatibility != 'Y') {
500
+					$db_info->qmail_compatibility = 'N';
501
+		}
499 502
 		$GLOBALS['_qmail_compatibility'] = $db_info->qmail_compatibility;
500 503
 
501
-		if(!$db_info->use_db_session)
502
-			$db_info->use_db_session = 'N';
503
-		if(!$db_info->use_ssl)
504
-			$db_info->use_ssl = 'none';
504
+		if(!$db_info->use_db_session) {
505
+					$db_info->use_db_session = 'N';
506
+		}
507
+		if(!$db_info->use_ssl) {
508
+					$db_info->use_ssl = 'none';
509
+		}
505 510
 		$this->set('_use_ssl', $db_info->use_ssl);
506 511
 
507 512
 		$self->set('_http_port', ($db_info->http_port) ? $db_info->http_port : NULL);
@@ -618,8 +623,7 @@  discard block
 block discarded – undo
618 623
 				$buff = FileHandler::readFile($orig_lang_file);
619 624
 				FileHandler::writeFile($selected_lang_file, $buff);
620 625
 				$lang_selected = self::loadLangSupported();
621
-			}
622
-			else
626
+			} else
623 627
 			{
624 628
 				$langs = file($selected_lang_file);
625 629
 				foreach($langs as $val)
@@ -678,15 +682,16 @@  discard block
 block discarded – undo
678 682
 
679 683
 				$oModuleModel = getModel('module');
680 684
 				$domain = $url_info['host'] . $url_info['path'];
681
-				if(substr_compare($domain, '/', -1) === 0) $domain = substr($domain, 0, -1);
685
+				if(substr_compare($domain, '/', -1) === 0) {
686
+					$domain = substr($domain, 0, -1);
687
+				}
682 688
 				$site_info = $oModuleModel->getSiteInfoByDomain($domain);
683 689
 
684 690
 				if($site_info->site_srl)
685 691
 				{
686 692
 				$url_info['query'].= ($url_info['query'] ? '&' : '') . 'SSOID=' . urlencode(session_id()) . '&sig=' . urlencode(Password::createSignature(session_id()));
687 693
 				$redirect_url = sprintf('%s://%s%s%s?%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':' . $url_info['port'] : '', $url_info['path'], $url_info['query']);
688
-				}
689
-				else
694
+				} else
690 695
 				{
691 696
 					$redirect_url = $url;
692 697
 				}
@@ -695,8 +700,7 @@  discard block
 block discarded – undo
695 700
 				return FALSE;
696 701
 			}
697 702
 			// for sites requesting SSO validation
698
-		}
699
-		else
703
+		} else
700 704
 		{
701 705
 			// result handling : set session_name()
702 706
 			if($session_name = self::get('SSOID'))
@@ -713,8 +717,7 @@  discard block
 block discarded – undo
713 717
 				header('location:' . $url);
714 718
 				return FALSE;
715 719
 				// send SSO request
716
-			}
717
-			else if(!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
720
+			} else if(!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
718 721
 			{
719 722
 				setcookie('sso', md5(self::getRequestUri()));
720 723
 				$origin_url = self::getRequestUrl();
@@ -774,8 +777,7 @@  discard block
 block discarded – undo
774 777
 		if($self->site_title)
775 778
 		{
776 779
 			$self->site_title .= ' - ' . $site_title;
777
-		}
778
-		else
780
+		} else
779 781
 		{
780 782
 			$self->site_title = $site_title;
781 783
 		}
@@ -875,8 +877,7 @@  discard block
 block discarded – undo
875 877
 		{
876 878
 			$self->loaded_lang_files[] = $filename;
877 879
 			include($filename);
878
-		}
879
-		else
880
+		} else
880 881
 		{
881 882
 			$self->_evalxmlLang($path);
882 883
 		}
@@ -892,7 +893,9 @@  discard block
 block discarded – undo
892 893
 	{
893 894
 		global $lang;
894 895
 
895
-		if(!$path) return;
896
+		if(!$path) {
897
+			return;
898
+		}
896 899
 
897 900
 		$_path = 'eval://' . $path;
898 901
 
@@ -924,7 +927,9 @@  discard block
 block discarded – undo
924 927
 	 */
925 928
 	function _loadXmlLang($path)
926 929
 	{
927
-		if(!$path) return;
930
+		if(!$path) {
931
+			return;
932
+		}
928 933
 
929 934
 		$oXmlLangParser = new XmlLangParser($path . ((substr_compare($path, '/', -1) !== 0) ? '/' : '') . 'lang.xml', $this->lang_type);
930 935
 		return $oXmlLangParser->compile();
@@ -938,7 +943,9 @@  discard block
 block discarded – undo
938 943
 	 */
939 944
 	function _loadPhpLang($path)
940 945
 	{
941
-		if(!$path) return;
946
+		if(!$path) {
947
+			return;
948
+		}
942 949
 
943 950
 		if(substr_compare($path, '/', -1) !== 0)
944 951
 		{
@@ -1074,12 +1081,14 @@  discard block
 block discarded – undo
1074 1081
 		static $flag = TRUE;
1075 1082
 		if($charset)
1076 1083
 		{
1077
-			if(is_array($val))
1078
-				array_walk($val,'Context::checkConvertFlag',$charset);
1079
-			else if($val && iconv($charset,$charset,$val)!=$val) $flag = FALSE;
1080
-			else $flag = FALSE;
1081
-		}
1082
-		else
1084
+			if(is_array($val)) {
1085
+							array_walk($val,'Context::checkConvertFlag',$charset);
1086
+			} else if($val && iconv($charset,$charset,$val)!=$val) {
1087
+				$flag = FALSE;
1088
+			} else {
1089
+				$flag = FALSE;
1090
+			}
1091
+		} else
1083 1092
 		{
1084 1093
 			$return = $flag;
1085 1094
 			$flag = TRUE;
@@ -1101,8 +1110,9 @@  discard block
 block discarded – undo
1101 1110
 		if (is_array($val))
1102 1111
 		{
1103 1112
 			array_walk($val,'Context::doConvertEncoding',$charset);
1113
+		} else {
1114
+			$val = iconv($charset,'UTF-8',$val);
1104 1115
 		}
1105
-		else $val = iconv($charset,'UTF-8',$val);
1106 1116
 	}
1107 1117
 
1108 1118
 	/**
@@ -1113,7 +1123,9 @@  discard block
 block discarded – undo
1113 1123
 	 */
1114 1124
 	function convertEncodingStr($str)
1115 1125
 	{
1116
-        if(!$str) return null;
1126
+        if(!$str) {
1127
+        	return null;
1128
+        }
1117 1129
 		$obj = new stdClass();
1118 1130
 		$obj->str = $str;
1119 1131
 		$obj = self::convertEncoding($obj);
@@ -1226,16 +1238,13 @@  discard block
 block discarded – undo
1226 1238
 			if($requestMethod == 'GET' && isset($_GET[$key]))
1227 1239
 			{
1228 1240
 				$set_to_vars = TRUE;
1229
-			}
1230
-			elseif($requestMethod == 'POST' && isset($_POST[$key]))
1241
+			} elseif($requestMethod == 'POST' && isset($_POST[$key]))
1231 1242
 			{
1232 1243
 				$set_to_vars = TRUE;
1233
-			}
1234
-			elseif($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1244
+			} elseif($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1235 1245
 			{
1236 1246
 				$set_to_vars = TRUE;
1237
-			}
1238
-			else
1247
+			} else
1239 1248
 			{
1240 1249
 				$set_to_vars = FALSE;
1241 1250
 			}
@@ -1261,8 +1270,7 @@  discard block
 block discarded – undo
1261 1270
 					return;
1262 1271
 				}
1263 1272
 			}
1264
-		}
1265
-		else if(is_array($val))
1273
+		} else if(is_array($val))
1266 1274
 		{
1267 1275
 			foreach($val as $val2)
1268 1276
 			{
@@ -1402,24 +1410,19 @@  discard block
 block discarded – undo
1402 1410
 			if($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
1403 1411
 			{
1404 1412
 				$result[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int) $v : $v;
1405
-			}
1406
-			elseif($key === 'mid' || $key === 'search_keyword')
1413
+			} elseif($key === 'mid' || $key === 'search_keyword')
1407 1414
 			{
1408 1415
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1409
-			}
1410
-			elseif($key === 'vid')
1416
+			} elseif($key === 'vid')
1411 1417
 			{
1412 1418
 				$result[$k] = urlencode($v);
1413
-			}
1414
-			elseif($key === 'xe_validator_id')
1419
+			} elseif($key === 'xe_validator_id')
1415 1420
 			{
1416 1421
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1417
-			}
1418
-			elseif(stripos($key, 'XE_VALIDATOR', 0) === 0)
1422
+			} elseif(stripos($key, 'XE_VALIDATOR', 0) === 0)
1419 1423
 			{
1420 1424
 				unset($result[$k]);
1421
-			}
1422
-			else
1425
+			} else
1423 1426
 			{
1424 1427
 				$result[$k] = $v;
1425 1428
 
@@ -1428,8 +1431,7 @@  discard block
 block discarded – undo
1428 1431
 					if (is_array($result[$k]))
1429 1432
 					{
1430 1433
 						array_walk_recursive($result[$k], function(&$val) { $val = stripslashes($val); });
1431
-					}
1432
-					else
1434
+					} else
1433 1435
 					{
1434 1436
 						$result[$k] = stripslashes($result[$k]);
1435 1437
 					}
@@ -1438,8 +1440,7 @@  discard block
 block discarded – undo
1438 1440
 				if(is_array($result[$k]))
1439 1441
 				{
1440 1442
 					array_walk_recursive($result[$k], function(&$val) { $val = trim($val); });
1441
-				}
1442
-				else
1443
+				} else
1443 1444
 				{
1444 1445
 					$result[$k] = trim($result[$k]);
1445 1446
 				}
@@ -1484,8 +1485,7 @@  discard block
 block discarded – undo
1484 1485
 				$val['name'] = htmlspecialchars($val['name'], ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1485 1486
 				$this->set($key, $val, TRUE);
1486 1487
 				$this->is_uploaded = TRUE;
1487
-			}
1488
-			else
1488
+			} else
1489 1489
 			{
1490 1490
 				$files = array();
1491 1491
 				$count_files = count($tmp_name);
@@ -1503,7 +1503,9 @@  discard block
 block discarded – undo
1503 1503
 						$files[] = $file;
1504 1504
 					}
1505 1505
 				}
1506
-				if($files) $this->set($key, $files, TRUE);
1506
+				if($files) {
1507
+					$this->set($key, $files, TRUE);
1508
+				}
1507 1509
 			}
1508 1510
 		}
1509 1511
 	}
@@ -1595,8 +1597,7 @@  discard block
 block discarded – undo
1595 1597
 			if($site_module_info->domain && isSiteID($site_module_info->domain))
1596 1598
 			{
1597 1599
 				$vid = $site_module_info->domain;
1598
-			}
1599
-			else
1600
+			} else
1600 1601
 			{
1601 1602
 				$domain = $site_module_info->domain;
1602 1603
 			}
@@ -1613,8 +1614,7 @@  discard block
 block discarded – undo
1613 1614
 			if($domain_info['host'] . $domain_info['path'] == $current_info['host'] . $current_info['path'])
1614 1615
 			{
1615 1616
 				unset($domain);
1616
-			}
1617
-			else
1617
+			} else
1618 1618
 			{
1619 1619
 				$domain = preg_replace('/^(http|https):\/\//i', '', trim($domain));
1620 1620
 				if(substr_compare($domain, '/', -1) !== 0)
@@ -1634,23 +1634,35 @@  discard block
 block discarded – undo
1634 1634
 			{
1635 1635
 				array_shift($args_list);
1636 1636
 			}
1637
-		}
1638
-		elseif($_SERVER['REQUEST_METHOD'] == 'GET')
1637
+		} elseif($_SERVER['REQUEST_METHOD'] == 'GET')
1639 1638
 		{
1640 1639
 			// Otherwise, make GET variables into array
1641 1640
 			$get_vars = get_object_vars($self->get_vars);
1642
-		}
1643
-		else
1641
+		} else
1644 1642
 		{
1645
-			if(!!$self->get_vars->module) $get_vars['module'] = $self->get_vars->module;
1646
-			if(!!$self->get_vars->mid) $get_vars['mid'] = $self->get_vars->mid;
1647
-			if(!!$self->get_vars->act) $get_vars['act'] = $self->get_vars->act;
1648
-			if(!!$self->get_vars->page) $get_vars['page'] = $self->get_vars->page;
1649
-			if(!!$self->get_vars->search_target) $get_vars['search_target'] = $self->get_vars->search_target;
1650
-			if(!!$self->get_vars->search_keyword) $get_vars['search_keyword'] = $self->get_vars->search_keyword;
1643
+			if(!!$self->get_vars->module) {
1644
+				$get_vars['module'] = $self->get_vars->module;
1645
+			}
1646
+			if(!!$self->get_vars->mid) {
1647
+				$get_vars['mid'] = $self->get_vars->mid;
1648
+			}
1649
+			if(!!$self->get_vars->act) {
1650
+				$get_vars['act'] = $self->get_vars->act;
1651
+			}
1652
+			if(!!$self->get_vars->page) {
1653
+				$get_vars['page'] = $self->get_vars->page;
1654
+			}
1655
+			if(!!$self->get_vars->search_target) {
1656
+				$get_vars['search_target'] = $self->get_vars->search_target;
1657
+			}
1658
+			if(!!$self->get_vars->search_keyword) {
1659
+				$get_vars['search_keyword'] = $self->get_vars->search_keyword;
1660
+			}
1651 1661
 			if($get_vars['act'] == 'IS')
1652 1662
 			{
1653
-				if(!!$self->get_vars->is_keyword) $get_vars['is_keyword'] = $self->get_vars->is_keyword;
1663
+				if(!!$self->get_vars->is_keyword) {
1664
+					$get_vars['is_keyword'] = $self->get_vars->is_keyword;
1665
+				}
1654 1666
 			}
1655 1667
 		}
1656 1668
 
@@ -1675,8 +1687,7 @@  discard block
 block discarded – undo
1675 1687
 		if($vid)
1676 1688
 		{
1677 1689
 			$get_vars['vid'] = $vid;
1678
-		}
1679
-		else
1690
+		} else
1680 1691
 		{
1681 1692
 			unset($get_vars['vid']);
1682 1693
 		}
@@ -1748,8 +1759,7 @@  discard block
 block discarded – undo
1748 1759
 						{
1749 1760
 							$queries[] = $key . '[' . $k . ']=' . urlencode($v);
1750 1761
 						}
1751
-					}
1752
-					elseif(!is_array($val))
1762
+					} elseif(!is_array($val))
1753 1763
 					{
1754 1764
 						$queries[] = $key . '=' . urlencode($val);
1755 1765
 					}
@@ -1767,25 +1777,23 @@  discard block
 block discarded – undo
1767 1777
 		{
1768 1778
 			$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1769 1779
 			// optional SSL use
1770
-		}
1771
-		elseif($_use_ssl == 'optional')
1780
+		} elseif($_use_ssl == 'optional')
1772 1781
 		{
1773 1782
 			$ssl_mode = (($self->get('module') === 'admin') || ($get_vars['module'] === 'admin') || (isset($get_vars['act']) && $self->isExistsSSLAction($get_vars['act']))) ? ENFORCE_SSL : RELEASE_SSL;
1774 1783
 			$query = $self->getRequestUri($ssl_mode, $domain) . $query;
1775 1784
 			// no SSL
1776
-		}
1777
-		else
1785
+		} else
1778 1786
 		{
1779 1787
 			// currently on SSL but target is not based on SSL
1780 1788
 			if($_SERVER['HTTPS'] == 'on')
1781 1789
 			{
1782 1790
 				$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1783
-			}
1784
-			else if($domain) // if $domain is set
1791
+			} else if($domain) {
1792
+				// if $domain is set
1785 1793
 			{
1786 1794
 				$query = $self->getRequestUri(FOLLOW_REQUEST_SSL, $domain) . $query;
1787 1795
 			}
1788
-			else
1796
+			} else
1789 1797
 			{
1790 1798
 				$query = getScriptPath() . $query;
1791 1799
 			}
@@ -1842,8 +1850,7 @@  discard block
 block discarded – undo
1842 1850
 		if($domain)
1843 1851
 		{
1844 1852
 			$domain_key = md5($domain);
1845
-		}
1846
-		else
1853
+		} else
1847 1854
 		{
1848 1855
 			$domain_key = 'default';
1849 1856
 		}
@@ -1872,8 +1879,7 @@  discard block
 block discarded – undo
1872 1879
 			{
1873 1880
 				$target_url.= '/';
1874 1881
 			}
1875
-		}
1876
-		else
1882
+		} else
1877 1883
 		{
1878 1884
 			$target_url = $_SERVER['HTTP_HOST'] . getScriptPath();
1879 1885
 		}
@@ -1891,20 +1897,17 @@  discard block
 block discarded – undo
1891 1897
 			if($port && $port != 443)
1892 1898
 			{
1893 1899
 				$url_info['port'] = $port;
1894
-			}
1895
-			elseif($url_info['port'] == 443)
1900
+			} elseif($url_info['port'] == 443)
1896 1901
 			{
1897 1902
 				unset($url_info['port']);
1898 1903
 			}
1899
-		}
1900
-		else
1904
+		} else
1901 1905
 		{
1902 1906
 			$port = self::get('_http_port');
1903 1907
 			if($port && $port != 80)
1904 1908
 			{
1905 1909
 				$url_info['port'] = $port;
1906
-			}
1907
-			elseif($url_info['port'] == 80)
1910
+			} elseif($url_info['port'] == 80)
1908 1911
 			{
1909 1912
 				unset($url_info['port']);
1910 1913
 			}
@@ -2141,8 +2144,7 @@  discard block
 block discarded – undo
2141 2144
 		if(strpos($file, './') === 0)
2142 2145
 		{
2143 2146
 			$file = $script_path . substr($file, 2);
2144
-		}
2145
-		elseif(strpos($file, '../') === 0)
2147
+		} elseif(strpos($file, '../') === 0)
2146 2148
 		{
2147 2149
 			$file = self::normalizeFilePath($script_path . $file);
2148 2150
 		}
@@ -2404,8 +2406,7 @@  discard block
 block discarded – undo
2404 2406
 			if(substr_compare($filename, '.js', -3) === 0)
2405 2407
 			{
2406 2408
 				$result->jsList[] = $plugin_path . $filename;
2407
-			}
2408
-			elseif(substr_compare($filename, '.css', -4) === 0)
2409
+			} elseif(substr_compare($filename, '.css', -4) === 0)
2409 2410
 			{
2410 2411
 				$result->cssList[] = $plugin_path . $filename;
2411 2412
 			}
@@ -2662,8 +2663,7 @@  discard block
 block discarded – undo
2662 2663
 			if(count($_base) > 0)
2663 2664
 			{
2664 2665
 				array_shift($_base);
2665
-			}
2666
-			else
2666
+			} else
2667 2667
 			{
2668 2668
 				array_unshift($_base, '..');
2669 2669
 			}
Please login to merge, or discard this patch.
Spacing   +310 added lines, -310 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	function &getInstance()
163 163
 	{
164 164
 		static $theInstance = null;
165
-		if(!$theInstance)
165
+		if (!$theInstance)
166 166
 		{
167 167
 			$theInstance = new Context();
168 168
 		}
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
 
183 183
 		// include ssl action cache file
184 184
 		$this->sslActionCacheFile = FileHandler::getRealPath($this->sslActionCacheFile);
185
-		if(is_readable($this->sslActionCacheFile))
185
+		if (is_readable($this->sslActionCacheFile))
186 186
 		{
187 187
 			require($this->sslActionCacheFile);
188
-			if(isset($sslActions))
188
+			if (isset($sslActions))
189 189
 			{
190 190
 				$this->ssl_actions = $sslActions;
191 191
 			}
@@ -201,12 +201,12 @@  discard block
 block discarded – undo
201 201
 	function init()
202 202
 	{
203 203
 		// fix missing HTTP_RAW_POST_DATA in PHP 5.6 and above
204
-		if(!isset($GLOBALS['HTTP_RAW_POST_DATA']) && version_compare(PHP_VERSION, '5.6.0', '>=') === TRUE)
204
+		if (!isset($GLOBALS['HTTP_RAW_POST_DATA']) && version_compare(PHP_VERSION, '5.6.0', '>=') === TRUE)
205 205
 		{
206 206
 			$GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents("php://input");
207 207
 			
208 208
 			// If content is not XML JSON, unset
209
-			if(!preg_match('/^[\<\{\[]/', $GLOBALS['HTTP_RAW_POST_DATA']) && strpos($_SERVER['CONTENT_TYPE'], 'json') === FALSE && strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json') === FALSE)
209
+			if (!preg_match('/^[\<\{\[]/', $GLOBALS['HTTP_RAW_POST_DATA']) && strpos($_SERVER['CONTENT_TYPE'], 'json') === FALSE && strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json') === FALSE)
210 210
 			{
211 211
 				unset($GLOBALS['HTTP_RAW_POST_DATA']);
212 212
 			}
@@ -228,11 +228,11 @@  discard block
 block discarded – undo
228 228
 		$this->_setUploadedArgument();
229 229
 
230 230
 		$this->loadDBInfo();
231
-		if($this->db_info->use_sitelock == 'Y')
231
+		if ($this->db_info->use_sitelock == 'Y')
232 232
 		{
233
-			if(is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
233
+			if (is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
234 234
 
235
-			if(!IpFilter::filter($whitelist))
235
+			if (!IpFilter::filter($whitelist))
236 236
 			{
237 237
 				$title = ($this->db_info->sitelock_title) ? $this->db_info->sitelock_title : 'Maintenance in progress...';
238 238
 				$message = $this->db_info->sitelock_message;
@@ -242,52 +242,52 @@  discard block
 block discarded – undo
242 242
 				define('_XE_SITELOCK_MESSAGE_', $message);
243 243
 
244 244
 				header("HTTP/1.1 403 Forbidden");
245
-				if(FileHandler::exists(_XE_PATH_ . 'common/tpl/sitelock.user.html'))
245
+				if (FileHandler::exists(_XE_PATH_.'common/tpl/sitelock.user.html'))
246 246
 				{
247
-					include _XE_PATH_ . 'common/tpl/sitelock.user.html';
247
+					include _XE_PATH_.'common/tpl/sitelock.user.html';
248 248
 				}
249 249
 				else
250 250
 				{
251
-					include _XE_PATH_ . 'common/tpl/sitelock.html';
251
+					include _XE_PATH_.'common/tpl/sitelock.html';
252 252
 				}
253 253
 				exit;
254 254
 			}
255 255
 		}
256 256
 
257 257
 		// If XE is installed, get virtual site information
258
-		if(self::isInstalled())
258
+		if (self::isInstalled())
259 259
 		{
260 260
 			$oModuleModel = getModel('module');
261 261
 			$site_module_info = $oModuleModel->getDefaultMid();
262 262
 
263
-			if(!isset($site_module_info))
263
+			if (!isset($site_module_info))
264 264
 			{
265 265
 				$site_module_info = new stdClass();
266 266
 			}
267 267
 
268 268
 			// if site_srl of site_module_info is 0 (default site), compare the domain to default_url of db_config
269
-			if($site_module_info->site_srl == 0 && $site_module_info->domain != $this->db_info->default_url)
269
+			if ($site_module_info->site_srl == 0 && $site_module_info->domain != $this->db_info->default_url)
270 270
 			{
271 271
 				$site_module_info->domain = $this->db_info->default_url;
272 272
 			}
273 273
 
274 274
 			$this->set('site_module_info', $site_module_info);
275
-			if($site_module_info->site_srl && isSiteID($site_module_info->domain))
275
+			if ($site_module_info->site_srl && isSiteID($site_module_info->domain))
276 276
 			{
277 277
 				$this->set('vid', $site_module_info->domain, TRUE);
278 278
 			}
279 279
 
280
-			if(!isset($this->db_info))
280
+			if (!isset($this->db_info))
281 281
 			{
282 282
 				$this->db_info = new stdClass();
283 283
 			}
284 284
 
285 285
 			$this->db_info->lang_type = $site_module_info->default_language;
286
-			if(!$this->db_info->lang_type)
286
+			if (!$this->db_info->lang_type)
287 287
 			{
288 288
 				$this->db_info->lang_type = 'en';
289 289
 			}
290
-			if(!$this->db_info->use_db_session)
290
+			if (!$this->db_info->use_db_session)
291 291
 			{
292 292
 				$this->db_info->use_db_session = 'N';
293 293
 			}
@@ -297,30 +297,30 @@  discard block
 block discarded – undo
297 297
 		$lang_supported = $this->loadLangSelected();
298 298
 
299 299
 		// Retrieve language type set in user's cookie
300
-		if($this->lang_type = $this->get('l'))
300
+		if ($this->lang_type = $this->get('l'))
301 301
 		{
302
-			if($_COOKIE['lang_type'] != $this->lang_type)
302
+			if ($_COOKIE['lang_type'] != $this->lang_type)
303 303
 			{
304 304
 				setcookie('lang_type', $this->lang_type, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000);
305 305
 			}
306 306
 		}
307
-		elseif($_COOKIE['lang_type'])
307
+		elseif ($_COOKIE['lang_type'])
308 308
 		{
309 309
 			$this->lang_type = $_COOKIE['lang_type'];
310 310
 		}
311 311
 
312 312
 		// If it's not exists, follow default language type set in db_info
313
-		if(!$this->lang_type)
313
+		if (!$this->lang_type)
314 314
 		{
315 315
 			$this->lang_type = $this->db_info->lang_type;
316 316
 		}
317 317
 
318 318
 		// if still lang_type has not been set or has not-supported type , set as English.
319
-		if(!$this->lang_type)
319
+		if (!$this->lang_type)
320 320
 		{
321 321
 			$this->lang_type = 'en';
322 322
 		}
323
-		if(is_array($lang_supported) && !isset($lang_supported[$this->lang_type]))
323
+		if (is_array($lang_supported) && !isset($lang_supported[$this->lang_type]))
324 324
 		{
325 325
 			$this->lang_type = 'en';
326 326
 		}
@@ -329,10 +329,10 @@  discard block
 block discarded – undo
329 329
 		$this->setLangType($this->lang_type);
330 330
 
331 331
 		// load module module's language file according to language setting
332
-		$this->loadLang(_XE_PATH_ . 'modules/module/lang');
332
+		$this->loadLang(_XE_PATH_.'modules/module/lang');
333 333
 
334 334
 		// set session handler
335
-		if(self::isInstalled() && $this->db_info->use_db_session == 'Y')
335
+		if (self::isInstalled() && $this->db_info->use_db_session == 'Y')
336 336
 		{
337 337
 			$oSessionModel = getModel('session');
338 338
 			$oSessionController = getController('session');
@@ -341,11 +341,11 @@  discard block
 block discarded – undo
341 341
 			);
342 342
 		}
343 343
 
344
-		if($sess = $_POST[session_name()]) session_id($sess);
344
+		if ($sess = $_POST[session_name()]) session_id($sess);
345 345
 		session_start();
346 346
 
347 347
 		// set authentication information in Context and session
348
-		if(self::isInstalled())
348
+		if (self::isInstalled())
349 349
 		{
350 350
 			$oModuleModel = getModel('module');
351 351
 			$oModuleModel->loadModuleExtends();
@@ -353,15 +353,15 @@  discard block
 block discarded – undo
353 353
 			$oMemberModel = getModel('member');
354 354
 			$oMemberController = getController('member');
355 355
 
356
-			if($oMemberController && $oMemberModel)
356
+			if ($oMemberController && $oMemberModel)
357 357
 			{
358 358
 				// if signed in, validate it.
359
-				if($oMemberModel->isLogged())
359
+				if ($oMemberModel->isLogged())
360 360
 				{
361 361
 					$oMemberController->setSessionInfo();
362 362
 				}
363 363
 				// check auto sign-in
364
-				elseif($_COOKIE['xeak'])
364
+				elseif ($_COOKIE['xeak'])
365 365
 				{
366 366
 					$oMemberController->doAutologin();
367 367
 				}
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 
374 374
 		// load common language file
375 375
 		$this->lang = &$GLOBALS['lang'];
376
-		$this->loadLang(_XE_PATH_ . 'common/lang/');
376
+		$this->loadLang(_XE_PATH_.'common/lang/');
377 377
 
378 378
 		// check if using rewrite module
379 379
 		$this->allow_rewrite = ($this->db_info->use_rewrite == 'Y' ? TRUE : FALSE);
@@ -381,28 +381,28 @@  discard block
 block discarded – undo
381 381
 		// set locations for javascript use
382 382
 		$url = array();
383 383
 		$current_url = self::getRequestUri();
384
-		if($_SERVER['REQUEST_METHOD'] == 'GET')
384
+		if ($_SERVER['REQUEST_METHOD'] == 'GET')
385 385
 		{
386
-			if($this->get_vars)
386
+			if ($this->get_vars)
387 387
 			{
388 388
 				$url = array();
389
-				foreach($this->get_vars as $key => $val)
389
+				foreach ($this->get_vars as $key => $val)
390 390
 				{
391
-					if(is_array($val) && count($val) > 0)
391
+					if (is_array($val) && count($val) > 0)
392 392
 					{
393
-						foreach($val as $k => $v)
393
+						foreach ($val as $k => $v)
394 394
 						{
395
-							$url[] = $key . '[' . $k . ']=' . urlencode($v);
395
+							$url[] = $key.'['.$k.']='.urlencode($v);
396 396
 						}
397 397
 					}
398
-					elseif($val)
398
+					elseif ($val)
399 399
 					{
400
-						$url[] = $key . '=' . urlencode($val);
400
+						$url[] = $key.'='.urlencode($val);
401 401
 					}
402 402
 				}
403 403
 
404 404
 				$current_url = self::getRequestUri();
405
-				if($url) $current_url .= '?' . join('&', $url);
405
+				if ($url) $current_url .= '?'.join('&', $url);
406 406
 			}
407 407
 			else
408 408
 			{
@@ -417,12 +417,12 @@  discard block
 block discarded – undo
417 417
 		$this->set('current_url', $current_url);
418 418
 		$this->set('request_uri', self::getRequestUri());
419 419
 
420
-		if(strpos($current_url, 'xn--') !== FALSE)
420
+		if (strpos($current_url, 'xn--') !== FALSE)
421 421
 		{
422 422
 			$this->set('current_url', self::decodeIdna($current_url));
423 423
 		}
424 424
 
425
-		if(strpos(self::getRequestUri(), 'xn--') !== FALSE)
425
+		if (strpos(self::getRequestUri(), 'xn--') !== FALSE)
426 426
 		{
427 427
 			$this->set('request_uri', self::decodeIdna(self::getRequestUri()));
428 428
 		}
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 	{
448 448
 		$self = self::getInstance();
449 449
 
450
-		if(!$self->isInstalled())
450
+		if (!$self->isInstalled())
451 451
 		{
452 452
 			return;
453 453
 		}
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 		ob_end_clean();
458 458
 
459 459
 		// If master_db information does not exist, the config file needs to be updated
460
-		if(!isset($db_info->master_db))
460
+		if (!isset($db_info->master_db))
461 461
 		{
462 462
 			$db_info->master_db = array();
463 463
 			$db_info->master_db["db_type"] = $db_info->db_type;
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 			$db_info->master_db["db_table_prefix"] = $db_info->db_table_prefix;
476 476
 			unset($db_info->db_table_prefix);
477 477
 
478
-			if(isset($db_info->master_db["db_table_prefix"]) && substr_compare($db_info->master_db["db_table_prefix"], '_', -1) !== 0)
478
+			if (isset($db_info->master_db["db_table_prefix"]) && substr_compare($db_info->master_db["db_table_prefix"], '_', -1) !== 0)
479 479
 			{
480 480
 				$db_info->master_db["db_table_prefix"] .= '_';
481 481
 			}
@@ -487,33 +487,33 @@  discard block
 block discarded – undo
487 487
 			$oInstallController->makeConfigFile();
488 488
 		}
489 489
 
490
-		if(!$db_info->use_prepared_statements)
490
+		if (!$db_info->use_prepared_statements)
491 491
 		{
492 492
 			$db_info->use_prepared_statements = 'Y';
493 493
 		}
494 494
 
495
-		if(!$db_info->time_zone)
495
+		if (!$db_info->time_zone)
496 496
 			$db_info->time_zone = date('O');
497 497
 		$GLOBALS['_time_zone'] = $db_info->time_zone;
498 498
 
499
-		if($db_info->qmail_compatibility != 'Y')
499
+		if ($db_info->qmail_compatibility != 'Y')
500 500
 			$db_info->qmail_compatibility = 'N';
501 501
 		$GLOBALS['_qmail_compatibility'] = $db_info->qmail_compatibility;
502 502
 
503
-		if(!$db_info->use_db_session)
503
+		if (!$db_info->use_db_session)
504 504
 			$db_info->use_db_session = 'N';
505
-		if(!$db_info->use_ssl)
505
+		if (!$db_info->use_ssl)
506 506
 			$db_info->use_ssl = 'none';
507 507
 		$this->set('_use_ssl', $db_info->use_ssl);
508 508
 
509 509
 		$self->set('_http_port', ($db_info->http_port) ? $db_info->http_port : NULL);
510 510
 		$self->set('_https_port', ($db_info->https_port) ? $db_info->https_port : NULL);
511 511
 
512
-		if(!$db_info->sitelock_whitelist) {
512
+		if (!$db_info->sitelock_whitelist) {
513 513
 			$db_info->sitelock_whitelist = '127.0.0.1';
514 514
 		}
515 515
 
516
-		if(is_string($db_info->sitelock_whitelist)) {
516
+		if (is_string($db_info->sitelock_whitelist)) {
517 517
 			$db_info->sitelock_whitelist = explode(',', $db_info->sitelock_whitelist);
518 518
 		}
519 519
 
@@ -584,10 +584,10 @@  discard block
 block discarded – undo
584 584
 	function loadLangSupported()
585 585
 	{
586 586
 		static $lang_supported = null;
587
-		if(!$lang_supported)
587
+		if (!$lang_supported)
588 588
 		{
589
-			$langs = file(_XE_PATH_ . 'common/lang/lang.info');
590
-			foreach($langs as $val)
589
+			$langs = file(_XE_PATH_.'common/lang/lang.info');
590
+			foreach ($langs as $val)
591 591
 			{
592 592
 				list($lang_prefix, $lang_text) = explode(',', $val);
593 593
 				$lang_text = trim($lang_text);
@@ -605,17 +605,17 @@  discard block
 block discarded – undo
605 605
 	function loadLangSelected()
606 606
 	{
607 607
 		static $lang_selected = null;
608
-		if(!$lang_selected)
608
+		if (!$lang_selected)
609 609
 		{
610
-			$orig_lang_file = _XE_PATH_ . 'common/lang/lang.info';
611
-			$selected_lang_file = _XE_PATH_ . 'files/config/lang_selected.info';
612
-			if(!FileHandler::hasContent($selected_lang_file))
610
+			$orig_lang_file = _XE_PATH_.'common/lang/lang.info';
611
+			$selected_lang_file = _XE_PATH_.'files/config/lang_selected.info';
612
+			if (!FileHandler::hasContent($selected_lang_file))
613 613
 			{
614
-				$old_selected_lang_file = _XE_PATH_ . 'files/cache/lang_selected.info';
614
+				$old_selected_lang_file = _XE_PATH_.'files/cache/lang_selected.info';
615 615
 				FileHandler::moveFile($old_selected_lang_file, $selected_lang_file);
616 616
 			}
617 617
 
618
-			if(!FileHandler::hasContent($selected_lang_file))
618
+			if (!FileHandler::hasContent($selected_lang_file))
619 619
 			{
620 620
 				$buff = FileHandler::readFile($orig_lang_file);
621 621
 				FileHandler::writeFile($selected_lang_file, $buff);
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 			else
625 625
 			{
626 626
 				$langs = file($selected_lang_file);
627
-				foreach($langs as $val)
627
+				foreach ($langs as $val)
628 628
 				{
629 629
 					list($lang_prefix, $lang_text) = explode(',', $val);
630 630
 					$lang_text = trim($lang_text);
@@ -643,56 +643,56 @@  discard block
 block discarded – undo
643 643
 	function checkSSO()
644 644
 	{
645 645
 		// pass if it's not GET request or XE is not yet installed
646
-		if($this->db_info->use_sso != 'Y' || isCrawler())
646
+		if ($this->db_info->use_sso != 'Y' || isCrawler())
647 647
 		{
648 648
 			return TRUE;
649 649
 		}
650 650
 		$checkActList = array('rss' => 1, 'atom' => 1);
651
-		if(self::getRequestMethod() != 'GET' || !self::isInstalled() || isset($checkActList[self::get('act')]))
651
+		if (self::getRequestMethod() != 'GET' || !self::isInstalled() || isset($checkActList[self::get('act')]))
652 652
 		{
653 653
 			return TRUE;
654 654
 		}
655 655
 
656 656
 		// pass if default URL is not set
657 657
 		$default_url = trim($this->db_info->default_url);
658
-		if(!$default_url)
658
+		if (!$default_url)
659 659
 		{
660 660
 			return TRUE;
661 661
 		}
662 662
 
663
-		if(substr_compare($default_url, '/', -1) !== 0)
663
+		if (substr_compare($default_url, '/', -1) !== 0)
664 664
 		{
665 665
 			$default_url .= '/';
666 666
 		}
667 667
 
668 668
 		// for sites recieving SSO valdiation
669
-		if($default_url == self::getRequestUri())
669
+		if ($default_url == self::getRequestUri())
670 670
 		{
671
-			if(self::get('url'))
671
+			if (self::get('url'))
672 672
 			{
673 673
 				$url = base64_decode(self::get('url'));
674 674
 				$url_info = parse_url($url);
675
-				if(!Password::checkSignature($url, self::get('sig')))
675
+				if (!Password::checkSignature($url, self::get('sig')))
676 676
 				{
677 677
 					echo self::get('lang')->msg_invalid_request;
678 678
 					return false;
679 679
 				}
680 680
 
681 681
 				$oModuleModel = getModel('module');
682
-				$domain = $url_info['host'] . $url_info['path'];
683
-				if(substr_compare($domain, '/', -1) === 0) $domain = substr($domain, 0, -1);
682
+				$domain = $url_info['host'].$url_info['path'];
683
+				if (substr_compare($domain, '/', -1) === 0) $domain = substr($domain, 0, -1);
684 684
 				$site_info = $oModuleModel->getSiteInfoByDomain($domain);
685 685
 
686
-				if($site_info->site_srl)
686
+				if ($site_info->site_srl)
687 687
 				{
688
-				$url_info['query'].= ($url_info['query'] ? '&' : '') . 'SSOID=' . urlencode(session_id()) . '&sig=' . urlencode(Password::createSignature(session_id()));
689
-				$redirect_url = sprintf('%s://%s%s%s?%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':' . $url_info['port'] : '', $url_info['path'], $url_info['query']);
688
+				$url_info['query'] .= ($url_info['query'] ? '&' : '').'SSOID='.urlencode(session_id()).'&sig='.urlencode(Password::createSignature(session_id()));
689
+				$redirect_url = sprintf('%s://%s%s%s?%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':'.$url_info['port'] : '', $url_info['path'], $url_info['query']);
690 690
 				}
691 691
 				else
692 692
 				{
693 693
 					$redirect_url = $url;
694 694
 				}
695
-				header('location:' . $redirect_url);
695
+				header('location:'.$redirect_url);
696 696
 
697 697
 				return FALSE;
698 698
 			}
@@ -701,9 +701,9 @@  discard block
 block discarded – undo
701 701
 		else
702 702
 		{
703 703
 			// result handling : set session_name()
704
-			if($session_name = self::get('SSOID'))
704
+			if ($session_name = self::get('SSOID'))
705 705
 			{
706
-				if(!Password::checkSignature($session_name, self::get('sig')))
706
+				if (!Password::checkSignature($session_name, self::get('sig')))
707 707
 				{
708 708
 					echo self::get('lang')->msg_invalid_request;
709 709
 					return false;
@@ -712,17 +712,17 @@  discard block
 block discarded – undo
712 712
 				setcookie(session_name(), $session_name);
713 713
 
714 714
 				$url = preg_replace('/[\?\&]SSOID=.+$/', '', self::getRequestUrl());
715
-				header('location:' . $url);
715
+				header('location:'.$url);
716 716
 				return FALSE;
717 717
 				// send SSO request
718 718
 			}
719
-			else if(!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
719
+			else if (!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
720 720
 			{
721 721
 				setcookie('sso', md5(self::getRequestUri()));
722 722
 				$origin_url = self::getRequestUrl();
723 723
 				$origin_sig = Password::createSignature($origin_url);
724 724
 				$url = sprintf("%s?url=%s&sig=%s", $default_url, urlencode(base64_encode($origin_url)), urlencode($origin_sig));
725
-				header('location:' . $url);
725
+				header('location:'.$url);
726 726
 				return FALSE;
727 727
 			}
728 728
 		}
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 	{
750 750
 		$self = self::getInstance();
751 751
 
752
-		if(!$self->isFTPRegisted())
752
+		if (!$self->isFTPRegisted())
753 753
 		{
754 754
 			return null;
755 755
 		}
@@ -767,15 +767,15 @@  discard block
 block discarded – undo
767 767
 	 */
768 768
 	function addBrowserTitle($site_title)
769 769
 	{
770
-		if(!$site_title)
770
+		if (!$site_title)
771 771
 		{
772 772
 			return;
773 773
 		}
774 774
 		$self = self::getInstance();
775 775
 
776
-		if($self->site_title)
776
+		if ($self->site_title)
777 777
 		{
778
-			$self->site_title .= ' - ' . $site_title;
778
+			$self->site_title .= ' - '.$site_title;
779 779
 		}
780 780
 		else
781 781
 		{
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 	 */
792 792
 	function setBrowserTitle($site_title)
793 793
 	{
794
-		if(!$site_title)
794
+		if (!$site_title)
795 795
 		{
796 796
 			return;
797 797
 		}
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 		$oModuleModel = getModel('module');
824 824
 		$moduleConfig = $oModuleModel->getModuleConfig('module');
825 825
 
826
-		if(isset($moduleConfig->siteTitle))
826
+		if (isset($moduleConfig->siteTitle))
827 827
 		{
828 828
 			return $moduleConfig->siteTitle;
829 829
 		}
@@ -850,30 +850,30 @@  discard block
 block discarded – undo
850 850
 		global $lang;
851 851
 
852 852
 		$self = self::getInstance();
853
-		if(!$self->lang_type)
853
+		if (!$self->lang_type)
854 854
 		{
855 855
 			return;
856 856
 		}
857
-		if(!is_object($lang))
857
+		if (!is_object($lang))
858 858
 		{
859 859
 			$lang = new stdClass;
860 860
 		}
861 861
 
862
-		if(!($filename = $self->_loadXmlLang($path)))
862
+		if (!($filename = $self->_loadXmlLang($path)))
863 863
 		{
864 864
 			$filename = $self->_loadPhpLang($path);
865 865
 		}
866 866
 
867
-		if(!is_array($self->loaded_lang_files))
867
+		if (!is_array($self->loaded_lang_files))
868 868
 		{
869 869
 			$self->loaded_lang_files = array();
870 870
 		}
871
-		if(in_array($filename, $self->loaded_lang_files))
871
+		if (in_array($filename, $self->loaded_lang_files))
872 872
 		{
873 873
 			return;
874 874
 		}
875 875
 
876
-		if($filename && is_readable($filename))
876
+		if ($filename && is_readable($filename))
877 877
 		{
878 878
 			$self->loaded_lang_files[] = $filename;
879 879
 			include($filename);
@@ -894,24 +894,24 @@  discard block
 block discarded – undo
894 894
 	{
895 895
 		global $lang;
896 896
 
897
-		if(!$path) return;
897
+		if (!$path) return;
898 898
 
899
-		$_path = 'eval://' . $path;
899
+		$_path = 'eval://'.$path;
900 900
 
901
-		if(in_array($_path, $this->loaded_lang_files))
901
+		if (in_array($_path, $this->loaded_lang_files))
902 902
 		{
903 903
 			return;
904 904
 		}
905 905
 
906
-		if(substr_compare($path, '/', -1) !== 0)
906
+		if (substr_compare($path, '/', -1) !== 0)
907 907
 		{
908 908
 			$path .= '/';
909 909
 		}
910 910
 
911
-		$oXmlLangParser = new XmlLangParser($path . 'lang.xml', $this->lang_type);
911
+		$oXmlLangParser = new XmlLangParser($path.'lang.xml', $this->lang_type);
912 912
 		$content = $oXmlLangParser->getCompileContent();
913 913
 
914
-		if($content)
914
+		if ($content)
915 915
 		{
916 916
 			$this->loaded_lang_files[] = $_path;
917 917
 			eval($content);
@@ -926,9 +926,9 @@  discard block
 block discarded – undo
926 926
 	 */
927 927
 	function _loadXmlLang($path)
928 928
 	{
929
-		if(!$path) return;
929
+		if (!$path) return;
930 930
 
931
-		$oXmlLangParser = new XmlLangParser($path . ((substr_compare($path, '/', -1) !== 0) ? '/' : '') . 'lang.xml', $this->lang_type);
931
+		$oXmlLangParser = new XmlLangParser($path.((substr_compare($path, '/', -1) !== 0) ? '/' : '').'lang.xml', $this->lang_type);
932 932
 		return $oXmlLangParser->compile();
933 933
 	}
934 934
 
@@ -940,22 +940,22 @@  discard block
 block discarded – undo
940 940
 	 */
941 941
 	function _loadPhpLang($path)
942 942
 	{
943
-		if(!$path) return;
943
+		if (!$path) return;
944 944
 
945
-		if(substr_compare($path, '/', -1) !== 0)
945
+		if (substr_compare($path, '/', -1) !== 0)
946 946
 		{
947 947
 			$path .= '/';
948 948
 		}
949
-		$path_tpl = $path . '%s.lang.php';
949
+		$path_tpl = $path.'%s.lang.php';
950 950
 		$file = sprintf($path_tpl, $this->lang_type);
951 951
 
952 952
 		$langs = array('ko', 'en'); // this will be configurable.
953
-		while(!is_readable($file) && $langs[0])
953
+		while (!is_readable($file) && $langs[0])
954 954
 		{
955 955
 			$file = sprintf($path_tpl, array_shift($langs));
956 956
 		}
957 957
 
958
-		if(!is_readable($file))
958
+		if (!is_readable($file))
959 959
 		{
960 960
 			return FALSE;
961 961
 		}
@@ -997,11 +997,11 @@  discard block
 block discarded – undo
997 997
 	 */
998 998
 	function getLang($code)
999 999
 	{
1000
-		if(!$code)
1000
+		if (!$code)
1001 1001
 		{
1002 1002
 			return;
1003 1003
 		}
1004
-		if($GLOBALS['lang']->{$code})
1004
+		if ($GLOBALS['lang']->{$code})
1005 1005
 		{
1006 1006
 			return $GLOBALS['lang']->{$code};
1007 1007
 		}
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
 	 */
1018 1018
 	function setLang($code, $val)
1019 1019
 	{
1020
-		if(!isset($GLOBALS['lang']))
1020
+		if (!isset($GLOBALS['lang']))
1021 1021
 		{
1022 1022
 			$GLOBALS['lang'] = new stdClass();
1023 1023
 		}
@@ -1045,17 +1045,17 @@  discard block
 block discarded – undo
1045 1045
 
1046 1046
 		$obj = clone $source_obj;
1047 1047
 
1048
-		foreach($charset_list as $charset)
1048
+		foreach ($charset_list as $charset)
1049 1049
 		{
1050
-			array_walk($obj,'Context::checkConvertFlag',$charset);
1050
+			array_walk($obj, 'Context::checkConvertFlag', $charset);
1051 1051
 			$flag = self::checkConvertFlag($flag = TRUE);
1052
-			if($flag)
1052
+			if ($flag)
1053 1053
 			{
1054
-				if($charset == 'UTF-8')
1054
+				if ($charset == 'UTF-8')
1055 1055
 				{
1056 1056
 					return $obj;
1057 1057
 				}
1058
-				array_walk($obj,'Context::doConvertEncoding',$charset);
1058
+				array_walk($obj, 'Context::doConvertEncoding', $charset);
1059 1059
 				return $obj;
1060 1060
 			}
1061 1061
 		}
@@ -1074,11 +1074,11 @@  discard block
 block discarded – undo
1074 1074
 	function checkConvertFlag(&$val, $key = null, $charset = null)
1075 1075
 	{
1076 1076
 		static $flag = TRUE;
1077
-		if($charset)
1077
+		if ($charset)
1078 1078
 		{
1079
-			if(is_array($val))
1080
-				array_walk($val,'Context::checkConvertFlag',$charset);
1081
-			else if($val && iconv($charset,$charset,$val)!=$val) $flag = FALSE;
1079
+			if (is_array($val))
1080
+				array_walk($val, 'Context::checkConvertFlag', $charset);
1081
+			else if ($val && iconv($charset, $charset, $val) != $val) $flag = FALSE;
1082 1082
 			else $flag = FALSE;
1083 1083
 		}
1084 1084
 		else
@@ -1102,9 +1102,9 @@  discard block
 block discarded – undo
1102 1102
 	{
1103 1103
 		if (is_array($val))
1104 1104
 		{
1105
-			array_walk($val,'Context::doConvertEncoding',$charset);
1105
+			array_walk($val, 'Context::doConvertEncoding', $charset);
1106 1106
 		}
1107
-		else $val = iconv($charset,'UTF-8',$val);
1107
+		else $val = iconv($charset, 'UTF-8', $val);
1108 1108
 	}
1109 1109
 
1110 1110
 	/**
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
 	 */
1116 1116
 	function convertEncodingStr($str)
1117 1117
 	{
1118
-        if(!$str) return null;
1118
+        if (!$str) return null;
1119 1119
 		$obj = new stdClass();
1120 1120
 		$obj->str = $str;
1121 1121
 		$obj = self::convertEncoding($obj);
@@ -1124,9 +1124,9 @@  discard block
 block discarded – undo
1124 1124
 
1125 1125
 	function decodeIdna($domain)
1126 1126
 	{
1127
-		if(strpos($domain, 'xn--') !== FALSE)
1127
+		if (strpos($domain, 'xn--') !== FALSE)
1128 1128
 		{
1129
-			require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php');
1129
+			require_once(_XE_PATH_.'libs/idna_convert/idna_convert.class.php');
1130 1130
 			$IDN = new idna_convert(array('idn_version' => 2008));
1131 1131
 			$domain = $IDN->decode($domain);
1132 1132
 		}
@@ -1157,7 +1157,7 @@  discard block
 block discarded – undo
1157 1157
 	{
1158 1158
 		$self = self::getInstance();
1159 1159
 
1160
-		if($self->response_method)
1160
+		if ($self->response_method)
1161 1161
 		{
1162 1162
 			return $self->response_method;
1163 1163
 		}
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
 		$this->_recursiveCheckVar($_SERVER['HTTP_HOST']);
1198 1198
 
1199 1199
 		$pattern = "/[\,\"\'\{\}\[\]\(\);$]/";
1200
-		if(preg_match($pattern, $_SERVER['HTTP_HOST']))
1200
+		if (preg_match($pattern, $_SERVER['HTTP_HOST']))
1201 1201
 		{
1202 1202
 			$this->isSuccessInit = FALSE;
1203 1203
 		}
@@ -1210,30 +1210,30 @@  discard block
 block discarded – undo
1210 1210
 	 */
1211 1211
 	function _setRequestArgument()
1212 1212
 	{
1213
-		if(!count($_REQUEST))
1213
+		if (!count($_REQUEST))
1214 1214
 		{
1215 1215
 			return;
1216 1216
 		}
1217 1217
 
1218 1218
 		$requestMethod = $this->getRequestMethod();
1219
-		foreach($_REQUEST as $key => $val)
1219
+		foreach ($_REQUEST as $key => $val)
1220 1220
 		{
1221
-			if($val === '' || self::get($key))
1221
+			if ($val === '' || self::get($key))
1222 1222
 			{
1223 1223
 				continue;
1224 1224
 			}
1225 1225
 			$key = htmlentities($key);
1226 1226
 			$val = $this->_filterRequestVar($key, $val);
1227 1227
 
1228
-			if($requestMethod == 'GET' && isset($_GET[$key]))
1228
+			if ($requestMethod == 'GET' && isset($_GET[$key]))
1229 1229
 			{
1230 1230
 				$set_to_vars = TRUE;
1231 1231
 			}
1232
-			elseif($requestMethod == 'POST' && isset($_POST[$key]))
1232
+			elseif ($requestMethod == 'POST' && isset($_POST[$key]))
1233 1233
 			{
1234 1234
 				$set_to_vars = TRUE;
1235 1235
 			}
1236
-			elseif($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1236
+			elseif ($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1237 1237
 			{
1238 1238
 				$set_to_vars = TRUE;
1239 1239
 			}
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 				$set_to_vars = FALSE;
1243 1243
 			}
1244 1244
 
1245
-			if($set_to_vars)
1245
+			if ($set_to_vars)
1246 1246
 			{
1247 1247
 				$this->_recursiveCheckVar($val);
1248 1248
 			}
@@ -1253,20 +1253,20 @@  discard block
 block discarded – undo
1253 1253
 
1254 1254
 	function _recursiveCheckVar($val)
1255 1255
 	{
1256
-		if(is_string($val))
1256
+		if (is_string($val))
1257 1257
 		{
1258
-			foreach($this->patterns as $pattern)
1258
+			foreach ($this->patterns as $pattern)
1259 1259
 			{
1260
-				if(preg_match($pattern, $val))
1260
+				if (preg_match($pattern, $val))
1261 1261
 				{
1262 1262
 					$this->isSuccessInit = FALSE;
1263 1263
 					return;
1264 1264
 				}
1265 1265
 			}
1266 1266
 		}
1267
-		else if(is_array($val))
1267
+		else if (is_array($val))
1268 1268
 		{
1269
-			foreach($val as $val2)
1269
+			foreach ($val as $val2)
1270 1270
 			{
1271 1271
 				$this->_recursiveCheckVar($val2);
1272 1272
 			}
@@ -1280,7 +1280,7 @@  discard block
 block discarded – undo
1280 1280
 	 */
1281 1281
 	function _setJSONRequestArgument()
1282 1282
 	{
1283
-		if($this->getRequestMethod() != 'JSON')
1283
+		if ($this->getRequestMethod() != 'JSON')
1284 1284
 		{
1285 1285
 			return;
1286 1286
 		}
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
 		$params = array();
1289 1289
 		parse_str($GLOBALS['HTTP_RAW_POST_DATA'], $params);
1290 1290
 
1291
-		foreach($params as $key => $val)
1291
+		foreach ($params as $key => $val)
1292 1292
 		{
1293 1293
 			$this->set($key, $this->_filterRequestVar($key, $val, 1), TRUE);
1294 1294
 		}
@@ -1301,13 +1301,13 @@  discard block
 block discarded – undo
1301 1301
 	 */
1302 1302
 	function _setXmlRpcArgument()
1303 1303
 	{
1304
-		if($this->getRequestMethod() != 'XMLRPC')
1304
+		if ($this->getRequestMethod() != 'XMLRPC')
1305 1305
 		{
1306 1306
 			return;
1307 1307
 		}
1308 1308
 
1309 1309
 		$xml = $GLOBALS['HTTP_RAW_POST_DATA'];
1310
-		if(Security::detectingXEE($xml))
1310
+		if (Security::detectingXEE($xml))
1311 1311
 		{
1312 1312
 			header("HTTP/1.0 400 Bad Request");
1313 1313
 			exit;
@@ -1319,12 +1319,12 @@  discard block
 block discarded – undo
1319 1319
 		$params = $xml_obj->methodcall->params;
1320 1320
 		unset($params->node_name, $params->attrs, $params->body);
1321 1321
 
1322
-		if(!count(get_object_vars($params)))
1322
+		if (!count(get_object_vars($params)))
1323 1323
 		{
1324 1324
 			return;
1325 1325
 		}
1326 1326
 
1327
-		foreach($params as $key => $val)
1327
+		foreach ($params as $key => $val)
1328 1328
 		{
1329 1329
 			$this->set($key, $this->_filterXmlVars($key, $val), TRUE);
1330 1330
 		}
@@ -1339,10 +1339,10 @@  discard block
 block discarded – undo
1339 1339
 	 */
1340 1340
 	function _filterXmlVars($key, $val)
1341 1341
 	{
1342
-		if(is_array($val))
1342
+		if (is_array($val))
1343 1343
 		{
1344 1344
 			$stack = array();
1345
-			foreach($val as $k => $v)
1345
+			foreach ($val as $k => $v)
1346 1346
 			{
1347 1347
 				$stack[$k] = $this->_filterXmlVars($k, $v);
1348 1348
 			}
@@ -1352,20 +1352,20 @@  discard block
 block discarded – undo
1352 1352
 
1353 1353
 		$body = $val->body;
1354 1354
 		unset($val->node_name, $val->attrs, $val->body);
1355
-		if(!count(get_object_vars($val)))
1355
+		if (!count(get_object_vars($val)))
1356 1356
 		{
1357 1357
 			return $this->_filterRequestVar($key, $body, 0);
1358 1358
 		}
1359 1359
 
1360 1360
 		$stack = new stdClass();
1361
-		foreach($val as $k => $v)
1361
+		foreach ($val as $k => $v)
1362 1362
 		{
1363 1363
 			$output = $this->_filterXmlVars($k, $v);
1364
-			if(is_object($v) && $v->attrs->type == 'array')
1364
+			if (is_object($v) && $v->attrs->type == 'array')
1365 1365
 			{
1366 1366
 				$output = array($output);
1367 1367
 			}
1368
-			if($k == 'value' && (is_array($v) || $v->attrs->type == 'array'))
1368
+			if ($k == 'value' && (is_array($v) || $v->attrs->type == 'array'))
1369 1369
 			{
1370 1370
 				return $output;
1371 1371
 			}
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
 			$stack->{$k} = $output;
1374 1374
 		}
1375 1375
 
1376
-		if(!count(get_object_vars($stack)))
1376
+		if (!count(get_object_vars($stack)))
1377 1377
 		{
1378 1378
 			return NULL;
1379 1379
 		}
@@ -1392,32 +1392,32 @@  discard block
 block discarded – undo
1392 1392
 	 */
1393 1393
 	function _filterRequestVar($key, $val, $do_stripslashes = 1)
1394 1394
 	{
1395
-		if(!($isArray = is_array($val)))
1395
+		if (!($isArray = is_array($val)))
1396 1396
 		{
1397 1397
 			$val = array($val);
1398 1398
 		}
1399 1399
 
1400 1400
 		$result = array();
1401
-		foreach($val as $k => $v)
1401
+		foreach ($val as $k => $v)
1402 1402
 		{
1403 1403
 			$k = htmlentities($k);
1404
-			if($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
1404
+			if ($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
1405 1405
 			{
1406 1406
 				$result[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int) $v : $v;
1407 1407
 			}
1408
-			elseif($key === 'mid' || $key === 'search_keyword')
1408
+			elseif ($key === 'mid' || $key === 'search_keyword')
1409 1409
 			{
1410 1410
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1411 1411
 			}
1412
-			elseif($key === 'vid')
1412
+			elseif ($key === 'vid')
1413 1413
 			{
1414 1414
 				$result[$k] = urlencode($v);
1415 1415
 			}
1416
-			elseif($key === 'xe_validator_id')
1416
+			elseif ($key === 'xe_validator_id')
1417 1417
 			{
1418 1418
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1419 1419
 			}
1420
-			elseif(stripos($key, 'XE_VALIDATOR', 0) === 0)
1420
+			elseif (stripos($key, 'XE_VALIDATOR', 0) === 0)
1421 1421
 			{
1422 1422
 				unset($result[$k]);
1423 1423
 			}
@@ -1425,7 +1425,7 @@  discard block
 block discarded – undo
1425 1425
 			{
1426 1426
 				$result[$k] = $v;
1427 1427
 
1428
-				if($do_stripslashes && version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc())
1428
+				if ($do_stripslashes && version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc())
1429 1429
 				{
1430 1430
 					if (is_array($result[$k]))
1431 1431
 					{
@@ -1437,7 +1437,7 @@  discard block
 block discarded – undo
1437 1437
 					}
1438 1438
 				}
1439 1439
 
1440
-				if(is_array($result[$k]))
1440
+				if (is_array($result[$k]))
1441 1441
 				{
1442 1442
 					array_walk_recursive($result[$k], function(&$val) { $val = trim($val); });
1443 1443
 				}
@@ -1469,17 +1469,17 @@  discard block
 block discarded – undo
1469 1469
 	 */
1470 1470
 	function _setUploadedArgument()
1471 1471
 	{
1472
-		if($_SERVER['REQUEST_METHOD'] != 'POST' || !$_FILES || (stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE && stripos($_SERVER['HTTP_CONTENT_TYPE'], 'multipart/form-data') === FALSE))
1472
+		if ($_SERVER['REQUEST_METHOD'] != 'POST' || !$_FILES || (stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE && stripos($_SERVER['HTTP_CONTENT_TYPE'], 'multipart/form-data') === FALSE))
1473 1473
 		{
1474 1474
 			return;
1475 1475
 		}
1476 1476
 
1477
-		foreach($_FILES as $key => $val)
1477
+		foreach ($_FILES as $key => $val)
1478 1478
 		{
1479 1479
 			$tmp_name = $val['tmp_name'];
1480
-			if(!is_array($tmp_name))
1480
+			if (!is_array($tmp_name))
1481 1481
 			{
1482
-				if(!$tmp_name || !is_uploaded_file($tmp_name))
1482
+				if (!$tmp_name || !is_uploaded_file($tmp_name))
1483 1483
 				{
1484 1484
 					continue;
1485 1485
 				}
@@ -1492,9 +1492,9 @@  discard block
 block discarded – undo
1492 1492
 				$files = array();
1493 1493
 				$count_files = count($tmp_name);
1494 1494
 
1495
-				for($i = 0; $i < $count_files; $i++)
1495
+				for ($i = 0; $i < $count_files; $i++)
1496 1496
 				{
1497
-					if($val['size'][$i] > 0)
1497
+					if ($val['size'][$i] > 0)
1498 1498
 					{
1499 1499
 						$file = array();
1500 1500
 						$file['name'] = $val['name'][$i];
@@ -1505,7 +1505,7 @@  discard block
 block discarded – undo
1505 1505
 						$files[] = $file;
1506 1506
 					}
1507 1507
 				}
1508
-				if($files) $this->set($key, $files, TRUE);
1508
+				if ($files) $this->set($key, $files, TRUE);
1509 1509
 			}
1510 1510
 		}
1511 1511
 	}
@@ -1527,16 +1527,16 @@  discard block
 block discarded – undo
1527 1527
 	function getRequestUrl()
1528 1528
 	{
1529 1529
 		static $url = null;
1530
-		if(is_null($url))
1530
+		if (is_null($url))
1531 1531
 		{
1532 1532
 			$url = self::getRequestUri();
1533
-			if(count($_GET) > 0)
1533
+			if (count($_GET) > 0)
1534 1534
 			{
1535
-				foreach($_GET as $key => $val)
1535
+				foreach ($_GET as $key => $val)
1536 1536
 				{
1537
-					$vars[] = $key . '=' . ($val ? urlencode(self::convertEncodingStr($val)) : '');
1537
+					$vars[] = $key.'='.($val ? urlencode(self::convertEncodingStr($val)) : '');
1538 1538
 				}
1539
-				$url .= '?' . join('&', $vars);
1539
+				$url .= '?'.join('&', $vars);
1540 1540
 			}
1541 1541
 		}
1542 1542
 		return $url;
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 		$self = self::getInstance();
1552 1552
 		$js_callback_func = isset($_GET['xe_js_callback']) ? $_GET['xe_js_callback'] : $_POST['xe_js_callback'];
1553 1553
 
1554
-		if(!preg_match('/^[a-z0-9\.]+$/i', $js_callback_func))
1554
+		if (!preg_match('/^[a-z0-9\.]+$/i', $js_callback_func))
1555 1555
 		{
1556 1556
 			unset($js_callback_func);
1557 1557
 			unset($_GET['xe_js_callback']);
@@ -1579,22 +1579,22 @@  discard block
 block discarded – undo
1579 1579
 		$self = self::getInstance();
1580 1580
 
1581 1581
 		// retrieve virtual site information
1582
-		if(is_null($site_module_info))
1582
+		if (is_null($site_module_info))
1583 1583
 		{
1584 1584
 			$site_module_info = self::get('site_module_info');
1585 1585
 		}
1586 1586
 
1587 1587
 		// If $domain is set, handle it (if $domain is vid type, remove $domain and handle with $vid)
1588
-		if($domain && isSiteID($domain))
1588
+		if ($domain && isSiteID($domain))
1589 1589
 		{
1590 1590
 			$vid = $domain;
1591 1591
 			$domain = '';
1592 1592
 		}
1593 1593
 
1594 1594
 		// If $domain, $vid are not set, use current site information
1595
-		if(!$domain && !$vid)
1595
+		if (!$domain && !$vid)
1596 1596
 		{
1597
-			if($site_module_info->domain && isSiteID($site_module_info->domain))
1597
+			if ($site_module_info->domain && isSiteID($site_module_info->domain))
1598 1598
 			{
1599 1599
 				$vid = $site_module_info->domain;
1600 1600
 			}
@@ -1605,21 +1605,21 @@  discard block
 block discarded – undo
1605 1605
 		}
1606 1606
 
1607 1607
 		// if $domain is set, compare current URL. If they are same, remove the domain, otherwise link to the domain.
1608
-		if($domain)
1608
+		if ($domain)
1609 1609
 		{
1610 1610
 			$domain_info = parse_url($domain);
1611
-			if(is_null($current_info))
1611
+			if (is_null($current_info))
1612 1612
 			{
1613
-				$current_info = parse_url(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . getScriptPath());
1613
+				$current_info = parse_url(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].getScriptPath());
1614 1614
 			}
1615
-			if($domain_info['host'] . $domain_info['path'] == $current_info['host'] . $current_info['path'])
1615
+			if ($domain_info['host'].$domain_info['path'] == $current_info['host'].$current_info['path'])
1616 1616
 			{
1617 1617
 				unset($domain);
1618 1618
 			}
1619 1619
 			else
1620 1620
 			{
1621 1621
 				$domain = preg_replace('/^(http|https):\/\//i', '', trim($domain));
1622
-				if(substr_compare($domain, '/', -1) !== 0)
1622
+				if (substr_compare($domain, '/', -1) !== 0)
1623 1623
 				{
1624 1624
 					$domain .= '/';
1625 1625
 				}
@@ -1629,41 +1629,41 @@  discard block
 block discarded – undo
1629 1629
 		$get_vars = array();
1630 1630
 
1631 1631
 		// If there is no GET variables or first argument is '' to reset variables
1632
-		if(!$self->get_vars || $args_list[0] == '')
1632
+		if (!$self->get_vars || $args_list[0] == '')
1633 1633
 		{
1634 1634
 			// rearrange args_list
1635
-			if(is_array($args_list) && $args_list[0] == '')
1635
+			if (is_array($args_list) && $args_list[0] == '')
1636 1636
 			{
1637 1637
 				array_shift($args_list);
1638 1638
 			}
1639 1639
 		}
1640
-		elseif($_SERVER['REQUEST_METHOD'] == 'GET')
1640
+		elseif ($_SERVER['REQUEST_METHOD'] == 'GET')
1641 1641
 		{
1642 1642
 			// Otherwise, make GET variables into array
1643 1643
 			$get_vars = get_object_vars($self->get_vars);
1644 1644
 		}
1645 1645
 		else
1646 1646
 		{
1647
-			if(!!$self->get_vars->module) $get_vars['module'] = $self->get_vars->module;
1648
-			if(!!$self->get_vars->mid) $get_vars['mid'] = $self->get_vars->mid;
1649
-			if(!!$self->get_vars->act) $get_vars['act'] = $self->get_vars->act;
1650
-			if(!!$self->get_vars->page) $get_vars['page'] = $self->get_vars->page;
1651
-			if(!!$self->get_vars->search_target) $get_vars['search_target'] = $self->get_vars->search_target;
1652
-			if(!!$self->get_vars->search_keyword) $get_vars['search_keyword'] = $self->get_vars->search_keyword;
1653
-			if($get_vars['act'] == 'IS')
1647
+			if (!!$self->get_vars->module) $get_vars['module'] = $self->get_vars->module;
1648
+			if (!!$self->get_vars->mid) $get_vars['mid'] = $self->get_vars->mid;
1649
+			if (!!$self->get_vars->act) $get_vars['act'] = $self->get_vars->act;
1650
+			if (!!$self->get_vars->page) $get_vars['page'] = $self->get_vars->page;
1651
+			if (!!$self->get_vars->search_target) $get_vars['search_target'] = $self->get_vars->search_target;
1652
+			if (!!$self->get_vars->search_keyword) $get_vars['search_keyword'] = $self->get_vars->search_keyword;
1653
+			if ($get_vars['act'] == 'IS')
1654 1654
 			{
1655
-				if(!!$self->get_vars->is_keyword) $get_vars['is_keyword'] = $self->get_vars->is_keyword;
1655
+				if (!!$self->get_vars->is_keyword) $get_vars['is_keyword'] = $self->get_vars->is_keyword;
1656 1656
 			}
1657 1657
 		}
1658 1658
 
1659 1659
 		// arrange args_list
1660
-		for($i = 0, $c = count($args_list); $i < $c; $i += 2)
1660
+		for ($i = 0, $c = count($args_list); $i < $c; $i += 2)
1661 1661
 		{
1662 1662
 			$key = $args_list[$i];
1663 1663
 			$val = trim($args_list[$i + 1]);
1664 1664
 
1665 1665
 			// If value is not set, remove the key
1666
-			if(!isset($val) || !strlen($val))
1666
+			if (!isset($val) || !strlen($val))
1667 1667
 			{
1668 1668
 				unset($get_vars[$key]);
1669 1669
 				continue;
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
 
1675 1675
 		// remove vid, rnd
1676 1676
 		unset($get_vars['rnd']);
1677
-		if($vid)
1677
+		if ($vid)
1678 1678
 		{
1679 1679
 			$get_vars['vid'] = $vid;
1680 1680
 		}
@@ -1691,17 +1691,17 @@  discard block
 block discarded – undo
1691 1691
 			'dispDocumentAdminManageDocument' => 'dispDocumentManageDocument',
1692 1692
 			'dispModuleAdminSelectList' => 'dispModuleSelectList'
1693 1693
 		);
1694
-		if($act_alias[$act])
1694
+		if ($act_alias[$act])
1695 1695
 		{
1696 1696
 			$get_vars['act'] = $act_alias[$act];
1697 1697
 		}
1698 1698
 
1699 1699
 		// organize URL
1700 1700
 		$query = '';
1701
-		if(count($get_vars) > 0)
1701
+		if (count($get_vars) > 0)
1702 1702
 		{
1703 1703
 			// if using rewrite mod
1704
-			if($self->allow_rewrite)
1704
+			if ($self->allow_rewrite)
1705 1705
 			{
1706 1706
 				$var_keys = array_keys($get_vars);
1707 1707
 				sort($var_keys);
@@ -1721,8 +1721,8 @@  discard block
 block discarded – undo
1721 1721
 					'vid' => $vid,
1722 1722
 					'mid' => $mid,
1723 1723
 					'mid.vid' => "$vid/$mid",
1724
-					'entry.mid' => "$mid/entry/" . $get_vars['entry'],
1725
-					'entry.mid.vid' => "$vid/$mid/entry/" . $get_vars['entry'],
1724
+					'entry.mid' => "$mid/entry/".$get_vars['entry'],
1725
+					'entry.mid.vid' => "$vid/$mid/entry/".$get_vars['entry'],
1726 1726
 					'document_srl' => $srl,
1727 1727
 					'document_srl.mid' => "$mid/$srl",
1728 1728
 					'document_srl.vid' => "$vid/$srl",
@@ -1739,66 +1739,66 @@  discard block
 block discarded – undo
1739 1739
 				$query = $target_map[$target];
1740 1740
 			}
1741 1741
 
1742
-			if(!$query)
1742
+			if (!$query)
1743 1743
 			{
1744 1744
 				$queries = array();
1745
-				foreach($get_vars as $key => $val)
1745
+				foreach ($get_vars as $key => $val)
1746 1746
 				{
1747
-					if(is_array($val) && count($val) > 0)
1747
+					if (is_array($val) && count($val) > 0)
1748 1748
 					{
1749
-						foreach($val as $k => $v)
1749
+						foreach ($val as $k => $v)
1750 1750
 						{
1751
-							$queries[] = $key . '[' . $k . ']=' . urlencode($v);
1751
+							$queries[] = $key.'['.$k.']='.urlencode($v);
1752 1752
 						}
1753 1753
 					}
1754
-					elseif(!is_array($val))
1754
+					elseif (!is_array($val))
1755 1755
 					{
1756
-						$queries[] = $key . '=' . urlencode($val);
1756
+						$queries[] = $key.'='.urlencode($val);
1757 1757
 					}
1758 1758
 				}
1759
-				if(count($queries) > 0)
1759
+				if (count($queries) > 0)
1760 1760
 				{
1761
-					$query = 'index.php?' . join('&', $queries);
1761
+					$query = 'index.php?'.join('&', $queries);
1762 1762
 				}
1763 1763
 			}
1764 1764
 		}
1765 1765
 
1766 1766
 		// If using SSL always
1767 1767
 		$_use_ssl = $self->get('_use_ssl');
1768
-		if($_use_ssl == 'always')
1768
+		if ($_use_ssl == 'always')
1769 1769
 		{
1770
-			$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1770
+			$query = $self->getRequestUri(ENFORCE_SSL, $domain).$query;
1771 1771
 			// optional SSL use
1772 1772
 		}
1773
-		elseif($_use_ssl == 'optional')
1773
+		elseif ($_use_ssl == 'optional')
1774 1774
 		{
1775 1775
 			$ssl_mode = (($self->get('module') === 'admin') || ($get_vars['module'] === 'admin') || (isset($get_vars['act']) && $self->isExistsSSLAction($get_vars['act']))) ? ENFORCE_SSL : RELEASE_SSL;
1776
-			$query = $self->getRequestUri($ssl_mode, $domain) . $query;
1776
+			$query = $self->getRequestUri($ssl_mode, $domain).$query;
1777 1777
 			// no SSL
1778 1778
 		}
1779 1779
 		else
1780 1780
 		{
1781 1781
 			// currently on SSL but target is not based on SSL
1782
-			if($_SERVER['HTTPS'] == 'on')
1782
+			if ($_SERVER['HTTPS'] == 'on')
1783 1783
 			{
1784
-				$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1784
+				$query = $self->getRequestUri(ENFORCE_SSL, $domain).$query;
1785 1785
 			}
1786
-			else if($domain) // if $domain is set
1786
+			else if ($domain) // if $domain is set
1787 1787
 			{
1788
-				$query = $self->getRequestUri(FOLLOW_REQUEST_SSL, $domain) . $query;
1788
+				$query = $self->getRequestUri(FOLLOW_REQUEST_SSL, $domain).$query;
1789 1789
 			}
1790 1790
 			else
1791 1791
 			{
1792
-				$query = getScriptPath() . $query;
1792
+				$query = getScriptPath().$query;
1793 1793
 			}
1794 1794
 		}
1795 1795
 
1796
-		if(!$encode)
1796
+		if (!$encode)
1797 1797
 		{
1798 1798
 			return $query;
1799 1799
 		}
1800 1800
 
1801
-		if(!$autoEncode)
1801
+		if (!$autoEncode)
1802 1802
 		{
1803 1803
 			return htmlspecialchars($query, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1804 1804
 		}
@@ -1807,16 +1807,16 @@  discard block
 block discarded – undo
1807 1807
 		$encode_queries = array();
1808 1808
 		$parsedUrl = parse_url($query);
1809 1809
 		parse_str($parsedUrl['query'], $output);
1810
-		foreach($output as $key => $value)
1810
+		foreach ($output as $key => $value)
1811 1811
 		{
1812
-			if(preg_match('/&([a-z]{2,}|#\d+);/', urldecode($value)))
1812
+			if (preg_match('/&([a-z]{2,}|#\d+);/', urldecode($value)))
1813 1813
 			{
1814 1814
 				$value = urlencode(htmlspecialchars_decode(urldecode($value)));
1815 1815
 			}
1816
-			$encode_queries[] = $key . '=' . $value;
1816
+			$encode_queries[] = $key.'='.$value;
1817 1817
 		}
1818 1818
 
1819
-		return htmlspecialchars($parsedUrl['path'] . '?' . join('&', $encode_queries), ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1819
+		return htmlspecialchars($parsedUrl['path'].'?'.join('&', $encode_queries), ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1820 1820
 	}
1821 1821
 
1822 1822
 	/**
@@ -1831,17 +1831,17 @@  discard block
 block discarded – undo
1831 1831
 		static $url = array();
1832 1832
 
1833 1833
 		// Check HTTP Request
1834
-		if(!isset($_SERVER['SERVER_PROTOCOL']))
1834
+		if (!isset($_SERVER['SERVER_PROTOCOL']))
1835 1835
 		{
1836 1836
 			return;
1837 1837
 		}
1838 1838
 
1839
-		if(self::get('_use_ssl') == 'always')
1839
+		if (self::get('_use_ssl') == 'always')
1840 1840
 		{
1841 1841
 			$ssl_mode = ENFORCE_SSL;
1842 1842
 		}
1843 1843
 
1844
-		if($domain)
1844
+		if ($domain)
1845 1845
 		{
1846 1846
 			$domain_key = md5($domain);
1847 1847
 		}
@@ -1850,14 +1850,14 @@  discard block
 block discarded – undo
1850 1850
 			$domain_key = 'default';
1851 1851
 		}
1852 1852
 
1853
-		if(isset($url[$ssl_mode][$domain_key]))
1853
+		if (isset($url[$ssl_mode][$domain_key]))
1854 1854
 		{
1855 1855
 			return $url[$ssl_mode][$domain_key];
1856 1856
 		}
1857 1857
 
1858 1858
 		$current_use_ssl = ($_SERVER['HTTPS'] == 'on');
1859 1859
 
1860
-		switch($ssl_mode)
1860
+		switch ($ssl_mode)
1861 1861
 		{
1862 1862
 			case FOLLOW_REQUEST_SSL: $use_ssl = $current_use_ssl;
1863 1863
 				break;
@@ -1867,34 +1867,34 @@  discard block
 block discarded – undo
1867 1867
 				break;
1868 1868
 		}
1869 1869
 
1870
-		if($domain)
1870
+		if ($domain)
1871 1871
 		{
1872 1872
 			$target_url = trim($domain);
1873
-			if(substr_compare($target_url, '/', -1) !== 0)
1873
+			if (substr_compare($target_url, '/', -1) !== 0)
1874 1874
 			{
1875
-				$target_url.= '/';
1875
+				$target_url .= '/';
1876 1876
 			}
1877 1877
 		}
1878 1878
 		else
1879 1879
 		{
1880
-			$target_url = $_SERVER['HTTP_HOST'] . getScriptPath();
1880
+			$target_url = $_SERVER['HTTP_HOST'].getScriptPath();
1881 1881
 		}
1882 1882
 
1883
-		$url_info = parse_url('http://' . $target_url);
1883
+		$url_info = parse_url('http://'.$target_url);
1884 1884
 
1885
-		if($current_use_ssl != $use_ssl)
1885
+		if ($current_use_ssl != $use_ssl)
1886 1886
 		{
1887 1887
 			unset($url_info['port']);
1888 1888
 		}
1889 1889
 
1890
-		if($use_ssl)
1890
+		if ($use_ssl)
1891 1891
 		{
1892 1892
 			$port = self::get('_https_port');
1893
-			if($port && $port != 443)
1893
+			if ($port && $port != 443)
1894 1894
 			{
1895 1895
 				$url_info['port'] = $port;
1896 1896
 			}
1897
-			elseif($url_info['port'] == 443)
1897
+			elseif ($url_info['port'] == 443)
1898 1898
 			{
1899 1899
 				unset($url_info['port']);
1900 1900
 			}
@@ -1902,17 +1902,17 @@  discard block
 block discarded – undo
1902 1902
 		else
1903 1903
 		{
1904 1904
 			$port = self::get('_http_port');
1905
-			if($port && $port != 80)
1905
+			if ($port && $port != 80)
1906 1906
 			{
1907 1907
 				$url_info['port'] = $port;
1908 1908
 			}
1909
-			elseif($url_info['port'] == 80)
1909
+			elseif ($url_info['port'] == 80)
1910 1910
 			{
1911 1911
 				unset($url_info['port']);
1912 1912
 			}
1913 1913
 		}
1914 1914
 
1915
-		$url[$ssl_mode][$domain_key] = sprintf('%s://%s%s%s', $use_ssl ? 'https' : $url_info['scheme'], $url_info['host'], $url_info['port'] && $url_info['port'] != 80 ? ':' . $url_info['port'] : '', $url_info['path']);
1915
+		$url[$ssl_mode][$domain_key] = sprintf('%s://%s%s%s', $use_ssl ? 'https' : $url_info['scheme'], $url_info['host'], $url_info['port'] && $url_info['port'] != 80 ? ':'.$url_info['port'] : '', $url_info['path']);
1916 1916
 
1917 1917
 		return $url[$ssl_mode][$domain_key];
1918 1918
 	}
@@ -1929,16 +1929,16 @@  discard block
 block discarded – undo
1929 1929
 	{
1930 1930
 		$self = self::getInstance();
1931 1931
 		$self->context->{$key} = $val;
1932
-		if($set_to_get_vars === FALSE)
1932
+		if ($set_to_get_vars === FALSE)
1933 1933
 		{
1934 1934
 			return;
1935 1935
 		}
1936
-		if($val === NULL || $val === '')
1936
+		if ($val === NULL || $val === '')
1937 1937
 		{
1938 1938
 			unset($self->get_vars->{$key});
1939 1939
 			return;
1940 1940
 		}
1941
-		if($set_to_get_vars || $self->get_vars->{$key})
1941
+		if ($set_to_get_vars || $self->get_vars->{$key})
1942 1942
 		{
1943 1943
 			$self->get_vars->{$key} = $val;
1944 1944
 		}
@@ -1954,7 +1954,7 @@  discard block
 block discarded – undo
1954 1954
 	{
1955 1955
 		$self = self::getInstance();
1956 1956
 
1957
-		if(!isset($self->context->{$key}))
1957
+		if (!isset($self->context->{$key}))
1958 1958
 		{
1959 1959
 			return null;
1960 1960
 		}
@@ -1969,7 +1969,7 @@  discard block
 block discarded – undo
1969 1969
 	function gets()
1970 1970
 	{
1971 1971
 		$num_args = func_num_args();
1972
-		if($num_args < 1)
1972
+		if ($num_args < 1)
1973 1973
 		{
1974 1974
 			return;
1975 1975
 		}
@@ -1977,7 +1977,7 @@  discard block
 block discarded – undo
1977 1977
 
1978 1978
 		$args_list = func_get_args();
1979 1979
 		$output = new stdClass();
1980
-		foreach($args_list as $v)
1980
+		foreach ($args_list as $v)
1981 1981
 		{
1982 1982
 			$output->{$v} = $self->get($v);
1983 1983
 		}
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
 	function getRequestVars()
2004 2004
 	{
2005 2005
 		$self = self::getInstance();
2006
-		if($self->get_vars)
2006
+		if ($self->get_vars)
2007 2007
 		{
2008 2008
 			return clone($self->get_vars);
2009 2009
 		}
@@ -2020,13 +2020,13 @@  discard block
 block discarded – undo
2020 2020
 	{
2021 2021
 		$self = self::getInstance();
2022 2022
 
2023
-		if(!is_readable($self->sslActionCacheFile))
2023
+		if (!is_readable($self->sslActionCacheFile))
2024 2024
 		{
2025 2025
 			$buff = '<?php if(!defined("__XE__"))exit;';
2026 2026
 			FileHandler::writeFile($self->sslActionCacheFile, $buff);
2027 2027
 		}
2028 2028
 
2029
-		if(!isset($self->ssl_actions[$action]))
2029
+		if (!isset($self->ssl_actions[$action]))
2030 2030
 		{
2031 2031
 			$self->ssl_actions[$action] = 1;
2032 2032
 			$sslActionCacheString = sprintf('$sslActions[\'%s\'] = 1;', $action);
@@ -2044,16 +2044,16 @@  discard block
 block discarded – undo
2044 2044
 	{
2045 2045
 		$self = self::getInstance();
2046 2046
 
2047
-		if(!is_readable($self->sslActionCacheFile))
2047
+		if (!is_readable($self->sslActionCacheFile))
2048 2048
 		{
2049 2049
 			unset($self->ssl_actions);
2050 2050
 			$buff = '<?php if(!defined("__XE__"))exit;';
2051 2051
 			FileHandler::writeFile($self->sslActionCacheFile, $buff);
2052 2052
 		}
2053 2053
 
2054
-		foreach($action_array as $action)
2054
+		foreach ($action_array as $action)
2055 2055
 		{
2056
-			if(!isset($self->ssl_actions[$action]))
2056
+			if (!isset($self->ssl_actions[$action]))
2057 2057
 			{
2058 2058
 				$self->ssl_actions[$action] = 1;
2059 2059
 				$sslActionCacheString = sprintf('$sslActions[\'%s\'] = 1;', $action);
@@ -2072,7 +2072,7 @@  discard block
 block discarded – undo
2072 2072
 	{
2073 2073
 		$self = self::getInstance();
2074 2074
 
2075
-		if($self->isExistsSSLAction($action))
2075
+		if ($self->isExistsSSLAction($action))
2076 2076
 		{
2077 2077
 			$sslActionCacheString = sprintf('$sslActions[\'%s\'] = 1;', $action);
2078 2078
 			$buff = FileHandler::readFile($self->sslActionCacheFile);
@@ -2089,7 +2089,7 @@  discard block
 block discarded – undo
2089 2089
 	function getSSLActions()
2090 2090
 	{
2091 2091
 		$self = self::getInstance();
2092
-		if($self->getSslStatus() == 'optional')
2092
+		if ($self->getSslStatus() == 'optional')
2093 2093
 		{
2094 2094
 			return $self->ssl_actions;
2095 2095
 		}
@@ -2116,12 +2116,12 @@  discard block
 block discarded – undo
2116 2116
 	 */
2117 2117
 	function normalizeFilePath($file)
2118 2118
 	{
2119
-		if($file{0} != '/' && $file{0} != '.' && strpos($file, '://') === FALSE)
2119
+		if ($file{0} != '/' && $file{0} != '.' && strpos($file, '://') === FALSE)
2120 2120
 		{
2121
-			$file = './' . $file;
2121
+			$file = './'.$file;
2122 2122
 		}
2123 2123
 		$file = preg_replace('@/\./|(?<!:)\/\/@', '/', $file);
2124
-		while(strpos($file, '/../') !== FALSE)
2124
+		while (strpos($file, '/../') !== FALSE)
2125 2125
 		{
2126 2126
 			$file = preg_replace('/\/([^\/]+)\/\.\.\//s', '/', $file, 1);
2127 2127
 		}
@@ -2140,13 +2140,13 @@  discard block
 block discarded – undo
2140 2140
 	{
2141 2141
 		$file = self::normalizeFilePath($file);
2142 2142
 		$script_path = getScriptPath();
2143
-		if(strpos($file, './') === 0)
2143
+		if (strpos($file, './') === 0)
2144 2144
 		{
2145
-			$file = $script_path . substr($file, 2);
2145
+			$file = $script_path.substr($file, 2);
2146 2146
 		}
2147
-		elseif(strpos($file, '../') === 0)
2147
+		elseif (strpos($file, '../') === 0)
2148 2148
 		{
2149
-			$file = self::normalizeFilePath($script_path . $file);
2149
+			$file = self::normalizeFilePath($script_path.$file);
2150 2150
 		}
2151 2151
 
2152 2152
 		return $file;
@@ -2216,12 +2216,12 @@  discard block
 block discarded – undo
2216 2216
 	 */
2217 2217
 	function addJsFile($file, $optimized = FALSE, $targetie = '', $index = 0, $type = 'head', $isRuleset = FALSE, $autoPath = null)
2218 2218
 	{
2219
-		if($isRuleset)
2219
+		if ($isRuleset)
2220 2220
 		{
2221
-			if(strpos($file, '#') !== FALSE)
2221
+			if (strpos($file, '#') !== FALSE)
2222 2222
 			{
2223 2223
 				$file = str_replace('#', '', $file);
2224
-				if(!is_readable($file))
2224
+				if (!is_readable($file))
2225 2225
 				{
2226 2226
 					$file = $autoPath;
2227 2227
 				}
@@ -2286,9 +2286,9 @@  discard block
 block discarded – undo
2286 2286
 		ksort($files);
2287 2287
 		$files = array_values($files);
2288 2288
 		$filenames = array();
2289
-		for($i = 0, $c = count($files); $i < $c; ++$i)
2289
+		for ($i = 0, $c = count($files); $i < $c; ++$i)
2290 2290
 		{
2291
-			if(in_array($files[$i]['file'], $filenames))
2291
+			if (in_array($files[$i]['file'], $filenames))
2292 2292
 			{
2293 2293
 				unset($files[$i]);
2294 2294
 			}
@@ -2373,14 +2373,14 @@  discard block
 block discarded – undo
2373 2373
 	 */
2374 2374
 	function getJavascriptPluginInfo($pluginName)
2375 2375
 	{
2376
-		if($plugin_name == 'ui.datepicker')
2376
+		if ($plugin_name == 'ui.datepicker')
2377 2377
 		{
2378 2378
 			$plugin_name = 'ui';
2379 2379
 		}
2380 2380
 
2381
-		$plugin_path = './common/js/plugins/' . $pluginName . '/';
2382
-		$info_file = $plugin_path . 'plugin.load';
2383
-		if(!is_readable($info_file))
2381
+		$plugin_path = './common/js/plugins/'.$pluginName.'/';
2382
+		$info_file = $plugin_path.'plugin.load';
2383
+		if (!is_readable($info_file))
2384 2384
 		{
2385 2385
 			return;
2386 2386
 		}
@@ -2390,32 +2390,32 @@  discard block
 block discarded – undo
2390 2390
 		$result->jsList = array();
2391 2391
 		$result->cssList = array();
2392 2392
 
2393
-		foreach($list as $filename)
2393
+		foreach ($list as $filename)
2394 2394
 		{
2395 2395
 			$filename = trim($filename);
2396
-			if(!$filename)
2396
+			if (!$filename)
2397 2397
 			{
2398 2398
 				continue;
2399 2399
 			}
2400 2400
 
2401
-			if(strncasecmp('./', $filename, 2) === 0)
2401
+			if (strncasecmp('./', $filename, 2) === 0)
2402 2402
 			{
2403 2403
 				$filename = substr($filename, 2);
2404 2404
 			}
2405 2405
 
2406
-			if(substr_compare($filename, '.js', -3) === 0)
2406
+			if (substr_compare($filename, '.js', -3) === 0)
2407 2407
 			{
2408
-				$result->jsList[] = $plugin_path . $filename;
2408
+				$result->jsList[] = $plugin_path.$filename;
2409 2409
 			}
2410
-			elseif(substr_compare($filename, '.css', -4) === 0)
2410
+			elseif (substr_compare($filename, '.css', -4) === 0)
2411 2411
 			{
2412
-				$result->cssList[] = $plugin_path . $filename;
2412
+				$result->cssList[] = $plugin_path.$filename;
2413 2413
 			}
2414 2414
 		}
2415 2415
 
2416
-		if(is_dir($plugin_path . 'lang'))
2416
+		if (is_dir($plugin_path.'lang'))
2417 2417
 		{
2418
-			$result->langPath = $plugin_path . 'lang';
2418
+			$result->langPath = $plugin_path.'lang';
2419 2419
 		}
2420 2420
 
2421 2421
 		return $result;
@@ -2431,50 +2431,50 @@  discard block
 block discarded – undo
2431 2431
 		static $loaded_plugins = array();
2432 2432
 
2433 2433
 		$self = self::getInstance();
2434
-		if($plugin_name == 'ui.datepicker')
2434
+		if ($plugin_name == 'ui.datepicker')
2435 2435
 		{
2436 2436
 			$plugin_name = 'ui';
2437 2437
 		}
2438 2438
 
2439
-		if($loaded_plugins[$plugin_name])
2439
+		if ($loaded_plugins[$plugin_name])
2440 2440
 		{
2441 2441
 			return;
2442 2442
 		}
2443 2443
 		$loaded_plugins[$plugin_name] = TRUE;
2444 2444
 
2445
-		$plugin_path = './common/js/plugins/' . $plugin_name . '/';
2446
-		$info_file = $plugin_path . 'plugin.load';
2447
-		if(!is_readable($info_file))
2445
+		$plugin_path = './common/js/plugins/'.$plugin_name.'/';
2446
+		$info_file = $plugin_path.'plugin.load';
2447
+		if (!is_readable($info_file))
2448 2448
 		{
2449 2449
 			return;
2450 2450
 		}
2451 2451
 
2452 2452
 		$list = file($info_file);
2453
-		foreach($list as $filename)
2453
+		foreach ($list as $filename)
2454 2454
 		{
2455 2455
 			$filename = trim($filename);
2456
-			if(!$filename)
2456
+			if (!$filename)
2457 2457
 			{
2458 2458
 				continue;
2459 2459
 			}
2460 2460
 
2461
-			if(strncasecmp('./', $filename, 2) === 0)
2461
+			if (strncasecmp('./', $filename, 2) === 0)
2462 2462
 			{
2463 2463
 				$filename = substr($filename, 2);
2464 2464
 			}
2465
-			if(substr_compare($filename, '.js', -3) === 0)
2465
+			if (substr_compare($filename, '.js', -3) === 0)
2466 2466
 			{
2467
-				$self->loadFile(array($plugin_path . $filename, 'body', '', 0), TRUE);
2467
+				$self->loadFile(array($plugin_path.$filename, 'body', '', 0), TRUE);
2468 2468
 			}
2469
-			if(substr_compare($filename, '.css', -4) === 0)
2469
+			if (substr_compare($filename, '.css', -4) === 0)
2470 2470
 			{
2471
-				$self->loadFile(array($plugin_path . $filename, 'all', '', 0), TRUE);
2471
+				$self->loadFile(array($plugin_path.$filename, 'all', '', 0), TRUE);
2472 2472
 			}
2473 2473
 		}
2474 2474
 
2475
-		if(is_dir($plugin_path . 'lang'))
2475
+		if (is_dir($plugin_path.'lang'))
2476 2476
 		{
2477
-			$self->loadLang($plugin_path . 'lang');
2477
+			$self->loadLang($plugin_path.'lang');
2478 2478
 		}
2479 2479
 	}
2480 2480
 
@@ -2487,7 +2487,7 @@  discard block
 block discarded – undo
2487 2487
 	function addHtmlHeader($header)
2488 2488
 	{
2489 2489
 		$self = self::getInstance();
2490
-		$self->html_header .= "\n" . $header;
2490
+		$self->html_header .= "\n".$header;
2491 2491
 	}
2492 2492
 
2493 2493
 	function clearHtmlHeader()
@@ -2539,7 +2539,7 @@  discard block
 block discarded – undo
2539 2539
 	function addBodyHeader($header)
2540 2540
 	{
2541 2541
 		$self = self::getInstance();
2542
-		$self->body_header .= "\n" . $header;
2542
+		$self->body_header .= "\n".$header;
2543 2543
 	}
2544 2544
 
2545 2545
 	/**
@@ -2561,7 +2561,7 @@  discard block
 block discarded – undo
2561 2561
 	function addHtmlFooter($footer)
2562 2562
 	{
2563 2563
 		$self = self::getInstance();
2564
-		$self->html_footer .= ($self->Htmlfooter ? "\n" : '') . $footer;
2564
+		$self->html_footer .= ($self->Htmlfooter ? "\n" : '').$footer;
2565 2565
 	}
2566 2566
 
2567 2567
 	/**
@@ -2582,7 +2582,7 @@  discard block
 block discarded – undo
2582 2582
 	 */
2583 2583
 	function getConfigFile()
2584 2584
 	{
2585
-		return _XE_PATH_ . 'files/config/db.config.php';
2585
+		return _XE_PATH_.'files/config/db.config.php';
2586 2586
 	}
2587 2587
 
2588 2588
 	/**
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
 	 */
2593 2593
 	function getFTPConfigFile()
2594 2594
 	{
2595
-		return _XE_PATH_ . 'files/config/ftp.config.php';
2595
+		return _XE_PATH_.'files/config/ftp.config.php';
2596 2596
 	}
2597 2597
 
2598 2598
 	/**
@@ -2644,14 +2644,14 @@  discard block
 block discarded – undo
2644 2644
 		$_path = explode('/', $path);
2645 2645
 		$_base = explode('/', $base_url);
2646 2646
 
2647
-		if(!$_base[count($_base) - 1])
2647
+		if (!$_base[count($_base) - 1])
2648 2648
 		{
2649 2649
 			array_pop($_base);
2650 2650
 		}
2651 2651
 
2652
-		foreach($_xe as $idx => $dir)
2652
+		foreach ($_xe as $idx => $dir)
2653 2653
 		{
2654
-			if($_path[0] != $dir)
2654
+			if ($_path[0] != $dir)
2655 2655
 			{
2656 2656
 				break;
2657 2657
 			}
@@ -2659,9 +2659,9 @@  discard block
 block discarded – undo
2659 2659
 		}
2660 2660
 
2661 2661
 		$idx = count($_xe) - $idx - 1;
2662
-		while($idx--)
2662
+		while ($idx--)
2663 2663
 		{
2664
-			if(count($_base) > 0)
2664
+			if (count($_base) > 0)
2665 2665
 			{
2666 2666
 				array_shift($_base);
2667 2667
 			}
@@ -2671,13 +2671,13 @@  discard block
 block discarded – undo
2671 2671
 			}
2672 2672
 		}
2673 2673
 
2674
-		if(count($_base) > 0)
2674
+		if (count($_base) > 0)
2675 2675
 		{
2676 2676
 			array_unshift($_path, join('/', $_base));
2677 2677
 		}
2678 2678
 
2679
-		$path = '/' . join('/', $_path);
2680
-		if(substr_compare($path, '/', -1) !== 0)
2679
+		$path = '/'.join('/', $_path);
2680
+		if (substr_compare($path, '/', -1) !== 0)
2681 2681
 		{
2682 2682
 			$path .= '/';
2683 2683
 		}
@@ -2692,13 +2692,13 @@  discard block
 block discarded – undo
2692 2692
 	{
2693 2693
 		$self = self::getInstance();
2694 2694
 
2695
-		if(!is_array($self->meta_tags))
2695
+		if (!is_array($self->meta_tags))
2696 2696
 		{
2697 2697
 			$self->meta_tags = array();
2698 2698
 		}
2699 2699
 
2700 2700
 		$ret = array();
2701
-		foreach($self->meta_tags as $key => $val)
2701
+		foreach ($self->meta_tags as $key => $val)
2702 2702
 		{
2703 2703
 			list($name, $is_http_equiv) = explode("\t", $key);
2704 2704
 			$ret[] = array('name' => $name, 'is_http_equiv' => $is_http_equiv, 'content' => $val);
@@ -2718,7 +2718,7 @@  discard block
 block discarded – undo
2718 2718
 	function addMetaTag($name, $content, $is_http_equiv = FALSE)
2719 2719
 	{
2720 2720
 		$self = self::getInstance();
2721
-		$self->meta_tags[$name . "\t" . ($is_http_equiv ? '1' : '0')] = $content;
2721
+		$self->meta_tags[$name."\t".($is_http_equiv ? '1' : '0')] = $content;
2722 2722
 	}
2723 2723
 
2724 2724
 }
Please login to merge, or discard this patch.
modules/install/install.controller.php 1 patch
Spacing   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	function init()
18 18
 	{
19 19
 		// Error occurs if already installed
20
-		if($this->act !== 'procInstallLicenseAggrement' && Context::isInstalled())
20
+		if ($this->act !== 'procInstallLicenseAggrement' && Context::isInstalled())
21 21
 		{
22 22
 			$this->stop('msg_already_installed');
23 23
 		}
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	function _procDBSetting()
87 87
 	{
88 88
 		// Get DB-related variables
89
-		$con_string = Context::gets('db_type','db_port','db_hostname','db_userid','db_password','db_database','db_table_prefix');
89
+		$con_string = Context::gets('db_type', 'db_port', 'db_hostname', 'db_userid', 'db_password', 'db_database', 'db_table_prefix');
90 90
 
91 91
 		$db_info = new stdClass();
92 92
 		$db_info->master_db = get_object_vars($con_string);
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
 		// Check if available to connect to the DB
102 102
 		$oDB = &DB::getInstance();
103 103
 		$output = $oDB->getError();
104
-		if(!$output->toBool()) return $output;
105
-		if(!$oDB->isConnected()) return $oDB->getError();
104
+		if (!$output->toBool()) return $output;
105
+		if (!$oDB->isConnected()) return $oDB->getError();
106 106
 
107 107
 		// Create a db temp config file
108
-		if(!$this->makeDBConfigFile()) return new BaseObject(-1, 'msg_install_failed');
108
+		if (!$this->makeDBConfigFile()) return new BaseObject(-1, 'msg_install_failed');
109 109
 
110
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
110
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
111 111
 		{
112 112
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'act', 'dispInstallConfigForm');
113 113
 			header('location:'.$returnUrl);
@@ -121,13 +121,13 @@  discard block
 block discarded – undo
121 121
 	function procConfigSetting()
122 122
 	{
123 123
 		// Get variables
124
-		$config_info = Context::gets('use_rewrite','time_zone');
125
-		if($config_info->use_rewrite!='Y') $config_info->use_rewrite = 'N';
124
+		$config_info = Context::gets('use_rewrite', 'time_zone');
125
+		if ($config_info->use_rewrite != 'Y') $config_info->use_rewrite = 'N';
126 126
 
127 127
 		// Create a db temp config file
128
-		if(!$this->makeEtcConfigFile($config_info)) return new BaseObject(-1, 'msg_install_failed');
128
+		if (!$this->makeEtcConfigFile($config_info)) return new BaseObject(-1, 'msg_install_failed');
129 129
 
130
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
130
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
131 131
 		{
132 132
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'act', 'dispInstallManagerForm');
133 133
 			header('location:'.$returnUrl);
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 	function procInstall()
142 142
 	{
143 143
 		// Check if it is already installed
144
-		if(Context::isInstalled()) return new BaseObject(-1, 'msg_already_installed');
144
+		if (Context::isInstalled()) return new BaseObject(-1, 'msg_already_installed');
145 145
 
146 146
 		Context::loadLang('modules/member/lang');
147 147
 		$oMemberModel = getModel('member');
148 148
 		$vars = Context::getRequestVars();
149 149
 
150
-		if(!$oMemberModel->checkPasswordStrength($vars->password, 'high'))
150
+		if (!$oMemberModel->checkPasswordStrength($vars->password, 'high'))
151 151
 		{
152 152
 			Context::loadLang('modules/member/lang');
153 153
 			$message = Context::getLang('about_password_strength');
@@ -160,15 +160,15 @@  discard block
 block discarded – undo
160 160
 		Context::set('logged_info', $logged_info);
161 161
 
162 162
 		// check install config
163
-		if(Context::get('install_config'))
163
+		if (Context::get('install_config'))
164 164
 		{
165 165
 			$db_info = $this->_makeDbInfoByInstallConfig();
166 166
 		}
167 167
 		// install by default XE UI
168 168
 		else
169 169
 		{
170
-			if(FileHandler::exists($this->db_tmp_config_file)) include $this->db_tmp_config_file;
171
-			if(FileHandler::exists($this->etc_tmp_config_file)) include $this->etc_tmp_config_file;
170
+			if (FileHandler::exists($this->db_tmp_config_file)) include $this->db_tmp_config_file;
171
+			if (FileHandler::exists($this->etc_tmp_config_file)) include $this->etc_tmp_config_file;
172 172
 		}
173 173
 
174 174
 		// Set DB type and information
@@ -176,30 +176,30 @@  discard block
 block discarded – undo
176 176
 		// Create DB Instance
177 177
 		$oDB = &DB::getInstance();
178 178
 		// Check if available to connect to the DB
179
-		if(!$oDB->isConnected()) return $oDB->getError();
179
+		if (!$oDB->isConnected()) return $oDB->getError();
180 180
 
181 181
 		// Install all the modules
182 182
 		try {
183 183
 			$oDB->begin();
184 184
 			$this->installDownloadedModule();
185 185
 			$oDB->commit();
186
-		} catch(Exception $e) {
186
+		} catch (Exception $e) {
187 187
 			$oDB->rollback();
188 188
 			return new BaseObject(-1, $e->getMessage());
189 189
 		}
190 190
 
191 191
 		// Create a config file
192
-		if(!$this->makeConfigFile()) return new BaseObject(-1, 'msg_install_failed');
192
+		if (!$this->makeConfigFile()) return new BaseObject(-1, 'msg_install_failed');
193 193
 
194 194
 		// load script
195
-		$scripts = FileHandler::readDir(_XE_PATH_ . 'modules/install/script', '/(\.php)$/');
196
-		if(count($scripts)>0)
195
+		$scripts = FileHandler::readDir(_XE_PATH_.'modules/install/script', '/(\.php)$/');
196
+		if (count($scripts) > 0)
197 197
 		{
198 198
 			sort($scripts);
199
-			foreach($scripts as $script)
199
+			foreach ($scripts as $script)
200 200
 			{
201 201
 				$script_path = FileHandler::getRealPath('./modules/install/script/');
202
-				$output = include($script_path . $script);
202
+				$output = include($script_path.$script);
203 203
 			}
204 204
 		}
205 205
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
 		unset($_SESSION['use_rewrite']);
214 214
 
215
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
215
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
216 216
 		{
217 217
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('');
218 218
 			header('location:'.$returnUrl);
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 		$db_info->use_rewrite = Context::get('use_rewrite');
243 243
 		$db_info->time_zone = Context::get('time_zone');
244 244
 
245
-		if($_SERVER['HTTPS'] == 'on')
245
+		if ($_SERVER['HTTPS'] == 'on')
246 246
 		{
247 247
 			$https_port = (Context::get('https_port')) ? Context::get('https_port') : $_SERVER['SERVER_PORT'];
248 248
 			$https_port = (!$https_port != 443) ? $https_port : null;
@@ -252,8 +252,8 @@  discard block
 block discarded – undo
252 252
 			$http_port = (Context::get('http_port')) ? Context::get('http_port') : $_SERVER['SERVER_PORT'];
253 253
 			$http_port = (!$http_port != 80) ? $http_port : null;
254 254
 		}
255
-		if($http_port) $db_info->http_port = $http_port;
256
-		if($https_port) $db_info->https_port = $https_port;
255
+		if ($http_port) $db_info->http_port = $http_port;
256
+		if ($https_port) $db_info->https_port = $https_port;
257 257
 
258 258
 		return $db_info;
259 259
 	}
@@ -263,57 +263,57 @@  discard block
 block discarded – undo
263 263
 	 */
264 264
 	function procInstallFTP()
265 265
 	{
266
-		if(Context::isInstalled()) return new BaseObject(-1, 'msg_already_installed');
267
-		$ftp_info = Context::gets('ftp_host', 'ftp_user','ftp_password','ftp_port','ftp_root_path');
268
-		$ftp_info->ftp_port = (int)$ftp_info->ftp_port;
269
-		if(!$ftp_info->ftp_port) $ftp_info->ftp_port = 21;
270
-		if(!$ftp_info->ftp_host) $ftp_info->ftp_host = '127.0.0.1';
271
-		if(!$ftp_info->ftp_root_path) $ftp_info->ftp_root_path = '/';
266
+		if (Context::isInstalled()) return new BaseObject(-1, 'msg_already_installed');
267
+		$ftp_info = Context::gets('ftp_host', 'ftp_user', 'ftp_password', 'ftp_port', 'ftp_root_path');
268
+		$ftp_info->ftp_port = (int) $ftp_info->ftp_port;
269
+		if (!$ftp_info->ftp_port) $ftp_info->ftp_port = 21;
270
+		if (!$ftp_info->ftp_host) $ftp_info->ftp_host = '127.0.0.1';
271
+		if (!$ftp_info->ftp_root_path) $ftp_info->ftp_root_path = '/';
272 272
 
273 273
 		$buff = array('<?php if(!defined("__XE__")) exit();');
274 274
 		$buff[] = "\$ftp_info = new stdClass();";
275
-		foreach($ftp_info as $key => $val)
275
+		foreach ($ftp_info as $key => $val)
276 276
 		{
277
-			$buff[] = sprintf("\$ftp_info->%s='%s';", $key, str_replace("'","\\'",$val));
277
+			$buff[] = sprintf("\$ftp_info->%s='%s';", $key, str_replace("'", "\\'", $val));
278 278
 		}
279 279
 
280 280
 		// If safe_mode
281
-		if(ini_get('safe_mode'))
281
+		if (ini_get('safe_mode'))
282 282
 		{
283
-			if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) return new BaseObject(-1,'msg_safe_mode_ftp_needed');
283
+			if (!$ftp_info->ftp_user || !$ftp_info->ftp_password) return new BaseObject(-1, 'msg_safe_mode_ftp_needed');
284 284
 
285 285
 			require_once(_XE_PATH_.'libs/ftp.class.php');
286 286
 			$oFtp = new ftp();
287
-			if(!$oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) return new BaseObject(-1, sprintf(Context::getLang('msg_ftp_not_connected'), 'host'));
287
+			if (!$oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) return new BaseObject(-1, sprintf(Context::getLang('msg_ftp_not_connected'), 'host'));
288 288
 
289
-			if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
289
+			if (!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
290 290
 			{
291 291
 				$oFtp->ftp_quit();
292
-				return new BaseObject(-1,'msg_ftp_invalid_auth_info');
292
+				return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
293 293
 			}
294 294
 
295
-			if(!is_dir(_XE_PATH_.'files') && !$oFtp->ftp_mkdir($ftp_info->ftp_root_path.'files'))
295
+			if (!is_dir(_XE_PATH_.'files') && !$oFtp->ftp_mkdir($ftp_info->ftp_root_path.'files'))
296 296
 			{
297 297
 				$oFtp->ftp_quit();
298
-				return new BaseObject(-1,'msg_ftp_mkdir_fail');
298
+				return new BaseObject(-1, 'msg_ftp_mkdir_fail');
299 299
 			}
300 300
 
301
-			if(!$oFtp->ftp_site("CHMOD 777 ".$ftp_info->ftp_root_path.'files'))
301
+			if (!$oFtp->ftp_site("CHMOD 777 ".$ftp_info->ftp_root_path.'files'))
302 302
 			{
303 303
 				$oFtp->ftp_quit();
304
-				return new BaseObject(-1,'msg_ftp_chmod_fail');
304
+				return new BaseObject(-1, 'msg_ftp_chmod_fail');
305 305
 			}
306 306
 
307
-			if(!is_dir(_XE_PATH_.'files/config') && !$oFtp->ftp_mkdir($ftp_info->ftp_root_path.'files/config'))
307
+			if (!is_dir(_XE_PATH_.'files/config') && !$oFtp->ftp_mkdir($ftp_info->ftp_root_path.'files/config'))
308 308
 			{
309 309
 				$oFtp->ftp_quit();
310
-				return new BaseObject(-1,'msg_ftp_mkdir_fail');
310
+				return new BaseObject(-1, 'msg_ftp_mkdir_fail');
311 311
 			}
312 312
 
313
-			if(!$oFtp->ftp_site("CHMOD 777 ".$ftp_info->ftp_root_path.'files/config'))
313
+			if (!$oFtp->ftp_site("CHMOD 777 ".$ftp_info->ftp_root_path.'files/config'))
314 314
 			{
315 315
 				$oFtp->ftp_quit();
316
-				return new BaseObject(-1,'msg_ftp_chmod_fail');
316
+				return new BaseObject(-1, 'msg_ftp_chmod_fail');
317 317
 			}
318 318
 
319 319
 			$oFtp->ftp_quit();
@@ -324,31 +324,31 @@  discard block
 block discarded – undo
324 324
 
325 325
 	function procInstallCheckFtp()
326 326
 	{
327
-		$ftp_info = Context::gets('ftp_user','ftp_password','ftp_port','sftp');
328
-		$ftp_info->ftp_port = (int)$ftp_info->ftp_port;
329
-		if(!$ftp_info->ftp_port) $ftp_info->ftp_port = 21;
330
-		if(!$ftp_info->sftp) $ftp_info->sftp = 'N';
327
+		$ftp_info = Context::gets('ftp_user', 'ftp_password', 'ftp_port', 'sftp');
328
+		$ftp_info->ftp_port = (int) $ftp_info->ftp_port;
329
+		if (!$ftp_info->ftp_port) $ftp_info->ftp_port = 21;
330
+		if (!$ftp_info->sftp) $ftp_info->sftp = 'N';
331 331
 
332
-		if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) return new BaseObject(-1,'msg_safe_mode_ftp_needed');
332
+		if (!$ftp_info->ftp_user || !$ftp_info->ftp_password) return new BaseObject(-1, 'msg_safe_mode_ftp_needed');
333 333
 
334
-		if($ftp_info->sftp == 'Y')
334
+		if ($ftp_info->sftp == 'Y')
335 335
 		{
336 336
 			$connection = ssh2_connect('localhost', $ftp_info->ftp_port);
337
-			if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
337
+			if (!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
338 338
 			{
339
-				return new BaseObject(-1,'msg_ftp_invalid_auth_info');
339
+				return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
340 340
 			}
341 341
 		}
342 342
 		else
343 343
 		{
344 344
 			require_once(_XE_PATH_.'libs/ftp.class.php');
345 345
 			$oFtp = new ftp();
346
-			if(!$oFtp->ftp_connect('127.0.0.1', $ftp_info->ftp_port)) return new BaseObject(-1, sprintf(Context::getLang('msg_ftp_not_connected'), 'localhost'));
346
+			if (!$oFtp->ftp_connect('127.0.0.1', $ftp_info->ftp_port)) return new BaseObject(-1, sprintf(Context::getLang('msg_ftp_not_connected'), 'localhost'));
347 347
 
348
-			if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
348
+			if (!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
349 349
 			{
350 350
 				$oFtp->ftp_quit();
351
-				return new BaseObject(-1,'msg_ftp_invalid_auth_info');
351
+				return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
352 352
 			}
353 353
 			$oFtp->ftp_quit();
354 354
 		}
@@ -365,36 +365,36 @@  discard block
 block discarded – undo
365 365
 		$checklist = array();
366 366
 		// 0. check your version of php (5.2.4 or higher)
367 367
 		$checklist['php_version'] = true;
368
-		if(version_compare(PHP_VERSION, __XE_MIN_PHP_VERSION__, '<'))
368
+		if (version_compare(PHP_VERSION, __XE_MIN_PHP_VERSION__, '<'))
369 369
 		{
370 370
 			$checklist['php_version'] = false;
371 371
 		}
372 372
 
373
-		if(version_compare(PHP_VERSION, __XE_RECOMMEND_PHP_VERSION__, '<'))
373
+		if (version_compare(PHP_VERSION, __XE_RECOMMEND_PHP_VERSION__, '<'))
374 374
 		{
375 375
 			Context::set('phpversion_warning', true);
376 376
 		}
377 377
 
378 378
 		// 1. Check permission
379
-		if(is_writable('./')||is_writable('./files')) $checklist['permission'] = true;
379
+		if (is_writable('./') || is_writable('./files')) $checklist['permission'] = true;
380 380
 		else $checklist['permission'] = false;
381 381
 		// 2. Check if xml_parser_create exists
382
-		if(function_exists('xml_parser_create')) $checklist['xml'] = true;
382
+		if (function_exists('xml_parser_create')) $checklist['xml'] = true;
383 383
 		else $checklist['xml'] = false;
384 384
 		// 3. Check if ini_get (session.auto_start) == 1
385
-		if(ini_get('session.auto_start')!=1) $checklist['session'] = true;
385
+		if (ini_get('session.auto_start') != 1) $checklist['session'] = true;
386 386
 		else $checklist['session'] = false;
387 387
 		// 4. Check if iconv exists
388
-		if(function_exists('iconv')) $checklist['iconv'] = true;
388
+		if (function_exists('iconv')) $checklist['iconv'] = true;
389 389
 		else $checklist['iconv'] = false;
390 390
 		// 5. Check gd(imagecreatefromgif function)
391
-		if(function_exists('imagecreatefromgif')) $checklist['gd'] = true;
391
+		if (function_exists('imagecreatefromgif')) $checklist['gd'] = true;
392 392
 		else $checklist['gd'] = false;
393 393
 		// 6. Check DB
394
-		if(DB::getEnableList()) $checklist['db'] = true;
394
+		if (DB::getEnableList()) $checklist['db'] = true;
395 395
 		else $checklist['db'] = false;
396 396
 
397
-		if(!$checklist['php_version'] || !$checklist['permission'] || !$checklist['xml'] || !$checklist['session'] || !$checklist['db']) $install_enable = false;
397
+		if (!$checklist['php_version'] || !$checklist['permission'] || !$checklist['xml'] || !$checklist['session'] || !$checklist['db']) $install_enable = false;
398 398
 		else $install_enable = true;
399 399
 
400 400
 		// Save the checked result to the Context
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 
415 415
 		$license_agreement = ($vars->license_agreement == 'Y') ? true : false;
416 416
 
417
-		if($license_agreement)
417
+		if ($license_agreement)
418 418
 		{
419 419
 			$currentTime = $_SERVER['REQUEST_TIME'];
420 420
 			FileHandler::writeFile($this->flagLicenseAgreement, $currentTime);
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 			return new BaseObject(-1, 'msg_must_accept_license_agreement');
426 426
 		}
427 427
 
428
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
428
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
429 429
 		{
430 430
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'act', 'dispInstallCheckEnv');
431 431
 			$this->setRedirectUrl($returnUrl);
@@ -448,25 +448,25 @@  discard block
 block discarded – undo
448 448
 		$hostname = $_SERVER['SERVER_NAME'];
449 449
 		$port = $_SERVER['SERVER_PORT'];
450 450
 		$str_port = '';
451
-		if($port)
451
+		if ($port)
452 452
 		{
453
-			$str_port = ':' . $port;
453
+			$str_port = ':'.$port;
454 454
 		}
455 455
 
456 456
 		$tmpPath = $_SERVER['DOCUMENT_ROOT'];
457 457
 
458 458
 		//if DIRECTORY_SEPARATOR is not /(IIS)
459
-		if(DIRECTORY_SEPARATOR !== '/')
459
+		if (DIRECTORY_SEPARATOR !== '/')
460 460
 		{
461 461
 			//change to slash for compare
462 462
 			$tmpPath = str_replace(DIRECTORY_SEPARATOR, '/', $_SERVER['DOCUMENT_ROOT']);
463 463
 		}
464 464
 
465
-		$query = "/JUST/CHECK/REWRITE/" . $checkFilePath;
465
+		$query = "/JUST/CHECK/REWRITE/".$checkFilePath;
466 466
 		$currentPath = str_replace($tmpPath, "", _XE_PATH_);
467
-		if($currentPath != "")
467
+		if ($currentPath != "")
468 468
 		{
469
-			$query = $currentPath . $query;
469
+			$query = $currentPath.$query;
470 470
 		}
471 471
 		$requestUrl = sprintf('%s://%s%s%s', $scheme, $hostname, $str_port, $query);
472 472
 		$requestConfig = array();
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 			'./files/cache/template_compiled',
492 492
 		);
493 493
 
494
-		foreach($directory_list as $dir)
494
+		foreach ($directory_list as $dir)
495 495
 		{
496 496
 			FileHandler::makeDir($dir);
497 497
 		}
@@ -507,57 +507,57 @@  discard block
 block discarded – undo
507 507
 		$oModuleModel = getModel('module');
508 508
 		// Create a table ny finding schemas/*.xml file in each module
509 509
 		$module_list = FileHandler::readDir('./modules/', NULL, false, true);
510
-		foreach($module_list as $module_path)
510
+		foreach ($module_list as $module_path)
511 511
 		{
512 512
 			// Get module name
513
-			$tmp_arr = explode('/',$module_path);
514
-			$module = $tmp_arr[count($tmp_arr)-1];
513
+			$tmp_arr = explode('/', $module_path);
514
+			$module = $tmp_arr[count($tmp_arr) - 1];
515 515
 
516 516
 			$xml_info = $oModuleModel->getModuleInfoXml($module);
517
-			if(!$xml_info) continue;
517
+			if (!$xml_info) continue;
518 518
 			$modules[$xml_info->category][] = $module;
519 519
 		}
520 520
 		// Install "module" module in advance
521
-		$this->installModule('module','./modules/module');
521
+		$this->installModule('module', './modules/module');
522 522
 		$oModule = getClass('module');
523
-		if($oModule->checkUpdate()) $oModule->moduleUpdate();
523
+		if ($oModule->checkUpdate()) $oModule->moduleUpdate();
524 524
 		// Determine the order of module installation depending on category
525
-		$install_step = array('system','content','member');
525
+		$install_step = array('system', 'content', 'member');
526 526
 		// Install all the remaining modules
527
-		foreach($install_step as $category)
527
+		foreach ($install_step as $category)
528 528
 		{
529
-			if(count($modules[$category]))
529
+			if (count($modules[$category]))
530 530
 			{
531
-				foreach($modules[$category] as $module)
531
+				foreach ($modules[$category] as $module)
532 532
 				{
533
-					if($module == 'module') continue;
533
+					if ($module == 'module') continue;
534 534
 					$this->installModule($module, sprintf('./modules/%s', $module));
535 535
 
536 536
 					$oModule = getClass($module);
537
-					if(is_object($oModule) && method_exists($oModule, 'checkUpdate'))
537
+					if (is_object($oModule) && method_exists($oModule, 'checkUpdate'))
538 538
 					{
539
-						if($oModule->checkUpdate()) $oModule->moduleUpdate();
539
+						if ($oModule->checkUpdate()) $oModule->moduleUpdate();
540 540
 					}
541 541
 				}
542 542
 				unset($modules[$category]);
543 543
 			}
544 544
 		}
545 545
 		// Install all the remaining modules
546
-		if(count($modules))
546
+		if (count($modules))
547 547
 		{
548
-			foreach($modules as $category => $module_list)
548
+			foreach ($modules as $category => $module_list)
549 549
 			{
550
-				if(count($module_list))
550
+				if (count($module_list))
551 551
 				{
552
-					foreach($module_list as $module)
552
+					foreach ($module_list as $module)
553 553
 					{
554
-						if($module == 'module') continue;
554
+						if ($module == 'module') continue;
555 555
 						$this->installModule($module, sprintf('./modules/%s', $module));
556 556
 
557 557
 						$oModule = getClass($module);
558
-						if($oModule && method_exists($oModule, 'checkUpdate') && method_exists($oModule, 'moduleUpdate'))
558
+						if ($oModule && method_exists($oModule, 'checkUpdate') && method_exists($oModule, 'moduleUpdate'))
559 559
 						{
560
-							if($oModule->checkUpdate()) $oModule->moduleUpdate();
560
+							if ($oModule->checkUpdate()) $oModule->moduleUpdate();
561 561
 						}
562 562
 					}
563 563
 				}
@@ -579,31 +579,31 @@  discard block
 block discarded – undo
579 579
 		$schema_files = FileHandler::readDir($schema_dir, NULL, false, true);
580 580
 
581 581
 		$file_cnt = count($schema_files);
582
-		for($i=0;$i<$file_cnt;$i++)
582
+		for ($i = 0; $i < $file_cnt; $i++)
583 583
 		{
584 584
 			$file = trim($schema_files[$i]);
585
-			if(!$file || substr($file,-4)!='.xml') continue;
585
+			if (!$file || substr($file, -4) != '.xml') continue;
586 586
 			$output = $oDB->createTableByXmlFile($file);
587
-			if($output === false)
587
+			if ($output === false)
588 588
 				throw new Exception('msg_create_table_failed');
589 589
 		}
590 590
 		// Create a table and module instance and then execute install() method
591 591
 		unset($oModule);
592 592
 		$oModule = getClass($module);
593
-		if(method_exists($oModule, 'moduleInstall')) $oModule->moduleInstall();
593
+		if (method_exists($oModule, 'moduleInstall')) $oModule->moduleInstall();
594 594
 		return new BaseObject();
595 595
 	}
596 596
 
597 597
 	function _getDBConfigFileContents($db_info)
598 598
 	{
599
-		if(substr($db_info->master_db['db_table_prefix'], -1) != '_')
599
+		if (substr($db_info->master_db['db_table_prefix'], -1) != '_')
600 600
 		{
601 601
 			$db_info->master_db['db_table_prefix'] .= '_';
602 602
 		}
603 603
 
604
-		foreach($db_info->slave_db as &$slave)
604
+		foreach ($db_info->slave_db as &$slave)
605 605
 		{
606
-			if(substr($slave['db_table_prefix'], -1) != '_')
606
+			if (substr($slave['db_table_prefix'], -1) != '_')
607 607
 			{
608 608
 				$slave['db_table_prefix'] .= '_';
609 609
 			}
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 
612 612
 		$buff = array();
613 613
 		$buff[] = '<?php if(!defined("__XE__")) exit();';
614
-		$buff[] = '$db_info = (object)' . var_export(get_object_vars($db_info), TRUE) . ';';
614
+		$buff[] = '$db_info = (object)'.var_export(get_object_vars($db_info), TRUE).';';
615 615
 
616 616
 		return implode(PHP_EOL, $buff);
617 617
 	}
@@ -625,13 +625,13 @@  discard block
 block discarded – undo
625 625
 		$db_tmp_config_file = $this->db_tmp_config_file;
626 626
 
627 627
 		$db_info = Context::getDBInfo();
628
-		if(!$db_info) return;
628
+		if (!$db_info) return;
629 629
 
630 630
 		$buff = $this->_getDBConfigFileContents($db_info);
631 631
 
632 632
 		FileHandler::writeFile($db_tmp_config_file, $buff);
633 633
 
634
-		if(@file_exists($db_tmp_config_file)) return true;
634
+		if (@file_exists($db_tmp_config_file)) return true;
635 635
 		return false;
636 636
 	}
637 637
 
@@ -644,14 +644,14 @@  discard block
 block discarded – undo
644 644
 		$etc_tmp_config_file = $this->etc_tmp_config_file;
645 645
 
646 646
 		$buff = '<?php if(!defined("__XE__")) exit();'."\n";
647
-		foreach($config_info as $key => $val)
647
+		foreach ($config_info as $key => $val)
648 648
 		{
649
-			$buff .= sprintf("\$db_info->%s = '%s';\n", $key, str_replace("'","\\'",$val));
649
+			$buff .= sprintf("\$db_info->%s = '%s';\n", $key, str_replace("'", "\\'", $val));
650 650
 		}
651 651
 
652 652
 		FileHandler::writeFile($etc_tmp_config_file, $buff);
653 653
 
654
-		if(@file_exists($etc_tmp_config_file)) return true;
654
+		if (@file_exists($etc_tmp_config_file)) return true;
655 655
 		return false;
656 656
 	}
657 657
 
@@ -666,13 +666,13 @@  discard block
 block discarded – undo
666 666
 			//if(file_exists($config_file)) return;
667 667
 
668 668
 			$db_info = Context::getDBInfo();
669
-			if(!$db_info) return;
669
+			if (!$db_info) return;
670 670
 
671 671
 			$buff = $this->_getDBConfigFileContents($db_info);
672 672
 
673 673
 			FileHandler::writeFile($config_file, $buff);
674 674
 
675
-			if(@file_exists($config_file))
675
+			if (@file_exists($config_file))
676 676
 			{
677 677
 				FileHandler::removeFile($this->db_tmp_config_file);
678 678
 				FileHandler::removeFile($this->etc_tmp_config_file);
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 	function installByConfig($install_config_file)
688 688
 	{
689 689
 		include $install_config_file;
690
-		if(!is_array($auto_config)) return false;
690
+		if (!is_array($auto_config)) return false;
691 691
 
692 692
 		$auto_config['module'] = 'install';
693 693
 		$auto_config['act'] = 'procInstall';
@@ -695,22 +695,22 @@  discard block
 block discarded – undo
695 695
 		$fstr = "<%s><![CDATA[%s]]></%s>\r\n";
696 696
 		$fheader = "POST %s HTTP/1.1\r\nHost: %s\r\nContent-Type: application/xml\r\nContent-Length: %s\r\n\r\n%s\r\n";
697 697
 		$body = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n<methodCall>\r\n<params>\r\n";
698
-		foreach($auto_config as $k => $v)
698
+		foreach ($auto_config as $k => $v)
699 699
 		{
700
-			if(!in_array($k,array('host','port','path'))) $body .= sprintf($fstr,$k,$v,$k);
700
+			if (!in_array($k, array('host', 'port', 'path'))) $body .= sprintf($fstr, $k, $v, $k);
701 701
 		}
702 702
 		$body .= "</params>\r\n</methodCall>";
703 703
 
704
-		$header = sprintf($fheader,$auto_config['path'],$auto_config['host'],strlen($body),$body);
704
+		$header = sprintf($fheader, $auto_config['path'], $auto_config['host'], strlen($body), $body);
705 705
 		$fp = @fsockopen($auto_config['host'], $auto_config['port'], $errno, $errstr, 5);
706 706
 
707
-		if($fp)
707
+		if ($fp)
708 708
 		{
709 709
 			fputs($fp, $header);
710
-			while(!feof($fp))
710
+			while (!feof($fp))
711 711
 			{
712 712
 				$line = trim(fgets($fp, 4096));
713
-				if(strncmp('<error>', $line, 7) === 0)
713
+				if (strncmp('<error>', $line, 7) === 0)
714 714
 				{
715 715
 					fclose($fp);
716 716
 					return false;
Please login to merge, or discard this patch.
modules/install/install.admin.controller.php 2 patches
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	function procInstallAdminInstall()
21 21
 	{
22 22
 		$module_name = Context::get('module_name');
23
-		if(!$module_name) return new BaseObject(-1, 'invalid_request');
23
+		if (!$module_name) return new BaseObject(-1, 'invalid_request');
24 24
 
25 25
 		$oInstallController = getController('install');
26 26
 		$oInstallController->installModule($module_name, './modules/'.$module_name);
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
 	{
36 36
 		@set_time_limit(0);
37 37
 		$module_name = Context::get('module_name');
38
-		if(!$module_name) return new BaseObject(-1, 'invalid_request');
38
+		if (!$module_name) return new BaseObject(-1, 'invalid_request');
39 39
 
40 40
 		$oModule = getModule($module_name, 'class');
41
-		if($oModule) $output = $oModule->moduleUpdate();
41
+		if ($oModule) $output = $oModule->moduleUpdate();
42 42
 		else $output = new BaseObject(-1, 'invalid_request');
43 43
 
44 44
 		return $output;
@@ -53,51 +53,51 @@  discard block
 block discarded – undo
53 53
 
54 54
 		$admin_ip_list = Context::get('admin_ip_list');
55 55
 
56
-		if($admin_ip_list)
56
+		if ($admin_ip_list)
57 57
 		{
58
-			$admin_ip_list = preg_replace("/[\r|\n|\r\n]+/",",",$admin_ip_list);
59
-			$admin_ip_list = preg_replace("/\s+/","",$admin_ip_list);
60
-			if(preg_match('/(<\?|<\?php|\?>)/xsm', $admin_ip_list))
58
+			$admin_ip_list = preg_replace("/[\r|\n|\r\n]+/", ",", $admin_ip_list);
59
+			$admin_ip_list = preg_replace("/\s+/", "", $admin_ip_list);
60
+			if (preg_match('/(<\?|<\?php|\?>)/xsm', $admin_ip_list))
61 61
 			{
62 62
 				$admin_ip_list = '';
63 63
 			}
64
-			$admin_ip_list .= ',127.0.0.1,' . $_SERVER['REMOTE_ADDR'];
65
-			$admin_ip_list = explode(',',trim($admin_ip_list, ','));
64
+			$admin_ip_list .= ',127.0.0.1,'.$_SERVER['REMOTE_ADDR'];
65
+			$admin_ip_list = explode(',', trim($admin_ip_list, ','));
66 66
 			$admin_ip_list = array_unique($admin_ip_list);
67
-			if(!IpFilter::validate($admin_ip_list)) {
67
+			if (!IpFilter::validate($admin_ip_list)) {
68 68
 				return new BaseObject(-1, 'msg_invalid_ip');
69 69
 			}
70 70
 		}
71 71
 		
72 72
 		$default_url = Context::get('default_url');
73
-		if($default_url && strncasecmp('http://', $default_url, 7) !== 0 && strncasecmp('https://', $default_url, 8) !== 0) $default_url = 'http://'.$default_url;
74
-		if($default_url && substr($default_url, -1) !== '/') $default_url = $default_url.'/';
73
+		if ($default_url && strncasecmp('http://', $default_url, 7) !== 0 && strncasecmp('https://', $default_url, 8) !== 0) $default_url = 'http://'.$default_url;
74
+		if ($default_url && substr($default_url, -1) !== '/') $default_url = $default_url.'/';
75 75
 
76 76
 		/* convert NON Alphabet URL to punycode URL - Alphabet URL will not be changed */
77
-		require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php');
77
+		require_once(_XE_PATH_.'libs/idna_convert/idna_convert.class.php');
78 78
 		$IDN = new idna_convert(array('idn_version' => 2008));
79 79
 		$default_url = $IDN->encode($default_url);
80 80
 
81 81
 		$use_ssl = Context::get('use_ssl');
82
-		if(!$use_ssl) $use_ssl = 'none';
82
+		if (!$use_ssl) $use_ssl = 'none';
83 83
 
84 84
 		$http_port = Context::get('http_port');
85 85
 		$https_port = Context::get('https_port');
86 86
 
87 87
 		$use_rewrite = Context::get('use_rewrite');
88
-		if($use_rewrite!='Y') $use_rewrite = 'N';
88
+		if ($use_rewrite != 'Y') $use_rewrite = 'N';
89 89
 
90 90
 		$use_sso = Context::get('use_sso');
91
-		if($use_sso !='Y') $use_sso = 'N';
91
+		if ($use_sso != 'Y') $use_sso = 'N';
92 92
 
93 93
 		$use_db_session = Context::get('use_db_session');
94
-		if($use_db_session!='Y') $use_db_session = 'N';
94
+		if ($use_db_session != 'Y') $use_db_session = 'N';
95 95
 
96 96
 		$qmail_compatibility = Context::get('qmail_compatibility');
97
-		if($qmail_compatibility!='Y') $qmail_compatibility = 'N';
97
+		if ($qmail_compatibility != 'Y') $qmail_compatibility = 'N';
98 98
 
99 99
 		$use_html5 = Context::get('use_html5');
100
-		if(!$use_html5) $use_html5 = 'N';
100
+		if (!$use_html5) $use_html5 = 'N';
101 101
 
102 102
 		$db_info->default_url = $default_url;
103 103
 		$db_info->qmail_compatibility = $qmail_compatibility;
@@ -108,23 +108,23 @@  discard block
 block discarded – undo
108 108
 		$db_info->use_html5 = $use_html5;
109 109
 		$db_info->admin_ip_list = $admin_ip_list;
110 110
 
111
-		if($http_port) $db_info->http_port = (int) $http_port;
112
-		else if($db_info->http_port) unset($db_info->http_port);
111
+		if ($http_port) $db_info->http_port = (int) $http_port;
112
+		else if ($db_info->http_port) unset($db_info->http_port);
113 113
 
114
-		if($https_port) $db_info->https_port = (int) $https_port;
115
-		else if($db_info->https_port) unset($db_info->https_port);
114
+		if ($https_port) $db_info->https_port = (int) $https_port;
115
+		else if ($db_info->https_port) unset($db_info->https_port);
116 116
 
117 117
 		unset($db_info->lang_type);
118 118
 
119 119
 		$oInstallController = getController('install');
120
-		if(!$oInstallController->makeConfigFile())
120
+		if (!$oInstallController->makeConfigFile())
121 121
 		{
122 122
 			return new BaseObject(-1, 'msg_invalid_request');
123 123
 		}
124 124
 		else
125 125
 		{
126 126
 			Context::setDBInfo($db_info);
127
-			if($default_url)
127
+			if ($default_url)
128 128
 			{
129 129
 				$site_args = new stdClass;
130 130
 				$site_args->site_srl = 0;
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
 	function procInstallAdminUpdateIndexModule()
140 140
 	{
141
-		if(!Context::get('index_module_srl') || !Context::get('menu_item_srl'))
141
+		if (!Context::get('index_module_srl') || !Context::get('menu_item_srl'))
142 142
 		{
143 143
 			return new BaseObject(-1, 'msg_invalid_request');
144 144
 		}
@@ -157,12 +157,12 @@  discard block
 block discarded – undo
157 157
 		// update homeSitemap.php cache file
158 158
 		$oMenuAdminController = getAdminController('menu');
159 159
 		$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
160
-		if(file_exists($homeMenuCacheFile))
160
+		if (file_exists($homeMenuCacheFile))
161 161
 		{
162 162
 			include($homeMenuCacheFile);
163 163
 		}
164 164
 
165
-		if(!$homeMenuSrl || $homeMenuSrl != $output->menu_srl)
165
+		if (!$homeMenuSrl || $homeMenuSrl != $output->menu_srl)
166 166
 		{
167 167
 			$oMenuAdminController->makeHomemenuCacheFile($output->menu_srl);
168 168
 		}
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 	function procInstallAdminRemoveFTPInfo()
174 174
 	{
175 175
 		$ftp_config_file = Context::getFTPConfigFile();
176
-		if(file_exists($ftp_config_file)) unlink($ftp_config_file);
177
-		if($_SESSION['ftp_password']) unset($_SESSION['ftp_password']);
176
+		if (file_exists($ftp_config_file)) unlink($ftp_config_file);
177
+		if ($_SESSION['ftp_password']) unset($_SESSION['ftp_password']);
178 178
 		$this->setMessage('success_deleted');
179 179
 	}
180 180
 
@@ -185,11 +185,11 @@  discard block
 block discarded – undo
185 185
 		$ftp_info->ftp_port = Context::get('ftp_port');
186 186
 		$ftp_info->ftp_host = Context::get('ftp_host');
187 187
 		$ftp_info->ftp_pasv = Context::get('ftp_pasv');
188
-		if(!$ftp_info->ftp_pasv) $ftp_info->ftp_pasv = "N";
188
+		if (!$ftp_info->ftp_pasv) $ftp_info->ftp_pasv = "N";
189 189
 		$ftp_info->sftp = Context::get('sftp');
190 190
 
191 191
 		$ftp_root_path = Context::get('ftp_root_path');
192
-		if(substr($ftp_root_path, strlen($ftp_root_path)-1) == "/")
192
+		if (substr($ftp_root_path, strlen($ftp_root_path) - 1) == "/")
193 193
 		{
194 194
 			$ftp_info->ftp_root_path = $ftp_root_path;
195 195
 		}
@@ -198,25 +198,25 @@  discard block
 block discarded – undo
198 198
 			$ftp_info->ftp_root_path = $ftp_root_path.'/';
199 199
 		}
200 200
 
201
-		if(ini_get('safe_mode'))
201
+		if (ini_get('safe_mode'))
202 202
 		{
203 203
 			$ftp_info->ftp_password = Context::get('ftp_password');
204 204
 		}
205 205
 
206 206
 		$buff = '<?php if(!defined("__XE__")) exit();'."\n\$ftp_info = new stdClass;\n";
207
-		foreach($ftp_info as $key => $val)
207
+		foreach ($ftp_info as $key => $val)
208 208
 		{
209
-			if(!$val) continue;
210
-			if(preg_match('/(<\?|<\?php|\?>|fputs|fopen|fwrite|fgets|fread|file_get_contents|file_put_contents|exec|proc_open|popen|passthru|show_source|phpinfo|system|\/\*|\*\/|chr\()/xsm', preg_replace('/\s/', '', $val)))
209
+			if (!$val) continue;
210
+			if (preg_match('/(<\?|<\?php|\?>|fputs|fopen|fwrite|fgets|fread|file_get_contents|file_put_contents|exec|proc_open|popen|passthru|show_source|phpinfo|system|\/\*|\*\/|chr\()/xsm', preg_replace('/\s/', '', $val)))
211 211
 			{
212 212
 				continue;
213 213
 			}
214
-			$buff .= sprintf("\$ftp_info->%s = '%s';\n", $key, str_replace("'","\\'",$val));
214
+			$buff .= sprintf("\$ftp_info->%s = '%s';\n", $key, str_replace("'", "\\'", $val));
215 215
 		}
216 216
 		$buff .= "?>";
217 217
 		$config_file = Context::getFTPConfigFile();
218 218
 		FileHandler::WriteFile($config_file, $buff);
219
-		if($_SESSION['ftp_password']) unset($_SESSION['ftp_password']);
219
+		if ($_SESSION['ftp_password']) unset($_SESSION['ftp_password']);
220 220
 
221 221
 		$this->setMessage('success_updated');
222 222
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigFtp');
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	function procInstallAdminConfig()
227 227
 	{
228 228
 		$use_mobile_view = Context::get('use_mobile_view');
229
-		if($use_mobile_view!='Y') $use_mobile_view = 'N';
229
+		if ($use_mobile_view != 'Y') $use_mobile_view = 'N';
230 230
 
231 231
 		$time_zone = Context::get('time_zone');
232 232
 
@@ -237,15 +237,15 @@  discard block
 block discarded – undo
237 237
 		unset($db_info->lang_type);
238 238
 		Context::setDBInfo($db_info);
239 239
 		$oInstallController = getController('install');
240
-		if(!$oInstallController->makeConfigFile())
240
+		if (!$oInstallController->makeConfigFile())
241 241
 		{
242 242
 			return new BaseObject(-1, 'msg_invalid_request');
243 243
 		}
244 244
 
245 245
 		$site_args = new stdClass();
246 246
 		$site_args->site_srl = 0;
247
-		$site_args->index_module_srl = Context::get('index_module_srl');//
248
-		$site_args->default_language = Context::get('change_lang_type');//
247
+		$site_args->index_module_srl = Context::get('index_module_srl'); //
248
+		$site_args->default_language = Context::get('change_lang_type'); //
249 249
 		$oModuleController = getController('module');
250 250
 		$oModuleController->updateSite($site_args);
251 251
 
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
 		$deleteFavicon = Context::get('is_delete_favicon');
258 258
 		$deleteMobicon = Context::get('is_delete_mobicon');
259 259
 
260
-		$this->updateIcon('favicon.ico',$deleteFavicon);
261
-		$this->updateIcon('mobicon.png',$deleteMobicon);
260
+		$this->updateIcon('favicon.ico', $deleteFavicon);
261
+		$this->updateIcon('mobicon.png', $deleteMobicon);
262 262
 
263 263
 		//모듈 설정 저장(썸네일, 풋터스크립트)
264 264
 		$config = new stdClass();
@@ -276,16 +276,16 @@  discard block
 block discarded – undo
276 276
 
277 277
 		$favicon = Context::get('favicon');
278 278
 		$mobicon = Context::get('mobicon');
279
-		if(!$favicon && !$mobicon) {
279
+		if (!$favicon && !$mobicon) {
280 280
 			Context::set('msg', Context::getLang("msg_invalid_format"));
281 281
 			return;
282 282
 		}
283
-		if($favicon) {
283
+		if ($favicon) {
284 284
 			$name = 'favicon';
285
-			$tmpFileName = $this->saveIconTmp($favicon,'favicon.ico');
285
+			$tmpFileName = $this->saveIconTmp($favicon, 'favicon.ico');
286 286
 		} else {
287 287
 			$name = 'mobicon';
288
-			$tmpFileName = $this->saveIconTmp($mobicon,'mobicon.png');
288
+			$tmpFileName = $this->saveIconTmp($mobicon, 'mobicon.png');
289 289
 		}
290 290
 
291 291
 		Context::set('name', $name);
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
 		$lang_supported = Context::loadLangSupported();
303 303
 		$buff = null;
304
-		for($i=0;$i<count($langs);$i++)
304
+		for ($i = 0; $i < count($langs); $i++)
305 305
 		{
306 306
 			$buff .= sprintf("%s,%s\n", $langs[$i], $lang_supported[$langs[$i]]);
307 307
 
@@ -329,12 +329,12 @@  discard block
 block discarded – undo
329 329
 		}
330 330
 
331 331
 		$oModuleController = getController('module');
332
-		$oModuleController->insertModuleConfig('document',$documentConfig);
332
+		$oModuleController->insertModuleConfig('document', $documentConfig);
333 333
 
334 334
 		$args = new stdClass;
335 335
 		$args->htmlFooter = $config->htmlFooter;
336 336
 		$args->siteTitle = $config->siteTitle;
337
-		$oModuleController->updateModuleConfig('module',$args);
337
+		$oModuleController->updateModuleConfig('module', $args);
338 338
 	}
339 339
 
340 340
 	private function saveIconTmp($icon, $iconname)
@@ -342,9 +342,9 @@  discard block
 block discarded – undo
342 342
 
343 343
 		$site_info = Context::get('site_module_info');
344 344
 		$virtual_site = '';
345
-		if($site_info->site_srl) 
345
+		if ($site_info->site_srl) 
346 346
 		{
347
-			$virtual_site = $site_info->site_srl . '/';
347
+			$virtual_site = $site_info->site_srl.'/';
348 348
 		}
349 349
 
350 350
 		$target_file = $icon['tmp_name'];
@@ -353,20 +353,20 @@  discard block
 block discarded – undo
353 353
 		$target_filename = _XE_PATH_.$relative_filename;
354 354
 
355 355
 		list($width, $height, $type_no, $attrs) = @getimagesize($target_file);
356
-		if($iconname == 'favicon.ico')
356
+		if ($iconname == 'favicon.ico')
357 357
 		{
358
-			if(!preg_match('/^.*(x-icon|\.icon)$/i',$type)) {
358
+			if (!preg_match('/^.*(x-icon|\.icon)$/i', $type)) {
359 359
 				Context::set('msg', '*.ico '.Context::getLang('msg_possible_only_file'));
360 360
 				return;
361 361
 			}
362 362
 		}
363
-		else if($iconname == 'mobicon.png')
363
+		else if ($iconname == 'mobicon.png')
364 364
 		{
365
-			if(!preg_match('/^.*(png).*$/',$type)) {
365
+			if (!preg_match('/^.*(png).*$/', $type)) {
366 366
 				Context::set('msg', '*.png '.Context::getLang('msg_possible_only_file'));
367 367
 				return;
368 368
 			}
369
-			if(!(($height == '57' && $width == '57') || ($height == '114' && $width == '114'))) {
369
+			if (!(($height == '57' && $width == '57') || ($height == '114' && $width == '114'))) {
370 370
 				Context::set('msg', Context::getLang('msg_invalid_format').' (size : 57x57, 114x114)');
371 371
 				return;
372 372
 			}
@@ -387,21 +387,21 @@  discard block
 block discarded – undo
387 387
 
388 388
 		$site_info = Context::get('site_module_info');
389 389
 		$virtual_site = '';
390
-		if($site_info->site_srl) 
390
+		if ($site_info->site_srl) 
391 391
 		{
392
-			$virtual_site = $site_info->site_srl . '/';
392
+			$virtual_site = $site_info->site_srl.'/';
393 393
 		}
394 394
 
395
-		$image_filepath = _XE_PATH_.'files/attach/xeicon/' . $virtual_site;
395
+		$image_filepath = _XE_PATH_.'files/attach/xeicon/'.$virtual_site;
396 396
 
397
-		if($deleteIcon) {
397
+		if ($deleteIcon) {
398 398
 			FileHandler::removeFile($image_filepath.$iconname);
399 399
 			return;
400 400
 		}
401 401
 
402 402
 		$tmpicon_filepath = $image_filepath.'tmp/'.$iconname;
403 403
 		$icon_filepath = $image_filepath.$iconname;
404
-		if(file_exists($tmpicon_filepath))
404
+		if (file_exists($tmpicon_filepath))
405 405
 		{
406 406
 			FileHandler::moveFile($tmpicon_filepath, $icon_filepath);
407 407
 		}
Please login to merge, or discard this patch.
Braces   +68 added lines, -32 removed lines patch added patch discarded remove patch
@@ -20,7 +20,9 @@  discard block
 block discarded – undo
20 20
 	function procInstallAdminInstall()
21 21
 	{
22 22
 		$module_name = Context::get('module_name');
23
-		if(!$module_name) return new BaseObject(-1, 'invalid_request');
23
+		if(!$module_name) {
24
+			return new BaseObject(-1, 'invalid_request');
25
+		}
24 26
 
25 27
 		$oInstallController = getController('install');
26 28
 		$oInstallController->installModule($module_name, './modules/'.$module_name);
@@ -35,11 +37,16 @@  discard block
 block discarded – undo
35 37
 	{
36 38
 		@set_time_limit(0);
37 39
 		$module_name = Context::get('module_name');
38
-		if(!$module_name) return new BaseObject(-1, 'invalid_request');
40
+		if(!$module_name) {
41
+			return new BaseObject(-1, 'invalid_request');
42
+		}
39 43
 
40 44
 		$oModule = getModule($module_name, 'class');
41
-		if($oModule) $output = $oModule->moduleUpdate();
42
-		else $output = new BaseObject(-1, 'invalid_request');
45
+		if($oModule) {
46
+			$output = $oModule->moduleUpdate();
47
+		} else {
48
+			$output = new BaseObject(-1, 'invalid_request');
49
+		}
43 50
 
44 51
 		return $output;
45 52
 	}
@@ -70,8 +77,12 @@  discard block
 block discarded – undo
70 77
 		}
71 78
 		
72 79
 		$default_url = Context::get('default_url');
73
-		if($default_url && strncasecmp('http://', $default_url, 7) !== 0 && strncasecmp('https://', $default_url, 8) !== 0) $default_url = 'http://'.$default_url;
74
-		if($default_url && substr($default_url, -1) !== '/') $default_url = $default_url.'/';
80
+		if($default_url && strncasecmp('http://', $default_url, 7) !== 0 && strncasecmp('https://', $default_url, 8) !== 0) {
81
+			$default_url = 'http://'.$default_url;
82
+		}
83
+		if($default_url && substr($default_url, -1) !== '/') {
84
+			$default_url = $default_url.'/';
85
+		}
75 86
 
76 87
 		/* convert NON Alphabet URL to punycode URL - Alphabet URL will not be changed */
77 88
 		require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php');
@@ -79,25 +90,37 @@  discard block
 block discarded – undo
79 90
 		$default_url = $IDN->encode($default_url);
80 91
 
81 92
 		$use_ssl = Context::get('use_ssl');
82
-		if(!$use_ssl) $use_ssl = 'none';
93
+		if(!$use_ssl) {
94
+			$use_ssl = 'none';
95
+		}
83 96
 
84 97
 		$http_port = Context::get('http_port');
85 98
 		$https_port = Context::get('https_port');
86 99
 
87 100
 		$use_rewrite = Context::get('use_rewrite');
88
-		if($use_rewrite!='Y') $use_rewrite = 'N';
101
+		if($use_rewrite!='Y') {
102
+			$use_rewrite = 'N';
103
+		}
89 104
 
90 105
 		$use_sso = Context::get('use_sso');
91
-		if($use_sso !='Y') $use_sso = 'N';
106
+		if($use_sso !='Y') {
107
+			$use_sso = 'N';
108
+		}
92 109
 
93 110
 		$use_db_session = Context::get('use_db_session');
94
-		if($use_db_session!='Y') $use_db_session = 'N';
111
+		if($use_db_session!='Y') {
112
+			$use_db_session = 'N';
113
+		}
95 114
 
96 115
 		$qmail_compatibility = Context::get('qmail_compatibility');
97
-		if($qmail_compatibility!='Y') $qmail_compatibility = 'N';
116
+		if($qmail_compatibility!='Y') {
117
+			$qmail_compatibility = 'N';
118
+		}
98 119
 
99 120
 		$use_html5 = Context::get('use_html5');
100
-		if(!$use_html5) $use_html5 = 'N';
121
+		if(!$use_html5) {
122
+			$use_html5 = 'N';
123
+		}
101 124
 
102 125
 		$db_info->default_url = $default_url;
103 126
 		$db_info->qmail_compatibility = $qmail_compatibility;
@@ -108,11 +131,17 @@  discard block
 block discarded – undo
108 131
 		$db_info->use_html5 = $use_html5;
109 132
 		$db_info->admin_ip_list = $admin_ip_list;
110 133
 
111
-		if($http_port) $db_info->http_port = (int) $http_port;
112
-		else if($db_info->http_port) unset($db_info->http_port);
134
+		if($http_port) {
135
+			$db_info->http_port = (int) $http_port;
136
+		} else if($db_info->http_port) {
137
+			unset($db_info->http_port);
138
+		}
113 139
 
114
-		if($https_port) $db_info->https_port = (int) $https_port;
115
-		else if($db_info->https_port) unset($db_info->https_port);
140
+		if($https_port) {
141
+			$db_info->https_port = (int) $https_port;
142
+		} else if($db_info->https_port) {
143
+			unset($db_info->https_port);
144
+		}
116 145
 
117 146
 		unset($db_info->lang_type);
118 147
 
@@ -120,8 +149,7 @@  discard block
 block discarded – undo
120 149
 		if(!$oInstallController->makeConfigFile())
121 150
 		{
122 151
 			return new BaseObject(-1, 'msg_invalid_request');
123
-		}
124
-		else
152
+		} else
125 153
 		{
126 154
 			Context::setDBInfo($db_info);
127 155
 			if($default_url)
@@ -173,8 +201,12 @@  discard block
 block discarded – undo
173 201
 	function procInstallAdminRemoveFTPInfo()
174 202
 	{
175 203
 		$ftp_config_file = Context::getFTPConfigFile();
176
-		if(file_exists($ftp_config_file)) unlink($ftp_config_file);
177
-		if($_SESSION['ftp_password']) unset($_SESSION['ftp_password']);
204
+		if(file_exists($ftp_config_file)) {
205
+			unlink($ftp_config_file);
206
+		}
207
+		if($_SESSION['ftp_password']) {
208
+			unset($_SESSION['ftp_password']);
209
+		}
178 210
 		$this->setMessage('success_deleted');
179 211
 	}
180 212
 
@@ -185,15 +217,16 @@  discard block
 block discarded – undo
185 217
 		$ftp_info->ftp_port = Context::get('ftp_port');
186 218
 		$ftp_info->ftp_host = Context::get('ftp_host');
187 219
 		$ftp_info->ftp_pasv = Context::get('ftp_pasv');
188
-		if(!$ftp_info->ftp_pasv) $ftp_info->ftp_pasv = "N";
220
+		if(!$ftp_info->ftp_pasv) {
221
+			$ftp_info->ftp_pasv = "N";
222
+		}
189 223
 		$ftp_info->sftp = Context::get('sftp');
190 224
 
191 225
 		$ftp_root_path = Context::get('ftp_root_path');
192 226
 		if(substr($ftp_root_path, strlen($ftp_root_path)-1) == "/")
193 227
 		{
194 228
 			$ftp_info->ftp_root_path = $ftp_root_path;
195
-		}
196
-		else
229
+		} else
197 230
 		{
198 231
 			$ftp_info->ftp_root_path = $ftp_root_path.'/';
199 232
 		}
@@ -206,7 +239,9 @@  discard block
 block discarded – undo
206 239
 		$buff = '<?php if(!defined("__XE__")) exit();'."\n\$ftp_info = new stdClass;\n";
207 240
 		foreach($ftp_info as $key => $val)
208 241
 		{
209
-			if(!$val) continue;
242
+			if(!$val) {
243
+				continue;
244
+			}
210 245
 			if(preg_match('/(<\?|<\?php|\?>|fputs|fopen|fwrite|fgets|fread|file_get_contents|file_put_contents|exec|proc_open|popen|passthru|show_source|phpinfo|system|\/\*|\*\/|chr\()/xsm', preg_replace('/\s/', '', $val)))
211 246
 			{
212 247
 				continue;
@@ -216,7 +251,9 @@  discard block
 block discarded – undo
216 251
 		$buff .= "?>";
217 252
 		$config_file = Context::getFTPConfigFile();
218 253
 		FileHandler::WriteFile($config_file, $buff);
219
-		if($_SESSION['ftp_password']) unset($_SESSION['ftp_password']);
254
+		if($_SESSION['ftp_password']) {
255
+			unset($_SESSION['ftp_password']);
256
+		}
220 257
 
221 258
 		$this->setMessage('success_updated');
222 259
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigFtp');
@@ -226,7 +263,9 @@  discard block
 block discarded – undo
226 263
 	function procInstallAdminConfig()
227 264
 	{
228 265
 		$use_mobile_view = Context::get('use_mobile_view');
229
-		if($use_mobile_view!='Y') $use_mobile_view = 'N';
266
+		if($use_mobile_view!='Y') {
267
+			$use_mobile_view = 'N';
268
+		}
230 269
 
231 270
 		$time_zone = Context::get('time_zone');
232 271
 
@@ -322,8 +361,7 @@  discard block
 block discarded – undo
322 361
 		if (!$config->thumbnail_type || $config->thumbnail_type != 'ratio')
323 362
 		{
324 363
 			$documentConfig->thumbnail_type = 'crop';
325
-		}
326
-		else
364
+		} else
327 365
 		{
328 366
 			$documentConfig->thumbnail_type = 'ratio';
329 367
 		}
@@ -359,8 +397,7 @@  discard block
 block discarded – undo
359 397
 				Context::set('msg', '*.ico '.Context::getLang('msg_possible_only_file'));
360 398
 				return;
361 399
 			}
362
-		}
363
-		else if($iconname == 'mobicon.png')
400
+		} else if($iconname == 'mobicon.png')
364 401
 		{
365 402
 			if(!preg_match('/^.*(png).*$/',$type)) {
366 403
 				Context::set('msg', '*.png '.Context::getLang('msg_possible_only_file'));
@@ -370,8 +407,7 @@  discard block
 block discarded – undo
370 407
 				Context::set('msg', Context::getLang('msg_invalid_format').' (size : 57x57, 114x114)');
371 408
 				return;
372 409
 			}
373
-		}
374
-		else
410
+		} else
375 411
 		{
376 412
 			Context::set('msg', Context::getLang('msg_invalid_format'));
377 413
 			return;
Please login to merge, or discard this patch.
modules/member/member.class.php 2 patches
Spacing   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	function member()
22 22
 	{
23
-		if(!Context::isInstalled()) return;
23
+		if (!Context::isInstalled()) return;
24 24
 
25 25
 		$oModuleModel = getModel('module');
26 26
 		$member_config = $oModuleModel->getModuleConfig('member');
27 27
 
28 28
 		// Set to use SSL upon actions related member join/information/password and so on. 2013.02.15
29
-		if(!Context::isExistsSSLAction('dispMemberModifyPassword') && Context::getSslStatus() == 'optional')
29
+		if (!Context::isExistsSSLAction('dispMemberModifyPassword') && Context::getSslStatus() == 'optional')
30 30
 		{
31 31
 			$ssl_actions = array('dispMemberModifyPassword', 'dispMemberSignUpForm', 'dispMemberModifyInfo', 'dispMemberModifyEmailAddress', 'dispMemberGetTempPassword', 'dispMemberResendAuthMail', 'dispMemberLoginForm', 'dispMemberFindAccount', 'dispMemberLeave', 'procMemberLogin', 'procMemberModifyPassword', 'procMemberInsert', 'procMemberModifyInfo', 'procMemberFindAccount', 'procMemberModifyEmailAddress', 'procMemberResendAuthMail', 'procMemberLeave'/*, 'getMemberMenu'*/, 'procMemberFindAccountByQuestion');
32 32
 			Context::addSSLActions($ssl_actions);
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 		$oModuleController = getController('module');
45 45
 
46 46
 		$oDB = &DB::getInstance();
47
-		$oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true);
47
+		$oDB->addIndex("member_group", "idx_site_title", array("site_srl", "title"), true);
48 48
 
49 49
 		$oModuleModel = getModel('module');
50 50
 		$config = $oModuleModel->getModuleConfig('member');
51 51
 
52
-		if(empty($config))
52
+		if (empty($config))
53 53
 		{
54 54
 			$isNotInstall = true;
55 55
 			$config = new stdClass;
@@ -58,29 +58,29 @@  discard block
 block discarded – undo
58 58
 		// Set the basic information
59 59
 		$config->enable_join = 'Y';
60 60
 		$config->enable_openid = 'N';
61
-		if(!$config->enable_auth_mail) $config->enable_auth_mail = 'N';
62
-		if(!$config->image_name) $config->image_name = 'Y';
63
-		if(!$config->image_mark) $config->image_mark = 'Y';
64
-		if(!$config->profile_image) $config->profile_image = 'Y';
65
-		if(!$config->image_name_max_width) $config->image_name_max_width = '90';
66
-		if(!$config->image_name_max_height) $config->image_name_max_height = '20';
67
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = '20';
68
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = '20';
69
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = '90';
70
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = '90';
71
-		if($config->group_image_mark!='Y') $config->group_image_mark = 'N';
72
-		if(!$config->password_strength) $config->password_strength = 'normal';
61
+		if (!$config->enable_auth_mail) $config->enable_auth_mail = 'N';
62
+		if (!$config->image_name) $config->image_name = 'Y';
63
+		if (!$config->image_mark) $config->image_mark = 'Y';
64
+		if (!$config->profile_image) $config->profile_image = 'Y';
65
+		if (!$config->image_name_max_width) $config->image_name_max_width = '90';
66
+		if (!$config->image_name_max_height) $config->image_name_max_height = '20';
67
+		if (!$config->image_mark_max_width) $config->image_mark_max_width = '20';
68
+		if (!$config->image_mark_max_height) $config->image_mark_max_height = '20';
69
+		if (!$config->profile_image_max_width) $config->profile_image_max_width = '90';
70
+		if (!$config->profile_image_max_height) $config->profile_image_max_height = '90';
71
+		if ($config->group_image_mark != 'Y') $config->group_image_mark = 'N';
72
+		if (!$config->password_strength) $config->password_strength = 'normal';
73 73
 		
74
-		if(!$config->password_hashing_algorithm)
74
+		if (!$config->password_hashing_algorithm)
75 75
 		{
76 76
 			$oPassword = new Password();
77 77
 			$config->password_hashing_algorithm = $oPassword->getBestAlgorithm();
78 78
 		}
79
-		if(!$config->password_hashing_work_factor)
79
+		if (!$config->password_hashing_work_factor)
80 80
 		{
81 81
 			$config->password_hashing_work_factor = 8;
82 82
 		}
83
-		if(!$config->password_hashing_auto_upgrade)
83
+		if (!$config->password_hashing_auto_upgrade)
84 84
 		{
85 85
 			$config->password_hashing_auto_upgrade = 'Y';
86 86
 		}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		$oMemberController = getController('member');
92 92
 		$oMemberAdminController = getAdminController('member');
93 93
 
94
-		if(!$config->signupForm || !is_array($config->signupForm))
94
+		if (!$config->signupForm || !is_array($config->signupForm))
95 95
 		{
96 96
 			$identifier = $isNotInstall ? 'email_address' : 'user_id';
97 97
 
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
 			$oMemberAdminController->_createFindAccountByQuestion($config->identifier);
107 107
 		}
108 108
 		
109
-		$oModuleController->insertModuleConfig('member',$config);
109
+		$oModuleController->insertModuleConfig('member', $config);
110 110
 
111 111
 		$groups = $oMemberModel->getGroups();
112
-		if(!count($groups))
112
+		if (!count($groups))
113 113
 		{
114 114
 			// Set an administrator, regular member(group1), and associate member(group2)
115 115
 			$group_args = new stdClass;
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
 		$admin_args = new stdClass;
136 136
 		$admin_args->is_admin = 'Y';
137 137
 		$output = executeQuery('member.getMemberList', $admin_args);
138
-		if(!$output->data)
138
+		if (!$output->data)
139 139
 		{
140
-			$admin_info = Context::gets('password','nick_name','email_address', 'user_id');
141
-			if($admin_info->email_address)
140
+			$admin_info = Context::gets('password', 'nick_name', 'email_address', 'user_id');
141
+			if ($admin_info->email_address)
142 142
 			{
143 143
 				$admin_info->user_name = 'admin';
144 144
 				// Insert admin information
@@ -150,16 +150,16 @@  discard block
 block discarded – undo
150 150
 		// Register denied ID(default + module name)
151 151
 		$oModuleModel = getModel('module');
152 152
 		$module_list = $oModuleModel->getModuleList();
153
-		foreach($module_list as $key => $val)
153
+		foreach ($module_list as $key => $val)
154 154
 		{
155
-			$oMemberAdminController->insertDeniedID($val->module,'');
155
+			$oMemberAdminController->insertDeniedID($val->module, '');
156 156
 		}
157
-		$oMemberAdminController->insertDeniedID('www','');
158
-		$oMemberAdminController->insertDeniedID('root','');
159
-		$oMemberAdminController->insertDeniedID('administrator','');
160
-		$oMemberAdminController->insertDeniedID('telnet','');
161
-		$oMemberAdminController->insertDeniedID('ftp','');
162
-		$oMemberAdminController->insertDeniedID('http','');
157
+		$oMemberAdminController->insertDeniedID('www', '');
158
+		$oMemberAdminController->insertDeniedID('root', '');
159
+		$oMemberAdminController->insertDeniedID('administrator', '');
160
+		$oMemberAdminController->insertDeniedID('telnet', '');
161
+		$oMemberAdminController->insertDeniedID('ftp', '');
162
+		$oMemberAdminController->insertDeniedID('http', '');
163 163
 		// Create cache directory to use in the member module
164 164
 		FileHandler::makeDir('./files/member_extra_info/image_name');
165 165
 		FileHandler::makeDir('./files/member_extra_info/image_mark');
@@ -184,76 +184,76 @@  discard block
 block discarded – undo
184 184
 		$oModuleModel = getModel('module');
185 185
 		$oModuleController = getController('module');
186 186
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
187
-		if($oModuleModel->needUpdate($version_update_id))
187
+		if ($oModuleModel->needUpdate($version_update_id))
188 188
 		{
189 189
 			// check member directory (11/08/2007 added)
190
-			if(!is_dir("./files/member_extra_info")) return true;
190
+			if (!is_dir("./files/member_extra_info")) return true;
191 191
 			// check member directory (22/10/2007 added)
192
-			if(!is_dir("./files/member_extra_info/profile_image")) return true;
192
+			if (!is_dir("./files/member_extra_info/profile_image")) return true;
193 193
 			// Add a column(is_register) to "member_auth_mail" table (22/04/2008)
194 194
 			$act = $oDB->isColumnExists("member_auth_mail", "is_register");
195
-			if(!$act) return true;
195
+			if (!$act) return true;
196 196
 			// Add a column(site_srl) to "member_group_member" table (11/15/2008)
197
-			if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true;
198
-			if(!$oDB->isColumnExists("member_group", "site_srl")) return true;
199
-			if($oDB->isIndexExists("member_group","uni_member_group_title")) return true;
197
+			if (!$oDB->isColumnExists("member_group_member", "site_srl")) return true;
198
+			if (!$oDB->isColumnExists("member_group", "site_srl")) return true;
199
+			if ($oDB->isIndexExists("member_group", "uni_member_group_title")) return true;
200 200
 
201 201
 			// Add a column for list_order (05/18/2011)
202
-			if(!$oDB->isColumnExists("member_group", "list_order")) return true;
202
+			if (!$oDB->isColumnExists("member_group", "list_order")) return true;
203 203
 
204 204
 			// image_mark 추가 (2009. 02. 14)
205
-			if(!$oDB->isColumnExists("member_group", "image_mark")) return true;
205
+			if (!$oDB->isColumnExists("member_group", "image_mark")) return true;
206 206
 			// Add c column for password expiration date
207
-			if(!$oDB->isColumnExists("member", "change_password_date")) return true;
207
+			if (!$oDB->isColumnExists("member", "change_password_date")) return true;
208 208
 
209 209
 			// Add columns of question and answer to verify a password
210
-			if(!$oDB->isColumnExists("member", "find_account_question")) return true;
211
-			if(!$oDB->isColumnExists("member", "find_account_answer")) return true;
210
+			if (!$oDB->isColumnExists("member", "find_account_question")) return true;
211
+			if (!$oDB->isColumnExists("member", "find_account_answer")) return true;
212 212
 
213
-			if(!$oDB->isColumnExists("member", "list_order")) return true;
214
-			if(!$oDB->isIndexExists("member","idx_list_order")) return true;
213
+			if (!$oDB->isColumnExists("member", "list_order")) return true;
214
+			if (!$oDB->isIndexExists("member", "idx_list_order")) return true;
215 215
 
216 216
 			$oModuleModel = getModel('module');
217 217
 			$config = $oModuleModel->getModuleConfig('member');
218 218
 			// check signup form ordering info
219
-			if(!$config->signupForm) return true;
219
+			if (!$config->signupForm) return true;
220 220
 
221
-			foreach($config->signupForm as $form)
221
+			foreach ($config->signupForm as $form)
222 222
 			{
223
-				if($form->name === 'email_address' && $form->isPublic !== 'N')
223
+				if ($form->name === 'email_address' && $form->isPublic !== 'N')
224 224
 				{
225 225
 					return true;
226 226
 				}
227 227
 			}
228 228
 
229 229
 			// check agreement field exist
230
-			if($config->agreement) return true;
230
+			if ($config->agreement) return true;
231 231
 
232
-			if($config->skin)
232
+			if ($config->skin)
233 233
 			{
234 234
 				$config_parse = explode('.', $config->skin);
235
-				if(count($config_parse) > 1)
235
+				if (count($config_parse) > 1)
236 236
 				{
237 237
 					$template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]);
238
-					if(is_dir($template_path)) return true;
238
+					if (is_dir($template_path)) return true;
239 239
 				}
240 240
 			}
241 241
 
242 242
 			// supprot multilanguage agreement.
243
-			if(is_readable('./files/member_extra_info/agreement.txt')) return true;
243
+			if (is_readable('./files/member_extra_info/agreement.txt')) return true;
244 244
 
245 245
 			// 2013. 11. 22 add menu when popup document menu called
246
-			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true;
247
-			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true;
246
+			if (!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true;
247
+			if (!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true;
248 248
 
249 249
 			$oModuleController->insertUpdatedLog($version_update_id);
250 250
 		}
251 251
 
252
-		if(!is_readable('./files/ruleset/insertMember.xml')) return true;
253
-		if(!is_readable('./files/ruleset/login.xml')) return true;
254
-		if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true;
252
+		if (!is_readable('./files/ruleset/insertMember.xml')) return true;
253
+		if (!is_readable('./files/ruleset/login.xml')) return true;
254
+		if (!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true;
255 255
 
256
-		if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true;
256
+		if ($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true;
257 257
 
258 258
 		return false;
259 259
 	}
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 		$oMemberAdminController = getAdminController('member');
272 272
 		$config = $oModuleModel->getModuleConfig('member');
273 273
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
274
-		if($oModuleModel->needUpdate($version_update_id))
274
+		if ($oModuleModel->needUpdate($version_update_id))
275 275
 		{
276 276
 			// Check member directory
277 277
 			FileHandler::makeDir('./files/member_extra_info/image_name');
@@ -279,74 +279,74 @@  discard block
 block discarded – undo
279 279
 			FileHandler::makeDir('./files/member_extra_info/signature');
280 280
 			FileHandler::makeDir('./files/member_extra_info/profile_image');
281 281
 			// Add a column
282
-			if(!$oDB->isColumnExists("member_auth_mail", "is_register"))
282
+			if (!$oDB->isColumnExists("member_auth_mail", "is_register"))
283 283
 			{
284 284
 				$oDB->addColumn("member_auth_mail", "is_register", "char", 1, "N", true);
285 285
 			}
286 286
 			// Add a column(site_srl) to "member_group_member" table (11/15/2008)
287
-			if(!$oDB->isColumnExists("member_group_member", "site_srl"))
287
+			if (!$oDB->isColumnExists("member_group_member", "site_srl"))
288 288
 			{
289 289
 				$oDB->addColumn("member_group_member", "site_srl", "number", 11, 0, true);
290 290
 				$oDB->addIndex("member_group_member", "idx_site_srl", "site_srl", false);
291 291
 			}
292
-			if(!$oDB->isColumnExists("member_group", "site_srl"))
292
+			if (!$oDB->isColumnExists("member_group", "site_srl"))
293 293
 			{
294 294
 				$oDB->addColumn("member_group", "site_srl", "number", 11, 0, true);
295
-				$oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true);
295
+				$oDB->addIndex("member_group", "idx_site_title", array("site_srl", "title"), true);
296 296
 			}
297
-			if($oDB->isIndexExists("member_group","uni_member_group_title"))
297
+			if ($oDB->isIndexExists("member_group", "uni_member_group_title"))
298 298
 			{
299
-				$oDB->dropIndex("member_group","uni_member_group_title",true);
299
+				$oDB->dropIndex("member_group", "uni_member_group_title", true);
300 300
 			}
301 301
 
302 302
 			// Add a column(list_order) to "member_group" table (05/18/2011)
303
-			if(!$oDB->isColumnExists("member_group", "list_order"))
303
+			if (!$oDB->isColumnExists("member_group", "list_order"))
304 304
 			{
305 305
 				$oDB->addColumn("member_group", "list_order", "number", 11, '', true);
306
-				$oDB->addIndex("member_group","idx_list_order", "list_order",false);
306
+				$oDB->addIndex("member_group", "idx_list_order", "list_order", false);
307 307
 				$output = executeQuery('member.updateAllMemberGroupListOrder');
308 308
 			}
309 309
 			// Add a column for image_mark (02/14/2009)
310
-			if(!$oDB->isColumnExists("member_group", "image_mark"))
310
+			if (!$oDB->isColumnExists("member_group", "image_mark"))
311 311
 			{
312 312
 				$oDB->addColumn("member_group", "image_mark", "text");
313 313
 			}
314 314
 			// Add a column for password expiration date
315
-			if(!$oDB->isColumnExists("member", "change_password_date"))
315
+			if (!$oDB->isColumnExists("member", "change_password_date"))
316 316
 			{
317 317
 				$oDB->addColumn("member", "change_password_date", "date");
318 318
 				executeQuery('member.updateAllChangePasswordDate');
319 319
 			}
320 320
 
321 321
 			// Add columns of question and answer to verify a password
322
-			if(!$oDB->isColumnExists("member", "find_account_question"))
322
+			if (!$oDB->isColumnExists("member", "find_account_question"))
323 323
 			{
324 324
 				$oDB->addColumn("member", "find_account_question", "number", 11);
325 325
 			}
326
-			if(!$oDB->isColumnExists("member", "find_account_answer"))
326
+			if (!$oDB->isColumnExists("member", "find_account_answer"))
327 327
 			{
328 328
 				$oDB->addColumn("member", "find_account_answer", "varchar", 250);
329 329
 			}
330 330
 
331
-			if(!$oDB->isColumnExists("member", "list_order"))
331
+			if (!$oDB->isColumnExists("member", "list_order"))
332 332
 			{
333 333
 				$oDB->addColumn("member", "list_order", "number", 11);
334 334
 				@set_time_limit(0);
335 335
 				$args->list_order = 'member_srl';
336
-				executeQuery('member.updateMemberListOrderAll',$args);
336
+				executeQuery('member.updateMemberListOrderAll', $args);
337 337
 				executeQuery('member.updateMemberListOrderAll');
338 338
 			}
339
-			if(!$oDB->isIndexExists("member","idx_list_order"))
339
+			if (!$oDB->isIndexExists("member", "idx_list_order"))
340 340
 			{
341
-				$oDB->addIndex("member","idx_list_order", array("list_order"));
341
+				$oDB->addIndex("member", "idx_list_order", array("list_order"));
342 342
 			}
343 343
 
344 344
 			$config = $oModuleModel->getModuleConfig('member');
345 345
 
346 346
 			// check agreement value exist
347
-			if($config->agreement)
347
+			if ($config->agreement)
348 348
 			{
349
-				$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
349
+				$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
350 350
 				$output = FileHandler::writeFile($agreement_file, $config->agreement);
351 351
 
352 352
 				$config->agreement = NULL;
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 			}
355 355
 
356 356
 			// check signup form ordering info
357
-			if(!$config->signupForm || !is_array($config->signupForm))
357
+			if (!$config->signupForm || !is_array($config->signupForm))
358 358
 			{
359 359
 				$identifier = 'email_address';
360 360
 
@@ -365,9 +365,9 @@  discard block
 block discarded – undo
365 365
 
366 366
 			// 회원정보에서 이메일 노출 제거
367 367
 			// @see https://github.com/xpressengine/xe-core/issues/2177
368
-			foreach($config->signupForm as $form)
368
+			foreach ($config->signupForm as $form)
369 369
 			{
370
-				if($form->name === 'email_address')
370
+				if ($form->name === 'email_address')
371 371
 				{
372 372
 					$form->isPublic = 'N';
373 373
 					break;
@@ -375,13 +375,13 @@  discard block
 block discarded – undo
375 375
 			}
376 376
 			$oModuleController->updateModuleConfig('member', $config);
377 377
 
378
-			if($config->skin)
378
+			if ($config->skin)
379 379
 			{
380 380
 				$config_parse = explode('.', $config->skin);
381 381
 				if (count($config_parse) > 1)
382 382
 				{
383 383
 					$template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]);
384
-					if(is_dir($template_path))
384
+					if (is_dir($template_path))
385 385
 					{
386 386
 						$config->skin = implode('|@|', $config_parse);
387 387
 						$oModuleController = getController('module');
@@ -391,15 +391,15 @@  discard block
 block discarded – undo
391 391
 			}
392 392
 			
393 393
 			// 2013. 11. 22 add menu when popup document menu called
394
-			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'))
394
+			if (!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'))
395 395
 				$oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
396
-			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'))
396
+			if (!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'))
397 397
 				$oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after');
398 398
 
399
-			if(is_readable('./files/member_extra_info/agreement.txt'))
399
+			if (is_readable('./files/member_extra_info/agreement.txt'))
400 400
 			{
401 401
 				$source_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
402
-				$target_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
402
+				$target_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
403 403
 
404 404
 				FileHandler::rename($source_file, $target_file);
405 405
 			}
@@ -408,14 +408,14 @@  discard block
 block discarded – undo
408 408
 		}
409 409
 
410 410
 		FileHandler::makeDir('./files/ruleset');
411
-		if(!is_readable('./files/ruleset/insertMember.xml'))
411
+		if (!is_readable('./files/ruleset/insertMember.xml'))
412 412
 			$oMemberAdminController->_createSignupRuleset($config->signupForm);
413
-		if(!is_readable('./files/ruleset/login.xml'))
413
+		if (!is_readable('./files/ruleset/login.xml'))
414 414
 			$oMemberAdminController->_createLoginRuleset($config->identifier);
415
-		if(!is_readable('./files/ruleset/find_member_account_by_question.xml'))
415
+		if (!is_readable('./files/ruleset/find_member_account_by_question.xml'))
416 416
 			$oMemberAdminController->_createFindAccountByQuestion($config->identifier);
417 417
 
418
-		if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset'))
418
+		if ($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset'))
419 419
 		{
420 420
 			$oMemberAdminController->_createSignupRuleset($config->signupForm);
421 421
 			$oModuleController->insertUpdatedLog('member.1.8.43.recreate_signup_ruleset');
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 	 */
439 439
 	function recordLoginError($error = 0, $message = 'success')
440 440
 	{
441
-		if($error == 0) return new BaseObject($error, $message);
441
+		if ($error == 0) return new BaseObject($error, $message);
442 442
 
443 443
 		// Create a member model object
444 444
 		$oMemberModel = getModel('member');
@@ -446,18 +446,18 @@  discard block
 block discarded – undo
446 446
 
447 447
 		// Check if there is recoding table.
448 448
 		$oDB = &DB::getInstance();
449
-		if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message);
449
+		if (!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message);
450 450
 
451 451
 		$args = new stdClass();
452 452
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
453 453
 
454 454
 		$output = executeQuery('member.getLoginCountByIp', $args);
455
-		if($output->data && $output->data->count)
455
+		if ($output->data && $output->data->count)
456 456
 		{
457 457
 			$last_update = strtotime($output->data->last_update);
458
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
458
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
459 459
 			//update, if IP address access in a short time, update count. If not, make count 1.
460
-			if($term < $config->max_error_count_time)
460
+			if ($term < $config->max_error_count_time)
461 461
 			{
462 462
 				$args->count = $output->data->count + 1;
463 463
 			}
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 	 */
484 484
 	function recordMemberLoginError($error = 0, $message = 'success', $args = NULL)
485 485
 	{
486
-		if($error == 0 || !$args->member_srl) return new BaseObject($error, $message);
486
+		if ($error == 0 || !$args->member_srl) return new BaseObject($error, $message);
487 487
 
488 488
 		// Create a member model object
489 489
 		$oMemberModel = getModel('member');
@@ -491,21 +491,21 @@  discard block
 block discarded – undo
491 491
 
492 492
 		// Check if there is recoding table.
493 493
 		$oDB = &DB::getInstance();
494
-		if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message);
494
+		if (!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message);
495 495
 
496 496
 		$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
497
-		if($output->data && $output->data->content)
497
+		if ($output->data && $output->data->content)
498 498
 		{
499 499
 			//update
500 500
 			$content = unserialize($output->data->content);
501
-			$content[] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']);
501
+			$content[] = array($_SERVER['REMOTE_ADDR'], Context::getLang($message), $_SERVER['REQUEST_TIME']);
502 502
 			$args->content = serialize($content);
503 503
 			$output = executeQuery('member.updateLoginCountHistoryByMemberSrl', $args);
504 504
 		}
505 505
 		else
506 506
 		{
507 507
 			//insert
508
-			$content[0] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']);
508
+			$content[0] = array($_SERVER['REMOTE_ADDR'], Context::getLang($message), $_SERVER['REQUEST_TIME']);
509 509
 			$args->content = serialize($content);
510 510
 			$output = executeQuery('member.insertLoginCountHistoryByMemberSrl', $args);
511 511
 		}
Please login to merge, or discard this patch.
Braces   +138 added lines, -56 removed lines patch added patch discarded remove patch
@@ -20,7 +20,9 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	function member()
22 22
 	{
23
-		if(!Context::isInstalled()) return;
23
+		if(!Context::isInstalled()) {
24
+			return;
25
+		}
24 26
 
25 27
 		$oModuleModel = getModel('module');
26 28
 		$member_config = $oModuleModel->getModuleConfig('member');
@@ -58,18 +60,42 @@  discard block
 block discarded – undo
58 60
 		// Set the basic information
59 61
 		$config->enable_join = 'Y';
60 62
 		$config->enable_openid = 'N';
61
-		if(!$config->enable_auth_mail) $config->enable_auth_mail = 'N';
62
-		if(!$config->image_name) $config->image_name = 'Y';
63
-		if(!$config->image_mark) $config->image_mark = 'Y';
64
-		if(!$config->profile_image) $config->profile_image = 'Y';
65
-		if(!$config->image_name_max_width) $config->image_name_max_width = '90';
66
-		if(!$config->image_name_max_height) $config->image_name_max_height = '20';
67
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = '20';
68
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = '20';
69
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = '90';
70
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = '90';
71
-		if($config->group_image_mark!='Y') $config->group_image_mark = 'N';
72
-		if(!$config->password_strength) $config->password_strength = 'normal';
63
+		if(!$config->enable_auth_mail) {
64
+			$config->enable_auth_mail = 'N';
65
+		}
66
+		if(!$config->image_name) {
67
+			$config->image_name = 'Y';
68
+		}
69
+		if(!$config->image_mark) {
70
+			$config->image_mark = 'Y';
71
+		}
72
+		if(!$config->profile_image) {
73
+			$config->profile_image = 'Y';
74
+		}
75
+		if(!$config->image_name_max_width) {
76
+			$config->image_name_max_width = '90';
77
+		}
78
+		if(!$config->image_name_max_height) {
79
+			$config->image_name_max_height = '20';
80
+		}
81
+		if(!$config->image_mark_max_width) {
82
+			$config->image_mark_max_width = '20';
83
+		}
84
+		if(!$config->image_mark_max_height) {
85
+			$config->image_mark_max_height = '20';
86
+		}
87
+		if(!$config->profile_image_max_width) {
88
+			$config->profile_image_max_width = '90';
89
+		}
90
+		if(!$config->profile_image_max_height) {
91
+			$config->profile_image_max_height = '90';
92
+		}
93
+		if($config->group_image_mark!='Y') {
94
+			$config->group_image_mark = 'N';
95
+		}
96
+		if(!$config->password_strength) {
97
+			$config->password_strength = 'normal';
98
+		}
73 99
 		
74 100
 		if(!$config->password_hashing_algorithm)
75 101
 		{
@@ -187,36 +213,64 @@  discard block
 block discarded – undo
187 213
 		if($oModuleModel->needUpdate($version_update_id))
188 214
 		{
189 215
 			// check member directory (11/08/2007 added)
190
-			if(!is_dir("./files/member_extra_info")) return true;
216
+			if(!is_dir("./files/member_extra_info")) {
217
+				return true;
218
+			}
191 219
 			// check member directory (22/10/2007 added)
192
-			if(!is_dir("./files/member_extra_info/profile_image")) return true;
220
+			if(!is_dir("./files/member_extra_info/profile_image")) {
221
+				return true;
222
+			}
193 223
 			// Add a column(is_register) to "member_auth_mail" table (22/04/2008)
194 224
 			$act = $oDB->isColumnExists("member_auth_mail", "is_register");
195
-			if(!$act) return true;
225
+			if(!$act) {
226
+				return true;
227
+			}
196 228
 			// Add a column(site_srl) to "member_group_member" table (11/15/2008)
197
-			if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true;
198
-			if(!$oDB->isColumnExists("member_group", "site_srl")) return true;
199
-			if($oDB->isIndexExists("member_group","uni_member_group_title")) return true;
229
+			if(!$oDB->isColumnExists("member_group_member", "site_srl")) {
230
+				return true;
231
+			}
232
+			if(!$oDB->isColumnExists("member_group", "site_srl")) {
233
+				return true;
234
+			}
235
+			if($oDB->isIndexExists("member_group","uni_member_group_title")) {
236
+				return true;
237
+			}
200 238
 
201 239
 			// Add a column for list_order (05/18/2011)
202
-			if(!$oDB->isColumnExists("member_group", "list_order")) return true;
240
+			if(!$oDB->isColumnExists("member_group", "list_order")) {
241
+				return true;
242
+			}
203 243
 
204 244
 			// image_mark 추가 (2009. 02. 14)
205
-			if(!$oDB->isColumnExists("member_group", "image_mark")) return true;
245
+			if(!$oDB->isColumnExists("member_group", "image_mark")) {
246
+				return true;
247
+			}
206 248
 			// Add c column for password expiration date
207
-			if(!$oDB->isColumnExists("member", "change_password_date")) return true;
249
+			if(!$oDB->isColumnExists("member", "change_password_date")) {
250
+				return true;
251
+			}
208 252
 
209 253
 			// Add columns of question and answer to verify a password
210
-			if(!$oDB->isColumnExists("member", "find_account_question")) return true;
211
-			if(!$oDB->isColumnExists("member", "find_account_answer")) return true;
254
+			if(!$oDB->isColumnExists("member", "find_account_question")) {
255
+				return true;
256
+			}
257
+			if(!$oDB->isColumnExists("member", "find_account_answer")) {
258
+				return true;
259
+			}
212 260
 
213
-			if(!$oDB->isColumnExists("member", "list_order")) return true;
214
-			if(!$oDB->isIndexExists("member","idx_list_order")) return true;
261
+			if(!$oDB->isColumnExists("member", "list_order")) {
262
+				return true;
263
+			}
264
+			if(!$oDB->isIndexExists("member","idx_list_order")) {
265
+				return true;
266
+			}
215 267
 
216 268
 			$oModuleModel = getModel('module');
217 269
 			$config = $oModuleModel->getModuleConfig('member');
218 270
 			// check signup form ordering info
219
-			if(!$config->signupForm) return true;
271
+			if(!$config->signupForm) {
272
+				return true;
273
+			}
220 274
 
221 275
 			foreach($config->signupForm as $form)
222 276
 			{
@@ -227,7 +281,9 @@  discard block
 block discarded – undo
227 281
 			}
228 282
 
229 283
 			// check agreement field exist
230
-			if($config->agreement) return true;
284
+			if($config->agreement) {
285
+				return true;
286
+			}
231 287
 
232 288
 			if($config->skin)
233 289
 			{
@@ -235,25 +291,41 @@  discard block
 block discarded – undo
235 291
 				if(count($config_parse) > 1)
236 292
 				{
237 293
 					$template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]);
238
-					if(is_dir($template_path)) return true;
294
+					if(is_dir($template_path)) {
295
+						return true;
296
+					}
239 297
 				}
240 298
 			}
241 299
 
242 300
 			// supprot multilanguage agreement.
243
-			if(is_readable('./files/member_extra_info/agreement.txt')) return true;
301
+			if(is_readable('./files/member_extra_info/agreement.txt')) {
302
+				return true;
303
+			}
244 304
 
245 305
 			// 2013. 11. 22 add menu when popup document menu called
246
-			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true;
247
-			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true;
306
+			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) {
307
+				return true;
308
+			}
309
+			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) {
310
+				return true;
311
+			}
248 312
 
249 313
 			$oModuleController->insertUpdatedLog($version_update_id);
250 314
 		}
251 315
 
252
-		if(!is_readable('./files/ruleset/insertMember.xml')) return true;
253
-		if(!is_readable('./files/ruleset/login.xml')) return true;
254
-		if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true;
316
+		if(!is_readable('./files/ruleset/insertMember.xml')) {
317
+			return true;
318
+		}
319
+		if(!is_readable('./files/ruleset/login.xml')) {
320
+			return true;
321
+		}
322
+		if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) {
323
+			return true;
324
+		}
255 325
 
256
-		if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true;
326
+		if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) {
327
+			return true;
328
+		}
257 329
 
258 330
 		return false;
259 331
 	}
@@ -391,10 +463,12 @@  discard block
 block discarded – undo
391 463
 			}
392 464
 			
393 465
 			// 2013. 11. 22 add menu when popup document menu called
394
-			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'))
395
-				$oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
396
-			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'))
397
-				$oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after');
466
+			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) {
467
+							$oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
468
+			}
469
+			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) {
470
+							$oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after');
471
+			}
398 472
 
399 473
 			if(is_readable('./files/member_extra_info/agreement.txt'))
400 474
 			{
@@ -408,12 +482,15 @@  discard block
 block discarded – undo
408 482
 		}
409 483
 
410 484
 		FileHandler::makeDir('./files/ruleset');
411
-		if(!is_readable('./files/ruleset/insertMember.xml'))
412
-			$oMemberAdminController->_createSignupRuleset($config->signupForm);
413
-		if(!is_readable('./files/ruleset/login.xml'))
414
-			$oMemberAdminController->_createLoginRuleset($config->identifier);
415
-		if(!is_readable('./files/ruleset/find_member_account_by_question.xml'))
416
-			$oMemberAdminController->_createFindAccountByQuestion($config->identifier);
485
+		if(!is_readable('./files/ruleset/insertMember.xml')) {
486
+					$oMemberAdminController->_createSignupRuleset($config->signupForm);
487
+		}
488
+		if(!is_readable('./files/ruleset/login.xml')) {
489
+					$oMemberAdminController->_createLoginRuleset($config->identifier);
490
+		}
491
+		if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) {
492
+					$oMemberAdminController->_createFindAccountByQuestion($config->identifier);
493
+		}
417 494
 
418 495
 		if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset'))
419 496
 		{
@@ -438,7 +515,9 @@  discard block
 block discarded – undo
438 515
 	 */
439 516
 	function recordLoginError($error = 0, $message = 'success')
440 517
 	{
441
-		if($error == 0) return new BaseObject($error, $message);
518
+		if($error == 0) {
519
+			return new BaseObject($error, $message);
520
+		}
442 521
 
443 522
 		// Create a member model object
444 523
 		$oMemberModel = getModel('member');
@@ -446,7 +525,9 @@  discard block
 block discarded – undo
446 525
 
447 526
 		// Check if there is recoding table.
448 527
 		$oDB = &DB::getInstance();
449
-		if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message);
528
+		if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') {
529
+			return new BaseObject($error, $message);
530
+		}
450 531
 
451 532
 		$args = new stdClass();
452 533
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
@@ -460,16 +541,14 @@  discard block
 block discarded – undo
460 541
 			if($term < $config->max_error_count_time)
461 542
 			{
462 543
 				$args->count = $output->data->count + 1;
463
-			}
464
-			else
544
+			} else
465 545
 			{
466 546
 				$args->count = 1;
467 547
 			}
468 548
 			unset($oMemberModel);
469 549
 			unset($config);
470 550
 			$output = executeQuery('member.updateLoginCountByIp', $args);
471
-		}
472
-		else
551
+		} else
473 552
 		{
474 553
 			//insert
475 554
 			$args->count = 1;
@@ -483,7 +562,9 @@  discard block
 block discarded – undo
483 562
 	 */
484 563
 	function recordMemberLoginError($error = 0, $message = 'success', $args = NULL)
485 564
 	{
486
-		if($error == 0 || !$args->member_srl) return new BaseObject($error, $message);
565
+		if($error == 0 || !$args->member_srl) {
566
+			return new BaseObject($error, $message);
567
+		}
487 568
 
488 569
 		// Create a member model object
489 570
 		$oMemberModel = getModel('member');
@@ -491,7 +572,9 @@  discard block
 block discarded – undo
491 572
 
492 573
 		// Check if there is recoding table.
493 574
 		$oDB = &DB::getInstance();
494
-		if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message);
575
+		if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') {
576
+			return new BaseObject($error, $message);
577
+		}
495 578
 
496 579
 		$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
497 580
 		if($output->data && $output->data->content)
@@ -501,8 +584,7 @@  discard block
 block discarded – undo
501 584
 			$content[] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']);
502 585
 			$args->content = serialize($content);
503 586
 			$output = executeQuery('member.updateLoginCountHistoryByMemberSrl', $args);
504
-		}
505
-		else
587
+		} else
506 588
 		{
507 589
 			//insert
508 590
 			$content[0] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']);
Please login to merge, or discard this patch.
modules/member/member.controller.php 2 patches
Spacing   +469 added lines, -469 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,20 +732,20 @@  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
 		$oMemberModel = getModel('member');
744 744
 		$config = $oMemberModel->getMemberConfig();
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
 		$output = $this->insertProfileImage($member_srl, $file['tmp_name']);
748
-		if(!$output->toBool()) return $output;
748
+		if (!$output->toBool()) return $output;
749 749
 
750 750
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
751 751
 		$this->setRedirectUrl($returnUrl);
@@ -766,20 +766,20 @@  discard block
 block discarded – undo
766 766
 		$max_width = $config->profile_image_max_width;
767 767
 		$max_height = $config->profile_image_max_height;
768 768
 		$max_filesize = $config->profile_image_max_filesize;
769
-		foreach($config->signupForm as $val)
769
+		foreach ($config->signupForm as $val)
770 770
 		{
771
-			if($val->name == "profile_image")
771
+			if ($val->name == "profile_image")
772 772
 				$allow_transparent = $val->allow_transparent_thumbnail == 'Y';
773 773
 		}
774 774
 
775
-		Context::loadLang(_XE_PATH_ . 'modules/file/lang');
775
+		Context::loadLang(_XE_PATH_.'modules/file/lang');
776 776
 
777 777
 		// Get file information
778 778
 		FileHandler::clearStatCache($target_file);
779 779
 		list($width, $height, $type) = @getimagesize($target_file);
780
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
781
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
782
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
780
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
781
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
782
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
783 783
 		else
784 784
 		{
785 785
 			return $this->stop('msg_not_uploaded_profile_image');
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
792 792
 
793 793
 		// Convert if the image size is larger than a given size or if the format is not a gif
794
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
794
+		if (($width > $max_width || $height > $max_height) && $type != 1)
795 795
 		{
796 796
 			$temp_filename = sprintf('files/cache/tmp/profile_image_%d.%s', $member_srl, $ext);
797 797
 			FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, $ext, 'crop', $allow_transparent);
@@ -799,10 +799,10 @@  discard block
 block discarded – undo
799 799
 			// 파일 용량 제한
800 800
 			FileHandler::clearStatCache($temp_filename);
801 801
 			$filesize = filesize($temp_filename);
802
-			if($max_filesize && $filesize > ($max_filesize * 1024))
802
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
803 803
 			{
804 804
 				FileHandler::removeFile($temp_filename);
805
-				return $this->stop(implode(' ' , array(
805
+				return $this->stop(implode(' ', array(
806 806
 					Context::getLang('msg_not_uploaded_profile_image'),
807 807
 					Context::getLang('msg_exceeds_limit_size')
808 808
 				)));
@@ -816,9 +816,9 @@  discard block
 block discarded – undo
816 816
 		{
817 817
 			// 파일 용량 제한
818 818
 			$filesize = filesize($target_file);
819
-			if($max_filesize && $filesize > ($max_filesize * 1024))
819
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
820 820
 			{
821
-				return $this->stop(implode(' ' , array(
821
+				return $this->stop(implode(' ', array(
822 822
 					Context::getLang('msg_not_uploaded_profile_image'),
823 823
 					Context::getLang('msg_exceeds_limit_size')
824 824
 				)));
@@ -841,20 +841,20 @@  discard block
 block discarded – undo
841 841
 	{
842 842
 		// Check if the file is successfully uploaded
843 843
 		$file = $_FILES['image_name'];
844
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
844
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
845 845
 		// Ignore if member_srl is invalid or doesn't exist.
846 846
 		$member_srl = Context::get('member_srl');
847
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
847
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
848 848
 
849 849
 		$logged_info = Context::get('logged_info');
850
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
850
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
851 851
 		// Return if member module is set not to use an image name or the user is not an administrator ;
852 852
 		$oMemberModel = getModel('member');
853 853
 		$config = $oMemberModel->getMemberConfig();
854
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
854
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
855 855
 
856 856
 		$output = $this->insertImageName($member_srl, $file['tmp_name']);
857
-		if(!$output->toBool()) return $output;
857
+		if (!$output->toBool()) return $output;
858 858
 
859 859
 		// Page refresh
860 860
 		//$this->setRefreshPage();
@@ -879,7 +879,7 @@  discard block
 block discarded – undo
879 879
 		$max_height = $config->image_name_max_height;
880 880
 		$max_filesize = $config->image_name_max_filesize;
881 881
 
882
-		Context::loadLang(_XE_PATH_ . 'modules/file/lang');
882
+		Context::loadLang(_XE_PATH_.'modules/file/lang');
883 883
 
884 884
 		// Get a target path to save
885 885
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
 		// Get file information
890 890
 		list($width, $height, $type) = @getimagesize($target_file);
891 891
 		// Convert if the image size is larger than a given size or if the format is not a gif
892
-		if($width > $max_width || $height > $max_height || $type!=1)
892
+		if ($width > $max_width || $height > $max_height || $type != 1)
893 893
 		{
894 894
 			$temp_filename = sprintf('files/cache/tmp/image_name_%d.gif', $member_srl, $ext);
895 895
 			FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif');
@@ -897,10 +897,10 @@  discard block
 block discarded – undo
897 897
 			// 파일 용량 제한
898 898
 			FileHandler::clearStatCache($temp_filename);
899 899
 			$filesize = filesize($temp_filename);
900
-			if($max_filesize && $filesize > ($max_filesize * 1024))
900
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
901 901
 			{
902 902
 				FileHandler::removeFile($temp_filename);
903
-				return $this->stop(implode(' ' , array(
903
+				return $this->stop(implode(' ', array(
904 904
 					Context::getLang('msg_not_uploaded_image_name'),
905 905
 					Context::getLang('msg_exceeds_limit_size')
906 906
 				)));
@@ -914,9 +914,9 @@  discard block
 block discarded – undo
914 914
 		{
915 915
 			// 파일 용량 제한
916 916
 			$filesize = filesize($target_file);
917
-			if($max_filesize && $filesize > ($max_filesize * 1024))
917
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
918 918
 			{
919
-				return $this->stop(implode(' ' , array(
919
+				return $this->stop(implode(' ', array(
920 920
 					Context::getLang('msg_not_uploaded_image_name'),
921 921
 					Context::getLang('msg_exceeds_limit_size')
922 922
 				)));
@@ -938,20 +938,20 @@  discard block
 block discarded – undo
938 938
 	function procMemberDeleteProfileImage($_memberSrl = 0)
939 939
 	{
940 940
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
941
-		if(!$member_srl)
941
+		if (!$member_srl)
942 942
 		{
943
-			return new BaseObject(0,'success');
943
+			return new BaseObject(0, 'success');
944 944
 		}
945 945
 
946 946
 		$logged_info = Context::get('logged_info');
947 947
 
948
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
948
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
949 949
 		{
950 950
 			$oMemberModel = getModel('member');
951 951
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
952 952
 			FileHandler::removeFile($profile_image->file);
953 953
 		}
954
-		return new BaseObject(0,'success');
954
+		return new BaseObject(0, 'success');
955 955
 	}
956 956
 
957 957
 	/**
@@ -962,20 +962,20 @@  discard block
 block discarded – undo
962 962
 	function procMemberDeleteImageName($_memberSrl = 0)
963 963
 	{
964 964
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
965
-		if(!$member_srl)
965
+		if (!$member_srl)
966 966
 		{
967
-			return new BaseObject(0,'success');
967
+			return new BaseObject(0, 'success');
968 968
 		}
969 969
 
970 970
 		$logged_info = Context::get('logged_info');
971 971
 
972
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
972
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
973 973
 		{
974 974
 			$oMemberModel = getModel('member');
975 975
 			$image_name = $oMemberModel->getImageName($member_srl);
976 976
 			FileHandler::removeFile($image_name->file);
977 977
 		}
978
-		return new BaseObject(0,'success');
978
+		return new BaseObject(0, 'success');
979 979
 	}
980 980
 
981 981
 	/**
@@ -987,20 +987,20 @@  discard block
 block discarded – undo
987 987
 	{
988 988
 		// Check if the file is successfully uploaded
989 989
 		$file = $_FILES['image_mark'];
990
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
990
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
991 991
 		// Ignore if member_srl is invalid or doesn't exist.
992 992
 		$member_srl = Context::get('member_srl');
993
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
993
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
994 994
 
995 995
 		$logged_info = Context::get('logged_info');
996
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
996
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
997 997
 		// Membership in the images mark the module using the ban was set by an administrator or return;
998 998
 		$oMemberModel = getModel('member');
999 999
 		$config = $oMemberModel->getMemberConfig();
1000
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1000
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1001 1001
 
1002 1002
 		$this->insertImageMark($member_srl, $file['tmp_name']);
1003
-		if(!$output->toBool()) return $output;
1003
+		if (!$output->toBool()) return $output;
1004 1004
 
1005 1005
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
1006 1006
 		$this->setRedirectUrl($returnUrl);
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
 		$max_height = $config->image_mark_max_height;
1023 1023
 		$max_filesize = $config->image_mark_max_filesize;
1024 1024
 
1025
-		Context::loadLang(_XE_PATH_ . 'modules/file/lang');
1025
+		Context::loadLang(_XE_PATH_.'modules/file/lang');
1026 1026
 
1027 1027
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
1028 1028
 		FileHandler::makeDir($target_path);
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 		// Get file information
1032 1032
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
1033 1033
 
1034
-		if($width > $max_width || $height > $max_height || $type!=1)
1034
+		if ($width > $max_width || $height > $max_height || $type != 1)
1035 1035
 		{
1036 1036
 			$temp_filename = sprintf('files/cache/tmp/image_mark_%d.gif', $member_srl);
1037 1037
 			FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif');
@@ -1039,10 +1039,10 @@  discard block
 block discarded – undo
1039 1039
 			// 파일 용량 제한
1040 1040
 			FileHandler::clearStatCache($temp_filename);
1041 1041
 			$filesize = filesize($temp_filename);
1042
-			if($max_filesize && $filesize > ($max_filesize * 1024))
1042
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
1043 1043
 			{
1044 1044
 				FileHandler::removeFile($temp_filename);
1045
-				return $this->stop(implode(' ' , array(
1045
+				return $this->stop(implode(' ', array(
1046 1046
 					Context::getLang('msg_not_uploaded_group_image_mark'),
1047 1047
 					Context::getLang('msg_exceeds_limit_size')
1048 1048
 				)));
@@ -1055,10 +1055,10 @@  discard block
 block discarded – undo
1055 1055
 		else
1056 1056
 		{
1057 1057
 			$filesize = filesize($target_file);
1058
-			if($max_filesize && $filesize > ($max_filesize * 1024))
1058
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
1059 1059
 			{
1060 1060
 				FileHandler::removeFile($target_file);
1061
-				return $this->stop(implode(' ' , array(
1061
+				return $this->stop(implode(' ', array(
1062 1062
 					Context::getLang('msg_not_uploaded_group_image_mark'),
1063 1063
 					Context::getLang('msg_exceeds_limit_size')
1064 1064
 				)));
@@ -1080,20 +1080,20 @@  discard block
 block discarded – undo
1080 1080
 	function procMemberDeleteImageMark($_memberSrl = 0)
1081 1081
 	{
1082 1082
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
1083
-		if(!$member_srl)
1083
+		if (!$member_srl)
1084 1084
 		{
1085
-			return new BaseObject(0,'success');
1085
+			return new BaseObject(0, 'success');
1086 1086
 		}
1087 1087
 
1088 1088
 		$logged_info = Context::get('logged_info');
1089 1089
 
1090
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
1090
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
1091 1091
 		{
1092 1092
 			$oMemberModel = getModel('member');
1093 1093
 			$image_mark = $oMemberModel->getImageMark($member_srl);
1094 1094
 			FileHandler::removeFile($image_mark->file);
1095 1095
 		}
1096
-		return new BaseObject(0,'success');
1096
+		return new BaseObject(0, 'success');
1097 1097
 	}
1098 1098
 
1099 1099
 	/**
@@ -1104,26 +1104,26 @@  discard block
 block discarded – undo
1104 1104
 	function procMemberFindAccount()
1105 1105
 	{
1106 1106
 		$email_address = Context::get('email_address');
1107
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1107
+		if (!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1108 1108
 
1109 1109
 		$oMemberModel = getModel('member');
1110 1110
 		$oModuleModel = getModel('module');
1111 1111
 
1112 1112
 		// Check if a member having the same email address exists
1113 1113
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1114
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1114
+		if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1115 1115
 
1116 1116
 		// Get information of the member
1117 1117
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
1118 1118
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1119 1119
 
1120 1120
 		// Check if possible to find member's ID and password
1121
-		if($member_info->denied == 'Y')
1121
+		if ($member_info->denied == 'Y')
1122 1122
 		{
1123 1123
 			$chk_args = new stdClass;
1124 1124
 			$chk_args->member_srl = $member_info->member_srl;
1125 1125
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1126
-			if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1126
+			if ($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1127 1127
 		}
1128 1128
 
1129 1129
 		// Insert data into the authentication DB
@@ -1136,19 +1136,19 @@  discard block
 block discarded – undo
1136 1136
 		$args->is_register = 'N';
1137 1137
 
1138 1138
 		$output = executeQuery('member.insertAuthMail', $args);
1139
-		if(!$output->toBool()) return $output;
1139
+		if (!$output->toBool()) return $output;
1140 1140
 		// Get content of the email to send a member
1141 1141
 		Context::set('auth_args', $args);
1142 1142
 
1143 1143
 		$member_config = $oModuleModel->getModuleConfig('member');
1144 1144
 		$memberInfo = array();
1145 1145
 		global $lang;
1146
-		if(is_array($member_config->signupForm))
1146
+		if (is_array($member_config->signupForm))
1147 1147
 		{
1148
-			$exceptForm=array('password', 'find_account_question');
1149
-			foreach($member_config->signupForm as $form)
1148
+			$exceptForm = array('password', 'find_account_question');
1149
+			foreach ($member_config->signupForm as $form)
1150 1150
 			{
1151
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1151
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1152 1152
 				{
1153 1153
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1154 1154
 				}
@@ -1163,15 +1163,15 @@  discard block
 block discarded – undo
1163 1163
 		}
1164 1164
 		Context::set('memberInfo', $memberInfo);
1165 1165
 
1166
-		if(!$member_config->skin) $member_config->skin = "default";
1167
-		if(!$member_config->colorset) $member_config->colorset = "white";
1166
+		if (!$member_config->skin) $member_config->skin = "default";
1167
+		if (!$member_config->colorset) $member_config->colorset = "white";
1168 1168
 
1169 1169
 		Context::set('member_config', $member_config);
1170 1170
 
1171 1171
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1172
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1172
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1173 1173
 
1174
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1174
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1175 1175
 		Context::set('find_url', $find_url);
1176 1176
 
1177 1177
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1181,19 +1181,19 @@  discard block
 block discarded – undo
1181 1181
 		$member_config = $oModuleModel->getModuleConfig('member');
1182 1182
 		// Send a mail
1183 1183
 		$oMail = new Mail();
1184
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1184
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1185 1185
 		$oMail->setContent($content);
1186
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1187
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1186
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1187
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1188 1188
 		$oMail->send();
1189 1189
 		// Return message
1190 1190
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1191
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1191
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1192 1192
 		{
1193 1193
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1194 1194
 			$this->setRedirectUrl($returnUrl);
1195 1195
 		}
1196
-		return new BaseObject(0,$msg);
1196
+		return new BaseObject(0, $msg);
1197 1197
 	}
1198 1198
 
1199 1199
 	/**
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 	function procMemberFindAccountByQuestion()
1205 1205
 	{
1206 1206
 		$oMemberModel = getModel('member');
1207
-		$oPassword =  new Password();
1207
+		$oPassword = new Password();
1208 1208
 		$config = $oMemberModel->getMemberConfig();
1209 1209
 
1210 1210
 		$email_address = Context::get('email_address');
@@ -1212,49 +1212,49 @@  discard block
 block discarded – undo
1212 1212
 		$find_account_question = trim(Context::get('find_account_question'));
1213 1213
 		$find_account_answer = trim(Context::get('find_account_answer'));
1214 1214
 
1215
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1215
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1216 1216
 
1217 1217
 		$oModuleModel = getModel('module');
1218 1218
 		// Check if a member having the same email address exists
1219 1219
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1220
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1220
+		if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1221 1221
 
1222 1222
 		// Get information of the member
1223 1223
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1224 1224
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1225 1225
 
1226 1226
 		// Display a message if no answer is entered
1227
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1227
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1228 1228
 
1229 1229
 		// 답변 확인
1230 1230
 		$hashed = $oPassword->checkAlgorithm($member_info->find_account_answer);
1231 1231
 		$authed = true;
1232 1232
 		$member_info->find_account_question = trim($member_info->find_account_question);
1233
-		if($member_info->find_account_question != $find_account_question)
1233
+		if ($member_info->find_account_question != $find_account_question)
1234 1234
 		{
1235 1235
 			$authed = false;
1236 1236
 		}
1237
-		else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1237
+		else if ($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1238 1238
 		{
1239 1239
 			$authed = false;
1240 1240
 		}
1241
-		else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1241
+		else if (!$hashed && $find_account_answer != $member_info->find_account_answer)
1242 1242
 		{
1243 1243
 			$authed = false;
1244 1244
 		}
1245 1245
 
1246
-		if(!$authed)
1246
+		if (!$authed)
1247 1247
 		{
1248 1248
 			return new BaseObject(-1, 'msg_answer_not_matches');
1249 1249
 		}
1250 1250
 
1251 1251
 		// answer가 동일하고 hash 되지 않았으면 hash 값으로 저장
1252
-		if($authed && !$hashed)
1252
+		if ($authed && !$hashed)
1253 1253
 		{
1254 1254
 			$this->updateFindAccountAnswer($member_srl, $find_account_answer);
1255 1255
 		}
1256 1256
 
1257
-		if($config->identifier == 'email_address')
1257
+		if ($config->identifier == 'email_address')
1258 1258
 		{
1259 1259
 			$user_id = $email_address;
1260 1260
 		}
@@ -1267,11 +1267,11 @@  discard block
 block discarded – undo
1267 1267
 		$args->password = $temp_password;
1268 1268
 		$args->change_password_date = '1';
1269 1269
 		$output = $this->updateMemberPassword($args);
1270
-		if(!$output->toBool()) return $output;
1270
+		if (!$output->toBool()) return $output;
1271 1271
 
1272
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1272
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1273 1273
 
1274
-		$this->add('user_id',$user_id);
1274
+		$this->add('user_id', $user_id);
1275 1275
 
1276 1276
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1277 1277
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 		$member_srl = Context::get('member_srl');
1292 1292
 		$auth_key = Context::get('auth_key');
1293 1293
 
1294
-		if(!$member_srl || !$auth_key)
1294
+		if (!$member_srl || !$auth_key)
1295 1295
 		{
1296 1296
 			return $this->stop('msg_invalid_request');
1297 1297
 		}
@@ -1302,9 +1302,9 @@  discard block
 block discarded – undo
1302 1302
 		$args->auth_key = $auth_key;
1303 1303
 		$output = executeQuery('member.getAuthMail', $args);
1304 1304
 
1305
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1305
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1306 1306
 		{
1307
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1307
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1308 1308
 			{
1309 1309
 				executeQuery('member.deleteAuthMail', $args);
1310 1310
 			}
@@ -1312,7 +1312,7 @@  discard block
 block discarded – undo
1312 1312
 			return $this->stop('msg_invalid_auth_key');
1313 1313
 		}
1314 1314
 
1315
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1315
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1316 1316
 		{
1317 1317
 			executeQuery('member.deleteAuthMail', $args);
1318 1318
 			return $this->stop('msg_invalid_auth_key');
@@ -1321,7 +1321,7 @@  discard block
 block discarded – undo
1321 1321
 		$args->password = $output->data->new_password;
1322 1322
 
1323 1323
 		// If credentials are correct, change the password to a new one
1324
-		if($output->data->is_register == 'Y')
1324
+		if ($output->data->is_register == 'Y')
1325 1325
 		{
1326 1326
 			$args->denied = 'N';
1327 1327
 		}
@@ -1334,13 +1334,13 @@  discard block
 block discarded – undo
1334 1334
 		$is_register = $output->data->is_register;
1335 1335
 
1336 1336
 		$output = executeQuery('member.updateMemberPassword', $args);
1337
-		if(!$output->toBool())
1337
+		if (!$output->toBool())
1338 1338
 		{
1339 1339
 			return $this->stop($output->getMessage());
1340 1340
 		}
1341 1341
 
1342 1342
 		// Remove all values having the member_srl from authentication table
1343
-		executeQuery('member.deleteAuthMail',$args);
1343
+		executeQuery('member.deleteAuthMail', $args);
1344 1344
 
1345 1345
 		$this->_clearMemberCache($args->member_srl);
1346 1346
 
@@ -1359,33 +1359,33 @@  discard block
 block discarded – undo
1359 1359
 	{
1360 1360
 		// Get an email_address
1361 1361
 		$email_address = Context::get('email_address');
1362
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1362
+		if (!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1363 1363
 		// Log test by using email_address
1364 1364
 		$oMemberModel = getModel('member');
1365 1365
 
1366 1366
 		$args = new stdClass;
1367 1367
 		$args->email_address = $email_address;
1368 1368
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1369
-		if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1369
+		if (!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1370 1370
 
1371 1371
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1372 1372
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1373 1373
 
1374 1374
 		$oModuleModel = getModel('module');
1375 1375
 		$member_config = $oModuleModel->getModuleConfig('member');
1376
-		if(!$member_config->skin) $member_config->skin = "default";
1377
-		if(!$member_config->colorset) $member_config->colorset = "white";
1376
+		if (!$member_config->skin) $member_config->skin = "default";
1377
+		if (!$member_config->colorset) $member_config->colorset = "white";
1378 1378
 
1379 1379
 		// Check if a authentication mail has been sent previously
1380 1380
 		$chk_args = new stdClass;
1381 1381
 		$chk_args->member_srl = $member_info->member_srl;
1382 1382
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1383
-		if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1383
+		if ($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1384 1384
 
1385 1385
 		$auth_args = new stdClass;
1386 1386
 		$auth_args->member_srl = $member_info->member_srl;
1387 1387
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1388
-		if(!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1388
+		if (!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1389 1389
 		$auth_info = $output->data[0];
1390 1390
 
1391 1391
 		// Update the regdate of authmail entry
@@ -1396,12 +1396,12 @@  discard block
 block discarded – undo
1396 1396
 
1397 1397
 		$memberInfo = array();
1398 1398
 		global $lang;
1399
-		if(is_array($member_config->signupForm))
1399
+		if (is_array($member_config->signupForm))
1400 1400
 		{
1401
-			$exceptForm=array('password', 'find_account_question');
1402
-			foreach($member_config->signupForm as $form)
1401
+			$exceptForm = array('password', 'find_account_question');
1402
+			foreach ($member_config->signupForm as $form)
1403 1403
 			{
1404
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1404
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1405 1405
 				{
1406 1406
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1407 1407
 				}
@@ -1420,19 +1420,19 @@  discard block
 block discarded – undo
1420 1420
 		Context::set('member_config', $member_config);
1421 1421
 
1422 1422
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1423
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1423
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1424 1424
 
1425
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1425
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1426 1426
 		Context::set('auth_url', $auth_url);
1427 1427
 
1428 1428
 		$oTemplate = &TemplateHandler::getInstance();
1429 1429
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1430 1430
 		// Send a mail
1431 1431
 		$oMail = new Mail();
1432
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1432
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1433 1433
 		$oMail->setContent($content);
1434
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1435
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1434
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1435
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1436 1436
 		$oMail->send();
1437 1437
 
1438 1438
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1447,23 +1447,23 @@  discard block
 block discarded – undo
1447 1447
 		$memberInfo = $_SESSION['auth_member_info'];
1448 1448
 		unset($_SESSION['auth_member_info']);
1449 1449
 
1450
-		if(!$memberInfo)
1450
+		if (!$memberInfo)
1451 1451
 		{
1452 1452
 			return $this->stop('msg_invalid_request');
1453 1453
 		}
1454 1454
 
1455 1455
 		$newEmail = Context::get('email_address');
1456 1456
 
1457
-		if(!$newEmail)
1457
+		if (!$newEmail)
1458 1458
 		{
1459 1459
 			return $this->stop('msg_invalid_request');
1460 1460
 		}
1461 1461
 
1462 1462
 		$oMemberModel = getModel('member');
1463 1463
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1464
-		if($member_srl)
1464
+		if ($member_srl)
1465 1465
 		{
1466
-			return new BaseObject(-1,'msg_exists_email_address');
1466
+			return new BaseObject(-1, 'msg_exists_email_address');
1467 1467
 		}
1468 1468
 
1469 1469
 		// remove all key by member_srl
@@ -1471,7 +1471,7 @@  discard block
 block discarded – undo
1471 1471
 		$args->member_srl = $memberInfo->member_srl;
1472 1472
 		$output = executeQuery('member.deleteAuthMail', $args);
1473 1473
 
1474
-		if(!$output->toBool())
1474
+		if (!$output->toBool())
1475 1475
 		{
1476 1476
 			return $output;
1477 1477
 		}
@@ -1481,7 +1481,7 @@  discard block
 block discarded – undo
1481 1481
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1482 1482
 
1483 1483
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1484
-		if(!$output->toBool())
1484
+		if (!$output->toBool())
1485 1485
 		{
1486 1486
 			return $this->stop($output->getMessage());
1487 1487
 		}
@@ -1498,7 +1498,7 @@  discard block
 block discarded – undo
1498 1498
 		$auth_args->is_register = 'Y';
1499 1499
 
1500 1500
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1501
-		if(!$output->toBool()) return $output;
1501
+		if (!$output->toBool()) return $output;
1502 1502
 
1503 1503
 		$memberInfo->email_address = $newEmail;
1504 1504
 
@@ -1522,12 +1522,12 @@  discard block
 block discarded – undo
1522 1522
 		$memberInfo = array();
1523 1523
 
1524 1524
 		global $lang;
1525
-		if(is_array($member_config->signupForm))
1525
+		if (is_array($member_config->signupForm))
1526 1526
 		{
1527
-			$exceptForm=array('password', 'find_account_question');
1528
-			foreach($member_config->signupForm as $form)
1527
+			$exceptForm = array('password', 'find_account_question');
1528
+			foreach ($member_config->signupForm as $form)
1529 1529
 			{
1530
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1530
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1531 1531
 				{
1532 1532
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1533 1533
 				}
@@ -1542,25 +1542,25 @@  discard block
 block discarded – undo
1542 1542
 		}
1543 1543
 		Context::set('memberInfo', $memberInfo);
1544 1544
 
1545
-		if(!$member_config->skin) $member_config->skin = "default";
1546
-		if(!$member_config->colorset) $member_config->colorset = "white";
1545
+		if (!$member_config->skin) $member_config->skin = "default";
1546
+		if (!$member_config->colorset) $member_config->colorset = "white";
1547 1547
 
1548 1548
 		Context::set('member_config', $member_config);
1549 1549
 
1550 1550
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1551
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1551
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1552 1552
 
1553
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1553
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1554 1554
 		Context::set('auth_url', $auth_url);
1555 1555
 
1556 1556
 		$oTemplate = &TemplateHandler::getInstance();
1557 1557
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1558 1558
 		// Send a mail
1559 1559
 		$oMail = new Mail();
1560
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1560
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1561 1561
 		$oMail->setContent($content);
1562
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1563
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1562
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1563
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1564 1564
 		$oMail->send();
1565 1565
 	}
1566 1566
 
@@ -1573,7 +1573,7 @@  discard block
 block discarded – undo
1573 1573
 	{
1574 1574
 		$site_module_info = Context::get('site_module_info');
1575 1575
 		$logged_info = Context::get('logged_info');
1576
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1576
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request');
1577 1577
 
1578 1578
 		$oMemberModel = getModel('member');
1579 1579
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1592,13 +1592,13 @@  discard block
 block discarded – undo
1592 1592
 	{
1593 1593
 		$site_module_info = Context::get('site_module_info');
1594 1594
 		$logged_info = Context::get('logged_info');
1595
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1595
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request');
1596 1596
 
1597 1597
 		$args = new stdClass;
1598
-		$args->site_srl= $site_module_info->site_srl;
1598
+		$args->site_srl = $site_module_info->site_srl;
1599 1599
 		$args->member_srl = $logged_info->member_srl;
1600 1600
 		$output = executeQuery('member.deleteMembersGroup', $args);
1601
-		if(!$output->toBool()) return $output;
1601
+		if (!$output->toBool()) return $output;
1602 1602
 		$this->setMessage('success_deleted');
1603 1603
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1604 1604
 	}
@@ -1612,25 +1612,25 @@  discard block
 block discarded – undo
1612 1612
 	 */
1613 1613
 	function setMemberConfig($args)
1614 1614
 	{
1615
-		if(!$args->skin) $args->skin = "default";
1616
-		if(!$args->colorset) $args->colorset = "white";
1617
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1618
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1619
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1620
-		$args->enable_openid= 'N';
1621
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1622
-		if($args->image_name!='Y') $args->image_name = 'N';
1623
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1624
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1625
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1626
-		$args->limit_day = (int)$args->limit_day;
1615
+		if (!$args->skin) $args->skin = "default";
1616
+		if (!$args->colorset) $args->colorset = "white";
1617
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1618
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1619
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1620
+		$args->enable_openid = 'N';
1621
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1622
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1623
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1624
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1625
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1626
+		$args->limit_day = (int) $args->limit_day;
1627 1627
 
1628 1628
 		$agreement = trim($args->agreement);
1629 1629
 		unset($args->agreement);
1630 1630
 
1631 1631
 		$oModuleController = getController('module');
1632
-		$output = $oModuleController->insertModuleConfig('member',$args);
1633
-		if(!$output->toBool()) return $output;
1632
+		$output = $oModuleController->insertModuleConfig('member', $args);
1633
+		if (!$output->toBool()) return $output;
1634 1634
 
1635 1635
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1636 1636
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1651,11 +1651,11 @@  discard block
 block discarded – undo
1651 1651
 		$signature = trim(removeHackTag($signature));
1652 1652
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1653 1653
 
1654
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"), '', strip_tags($signature, '<img><object>')));
1654
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1655 1655
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1656 1656
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1657 1657
 
1658
-		if(!$check_signature) return FileHandler::removeFile($filename);
1658
+		if (!$check_signature) return FileHandler::removeFile($filename);
1659 1659
 
1660 1660
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1661 1661
 		FileHandler::makeDir($path);
@@ -1684,15 +1684,15 @@  discard block
 block discarded – undo
1684 1684
 	 *
1685 1685
 	 * @return BaseObject
1686 1686
 	 */
1687
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1687
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1688 1688
 	{
1689 1689
 		$args = new stdClass();
1690 1690
 		$args->member_srl = $member_srl;
1691 1691
 		$args->group_srl = $group_srl;
1692
-		if($site_srl) $args->site_srl = $site_srl;
1692
+		if ($site_srl) $args->site_srl = $site_srl;
1693 1693
 
1694 1694
 		// Add
1695
-		$output = executeQuery('member.addMemberToGroup',$args);
1695
+		$output = executeQuery('member.addMemberToGroup', $args);
1696 1696
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1697 1697
 
1698 1698
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1712,18 +1712,18 @@  discard block
 block discarded – undo
1712 1712
 	{
1713 1713
 		$obj = new stdClass;
1714 1714
 		$obj->site_srl = $args->site_srl;
1715
-		$obj->member_srl = implode(',',$args->member_srl);
1715
+		$obj->member_srl = implode(',', $args->member_srl);
1716 1716
 
1717 1717
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1718
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1718
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1719 1719
 
1720 1720
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1721
-		if(!$output->toBool()) return $output;
1721
+		if (!$output->toBool()) return $output;
1722 1722
 
1723 1723
 		$inserted_members = array();
1724
-		foreach($args->member_srl as $key => $val)
1724
+		foreach ($args->member_srl as $key => $val)
1725 1725
 		{
1726
-			if($inserted_members[$val]) continue;
1726
+			if ($inserted_members[$val]) continue;
1727 1727
 			$inserted_members[$val] = true;
1728 1728
 
1729 1729
 			unset($obj);
@@ -1733,7 +1733,7 @@  discard block
 block discarded – undo
1733 1733
 			$obj->site_srl = $args->site_srl;
1734 1734
 			$obj->regdate = $date[$obj->member_srl];
1735 1735
 			$output = executeQuery('member.addMemberToGroup', $obj);
1736
-			if(!$output->toBool()) return $output;
1736
+			if (!$output->toBool()) return $output;
1737 1737
 
1738 1738
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1739 1739
 		}
@@ -1755,9 +1755,9 @@  discard block
 block discarded – undo
1755 1755
 		// Get information of the key
1756 1756
 		$output = executeQuery('member.getAutologin', $args);
1757 1757
 		// If no information exists, delete a cookie
1758
-		if(!$output->toBool() || !$output->data)
1758
+		if (!$output->toBool() || !$output->data)
1759 1759
 		{
1760
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1760
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1761 1761
 			return;
1762 1762
 		}
1763 1763
 
@@ -1767,9 +1767,9 @@  discard block
 block discarded – undo
1767 1767
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1768 1768
 		$password = $output->data->password;
1769 1769
 
1770
-		if(!$user_id || !$password)
1770
+		if (!$user_id || !$password)
1771 1771
 		{
1772
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1772
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1773 1773
 			return;
1774 1774
 		}
1775 1775
 
@@ -1779,7 +1779,7 @@  discard block
 block discarded – undo
1779 1779
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1780 1780
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1781 1781
 
1782
-		if($check_key === substr($args->autologin_key, 32))
1782
+		if ($check_key === substr($args->autologin_key, 32))
1783 1783
 		{
1784 1784
 			// Check change_password_date
1785 1785
 			$oModuleModel = getModel('module');
@@ -1787,12 +1787,12 @@  discard block
 block discarded – undo
1787 1787
 			$limit_date = $member_config->change_password_date;
1788 1788
 
1789 1789
 			// Check if change_password_date is set
1790
-			if($limit_date > 0)
1790
+			if ($limit_date > 0)
1791 1791
 			{
1792 1792
 				$oMemberModel = getModel('member');
1793 1793
 				$columnList = array('member_srl', 'change_password_date');
1794 1794
 
1795
-				if($config->identifier == 'user_id')
1795
+				if ($config->identifier == 'user_id')
1796 1796
 				{
1797 1797
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1798 1798
 				}
@@ -1801,7 +1801,7 @@  discard block
 block discarded – undo
1801 1801
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1802 1802
 				}
1803 1803
 
1804
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1804
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1805 1805
 					$do_auto_login = true;
1806 1806
 				}
1807 1807
 
@@ -1812,14 +1812,14 @@  discard block
 block discarded – undo
1812 1812
 			}
1813 1813
 		}
1814 1814
 
1815
-		if($do_auto_login)
1815
+		if ($do_auto_login)
1816 1816
 		{
1817 1817
 			$output = $this->doLogin($user_id);
1818 1818
 		}
1819 1819
 		else
1820 1820
 		{
1821 1821
 			executeQuery('member.deleteAutologin', $args);
1822
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1822
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1823 1823
 		}
1824 1824
 	}
1825 1825
 
@@ -1835,13 +1835,13 @@  discard block
 block discarded – undo
1835 1835
 	function doLogin($user_id, $password = '', $keep_signed = false)
1836 1836
 	{
1837 1837
 		$user_id = strtolower($user_id);
1838
-		if(!$user_id) return new BaseObject(-1, 'null_user_id');
1838
+		if (!$user_id) return new BaseObject(-1, 'null_user_id');
1839 1839
 		// Call a trigger before log-in (before)
1840 1840
 		$trigger_obj = new stdClass();
1841 1841
 		$trigger_obj->user_id = $user_id;
1842 1842
 		$trigger_obj->password = $password;
1843 1843
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1844
-		if(!$trigger_output->toBool()) return $trigger_output;
1844
+		if (!$trigger_output->toBool()) return $trigger_output;
1845 1845
 		// Create a member model object
1846 1846
 		$oMemberModel = getModel('member');
1847 1847
 
@@ -1851,12 +1851,12 @@  discard block
 block discarded – undo
1851 1851
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1852 1852
 
1853 1853
 		// check identifier
1854
-		if($config->identifier == 'email_address')
1854
+		if ($config->identifier == 'email_address')
1855 1855
 		{
1856 1856
 			// Get user_id information
1857 1857
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1858 1858
 			// Set an invalid user if no value returned
1859
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1859
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1860 1860
 
1861 1861
 		}
1862 1862
 		else
@@ -1864,24 +1864,24 @@  discard block
 block discarded – undo
1864 1864
 			// Get user_id information
1865 1865
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1866 1866
 			// Set an invalid user if no value returned
1867
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1867
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1868 1868
 		}
1869 1869
 
1870 1870
 		$output = executeQuery('member.getLoginCountByIp', $args);
1871 1871
 		$errorCount = $output->data->count;
1872
-		if($errorCount >= $config->max_error_count)
1872
+		if ($errorCount >= $config->max_error_count)
1873 1873
 		{
1874 1874
 			$last_update = strtotime($output->data->last_update);
1875
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1876
-			if($term < $config->max_error_count_time)
1875
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1876
+			if ($term < $config->max_error_count_time)
1877 1877
 			{
1878 1878
 				$term = $config->max_error_count_time - $term;
1879
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1880
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1881
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1882
-				else $term = intval($term/86400).Context::getLang('unit_day');
1879
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1880
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1881
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1882
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1883 1883
 
1884
-				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1884
+				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1885 1885
 			}
1886 1886
 			else
1887 1887
 			{
@@ -1891,13 +1891,13 @@  discard block
 block discarded – undo
1891 1891
 		}
1892 1892
 
1893 1893
 		// Password Check
1894
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1894
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1895 1895
 		{
1896
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1896
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1897 1897
 		}
1898 1898
 
1899 1899
 		// If denied == 'Y', notify
1900
-		if($this->memberInfo->denied == 'Y')
1900
+		if ($this->memberInfo->denied == 'Y')
1901 1901
 		{
1902 1902
 			$args->member_srl = $this->memberInfo->member_srl;
1903 1903
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1905,12 +1905,12 @@  discard block
 block discarded – undo
1905 1905
 			{
1906 1906
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1907 1907
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1908
-				return $this->setRedirectUrl($redirectUrl, new BaseObject(-1,'msg_user_not_confirmed'));
1908
+				return $this->setRedirectUrl($redirectUrl, new BaseObject(-1, 'msg_user_not_confirmed'));
1909 1909
 			}
1910
-			return new BaseObject(-1,'msg_user_denied');
1910
+			return new BaseObject(-1, 'msg_user_denied');
1911 1911
 		}
1912 1912
 		// Notify if denied_date is less than the current time
1913
-		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")));
1913
+		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")));
1914 1914
 		// Update the latest login time
1915 1915
 		$args->member_srl = $this->memberInfo->member_srl;
1916 1916
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1920,36 +1920,36 @@  discard block
 block discarded – undo
1920 1920
 
1921 1921
 		// Check if there is recoding table.
1922 1922
 		$oDB = &DB::getInstance();
1923
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1923
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1924 1924
 		{
1925 1925
 			// check if there is login fail records.
1926 1926
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1927
-			if($output->data && $output->data->content)
1927
+			if ($output->data && $output->data->content)
1928 1928
 			{
1929 1929
 				$title = Context::getLang('login_fail_report');
1930 1930
 				$message = '<ul>';
1931 1931
 				$content = unserialize($output->data->content);
1932
-				if(count($content) > $config->max_error_count)
1932
+				if (count($content) > $config->max_error_count)
1933 1933
 				{
1934
-					foreach($content as $val)
1934
+					foreach ($content as $val)
1935 1935
 					{
1936
-						$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>';
1936
+						$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>';
1937 1937
 					}
1938 1938
 					$message .= '</ul>';
1939
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1939
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1940 1940
 
1941 1941
 					//send message
1942 1942
 					$oCommunicationController = getController('communication');
1943 1943
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1944 1944
 
1945
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1945
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1946 1946
 					{
1947 1947
 						$view_url = Context::getRequestUri();
1948
-						$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);
1948
+						$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);
1949 1949
 						$oMail = new Mail();
1950 1950
 						$oMail->setTitle($title);
1951 1951
 						$oMail->setContent($content);
1952
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1952
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1953 1953
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1954 1954
 						$oMail->send();
1955 1955
 					}
@@ -1959,9 +1959,9 @@  discard block
 block discarded – undo
1959 1959
 		}
1960 1960
 		// Call a trigger after successfully log-in (after)
1961 1961
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1962
-		if(!$trigger_output->toBool()) return $trigger_output;
1962
+		if (!$trigger_output->toBool()) return $trigger_output;
1963 1963
 		// When user checked to use auto-login
1964
-		if($keep_signed)
1964
+		if ($keep_signed)
1965 1965
 		{
1966 1966
 			// Key generate for auto login
1967 1967
 			$oPassword = new Password();
@@ -1973,12 +1973,12 @@  discard block
 block discarded – undo
1973 1973
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1974 1974
 			executeQuery('member.deleteAutologin', $autologin_args);
1975 1975
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1976
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
1976
+			if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000);
1977 1977
 		}
1978
-		if($this->memberInfo->is_admin == 'Y')
1978
+		if ($this->memberInfo->is_admin == 'Y')
1979 1979
 		{
1980 1980
 			$oMemberAdminModel = getAdminModel('member');
1981
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1981
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1982 1982
 			{
1983 1983
 				$_SESSION['denied_admin'] = 'Y';
1984 1984
 			}
@@ -1996,18 +1996,18 @@  discard block
 block discarded – undo
1996 1996
 	{
1997 1997
 		$oMemberModel = getModel('member');
1998 1998
 		// If your information came through the current session information to extract information from the users
1999
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1999
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
2000 2000
 		{
2001 2001
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
2002 2002
 			// If you do not destroy the session Profile
2003
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
2003
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
2004 2004
 			{
2005 2005
 				$this->destroySessionInfo();
2006 2006
 				return;
2007 2007
 			}
2008 2008
 		}
2009 2009
 		// Stop using the session id is destroyed
2010
-		if($this->memberInfo->denied=='Y')
2010
+		if ($this->memberInfo->denied == 'Y')
2011 2011
 		{
2012 2012
 			$this->destroySessionInfo();
2013 2013
 			return;
@@ -2037,10 +2037,10 @@  discard block
 block discarded – undo
2037 2037
 		Context::set('logged_info', $this->memberInfo);
2038 2038
 
2039 2039
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
2040
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
2041
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
2042
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
2043
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
2040
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
2041
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
2042
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
2043
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
2044 2044
 	}
2045 2045
 
2046 2046
 	/**
@@ -2062,7 +2062,7 @@  discard block
 block discarded – undo
2062 2062
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
2063 2063
 	{
2064 2064
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
2065
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2065
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2066 2066
 
2067 2067
 		$obj = new stdClass;
2068 2068
 		$obj->url = $url;
@@ -2081,33 +2081,33 @@  discard block
 block discarded – undo
2081 2081
 	{
2082 2082
 		// Call a trigger (before)
2083 2083
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
2084
-		if(!$output->toBool()) return $output;
2084
+		if (!$output->toBool()) return $output;
2085 2085
 		// Terms and Conditions portion of the information set up by members reaffirmed
2086 2086
 		$oModuleModel = getModel('module');
2087 2087
 		$config = $oModuleModel->getModuleConfig('member');
2088 2088
 
2089 2089
 		$logged_info = Context::get('logged_info');
2090 2090
 		// If the date of the temporary restrictions limit further information on the date of
2091
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2091
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
2092 2092
 
2093 2093
 		$args->member_srl = getNextSequence();
2094 2094
 		$args->list_order = -1 * $args->member_srl;
2095 2095
 
2096 2096
 		// Execute insert or update depending on the value of member_srl
2097
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2097
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2098 2098
 		// Enter the user's identity changed to lowercase
2099 2099
 		else $args->user_id = strtolower($args->user_id);
2100
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2101
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2100
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2101
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
2102 2102
 
2103 2103
 		// Control of essential parameters
2104
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2105
-		if($args->denied!='Y') $args->denied = 'N';
2106
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2104
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2105
+		if ($args->denied != 'Y') $args->denied = 'N';
2106
+		if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y';
2107 2107
 
2108
-		if($logged_info->is_admin == 'Y')
2108
+		if ($logged_info->is_admin == 'Y')
2109 2109
 		{
2110
-			if($args->is_admin!='Y') $args->is_admin = 'N';
2110
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
2111 2111
 		}
2112 2112
 		else
2113 2113
 		{
@@ -2122,97 +2122,97 @@  discard block
 block discarded – undo
2122 2122
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2123 2123
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2124 2124
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2125
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2126
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2125
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2126
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
2127 2127
 
2128 2128
 		// Create a model object
2129 2129
 		$oMemberModel = getModel('member');
2130 2130
 
2131 2131
 		// Check password strength
2132
-		if($args->password && !$password_is_hashed)
2132
+		if ($args->password && !$password_is_hashed)
2133 2133
 		{
2134
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2134
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2135 2135
 			{
2136 2136
 				$message = Context::getLang('about_password_strength');
2137 2137
 				return new BaseObject(-1, $message[$config->password_strength]);
2138 2138
 			}
2139 2139
 			$args->password = $oMemberModel->hashPassword($args->password);
2140 2140
 		}
2141
-		elseif(!$args->password)
2141
+		elseif (!$args->password)
2142 2142
 		{
2143 2143
 			unset($args->password);
2144 2144
 		}
2145 2145
 
2146
-		if($args->find_account_answer && !$password_is_hashed)
2146
+		if ($args->find_account_answer && !$password_is_hashed)
2147 2147
 		{
2148 2148
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2149 2149
 		}
2150
-		elseif(!$args->find_account_answer)
2150
+		elseif (!$args->find_account_answer)
2151 2151
 		{
2152 2152
 			unset($args->find_account_answer);
2153 2153
 		}
2154 2154
 
2155 2155
 		// Check if ID is prohibited
2156
-		if($oMemberModel->isDeniedID($args->user_id))
2156
+		if ($oMemberModel->isDeniedID($args->user_id))
2157 2157
 		{
2158
-			return new BaseObject(-1,'denied_user_id');
2158
+			return new BaseObject(-1, 'denied_user_id');
2159 2159
 		}
2160 2160
 
2161 2161
 		// Check if ID is duplicate
2162 2162
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2163
-		if($member_srl)
2163
+		if ($member_srl)
2164 2164
 		{
2165
-			return new BaseObject(-1,'msg_exists_user_id');
2165
+			return new BaseObject(-1, 'msg_exists_user_id');
2166 2166
 		}
2167 2167
 
2168 2168
 		// Check if nickname is prohibited
2169
-		if($oMemberModel->isDeniedNickName($args->nick_name))
2169
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
2170 2170
 		{
2171
-			return new BaseObject(-1,'denied_nick_name');
2171
+			return new BaseObject(-1, 'denied_nick_name');
2172 2172
 		}
2173 2173
 
2174 2174
 		// Check if nickname is duplicate
2175 2175
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2176
-		if($member_srl)
2176
+		if ($member_srl)
2177 2177
 		{
2178
-			return new BaseObject(-1,'msg_exists_nick_name');
2178
+			return new BaseObject(-1, 'msg_exists_nick_name');
2179 2179
 		}
2180 2180
 
2181 2181
 		// Check if email address is duplicate
2182 2182
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2183
-		if($member_srl)
2183
+		if ($member_srl)
2184 2184
 		{
2185
-			return new BaseObject(-1,'msg_exists_email_address');
2185
+			return new BaseObject(-1, 'msg_exists_email_address');
2186 2186
 		}
2187 2187
 
2188 2188
 		// Insert data into the DB
2189 2189
 		$args->list_order = -1 * $args->member_srl;
2190 2190
 
2191
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2192
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2191
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2192
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2193 2193
 
2194 2194
 		$oDB = &DB::getInstance();
2195 2195
 		$oDB->begin();
2196 2196
 
2197 2197
 		$output = executeQuery('member.insertMember', $args);
2198
-		if(!$output->toBool())
2198
+		if (!$output->toBool())
2199 2199
 		{
2200 2200
 			$oDB->rollback();
2201 2201
 			return $output;
2202 2202
 		}
2203 2203
 
2204
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2204
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2205 2205
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2206 2206
 		// If no value is entered the default group, the value of group registration
2207
-		if(!$args->group_srl_list)
2207
+		if (!$args->group_srl_list)
2208 2208
 		{
2209 2209
 			$columnList = array('site_srl', 'group_srl');
2210 2210
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2211
-			if($default_group)
2211
+			if ($default_group)
2212 2212
 			{
2213 2213
 				// Add to the default group
2214
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2215
-				if(!$output->toBool())
2214
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2215
+				if (!$output->toBool())
2216 2216
 				{
2217 2217
 					$oDB->rollback();
2218 2218
 					return $output;
@@ -2222,11 +2222,11 @@  discard block
 block discarded – undo
2222 2222
 		}
2223 2223
 		else
2224 2224
 		{
2225
-			for($i=0;$i<count($group_srl_list);$i++)
2225
+			for ($i = 0; $i < count($group_srl_list); $i++)
2226 2226
 			{
2227
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2227
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2228 2228
 
2229
-				if(!$output->toBool())
2229
+				if (!$output->toBool())
2230 2230
 				{
2231 2231
 					$oDB->rollback();
2232 2232
 					return $output;
@@ -2236,7 +2236,7 @@  discard block
 block discarded – undo
2236 2236
 
2237 2237
 		$member_config = $oModuleModel->getModuleConfig('member');
2238 2238
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2239
-		if($args->denied == 'Y')
2239
+		if ($args->denied == 'Y')
2240 2240
 		{
2241 2241
 			// Insert data into the authentication DB
2242 2242
 			$oPassword = new Password();
@@ -2248,7 +2248,7 @@  discard block
 block discarded – undo
2248 2248
 			$auth_args->is_register = 'Y';
2249 2249
 
2250 2250
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2251
-			if(!$output->toBool())
2251
+			if (!$output->toBool())
2252 2252
 			{
2253 2253
 				$oDB->rollback();
2254 2254
 				return $output;
@@ -2256,10 +2256,10 @@  discard block
 block discarded – undo
2256 2256
 			$this->_sendAuthMail($auth_args, $args);
2257 2257
 		}
2258 2258
 		// Call a trigger (after)
2259
-		if($output->toBool())
2259
+		if ($output->toBool())
2260 2260
 		{
2261 2261
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2262
-			if(!$trigger_output->toBool())
2262
+			if (!$trigger_output->toBool())
2263 2263
 			{
2264 2264
 				$oDB->rollback();
2265 2265
 				return $trigger_output;
@@ -2281,41 +2281,41 @@  discard block
 block discarded – undo
2281 2281
 	{
2282 2282
 		// Call a trigger (before)
2283 2283
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2284
-		if(!$output->toBool()) return $output;
2284
+		if (!$output->toBool()) return $output;
2285 2285
 		// Create a model object
2286 2286
 		$oMemberModel = getModel('member');
2287 2287
 
2288 2288
 		$logged_info = Context::get('logged_info');
2289 2289
 		// Get what you want to modify the original information
2290
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2290
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2291 2291
 		// Control of essential parameters
2292
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2293
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2292
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2293
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2294 2294
 
2295
-		if($logged_info->is_admin == 'Y')
2295
+		if ($logged_info->is_admin == 'Y')
2296 2296
 		{
2297
-			if($args->denied!='Y') $args->denied = 'N';
2298
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2297
+			if ($args->denied != 'Y') $args->denied = 'N';
2298
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2299 2299
 		}
2300 2300
 		else
2301 2301
 		{
2302 2302
 			unset($args->is_admin);
2303
-			if($is_admin == false)
2303
+			if ($is_admin == false)
2304 2304
 				unset($args->denied);
2305
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2305
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2306 2306
 			{
2307 2307
 				return $this->stop('msg_invalid_request');
2308 2308
 			}
2309 2309
 		}
2310 2310
 
2311 2311
 		// Sanitize user ID, username, nickname, homepage, blog
2312
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2312
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2313 2313
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2314 2314
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2315 2315
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2316 2316
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2317
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2318
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2317
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2318
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2319 2319
 
2320 2320
 		// check member identifier form
2321 2321
 		$config = $oMemberModel->getMemberConfig();
@@ -2324,56 +2324,56 @@  discard block
 block discarded – undo
2324 2324
 		$orgMemberInfo = $output->data;
2325 2325
 
2326 2326
 		// Check if email address or user ID is duplicate
2327
-		if($config->identifier == 'email_address')
2327
+		if ($config->identifier == 'email_address')
2328 2328
 		{
2329 2329
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2330
-			if($member_srl && $args->member_srl != $member_srl)
2330
+			if ($member_srl && $args->member_srl != $member_srl)
2331 2331
 			{
2332
-				return new BaseObject(-1,'msg_exists_email_address');
2332
+				return new BaseObject(-1, 'msg_exists_email_address');
2333 2333
 			}
2334 2334
 			$args->email_address = $orgMemberInfo->email_address;
2335 2335
 		}
2336 2336
 		else
2337 2337
 		{
2338 2338
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2339
-			if($member_srl && $args->member_srl != $member_srl)
2339
+			if ($member_srl && $args->member_srl != $member_srl)
2340 2340
 			{
2341
-				return new BaseObject(-1,'msg_exists_user_id');
2341
+				return new BaseObject(-1, 'msg_exists_user_id');
2342 2342
 			}
2343 2343
 
2344 2344
 			$args->user_id = $orgMemberInfo->user_id;
2345 2345
 		}
2346 2346
 
2347
-		if($logged_info->is_admin !== 'Y')
2347
+		if ($logged_info->is_admin !== 'Y')
2348 2348
 		{
2349 2349
 			// Check if ID is prohibited
2350
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2350
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2351 2351
 			{
2352
-				return new BaseObject(-1,'denied_user_id');
2352
+				return new BaseObject(-1, 'denied_user_id');
2353 2353
 			}
2354 2354
 
2355 2355
 			// Check if nickname is prohibited
2356
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2356
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2357 2357
 			{
2358 2358
 				return new BaseObject(-1, 'denied_nick_name');
2359 2359
 			}
2360 2360
 		}
2361 2361
 
2362 2362
 		// Check if ID is duplicate
2363
-		if($args->user_id)
2363
+		if ($args->user_id)
2364 2364
 		{
2365 2365
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2366
-			if($member_srl && $args->member_srl != $member_srl)
2366
+			if ($member_srl && $args->member_srl != $member_srl)
2367 2367
 			{
2368
-				return new BaseObject(-1,'msg_exists_user_id');
2368
+				return new BaseObject(-1, 'msg_exists_user_id');
2369 2369
 			}
2370 2370
 		}
2371 2371
 
2372 2372
 		// Check if nickname is duplicate
2373 2373
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2374
- 		if($member_srl && $args->member_srl != $member_srl)
2374
+ 		if ($member_srl && $args->member_srl != $member_srl)
2375 2375
  		{
2376
- 			return new BaseObject(-1,'msg_exists_nick_name');
2376
+ 			return new BaseObject(-1, 'msg_exists_nick_name');
2377 2377
  		}
2378 2378
 
2379 2379
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2382,9 +2382,9 @@  discard block
 block discarded – undo
2382 2382
 		$oDB->begin();
2383 2383
 
2384 2384
 		// Check password strength
2385
-		if($args->password)
2385
+		if ($args->password)
2386 2386
 		{
2387
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2387
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2388 2388
 			{
2389 2389
 				$message = Context::getLang('about_password_strength');
2390 2390
 				return new BaseObject(-1, $message[$config->password_strength]);
@@ -2396,55 +2396,55 @@  discard block
 block discarded – undo
2396 2396
 			$args->password = $orgMemberInfo->password;
2397 2397
 		}
2398 2398
 
2399
-		if($args->find_account_answer) {
2399
+		if ($args->find_account_answer) {
2400 2400
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2401 2401
 		}
2402 2402
 		else
2403 2403
 		{
2404
-			$oPassword =  new Password();
2404
+			$oPassword = new Password();
2405 2405
 			$hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer);
2406 2406
 
2407
-			if($hashed) {
2407
+			if ($hashed) {
2408 2408
 				$args->find_account_answer = $orgMemberInfo->find_account_answer;
2409 2409
 			} else {
2410 2410
 				$args->find_account_answer = $oPassword->createHash($orgMemberInfo->find_account_answer);
2411 2411
 			}
2412 2412
 		}
2413 2413
 
2414
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2415
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2416
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2417
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2418
-		if(!$args->birthday) $args->birthday = '';
2414
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2415
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2416
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2417
+		if (!$args->description) $args->description = $orgMemberInfo->description;
2418
+		if (!$args->birthday) $args->birthday = '';
2419 2419
 
2420 2420
 		$output = executeQuery('member.updateMember', $args);
2421 2421
 
2422
-		if(!$output->toBool())
2422
+		if (!$output->toBool())
2423 2423
 		{
2424 2424
 			$oDB->rollback();
2425 2425
 			return $output;
2426 2426
 		}
2427 2427
 
2428
-		if($args->group_srl_list)
2428
+		if ($args->group_srl_list)
2429 2429
 		{
2430
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2430
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2431 2431
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2432 2432
 			// If the group information, group information changes
2433
-			if(count($group_srl_list) > 0)
2433
+			if (count($group_srl_list) > 0)
2434 2434
 			{
2435 2435
 				$args->site_srl = 0;
2436 2436
 				// One of its members to delete all the group
2437 2437
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2438
-				if(!$output->toBool())
2438
+				if (!$output->toBool())
2439 2439
 				{
2440 2440
 					$oDB->rollback();
2441 2441
 					return $output;
2442 2442
 				}
2443 2443
 				// Enter one of the loop a
2444
-				for($i=0;$i<count($group_srl_list);$i++)
2444
+				for ($i = 0; $i < count($group_srl_list); $i++)
2445 2445
 				{
2446
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2447
-					if(!$output->toBool())
2446
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2447
+					if (!$output->toBool())
2448 2448
 					{
2449 2449
 						$oDB->rollback();
2450 2450
 						return $output;
@@ -2456,9 +2456,9 @@  discard block
 block discarded – undo
2456 2456
 			}
2457 2457
 		}
2458 2458
 		// Call a trigger (after)
2459
-		if($output->toBool()) {
2459
+		if ($output->toBool()) {
2460 2460
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2461
-			if(!$trigger_output->toBool())
2461
+			if (!$trigger_output->toBool())
2462 2462
 			{
2463 2463
 				$oDB->rollback();
2464 2464
 				return $trigger_output;
@@ -2471,7 +2471,7 @@  discard block
 block discarded – undo
2471 2471
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2472 2472
 
2473 2473
 		// Save Session
2474
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2474
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2475 2475
 		$logged_info = Context::get('logged_info');
2476 2476
 
2477 2477
 		$output->add('member_srl', $args->member_srl);
@@ -2483,14 +2483,14 @@  discard block
 block discarded – undo
2483 2483
 	 */
2484 2484
 	function updateMemberPassword($args)
2485 2485
 	{
2486
-		if($args->password)
2486
+		if ($args->password)
2487 2487
 		{
2488 2488
 
2489 2489
 			// check password strength
2490 2490
 			$oMemberModel = getModel('member');
2491 2491
 			$config = $oMemberModel->getMemberConfig();
2492 2492
 
2493
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2493
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2494 2494
 			{
2495 2495
 				$message = Context::getLang('about_password_strength');
2496 2496
 				return new BaseObject(-1, $message[$config->password_strength]);
@@ -2498,13 +2498,13 @@  discard block
 block discarded – undo
2498 2498
 
2499 2499
 			$args->password = $oMemberModel->hashPassword($args->password);
2500 2500
 		}
2501
-		else if($args->hashed_password)
2501
+		else if ($args->hashed_password)
2502 2502
 		{
2503 2503
 			$args->password = $args->hashed_password;
2504 2504
 		}
2505 2505
 
2506 2506
 		$output = executeQuery('member.updateMemberPassword', $args);
2507
-		if($output->toBool())
2507
+		if ($output->toBool())
2508 2508
 		{
2509 2509
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2510 2510
 		}
@@ -2516,7 +2516,7 @@  discard block
 block discarded – undo
2516 2516
 
2517 2517
 	function updateFindAccountAnswer($member_srl, $answer)
2518 2518
 	{
2519
-		$oPassword =  new Password();
2519
+		$oPassword = new Password();
2520 2520
 
2521 2521
 		$args = new stdClass();
2522 2522
 		$args->member_srl = $member_srl;
@@ -2533,18 +2533,18 @@  discard block
 block discarded – undo
2533 2533
 		$trigger_obj = new stdClass();
2534 2534
 		$trigger_obj->member_srl = $member_srl;
2535 2535
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2536
-		if(!$output->toBool()) return $output;
2536
+		if (!$output->toBool()) return $output;
2537 2537
 		// Create a model object
2538 2538
 		$oMemberModel = getModel('member');
2539 2539
 		// Bringing the user's information
2540
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2540
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2541 2541
 		{
2542 2542
 			$columnList = array('member_srl', 'is_admin');
2543 2543
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2544 2544
 		}
2545
-		if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2545
+		if (!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2546 2546
 		// If managers can not be deleted
2547
-		if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2547
+		if ($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2548 2548
 
2549 2549
 		$oDB = &DB::getInstance();
2550 2550
 		$oDB->begin();
@@ -2553,7 +2553,7 @@  discard block
 block discarded – undo
2553 2553
 		$args->member_srl = $member_srl;
2554 2554
 		// Delete the entries in member_auth_mail
2555 2555
 		$output = executeQuery('member.deleteAuthMail', $args);
2556
-		if(!$output->toBool())
2556
+		if (!$output->toBool())
2557 2557
 		{
2558 2558
 			$oDB->rollback();
2559 2559
 			return $output;
@@ -2568,23 +2568,23 @@  discard block
 block discarded – undo
2568 2568
 		 */
2569 2569
 		// Delete the entries in member_group_member
2570 2570
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2571
-		if(!$output->toBool())
2571
+		if (!$output->toBool())
2572 2572
 		{
2573 2573
 			$oDB->rollback();
2574 2574
 			return $output;
2575 2575
 		}
2576 2576
 		// member removed from the table
2577 2577
 		$output = executeQuery('member.deleteMember', $args);
2578
-		if(!$output->toBool())
2578
+		if (!$output->toBool())
2579 2579
 		{
2580 2580
 			$oDB->rollback();
2581 2581
 			return $output;
2582 2582
 		}
2583 2583
 		// Call a trigger (after)
2584
-		if($output->toBool())
2584
+		if ($output->toBool())
2585 2585
 		{
2586 2586
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2587
-			if(!$trigger_output->toBool())
2587
+			if (!$trigger_output->toBool())
2588 2588
 			{
2589 2589
 				$oDB->rollback();
2590 2590
 				return $trigger_output;
@@ -2608,23 +2608,23 @@  discard block
 block discarded – undo
2608 2608
 	 */
2609 2609
 	function destroySessionInfo()
2610 2610
 	{
2611
-		if(!$_SESSION || !is_array($_SESSION)) return;
2611
+		if (!$_SESSION || !is_array($_SESSION)) return;
2612 2612
 
2613 2613
 		$memberInfo = Context::get('logged_info');
2614 2614
 		$memberSrl = $memberInfo->member_srl;
2615 2615
 
2616
-		foreach($_SESSION as $key => $val)
2616
+		foreach ($_SESSION as $key => $val)
2617 2617
 		{
2618 2618
 			$_SESSION[$key] = '';
2619 2619
 		}
2620 2620
 
2621 2621
 		session_destroy();
2622
-		setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000);
2623
-		setcookie('sso','',$_SERVER['REQUEST_TIME']-42000);
2624
-		setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000);
2622
+		setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000);
2623
+		setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000);
2624
+		setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000);
2625 2625
 		setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000);
2626 2626
 
2627
-		if($memberSrl || $_COOKIE['xeak'])
2627
+		if ($memberSrl || $_COOKIE['xeak'])
2628 2628
 		{
2629 2629
 			$args = new stdClass();
2630 2630
 			$args->member_srl = $memberSrl;
@@ -2640,22 +2640,22 @@  discard block
 block discarded – undo
2640 2640
 		$pointGroup = $pointModuleConfig->point_group;
2641 2641
 
2642 2642
 		$levelGroup = array();
2643
-		if(is_array($pointGroup) && count($pointGroup)>0)
2643
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2644 2644
 		{
2645 2645
 			$levelGroup = array_flip($pointGroup);
2646 2646
 			ksort($levelGroup);
2647 2647
 		}
2648 2648
 		$maxLevel = 0;
2649 2649
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2650
-		if(count($resultGroup) > 0)
2650
+		if (count($resultGroup) > 0)
2651 2651
 			$maxLevel = max(array_flip($resultGroup));
2652 2652
 
2653
-		if($maxLevel > 0)
2653
+		if ($maxLevel > 0)
2654 2654
 		{
2655 2655
 			$oPointModel = getModel('point');
2656 2656
 			$originPoint = $oPointModel->getPoint($memberSrl);
2657 2657
 
2658
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2658
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2659 2659
 			{
2660 2660
 				$oPointController = getController('point');
2661 2661
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2665,18 +2665,18 @@  discard block
 block discarded – undo
2665 2665
 
2666 2666
 	function procMemberModifyEmailAddress()
2667 2667
 	{
2668
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2668
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2669 2669
 
2670 2670
 		$member_info = Context::get('logged_info');
2671 2671
 		$newEmail = Context::get('email_address');
2672 2672
 
2673
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2673
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2674 2674
 
2675 2675
 		$oMemberModel = getModel('member');
2676 2676
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2677
-		if($member_srl) return new BaseObject(-1,'msg_exists_email_address');
2677
+		if ($member_srl) return new BaseObject(-1, 'msg_exists_email_address');
2678 2678
 
2679
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2679
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2680 2680
 		{
2681 2681
 			return $this->stop('msg_invalid_request');
2682 2682
 		}
@@ -2692,7 +2692,7 @@  discard block
 block discarded – undo
2692 2692
 		$oDB = &DB::getInstance();
2693 2693
 		$oDB->begin();
2694 2694
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2695
-		if(!$output->toBool())
2695
+		if (!$output->toBool())
2696 2696
 		{
2697 2697
 			$oDB->rollback();
2698 2698
 			return $output;
@@ -2702,7 +2702,7 @@  discard block
 block discarded – undo
2702 2702
 		$member_config = $oModuleModel->getModuleConfig('member');
2703 2703
 
2704 2704
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2705
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2705
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2706 2706
 
2707 2707
 		global $lang;
2708 2708
 
@@ -2714,17 +2714,17 @@  discard block
 block discarded – undo
2714 2714
 
2715 2715
 		Context::set('newEmail', $newEmail);
2716 2716
 
2717
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2717
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2718 2718
 		Context::set('auth_url', $auth_url);
2719 2719
 
2720 2720
 		$oTemplate = &TemplateHandler::getInstance();
2721 2721
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2722 2722
 
2723 2723
 		$oMail = new Mail();
2724
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2724
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2725 2725
 		$oMail->setContent($content);
2726
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2727
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2726
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2727
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2728 2728
 		$result = $oMail->send();
2729 2729
 
2730 2730
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2738,16 +2738,16 @@  discard block
 block discarded – undo
2738 2738
 	{
2739 2739
 		$member_srl = Context::get('member_srl');
2740 2740
 		$auth_key = Context::get('auth_key');
2741
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2741
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2742 2742
 
2743 2743
 		// Test logs for finding password by user_id and authkey
2744 2744
 		$args = new stdClass;
2745 2745
 		$args->member_srl = $member_srl;
2746 2746
 		$args->auth_key = $auth_key;
2747 2747
 		$output = executeQuery('member.getAuthMail', $args);
2748
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2748
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2749 2749
 		{
2750
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2750
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2751 2751
 			return $this->stop('msg_invalid_modify_email_auth_key');
2752 2752
 		}
2753 2753
 
@@ -2756,10 +2756,10 @@  discard block
 block discarded – undo
2756 2756
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2757 2757
 
2758 2758
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2759
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2759
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2760 2760
 
2761 2761
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2762
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2762
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2763 2763
 
2764 2764
 		$this->_clearMemberCache($args->member_srl);
2765 2765
 
@@ -2777,7 +2777,7 @@  discard block
 block discarded – undo
2777 2777
 	**/
2778 2778
 	function triggerGetDocumentMenu(&$menu_list)
2779 2779
 	{
2780
-		if(!Context::get('is_logged')) return new BaseObject();
2780
+		if (!Context::get('is_logged')) return new BaseObject();
2781 2781
 
2782 2782
 		$logged_info = Context::get('logged_info');
2783 2783
 		$document_srl = Context::get('target_srl');
@@ -2788,12 +2788,12 @@  discard block
 block discarded – undo
2788 2788
 		$member_srl = $oDocument->get('member_srl');
2789 2789
 		$module_srl = $oDocument->get('module_srl');
2790 2790
 
2791
-		if(!$member_srl) return new BaseObject();
2792
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
2791
+		if (!$member_srl) return new BaseObject();
2792
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject();
2793 2793
 
2794 2794
 		$oDocumentController = getController('document');
2795
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2796
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2795
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2796
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2797 2797
 
2798 2798
 		return new BaseObject();
2799 2799
 	}
@@ -2807,7 +2807,7 @@  discard block
 block discarded – undo
2807 2807
 	**/
2808 2808
 	function triggerGetCommentMenu(&$menu_list)
2809 2809
 	{
2810
-		if(!Context::get('is_logged')) return new BaseObject();
2810
+		if (!Context::get('is_logged')) return new BaseObject();
2811 2811
 
2812 2812
 		$logged_info = Context::get('logged_info');
2813 2813
 		$comment_srl = Context::get('target_srl');
@@ -2818,12 +2818,12 @@  discard block
 block discarded – undo
2818 2818
 		$module_srl = $oComment->get('module_srl');
2819 2819
 		$member_srl = $oComment->get('member_srl');
2820 2820
 
2821
-		if(!$member_srl) return new BaseObject();
2822
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
2821
+		if (!$member_srl) return new BaseObject();
2822
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject();
2823 2823
 
2824 2824
 		$oCommentController = getController('comment');
2825
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2826
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2825
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2826
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2827 2827
 
2828 2828
 		return new BaseObject();
2829 2829
 	}
@@ -2835,7 +2835,7 @@  discard block
 block discarded – undo
2835 2835
 	**/
2836 2836
 	function procMemberSpammerManage()
2837 2837
 	{
2838
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
2838
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
2839 2839
 
2840 2840
 		$logged_info = Context::get('logged_info');
2841 2841
 		$member_srl = Context::get('member_srl');
@@ -2843,7 +2843,7 @@  discard block
 block discarded – undo
2843 2843
 		$cnt_loop = Context::get('cnt_loop');
2844 2844
 		$proc_type = Context::get('proc_type');
2845 2845
 		$isMoveToTrash = true;
2846
-		if($proc_type == "delete")
2846
+		if ($proc_type == "delete")
2847 2847
 			$isMoveToTrash = false;
2848 2848
 
2849 2849
 		// check grant
@@ -2852,7 +2852,7 @@  discard block
 block discarded – undo
2852 2852
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2853 2853
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2854 2854
 
2855
-		if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
2855
+		if (!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
2856 2856
 
2857 2857
 		$proc_msg = "";
2858 2858
 
@@ -2861,10 +2861,10 @@  discard block
 block discarded – undo
2861 2861
 
2862 2862
 		// delete or trash destination
2863 2863
 		// proc member
2864
-		if($cnt_loop == 1)
2864
+		if ($cnt_loop == 1)
2865 2865
 			$this->_spammerMember($member_srl);
2866 2866
 		// proc document and comment
2867
-		elseif($cnt_loop>1)
2867
+		elseif ($cnt_loop > 1)
2868 2868
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2869 2869
 
2870 2870
 		// get destination count
@@ -2873,11 +2873,11 @@  discard block
 block discarded – undo
2873 2873
 
2874 2874
 		$total_count = Context::get('total_count');
2875 2875
 		$remain_count = $cnt_document + $cnt_comment;
2876
-		if($cnt_loop == 1) $total_count = $remain_count;
2876
+		if ($cnt_loop == 1) $total_count = $remain_count;
2877 2877
 
2878 2878
 		// get progress percent
2879
-		if($total_count > 0)
2880
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2879
+		if ($total_count > 0)
2880
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2881 2881
 		else
2882 2882
 			$progress = 100;
2883 2883
 
@@ -2901,7 +2901,7 @@  discard block
 block discarded – undo
2901 2901
 	**/
2902 2902
 	private function _spammerMember($member_srl) {
2903 2903
 		$logged_info = Context::get('logged_info');
2904
-		$spam_description = trim( Context::get('spam_description') );
2904
+		$spam_description = trim(Context::get('spam_description'));
2905 2905
 
2906 2906
 		$oMemberModel = getModel('member');
2907 2907
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2920,10 +2920,10 @@  discard block
 block discarded – undo
2920 2920
 		$args->user_id = $member_info->user_id;
2921 2921
 		$args->nick_name = $member_info->nick_name;
2922 2922
 		$args->denied = "Y";
2923
-		$args->description = trim( $member_info->description );
2924
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2923
+		$args->description = trim($member_info->description);
2924
+		if ($args->description != "") $args->description .= "\n"; // add new line
2925 2925
 
2926
-		$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 . "]";
2926
+		$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."]";
2927 2927
 
2928 2928
 		$output = $this->updateMember($args, true);
2929 2929
 
@@ -2952,21 +2952,21 @@  discard block
 block discarded – undo
2952 2952
 		// 1. proc comment, 2. proc document
2953 2953
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2954 2954
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2955
-		if($cnt_comment > 0)
2955
+		if ($cnt_comment > 0)
2956 2956
 		{
2957 2957
 			$columnList = array();
2958 2958
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2959
-			if($commentList) {
2960
-				foreach($commentList as $v) {
2959
+			if ($commentList) {
2960
+				foreach ($commentList as $v) {
2961 2961
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2962 2962
 				}
2963 2963
 			}
2964
-		} elseif($cnt_document > 0) {
2964
+		} elseif ($cnt_document > 0) {
2965 2965
 			$columnList = array();
2966 2966
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2967
-			if($documentList) {
2968
-				foreach($documentList as $v) {
2969
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2967
+			if ($documentList) {
2968
+				foreach ($documentList as $v) {
2969
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2970 2970
 					else $oDocumentController->deleteDocument($v->document_srl);
2971 2971
 				}
2972 2972
 			}
@@ -2978,24 +2978,24 @@  discard block
 block discarded – undo
2978 2978
 	function _clearMemberCache($member_srl, $site_srl = 0)
2979 2979
 	{
2980 2980
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2981
-		if($oCacheHandler->isSupport())
2981
+		if ($oCacheHandler->isSupport())
2982 2982
 		{
2983
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2983
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2984 2984
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2985 2985
 			$oCacheHandler->delete($cache_key);
2986 2986
 
2987
-			if($site_srl !== 0)
2987
+			if ($site_srl !== 0)
2988 2988
 			{
2989
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2989
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2990 2990
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2991 2991
 				$oCacheHandler->delete($cache_key);
2992 2992
 			}
2993 2993
 		}
2994 2994
 
2995 2995
 		$oCacheHandler = CacheHandler::getInstance('object');
2996
-		if($oCacheHandler->isSupport())
2996
+		if ($oCacheHandler->isSupport())
2997 2997
 		{
2998
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2998
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2999 2999
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
3000 3000
 			$oCacheHandler->delete($cache_key);
3001 3001
 		}
Please login to merge, or discard this patch.
Braces   +568 added lines, -250 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,20 +818,30 @@  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
 		$oMemberModel = getModel('member');
744 836
 		$config = $oMemberModel->getMemberConfig();
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
 		$output = $this->insertProfileImage($member_srl, $file['tmp_name']);
748
-		if(!$output->toBool()) return $output;
842
+		if(!$output->toBool()) {
843
+			return $output;
844
+		}
749 845
 
750 846
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
751 847
 		$this->setRedirectUrl($returnUrl);
@@ -768,8 +864,9 @@  discard block
 block discarded – undo
768 864
 		$max_filesize = $config->profile_image_max_filesize;
769 865
 		foreach($config->signupForm as $val)
770 866
 		{
771
-			if($val->name == "profile_image")
772
-				$allow_transparent = $val->allow_transparent_thumbnail == 'Y';
867
+			if($val->name == "profile_image") {
868
+							$allow_transparent = $val->allow_transparent_thumbnail == 'Y';
869
+			}
773 870
 		}
774 871
 
775 872
 		Context::loadLang(_XE_PATH_ . 'modules/file/lang');
@@ -777,10 +874,13 @@  discard block
 block discarded – undo
777 874
 		// Get file information
778 875
 		FileHandler::clearStatCache($target_file);
779 876
 		list($width, $height, $type) = @getimagesize($target_file);
780
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
781
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
782
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
783
-		else
877
+		if(IMAGETYPE_PNG == $type) {
878
+			$ext = 'png';
879
+		} elseif(IMAGETYPE_JPEG == $type) {
880
+			$ext = 'jpg';
881
+		} elseif(IMAGETYPE_GIF == $type) {
882
+			$ext = 'gif';
883
+		} else
784 884
 		{
785 885
 			return $this->stop('msg_not_uploaded_profile_image');
786 886
 		}
@@ -811,8 +911,7 @@  discard block
 block discarded – undo
811 911
 			FileHandler::removeFilesInDir($target_path);
812 912
 			FileHandler::moveFile($temp_filename, $target_filename);
813 913
 			FileHandler::clearStatCache($target_filename);
814
-		}
815
-		else
914
+		} else
816 915
 		{
817 916
 			// 파일 용량 제한
818 917
 			$filesize = filesize($target_file);
@@ -841,20 +940,30 @@  discard block
 block discarded – undo
841 940
 	{
842 941
 		// Check if the file is successfully uploaded
843 942
 		$file = $_FILES['image_name'];
844
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
943
+		if(!is_uploaded_file($file['tmp_name'])) {
944
+			return $this->stop('msg_not_uploaded_image_name');
945
+		}
845 946
 		// Ignore if member_srl is invalid or doesn't exist.
846 947
 		$member_srl = Context::get('member_srl');
847
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
948
+		if(!$member_srl) {
949
+			return $this->stop('msg_not_uploaded_image_name');
950
+		}
848 951
 
849 952
 		$logged_info = Context::get('logged_info');
850
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
953
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
954
+			return $this->stop('msg_not_uploaded_image_name');
955
+		}
851 956
 		// Return if member module is set not to use an image name or the user is not an administrator ;
852 957
 		$oMemberModel = getModel('member');
853 958
 		$config = $oMemberModel->getMemberConfig();
854
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
959
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
960
+			return $this->stop('msg_not_uploaded_image_name');
961
+		}
855 962
 
856 963
 		$output = $this->insertImageName($member_srl, $file['tmp_name']);
857
-		if(!$output->toBool()) return $output;
964
+		if(!$output->toBool()) {
965
+			return $output;
966
+		}
858 967
 
859 968
 		// Page refresh
860 969
 		//$this->setRefreshPage();
@@ -909,8 +1018,7 @@  discard block
 block discarded – undo
909 1018
 			FileHandler::removeFilesInDir($target_path);
910 1019
 			FileHandler::moveFile($temp_filename, $target_filename);
911 1020
 			FileHandler::clearStatCache($target_filename);
912
-		}
913
-		else
1021
+		} else
914 1022
 		{
915 1023
 			// 파일 용량 제한
916 1024
 			$filesize = filesize($target_file);
@@ -987,20 +1095,30 @@  discard block
 block discarded – undo
987 1095
 	{
988 1096
 		// Check if the file is successfully uploaded
989 1097
 		$file = $_FILES['image_mark'];
990
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
1098
+		if(!is_uploaded_file($file['tmp_name'])) {
1099
+			return $this->stop('msg_not_uploaded_image_mark');
1100
+		}
991 1101
 		// Ignore if member_srl is invalid or doesn't exist.
992 1102
 		$member_srl = Context::get('member_srl');
993
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
1103
+		if(!$member_srl) {
1104
+			return $this->stop('msg_not_uploaded_image_mark');
1105
+		}
994 1106
 
995 1107
 		$logged_info = Context::get('logged_info');
996
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
1108
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
1109
+			return $this->stop('msg_not_uploaded_image_mark');
1110
+		}
997 1111
 		// Membership in the images mark the module using the ban was set by an administrator or return;
998 1112
 		$oMemberModel = getModel('member');
999 1113
 		$config = $oMemberModel->getMemberConfig();
1000
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1114
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1115
+			return $this->stop('msg_not_uploaded_image_mark');
1116
+		}
1001 1117
 
1002 1118
 		$this->insertImageMark($member_srl, $file['tmp_name']);
1003
-		if(!$output->toBool()) return $output;
1119
+		if(!$output->toBool()) {
1120
+			return $output;
1121
+		}
1004 1122
 
1005 1123
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
1006 1124
 		$this->setRedirectUrl($returnUrl);
@@ -1051,8 +1169,7 @@  discard block
 block discarded – undo
1051 1169
 			FileHandler::removeFilesInDir($target_path);
1052 1170
 			FileHandler::moveFile($temp_filename, $target_filename);
1053 1171
 			FileHandler::clearStatCache($target_filename);
1054
-		}
1055
-		else
1172
+		} else
1056 1173
 		{
1057 1174
 			$filesize = filesize($target_file);
1058 1175
 			if($max_filesize && $filesize > ($max_filesize * 1024))
@@ -1104,14 +1221,18 @@  discard block
 block discarded – undo
1104 1221
 	function procMemberFindAccount()
1105 1222
 	{
1106 1223
 		$email_address = Context::get('email_address');
1107
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1224
+		if(!$email_address) {
1225
+			return new BaseObject(-1, 'msg_invalid_request');
1226
+		}
1108 1227
 
1109 1228
 		$oMemberModel = getModel('member');
1110 1229
 		$oModuleModel = getModel('module');
1111 1230
 
1112 1231
 		// Check if a member having the same email address exists
1113 1232
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1114
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1233
+		if(!$member_srl) {
1234
+			return new BaseObject(-1, 'msg_email_not_exists');
1235
+		}
1115 1236
 
1116 1237
 		// Get information of the member
1117 1238
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -1123,7 +1244,9 @@  discard block
 block discarded – undo
1123 1244
 			$chk_args = new stdClass;
1124 1245
 			$chk_args->member_srl = $member_info->member_srl;
1125 1246
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1126
-			if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1247
+			if($output->toBool() && $output->data->count != '0') {
1248
+				return new BaseObject(-1, 'msg_user_not_confirmed');
1249
+			}
1127 1250
 		}
1128 1251
 
1129 1252
 		// Insert data into the authentication DB
@@ -1136,7 +1259,9 @@  discard block
 block discarded – undo
1136 1259
 		$args->is_register = 'N';
1137 1260
 
1138 1261
 		$output = executeQuery('member.insertAuthMail', $args);
1139
-		if(!$output->toBool()) return $output;
1262
+		if(!$output->toBool()) {
1263
+			return $output;
1264
+		}
1140 1265
 		// Get content of the email to send a member
1141 1266
 		Context::set('auth_args', $args);
1142 1267
 
@@ -1153,8 +1278,7 @@  discard block
 block discarded – undo
1153 1278
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1154 1279
 				}
1155 1280
 			}
1156
-		}
1157
-		else
1281
+		} else
1158 1282
 		{
1159 1283
 			$memberInfo[$lang->user_id] = $args->user_id;
1160 1284
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1163,13 +1287,19 @@  discard block
 block discarded – undo
1163 1287
 		}
1164 1288
 		Context::set('memberInfo', $memberInfo);
1165 1289
 
1166
-		if(!$member_config->skin) $member_config->skin = "default";
1167
-		if(!$member_config->colorset) $member_config->colorset = "white";
1290
+		if(!$member_config->skin) {
1291
+			$member_config->skin = "default";
1292
+		}
1293
+		if(!$member_config->colorset) {
1294
+			$member_config->colorset = "white";
1295
+		}
1168 1296
 
1169 1297
 		Context::set('member_config', $member_config);
1170 1298
 
1171 1299
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1172
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1300
+		if(!is_dir($tpl_path)) {
1301
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1302
+		}
1173 1303
 
1174 1304
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1175 1305
 		Context::set('find_url', $find_url);
@@ -1212,19 +1342,25 @@  discard block
 block discarded – undo
1212 1342
 		$find_account_question = trim(Context::get('find_account_question'));
1213 1343
 		$find_account_answer = trim(Context::get('find_account_answer'));
1214 1344
 
1215
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1345
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1346
+			return new BaseObject(-1, 'msg_invalid_request');
1347
+		}
1216 1348
 
1217 1349
 		$oModuleModel = getModel('module');
1218 1350
 		// Check if a member having the same email address exists
1219 1351
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1220
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1352
+		if(!$member_srl) {
1353
+			return new BaseObject(-1, 'msg_email_not_exists');
1354
+		}
1221 1355
 
1222 1356
 		// Get information of the member
1223 1357
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1224 1358
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1225 1359
 
1226 1360
 		// Display a message if no answer is entered
1227
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1361
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1362
+			return new BaseObject(-1, 'msg_question_not_exists');
1363
+		}
1228 1364
 
1229 1365
 		// 답변 확인
1230 1366
 		$hashed = $oPassword->checkAlgorithm($member_info->find_account_answer);
@@ -1233,12 +1369,10 @@  discard block
 block discarded – undo
1233 1369
 		if($member_info->find_account_question != $find_account_question)
1234 1370
 		{
1235 1371
 			$authed = false;
1236
-		}
1237
-		else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1372
+		} else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1238 1373
 		{
1239 1374
 			$authed = false;
1240
-		}
1241
-		else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1375
+		} else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1242 1376
 		{
1243 1377
 			$authed = false;
1244 1378
 		}
@@ -1267,7 +1401,9 @@  discard block
 block discarded – undo
1267 1401
 		$args->password = $temp_password;
1268 1402
 		$args->change_password_date = '1';
1269 1403
 		$output = $this->updateMemberPassword($args);
1270
-		if(!$output->toBool()) return $output;
1404
+		if(!$output->toBool()) {
1405
+			return $output;
1406
+		}
1271 1407
 
1272 1408
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1273 1409
 
@@ -1324,8 +1460,7 @@  discard block
 block discarded – undo
1324 1460
 		if($output->data->is_register == 'Y')
1325 1461
 		{
1326 1462
 			$args->denied = 'N';
1327
-		}
1328
-		else
1463
+		} else
1329 1464
 		{
1330 1465
 			$args->password = $oMemberModel->hashPassword($args->password);
1331 1466
 		}
@@ -1359,33 +1494,45 @@  discard block
 block discarded – undo
1359 1494
 	{
1360 1495
 		// Get an email_address
1361 1496
 		$email_address = Context::get('email_address');
1362
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1497
+		if(!$email_address) {
1498
+			return new BaseObject(-1, 'msg_invalid_request');
1499
+		}
1363 1500
 		// Log test by using email_address
1364 1501
 		$oMemberModel = getModel('member');
1365 1502
 
1366 1503
 		$args = new stdClass;
1367 1504
 		$args->email_address = $email_address;
1368 1505
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1369
-		if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1506
+		if(!$memberSrl) {
1507
+			return new BaseObject(-1, 'msg_not_exists_member');
1508
+		}
1370 1509
 
1371 1510
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1372 1511
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1373 1512
 
1374 1513
 		$oModuleModel = getModel('module');
1375 1514
 		$member_config = $oModuleModel->getModuleConfig('member');
1376
-		if(!$member_config->skin) $member_config->skin = "default";
1377
-		if(!$member_config->colorset) $member_config->colorset = "white";
1515
+		if(!$member_config->skin) {
1516
+			$member_config->skin = "default";
1517
+		}
1518
+		if(!$member_config->colorset) {
1519
+			$member_config->colorset = "white";
1520
+		}
1378 1521
 
1379 1522
 		// Check if a authentication mail has been sent previously
1380 1523
 		$chk_args = new stdClass;
1381 1524
 		$chk_args->member_srl = $member_info->member_srl;
1382 1525
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1383
-		if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1526
+		if($output->toBool() && $output->data->count == '0') {
1527
+			return new BaseObject(-1, 'msg_invalid_request');
1528
+		}
1384 1529
 
1385 1530
 		$auth_args = new stdClass;
1386 1531
 		$auth_args->member_srl = $member_info->member_srl;
1387 1532
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1388
-		if(!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1533
+		if(!$output->data || !$output->data[0]->auth_key) {
1534
+			return new BaseObject(-1, 'msg_invalid_request');
1535
+		}
1389 1536
 		$auth_info = $output->data[0];
1390 1537
 
1391 1538
 		// Update the regdate of authmail entry
@@ -1406,8 +1553,7 @@  discard block
 block discarded – undo
1406 1553
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1407 1554
 				}
1408 1555
 			}
1409
-		}
1410
-		else
1556
+		} else
1411 1557
 		{
1412 1558
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1413 1559
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1420,7 +1566,9 @@  discard block
 block discarded – undo
1420 1566
 		Context::set('member_config', $member_config);
1421 1567
 
1422 1568
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1423
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1569
+		if(!is_dir($tpl_path)) {
1570
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1571
+		}
1424 1572
 
1425 1573
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1426 1574
 		Context::set('auth_url', $auth_url);
@@ -1498,7 +1646,9 @@  discard block
 block discarded – undo
1498 1646
 		$auth_args->is_register = 'Y';
1499 1647
 
1500 1648
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1501
-		if(!$output->toBool()) return $output;
1649
+		if(!$output->toBool()) {
1650
+			return $output;
1651
+		}
1502 1652
 
1503 1653
 		$memberInfo->email_address = $newEmail;
1504 1654
 
@@ -1532,8 +1682,7 @@  discard block
 block discarded – undo
1532 1682
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1533 1683
 				}
1534 1684
 			}
1535
-		}
1536
-		else
1685
+		} else
1537 1686
 		{
1538 1687
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1539 1688
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1542,13 +1691,19 @@  discard block
 block discarded – undo
1542 1691
 		}
1543 1692
 		Context::set('memberInfo', $memberInfo);
1544 1693
 
1545
-		if(!$member_config->skin) $member_config->skin = "default";
1546
-		if(!$member_config->colorset) $member_config->colorset = "white";
1694
+		if(!$member_config->skin) {
1695
+			$member_config->skin = "default";
1696
+		}
1697
+		if(!$member_config->colorset) {
1698
+			$member_config->colorset = "white";
1699
+		}
1547 1700
 
1548 1701
 		Context::set('member_config', $member_config);
1549 1702
 
1550 1703
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1551
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1704
+		if(!is_dir($tpl_path)) {
1705
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1706
+		}
1552 1707
 
1553 1708
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1554 1709
 		Context::set('auth_url', $auth_url);
@@ -1573,7 +1728,9 @@  discard block
 block discarded – undo
1573 1728
 	{
1574 1729
 		$site_module_info = Context::get('site_module_info');
1575 1730
 		$logged_info = Context::get('logged_info');
1576
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1731
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1732
+			return new BaseObject(-1,'msg_invalid_request');
1733
+		}
1577 1734
 
1578 1735
 		$oMemberModel = getModel('member');
1579 1736
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1592,13 +1749,17 @@  discard block
 block discarded – undo
1592 1749
 	{
1593 1750
 		$site_module_info = Context::get('site_module_info');
1594 1751
 		$logged_info = Context::get('logged_info');
1595
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1752
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1753
+			return new BaseObject(-1,'msg_invalid_request');
1754
+		}
1596 1755
 
1597 1756
 		$args = new stdClass;
1598 1757
 		$args->site_srl= $site_module_info->site_srl;
1599 1758
 		$args->member_srl = $logged_info->member_srl;
1600 1759
 		$output = executeQuery('member.deleteMembersGroup', $args);
1601
-		if(!$output->toBool()) return $output;
1760
+		if(!$output->toBool()) {
1761
+			return $output;
1762
+		}
1602 1763
 		$this->setMessage('success_deleted');
1603 1764
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1604 1765
 	}
@@ -1612,17 +1773,37 @@  discard block
 block discarded – undo
1612 1773
 	 */
1613 1774
 	function setMemberConfig($args)
1614 1775
 	{
1615
-		if(!$args->skin) $args->skin = "default";
1616
-		if(!$args->colorset) $args->colorset = "white";
1617
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1618
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1619
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1776
+		if(!$args->skin) {
1777
+			$args->skin = "default";
1778
+		}
1779
+		if(!$args->colorset) {
1780
+			$args->colorset = "white";
1781
+		}
1782
+		if(!$args->editor_skin) {
1783
+			$args->editor_skin= "ckeditor";
1784
+		}
1785
+		if(!$args->editor_colorset) {
1786
+			$args->editor_colorset = "moono";
1787
+		}
1788
+		if($args->enable_join!='Y') {
1789
+			$args->enable_join = 'N';
1790
+		}
1620 1791
 		$args->enable_openid= 'N';
1621
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1622
-		if($args->image_name!='Y') $args->image_name = 'N';
1623
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1624
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1625
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1792
+		if($args->profile_image !='Y') {
1793
+			$args->profile_image = 'N';
1794
+		}
1795
+		if($args->image_name!='Y') {
1796
+			$args->image_name = 'N';
1797
+		}
1798
+		if($args->image_mark!='Y') {
1799
+			$args->image_mark = 'N';
1800
+		}
1801
+		if($args->group_image_mark!='Y') {
1802
+			$args->group_image_mark = 'N';
1803
+		}
1804
+		if(!trim(strip_tags($args->agreement))) {
1805
+			$args->agreement = null;
1806
+		}
1626 1807
 		$args->limit_day = (int)$args->limit_day;
1627 1808
 
1628 1809
 		$agreement = trim($args->agreement);
@@ -1630,7 +1811,9 @@  discard block
 block discarded – undo
1630 1811
 
1631 1812
 		$oModuleController = getController('module');
1632 1813
 		$output = $oModuleController->insertModuleConfig('member',$args);
1633
-		if(!$output->toBool()) return $output;
1814
+		if(!$output->toBool()) {
1815
+			return $output;
1816
+		}
1634 1817
 
1635 1818
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1636 1819
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1655,7 +1838,9 @@  discard block
 block discarded – undo
1655 1838
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1656 1839
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1657 1840
 
1658
-		if(!$check_signature) return FileHandler::removeFile($filename);
1841
+		if(!$check_signature) {
1842
+			return FileHandler::removeFile($filename);
1843
+		}
1659 1844
 
1660 1845
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1661 1846
 		FileHandler::makeDir($path);
@@ -1689,7 +1874,9 @@  discard block
 block discarded – undo
1689 1874
 		$args = new stdClass();
1690 1875
 		$args->member_srl = $member_srl;
1691 1876
 		$args->group_srl = $group_srl;
1692
-		if($site_srl) $args->site_srl = $site_srl;
1877
+		if($site_srl) {
1878
+			$args->site_srl = $site_srl;
1879
+		}
1693 1880
 
1694 1881
 		// Add
1695 1882
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1715,15 +1902,21 @@  discard block
 block discarded – undo
1715 1902
 		$obj->member_srl = implode(',',$args->member_srl);
1716 1903
 
1717 1904
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1718
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1905
+		if($output->data) {
1906
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1907
+		}
1719 1908
 
1720 1909
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1721
-		if(!$output->toBool()) return $output;
1910
+		if(!$output->toBool()) {
1911
+			return $output;
1912
+		}
1722 1913
 
1723 1914
 		$inserted_members = array();
1724 1915
 		foreach($args->member_srl as $key => $val)
1725 1916
 		{
1726
-			if($inserted_members[$val]) continue;
1917
+			if($inserted_members[$val]) {
1918
+				continue;
1919
+			}
1727 1920
 			$inserted_members[$val] = true;
1728 1921
 
1729 1922
 			unset($obj);
@@ -1733,7 +1926,9 @@  discard block
 block discarded – undo
1733 1926
 			$obj->site_srl = $args->site_srl;
1734 1927
 			$obj->regdate = $date[$obj->member_srl];
1735 1928
 			$output = executeQuery('member.addMemberToGroup', $obj);
1736
-			if(!$output->toBool()) return $output;
1929
+			if(!$output->toBool()) {
1930
+				return $output;
1931
+			}
1737 1932
 
1738 1933
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1739 1934
 		}
@@ -1795,8 +1990,7 @@  discard block
 block discarded – undo
1795 1990
 				if($config->identifier == 'user_id')
1796 1991
 				{
1797 1992
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1798
-				}
1799
-				else
1993
+				} else
1800 1994
 				{
1801 1995
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1802 1996
 				}
@@ -1805,8 +1999,7 @@  discard block
 block discarded – undo
1805 1999
 					$do_auto_login = true;
1806 2000
 				}
1807 2001
 
1808
-			}
1809
-			else
2002
+			} else
1810 2003
 			{
1811 2004
 				$do_auto_login = true;
1812 2005
 			}
@@ -1815,8 +2008,7 @@  discard block
 block discarded – undo
1815 2008
 		if($do_auto_login)
1816 2009
 		{
1817 2010
 			$output = $this->doLogin($user_id);
1818
-		}
1819
-		else
2011
+		} else
1820 2012
 		{
1821 2013
 			executeQuery('member.deleteAutologin', $args);
1822 2014
 			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
@@ -1835,13 +2027,17 @@  discard block
 block discarded – undo
1835 2027
 	function doLogin($user_id, $password = '', $keep_signed = false)
1836 2028
 	{
1837 2029
 		$user_id = strtolower($user_id);
1838
-		if(!$user_id) return new BaseObject(-1, 'null_user_id');
2030
+		if(!$user_id) {
2031
+			return new BaseObject(-1, 'null_user_id');
2032
+		}
1839 2033
 		// Call a trigger before log-in (before)
1840 2034
 		$trigger_obj = new stdClass();
1841 2035
 		$trigger_obj->user_id = $user_id;
1842 2036
 		$trigger_obj->password = $password;
1843 2037
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1844
-		if(!$trigger_output->toBool()) return $trigger_output;
2038
+		if(!$trigger_output->toBool()) {
2039
+			return $trigger_output;
2040
+		}
1845 2041
 		// Create a member model object
1846 2042
 		$oMemberModel = getModel('member');
1847 2043
 
@@ -1856,15 +2052,18 @@  discard block
 block discarded – undo
1856 2052
 			// Get user_id information
1857 2053
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1858 2054
 			// Set an invalid user if no value returned
1859
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
2055
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
2056
+				return $this->recordLoginError(-1, 'invalid_email_address');
2057
+			}
1860 2058
 
1861
-		}
1862
-		else
2059
+		} else
1863 2060
 		{
1864 2061
 			// Get user_id information
1865 2062
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1866 2063
 			// Set an invalid user if no value returned
1867
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
2064
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
2065
+				return $this->recordLoginError(-1, 'invalid_user_id');
2066
+			}
1868 2067
 		}
1869 2068
 
1870 2069
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1876,14 +2075,18 @@  discard block
 block discarded – undo
1876 2075
 			if($term < $config->max_error_count_time)
1877 2076
 			{
1878 2077
 				$term = $config->max_error_count_time - $term;
1879
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1880
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1881
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1882
-				else $term = intval($term/86400).Context::getLang('unit_day');
2078
+				if($term < 60) {
2079
+					$term = intval($term).Context::getLang('unit_sec');
2080
+				} elseif(60 <= $term && $term < 3600) {
2081
+					$term = intval($term/60).Context::getLang('unit_min');
2082
+				} elseif(3600 <= $term && $term < 86400) {
2083
+					$term = intval($term/3600).Context::getLang('unit_hour');
2084
+				} else {
2085
+					$term = intval($term/86400).Context::getLang('unit_day');
2086
+				}
1883 2087
 
1884 2088
 				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1885
-			}
1886
-			else
2089
+			} else
1887 2090
 			{
1888 2091
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1889 2092
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1910,7 +2113,9 @@  discard block
 block discarded – undo
1910 2113
 			return new BaseObject(-1,'msg_user_denied');
1911 2114
 		}
1912 2115
 		// Notify if denied_date is less than the current time
1913
-		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")));
2116
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
2117
+			return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
2118
+		}
1914 2119
 		// Update the latest login time
1915 2120
 		$args->member_srl = $this->memberInfo->member_srl;
1916 2121
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1959,7 +2164,9 @@  discard block
 block discarded – undo
1959 2164
 		}
1960 2165
 		// Call a trigger after successfully log-in (after)
1961 2166
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1962
-		if(!$trigger_output->toBool()) return $trigger_output;
2167
+		if(!$trigger_output->toBool()) {
2168
+			return $trigger_output;
2169
+		}
1963 2170
 		// When user checked to use auto-login
1964 2171
 		if($keep_signed)
1965 2172
 		{
@@ -1973,7 +2180,9 @@  discard block
 block discarded – undo
1973 2180
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1974 2181
 			executeQuery('member.deleteAutologin', $autologin_args);
1975 2182
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1976
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2183
+			if($autologin_output->toBool()) {
2184
+				setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2185
+			}
1977 2186
 		}
1978 2187
 		if($this->memberInfo->is_admin == 'Y')
1979 2188
 		{
@@ -2062,7 +2271,9 @@  discard block
 block discarded – undo
2062 2271
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
2063 2272
 	{
2064 2273
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
2065
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2274
+		if(!is_array($member_popup_menu_list)) {
2275
+			$member_popup_menu_list = array();
2276
+		}
2066 2277
 
2067 2278
 		$obj = new stdClass;
2068 2279
 		$obj->url = $url;
@@ -2081,35 +2292,54 @@  discard block
 block discarded – undo
2081 2292
 	{
2082 2293
 		// Call a trigger (before)
2083 2294
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
2084
-		if(!$output->toBool()) return $output;
2295
+		if(!$output->toBool()) {
2296
+			return $output;
2297
+		}
2085 2298
 		// Terms and Conditions portion of the information set up by members reaffirmed
2086 2299
 		$oModuleModel = getModel('module');
2087 2300
 		$config = $oModuleModel->getModuleConfig('member');
2088 2301
 
2089 2302
 		$logged_info = Context::get('logged_info');
2090 2303
 		// If the date of the temporary restrictions limit further information on the date of
2091
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2304
+		if($config->limit_day) {
2305
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2306
+		}
2092 2307
 
2093 2308
 		$args->member_srl = getNextSequence();
2094 2309
 		$args->list_order = -1 * $args->member_srl;
2095 2310
 
2096 2311
 		// Execute insert or update depending on the value of member_srl
2097
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2312
+		if(!$args->user_id) {
2313
+			$args->user_id = 't'.$args->member_srl;
2314
+		}
2098 2315
 		// Enter the user's identity changed to lowercase
2099
-		else $args->user_id = strtolower($args->user_id);
2100
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2101
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2316
+		else {
2317
+			$args->user_id = strtolower($args->user_id);
2318
+		}
2319
+		if(!$args->user_name) {
2320
+			$args->user_name = $args->member_srl;
2321
+		}
2322
+		if(!$args->nick_name) {
2323
+			$args->nick_name = $args->member_srl;
2324
+		}
2102 2325
 
2103 2326
 		// Control of essential parameters
2104
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2105
-		if($args->denied!='Y') $args->denied = 'N';
2106
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2327
+		if($args->allow_mailing!='Y') {
2328
+			$args->allow_mailing = 'N';
2329
+		}
2330
+		if($args->denied!='Y') {
2331
+			$args->denied = 'N';
2332
+		}
2333
+		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) {
2334
+			$args->allow_message = 'Y';
2335
+		}
2107 2336
 
2108 2337
 		if($logged_info->is_admin == 'Y')
2109 2338
 		{
2110
-			if($args->is_admin!='Y') $args->is_admin = 'N';
2111
-		}
2112
-		else
2339
+			if($args->is_admin!='Y') {
2340
+				$args->is_admin = 'N';
2341
+			}
2342
+		} else
2113 2343
 		{
2114 2344
 			unset($args->is_admin);
2115 2345
 		}
@@ -2122,8 +2352,12 @@  discard block
 block discarded – undo
2122 2352
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2123 2353
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2124 2354
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2125
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2126
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2355
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2356
+			$args->homepage = 'http://'.$args->homepage;
2357
+		}
2358
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2359
+			$args->blog = 'http://'.$args->blog;
2360
+		}
2127 2361
 
2128 2362
 		// Create a model object
2129 2363
 		$oMemberModel = getModel('member');
@@ -2137,8 +2371,7 @@  discard block
 block discarded – undo
2137 2371
 				return new BaseObject(-1, $message[$config->password_strength]);
2138 2372
 			}
2139 2373
 			$args->password = $oMemberModel->hashPassword($args->password);
2140
-		}
2141
-		elseif(!$args->password)
2374
+		} elseif(!$args->password)
2142 2375
 		{
2143 2376
 			unset($args->password);
2144 2377
 		}
@@ -2146,8 +2379,7 @@  discard block
 block discarded – undo
2146 2379
 		if($args->find_account_answer && !$password_is_hashed)
2147 2380
 		{
2148 2381
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2149
-		}
2150
-		elseif(!$args->find_account_answer)
2382
+		} elseif(!$args->find_account_answer)
2151 2383
 		{
2152 2384
 			unset($args->find_account_answer);
2153 2385
 		}
@@ -2188,8 +2420,12 @@  discard block
 block discarded – undo
2188 2420
 		// Insert data into the DB
2189 2421
 		$args->list_order = -1 * $args->member_srl;
2190 2422
 
2191
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2192
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2423
+		if(!$args->user_id) {
2424
+			$args->user_id = 't'.$args->member_srl;
2425
+		}
2426
+		if(!$args->user_name) {
2427
+			$args->user_name = $args->member_srl;
2428
+		}
2193 2429
 
2194 2430
 		$oDB = &DB::getInstance();
2195 2431
 		$oDB->begin();
@@ -2201,8 +2437,11 @@  discard block
 block discarded – undo
2201 2437
 			return $output;
2202 2438
 		}
2203 2439
 
2204
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2205
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2440
+		if(is_array($args->group_srl_list)) {
2441
+			$group_srl_list = $args->group_srl_list;
2442
+		} else {
2443
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2444
+		}
2206 2445
 		// If no value is entered the default group, the value of group registration
2207 2446
 		if(!$args->group_srl_list)
2208 2447
 		{
@@ -2219,8 +2458,7 @@  discard block
 block discarded – undo
2219 2458
 				}
2220 2459
 			}
2221 2460
 			// If the value is the value of the group entered the group registration
2222
-		}
2223
-		else
2461
+		} else
2224 2462
 		{
2225 2463
 			for($i=0;$i<count($group_srl_list);$i++)
2226 2464
 			{
@@ -2281,27 +2519,39 @@  discard block
 block discarded – undo
2281 2519
 	{
2282 2520
 		// Call a trigger (before)
2283 2521
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2284
-		if(!$output->toBool()) return $output;
2522
+		if(!$output->toBool()) {
2523
+			return $output;
2524
+		}
2285 2525
 		// Create a model object
2286 2526
 		$oMemberModel = getModel('member');
2287 2527
 
2288 2528
 		$logged_info = Context::get('logged_info');
2289 2529
 		// Get what you want to modify the original information
2290
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2530
+		if(!$this->memberInfo) {
2531
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2532
+		}
2291 2533
 		// Control of essential parameters
2292
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2293
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2534
+		if($args->allow_mailing!='Y') {
2535
+			$args->allow_mailing = 'N';
2536
+		}
2537
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2538
+			$args->allow_message = 'Y';
2539
+		}
2294 2540
 
2295 2541
 		if($logged_info->is_admin == 'Y')
2296 2542
 		{
2297
-			if($args->denied!='Y') $args->denied = 'N';
2298
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2299
-		}
2300
-		else
2543
+			if($args->denied!='Y') {
2544
+				$args->denied = 'N';
2545
+			}
2546
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2547
+				$args->is_admin = 'N';
2548
+			}
2549
+		} else
2301 2550
 		{
2302 2551
 			unset($args->is_admin);
2303
-			if($is_admin == false)
2304
-				unset($args->denied);
2552
+			if($is_admin == false) {
2553
+							unset($args->denied);
2554
+			}
2305 2555
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2306 2556
 			{
2307 2557
 				return $this->stop('msg_invalid_request');
@@ -2309,13 +2559,19 @@  discard block
 block discarded – undo
2309 2559
 		}
2310 2560
 
2311 2561
 		// Sanitize user ID, username, nickname, homepage, blog
2312
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2562
+		if($args->user_id) {
2563
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2564
+		}
2313 2565
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2314 2566
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2315 2567
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2316 2568
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2317
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2318
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2569
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2570
+			$args->homepage = 'http://'.$args->homepage;
2571
+		}
2572
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2573
+			$args->blog = 'http://'.$args->blog;
2574
+		}
2319 2575
 
2320 2576
 		// check member identifier form
2321 2577
 		$config = $oMemberModel->getMemberConfig();
@@ -2332,8 +2588,7 @@  discard block
 block discarded – undo
2332 2588
 				return new BaseObject(-1,'msg_exists_email_address');
2333 2589
 			}
2334 2590
 			$args->email_address = $orgMemberInfo->email_address;
2335
-		}
2336
-		else
2591
+		} else
2337 2592
 		{
2338 2593
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2339 2594
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2390,16 +2645,14 @@  discard block
 block discarded – undo
2390 2645
 				return new BaseObject(-1, $message[$config->password_strength]);
2391 2646
 			}
2392 2647
 			$args->password = $oMemberModel->hashPassword($args->password);
2393
-		}
2394
-		else
2648
+		} else
2395 2649
 		{
2396 2650
 			$args->password = $orgMemberInfo->password;
2397 2651
 		}
2398 2652
 
2399 2653
 		if($args->find_account_answer) {
2400 2654
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2401
-		}
2402
-		else
2655
+		} else
2403 2656
 		{
2404 2657
 			$oPassword =  new Password();
2405 2658
 			$hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer);
@@ -2411,11 +2664,21 @@  discard block
 block discarded – undo
2411 2664
 			}
2412 2665
 		}
2413 2666
 
2414
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2415
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2416
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2417
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2418
-		if(!$args->birthday) $args->birthday = '';
2667
+		if(!$args->user_name) {
2668
+			$args->user_name = $orgMemberInfo->user_name;
2669
+		}
2670
+		if(!$args->user_id) {
2671
+			$args->user_id = $orgMemberInfo->user_id;
2672
+		}
2673
+		if(!$args->nick_name) {
2674
+			$args->nick_name = $orgMemberInfo->nick_name;
2675
+		}
2676
+		if(!$args->description) {
2677
+			$args->description = $orgMemberInfo->description;
2678
+		}
2679
+		if(!$args->birthday) {
2680
+			$args->birthday = '';
2681
+		}
2419 2682
 
2420 2683
 		$output = executeQuery('member.updateMember', $args);
2421 2684
 
@@ -2427,8 +2690,11 @@  discard block
 block discarded – undo
2427 2690
 
2428 2691
 		if($args->group_srl_list)
2429 2692
 		{
2430
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2431
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2693
+			if(is_array($args->group_srl_list)) {
2694
+				$group_srl_list = $args->group_srl_list;
2695
+			} else {
2696
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2697
+			}
2432 2698
 			// If the group information, group information changes
2433 2699
 			if(count($group_srl_list) > 0)
2434 2700
 			{
@@ -2471,7 +2737,9 @@  discard block
 block discarded – undo
2471 2737
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2472 2738
 
2473 2739
 		// Save Session
2474
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2740
+		if(!$this->memberInfo) {
2741
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2742
+		}
2475 2743
 		$logged_info = Context::get('logged_info');
2476 2744
 
2477 2745
 		$output->add('member_srl', $args->member_srl);
@@ -2497,8 +2765,7 @@  discard block
 block discarded – undo
2497 2765
 			}
2498 2766
 
2499 2767
 			$args->password = $oMemberModel->hashPassword($args->password);
2500
-		}
2501
-		else if($args->hashed_password)
2768
+		} else if($args->hashed_password)
2502 2769
 		{
2503 2770
 			$args->password = $args->hashed_password;
2504 2771
 		}
@@ -2533,7 +2800,9 @@  discard block
 block discarded – undo
2533 2800
 		$trigger_obj = new stdClass();
2534 2801
 		$trigger_obj->member_srl = $member_srl;
2535 2802
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2536
-		if(!$output->toBool()) return $output;
2803
+		if(!$output->toBool()) {
2804
+			return $output;
2805
+		}
2537 2806
 		// Create a model object
2538 2807
 		$oMemberModel = getModel('member');
2539 2808
 		// Bringing the user's information
@@ -2542,9 +2811,13 @@  discard block
 block discarded – undo
2542 2811
 			$columnList = array('member_srl', 'is_admin');
2543 2812
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2544 2813
 		}
2545
-		if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2814
+		if(!$this->memberInfo) {
2815
+			return new BaseObject(-1, 'msg_not_exists_member');
2816
+		}
2546 2817
 		// If managers can not be deleted
2547
-		if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2818
+		if($this->memberInfo->is_admin == 'Y') {
2819
+			return new BaseObject(-1, 'msg_cannot_delete_admin');
2820
+		}
2548 2821
 
2549 2822
 		$oDB = &DB::getInstance();
2550 2823
 		$oDB->begin();
@@ -2608,7 +2881,9 @@  discard block
 block discarded – undo
2608 2881
 	 */
2609 2882
 	function destroySessionInfo()
2610 2883
 	{
2611
-		if(!$_SESSION || !is_array($_SESSION)) return;
2884
+		if(!$_SESSION || !is_array($_SESSION)) {
2885
+			return;
2886
+		}
2612 2887
 
2613 2888
 		$memberInfo = Context::get('logged_info');
2614 2889
 		$memberSrl = $memberInfo->member_srl;
@@ -2647,8 +2922,9 @@  discard block
 block discarded – undo
2647 2922
 		}
2648 2923
 		$maxLevel = 0;
2649 2924
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2650
-		if(count($resultGroup) > 0)
2651
-			$maxLevel = max(array_flip($resultGroup));
2925
+		if(count($resultGroup) > 0) {
2926
+					$maxLevel = max(array_flip($resultGroup));
2927
+		}
2652 2928
 
2653 2929
 		if($maxLevel > 0)
2654 2930
 		{
@@ -2665,16 +2941,22 @@  discard block
 block discarded – undo
2665 2941
 
2666 2942
 	function procMemberModifyEmailAddress()
2667 2943
 	{
2668
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2944
+		if(!Context::get('is_logged')) {
2945
+			return $this->stop('msg_not_logged');
2946
+		}
2669 2947
 
2670 2948
 		$member_info = Context::get('logged_info');
2671 2949
 		$newEmail = Context::get('email_address');
2672 2950
 
2673
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2951
+		if(!$newEmail) {
2952
+			return $this->stop('msg_invalid_request');
2953
+		}
2674 2954
 
2675 2955
 		$oMemberModel = getModel('member');
2676 2956
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2677
-		if($member_srl) return new BaseObject(-1,'msg_exists_email_address');
2957
+		if($member_srl) {
2958
+			return new BaseObject(-1,'msg_exists_email_address');
2959
+		}
2678 2960
 
2679 2961
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2680 2962
 		{
@@ -2702,7 +2984,9 @@  discard block
 block discarded – undo
2702 2984
 		$member_config = $oModuleModel->getModuleConfig('member');
2703 2985
 
2704 2986
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2705
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2987
+		if(!is_dir($tpl_path)) {
2988
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2989
+		}
2706 2990
 
2707 2991
 		global $lang;
2708 2992
 
@@ -2738,7 +3022,9 @@  discard block
 block discarded – undo
2738 3022
 	{
2739 3023
 		$member_srl = Context::get('member_srl');
2740 3024
 		$auth_key = Context::get('auth_key');
2741
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
3025
+		if(!$member_srl || !$auth_key) {
3026
+			return $this->stop('msg_invalid_request');
3027
+		}
2742 3028
 
2743 3029
 		// Test logs for finding password by user_id and authkey
2744 3030
 		$args = new stdClass;
@@ -2747,7 +3033,9 @@  discard block
 block discarded – undo
2747 3033
 		$output = executeQuery('member.getAuthMail', $args);
2748 3034
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2749 3035
 		{
2750
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
3036
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
3037
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
3038
+			}
2751 3039
 			return $this->stop('msg_invalid_modify_email_auth_key');
2752 3040
 		}
2753 3041
 
@@ -2756,7 +3044,9 @@  discard block
 block discarded – undo
2756 3044
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2757 3045
 
2758 3046
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2759
-		if(!$output->toBool()) return $this->stop($output->getMessage());
3047
+		if(!$output->toBool()) {
3048
+			return $this->stop($output->getMessage());
3049
+		}
2760 3050
 
2761 3051
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2762 3052
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2777,7 +3067,9 @@  discard block
 block discarded – undo
2777 3067
 	**/
2778 3068
 	function triggerGetDocumentMenu(&$menu_list)
2779 3069
 	{
2780
-		if(!Context::get('is_logged')) return new BaseObject();
3070
+		if(!Context::get('is_logged')) {
3071
+			return new BaseObject();
3072
+		}
2781 3073
 
2782 3074
 		$logged_info = Context::get('logged_info');
2783 3075
 		$document_srl = Context::get('target_srl');
@@ -2788,8 +3080,12 @@  discard block
 block discarded – undo
2788 3080
 		$member_srl = $oDocument->get('member_srl');
2789 3081
 		$module_srl = $oDocument->get('module_srl');
2790 3082
 
2791
-		if(!$member_srl) return new BaseObject();
2792
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
3083
+		if(!$member_srl) {
3084
+			return new BaseObject();
3085
+		}
3086
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
3087
+			return new BaseObject();
3088
+		}
2793 3089
 
2794 3090
 		$oDocumentController = getController('document');
2795 3091
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2807,7 +3103,9 @@  discard block
 block discarded – undo
2807 3103
 	**/
2808 3104
 	function triggerGetCommentMenu(&$menu_list)
2809 3105
 	{
2810
-		if(!Context::get('is_logged')) return new BaseObject();
3106
+		if(!Context::get('is_logged')) {
3107
+			return new BaseObject();
3108
+		}
2811 3109
 
2812 3110
 		$logged_info = Context::get('logged_info');
2813 3111
 		$comment_srl = Context::get('target_srl');
@@ -2818,8 +3116,12 @@  discard block
 block discarded – undo
2818 3116
 		$module_srl = $oComment->get('module_srl');
2819 3117
 		$member_srl = $oComment->get('member_srl');
2820 3118
 
2821
-		if(!$member_srl) return new BaseObject();
2822
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
3119
+		if(!$member_srl) {
3120
+			return new BaseObject();
3121
+		}
3122
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
3123
+			return new BaseObject();
3124
+		}
2823 3125
 
2824 3126
 		$oCommentController = getController('comment');
2825 3127
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2835,7 +3137,9 @@  discard block
 block discarded – undo
2835 3137
 	**/
2836 3138
 	function procMemberSpammerManage()
2837 3139
 	{
2838
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
3140
+		if(!Context::get('is_logged')) {
3141
+			return new BaseObject(-1,'msg_not_permitted');
3142
+		}
2839 3143
 
2840 3144
 		$logged_info = Context::get('logged_info');
2841 3145
 		$member_srl = Context::get('member_srl');
@@ -2843,8 +3147,9 @@  discard block
 block discarded – undo
2843 3147
 		$cnt_loop = Context::get('cnt_loop');
2844 3148
 		$proc_type = Context::get('proc_type');
2845 3149
 		$isMoveToTrash = true;
2846
-		if($proc_type == "delete")
2847
-			$isMoveToTrash = false;
3150
+		if($proc_type == "delete") {
3151
+					$isMoveToTrash = false;
3152
+		}
2848 3153
 
2849 3154
 		// check grant
2850 3155
 		$oModuleModel = getModel('module');
@@ -2852,7 +3157,9 @@  discard block
 block discarded – undo
2852 3157
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2853 3158
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2854 3159
 
2855
-		if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
3160
+		if(!$grant->manager) {
3161
+			return new BaseObject(-1,'msg_not_permitted');
3162
+		}
2856 3163
 
2857 3164
 		$proc_msg = "";
2858 3165
 
@@ -2861,11 +3168,13 @@  discard block
 block discarded – undo
2861 3168
 
2862 3169
 		// delete or trash destination
2863 3170
 		// proc member
2864
-		if($cnt_loop == 1)
2865
-			$this->_spammerMember($member_srl);
3171
+		if($cnt_loop == 1) {
3172
+					$this->_spammerMember($member_srl);
3173
+		}
2866 3174
 		// proc document and comment
2867
-		elseif($cnt_loop>1)
2868
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
3175
+		elseif($cnt_loop>1) {
3176
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
3177
+		}
2869 3178
 
2870 3179
 		// get destination count
2871 3180
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2873,13 +3182,16 @@  discard block
 block discarded – undo
2873 3182
 
2874 3183
 		$total_count = Context::get('total_count');
2875 3184
 		$remain_count = $cnt_document + $cnt_comment;
2876
-		if($cnt_loop == 1) $total_count = $remain_count;
3185
+		if($cnt_loop == 1) {
3186
+			$total_count = $remain_count;
3187
+		}
2877 3188
 
2878 3189
 		// get progress percent
2879
-		if($total_count > 0)
2880
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2881
-		else
2882
-			$progress = 100;
3190
+		if($total_count > 0) {
3191
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
3192
+		} else {
3193
+					$progress = 100;
3194
+		}
2883 3195
 
2884 3196
 		$this->add('total_count', $total_count);
2885 3197
 		$this->add('remain_count', $remain_count);
@@ -2921,7 +3233,10 @@  discard block
 block discarded – undo
2921 3233
 		$args->nick_name = $member_info->nick_name;
2922 3234
 		$args->denied = "Y";
2923 3235
 		$args->description = trim( $member_info->description );
2924
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3236
+		if( $args->description != "" ) {
3237
+			$args->description .= "\n";
3238
+		}
3239
+		// add new line
2925 3240
 
2926 3241
 		$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 . "]";
2927 3242
 
@@ -2966,8 +3281,11 @@  discard block
 block discarded – undo
2966 3281
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2967 3282
 			if($documentList) {
2968 3283
 				foreach($documentList as $v) {
2969
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2970
-					else $oDocumentController->deleteDocument($v->document_srl);
3284
+					if($isMoveToTrash) {
3285
+						$oDocumentController->moveDocumentToTrash($v);
3286
+					} else {
3287
+						$oDocumentController->deleteDocument($v->document_srl);
3288
+					}
2971 3289
 				}
2972 3290
 			}
2973 3291
 		}
Please login to merge, or discard this patch.
modules/module/module.class.php 2 patches
Spacing   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 		$oModuleController = getController('module');
17 17
 
18 18
 		$oDB = &DB::getInstance();
19
-		$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"), true);
20
-		$oDB->addIndex('sites','unique_domain',array('domain'),true);
19
+		$oDB->addIndex("modules", "idx_site_mid", array("site_srl", "mid"), true);
20
+		$oDB->addIndex('sites', 'unique_domain', array('domain'), true);
21 21
 		// Create a directory to use in the module module
22 22
 		FileHandler::makeDir('./files/cache/module_info');
23 23
 		FileHandler::makeDir('./files/cache/triggers');
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 		$args = new stdClass;
28 28
 		$args->site_srl = 0;
29 29
 		$output = $oDB->executeQuery('module.getSite', $args);
30
-		if(!$output->data || !$output->data->index_module_srl)
30
+		if (!$output->data || !$output->data->index_module_srl)
31 31
 		{
32 32
 			$db_info = Context::getDBInfo();
33 33
 			$domain = Context::getDefaultUrl();
34 34
 			$url_info = parse_url($domain);
35
-			$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
35
+			$domain = $url_info['host'].((!empty($url_info['port']) && $url_info['port'] != 80) ? ':'.$url_info['port'] : '').$url_info['path'];
36 36
 
37 37
 			$site_args = new stdClass;
38 38
 			$site_args->site_srl = 0;
39
-			$site_args->index_module_srl  = 0;
39
+			$site_args->index_module_srl = 0;
40 40
 			$site_args->domain = $domain;
41 41
 			$site_args->default_language = $db_info->lang_type;
42 42
 
43 43
 			$output = executeQuery('module.insertSite', $site_args);
44
-			if(!$output->toBool()) return $output;
44
+			if (!$output->toBool()) return $output;
45 45
 		}
46 46
 
47 47
 		return new BaseObject();
@@ -56,68 +56,68 @@  discard block
 block discarded – undo
56 56
 		$oModuleModel = getModel('module');
57 57
 		$oModuleController = getController('module');
58 58
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
59
-		if($oModuleModel->needUpdate($version_update_id))
59
+		if ($oModuleModel->needUpdate($version_update_id))
60 60
 		{
61 61
 			// 2008. 10. 27 Add multi-index in the table, the module_part_config
62
-			if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) return true;
62
+			if (!$oDB->isIndexExists("module_part_config", "idx_module_part_config")) return true;
63 63
 			// 2008. 11. 13 Delete unique constraint on mid in modules. Add site_srl and then create unique index on site_srl and mid
64
-			if(!$oDB->isIndexExists('modules',"idx_site_mid")) return true;
64
+			if (!$oDB->isIndexExists('modules', "idx_site_mid")) return true;
65 65
 			// Move permissions/skin information of all modules to the table, grants.
66
-			if($oDB->isColumnExists('modules', 'grants')) return true;
66
+			if ($oDB->isColumnExists('modules', 'grants')) return true;
67 67
 			// Move permissions/skin information of all modules to the table, grants.
68
-			if(!$oDB->isColumnExists('sites', 'default_language')) return true;
68
+			if (!$oDB->isColumnExists('sites', 'default_language')) return true;
69 69
 			// Delete extra_vars* column
70
-			for($i=1;$i<=20;$i++)
70
+			for ($i = 1; $i <= 20; $i++)
71 71
 			{
72
-				if($oDB->isColumnExists("documents","extra_vars".$i)) return true;
72
+				if ($oDB->isColumnExists("documents", "extra_vars".$i)) return true;
73 73
 			}
74 74
 			// Insert site information to the table, sites
75 75
 			$args = new stdClass();
76 76
 			$args->site_srl = 0;
77 77
 			$output = $oDB->executeQuery('module.getSite', $args);
78
-			if(!$output->data) return true;
78
+			if (!$output->data) return true;
79 79
 
80 80
 			// If domain index is defined on the table, sites
81
-			if($oDB->isIndexExists('sites', 'idx_domain')) return true;
82
-			if(!$oDB->isIndexExists('sites','unique_domain')) return true;
81
+			if ($oDB->isIndexExists('sites', 'idx_domain')) return true;
82
+			if (!$oDB->isIndexExists('sites', 'unique_domain')) return true;
83 83
 
84
-			if(!$oDB->isColumnExists("modules", "use_mobile")) return true;
85
-			if(!$oDB->isColumnExists("modules", "mlayout_srl")) return true;
86
-			if(!$oDB->isColumnExists("modules", "mcontent")) return true;
87
-			if(!$oDB->isColumnExists("modules", "mskin")) return true;
84
+			if (!$oDB->isColumnExists("modules", "use_mobile")) return true;
85
+			if (!$oDB->isColumnExists("modules", "mlayout_srl")) return true;
86
+			if (!$oDB->isColumnExists("modules", "mcontent")) return true;
87
+			if (!$oDB->isColumnExists("modules", "mskin")) return true;
88 88
 
89 89
 			// check fix skin
90
-			if(!$oDB->isColumnExists("modules", "is_skin_fix")) return true;
90
+			if (!$oDB->isColumnExists("modules", "is_skin_fix")) return true;
91 91
 
92
-			if(!$oDB->isColumnExists("module_config", "site_srl")) return true;
92
+			if (!$oDB->isColumnExists("module_config", "site_srl")) return true;
93 93
 
94 94
 			$args->skin = '.';
95 95
 			$output = executeQueryArray('module.getModuleSkinDotList', $args);
96
-			if($output->data && count($output->data) > 0)
96
+			if ($output->data && count($output->data) > 0)
97 97
 			{
98
-				foreach($output->data as $item)
98
+				foreach ($output->data as $item)
99 99
 				{
100 100
 					$skin_path = explode('.', $item->skin);
101
-					if(count($skin_path) != 2) continue;
102
-					if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) return true;
101
+					if (count($skin_path) != 2) continue;
102
+					if (is_dir(sprintf(_XE_PATH_.'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) return true;
103 103
 				}
104 104
 			}
105 105
 
106 106
 			// XE 1.7
107 107
 
108 108
 			// check fix mskin
109
-			if(!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
109
+			if (!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
110 110
 
111
-			if(!$oDB->isIndexExists("module_part_config", "unique_module_part_config")) return true;
111
+			if (!$oDB->isIndexExists("module_part_config", "unique_module_part_config")) return true;
112 112
 
113 113
 			$oModuleModel = getModel('module');
114 114
 			$moduleConfig = $oModuleModel->getModuleConfig('module');
115
-			if(!$moduleConfig->isUpdateFixedValue) return true;
115
+			if (!$moduleConfig->isUpdateFixedValue) return true;
116 116
 
117 117
 			$oModuleController->insertUpdatedLog($version_update_id);
118 118
 		}
119 119
 
120
-		if(!is_dir('./files/ruleset')) return true;
120
+		if (!is_dir('./files/ruleset')) return true;
121 121
 
122 122
 		return false;
123 123
 	}
@@ -131,22 +131,22 @@  discard block
 block discarded – undo
131 131
 		$oModuleModel = getModel('module');
132 132
 		$oModuleController = getController('module');
133 133
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
134
-		if($oModuleModel->needUpdate($version_update_id))
134
+		if ($oModuleModel->needUpdate($version_update_id))
135 135
 		{
136 136
 			// 2008. 10. 27 module_part_config Add a multi-index to the table and check all information of module_configg
137
-			if(!$oDB->isIndexExists("module_part_config","idx_module_part_config"))
137
+			if (!$oDB->isIndexExists("module_part_config", "idx_module_part_config"))
138 138
 			{
139 139
 				$oModuleModel = getModel('module');
140 140
 				$oModuleController = getController('module');
141 141
 				$modules = $oModuleModel->getModuleList();
142
-				foreach($modules as $key => $module_info)
142
+				foreach ($modules as $key => $module_info)
143 143
 				{
144 144
 					$module = $module_info->module;
145
-					if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) continue;
145
+					if (!in_array($module, array('point', 'trackback', 'layout', 'rss', 'file', 'comment', 'editor'))) continue;
146 146
 					$config = $oModuleModel->getModuleConfig($module);
147 147
 
148 148
 					$module_config = null;
149
-					switch($module)
149
+					switch ($module)
150 150
 					{
151 151
 						case 'point' :
152 152
 							$module_config = $config->module_point;
@@ -159,21 +159,21 @@  discard block
 block discarded – undo
159 159
 						case 'editor' :
160 160
 							$module_config = $config->module_config;
161 161
 							unset($config->module_config);
162
-							if(is_array($module_config) && count($module_config))
162
+							if (is_array($module_config) && count($module_config))
163 163
 							{
164
-								foreach($module_config as $key => $val)
164
+								foreach ($module_config as $key => $val)
165 165
 								{
166
-									if(isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
166
+									if (isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
167 167
 								}
168 168
 							}
169 169
 							break;
170 170
 						case 'layout' :
171 171
 							$tmp = $config->header_script;
172
-							if(is_array($tmp) && count($tmp))
172
+							if (is_array($tmp) && count($tmp))
173 173
 							{
174
-								foreach($tmp as $k => $v)
174
+								foreach ($tmp as $k => $v)
175 175
 								{
176
-									if(!$v && !trim($v)) continue;
176
+									if (!$v && !trim($v)) continue;
177 177
 									$module_config[$k]->header_script = $v;
178 178
 								}
179 179
 							}
@@ -183,29 +183,29 @@  discard block
 block discarded – undo
183 183
 
184 184
 					$oModuleController->insertModuleConfig($module, $config);
185 185
 
186
-					if(is_array($module_config) && count($module_config))
186
+					if (is_array($module_config) && count($module_config))
187 187
 					{
188
-						foreach($module_config as $module_srl => $module_part_config)
188
+						foreach ($module_config as $module_srl => $module_part_config)
189 189
 						{
190
-							$oModuleController->insertModulePartConfig($module,$module_srl,$module_part_config);
190
+							$oModuleController->insertModulePartConfig($module, $module_srl, $module_part_config);
191 191
 						}
192 192
 					}
193 193
 				}
194
-				$oDB->addIndex("module_part_config","idx_module_part_config", array("module","module_srl"));
194
+				$oDB->addIndex("module_part_config", "idx_module_part_config", array("module", "module_srl"));
195 195
 			}
196 196
 			// 2008. 11. 13 drop index(unique_mid). Add a column and index on site_srl and mid columns
197
-			if(!$oDB->isIndexExists('modules',"idx_site_mid"))
197
+			if (!$oDB->isIndexExists('modules', "idx_site_mid"))
198 198
 			{
199
-				$oDB->dropIndex("modules","unique_mid",true);
200
-				$oDB->addColumn('modules','site_srl','number',11,0,true);
201
-				$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"),true);
199
+				$oDB->dropIndex("modules", "unique_mid", true);
200
+				$oDB->addColumn('modules', 'site_srl', 'number', 11, 0, true);
201
+				$oDB->addIndex("modules", "idx_site_mid", array("site_srl", "mid"), true);
202 202
 			}
203 203
 			// document extra vars
204
-			if(!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
204
+			if (!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
205 205
 
206
-			if(!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
206
+			if (!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
207 207
 			// Move permission, skin info, extection info, admin ID of all modules to the table, grants
208
-			if($oDB->isColumnExists('modules', 'grants'))
208
+			if ($oDB->isColumnExists('modules', 'grants'))
209 209
 			{
210 210
 				$oModuleController = getController('module');
211 211
 				$oDocumentController = getController('document');
@@ -213,26 +213,26 @@  discard block
 block discarded – undo
213 213
 				$lang_code = Context::getLangType();
214 214
 				// Get module_info of all modules
215 215
 				$output = executeQueryArray('module.getModuleInfos');
216
-				if(count($output->data))
216
+				if (count($output->data))
217 217
 				{
218
-					foreach($output->data as $module_info)
218
+					foreach ($output->data as $module_info)
219 219
 					{
220 220
 						// Separate information about permission granted to the module, extra vars, skin vars, super-admin's authority
221 221
 						$module_srl = trim($module_info->module_srl);
222 222
 						// grant an authority
223 223
 						$grants = unserialize($module_info->grants);
224
-						if($grants) $oModuleController->insertModuleGrants($module_srl, $grants);
224
+						if ($grants) $oModuleController->insertModuleGrants($module_srl, $grants);
225 225
 						// Insert skin vars
226 226
 						$skin_vars = unserialize($module_info->skin_vars);
227
-						if($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
227
+						if ($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
228 228
 						// Insert super admin's ID
229 229
 						$admin_id = trim($module_info->admin_id);
230
-						if($admin_id && $admin_id != 'Array')
230
+						if ($admin_id && $admin_id != 'Array')
231 231
 						{
232
-							$admin_ids = explode(',',$admin_id);
233
-							if(count($admin_id))
232
+							$admin_ids = explode(',', $admin_id);
233
+							if (count($admin_id))
234 234
 							{
235
-								foreach($admin_ids as $admin_id)
235
+								foreach ($admin_ids as $admin_id)
236 236
 								{
237 237
 									$oModuleController->insertAdminId($module_srl, $admin_id);
238 238
 								}
@@ -241,20 +241,20 @@  discard block
 block discarded – undo
241 241
 						// Save extra configurations for each module(column data which doesn't exist in the defaut modules)
242 242
 						$extra_vars = unserialize($module_info->extra_vars);
243 243
 						$document_extra_keys = null;
244
-						if($extra_vars->extra_vars && count($extra_vars->extra_vars))
244
+						if ($extra_vars->extra_vars && count($extra_vars->extra_vars))
245 245
 						{
246 246
 							$document_extra_keys = $extra_vars->extra_vars;
247 247
 							unset($extra_vars->extra_vars);
248 248
 						}
249
-						if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
249
+						if ($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
250 250
 
251 251
 						/**
252 252
 						 * Move document extra vars(it should have conducted in the documents module however extra vars in modules table should be listed up in this module)
253 253
 						 */
254 254
 						// Insert extra vars if planet module is
255
-						if($module_info->module == 'planet')
255
+						if ($module_info->module == 'planet')
256 256
 						{
257
-							if(!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
257
+							if (!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
258 258
 							$planet_extra_keys->name = 'postscript';
259 259
 							$planet_extra_keys->type = 'text';
260 260
 							$planet_extra_keys->is_required = 'N';
@@ -264,9 +264,9 @@  discard block
 block discarded – undo
264 264
 							$document_extra_keys[20] = $planet_extra_keys;
265 265
 						}
266 266
 						// Register keys for document extra vars
267
-						if(count($document_extra_keys))
267
+						if (count($document_extra_keys))
268 268
 						{
269
-							foreach($document_extra_keys as $var_idx => $val)
269
+							foreach ($document_extra_keys as $var_idx => $val)
270 270
 							{
271 271
 								$oDocumentController->insertDocumentExtraKey($module_srl, $var_idx, $val->name, $val->type, $val->is_required, $val->search, $val->default, $val->desc, 'extra_vars'.$var_idx);
272 272
 							}
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 							$oDocumentModel = getModel('document');
275 275
 							$total_count = $oDocumentModel->getDocumentCount($module_srl);
276 276
 
277
-							if($total_count > 0)
277
+							if ($total_count > 0)
278 278
 							{
279 279
 								$per_page = 100;
280 280
 								$total_pages = (int) (($total_count - 1) / $per_page) + 1;
@@ -285,19 +285,19 @@  discard block
 block discarded – undo
285 285
 								$doc_args->sort_index = 'list_order';
286 286
 								$doc_args->order_type = 'asc';
287 287
 
288
-								for($doc_args->page = 1; $doc_args->page <= $total_pages; $doc_args->page++)
288
+								for ($doc_args->page = 1; $doc_args->page <= $total_pages; $doc_args->page++)
289 289
 								{
290 290
 									$output = executeQueryArray('document.getDocumentList', $doc_args);
291 291
 
292
-									if($output->toBool() && $output->data && count($output->data))
292
+									if ($output->toBool() && $output->data && count($output->data))
293 293
 									{
294 294
 										foreach ($output->data as $document)
295 295
 										{
296
-											if(!$document) continue;
296
+											if (!$document) continue;
297 297
 											foreach ($document as $key => $var)
298 298
 											{
299 299
 												if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') continue;
300
-												$var_idx = str_replace('extra_vars','',$key);
300
+												$var_idx = str_replace('extra_vars', '', $key);
301 301
 												$oDocumentController->insertDocumentExtraVar($module_srl, $document->document_srl, $var_idx, $var, 'extra_vars'.$var_idx, $lang_code);
302 302
 											}
303 303
 										}
@@ -313,96 +313,96 @@  discard block
 block discarded – undo
313 313
 						executeQuery('module.updateModule', $module_info);
314 314
 
315 315
 						$oCacheHandler = CacheHandler::getInstance('object', null, true);
316
-						if($oCacheHandler->isSupport())
316
+						if ($oCacheHandler->isSupport())
317 317
 						{
318 318
 							$oCacheHandler->invalidateGroupKey('site_and_module');
319 319
 						}
320 320
 					}
321 321
 				}
322 322
 				// Various column drop
323
-				$oDB->dropColumn('modules','grants');
324
-				$oDB->dropColumn('modules','admin_id');
325
-				$oDB->dropColumn('modules','skin_vars');
326
-				$oDB->dropColumn('modules','extra_vars');
323
+				$oDB->dropColumn('modules', 'grants');
324
+				$oDB->dropColumn('modules', 'admin_id');
325
+				$oDB->dropColumn('modules', 'skin_vars');
326
+				$oDB->dropColumn('modules', 'extra_vars');
327 327
 			}
328 328
 			// Rights of all modules/skins transferring the information into a table Update grants
329
-			if(!$oDB->isColumnExists('sites', 'default_language'))
329
+			if (!$oDB->isColumnExists('sites', 'default_language'))
330 330
 			{
331
-				$oDB->addColumn('sites','default_language','varchar',255,0,false);
331
+				$oDB->addColumn('sites', 'default_language', 'varchar', 255, 0, false);
332 332
 			}
333 333
 			// extra_vars * Remove Column
334
-			for($i=1;$i<=20;$i++)
334
+			for ($i = 1; $i <= 20; $i++)
335 335
 			{
336
-				if(!$oDB->isColumnExists("documents","extra_vars".$i)) continue;
337
-				$oDB->dropColumn('documents','extra_vars'.$i);
336
+				if (!$oDB->isColumnExists("documents", "extra_vars".$i)) continue;
337
+				$oDB->dropColumn('documents', 'extra_vars'.$i);
338 338
 			}
339 339
 
340 340
 			// Enter the main site information sites on the table
341 341
 			$args = new stdClass;
342 342
 			$args->site_srl = 0;
343 343
 			$output = $oDB->executeQuery('module.getSite', $args);
344
-			if(!$output->data)
344
+			if (!$output->data)
345 345
 			{
346 346
 				// Basic mid, language Wanted
347 347
 				$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
348 348
 				$db_info = Context::getDBInfo();
349 349
 				$domain = Context::getDefaultUrl();
350 350
 				$url_info = parse_url($domain);
351
-				$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
351
+				$domain = $url_info['host'].((!empty($url_info['port']) && $url_info['port'] != 80) ? ':'.$url_info['port'] : '').$url_info['path'];
352 352
 				$site_args->site_srl = 0;
353
-				$site_args->index_module_srl  = $mid_output->data->module_srl;
353
+				$site_args->index_module_srl = $mid_output->data->module_srl;
354 354
 				$site_args->domain = $domain;
355 355
 				$site_args->default_language = $db_info->lang_type;
356 356
 
357 357
 				$output = executeQuery('module.insertSite', $site_args);
358
-				if(!$output->toBool()) return $output;
358
+				if (!$output->toBool()) return $output;
359 359
 			}
360 360
 
361
-			if($oDB->isIndexExists('sites','idx_domain'))
361
+			if ($oDB->isIndexExists('sites', 'idx_domain'))
362 362
 			{
363
-				$oDB->dropIndex('sites','idx_domain');
363
+				$oDB->dropIndex('sites', 'idx_domain');
364 364
 			}
365
-			if(!$oDB->isIndexExists('sites','unique_domain'))
365
+			if (!$oDB->isIndexExists('sites', 'unique_domain'))
366 366
 			{
367 367
 				$this->updateForUniqueSiteDomain();
368
-				$oDB->addIndex('sites','unique_domain',array('domain'),true);
368
+				$oDB->addIndex('sites', 'unique_domain', array('domain'), true);
369 369
 			}
370 370
 
371
-			if(!$oDB->isColumnExists("modules", "use_mobile"))
371
+			if (!$oDB->isColumnExists("modules", "use_mobile"))
372 372
 			{
373
-				$oDB->addColumn('modules','use_mobile','char',1,'N');
373
+				$oDB->addColumn('modules', 'use_mobile', 'char', 1, 'N');
374 374
 			}
375
-			if(!$oDB->isColumnExists("modules", "mlayout_srl"))
375
+			if (!$oDB->isColumnExists("modules", "mlayout_srl"))
376 376
 			{
377
-				$oDB->addColumn('modules','mlayout_srl','number',11, 0);
377
+				$oDB->addColumn('modules', 'mlayout_srl', 'number', 11, 0);
378 378
 			}
379
-			if(!$oDB->isColumnExists("modules", "mcontent"))
379
+			if (!$oDB->isColumnExists("modules", "mcontent"))
380 380
 			{
381
-				$oDB->addColumn('modules','mcontent','bigtext');
381
+				$oDB->addColumn('modules', 'mcontent', 'bigtext');
382 382
 			}
383
-			if(!$oDB->isColumnExists("modules", "mskin"))
383
+			if (!$oDB->isColumnExists("modules", "mskin"))
384 384
 			{
385
-				$oDB->addColumn('modules','mskin','varchar',250);
385
+				$oDB->addColumn('modules', 'mskin', 'varchar', 250);
386 386
 			}
387
-			if(!$oDB->isColumnExists("modules", "is_skin_fix"))
387
+			if (!$oDB->isColumnExists("modules", "is_skin_fix"))
388 388
 			{
389 389
 				$oDB->addColumn('modules', 'is_skin_fix', 'char', 1, 'N');
390 390
 				$output = executeQuery('module.updateSkinFixModules');
391 391
 			}
392
-			if(!$oDB->isColumnExists("module_config", "site_srl"))
392
+			if (!$oDB->isColumnExists("module_config", "site_srl"))
393 393
 			{
394 394
 				$oDB->addColumn('module_config', 'site_srl', 'number', 11, 0, true);
395 395
 			}
396 396
 
397 397
 			$args->skin = '.';
398 398
 			$output = executeQueryArray('module.getModuleSkinDotList', $args);
399
-			if($output->data && count($output->data) > 0)
399
+			if ($output->data && count($output->data) > 0)
400 400
 			{
401
-				foreach($output->data as $item)
401
+				foreach ($output->data as $item)
402 402
 				{
403 403
 					$skin_path = explode('.', $item->skin);
404
-					if(count($skin_path) != 2) continue;
405
-					if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
404
+					if (count($skin_path) != 2) continue;
405
+					if (is_dir(sprintf(_XE_PATH_.'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
406 406
 					{
407 407
 						unset($args);
408 408
 						$args->skin = $item->skin;
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 			}
414 414
 
415 415
 			// XE 1.7
416
-			if(!$oDB->isColumnExists("modules", "is_mskin_fix"))
416
+			if (!$oDB->isColumnExists("modules", "is_mskin_fix"))
417 417
 			{
418 418
 				$oDB->addColumn('modules', 'is_mskin_fix', 'char', 1, 'N');
419 419
 				$output = executeQuery('module.updateMobileSkinFixModules');
@@ -421,18 +421,18 @@  discard block
 block discarded – undo
421 421
 
422 422
 			$oModuleModel = getModel('module');
423 423
 			$moduleConfig = $oModuleModel->getModuleConfig('module');
424
-			if(!$moduleConfig->isUpdateFixedValue)
424
+			if (!$moduleConfig->isUpdateFixedValue)
425 425
 			{
426 426
 				$output = executeQuery('module.updateSkinFixModules');
427 427
 				$output = executeQuery('module.updateMobileSkinFixModules');
428 428
 
429 429
 				$oModuleController = getController('module');
430
-				if(!$moduleConfig) $moduleConfig = new stdClass;
430
+				if (!$moduleConfig) $moduleConfig = new stdClass;
431 431
 				$moduleConfig->isUpdateFixedValue = TRUE;
432 432
 				$output = $oModuleController->updateModuleConfig('module', $moduleConfig);
433 433
 			}
434 434
 
435
-			if(!$oDB->isIndexExists("module_part_config", "unique_module_part_config"))
435
+			if (!$oDB->isIndexExists("module_part_config", "unique_module_part_config"))
436 436
 			{
437 437
 				$oDB->addIndex("module_part_config", "unique_module_part_config", array("module", "module_srl"), TRUE);
438 438
 			}
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 			$oModuleController->insertUpdatedLog($version_update_id);
441 441
 		}
442 442
 
443
-		if(!is_dir('./files/ruleset')) FileHandler::makeDir('./files/ruleset');
443
+		if (!is_dir('./files/ruleset')) FileHandler::makeDir('./files/ruleset');
444 444
 
445 445
 		return new BaseObject(0, 'success_updated');
446 446
 	}
@@ -448,18 +448,18 @@  discard block
 block discarded – undo
448 448
 	function updateForUniqueSiteDomain()
449 449
 	{
450 450
 		$output = executeQueryArray("module.getNonuniqueDomains");
451
-		if(!$output->data) return;
452
-		foreach($output->data as $data)
451
+		if (!$output->data) return;
452
+		foreach ($output->data as $data)
453 453
 		{
454
-			if($data->count == 1) continue;
454
+			if ($data->count == 1) continue;
455 455
 			$domain = $data->domain;
456 456
 			$args = new stdClass;
457 457
 			$args->domain = $domain;
458 458
 			$output2 = executeQueryArray("module.getSiteByDomain", $args);
459 459
 			$bFirst = true;
460
-			foreach($output2->data as $site)
460
+			foreach ($output2->data as $site)
461 461
 			{
462
-				if($bFirst)
462
+				if ($bFirst)
463 463
 				{
464 464
 					$bFirst = false;
465 465
 					continue;
Please login to merge, or discard this patch.
Braces   +117 added lines, -39 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 			$site_args->default_language = $db_info->lang_type;
42 42
 
43 43
 			$output = executeQuery('module.insertSite', $site_args);
44
-			if(!$output->toBool()) return $output;
44
+			if(!$output->toBool()) {
45
+				return $output;
46
+			}
45 47
 		}
46 48
 
47 49
 		return new BaseObject();
@@ -59,37 +61,65 @@  discard block
 block discarded – undo
59 61
 		if($oModuleModel->needUpdate($version_update_id))
60 62
 		{
61 63
 			// 2008. 10. 27 Add multi-index in the table, the module_part_config
62
-			if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) return true;
64
+			if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) {
65
+				return true;
66
+			}
63 67
 			// 2008. 11. 13 Delete unique constraint on mid in modules. Add site_srl and then create unique index on site_srl and mid
64
-			if(!$oDB->isIndexExists('modules',"idx_site_mid")) return true;
68
+			if(!$oDB->isIndexExists('modules',"idx_site_mid")) {
69
+				return true;
70
+			}
65 71
 			// Move permissions/skin information of all modules to the table, grants.
66
-			if($oDB->isColumnExists('modules', 'grants')) return true;
72
+			if($oDB->isColumnExists('modules', 'grants')) {
73
+				return true;
74
+			}
67 75
 			// Move permissions/skin information of all modules to the table, grants.
68
-			if(!$oDB->isColumnExists('sites', 'default_language')) return true;
76
+			if(!$oDB->isColumnExists('sites', 'default_language')) {
77
+				return true;
78
+			}
69 79
 			// Delete extra_vars* column
70 80
 			for($i=1;$i<=20;$i++)
71 81
 			{
72
-				if($oDB->isColumnExists("documents","extra_vars".$i)) return true;
82
+				if($oDB->isColumnExists("documents","extra_vars".$i)) {
83
+					return true;
84
+				}
73 85
 			}
74 86
 			// Insert site information to the table, sites
75 87
 			$args = new stdClass();
76 88
 			$args->site_srl = 0;
77 89
 			$output = $oDB->executeQuery('module.getSite', $args);
78
-			if(!$output->data) return true;
90
+			if(!$output->data) {
91
+				return true;
92
+			}
79 93
 
80 94
 			// If domain index is defined on the table, sites
81
-			if($oDB->isIndexExists('sites', 'idx_domain')) return true;
82
-			if(!$oDB->isIndexExists('sites','unique_domain')) return true;
95
+			if($oDB->isIndexExists('sites', 'idx_domain')) {
96
+				return true;
97
+			}
98
+			if(!$oDB->isIndexExists('sites','unique_domain')) {
99
+				return true;
100
+			}
83 101
 
84
-			if(!$oDB->isColumnExists("modules", "use_mobile")) return true;
85
-			if(!$oDB->isColumnExists("modules", "mlayout_srl")) return true;
86
-			if(!$oDB->isColumnExists("modules", "mcontent")) return true;
87
-			if(!$oDB->isColumnExists("modules", "mskin")) return true;
102
+			if(!$oDB->isColumnExists("modules", "use_mobile")) {
103
+				return true;
104
+			}
105
+			if(!$oDB->isColumnExists("modules", "mlayout_srl")) {
106
+				return true;
107
+			}
108
+			if(!$oDB->isColumnExists("modules", "mcontent")) {
109
+				return true;
110
+			}
111
+			if(!$oDB->isColumnExists("modules", "mskin")) {
112
+				return true;
113
+			}
88 114
 
89 115
 			// check fix skin
90
-			if(!$oDB->isColumnExists("modules", "is_skin_fix")) return true;
116
+			if(!$oDB->isColumnExists("modules", "is_skin_fix")) {
117
+				return true;
118
+			}
91 119
 
92
-			if(!$oDB->isColumnExists("module_config", "site_srl")) return true;
120
+			if(!$oDB->isColumnExists("module_config", "site_srl")) {
121
+				return true;
122
+			}
93 123
 
94 124
 			$args->skin = '.';
95 125
 			$output = executeQueryArray('module.getModuleSkinDotList', $args);
@@ -98,26 +128,38 @@  discard block
 block discarded – undo
98 128
 				foreach($output->data as $item)
99 129
 				{
100 130
 					$skin_path = explode('.', $item->skin);
101
-					if(count($skin_path) != 2) continue;
102
-					if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) return true;
131
+					if(count($skin_path) != 2) {
132
+						continue;
133
+					}
134
+					if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) {
135
+						return true;
136
+					}
103 137
 				}
104 138
 			}
105 139
 
106 140
 			// XE 1.7
107 141
 
108 142
 			// check fix mskin
109
-			if(!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
143
+			if(!$oDB->isColumnExists("modules", "is_mskin_fix")) {
144
+				return true;
145
+			}
110 146
 
111
-			if(!$oDB->isIndexExists("module_part_config", "unique_module_part_config")) return true;
147
+			if(!$oDB->isIndexExists("module_part_config", "unique_module_part_config")) {
148
+				return true;
149
+			}
112 150
 
113 151
 			$oModuleModel = getModel('module');
114 152
 			$moduleConfig = $oModuleModel->getModuleConfig('module');
115
-			if(!$moduleConfig->isUpdateFixedValue) return true;
153
+			if(!$moduleConfig->isUpdateFixedValue) {
154
+				return true;
155
+			}
116 156
 
117 157
 			$oModuleController->insertUpdatedLog($version_update_id);
118 158
 		}
119 159
 
120
-		if(!is_dir('./files/ruleset')) return true;
160
+		if(!is_dir('./files/ruleset')) {
161
+			return true;
162
+		}
121 163
 
122 164
 		return false;
123 165
 	}
@@ -142,7 +184,9 @@  discard block
 block discarded – undo
142 184
 				foreach($modules as $key => $module_info)
143 185
 				{
144 186
 					$module = $module_info->module;
145
-					if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) continue;
187
+					if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) {
188
+						continue;
189
+					}
146 190
 					$config = $oModuleModel->getModuleConfig($module);
147 191
 
148 192
 					$module_config = null;
@@ -163,7 +207,9 @@  discard block
 block discarded – undo
163 207
 							{
164 208
 								foreach($module_config as $key => $val)
165 209
 								{
166
-									if(isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
210
+									if(isset($module_config[$key]->module_srl)) {
211
+										unset($module_config[$key]->module_srl);
212
+									}
167 213
 								}
168 214
 							}
169 215
 							break;
@@ -173,7 +219,9 @@  discard block
 block discarded – undo
173 219
 							{
174 220
 								foreach($tmp as $k => $v)
175 221
 								{
176
-									if(!$v && !trim($v)) continue;
222
+									if(!$v && !trim($v)) {
223
+										continue;
224
+									}
177 225
 									$module_config[$k]->header_script = $v;
178 226
 								}
179 227
 							}
@@ -201,9 +249,13 @@  discard block
 block discarded – undo
201 249
 				$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"),true);
202 250
 			}
203 251
 			// document extra vars
204
-			if(!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
252
+			if(!$oDB->isTableExists('document_extra_vars')) {
253
+				$oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
254
+			}
205 255
 
206
-			if(!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
256
+			if(!$oDB->isTableExists('document_extra_keys')) {
257
+				$oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
258
+			}
207 259
 			// Move permission, skin info, extection info, admin ID of all modules to the table, grants
208 260
 			if($oDB->isColumnExists('modules', 'grants'))
209 261
 			{
@@ -221,10 +273,14 @@  discard block
 block discarded – undo
221 273
 						$module_srl = trim($module_info->module_srl);
222 274
 						// grant an authority
223 275
 						$grants = unserialize($module_info->grants);
224
-						if($grants) $oModuleController->insertModuleGrants($module_srl, $grants);
276
+						if($grants) {
277
+							$oModuleController->insertModuleGrants($module_srl, $grants);
278
+						}
225 279
 						// Insert skin vars
226 280
 						$skin_vars = unserialize($module_info->skin_vars);
227
-						if($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
281
+						if($skin_vars) {
282
+							$oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
283
+						}
228 284
 						// Insert super admin's ID
229 285
 						$admin_id = trim($module_info->admin_id);
230 286
 						if($admin_id && $admin_id != 'Array')
@@ -246,7 +302,9 @@  discard block
 block discarded – undo
246 302
 							$document_extra_keys = $extra_vars->extra_vars;
247 303
 							unset($extra_vars->extra_vars);
248 304
 						}
249
-						if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
305
+						if($extra_vars) {
306
+							$oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
307
+						}
250 308
 
251 309
 						/**
252 310
 						 * Move document extra vars(it should have conducted in the documents module however extra vars in modules table should be listed up in this module)
@@ -254,7 +312,9 @@  discard block
 block discarded – undo
254 312
 						// Insert extra vars if planet module is
255 313
 						if($module_info->module == 'planet')
256 314
 						{
257
-							if(!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
315
+							if(!$document_extra_keys || !is_array($document_extra_keys)) {
316
+								$document_extra_keys = array();
317
+							}
258 318
 							$planet_extra_keys->name = 'postscript';
259 319
 							$planet_extra_keys->type = 'text';
260 320
 							$planet_extra_keys->is_required = 'N';
@@ -293,10 +353,14 @@  discard block
 block discarded – undo
293 353
 									{
294 354
 										foreach ($output->data as $document)
295 355
 										{
296
-											if(!$document) continue;
356
+											if(!$document) {
357
+												continue;
358
+											}
297 359
 											foreach ($document as $key => $var)
298 360
 											{
299
-												if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') continue;
361
+												if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') {
362
+													continue;
363
+												}
300 364
 												$var_idx = str_replace('extra_vars','',$key);
301 365
 												$oDocumentController->insertDocumentExtraVar($module_srl, $document->document_srl, $var_idx, $var, 'extra_vars'.$var_idx, $lang_code);
302 366
 											}
@@ -333,7 +397,9 @@  discard block
 block discarded – undo
333 397
 			// extra_vars * Remove Column
334 398
 			for($i=1;$i<=20;$i++)
335 399
 			{
336
-				if(!$oDB->isColumnExists("documents","extra_vars".$i)) continue;
400
+				if(!$oDB->isColumnExists("documents","extra_vars".$i)) {
401
+					continue;
402
+				}
337 403
 				$oDB->dropColumn('documents','extra_vars'.$i);
338 404
 			}
339 405
 
@@ -355,7 +421,9 @@  discard block
 block discarded – undo
355 421
 				$site_args->default_language = $db_info->lang_type;
356 422
 
357 423
 				$output = executeQuery('module.insertSite', $site_args);
358
-				if(!$output->toBool()) return $output;
424
+				if(!$output->toBool()) {
425
+					return $output;
426
+				}
359 427
 			}
360 428
 
361 429
 			if($oDB->isIndexExists('sites','idx_domain'))
@@ -401,7 +469,9 @@  discard block
 block discarded – undo
401 469
 				foreach($output->data as $item)
402 470
 				{
403 471
 					$skin_path = explode('.', $item->skin);
404
-					if(count($skin_path) != 2) continue;
472
+					if(count($skin_path) != 2) {
473
+						continue;
474
+					}
405 475
 					if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
406 476
 					{
407 477
 						unset($args);
@@ -427,7 +497,9 @@  discard block
 block discarded – undo
427 497
 				$output = executeQuery('module.updateMobileSkinFixModules');
428 498
 
429 499
 				$oModuleController = getController('module');
430
-				if(!$moduleConfig) $moduleConfig = new stdClass;
500
+				if(!$moduleConfig) {
501
+					$moduleConfig = new stdClass;
502
+				}
431 503
 				$moduleConfig->isUpdateFixedValue = TRUE;
432 504
 				$output = $oModuleController->updateModuleConfig('module', $moduleConfig);
433 505
 			}
@@ -440,7 +512,9 @@  discard block
 block discarded – undo
440 512
 			$oModuleController->insertUpdatedLog($version_update_id);
441 513
 		}
442 514
 
443
-		if(!is_dir('./files/ruleset')) FileHandler::makeDir('./files/ruleset');
515
+		if(!is_dir('./files/ruleset')) {
516
+			FileHandler::makeDir('./files/ruleset');
517
+		}
444 518
 
445 519
 		return new BaseObject(0, 'success_updated');
446 520
 	}
@@ -448,10 +522,14 @@  discard block
 block discarded – undo
448 522
 	function updateForUniqueSiteDomain()
449 523
 	{
450 524
 		$output = executeQueryArray("module.getNonuniqueDomains");
451
-		if(!$output->data) return;
525
+		if(!$output->data) {
526
+			return;
527
+		}
452 528
 		foreach($output->data as $data)
453 529
 		{
454
-			if($data->count == 1) continue;
530
+			if($data->count == 1) {
531
+				continue;
532
+			}
455 533
 			$domain = $data->domain;
456 534
 			$args = new stdClass;
457 535
 			$args->domain = $domain;
Please login to merge, or discard this patch.