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
Pull Request — develop (#1930)
by
unknown
12:28
created
modules/poll/poll.model.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$args = new stdClass;
23 23
 		$args->poll_srl = $poll_srl;
24 24
 
25
-		if(Context::get('is_logged'))
25
+		if (Context::get('is_logged'))
26 26
 		{
27 27
 			$logged_info = Context::get('logged_info');
28 28
 			$args->member_srl = $logged_info->member_srl;
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			$args->ipaddress = $_SERVER['REMOTE_ADDR'];
33 33
 		}
34 34
 		$output = executeQuery('poll.getPollLog', $args);
35
-		if($output->data->count) return true;
35
+		if ($output->data->count) return true;
36 36
 		return false;
37 37
 	}
38 38
 
@@ -47,20 +47,20 @@  discard block
 block discarded – undo
47 47
 		// Get the information related to the survey
48 48
 		$columnList = array('poll_count', 'stop_date');
49 49
 		$output = executeQuery('poll.getPoll', $args, $columnList);
50
-		if(!$output->data) return '';
50
+		if (!$output->data) return '';
51 51
 
52 52
 		$poll = new stdClass;
53 53
 		$poll->style = $style;
54
-		$poll->poll_count = (int)$output->data->poll_count;
54
+		$poll->poll_count = (int) $output->data->poll_count;
55 55
 		$poll->stop_date = $output->data->stop_date;
56 56
 
57 57
 		$columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count');
58 58
 		$output = executeQuery('poll.getPollTitle', $args, $columnList);
59
-		if(!$output->data) return;
60
-		if(!is_array($output->data)) $output->data = array($output->data);
59
+		if (!$output->data) return;
60
+		if (!is_array($output->data)) $output->data = array($output->data);
61 61
 
62 62
 		$poll->poll = array();
63
-		foreach($output->data as $key => $val)
63
+		foreach ($output->data as $key => $val)
64 64
 		{
65 65
 			$poll->poll[$val->poll_index_srl] = new stdClass;
66 66
 			$poll->poll[$val->poll_index_srl]->title = $val->title;
@@ -69,16 +69,16 @@  discard block
 block discarded – undo
69 69
 		}
70 70
 
71 71
 		$output = executeQuery('poll.getPollItem', $args);
72
-		foreach($output->data as $key => $val)
72
+		foreach ($output->data as $key => $val)
73 73
 		{
74 74
 			$poll->poll[$val->poll_index_srl]->item[] = $val;
75 75
 		}
76 76
 
77 77
 		$poll->poll_srl = $poll_srl;
78 78
 		// Only ongoing poll results
79
-		if($poll->stop_date >= date("Ymd"))
79
+		if ($poll->stop_date >= date("Ymd"))
80 80
 		{
81
-			if($this->isPolled($poll_srl)) $tpl_file = "result";
81
+			if ($this->isPolled($poll_srl)) $tpl_file = "result";
82 82
 			else $tpl_file = "form";
83 83
 		}
84 84
 		else
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 			$tpl_file = "result";
87 87
 		}
88 88
 
89
-		Context::set('poll',$poll);
90
-		Context::set('skin',$skin);
89
+		Context::set('poll', $poll);
90
+		Context::set('skin', $skin);
91 91
 		// The skin for the default configurations, and the colorset configurations
92 92
 		$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
93 93
 
@@ -104,20 +104,20 @@  discard block
 block discarded – undo
104 104
 		$args->poll_srl = $poll_srl;
105 105
 		// Get the information related to the survey
106 106
 		$output = executeQuery('poll.getPoll', $args);
107
-		if(!$output->data) return '';
107
+		if (!$output->data) return '';
108 108
 
109 109
 		$poll = new stdClass;
110 110
 		$poll->style = $style;
111
-		$poll->poll_count = (int)$output->data->poll_count;
111
+		$poll->poll_count = (int) $output->data->poll_count;
112 112
 		$poll->stop_date = $output->data->stop_date;
113 113
 
114 114
 		$columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count');
115 115
 		$output = executeQuery('poll.getPollTitle', $args, $columnList);
116
-		if(!$output->data) return;
117
-		if(!is_array($output->data)) $output->data = array($output->data);
116
+		if (!$output->data) return;
117
+		if (!is_array($output->data)) $output->data = array($output->data);
118 118
 
119 119
 		$poll->poll = array();
120
-		foreach($output->data as $key => $val)
120
+		foreach ($output->data as $key => $val)
121 121
 		{
122 122
 			$poll->poll[$val->poll_index_srl] = new stdClass;
123 123
 			$poll->poll[$val->poll_index_srl]->title = $val->title;
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 		}
127 127
 
128 128
 		$output = executeQuery('poll.getPollItem', $args);
129
-		foreach($output->data as $key => $val)
129
+		foreach ($output->data as $key => $val)
130 130
 		{
131 131
 			$poll->poll[$val->poll_index_srl]->item[] = $val;
132 132
 		}
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
 		$tpl_file = "result";
137 137
 
138
-		Context::set('poll',$poll);
138
+		Context::set('poll', $poll);
139 139
 		// The skin for the default configurations, and the colorset configurations
140 140
 		$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
141 141
 
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
 		$oModuleModel = getModel('module');
153 153
 		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
154 154
 
155
-		for($i=0;$i<count($skin_info->colorset);$i++)
155
+		for ($i = 0; $i < count($skin_info->colorset); $i++)
156 156
 		{
157 157
 			$colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title);
158 158
 			$colorset_list[] = $colorset;
159 159
 		}
160 160
 
161
-		if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
161
+		if (count($colorset_list)) $colorsets = implode("\n", $colorset_list);
162 162
 		$this->add('colorset_list', $colorsets);
163 163
 	}
164 164
 }
Please login to merge, or discard this patch.
Braces   +31 added lines, -14 removed lines patch added patch discarded remove patch
@@ -26,13 +26,14 @@  discard block
 block discarded – undo
26 26
 		{
27 27
 			$logged_info = Context::get('logged_info');
28 28
 			$args->member_srl = $logged_info->member_srl;
29
-		}
30
-		else
29
+		} else
31 30
 		{
32 31
 			$args->ipaddress = $_SERVER['REMOTE_ADDR'];
33 32
 		}
34 33
 		$output = executeQuery('poll.getPollLog', $args);
35
-		if($output->data->count) return true;
34
+		if($output->data->count) {
35
+			return true;
36
+		}
36 37
 		return false;
37 38
 	}
38 39
 
@@ -47,7 +48,9 @@  discard block
 block discarded – undo
47 48
 		// Get the information related to the survey
48 49
 		$columnList = array('poll_count', 'stop_date');
49 50
 		$output = executeQuery('poll.getPoll', $args, $columnList);
50
-		if(!$output->data) return '';
51
+		if(!$output->data) {
52
+			return '';
53
+		}
51 54
 
52 55
 		$poll = new stdClass;
53 56
 		$poll->style = $style;
@@ -56,8 +59,12 @@  discard block
 block discarded – undo
56 59
 
57 60
 		$columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count');
58 61
 		$output = executeQuery('poll.getPollTitle', $args, $columnList);
59
-		if(!$output->data) return;
60
-		if(!is_array($output->data)) $output->data = array($output->data);
62
+		if(!$output->data) {
63
+			return;
64
+		}
65
+		if(!is_array($output->data)) {
66
+			$output->data = array($output->data);
67
+		}
61 68
 
62 69
 		$poll->poll = array();
63 70
 		foreach($output->data as $key => $val)
@@ -78,10 +85,12 @@  discard block
 block discarded – undo
78 85
 		// Only ongoing poll results
79 86
 		if($poll->stop_date >= date("Ymd"))
80 87
 		{
81
-			if($this->isPolled($poll_srl)) $tpl_file = "result";
82
-			else $tpl_file = "form";
83
-		}
84
-		else
88
+			if($this->isPolled($poll_srl)) {
89
+				$tpl_file = "result";
90
+			} else {
91
+				$tpl_file = "form";
92
+			}
93
+		} else
85 94
 		{
86 95
 			$tpl_file = "result";
87 96
 		}
@@ -104,7 +113,9 @@  discard block
 block discarded – undo
104 113
 		$args->poll_srl = $poll_srl;
105 114
 		// Get the information related to the survey
106 115
 		$output = executeQuery('poll.getPoll', $args);
107
-		if(!$output->data) return '';
116
+		if(!$output->data) {
117
+			return '';
118
+		}
108 119
 
109 120
 		$poll = new stdClass;
110 121
 		$poll->style = $style;
@@ -113,8 +124,12 @@  discard block
 block discarded – undo
113 124
 
114 125
 		$columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count');
115 126
 		$output = executeQuery('poll.getPollTitle', $args, $columnList);
116
-		if(!$output->data) return;
117
-		if(!is_array($output->data)) $output->data = array($output->data);
127
+		if(!$output->data) {
128
+			return;
129
+		}
130
+		if(!is_array($output->data)) {
131
+			$output->data = array($output->data);
132
+		}
118 133
 
119 134
 		$poll->poll = array();
120 135
 		foreach($output->data as $key => $val)
@@ -158,7 +173,9 @@  discard block
 block discarded – undo
158 173
 			$colorset_list[] = $colorset;
159 174
 		}
160 175
 
161
-		if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
176
+		if(count($colorset_list)) {
177
+			$colorsets = implode("\n", $colorset_list);
178
+		}
162 179
 		$this->add('colorset_list', $colorsets);
163 180
 	}
164 181
 }
Please login to merge, or discard this patch.
modules/rss/rss.admin.view.php 2 patches
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,9 +44,14 @@  discard block
 block discarded – undo
44 44
 					$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
45 45
 					$columnList = array('sites.domain');
46 46
 					$site = $oModuleModel->getSiteInfo($module_info->site_srl, $columnList);
47
-					if(!strpos($site->domain, '.')) $vid = $site->domain;
48
-					else $site = null;
49
-					if($site) $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss');
47
+					if(!strpos($site->domain, '.')) {
48
+						$vid = $site->domain;
49
+					} else {
50
+						$site = null;
51
+					}
52
+					if($site) {
53
+						$feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss');
54
+					}
50 55
 					$feed_config[$module_srl]['mid'] = $module_info->mid;
51 56
 					$feed_config[$module_srl]['open_feed'] = $config->open_rss;
52 57
 					$feed_config[$module_srl]['open_total_feed'] = $config->open_total_feed;
@@ -54,7 +59,9 @@  discard block
 block discarded – undo
54 59
 				}
55 60
 			}
56 61
 		}
57
-		if(!$total_config->feed_document_count) $total_config->feed_document_count = 15;
62
+		if(!$total_config->feed_document_count) {
63
+			$total_config->feed_document_count = 15;
64
+		}
58 65
 		$total_config->url = $oRssModel->getModuleFeedUrl(NULL, '', 'rss', true);
59 66
 
60 67
 		Context::set('feed_config', $feed_config);
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,25 +28,25 @@  discard block
 block discarded – undo
28 28
 		$oModuleModel = getModel('module');
29 29
 		$rss_config = $oModuleModel->getModulePartConfigs('rss');
30 30
 		$total_config = $oModuleModel->getModuleConfig('rss');
31
-		if(!$total_config)
31
+		if (!$total_config)
32 32
 		{
33 33
 			$total_config = new stdClass();
34 34
 		}
35 35
 		$oRssModel = getModel('rss');
36 36
 
37
-		if($rss_config)
37
+		if ($rss_config)
38 38
 		{
39 39
 			$feed_config = array();
40
-			foreach($rss_config as $module_srl => $config)
40
+			foreach ($rss_config as $module_srl => $config)
41 41
 			{
42
-				if($config)
42
+				if ($config)
43 43
 				{
44 44
 					$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
45 45
 					$columnList = array('sites.domain');
46 46
 					$site = $oModuleModel->getSiteInfo($module_info->site_srl, $columnList);
47
-					if(!strpos($site->domain, '.')) $vid = $site->domain;
47
+					if (!strpos($site->domain, '.')) $vid = $site->domain;
48 48
 					else $site = null;
49
-					if($site) $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss');
49
+					if ($site) $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss');
50 50
 					$feed_config[$module_srl]['mid'] = $module_info->mid;
51 51
 					$feed_config[$module_srl]['open_feed'] = $config->open_rss;
52 52
 					$feed_config[$module_srl]['open_total_feed'] = $config->open_total_feed;
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
 				}
55 55
 			}
56 56
 		}
57
-		if(!$total_config->feed_document_count) $total_config->feed_document_count = 15;
57
+		if (!$total_config->feed_document_count) $total_config->feed_document_count = 15;
58 58
 		$total_config->url = $oRssModel->getModuleFeedUrl(NULL, '', 'rss', true);
59 59
 
60 60
 		Context::set('feed_config', $feed_config);
61 61
 		Context::set('total_config', $total_config);
62 62
 
63 63
 		$security = new Security();
64
-		$security->encodeHTML('feed_config..mid','feed_config..url');
64
+		$security->encodeHTML('feed_config..mid', 'feed_config..url');
65 65
 		$security->encodeHTML('total_config..');
66 66
 
67 67
 		$this->setTemplatePath($this->module_path.'tpl');
Please login to merge, or discard this patch.
modules/rss/rss.class.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,16 +35,16 @@  discard block
 block discarded – undo
35 35
 	{
36 36
 		$oModuleModel = getModel('module');
37 37
 		// Add the Action forward for atom
38
-		if(!$oModuleModel->getActionForward('atom')) return true;
38
+		if (!$oModuleModel->getActionForward('atom')) return true;
39 39
 		// 2007. 10. Add a trigger for participating additional configurations of the service module
40
-		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) return true;
40
+		if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) return true;
41 41
 		// 2007. 10. 19 Call the trigger to set RSS URL before outputing
42
-		if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) return true;
42
+		if (!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) return true;
43 43
 
44
-		if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) return true;
44
+		if ($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) return true;
45 45
 
46 46
 		// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
47
-		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after')) return true;
47
+		if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after')) return true;
48 48
 
49 49
 		return false;
50 50
 	}
@@ -59,19 +59,19 @@  discard block
 block discarded – undo
59 59
 		$oModuleModel = getModel('module');
60 60
 		$oModuleController = getController('module');
61 61
 		// Add atom act
62
-		if(!$oModuleModel->getActionForward('atom'))
62
+		if (!$oModuleModel->getActionForward('atom'))
63 63
 			$oModuleController->insertActionForward('rss', 'view', 'atom');
64 64
 		// 2007. 10. An additional set of 18 to participate in a service module, add a trigger
65
-		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) 
65
+		if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) 
66 66
 			$oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
67 67
 		// 2007. 10. 19 outputs the trigger before you call to set up rss url
68
-		if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) 
68
+		if (!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) 
69 69
 			$oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
70
-		if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before'))
70
+		if ($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before'))
71 71
 			$oModuleController->deleteTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before');
72 72
 
73 73
 		// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
74
-		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after'))
74
+		if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after'))
75 75
 		{
76 76
 			$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after');
77 77
 		}
Please login to merge, or discard this patch.
Braces   +27 added lines, -13 removed lines patch added patch discarded remove patch
@@ -35,16 +35,26 @@  discard block
 block discarded – undo
35 35
 	{
36 36
 		$oModuleModel = getModel('module');
37 37
 		// Add the Action forward for atom
38
-		if(!$oModuleModel->getActionForward('atom')) return true;
38
+		if(!$oModuleModel->getActionForward('atom')) {
39
+			return true;
40
+		}
39 41
 		// 2007. 10. Add a trigger for participating additional configurations of the service module
40
-		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) return true;
42
+		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) {
43
+			return true;
44
+		}
41 45
 		// 2007. 10. 19 Call the trigger to set RSS URL before outputing
42
-		if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) return true;
46
+		if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) {
47
+			return true;
48
+		}
43 49
 
44
-		if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) return true;
50
+		if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) {
51
+			return true;
52
+		}
45 53
 
46 54
 		// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
47
-		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after')) return true;
55
+		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after')) {
56
+			return true;
57
+		}
48 58
 
49 59
 		return false;
50 60
 	}
@@ -59,16 +69,20 @@  discard block
 block discarded – undo
59 69
 		$oModuleModel = getModel('module');
60 70
 		$oModuleController = getController('module');
61 71
 		// Add atom act
62
-		if(!$oModuleModel->getActionForward('atom'))
63
-			$oModuleController->insertActionForward('rss', 'view', 'atom');
72
+		if(!$oModuleModel->getActionForward('atom')) {
73
+					$oModuleController->insertActionForward('rss', 'view', 'atom');
74
+		}
64 75
 		// 2007. 10. An additional set of 18 to participate in a service module, add a trigger
65
-		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) 
66
-			$oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
76
+		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) {
77
+					$oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
78
+		}
67 79
 		// 2007. 10. 19 outputs the trigger before you call to set up rss url
68
-		if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) 
69
-			$oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
70
-		if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before'))
71
-			$oModuleController->deleteTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before');
80
+		if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) {
81
+					$oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
82
+		}
83
+		if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) {
84
+					$oModuleController->deleteTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before');
85
+		}
72 86
 
73 87
 		// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
74 88
 		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after'))
Please login to merge, or discard this patch.
modules/rss/rss.controller.php 2 patches
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,9 @@  discard block
 block discarded – undo
37 37
 			$current_module_srl = $current_module_info->module_srl;
38 38
 		}
39 39
 
40
-		if(!$current_module_srl) return new Object();
40
+		if(!$current_module_srl) {
41
+			return new Object();
42
+		}
41 43
 		// Imported rss settings of the selected module
42 44
 		$oRssModel = getModel('rss');
43 45
 		$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
@@ -55,8 +57,7 @@  discard block
 block discarded – undo
55 57
 				$request_uri = Context::getRequestUri();
56 58
 				Context::set('general_rss_url', $request_uri.'rss');
57 59
 				Context::set('general_atom_url', $request_uri.'atom');
58
-			}
59
-			else
60
+			} else
60 61
 			{
61 62
 				Context::set('general_rss_url', getUrl('','module','rss','act','rss'));
62 63
 				Context::set('general_atom_url', getUrl('','module','rss','act','atom'));
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,29 +28,29 @@  discard block
 block discarded – undo
28 28
 		$current_module_srl = Context::get('module_srl');
29 29
 		$site_module_info = Context::get('site_module_info');
30 30
 
31
-		if(is_array($current_module_srl))
31
+		if (is_array($current_module_srl))
32 32
 		{
33 33
 			unset($current_module_srl);
34 34
 		}
35
-		if(!$current_module_srl) {
35
+		if (!$current_module_srl) {
36 36
 			$current_module_info = Context::get('current_module_info');
37 37
 			$current_module_srl = $current_module_info->module_srl;
38 38
 		}
39 39
 
40
-		if(!$current_module_srl) return new Object();
40
+		if (!$current_module_srl) return new Object();
41 41
 		// Imported rss settings of the selected module
42 42
 		$oRssModel = getModel('rss');
43 43
 		$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
44 44
 
45
-		if($rss_config->open_rss != 'N')
45
+		if ($rss_config->open_rss != 'N')
46 46
 		{
47 47
 			Context::set('rss_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'rss'));
48 48
 			Context::set('atom_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'atom'));
49 49
 		}
50 50
 
51
-		if(Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N')
51
+		if (Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N')
52 52
 		{
53
-			if(Context::isAllowRewrite() && !Context::get('vid'))
53
+			if (Context::isAllowRewrite() && !Context::get('vid'))
54 54
 			{
55 55
 				$request_uri = Context::getRequestUri();
56 56
 				Context::set('general_rss_url', $request_uri.'rss');
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 			}
59 59
 			else
60 60
 			{
61
-				Context::set('general_rss_url', getUrl('','module','rss','act','rss'));
62
-				Context::set('general_atom_url', getUrl('','module','rss','act','atom'));
61
+				Context::set('general_rss_url', getUrl('', 'module', 'rss', 'act', 'rss'));
62
+				Context::set('general_atom_url', getUrl('', 'module', 'rss', 'act', 'atom'));
63 63
 			}
64 64
 		}
65 65
 
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
 		$rssConfig = $oModuleModel->getModulePartConfig('rss', $obj->originModuleSrl);
73 73
 
74 74
 		$oModuleController = getController('module');
75
-		if(is_array($obj->moduleSrlList))
75
+		if (is_array($obj->moduleSrlList))
76 76
 		{
77
-			foreach($obj->moduleSrlList AS $key=>$moduleSrl)
77
+			foreach ($obj->moduleSrlList AS $key=>$moduleSrl)
78 78
 			{
79 79
 				$oModuleController->insertModulePartConfig('rss', $moduleSrl, $rssConfig);
80 80
 			}
Please login to merge, or discard this patch.
modules/rss/rss.model.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	function getModuleFeedUrl($vid, $mid, $format = 'rss', $absolute_url = false)
20 20
 	{
21
-		if($absolute_url)
21
+		if ($absolute_url)
22 22
 		{
23
-			return getFullUrl('','vid',$vid, 'mid',$mid, 'act',$format);
23
+			return getFullUrl('', 'vid', $vid, 'mid', $mid, 'act', $format);
24 24
 		}
25 25
 		else
26 26
 		{
27
-			return getUrl('','vid',$vid, 'mid',$mid, 'act',$format);
27
+			return getUrl('', 'vid', $vid, 'mid', $mid, 'act', $format);
28 28
 		}
29 29
 	}
30 30
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		// Get the configurations of the rss module
40 40
 		$oModuleModel = getModel('module');
41 41
 		$module_rss_config = $oModuleModel->getModulePartConfig('rss', $module_srl);
42
-		if(!$module_rss_config)
42
+		if (!$module_rss_config)
43 43
 		{
44 44
 			$module_rss_config = new stdClass();
45 45
 			$module_rss_config->open_rss = 'N';
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
21 21
 		if($absolute_url)
22 22
 		{
23 23
 			return getFullUrl('','vid',$vid, 'mid',$mid, 'act',$format);
24
-		}
25
-		else
24
+		} else
26 25
 		{
27 26
 			return getUrl('','vid',$vid, 'mid',$mid, 'act',$format);
28 27
 		}
Please login to merge, or discard this patch.
modules/rss/rss.view.php 2 patches
Braces   +43 added lines, -21 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
 					$open_rss_config[$module_srl] = $config->open_rss;
54 54
 				}
55 55
 				// If mid is not selected, then get all
56
-			}
57
-			else
56
+			} else
58 57
 			{
59 58
 				if($total_config->use_total_feed != 'N')
60 59
 				{
@@ -73,7 +72,9 @@  discard block
 block discarded – undo
73 72
 				}
74 73
 			}
75 74
 
76
-			if(!count($module_srls) && !$add_description) return $this->dispError();
75
+			if(!count($module_srls) && !$add_description) {
76
+				return $this->dispError();
77
+			}
77 78
 
78 79
 			$info = new stdClass;
79 80
 			$args = new stdClass;
@@ -87,12 +88,24 @@  discard block
 block discarded – undo
87 88
 				$args->search_keyword = 'N';
88 89
 				$args->page = (int)Context::get('page');
89 90
 				$args->list_count = 15;
90
-				if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count;
91
-				if(!$args->page || $args->page < 1) $args->page = 1;
92
-				if($start_date || $start_date != 0) $args->start_date = $start_date;
93
-				if($end_date || $end_date != 0) $args->end_date = $end_date;
94
-				if($start_date == 0) unset($start_date);
95
-				if($end_date == 0) unset($end_date);
91
+				if($total_config->feed_document_count) {
92
+					$args->list_count = $total_config->feed_document_count;
93
+				}
94
+				if(!$args->page || $args->page < 1) {
95
+					$args->page = 1;
96
+				}
97
+				if($start_date || $start_date != 0) {
98
+					$args->start_date = $start_date;
99
+				}
100
+				if($end_date || $end_date != 0) {
101
+					$args->end_date = $end_date;
102
+				}
103
+				if($start_date == 0) {
104
+					unset($start_date);
105
+				}
106
+				if($end_date == 0) {
107
+					unset($end_date);
108
+				}
96 109
 
97 110
 				$args->sort_index = 'list_order'; 
98 111
 				$args->order_type = 'asc';
@@ -108,8 +121,7 @@  discard block
 block discarded – undo
108 121
 					if($config->feed_description)
109 122
 					{
110 123
 						$info->description = str_replace('\'', '&apos;', htmlspecialchars($config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
111
-					}
112
-					else
124
+					} else
113 125
 					{
114 126
 						$info->description = str_replace('\'', '&apos;', htmlspecialchars($this->module_info->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
115 127
 					}
@@ -125,9 +137,11 @@  discard block
 block discarded – undo
125 137
 
126 138
 		if(!$info->title)
127 139
 		{
128
-			if($rss_title) $info->title = $rss_title;
129
-			else if($total_config->feed_title) $info->title = $total_config->feed_title;
130
-			else
140
+			if($rss_title) {
141
+				$info->title = $rss_title;
142
+			} else if($total_config->feed_title) {
143
+				$info->title = $total_config->feed_title;
144
+			} else
131 145
 			{
132 146
 				$site_module_info = Context::get('site_module_info');
133 147
 				$info->title = $site_module_info->browser_title;
@@ -139,15 +153,18 @@  discard block
 block discarded – undo
139 153
 			$info->link = Context::getRequestUri();
140 154
 			$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
141 155
 		}
142
-		if($add_description) $info->description .= "\r\n".$add_description;
156
+		if($add_description) {
157
+			$info->description .= "\r\n".$add_description;
158
+		}
143 159
 
144
-		if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', '&apos;', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
160
+		if($total_config->image) {
161
+			$info->image = Context::getRequestUri().str_replace('\'', '&apos;', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
162
+		}
145 163
 		switch(Context::get('format'))
146 164
 		{
147 165
 			case 'atom':
148 166
 				$info->date = date('Y-m-d\TH:i:sP');
149
-				if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
150
-				else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
167
+				if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
151 168
 				break;
152 169
 			case 'rss1.0':
153 170
 				$info->date = date('Y-m-d\TH:i:sP');
@@ -157,8 +174,11 @@  discard block
 block discarded – undo
157 174
 				break;
158 175
 		}
159 176
 
160
-		if($_SERVER['HTTPS']=='on') $proctcl = 'https://';
161
-		else $proctcl = 'http://';
177
+		if($_SERVER['HTTPS']=='on') {
178
+			$proctcl = 'https://';
179
+		} else {
180
+			$proctcl = 'http://';
181
+		}
162 182
 
163 183
 		$temp_link = explode('/', $info->link);
164 184
 		if($temp_link[0]=='' && $info->link)
@@ -248,7 +268,9 @@  discard block
 block discarded – undo
248 268
 			// Get information of the selected module
249 269
 			$current_module_info = Context::get('current_module_info');
250 270
 			$current_module_srl = $current_module_info->module_srl;
251
-			if(!$current_module_srl) return new Object();
271
+			if(!$current_module_srl) {
272
+				return new Object();
273
+			}
252 274
 		}
253 275
 		// Get teh RSS configurations for the selected module
254 276
 		$oRssModel = getModel('rss');
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -30,24 +30,24 @@  discard block
 block discarded – undo
30 30
 		$oModuleModel = getModel('module');
31 31
 		$oModuleController = getController('module');
32 32
 		// Get the content and information for the current requested module if the method is not called from another module
33
-		if(!$document_list)
33
+		if (!$document_list)
34 34
 		{
35 35
 			$site_module_info = Context::get('site_module_info');
36 36
 			$site_srl = $site_module_info->site_srl;
37 37
 			$mid = Context::get('mid'); // The target module id, if absent, then all
38
-			$start_date = (int)Context::get('start_date');
39
-			$end_date = (int)Context::get('end_date');
38
+			$start_date = (int) Context::get('start_date');
39
+			$end_date = (int) Context::get('end_date');
40 40
 
41 41
 			$module_srls = array();
42 42
 			$rss_config = array();
43 43
 			$total_config = '';
44 44
 			$total_config = $oModuleModel->getModuleConfig('rss');
45 45
 			// If one is specified, extract only for this mid
46
-			if($mid)
46
+			if ($mid)
47 47
 			{
48 48
 				$module_srl = $this->module_info->module_srl;
49 49
 				$config = $oModuleModel->getModulePartConfig('rss', $module_srl);
50
-				if($config->open_rss && $config->open_rss != 'N')
50
+				if ($config->open_rss && $config->open_rss != 'N')
51 51
 				{
52 52
 					$module_srls[] = $module_srl; 
53 53
 					$open_rss_config[$module_srl] = $config->open_rss;
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
 			}
57 57
 			else
58 58
 			{
59
-				if($total_config->use_total_feed != 'N')
59
+				if ($total_config->use_total_feed != 'N')
60 60
 				{
61 61
 					$rss_config = $oModuleModel->getModulePartConfigs('rss', $site_srl);
62
-					if($rss_config)
62
+					if ($rss_config)
63 63
 					{
64
-						foreach($rss_config as $module_srl => $config)
64
+						foreach ($rss_config as $module_srl => $config)
65 65
 						{
66
-							if($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N')
66
+							if ($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N')
67 67
 							{
68 68
 								$module_srls[] = $module_srl;
69 69
 								$open_rss_config[$module_srl] = $config->open_rss;
@@ -73,39 +73,39 @@  discard block
 block discarded – undo
73 73
 				}
74 74
 			}
75 75
 
76
-			if(!count($module_srls) && !$add_description) return $this->dispError();
76
+			if (!count($module_srls) && !$add_description) return $this->dispError();
77 77
 
78 78
 			$info = new stdClass;
79 79
 			$args = new stdClass;
80 80
 
81
-			if($module_srls)
81
+			if ($module_srls)
82 82
 			{
83
-				$args->module_srl = implode(',',$module_srls);
83
+				$args->module_srl = implode(',', $module_srls);
84 84
 				//$module_list = $oModuleModel->getMidList($args);	//perhaps module_list varialbles not use
85 85
 
86 86
 				$args->search_target = 'is_secret';
87 87
 				$args->search_keyword = 'N';
88
-				$args->page = (int)Context::get('page');
88
+				$args->page = (int) Context::get('page');
89 89
 				$args->list_count = 15;
90
-				if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count;
91
-				if(!$args->page || $args->page < 1) $args->page = 1;
92
-				if($start_date || $start_date != 0) $args->start_date = $start_date;
93
-				if($end_date || $end_date != 0) $args->end_date = $end_date;
94
-				if($start_date == 0) unset($start_date);
95
-				if($end_date == 0) unset($end_date);
90
+				if ($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count;
91
+				if (!$args->page || $args->page < 1) $args->page = 1;
92
+				if ($start_date || $start_date != 0) $args->start_date = $start_date;
93
+				if ($end_date || $end_date != 0) $args->end_date = $end_date;
94
+				if ($start_date == 0) unset($start_date);
95
+				if ($end_date == 0) unset($end_date);
96 96
 
97 97
 				$args->sort_index = 'list_order'; 
98 98
 				$args->order_type = 'asc';
99 99
 				$output = $oDocumentModel->getDocumentList($args);
100 100
 				$document_list = $output->data;
101 101
 				// Extract the feed title and information with Context::getBrowserTitle
102
-				if($mid)
102
+				if ($mid)
103 103
 				{
104 104
 					$info->title = Context::getBrowserTitle();
105 105
 					$oModuleController->replaceDefinedLangCode($info->title);
106 106
 
107
-					$info->title = str_replace('\'', '&apos;',$info->title);
108
-					if($config->feed_description)
107
+					$info->title = str_replace('\'', '&apos;', $info->title);
108
+					if ($config->feed_description)
109 109
 					{
110 110
 						$info->description = str_replace('\'', '&apos;', htmlspecialchars($config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
111 111
 					}
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 					{
114 114
 						$info->description = str_replace('\'', '&apos;', htmlspecialchars($this->module_info->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
115 115
 					}
116
-					$info->link = getUrl('','mid',$mid);
116
+					$info->link = getUrl('', 'mid', $mid);
117 117
 					$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($feed_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
118
-					if(!$info->feed_copyright)
118
+					if (!$info->feed_copyright)
119 119
 					{
120 120
 						$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
121 121
 					}
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
 			}
124 124
 		}
125 125
 
126
-		if(!$info->title)
126
+		if (!$info->title)
127 127
 		{
128
-			if($rss_title) $info->title = $rss_title;
129
-			else if($total_config->feed_title) $info->title = $total_config->feed_title;
128
+			if ($rss_title) $info->title = $rss_title;
129
+			else if ($total_config->feed_title) $info->title = $total_config->feed_title;
130 130
 			else
131 131
 			{
132 132
 				$site_module_info = Context::get('site_module_info');
@@ -139,15 +139,15 @@  discard block
 block discarded – undo
139 139
 			$info->link = Context::getRequestUri();
140 140
 			$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
141 141
 		}
142
-		if($add_description) $info->description .= "\r\n".$add_description;
142
+		if ($add_description) $info->description .= "\r\n".$add_description;
143 143
 
144
-		if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', '&apos;', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
145
-		switch(Context::get('format'))
144
+		if ($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', '&apos;', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
145
+		switch (Context::get('format'))
146 146
 		{
147 147
 			case 'atom':
148 148
 				$info->date = date('Y-m-d\TH:i:sP');
149
-				if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
150
-				else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
149
+				if ($mid) { $info->id = getUrl('', 'mid', $mid, 'act', 'atom', 'page', Context::get('page'), 'start_date', Context::get('start_date'), 'end_date', Context::get('end_date')); }
150
+				else { $info->id = getUrl('', 'module', 'rss', 'act', 'atom', 'page', Context::get('page'), 'start_date', Context::get('start_date'), 'end_date', Context::get('end_date')); }
151 151
 				break;
152 152
 			case 'rss1.0':
153 153
 				$info->date = date('Y-m-d\TH:i:sP');
@@ -157,22 +157,22 @@  discard block
 block discarded – undo
157 157
 				break;
158 158
 		}
159 159
 
160
-		if($_SERVER['HTTPS']=='on') $proctcl = 'https://';
160
+		if ($_SERVER['HTTPS'] == 'on') $proctcl = 'https://';
161 161
 		else $proctcl = 'http://';
162 162
 
163 163
 		$temp_link = explode('/', $info->link);
164
-		if($temp_link[0]=='' && $info->link)
164
+		if ($temp_link[0] == '' && $info->link)
165 165
 		{
166 166
 			$info->link = $proctcl.$_SERVER['HTTP_HOST'].$info->link;
167 167
 		}
168 168
 
169 169
 		$temp_id = explode('/', $info->id);
170
-		if($temp_id[0]=='' && $info->id)
170
+		if ($temp_id[0] == '' && $info->id)
171 171
 		{
172 172
 			$info->id = $proctcl.$_SERVER['HTTP_HOST'].$info->id;
173 173
 		}
174 174
 
175
-		$info->language = str_replace('jp','ja',Context::getLangType());
175
+		$info->language = str_replace('jp', 'ja', Context::getLangType());
176 176
 		// Set the variables used in the RSS output
177 177
 		Context::set('info', $info);
178 178
 		Context::set('feed_config', $config);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	function dispError()
229 229
 	{
230 230
 		// Prepare the output message
231
-		$this->rss(null, null, Context::getLang('msg_rss_is_disabled') );
231
+		$this->rss(null, null, Context::getLang('msg_rss_is_disabled'));
232 232
 	}
233 233
 
234 234
 	/**
@@ -243,12 +243,12 @@  discard block
 block discarded – undo
243 243
 		$current_module_srl = Context::get('module_srl');
244 244
 		$current_module_srls = Context::get('module_srls');
245 245
 
246
-		if(!$current_module_srl && !$current_module_srls)
246
+		if (!$current_module_srl && !$current_module_srls)
247 247
 		{
248 248
 			// Get information of the selected module
249 249
 			$current_module_info = Context::get('current_module_info');
250 250
 			$current_module_srl = $current_module_info->module_srl;
251
-			if(!$current_module_srl) return new Object();
251
+			if (!$current_module_srl) return new Object();
252 252
 		}
253 253
 		// Get teh RSS configurations for the selected module
254 254
 		$oRssModel = getModel('rss');
Please login to merge, or discard this patch.
modules/session/session.admin.controller.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 		$oSessionController = getController('session');
23 23
 		$oSessionController->gc(0);
24 24
 
25
-		$this->add('result',Context::getLang('session_cleared'));
25
+		$this->add('result', Context::getLang('session_cleared'));
26 26
 	}
27 27
 }
28 28
 /* End of file session.admin.controller.php */
Please login to merge, or discard this patch.
modules/session/session.class.php 2 patches
Braces   +30 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,7 +15,9 @@  discard block
 block discarded – undo
15 15
 
16 16
 	function session()
17 17
 	{
18
-		if(Context::isInstalled()) $this->session_started= true;
18
+		if(Context::isInstalled()) {
19
+			$this->session_started= true;
20
+		}
19 21
 	}
20 22
 
21 23
 	/**
@@ -35,9 +37,15 @@  discard block
 block discarded – undo
35 37
 	function checkUpdate()
36 38
 	{
37 39
 		$oDB = &DB::getInstance();
38
-		if(!$oDB->isTableExists('session')) return true;
39
-		if(!$oDB->isColumnExists("session","cur_mid")) return true;
40
-		if(!$oDB->isIndexExists("session","idx_session_update_mid")) return true;
40
+		if(!$oDB->isTableExists('session')) {
41
+			return true;
42
+		}
43
+		if(!$oDB->isColumnExists("session","cur_mid")) {
44
+			return true;
45
+		}
46
+		if(!$oDB->isIndexExists("session","idx_session_update_mid")) {
47
+			return true;
48
+		}
41 49
 		return false;
42 50
 	}
43 51
 
@@ -49,11 +57,17 @@  discard block
 block discarded – undo
49 57
 		$oDB = &DB::getInstance();
50 58
 		$oModuleModel = getModel('module');
51 59
 
52
-		if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml');
60
+		if(!$oDB->isTableExists('session')) {
61
+			$oDB->createTableByXmlFile($this->module_path.'schemas/session.xml');
62
+		}
53 63
 
54
-		if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128);
64
+		if(!$oDB->isColumnExists("session","cur_mid")) {
65
+			$oDB->addColumn('session',"cur_mid","varchar",128);
66
+		}
55 67
 
56
-		if(!$oDB->isIndexExists("session","idx_session_update_mid")) $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
68
+		if(!$oDB->isIndexExists("session","idx_session_update_mid")) {
69
+			$oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
70
+		}
57 71
 	}
58 72
 
59 73
 	/**
@@ -62,7 +76,9 @@  discard block
 block discarded – undo
62 76
 	function unSerializeSession($val)
63 77
 	{
64 78
 		$vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
65
-		for($i=0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]);
79
+		for($i=0; $vars[$i]; $i++) {
80
+			$result[$vars[$i++]] = unserialize($vars[$i]);
81
+		}
66 82
 		return $result;
67 83
 	}
68 84
 
@@ -71,10 +87,14 @@  discard block
 block discarded – undo
71 87
 	 */
72 88
 	function serializeSession($data)
73 89
 	{
74
-		if(!count($data)) return;
90
+		if(!count($data)) {
91
+			return;
92
+		}
75 93
 
76 94
 		$str = '';
77
-		foreach($data as $key => $val) $str .= $key.'|'.serialize($val);
95
+		foreach($data as $key => $val) {
96
+			$str .= $key.'|'.serialize($val);
97
+		}
78 98
 		return substr($str, 0, strlen($str)-1).'}';
79 99
 	}
80 100
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 	function session()
17 17
 	{
18
-		if(Context::isInstalled()) $this->session_started= true;
18
+		if (Context::isInstalled()) $this->session_started = true;
19 19
 	}
20 20
 
21 21
 	/**
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	function moduleInstall()
25 25
 	{
26 26
 		$oDB = &DB::getInstance();
27
-		$oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
27
+		$oDB->addIndex("session", "idx_session_update_mid", array("member_srl", "last_update", "cur_mid"));
28 28
 
29 29
 		return new Object();
30 30
 	}
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	function checkUpdate()
36 36
 	{
37 37
 		$oDB = &DB::getInstance();
38
-		if(!$oDB->isTableExists('session')) return true;
39
-		if(!$oDB->isColumnExists("session","cur_mid")) return true;
40
-		if(!$oDB->isIndexExists("session","idx_session_update_mid")) return true;
38
+		if (!$oDB->isTableExists('session')) return true;
39
+		if (!$oDB->isColumnExists("session", "cur_mid")) return true;
40
+		if (!$oDB->isIndexExists("session", "idx_session_update_mid")) return true;
41 41
 		return false;
42 42
 	}
43 43
 
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 		$oDB = &DB::getInstance();
50 50
 		$oModuleModel = getModel('module');
51 51
 
52
-		if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml');
52
+		if (!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml');
53 53
 
54
-		if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128);
54
+		if (!$oDB->isColumnExists("session", "cur_mid")) $oDB->addColumn('session', "cur_mid", "varchar", 128);
55 55
 
56
-		if(!$oDB->isIndexExists("session","idx_session_update_mid")) $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
56
+		if (!$oDB->isIndexExists("session", "idx_session_update_mid")) $oDB->addIndex("session", "idx_session_update_mid", array("member_srl", "last_update", "cur_mid"));
57 57
 	}
58 58
 
59 59
 	/**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	function unSerializeSession($val)
63 63
 	{
64
-		$vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
65
-		for($i=0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]);
64
+		$vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
65
+		for ($i = 0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]);
66 66
 		return $result;
67 67
 	}
68 68
 
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	function serializeSession($data)
73 73
 	{
74
-		if(!count($data)) return;
74
+		if (!count($data)) return;
75 75
 
76 76
 		$str = '';
77
-		foreach($data as $key => $val) $str .= $key.'|'.serialize($val);
78
-		return substr($str, 0, strlen($str)-1).'}';
77
+		foreach ($data as $key => $val) $str .= $key.'|'.serialize($val);
78
+		return substr($str, 0, strlen($str) - 1).'}';
79 79
 	}
80 80
 
81 81
 	/**
Please login to merge, or discard this patch.
modules/session/session.controller.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 	function write($session_key, $val)
28 28
 	{
29
-		if(!$session_key || !$this->session_started) return;
29
+		if (!$session_key || !$this->session_started) return;
30 30
 
31 31
 		$args = new stdClass;
32 32
 		$args->session_key = $session_key;
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		$session_info = $output->data;
36 36
 
37 37
 		//if ip has changed delete the session from db
38
-		if($session_info->session_key == $session_key && $session_info->ipaddress != $_SERVER['REMOTE_ADDR'])
38
+		if ($session_info->session_key == $session_key && $session_info->ipaddress != $_SERVER['REMOTE_ADDR'])
39 39
 		{
40 40
 			executeQuery('session.deleteSession', $args);
41 41
 
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 		$args->val = $val;
47 47
 		$args->cur_mid = Context::get('mid');
48 48
 
49
-		if(!$args->cur_mid)
49
+		if (!$args->cur_mid)
50 50
 		{
51 51
 			$module_info = Context::get('current_module_info');
52 52
 			$args->cur_mid = $module_info->mid;
53 53
 		}
54 54
 
55
-		if(Context::get('is_logged'))
55
+		if (Context::get('is_logged'))
56 56
 		{
57 57
 			$logged_info = Context::get('logged_info');
58 58
 			$args->member_srl = $logged_info->member_srl;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		$args->last_update = date("YmdHis", $_SERVER['REQUEST_TIME']);
66 66
 
67 67
 		//put session into db
68
-		if($session_info->session_key)
68
+		if ($session_info->session_key)
69 69
 		{
70 70
 			$output = executeQuery('session.updateSession', $args);
71 71
 		}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
 	function destroy($session_key)
81 81
 	{
82
-		if(!$session_key || !$this->session_started) return;
82
+		if (!$session_key || !$this->session_started) return;
83 83
 
84 84
 		//remove session from db
85 85
 		$args = new stdClass();
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 	function gc($maxlifetime)
93 93
 	{
94
-		if(!$this->session_started) return;
94
+		if (!$this->session_started) return;
95 95
 
96 96
 		executeQuery('session.gcSession');
97 97
 		return true;
Please login to merge, or discard this patch.
Braces   +11 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@  discard block
 block discarded – undo
26 26
 
27 27
 	function write($session_key, $val)
28 28
 	{
29
-		if(!$session_key || !$this->session_started) return;
29
+		if(!$session_key || !$this->session_started) {
30
+			return;
31
+		}
30 32
 
31 33
 		$args = new stdClass;
32 34
 		$args->session_key = $session_key;
@@ -56,8 +58,7 @@  discard block
 block discarded – undo
56 58
 		{
57 59
 			$logged_info = Context::get('logged_info');
58 60
 			$args->member_srl = $logged_info->member_srl;
59
-		}
60
-		else
61
+		} else
61 62
 		{
62 63
 			$args->member_srl = 0;
63 64
 		}
@@ -68,8 +69,7 @@  discard block
 block discarded – undo
68 69
 		if($session_info->session_key)
69 70
 		{
70 71
 			$output = executeQuery('session.updateSession', $args);
71
-		}
72
-		else
72
+		} else
73 73
 		{
74 74
 			$output = executeQuery('session.insertSession', $args);
75 75
 		}
@@ -79,7 +79,9 @@  discard block
 block discarded – undo
79 79
 
80 80
 	function destroy($session_key)
81 81
 	{
82
-		if(!$session_key || !$this->session_started) return;
82
+		if(!$session_key || !$this->session_started) {
83
+			return;
84
+		}
83 85
 
84 86
 		//remove session from db
85 87
 		$args = new stdClass();
@@ -91,7 +93,9 @@  discard block
 block discarded – undo
91 93
 
92 94
 	function gc($maxlifetime)
93 95
 	{
94
-		if(!$this->session_started) return;
96
+		if(!$this->session_started) {
97
+			return;
98
+		}
95 99
 
96 100
 		executeQuery('session.gcSession');
97 101
 		return true;
Please login to merge, or discard this patch.