@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | static $member_config; |
28 | 28 | |
29 | - if($member_config) |
|
29 | + if ($member_config) |
|
30 | 30 | { |
31 | 31 | return $member_config; |
32 | 32 | } |
@@ -35,47 +35,47 @@ discard block |
||
35 | 35 | $oModuleModel = getModel('module'); |
36 | 36 | $config = $oModuleModel->getModuleConfig('member'); |
37 | 37 | |
38 | - if(!$config->signupForm || !is_array($config->signupForm)) |
|
38 | + if (!$config->signupForm || !is_array($config->signupForm)) |
|
39 | 39 | { |
40 | 40 | $oMemberAdminController = getAdminController('member'); |
41 | 41 | $identifier = ($config->identifier) ? $config->identifier : 'email_address'; |
42 | 42 | $config->signupForm = $oMemberAdminController->createSignupForm($identifier); |
43 | 43 | } |
44 | 44 | //for multi language |
45 | - foreach($config->signupForm AS $key=>$value) |
|
45 | + foreach ($config->signupForm AS $key=>$value) |
|
46 | 46 | { |
47 | 47 | $config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title; |
48 | - if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y'; |
|
49 | - if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N'; |
|
48 | + if ($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y'; |
|
49 | + if ($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | // Get terms of user |
53 | 53 | $config->agreement = memberModel::_getAgreement(); |
54 | 54 | |
55 | - if(!$config->webmaster_name) $config->webmaster_name = 'webmaster'; |
|
55 | + if (!$config->webmaster_name) $config->webmaster_name = 'webmaster'; |
|
56 | 56 | |
57 | - if(!$config->image_name_max_width) $config->image_name_max_width = 90; |
|
58 | - if(!$config->image_name_max_height) $config->image_name_max_height = 20; |
|
59 | - if(!$config->image_name_max_filesize) $config->image_name_max_filesize = null; |
|
60 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = 20; |
|
61 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = 20; |
|
62 | - if(!$config->image_mark_max_filesize) $config->image_mark_max_filesize = null; |
|
63 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = 90; |
|
64 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = 90; |
|
65 | - if(!$config->profile_image_max_filesize) $config->profile_image_max_filesize = null; |
|
57 | + if (!$config->image_name_max_width) $config->image_name_max_width = 90; |
|
58 | + if (!$config->image_name_max_height) $config->image_name_max_height = 20; |
|
59 | + if (!$config->image_name_max_filesize) $config->image_name_max_filesize = null; |
|
60 | + if (!$config->image_mark_max_width) $config->image_mark_max_width = 20; |
|
61 | + if (!$config->image_mark_max_height) $config->image_mark_max_height = 20; |
|
62 | + if (!$config->image_mark_max_filesize) $config->image_mark_max_filesize = null; |
|
63 | + if (!$config->profile_image_max_width) $config->profile_image_max_width = 90; |
|
64 | + if (!$config->profile_image_max_height) $config->profile_image_max_height = 90; |
|
65 | + if (!$config->profile_image_max_filesize) $config->profile_image_max_filesize = null; |
|
66 | 66 | |
67 | - if(!$config->skin) $config->skin = 'default'; |
|
68 | - if(!$config->colorset) $config->colorset = 'white'; |
|
69 | - if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor'; |
|
70 | - if(!$config->group_image_mark) $config->group_image_mark = "N"; |
|
67 | + if (!$config->skin) $config->skin = 'default'; |
|
68 | + if (!$config->colorset) $config->colorset = 'white'; |
|
69 | + if (!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor'; |
|
70 | + if (!$config->group_image_mark) $config->group_image_mark = "N"; |
|
71 | 71 | |
72 | - if(!$config->identifier) $config->identifier = 'user_id'; |
|
72 | + if (!$config->identifier) $config->identifier = 'user_id'; |
|
73 | 73 | |
74 | - if(!$config->max_error_count) $config->max_error_count = 10; |
|
75 | - if(!$config->max_error_count_time) $config->max_error_count_time = 300; |
|
74 | + if (!$config->max_error_count) $config->max_error_count = 10; |
|
75 | + if (!$config->max_error_count_time) $config->max_error_count_time = 300; |
|
76 | 76 | |
77 | - if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor'; |
|
78 | - if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono'; |
|
77 | + if (!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor'; |
|
78 | + if (!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono'; |
|
79 | 79 | |
80 | 80 | $member_config = $config; |
81 | 81 | |
@@ -84,24 +84,24 @@ discard block |
||
84 | 84 | |
85 | 85 | function _getAgreement() |
86 | 86 | { |
87 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
88 | - if(is_readable($agreement_file)) |
|
87 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
88 | + if (is_readable($agreement_file)) |
|
89 | 89 | { |
90 | 90 | return FileHandler::readFile($agreement_file); |
91 | 91 | } |
92 | 92 | |
93 | 93 | $db_info = Context::getDBInfo(); |
94 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $db_info->lang_type . '.txt'; |
|
95 | - if(is_readable($agreement_file)) |
|
94 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$db_info->lang_type.'.txt'; |
|
95 | + if (is_readable($agreement_file)) |
|
96 | 96 | { |
97 | 97 | return FileHandler::readFile($agreement_file); |
98 | 98 | } |
99 | 99 | |
100 | 100 | $lang_selected = Context::loadLangSelected(); |
101 | - foreach($lang_selected as $key => $val) |
|
101 | + foreach ($lang_selected as $key => $val) |
|
102 | 102 | { |
103 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $key . '.txt'; |
|
104 | - if(is_readable($agreement_file)) |
|
103 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$key.'.txt'; |
|
104 | + if (is_readable($agreement_file)) |
|
105 | 105 | { |
106 | 106 | return FileHandler::readFile($agreement_file); |
107 | 107 | } |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | $logged_info = Context::get('logged_info'); |
122 | 122 | $act = Context::get('cur_act'); |
123 | 123 | // When click user's own nickname |
124 | - if($member_srl == $logged_info->member_srl) $member_info = $logged_info; |
|
124 | + if ($member_srl == $logged_info->member_srl) $member_info = $logged_info; |
|
125 | 125 | // When click other's nickname |
126 | 126 | else $member_info = $this->getMemberInfoByMemberSrl($member_srl); |
127 | 127 | |
128 | 128 | $member_srl = $member_info->member_srl; |
129 | - if(!$member_srl) return; |
|
129 | + if (!$member_srl) return; |
|
130 | 130 | // List variables |
131 | 131 | $user_id = $member_info->user_id; |
132 | 132 | $user_name = $member_info->user_name; |
@@ -135,18 +135,18 @@ discard block |
||
135 | 135 | |
136 | 136 | $oMemberController = getController('member'); |
137 | 137 | // Display member information (Don't display to non-logged user) |
138 | - if($logged_info->member_srl) |
|
138 | + if ($logged_info->member_srl) |
|
139 | 139 | { |
140 | - $url = getUrl('','mid',$mid,'act','dispMemberInfo','member_srl',$member_srl); |
|
141 | - $oMemberController->addMemberPopupMenu($url,'cmd_view_member_info',$icon_path,'self'); |
|
140 | + $url = getUrl('', 'mid', $mid, 'act', 'dispMemberInfo', 'member_srl', $member_srl); |
|
141 | + $oMemberController->addMemberPopupMenu($url, 'cmd_view_member_info', $icon_path, 'self'); |
|
142 | 142 | } |
143 | 143 | // When click other's nickname |
144 | - if($member_srl != $logged_info->member_srl && $logged_info->member_srl) |
|
144 | + if ($member_srl != $logged_info->member_srl && $logged_info->member_srl) |
|
145 | 145 | { |
146 | 146 | // Get email config |
147 | - foreach($this->module_config->signupForm as $field) |
|
147 | + foreach ($this->module_config->signupForm as $field) |
|
148 | 148 | { |
149 | - if($field->name == 'email_address') |
|
149 | + if ($field->name == 'email_address') |
|
150 | 150 | { |
151 | 151 | $email_config = $field; |
152 | 152 | break; |
@@ -154,36 +154,36 @@ discard block |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | // Send an email only if email address is public |
157 | - if(($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address) |
|
157 | + if (($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address) |
|
158 | 158 | { |
159 | 159 | $url = 'mailto:'.escape($member_info->email_address, false); |
160 | - $oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path); |
|
160 | + $oMemberController->addMemberPopupMenu($url, 'cmd_send_email', $icon_path); |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | // View homepage info |
164 | - if($member_info->homepage) |
|
164 | + if ($member_info->homepage) |
|
165 | 165 | $oMemberController->addMemberPopupMenu(escape($member_info->homepage, false), 'homepage', '', 'blank'); |
166 | 166 | // View blog info |
167 | - if($member_info->blog) |
|
167 | + if ($member_info->blog) |
|
168 | 168 | $oMemberController->addMemberPopupMenu(escape($member_info->blog, false), 'blog', '', 'blank'); |
169 | 169 | // Call a trigger (after) |
170 | 170 | ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null); |
171 | 171 | // Display a menu for editting member info to a top administrator |
172 | - if($logged_info->is_admin == 'Y') |
|
172 | + if ($logged_info->is_admin == 'Y') |
|
173 | 173 | { |
174 | - $url = getUrl('','module','admin','act','dispMemberAdminInsert','member_srl',$member_srl); |
|
175 | - $oMemberController->addMemberPopupMenu($url,'cmd_manage_member_info',$icon_path,'MemberModifyInfo'); |
|
174 | + $url = getUrl('', 'module', 'admin', 'act', 'dispMemberAdminInsert', 'member_srl', $member_srl); |
|
175 | + $oMemberController->addMemberPopupMenu($url, 'cmd_manage_member_info', $icon_path, 'MemberModifyInfo'); |
|
176 | 176 | |
177 | - $url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','member_srl','search_keyword',$member_srl); |
|
178 | - $oMemberController->addMemberPopupMenu($url,'cmd_trace_document',$icon_path,'TraceMemberDocument'); |
|
177 | + $url = getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl); |
|
178 | + $oMemberController->addMemberPopupMenu($url, 'cmd_trace_document', $icon_path, 'TraceMemberDocument'); |
|
179 | 179 | |
180 | - $url = getUrl('','module','admin','act','dispCommentAdminList','search_target','member_srl','search_keyword',$member_srl); |
|
181 | - $oMemberController->addMemberPopupMenu($url,'cmd_trace_comment',$icon_path,'TraceMemberComment'); |
|
180 | + $url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl); |
|
181 | + $oMemberController->addMemberPopupMenu($url, 'cmd_trace_comment', $icon_path, 'TraceMemberComment'); |
|
182 | 182 | } |
183 | 183 | // Change a language of pop-up menu |
184 | 184 | $menus = Context::get('member_popup_menu_list'); |
185 | 185 | $menus_count = count($menus); |
186 | - for($i=0;$i<$menus_count;$i++) |
|
186 | + for ($i = 0; $i < $menus_count; $i++) |
|
187 | 187 | { |
188 | 188 | $menus[$i]->str = Context::getLang($menus[$i]->str); |
189 | 189 | } |
@@ -195,16 +195,16 @@ discard block |
||
195 | 195 | * @brief Check if logged-in |
196 | 196 | */ |
197 | 197 | function isLogged() { |
198 | - if($_SESSION['is_logged']) |
|
198 | + if ($_SESSION['is_logged']) |
|
199 | 199 | { |
200 | - if(Mobile::isFromMobilePhone()) |
|
200 | + if (Mobile::isFromMobilePhone()) |
|
201 | 201 | { |
202 | 202 | return true; |
203 | 203 | } |
204 | - elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
204 | + elseif (filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
205 | 205 | { |
206 | 206 | // IPv6: require same /48 |
207 | - if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0) |
|
207 | + if (strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0) |
|
208 | 208 | { |
209 | 209 | return true; |
210 | 210 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | else |
213 | 213 | { |
214 | 214 | // IPv4: require same /24 |
215 | - if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) |
|
215 | + if (ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) |
|
216 | 216 | { |
217 | 217 | return true; |
218 | 218 | } |
@@ -229,23 +229,23 @@ discard block |
||
229 | 229 | function getLoggedInfo() |
230 | 230 | { |
231 | 231 | // Return session info if session info is requested and the user is logged-in |
232 | - if($this->isLogged()) |
|
232 | + if ($this->isLogged()) |
|
233 | 233 | { |
234 | 234 | $logged_info = Context::get('logged_info'); |
235 | 235 | // Admin/Group list defined depending on site_module_info |
236 | 236 | $site_module_info = Context::get('site_module_info'); |
237 | - if($site_module_info->site_srl) |
|
237 | + if ($site_module_info->site_srl) |
|
238 | 238 | { |
239 | 239 | $logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl); |
240 | 240 | // Add is_site_admin bool variable into logged_info if site_administrator is |
241 | 241 | $oModuleModel = getModel('module'); |
242 | - if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; |
|
242 | + if ($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; |
|
243 | 243 | else $logged_info->is_site_admin = false; |
244 | 244 | } |
245 | 245 | else |
246 | 246 | { |
247 | 247 | // Register a default group if the site doesn't have a member group |
248 | - if(count($logged_info->group_list) === 0) |
|
248 | + if (count($logged_info->group_list) === 0) |
|
249 | 249 | { |
250 | 250 | $default_group = $this->getDefaultGroup(0); |
251 | 251 | $oMemberController = getController('member'); |
@@ -268,13 +268,13 @@ discard block |
||
268 | 268 | */ |
269 | 269 | function getMemberInfoByUserID($user_id, $columnList = array()) |
270 | 270 | { |
271 | - if(!$user_id) return; |
|
271 | + if (!$user_id) return; |
|
272 | 272 | |
273 | 273 | $args = new stdClass; |
274 | 274 | $args->user_id = $user_id; |
275 | 275 | $output = executeQuery('member.getMemberInfo', $args); |
276 | - if(!$output->toBool()) return $output; |
|
277 | - if(!$output->data) return; |
|
276 | + if (!$output->toBool()) return $output; |
|
277 | + if (!$output->data) return; |
|
278 | 278 | |
279 | 279 | $member_info = $this->arrangeMemberInfo($output->data); |
280 | 280 | |
@@ -286,12 +286,12 @@ discard block |
||
286 | 286 | */ |
287 | 287 | function getMemberInfoByEmailAddress($email_address) |
288 | 288 | { |
289 | - if(!$email_address) return; |
|
289 | + if (!$email_address) return; |
|
290 | 290 | |
291 | 291 | $args = new stdClass(); |
292 | 292 | |
293 | - $db_info = Context::getDBInfo (); |
|
294 | - if($db_info->master_db['db_type'] == "cubrid") |
|
293 | + $db_info = Context::getDBInfo(); |
|
294 | + if ($db_info->master_db['db_type'] == "cubrid") |
|
295 | 295 | { |
296 | 296 | $args->email_address = strtolower($email_address); |
297 | 297 | $output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args); |
@@ -302,8 +302,8 @@ discard block |
||
302 | 302 | $output = executeQuery('member.getMemberInfoByEmailAddress', $args); |
303 | 303 | } |
304 | 304 | |
305 | - if(!$output->toBool()) return $output; |
|
306 | - if(!$output->data) return; |
|
305 | + if (!$output->toBool()) return $output; |
|
306 | + if (!$output->data) return; |
|
307 | 307 | |
308 | 308 | $member_info = $this->arrangeMemberInfo($output->data); |
309 | 309 | return $member_info; |
@@ -314,36 +314,36 @@ discard block |
||
314 | 314 | */ |
315 | 315 | function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array()) |
316 | 316 | { |
317 | - if(!$member_srl) return; |
|
317 | + if (!$member_srl) return; |
|
318 | 318 | |
319 | 319 | //columnList size zero... get full member info |
320 | - if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0) |
|
320 | + if (!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0) |
|
321 | 321 | { |
322 | 322 | $GLOBALS['__member_info__'][$member_srl] = false; |
323 | 323 | |
324 | 324 | $oCacheHandler = CacheHandler::getInstance('object'); |
325 | - if($oCacheHandler->isSupport()) |
|
325 | + if ($oCacheHandler->isSupport()) |
|
326 | 326 | { |
327 | 327 | $columnList = array(); |
328 | - $object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl; |
|
328 | + $object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl; |
|
329 | 329 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
330 | 330 | $GLOBALS['__member_info__'][$member_srl] = $oCacheHandler->get($cache_key); |
331 | 331 | } |
332 | 332 | |
333 | - if($GLOBALS['__member_info__'][$member_srl] === false) |
|
333 | + if ($GLOBALS['__member_info__'][$member_srl] === false) |
|
334 | 334 | { |
335 | 335 | $args = new stdClass(); |
336 | 336 | $args->member_srl = $member_srl; |
337 | 337 | $output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList); |
338 | - if(!$output->data) |
|
338 | + if (!$output->data) |
|
339 | 339 | { |
340 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass); |
|
340 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass); |
|
341 | 341 | return; |
342 | 342 | } |
343 | 343 | $this->arrangeMemberInfo($output->data, $site_srl); |
344 | 344 | |
345 | 345 | //insert in cache |
346 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
346 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
347 | 347 | } |
348 | 348 | } |
349 | 349 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | function arrangeMemberInfo($info, $site_srl = 0) |
357 | 357 | { |
358 | - if(!$GLOBALS['__member_info__'][$info->member_srl]) |
|
358 | + if (!$GLOBALS['__member_info__'][$info->member_srl]) |
|
359 | 359 | { |
360 | 360 | $oModuleModel = getModel('module'); |
361 | 361 | $config = $oModuleModel->getModuleConfig('member'); |
@@ -364,25 +364,25 @@ discard block |
||
364 | 364 | $info->profile_image = $this->getProfileImage($info->member_srl); |
365 | 365 | $info->image_name = $this->getImageName($info->member_srl); |
366 | 366 | $info->image_mark = $this->getImageMark($info->member_srl); |
367 | - if($config->group_image_mark=='Y') |
|
367 | + if ($config->group_image_mark == 'Y') |
|
368 | 368 | { |
369 | - $info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl); |
|
369 | + $info->group_mark = $this->getGroupImageMark($info->member_srl, $site_srl); |
|
370 | 370 | } |
371 | 371 | $info->signature = $this->getSignature($info->member_srl); |
372 | 372 | $info->group_list = $this->getMemberGroups($info->member_srl, $site_srl); |
373 | 373 | |
374 | 374 | $extra_vars = unserialize($info->extra_vars); |
375 | 375 | unset($info->extra_vars); |
376 | - if($extra_vars) |
|
376 | + if ($extra_vars) |
|
377 | 377 | { |
378 | - foreach($extra_vars as $key => $val) |
|
378 | + foreach ($extra_vars as $key => $val) |
|
379 | 379 | { |
380 | - if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val); |
|
381 | - if(!$info->{$key}) $info->{$key} = $val; |
|
380 | + if (!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val); |
|
381 | + if (!$info->{$key}) $info->{$key} = $val; |
|
382 | 382 | } |
383 | 383 | } |
384 | 384 | |
385 | - if(strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer)) |
|
385 | + if (strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer)) |
|
386 | 386 | { |
387 | 387 | $info->find_account_answer = null; |
388 | 388 | } |
@@ -394,13 +394,13 @@ discard block |
||
394 | 394 | $info->homepage = strip_tags($info->homepage); |
395 | 395 | $info->blog = strip_tags($info->blog); |
396 | 396 | |
397 | - if($extra_vars) |
|
397 | + if ($extra_vars) |
|
398 | 398 | { |
399 | - foreach($extra_vars as $key => $val) |
|
399 | + foreach ($extra_vars as $key => $val) |
|
400 | 400 | { |
401 | - if(is_array($val)) |
|
401 | + if (is_array($val)) |
|
402 | 402 | { |
403 | - $oSecurity->encodeHTML($key . '.'); |
|
403 | + $oSecurity->encodeHTML($key.'.'); |
|
404 | 404 | } |
405 | 405 | else |
406 | 406 | { |
@@ -411,12 +411,12 @@ discard block |
||
411 | 411 | |
412 | 412 | // Check format. |
413 | 413 | $oValidator = new Validator(); |
414 | - if(!$oValidator->applyRule('url', $info->homepage)) |
|
414 | + if (!$oValidator->applyRule('url', $info->homepage)) |
|
415 | 415 | { |
416 | 416 | $info->homepage = ''; |
417 | 417 | } |
418 | 418 | |
419 | - if(!$oValidator->applyRule('url', $info->blog)) |
|
419 | + if (!$oValidator->applyRule('url', $info->blog)) |
|
420 | 420 | { |
421 | 421 | $info->blog = ''; |
422 | 422 | } |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | */ |
466 | 466 | function getLoggedMemberSrl() |
467 | 467 | { |
468 | - if(!$this->isLogged()) return; |
|
468 | + if (!$this->isLogged()) return; |
|
469 | 469 | return $_SESSION['member_srl']; |
470 | 470 | } |
471 | 471 | |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | */ |
475 | 475 | function getLoggedUserID() |
476 | 476 | { |
477 | - if(!$this->isLogged()) return; |
|
477 | + if (!$this->isLogged()) return; |
|
478 | 478 | $logged_info = Context::get('logged_info'); |
479 | 479 | return $logged_info->user_id; |
480 | 480 | } |
@@ -489,16 +489,16 @@ discard block |
||
489 | 489 | // cache controll |
490 | 490 | $group_list = false; |
491 | 491 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
492 | - if($oCacheHandler->isSupport()) |
|
492 | + if ($oCacheHandler->isSupport()) |
|
493 | 493 | { |
494 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_'.$site_srl; |
|
494 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl; |
|
495 | 495 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
496 | 496 | $group_list = $oCacheHandler->get($cache_key); |
497 | 497 | } |
498 | 498 | |
499 | - if(!$member_groups[$member_srl][$site_srl] || $force_reload) |
|
499 | + if (!$member_groups[$member_srl][$site_srl] || $force_reload) |
|
500 | 500 | { |
501 | - if($group_list === false) |
|
501 | + if ($group_list === false) |
|
502 | 502 | { |
503 | 503 | $args = new stdClass(); |
504 | 504 | $args->member_srl = $member_srl; |
@@ -506,11 +506,11 @@ discard block |
||
506 | 506 | $output = executeQueryArray('member.getMemberGroups', $args); |
507 | 507 | $group_list = $output->data; |
508 | 508 | //insert in cache |
509 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
509 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
510 | 510 | } |
511 | - if(!$group_list) return array(); |
|
511 | + if (!$group_list) return array(); |
|
512 | 512 | |
513 | - foreach($group_list as $group) |
|
513 | + foreach ($group_list as $group) |
|
514 | 514 | { |
515 | 515 | $result[$group->group_srl] = $group->title; |
516 | 516 | } |
@@ -524,14 +524,14 @@ discard block |
||
524 | 524 | */ |
525 | 525 | function getMembersGroups($member_srls, $site_srl = 0) |
526 | 526 | { |
527 | - $args->member_srls = implode(',',$member_srls); |
|
527 | + $args->member_srls = implode(',', $member_srls); |
|
528 | 528 | $args->site_srl = $site_srl; |
529 | 529 | $args->sort_index = 'list_order'; |
530 | 530 | $output = executeQueryArray('member.getMembersGroups', $args); |
531 | - if(!$output->data) return array(); |
|
531 | + if (!$output->data) return array(); |
|
532 | 532 | |
533 | 533 | $result = array(); |
534 | - foreach($output->data as $key=>$val) |
|
534 | + foreach ($output->data as $key=>$val) |
|
535 | 535 | { |
536 | 536 | $result[$val->member_srl][] = $val->title; |
537 | 537 | } |
@@ -545,21 +545,21 @@ discard block |
||
545 | 545 | { |
546 | 546 | $default_group = false; |
547 | 547 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
548 | - if($oCacheHandler->isSupport()) |
|
548 | + if ($oCacheHandler->isSupport()) |
|
549 | 549 | { |
550 | 550 | $columnList = array(); |
551 | - $object_key = 'default_group_' . $site_srl; |
|
551 | + $object_key = 'default_group_'.$site_srl; |
|
552 | 552 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
553 | 553 | $default_group = $oCacheHandler->get($cache_key); |
554 | 554 | } |
555 | 555 | |
556 | - if($default_group === false) |
|
556 | + if ($default_group === false) |
|
557 | 557 | { |
558 | 558 | $args = new stdClass(); |
559 | 559 | $args->site_srl = $site_srl; |
560 | 560 | $output = executeQuery('member.getDefaultGroup', $args, $columnList); |
561 | 561 | $default_group = $output->data; |
562 | - if($oCacheHandler->isSupport()) |
|
562 | + if ($oCacheHandler->isSupport()) |
|
563 | 563 | { |
564 | 564 | $oCacheHandler->put($cache_key, $default_group); |
565 | 565 | } |
@@ -593,25 +593,25 @@ discard block |
||
593 | 593 | */ |
594 | 594 | function getGroups($site_srl = 0) |
595 | 595 | { |
596 | - if(!$GLOBALS['__group_info__'][$site_srl]) |
|
596 | + if (!$GLOBALS['__group_info__'][$site_srl]) |
|
597 | 597 | { |
598 | 598 | $result = array(); |
599 | 599 | |
600 | - if(!isset($site_srl)) |
|
600 | + if (!isset($site_srl)) |
|
601 | 601 | { |
602 | 602 | $site_srl = 0; |
603 | 603 | } |
604 | 604 | |
605 | 605 | $group_list = false; |
606 | 606 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
607 | - if($oCacheHandler->isSupport()) |
|
607 | + if ($oCacheHandler->isSupport()) |
|
608 | 608 | { |
609 | 609 | $object_key = 'member_groups:site_'.$site_srl; |
610 | 610 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
611 | 611 | $group_list = $oCacheHandler->get($cache_key); |
612 | 612 | } |
613 | 613 | |
614 | - if($group_list === false) |
|
614 | + if ($group_list === false) |
|
615 | 615 | { |
616 | 616 | $args = new stdClass(); |
617 | 617 | $args->site_srl = $site_srl; |
@@ -620,16 +620,16 @@ discard block |
||
620 | 620 | $output = executeQueryArray('member.getGroups', $args); |
621 | 621 | $group_list = $output->data; |
622 | 622 | //insert in cache |
623 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
623 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
624 | 624 | } |
625 | 625 | |
626 | - if(!$group_list) |
|
626 | + if (!$group_list) |
|
627 | 627 | { |
628 | 628 | return array(); |
629 | 629 | } |
630 | 630 | |
631 | 631 | |
632 | - foreach($group_list as $val) |
|
632 | + foreach ($group_list as $val) |
|
633 | 633 | { |
634 | 634 | $result[$val->group_srl] = $val; |
635 | 635 | } |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | // Set to ignore if a super administrator. |
661 | 661 | $logged_info = Context::get('logged_info'); |
662 | 662 | |
663 | - if(!$this->join_form_list) |
|
663 | + if (!$this->join_form_list) |
|
664 | 664 | { |
665 | 665 | // Argument setting to sort list_order column |
666 | 666 | $args = new stdClass(); |
@@ -668,11 +668,11 @@ discard block |
||
668 | 668 | $output = executeQuery('member.getJoinFormList', $args); |
669 | 669 | // NULL if output data deosn't exist |
670 | 670 | $join_form_list = $output->data; |
671 | - if(!$join_form_list) return NULL; |
|
671 | + if (!$join_form_list) return NULL; |
|
672 | 672 | // Need to unserialize because serialized array is inserted into DB in case of default_value |
673 | - if(!is_array($join_form_list)) $join_form_list = array($join_form_list); |
|
673 | + if (!is_array($join_form_list)) $join_form_list = array($join_form_list); |
|
674 | 674 | $join_form_count = count($join_form_list); |
675 | - for($i=0;$i<$join_form_count;$i++) |
|
675 | + for ($i = 0; $i < $join_form_count; $i++) |
|
676 | 676 | { |
677 | 677 | $join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name); |
678 | 678 | |
@@ -684,10 +684,10 @@ discard block |
||
684 | 684 | // Add language variable |
685 | 685 | $lang->extend_vars[$column_name] = $column_title; |
686 | 686 | // unserialize if the data type if checkbox, select and so on |
687 | - if(in_array($column_type, array('checkbox','select','radio'))) |
|
687 | + if (in_array($column_type, array('checkbox', 'select', 'radio'))) |
|
688 | 688 | { |
689 | 689 | $join_form_list[$i]->default_value = unserialize($default_value); |
690 | - if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = ''; |
|
690 | + if (!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = ''; |
|
691 | 691 | } |
692 | 692 | else |
693 | 693 | { |
@@ -699,16 +699,16 @@ discard block |
||
699 | 699 | $this->join_form_list = $list; |
700 | 700 | } |
701 | 701 | // Get object style if the filter_response is true |
702 | - if($filter_response && count($this->join_form_list)) |
|
702 | + if ($filter_response && count($this->join_form_list)) |
|
703 | 703 | { |
704 | - foreach($this->join_form_list as $key => $val) |
|
704 | + foreach ($this->join_form_list as $key => $val) |
|
705 | 705 | { |
706 | - if($val->is_active != 'Y') continue; |
|
706 | + if ($val->is_active != 'Y') continue; |
|
707 | 707 | unset($obj); |
708 | 708 | $obj->type = $val->column_type; |
709 | 709 | $obj->name = $val->column_name; |
710 | 710 | $obj->lang = $val->column_title; |
711 | - if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false; |
|
711 | + if ($logged_info->is_admin != 'Y') $obj->required = $val->required == 'Y' ?true:false; |
|
712 | 712 | else $obj->required = false; |
713 | 713 | $filter_output[] = $obj; |
714 | 714 | |
@@ -735,15 +735,15 @@ discard block |
||
735 | 735 | $args->sort_index = "list_order"; |
736 | 736 | $output = executeQueryArray('member.getJoinFormList', $args); |
737 | 737 | |
738 | - if(!$output->toBool()) |
|
738 | + if (!$output->toBool()) |
|
739 | 739 | { |
740 | 740 | return array(); |
741 | 741 | } |
742 | 742 | |
743 | 743 | $joinFormList = array(); |
744 | - foreach($output->data as $val) |
|
744 | + foreach ($output->data as $val) |
|
745 | 745 | { |
746 | - if($val->is_active != 'Y') |
|
746 | + if ($val->is_active != 'Y') |
|
747 | 747 | { |
748 | 748 | continue; |
749 | 749 | } |
@@ -760,20 +760,20 @@ discard block |
||
760 | 760 | function getCombineJoinForm($member_info) |
761 | 761 | { |
762 | 762 | $extend_form_list = $this->getJoinFormlist(); |
763 | - if(!$extend_form_list) return; |
|
763 | + if (!$extend_form_list) return; |
|
764 | 764 | // Member info is open only to an administrator and him/herself when is_private is true. |
765 | 765 | $logged_info = Context::get('logged_info'); |
766 | 766 | |
767 | - foreach($extend_form_list as $srl => $item) |
|
767 | + foreach ($extend_form_list as $srl => $item) |
|
768 | 768 | { |
769 | 769 | $column_name = $item->column_name; |
770 | 770 | $value = $member_info->{$column_name}; |
771 | 771 | |
772 | 772 | // Change values depening on the type of extend form |
773 | - switch($item->column_type) |
|
773 | + switch ($item->column_type) |
|
774 | 774 | { |
775 | 775 | case 'checkbox' : |
776 | - if($value && !is_array($value)) $value = array($value); |
|
776 | + if ($value && !is_array($value)) $value = array($value); |
|
777 | 777 | break; |
778 | 778 | case 'text' : |
779 | 779 | case 'homepage' : |
@@ -787,7 +787,7 @@ discard block |
||
787 | 787 | |
788 | 788 | $extend_form_list[$srl]->value = $value; |
789 | 789 | |
790 | - if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true; |
|
790 | + if ($member_info->{'open_'.$column_name} == 'Y') $extend_form_list[$srl]->is_opened = true; |
|
791 | 791 | else $extend_form_list[$srl]->is_opened = false; |
792 | 792 | } |
793 | 793 | return $extend_form_list; |
@@ -801,12 +801,12 @@ discard block |
||
801 | 801 | $args->member_join_form_srl = $member_join_form_srl; |
802 | 802 | $output = executeQuery('member.getJoinForm', $args); |
803 | 803 | $join_form = $output->data; |
804 | - if(!$join_form) return NULL; |
|
804 | + if (!$join_form) return NULL; |
|
805 | 805 | |
806 | 806 | $column_type = $join_form->column_type; |
807 | 807 | $default_value = $join_form->default_value; |
808 | 808 | |
809 | - if(in_array($column_type, array('checkbox','select','radio'))) |
|
809 | + if (in_array($column_type, array('checkbox', 'select', 'radio'))) |
|
810 | 810 | { |
811 | 811 | $join_form->default_value = unserialize($default_value); |
812 | 812 | } |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | */ |
824 | 824 | function getDeniedIDList() |
825 | 825 | { |
826 | - if(!$this->denied_id_list) |
|
826 | + if (!$this->denied_id_list) |
|
827 | 827 | { |
828 | 828 | $args->sort_index = "list_order"; |
829 | 829 | $args->page = Context::get('page'); |
@@ -839,14 +839,14 @@ discard block |
||
839 | 839 | function getDeniedIDs() |
840 | 840 | { |
841 | 841 | $output = executeQueryArray('member.getDeniedIDs'); |
842 | - if(!$output->toBool()) return array(); |
|
842 | + if (!$output->toBool()) return array(); |
|
843 | 843 | return $output->data; |
844 | 844 | } |
845 | 845 | |
846 | 846 | function getDeniedNickNames() |
847 | 847 | { |
848 | 848 | $output = executeQueryArray('member.getDeniedNickNames'); |
849 | - if(!$output->toBool()) |
|
849 | + if (!$output->toBool()) |
|
850 | 850 | { |
851 | 851 | return array(); |
852 | 852 | } |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | $args = new stdClass(); |
863 | 863 | $args->user_id = $user_id; |
864 | 864 | $output = executeQuery('member.chkDeniedID', $args); |
865 | - if($output->data->count) return true; |
|
865 | + if ($output->data->count) return true; |
|
866 | 866 | return false; |
867 | 867 | } |
868 | 868 | |
@@ -874,8 +874,8 @@ discard block |
||
874 | 874 | $args = new stdClass(); |
875 | 875 | $args->nick_name = $nickName; |
876 | 876 | $output = executeQuery('member.chkDeniedNickName', $args); |
877 | - if($output->data->count) return true; |
|
878 | - if(!$output->toBool()) |
|
877 | + if ($output->data->count) return true; |
|
878 | + if (!$output->toBool()) |
|
879 | 879 | { |
880 | 880 | return true; |
881 | 881 | } |
@@ -886,20 +886,20 @@ discard block |
||
886 | 886 | */ |
887 | 887 | function getProfileImage($member_srl) |
888 | 888 | { |
889 | - if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) |
|
889 | + if (!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) |
|
890 | 890 | { |
891 | 891 | $GLOBALS['__member_info__']['profile_image'][$member_srl] = null; |
892 | - $exts = array('gif','jpg','png'); |
|
893 | - for($i=0;$i<3;$i++) |
|
892 | + $exts = array('gif', 'jpg', 'png'); |
|
893 | + for ($i = 0; $i < 3; $i++) |
|
894 | 894 | { |
895 | 895 | $image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]); |
896 | - if(file_exists($image_name_file)) |
|
896 | + if (file_exists($image_name_file)) |
|
897 | 897 | { |
898 | 898 | list($width, $height, $type, $attrs) = getimagesize($image_name_file); |
899 | 899 | $info = new stdClass(); |
900 | 900 | $info->width = $width; |
901 | 901 | $info->height = $height; |
902 | - $info->src = Context::getRequestUri().$image_name_file . '?' . date('YmdHis', filemtime($image_name_file)); |
|
902 | + $info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file)); |
|
903 | 903 | $info->file = './'.$image_name_file; |
904 | 904 | $GLOBALS['__member_info__']['profile_image'][$member_srl] = $info; |
905 | 905 | break; |
@@ -915,16 +915,16 @@ discard block |
||
915 | 915 | */ |
916 | 916 | function getImageName($member_srl) |
917 | 917 | { |
918 | - if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) |
|
918 | + if (!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) |
|
919 | 919 | { |
920 | 920 | $image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl); |
921 | - if(file_exists($image_name_file)) |
|
921 | + if (file_exists($image_name_file)) |
|
922 | 922 | { |
923 | 923 | list($width, $height, $type, $attrs) = getimagesize($image_name_file); |
924 | 924 | $info = new stdClass; |
925 | 925 | $info->width = $width; |
926 | 926 | $info->height = $height; |
927 | - $info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file)); |
|
927 | + $info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file)); |
|
928 | 928 | $info->file = './'.$image_name_file; |
929 | 929 | $GLOBALS['__member_info__']['image_name'][$member_srl] = $info; |
930 | 930 | } |
@@ -938,15 +938,15 @@ discard block |
||
938 | 938 | */ |
939 | 939 | function getImageMark($member_srl) |
940 | 940 | { |
941 | - if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) |
|
941 | + if (!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) |
|
942 | 942 | { |
943 | 943 | $image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl); |
944 | - if(file_exists($image_mark_file)) |
|
944 | + if (file_exists($image_mark_file)) |
|
945 | 945 | { |
946 | 946 | list($width, $height, $type, $attrs) = getimagesize($image_mark_file); |
947 | 947 | $info->width = $width; |
948 | 948 | $info->height = $height; |
949 | - $info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file)); |
|
949 | + $info->src = Context::getRequestUri().$image_mark_file.'?'.date('YmdHis', filemtime($image_mark_file)); |
|
950 | 950 | $info->file = './'.$image_mark_file; |
951 | 951 | $GLOBALS['__member_info__']['image_mark'][$member_srl] = $info; |
952 | 952 | } |
@@ -960,27 +960,27 @@ discard block |
||
960 | 960 | /** |
961 | 961 | * @brief Get the image mark of the group |
962 | 962 | */ |
963 | - function getGroupImageMark($member_srl,$site_srl=0) |
|
963 | + function getGroupImageMark($member_srl, $site_srl = 0) |
|
964 | 964 | { |
965 | - if(!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl])) |
|
965 | + if (!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl])) |
|
966 | 966 | { |
967 | 967 | $oModuleModel = getModel('module'); |
968 | 968 | $config = $oModuleModel->getModuleConfig('member'); |
969 | - if($config->group_image_mark!='Y') |
|
969 | + if ($config->group_image_mark != 'Y') |
|
970 | 970 | { |
971 | 971 | return null; |
972 | 972 | } |
973 | - $member_group = $this->getMemberGroups($member_srl,$site_srl); |
|
973 | + $member_group = $this->getMemberGroups($member_srl, $site_srl); |
|
974 | 974 | $groups_info = $this->getGroups($site_srl); |
975 | - if(count($member_group) > 0 && is_array($member_group)) |
|
975 | + if (count($member_group) > 0 && is_array($member_group)) |
|
976 | 976 | { |
977 | 977 | $memberGroups = array_keys($member_group); |
978 | 978 | |
979 | - foreach($groups_info as $group_srl=>$group_info) |
|
979 | + foreach ($groups_info as $group_srl=>$group_info) |
|
980 | 980 | { |
981 | - if(in_array($group_srl, $memberGroups)) |
|
981 | + if (in_array($group_srl, $memberGroups)) |
|
982 | 982 | { |
983 | - if($group_info->image_mark) |
|
983 | + if ($group_info->image_mark) |
|
984 | 984 | { |
985 | 985 | $info = new stdClass(); |
986 | 986 | $info->title = $group_info->title; |
@@ -1004,10 +1004,10 @@ discard block |
||
1004 | 1004 | */ |
1005 | 1005 | function getSignature($member_srl) |
1006 | 1006 | { |
1007 | - if(!isset($GLOBALS['__member_info__']['signature'][$member_srl])) |
|
1007 | + if (!isset($GLOBALS['__member_info__']['signature'][$member_srl])) |
|
1008 | 1008 | { |
1009 | 1009 | $filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl); |
1010 | - if(file_exists($filename)) |
|
1010 | + if (file_exists($filename)) |
|
1011 | 1011 | { |
1012 | 1012 | $buff = FileHandler::readFile($filename); |
1013 | 1013 | $signature = preg_replace('/<\?.*?\?>/', '', $buff); |
@@ -1025,10 +1025,10 @@ discard block |
||
1025 | 1025 | * @param int $member_srl Set this to member_srl when comparing a member's password (optional) |
1026 | 1026 | * @return bool |
1027 | 1027 | */ |
1028 | - function isValidPassword($hashed_password, $password_text, $member_srl=null) |
|
1028 | + function isValidPassword($hashed_password, $password_text, $member_srl = null) |
|
1029 | 1029 | { |
1030 | 1030 | // False if no password in entered |
1031 | - if(!$password_text) |
|
1031 | + if (!$password_text) |
|
1032 | 1032 | { |
1033 | 1033 | return false; |
1034 | 1034 | } |
@@ -1037,31 +1037,31 @@ discard block |
||
1037 | 1037 | $oPassword = new Password(); |
1038 | 1038 | $current_algorithm = $oPassword->checkAlgorithm($hashed_password); |
1039 | 1039 | $match = $oPassword->checkPassword($password_text, $hashed_password, $current_algorithm); |
1040 | - if(!$match) |
|
1040 | + if (!$match) |
|
1041 | 1041 | { |
1042 | 1042 | return false; |
1043 | 1043 | } |
1044 | 1044 | |
1045 | 1045 | // Update the encryption method if necessary |
1046 | 1046 | $config = $this->getMemberConfig(); |
1047 | - if($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N') |
|
1047 | + if ($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N') |
|
1048 | 1048 | { |
1049 | 1049 | $need_upgrade = false; |
1050 | 1050 | |
1051 | - if(!$need_upgrade) |
|
1051 | + if (!$need_upgrade) |
|
1052 | 1052 | { |
1053 | 1053 | $required_algorithm = $oPassword->getCurrentlySelectedAlgorithm(); |
1054 | - if($required_algorithm !== $current_algorithm) $need_upgrade = true; |
|
1054 | + if ($required_algorithm !== $current_algorithm) $need_upgrade = true; |
|
1055 | 1055 | } |
1056 | 1056 | |
1057 | - if(!$need_upgrade) |
|
1057 | + if (!$need_upgrade) |
|
1058 | 1058 | { |
1059 | 1059 | $required_work_factor = $oPassword->getWorkFactor(); |
1060 | 1060 | $current_work_factor = $oPassword->checkWorkFactor($hashed_password); |
1061 | - if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; |
|
1061 | + if ($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; |
|
1062 | 1062 | } |
1063 | 1063 | |
1064 | - if($need_upgrade === true) |
|
1064 | + if ($need_upgrade === true) |
|
1065 | 1065 | { |
1066 | 1066 | $args = new stdClass(); |
1067 | 1067 | $args->member_srl = $member_srl; |
@@ -1089,27 +1089,27 @@ discard block |
||
1089 | 1089 | function checkPasswordStrength($password, $strength) |
1090 | 1090 | { |
1091 | 1091 | $logged_info = Context::get('logged_info'); |
1092 | - if($logged_info->is_admin == 'Y') return true; |
|
1092 | + if ($logged_info->is_admin == 'Y') return true; |
|
1093 | 1093 | |
1094 | - if($strength == NULL) |
|
1094 | + if ($strength == NULL) |
|
1095 | 1095 | { |
1096 | 1096 | $config = $this->getMemberConfig(); |
1097 | - $strength = $config->password_strength?$config->password_strength:'normal'; |
|
1097 | + $strength = $config->password_strength ? $config->password_strength : 'normal'; |
|
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | $length = strlen($password); |
1101 | 1101 | |
1102 | 1102 | switch ($strength) { |
1103 | 1103 | case 'high': |
1104 | - if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false; |
|
1104 | + if ($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false; |
|
1105 | 1105 | /* no break */ |
1106 | 1106 | |
1107 | 1107 | case 'normal': |
1108 | - if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false; |
|
1108 | + if ($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false; |
|
1109 | 1109 | break; |
1110 | 1110 | |
1111 | 1111 | case 'low': |
1112 | - if($length < 4) return false; |
|
1112 | + if ($length < 4) return false; |
|
1113 | 1113 | break; |
1114 | 1114 | } |
1115 | 1115 | |
@@ -1120,11 +1120,11 @@ discard block |
||
1120 | 1120 | { |
1121 | 1121 | $groupSrl = 0; |
1122 | 1122 | $output = $this->getGroups($site_srl); |
1123 | - if(is_array($output)) |
|
1123 | + if (is_array($output)) |
|
1124 | 1124 | { |
1125 | - foreach($output AS $key=>$value) |
|
1125 | + foreach ($output AS $key=>$value) |
|
1126 | 1126 | { |
1127 | - if($value->is_admin == 'Y') |
|
1127 | + if ($value->is_admin == 'Y') |
|
1128 | 1128 | { |
1129 | 1129 | $groupSrl = $value->group_srl; |
1130 | 1130 | break; |
@@ -45,37 +45,79 @@ discard block |
||
45 | 45 | foreach($config->signupForm AS $key=>$value) |
46 | 46 | { |
47 | 47 | $config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title; |
48 | - if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y'; |
|
49 | - if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N'; |
|
48 | + if($config->signupForm[$key]->isPublic != 'N') { |
|
49 | + $config->signupForm[$key]->isPublic = 'Y'; |
|
50 | + } |
|
51 | + if($value->name == 'find_account_question') { |
|
52 | + $config->signupForm[$key]->isPublic = 'N'; |
|
53 | + } |
|
50 | 54 | } |
51 | 55 | |
52 | 56 | // Get terms of user |
53 | 57 | $config->agreement = memberModel::_getAgreement(); |
54 | 58 | |
55 | - if(!$config->webmaster_name) $config->webmaster_name = 'webmaster'; |
|
59 | + if(!$config->webmaster_name) { |
|
60 | + $config->webmaster_name = 'webmaster'; |
|
61 | + } |
|
56 | 62 | |
57 | - if(!$config->image_name_max_width) $config->image_name_max_width = 90; |
|
58 | - if(!$config->image_name_max_height) $config->image_name_max_height = 20; |
|
59 | - if(!$config->image_name_max_filesize) $config->image_name_max_filesize = null; |
|
60 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = 20; |
|
61 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = 20; |
|
62 | - if(!$config->image_mark_max_filesize) $config->image_mark_max_filesize = null; |
|
63 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = 90; |
|
64 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = 90; |
|
65 | - if(!$config->profile_image_max_filesize) $config->profile_image_max_filesize = null; |
|
63 | + if(!$config->image_name_max_width) { |
|
64 | + $config->image_name_max_width = 90; |
|
65 | + } |
|
66 | + if(!$config->image_name_max_height) { |
|
67 | + $config->image_name_max_height = 20; |
|
68 | + } |
|
69 | + if(!$config->image_name_max_filesize) { |
|
70 | + $config->image_name_max_filesize = null; |
|
71 | + } |
|
72 | + if(!$config->image_mark_max_width) { |
|
73 | + $config->image_mark_max_width = 20; |
|
74 | + } |
|
75 | + if(!$config->image_mark_max_height) { |
|
76 | + $config->image_mark_max_height = 20; |
|
77 | + } |
|
78 | + if(!$config->image_mark_max_filesize) { |
|
79 | + $config->image_mark_max_filesize = null; |
|
80 | + } |
|
81 | + if(!$config->profile_image_max_width) { |
|
82 | + $config->profile_image_max_width = 90; |
|
83 | + } |
|
84 | + if(!$config->profile_image_max_height) { |
|
85 | + $config->profile_image_max_height = 90; |
|
86 | + } |
|
87 | + if(!$config->profile_image_max_filesize) { |
|
88 | + $config->profile_image_max_filesize = null; |
|
89 | + } |
|
66 | 90 | |
67 | - if(!$config->skin) $config->skin = 'default'; |
|
68 | - if(!$config->colorset) $config->colorset = 'white'; |
|
69 | - if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor'; |
|
70 | - if(!$config->group_image_mark) $config->group_image_mark = "N"; |
|
91 | + if(!$config->skin) { |
|
92 | + $config->skin = 'default'; |
|
93 | + } |
|
94 | + if(!$config->colorset) { |
|
95 | + $config->colorset = 'white'; |
|
96 | + } |
|
97 | + if(!$config->editor_skin || $config->editor_skin == 'default') { |
|
98 | + $config->editor_skin = 'ckeditor'; |
|
99 | + } |
|
100 | + if(!$config->group_image_mark) { |
|
101 | + $config->group_image_mark = "N"; |
|
102 | + } |
|
71 | 103 | |
72 | - if(!$config->identifier) $config->identifier = 'user_id'; |
|
104 | + if(!$config->identifier) { |
|
105 | + $config->identifier = 'user_id'; |
|
106 | + } |
|
73 | 107 | |
74 | - if(!$config->max_error_count) $config->max_error_count = 10; |
|
75 | - if(!$config->max_error_count_time) $config->max_error_count_time = 300; |
|
108 | + if(!$config->max_error_count) { |
|
109 | + $config->max_error_count = 10; |
|
110 | + } |
|
111 | + if(!$config->max_error_count_time) { |
|
112 | + $config->max_error_count_time = 300; |
|
113 | + } |
|
76 | 114 | |
77 | - if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor'; |
|
78 | - if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono'; |
|
115 | + if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') { |
|
116 | + $config->signature_editor_skin = 'ckeditor'; |
|
117 | + } |
|
118 | + if(!$config->sel_editor_colorset) { |
|
119 | + $config->sel_editor_colorset = 'moono'; |
|
120 | + } |
|
79 | 121 | |
80 | 122 | $member_config = $config; |
81 | 123 | |
@@ -121,12 +163,18 @@ discard block |
||
121 | 163 | $logged_info = Context::get('logged_info'); |
122 | 164 | $act = Context::get('cur_act'); |
123 | 165 | // When click user's own nickname |
124 | - if($member_srl == $logged_info->member_srl) $member_info = $logged_info; |
|
166 | + if($member_srl == $logged_info->member_srl) { |
|
167 | + $member_info = $logged_info; |
|
168 | + } |
|
125 | 169 | // When click other's nickname |
126 | - else $member_info = $this->getMemberInfoByMemberSrl($member_srl); |
|
170 | + else { |
|
171 | + $member_info = $this->getMemberInfoByMemberSrl($member_srl); |
|
172 | + } |
|
127 | 173 | |
128 | 174 | $member_srl = $member_info->member_srl; |
129 | - if(!$member_srl) return; |
|
175 | + if(!$member_srl) { |
|
176 | + return; |
|
177 | + } |
|
130 | 178 | // List variables |
131 | 179 | $user_id = $member_info->user_id; |
132 | 180 | $user_name = $member_info->user_name; |
@@ -161,11 +209,13 @@ discard block |
||
161 | 209 | } |
162 | 210 | } |
163 | 211 | // View homepage info |
164 | - if($member_info->homepage) |
|
165 | - $oMemberController->addMemberPopupMenu(escape($member_info->homepage, false), 'homepage', '', 'blank'); |
|
212 | + if($member_info->homepage) { |
|
213 | + $oMemberController->addMemberPopupMenu(escape($member_info->homepage, false), 'homepage', '', 'blank'); |
|
214 | + } |
|
166 | 215 | // View blog info |
167 | - if($member_info->blog) |
|
168 | - $oMemberController->addMemberPopupMenu(escape($member_info->blog, false), 'blog', '', 'blank'); |
|
216 | + if($member_info->blog) { |
|
217 | + $oMemberController->addMemberPopupMenu(escape($member_info->blog, false), 'blog', '', 'blank'); |
|
218 | + } |
|
169 | 219 | // Call a trigger (after) |
170 | 220 | ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null); |
171 | 221 | // Display a menu for editting member info to a top administrator |
@@ -200,16 +250,14 @@ discard block |
||
200 | 250 | if(Mobile::isFromMobilePhone()) |
201 | 251 | { |
202 | 252 | return true; |
203 | - } |
|
204 | - elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
253 | + } elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
205 | 254 | { |
206 | 255 | // IPv6: require same /48 |
207 | 256 | if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0) |
208 | 257 | { |
209 | 258 | return true; |
210 | 259 | } |
211 | - } |
|
212 | - else |
|
260 | + } else |
|
213 | 261 | { |
214 | 262 | // IPv4: require same /24 |
215 | 263 | if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) |
@@ -239,10 +287,12 @@ discard block |
||
239 | 287 | $logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl); |
240 | 288 | // Add is_site_admin bool variable into logged_info if site_administrator is |
241 | 289 | $oModuleModel = getModel('module'); |
242 | - if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; |
|
243 | - else $logged_info->is_site_admin = false; |
|
244 | - } |
|
245 | - else |
|
290 | + if($oModuleModel->isSiteAdmin($logged_info)) { |
|
291 | + $logged_info->is_site_admin = true; |
|
292 | + } else { |
|
293 | + $logged_info->is_site_admin = false; |
|
294 | + } |
|
295 | + } else |
|
246 | 296 | { |
247 | 297 | // Register a default group if the site doesn't have a member group |
248 | 298 | if(count($logged_info->group_list) === 0) |
@@ -268,13 +318,19 @@ discard block |
||
268 | 318 | */ |
269 | 319 | function getMemberInfoByUserID($user_id, $columnList = array()) |
270 | 320 | { |
271 | - if(!$user_id) return; |
|
321 | + if(!$user_id) { |
|
322 | + return; |
|
323 | + } |
|
272 | 324 | |
273 | 325 | $args = new stdClass; |
274 | 326 | $args->user_id = $user_id; |
275 | 327 | $output = executeQuery('member.getMemberInfo', $args); |
276 | - if(!$output->toBool()) return $output; |
|
277 | - if(!$output->data) return; |
|
328 | + if(!$output->toBool()) { |
|
329 | + return $output; |
|
330 | + } |
|
331 | + if(!$output->data) { |
|
332 | + return; |
|
333 | + } |
|
278 | 334 | |
279 | 335 | $member_info = $this->arrangeMemberInfo($output->data); |
280 | 336 | |
@@ -286,7 +342,9 @@ discard block |
||
286 | 342 | */ |
287 | 343 | function getMemberInfoByEmailAddress($email_address) |
288 | 344 | { |
289 | - if(!$email_address) return; |
|
345 | + if(!$email_address) { |
|
346 | + return; |
|
347 | + } |
|
290 | 348 | |
291 | 349 | $args = new stdClass(); |
292 | 350 | |
@@ -295,15 +353,18 @@ discard block |
||
295 | 353 | { |
296 | 354 | $args->email_address = strtolower($email_address); |
297 | 355 | $output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args); |
298 | - } |
|
299 | - else |
|
356 | + } else |
|
300 | 357 | { |
301 | 358 | $args->email_address = $email_address; |
302 | 359 | $output = executeQuery('member.getMemberInfoByEmailAddress', $args); |
303 | 360 | } |
304 | 361 | |
305 | - if(!$output->toBool()) return $output; |
|
306 | - if(!$output->data) return; |
|
362 | + if(!$output->toBool()) { |
|
363 | + return $output; |
|
364 | + } |
|
365 | + if(!$output->data) { |
|
366 | + return; |
|
367 | + } |
|
307 | 368 | |
308 | 369 | $member_info = $this->arrangeMemberInfo($output->data); |
309 | 370 | return $member_info; |
@@ -314,7 +375,9 @@ discard block |
||
314 | 375 | */ |
315 | 376 | function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array()) |
316 | 377 | { |
317 | - if(!$member_srl) return; |
|
378 | + if(!$member_srl) { |
|
379 | + return; |
|
380 | + } |
|
318 | 381 | |
319 | 382 | //columnList size zero... get full member info |
320 | 383 | if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0) |
@@ -337,13 +400,17 @@ discard block |
||
337 | 400 | $output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList); |
338 | 401 | if(!$output->data) |
339 | 402 | { |
340 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass); |
|
403 | + if($oCacheHandler->isSupport()) { |
|
404 | + $oCacheHandler->put($cache_key, new stdClass); |
|
405 | + } |
|
341 | 406 | return; |
342 | 407 | } |
343 | 408 | $this->arrangeMemberInfo($output->data, $site_srl); |
344 | 409 | |
345 | 410 | //insert in cache |
346 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
411 | + if($oCacheHandler->isSupport()) { |
|
412 | + $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
413 | + } |
|
347 | 414 | } |
348 | 415 | } |
349 | 416 | |
@@ -377,8 +444,12 @@ discard block |
||
377 | 444 | { |
378 | 445 | foreach($extra_vars as $key => $val) |
379 | 446 | { |
380 | - if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val); |
|
381 | - if(!$info->{$key}) $info->{$key} = $val; |
|
447 | + if(!is_array($val) && strpos($val, '|@|') !== FALSE) { |
|
448 | + $val = explode('|@|', $val); |
|
449 | + } |
|
450 | + if(!$info->{$key}) { |
|
451 | + $info->{$key} = $val; |
|
452 | + } |
|
382 | 453 | } |
383 | 454 | } |
384 | 455 | |
@@ -401,8 +472,7 @@ discard block |
||
401 | 472 | if(is_array($val)) |
402 | 473 | { |
403 | 474 | $oSecurity->encodeHTML($key . '.'); |
404 | - } |
|
405 | - else |
|
475 | + } else |
|
406 | 476 | { |
407 | 477 | $oSecurity->encodeHTML($key); |
408 | 478 | } |
@@ -465,7 +535,9 @@ discard block |
||
465 | 535 | */ |
466 | 536 | function getLoggedMemberSrl() |
467 | 537 | { |
468 | - if(!$this->isLogged()) return; |
|
538 | + if(!$this->isLogged()) { |
|
539 | + return; |
|
540 | + } |
|
469 | 541 | return $_SESSION['member_srl']; |
470 | 542 | } |
471 | 543 | |
@@ -474,7 +546,9 @@ discard block |
||
474 | 546 | */ |
475 | 547 | function getLoggedUserID() |
476 | 548 | { |
477 | - if(!$this->isLogged()) return; |
|
549 | + if(!$this->isLogged()) { |
|
550 | + return; |
|
551 | + } |
|
478 | 552 | $logged_info = Context::get('logged_info'); |
479 | 553 | return $logged_info->user_id; |
480 | 554 | } |
@@ -506,9 +580,13 @@ discard block |
||
506 | 580 | $output = executeQueryArray('member.getMemberGroups', $args); |
507 | 581 | $group_list = $output->data; |
508 | 582 | //insert in cache |
509 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
583 | + if($oCacheHandler->isSupport()) { |
|
584 | + $oCacheHandler->put($cache_key, $group_list); |
|
585 | + } |
|
586 | + } |
|
587 | + if(!$group_list) { |
|
588 | + return array(); |
|
510 | 589 | } |
511 | - if(!$group_list) return array(); |
|
512 | 590 | |
513 | 591 | foreach($group_list as $group) |
514 | 592 | { |
@@ -528,7 +606,9 @@ discard block |
||
528 | 606 | $args->site_srl = $site_srl; |
529 | 607 | $args->sort_index = 'list_order'; |
530 | 608 | $output = executeQueryArray('member.getMembersGroups', $args); |
531 | - if(!$output->data) return array(); |
|
609 | + if(!$output->data) { |
|
610 | + return array(); |
|
611 | + } |
|
532 | 612 | |
533 | 613 | $result = array(); |
534 | 614 | foreach($output->data as $key=>$val) |
@@ -620,7 +700,9 @@ discard block |
||
620 | 700 | $output = executeQueryArray('member.getGroups', $args); |
621 | 701 | $group_list = $output->data; |
622 | 702 | //insert in cache |
623 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
703 | + if($oCacheHandler->isSupport()) { |
|
704 | + $oCacheHandler->put($cache_key, $group_list); |
|
705 | + } |
|
624 | 706 | } |
625 | 707 | |
626 | 708 | if(!$group_list) |
@@ -668,9 +750,13 @@ discard block |
||
668 | 750 | $output = executeQuery('member.getJoinFormList', $args); |
669 | 751 | // NULL if output data deosn't exist |
670 | 752 | $join_form_list = $output->data; |
671 | - if(!$join_form_list) return NULL; |
|
753 | + if(!$join_form_list) { |
|
754 | + return NULL; |
|
755 | + } |
|
672 | 756 | // Need to unserialize because serialized array is inserted into DB in case of default_value |
673 | - if(!is_array($join_form_list)) $join_form_list = array($join_form_list); |
|
757 | + if(!is_array($join_form_list)) { |
|
758 | + $join_form_list = array($join_form_list); |
|
759 | + } |
|
674 | 760 | $join_form_count = count($join_form_list); |
675 | 761 | for($i=0;$i<$join_form_count;$i++) |
676 | 762 | { |
@@ -687,9 +773,10 @@ discard block |
||
687 | 773 | if(in_array($column_type, array('checkbox','select','radio'))) |
688 | 774 | { |
689 | 775 | $join_form_list[$i]->default_value = unserialize($default_value); |
690 | - if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = ''; |
|
691 | - } |
|
692 | - else |
|
776 | + if(!$join_form_list[$i]->default_value[0]) { |
|
777 | + $join_form_list[$i]->default_value = ''; |
|
778 | + } |
|
779 | + } else |
|
693 | 780 | { |
694 | 781 | $join_form_list[$i]->default_value = ''; |
695 | 782 | } |
@@ -703,13 +790,18 @@ discard block |
||
703 | 790 | { |
704 | 791 | foreach($this->join_form_list as $key => $val) |
705 | 792 | { |
706 | - if($val->is_active != 'Y') continue; |
|
793 | + if($val->is_active != 'Y') { |
|
794 | + continue; |
|
795 | + } |
|
707 | 796 | unset($obj); |
708 | 797 | $obj->type = $val->column_type; |
709 | 798 | $obj->name = $val->column_name; |
710 | 799 | $obj->lang = $val->column_title; |
711 | - if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false; |
|
712 | - else $obj->required = false; |
|
800 | + if($logged_info->is_admin != 'Y') { |
|
801 | + $obj->required = $val->required=='Y'?true:false; |
|
802 | + } else { |
|
803 | + $obj->required = false; |
|
804 | + } |
|
713 | 805 | $filter_output[] = $obj; |
714 | 806 | |
715 | 807 | unset($open_obj); |
@@ -760,7 +852,9 @@ discard block |
||
760 | 852 | function getCombineJoinForm($member_info) |
761 | 853 | { |
762 | 854 | $extend_form_list = $this->getJoinFormlist(); |
763 | - if(!$extend_form_list) return; |
|
855 | + if(!$extend_form_list) { |
|
856 | + return; |
|
857 | + } |
|
764 | 858 | // Member info is open only to an administrator and him/herself when is_private is true. |
765 | 859 | $logged_info = Context::get('logged_info'); |
766 | 860 | |
@@ -773,7 +867,9 @@ discard block |
||
773 | 867 | switch($item->column_type) |
774 | 868 | { |
775 | 869 | case 'checkbox' : |
776 | - if($value && !is_array($value)) $value = array($value); |
|
870 | + if($value && !is_array($value)) { |
|
871 | + $value = array($value); |
|
872 | + } |
|
777 | 873 | break; |
778 | 874 | case 'text' : |
779 | 875 | case 'homepage' : |
@@ -787,8 +883,11 @@ discard block |
||
787 | 883 | |
788 | 884 | $extend_form_list[$srl]->value = $value; |
789 | 885 | |
790 | - if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true; |
|
791 | - else $extend_form_list[$srl]->is_opened = false; |
|
886 | + if($member_info->{'open_'.$column_name}=='Y') { |
|
887 | + $extend_form_list[$srl]->is_opened = true; |
|
888 | + } else { |
|
889 | + $extend_form_list[$srl]->is_opened = false; |
|
890 | + } |
|
792 | 891 | } |
793 | 892 | return $extend_form_list; |
794 | 893 | } |
@@ -801,7 +900,9 @@ discard block |
||
801 | 900 | $args->member_join_form_srl = $member_join_form_srl; |
802 | 901 | $output = executeQuery('member.getJoinForm', $args); |
803 | 902 | $join_form = $output->data; |
804 | - if(!$join_form) return NULL; |
|
903 | + if(!$join_form) { |
|
904 | + return NULL; |
|
905 | + } |
|
805 | 906 | |
806 | 907 | $column_type = $join_form->column_type; |
807 | 908 | $default_value = $join_form->default_value; |
@@ -809,8 +910,7 @@ discard block |
||
809 | 910 | if(in_array($column_type, array('checkbox','select','radio'))) |
810 | 911 | { |
811 | 912 | $join_form->default_value = unserialize($default_value); |
812 | - } |
|
813 | - else |
|
913 | + } else |
|
814 | 914 | { |
815 | 915 | $join_form->default_value = ''; |
816 | 916 | } |
@@ -839,7 +939,9 @@ discard block |
||
839 | 939 | function getDeniedIDs() |
840 | 940 | { |
841 | 941 | $output = executeQueryArray('member.getDeniedIDs'); |
842 | - if(!$output->toBool()) return array(); |
|
942 | + if(!$output->toBool()) { |
|
943 | + return array(); |
|
944 | + } |
|
843 | 945 | return $output->data; |
844 | 946 | } |
845 | 947 | |
@@ -862,7 +964,9 @@ discard block |
||
862 | 964 | $args = new stdClass(); |
863 | 965 | $args->user_id = $user_id; |
864 | 966 | $output = executeQuery('member.chkDeniedID', $args); |
865 | - if($output->data->count) return true; |
|
967 | + if($output->data->count) { |
|
968 | + return true; |
|
969 | + } |
|
866 | 970 | return false; |
867 | 971 | } |
868 | 972 | |
@@ -874,7 +978,9 @@ discard block |
||
874 | 978 | $args = new stdClass(); |
875 | 979 | $args->nick_name = $nickName; |
876 | 980 | $output = executeQuery('member.chkDeniedNickName', $args); |
877 | - if($output->data->count) return true; |
|
981 | + if($output->data->count) { |
|
982 | + return true; |
|
983 | + } |
|
878 | 984 | if(!$output->toBool()) |
879 | 985 | { |
880 | 986 | return true; |
@@ -927,8 +1033,9 @@ discard block |
||
927 | 1033 | $info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file)); |
928 | 1034 | $info->file = './'.$image_name_file; |
929 | 1035 | $GLOBALS['__member_info__']['image_name'][$member_srl] = $info; |
1036 | + } else { |
|
1037 | + $GLOBALS['__member_info__']['image_name'][$member_srl] = null; |
|
930 | 1038 | } |
931 | - else $GLOBALS['__member_info__']['image_name'][$member_srl] = null; |
|
932 | 1039 | } |
933 | 1040 | return $GLOBALS['__member_info__']['image_name'][$member_srl]; |
934 | 1041 | } |
@@ -949,8 +1056,9 @@ discard block |
||
949 | 1056 | $info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file)); |
950 | 1057 | $info->file = './'.$image_mark_file; |
951 | 1058 | $GLOBALS['__member_info__']['image_mark'][$member_srl] = $info; |
1059 | + } else { |
|
1060 | + $GLOBALS['__member_info__']['image_mark'][$member_srl] = null; |
|
952 | 1061 | } |
953 | - else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null; |
|
954 | 1062 | } |
955 | 1063 | |
956 | 1064 | return $GLOBALS['__member_info__']['image_mark'][$member_srl]; |
@@ -992,9 +1100,13 @@ discard block |
||
992 | 1100 | } |
993 | 1101 | } |
994 | 1102 | } |
995 | - if (!$info) $GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N'; |
|
1103 | + if (!$info) { |
|
1104 | + $GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N'; |
|
1105 | + } |
|
1106 | + } |
|
1107 | + if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') { |
|
1108 | + return null; |
|
996 | 1109 | } |
997 | - if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') return null; |
|
998 | 1110 | |
999 | 1111 | return $GLOBALS['__member_info__']['group_image_mark'][$member_srl]; |
1000 | 1112 | } |
@@ -1012,8 +1124,9 @@ discard block |
||
1012 | 1124 | $buff = FileHandler::readFile($filename); |
1013 | 1125 | $signature = preg_replace('/<\?.*?\?>/', '', $buff); |
1014 | 1126 | $GLOBALS['__member_info__']['signature'][$member_srl] = $signature; |
1127 | + } else { |
|
1128 | + $GLOBALS['__member_info__']['signature'][$member_srl] = null; |
|
1015 | 1129 | } |
1016 | - else $GLOBALS['__member_info__']['signature'][$member_srl] = null; |
|
1017 | 1130 | } |
1018 | 1131 | return $GLOBALS['__member_info__']['signature'][$member_srl]; |
1019 | 1132 | } |
@@ -1051,14 +1164,18 @@ discard block |
||
1051 | 1164 | if(!$need_upgrade) |
1052 | 1165 | { |
1053 | 1166 | $required_algorithm = $oPassword->getCurrentlySelectedAlgorithm(); |
1054 | - if($required_algorithm !== $current_algorithm) $need_upgrade = true; |
|
1167 | + if($required_algorithm !== $current_algorithm) { |
|
1168 | + $need_upgrade = true; |
|
1169 | + } |
|
1055 | 1170 | } |
1056 | 1171 | |
1057 | 1172 | if(!$need_upgrade) |
1058 | 1173 | { |
1059 | 1174 | $required_work_factor = $oPassword->getWorkFactor(); |
1060 | 1175 | $current_work_factor = $oPassword->checkWorkFactor($hashed_password); |
1061 | - if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; |
|
1176 | + if($current_work_factor !== false && $required_work_factor > $current_work_factor) { |
|
1177 | + $need_upgrade = true; |
|
1178 | + } |
|
1062 | 1179 | } |
1063 | 1180 | |
1064 | 1181 | if($need_upgrade === true) |
@@ -1089,7 +1206,9 @@ discard block |
||
1089 | 1206 | function checkPasswordStrength($password, $strength) |
1090 | 1207 | { |
1091 | 1208 | $logged_info = Context::get('logged_info'); |
1092 | - if($logged_info->is_admin == 'Y') return true; |
|
1209 | + if($logged_info->is_admin == 'Y') { |
|
1210 | + return true; |
|
1211 | + } |
|
1093 | 1212 | |
1094 | 1213 | if($strength == NULL) |
1095 | 1214 | { |
@@ -1101,15 +1220,21 @@ discard block |
||
1101 | 1220 | |
1102 | 1221 | switch ($strength) { |
1103 | 1222 | case 'high': |
1104 | - if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false; |
|
1223 | + if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) { |
|
1224 | + return false; |
|
1225 | + } |
|
1105 | 1226 | /* no break */ |
1106 | 1227 | |
1107 | 1228 | case 'normal': |
1108 | - if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false; |
|
1229 | + if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) { |
|
1230 | + return false; |
|
1231 | + } |
|
1109 | 1232 | break; |
1110 | 1233 | |
1111 | 1234 | case 'low': |
1112 | - if($length < 4) return false; |
|
1235 | + if($length < 4) { |
|
1236 | + return false; |
|
1237 | + } |
|
1113 | 1238 | break; |
1114 | 1239 | } |
1115 | 1240 |