@@ -34,25 +34,25 @@ discard block |
||
34 | 34 | */ |
35 | 35 | function procMemberLogin($user_id = null, $password = null, $keep_signed = null) |
36 | 36 | { |
37 | - if(!$user_id && !$password && Context::getRequestMethod() == 'GET') |
|
37 | + if (!$user_id && !$password && Context::getRequestMethod() == 'GET') |
|
38 | 38 | { |
39 | 39 | $this->setRedirectUrl(getNotEncodedUrl('')); |
40 | 40 | return new BaseObject(-1, 'null_user_id'); |
41 | 41 | } |
42 | 42 | |
43 | 43 | // Variables |
44 | - if(!$user_id) $user_id = Context::get('user_id'); |
|
44 | + if (!$user_id) $user_id = Context::get('user_id'); |
|
45 | 45 | $user_id = trim($user_id); |
46 | 46 | |
47 | - if(!$password) $password = Context::get('password'); |
|
47 | + if (!$password) $password = Context::get('password'); |
|
48 | 48 | $password = trim($password); |
49 | 49 | |
50 | - if(!$keep_signed) $keep_signed = Context::get('keep_signed'); |
|
50 | + if (!$keep_signed) $keep_signed = Context::get('keep_signed'); |
|
51 | 51 | // Return an error when id and password doesn't exist |
52 | - if(!$user_id) return new BaseObject(-1,'null_user_id'); |
|
53 | - if(!$password) return new BaseObject(-1,'null_password'); |
|
52 | + if (!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
53 | + if (!$password) return new BaseObject(-1, 'null_password'); |
|
54 | 54 | |
55 | - $output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false); |
|
55 | + $output = $this->doLogin($user_id, $password, $keep_signed == 'Y' ?true:false); |
|
56 | 56 | if (!$output->toBool()) return $output; |
57 | 57 | |
58 | 58 | $oModuleModel = getModel('module'); |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | $limit_date = $config->change_password_date; |
63 | 63 | |
64 | 64 | // Check if change_password_date is set |
65 | - if($limit_date > 0) |
|
65 | + if ($limit_date > 0) |
|
66 | 66 | { |
67 | 67 | $oMemberModel = getModel('member'); |
68 | - if($this->memberInfo->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day'))) |
|
68 | + if ($this->memberInfo->change_password_date < date('YmdHis', strtotime('-'.$limit_date.' day'))) |
|
69 | 69 | { |
70 | 70 | $msg = sprintf(Context::getLang('msg_change_password_date'), $limit_date); |
71 | - return $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword'), new BaseObject(-1, $msg)); |
|
71 | + return $this->setRedirectUrl(getNotEncodedUrl('', 'vid', Context::get('vid'), 'mid', Context::get('mid'), 'act', 'dispMemberModifyPassword'), new BaseObject(-1, $msg)); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $args->member_srl = $this->memberInfo->member_srl; |
78 | 78 | executeQuery('member.deleteAuthMail', $args); |
79 | 79 | |
80 | - if(!$config->after_login_url) |
|
80 | + if (!$config->after_login_url) |
|
81 | 81 | { |
82 | 82 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); |
83 | 83 | } |
@@ -98,18 +98,18 @@ discard block |
||
98 | 98 | // Call a trigger before log-out (before) |
99 | 99 | $logged_info = Context::get('logged_info'); |
100 | 100 | $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info); |
101 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
101 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
102 | 102 | // Destroy session information |
103 | 103 | $this->destroySessionInfo(); |
104 | 104 | // Call a trigger after log-out (after) |
105 | 105 | $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info); |
106 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
106 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
107 | 107 | |
108 | 108 | $output = new BaseObject(); |
109 | 109 | |
110 | 110 | $oModuleModel = getModel('module'); |
111 | 111 | $config = $oModuleModel->getModuleConfig('member'); |
112 | - if($config->after_logout_url) |
|
112 | + if ($config->after_logout_url) |
|
113 | 113 | $output->redirect_url = $config->after_logout_url; |
114 | 114 | |
115 | 115 | $this->_clearMemberCache($logged_info->member_srl); |
@@ -127,18 +127,18 @@ discard block |
||
127 | 127 | $oModuleModel = &getModel('module'); |
128 | 128 | |
129 | 129 | // Check login information |
130 | - if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
130 | + if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
131 | 131 | $logged_info = Context::get('logged_info'); |
132 | 132 | |
133 | - $document_srl = (int)Context::get('document_srl'); |
|
134 | - if(!$document_srl) $document_srl = (int)Context::get('target_srl'); |
|
135 | - if(!$document_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
133 | + $document_srl = (int) Context::get('document_srl'); |
|
134 | + if (!$document_srl) $document_srl = (int) Context::get('target_srl'); |
|
135 | + if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request'); |
|
136 | 136 | |
137 | 137 | // Get document |
138 | 138 | $oDocumentModel = getModel('document'); |
139 | 139 | $oDocument = $oDocumentModel->getDocument($document_srl); |
140 | 140 | |
141 | - if($oDocument->isSecret() && !$oDocument->isGranted()) |
|
141 | + if ($oDocument->isSecret() && !$oDocument->isGranted()) |
|
142 | 142 | { |
143 | 143 | return new BaseObject(-1, 'msg_is_secret'); |
144 | 144 | } |
@@ -147,19 +147,19 @@ discard block |
||
147 | 147 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')); |
148 | 148 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
149 | 149 | |
150 | - if(!$grant->access) |
|
150 | + if (!$grant->access) |
|
151 | 151 | { |
152 | 152 | return new BaseObject(-1, 'msg_not_permitted'); |
153 | 153 | } |
154 | 154 | |
155 | 155 | // 게시판 모듈에서 글 목록 보기 권한이 없으면 스크랩 제한 |
156 | - if($module_info->module === 'board' && isset($grant->list) && !$grant->list) |
|
156 | + if ($module_info->module === 'board' && isset($grant->list) && !$grant->list) |
|
157 | 157 | { |
158 | 158 | return new BaseObject(-1, 'msg_not_permitted'); |
159 | 159 | } |
160 | 160 | |
161 | 161 | // 게시판 모듈에서 상담 기능 사용 시 권한이 없는 게시물(타인의 게시물) 스크랩 제한 |
162 | - if($module_info->module === 'board' && |
|
162 | + if ($module_info->module === 'board' && |
|
163 | 163 | $module_info->consultation === 'Y' && |
164 | 164 | isset($grant->consultation_read) && |
165 | 165 | !$grant->consultation_read && !$oDocument->isGranted() |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | |
181 | 181 | // Check if already scrapped |
182 | 182 | $output = executeQuery('member.getScrapDocument', $args); |
183 | - if($output->data->count) return new BaseObject(-1, 'msg_alreay_scrapped'); |
|
183 | + if ($output->data->count) return new BaseObject(-1, 'msg_alreay_scrapped'); |
|
184 | 184 | |
185 | 185 | // Insert |
186 | 186 | $output = executeQuery('member.addScrapDocument', $args); |
187 | - if(!$output->toBool()) return $output; |
|
187 | + if (!$output->toBool()) return $output; |
|
188 | 188 | |
189 | 189 | $this->setError(-1); |
190 | 190 | $this->setMessage('success_registed'); |
@@ -198,11 +198,11 @@ discard block |
||
198 | 198 | function procMemberDeleteScrap() |
199 | 199 | { |
200 | 200 | // Check login information |
201 | - if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
201 | + if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
202 | 202 | $logged_info = Context::get('logged_info'); |
203 | 203 | |
204 | - $document_srl = (int)Context::get('document_srl'); |
|
205 | - if(!$document_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
204 | + $document_srl = (int) Context::get('document_srl'); |
|
205 | + if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request'); |
|
206 | 206 | // Variables |
207 | 207 | $args = new stdClass; |
208 | 208 | $args->member_srl = $logged_info->member_srl; |
@@ -228,23 +228,23 @@ discard block |
||
228 | 228 | function procMemberDeleteSavedDocument() |
229 | 229 | { |
230 | 230 | // Check login information |
231 | - if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
231 | + if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
232 | 232 | $logged_info = Context::get('logged_info'); |
233 | 233 | |
234 | - $document_srl = (int)Context::get('document_srl'); |
|
235 | - if(!$document_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
234 | + $document_srl = (int) Context::get('document_srl'); |
|
235 | + if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request'); |
|
236 | 236 | |
237 | 237 | $oDocumentModel = getModel('document'); |
238 | 238 | $oDocument = $oDocumentModel->getDocument($document_srl); |
239 | 239 | if ($oDocument->get('member_srl') != $logged_info->member_srl) |
240 | 240 | { |
241 | - return new BaseObject(-1,'msg_invalid_request'); |
|
241 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | $configStatusList = $oDocumentModel->getStatusList(); |
245 | 245 | if ($oDocument->get('status') != $configStatusList['temp']) |
246 | 246 | { |
247 | - return new BaseObject(-1,'msg_invalid_request'); |
|
247 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | $oDocumentController = getController('document'); |
@@ -260,37 +260,37 @@ discard block |
||
260 | 260 | { |
261 | 261 | $name = Context::get('name'); |
262 | 262 | $value = Context::get('value'); |
263 | - if(!$value) return; |
|
263 | + if (!$value) return; |
|
264 | 264 | |
265 | 265 | $oMemberModel = getModel('member'); |
266 | 266 | // Check if logged-in |
267 | 267 | $logged_info = Context::get('logged_info'); |
268 | 268 | |
269 | 269 | |
270 | - switch($name) |
|
270 | + switch ($name) |
|
271 | 271 | { |
272 | 272 | case 'user_id' : |
273 | 273 | // Check denied ID |
274 | - if($oMemberModel->isDeniedID($value)) return new BaseObject(0,'denied_user_id'); |
|
274 | + if ($oMemberModel->isDeniedID($value)) return new BaseObject(0, 'denied_user_id'); |
|
275 | 275 | // Check if duplicated |
276 | 276 | $member_srl = $oMemberModel->getMemberSrlByUserID($value); |
277 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_user_id'); |
|
277 | + if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_user_id'); |
|
278 | 278 | break; |
279 | 279 | case 'nick_name' : |
280 | 280 | // Check denied ID |
281 | - if($oMemberModel->isDeniedNickName($value)) |
|
281 | + if ($oMemberModel->isDeniedNickName($value)) |
|
282 | 282 | { |
283 | - return new BaseObject(0,'denied_nick_name'); |
|
283 | + return new BaseObject(0, 'denied_nick_name'); |
|
284 | 284 | } |
285 | 285 | // Check if duplicated |
286 | 286 | $member_srl = $oMemberModel->getMemberSrlByNickName($value); |
287 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_nick_name'); |
|
287 | + if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_nick_name'); |
|
288 | 288 | |
289 | 289 | break; |
290 | 290 | case 'email_address' : |
291 | 291 | // Check if duplicated |
292 | 292 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($value); |
293 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_email_address'); |
|
293 | + if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_email_address'); |
|
294 | 294 | break; |
295 | 295 | } |
296 | 296 | } |
@@ -302,25 +302,25 @@ discard block |
||
302 | 302 | */ |
303 | 303 | function procMemberInsert() |
304 | 304 | { |
305 | - if (Context::getRequestMethod () == "GET") return new BaseObject(-1, "msg_invalid_request"); |
|
306 | - $oMemberModel = &getModel ('member'); |
|
305 | + if (Context::getRequestMethod() == "GET") return new BaseObject(-1, "msg_invalid_request"); |
|
306 | + $oMemberModel = &getModel('member'); |
|
307 | 307 | $config = $oMemberModel->getMemberConfig(); |
308 | 308 | |
309 | 309 | // call a trigger (before) |
310 | - $trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config); |
|
311 | - if(!$trigger_output->toBool ()) return $trigger_output; |
|
310 | + $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config); |
|
311 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
312 | 312 | // Check if an administrator allows a membership |
313 | - if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled'); |
|
313 | + if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled'); |
|
314 | 314 | // Check if the user accept the license terms (only if terms exist) |
315 | - if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement'); |
|
315 | + if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement'); |
|
316 | 316 | |
317 | 317 | // Extract the necessary information in advance |
318 | 318 | $getVars = array(); |
319 | - if($config->signupForm) |
|
319 | + if ($config->signupForm) |
|
320 | 320 | { |
321 | - foreach($config->signupForm as $formInfo) |
|
321 | + foreach ($config->signupForm as $formInfo) |
|
322 | 322 | { |
323 | - if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
323 | + if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
324 | 324 | { |
325 | 325 | $getVars[] = $formInfo->name; |
326 | 326 | } |
@@ -328,22 +328,22 @@ discard block |
||
328 | 328 | } |
329 | 329 | |
330 | 330 | $args = new stdClass; |
331 | - foreach($getVars as $val) |
|
331 | + foreach ($getVars as $val) |
|
332 | 332 | { |
333 | 333 | $args->{$val} = Context::get($val); |
334 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
334 | + if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
335 | 335 | } |
336 | 336 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
337 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
337 | + if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
338 | 338 | |
339 | 339 | $args->find_account_answer = Context::get('find_account_answer'); |
340 | 340 | $args->allow_mailing = Context::get('allow_mailing'); |
341 | 341 | $args->allow_message = Context::get('allow_message'); |
342 | 342 | |
343 | - if($args->password1) $args->password = $args->password1; |
|
343 | + if ($args->password1) $args->password = $args->password1; |
|
344 | 344 | |
345 | 345 | // check password strength |
346 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
346 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
347 | 347 | { |
348 | 348 | $message = Context::getLang('about_password_strength'); |
349 | 349 | return new BaseObject(-1, $message[$config->password_strength]); |
@@ -369,58 +369,58 @@ discard block |
||
369 | 369 | unset($all_args->secret_text); |
370 | 370 | |
371 | 371 | // Set the user state as "denied" when using mail authentication |
372 | - if($config->enable_confirm == 'Y') $args->denied = 'Y'; |
|
372 | + if ($config->enable_confirm == 'Y') $args->denied = 'Y'; |
|
373 | 373 | // Add extra vars after excluding necessary information from all the requested arguments |
374 | 374 | $extra_vars = delObjectVars($all_args, $args); |
375 | 375 | $args->extra_vars = serialize($extra_vars); |
376 | 376 | |
377 | 377 | // remove whitespace |
378 | 378 | $checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address'); |
379 | - foreach($checkInfos as $val) |
|
379 | + foreach ($checkInfos as $val) |
|
380 | 380 | { |
381 | - if(isset($args->{$val})) |
|
381 | + if (isset($args->{$val})) |
|
382 | 382 | { |
383 | 383 | $args->{$val} = preg_replace('/[\pZ\pC]+/u', '', html_entity_decode($args->{$val})); |
384 | 384 | } |
385 | 385 | } |
386 | 386 | $output = $this->insertMember($args); |
387 | - if(!$output->toBool()) return $output; |
|
387 | + if (!$output->toBool()) return $output; |
|
388 | 388 | |
389 | 389 | // insert ProfileImage, ImageName, ImageMark |
390 | 390 | $profile_image = $_FILES['profile_image']; |
391 | - if(is_uploaded_file($profile_image['tmp_name'])) |
|
391 | + if (is_uploaded_file($profile_image['tmp_name'])) |
|
392 | 392 | { |
393 | 393 | $this->insertProfileImage($args->member_srl, $profile_image['tmp_name']); |
394 | 394 | } |
395 | 395 | |
396 | 396 | $image_mark = $_FILES['image_mark']; |
397 | - if(is_uploaded_file($image_mark['tmp_name'])) |
|
397 | + if (is_uploaded_file($image_mark['tmp_name'])) |
|
398 | 398 | { |
399 | 399 | $this->insertImageMark($args->member_srl, $image_mark['tmp_name']); |
400 | 400 | } |
401 | 401 | |
402 | 402 | $image_name = $_FILES['image_name']; |
403 | - if(is_uploaded_file($image_name['tmp_name'])) |
|
403 | + if (is_uploaded_file($image_name['tmp_name'])) |
|
404 | 404 | { |
405 | 405 | $this->insertImageName($args->member_srl, $image_name['tmp_name']); |
406 | 406 | } |
407 | 407 | |
408 | 408 | // If a virtual site, join the site |
409 | 409 | $site_module_info = Context::get('site_module_info'); |
410 | - if($site_module_info->site_srl > 0) |
|
410 | + if ($site_module_info->site_srl > 0) |
|
411 | 411 | { |
412 | 412 | $columnList = array('site_srl', 'group_srl'); |
413 | 413 | $default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList); |
414 | - if($default_group->group_srl) |
|
414 | + if ($default_group->group_srl) |
|
415 | 415 | { |
416 | 416 | $this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl); |
417 | 417 | } |
418 | 418 | |
419 | 419 | } |
420 | 420 | // Log-in |
421 | - if($config->enable_confirm != 'Y') |
|
421 | + if ($config->enable_confirm != 'Y') |
|
422 | 422 | { |
423 | - if($config->identifier == 'email_address') |
|
423 | + if ($config->identifier == 'email_address') |
|
424 | 424 | { |
425 | 425 | $output = $this->doLogin($args->email_address); |
426 | 426 | } |
@@ -428,8 +428,8 @@ discard block |
||
428 | 428 | { |
429 | 429 | $output = $this->doLogin($args->user_id); |
430 | 430 | } |
431 | - if(!$output->toBool()) { |
|
432 | - if($output->error == -9) |
|
431 | + if (!$output->toBool()) { |
|
432 | + if ($output->error == -9) |
|
433 | 433 | $output->error = -11; |
434 | 434 | return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output); |
435 | 435 | } |
@@ -437,8 +437,8 @@ discard block |
||
437 | 437 | |
438 | 438 | // Results |
439 | 439 | $this->add('member_srl', $args->member_srl); |
440 | - if($config->redirect_url) $this->add('redirect_url', $config->redirect_url); |
|
441 | - if($config->enable_confirm == 'Y') |
|
440 | + if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url); |
|
441 | + if ($config->enable_confirm == 'Y') |
|
442 | 442 | { |
443 | 443 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
444 | 444 | $this->setMessage($msg); |
@@ -447,19 +447,19 @@ discard block |
||
447 | 447 | else $this->setMessage('success_registed'); |
448 | 448 | // Call a trigger (after) |
449 | 449 | $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config); |
450 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
450 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
451 | 451 | |
452 | - if($config->redirect_url) |
|
452 | + if ($config->redirect_url) |
|
453 | 453 | { |
454 | 454 | $returnUrl = $config->redirect_url; |
455 | 455 | } |
456 | 456 | else |
457 | 457 | { |
458 | - if(Context::get('success_return_url')) |
|
458 | + if (Context::get('success_return_url')) |
|
459 | 459 | { |
460 | 460 | $returnUrl = Context::get('success_return_url'); |
461 | 461 | } |
462 | - else if($_COOKIE['XE_REDIRECT_URL']) |
|
462 | + else if ($_COOKIE['XE_REDIRECT_URL']) |
|
463 | 463 | { |
464 | 464 | $returnUrl = $_COOKIE['XE_REDIRECT_URL']; |
465 | 465 | setcookie("XE_REDIRECT_URL", '', 1); |
@@ -473,26 +473,26 @@ discard block |
||
473 | 473 | |
474 | 474 | function procMemberModifyInfoBefore() |
475 | 475 | { |
476 | - if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD') |
|
476 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD') |
|
477 | 477 | { |
478 | 478 | return $this->stop('msg_invalid_request'); |
479 | 479 | } |
480 | 480 | |
481 | - if(!Context::get('is_logged')) |
|
481 | + if (!Context::get('is_logged')) |
|
482 | 482 | { |
483 | 483 | return $this->stop('msg_not_logged'); |
484 | 484 | } |
485 | 485 | |
486 | 486 | $password = Context::get('password'); |
487 | 487 | |
488 | - if(!$password) |
|
488 | + if (!$password) |
|
489 | 489 | { |
490 | 490 | return $this->stop('msg_invalid_request'); |
491 | 491 | } |
492 | 492 | |
493 | 493 | $oMemberModel = getModel('member'); |
494 | 494 | |
495 | - if(!$this->memberInfo->password) |
|
495 | + if (!$this->memberInfo->password) |
|
496 | 496 | { |
497 | 497 | // Get information of logged-in user |
498 | 498 | $logged_info = Context::get('logged_info'); |
@@ -503,14 +503,14 @@ discard block |
||
503 | 503 | $this->memberInfo->password = $memberInfo->password; |
504 | 504 | } |
505 | 505 | // Verify the current password |
506 | - if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) |
|
506 | + if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) |
|
507 | 507 | { |
508 | 508 | return new BaseObject(-1, 'invalid_password'); |
509 | 509 | } |
510 | 510 | |
511 | 511 | $_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD'; |
512 | 512 | |
513 | - if(Context::get('success_return_url')) |
|
513 | + if (Context::get('success_return_url')) |
|
514 | 514 | { |
515 | 515 | $redirectUrl = Context::get('success_return_url'); |
516 | 516 | } |
@@ -528,12 +528,12 @@ discard block |
||
528 | 528 | */ |
529 | 529 | function procMemberModifyInfo() |
530 | 530 | { |
531 | - if(!Context::get('is_logged')) |
|
531 | + if (!Context::get('is_logged')) |
|
532 | 532 | { |
533 | 533 | return $this->stop('msg_not_logged'); |
534 | 534 | } |
535 | 535 | |
536 | - if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
536 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
537 | 537 | { |
538 | 538 | return $this->stop('msg_invalid_request'); |
539 | 539 | } |
@@ -541,13 +541,13 @@ discard block |
||
541 | 541 | |
542 | 542 | // Extract the necessary information in advance |
543 | 543 | $oMemberModel = getModel('member'); |
544 | - $config = $oMemberModel->getMemberConfig (); |
|
545 | - $getVars = array('find_account_answer','allow_mailing','allow_message'); |
|
546 | - if($config->signupForm) |
|
544 | + $config = $oMemberModel->getMemberConfig(); |
|
545 | + $getVars = array('find_account_answer', 'allow_mailing', 'allow_message'); |
|
546 | + if ($config->signupForm) |
|
547 | 547 | { |
548 | - foreach($config->signupForm as $formInfo) |
|
548 | + foreach ($config->signupForm as $formInfo) |
|
549 | 549 | { |
550 | - if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
550 | + if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
551 | 551 | { |
552 | 552 | $getVars[] = $formInfo->name; |
553 | 553 | } |
@@ -555,11 +555,11 @@ discard block |
||
555 | 555 | } |
556 | 556 | |
557 | 557 | $args = new stdClass; |
558 | - foreach($getVars as $val) |
|
558 | + foreach ($getVars as $val) |
|
559 | 559 | { |
560 | 560 | $args->{$val} = Context::get($val); |
561 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
562 | - if($val == 'find_account_answer' && !Context::get($val)) { |
|
561 | + if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
562 | + if ($val == 'find_account_answer' && !Context::get($val)) { |
|
563 | 563 | unset($args->{$val}); |
564 | 564 | } |
565 | 565 | } |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | $logged_info = Context::get('logged_info'); |
569 | 569 | $args->member_srl = $logged_info->member_srl; |
570 | 570 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
571 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
571 | + if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
572 | 572 | |
573 | 573 | // Remove some unnecessary variables from all the vars |
574 | 574 | $all_args = Context::getRequestVars(); |
@@ -593,9 +593,9 @@ discard block |
||
593 | 593 | |
594 | 594 | // remove whitespace |
595 | 595 | $checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address'); |
596 | - foreach($checkInfos as $val) |
|
596 | + foreach ($checkInfos as $val) |
|
597 | 597 | { |
598 | - if(isset($args->{$val})) |
|
598 | + if (isset($args->{$val})) |
|
599 | 599 | { |
600 | 600 | $args->{$val} = preg_replace('/[\pZ\pC]+/u', '', html_entity_decode($args->{$val})); |
601 | 601 | } |
@@ -603,22 +603,22 @@ discard block |
||
603 | 603 | |
604 | 604 | // Execute insert or update depending on the value of member_srl |
605 | 605 | $output = $this->updateMember($args); |
606 | - if(!$output->toBool()) return $output; |
|
606 | + if (!$output->toBool()) return $output; |
|
607 | 607 | |
608 | 608 | $profile_image = $_FILES['profile_image']; |
609 | - if(is_uploaded_file($profile_image['tmp_name'])) |
|
609 | + if (is_uploaded_file($profile_image['tmp_name'])) |
|
610 | 610 | { |
611 | 611 | $this->insertProfileImage($args->member_srl, $profile_image['tmp_name']); |
612 | 612 | } |
613 | 613 | |
614 | 614 | $image_mark = $_FILES['image_mark']; |
615 | - if(is_uploaded_file($image_mark['tmp_name'])) |
|
615 | + if (is_uploaded_file($image_mark['tmp_name'])) |
|
616 | 616 | { |
617 | 617 | $this->insertImageMark($args->member_srl, $image_mark['tmp_name']); |
618 | 618 | } |
619 | 619 | |
620 | 620 | $image_name = $_FILES['image_name']; |
621 | - if(is_uploaded_file($image_name['tmp_name'])) |
|
621 | + if (is_uploaded_file($image_name['tmp_name'])) |
|
622 | 622 | { |
623 | 623 | $this->insertImageName($args->member_srl, $image_name['tmp_name']); |
624 | 624 | } |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | |
634 | 634 | // Call a trigger after successfully log-in (after) |
635 | 635 | $trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo); |
636 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
636 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
637 | 637 | |
638 | 638 | $this->setSessionInfo(); |
639 | 639 | // Return result |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | */ |
655 | 655 | function procMemberModifyPassword() |
656 | 656 | { |
657 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
657 | + if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
658 | 658 | // Extract the necessary information in advance |
659 | 659 | $current_password = trim(Context::get('current_password')); |
660 | 660 | $password = trim(Context::get('password1')); |
@@ -668,17 +668,17 @@ discard block |
||
668 | 668 | |
669 | 669 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
670 | 670 | // Verify the cuttent password |
671 | - if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new BaseObject(-1, 'invalid_password'); |
|
671 | + if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new BaseObject(-1, 'invalid_password'); |
|
672 | 672 | |
673 | 673 | // Check if a new password is as same as the previous password |
674 | - if($current_password == $password) return new BaseObject(-1, 'invalid_new_password'); |
|
674 | + if ($current_password == $password) return new BaseObject(-1, 'invalid_new_password'); |
|
675 | 675 | |
676 | 676 | // Execute insert or update depending on the value of member_srl |
677 | 677 | $args = new stdClass; |
678 | 678 | $args->member_srl = $member_srl; |
679 | 679 | $args->password = $password; |
680 | 680 | $output = $this->updateMemberPassword($args); |
681 | - if(!$output->toBool()) return $output; |
|
681 | + if (!$output->toBool()) return $output; |
|
682 | 682 | |
683 | 683 | $this->add('member_srl', $args->member_srl); |
684 | 684 | $this->setMessage('success_updated'); |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | */ |
695 | 695 | function procMemberLeave() |
696 | 696 | { |
697 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
697 | + if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
698 | 698 | // Extract the necessary information in advance |
699 | 699 | $password = trim(Context::get('password')); |
700 | 700 | // Get information of logged-in user |
@@ -703,17 +703,17 @@ discard block |
||
703 | 703 | // Create a member model object |
704 | 704 | $oMemberModel = getModel('member'); |
705 | 705 | // Get information of member_srl |
706 | - if(!$this->memberInfo->password) |
|
706 | + if (!$this->memberInfo->password) |
|
707 | 707 | { |
708 | 708 | $columnList = array('member_srl', 'password'); |
709 | 709 | $memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
710 | 710 | $this->memberInfo->password = $memberInfo->password; |
711 | 711 | } |
712 | 712 | // Verify the cuttent password |
713 | - if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new BaseObject(-1, 'invalid_password'); |
|
713 | + if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new BaseObject(-1, 'invalid_password'); |
|
714 | 714 | |
715 | 715 | $output = $this->deleteMember($member_srl); |
716 | - if(!$output->toBool()) return $output; |
|
716 | + if (!$output->toBool()) return $output; |
|
717 | 717 | // Destroy all session information |
718 | 718 | $this->destroySessionInfo(); |
719 | 719 | // Return success message |
@@ -732,20 +732,20 @@ discard block |
||
732 | 732 | { |
733 | 733 | // Check if the file is successfully uploaded |
734 | 734 | $file = $_FILES['profile_image']; |
735 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image'); |
|
735 | + if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image'); |
|
736 | 736 | // Ignore if member_srl is invalid or doesn't exist. |
737 | 737 | $member_srl = Context::get('member_srl'); |
738 | - if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
738 | + if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
739 | 739 | |
740 | 740 | $logged_info = Context::get('logged_info'); |
741 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
741 | + if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
742 | 742 | // Return if member module is set not to use an image name or the user is not an administrator ; |
743 | 743 | $oMemberModel = getModel('member'); |
744 | 744 | $config = $oMemberModel->getMemberConfig(); |
745 | - if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image'); |
|
745 | + if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image'); |
|
746 | 746 | |
747 | 747 | $output = $this->insertProfileImage($member_srl, $file['tmp_name']); |
748 | - if(!$output->toBool()) return $output; |
|
748 | + if (!$output->toBool()) return $output; |
|
749 | 749 | |
750 | 750 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
751 | 751 | $this->setRedirectUrl($returnUrl); |
@@ -766,20 +766,20 @@ discard block |
||
766 | 766 | $max_width = $config->profile_image_max_width; |
767 | 767 | $max_height = $config->profile_image_max_height; |
768 | 768 | $max_filesize = $config->profile_image_max_filesize; |
769 | - foreach($config->signupForm as $val) |
|
769 | + foreach ($config->signupForm as $val) |
|
770 | 770 | { |
771 | - if($val->name == "profile_image") |
|
771 | + if ($val->name == "profile_image") |
|
772 | 772 | $allow_transparent = $val->allow_transparent_thumbnail == 'Y'; |
773 | 773 | } |
774 | 774 | |
775 | - Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
|
775 | + Context::loadLang(_XE_PATH_.'modules/file/lang'); |
|
776 | 776 | |
777 | 777 | // Get file information |
778 | 778 | FileHandler::clearStatCache($target_file); |
779 | 779 | list($width, $height, $type) = @getimagesize($target_file); |
780 | - if(IMAGETYPE_PNG == $type) $ext = 'png'; |
|
781 | - elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
782 | - elseif(IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
780 | + if (IMAGETYPE_PNG == $type) $ext = 'png'; |
|
781 | + elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
782 | + elseif (IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
783 | 783 | else |
784 | 784 | { |
785 | 785 | return $this->stop('msg_not_uploaded_profile_image'); |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | $target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext); |
792 | 792 | |
793 | 793 | // Convert if the image size is larger than a given size or if the format is not a gif |
794 | - if(($width > $max_width || $height > $max_height ) && $type != 1) |
|
794 | + if (($width > $max_width || $height > $max_height) && $type != 1) |
|
795 | 795 | { |
796 | 796 | $temp_filename = sprintf('files/cache/tmp/profile_image_%d.%s', $member_srl, $ext); |
797 | 797 | FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, $ext, 'crop', $allow_transparent); |
@@ -799,10 +799,10 @@ discard block |
||
799 | 799 | // 파일 용량 제한 |
800 | 800 | FileHandler::clearStatCache($temp_filename); |
801 | 801 | $filesize = filesize($temp_filename); |
802 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
802 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
803 | 803 | { |
804 | 804 | FileHandler::removeFile($temp_filename); |
805 | - return $this->stop(implode(' ' , array( |
|
805 | + return $this->stop(implode(' ', array( |
|
806 | 806 | Context::getLang('msg_not_uploaded_profile_image'), |
807 | 807 | Context::getLang('msg_exceeds_limit_size') |
808 | 808 | ))); |
@@ -816,9 +816,9 @@ discard block |
||
816 | 816 | { |
817 | 817 | // 파일 용량 제한 |
818 | 818 | $filesize = filesize($target_file); |
819 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
819 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
820 | 820 | { |
821 | - return $this->stop(implode(' ' , array( |
|
821 | + return $this->stop(implode(' ', array( |
|
822 | 822 | Context::getLang('msg_not_uploaded_profile_image'), |
823 | 823 | Context::getLang('msg_exceeds_limit_size') |
824 | 824 | ))); |
@@ -841,20 +841,20 @@ discard block |
||
841 | 841 | { |
842 | 842 | // Check if the file is successfully uploaded |
843 | 843 | $file = $_FILES['image_name']; |
844 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
844 | + if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
845 | 845 | // Ignore if member_srl is invalid or doesn't exist. |
846 | 846 | $member_srl = Context::get('member_srl'); |
847 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
847 | + if (!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
848 | 848 | |
849 | 849 | $logged_info = Context::get('logged_info'); |
850 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
850 | + if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
851 | 851 | // Return if member module is set not to use an image name or the user is not an administrator ; |
852 | 852 | $oMemberModel = getModel('member'); |
853 | 853 | $config = $oMemberModel->getMemberConfig(); |
854 | - if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
854 | + if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
855 | 855 | |
856 | 856 | $output = $this->insertImageName($member_srl, $file['tmp_name']); |
857 | - if(!$output->toBool()) return $output; |
|
857 | + if (!$output->toBool()) return $output; |
|
858 | 858 | |
859 | 859 | // Page refresh |
860 | 860 | //$this->setRefreshPage(); |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | $max_height = $config->image_name_max_height; |
880 | 880 | $max_filesize = $config->image_name_max_filesize; |
881 | 881 | |
882 | - Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
|
882 | + Context::loadLang(_XE_PATH_.'modules/file/lang'); |
|
883 | 883 | |
884 | 884 | // Get a target path to save |
885 | 885 | $target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl)); |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | // Get file information |
890 | 890 | list($width, $height, $type) = @getimagesize($target_file); |
891 | 891 | // Convert if the image size is larger than a given size or if the format is not a gif |
892 | - if($width > $max_width || $height > $max_height || $type!=1) |
|
892 | + if ($width > $max_width || $height > $max_height || $type != 1) |
|
893 | 893 | { |
894 | 894 | $temp_filename = sprintf('files/cache/tmp/image_name_%d.gif', $member_srl, $ext); |
895 | 895 | FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif'); |
@@ -897,10 +897,10 @@ discard block |
||
897 | 897 | // 파일 용량 제한 |
898 | 898 | FileHandler::clearStatCache($temp_filename); |
899 | 899 | $filesize = filesize($temp_filename); |
900 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
900 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
901 | 901 | { |
902 | 902 | FileHandler::removeFile($temp_filename); |
903 | - return $this->stop(implode(' ' , array( |
|
903 | + return $this->stop(implode(' ', array( |
|
904 | 904 | Context::getLang('msg_not_uploaded_image_name'), |
905 | 905 | Context::getLang('msg_exceeds_limit_size') |
906 | 906 | ))); |
@@ -914,9 +914,9 @@ discard block |
||
914 | 914 | { |
915 | 915 | // 파일 용량 제한 |
916 | 916 | $filesize = filesize($target_file); |
917 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
917 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
918 | 918 | { |
919 | - return $this->stop(implode(' ' , array( |
|
919 | + return $this->stop(implode(' ', array( |
|
920 | 920 | Context::getLang('msg_not_uploaded_image_name'), |
921 | 921 | Context::getLang('msg_exceeds_limit_size') |
922 | 922 | ))); |
@@ -938,20 +938,20 @@ discard block |
||
938 | 938 | function procMemberDeleteProfileImage($_memberSrl = 0) |
939 | 939 | { |
940 | 940 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
941 | - if(!$member_srl) |
|
941 | + if (!$member_srl) |
|
942 | 942 | { |
943 | - return new BaseObject(0,'success'); |
|
943 | + return new BaseObject(0, 'success'); |
|
944 | 944 | } |
945 | 945 | |
946 | 946 | $logged_info = Context::get('logged_info'); |
947 | 947 | |
948 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
948 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
949 | 949 | { |
950 | 950 | $oMemberModel = getModel('member'); |
951 | 951 | $profile_image = $oMemberModel->getProfileImage($member_srl); |
952 | 952 | FileHandler::removeFile($profile_image->file); |
953 | 953 | } |
954 | - return new BaseObject(0,'success'); |
|
954 | + return new BaseObject(0, 'success'); |
|
955 | 955 | } |
956 | 956 | |
957 | 957 | /** |
@@ -962,20 +962,20 @@ discard block |
||
962 | 962 | function procMemberDeleteImageName($_memberSrl = 0) |
963 | 963 | { |
964 | 964 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
965 | - if(!$member_srl) |
|
965 | + if (!$member_srl) |
|
966 | 966 | { |
967 | - return new BaseObject(0,'success'); |
|
967 | + return new BaseObject(0, 'success'); |
|
968 | 968 | } |
969 | 969 | |
970 | 970 | $logged_info = Context::get('logged_info'); |
971 | 971 | |
972 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
972 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
973 | 973 | { |
974 | 974 | $oMemberModel = getModel('member'); |
975 | 975 | $image_name = $oMemberModel->getImageName($member_srl); |
976 | 976 | FileHandler::removeFile($image_name->file); |
977 | 977 | } |
978 | - return new BaseObject(0,'success'); |
|
978 | + return new BaseObject(0, 'success'); |
|
979 | 979 | } |
980 | 980 | |
981 | 981 | /** |
@@ -987,20 +987,20 @@ discard block |
||
987 | 987 | { |
988 | 988 | // Check if the file is successfully uploaded |
989 | 989 | $file = $_FILES['image_mark']; |
990 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
990 | + if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
991 | 991 | // Ignore if member_srl is invalid or doesn't exist. |
992 | 992 | $member_srl = Context::get('member_srl'); |
993 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
993 | + if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
994 | 994 | |
995 | 995 | $logged_info = Context::get('logged_info'); |
996 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
996 | + if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
997 | 997 | // Membership in the images mark the module using the ban was set by an administrator or return; |
998 | 998 | $oMemberModel = getModel('member'); |
999 | 999 | $config = $oMemberModel->getMemberConfig(); |
1000 | - if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
1000 | + if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
1001 | 1001 | |
1002 | 1002 | $this->insertImageMark($member_srl, $file['tmp_name']); |
1003 | - if(!$output->toBool()) return $output; |
|
1003 | + if (!$output->toBool()) return $output; |
|
1004 | 1004 | |
1005 | 1005 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
1006 | 1006 | $this->setRedirectUrl($returnUrl); |
@@ -1022,7 +1022,7 @@ discard block |
||
1022 | 1022 | $max_height = $config->image_mark_max_height; |
1023 | 1023 | $max_filesize = $config->image_mark_max_filesize; |
1024 | 1024 | |
1025 | - Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
|
1025 | + Context::loadLang(_XE_PATH_.'modules/file/lang'); |
|
1026 | 1026 | |
1027 | 1027 | $target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); |
1028 | 1028 | FileHandler::makeDir($target_path); |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | // Get file information |
1032 | 1032 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
1033 | 1033 | |
1034 | - if($width > $max_width || $height > $max_height || $type!=1) |
|
1034 | + if ($width > $max_width || $height > $max_height || $type != 1) |
|
1035 | 1035 | { |
1036 | 1036 | $temp_filename = sprintf('files/cache/tmp/image_mark_%d.gif', $member_srl); |
1037 | 1037 | FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif'); |
@@ -1039,10 +1039,10 @@ discard block |
||
1039 | 1039 | // 파일 용량 제한 |
1040 | 1040 | FileHandler::clearStatCache($temp_filename); |
1041 | 1041 | $filesize = filesize($temp_filename); |
1042 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
1042 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
1043 | 1043 | { |
1044 | 1044 | FileHandler::removeFile($temp_filename); |
1045 | - return $this->stop(implode(' ' , array( |
|
1045 | + return $this->stop(implode(' ', array( |
|
1046 | 1046 | Context::getLang('msg_not_uploaded_group_image_mark'), |
1047 | 1047 | Context::getLang('msg_exceeds_limit_size') |
1048 | 1048 | ))); |
@@ -1055,10 +1055,10 @@ discard block |
||
1055 | 1055 | else |
1056 | 1056 | { |
1057 | 1057 | $filesize = filesize($target_file); |
1058 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
1058 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
1059 | 1059 | { |
1060 | 1060 | FileHandler::removeFile($target_file); |
1061 | - return $this->stop(implode(' ' , array( |
|
1061 | + return $this->stop(implode(' ', array( |
|
1062 | 1062 | Context::getLang('msg_not_uploaded_group_image_mark'), |
1063 | 1063 | Context::getLang('msg_exceeds_limit_size') |
1064 | 1064 | ))); |
@@ -1080,20 +1080,20 @@ discard block |
||
1080 | 1080 | function procMemberDeleteImageMark($_memberSrl = 0) |
1081 | 1081 | { |
1082 | 1082 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
1083 | - if(!$member_srl) |
|
1083 | + if (!$member_srl) |
|
1084 | 1084 | { |
1085 | - return new BaseObject(0,'success'); |
|
1085 | + return new BaseObject(0, 'success'); |
|
1086 | 1086 | } |
1087 | 1087 | |
1088 | 1088 | $logged_info = Context::get('logged_info'); |
1089 | 1089 | |
1090 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
1090 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
1091 | 1091 | { |
1092 | 1092 | $oMemberModel = getModel('member'); |
1093 | 1093 | $image_mark = $oMemberModel->getImageMark($member_srl); |
1094 | 1094 | FileHandler::removeFile($image_mark->file); |
1095 | 1095 | } |
1096 | - return new BaseObject(0,'success'); |
|
1096 | + return new BaseObject(0, 'success'); |
|
1097 | 1097 | } |
1098 | 1098 | |
1099 | 1099 | /** |
@@ -1104,26 +1104,26 @@ discard block |
||
1104 | 1104 | function procMemberFindAccount() |
1105 | 1105 | { |
1106 | 1106 | $email_address = Context::get('email_address'); |
1107 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1107 | + if (!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1108 | 1108 | |
1109 | 1109 | $oMemberModel = getModel('member'); |
1110 | 1110 | $oModuleModel = getModel('module'); |
1111 | 1111 | |
1112 | 1112 | // Check if a member having the same email address exists |
1113 | 1113 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1114 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1114 | + if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1115 | 1115 | |
1116 | 1116 | // Get information of the member |
1117 | 1117 | $columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name'); |
1118 | 1118 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
1119 | 1119 | |
1120 | 1120 | // Check if possible to find member's ID and password |
1121 | - if($member_info->denied == 'Y') |
|
1121 | + if ($member_info->denied == 'Y') |
|
1122 | 1122 | { |
1123 | 1123 | $chk_args = new stdClass; |
1124 | 1124 | $chk_args->member_srl = $member_info->member_srl; |
1125 | 1125 | $output = executeQuery('member.chkAuthMail', $chk_args); |
1126 | - if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
1126 | + if ($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
1127 | 1127 | } |
1128 | 1128 | |
1129 | 1129 | // Insert data into the authentication DB |
@@ -1136,19 +1136,19 @@ discard block |
||
1136 | 1136 | $args->is_register = 'N'; |
1137 | 1137 | |
1138 | 1138 | $output = executeQuery('member.insertAuthMail', $args); |
1139 | - if(!$output->toBool()) return $output; |
|
1139 | + if (!$output->toBool()) return $output; |
|
1140 | 1140 | // Get content of the email to send a member |
1141 | 1141 | Context::set('auth_args', $args); |
1142 | 1142 | |
1143 | 1143 | $member_config = $oModuleModel->getModuleConfig('member'); |
1144 | 1144 | $memberInfo = array(); |
1145 | 1145 | global $lang; |
1146 | - if(is_array($member_config->signupForm)) |
|
1146 | + if (is_array($member_config->signupForm)) |
|
1147 | 1147 | { |
1148 | - $exceptForm=array('password', 'find_account_question'); |
|
1149 | - foreach($member_config->signupForm as $form) |
|
1148 | + $exceptForm = array('password', 'find_account_question'); |
|
1149 | + foreach ($member_config->signupForm as $form) |
|
1150 | 1150 | { |
1151 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1151 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1152 | 1152 | { |
1153 | 1153 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1154 | 1154 | } |
@@ -1163,15 +1163,15 @@ discard block |
||
1163 | 1163 | } |
1164 | 1164 | Context::set('memberInfo', $memberInfo); |
1165 | 1165 | |
1166 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1167 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1166 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
1167 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
1168 | 1168 | |
1169 | 1169 | Context::set('member_config', $member_config); |
1170 | 1170 | |
1171 | 1171 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1172 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1172 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1173 | 1173 | |
1174 | - $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
|
1174 | + $find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
|
1175 | 1175 | Context::set('find_url', $find_url); |
1176 | 1176 | |
1177 | 1177 | $oTemplate = &TemplateHandler::getInstance(); |
@@ -1181,19 +1181,19 @@ discard block |
||
1181 | 1181 | $member_config = $oModuleModel->getModuleConfig('member'); |
1182 | 1182 | // Send a mail |
1183 | 1183 | $oMail = new Mail(); |
1184 | - $oMail->setTitle( Context::getLang('msg_find_account_title') ); |
|
1184 | + $oMail->setTitle(Context::getLang('msg_find_account_title')); |
|
1185 | 1185 | $oMail->setContent($content); |
1186 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
1187 | - $oMail->setReceiptor( $member_info->user_name, $member_info->email_address ); |
|
1186 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
1187 | + $oMail->setReceiptor($member_info->user_name, $member_info->email_address); |
|
1188 | 1188 | $oMail->send(); |
1189 | 1189 | // Return message |
1190 | 1190 | $msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address); |
1191 | - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) |
|
1191 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
1192 | 1192 | { |
1193 | 1193 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount'); |
1194 | 1194 | $this->setRedirectUrl($returnUrl); |
1195 | 1195 | } |
1196 | - return new BaseObject(0,$msg); |
|
1196 | + return new BaseObject(0, $msg); |
|
1197 | 1197 | } |
1198 | 1198 | |
1199 | 1199 | /** |
@@ -1204,7 +1204,7 @@ discard block |
||
1204 | 1204 | function procMemberFindAccountByQuestion() |
1205 | 1205 | { |
1206 | 1206 | $oMemberModel = getModel('member'); |
1207 | - $oPassword = new Password(); |
|
1207 | + $oPassword = new Password(); |
|
1208 | 1208 | $config = $oMemberModel->getMemberConfig(); |
1209 | 1209 | |
1210 | 1210 | $email_address = Context::get('email_address'); |
@@ -1212,49 +1212,49 @@ discard block |
||
1212 | 1212 | $find_account_question = trim(Context::get('find_account_question')); |
1213 | 1213 | $find_account_answer = trim(Context::get('find_account_answer')); |
1214 | 1214 | |
1215 | - if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
1215 | + if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
1216 | 1216 | |
1217 | 1217 | $oModuleModel = getModel('module'); |
1218 | 1218 | // Check if a member having the same email address exists |
1219 | 1219 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1220 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1220 | + if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1221 | 1221 | |
1222 | 1222 | // Get information of the member |
1223 | 1223 | $columnList = array('member_srl', 'find_account_question', 'find_account_answer'); |
1224 | 1224 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
1225 | 1225 | |
1226 | 1226 | // Display a message if no answer is entered |
1227 | - if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
1227 | + if (!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
1228 | 1228 | |
1229 | 1229 | // 답변 확인 |
1230 | 1230 | $hashed = $oPassword->checkAlgorithm($member_info->find_account_answer); |
1231 | 1231 | $authed = true; |
1232 | 1232 | $member_info->find_account_question = trim($member_info->find_account_question); |
1233 | - if($member_info->find_account_question != $find_account_question) |
|
1233 | + if ($member_info->find_account_question != $find_account_question) |
|
1234 | 1234 | { |
1235 | 1235 | $authed = false; |
1236 | 1236 | } |
1237 | - else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
1237 | + else if ($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
1238 | 1238 | { |
1239 | 1239 | $authed = false; |
1240 | 1240 | } |
1241 | - else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
1241 | + else if (!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
1242 | 1242 | { |
1243 | 1243 | $authed = false; |
1244 | 1244 | } |
1245 | 1245 | |
1246 | - if(!$authed) |
|
1246 | + if (!$authed) |
|
1247 | 1247 | { |
1248 | 1248 | return new BaseObject(-1, 'msg_answer_not_matches'); |
1249 | 1249 | } |
1250 | 1250 | |
1251 | 1251 | // answer가 동일하고 hash 되지 않았으면 hash 값으로 저장 |
1252 | - if($authed && !$hashed) |
|
1252 | + if ($authed && !$hashed) |
|
1253 | 1253 | { |
1254 | 1254 | $this->updateFindAccountAnswer($member_srl, $find_account_answer); |
1255 | 1255 | } |
1256 | 1256 | |
1257 | - if($config->identifier == 'email_address') |
|
1257 | + if ($config->identifier == 'email_address') |
|
1258 | 1258 | { |
1259 | 1259 | $user_id = $email_address; |
1260 | 1260 | } |
@@ -1267,11 +1267,11 @@ discard block |
||
1267 | 1267 | $args->password = $temp_password; |
1268 | 1268 | $args->change_password_date = '1'; |
1269 | 1269 | $output = $this->updateMemberPassword($args); |
1270 | - if(!$output->toBool()) return $output; |
|
1270 | + if (!$output->toBool()) return $output; |
|
1271 | 1271 | |
1272 | - $_SESSION['xe_temp_password_' . $user_id] = $temp_password; |
|
1272 | + $_SESSION['xe_temp_password_'.$user_id] = $temp_password; |
|
1273 | 1273 | |
1274 | - $this->add('user_id',$user_id); |
|
1274 | + $this->add('user_id', $user_id); |
|
1275 | 1275 | |
1276 | 1276 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); |
1277 | 1277 | $this->setRedirectUrl($returnUrl.'&user_id='.$user_id); |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | $member_srl = Context::get('member_srl'); |
1292 | 1292 | $auth_key = Context::get('auth_key'); |
1293 | 1293 | |
1294 | - if(!$member_srl || !$auth_key) |
|
1294 | + if (!$member_srl || !$auth_key) |
|
1295 | 1295 | { |
1296 | 1296 | return $this->stop('msg_invalid_request'); |
1297 | 1297 | } |
@@ -1302,9 +1302,9 @@ discard block |
||
1302 | 1302 | $args->auth_key = $auth_key; |
1303 | 1303 | $output = executeQuery('member.getAuthMail', $args); |
1304 | 1304 | |
1305 | - if(!$output->toBool() || $output->data->auth_key != $auth_key) |
|
1305 | + if (!$output->toBool() || $output->data->auth_key != $auth_key) |
|
1306 | 1306 | { |
1307 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) |
|
1307 | + if (strlen($output->data->auth_key) !== strlen($auth_key)) |
|
1308 | 1308 | { |
1309 | 1309 | executeQuery('member.deleteAuthMail', $args); |
1310 | 1310 | } |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | return $this->stop('msg_invalid_auth_key'); |
1313 | 1313 | } |
1314 | 1314 | |
1315 | - if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400) |
|
1315 | + if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400) |
|
1316 | 1316 | { |
1317 | 1317 | executeQuery('member.deleteAuthMail', $args); |
1318 | 1318 | |
@@ -1327,7 +1327,7 @@ discard block |
||
1327 | 1327 | $auth_args->is_register = 'Y'; |
1328 | 1328 | |
1329 | 1329 | $output = executeQuery('member.insertAuthMail', $auth_args); |
1330 | - if(!$output->toBool()) return $output; |
|
1330 | + if (!$output->toBool()) return $output; |
|
1331 | 1331 | |
1332 | 1332 | // resend auth mail. |
1333 | 1333 | $this->_sendAuthMail($auth_args, $memberInfo); |
@@ -1341,7 +1341,7 @@ discard block |
||
1341 | 1341 | $args->password = $output->data->new_password; |
1342 | 1342 | |
1343 | 1343 | // If credentials are correct, change the password to a new one |
1344 | - if($output->data->is_register == 'Y') |
|
1344 | + if ($output->data->is_register == 'Y') |
|
1345 | 1345 | { |
1346 | 1346 | $args->denied = 'N'; |
1347 | 1347 | } |
@@ -1354,13 +1354,13 @@ discard block |
||
1354 | 1354 | $is_register = $output->data->is_register; |
1355 | 1355 | |
1356 | 1356 | $output = executeQuery('member.updateMemberPassword', $args); |
1357 | - if(!$output->toBool()) |
|
1357 | + if (!$output->toBool()) |
|
1358 | 1358 | { |
1359 | 1359 | return $this->stop($output->getMessage()); |
1360 | 1360 | } |
1361 | 1361 | |
1362 | 1362 | // Remove all values having the member_srl from authentication table |
1363 | - executeQuery('member.deleteAuthMail',$args); |
|
1363 | + executeQuery('member.deleteAuthMail', $args); |
|
1364 | 1364 | |
1365 | 1365 | $this->_clearMemberCache($args->member_srl); |
1366 | 1366 | |
@@ -1379,33 +1379,33 @@ discard block |
||
1379 | 1379 | { |
1380 | 1380 | // Get an email_address |
1381 | 1381 | $email_address = Context::get('email_address'); |
1382 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1382 | + if (!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1383 | 1383 | // Log test by using email_address |
1384 | 1384 | $oMemberModel = getModel('member'); |
1385 | 1385 | |
1386 | 1386 | $args = new stdClass; |
1387 | 1387 | $args->email_address = $email_address; |
1388 | 1388 | $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1389 | - if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
1389 | + if (!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
1390 | 1390 | |
1391 | 1391 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address'); |
1392 | 1392 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList); |
1393 | 1393 | |
1394 | 1394 | $oModuleModel = getModel('module'); |
1395 | 1395 | $member_config = $oModuleModel->getModuleConfig('member'); |
1396 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1397 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1396 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
1397 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
1398 | 1398 | |
1399 | 1399 | // Check if a authentication mail has been sent previously |
1400 | 1400 | $chk_args = new stdClass; |
1401 | 1401 | $chk_args->member_srl = $member_info->member_srl; |
1402 | 1402 | $output = executeQuery('member.chkAuthMail', $chk_args); |
1403 | - if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
1403 | + if ($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
1404 | 1404 | |
1405 | 1405 | $auth_args = new stdClass; |
1406 | 1406 | $auth_args->member_srl = $member_info->member_srl; |
1407 | 1407 | $output = executeQueryArray('member.getAuthMailInfo', $auth_args); |
1408 | - if(!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
1408 | + if (!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
1409 | 1409 | $auth_info = $output->data[0]; |
1410 | 1410 | |
1411 | 1411 | // Update the regdate of authmail entry |
@@ -1416,12 +1416,12 @@ discard block |
||
1416 | 1416 | |
1417 | 1417 | $memberInfo = array(); |
1418 | 1418 | global $lang; |
1419 | - if(is_array($member_config->signupForm)) |
|
1419 | + if (is_array($member_config->signupForm)) |
|
1420 | 1420 | { |
1421 | - $exceptForm=array('password', 'find_account_question'); |
|
1422 | - foreach($member_config->signupForm as $form) |
|
1421 | + $exceptForm = array('password', 'find_account_question'); |
|
1422 | + foreach ($member_config->signupForm as $form) |
|
1423 | 1423 | { |
1424 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1424 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1425 | 1425 | { |
1426 | 1426 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1427 | 1427 | } |
@@ -1440,19 +1440,19 @@ discard block |
||
1440 | 1440 | Context::set('member_config', $member_config); |
1441 | 1441 | |
1442 | 1442 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1443 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1443 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1444 | 1444 | |
1445 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); |
|
1445 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key); |
|
1446 | 1446 | Context::set('auth_url', $auth_url); |
1447 | 1447 | |
1448 | 1448 | $oTemplate = &TemplateHandler::getInstance(); |
1449 | 1449 | $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); |
1450 | 1450 | // Send a mail |
1451 | 1451 | $oMail = new Mail(); |
1452 | - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); |
|
1452 | + $oMail->setTitle(Context::getLang('msg_confirm_account_title')); |
|
1453 | 1453 | $oMail->setContent($content); |
1454 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
1455 | - $oMail->setReceiptor( $args->user_name, $args->email_address ); |
|
1454 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
1455 | + $oMail->setReceiptor($args->user_name, $args->email_address); |
|
1456 | 1456 | $oMail->send(); |
1457 | 1457 | |
1458 | 1458 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
@@ -1467,23 +1467,23 @@ discard block |
||
1467 | 1467 | $memberInfo = $_SESSION['auth_member_info']; |
1468 | 1468 | unset($_SESSION['auth_member_info']); |
1469 | 1469 | |
1470 | - if(!$memberInfo) |
|
1470 | + if (!$memberInfo) |
|
1471 | 1471 | { |
1472 | 1472 | return $this->stop('msg_invalid_request'); |
1473 | 1473 | } |
1474 | 1474 | |
1475 | 1475 | $newEmail = Context::get('email_address'); |
1476 | 1476 | |
1477 | - if(!$newEmail) |
|
1477 | + if (!$newEmail) |
|
1478 | 1478 | { |
1479 | 1479 | return $this->stop('msg_invalid_request'); |
1480 | 1480 | } |
1481 | 1481 | |
1482 | 1482 | $oMemberModel = getModel('member'); |
1483 | 1483 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
1484 | - if($member_srl) |
|
1484 | + if ($member_srl) |
|
1485 | 1485 | { |
1486 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
1486 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
1487 | 1487 | } |
1488 | 1488 | |
1489 | 1489 | // remove all key by member_srl |
@@ -1491,7 +1491,7 @@ discard block |
||
1491 | 1491 | $args->member_srl = $memberInfo->member_srl; |
1492 | 1492 | $output = executeQuery('member.deleteAuthMail', $args); |
1493 | 1493 | |
1494 | - if(!$output->toBool()) |
|
1494 | + if (!$output->toBool()) |
|
1495 | 1495 | { |
1496 | 1496 | return $output; |
1497 | 1497 | } |
@@ -1501,7 +1501,7 @@ discard block |
||
1501 | 1501 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
1502 | 1502 | |
1503 | 1503 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
1504 | - if(!$output->toBool()) |
|
1504 | + if (!$output->toBool()) |
|
1505 | 1505 | { |
1506 | 1506 | return $this->stop($output->getMessage()); |
1507 | 1507 | } |
@@ -1518,7 +1518,7 @@ discard block |
||
1518 | 1518 | $auth_args->is_register = 'Y'; |
1519 | 1519 | |
1520 | 1520 | $output = executeQuery('member.insertAuthMail', $auth_args); |
1521 | - if(!$output->toBool()) return $output; |
|
1521 | + if (!$output->toBool()) return $output; |
|
1522 | 1522 | |
1523 | 1523 | $memberInfo->email_address = $newEmail; |
1524 | 1524 | |
@@ -1542,12 +1542,12 @@ discard block |
||
1542 | 1542 | $memberInfo = array(); |
1543 | 1543 | |
1544 | 1544 | global $lang; |
1545 | - if(is_array($member_config->signupForm)) |
|
1545 | + if (is_array($member_config->signupForm)) |
|
1546 | 1546 | { |
1547 | - $exceptForm=array('password', 'find_account_question'); |
|
1548 | - foreach($member_config->signupForm as $form) |
|
1547 | + $exceptForm = array('password', 'find_account_question'); |
|
1548 | + foreach ($member_config->signupForm as $form) |
|
1549 | 1549 | { |
1550 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1550 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1551 | 1551 | { |
1552 | 1552 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1553 | 1553 | } |
@@ -1562,25 +1562,25 @@ discard block |
||
1562 | 1562 | } |
1563 | 1563 | Context::set('memberInfo', $memberInfo); |
1564 | 1564 | |
1565 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1566 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1565 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
1566 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
1567 | 1567 | |
1568 | 1568 | Context::set('member_config', $member_config); |
1569 | 1569 | |
1570 | 1570 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1571 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1571 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1572 | 1572 | |
1573 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
|
1573 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key); |
|
1574 | 1574 | Context::set('auth_url', $auth_url); |
1575 | 1575 | |
1576 | 1576 | $oTemplate = &TemplateHandler::getInstance(); |
1577 | 1577 | $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); |
1578 | 1578 | // Send a mail |
1579 | 1579 | $oMail = new Mail(); |
1580 | - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); |
|
1580 | + $oMail->setTitle(Context::getLang('msg_confirm_account_title')); |
|
1581 | 1581 | $oMail->setContent($content); |
1582 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
1583 | - $oMail->setReceiptor( $member_info->user_name, $member_info->email_address ); |
|
1582 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
1583 | + $oMail->setReceiptor($member_info->user_name, $member_info->email_address); |
|
1584 | 1584 | $oMail->send(); |
1585 | 1585 | } |
1586 | 1586 | |
@@ -1593,7 +1593,7 @@ discard block |
||
1593 | 1593 | { |
1594 | 1594 | $site_module_info = Context::get('site_module_info'); |
1595 | 1595 | $logged_info = Context::get('logged_info'); |
1596 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
1596 | + if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request'); |
|
1597 | 1597 | |
1598 | 1598 | $oMemberModel = getModel('member'); |
1599 | 1599 | $columnList = array('site_srl', 'group_srl', 'title'); |
@@ -1612,13 +1612,13 @@ discard block |
||
1612 | 1612 | { |
1613 | 1613 | $site_module_info = Context::get('site_module_info'); |
1614 | 1614 | $logged_info = Context::get('logged_info'); |
1615 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
1615 | + if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request'); |
|
1616 | 1616 | |
1617 | 1617 | $args = new stdClass; |
1618 | - $args->site_srl= $site_module_info->site_srl; |
|
1618 | + $args->site_srl = $site_module_info->site_srl; |
|
1619 | 1619 | $args->member_srl = $logged_info->member_srl; |
1620 | 1620 | $output = executeQuery('member.deleteMembersGroup', $args); |
1621 | - if(!$output->toBool()) return $output; |
|
1621 | + if (!$output->toBool()) return $output; |
|
1622 | 1622 | $this->setMessage('success_deleted'); |
1623 | 1623 | $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl); |
1624 | 1624 | } |
@@ -1632,25 +1632,25 @@ discard block |
||
1632 | 1632 | */ |
1633 | 1633 | function setMemberConfig($args) |
1634 | 1634 | { |
1635 | - if(!$args->skin) $args->skin = "default"; |
|
1636 | - if(!$args->colorset) $args->colorset = "white"; |
|
1637 | - if(!$args->editor_skin) $args->editor_skin= "ckeditor"; |
|
1638 | - if(!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
1639 | - if($args->enable_join!='Y') $args->enable_join = 'N'; |
|
1640 | - $args->enable_openid= 'N'; |
|
1641 | - if($args->profile_image !='Y') $args->profile_image = 'N'; |
|
1642 | - if($args->image_name!='Y') $args->image_name = 'N'; |
|
1643 | - if($args->image_mark!='Y') $args->image_mark = 'N'; |
|
1644 | - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; |
|
1645 | - if(!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
1646 | - $args->limit_day = (int)$args->limit_day; |
|
1635 | + if (!$args->skin) $args->skin = "default"; |
|
1636 | + if (!$args->colorset) $args->colorset = "white"; |
|
1637 | + if (!$args->editor_skin) $args->editor_skin = "ckeditor"; |
|
1638 | + if (!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
1639 | + if ($args->enable_join != 'Y') $args->enable_join = 'N'; |
|
1640 | + $args->enable_openid = 'N'; |
|
1641 | + if ($args->profile_image != 'Y') $args->profile_image = 'N'; |
|
1642 | + if ($args->image_name != 'Y') $args->image_name = 'N'; |
|
1643 | + if ($args->image_mark != 'Y') $args->image_mark = 'N'; |
|
1644 | + if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N'; |
|
1645 | + if (!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
1646 | + $args->limit_day = (int) $args->limit_day; |
|
1647 | 1647 | |
1648 | 1648 | $agreement = trim($args->agreement); |
1649 | 1649 | unset($args->agreement); |
1650 | 1650 | |
1651 | 1651 | $oModuleController = getController('module'); |
1652 | - $output = $oModuleController->insertModuleConfig('member',$args); |
|
1653 | - if(!$output->toBool()) return $output; |
|
1652 | + $output = $oModuleController->insertModuleConfig('member', $args); |
|
1653 | + if (!$output->toBool()) return $output; |
|
1654 | 1654 | |
1655 | 1655 | $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
1656 | 1656 | FileHandler::writeFile($agreement_file, $agreement); |
@@ -1671,11 +1671,11 @@ discard block |
||
1671 | 1671 | $signature = trim(removeHackTag($signature)); |
1672 | 1672 | $signature = preg_replace('/<(\/?)(embed|object|param)/is', '<$1$2', $signature); |
1673 | 1673 | |
1674 | - $check_signature = trim(str_replace(array(' ',"\n","\r"), '', strip_tags($signature, '<img><object>'))); |
|
1674 | + $check_signature = trim(str_replace(array(' ', "\n", "\r"), '', strip_tags($signature, '<img><object>'))); |
|
1675 | 1675 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
1676 | 1676 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
1677 | 1677 | |
1678 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
1678 | + if (!$check_signature) return FileHandler::removeFile($filename); |
|
1679 | 1679 | |
1680 | 1680 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
1681 | 1681 | FileHandler::makeDir($path); |
@@ -1704,15 +1704,15 @@ discard block |
||
1704 | 1704 | * |
1705 | 1705 | * @return BaseObject |
1706 | 1706 | */ |
1707 | - function addMemberToGroup($member_srl, $group_srl, $site_srl=0) |
|
1707 | + function addMemberToGroup($member_srl, $group_srl, $site_srl = 0) |
|
1708 | 1708 | { |
1709 | 1709 | $args = new stdClass(); |
1710 | 1710 | $args->member_srl = $member_srl; |
1711 | 1711 | $args->group_srl = $group_srl; |
1712 | - if($site_srl) $args->site_srl = $site_srl; |
|
1712 | + if ($site_srl) $args->site_srl = $site_srl; |
|
1713 | 1713 | |
1714 | 1714 | // Add |
1715 | - $output = executeQuery('member.addMemberToGroup',$args); |
|
1715 | + $output = executeQuery('member.addMemberToGroup', $args); |
|
1716 | 1716 | $output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args); |
1717 | 1717 | |
1718 | 1718 | $this->_clearMemberCache($member_srl, $site_srl); |
@@ -1732,18 +1732,18 @@ discard block |
||
1732 | 1732 | { |
1733 | 1733 | $obj = new stdClass; |
1734 | 1734 | $obj->site_srl = $args->site_srl; |
1735 | - $obj->member_srl = implode(',',$args->member_srl); |
|
1735 | + $obj->member_srl = implode(',', $args->member_srl); |
|
1736 | 1736 | |
1737 | 1737 | $output = executeQueryArray('member.getMembersGroup', $obj); |
1738 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1738 | + if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1739 | 1739 | |
1740 | 1740 | $output = executeQuery('member.deleteMembersGroup', $obj); |
1741 | - if(!$output->toBool()) return $output; |
|
1741 | + if (!$output->toBool()) return $output; |
|
1742 | 1742 | |
1743 | 1743 | $inserted_members = array(); |
1744 | - foreach($args->member_srl as $key => $val) |
|
1744 | + foreach ($args->member_srl as $key => $val) |
|
1745 | 1745 | { |
1746 | - if($inserted_members[$val]) continue; |
|
1746 | + if ($inserted_members[$val]) continue; |
|
1747 | 1747 | $inserted_members[$val] = true; |
1748 | 1748 | |
1749 | 1749 | unset($obj); |
@@ -1753,7 +1753,7 @@ discard block |
||
1753 | 1753 | $obj->site_srl = $args->site_srl; |
1754 | 1754 | $obj->regdate = $date[$obj->member_srl]; |
1755 | 1755 | $output = executeQuery('member.addMemberToGroup', $obj); |
1756 | - if(!$output->toBool()) return $output; |
|
1756 | + if (!$output->toBool()) return $output; |
|
1757 | 1757 | |
1758 | 1758 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
1759 | 1759 | } |
@@ -1775,9 +1775,9 @@ discard block |
||
1775 | 1775 | // Get information of the key |
1776 | 1776 | $output = executeQuery('member.getAutologin', $args); |
1777 | 1777 | // If no information exists, delete a cookie |
1778 | - if(!$output->toBool() || !$output->data) |
|
1778 | + if (!$output->toBool() || !$output->data) |
|
1779 | 1779 | { |
1780 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
1780 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
1781 | 1781 | return; |
1782 | 1782 | } |
1783 | 1783 | |
@@ -1787,9 +1787,9 @@ discard block |
||
1787 | 1787 | $user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address; |
1788 | 1788 | $password = $output->data->password; |
1789 | 1789 | |
1790 | - if(!$user_id || !$password) |
|
1790 | + if (!$user_id || !$password) |
|
1791 | 1791 | { |
1792 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
1792 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
1793 | 1793 | return; |
1794 | 1794 | } |
1795 | 1795 | |
@@ -1799,7 +1799,7 @@ discard block |
||
1799 | 1799 | $check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT']; |
1800 | 1800 | $check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32); |
1801 | 1801 | |
1802 | - if($check_key === substr($args->autologin_key, 32)) |
|
1802 | + if ($check_key === substr($args->autologin_key, 32)) |
|
1803 | 1803 | { |
1804 | 1804 | // Check change_password_date |
1805 | 1805 | $oModuleModel = getModel('module'); |
@@ -1807,12 +1807,12 @@ discard block |
||
1807 | 1807 | $limit_date = $member_config->change_password_date; |
1808 | 1808 | |
1809 | 1809 | // Check if change_password_date is set |
1810 | - if($limit_date > 0) |
|
1810 | + if ($limit_date > 0) |
|
1811 | 1811 | { |
1812 | 1812 | $oMemberModel = getModel('member'); |
1813 | 1813 | $columnList = array('member_srl', 'change_password_date'); |
1814 | 1814 | |
1815 | - if($config->identifier == 'user_id') |
|
1815 | + if ($config->identifier == 'user_id') |
|
1816 | 1816 | { |
1817 | 1817 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
1818 | 1818 | } |
@@ -1821,7 +1821,7 @@ discard block |
||
1821 | 1821 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
1822 | 1822 | } |
1823 | 1823 | |
1824 | - if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){ |
|
1824 | + if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) { |
|
1825 | 1825 | $do_auto_login = true; |
1826 | 1826 | } |
1827 | 1827 | |
@@ -1832,14 +1832,14 @@ discard block |
||
1832 | 1832 | } |
1833 | 1833 | } |
1834 | 1834 | |
1835 | - if($do_auto_login) |
|
1835 | + if ($do_auto_login) |
|
1836 | 1836 | { |
1837 | 1837 | $output = $this->doLogin($user_id); |
1838 | 1838 | } |
1839 | 1839 | else |
1840 | 1840 | { |
1841 | 1841 | executeQuery('member.deleteAutologin', $args); |
1842 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
1842 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
1843 | 1843 | } |
1844 | 1844 | } |
1845 | 1845 | |
@@ -1855,13 +1855,13 @@ discard block |
||
1855 | 1855 | function doLogin($user_id, $password = '', $keep_signed = false) |
1856 | 1856 | { |
1857 | 1857 | $user_id = strtolower($user_id); |
1858 | - if(!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
1858 | + if (!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
1859 | 1859 | // Call a trigger before log-in (before) |
1860 | 1860 | $trigger_obj = new stdClass(); |
1861 | 1861 | $trigger_obj->user_id = $user_id; |
1862 | 1862 | $trigger_obj->password = $password; |
1863 | 1863 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
1864 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
1864 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
1865 | 1865 | // Create a member model object |
1866 | 1866 | $oMemberModel = getModel('member'); |
1867 | 1867 | |
@@ -1871,12 +1871,12 @@ discard block |
||
1871 | 1871 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
1872 | 1872 | |
1873 | 1873 | // check identifier |
1874 | - if($config->identifier == 'email_address') |
|
1874 | + if ($config->identifier == 'email_address') |
|
1875 | 1875 | { |
1876 | 1876 | // Get user_id information |
1877 | 1877 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
1878 | 1878 | // Set an invalid user if no value returned |
1879 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
1879 | + if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
1880 | 1880 | |
1881 | 1881 | } |
1882 | 1882 | else |
@@ -1884,24 +1884,24 @@ discard block |
||
1884 | 1884 | // Get user_id information |
1885 | 1885 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
1886 | 1886 | // Set an invalid user if no value returned |
1887 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
1887 | + if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
1888 | 1888 | } |
1889 | 1889 | |
1890 | 1890 | $output = executeQuery('member.getLoginCountByIp', $args); |
1891 | 1891 | $errorCount = $output->data->count; |
1892 | - if($errorCount >= $config->max_error_count) |
|
1892 | + if ($errorCount >= $config->max_error_count) |
|
1893 | 1893 | { |
1894 | 1894 | $last_update = strtotime($output->data->last_update); |
1895 | - $term = intval($_SERVER['REQUEST_TIME']-$last_update); |
|
1896 | - if($term < $config->max_error_count_time) |
|
1895 | + $term = intval($_SERVER['REQUEST_TIME'] - $last_update); |
|
1896 | + if ($term < $config->max_error_count_time) |
|
1897 | 1897 | { |
1898 | 1898 | $term = $config->max_error_count_time - $term; |
1899 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
1900 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
1901 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
1902 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
1899 | + if ($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
1900 | + elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min'); |
|
1901 | + elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour'); |
|
1902 | + else $term = intval($term / 86400).Context::getLang('unit_day'); |
|
1903 | 1903 | |
1904 | - return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
|
1904 | + return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'), $term)); |
|
1905 | 1905 | } |
1906 | 1906 | else |
1907 | 1907 | { |
@@ -1911,13 +1911,13 @@ discard block |
||
1911 | 1911 | } |
1912 | 1912 | |
1913 | 1913 | // Password Check |
1914 | - if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
1914 | + if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
1915 | 1915 | { |
1916 | - return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo); |
|
1916 | + return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo); |
|
1917 | 1917 | } |
1918 | 1918 | |
1919 | 1919 | // If denied == 'Y', notify |
1920 | - if($this->memberInfo->denied == 'Y') |
|
1920 | + if ($this->memberInfo->denied == 'Y') |
|
1921 | 1921 | { |
1922 | 1922 | $args->member_srl = $this->memberInfo->member_srl; |
1923 | 1923 | $output = executeQuery('member.chkAuthMail', $args); |
@@ -1925,12 +1925,12 @@ discard block |
||
1925 | 1925 | { |
1926 | 1926 | $_SESSION['auth_member_srl'] = $this->memberInfo->member_srl; |
1927 | 1927 | $redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail'); |
1928 | - return $this->setRedirectUrl($redirectUrl, new BaseObject(-1,'msg_user_not_confirmed')); |
|
1928 | + return $this->setRedirectUrl($redirectUrl, new BaseObject(-1, 'msg_user_not_confirmed')); |
|
1929 | 1929 | } |
1930 | - return new BaseObject(-1,'msg_user_denied'); |
|
1930 | + return new BaseObject(-1, 'msg_user_denied'); |
|
1931 | 1931 | } |
1932 | 1932 | // Notify if denied_date is less than the current time |
1933 | - if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
1933 | + if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) return new BaseObject(-9, sprintf(Context::getLang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d"))); |
|
1934 | 1934 | // Update the latest login time |
1935 | 1935 | $args->member_srl = $this->memberInfo->member_srl; |
1936 | 1936 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1940,36 +1940,36 @@ discard block |
||
1940 | 1940 | |
1941 | 1941 | // Check if there is recoding table. |
1942 | 1942 | $oDB = &DB::getInstance(); |
1943 | - if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
1943 | + if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
1944 | 1944 | { |
1945 | 1945 | // check if there is login fail records. |
1946 | 1946 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
1947 | - if($output->data && $output->data->content) |
|
1947 | + if ($output->data && $output->data->content) |
|
1948 | 1948 | { |
1949 | 1949 | $title = Context::getLang('login_fail_report'); |
1950 | 1950 | $message = '<ul>'; |
1951 | 1951 | $content = unserialize($output->data->content); |
1952 | - if(count($content) > $config->max_error_count) |
|
1952 | + if (count($content) > $config->max_error_count) |
|
1953 | 1953 | { |
1954 | - foreach($content as $val) |
|
1954 | + foreach ($content as $val) |
|
1955 | 1955 | { |
1956 | - $message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa',$val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>'; |
|
1956 | + $message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa', $val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>'; |
|
1957 | 1957 | } |
1958 | 1958 | $message .= '</ul>'; |
1959 | - $content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa')); |
|
1959 | + $content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa')); |
|
1960 | 1960 | |
1961 | 1961 | //send message |
1962 | 1962 | $oCommunicationController = getController('communication'); |
1963 | 1963 | $oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true); |
1964 | 1964 | |
1965 | - if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
1965 | + if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
1966 | 1966 | { |
1967 | 1967 | $view_url = Context::getRequestUri(); |
1968 | - $content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>",$content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id); |
|
1968 | + $content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>", $content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id); |
|
1969 | 1969 | $oMail = new Mail(); |
1970 | 1970 | $oMail->setTitle($title); |
1971 | 1971 | $oMail->setContent($content); |
1972 | - $oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email); |
|
1972 | + $oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email); |
|
1973 | 1973 | $oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address); |
1974 | 1974 | $oMail->send(); |
1975 | 1975 | } |
@@ -1979,9 +1979,9 @@ discard block |
||
1979 | 1979 | } |
1980 | 1980 | // Call a trigger after successfully log-in (after) |
1981 | 1981 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
1982 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
1982 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
1983 | 1983 | // When user checked to use auto-login |
1984 | - if($keep_signed) |
|
1984 | + if ($keep_signed) |
|
1985 | 1985 | { |
1986 | 1986 | // Key generate for auto login |
1987 | 1987 | $oPassword = new Password(); |
@@ -1993,12 +1993,12 @@ discard block |
||
1993 | 1993 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
1994 | 1994 | executeQuery('member.deleteAutologin', $autologin_args); |
1995 | 1995 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
1996 | - if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
1996 | + if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000); |
|
1997 | 1997 | } |
1998 | - if($this->memberInfo->is_admin == 'Y') |
|
1998 | + if ($this->memberInfo->is_admin == 'Y') |
|
1999 | 1999 | { |
2000 | 2000 | $oMemberAdminModel = getAdminModel('member'); |
2001 | - if(!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
2001 | + if (!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
2002 | 2002 | { |
2003 | 2003 | $_SESSION['denied_admin'] = 'Y'; |
2004 | 2004 | } |
@@ -2016,18 +2016,18 @@ discard block |
||
2016 | 2016 | { |
2017 | 2017 | $oMemberModel = getModel('member'); |
2018 | 2018 | // If your information came through the current session information to extract information from the users |
2019 | - if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() ) |
|
2019 | + if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged()) |
|
2020 | 2020 | { |
2021 | 2021 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']); |
2022 | 2022 | // If you do not destroy the session Profile |
2023 | - if($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
2023 | + if ($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
2024 | 2024 | { |
2025 | 2025 | $this->destroySessionInfo(); |
2026 | 2026 | return; |
2027 | 2027 | } |
2028 | 2028 | } |
2029 | 2029 | // Stop using the session id is destroyed |
2030 | - if($this->memberInfo->denied=='Y') |
|
2030 | + if ($this->memberInfo->denied == 'Y') |
|
2031 | 2031 | { |
2032 | 2032 | $this->destroySessionInfo(); |
2033 | 2033 | return; |
@@ -2057,10 +2057,10 @@ discard block |
||
2057 | 2057 | Context::set('logged_info', $this->memberInfo); |
2058 | 2058 | |
2059 | 2059 | // Only the menu configuration of the user (such as an add-on to the menu can be changed) |
2060 | - $this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info'); |
|
2061 | - $this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
2062 | - $this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
2063 | - $this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document'); |
|
2060 | + $this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info'); |
|
2061 | + $this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
2062 | + $this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
2063 | + $this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document'); |
|
2064 | 2064 | } |
2065 | 2065 | |
2066 | 2066 | /** |
@@ -2082,7 +2082,7 @@ discard block |
||
2082 | 2082 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
2083 | 2083 | { |
2084 | 2084 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
2085 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
2085 | + if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
2086 | 2086 | |
2087 | 2087 | $obj = new stdClass; |
2088 | 2088 | $obj->url = $url; |
@@ -2101,33 +2101,33 @@ discard block |
||
2101 | 2101 | { |
2102 | 2102 | // Call a trigger (before) |
2103 | 2103 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
2104 | - if(!$output->toBool()) return $output; |
|
2104 | + if (!$output->toBool()) return $output; |
|
2105 | 2105 | // Terms and Conditions portion of the information set up by members reaffirmed |
2106 | 2106 | $oModuleModel = getModel('module'); |
2107 | 2107 | $config = $oModuleModel->getModuleConfig('member'); |
2108 | 2108 | |
2109 | 2109 | $logged_info = Context::get('logged_info'); |
2110 | 2110 | // If the date of the temporary restrictions limit further information on the date of |
2111 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
2111 | + if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24); |
|
2112 | 2112 | |
2113 | 2113 | $args->member_srl = getNextSequence(); |
2114 | 2114 | $args->list_order = -1 * $args->member_srl; |
2115 | 2115 | |
2116 | 2116 | // Execute insert or update depending on the value of member_srl |
2117 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2117 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2118 | 2118 | // Enter the user's identity changed to lowercase |
2119 | 2119 | else $args->user_id = strtolower($args->user_id); |
2120 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
2121 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
2120 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
2121 | + if (!$args->nick_name) $args->nick_name = $args->member_srl; |
|
2122 | 2122 | |
2123 | 2123 | // Control of essential parameters |
2124 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
2125 | - if($args->denied!='Y') $args->denied = 'N'; |
|
2126 | - if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y'; |
|
2124 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
2125 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
2126 | + if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y'; |
|
2127 | 2127 | |
2128 | - if($logged_info->is_admin == 'Y') |
|
2128 | + if ($logged_info->is_admin == 'Y') |
|
2129 | 2129 | { |
2130 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
2130 | + if ($args->is_admin != 'Y') $args->is_admin = 'N'; |
|
2131 | 2131 | } |
2132 | 2132 | else |
2133 | 2133 | { |
@@ -2142,97 +2142,97 @@ discard block |
||
2142 | 2142 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2143 | 2143 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2144 | 2144 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2145 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2146 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
2145 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2146 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
2147 | 2147 | |
2148 | 2148 | // Create a model object |
2149 | 2149 | $oMemberModel = getModel('member'); |
2150 | 2150 | |
2151 | 2151 | // Check password strength |
2152 | - if($args->password && !$password_is_hashed) |
|
2152 | + if ($args->password && !$password_is_hashed) |
|
2153 | 2153 | { |
2154 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2154 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2155 | 2155 | { |
2156 | 2156 | $message = Context::getLang('about_password_strength'); |
2157 | 2157 | return new BaseObject(-1, $message[$config->password_strength]); |
2158 | 2158 | } |
2159 | 2159 | $args->password = $oMemberModel->hashPassword($args->password); |
2160 | 2160 | } |
2161 | - elseif(!$args->password) |
|
2161 | + elseif (!$args->password) |
|
2162 | 2162 | { |
2163 | 2163 | unset($args->password); |
2164 | 2164 | } |
2165 | 2165 | |
2166 | - if($args->find_account_answer && !$password_is_hashed) |
|
2166 | + if ($args->find_account_answer && !$password_is_hashed) |
|
2167 | 2167 | { |
2168 | 2168 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
2169 | 2169 | } |
2170 | - elseif(!$args->find_account_answer) |
|
2170 | + elseif (!$args->find_account_answer) |
|
2171 | 2171 | { |
2172 | 2172 | unset($args->find_account_answer); |
2173 | 2173 | } |
2174 | 2174 | |
2175 | 2175 | // Check if ID is prohibited |
2176 | - if($oMemberModel->isDeniedID($args->user_id)) |
|
2176 | + if ($oMemberModel->isDeniedID($args->user_id)) |
|
2177 | 2177 | { |
2178 | - return new BaseObject(-1,'denied_user_id'); |
|
2178 | + return new BaseObject(-1, 'denied_user_id'); |
|
2179 | 2179 | } |
2180 | 2180 | |
2181 | 2181 | // Check if ID is duplicate |
2182 | 2182 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
2183 | - if($member_srl) |
|
2183 | + if ($member_srl) |
|
2184 | 2184 | { |
2185 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
2185 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
2186 | 2186 | } |
2187 | 2187 | |
2188 | 2188 | // Check if nickname is prohibited |
2189 | - if($oMemberModel->isDeniedNickName($args->nick_name)) |
|
2189 | + if ($oMemberModel->isDeniedNickName($args->nick_name)) |
|
2190 | 2190 | { |
2191 | - return new BaseObject(-1,'denied_nick_name'); |
|
2191 | + return new BaseObject(-1, 'denied_nick_name'); |
|
2192 | 2192 | } |
2193 | 2193 | |
2194 | 2194 | // Check if nickname is duplicate |
2195 | 2195 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
2196 | - if($member_srl) |
|
2196 | + if ($member_srl) |
|
2197 | 2197 | { |
2198 | - return new BaseObject(-1,'msg_exists_nick_name'); |
|
2198 | + return new BaseObject(-1, 'msg_exists_nick_name'); |
|
2199 | 2199 | } |
2200 | 2200 | |
2201 | 2201 | // Check if email address is duplicate |
2202 | 2202 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
2203 | - if($member_srl) |
|
2203 | + if ($member_srl) |
|
2204 | 2204 | { |
2205 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
2205 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
2206 | 2206 | } |
2207 | 2207 | |
2208 | 2208 | // Insert data into the DB |
2209 | 2209 | $args->list_order = -1 * $args->member_srl; |
2210 | 2210 | |
2211 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2212 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
2211 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2212 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
2213 | 2213 | |
2214 | 2214 | $oDB = &DB::getInstance(); |
2215 | 2215 | $oDB->begin(); |
2216 | 2216 | |
2217 | 2217 | $output = executeQuery('member.insertMember', $args); |
2218 | - if(!$output->toBool()) |
|
2218 | + if (!$output->toBool()) |
|
2219 | 2219 | { |
2220 | 2220 | $oDB->rollback(); |
2221 | 2221 | return $output; |
2222 | 2222 | } |
2223 | 2223 | |
2224 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2224 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2225 | 2225 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
2226 | 2226 | // If no value is entered the default group, the value of group registration |
2227 | - if(!$args->group_srl_list) |
|
2227 | + if (!$args->group_srl_list) |
|
2228 | 2228 | { |
2229 | 2229 | $columnList = array('site_srl', 'group_srl'); |
2230 | 2230 | $default_group = $oMemberModel->getDefaultGroup(0, $columnList); |
2231 | - if($default_group) |
|
2231 | + if ($default_group) |
|
2232 | 2232 | { |
2233 | 2233 | // Add to the default group |
2234 | - $output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl); |
|
2235 | - if(!$output->toBool()) |
|
2234 | + $output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl); |
|
2235 | + if (!$output->toBool()) |
|
2236 | 2236 | { |
2237 | 2237 | $oDB->rollback(); |
2238 | 2238 | return $output; |
@@ -2242,11 +2242,11 @@ discard block |
||
2242 | 2242 | } |
2243 | 2243 | else |
2244 | 2244 | { |
2245 | - for($i=0;$i<count($group_srl_list);$i++) |
|
2245 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
2246 | 2246 | { |
2247 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
2247 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
2248 | 2248 | |
2249 | - if(!$output->toBool()) |
|
2249 | + if (!$output->toBool()) |
|
2250 | 2250 | { |
2251 | 2251 | $oDB->rollback(); |
2252 | 2252 | return $output; |
@@ -2256,7 +2256,7 @@ discard block |
||
2256 | 2256 | |
2257 | 2257 | $member_config = $oModuleModel->getModuleConfig('member'); |
2258 | 2258 | // When using email authentication mode (when you subscribed members denied a) certified mail sent |
2259 | - if($args->denied == 'Y') |
|
2259 | + if ($args->denied == 'Y') |
|
2260 | 2260 | { |
2261 | 2261 | // Insert data into the authentication DB |
2262 | 2262 | $oPassword = new Password(); |
@@ -2268,7 +2268,7 @@ discard block |
||
2268 | 2268 | $auth_args->is_register = 'Y'; |
2269 | 2269 | |
2270 | 2270 | $output = executeQuery('member.insertAuthMail', $auth_args); |
2271 | - if(!$output->toBool()) |
|
2271 | + if (!$output->toBool()) |
|
2272 | 2272 | { |
2273 | 2273 | $oDB->rollback(); |
2274 | 2274 | return $output; |
@@ -2276,10 +2276,10 @@ discard block |
||
2276 | 2276 | $this->_sendAuthMail($auth_args, $args); |
2277 | 2277 | } |
2278 | 2278 | // Call a trigger (after) |
2279 | - if($output->toBool()) |
|
2279 | + if ($output->toBool()) |
|
2280 | 2280 | { |
2281 | 2281 | $trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args); |
2282 | - if(!$trigger_output->toBool()) |
|
2282 | + if (!$trigger_output->toBool()) |
|
2283 | 2283 | { |
2284 | 2284 | $oDB->rollback(); |
2285 | 2285 | return $trigger_output; |
@@ -2301,41 +2301,41 @@ discard block |
||
2301 | 2301 | { |
2302 | 2302 | // Call a trigger (before) |
2303 | 2303 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
2304 | - if(!$output->toBool()) return $output; |
|
2304 | + if (!$output->toBool()) return $output; |
|
2305 | 2305 | // Create a model object |
2306 | 2306 | $oMemberModel = getModel('member'); |
2307 | 2307 | |
2308 | 2308 | $logged_info = Context::get('logged_info'); |
2309 | 2309 | // Get what you want to modify the original information |
2310 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2310 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2311 | 2311 | // Control of essential parameters |
2312 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
2313 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
2312 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
2313 | + if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y'; |
|
2314 | 2314 | |
2315 | - if($logged_info->is_admin == 'Y') |
|
2315 | + if ($logged_info->is_admin == 'Y') |
|
2316 | 2316 | { |
2317 | - if($args->denied!='Y') $args->denied = 'N'; |
|
2318 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
2317 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
2318 | + if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
2319 | 2319 | } |
2320 | 2320 | else |
2321 | 2321 | { |
2322 | 2322 | unset($args->is_admin); |
2323 | - if($is_admin == false) |
|
2323 | + if ($is_admin == false) |
|
2324 | 2324 | unset($args->denied); |
2325 | - if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
2325 | + if ($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
2326 | 2326 | { |
2327 | 2327 | return $this->stop('msg_invalid_request'); |
2328 | 2328 | } |
2329 | 2329 | } |
2330 | 2330 | |
2331 | 2331 | // Sanitize user ID, username, nickname, homepage, blog |
2332 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2332 | + if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2333 | 2333 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2334 | 2334 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2335 | 2335 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2336 | 2336 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2337 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2338 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
2337 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2338 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
2339 | 2339 | |
2340 | 2340 | // check member identifier form |
2341 | 2341 | $config = $oMemberModel->getMemberConfig(); |
@@ -2344,56 +2344,56 @@ discard block |
||
2344 | 2344 | $orgMemberInfo = $output->data; |
2345 | 2345 | |
2346 | 2346 | // Check if email address or user ID is duplicate |
2347 | - if($config->identifier == 'email_address') |
|
2347 | + if ($config->identifier == 'email_address') |
|
2348 | 2348 | { |
2349 | 2349 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
2350 | - if($member_srl && $args->member_srl != $member_srl) |
|
2350 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2351 | 2351 | { |
2352 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
2352 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
2353 | 2353 | } |
2354 | 2354 | $args->email_address = $orgMemberInfo->email_address; |
2355 | 2355 | } |
2356 | 2356 | else |
2357 | 2357 | { |
2358 | 2358 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
2359 | - if($member_srl && $args->member_srl != $member_srl) |
|
2359 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2360 | 2360 | { |
2361 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
2361 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
2362 | 2362 | } |
2363 | 2363 | |
2364 | 2364 | $args->user_id = $orgMemberInfo->user_id; |
2365 | 2365 | } |
2366 | 2366 | |
2367 | - if($logged_info->is_admin !== 'Y') |
|
2367 | + if ($logged_info->is_admin !== 'Y') |
|
2368 | 2368 | { |
2369 | 2369 | // Check if ID is prohibited |
2370 | - if($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
2370 | + if ($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
2371 | 2371 | { |
2372 | - return new BaseObject(-1,'denied_user_id'); |
|
2372 | + return new BaseObject(-1, 'denied_user_id'); |
|
2373 | 2373 | } |
2374 | 2374 | |
2375 | 2375 | // Check if nickname is prohibited |
2376 | - if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
2376 | + if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
2377 | 2377 | { |
2378 | 2378 | return new BaseObject(-1, 'denied_nick_name'); |
2379 | 2379 | } |
2380 | 2380 | } |
2381 | 2381 | |
2382 | 2382 | // Check if ID is duplicate |
2383 | - if($args->user_id) |
|
2383 | + if ($args->user_id) |
|
2384 | 2384 | { |
2385 | 2385 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
2386 | - if($member_srl && $args->member_srl != $member_srl) |
|
2386 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2387 | 2387 | { |
2388 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
2388 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
2389 | 2389 | } |
2390 | 2390 | } |
2391 | 2391 | |
2392 | 2392 | // Check if nickname is duplicate |
2393 | 2393 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
2394 | - if($member_srl && $args->member_srl != $member_srl) |
|
2394 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2395 | 2395 | { |
2396 | - return new BaseObject(-1,'msg_exists_nick_name'); |
|
2396 | + return new BaseObject(-1, 'msg_exists_nick_name'); |
|
2397 | 2397 | } |
2398 | 2398 | |
2399 | 2399 | list($args->email_id, $args->email_host) = explode('@', $args->email_address); |
@@ -2402,9 +2402,9 @@ discard block |
||
2402 | 2402 | $oDB->begin(); |
2403 | 2403 | |
2404 | 2404 | // Check password strength |
2405 | - if($args->password) |
|
2405 | + if ($args->password) |
|
2406 | 2406 | { |
2407 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2407 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2408 | 2408 | { |
2409 | 2409 | $message = Context::getLang('about_password_strength'); |
2410 | 2410 | return new BaseObject(-1, $message[$config->password_strength]); |
@@ -2416,57 +2416,57 @@ discard block |
||
2416 | 2416 | $args->password = $orgMemberInfo->password; |
2417 | 2417 | } |
2418 | 2418 | |
2419 | - if($args->find_account_answer) { |
|
2419 | + if ($args->find_account_answer) { |
|
2420 | 2420 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
2421 | 2421 | } |
2422 | 2422 | else |
2423 | 2423 | { |
2424 | - $oPassword = new Password(); |
|
2424 | + $oPassword = new Password(); |
|
2425 | 2425 | $hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer); |
2426 | 2426 | |
2427 | - if($hashed) { |
|
2427 | + if ($hashed) { |
|
2428 | 2428 | $args->find_account_answer = $orgMemberInfo->find_account_answer; |
2429 | 2429 | } else { |
2430 | 2430 | $args->find_account_answer = $oPassword->createHash($orgMemberInfo->find_account_answer); |
2431 | 2431 | } |
2432 | 2432 | } |
2433 | 2433 | |
2434 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
2435 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
2436 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
2434 | + if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
2435 | + if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
2436 | + if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
2437 | 2437 | |
2438 | 2438 | // BUGFIX 관리자가 회원 메모를 삭제할수 없는 문제 수정 https://github.com/xpressengine/xe-core/issues/2290 |
2439 | - if(!isset($args->description)) $args->description = $orgMemberInfo->description; |
|
2440 | - if(!$args->birthday) $args->birthday = ''; |
|
2439 | + if (!isset($args->description)) $args->description = $orgMemberInfo->description; |
|
2440 | + if (!$args->birthday) $args->birthday = ''; |
|
2441 | 2441 | |
2442 | 2442 | $output = executeQuery('member.updateMember', $args); |
2443 | 2443 | |
2444 | - if(!$output->toBool()) |
|
2444 | + if (!$output->toBool()) |
|
2445 | 2445 | { |
2446 | 2446 | $oDB->rollback(); |
2447 | 2447 | return $output; |
2448 | 2448 | } |
2449 | 2449 | |
2450 | - if($args->group_srl_list) |
|
2450 | + if ($args->group_srl_list) |
|
2451 | 2451 | { |
2452 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2452 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2453 | 2453 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
2454 | 2454 | // If the group information, group information changes |
2455 | - if(count($group_srl_list) > 0) |
|
2455 | + if (count($group_srl_list) > 0) |
|
2456 | 2456 | { |
2457 | 2457 | $args->site_srl = 0; |
2458 | 2458 | // One of its members to delete all the group |
2459 | 2459 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
2460 | - if(!$output->toBool()) |
|
2460 | + if (!$output->toBool()) |
|
2461 | 2461 | { |
2462 | 2462 | $oDB->rollback(); |
2463 | 2463 | return $output; |
2464 | 2464 | } |
2465 | 2465 | // Enter one of the loop a |
2466 | - for($i=0;$i<count($group_srl_list);$i++) |
|
2466 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
2467 | 2467 | { |
2468 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
2469 | - if(!$output->toBool()) |
|
2468 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
2469 | + if (!$output->toBool()) |
|
2470 | 2470 | { |
2471 | 2471 | $oDB->rollback(); |
2472 | 2472 | return $output; |
@@ -2478,9 +2478,9 @@ discard block |
||
2478 | 2478 | } |
2479 | 2479 | } |
2480 | 2480 | // Call a trigger (after) |
2481 | - if($output->toBool()) { |
|
2481 | + if ($output->toBool()) { |
|
2482 | 2482 | $trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args); |
2483 | - if(!$trigger_output->toBool()) |
|
2483 | + if (!$trigger_output->toBool()) |
|
2484 | 2484 | { |
2485 | 2485 | $oDB->rollback(); |
2486 | 2486 | return $trigger_output; |
@@ -2493,7 +2493,7 @@ discard block |
||
2493 | 2493 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
2494 | 2494 | |
2495 | 2495 | // Save Session |
2496 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2496 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2497 | 2497 | $logged_info = Context::get('logged_info'); |
2498 | 2498 | |
2499 | 2499 | $output->add('member_srl', $args->member_srl); |
@@ -2505,14 +2505,14 @@ discard block |
||
2505 | 2505 | */ |
2506 | 2506 | function updateMemberPassword($args) |
2507 | 2507 | { |
2508 | - if($args->password) |
|
2508 | + if ($args->password) |
|
2509 | 2509 | { |
2510 | 2510 | |
2511 | 2511 | // check password strength |
2512 | 2512 | $oMemberModel = getModel('member'); |
2513 | 2513 | $config = $oMemberModel->getMemberConfig(); |
2514 | 2514 | |
2515 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2515 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2516 | 2516 | { |
2517 | 2517 | $message = Context::getLang('about_password_strength'); |
2518 | 2518 | return new BaseObject(-1, $message[$config->password_strength]); |
@@ -2520,13 +2520,13 @@ discard block |
||
2520 | 2520 | |
2521 | 2521 | $args->password = $oMemberModel->hashPassword($args->password); |
2522 | 2522 | } |
2523 | - else if($args->hashed_password) |
|
2523 | + else if ($args->hashed_password) |
|
2524 | 2524 | { |
2525 | 2525 | $args->password = $args->hashed_password; |
2526 | 2526 | } |
2527 | 2527 | |
2528 | 2528 | $output = executeQuery('member.updateMemberPassword', $args); |
2529 | - if($output->toBool()) |
|
2529 | + if ($output->toBool()) |
|
2530 | 2530 | { |
2531 | 2531 | $result = executeQuery('member.updateChangePasswordDate', $args); |
2532 | 2532 | } |
@@ -2538,7 +2538,7 @@ discard block |
||
2538 | 2538 | |
2539 | 2539 | function updateFindAccountAnswer($member_srl, $answer) |
2540 | 2540 | { |
2541 | - $oPassword = new Password(); |
|
2541 | + $oPassword = new Password(); |
|
2542 | 2542 | |
2543 | 2543 | $args = new stdClass(); |
2544 | 2544 | $args->member_srl = $member_srl; |
@@ -2555,18 +2555,18 @@ discard block |
||
2555 | 2555 | $trigger_obj = new stdClass(); |
2556 | 2556 | $trigger_obj->member_srl = $member_srl; |
2557 | 2557 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
2558 | - if(!$output->toBool()) return $output; |
|
2558 | + if (!$output->toBool()) return $output; |
|
2559 | 2559 | // Create a model object |
2560 | 2560 | $oMemberModel = getModel('member'); |
2561 | 2561 | // Bringing the user's information |
2562 | - if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
2562 | + if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
2563 | 2563 | { |
2564 | 2564 | $columnList = array('member_srl', 'is_admin'); |
2565 | 2565 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
2566 | 2566 | } |
2567 | - if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
2567 | + if (!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
2568 | 2568 | // If managers can not be deleted |
2569 | - if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
2569 | + if ($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
2570 | 2570 | |
2571 | 2571 | $oDB = &DB::getInstance(); |
2572 | 2572 | $oDB->begin(); |
@@ -2575,7 +2575,7 @@ discard block |
||
2575 | 2575 | $args->member_srl = $member_srl; |
2576 | 2576 | // Delete the entries in member_auth_mail |
2577 | 2577 | $output = executeQuery('member.deleteAuthMail', $args); |
2578 | - if(!$output->toBool()) |
|
2578 | + if (!$output->toBool()) |
|
2579 | 2579 | { |
2580 | 2580 | $oDB->rollback(); |
2581 | 2581 | return $output; |
@@ -2590,23 +2590,23 @@ discard block |
||
2590 | 2590 | */ |
2591 | 2591 | // Delete the entries in member_group_member |
2592 | 2592 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
2593 | - if(!$output->toBool()) |
|
2593 | + if (!$output->toBool()) |
|
2594 | 2594 | { |
2595 | 2595 | $oDB->rollback(); |
2596 | 2596 | return $output; |
2597 | 2597 | } |
2598 | 2598 | // member removed from the table |
2599 | 2599 | $output = executeQuery('member.deleteMember', $args); |
2600 | - if(!$output->toBool()) |
|
2600 | + if (!$output->toBool()) |
|
2601 | 2601 | { |
2602 | 2602 | $oDB->rollback(); |
2603 | 2603 | return $output; |
2604 | 2604 | } |
2605 | 2605 | // Call a trigger (after) |
2606 | - if($output->toBool()) |
|
2606 | + if ($output->toBool()) |
|
2607 | 2607 | { |
2608 | 2608 | $trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj); |
2609 | - if(!$trigger_output->toBool()) |
|
2609 | + if (!$trigger_output->toBool()) |
|
2610 | 2610 | { |
2611 | 2611 | $oDB->rollback(); |
2612 | 2612 | return $trigger_output; |
@@ -2630,23 +2630,23 @@ discard block |
||
2630 | 2630 | */ |
2631 | 2631 | function destroySessionInfo() |
2632 | 2632 | { |
2633 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
2633 | + if (!$_SESSION || !is_array($_SESSION)) return; |
|
2634 | 2634 | |
2635 | 2635 | $memberInfo = Context::get('logged_info'); |
2636 | 2636 | $memberSrl = $memberInfo->member_srl; |
2637 | 2637 | |
2638 | - foreach($_SESSION as $key => $val) |
|
2638 | + foreach ($_SESSION as $key => $val) |
|
2639 | 2639 | { |
2640 | 2640 | $_SESSION[$key] = ''; |
2641 | 2641 | } |
2642 | 2642 | |
2643 | 2643 | session_destroy(); |
2644 | - setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000); |
|
2645 | - setcookie('sso','',$_SERVER['REQUEST_TIME']-42000); |
|
2646 | - setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000); |
|
2644 | + setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000); |
|
2645 | + setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000); |
|
2646 | + setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000); |
|
2647 | 2647 | setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000); |
2648 | 2648 | |
2649 | - if($memberSrl || $_COOKIE['xeak']) |
|
2649 | + if ($memberSrl || $_COOKIE['xeak']) |
|
2650 | 2650 | { |
2651 | 2651 | $args = new stdClass(); |
2652 | 2652 | $args->member_srl = $memberSrl; |
@@ -2662,22 +2662,22 @@ discard block |
||
2662 | 2662 | $pointGroup = $pointModuleConfig->point_group; |
2663 | 2663 | |
2664 | 2664 | $levelGroup = array(); |
2665 | - if(is_array($pointGroup) && count($pointGroup)>0) |
|
2665 | + if (is_array($pointGroup) && count($pointGroup) > 0) |
|
2666 | 2666 | { |
2667 | 2667 | $levelGroup = array_flip($pointGroup); |
2668 | 2668 | ksort($levelGroup); |
2669 | 2669 | } |
2670 | 2670 | $maxLevel = 0; |
2671 | 2671 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
2672 | - if(count($resultGroup) > 0) |
|
2672 | + if (count($resultGroup) > 0) |
|
2673 | 2673 | $maxLevel = max(array_flip($resultGroup)); |
2674 | 2674 | |
2675 | - if($maxLevel > 0) |
|
2675 | + if ($maxLevel > 0) |
|
2676 | 2676 | { |
2677 | 2677 | $oPointModel = getModel('point'); |
2678 | 2678 | $originPoint = $oPointModel->getPoint($memberSrl); |
2679 | 2679 | |
2680 | - if($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
2680 | + if ($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
2681 | 2681 | { |
2682 | 2682 | $oPointController = getController('point'); |
2683 | 2683 | $oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update'); |
@@ -2687,18 +2687,18 @@ discard block |
||
2687 | 2687 | |
2688 | 2688 | function procMemberModifyEmailAddress() |
2689 | 2689 | { |
2690 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
2690 | + if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
2691 | 2691 | |
2692 | 2692 | $member_info = Context::get('logged_info'); |
2693 | 2693 | $newEmail = Context::get('email_address'); |
2694 | 2694 | |
2695 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
2695 | + if (!$newEmail) return $this->stop('msg_invalid_request'); |
|
2696 | 2696 | |
2697 | 2697 | $oMemberModel = getModel('member'); |
2698 | 2698 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
2699 | - if($member_srl) return new BaseObject(-1,'msg_exists_email_address'); |
|
2699 | + if ($member_srl) return new BaseObject(-1, 'msg_exists_email_address'); |
|
2700 | 2700 | |
2701 | - if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
2701 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
2702 | 2702 | { |
2703 | 2703 | return $this->stop('msg_invalid_request'); |
2704 | 2704 | } |
@@ -2714,7 +2714,7 @@ discard block |
||
2714 | 2714 | $oDB = &DB::getInstance(); |
2715 | 2715 | $oDB->begin(); |
2716 | 2716 | $output = executeQuery('member.insertAuthMail', $auth_args); |
2717 | - if(!$output->toBool()) |
|
2717 | + if (!$output->toBool()) |
|
2718 | 2718 | { |
2719 | 2719 | $oDB->rollback(); |
2720 | 2720 | return $output; |
@@ -2724,7 +2724,7 @@ discard block |
||
2724 | 2724 | $member_config = $oModuleModel->getModuleConfig('member'); |
2725 | 2725 | |
2726 | 2726 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
2727 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
2727 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
2728 | 2728 | |
2729 | 2729 | global $lang; |
2730 | 2730 | |
@@ -2736,17 +2736,17 @@ discard block |
||
2736 | 2736 | |
2737 | 2737 | Context::set('newEmail', $newEmail); |
2738 | 2738 | |
2739 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
|
2739 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key); |
|
2740 | 2740 | Context::set('auth_url', $auth_url); |
2741 | 2741 | |
2742 | 2742 | $oTemplate = &TemplateHandler::getInstance(); |
2743 | 2743 | $content = $oTemplate->compile($tpl_path, 'confirm_member_new_email'); |
2744 | 2744 | |
2745 | 2745 | $oMail = new Mail(); |
2746 | - $oMail->setTitle( Context::getLang('title_modify_email_address') ); |
|
2746 | + $oMail->setTitle(Context::getLang('title_modify_email_address')); |
|
2747 | 2747 | $oMail->setContent($content); |
2748 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
2749 | - $oMail->setReceiptor( $member_info->nick_name, $newEmail ); |
|
2748 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
2749 | + $oMail->setReceiptor($member_info->nick_name, $newEmail); |
|
2750 | 2750 | $result = $oMail->send(); |
2751 | 2751 | |
2752 | 2752 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail); |
@@ -2760,16 +2760,16 @@ discard block |
||
2760 | 2760 | { |
2761 | 2761 | $member_srl = Context::get('member_srl'); |
2762 | 2762 | $auth_key = Context::get('auth_key'); |
2763 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
2763 | + if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
2764 | 2764 | |
2765 | 2765 | // Test logs for finding password by user_id and authkey |
2766 | 2766 | $args = new stdClass; |
2767 | 2767 | $args->member_srl = $member_srl; |
2768 | 2768 | $args->auth_key = $auth_key; |
2769 | 2769 | $output = executeQuery('member.getAuthMail', $args); |
2770 | - if(!$output->toBool() || $output->data->auth_key != $auth_key) |
|
2770 | + if (!$output->toBool() || $output->data->auth_key != $auth_key) |
|
2771 | 2771 | { |
2772 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
2772 | + if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
2773 | 2773 | return $this->stop('msg_invalid_modify_email_auth_key'); |
2774 | 2774 | } |
2775 | 2775 | |
@@ -2778,10 +2778,10 @@ discard block |
||
2778 | 2778 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
2779 | 2779 | |
2780 | 2780 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
2781 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
2781 | + if (!$output->toBool()) return $this->stop($output->getMessage()); |
|
2782 | 2782 | |
2783 | 2783 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
2784 | - executeQuery('member.deleteAuthChangeEmailAddress',$args); |
|
2784 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
2785 | 2785 | |
2786 | 2786 | $this->_clearMemberCache($args->member_srl); |
2787 | 2787 | |
@@ -2799,7 +2799,7 @@ discard block |
||
2799 | 2799 | **/ |
2800 | 2800 | function triggerGetDocumentMenu(&$menu_list) |
2801 | 2801 | { |
2802 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
2802 | + if (!Context::get('is_logged')) return new BaseObject(); |
|
2803 | 2803 | |
2804 | 2804 | $logged_info = Context::get('logged_info'); |
2805 | 2805 | $document_srl = Context::get('target_srl'); |
@@ -2810,12 +2810,12 @@ discard block |
||
2810 | 2810 | $member_srl = $oDocument->get('member_srl'); |
2811 | 2811 | $module_srl = $oDocument->get('module_srl'); |
2812 | 2812 | |
2813 | - if(!$member_srl) return new BaseObject(); |
|
2814 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
2813 | + if (!$member_srl) return new BaseObject(); |
|
2814 | + if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject(); |
|
2815 | 2815 | |
2816 | 2816 | $oDocumentController = getController('document'); |
2817 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
2818 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup'); |
|
2817 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
2818 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
2819 | 2819 | |
2820 | 2820 | return new BaseObject(); |
2821 | 2821 | } |
@@ -2829,7 +2829,7 @@ discard block |
||
2829 | 2829 | **/ |
2830 | 2830 | function triggerGetCommentMenu(&$menu_list) |
2831 | 2831 | { |
2832 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
2832 | + if (!Context::get('is_logged')) return new BaseObject(); |
|
2833 | 2833 | |
2834 | 2834 | $logged_info = Context::get('logged_info'); |
2835 | 2835 | $comment_srl = Context::get('target_srl'); |
@@ -2840,12 +2840,12 @@ discard block |
||
2840 | 2840 | $module_srl = $oComment->get('module_srl'); |
2841 | 2841 | $member_srl = $oComment->get('member_srl'); |
2842 | 2842 | |
2843 | - if(!$member_srl) return new BaseObject(); |
|
2844 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
2843 | + if (!$member_srl) return new BaseObject(); |
|
2844 | + if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject(); |
|
2845 | 2845 | |
2846 | 2846 | $oCommentController = getController('comment'); |
2847 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
2848 | - $oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup'); |
|
2847 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
2848 | + $oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
2849 | 2849 | |
2850 | 2850 | return new BaseObject(); |
2851 | 2851 | } |
@@ -2857,7 +2857,7 @@ discard block |
||
2857 | 2857 | **/ |
2858 | 2858 | function procMemberSpammerManage() |
2859 | 2859 | { |
2860 | - if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted'); |
|
2860 | + if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted'); |
|
2861 | 2861 | |
2862 | 2862 | $logged_info = Context::get('logged_info'); |
2863 | 2863 | $member_srl = Context::get('member_srl'); |
@@ -2865,7 +2865,7 @@ discard block |
||
2865 | 2865 | $cnt_loop = Context::get('cnt_loop'); |
2866 | 2866 | $proc_type = Context::get('proc_type'); |
2867 | 2867 | $isMoveToTrash = true; |
2868 | - if($proc_type == "delete") |
|
2868 | + if ($proc_type == "delete") |
|
2869 | 2869 | $isMoveToTrash = false; |
2870 | 2870 | |
2871 | 2871 | // check grant |
@@ -2874,7 +2874,7 @@ discard block |
||
2874 | 2874 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
2875 | 2875 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
2876 | 2876 | |
2877 | - if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted'); |
|
2877 | + if (!$grant->manager) return new BaseObject(-1, 'msg_not_permitted'); |
|
2878 | 2878 | |
2879 | 2879 | $proc_msg = ""; |
2880 | 2880 | |
@@ -2883,10 +2883,10 @@ discard block |
||
2883 | 2883 | |
2884 | 2884 | // delete or trash destination |
2885 | 2885 | // proc member |
2886 | - if($cnt_loop == 1) |
|
2886 | + if ($cnt_loop == 1) |
|
2887 | 2887 | $this->_spammerMember($member_srl); |
2888 | 2888 | // proc document and comment |
2889 | - elseif($cnt_loop>1) |
|
2889 | + elseif ($cnt_loop > 1) |
|
2890 | 2890 | $this->_spammerDocuments($member_srl, $isMoveToTrash); |
2891 | 2891 | |
2892 | 2892 | // get destination count |
@@ -2895,11 +2895,11 @@ discard block |
||
2895 | 2895 | |
2896 | 2896 | $total_count = Context::get('total_count'); |
2897 | 2897 | $remain_count = $cnt_document + $cnt_comment; |
2898 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
2898 | + if ($cnt_loop == 1) $total_count = $remain_count; |
|
2899 | 2899 | |
2900 | 2900 | // get progress percent |
2901 | - if($total_count > 0) |
|
2902 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
2901 | + if ($total_count > 0) |
|
2902 | + $progress = intval((($total_count - $remain_count) / $total_count) * 100); |
|
2903 | 2903 | else |
2904 | 2904 | $progress = 100; |
2905 | 2905 | |
@@ -2923,7 +2923,7 @@ discard block |
||
2923 | 2923 | **/ |
2924 | 2924 | private function _spammerMember($member_srl) { |
2925 | 2925 | $logged_info = Context::get('logged_info'); |
2926 | - $spam_description = trim( Context::get('spam_description') ); |
|
2926 | + $spam_description = trim(Context::get('spam_description')); |
|
2927 | 2927 | |
2928 | 2928 | $oMemberModel = getModel('member'); |
2929 | 2929 | $columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description'); |
@@ -2942,10 +2942,10 @@ discard block |
||
2942 | 2942 | $args->user_id = $member_info->user_id; |
2943 | 2943 | $args->nick_name = $member_info->nick_name; |
2944 | 2944 | $args->denied = "Y"; |
2945 | - $args->description = trim( $member_info->description ); |
|
2946 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
2945 | + $args->description = trim($member_info->description); |
|
2946 | + if ($args->description != "") $args->description .= "\n"; // add new line |
|
2947 | 2947 | |
2948 | - $args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]"; |
|
2948 | + $args->description .= Context::getLang('cmd_spammer')."[".date("Y-m-d H:i:s")." from:".$logged_info->user_id." info:".$spam_description." docuemnts count:".$total_count."]"; |
|
2949 | 2949 | |
2950 | 2950 | $output = $this->updateMember($args, true); |
2951 | 2951 | |
@@ -2974,21 +2974,21 @@ discard block |
||
2974 | 2974 | // 1. proc comment, 2. proc document |
2975 | 2975 | $cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl); |
2976 | 2976 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
2977 | - if($cnt_comment > 0) |
|
2977 | + if ($cnt_comment > 0) |
|
2978 | 2978 | { |
2979 | 2979 | $columnList = array(); |
2980 | 2980 | $commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
2981 | - if($commentList) { |
|
2982 | - foreach($commentList as $v) { |
|
2981 | + if ($commentList) { |
|
2982 | + foreach ($commentList as $v) { |
|
2983 | 2983 | $oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash); |
2984 | 2984 | } |
2985 | 2985 | } |
2986 | - } elseif($cnt_document > 0) { |
|
2986 | + } elseif ($cnt_document > 0) { |
|
2987 | 2987 | $columnList = array(); |
2988 | 2988 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
2989 | - if($documentList) { |
|
2990 | - foreach($documentList as $v) { |
|
2991 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
2989 | + if ($documentList) { |
|
2990 | + foreach ($documentList as $v) { |
|
2991 | + if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
2992 | 2992 | else $oDocumentController->deleteDocument($v->document_srl); |
2993 | 2993 | } |
2994 | 2994 | } |
@@ -3000,24 +3000,24 @@ discard block |
||
3000 | 3000 | function _clearMemberCache($member_srl, $site_srl = 0) |
3001 | 3001 | { |
3002 | 3002 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
3003 | - if($oCacheHandler->isSupport()) |
|
3003 | + if ($oCacheHandler->isSupport()) |
|
3004 | 3004 | { |
3005 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl; |
|
3005 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl; |
|
3006 | 3006 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
3007 | 3007 | $oCacheHandler->delete($cache_key); |
3008 | 3008 | |
3009 | - if($site_srl !== 0) |
|
3009 | + if ($site_srl !== 0) |
|
3010 | 3010 | { |
3011 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0'; |
|
3011 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0'; |
|
3012 | 3012 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
3013 | 3013 | $oCacheHandler->delete($cache_key); |
3014 | 3014 | } |
3015 | 3015 | } |
3016 | 3016 | |
3017 | 3017 | $oCacheHandler = CacheHandler::getInstance('object'); |
3018 | - if($oCacheHandler->isSupport()) |
|
3018 | + if ($oCacheHandler->isSupport()) |
|
3019 | 3019 | { |
3020 | - $object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl; |
|
3020 | + $object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl; |
|
3021 | 3021 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
3022 | 3022 | $oCacheHandler->delete($cache_key); |
3023 | 3023 | } |
@@ -41,19 +41,31 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | // Variables |
44 | - if(!$user_id) $user_id = Context::get('user_id'); |
|
44 | + if(!$user_id) { |
|
45 | + $user_id = Context::get('user_id'); |
|
46 | + } |
|
45 | 47 | $user_id = trim($user_id); |
46 | 48 | |
47 | - if(!$password) $password = Context::get('password'); |
|
49 | + if(!$password) { |
|
50 | + $password = Context::get('password'); |
|
51 | + } |
|
48 | 52 | $password = trim($password); |
49 | 53 | |
50 | - if(!$keep_signed) $keep_signed = Context::get('keep_signed'); |
|
54 | + if(!$keep_signed) { |
|
55 | + $keep_signed = Context::get('keep_signed'); |
|
56 | + } |
|
51 | 57 | // Return an error when id and password doesn't exist |
52 | - if(!$user_id) return new BaseObject(-1,'null_user_id'); |
|
53 | - if(!$password) return new BaseObject(-1,'null_password'); |
|
58 | + if(!$user_id) { |
|
59 | + return new BaseObject(-1,'null_user_id'); |
|
60 | + } |
|
61 | + if(!$password) { |
|
62 | + return new BaseObject(-1,'null_password'); |
|
63 | + } |
|
54 | 64 | |
55 | 65 | $output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false); |
56 | - if (!$output->toBool()) return $output; |
|
66 | + if (!$output->toBool()) { |
|
67 | + return $output; |
|
68 | + } |
|
57 | 69 | |
58 | 70 | $oModuleModel = getModel('module'); |
59 | 71 | $config = $oModuleModel->getModuleConfig('member'); |
@@ -80,8 +92,7 @@ discard block |
||
80 | 92 | if(!$config->after_login_url) |
81 | 93 | { |
82 | 94 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); |
83 | - } |
|
84 | - else |
|
95 | + } else |
|
85 | 96 | { |
86 | 97 | $returnUrl = $config->after_login_url; |
87 | 98 | } |
@@ -98,19 +109,24 @@ discard block |
||
98 | 109 | // Call a trigger before log-out (before) |
99 | 110 | $logged_info = Context::get('logged_info'); |
100 | 111 | $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info); |
101 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
112 | + if(!$trigger_output->toBool()) { |
|
113 | + return $trigger_output; |
|
114 | + } |
|
102 | 115 | // Destroy session information |
103 | 116 | $this->destroySessionInfo(); |
104 | 117 | // Call a trigger after log-out (after) |
105 | 118 | $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info); |
106 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
119 | + if(!$trigger_output->toBool()) { |
|
120 | + return $trigger_output; |
|
121 | + } |
|
107 | 122 | |
108 | 123 | $output = new BaseObject(); |
109 | 124 | |
110 | 125 | $oModuleModel = getModel('module'); |
111 | 126 | $config = $oModuleModel->getModuleConfig('member'); |
112 | - if($config->after_logout_url) |
|
113 | - $output->redirect_url = $config->after_logout_url; |
|
127 | + if($config->after_logout_url) { |
|
128 | + $output->redirect_url = $config->after_logout_url; |
|
129 | + } |
|
114 | 130 | |
115 | 131 | $this->_clearMemberCache($logged_info->member_srl); |
116 | 132 | |
@@ -127,12 +143,18 @@ discard block |
||
127 | 143 | $oModuleModel = &getModel('module'); |
128 | 144 | |
129 | 145 | // Check login information |
130 | - if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
146 | + if(!Context::get('is_logged')) { |
|
147 | + return new BaseObject(-1, 'msg_not_logged'); |
|
148 | + } |
|
131 | 149 | $logged_info = Context::get('logged_info'); |
132 | 150 | |
133 | 151 | $document_srl = (int)Context::get('document_srl'); |
134 | - if(!$document_srl) $document_srl = (int)Context::get('target_srl'); |
|
135 | - if(!$document_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
152 | + if(!$document_srl) { |
|
153 | + $document_srl = (int)Context::get('target_srl'); |
|
154 | + } |
|
155 | + if(!$document_srl) { |
|
156 | + return new BaseObject(-1,'msg_invalid_request'); |
|
157 | + } |
|
136 | 158 | |
137 | 159 | // Get document |
138 | 160 | $oDocumentModel = getModel('document'); |
@@ -180,11 +202,15 @@ discard block |
||
180 | 202 | |
181 | 203 | // Check if already scrapped |
182 | 204 | $output = executeQuery('member.getScrapDocument', $args); |
183 | - if($output->data->count) return new BaseObject(-1, 'msg_alreay_scrapped'); |
|
205 | + if($output->data->count) { |
|
206 | + return new BaseObject(-1, 'msg_alreay_scrapped'); |
|
207 | + } |
|
184 | 208 | |
185 | 209 | // Insert |
186 | 210 | $output = executeQuery('member.addScrapDocument', $args); |
187 | - if(!$output->toBool()) return $output; |
|
211 | + if(!$output->toBool()) { |
|
212 | + return $output; |
|
213 | + } |
|
188 | 214 | |
189 | 215 | $this->setError(-1); |
190 | 216 | $this->setMessage('success_registed'); |
@@ -198,11 +224,15 @@ discard block |
||
198 | 224 | function procMemberDeleteScrap() |
199 | 225 | { |
200 | 226 | // Check login information |
201 | - if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
227 | + if(!Context::get('is_logged')) { |
|
228 | + return new BaseObject(-1, 'msg_not_logged'); |
|
229 | + } |
|
202 | 230 | $logged_info = Context::get('logged_info'); |
203 | 231 | |
204 | 232 | $document_srl = (int)Context::get('document_srl'); |
205 | - if(!$document_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
233 | + if(!$document_srl) { |
|
234 | + return new BaseObject(-1,'msg_invalid_request'); |
|
235 | + } |
|
206 | 236 | // Variables |
207 | 237 | $args = new stdClass; |
208 | 238 | $args->member_srl = $logged_info->member_srl; |
@@ -228,11 +258,15 @@ discard block |
||
228 | 258 | function procMemberDeleteSavedDocument() |
229 | 259 | { |
230 | 260 | // Check login information |
231 | - if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
261 | + if(!Context::get('is_logged')) { |
|
262 | + return new BaseObject(-1, 'msg_not_logged'); |
|
263 | + } |
|
232 | 264 | $logged_info = Context::get('logged_info'); |
233 | 265 | |
234 | 266 | $document_srl = (int)Context::get('document_srl'); |
235 | - if(!$document_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
267 | + if(!$document_srl) { |
|
268 | + return new BaseObject(-1,'msg_invalid_request'); |
|
269 | + } |
|
236 | 270 | |
237 | 271 | $oDocumentModel = getModel('document'); |
238 | 272 | $oDocument = $oDocumentModel->getDocument($document_srl); |
@@ -260,7 +294,9 @@ discard block |
||
260 | 294 | { |
261 | 295 | $name = Context::get('name'); |
262 | 296 | $value = Context::get('value'); |
263 | - if(!$value) return; |
|
297 | + if(!$value) { |
|
298 | + return; |
|
299 | + } |
|
264 | 300 | |
265 | 301 | $oMemberModel = getModel('member'); |
266 | 302 | // Check if logged-in |
@@ -271,10 +307,14 @@ discard block |
||
271 | 307 | { |
272 | 308 | case 'user_id' : |
273 | 309 | // Check denied ID |
274 | - if($oMemberModel->isDeniedID($value)) return new BaseObject(0,'denied_user_id'); |
|
310 | + if($oMemberModel->isDeniedID($value)) { |
|
311 | + return new BaseObject(0,'denied_user_id'); |
|
312 | + } |
|
275 | 313 | // Check if duplicated |
276 | 314 | $member_srl = $oMemberModel->getMemberSrlByUserID($value); |
277 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_user_id'); |
|
315 | + if($member_srl && $logged_info->member_srl != $member_srl ) { |
|
316 | + return new BaseObject(0,'msg_exists_user_id'); |
|
317 | + } |
|
278 | 318 | break; |
279 | 319 | case 'nick_name' : |
280 | 320 | // Check denied ID |
@@ -284,13 +324,17 @@ discard block |
||
284 | 324 | } |
285 | 325 | // Check if duplicated |
286 | 326 | $member_srl = $oMemberModel->getMemberSrlByNickName($value); |
287 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_nick_name'); |
|
327 | + if($member_srl && $logged_info->member_srl != $member_srl ) { |
|
328 | + return new BaseObject(0,'msg_exists_nick_name'); |
|
329 | + } |
|
288 | 330 | |
289 | 331 | break; |
290 | 332 | case 'email_address' : |
291 | 333 | // Check if duplicated |
292 | 334 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($value); |
293 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_email_address'); |
|
335 | + if($member_srl && $logged_info->member_srl != $member_srl ) { |
|
336 | + return new BaseObject(0,'msg_exists_email_address'); |
|
337 | + } |
|
294 | 338 | break; |
295 | 339 | } |
296 | 340 | } |
@@ -302,17 +346,25 @@ discard block |
||
302 | 346 | */ |
303 | 347 | function procMemberInsert() |
304 | 348 | { |
305 | - if (Context::getRequestMethod () == "GET") return new BaseObject(-1, "msg_invalid_request"); |
|
349 | + if (Context::getRequestMethod () == "GET") { |
|
350 | + return new BaseObject(-1, "msg_invalid_request"); |
|
351 | + } |
|
306 | 352 | $oMemberModel = &getModel ('member'); |
307 | 353 | $config = $oMemberModel->getMemberConfig(); |
308 | 354 | |
309 | 355 | // call a trigger (before) |
310 | 356 | $trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config); |
311 | - if(!$trigger_output->toBool ()) return $trigger_output; |
|
357 | + if(!$trigger_output->toBool ()) { |
|
358 | + return $trigger_output; |
|
359 | + } |
|
312 | 360 | // Check if an administrator allows a membership |
313 | - if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled'); |
|
361 | + if($config->enable_join != 'Y') { |
|
362 | + return $this->stop ('msg_signup_disabled'); |
|
363 | + } |
|
314 | 364 | // Check if the user accept the license terms (only if terms exist) |
315 | - if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement'); |
|
365 | + if($config->agreement && Context::get('accept_agreement')!='Y') { |
|
366 | + return $this->stop('msg_accept_agreement'); |
|
367 | + } |
|
316 | 368 | |
317 | 369 | // Extract the necessary information in advance |
318 | 370 | $getVars = array(); |
@@ -331,16 +383,22 @@ discard block |
||
331 | 383 | foreach($getVars as $val) |
332 | 384 | { |
333 | 385 | $args->{$val} = Context::get($val); |
334 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
386 | + if($val == 'birthday') { |
|
387 | + $args->birthday_ui = Context::get('birthday_ui'); |
|
388 | + } |
|
335 | 389 | } |
336 | 390 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
337 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
391 | + if(!$args->birthday && $args->birthday_ui) { |
|
392 | + $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
393 | + } |
|
338 | 394 | |
339 | 395 | $args->find_account_answer = Context::get('find_account_answer'); |
340 | 396 | $args->allow_mailing = Context::get('allow_mailing'); |
341 | 397 | $args->allow_message = Context::get('allow_message'); |
342 | 398 | |
343 | - if($args->password1) $args->password = $args->password1; |
|
399 | + if($args->password1) { |
|
400 | + $args->password = $args->password1; |
|
401 | + } |
|
344 | 402 | |
345 | 403 | // check password strength |
346 | 404 | if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
@@ -369,7 +427,9 @@ discard block |
||
369 | 427 | unset($all_args->secret_text); |
370 | 428 | |
371 | 429 | // Set the user state as "denied" when using mail authentication |
372 | - if($config->enable_confirm == 'Y') $args->denied = 'Y'; |
|
430 | + if($config->enable_confirm == 'Y') { |
|
431 | + $args->denied = 'Y'; |
|
432 | + } |
|
373 | 433 | // Add extra vars after excluding necessary information from all the requested arguments |
374 | 434 | $extra_vars = delObjectVars($all_args, $args); |
375 | 435 | $args->extra_vars = serialize($extra_vars); |
@@ -384,7 +444,9 @@ discard block |
||
384 | 444 | } |
385 | 445 | } |
386 | 446 | $output = $this->insertMember($args); |
387 | - if(!$output->toBool()) return $output; |
|
447 | + if(!$output->toBool()) { |
|
448 | + return $output; |
|
449 | + } |
|
388 | 450 | |
389 | 451 | // insert ProfileImage, ImageName, ImageMark |
390 | 452 | $profile_image = $_FILES['profile_image']; |
@@ -423,43 +485,46 @@ discard block |
||
423 | 485 | if($config->identifier == 'email_address') |
424 | 486 | { |
425 | 487 | $output = $this->doLogin($args->email_address); |
426 | - } |
|
427 | - else |
|
488 | + } else |
|
428 | 489 | { |
429 | 490 | $output = $this->doLogin($args->user_id); |
430 | 491 | } |
431 | 492 | if(!$output->toBool()) { |
432 | - if($output->error == -9) |
|
433 | - $output->error = -11; |
|
493 | + if($output->error == -9) { |
|
494 | + $output->error = -11; |
|
495 | + } |
|
434 | 496 | return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output); |
435 | 497 | } |
436 | 498 | } |
437 | 499 | |
438 | 500 | // Results |
439 | 501 | $this->add('member_srl', $args->member_srl); |
440 | - if($config->redirect_url) $this->add('redirect_url', $config->redirect_url); |
|
502 | + if($config->redirect_url) { |
|
503 | + $this->add('redirect_url', $config->redirect_url); |
|
504 | + } |
|
441 | 505 | if($config->enable_confirm == 'Y') |
442 | 506 | { |
443 | 507 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
444 | 508 | $this->setMessage($msg); |
445 | 509 | return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new BaseObject(-12, $msg)); |
510 | + } else { |
|
511 | + $this->setMessage('success_registed'); |
|
446 | 512 | } |
447 | - else $this->setMessage('success_registed'); |
|
448 | 513 | // Call a trigger (after) |
449 | 514 | $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config); |
450 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
515 | + if(!$trigger_output->toBool()) { |
|
516 | + return $trigger_output; |
|
517 | + } |
|
451 | 518 | |
452 | 519 | if($config->redirect_url) |
453 | 520 | { |
454 | 521 | $returnUrl = $config->redirect_url; |
455 | - } |
|
456 | - else |
|
522 | + } else |
|
457 | 523 | { |
458 | 524 | if(Context::get('success_return_url')) |
459 | 525 | { |
460 | 526 | $returnUrl = Context::get('success_return_url'); |
461 | - } |
|
462 | - else if($_COOKIE['XE_REDIRECT_URL']) |
|
527 | + } else if($_COOKIE['XE_REDIRECT_URL']) |
|
463 | 528 | { |
464 | 529 | $returnUrl = $_COOKIE['XE_REDIRECT_URL']; |
465 | 530 | setcookie("XE_REDIRECT_URL", '', 1); |
@@ -513,8 +578,7 @@ discard block |
||
513 | 578 | if(Context::get('success_return_url')) |
514 | 579 | { |
515 | 580 | $redirectUrl = Context::get('success_return_url'); |
516 | - } |
|
517 | - else |
|
581 | + } else |
|
518 | 582 | { |
519 | 583 | $redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
520 | 584 | } |
@@ -558,7 +622,9 @@ discard block |
||
558 | 622 | foreach($getVars as $val) |
559 | 623 | { |
560 | 624 | $args->{$val} = Context::get($val); |
561 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
625 | + if($val == 'birthday') { |
|
626 | + $args->birthday_ui = Context::get('birthday_ui'); |
|
627 | + } |
|
562 | 628 | if($val == 'find_account_answer' && !Context::get($val)) { |
563 | 629 | unset($args->{$val}); |
564 | 630 | } |
@@ -568,7 +634,9 @@ discard block |
||
568 | 634 | $logged_info = Context::get('logged_info'); |
569 | 635 | $args->member_srl = $logged_info->member_srl; |
570 | 636 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
571 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
637 | + if(!$args->birthday && $args->birthday_ui) { |
|
638 | + $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
639 | + } |
|
572 | 640 | |
573 | 641 | // Remove some unnecessary variables from all the vars |
574 | 642 | $all_args = Context::getRequestVars(); |
@@ -603,7 +671,9 @@ discard block |
||
603 | 671 | |
604 | 672 | // Execute insert or update depending on the value of member_srl |
605 | 673 | $output = $this->updateMember($args); |
606 | - if(!$output->toBool()) return $output; |
|
674 | + if(!$output->toBool()) { |
|
675 | + return $output; |
|
676 | + } |
|
607 | 677 | |
608 | 678 | $profile_image = $_FILES['profile_image']; |
609 | 679 | if(is_uploaded_file($profile_image['tmp_name'])) |
@@ -633,7 +703,9 @@ discard block |
||
633 | 703 | |
634 | 704 | // Call a trigger after successfully log-in (after) |
635 | 705 | $trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo); |
636 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
706 | + if(!$trigger_output->toBool()) { |
|
707 | + return $trigger_output; |
|
708 | + } |
|
637 | 709 | |
638 | 710 | $this->setSessionInfo(); |
639 | 711 | // Return result |
@@ -654,7 +726,9 @@ discard block |
||
654 | 726 | */ |
655 | 727 | function procMemberModifyPassword() |
656 | 728 | { |
657 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
729 | + if(!Context::get('is_logged')) { |
|
730 | + return $this->stop('msg_not_logged'); |
|
731 | + } |
|
658 | 732 | // Extract the necessary information in advance |
659 | 733 | $current_password = trim(Context::get('current_password')); |
660 | 734 | $password = trim(Context::get('password1')); |
@@ -668,17 +742,23 @@ discard block |
||
668 | 742 | |
669 | 743 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
670 | 744 | // Verify the cuttent password |
671 | - if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new BaseObject(-1, 'invalid_password'); |
|
745 | + if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) { |
|
746 | + return new BaseObject(-1, 'invalid_password'); |
|
747 | + } |
|
672 | 748 | |
673 | 749 | // Check if a new password is as same as the previous password |
674 | - if($current_password == $password) return new BaseObject(-1, 'invalid_new_password'); |
|
750 | + if($current_password == $password) { |
|
751 | + return new BaseObject(-1, 'invalid_new_password'); |
|
752 | + } |
|
675 | 753 | |
676 | 754 | // Execute insert or update depending on the value of member_srl |
677 | 755 | $args = new stdClass; |
678 | 756 | $args->member_srl = $member_srl; |
679 | 757 | $args->password = $password; |
680 | 758 | $output = $this->updateMemberPassword($args); |
681 | - if(!$output->toBool()) return $output; |
|
759 | + if(!$output->toBool()) { |
|
760 | + return $output; |
|
761 | + } |
|
682 | 762 | |
683 | 763 | $this->add('member_srl', $args->member_srl); |
684 | 764 | $this->setMessage('success_updated'); |
@@ -694,7 +774,9 @@ discard block |
||
694 | 774 | */ |
695 | 775 | function procMemberLeave() |
696 | 776 | { |
697 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
777 | + if(!Context::get('is_logged')) { |
|
778 | + return $this->stop('msg_not_logged'); |
|
779 | + } |
|
698 | 780 | // Extract the necessary information in advance |
699 | 781 | $password = trim(Context::get('password')); |
700 | 782 | // Get information of logged-in user |
@@ -710,10 +792,14 @@ discard block |
||
710 | 792 | $this->memberInfo->password = $memberInfo->password; |
711 | 793 | } |
712 | 794 | // Verify the cuttent password |
713 | - if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new BaseObject(-1, 'invalid_password'); |
|
795 | + if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) { |
|
796 | + return new BaseObject(-1, 'invalid_password'); |
|
797 | + } |
|
714 | 798 | |
715 | 799 | $output = $this->deleteMember($member_srl); |
716 | - if(!$output->toBool()) return $output; |
|
800 | + if(!$output->toBool()) { |
|
801 | + return $output; |
|
802 | + } |
|
717 | 803 | // Destroy all session information |
718 | 804 | $this->destroySessionInfo(); |
719 | 805 | // Return success message |
@@ -732,20 +818,30 @@ discard block |
||
732 | 818 | { |
733 | 819 | // Check if the file is successfully uploaded |
734 | 820 | $file = $_FILES['profile_image']; |
735 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image'); |
|
821 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
822 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
823 | + } |
|
736 | 824 | // Ignore if member_srl is invalid or doesn't exist. |
737 | 825 | $member_srl = Context::get('member_srl'); |
738 | - if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
826 | + if(!$member_srl) { |
|
827 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
828 | + } |
|
739 | 829 | |
740 | 830 | $logged_info = Context::get('logged_info'); |
741 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
831 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
832 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
833 | + } |
|
742 | 834 | // Return if member module is set not to use an image name or the user is not an administrator ; |
743 | 835 | $oMemberModel = getModel('member'); |
744 | 836 | $config = $oMemberModel->getMemberConfig(); |
745 | - if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image'); |
|
837 | + if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') { |
|
838 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
839 | + } |
|
746 | 840 | |
747 | 841 | $output = $this->insertProfileImage($member_srl, $file['tmp_name']); |
748 | - if(!$output->toBool()) return $output; |
|
842 | + if(!$output->toBool()) { |
|
843 | + return $output; |
|
844 | + } |
|
749 | 845 | |
750 | 846 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
751 | 847 | $this->setRedirectUrl($returnUrl); |
@@ -768,8 +864,9 @@ discard block |
||
768 | 864 | $max_filesize = $config->profile_image_max_filesize; |
769 | 865 | foreach($config->signupForm as $val) |
770 | 866 | { |
771 | - if($val->name == "profile_image") |
|
772 | - $allow_transparent = $val->allow_transparent_thumbnail == 'Y'; |
|
867 | + if($val->name == "profile_image") { |
|
868 | + $allow_transparent = $val->allow_transparent_thumbnail == 'Y'; |
|
869 | + } |
|
773 | 870 | } |
774 | 871 | |
775 | 872 | Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
@@ -777,10 +874,13 @@ discard block |
||
777 | 874 | // Get file information |
778 | 875 | FileHandler::clearStatCache($target_file); |
779 | 876 | list($width, $height, $type) = @getimagesize($target_file); |
780 | - if(IMAGETYPE_PNG == $type) $ext = 'png'; |
|
781 | - elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
782 | - elseif(IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
783 | - else |
|
877 | + if(IMAGETYPE_PNG == $type) { |
|
878 | + $ext = 'png'; |
|
879 | + } elseif(IMAGETYPE_JPEG == $type) { |
|
880 | + $ext = 'jpg'; |
|
881 | + } elseif(IMAGETYPE_GIF == $type) { |
|
882 | + $ext = 'gif'; |
|
883 | + } else |
|
784 | 884 | { |
785 | 885 | return $this->stop('msg_not_uploaded_profile_image'); |
786 | 886 | } |
@@ -811,8 +911,7 @@ discard block |
||
811 | 911 | FileHandler::removeFilesInDir($target_path); |
812 | 912 | FileHandler::moveFile($temp_filename, $target_filename); |
813 | 913 | FileHandler::clearStatCache($target_filename); |
814 | - } |
|
815 | - else |
|
914 | + } else |
|
816 | 915 | { |
817 | 916 | // 파일 용량 제한 |
818 | 917 | $filesize = filesize($target_file); |
@@ -841,20 +940,30 @@ discard block |
||
841 | 940 | { |
842 | 941 | // Check if the file is successfully uploaded |
843 | 942 | $file = $_FILES['image_name']; |
844 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
943 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
944 | + return $this->stop('msg_not_uploaded_image_name'); |
|
945 | + } |
|
845 | 946 | // Ignore if member_srl is invalid or doesn't exist. |
846 | 947 | $member_srl = Context::get('member_srl'); |
847 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
948 | + if(!$member_srl) { |
|
949 | + return $this->stop('msg_not_uploaded_image_name'); |
|
950 | + } |
|
848 | 951 | |
849 | 952 | $logged_info = Context::get('logged_info'); |
850 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
953 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
954 | + return $this->stop('msg_not_uploaded_image_name'); |
|
955 | + } |
|
851 | 956 | // Return if member module is set not to use an image name or the user is not an administrator ; |
852 | 957 | $oMemberModel = getModel('member'); |
853 | 958 | $config = $oMemberModel->getMemberConfig(); |
854 | - if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
959 | + if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') { |
|
960 | + return $this->stop('msg_not_uploaded_image_name'); |
|
961 | + } |
|
855 | 962 | |
856 | 963 | $output = $this->insertImageName($member_srl, $file['tmp_name']); |
857 | - if(!$output->toBool()) return $output; |
|
964 | + if(!$output->toBool()) { |
|
965 | + return $output; |
|
966 | + } |
|
858 | 967 | |
859 | 968 | // Page refresh |
860 | 969 | //$this->setRefreshPage(); |
@@ -909,8 +1018,7 @@ discard block |
||
909 | 1018 | FileHandler::removeFilesInDir($target_path); |
910 | 1019 | FileHandler::moveFile($temp_filename, $target_filename); |
911 | 1020 | FileHandler::clearStatCache($target_filename); |
912 | - } |
|
913 | - else |
|
1021 | + } else |
|
914 | 1022 | { |
915 | 1023 | // 파일 용량 제한 |
916 | 1024 | $filesize = filesize($target_file); |
@@ -987,20 +1095,30 @@ discard block |
||
987 | 1095 | { |
988 | 1096 | // Check if the file is successfully uploaded |
989 | 1097 | $file = $_FILES['image_mark']; |
990 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
1098 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
1099 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
1100 | + } |
|
991 | 1101 | // Ignore if member_srl is invalid or doesn't exist. |
992 | 1102 | $member_srl = Context::get('member_srl'); |
993 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
1103 | + if(!$member_srl) { |
|
1104 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
1105 | + } |
|
994 | 1106 | |
995 | 1107 | $logged_info = Context::get('logged_info'); |
996 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
1108 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
1109 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
1110 | + } |
|
997 | 1111 | // Membership in the images mark the module using the ban was set by an administrator or return; |
998 | 1112 | $oMemberModel = getModel('member'); |
999 | 1113 | $config = $oMemberModel->getMemberConfig(); |
1000 | - if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
1114 | + if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') { |
|
1115 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
1116 | + } |
|
1001 | 1117 | |
1002 | 1118 | $this->insertImageMark($member_srl, $file['tmp_name']); |
1003 | - if(!$output->toBool()) return $output; |
|
1119 | + if(!$output->toBool()) { |
|
1120 | + return $output; |
|
1121 | + } |
|
1004 | 1122 | |
1005 | 1123 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
1006 | 1124 | $this->setRedirectUrl($returnUrl); |
@@ -1051,8 +1169,7 @@ discard block |
||
1051 | 1169 | FileHandler::removeFilesInDir($target_path); |
1052 | 1170 | FileHandler::moveFile($temp_filename, $target_filename); |
1053 | 1171 | FileHandler::clearStatCache($target_filename); |
1054 | - } |
|
1055 | - else |
|
1172 | + } else |
|
1056 | 1173 | { |
1057 | 1174 | $filesize = filesize($target_file); |
1058 | 1175 | if($max_filesize && $filesize > ($max_filesize * 1024)) |
@@ -1104,14 +1221,18 @@ discard block |
||
1104 | 1221 | function procMemberFindAccount() |
1105 | 1222 | { |
1106 | 1223 | $email_address = Context::get('email_address'); |
1107 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1224 | + if(!$email_address) { |
|
1225 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
1226 | + } |
|
1108 | 1227 | |
1109 | 1228 | $oMemberModel = getModel('member'); |
1110 | 1229 | $oModuleModel = getModel('module'); |
1111 | 1230 | |
1112 | 1231 | // Check if a member having the same email address exists |
1113 | 1232 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1114 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1233 | + if(!$member_srl) { |
|
1234 | + return new BaseObject(-1, 'msg_email_not_exists'); |
|
1235 | + } |
|
1115 | 1236 | |
1116 | 1237 | // Get information of the member |
1117 | 1238 | $columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name'); |
@@ -1123,7 +1244,9 @@ discard block |
||
1123 | 1244 | $chk_args = new stdClass; |
1124 | 1245 | $chk_args->member_srl = $member_info->member_srl; |
1125 | 1246 | $output = executeQuery('member.chkAuthMail', $chk_args); |
1126 | - if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
1247 | + if($output->toBool() && $output->data->count != '0') { |
|
1248 | + return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
1249 | + } |
|
1127 | 1250 | } |
1128 | 1251 | |
1129 | 1252 | // Insert data into the authentication DB |
@@ -1136,7 +1259,9 @@ discard block |
||
1136 | 1259 | $args->is_register = 'N'; |
1137 | 1260 | |
1138 | 1261 | $output = executeQuery('member.insertAuthMail', $args); |
1139 | - if(!$output->toBool()) return $output; |
|
1262 | + if(!$output->toBool()) { |
|
1263 | + return $output; |
|
1264 | + } |
|
1140 | 1265 | // Get content of the email to send a member |
1141 | 1266 | Context::set('auth_args', $args); |
1142 | 1267 | |
@@ -1153,8 +1278,7 @@ discard block |
||
1153 | 1278 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1154 | 1279 | } |
1155 | 1280 | } |
1156 | - } |
|
1157 | - else |
|
1281 | + } else |
|
1158 | 1282 | { |
1159 | 1283 | $memberInfo[$lang->user_id] = $args->user_id; |
1160 | 1284 | $memberInfo[$lang->user_name] = $args->user_name; |
@@ -1163,13 +1287,19 @@ discard block |
||
1163 | 1287 | } |
1164 | 1288 | Context::set('memberInfo', $memberInfo); |
1165 | 1289 | |
1166 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1167 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1290 | + if(!$member_config->skin) { |
|
1291 | + $member_config->skin = "default"; |
|
1292 | + } |
|
1293 | + if(!$member_config->colorset) { |
|
1294 | + $member_config->colorset = "white"; |
|
1295 | + } |
|
1168 | 1296 | |
1169 | 1297 | Context::set('member_config', $member_config); |
1170 | 1298 | |
1171 | 1299 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1172 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1300 | + if(!is_dir($tpl_path)) { |
|
1301 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1302 | + } |
|
1173 | 1303 | |
1174 | 1304 | $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
1175 | 1305 | Context::set('find_url', $find_url); |
@@ -1212,19 +1342,25 @@ discard block |
||
1212 | 1342 | $find_account_question = trim(Context::get('find_account_question')); |
1213 | 1343 | $find_account_answer = trim(Context::get('find_account_answer')); |
1214 | 1344 | |
1215 | - if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
1345 | + if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) { |
|
1346 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
1347 | + } |
|
1216 | 1348 | |
1217 | 1349 | $oModuleModel = getModel('module'); |
1218 | 1350 | // Check if a member having the same email address exists |
1219 | 1351 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1220 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1352 | + if(!$member_srl) { |
|
1353 | + return new BaseObject(-1, 'msg_email_not_exists'); |
|
1354 | + } |
|
1221 | 1355 | |
1222 | 1356 | // Get information of the member |
1223 | 1357 | $columnList = array('member_srl', 'find_account_question', 'find_account_answer'); |
1224 | 1358 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
1225 | 1359 | |
1226 | 1360 | // Display a message if no answer is entered |
1227 | - if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
1361 | + if(!$member_info->find_account_question || !$member_info->find_account_answer) { |
|
1362 | + return new BaseObject(-1, 'msg_question_not_exists'); |
|
1363 | + } |
|
1228 | 1364 | |
1229 | 1365 | // 답변 확인 |
1230 | 1366 | $hashed = $oPassword->checkAlgorithm($member_info->find_account_answer); |
@@ -1233,12 +1369,10 @@ discard block |
||
1233 | 1369 | if($member_info->find_account_question != $find_account_question) |
1234 | 1370 | { |
1235 | 1371 | $authed = false; |
1236 | - } |
|
1237 | - else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
1372 | + } else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
1238 | 1373 | { |
1239 | 1374 | $authed = false; |
1240 | - } |
|
1241 | - else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
1375 | + } else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
1242 | 1376 | { |
1243 | 1377 | $authed = false; |
1244 | 1378 | } |
@@ -1267,7 +1401,9 @@ discard block |
||
1267 | 1401 | $args->password = $temp_password; |
1268 | 1402 | $args->change_password_date = '1'; |
1269 | 1403 | $output = $this->updateMemberPassword($args); |
1270 | - if(!$output->toBool()) return $output; |
|
1404 | + if(!$output->toBool()) { |
|
1405 | + return $output; |
|
1406 | + } |
|
1271 | 1407 | |
1272 | 1408 | $_SESSION['xe_temp_password_' . $user_id] = $temp_password; |
1273 | 1409 | |
@@ -1327,7 +1463,9 @@ discard block |
||
1327 | 1463 | $auth_args->is_register = 'Y'; |
1328 | 1464 | |
1329 | 1465 | $output = executeQuery('member.insertAuthMail', $auth_args); |
1330 | - if(!$output->toBool()) return $output; |
|
1466 | + if(!$output->toBool()) { |
|
1467 | + return $output; |
|
1468 | + } |
|
1331 | 1469 | |
1332 | 1470 | // resend auth mail. |
1333 | 1471 | $this->_sendAuthMail($auth_args, $memberInfo); |
@@ -1344,8 +1482,7 @@ discard block |
||
1344 | 1482 | if($output->data->is_register == 'Y') |
1345 | 1483 | { |
1346 | 1484 | $args->denied = 'N'; |
1347 | - } |
|
1348 | - else |
|
1485 | + } else |
|
1349 | 1486 | { |
1350 | 1487 | $args->password = $oMemberModel->hashPassword($args->password); |
1351 | 1488 | } |
@@ -1379,33 +1516,45 @@ discard block |
||
1379 | 1516 | { |
1380 | 1517 | // Get an email_address |
1381 | 1518 | $email_address = Context::get('email_address'); |
1382 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1519 | + if(!$email_address) { |
|
1520 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
1521 | + } |
|
1383 | 1522 | // Log test by using email_address |
1384 | 1523 | $oMemberModel = getModel('member'); |
1385 | 1524 | |
1386 | 1525 | $args = new stdClass; |
1387 | 1526 | $args->email_address = $email_address; |
1388 | 1527 | $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1389 | - if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
1528 | + if(!$memberSrl) { |
|
1529 | + return new BaseObject(-1, 'msg_not_exists_member'); |
|
1530 | + } |
|
1390 | 1531 | |
1391 | 1532 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address'); |
1392 | 1533 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList); |
1393 | 1534 | |
1394 | 1535 | $oModuleModel = getModel('module'); |
1395 | 1536 | $member_config = $oModuleModel->getModuleConfig('member'); |
1396 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1397 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1537 | + if(!$member_config->skin) { |
|
1538 | + $member_config->skin = "default"; |
|
1539 | + } |
|
1540 | + if(!$member_config->colorset) { |
|
1541 | + $member_config->colorset = "white"; |
|
1542 | + } |
|
1398 | 1543 | |
1399 | 1544 | // Check if a authentication mail has been sent previously |
1400 | 1545 | $chk_args = new stdClass; |
1401 | 1546 | $chk_args->member_srl = $member_info->member_srl; |
1402 | 1547 | $output = executeQuery('member.chkAuthMail', $chk_args); |
1403 | - if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
1548 | + if($output->toBool() && $output->data->count == '0') { |
|
1549 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
1550 | + } |
|
1404 | 1551 | |
1405 | 1552 | $auth_args = new stdClass; |
1406 | 1553 | $auth_args->member_srl = $member_info->member_srl; |
1407 | 1554 | $output = executeQueryArray('member.getAuthMailInfo', $auth_args); |
1408 | - if(!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
1555 | + if(!$output->data || !$output->data[0]->auth_key) { |
|
1556 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
1557 | + } |
|
1409 | 1558 | $auth_info = $output->data[0]; |
1410 | 1559 | |
1411 | 1560 | // Update the regdate of authmail entry |
@@ -1426,8 +1575,7 @@ discard block |
||
1426 | 1575 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1427 | 1576 | } |
1428 | 1577 | } |
1429 | - } |
|
1430 | - else |
|
1578 | + } else |
|
1431 | 1579 | { |
1432 | 1580 | $memberInfo[$lang->user_id] = $member_info->user_id; |
1433 | 1581 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1440,7 +1588,9 @@ discard block |
||
1440 | 1588 | Context::set('member_config', $member_config); |
1441 | 1589 | |
1442 | 1590 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1443 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1591 | + if(!is_dir($tpl_path)) { |
|
1592 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1593 | + } |
|
1444 | 1594 | |
1445 | 1595 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); |
1446 | 1596 | Context::set('auth_url', $auth_url); |
@@ -1518,7 +1668,9 @@ discard block |
||
1518 | 1668 | $auth_args->is_register = 'Y'; |
1519 | 1669 | |
1520 | 1670 | $output = executeQuery('member.insertAuthMail', $auth_args); |
1521 | - if(!$output->toBool()) return $output; |
|
1671 | + if(!$output->toBool()) { |
|
1672 | + return $output; |
|
1673 | + } |
|
1522 | 1674 | |
1523 | 1675 | $memberInfo->email_address = $newEmail; |
1524 | 1676 | |
@@ -1552,8 +1704,7 @@ discard block |
||
1552 | 1704 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1553 | 1705 | } |
1554 | 1706 | } |
1555 | - } |
|
1556 | - else |
|
1707 | + } else |
|
1557 | 1708 | { |
1558 | 1709 | $memberInfo[$lang->user_id] = $member_info->user_id; |
1559 | 1710 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1562,13 +1713,19 @@ discard block |
||
1562 | 1713 | } |
1563 | 1714 | Context::set('memberInfo', $memberInfo); |
1564 | 1715 | |
1565 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1566 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1716 | + if(!$member_config->skin) { |
|
1717 | + $member_config->skin = "default"; |
|
1718 | + } |
|
1719 | + if(!$member_config->colorset) { |
|
1720 | + $member_config->colorset = "white"; |
|
1721 | + } |
|
1567 | 1722 | |
1568 | 1723 | Context::set('member_config', $member_config); |
1569 | 1724 | |
1570 | 1725 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1571 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1726 | + if(!is_dir($tpl_path)) { |
|
1727 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1728 | + } |
|
1572 | 1729 | |
1573 | 1730 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
1574 | 1731 | Context::set('auth_url', $auth_url); |
@@ -1593,7 +1750,9 @@ discard block |
||
1593 | 1750 | { |
1594 | 1751 | $site_module_info = Context::get('site_module_info'); |
1595 | 1752 | $logged_info = Context::get('logged_info'); |
1596 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
1753 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
1754 | + return new BaseObject(-1,'msg_invalid_request'); |
|
1755 | + } |
|
1597 | 1756 | |
1598 | 1757 | $oMemberModel = getModel('member'); |
1599 | 1758 | $columnList = array('site_srl', 'group_srl', 'title'); |
@@ -1612,13 +1771,17 @@ discard block |
||
1612 | 1771 | { |
1613 | 1772 | $site_module_info = Context::get('site_module_info'); |
1614 | 1773 | $logged_info = Context::get('logged_info'); |
1615 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
1774 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
1775 | + return new BaseObject(-1,'msg_invalid_request'); |
|
1776 | + } |
|
1616 | 1777 | |
1617 | 1778 | $args = new stdClass; |
1618 | 1779 | $args->site_srl= $site_module_info->site_srl; |
1619 | 1780 | $args->member_srl = $logged_info->member_srl; |
1620 | 1781 | $output = executeQuery('member.deleteMembersGroup', $args); |
1621 | - if(!$output->toBool()) return $output; |
|
1782 | + if(!$output->toBool()) { |
|
1783 | + return $output; |
|
1784 | + } |
|
1622 | 1785 | $this->setMessage('success_deleted'); |
1623 | 1786 | $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl); |
1624 | 1787 | } |
@@ -1632,17 +1795,37 @@ discard block |
||
1632 | 1795 | */ |
1633 | 1796 | function setMemberConfig($args) |
1634 | 1797 | { |
1635 | - if(!$args->skin) $args->skin = "default"; |
|
1636 | - if(!$args->colorset) $args->colorset = "white"; |
|
1637 | - if(!$args->editor_skin) $args->editor_skin= "ckeditor"; |
|
1638 | - if(!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
1639 | - if($args->enable_join!='Y') $args->enable_join = 'N'; |
|
1798 | + if(!$args->skin) { |
|
1799 | + $args->skin = "default"; |
|
1800 | + } |
|
1801 | + if(!$args->colorset) { |
|
1802 | + $args->colorset = "white"; |
|
1803 | + } |
|
1804 | + if(!$args->editor_skin) { |
|
1805 | + $args->editor_skin= "ckeditor"; |
|
1806 | + } |
|
1807 | + if(!$args->editor_colorset) { |
|
1808 | + $args->editor_colorset = "moono"; |
|
1809 | + } |
|
1810 | + if($args->enable_join!='Y') { |
|
1811 | + $args->enable_join = 'N'; |
|
1812 | + } |
|
1640 | 1813 | $args->enable_openid= 'N'; |
1641 | - if($args->profile_image !='Y') $args->profile_image = 'N'; |
|
1642 | - if($args->image_name!='Y') $args->image_name = 'N'; |
|
1643 | - if($args->image_mark!='Y') $args->image_mark = 'N'; |
|
1644 | - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; |
|
1645 | - if(!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
1814 | + if($args->profile_image !='Y') { |
|
1815 | + $args->profile_image = 'N'; |
|
1816 | + } |
|
1817 | + if($args->image_name!='Y') { |
|
1818 | + $args->image_name = 'N'; |
|
1819 | + } |
|
1820 | + if($args->image_mark!='Y') { |
|
1821 | + $args->image_mark = 'N'; |
|
1822 | + } |
|
1823 | + if($args->group_image_mark!='Y') { |
|
1824 | + $args->group_image_mark = 'N'; |
|
1825 | + } |
|
1826 | + if(!trim(strip_tags($args->agreement))) { |
|
1827 | + $args->agreement = null; |
|
1828 | + } |
|
1646 | 1829 | $args->limit_day = (int)$args->limit_day; |
1647 | 1830 | |
1648 | 1831 | $agreement = trim($args->agreement); |
@@ -1650,7 +1833,9 @@ discard block |
||
1650 | 1833 | |
1651 | 1834 | $oModuleController = getController('module'); |
1652 | 1835 | $output = $oModuleController->insertModuleConfig('member',$args); |
1653 | - if(!$output->toBool()) return $output; |
|
1836 | + if(!$output->toBool()) { |
|
1837 | + return $output; |
|
1838 | + } |
|
1654 | 1839 | |
1655 | 1840 | $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
1656 | 1841 | FileHandler::writeFile($agreement_file, $agreement); |
@@ -1675,7 +1860,9 @@ discard block |
||
1675 | 1860 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
1676 | 1861 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
1677 | 1862 | |
1678 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
1863 | + if(!$check_signature) { |
|
1864 | + return FileHandler::removeFile($filename); |
|
1865 | + } |
|
1679 | 1866 | |
1680 | 1867 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
1681 | 1868 | FileHandler::makeDir($path); |
@@ -1709,7 +1896,9 @@ discard block |
||
1709 | 1896 | $args = new stdClass(); |
1710 | 1897 | $args->member_srl = $member_srl; |
1711 | 1898 | $args->group_srl = $group_srl; |
1712 | - if($site_srl) $args->site_srl = $site_srl; |
|
1899 | + if($site_srl) { |
|
1900 | + $args->site_srl = $site_srl; |
|
1901 | + } |
|
1713 | 1902 | |
1714 | 1903 | // Add |
1715 | 1904 | $output = executeQuery('member.addMemberToGroup',$args); |
@@ -1735,15 +1924,21 @@ discard block |
||
1735 | 1924 | $obj->member_srl = implode(',',$args->member_srl); |
1736 | 1925 | |
1737 | 1926 | $output = executeQueryArray('member.getMembersGroup', $obj); |
1738 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1927 | + if($output->data) { |
|
1928 | + foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1929 | + } |
|
1739 | 1930 | |
1740 | 1931 | $output = executeQuery('member.deleteMembersGroup', $obj); |
1741 | - if(!$output->toBool()) return $output; |
|
1932 | + if(!$output->toBool()) { |
|
1933 | + return $output; |
|
1934 | + } |
|
1742 | 1935 | |
1743 | 1936 | $inserted_members = array(); |
1744 | 1937 | foreach($args->member_srl as $key => $val) |
1745 | 1938 | { |
1746 | - if($inserted_members[$val]) continue; |
|
1939 | + if($inserted_members[$val]) { |
|
1940 | + continue; |
|
1941 | + } |
|
1747 | 1942 | $inserted_members[$val] = true; |
1748 | 1943 | |
1749 | 1944 | unset($obj); |
@@ -1753,7 +1948,9 @@ discard block |
||
1753 | 1948 | $obj->site_srl = $args->site_srl; |
1754 | 1949 | $obj->regdate = $date[$obj->member_srl]; |
1755 | 1950 | $output = executeQuery('member.addMemberToGroup', $obj); |
1756 | - if(!$output->toBool()) return $output; |
|
1951 | + if(!$output->toBool()) { |
|
1952 | + return $output; |
|
1953 | + } |
|
1757 | 1954 | |
1758 | 1955 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
1759 | 1956 | } |
@@ -1815,8 +2012,7 @@ discard block |
||
1815 | 2012 | if($config->identifier == 'user_id') |
1816 | 2013 | { |
1817 | 2014 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
1818 | - } |
|
1819 | - else |
|
2015 | + } else |
|
1820 | 2016 | { |
1821 | 2017 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
1822 | 2018 | } |
@@ -1825,8 +2021,7 @@ discard block |
||
1825 | 2021 | $do_auto_login = true; |
1826 | 2022 | } |
1827 | 2023 | |
1828 | - } |
|
1829 | - else |
|
2024 | + } else |
|
1830 | 2025 | { |
1831 | 2026 | $do_auto_login = true; |
1832 | 2027 | } |
@@ -1835,8 +2030,7 @@ discard block |
||
1835 | 2030 | if($do_auto_login) |
1836 | 2031 | { |
1837 | 2032 | $output = $this->doLogin($user_id); |
1838 | - } |
|
1839 | - else |
|
2033 | + } else |
|
1840 | 2034 | { |
1841 | 2035 | executeQuery('member.deleteAutologin', $args); |
1842 | 2036 | setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
@@ -1855,13 +2049,17 @@ discard block |
||
1855 | 2049 | function doLogin($user_id, $password = '', $keep_signed = false) |
1856 | 2050 | { |
1857 | 2051 | $user_id = strtolower($user_id); |
1858 | - if(!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
2052 | + if(!$user_id) { |
|
2053 | + return new BaseObject(-1, 'null_user_id'); |
|
2054 | + } |
|
1859 | 2055 | // Call a trigger before log-in (before) |
1860 | 2056 | $trigger_obj = new stdClass(); |
1861 | 2057 | $trigger_obj->user_id = $user_id; |
1862 | 2058 | $trigger_obj->password = $password; |
1863 | 2059 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
1864 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
2060 | + if(!$trigger_output->toBool()) { |
|
2061 | + return $trigger_output; |
|
2062 | + } |
|
1865 | 2063 | // Create a member model object |
1866 | 2064 | $oMemberModel = getModel('member'); |
1867 | 2065 | |
@@ -1876,15 +2074,18 @@ discard block |
||
1876 | 2074 | // Get user_id information |
1877 | 2075 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
1878 | 2076 | // Set an invalid user if no value returned |
1879 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
2077 | + if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) { |
|
2078 | + return $this->recordLoginError(-1, 'invalid_email_address'); |
|
2079 | + } |
|
1880 | 2080 | |
1881 | - } |
|
1882 | - else |
|
2081 | + } else |
|
1883 | 2082 | { |
1884 | 2083 | // Get user_id information |
1885 | 2084 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
1886 | 2085 | // Set an invalid user if no value returned |
1887 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
2086 | + if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) { |
|
2087 | + return $this->recordLoginError(-1, 'invalid_user_id'); |
|
2088 | + } |
|
1888 | 2089 | } |
1889 | 2090 | |
1890 | 2091 | $output = executeQuery('member.getLoginCountByIp', $args); |
@@ -1896,14 +2097,18 @@ discard block |
||
1896 | 2097 | if($term < $config->max_error_count_time) |
1897 | 2098 | { |
1898 | 2099 | $term = $config->max_error_count_time - $term; |
1899 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
1900 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
1901 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
1902 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
2100 | + if($term < 60) { |
|
2101 | + $term = intval($term).Context::getLang('unit_sec'); |
|
2102 | + } elseif(60 <= $term && $term < 3600) { |
|
2103 | + $term = intval($term/60).Context::getLang('unit_min'); |
|
2104 | + } elseif(3600 <= $term && $term < 86400) { |
|
2105 | + $term = intval($term/3600).Context::getLang('unit_hour'); |
|
2106 | + } else { |
|
2107 | + $term = intval($term/86400).Context::getLang('unit_day'); |
|
2108 | + } |
|
1903 | 2109 | |
1904 | 2110 | return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
1905 | - } |
|
1906 | - else |
|
2111 | + } else |
|
1907 | 2112 | { |
1908 | 2113 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
1909 | 2114 | $output = executeQuery('member.deleteLoginCountByIp', $args); |
@@ -1930,7 +2135,9 @@ discard block |
||
1930 | 2135 | return new BaseObject(-1,'msg_user_denied'); |
1931 | 2136 | } |
1932 | 2137 | // Notify if denied_date is less than the current time |
1933 | - if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
2138 | + if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) { |
|
2139 | + return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
2140 | + } |
|
1934 | 2141 | // Update the latest login time |
1935 | 2142 | $args->member_srl = $this->memberInfo->member_srl; |
1936 | 2143 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1979,7 +2186,9 @@ discard block |
||
1979 | 2186 | } |
1980 | 2187 | // Call a trigger after successfully log-in (after) |
1981 | 2188 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
1982 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
2189 | + if(!$trigger_output->toBool()) { |
|
2190 | + return $trigger_output; |
|
2191 | + } |
|
1983 | 2192 | // When user checked to use auto-login |
1984 | 2193 | if($keep_signed) |
1985 | 2194 | { |
@@ -1993,7 +2202,9 @@ discard block |
||
1993 | 2202 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
1994 | 2203 | executeQuery('member.deleteAutologin', $autologin_args); |
1995 | 2204 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
1996 | - if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
2205 | + if($autologin_output->toBool()) { |
|
2206 | + setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
2207 | + } |
|
1997 | 2208 | } |
1998 | 2209 | if($this->memberInfo->is_admin == 'Y') |
1999 | 2210 | { |
@@ -2082,7 +2293,9 @@ discard block |
||
2082 | 2293 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
2083 | 2294 | { |
2084 | 2295 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
2085 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
2296 | + if(!is_array($member_popup_menu_list)) { |
|
2297 | + $member_popup_menu_list = array(); |
|
2298 | + } |
|
2086 | 2299 | |
2087 | 2300 | $obj = new stdClass; |
2088 | 2301 | $obj->url = $url; |
@@ -2101,35 +2314,54 @@ discard block |
||
2101 | 2314 | { |
2102 | 2315 | // Call a trigger (before) |
2103 | 2316 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
2104 | - if(!$output->toBool()) return $output; |
|
2317 | + if(!$output->toBool()) { |
|
2318 | + return $output; |
|
2319 | + } |
|
2105 | 2320 | // Terms and Conditions portion of the information set up by members reaffirmed |
2106 | 2321 | $oModuleModel = getModel('module'); |
2107 | 2322 | $config = $oModuleModel->getModuleConfig('member'); |
2108 | 2323 | |
2109 | 2324 | $logged_info = Context::get('logged_info'); |
2110 | 2325 | // If the date of the temporary restrictions limit further information on the date of |
2111 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
2326 | + if($config->limit_day) { |
|
2327 | + $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
2328 | + } |
|
2112 | 2329 | |
2113 | 2330 | $args->member_srl = getNextSequence(); |
2114 | 2331 | $args->list_order = -1 * $args->member_srl; |
2115 | 2332 | |
2116 | 2333 | // Execute insert or update depending on the value of member_srl |
2117 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2334 | + if(!$args->user_id) { |
|
2335 | + $args->user_id = 't'.$args->member_srl; |
|
2336 | + } |
|
2118 | 2337 | // Enter the user's identity changed to lowercase |
2119 | - else $args->user_id = strtolower($args->user_id); |
|
2120 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
2121 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
2338 | + else { |
|
2339 | + $args->user_id = strtolower($args->user_id); |
|
2340 | + } |
|
2341 | + if(!$args->user_name) { |
|
2342 | + $args->user_name = $args->member_srl; |
|
2343 | + } |
|
2344 | + if(!$args->nick_name) { |
|
2345 | + $args->nick_name = $args->member_srl; |
|
2346 | + } |
|
2122 | 2347 | |
2123 | 2348 | // Control of essential parameters |
2124 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
2125 | - if($args->denied!='Y') $args->denied = 'N'; |
|
2126 | - if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y'; |
|
2349 | + if($args->allow_mailing!='Y') { |
|
2350 | + $args->allow_mailing = 'N'; |
|
2351 | + } |
|
2352 | + if($args->denied!='Y') { |
|
2353 | + $args->denied = 'N'; |
|
2354 | + } |
|
2355 | + if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) { |
|
2356 | + $args->allow_message = 'Y'; |
|
2357 | + } |
|
2127 | 2358 | |
2128 | 2359 | if($logged_info->is_admin == 'Y') |
2129 | 2360 | { |
2130 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
2131 | - } |
|
2132 | - else |
|
2361 | + if($args->is_admin!='Y') { |
|
2362 | + $args->is_admin = 'N'; |
|
2363 | + } |
|
2364 | + } else |
|
2133 | 2365 | { |
2134 | 2366 | unset($args->is_admin); |
2135 | 2367 | } |
@@ -2142,8 +2374,12 @@ discard block |
||
2142 | 2374 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2143 | 2375 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2144 | 2376 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2145 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2146 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
2377 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) { |
|
2378 | + $args->homepage = 'http://'.$args->homepage; |
|
2379 | + } |
|
2380 | + if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) { |
|
2381 | + $args->blog = 'http://'.$args->blog; |
|
2382 | + } |
|
2147 | 2383 | |
2148 | 2384 | // Create a model object |
2149 | 2385 | $oMemberModel = getModel('member'); |
@@ -2157,8 +2393,7 @@ discard block |
||
2157 | 2393 | return new BaseObject(-1, $message[$config->password_strength]); |
2158 | 2394 | } |
2159 | 2395 | $args->password = $oMemberModel->hashPassword($args->password); |
2160 | - } |
|
2161 | - elseif(!$args->password) |
|
2396 | + } elseif(!$args->password) |
|
2162 | 2397 | { |
2163 | 2398 | unset($args->password); |
2164 | 2399 | } |
@@ -2166,8 +2401,7 @@ discard block |
||
2166 | 2401 | if($args->find_account_answer && !$password_is_hashed) |
2167 | 2402 | { |
2168 | 2403 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
2169 | - } |
|
2170 | - elseif(!$args->find_account_answer) |
|
2404 | + } elseif(!$args->find_account_answer) |
|
2171 | 2405 | { |
2172 | 2406 | unset($args->find_account_answer); |
2173 | 2407 | } |
@@ -2208,8 +2442,12 @@ discard block |
||
2208 | 2442 | // Insert data into the DB |
2209 | 2443 | $args->list_order = -1 * $args->member_srl; |
2210 | 2444 | |
2211 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2212 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
2445 | + if(!$args->user_id) { |
|
2446 | + $args->user_id = 't'.$args->member_srl; |
|
2447 | + } |
|
2448 | + if(!$args->user_name) { |
|
2449 | + $args->user_name = $args->member_srl; |
|
2450 | + } |
|
2213 | 2451 | |
2214 | 2452 | $oDB = &DB::getInstance(); |
2215 | 2453 | $oDB->begin(); |
@@ -2221,8 +2459,11 @@ discard block |
||
2221 | 2459 | return $output; |
2222 | 2460 | } |
2223 | 2461 | |
2224 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2225 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2462 | + if(is_array($args->group_srl_list)) { |
|
2463 | + $group_srl_list = $args->group_srl_list; |
|
2464 | + } else { |
|
2465 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2466 | + } |
|
2226 | 2467 | // If no value is entered the default group, the value of group registration |
2227 | 2468 | if(!$args->group_srl_list) |
2228 | 2469 | { |
@@ -2239,8 +2480,7 @@ discard block |
||
2239 | 2480 | } |
2240 | 2481 | } |
2241 | 2482 | // If the value is the value of the group entered the group registration |
2242 | - } |
|
2243 | - else |
|
2483 | + } else |
|
2244 | 2484 | { |
2245 | 2485 | for($i=0;$i<count($group_srl_list);$i++) |
2246 | 2486 | { |
@@ -2301,27 +2541,39 @@ discard block |
||
2301 | 2541 | { |
2302 | 2542 | // Call a trigger (before) |
2303 | 2543 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
2304 | - if(!$output->toBool()) return $output; |
|
2544 | + if(!$output->toBool()) { |
|
2545 | + return $output; |
|
2546 | + } |
|
2305 | 2547 | // Create a model object |
2306 | 2548 | $oMemberModel = getModel('member'); |
2307 | 2549 | |
2308 | 2550 | $logged_info = Context::get('logged_info'); |
2309 | 2551 | // Get what you want to modify the original information |
2310 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2552 | + if(!$this->memberInfo) { |
|
2553 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2554 | + } |
|
2311 | 2555 | // Control of essential parameters |
2312 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
2313 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
2556 | + if($args->allow_mailing!='Y') { |
|
2557 | + $args->allow_mailing = 'N'; |
|
2558 | + } |
|
2559 | + if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) { |
|
2560 | + $args->allow_message = 'Y'; |
|
2561 | + } |
|
2314 | 2562 | |
2315 | 2563 | if($logged_info->is_admin == 'Y') |
2316 | 2564 | { |
2317 | - if($args->denied!='Y') $args->denied = 'N'; |
|
2318 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
2319 | - } |
|
2320 | - else |
|
2565 | + if($args->denied!='Y') { |
|
2566 | + $args->denied = 'N'; |
|
2567 | + } |
|
2568 | + if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) { |
|
2569 | + $args->is_admin = 'N'; |
|
2570 | + } |
|
2571 | + } else |
|
2321 | 2572 | { |
2322 | 2573 | unset($args->is_admin); |
2323 | - if($is_admin == false) |
|
2324 | - unset($args->denied); |
|
2574 | + if($is_admin == false) { |
|
2575 | + unset($args->denied); |
|
2576 | + } |
|
2325 | 2577 | if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
2326 | 2578 | { |
2327 | 2579 | return $this->stop('msg_invalid_request'); |
@@ -2329,13 +2581,19 @@ discard block |
||
2329 | 2581 | } |
2330 | 2582 | |
2331 | 2583 | // Sanitize user ID, username, nickname, homepage, blog |
2332 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2584 | + if($args->user_id) { |
|
2585 | + $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2586 | + } |
|
2333 | 2587 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2334 | 2588 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2335 | 2589 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2336 | 2590 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2337 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2338 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
2591 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) { |
|
2592 | + $args->homepage = 'http://'.$args->homepage; |
|
2593 | + } |
|
2594 | + if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) { |
|
2595 | + $args->blog = 'http://'.$args->blog; |
|
2596 | + } |
|
2339 | 2597 | |
2340 | 2598 | // check member identifier form |
2341 | 2599 | $config = $oMemberModel->getMemberConfig(); |
@@ -2352,8 +2610,7 @@ discard block |
||
2352 | 2610 | return new BaseObject(-1,'msg_exists_email_address'); |
2353 | 2611 | } |
2354 | 2612 | $args->email_address = $orgMemberInfo->email_address; |
2355 | - } |
|
2356 | - else |
|
2613 | + } else |
|
2357 | 2614 | { |
2358 | 2615 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
2359 | 2616 | if($member_srl && $args->member_srl != $member_srl) |
@@ -2410,16 +2667,14 @@ discard block |
||
2410 | 2667 | return new BaseObject(-1, $message[$config->password_strength]); |
2411 | 2668 | } |
2412 | 2669 | $args->password = $oMemberModel->hashPassword($args->password); |
2413 | - } |
|
2414 | - else |
|
2670 | + } else |
|
2415 | 2671 | { |
2416 | 2672 | $args->password = $orgMemberInfo->password; |
2417 | 2673 | } |
2418 | 2674 | |
2419 | 2675 | if($args->find_account_answer) { |
2420 | 2676 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
2421 | - } |
|
2422 | - else |
|
2677 | + } else |
|
2423 | 2678 | { |
2424 | 2679 | $oPassword = new Password(); |
2425 | 2680 | $hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer); |
@@ -2431,13 +2686,23 @@ discard block |
||
2431 | 2686 | } |
2432 | 2687 | } |
2433 | 2688 | |
2434 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
2435 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
2436 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
2689 | + if(!$args->user_name) { |
|
2690 | + $args->user_name = $orgMemberInfo->user_name; |
|
2691 | + } |
|
2692 | + if(!$args->user_id) { |
|
2693 | + $args->user_id = $orgMemberInfo->user_id; |
|
2694 | + } |
|
2695 | + if(!$args->nick_name) { |
|
2696 | + $args->nick_name = $orgMemberInfo->nick_name; |
|
2697 | + } |
|
2437 | 2698 | |
2438 | 2699 | // BUGFIX 관리자가 회원 메모를 삭제할수 없는 문제 수정 https://github.com/xpressengine/xe-core/issues/2290 |
2439 | - if(!isset($args->description)) $args->description = $orgMemberInfo->description; |
|
2440 | - if(!$args->birthday) $args->birthday = ''; |
|
2700 | + if(!isset($args->description)) { |
|
2701 | + $args->description = $orgMemberInfo->description; |
|
2702 | + } |
|
2703 | + if(!$args->birthday) { |
|
2704 | + $args->birthday = ''; |
|
2705 | + } |
|
2441 | 2706 | |
2442 | 2707 | $output = executeQuery('member.updateMember', $args); |
2443 | 2708 | |
@@ -2449,8 +2714,11 @@ discard block |
||
2449 | 2714 | |
2450 | 2715 | if($args->group_srl_list) |
2451 | 2716 | { |
2452 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2453 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2717 | + if(is_array($args->group_srl_list)) { |
|
2718 | + $group_srl_list = $args->group_srl_list; |
|
2719 | + } else { |
|
2720 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2721 | + } |
|
2454 | 2722 | // If the group information, group information changes |
2455 | 2723 | if(count($group_srl_list) > 0) |
2456 | 2724 | { |
@@ -2493,7 +2761,9 @@ discard block |
||
2493 | 2761 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
2494 | 2762 | |
2495 | 2763 | // Save Session |
2496 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2764 | + if(!$this->memberInfo) { |
|
2765 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2766 | + } |
|
2497 | 2767 | $logged_info = Context::get('logged_info'); |
2498 | 2768 | |
2499 | 2769 | $output->add('member_srl', $args->member_srl); |
@@ -2519,8 +2789,7 @@ discard block |
||
2519 | 2789 | } |
2520 | 2790 | |
2521 | 2791 | $args->password = $oMemberModel->hashPassword($args->password); |
2522 | - } |
|
2523 | - else if($args->hashed_password) |
|
2792 | + } else if($args->hashed_password) |
|
2524 | 2793 | { |
2525 | 2794 | $args->password = $args->hashed_password; |
2526 | 2795 | } |
@@ -2555,7 +2824,9 @@ discard block |
||
2555 | 2824 | $trigger_obj = new stdClass(); |
2556 | 2825 | $trigger_obj->member_srl = $member_srl; |
2557 | 2826 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
2558 | - if(!$output->toBool()) return $output; |
|
2827 | + if(!$output->toBool()) { |
|
2828 | + return $output; |
|
2829 | + } |
|
2559 | 2830 | // Create a model object |
2560 | 2831 | $oMemberModel = getModel('member'); |
2561 | 2832 | // Bringing the user's information |
@@ -2564,9 +2835,13 @@ discard block |
||
2564 | 2835 | $columnList = array('member_srl', 'is_admin'); |
2565 | 2836 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
2566 | 2837 | } |
2567 | - if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
2838 | + if(!$this->memberInfo) { |
|
2839 | + return new BaseObject(-1, 'msg_not_exists_member'); |
|
2840 | + } |
|
2568 | 2841 | // If managers can not be deleted |
2569 | - if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
2842 | + if($this->memberInfo->is_admin == 'Y') { |
|
2843 | + return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
2844 | + } |
|
2570 | 2845 | |
2571 | 2846 | $oDB = &DB::getInstance(); |
2572 | 2847 | $oDB->begin(); |
@@ -2630,7 +2905,9 @@ discard block |
||
2630 | 2905 | */ |
2631 | 2906 | function destroySessionInfo() |
2632 | 2907 | { |
2633 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
2908 | + if(!$_SESSION || !is_array($_SESSION)) { |
|
2909 | + return; |
|
2910 | + } |
|
2634 | 2911 | |
2635 | 2912 | $memberInfo = Context::get('logged_info'); |
2636 | 2913 | $memberSrl = $memberInfo->member_srl; |
@@ -2669,8 +2946,9 @@ discard block |
||
2669 | 2946 | } |
2670 | 2947 | $maxLevel = 0; |
2671 | 2948 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
2672 | - if(count($resultGroup) > 0) |
|
2673 | - $maxLevel = max(array_flip($resultGroup)); |
|
2949 | + if(count($resultGroup) > 0) { |
|
2950 | + $maxLevel = max(array_flip($resultGroup)); |
|
2951 | + } |
|
2674 | 2952 | |
2675 | 2953 | if($maxLevel > 0) |
2676 | 2954 | { |
@@ -2687,16 +2965,22 @@ discard block |
||
2687 | 2965 | |
2688 | 2966 | function procMemberModifyEmailAddress() |
2689 | 2967 | { |
2690 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
2968 | + if(!Context::get('is_logged')) { |
|
2969 | + return $this->stop('msg_not_logged'); |
|
2970 | + } |
|
2691 | 2971 | |
2692 | 2972 | $member_info = Context::get('logged_info'); |
2693 | 2973 | $newEmail = Context::get('email_address'); |
2694 | 2974 | |
2695 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
2975 | + if(!$newEmail) { |
|
2976 | + return $this->stop('msg_invalid_request'); |
|
2977 | + } |
|
2696 | 2978 | |
2697 | 2979 | $oMemberModel = getModel('member'); |
2698 | 2980 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
2699 | - if($member_srl) return new BaseObject(-1,'msg_exists_email_address'); |
|
2981 | + if($member_srl) { |
|
2982 | + return new BaseObject(-1,'msg_exists_email_address'); |
|
2983 | + } |
|
2700 | 2984 | |
2701 | 2985 | if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
2702 | 2986 | { |
@@ -2724,7 +3008,9 @@ discard block |
||
2724 | 3008 | $member_config = $oModuleModel->getModuleConfig('member'); |
2725 | 3009 | |
2726 | 3010 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
2727 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
3011 | + if(!is_dir($tpl_path)) { |
|
3012 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
3013 | + } |
|
2728 | 3014 | |
2729 | 3015 | global $lang; |
2730 | 3016 | |
@@ -2760,7 +3046,9 @@ discard block |
||
2760 | 3046 | { |
2761 | 3047 | $member_srl = Context::get('member_srl'); |
2762 | 3048 | $auth_key = Context::get('auth_key'); |
2763 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
3049 | + if(!$member_srl || !$auth_key) { |
|
3050 | + return $this->stop('msg_invalid_request'); |
|
3051 | + } |
|
2764 | 3052 | |
2765 | 3053 | // Test logs for finding password by user_id and authkey |
2766 | 3054 | $args = new stdClass; |
@@ -2769,7 +3057,9 @@ discard block |
||
2769 | 3057 | $output = executeQuery('member.getAuthMail', $args); |
2770 | 3058 | if(!$output->toBool() || $output->data->auth_key != $auth_key) |
2771 | 3059 | { |
2772 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
3060 | + if(strlen($output->data->auth_key) !== strlen($auth_key)) { |
|
3061 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
3062 | + } |
|
2773 | 3063 | return $this->stop('msg_invalid_modify_email_auth_key'); |
2774 | 3064 | } |
2775 | 3065 | |
@@ -2778,7 +3068,9 @@ discard block |
||
2778 | 3068 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
2779 | 3069 | |
2780 | 3070 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
2781 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
3071 | + if(!$output->toBool()) { |
|
3072 | + return $this->stop($output->getMessage()); |
|
3073 | + } |
|
2782 | 3074 | |
2783 | 3075 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
2784 | 3076 | executeQuery('member.deleteAuthChangeEmailAddress',$args); |
@@ -2799,7 +3091,9 @@ discard block |
||
2799 | 3091 | **/ |
2800 | 3092 | function triggerGetDocumentMenu(&$menu_list) |
2801 | 3093 | { |
2802 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
3094 | + if(!Context::get('is_logged')) { |
|
3095 | + return new BaseObject(); |
|
3096 | + } |
|
2803 | 3097 | |
2804 | 3098 | $logged_info = Context::get('logged_info'); |
2805 | 3099 | $document_srl = Context::get('target_srl'); |
@@ -2810,8 +3104,12 @@ discard block |
||
2810 | 3104 | $member_srl = $oDocument->get('member_srl'); |
2811 | 3105 | $module_srl = $oDocument->get('module_srl'); |
2812 | 3106 | |
2813 | - if(!$member_srl) return new BaseObject(); |
|
2814 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
3107 | + if(!$member_srl) { |
|
3108 | + return new BaseObject(); |
|
3109 | + } |
|
3110 | + if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
3111 | + return new BaseObject(); |
|
3112 | + } |
|
2815 | 3113 | |
2816 | 3114 | $oDocumentController = getController('document'); |
2817 | 3115 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2829,7 +3127,9 @@ discard block |
||
2829 | 3127 | **/ |
2830 | 3128 | function triggerGetCommentMenu(&$menu_list) |
2831 | 3129 | { |
2832 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
3130 | + if(!Context::get('is_logged')) { |
|
3131 | + return new BaseObject(); |
|
3132 | + } |
|
2833 | 3133 | |
2834 | 3134 | $logged_info = Context::get('logged_info'); |
2835 | 3135 | $comment_srl = Context::get('target_srl'); |
@@ -2840,8 +3140,12 @@ discard block |
||
2840 | 3140 | $module_srl = $oComment->get('module_srl'); |
2841 | 3141 | $member_srl = $oComment->get('member_srl'); |
2842 | 3142 | |
2843 | - if(!$member_srl) return new BaseObject(); |
|
2844 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
3143 | + if(!$member_srl) { |
|
3144 | + return new BaseObject(); |
|
3145 | + } |
|
3146 | + if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
3147 | + return new BaseObject(); |
|
3148 | + } |
|
2845 | 3149 | |
2846 | 3150 | $oCommentController = getController('comment'); |
2847 | 3151 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2857,7 +3161,9 @@ discard block |
||
2857 | 3161 | **/ |
2858 | 3162 | function procMemberSpammerManage() |
2859 | 3163 | { |
2860 | - if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted'); |
|
3164 | + if(!Context::get('is_logged')) { |
|
3165 | + return new BaseObject(-1,'msg_not_permitted'); |
|
3166 | + } |
|
2861 | 3167 | |
2862 | 3168 | $logged_info = Context::get('logged_info'); |
2863 | 3169 | $member_srl = Context::get('member_srl'); |
@@ -2865,8 +3171,9 @@ discard block |
||
2865 | 3171 | $cnt_loop = Context::get('cnt_loop'); |
2866 | 3172 | $proc_type = Context::get('proc_type'); |
2867 | 3173 | $isMoveToTrash = true; |
2868 | - if($proc_type == "delete") |
|
2869 | - $isMoveToTrash = false; |
|
3174 | + if($proc_type == "delete") { |
|
3175 | + $isMoveToTrash = false; |
|
3176 | + } |
|
2870 | 3177 | |
2871 | 3178 | // check grant |
2872 | 3179 | $oModuleModel = getModel('module'); |
@@ -2874,7 +3181,9 @@ discard block |
||
2874 | 3181 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
2875 | 3182 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
2876 | 3183 | |
2877 | - if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted'); |
|
3184 | + if(!$grant->manager) { |
|
3185 | + return new BaseObject(-1,'msg_not_permitted'); |
|
3186 | + } |
|
2878 | 3187 | |
2879 | 3188 | $proc_msg = ""; |
2880 | 3189 | |
@@ -2883,11 +3192,13 @@ discard block |
||
2883 | 3192 | |
2884 | 3193 | // delete or trash destination |
2885 | 3194 | // proc member |
2886 | - if($cnt_loop == 1) |
|
2887 | - $this->_spammerMember($member_srl); |
|
3195 | + if($cnt_loop == 1) { |
|
3196 | + $this->_spammerMember($member_srl); |
|
3197 | + } |
|
2888 | 3198 | // proc document and comment |
2889 | - elseif($cnt_loop>1) |
|
2890 | - $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
3199 | + elseif($cnt_loop>1) { |
|
3200 | + $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
3201 | + } |
|
2891 | 3202 | |
2892 | 3203 | // get destination count |
2893 | 3204 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
@@ -2895,13 +3206,16 @@ discard block |
||
2895 | 3206 | |
2896 | 3207 | $total_count = Context::get('total_count'); |
2897 | 3208 | $remain_count = $cnt_document + $cnt_comment; |
2898 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
3209 | + if($cnt_loop == 1) { |
|
3210 | + $total_count = $remain_count; |
|
3211 | + } |
|
2899 | 3212 | |
2900 | 3213 | // get progress percent |
2901 | - if($total_count > 0) |
|
2902 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
2903 | - else |
|
2904 | - $progress = 100; |
|
3214 | + if($total_count > 0) { |
|
3215 | + $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
3216 | + } else { |
|
3217 | + $progress = 100; |
|
3218 | + } |
|
2905 | 3219 | |
2906 | 3220 | $this->add('total_count', $total_count); |
2907 | 3221 | $this->add('remain_count', $remain_count); |
@@ -2943,7 +3257,10 @@ discard block |
||
2943 | 3257 | $args->nick_name = $member_info->nick_name; |
2944 | 3258 | $args->denied = "Y"; |
2945 | 3259 | $args->description = trim( $member_info->description ); |
2946 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
3260 | + if( $args->description != "" ) { |
|
3261 | + $args->description .= "\n"; |
|
3262 | + } |
|
3263 | + // add new line |
|
2947 | 3264 | |
2948 | 3265 | $args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]"; |
2949 | 3266 | |
@@ -2988,8 +3305,11 @@ discard block |
||
2988 | 3305 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
2989 | 3306 | if($documentList) { |
2990 | 3307 | foreach($documentList as $v) { |
2991 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
2992 | - else $oDocumentController->deleteDocument($v->document_srl); |
|
3308 | + if($isMoveToTrash) { |
|
3309 | + $oDocumentController->moveDocumentToTrash($v); |
|
3310 | + } else { |
|
3311 | + $oDocumentController->deleteDocument($v->document_srl); |
|
3312 | + } |
|
2993 | 3313 | } |
2994 | 3314 | } |
2995 | 3315 | } |