@@ -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,42 +35,42 @@ 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'; |
|
56 | - if(!$config->image_name_max_width) $config->image_name_max_width = 90; |
|
57 | - if(!$config->image_name_max_height) $config->image_name_max_height = 20; |
|
58 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = 20; |
|
59 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = 20; |
|
60 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = 90; |
|
61 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = 90; |
|
62 | - if(!$config->skin) $config->skin = 'default'; |
|
63 | - if(!$config->colorset) $config->colorset = 'white'; |
|
64 | - if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor'; |
|
65 | - if(!$config->group_image_mark) $config->group_image_mark = "N"; |
|
55 | + if (!$config->webmaster_name) $config->webmaster_name = 'webmaster'; |
|
56 | + if (!$config->image_name_max_width) $config->image_name_max_width = 90; |
|
57 | + if (!$config->image_name_max_height) $config->image_name_max_height = 20; |
|
58 | + if (!$config->image_mark_max_width) $config->image_mark_max_width = 20; |
|
59 | + if (!$config->image_mark_max_height) $config->image_mark_max_height = 20; |
|
60 | + if (!$config->profile_image_max_width) $config->profile_image_max_width = 90; |
|
61 | + if (!$config->profile_image_max_height) $config->profile_image_max_height = 90; |
|
62 | + if (!$config->skin) $config->skin = 'default'; |
|
63 | + if (!$config->colorset) $config->colorset = 'white'; |
|
64 | + if (!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor'; |
|
65 | + if (!$config->group_image_mark) $config->group_image_mark = "N"; |
|
66 | 66 | |
67 | - if(!$config->identifier) $config->identifier = 'user_id'; |
|
67 | + if (!$config->identifier) $config->identifier = 'user_id'; |
|
68 | 68 | |
69 | - if(!$config->max_error_count) $config->max_error_count = 10; |
|
70 | - if(!$config->max_error_count_time) $config->max_error_count_time = 300; |
|
69 | + if (!$config->max_error_count) $config->max_error_count = 10; |
|
70 | + if (!$config->max_error_count_time) $config->max_error_count_time = 300; |
|
71 | 71 | |
72 | - if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor'; |
|
73 | - if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono'; |
|
72 | + if (!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor'; |
|
73 | + if (!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono'; |
|
74 | 74 | |
75 | 75 | $member_config = $config; |
76 | 76 | |
@@ -79,24 +79,24 @@ discard block |
||
79 | 79 | |
80 | 80 | function _getAgreement() |
81 | 81 | { |
82 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
83 | - if(is_readable($agreement_file)) |
|
82 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
83 | + if (is_readable($agreement_file)) |
|
84 | 84 | { |
85 | 85 | return FileHandler::readFile($agreement_file); |
86 | 86 | } |
87 | 87 | |
88 | 88 | $db_info = Context::getDBInfo(); |
89 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $db_info->lang_type . '.txt'; |
|
90 | - if(is_readable($agreement_file)) |
|
89 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$db_info->lang_type.'.txt'; |
|
90 | + if (is_readable($agreement_file)) |
|
91 | 91 | { |
92 | 92 | return FileHandler::readFile($agreement_file); |
93 | 93 | } |
94 | 94 | |
95 | 95 | $lang_selected = Context::loadLangSelected(); |
96 | - foreach($lang_selected as $key => $val) |
|
96 | + foreach ($lang_selected as $key => $val) |
|
97 | 97 | { |
98 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $key . '.txt'; |
|
99 | - if(is_readable($agreement_file)) |
|
98 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$key.'.txt'; |
|
99 | + if (is_readable($agreement_file)) |
|
100 | 100 | { |
101 | 101 | return FileHandler::readFile($agreement_file); |
102 | 102 | } |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | $logged_info = Context::get('logged_info'); |
117 | 117 | $act = Context::get('cur_act'); |
118 | 118 | // When click user's own nickname |
119 | - if($member_srl == $logged_info->member_srl) $member_info = $logged_info; |
|
119 | + if ($member_srl == $logged_info->member_srl) $member_info = $logged_info; |
|
120 | 120 | // When click other's nickname |
121 | 121 | else $member_info = $this->getMemberInfoByMemberSrl($member_srl); |
122 | 122 | |
123 | 123 | $member_srl = $member_info->member_srl; |
124 | - if(!$member_srl) return; |
|
124 | + if (!$member_srl) return; |
|
125 | 125 | // List variables |
126 | 126 | $user_id = $member_info->user_id; |
127 | 127 | $user_name = $member_info->user_name; |
@@ -130,18 +130,18 @@ discard block |
||
130 | 130 | |
131 | 131 | $oMemberController = getController('member'); |
132 | 132 | // Display member information (Don't display to non-logged user) |
133 | - if($logged_info->member_srl) |
|
133 | + if ($logged_info->member_srl) |
|
134 | 134 | { |
135 | - $url = getUrl('','mid',$mid,'act','dispMemberInfo','member_srl',$member_srl); |
|
136 | - $oMemberController->addMemberPopupMenu($url,'cmd_view_member_info',$icon_path,'self'); |
|
135 | + $url = getUrl('', 'mid', $mid, 'act', 'dispMemberInfo', 'member_srl', $member_srl); |
|
136 | + $oMemberController->addMemberPopupMenu($url, 'cmd_view_member_info', $icon_path, 'self'); |
|
137 | 137 | } |
138 | 138 | // When click other's nickname |
139 | - if($member_srl != $logged_info->member_srl && $logged_info->member_srl) |
|
139 | + if ($member_srl != $logged_info->member_srl && $logged_info->member_srl) |
|
140 | 140 | { |
141 | 141 | // Get email config |
142 | - foreach($this->module_config->signupForm as $field) |
|
142 | + foreach ($this->module_config->signupForm as $field) |
|
143 | 143 | { |
144 | - if($field->name == 'email_address') |
|
144 | + if ($field->name == 'email_address') |
|
145 | 145 | { |
146 | 146 | $email_config = $field; |
147 | 147 | break; |
@@ -149,36 +149,36 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | // Send an email only if email address is public |
152 | - if(($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address) |
|
152 | + if (($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address) |
|
153 | 153 | { |
154 | 154 | $url = 'mailto:'.htmlspecialchars($member_info->email_address, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
155 | - $oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path); |
|
155 | + $oMemberController->addMemberPopupMenu($url, 'cmd_send_email', $icon_path); |
|
156 | 156 | } |
157 | 157 | } |
158 | 158 | // View homepage info |
159 | - if($member_info->homepage) |
|
159 | + if ($member_info->homepage) |
|
160 | 160 | $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank'); |
161 | 161 | // View blog info |
162 | - if($member_info->blog) |
|
162 | + if ($member_info->blog) |
|
163 | 163 | $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank'); |
164 | 164 | // Call a trigger (after) |
165 | 165 | ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null); |
166 | 166 | // Display a menu for editting member info to a top administrator |
167 | - if($logged_info->is_admin == 'Y') |
|
167 | + if ($logged_info->is_admin == 'Y') |
|
168 | 168 | { |
169 | - $url = getUrl('','module','admin','act','dispMemberAdminInsert','member_srl',$member_srl); |
|
170 | - $oMemberController->addMemberPopupMenu($url,'cmd_manage_member_info',$icon_path,'MemberModifyInfo'); |
|
169 | + $url = getUrl('', 'module', 'admin', 'act', 'dispMemberAdminInsert', 'member_srl', $member_srl); |
|
170 | + $oMemberController->addMemberPopupMenu($url, 'cmd_manage_member_info', $icon_path, 'MemberModifyInfo'); |
|
171 | 171 | |
172 | - $url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','member_srl','search_keyword',$member_srl); |
|
173 | - $oMemberController->addMemberPopupMenu($url,'cmd_trace_document',$icon_path,'TraceMemberDocument'); |
|
172 | + $url = getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl); |
|
173 | + $oMemberController->addMemberPopupMenu($url, 'cmd_trace_document', $icon_path, 'TraceMemberDocument'); |
|
174 | 174 | |
175 | - $url = getUrl('','module','admin','act','dispCommentAdminList','search_target','member_srl','search_keyword',$member_srl); |
|
176 | - $oMemberController->addMemberPopupMenu($url,'cmd_trace_comment',$icon_path,'TraceMemberComment'); |
|
175 | + $url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl); |
|
176 | + $oMemberController->addMemberPopupMenu($url, 'cmd_trace_comment', $icon_path, 'TraceMemberComment'); |
|
177 | 177 | } |
178 | 178 | // Change a language of pop-up menu |
179 | 179 | $menus = Context::get('member_popup_menu_list'); |
180 | 180 | $menus_count = count($menus); |
181 | - for($i=0;$i<$menus_count;$i++) |
|
181 | + for ($i = 0; $i < $menus_count; $i++) |
|
182 | 182 | { |
183 | 183 | $menus[$i]->str = Context::getLang($menus[$i]->str); |
184 | 184 | } |
@@ -190,15 +190,15 @@ discard block |
||
190 | 190 | * @brief Check if logged-in |
191 | 191 | */ |
192 | 192 | function isLogged() { |
193 | - if($_SESSION['is_logged']) |
|
193 | + if ($_SESSION['is_logged']) |
|
194 | 194 | { |
195 | - if(Mobile::isFromMobilePhone()) |
|
195 | + if (Mobile::isFromMobilePhone()) |
|
196 | 196 | { |
197 | 197 | return true; |
198 | 198 | } |
199 | 199 | else |
200 | 200 | { |
201 | - if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) |
|
201 | + if (ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) |
|
202 | 202 | { |
203 | 203 | return true; |
204 | 204 | } |
@@ -215,23 +215,23 @@ discard block |
||
215 | 215 | function getLoggedInfo() |
216 | 216 | { |
217 | 217 | // Return session info if session info is requested and the user is logged-in |
218 | - if($this->isLogged()) |
|
218 | + if ($this->isLogged()) |
|
219 | 219 | { |
220 | 220 | $logged_info = Context::get('logged_info'); |
221 | 221 | // Admin/Group list defined depending on site_module_info |
222 | 222 | $site_module_info = Context::get('site_module_info'); |
223 | - if($site_module_info->site_srl) |
|
223 | + if ($site_module_info->site_srl) |
|
224 | 224 | { |
225 | 225 | $logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl); |
226 | 226 | // Add is_site_admin bool variable into logged_info if site_administrator is |
227 | 227 | $oModuleModel = getModel('module'); |
228 | - if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; |
|
228 | + if ($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; |
|
229 | 229 | else $logged_info->is_site_admin = false; |
230 | 230 | } |
231 | 231 | else |
232 | 232 | { |
233 | 233 | // Register a default group if the site doesn't have a member group |
234 | - if(count($logged_info->group_list) === 0) |
|
234 | + if (count($logged_info->group_list) === 0) |
|
235 | 235 | { |
236 | 236 | $default_group = $this->getDefaultGroup(0); |
237 | 237 | $oMemberController = getController('member'); |
@@ -254,13 +254,13 @@ discard block |
||
254 | 254 | */ |
255 | 255 | function getMemberInfoByUserID($user_id, $columnList = array()) |
256 | 256 | { |
257 | - if(!$user_id) return; |
|
257 | + if (!$user_id) return; |
|
258 | 258 | |
259 | 259 | $args = new stdClass; |
260 | 260 | $args->user_id = $user_id; |
261 | 261 | $output = executeQuery('member.getMemberInfo', $args); |
262 | - if(!$output->toBool()) return $output; |
|
263 | - if(!$output->data) return; |
|
262 | + if (!$output->toBool()) return $output; |
|
263 | + if (!$output->data) return; |
|
264 | 264 | |
265 | 265 | $member_info = $this->arrangeMemberInfo($output->data); |
266 | 266 | |
@@ -272,12 +272,12 @@ discard block |
||
272 | 272 | */ |
273 | 273 | function getMemberInfoByEmailAddress($email_address) |
274 | 274 | { |
275 | - if(!$email_address) return; |
|
275 | + if (!$email_address) return; |
|
276 | 276 | |
277 | 277 | $args = new stdClass(); |
278 | 278 | |
279 | - $db_info = Context::getDBInfo (); |
|
280 | - if($db_info->master_db['db_type'] == "cubrid") |
|
279 | + $db_info = Context::getDBInfo(); |
|
280 | + if ($db_info->master_db['db_type'] == "cubrid") |
|
281 | 281 | { |
282 | 282 | $args->email_address = strtolower($email_address); |
283 | 283 | $output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args); |
@@ -288,8 +288,8 @@ discard block |
||
288 | 288 | $output = executeQuery('member.getMemberInfoByEmailAddress', $args); |
289 | 289 | } |
290 | 290 | |
291 | - if(!$output->toBool()) return $output; |
|
292 | - if(!$output->data) return; |
|
291 | + if (!$output->toBool()) return $output; |
|
292 | + if (!$output->data) return; |
|
293 | 293 | |
294 | 294 | $member_info = $this->arrangeMemberInfo($output->data); |
295 | 295 | return $member_info; |
@@ -300,36 +300,36 @@ discard block |
||
300 | 300 | */ |
301 | 301 | function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array()) |
302 | 302 | { |
303 | - if(!$member_srl) return; |
|
303 | + if (!$member_srl) return; |
|
304 | 304 | |
305 | 305 | //columnList size zero... get full member info |
306 | - if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0) |
|
306 | + if (!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0) |
|
307 | 307 | { |
308 | 308 | $GLOBALS['__member_info__'][$member_srl] = false; |
309 | 309 | |
310 | 310 | $oCacheHandler = CacheHandler::getInstance('object'); |
311 | - if($oCacheHandler->isSupport()) |
|
311 | + if ($oCacheHandler->isSupport()) |
|
312 | 312 | { |
313 | 313 | $columnList = array(); |
314 | - $object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl; |
|
314 | + $object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl; |
|
315 | 315 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
316 | 316 | $GLOBALS['__member_info__'][$member_srl] = $oCacheHandler->get($cache_key); |
317 | 317 | } |
318 | 318 | |
319 | - if($GLOBALS['__member_info__'][$member_srl] === false) |
|
319 | + if ($GLOBALS['__member_info__'][$member_srl] === false) |
|
320 | 320 | { |
321 | 321 | $args = new stdClass(); |
322 | 322 | $args->member_srl = $member_srl; |
323 | 323 | $output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList); |
324 | - if(!$output->data) |
|
324 | + if (!$output->data) |
|
325 | 325 | { |
326 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass); |
|
326 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass); |
|
327 | 327 | return; |
328 | 328 | } |
329 | 329 | $this->arrangeMemberInfo($output->data, $site_srl); |
330 | 330 | |
331 | 331 | //insert in cache |
332 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
332 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
333 | 333 | } |
334 | 334 | } |
335 | 335 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | */ |
342 | 342 | function arrangeMemberInfo($info, $site_srl = 0) |
343 | 343 | { |
344 | - if(!$GLOBALS['__member_info__'][$info->member_srl]) |
|
344 | + if (!$GLOBALS['__member_info__'][$info->member_srl]) |
|
345 | 345 | { |
346 | 346 | $oModuleModel = getModel('module'); |
347 | 347 | $config = $oModuleModel->getModuleConfig('member'); |
@@ -350,25 +350,25 @@ discard block |
||
350 | 350 | $info->profile_image = $this->getProfileImage($info->member_srl); |
351 | 351 | $info->image_name = $this->getImageName($info->member_srl); |
352 | 352 | $info->image_mark = $this->getImageMark($info->member_srl); |
353 | - if($config->group_image_mark=='Y') |
|
353 | + if ($config->group_image_mark == 'Y') |
|
354 | 354 | { |
355 | - $info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl); |
|
355 | + $info->group_mark = $this->getGroupImageMark($info->member_srl, $site_srl); |
|
356 | 356 | } |
357 | 357 | $info->signature = $this->getSignature($info->member_srl); |
358 | 358 | $info->group_list = $this->getMemberGroups($info->member_srl, $site_srl); |
359 | 359 | |
360 | 360 | $extra_vars = unserialize($info->extra_vars); |
361 | 361 | unset($info->extra_vars); |
362 | - if($extra_vars) |
|
362 | + if ($extra_vars) |
|
363 | 363 | { |
364 | - foreach($extra_vars as $key => $val) |
|
364 | + foreach ($extra_vars as $key => $val) |
|
365 | 365 | { |
366 | - if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val); |
|
367 | - if(!$info->{$key}) $info->{$key} = $val; |
|
366 | + if (!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val); |
|
367 | + if (!$info->{$key}) $info->{$key} = $val; |
|
368 | 368 | } |
369 | 369 | } |
370 | 370 | |
371 | - if(strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer)) |
|
371 | + if (strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer)) |
|
372 | 372 | { |
373 | 373 | $info->find_account_answer = null; |
374 | 374 | } |
@@ -380,13 +380,13 @@ discard block |
||
380 | 380 | $info->homepage = strip_tags($info->homepage); |
381 | 381 | $info->blog = strip_tags($info->blog); |
382 | 382 | |
383 | - if($extra_vars) |
|
383 | + if ($extra_vars) |
|
384 | 384 | { |
385 | - foreach($extra_vars as $key => $val) |
|
385 | + foreach ($extra_vars as $key => $val) |
|
386 | 386 | { |
387 | - if(is_array($val)) |
|
387 | + if (is_array($val)) |
|
388 | 388 | { |
389 | - $oSecurity->encodeHTML($key . '.'); |
|
389 | + $oSecurity->encodeHTML($key.'.'); |
|
390 | 390 | } |
391 | 391 | else |
392 | 392 | { |
@@ -397,12 +397,12 @@ discard block |
||
397 | 397 | |
398 | 398 | // Check format. |
399 | 399 | $oValidator = new Validator(); |
400 | - if(!$oValidator->applyRule('url', $info->homepage)) |
|
400 | + if (!$oValidator->applyRule('url', $info->homepage)) |
|
401 | 401 | { |
402 | 402 | $info->homepage = ''; |
403 | 403 | } |
404 | 404 | |
405 | - if(!$oValidator->applyRule('url', $info->blog)) |
|
405 | + if (!$oValidator->applyRule('url', $info->blog)) |
|
406 | 406 | { |
407 | 407 | $info->blog = ''; |
408 | 408 | } |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | */ |
452 | 452 | function getLoggedMemberSrl() |
453 | 453 | { |
454 | - if(!$this->isLogged()) return; |
|
454 | + if (!$this->isLogged()) return; |
|
455 | 455 | return $_SESSION['member_srl']; |
456 | 456 | } |
457 | 457 | |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | */ |
461 | 461 | function getLoggedUserID() |
462 | 462 | { |
463 | - if(!$this->isLogged()) return; |
|
463 | + if (!$this->isLogged()) return; |
|
464 | 464 | $logged_info = Context::get('logged_info'); |
465 | 465 | return $logged_info->user_id; |
466 | 466 | } |
@@ -475,16 +475,16 @@ discard block |
||
475 | 475 | // cache controll |
476 | 476 | $group_list = false; |
477 | 477 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
478 | - if($oCacheHandler->isSupport()) |
|
478 | + if ($oCacheHandler->isSupport()) |
|
479 | 479 | { |
480 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_'.$site_srl; |
|
480 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl; |
|
481 | 481 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
482 | 482 | $group_list = $oCacheHandler->get($cache_key); |
483 | 483 | } |
484 | 484 | |
485 | - if(!$member_groups[$member_srl][$site_srl] || $force_reload) |
|
485 | + if (!$member_groups[$member_srl][$site_srl] || $force_reload) |
|
486 | 486 | { |
487 | - if($group_list === false) |
|
487 | + if ($group_list === false) |
|
488 | 488 | { |
489 | 489 | $args = new stdClass(); |
490 | 490 | $args->member_srl = $member_srl; |
@@ -492,11 +492,11 @@ discard block |
||
492 | 492 | $output = executeQueryArray('member.getMemberGroups', $args); |
493 | 493 | $group_list = $output->data; |
494 | 494 | //insert in cache |
495 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
495 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
496 | 496 | } |
497 | - if(!$group_list) return array(); |
|
497 | + if (!$group_list) return array(); |
|
498 | 498 | |
499 | - foreach($group_list as $group) |
|
499 | + foreach ($group_list as $group) |
|
500 | 500 | { |
501 | 501 | $result[$group->group_srl] = $group->title; |
502 | 502 | } |
@@ -510,14 +510,14 @@ discard block |
||
510 | 510 | */ |
511 | 511 | function getMembersGroups($member_srls, $site_srl = 0) |
512 | 512 | { |
513 | - $args->member_srls = implode(',',$member_srls); |
|
513 | + $args->member_srls = implode(',', $member_srls); |
|
514 | 514 | $args->site_srl = $site_srl; |
515 | 515 | $args->sort_index = 'list_order'; |
516 | 516 | $output = executeQueryArray('member.getMembersGroups', $args); |
517 | - if(!$output->data) return array(); |
|
517 | + if (!$output->data) return array(); |
|
518 | 518 | |
519 | 519 | $result = array(); |
520 | - foreach($output->data as $key=>$val) |
|
520 | + foreach ($output->data as $key=>$val) |
|
521 | 521 | { |
522 | 522 | $result[$val->member_srl][] = $val->title; |
523 | 523 | } |
@@ -531,21 +531,21 @@ discard block |
||
531 | 531 | { |
532 | 532 | $default_group = false; |
533 | 533 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
534 | - if($oCacheHandler->isSupport()) |
|
534 | + if ($oCacheHandler->isSupport()) |
|
535 | 535 | { |
536 | 536 | $columnList = array(); |
537 | - $object_key = 'default_group_' . $site_srl; |
|
537 | + $object_key = 'default_group_'.$site_srl; |
|
538 | 538 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
539 | 539 | $default_group = $oCacheHandler->get($cache_key); |
540 | 540 | } |
541 | 541 | |
542 | - if($default_group === false) |
|
542 | + if ($default_group === false) |
|
543 | 543 | { |
544 | 544 | $args = new stdClass(); |
545 | 545 | $args->site_srl = $site_srl; |
546 | 546 | $output = executeQuery('member.getDefaultGroup', $args, $columnList); |
547 | 547 | $default_group = $output->data; |
548 | - if($oCacheHandler->isSupport()) |
|
548 | + if ($oCacheHandler->isSupport()) |
|
549 | 549 | { |
550 | 550 | $oCacheHandler->put($cache_key, $default_group); |
551 | 551 | } |
@@ -579,25 +579,25 @@ discard block |
||
579 | 579 | */ |
580 | 580 | function getGroups($site_srl = 0) |
581 | 581 | { |
582 | - if(!$GLOBALS['__group_info__'][$site_srl]) |
|
582 | + if (!$GLOBALS['__group_info__'][$site_srl]) |
|
583 | 583 | { |
584 | 584 | $result = array(); |
585 | 585 | |
586 | - if(!isset($site_srl)) |
|
586 | + if (!isset($site_srl)) |
|
587 | 587 | { |
588 | 588 | $site_srl = 0; |
589 | 589 | } |
590 | 590 | |
591 | 591 | $group_list = false; |
592 | 592 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
593 | - if($oCacheHandler->isSupport()) |
|
593 | + if ($oCacheHandler->isSupport()) |
|
594 | 594 | { |
595 | 595 | $object_key = 'member_groups:site_'.$site_srl; |
596 | 596 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
597 | 597 | $group_list = $oCacheHandler->get($cache_key); |
598 | 598 | } |
599 | 599 | |
600 | - if($group_list === false) |
|
600 | + if ($group_list === false) |
|
601 | 601 | { |
602 | 602 | $args = new stdClass(); |
603 | 603 | $args->site_srl = $site_srl; |
@@ -606,16 +606,16 @@ discard block |
||
606 | 606 | $output = executeQueryArray('member.getGroups', $args); |
607 | 607 | $group_list = $output->data; |
608 | 608 | //insert in cache |
609 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
609 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
610 | 610 | } |
611 | 611 | |
612 | - if(!$group_list) |
|
612 | + if (!$group_list) |
|
613 | 613 | { |
614 | 614 | return array(); |
615 | 615 | } |
616 | 616 | |
617 | 617 | |
618 | - foreach($group_list as $val) |
|
618 | + foreach ($group_list as $val) |
|
619 | 619 | { |
620 | 620 | $result[$val->group_srl] = $val; |
621 | 621 | } |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | // Set to ignore if a super administrator. |
647 | 647 | $logged_info = Context::get('logged_info'); |
648 | 648 | |
649 | - if(!$this->join_form_list) |
|
649 | + if (!$this->join_form_list) |
|
650 | 650 | { |
651 | 651 | // Argument setting to sort list_order column |
652 | 652 | $args = new stdClass(); |
@@ -654,11 +654,11 @@ discard block |
||
654 | 654 | $output = executeQuery('member.getJoinFormList', $args); |
655 | 655 | // NULL if output data deosn't exist |
656 | 656 | $join_form_list = $output->data; |
657 | - if(!$join_form_list) return NULL; |
|
657 | + if (!$join_form_list) return NULL; |
|
658 | 658 | // Need to unserialize because serialized array is inserted into DB in case of default_value |
659 | - if(!is_array($join_form_list)) $join_form_list = array($join_form_list); |
|
659 | + if (!is_array($join_form_list)) $join_form_list = array($join_form_list); |
|
660 | 660 | $join_form_count = count($join_form_list); |
661 | - for($i=0;$i<$join_form_count;$i++) |
|
661 | + for ($i = 0; $i < $join_form_count; $i++) |
|
662 | 662 | { |
663 | 663 | $join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name); |
664 | 664 | |
@@ -670,10 +670,10 @@ discard block |
||
670 | 670 | // Add language variable |
671 | 671 | $lang->extend_vars[$column_name] = $column_title; |
672 | 672 | // unserialize if the data type if checkbox, select and so on |
673 | - if(in_array($column_type, array('checkbox','select','radio'))) |
|
673 | + if (in_array($column_type, array('checkbox', 'select', 'radio'))) |
|
674 | 674 | { |
675 | 675 | $join_form_list[$i]->default_value = unserialize($default_value); |
676 | - if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = ''; |
|
676 | + if (!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = ''; |
|
677 | 677 | } |
678 | 678 | else |
679 | 679 | { |
@@ -685,16 +685,16 @@ discard block |
||
685 | 685 | $this->join_form_list = $list; |
686 | 686 | } |
687 | 687 | // Get object style if the filter_response is true |
688 | - if($filter_response && count($this->join_form_list)) |
|
688 | + if ($filter_response && count($this->join_form_list)) |
|
689 | 689 | { |
690 | - foreach($this->join_form_list as $key => $val) |
|
690 | + foreach ($this->join_form_list as $key => $val) |
|
691 | 691 | { |
692 | - if($val->is_active != 'Y') continue; |
|
692 | + if ($val->is_active != 'Y') continue; |
|
693 | 693 | unset($obj); |
694 | 694 | $obj->type = $val->column_type; |
695 | 695 | $obj->name = $val->column_name; |
696 | 696 | $obj->lang = $val->column_title; |
697 | - if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false; |
|
697 | + if ($logged_info->is_admin != 'Y') $obj->required = $val->required == 'Y' ? true : false; |
|
698 | 698 | else $obj->required = false; |
699 | 699 | $filter_output[] = $obj; |
700 | 700 | |
@@ -721,15 +721,15 @@ discard block |
||
721 | 721 | $args->sort_index = "list_order"; |
722 | 722 | $output = executeQueryArray('member.getJoinFormList', $args); |
723 | 723 | |
724 | - if(!$output->toBool()) |
|
724 | + if (!$output->toBool()) |
|
725 | 725 | { |
726 | 726 | return array(); |
727 | 727 | } |
728 | 728 | |
729 | 729 | $joinFormList = array(); |
730 | - foreach($output->data as $val) |
|
730 | + foreach ($output->data as $val) |
|
731 | 731 | { |
732 | - if($val->is_active != 'Y') |
|
732 | + if ($val->is_active != 'Y') |
|
733 | 733 | { |
734 | 734 | continue; |
735 | 735 | } |
@@ -746,20 +746,20 @@ discard block |
||
746 | 746 | function getCombineJoinForm($member_info) |
747 | 747 | { |
748 | 748 | $extend_form_list = $this->getJoinFormlist(); |
749 | - if(!$extend_form_list) return; |
|
749 | + if (!$extend_form_list) return; |
|
750 | 750 | // Member info is open only to an administrator and him/herself when is_private is true. |
751 | 751 | $logged_info = Context::get('logged_info'); |
752 | 752 | |
753 | - foreach($extend_form_list as $srl => $item) |
|
753 | + foreach ($extend_form_list as $srl => $item) |
|
754 | 754 | { |
755 | 755 | $column_name = $item->column_name; |
756 | 756 | $value = $member_info->{$column_name}; |
757 | 757 | |
758 | 758 | // Change values depening on the type of extend form |
759 | - switch($item->column_type) |
|
759 | + switch ($item->column_type) |
|
760 | 760 | { |
761 | 761 | case 'checkbox' : |
762 | - if($value && !is_array($value)) $value = array($value); |
|
762 | + if ($value && !is_array($value)) $value = array($value); |
|
763 | 763 | break; |
764 | 764 | case 'text' : |
765 | 765 | case 'homepage' : |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | |
774 | 774 | $extend_form_list[$srl]->value = $value; |
775 | 775 | |
776 | - if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true; |
|
776 | + if ($member_info->{'open_'.$column_name} == 'Y') $extend_form_list[$srl]->is_opened = true; |
|
777 | 777 | else $extend_form_list[$srl]->is_opened = false; |
778 | 778 | } |
779 | 779 | return $extend_form_list; |
@@ -787,12 +787,12 @@ discard block |
||
787 | 787 | $args->member_join_form_srl = $member_join_form_srl; |
788 | 788 | $output = executeQuery('member.getJoinForm', $args); |
789 | 789 | $join_form = $output->data; |
790 | - if(!$join_form) return NULL; |
|
790 | + if (!$join_form) return NULL; |
|
791 | 791 | |
792 | 792 | $column_type = $join_form->column_type; |
793 | 793 | $default_value = $join_form->default_value; |
794 | 794 | |
795 | - if(in_array($column_type, array('checkbox','select','radio'))) |
|
795 | + if (in_array($column_type, array('checkbox', 'select', 'radio'))) |
|
796 | 796 | { |
797 | 797 | $join_form->default_value = unserialize($default_value); |
798 | 798 | } |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | */ |
810 | 810 | function getDeniedIDList() |
811 | 811 | { |
812 | - if(!$this->denied_id_list) |
|
812 | + if (!$this->denied_id_list) |
|
813 | 813 | { |
814 | 814 | $args->sort_index = "list_order"; |
815 | 815 | $args->page = Context::get('page'); |
@@ -825,14 +825,14 @@ discard block |
||
825 | 825 | function getDeniedIDs() |
826 | 826 | { |
827 | 827 | $output = executeQueryArray('member.getDeniedIDs'); |
828 | - if(!$output->toBool()) return array(); |
|
828 | + if (!$output->toBool()) return array(); |
|
829 | 829 | return $output->data; |
830 | 830 | } |
831 | 831 | |
832 | 832 | function getDeniedNickNames() |
833 | 833 | { |
834 | 834 | $output = executeQueryArray('member.getDeniedNickNames'); |
835 | - if(!$output->toBool()) |
|
835 | + if (!$output->toBool()) |
|
836 | 836 | { |
837 | 837 | return array(); |
838 | 838 | } |
@@ -848,7 +848,7 @@ discard block |
||
848 | 848 | $args = new stdClass(); |
849 | 849 | $args->user_id = $user_id; |
850 | 850 | $output = executeQuery('member.chkDeniedID', $args); |
851 | - if($output->data->count) return true; |
|
851 | + if ($output->data->count) return true; |
|
852 | 852 | return false; |
853 | 853 | } |
854 | 854 | |
@@ -860,8 +860,8 @@ discard block |
||
860 | 860 | $args = new stdClass(); |
861 | 861 | $args->nick_name = $nickName; |
862 | 862 | $output = executeQuery('member.chkDeniedNickName', $args); |
863 | - if($output->data->count) return true; |
|
864 | - if(!$output->toBool()) |
|
863 | + if ($output->data->count) return true; |
|
864 | + if (!$output->toBool()) |
|
865 | 865 | { |
866 | 866 | return true; |
867 | 867 | } |
@@ -872,20 +872,20 @@ discard block |
||
872 | 872 | */ |
873 | 873 | function getProfileImage($member_srl) |
874 | 874 | { |
875 | - if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) |
|
875 | + if (!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) |
|
876 | 876 | { |
877 | 877 | $GLOBALS['__member_info__']['profile_image'][$member_srl] = null; |
878 | - $exts = array('gif','jpg','png'); |
|
879 | - for($i=0;$i<3;$i++) |
|
878 | + $exts = array('gif', 'jpg', 'png'); |
|
879 | + for ($i = 0; $i < 3; $i++) |
|
880 | 880 | { |
881 | 881 | $image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]); |
882 | - if(file_exists($image_name_file)) |
|
882 | + if (file_exists($image_name_file)) |
|
883 | 883 | { |
884 | 884 | list($width, $height, $type, $attrs) = getimagesize($image_name_file); |
885 | 885 | $info = new stdClass(); |
886 | 886 | $info->width = $width; |
887 | 887 | $info->height = $height; |
888 | - $info->src = Context::getRequestUri().$image_name_file . '?' . date('YmdHis', filemtime($image_name_file)); |
|
888 | + $info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file)); |
|
889 | 889 | $info->file = './'.$image_name_file; |
890 | 890 | $GLOBALS['__member_info__']['profile_image'][$member_srl] = $info; |
891 | 891 | break; |
@@ -901,16 +901,16 @@ discard block |
||
901 | 901 | */ |
902 | 902 | function getImageName($member_srl) |
903 | 903 | { |
904 | - if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) |
|
904 | + if (!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) |
|
905 | 905 | { |
906 | 906 | $image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl); |
907 | - if(file_exists($image_name_file)) |
|
907 | + if (file_exists($image_name_file)) |
|
908 | 908 | { |
909 | 909 | list($width, $height, $type, $attrs) = getimagesize($image_name_file); |
910 | 910 | $info = new stdClass; |
911 | 911 | $info->width = $width; |
912 | 912 | $info->height = $height; |
913 | - $info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file)); |
|
913 | + $info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file)); |
|
914 | 914 | $info->file = './'.$image_name_file; |
915 | 915 | $GLOBALS['__member_info__']['image_name'][$member_srl] = $info; |
916 | 916 | } |
@@ -924,15 +924,15 @@ discard block |
||
924 | 924 | */ |
925 | 925 | function getImageMark($member_srl) |
926 | 926 | { |
927 | - if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) |
|
927 | + if (!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) |
|
928 | 928 | { |
929 | 929 | $image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl); |
930 | - if(file_exists($image_mark_file)) |
|
930 | + if (file_exists($image_mark_file)) |
|
931 | 931 | { |
932 | 932 | list($width, $height, $type, $attrs) = getimagesize($image_mark_file); |
933 | 933 | $info->width = $width; |
934 | 934 | $info->height = $height; |
935 | - $info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file)); |
|
935 | + $info->src = Context::getRequestUri().$image_mark_file.'?'.date('YmdHis', filemtime($image_mark_file)); |
|
936 | 936 | $info->file = './'.$image_mark_file; |
937 | 937 | $GLOBALS['__member_info__']['image_mark'][$member_srl] = $info; |
938 | 938 | } |
@@ -946,27 +946,27 @@ discard block |
||
946 | 946 | /** |
947 | 947 | * @brief Get the image mark of the group |
948 | 948 | */ |
949 | - function getGroupImageMark($member_srl,$site_srl=0) |
|
949 | + function getGroupImageMark($member_srl, $site_srl = 0) |
|
950 | 950 | { |
951 | - if(!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl])) |
|
951 | + if (!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl])) |
|
952 | 952 | { |
953 | 953 | $oModuleModel = getModel('module'); |
954 | 954 | $config = $oModuleModel->getModuleConfig('member'); |
955 | - if($config->group_image_mark!='Y') |
|
955 | + if ($config->group_image_mark != 'Y') |
|
956 | 956 | { |
957 | 957 | return null; |
958 | 958 | } |
959 | - $member_group = $this->getMemberGroups($member_srl,$site_srl); |
|
959 | + $member_group = $this->getMemberGroups($member_srl, $site_srl); |
|
960 | 960 | $groups_info = $this->getGroups($site_srl); |
961 | - if(count($member_group) > 0 && is_array($member_group)) |
|
961 | + if (count($member_group) > 0 && is_array($member_group)) |
|
962 | 962 | { |
963 | 963 | $memberGroups = array_keys($member_group); |
964 | 964 | |
965 | - foreach($groups_info as $group_srl=>$group_info) |
|
965 | + foreach ($groups_info as $group_srl=>$group_info) |
|
966 | 966 | { |
967 | - if(in_array($group_srl, $memberGroups)) |
|
967 | + if (in_array($group_srl, $memberGroups)) |
|
968 | 968 | { |
969 | - if($group_info->image_mark) |
|
969 | + if ($group_info->image_mark) |
|
970 | 970 | { |
971 | 971 | $info = new stdClass(); |
972 | 972 | $info->title = $group_info->title; |
@@ -990,10 +990,10 @@ discard block |
||
990 | 990 | */ |
991 | 991 | function getSignature($member_srl) |
992 | 992 | { |
993 | - if(!isset($GLOBALS['__member_info__']['signature'][$member_srl])) |
|
993 | + if (!isset($GLOBALS['__member_info__']['signature'][$member_srl])) |
|
994 | 994 | { |
995 | 995 | $filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl); |
996 | - if(file_exists($filename)) |
|
996 | + if (file_exists($filename)) |
|
997 | 997 | { |
998 | 998 | $buff = FileHandler::readFile($filename); |
999 | 999 | $signature = preg_replace('/<\?.*\?>/', '', $buff); |
@@ -1011,10 +1011,10 @@ discard block |
||
1011 | 1011 | * @param int $member_srl Set this to member_srl when comparing a member's password (optional) |
1012 | 1012 | * @return bool |
1013 | 1013 | */ |
1014 | - function isValidPassword($hashed_password, $password_text, $member_srl=null) |
|
1014 | + function isValidPassword($hashed_password, $password_text, $member_srl = null) |
|
1015 | 1015 | { |
1016 | 1016 | // False if no password in entered |
1017 | - if(!$password_text) |
|
1017 | + if (!$password_text) |
|
1018 | 1018 | { |
1019 | 1019 | return false; |
1020 | 1020 | } |
@@ -1023,31 +1023,31 @@ discard block |
||
1023 | 1023 | $oPassword = new Password(); |
1024 | 1024 | $current_algorithm = $oPassword->checkAlgorithm($hashed_password); |
1025 | 1025 | $match = $oPassword->checkPassword($password_text, $hashed_password, $current_algorithm); |
1026 | - if(!$match) |
|
1026 | + if (!$match) |
|
1027 | 1027 | { |
1028 | 1028 | return false; |
1029 | 1029 | } |
1030 | 1030 | |
1031 | 1031 | // Update the encryption method if necessary |
1032 | 1032 | $config = $this->getMemberConfig(); |
1033 | - if($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N') |
|
1033 | + if ($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N') |
|
1034 | 1034 | { |
1035 | 1035 | $need_upgrade = false; |
1036 | 1036 | |
1037 | - if(!$need_upgrade) |
|
1037 | + if (!$need_upgrade) |
|
1038 | 1038 | { |
1039 | 1039 | $required_algorithm = $oPassword->getCurrentlySelectedAlgorithm(); |
1040 | - if($required_algorithm !== $current_algorithm) $need_upgrade = true; |
|
1040 | + if ($required_algorithm !== $current_algorithm) $need_upgrade = true; |
|
1041 | 1041 | } |
1042 | 1042 | |
1043 | - if(!$need_upgrade) |
|
1043 | + if (!$need_upgrade) |
|
1044 | 1044 | { |
1045 | 1045 | $required_work_factor = $oPassword->getWorkFactor(); |
1046 | 1046 | $current_work_factor = $oPassword->checkWorkFactor($hashed_password); |
1047 | - if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; |
|
1047 | + if ($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; |
|
1048 | 1048 | } |
1049 | 1049 | |
1050 | - if($need_upgrade === true) |
|
1050 | + if ($need_upgrade === true) |
|
1051 | 1051 | { |
1052 | 1052 | $args = new stdClass(); |
1053 | 1053 | $args->member_srl = $member_srl; |
@@ -1075,27 +1075,27 @@ discard block |
||
1075 | 1075 | function checkPasswordStrength($password, $strength) |
1076 | 1076 | { |
1077 | 1077 | $logged_info = Context::get('logged_info'); |
1078 | - if($logged_info->is_admin == 'Y') return true; |
|
1078 | + if ($logged_info->is_admin == 'Y') return true; |
|
1079 | 1079 | |
1080 | - if($strength == NULL) |
|
1080 | + if ($strength == NULL) |
|
1081 | 1081 | { |
1082 | 1082 | $config = $this->getMemberConfig(); |
1083 | - $strength = $config->password_strength?$config->password_strength:'normal'; |
|
1083 | + $strength = $config->password_strength ? $config->password_strength : 'normal'; |
|
1084 | 1084 | } |
1085 | 1085 | |
1086 | 1086 | $length = strlen($password); |
1087 | 1087 | |
1088 | 1088 | switch ($strength) { |
1089 | 1089 | case 'high': |
1090 | - if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false; |
|
1090 | + if ($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false; |
|
1091 | 1091 | /* no break */ |
1092 | 1092 | |
1093 | 1093 | case 'normal': |
1094 | - if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false; |
|
1094 | + if ($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false; |
|
1095 | 1095 | break; |
1096 | 1096 | |
1097 | 1097 | case 'low': |
1098 | - if($length < 4) return false; |
|
1098 | + if ($length < 4) return false; |
|
1099 | 1099 | break; |
1100 | 1100 | } |
1101 | 1101 | |
@@ -1106,11 +1106,11 @@ discard block |
||
1106 | 1106 | { |
1107 | 1107 | $groupSrl = 0; |
1108 | 1108 | $output = $this->getGroups($site_srl); |
1109 | - if(is_array($output)) |
|
1109 | + if (is_array($output)) |
|
1110 | 1110 | { |
1111 | - foreach($output AS $key=>$value) |
|
1111 | + foreach ($output AS $key=>$value) |
|
1112 | 1112 | { |
1113 | - if($value->is_admin == 'Y') |
|
1113 | + if ($value->is_admin == 'Y') |
|
1114 | 1114 | { |
1115 | 1115 | $groupSrl = $value->group_srl; |
1116 | 1116 | break; |
@@ -8,12 +8,12 @@ discard block |
||
8 | 8 | { |
9 | 9 | // If member_srl < 0, then return text only in the body |
10 | 10 | $member_srl = $matches[3]; |
11 | - if($member_srl < 0) |
|
11 | + if ($member_srl < 0) |
|
12 | 12 | { |
13 | 13 | return $matches[5]; |
14 | 14 | } |
15 | 15 | // If member_srl=o(not a member), return the entire body |
16 | - if(!$member_srl) |
|
16 | + if (!$member_srl) |
|
17 | 17 | { |
18 | 18 | return $matches[0]; |
19 | 19 | } |
@@ -22,22 +22,22 @@ discard block |
||
22 | 22 | $nick_name = $matches[5]; |
23 | 23 | |
24 | 24 | // Initialize global variable for cache |
25 | - if(!isset($GLOBALS['_transImageNameList'][$member_srl])) |
|
25 | + if (!isset($GLOBALS['_transImageNameList'][$member_srl])) |
|
26 | 26 | { |
27 | 27 | $GLOBALS['_transImageNameList'][$member_srl] = new stdClass(); |
28 | 28 | } |
29 | 29 | $_tmp = &$GLOBALS['_transImageNameList'][$member_srl]; |
30 | 30 | |
31 | 31 | // If pre-defined data in the global variables, return it |
32 | - if(!$_tmp->cached) |
|
32 | + if (!$_tmp->cached) |
|
33 | 33 | { |
34 | 34 | $_tmp->cached = true; |
35 | 35 | $image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl); |
36 | 36 | $image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl); |
37 | 37 | |
38 | - if(file_exists(_XE_PATH_ . $image_name_file)) |
|
38 | + if (file_exists(_XE_PATH_.$image_name_file)) |
|
39 | 39 | { |
40 | - $_tmp->image_name_file = $image_name_file . '?' . date('YmdHis', filemtime(_XE_PATH_ . $image_name_file)); |
|
40 | + $_tmp->image_name_file = $image_name_file.'?'.date('YmdHis', filemtime(_XE_PATH_.$image_name_file)); |
|
41 | 41 | $image_name_file = $_tmp->image_name_file; |
42 | 42 | } |
43 | 43 | else |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | $image_name_file = ''; |
46 | 46 | } |
47 | 47 | |
48 | - if(file_exists(_XE_PATH_ . $image_mark_file)) |
|
48 | + if (file_exists(_XE_PATH_.$image_mark_file)) |
|
49 | 49 | { |
50 | - $_tmp->image_mark_file = $image_mark_file . '?' . date('YmdHis', filemtime(_XE_PATH_ . $image_mark_file)); |
|
50 | + $_tmp->image_mark_file = $image_mark_file.'?'.date('YmdHis', filemtime(_XE_PATH_.$image_mark_file)); |
|
51 | 51 | $image_mark_file = $_tmp->image_mark_file; |
52 | 52 | } |
53 | 53 | else |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | // If image name and mark doesn't exist, set the original information |
70 | - if(!$image_name_file && !$image_mark_file && !$group_image) |
|
70 | + if (!$image_name_file && !$image_mark_file && !$group_image) |
|
71 | 71 | { |
72 | 72 | return $matches[0]; |
73 | 73 | } |
@@ -76,21 +76,21 @@ discard block |
||
76 | 76 | |
77 | 77 | $config = $oMemberModel->getMemberConfig(); |
78 | 78 | |
79 | - if($config->image_name == 'Y' && $image_name_file) |
|
79 | + if ($config->image_name == 'Y' && $image_name_file) |
|
80 | 80 | { |
81 | 81 | $nick_name = sprintf('<img src="%s%s" alt="id: %s" title="id: %s" style="border:0;vertical-align:middle;margin-right:3px" />', Context::getRequestUri(), $image_name_file, strip_tags($nick_name), strip_tags($nick_name)); |
82 | 82 | } |
83 | - if($config->image_mark == 'Y' && $image_mark_file) |
|
83 | + if ($config->image_mark == 'Y' && $image_mark_file) |
|
84 | 84 | { |
85 | 85 | $nick_name = sprintf('<img src="%s%s" alt="id: %s" title="id : %s" style="border:0;vertical-align:middle;margin-right:3px"/>%s', Context::getRequestUri(), $image_mark_file, strip_tags($nick_name), strip_tags($nick_name), $nick_name); |
86 | 86 | } |
87 | 87 | |
88 | - if($group_image) |
|
88 | + if ($group_image) |
|
89 | 89 | { |
90 | 90 | $nick_name = sprintf('<img src="%s" style="border:0;max-height:16px;vertical-align:middle;margin-right:3px" alt="%s" title="%s" />%s', $group_image->src, $group_image->title, $group_image->description, $nick_name); |
91 | 91 | } |
92 | 92 | |
93 | - return preg_replace('/' . preg_quote($matches[5], '/') . '<\/' . $matches[6] . '>$/', '', $matches[0]) . $nick_name . '</' . $matches[6] . '>'; |
|
93 | + return preg_replace('/'.preg_quote($matches[5], '/').'<\/'.$matches[6].'>$/', '', $matches[0]).$nick_name.'</'.$matches[6].'>'; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /* End of file member_extra_info.lib.php */ |