@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | * @param int $member_srl |
758 | 758 | * @param object $target_file |
759 | 759 | * |
760 | - * @return void |
|
760 | + * @return BaseObject |
|
761 | 761 | */ |
762 | 762 | function insertProfileImage($member_srl, $target_file) |
763 | 763 | { |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | * @param int $member_srl |
865 | 865 | * @param object $target_file |
866 | 866 | * |
867 | - * @return void |
|
867 | + * @return BaseObject |
|
868 | 868 | */ |
869 | 869 | function insertImageName($member_srl, $target_file) |
870 | 870 | { |
@@ -952,7 +952,7 @@ discard block |
||
952 | 952 | /** |
953 | 953 | * Delete Image name |
954 | 954 | * |
955 | - * @return void |
|
955 | + * @return BaseObject |
|
956 | 956 | */ |
957 | 957 | function procMemberDeleteImageName($_memberSrl = 0) |
958 | 958 | { |
@@ -1007,7 +1007,7 @@ discard block |
||
1007 | 1007 | * @param int $member_srl |
1008 | 1008 | * @param object $target_file |
1009 | 1009 | * |
1010 | - * @return void |
|
1010 | + * @return BaseObject |
|
1011 | 1011 | */ |
1012 | 1012 | function insertImageMark($member_srl, $target_file) |
1013 | 1013 | { |
@@ -1276,7 +1276,7 @@ discard block |
||
1276 | 1276 | * Execute finding ID/Passoword |
1277 | 1277 | * When clicking the link in the verification email, a method is called to change the old password and to authenticate it |
1278 | 1278 | * |
1279 | - * @return void|BaseObject (void : success, BaseObject : fail) |
|
1279 | + * @return ModuleObject|null (void : success, BaseObject : fail) |
|
1280 | 1280 | */ |
1281 | 1281 | function procMemberAuthAccount() |
1282 | 1282 | { |
@@ -1507,6 +1507,9 @@ discard block |
||
1507 | 1507 | $this->setRedirectUrl($returnUrl); |
1508 | 1508 | } |
1509 | 1509 | |
1510 | + /** |
|
1511 | + * @param stdClass $auth_args |
|
1512 | + */ |
|
1510 | 1513 | function _sendAuthMail($auth_args, $member_info) |
1511 | 1514 | { |
1512 | 1515 | $oMemberModel = getModel('member'); |
@@ -1639,7 +1642,7 @@ discard block |
||
1639 | 1642 | * @param int $member_srl |
1640 | 1643 | * @param string $signature |
1641 | 1644 | * |
1642 | - * @return void |
|
1645 | + * @return boolean|null |
|
1643 | 1646 | */ |
1644 | 1647 | function putSignature($member_srl, $signature) |
1645 | 1648 | { |
@@ -2041,6 +2044,8 @@ discard block |
||
2041 | 2044 | /** |
2042 | 2045 | * Logged method for providing a personalized menu |
2043 | 2046 | * Login information is used in the output widget, or personalized page |
2047 | + * @param string $act |
|
2048 | + * @param string $str |
|
2044 | 2049 | */ |
2045 | 2050 | function addMemberMenu($act, $str) |
2046 | 2051 | { |
@@ -2071,6 +2076,7 @@ discard block |
||
2071 | 2076 | |
2072 | 2077 | /** |
2073 | 2078 | * Add users to the member table |
2079 | + * @param stdClass $args |
|
2074 | 2080 | */ |
2075 | 2081 | function insertMember(&$args, $password_is_hashed = false) |
2076 | 2082 | { |
@@ -2271,6 +2277,7 @@ discard block |
||
2271 | 2277 | * Modify member information |
2272 | 2278 | * |
2273 | 2279 | * @param bool $is_admin , modified 2013-11-22 |
2280 | + * @param stdClass $args |
|
2274 | 2281 | */ |
2275 | 2282 | function updateMember($args, $is_admin = FALSE) |
2276 | 2283 | { |
@@ -2475,6 +2482,7 @@ discard block |
||
2475 | 2482 | |
2476 | 2483 | /** |
2477 | 2484 | * Modify member password |
2485 | + * @param stdClass $args |
|
2478 | 2486 | */ |
2479 | 2487 | function updateMemberPassword($args) |
2480 | 2488 | { |
@@ -2509,6 +2517,9 @@ discard block |
||
2509 | 2517 | return $output; |
2510 | 2518 | } |
2511 | 2519 | |
2520 | + /** |
|
2521 | + * @param string $answer |
|
2522 | + */ |
|
2512 | 2523 | function updateFindAccountAnswer($member_srl, $answer) |
2513 | 2524 | { |
2514 | 2525 | $oPassword = new Password(); |
@@ -2768,7 +2779,7 @@ discard block |
||
2768 | 2779 | * |
2769 | 2780 | * @param array &$menu_list |
2770 | 2781 | * |
2771 | - * @return object |
|
2782 | + * @return BaseObject |
|
2772 | 2783 | **/ |
2773 | 2784 | function triggerGetDocumentMenu(&$menu_list) |
2774 | 2785 | { |
@@ -2798,7 +2809,7 @@ discard block |
||
2798 | 2809 | * |
2799 | 2810 | * @param array &$menu_list |
2800 | 2811 | * |
2801 | - * @return object |
|
2812 | + * @return BaseObject |
|
2802 | 2813 | **/ |
2803 | 2814 | function triggerGetCommentMenu(&$menu_list) |
2804 | 2815 | { |
@@ -2826,7 +2837,7 @@ discard block |
||
2826 | 2837 | /** |
2827 | 2838 | * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string |
2828 | 2839 | * |
2829 | - * @return object |
|
2840 | + * @return BaseObject |
|
2830 | 2841 | **/ |
2831 | 2842 | function procMemberSpammerManage() |
2832 | 2843 | { |
@@ -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', '', $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', '', $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); |
@@ -767,14 +767,14 @@ discard block |
||
767 | 767 | $max_height = $config->profile_image_max_height; |
768 | 768 | $max_filesize = $config->profile_image_max_filesize; |
769 | 769 | |
770 | - Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
|
770 | + Context::loadLang(_XE_PATH_.'modules/file/lang'); |
|
771 | 771 | |
772 | 772 | // Get file information |
773 | 773 | FileHandler::clearStatCache($target_file); |
774 | 774 | list($width, $height, $type) = @getimagesize($target_file); |
775 | - if(IMAGETYPE_PNG == $type) $ext = 'png'; |
|
776 | - elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
777 | - elseif(IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
775 | + if (IMAGETYPE_PNG == $type) $ext = 'png'; |
|
776 | + elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
777 | + elseif (IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
778 | 778 | else |
779 | 779 | { |
780 | 780 | return $this->stop('msg_not_uploaded_profile_image'); |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | $target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext); |
787 | 787 | |
788 | 788 | // Convert if the image size is larger than a given size or if the format is not a gif |
789 | - if(($width > $max_width || $height > $max_height ) && $type != 1) |
|
789 | + if (($width > $max_width || $height > $max_height) && $type != 1) |
|
790 | 790 | { |
791 | 791 | $temp_filename = sprintf('files/cache/tmp/profile_image_%d.%s', $member_srl, $ext); |
792 | 792 | FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, $ext); |
@@ -794,10 +794,10 @@ discard block |
||
794 | 794 | // 파일 용량 제한 |
795 | 795 | FileHandler::clearStatCache($temp_filename); |
796 | 796 | $filesize = filesize($temp_filename); |
797 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
797 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
798 | 798 | { |
799 | 799 | FileHandler::removeFile($temp_filename); |
800 | - return $this->stop(implode(' ' , array( |
|
800 | + return $this->stop(implode(' ', array( |
|
801 | 801 | Context::getLang('msg_not_uploaded_profile_image'), |
802 | 802 | Context::getLang('msg_exceeds_limit_size') |
803 | 803 | ))); |
@@ -811,9 +811,9 @@ discard block |
||
811 | 811 | { |
812 | 812 | // 파일 용량 제한 |
813 | 813 | $filesize = filesize($target_file); |
814 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
814 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
815 | 815 | { |
816 | - return $this->stop(implode(' ' , array( |
|
816 | + return $this->stop(implode(' ', array( |
|
817 | 817 | Context::getLang('msg_not_uploaded_profile_image'), |
818 | 818 | Context::getLang('msg_exceeds_limit_size') |
819 | 819 | ))); |
@@ -836,20 +836,20 @@ discard block |
||
836 | 836 | { |
837 | 837 | // Check if the file is successfully uploaded |
838 | 838 | $file = $_FILES['image_name']; |
839 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
839 | + if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
840 | 840 | // Ignore if member_srl is invalid or doesn't exist. |
841 | 841 | $member_srl = Context::get('member_srl'); |
842 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
842 | + if (!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
843 | 843 | |
844 | 844 | $logged_info = Context::get('logged_info'); |
845 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
845 | + if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
846 | 846 | // Return if member module is set not to use an image name or the user is not an administrator ; |
847 | 847 | $oMemberModel = getModel('member'); |
848 | 848 | $config = $oMemberModel->getMemberConfig(); |
849 | - if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
849 | + if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
850 | 850 | |
851 | 851 | $output = $this->insertImageName($member_srl, $file['tmp_name']); |
852 | - if(!$output->toBool()) return $output; |
|
852 | + if (!$output->toBool()) return $output; |
|
853 | 853 | |
854 | 854 | // Page refresh |
855 | 855 | //$this->setRefreshPage(); |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | $max_height = $config->image_name_max_height; |
875 | 875 | $max_filesize = $config->image_name_max_filesize; |
876 | 876 | |
877 | - Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
|
877 | + Context::loadLang(_XE_PATH_.'modules/file/lang'); |
|
878 | 878 | |
879 | 879 | // Get a target path to save |
880 | 880 | $target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl)); |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | // Get file information |
885 | 885 | list($width, $height, $type) = @getimagesize($target_file); |
886 | 886 | // Convert if the image size is larger than a given size or if the format is not a gif |
887 | - if($width > $max_width || $height > $max_height || $type!=1) |
|
887 | + if ($width > $max_width || $height > $max_height || $type != 1) |
|
888 | 888 | { |
889 | 889 | $temp_filename = sprintf('files/cache/tmp/image_name_%d.gif', $member_srl, $ext); |
890 | 890 | FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif'); |
@@ -892,10 +892,10 @@ discard block |
||
892 | 892 | // 파일 용량 제한 |
893 | 893 | FileHandler::clearStatCache($temp_filename); |
894 | 894 | $filesize = filesize($temp_filename); |
895 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
895 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
896 | 896 | { |
897 | 897 | FileHandler::removeFile($temp_filename); |
898 | - return $this->stop(implode(' ' , array( |
|
898 | + return $this->stop(implode(' ', array( |
|
899 | 899 | Context::getLang('msg_not_uploaded_image_name'), |
900 | 900 | Context::getLang('msg_exceeds_limit_size') |
901 | 901 | ))); |
@@ -909,9 +909,9 @@ discard block |
||
909 | 909 | { |
910 | 910 | // 파일 용량 제한 |
911 | 911 | $filesize = filesize($target_file); |
912 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
912 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
913 | 913 | { |
914 | - return $this->stop(implode(' ' , array( |
|
914 | + return $this->stop(implode(' ', array( |
|
915 | 915 | Context::getLang('msg_not_uploaded_image_name'), |
916 | 916 | Context::getLang('msg_exceeds_limit_size') |
917 | 917 | ))); |
@@ -933,20 +933,20 @@ discard block |
||
933 | 933 | function procMemberDeleteProfileImage($_memberSrl = 0) |
934 | 934 | { |
935 | 935 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
936 | - if(!$member_srl) |
|
936 | + if (!$member_srl) |
|
937 | 937 | { |
938 | - return new BaseObject(0,'success'); |
|
938 | + return new BaseObject(0, 'success'); |
|
939 | 939 | } |
940 | 940 | |
941 | 941 | $logged_info = Context::get('logged_info'); |
942 | 942 | |
943 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
943 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
944 | 944 | { |
945 | 945 | $oMemberModel = getModel('member'); |
946 | 946 | $profile_image = $oMemberModel->getProfileImage($member_srl); |
947 | 947 | FileHandler::removeFile($profile_image->file); |
948 | 948 | } |
949 | - return new BaseObject(0,'success'); |
|
949 | + return new BaseObject(0, 'success'); |
|
950 | 950 | } |
951 | 951 | |
952 | 952 | /** |
@@ -957,20 +957,20 @@ discard block |
||
957 | 957 | function procMemberDeleteImageName($_memberSrl = 0) |
958 | 958 | { |
959 | 959 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
960 | - if(!$member_srl) |
|
960 | + if (!$member_srl) |
|
961 | 961 | { |
962 | - return new BaseObject(0,'success'); |
|
962 | + return new BaseObject(0, 'success'); |
|
963 | 963 | } |
964 | 964 | |
965 | 965 | $logged_info = Context::get('logged_info'); |
966 | 966 | |
967 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
967 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
968 | 968 | { |
969 | 969 | $oMemberModel = getModel('member'); |
970 | 970 | $image_name = $oMemberModel->getImageName($member_srl); |
971 | 971 | FileHandler::removeFile($image_name->file); |
972 | 972 | } |
973 | - return new BaseObject(0,'success'); |
|
973 | + return new BaseObject(0, 'success'); |
|
974 | 974 | } |
975 | 975 | |
976 | 976 | /** |
@@ -982,20 +982,20 @@ discard block |
||
982 | 982 | { |
983 | 983 | // Check if the file is successfully uploaded |
984 | 984 | $file = $_FILES['image_mark']; |
985 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
985 | + if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
986 | 986 | // Ignore if member_srl is invalid or doesn't exist. |
987 | 987 | $member_srl = Context::get('member_srl'); |
988 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
988 | + if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
989 | 989 | |
990 | 990 | $logged_info = Context::get('logged_info'); |
991 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
991 | + if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
992 | 992 | // Membership in the images mark the module using the ban was set by an administrator or return; |
993 | 993 | $oMemberModel = getModel('member'); |
994 | 994 | $config = $oMemberModel->getMemberConfig(); |
995 | - if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
995 | + if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
996 | 996 | |
997 | 997 | $this->insertImageMark($member_srl, $file['tmp_name']); |
998 | - if(!$output->toBool()) return $output; |
|
998 | + if (!$output->toBool()) return $output; |
|
999 | 999 | |
1000 | 1000 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
1001 | 1001 | $this->setRedirectUrl($returnUrl); |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | $max_height = $config->image_mark_max_height; |
1018 | 1018 | $max_filesize = $config->image_mark_max_filesize; |
1019 | 1019 | |
1020 | - Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
|
1020 | + Context::loadLang(_XE_PATH_.'modules/file/lang'); |
|
1021 | 1021 | |
1022 | 1022 | $target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); |
1023 | 1023 | FileHandler::makeDir($target_path); |
@@ -1026,7 +1026,7 @@ discard block |
||
1026 | 1026 | // Get file information |
1027 | 1027 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
1028 | 1028 | |
1029 | - if($width > $max_width || $height > $max_height || $type!=1) |
|
1029 | + if ($width > $max_width || $height > $max_height || $type != 1) |
|
1030 | 1030 | { |
1031 | 1031 | $temp_filename = sprintf('files/cache/tmp/image_mark_%d.gif', $member_srl); |
1032 | 1032 | FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif'); |
@@ -1034,10 +1034,10 @@ discard block |
||
1034 | 1034 | // 파일 용량 제한 |
1035 | 1035 | FileHandler::clearStatCache($temp_filename); |
1036 | 1036 | $filesize = filesize($temp_filename); |
1037 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
1037 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
1038 | 1038 | { |
1039 | 1039 | FileHandler::removeFile($temp_filename); |
1040 | - return $this->stop(implode(' ' , array( |
|
1040 | + return $this->stop(implode(' ', array( |
|
1041 | 1041 | Context::getLang('msg_not_uploaded_group_image_mark'), |
1042 | 1042 | Context::getLang('msg_exceeds_limit_size') |
1043 | 1043 | ))); |
@@ -1050,10 +1050,10 @@ discard block |
||
1050 | 1050 | else |
1051 | 1051 | { |
1052 | 1052 | $filesize = filesize($target_file); |
1053 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
1053 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
1054 | 1054 | { |
1055 | 1055 | FileHandler::removeFile($target_file); |
1056 | - return $this->stop(implode(' ' , array( |
|
1056 | + return $this->stop(implode(' ', array( |
|
1057 | 1057 | Context::getLang('msg_not_uploaded_group_image_mark'), |
1058 | 1058 | Context::getLang('msg_exceeds_limit_size') |
1059 | 1059 | ))); |
@@ -1075,20 +1075,20 @@ discard block |
||
1075 | 1075 | function procMemberDeleteImageMark($_memberSrl = 0) |
1076 | 1076 | { |
1077 | 1077 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
1078 | - if(!$member_srl) |
|
1078 | + if (!$member_srl) |
|
1079 | 1079 | { |
1080 | - return new BaseObject(0,'success'); |
|
1080 | + return new BaseObject(0, 'success'); |
|
1081 | 1081 | } |
1082 | 1082 | |
1083 | 1083 | $logged_info = Context::get('logged_info'); |
1084 | 1084 | |
1085 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
1085 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
1086 | 1086 | { |
1087 | 1087 | $oMemberModel = getModel('member'); |
1088 | 1088 | $image_mark = $oMemberModel->getImageMark($member_srl); |
1089 | 1089 | FileHandler::removeFile($image_mark->file); |
1090 | 1090 | } |
1091 | - return new BaseObject(0,'success'); |
|
1091 | + return new BaseObject(0, 'success'); |
|
1092 | 1092 | } |
1093 | 1093 | |
1094 | 1094 | /** |
@@ -1099,26 +1099,26 @@ discard block |
||
1099 | 1099 | function procMemberFindAccount() |
1100 | 1100 | { |
1101 | 1101 | $email_address = Context::get('email_address'); |
1102 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1102 | + if (!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1103 | 1103 | |
1104 | 1104 | $oMemberModel = getModel('member'); |
1105 | 1105 | $oModuleModel = getModel('module'); |
1106 | 1106 | |
1107 | 1107 | // Check if a member having the same email address exists |
1108 | 1108 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1109 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1109 | + if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1110 | 1110 | |
1111 | 1111 | // Get information of the member |
1112 | 1112 | $columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name'); |
1113 | 1113 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
1114 | 1114 | |
1115 | 1115 | // Check if possible to find member's ID and password |
1116 | - if($member_info->denied == 'Y') |
|
1116 | + if ($member_info->denied == 'Y') |
|
1117 | 1117 | { |
1118 | 1118 | $chk_args = new stdClass; |
1119 | 1119 | $chk_args->member_srl = $member_info->member_srl; |
1120 | 1120 | $output = executeQuery('member.chkAuthMail', $chk_args); |
1121 | - if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
1121 | + if ($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
1122 | 1122 | } |
1123 | 1123 | |
1124 | 1124 | // Insert data into the authentication DB |
@@ -1131,19 +1131,19 @@ discard block |
||
1131 | 1131 | $args->is_register = 'N'; |
1132 | 1132 | |
1133 | 1133 | $output = executeQuery('member.insertAuthMail', $args); |
1134 | - if(!$output->toBool()) return $output; |
|
1134 | + if (!$output->toBool()) return $output; |
|
1135 | 1135 | // Get content of the email to send a member |
1136 | 1136 | Context::set('auth_args', $args); |
1137 | 1137 | |
1138 | 1138 | $member_config = $oModuleModel->getModuleConfig('member'); |
1139 | 1139 | $memberInfo = array(); |
1140 | 1140 | global $lang; |
1141 | - if(is_array($member_config->signupForm)) |
|
1141 | + if (is_array($member_config->signupForm)) |
|
1142 | 1142 | { |
1143 | - $exceptForm=array('password', 'find_account_question'); |
|
1144 | - foreach($member_config->signupForm as $form) |
|
1143 | + $exceptForm = array('password', 'find_account_question'); |
|
1144 | + foreach ($member_config->signupForm as $form) |
|
1145 | 1145 | { |
1146 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1146 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1147 | 1147 | { |
1148 | 1148 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1149 | 1149 | } |
@@ -1158,15 +1158,15 @@ discard block |
||
1158 | 1158 | } |
1159 | 1159 | Context::set('memberInfo', $memberInfo); |
1160 | 1160 | |
1161 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1162 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1161 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
1162 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
1163 | 1163 | |
1164 | 1164 | Context::set('member_config', $member_config); |
1165 | 1165 | |
1166 | 1166 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1167 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1167 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1168 | 1168 | |
1169 | - $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
|
1169 | + $find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
|
1170 | 1170 | Context::set('find_url', $find_url); |
1171 | 1171 | |
1172 | 1172 | $oTemplate = &TemplateHandler::getInstance(); |
@@ -1176,19 +1176,19 @@ discard block |
||
1176 | 1176 | $member_config = $oModuleModel->getModuleConfig('member'); |
1177 | 1177 | // Send a mail |
1178 | 1178 | $oMail = new Mail(); |
1179 | - $oMail->setTitle( Context::getLang('msg_find_account_title') ); |
|
1179 | + $oMail->setTitle(Context::getLang('msg_find_account_title')); |
|
1180 | 1180 | $oMail->setContent($content); |
1181 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
1182 | - $oMail->setReceiptor( $member_info->user_name, $member_info->email_address ); |
|
1181 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
1182 | + $oMail->setReceiptor($member_info->user_name, $member_info->email_address); |
|
1183 | 1183 | $oMail->send(); |
1184 | 1184 | // Return message |
1185 | 1185 | $msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address); |
1186 | - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) |
|
1186 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
1187 | 1187 | { |
1188 | 1188 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount'); |
1189 | 1189 | $this->setRedirectUrl($returnUrl); |
1190 | 1190 | } |
1191 | - return new BaseObject(0,$msg); |
|
1191 | + return new BaseObject(0, $msg); |
|
1192 | 1192 | } |
1193 | 1193 | |
1194 | 1194 | /** |
@@ -1199,7 +1199,7 @@ discard block |
||
1199 | 1199 | function procMemberFindAccountByQuestion() |
1200 | 1200 | { |
1201 | 1201 | $oMemberModel = getModel('member'); |
1202 | - $oPassword = new Password(); |
|
1202 | + $oPassword = new Password(); |
|
1203 | 1203 | $config = $oMemberModel->getMemberConfig(); |
1204 | 1204 | |
1205 | 1205 | $email_address = Context::get('email_address'); |
@@ -1207,49 +1207,49 @@ discard block |
||
1207 | 1207 | $find_account_question = trim(Context::get('find_account_question')); |
1208 | 1208 | $find_account_answer = trim(Context::get('find_account_answer')); |
1209 | 1209 | |
1210 | - if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
1210 | + if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
1211 | 1211 | |
1212 | 1212 | $oModuleModel = getModel('module'); |
1213 | 1213 | // Check if a member having the same email address exists |
1214 | 1214 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1215 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1215 | + if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1216 | 1216 | |
1217 | 1217 | // Get information of the member |
1218 | 1218 | $columnList = array('member_srl', 'find_account_question', 'find_account_answer'); |
1219 | 1219 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
1220 | 1220 | |
1221 | 1221 | // Display a message if no answer is entered |
1222 | - if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
1222 | + if (!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
1223 | 1223 | |
1224 | 1224 | // 답변 확인 |
1225 | 1225 | $hashed = $oPassword->checkAlgorithm($member_info->find_account_answer); |
1226 | 1226 | $authed = true; |
1227 | 1227 | $member_info->find_account_question = trim($member_info->find_account_question); |
1228 | - if($member_info->find_account_question != $find_account_question) |
|
1228 | + if ($member_info->find_account_question != $find_account_question) |
|
1229 | 1229 | { |
1230 | 1230 | $authed = false; |
1231 | 1231 | } |
1232 | - else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
1232 | + else if ($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
1233 | 1233 | { |
1234 | 1234 | $authed = false; |
1235 | 1235 | } |
1236 | - else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
1236 | + else if (!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
1237 | 1237 | { |
1238 | 1238 | $authed = false; |
1239 | 1239 | } |
1240 | 1240 | |
1241 | - if(!$authed) |
|
1241 | + if (!$authed) |
|
1242 | 1242 | { |
1243 | 1243 | return new BaseObject(-1, 'msg_answer_not_matches'); |
1244 | 1244 | } |
1245 | 1245 | |
1246 | 1246 | // answer가 동일하고 hash 되지 않았으면 hash 값으로 저장 |
1247 | - if($authed && !$hashed) |
|
1247 | + if ($authed && !$hashed) |
|
1248 | 1248 | { |
1249 | 1249 | $this->updateFindAccountAnswer($member_srl, $find_account_answer); |
1250 | 1250 | } |
1251 | 1251 | |
1252 | - if($config->identifier == 'email_address') |
|
1252 | + if ($config->identifier == 'email_address') |
|
1253 | 1253 | { |
1254 | 1254 | $user_id = $email_address; |
1255 | 1255 | } |
@@ -1262,11 +1262,11 @@ discard block |
||
1262 | 1262 | $args->password = $temp_password; |
1263 | 1263 | $args->change_password_date = '1'; |
1264 | 1264 | $output = $this->updateMemberPassword($args); |
1265 | - if(!$output->toBool()) return $output; |
|
1265 | + if (!$output->toBool()) return $output; |
|
1266 | 1266 | |
1267 | - $_SESSION['xe_temp_password_' . $user_id] = $temp_password; |
|
1267 | + $_SESSION['xe_temp_password_'.$user_id] = $temp_password; |
|
1268 | 1268 | |
1269 | - $this->add('user_id',$user_id); |
|
1269 | + $this->add('user_id', $user_id); |
|
1270 | 1270 | |
1271 | 1271 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); |
1272 | 1272 | $this->setRedirectUrl($returnUrl.'&user_id='.$user_id); |
@@ -1286,7 +1286,7 @@ discard block |
||
1286 | 1286 | $member_srl = Context::get('member_srl'); |
1287 | 1287 | $auth_key = Context::get('auth_key'); |
1288 | 1288 | |
1289 | - if(!$member_srl || !$auth_key) |
|
1289 | + if (!$member_srl || !$auth_key) |
|
1290 | 1290 | { |
1291 | 1291 | return $this->stop('msg_invalid_request'); |
1292 | 1292 | } |
@@ -1297,9 +1297,9 @@ discard block |
||
1297 | 1297 | $args->auth_key = $auth_key; |
1298 | 1298 | $output = executeQuery('member.getAuthMail', $args); |
1299 | 1299 | |
1300 | - if(!$output->toBool() || $output->data->auth_key != $auth_key) |
|
1300 | + if (!$output->toBool() || $output->data->auth_key != $auth_key) |
|
1301 | 1301 | { |
1302 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) |
|
1302 | + if (strlen($output->data->auth_key) !== strlen($auth_key)) |
|
1303 | 1303 | { |
1304 | 1304 | executeQuery('member.deleteAuthMail', $args); |
1305 | 1305 | } |
@@ -1307,7 +1307,7 @@ discard block |
||
1307 | 1307 | return $this->stop('msg_invalid_auth_key'); |
1308 | 1308 | } |
1309 | 1309 | |
1310 | - if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400) |
|
1310 | + if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400) |
|
1311 | 1311 | { |
1312 | 1312 | executeQuery('member.deleteAuthMail', $args); |
1313 | 1313 | return $this->stop('msg_invalid_auth_key'); |
@@ -1316,7 +1316,7 @@ discard block |
||
1316 | 1316 | $args->password = $output->data->new_password; |
1317 | 1317 | |
1318 | 1318 | // If credentials are correct, change the password to a new one |
1319 | - if($output->data->is_register == 'Y') |
|
1319 | + if ($output->data->is_register == 'Y') |
|
1320 | 1320 | { |
1321 | 1321 | $args->denied = 'N'; |
1322 | 1322 | } |
@@ -1329,13 +1329,13 @@ discard block |
||
1329 | 1329 | $is_register = $output->data->is_register; |
1330 | 1330 | |
1331 | 1331 | $output = executeQuery('member.updateMemberPassword', $args); |
1332 | - if(!$output->toBool()) |
|
1332 | + if (!$output->toBool()) |
|
1333 | 1333 | { |
1334 | 1334 | return $this->stop($output->getMessage()); |
1335 | 1335 | } |
1336 | 1336 | |
1337 | 1337 | // Remove all values having the member_srl from authentication table |
1338 | - executeQuery('member.deleteAuthMail',$args); |
|
1338 | + executeQuery('member.deleteAuthMail', $args); |
|
1339 | 1339 | |
1340 | 1340 | $this->_clearMemberCache($args->member_srl); |
1341 | 1341 | |
@@ -1354,33 +1354,33 @@ discard block |
||
1354 | 1354 | { |
1355 | 1355 | // Get an email_address |
1356 | 1356 | $email_address = Context::get('email_address'); |
1357 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1357 | + if (!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1358 | 1358 | // Log test by using email_address |
1359 | 1359 | $oMemberModel = getModel('member'); |
1360 | 1360 | |
1361 | 1361 | $args = new stdClass; |
1362 | 1362 | $args->email_address = $email_address; |
1363 | 1363 | $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1364 | - if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
1364 | + if (!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
1365 | 1365 | |
1366 | 1366 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address'); |
1367 | 1367 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList); |
1368 | 1368 | |
1369 | 1369 | $oModuleModel = getModel('module'); |
1370 | 1370 | $member_config = $oModuleModel->getModuleConfig('member'); |
1371 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1372 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1371 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
1372 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
1373 | 1373 | |
1374 | 1374 | // Check if a authentication mail has been sent previously |
1375 | 1375 | $chk_args = new stdClass; |
1376 | 1376 | $chk_args->member_srl = $member_info->member_srl; |
1377 | 1377 | $output = executeQuery('member.chkAuthMail', $chk_args); |
1378 | - if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
1378 | + if ($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
1379 | 1379 | |
1380 | 1380 | $auth_args = new stdClass; |
1381 | 1381 | $auth_args->member_srl = $member_info->member_srl; |
1382 | 1382 | $output = executeQueryArray('member.getAuthMailInfo', $auth_args); |
1383 | - if(!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
1383 | + if (!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
1384 | 1384 | $auth_info = $output->data[0]; |
1385 | 1385 | |
1386 | 1386 | // Update the regdate of authmail entry |
@@ -1391,12 +1391,12 @@ discard block |
||
1391 | 1391 | |
1392 | 1392 | $memberInfo = array(); |
1393 | 1393 | global $lang; |
1394 | - if(is_array($member_config->signupForm)) |
|
1394 | + if (is_array($member_config->signupForm)) |
|
1395 | 1395 | { |
1396 | - $exceptForm=array('password', 'find_account_question'); |
|
1397 | - foreach($member_config->signupForm as $form) |
|
1396 | + $exceptForm = array('password', 'find_account_question'); |
|
1397 | + foreach ($member_config->signupForm as $form) |
|
1398 | 1398 | { |
1399 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1399 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1400 | 1400 | { |
1401 | 1401 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1402 | 1402 | } |
@@ -1415,19 +1415,19 @@ discard block |
||
1415 | 1415 | Context::set('member_config', $member_config); |
1416 | 1416 | |
1417 | 1417 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1418 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1418 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1419 | 1419 | |
1420 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); |
|
1420 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key); |
|
1421 | 1421 | Context::set('auth_url', $auth_url); |
1422 | 1422 | |
1423 | 1423 | $oTemplate = &TemplateHandler::getInstance(); |
1424 | 1424 | $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); |
1425 | 1425 | // Send a mail |
1426 | 1426 | $oMail = new Mail(); |
1427 | - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); |
|
1427 | + $oMail->setTitle(Context::getLang('msg_confirm_account_title')); |
|
1428 | 1428 | $oMail->setContent($content); |
1429 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
1430 | - $oMail->setReceiptor( $args->user_name, $args->email_address ); |
|
1429 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
1430 | + $oMail->setReceiptor($args->user_name, $args->email_address); |
|
1431 | 1431 | $oMail->send(); |
1432 | 1432 | |
1433 | 1433 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
@@ -1442,23 +1442,23 @@ discard block |
||
1442 | 1442 | $memberInfo = $_SESSION['auth_member_info']; |
1443 | 1443 | unset($_SESSION['auth_member_info']); |
1444 | 1444 | |
1445 | - if(!$memberInfo) |
|
1445 | + if (!$memberInfo) |
|
1446 | 1446 | { |
1447 | 1447 | return $this->stop('msg_invalid_request'); |
1448 | 1448 | } |
1449 | 1449 | |
1450 | 1450 | $newEmail = Context::get('email_address'); |
1451 | 1451 | |
1452 | - if(!$newEmail) |
|
1452 | + if (!$newEmail) |
|
1453 | 1453 | { |
1454 | 1454 | return $this->stop('msg_invalid_request'); |
1455 | 1455 | } |
1456 | 1456 | |
1457 | 1457 | $oMemberModel = getModel('member'); |
1458 | 1458 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
1459 | - if($member_srl) |
|
1459 | + if ($member_srl) |
|
1460 | 1460 | { |
1461 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
1461 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
1462 | 1462 | } |
1463 | 1463 | |
1464 | 1464 | // remove all key by member_srl |
@@ -1466,7 +1466,7 @@ discard block |
||
1466 | 1466 | $args->member_srl = $memberInfo->member_srl; |
1467 | 1467 | $output = executeQuery('member.deleteAuthMail', $args); |
1468 | 1468 | |
1469 | - if(!$output->toBool()) |
|
1469 | + if (!$output->toBool()) |
|
1470 | 1470 | { |
1471 | 1471 | return $output; |
1472 | 1472 | } |
@@ -1476,7 +1476,7 @@ discard block |
||
1476 | 1476 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
1477 | 1477 | |
1478 | 1478 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
1479 | - if(!$output->toBool()) |
|
1479 | + if (!$output->toBool()) |
|
1480 | 1480 | { |
1481 | 1481 | return $this->stop($output->getMessage()); |
1482 | 1482 | } |
@@ -1493,7 +1493,7 @@ discard block |
||
1493 | 1493 | $auth_args->is_register = 'Y'; |
1494 | 1494 | |
1495 | 1495 | $output = executeQuery('member.insertAuthMail', $auth_args); |
1496 | - if(!$output->toBool()) return $output; |
|
1496 | + if (!$output->toBool()) return $output; |
|
1497 | 1497 | |
1498 | 1498 | $memberInfo->email_address = $newEmail; |
1499 | 1499 | |
@@ -1517,12 +1517,12 @@ discard block |
||
1517 | 1517 | $memberInfo = array(); |
1518 | 1518 | |
1519 | 1519 | global $lang; |
1520 | - if(is_array($member_config->signupForm)) |
|
1520 | + if (is_array($member_config->signupForm)) |
|
1521 | 1521 | { |
1522 | - $exceptForm=array('password', 'find_account_question'); |
|
1523 | - foreach($member_config->signupForm as $form) |
|
1522 | + $exceptForm = array('password', 'find_account_question'); |
|
1523 | + foreach ($member_config->signupForm as $form) |
|
1524 | 1524 | { |
1525 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1525 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
1526 | 1526 | { |
1527 | 1527 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1528 | 1528 | } |
@@ -1537,25 +1537,25 @@ discard block |
||
1537 | 1537 | } |
1538 | 1538 | Context::set('memberInfo', $memberInfo); |
1539 | 1539 | |
1540 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1541 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1540 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
1541 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
1542 | 1542 | |
1543 | 1543 | Context::set('member_config', $member_config); |
1544 | 1544 | |
1545 | 1545 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1546 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1546 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1547 | 1547 | |
1548 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
|
1548 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key); |
|
1549 | 1549 | Context::set('auth_url', $auth_url); |
1550 | 1550 | |
1551 | 1551 | $oTemplate = &TemplateHandler::getInstance(); |
1552 | 1552 | $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); |
1553 | 1553 | // Send a mail |
1554 | 1554 | $oMail = new Mail(); |
1555 | - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); |
|
1555 | + $oMail->setTitle(Context::getLang('msg_confirm_account_title')); |
|
1556 | 1556 | $oMail->setContent($content); |
1557 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
1558 | - $oMail->setReceiptor( $member_info->user_name, $member_info->email_address ); |
|
1557 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
1558 | + $oMail->setReceiptor($member_info->user_name, $member_info->email_address); |
|
1559 | 1559 | $oMail->send(); |
1560 | 1560 | } |
1561 | 1561 | |
@@ -1568,7 +1568,7 @@ discard block |
||
1568 | 1568 | { |
1569 | 1569 | $site_module_info = Context::get('site_module_info'); |
1570 | 1570 | $logged_info = Context::get('logged_info'); |
1571 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
1571 | + if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request'); |
|
1572 | 1572 | |
1573 | 1573 | $oMemberModel = getModel('member'); |
1574 | 1574 | $columnList = array('site_srl', 'group_srl', 'title'); |
@@ -1587,13 +1587,13 @@ discard block |
||
1587 | 1587 | { |
1588 | 1588 | $site_module_info = Context::get('site_module_info'); |
1589 | 1589 | $logged_info = Context::get('logged_info'); |
1590 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
1590 | + if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request'); |
|
1591 | 1591 | |
1592 | 1592 | $args = new stdClass; |
1593 | - $args->site_srl= $site_module_info->site_srl; |
|
1593 | + $args->site_srl = $site_module_info->site_srl; |
|
1594 | 1594 | $args->member_srl = $logged_info->member_srl; |
1595 | 1595 | $output = executeQuery('member.deleteMembersGroup', $args); |
1596 | - if(!$output->toBool()) return $output; |
|
1596 | + if (!$output->toBool()) return $output; |
|
1597 | 1597 | $this->setMessage('success_deleted'); |
1598 | 1598 | $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl); |
1599 | 1599 | } |
@@ -1607,25 +1607,25 @@ discard block |
||
1607 | 1607 | */ |
1608 | 1608 | function setMemberConfig($args) |
1609 | 1609 | { |
1610 | - if(!$args->skin) $args->skin = "default"; |
|
1611 | - if(!$args->colorset) $args->colorset = "white"; |
|
1612 | - if(!$args->editor_skin) $args->editor_skin= "ckeditor"; |
|
1613 | - if(!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
1614 | - if($args->enable_join!='Y') $args->enable_join = 'N'; |
|
1615 | - $args->enable_openid= 'N'; |
|
1616 | - if($args->profile_image !='Y') $args->profile_image = 'N'; |
|
1617 | - if($args->image_name!='Y') $args->image_name = 'N'; |
|
1618 | - if($args->image_mark!='Y') $args->image_mark = 'N'; |
|
1619 | - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; |
|
1620 | - if(!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
1621 | - $args->limit_day = (int)$args->limit_day; |
|
1610 | + if (!$args->skin) $args->skin = "default"; |
|
1611 | + if (!$args->colorset) $args->colorset = "white"; |
|
1612 | + if (!$args->editor_skin) $args->editor_skin = "ckeditor"; |
|
1613 | + if (!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
1614 | + if ($args->enable_join != 'Y') $args->enable_join = 'N'; |
|
1615 | + $args->enable_openid = 'N'; |
|
1616 | + if ($args->profile_image != 'Y') $args->profile_image = 'N'; |
|
1617 | + if ($args->image_name != 'Y') $args->image_name = 'N'; |
|
1618 | + if ($args->image_mark != 'Y') $args->image_mark = 'N'; |
|
1619 | + if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N'; |
|
1620 | + if (!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
1621 | + $args->limit_day = (int) $args->limit_day; |
|
1622 | 1622 | |
1623 | 1623 | $agreement = trim($args->agreement); |
1624 | 1624 | unset($args->agreement); |
1625 | 1625 | |
1626 | 1626 | $oModuleController = getController('module'); |
1627 | - $output = $oModuleController->insertModuleConfig('member',$args); |
|
1628 | - if(!$output->toBool()) return $output; |
|
1627 | + $output = $oModuleController->insertModuleConfig('member', $args); |
|
1628 | + if (!$output->toBool()) return $output; |
|
1629 | 1629 | |
1630 | 1630 | $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
1631 | 1631 | FileHandler::writeFile($agreement_file, $agreement); |
@@ -1646,11 +1646,11 @@ discard block |
||
1646 | 1646 | $signature = trim(removeHackTag($signature)); |
1647 | 1647 | $signature = preg_replace('/<(\/?)(embed|object|param)/is', '<$1$2', $signature); |
1648 | 1648 | |
1649 | - $check_signature = trim(str_replace(array(' ',"\n","\r"), '', strip_tags($signature, '<img><object>'))); |
|
1649 | + $check_signature = trim(str_replace(array(' ', "\n", "\r"), '', strip_tags($signature, '<img><object>'))); |
|
1650 | 1650 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
1651 | 1651 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
1652 | 1652 | |
1653 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
1653 | + if (!$check_signature) return FileHandler::removeFile($filename); |
|
1654 | 1654 | |
1655 | 1655 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
1656 | 1656 | FileHandler::makeDir($path); |
@@ -1679,15 +1679,15 @@ discard block |
||
1679 | 1679 | * |
1680 | 1680 | * @return BaseObject |
1681 | 1681 | */ |
1682 | - function addMemberToGroup($member_srl, $group_srl, $site_srl=0) |
|
1682 | + function addMemberToGroup($member_srl, $group_srl, $site_srl = 0) |
|
1683 | 1683 | { |
1684 | 1684 | $args = new stdClass(); |
1685 | 1685 | $args->member_srl = $member_srl; |
1686 | 1686 | $args->group_srl = $group_srl; |
1687 | - if($site_srl) $args->site_srl = $site_srl; |
|
1687 | + if ($site_srl) $args->site_srl = $site_srl; |
|
1688 | 1688 | |
1689 | 1689 | // Add |
1690 | - $output = executeQuery('member.addMemberToGroup',$args); |
|
1690 | + $output = executeQuery('member.addMemberToGroup', $args); |
|
1691 | 1691 | $output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args); |
1692 | 1692 | |
1693 | 1693 | $this->_clearMemberCache($member_srl, $site_srl); |
@@ -1707,18 +1707,18 @@ discard block |
||
1707 | 1707 | { |
1708 | 1708 | $obj = new stdClass; |
1709 | 1709 | $obj->site_srl = $args->site_srl; |
1710 | - $obj->member_srl = implode(',',$args->member_srl); |
|
1710 | + $obj->member_srl = implode(',', $args->member_srl); |
|
1711 | 1711 | |
1712 | 1712 | $output = executeQueryArray('member.getMembersGroup', $obj); |
1713 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1713 | + if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1714 | 1714 | |
1715 | 1715 | $output = executeQuery('member.deleteMembersGroup', $obj); |
1716 | - if(!$output->toBool()) return $output; |
|
1716 | + if (!$output->toBool()) return $output; |
|
1717 | 1717 | |
1718 | 1718 | $inserted_members = array(); |
1719 | - foreach($args->member_srl as $key => $val) |
|
1719 | + foreach ($args->member_srl as $key => $val) |
|
1720 | 1720 | { |
1721 | - if($inserted_members[$val]) continue; |
|
1721 | + if ($inserted_members[$val]) continue; |
|
1722 | 1722 | $inserted_members[$val] = true; |
1723 | 1723 | |
1724 | 1724 | unset($obj); |
@@ -1728,7 +1728,7 @@ discard block |
||
1728 | 1728 | $obj->site_srl = $args->site_srl; |
1729 | 1729 | $obj->regdate = $date[$obj->member_srl]; |
1730 | 1730 | $output = executeQuery('member.addMemberToGroup', $obj); |
1731 | - if(!$output->toBool()) return $output; |
|
1731 | + if (!$output->toBool()) return $output; |
|
1732 | 1732 | |
1733 | 1733 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
1734 | 1734 | } |
@@ -1750,9 +1750,9 @@ discard block |
||
1750 | 1750 | // Get information of the key |
1751 | 1751 | $output = executeQuery('member.getAutologin', $args); |
1752 | 1752 | // If no information exists, delete a cookie |
1753 | - if(!$output->toBool() || !$output->data) |
|
1753 | + if (!$output->toBool() || !$output->data) |
|
1754 | 1754 | { |
1755 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
1755 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
1756 | 1756 | return; |
1757 | 1757 | } |
1758 | 1758 | |
@@ -1762,9 +1762,9 @@ discard block |
||
1762 | 1762 | $user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address; |
1763 | 1763 | $password = $output->data->password; |
1764 | 1764 | |
1765 | - if(!$user_id || !$password) |
|
1765 | + if (!$user_id || !$password) |
|
1766 | 1766 | { |
1767 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
1767 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
1768 | 1768 | return; |
1769 | 1769 | } |
1770 | 1770 | |
@@ -1774,7 +1774,7 @@ discard block |
||
1774 | 1774 | $check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT']; |
1775 | 1775 | $check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32); |
1776 | 1776 | |
1777 | - if($check_key === substr($args->autologin_key, 32)) |
|
1777 | + if ($check_key === substr($args->autologin_key, 32)) |
|
1778 | 1778 | { |
1779 | 1779 | // Check change_password_date |
1780 | 1780 | $oModuleModel = getModel('module'); |
@@ -1782,12 +1782,12 @@ discard block |
||
1782 | 1782 | $limit_date = $member_config->change_password_date; |
1783 | 1783 | |
1784 | 1784 | // Check if change_password_date is set |
1785 | - if($limit_date > 0) |
|
1785 | + if ($limit_date > 0) |
|
1786 | 1786 | { |
1787 | 1787 | $oMemberModel = getModel('member'); |
1788 | 1788 | $columnList = array('member_srl', 'change_password_date'); |
1789 | 1789 | |
1790 | - if($config->identifier == 'user_id') |
|
1790 | + if ($config->identifier == 'user_id') |
|
1791 | 1791 | { |
1792 | 1792 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
1793 | 1793 | } |
@@ -1796,7 +1796,7 @@ discard block |
||
1796 | 1796 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
1797 | 1797 | } |
1798 | 1798 | |
1799 | - if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){ |
|
1799 | + if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) { |
|
1800 | 1800 | $do_auto_login = true; |
1801 | 1801 | } |
1802 | 1802 | |
@@ -1807,14 +1807,14 @@ discard block |
||
1807 | 1807 | } |
1808 | 1808 | } |
1809 | 1809 | |
1810 | - if($do_auto_login) |
|
1810 | + if ($do_auto_login) |
|
1811 | 1811 | { |
1812 | 1812 | $output = $this->doLogin($user_id); |
1813 | 1813 | } |
1814 | 1814 | else |
1815 | 1815 | { |
1816 | 1816 | executeQuery('member.deleteAutologin', $args); |
1817 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
1817 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
1818 | 1818 | } |
1819 | 1819 | } |
1820 | 1820 | |
@@ -1830,13 +1830,13 @@ discard block |
||
1830 | 1830 | function doLogin($user_id, $password = '', $keep_signed = false) |
1831 | 1831 | { |
1832 | 1832 | $user_id = strtolower($user_id); |
1833 | - if(!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
1833 | + if (!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
1834 | 1834 | // Call a trigger before log-in (before) |
1835 | 1835 | $trigger_obj = new stdClass(); |
1836 | 1836 | $trigger_obj->user_id = $user_id; |
1837 | 1837 | $trigger_obj->password = $password; |
1838 | 1838 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
1839 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
1839 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
1840 | 1840 | // Create a member model object |
1841 | 1841 | $oMemberModel = getModel('member'); |
1842 | 1842 | |
@@ -1846,12 +1846,12 @@ discard block |
||
1846 | 1846 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
1847 | 1847 | |
1848 | 1848 | // check identifier |
1849 | - if($config->identifier == 'email_address') |
|
1849 | + if ($config->identifier == 'email_address') |
|
1850 | 1850 | { |
1851 | 1851 | // Get user_id information |
1852 | 1852 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
1853 | 1853 | // Set an invalid user if no value returned |
1854 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
1854 | + if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
1855 | 1855 | |
1856 | 1856 | } |
1857 | 1857 | else |
@@ -1859,24 +1859,24 @@ discard block |
||
1859 | 1859 | // Get user_id information |
1860 | 1860 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
1861 | 1861 | // Set an invalid user if no value returned |
1862 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
1862 | + if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
1863 | 1863 | } |
1864 | 1864 | |
1865 | 1865 | $output = executeQuery('member.getLoginCountByIp', $args); |
1866 | 1866 | $errorCount = $output->data->count; |
1867 | - if($errorCount >= $config->max_error_count) |
|
1867 | + if ($errorCount >= $config->max_error_count) |
|
1868 | 1868 | { |
1869 | 1869 | $last_update = strtotime($output->data->last_update); |
1870 | - $term = intval($_SERVER['REQUEST_TIME']-$last_update); |
|
1871 | - if($term < $config->max_error_count_time) |
|
1870 | + $term = intval($_SERVER['REQUEST_TIME'] - $last_update); |
|
1871 | + if ($term < $config->max_error_count_time) |
|
1872 | 1872 | { |
1873 | 1873 | $term = $config->max_error_count_time - $term; |
1874 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
1875 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
1876 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
1877 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
1874 | + if ($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
1875 | + elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min'); |
|
1876 | + elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour'); |
|
1877 | + else $term = intval($term / 86400).Context::getLang('unit_day'); |
|
1878 | 1878 | |
1879 | - return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
|
1879 | + return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'), $term)); |
|
1880 | 1880 | } |
1881 | 1881 | else |
1882 | 1882 | { |
@@ -1886,13 +1886,13 @@ discard block |
||
1886 | 1886 | } |
1887 | 1887 | |
1888 | 1888 | // Password Check |
1889 | - if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
1889 | + if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
1890 | 1890 | { |
1891 | - return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo); |
|
1891 | + return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo); |
|
1892 | 1892 | } |
1893 | 1893 | |
1894 | 1894 | // If denied == 'Y', notify |
1895 | - if($this->memberInfo->denied == 'Y') |
|
1895 | + if ($this->memberInfo->denied == 'Y') |
|
1896 | 1896 | { |
1897 | 1897 | $args->member_srl = $this->memberInfo->member_srl; |
1898 | 1898 | $output = executeQuery('member.chkAuthMail', $args); |
@@ -1900,12 +1900,12 @@ discard block |
||
1900 | 1900 | { |
1901 | 1901 | $_SESSION['auth_member_srl'] = $this->memberInfo->member_srl; |
1902 | 1902 | $redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail'); |
1903 | - return $this->setRedirectUrl($redirectUrl, new BaseObject(-1,'msg_user_not_confirmed')); |
|
1903 | + return $this->setRedirectUrl($redirectUrl, new BaseObject(-1, 'msg_user_not_confirmed')); |
|
1904 | 1904 | } |
1905 | - return new BaseObject(-1,'msg_user_denied'); |
|
1905 | + return new BaseObject(-1, 'msg_user_denied'); |
|
1906 | 1906 | } |
1907 | 1907 | // Notify if denied_date is less than the current time |
1908 | - 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"))); |
|
1908 | + 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"))); |
|
1909 | 1909 | // Update the latest login time |
1910 | 1910 | $args->member_srl = $this->memberInfo->member_srl; |
1911 | 1911 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1915,36 +1915,36 @@ discard block |
||
1915 | 1915 | |
1916 | 1916 | // Check if there is recoding table. |
1917 | 1917 | $oDB = &DB::getInstance(); |
1918 | - if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
1918 | + if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
1919 | 1919 | { |
1920 | 1920 | // check if there is login fail records. |
1921 | 1921 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
1922 | - if($output->data && $output->data->content) |
|
1922 | + if ($output->data && $output->data->content) |
|
1923 | 1923 | { |
1924 | 1924 | $title = Context::getLang('login_fail_report'); |
1925 | 1925 | $message = '<ul>'; |
1926 | 1926 | $content = unserialize($output->data->content); |
1927 | - if(count($content) > $config->max_error_count) |
|
1927 | + if (count($content) > $config->max_error_count) |
|
1928 | 1928 | { |
1929 | - foreach($content as $val) |
|
1929 | + foreach ($content as $val) |
|
1930 | 1930 | { |
1931 | - $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>'; |
|
1931 | + $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>'; |
|
1932 | 1932 | } |
1933 | 1933 | $message .= '</ul>'; |
1934 | - $content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa')); |
|
1934 | + $content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa')); |
|
1935 | 1935 | |
1936 | 1936 | //send message |
1937 | 1937 | $oCommunicationController = getController('communication'); |
1938 | 1938 | $oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true); |
1939 | 1939 | |
1940 | - if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
1940 | + if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
1941 | 1941 | { |
1942 | 1942 | $view_url = Context::getRequestUri(); |
1943 | - $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); |
|
1943 | + $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); |
|
1944 | 1944 | $oMail = new Mail(); |
1945 | 1945 | $oMail->setTitle($title); |
1946 | 1946 | $oMail->setContent($content); |
1947 | - $oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email); |
|
1947 | + $oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email); |
|
1948 | 1948 | $oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address); |
1949 | 1949 | $oMail->send(); |
1950 | 1950 | } |
@@ -1954,9 +1954,9 @@ discard block |
||
1954 | 1954 | } |
1955 | 1955 | // Call a trigger after successfully log-in (after) |
1956 | 1956 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
1957 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
1957 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
1958 | 1958 | // When user checked to use auto-login |
1959 | - if($keep_signed) |
|
1959 | + if ($keep_signed) |
|
1960 | 1960 | { |
1961 | 1961 | // Key generate for auto login |
1962 | 1962 | $oPassword = new Password(); |
@@ -1968,12 +1968,12 @@ discard block |
||
1968 | 1968 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
1969 | 1969 | executeQuery('member.deleteAutologin', $autologin_args); |
1970 | 1970 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
1971 | - if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
1971 | + if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000); |
|
1972 | 1972 | } |
1973 | - if($this->memberInfo->is_admin == 'Y') |
|
1973 | + if ($this->memberInfo->is_admin == 'Y') |
|
1974 | 1974 | { |
1975 | 1975 | $oMemberAdminModel = getAdminModel('member'); |
1976 | - if(!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
1976 | + if (!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
1977 | 1977 | { |
1978 | 1978 | $_SESSION['denied_admin'] = 'Y'; |
1979 | 1979 | } |
@@ -1991,18 +1991,18 @@ discard block |
||
1991 | 1991 | { |
1992 | 1992 | $oMemberModel = getModel('member'); |
1993 | 1993 | // If your information came through the current session information to extract information from the users |
1994 | - if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() ) |
|
1994 | + if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged()) |
|
1995 | 1995 | { |
1996 | 1996 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']); |
1997 | 1997 | // If you do not destroy the session Profile |
1998 | - if($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
1998 | + if ($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
1999 | 1999 | { |
2000 | 2000 | $this->destroySessionInfo(); |
2001 | 2001 | return; |
2002 | 2002 | } |
2003 | 2003 | } |
2004 | 2004 | // Stop using the session id is destroyed |
2005 | - if($this->memberInfo->denied=='Y') |
|
2005 | + if ($this->memberInfo->denied == 'Y') |
|
2006 | 2006 | { |
2007 | 2007 | $this->destroySessionInfo(); |
2008 | 2008 | return; |
@@ -2032,10 +2032,10 @@ discard block |
||
2032 | 2032 | Context::set('logged_info', $this->memberInfo); |
2033 | 2033 | |
2034 | 2034 | // Only the menu configuration of the user (such as an add-on to the menu can be changed) |
2035 | - $this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info'); |
|
2036 | - $this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
2037 | - $this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
2038 | - $this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document'); |
|
2035 | + $this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info'); |
|
2036 | + $this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
2037 | + $this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
2038 | + $this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document'); |
|
2039 | 2039 | } |
2040 | 2040 | |
2041 | 2041 | /** |
@@ -2057,7 +2057,7 @@ discard block |
||
2057 | 2057 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
2058 | 2058 | { |
2059 | 2059 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
2060 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
2060 | + if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
2061 | 2061 | |
2062 | 2062 | $obj = new stdClass; |
2063 | 2063 | $obj->url = $url; |
@@ -2076,33 +2076,33 @@ discard block |
||
2076 | 2076 | { |
2077 | 2077 | // Call a trigger (before) |
2078 | 2078 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
2079 | - if(!$output->toBool()) return $output; |
|
2079 | + if (!$output->toBool()) return $output; |
|
2080 | 2080 | // Terms and Conditions portion of the information set up by members reaffirmed |
2081 | 2081 | $oModuleModel = getModel('module'); |
2082 | 2082 | $config = $oModuleModel->getModuleConfig('member'); |
2083 | 2083 | |
2084 | 2084 | $logged_info = Context::get('logged_info'); |
2085 | 2085 | // If the date of the temporary restrictions limit further information on the date of |
2086 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
2086 | + if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24); |
|
2087 | 2087 | |
2088 | 2088 | $args->member_srl = getNextSequence(); |
2089 | 2089 | $args->list_order = -1 * $args->member_srl; |
2090 | 2090 | |
2091 | 2091 | // Execute insert or update depending on the value of member_srl |
2092 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2092 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2093 | 2093 | // Enter the user's identity changed to lowercase |
2094 | 2094 | else $args->user_id = strtolower($args->user_id); |
2095 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
2096 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
2095 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
2096 | + if (!$args->nick_name) $args->nick_name = $args->member_srl; |
|
2097 | 2097 | |
2098 | 2098 | // Control of essential parameters |
2099 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
2100 | - if($args->denied!='Y') $args->denied = 'N'; |
|
2101 | - if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y'; |
|
2099 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
2100 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
2101 | + if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y'; |
|
2102 | 2102 | |
2103 | - if($logged_info->is_admin == 'Y') |
|
2103 | + if ($logged_info->is_admin == 'Y') |
|
2104 | 2104 | { |
2105 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
2105 | + if ($args->is_admin != 'Y') $args->is_admin = 'N'; |
|
2106 | 2106 | } |
2107 | 2107 | else |
2108 | 2108 | { |
@@ -2117,97 +2117,97 @@ discard block |
||
2117 | 2117 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2118 | 2118 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2119 | 2119 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2120 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2121 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
2120 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2121 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
2122 | 2122 | |
2123 | 2123 | // Create a model object |
2124 | 2124 | $oMemberModel = getModel('member'); |
2125 | 2125 | |
2126 | 2126 | // Check password strength |
2127 | - if($args->password && !$password_is_hashed) |
|
2127 | + if ($args->password && !$password_is_hashed) |
|
2128 | 2128 | { |
2129 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2129 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2130 | 2130 | { |
2131 | 2131 | $message = Context::getLang('about_password_strength'); |
2132 | 2132 | return new BaseObject(-1, $message[$config->password_strength]); |
2133 | 2133 | } |
2134 | 2134 | $args->password = $oMemberModel->hashPassword($args->password); |
2135 | 2135 | } |
2136 | - elseif(!$args->password) |
|
2136 | + elseif (!$args->password) |
|
2137 | 2137 | { |
2138 | 2138 | unset($args->password); |
2139 | 2139 | } |
2140 | 2140 | |
2141 | - if($args->find_account_answer && !$password_is_hashed) |
|
2141 | + if ($args->find_account_answer && !$password_is_hashed) |
|
2142 | 2142 | { |
2143 | 2143 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
2144 | 2144 | } |
2145 | - elseif(!$args->find_account_answer) |
|
2145 | + elseif (!$args->find_account_answer) |
|
2146 | 2146 | { |
2147 | 2147 | unset($args->find_account_answer); |
2148 | 2148 | } |
2149 | 2149 | |
2150 | 2150 | // Check if ID is prohibited |
2151 | - if($oMemberModel->isDeniedID($args->user_id)) |
|
2151 | + if ($oMemberModel->isDeniedID($args->user_id)) |
|
2152 | 2152 | { |
2153 | - return new BaseObject(-1,'denied_user_id'); |
|
2153 | + return new BaseObject(-1, 'denied_user_id'); |
|
2154 | 2154 | } |
2155 | 2155 | |
2156 | 2156 | // Check if ID is duplicate |
2157 | 2157 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
2158 | - if($member_srl) |
|
2158 | + if ($member_srl) |
|
2159 | 2159 | { |
2160 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
2160 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
2161 | 2161 | } |
2162 | 2162 | |
2163 | 2163 | // Check if nickname is prohibited |
2164 | - if($oMemberModel->isDeniedNickName($args->nick_name)) |
|
2164 | + if ($oMemberModel->isDeniedNickName($args->nick_name)) |
|
2165 | 2165 | { |
2166 | - return new BaseObject(-1,'denied_nick_name'); |
|
2166 | + return new BaseObject(-1, 'denied_nick_name'); |
|
2167 | 2167 | } |
2168 | 2168 | |
2169 | 2169 | // Check if nickname is duplicate |
2170 | 2170 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
2171 | - if($member_srl) |
|
2171 | + if ($member_srl) |
|
2172 | 2172 | { |
2173 | - return new BaseObject(-1,'msg_exists_nick_name'); |
|
2173 | + return new BaseObject(-1, 'msg_exists_nick_name'); |
|
2174 | 2174 | } |
2175 | 2175 | |
2176 | 2176 | // Check if email address is duplicate |
2177 | 2177 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
2178 | - if($member_srl) |
|
2178 | + if ($member_srl) |
|
2179 | 2179 | { |
2180 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
2180 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
2181 | 2181 | } |
2182 | 2182 | |
2183 | 2183 | // Insert data into the DB |
2184 | 2184 | $args->list_order = -1 * $args->member_srl; |
2185 | 2185 | |
2186 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2187 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
2186 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2187 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
2188 | 2188 | |
2189 | 2189 | $oDB = &DB::getInstance(); |
2190 | 2190 | $oDB->begin(); |
2191 | 2191 | |
2192 | 2192 | $output = executeQuery('member.insertMember', $args); |
2193 | - if(!$output->toBool()) |
|
2193 | + if (!$output->toBool()) |
|
2194 | 2194 | { |
2195 | 2195 | $oDB->rollback(); |
2196 | 2196 | return $output; |
2197 | 2197 | } |
2198 | 2198 | |
2199 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2199 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2200 | 2200 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
2201 | 2201 | // If no value is entered the default group, the value of group registration |
2202 | - if(!$args->group_srl_list) |
|
2202 | + if (!$args->group_srl_list) |
|
2203 | 2203 | { |
2204 | 2204 | $columnList = array('site_srl', 'group_srl'); |
2205 | 2205 | $default_group = $oMemberModel->getDefaultGroup(0, $columnList); |
2206 | - if($default_group) |
|
2206 | + if ($default_group) |
|
2207 | 2207 | { |
2208 | 2208 | // Add to the default group |
2209 | - $output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl); |
|
2210 | - if(!$output->toBool()) |
|
2209 | + $output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl); |
|
2210 | + if (!$output->toBool()) |
|
2211 | 2211 | { |
2212 | 2212 | $oDB->rollback(); |
2213 | 2213 | return $output; |
@@ -2217,11 +2217,11 @@ discard block |
||
2217 | 2217 | } |
2218 | 2218 | else |
2219 | 2219 | { |
2220 | - for($i=0;$i<count($group_srl_list);$i++) |
|
2220 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
2221 | 2221 | { |
2222 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
2222 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
2223 | 2223 | |
2224 | - if(!$output->toBool()) |
|
2224 | + if (!$output->toBool()) |
|
2225 | 2225 | { |
2226 | 2226 | $oDB->rollback(); |
2227 | 2227 | return $output; |
@@ -2231,7 +2231,7 @@ discard block |
||
2231 | 2231 | |
2232 | 2232 | $member_config = $oModuleModel->getModuleConfig('member'); |
2233 | 2233 | // When using email authentication mode (when you subscribed members denied a) certified mail sent |
2234 | - if($args->denied == 'Y') |
|
2234 | + if ($args->denied == 'Y') |
|
2235 | 2235 | { |
2236 | 2236 | // Insert data into the authentication DB |
2237 | 2237 | $oPassword = new Password(); |
@@ -2243,7 +2243,7 @@ discard block |
||
2243 | 2243 | $auth_args->is_register = 'Y'; |
2244 | 2244 | |
2245 | 2245 | $output = executeQuery('member.insertAuthMail', $auth_args); |
2246 | - if(!$output->toBool()) |
|
2246 | + if (!$output->toBool()) |
|
2247 | 2247 | { |
2248 | 2248 | $oDB->rollback(); |
2249 | 2249 | return $output; |
@@ -2251,10 +2251,10 @@ discard block |
||
2251 | 2251 | $this->_sendAuthMail($auth_args, $args); |
2252 | 2252 | } |
2253 | 2253 | // Call a trigger (after) |
2254 | - if($output->toBool()) |
|
2254 | + if ($output->toBool()) |
|
2255 | 2255 | { |
2256 | 2256 | $trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args); |
2257 | - if(!$trigger_output->toBool()) |
|
2257 | + if (!$trigger_output->toBool()) |
|
2258 | 2258 | { |
2259 | 2259 | $oDB->rollback(); |
2260 | 2260 | return $trigger_output; |
@@ -2276,41 +2276,41 @@ discard block |
||
2276 | 2276 | { |
2277 | 2277 | // Call a trigger (before) |
2278 | 2278 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
2279 | - if(!$output->toBool()) return $output; |
|
2279 | + if (!$output->toBool()) return $output; |
|
2280 | 2280 | // Create a model object |
2281 | 2281 | $oMemberModel = getModel('member'); |
2282 | 2282 | |
2283 | 2283 | $logged_info = Context::get('logged_info'); |
2284 | 2284 | // Get what you want to modify the original information |
2285 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2285 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2286 | 2286 | // Control of essential parameters |
2287 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
2288 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
2287 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
2288 | + if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y'; |
|
2289 | 2289 | |
2290 | - if($logged_info->is_admin == 'Y') |
|
2290 | + if ($logged_info->is_admin == 'Y') |
|
2291 | 2291 | { |
2292 | - if($args->denied!='Y') $args->denied = 'N'; |
|
2293 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
2292 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
2293 | + if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
2294 | 2294 | } |
2295 | 2295 | else |
2296 | 2296 | { |
2297 | 2297 | unset($args->is_admin); |
2298 | - if($is_admin == false) |
|
2298 | + if ($is_admin == false) |
|
2299 | 2299 | unset($args->denied); |
2300 | - if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
2300 | + if ($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
2301 | 2301 | { |
2302 | 2302 | return $this->stop('msg_invalid_request'); |
2303 | 2303 | } |
2304 | 2304 | } |
2305 | 2305 | |
2306 | 2306 | // Sanitize user ID, username, nickname, homepage, blog |
2307 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2307 | + if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2308 | 2308 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2309 | 2309 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2310 | 2310 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2311 | 2311 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2312 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2313 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
2312 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2313 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
2314 | 2314 | |
2315 | 2315 | // check member identifier form |
2316 | 2316 | $config = $oMemberModel->getMemberConfig(); |
@@ -2319,56 +2319,56 @@ discard block |
||
2319 | 2319 | $orgMemberInfo = $output->data; |
2320 | 2320 | |
2321 | 2321 | // Check if email address or user ID is duplicate |
2322 | - if($config->identifier == 'email_address') |
|
2322 | + if ($config->identifier == 'email_address') |
|
2323 | 2323 | { |
2324 | 2324 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
2325 | - if($member_srl && $args->member_srl != $member_srl) |
|
2325 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2326 | 2326 | { |
2327 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
2327 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
2328 | 2328 | } |
2329 | 2329 | $args->email_address = $orgMemberInfo->email_address; |
2330 | 2330 | } |
2331 | 2331 | else |
2332 | 2332 | { |
2333 | 2333 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
2334 | - if($member_srl && $args->member_srl != $member_srl) |
|
2334 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2335 | 2335 | { |
2336 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
2336 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
2337 | 2337 | } |
2338 | 2338 | |
2339 | 2339 | $args->user_id = $orgMemberInfo->user_id; |
2340 | 2340 | } |
2341 | 2341 | |
2342 | - if($logged_info->is_admin !== 'Y') |
|
2342 | + if ($logged_info->is_admin !== 'Y') |
|
2343 | 2343 | { |
2344 | 2344 | // Check if ID is prohibited |
2345 | - if($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
2345 | + if ($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
2346 | 2346 | { |
2347 | - return new BaseObject(-1,'denied_user_id'); |
|
2347 | + return new BaseObject(-1, 'denied_user_id'); |
|
2348 | 2348 | } |
2349 | 2349 | |
2350 | 2350 | // Check if nickname is prohibited |
2351 | - if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
2351 | + if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
2352 | 2352 | { |
2353 | 2353 | return new BaseObject(-1, 'denied_nick_name'); |
2354 | 2354 | } |
2355 | 2355 | } |
2356 | 2356 | |
2357 | 2357 | // Check if ID is duplicate |
2358 | - if($args->user_id) |
|
2358 | + if ($args->user_id) |
|
2359 | 2359 | { |
2360 | 2360 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
2361 | - if($member_srl && $args->member_srl != $member_srl) |
|
2361 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2362 | 2362 | { |
2363 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
2363 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
2364 | 2364 | } |
2365 | 2365 | } |
2366 | 2366 | |
2367 | 2367 | // Check if nickname is duplicate |
2368 | 2368 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
2369 | - if($member_srl && $args->member_srl != $member_srl) |
|
2369 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2370 | 2370 | { |
2371 | - return new BaseObject(-1,'msg_exists_nick_name'); |
|
2371 | + return new BaseObject(-1, 'msg_exists_nick_name'); |
|
2372 | 2372 | } |
2373 | 2373 | |
2374 | 2374 | list($args->email_id, $args->email_host) = explode('@', $args->email_address); |
@@ -2377,9 +2377,9 @@ discard block |
||
2377 | 2377 | $oDB->begin(); |
2378 | 2378 | |
2379 | 2379 | // Check password strength |
2380 | - if($args->password) |
|
2380 | + if ($args->password) |
|
2381 | 2381 | { |
2382 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2382 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2383 | 2383 | { |
2384 | 2384 | $message = Context::getLang('about_password_strength'); |
2385 | 2385 | return new BaseObject(-1, $message[$config->password_strength]); |
@@ -2391,55 +2391,55 @@ discard block |
||
2391 | 2391 | $args->password = $orgMemberInfo->password; |
2392 | 2392 | } |
2393 | 2393 | |
2394 | - if($args->find_account_answer) { |
|
2394 | + if ($args->find_account_answer) { |
|
2395 | 2395 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
2396 | 2396 | } |
2397 | 2397 | else |
2398 | 2398 | { |
2399 | - $oPassword = new Password(); |
|
2399 | + $oPassword = new Password(); |
|
2400 | 2400 | $hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer); |
2401 | 2401 | |
2402 | - if($hashed) { |
|
2402 | + if ($hashed) { |
|
2403 | 2403 | $args->find_account_answer = $orgMemberInfo->find_account_answer; |
2404 | 2404 | } else { |
2405 | 2405 | $args->find_account_answer = $oPassword->createHash($orgMemberInfo->find_account_answer); |
2406 | 2406 | } |
2407 | 2407 | } |
2408 | 2408 | |
2409 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
2410 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
2411 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
2412 | - if(!$args->description) $args->description = $orgMemberInfo->description; |
|
2413 | - if(!$args->birthday) $args->birthday = ''; |
|
2409 | + if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
2410 | + if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
2411 | + if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
2412 | + if (!$args->description) $args->description = $orgMemberInfo->description; |
|
2413 | + if (!$args->birthday) $args->birthday = ''; |
|
2414 | 2414 | |
2415 | 2415 | $output = executeQuery('member.updateMember', $args); |
2416 | 2416 | |
2417 | - if(!$output->toBool()) |
|
2417 | + if (!$output->toBool()) |
|
2418 | 2418 | { |
2419 | 2419 | $oDB->rollback(); |
2420 | 2420 | return $output; |
2421 | 2421 | } |
2422 | 2422 | |
2423 | - if($args->group_srl_list) |
|
2423 | + if ($args->group_srl_list) |
|
2424 | 2424 | { |
2425 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2425 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2426 | 2426 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
2427 | 2427 | // If the group information, group information changes |
2428 | - if(count($group_srl_list) > 0) |
|
2428 | + if (count($group_srl_list) > 0) |
|
2429 | 2429 | { |
2430 | 2430 | $args->site_srl = 0; |
2431 | 2431 | // One of its members to delete all the group |
2432 | 2432 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
2433 | - if(!$output->toBool()) |
|
2433 | + if (!$output->toBool()) |
|
2434 | 2434 | { |
2435 | 2435 | $oDB->rollback(); |
2436 | 2436 | return $output; |
2437 | 2437 | } |
2438 | 2438 | // Enter one of the loop a |
2439 | - for($i=0;$i<count($group_srl_list);$i++) |
|
2439 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
2440 | 2440 | { |
2441 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
2442 | - if(!$output->toBool()) |
|
2441 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
2442 | + if (!$output->toBool()) |
|
2443 | 2443 | { |
2444 | 2444 | $oDB->rollback(); |
2445 | 2445 | return $output; |
@@ -2451,9 +2451,9 @@ discard block |
||
2451 | 2451 | } |
2452 | 2452 | } |
2453 | 2453 | // Call a trigger (after) |
2454 | - if($output->toBool()) { |
|
2454 | + if ($output->toBool()) { |
|
2455 | 2455 | $trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args); |
2456 | - if(!$trigger_output->toBool()) |
|
2456 | + if (!$trigger_output->toBool()) |
|
2457 | 2457 | { |
2458 | 2458 | $oDB->rollback(); |
2459 | 2459 | return $trigger_output; |
@@ -2466,7 +2466,7 @@ discard block |
||
2466 | 2466 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
2467 | 2467 | |
2468 | 2468 | // Save Session |
2469 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2469 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2470 | 2470 | $logged_info = Context::get('logged_info'); |
2471 | 2471 | |
2472 | 2472 | $output->add('member_srl', $args->member_srl); |
@@ -2478,14 +2478,14 @@ discard block |
||
2478 | 2478 | */ |
2479 | 2479 | function updateMemberPassword($args) |
2480 | 2480 | { |
2481 | - if($args->password) |
|
2481 | + if ($args->password) |
|
2482 | 2482 | { |
2483 | 2483 | |
2484 | 2484 | // check password strength |
2485 | 2485 | $oMemberModel = getModel('member'); |
2486 | 2486 | $config = $oMemberModel->getMemberConfig(); |
2487 | 2487 | |
2488 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2488 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2489 | 2489 | { |
2490 | 2490 | $message = Context::getLang('about_password_strength'); |
2491 | 2491 | return new BaseObject(-1, $message[$config->password_strength]); |
@@ -2493,13 +2493,13 @@ discard block |
||
2493 | 2493 | |
2494 | 2494 | $args->password = $oMemberModel->hashPassword($args->password); |
2495 | 2495 | } |
2496 | - else if($args->hashed_password) |
|
2496 | + else if ($args->hashed_password) |
|
2497 | 2497 | { |
2498 | 2498 | $args->password = $args->hashed_password; |
2499 | 2499 | } |
2500 | 2500 | |
2501 | 2501 | $output = executeQuery('member.updateMemberPassword', $args); |
2502 | - if($output->toBool()) |
|
2502 | + if ($output->toBool()) |
|
2503 | 2503 | { |
2504 | 2504 | $result = executeQuery('member.updateChangePasswordDate', $args); |
2505 | 2505 | } |
@@ -2511,7 +2511,7 @@ discard block |
||
2511 | 2511 | |
2512 | 2512 | function updateFindAccountAnswer($member_srl, $answer) |
2513 | 2513 | { |
2514 | - $oPassword = new Password(); |
|
2514 | + $oPassword = new Password(); |
|
2515 | 2515 | |
2516 | 2516 | $args = new stdClass(); |
2517 | 2517 | $args->member_srl = $member_srl; |
@@ -2528,18 +2528,18 @@ discard block |
||
2528 | 2528 | $trigger_obj = new stdClass(); |
2529 | 2529 | $trigger_obj->member_srl = $member_srl; |
2530 | 2530 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
2531 | - if(!$output->toBool()) return $output; |
|
2531 | + if (!$output->toBool()) return $output; |
|
2532 | 2532 | // Create a model object |
2533 | 2533 | $oMemberModel = getModel('member'); |
2534 | 2534 | // Bringing the user's information |
2535 | - if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
2535 | + if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
2536 | 2536 | { |
2537 | 2537 | $columnList = array('member_srl', 'is_admin'); |
2538 | 2538 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
2539 | 2539 | } |
2540 | - if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
2540 | + if (!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
2541 | 2541 | // If managers can not be deleted |
2542 | - if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
2542 | + if ($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
2543 | 2543 | |
2544 | 2544 | $oDB = &DB::getInstance(); |
2545 | 2545 | $oDB->begin(); |
@@ -2548,7 +2548,7 @@ discard block |
||
2548 | 2548 | $args->member_srl = $member_srl; |
2549 | 2549 | // Delete the entries in member_auth_mail |
2550 | 2550 | $output = executeQuery('member.deleteAuthMail', $args); |
2551 | - if(!$output->toBool()) |
|
2551 | + if (!$output->toBool()) |
|
2552 | 2552 | { |
2553 | 2553 | $oDB->rollback(); |
2554 | 2554 | return $output; |
@@ -2563,23 +2563,23 @@ discard block |
||
2563 | 2563 | */ |
2564 | 2564 | // Delete the entries in member_group_member |
2565 | 2565 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
2566 | - if(!$output->toBool()) |
|
2566 | + if (!$output->toBool()) |
|
2567 | 2567 | { |
2568 | 2568 | $oDB->rollback(); |
2569 | 2569 | return $output; |
2570 | 2570 | } |
2571 | 2571 | // member removed from the table |
2572 | 2572 | $output = executeQuery('member.deleteMember', $args); |
2573 | - if(!$output->toBool()) |
|
2573 | + if (!$output->toBool()) |
|
2574 | 2574 | { |
2575 | 2575 | $oDB->rollback(); |
2576 | 2576 | return $output; |
2577 | 2577 | } |
2578 | 2578 | // Call a trigger (after) |
2579 | - if($output->toBool()) |
|
2579 | + if ($output->toBool()) |
|
2580 | 2580 | { |
2581 | 2581 | $trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj); |
2582 | - if(!$trigger_output->toBool()) |
|
2582 | + if (!$trigger_output->toBool()) |
|
2583 | 2583 | { |
2584 | 2584 | $oDB->rollback(); |
2585 | 2585 | return $trigger_output; |
@@ -2603,23 +2603,23 @@ discard block |
||
2603 | 2603 | */ |
2604 | 2604 | function destroySessionInfo() |
2605 | 2605 | { |
2606 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
2606 | + if (!$_SESSION || !is_array($_SESSION)) return; |
|
2607 | 2607 | |
2608 | 2608 | $memberInfo = Context::get('logged_info'); |
2609 | 2609 | $memberSrl = $memberInfo->member_srl; |
2610 | 2610 | |
2611 | - foreach($_SESSION as $key => $val) |
|
2611 | + foreach ($_SESSION as $key => $val) |
|
2612 | 2612 | { |
2613 | 2613 | $_SESSION[$key] = ''; |
2614 | 2614 | } |
2615 | 2615 | |
2616 | 2616 | session_destroy(); |
2617 | - setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000); |
|
2618 | - setcookie('sso','',$_SERVER['REQUEST_TIME']-42000); |
|
2619 | - setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000); |
|
2617 | + setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000); |
|
2618 | + setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000); |
|
2619 | + setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000); |
|
2620 | 2620 | setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000); |
2621 | 2621 | |
2622 | - if($memberSrl || $_COOKIE['xeak']) |
|
2622 | + if ($memberSrl || $_COOKIE['xeak']) |
|
2623 | 2623 | { |
2624 | 2624 | $args = new stdClass(); |
2625 | 2625 | $args->member_srl = $memberSrl; |
@@ -2635,22 +2635,22 @@ discard block |
||
2635 | 2635 | $pointGroup = $pointModuleConfig->point_group; |
2636 | 2636 | |
2637 | 2637 | $levelGroup = array(); |
2638 | - if(is_array($pointGroup) && count($pointGroup)>0) |
|
2638 | + if (is_array($pointGroup) && count($pointGroup) > 0) |
|
2639 | 2639 | { |
2640 | 2640 | $levelGroup = array_flip($pointGroup); |
2641 | 2641 | ksort($levelGroup); |
2642 | 2642 | } |
2643 | 2643 | $maxLevel = 0; |
2644 | 2644 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
2645 | - if(count($resultGroup) > 0) |
|
2645 | + if (count($resultGroup) > 0) |
|
2646 | 2646 | $maxLevel = max(array_flip($resultGroup)); |
2647 | 2647 | |
2648 | - if($maxLevel > 0) |
|
2648 | + if ($maxLevel > 0) |
|
2649 | 2649 | { |
2650 | 2650 | $oPointModel = getModel('point'); |
2651 | 2651 | $originPoint = $oPointModel->getPoint($memberSrl); |
2652 | 2652 | |
2653 | - if($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
2653 | + if ($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
2654 | 2654 | { |
2655 | 2655 | $oPointController = getController('point'); |
2656 | 2656 | $oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update'); |
@@ -2660,18 +2660,18 @@ discard block |
||
2660 | 2660 | |
2661 | 2661 | function procMemberModifyEmailAddress() |
2662 | 2662 | { |
2663 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
2663 | + if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
2664 | 2664 | |
2665 | 2665 | $member_info = Context::get('logged_info'); |
2666 | 2666 | $newEmail = Context::get('email_address'); |
2667 | 2667 | |
2668 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
2668 | + if (!$newEmail) return $this->stop('msg_invalid_request'); |
|
2669 | 2669 | |
2670 | 2670 | $oMemberModel = getModel('member'); |
2671 | 2671 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
2672 | - if($member_srl) return new BaseObject(-1,'msg_exists_email_address'); |
|
2672 | + if ($member_srl) return new BaseObject(-1, 'msg_exists_email_address'); |
|
2673 | 2673 | |
2674 | - if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
2674 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
2675 | 2675 | { |
2676 | 2676 | return $this->stop('msg_invalid_request'); |
2677 | 2677 | } |
@@ -2687,7 +2687,7 @@ discard block |
||
2687 | 2687 | $oDB = &DB::getInstance(); |
2688 | 2688 | $oDB->begin(); |
2689 | 2689 | $output = executeQuery('member.insertAuthMail', $auth_args); |
2690 | - if(!$output->toBool()) |
|
2690 | + if (!$output->toBool()) |
|
2691 | 2691 | { |
2692 | 2692 | $oDB->rollback(); |
2693 | 2693 | return $output; |
@@ -2697,7 +2697,7 @@ discard block |
||
2697 | 2697 | $member_config = $oModuleModel->getModuleConfig('member'); |
2698 | 2698 | |
2699 | 2699 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
2700 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
2700 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
2701 | 2701 | |
2702 | 2702 | global $lang; |
2703 | 2703 | |
@@ -2709,17 +2709,17 @@ discard block |
||
2709 | 2709 | |
2710 | 2710 | Context::set('newEmail', $newEmail); |
2711 | 2711 | |
2712 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
|
2712 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key); |
|
2713 | 2713 | Context::set('auth_url', $auth_url); |
2714 | 2714 | |
2715 | 2715 | $oTemplate = &TemplateHandler::getInstance(); |
2716 | 2716 | $content = $oTemplate->compile($tpl_path, 'confirm_member_new_email'); |
2717 | 2717 | |
2718 | 2718 | $oMail = new Mail(); |
2719 | - $oMail->setTitle( Context::getLang('title_modify_email_address') ); |
|
2719 | + $oMail->setTitle(Context::getLang('title_modify_email_address')); |
|
2720 | 2720 | $oMail->setContent($content); |
2721 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
2722 | - $oMail->setReceiptor( $member_info->nick_name, $newEmail ); |
|
2721 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
2722 | + $oMail->setReceiptor($member_info->nick_name, $newEmail); |
|
2723 | 2723 | $result = $oMail->send(); |
2724 | 2724 | |
2725 | 2725 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail); |
@@ -2733,16 +2733,16 @@ discard block |
||
2733 | 2733 | { |
2734 | 2734 | $member_srl = Context::get('member_srl'); |
2735 | 2735 | $auth_key = Context::get('auth_key'); |
2736 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
2736 | + if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
2737 | 2737 | |
2738 | 2738 | // Test logs for finding password by user_id and authkey |
2739 | 2739 | $args = new stdClass; |
2740 | 2740 | $args->member_srl = $member_srl; |
2741 | 2741 | $args->auth_key = $auth_key; |
2742 | 2742 | $output = executeQuery('member.getAuthMail', $args); |
2743 | - if(!$output->toBool() || $output->data->auth_key != $auth_key) |
|
2743 | + if (!$output->toBool() || $output->data->auth_key != $auth_key) |
|
2744 | 2744 | { |
2745 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
2745 | + if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
2746 | 2746 | return $this->stop('msg_invalid_modify_email_auth_key'); |
2747 | 2747 | } |
2748 | 2748 | |
@@ -2751,10 +2751,10 @@ discard block |
||
2751 | 2751 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
2752 | 2752 | |
2753 | 2753 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
2754 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
2754 | + if (!$output->toBool()) return $this->stop($output->getMessage()); |
|
2755 | 2755 | |
2756 | 2756 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
2757 | - executeQuery('member.deleteAuthChangeEmailAddress',$args); |
|
2757 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
2758 | 2758 | |
2759 | 2759 | $this->_clearMemberCache($args->member_srl); |
2760 | 2760 | |
@@ -2772,7 +2772,7 @@ discard block |
||
2772 | 2772 | **/ |
2773 | 2773 | function triggerGetDocumentMenu(&$menu_list) |
2774 | 2774 | { |
2775 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
2775 | + if (!Context::get('is_logged')) return new BaseObject(); |
|
2776 | 2776 | |
2777 | 2777 | $logged_info = Context::get('logged_info'); |
2778 | 2778 | $document_srl = Context::get('target_srl'); |
@@ -2783,12 +2783,12 @@ discard block |
||
2783 | 2783 | $member_srl = $oDocument->get('member_srl'); |
2784 | 2784 | $module_srl = $oDocument->get('module_srl'); |
2785 | 2785 | |
2786 | - if(!$member_srl) return new BaseObject(); |
|
2787 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
2786 | + if (!$member_srl) return new BaseObject(); |
|
2787 | + if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject(); |
|
2788 | 2788 | |
2789 | 2789 | $oDocumentController = getController('document'); |
2790 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
2791 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup'); |
|
2790 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
2791 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
2792 | 2792 | |
2793 | 2793 | return new BaseObject(); |
2794 | 2794 | } |
@@ -2802,7 +2802,7 @@ discard block |
||
2802 | 2802 | **/ |
2803 | 2803 | function triggerGetCommentMenu(&$menu_list) |
2804 | 2804 | { |
2805 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
2805 | + if (!Context::get('is_logged')) return new BaseObject(); |
|
2806 | 2806 | |
2807 | 2807 | $logged_info = Context::get('logged_info'); |
2808 | 2808 | $comment_srl = Context::get('target_srl'); |
@@ -2813,12 +2813,12 @@ discard block |
||
2813 | 2813 | $module_srl = $oComment->get('module_srl'); |
2814 | 2814 | $member_srl = $oComment->get('member_srl'); |
2815 | 2815 | |
2816 | - if(!$member_srl) return new BaseObject(); |
|
2817 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
2816 | + if (!$member_srl) return new BaseObject(); |
|
2817 | + if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject(); |
|
2818 | 2818 | |
2819 | 2819 | $oCommentController = getController('comment'); |
2820 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
2821 | - $oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup'); |
|
2820 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
2821 | + $oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
2822 | 2822 | |
2823 | 2823 | return new BaseObject(); |
2824 | 2824 | } |
@@ -2830,7 +2830,7 @@ discard block |
||
2830 | 2830 | **/ |
2831 | 2831 | function procMemberSpammerManage() |
2832 | 2832 | { |
2833 | - if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted'); |
|
2833 | + if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted'); |
|
2834 | 2834 | |
2835 | 2835 | $logged_info = Context::get('logged_info'); |
2836 | 2836 | $member_srl = Context::get('member_srl'); |
@@ -2838,7 +2838,7 @@ discard block |
||
2838 | 2838 | $cnt_loop = Context::get('cnt_loop'); |
2839 | 2839 | $proc_type = Context::get('proc_type'); |
2840 | 2840 | $isMoveToTrash = true; |
2841 | - if($proc_type == "delete") |
|
2841 | + if ($proc_type == "delete") |
|
2842 | 2842 | $isMoveToTrash = false; |
2843 | 2843 | |
2844 | 2844 | // check grant |
@@ -2847,7 +2847,7 @@ discard block |
||
2847 | 2847 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
2848 | 2848 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
2849 | 2849 | |
2850 | - if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted'); |
|
2850 | + if (!$grant->manager) return new BaseObject(-1, 'msg_not_permitted'); |
|
2851 | 2851 | |
2852 | 2852 | $proc_msg = ""; |
2853 | 2853 | |
@@ -2856,10 +2856,10 @@ discard block |
||
2856 | 2856 | |
2857 | 2857 | // delete or trash destination |
2858 | 2858 | // proc member |
2859 | - if($cnt_loop == 1) |
|
2859 | + if ($cnt_loop == 1) |
|
2860 | 2860 | $this->_spammerMember($member_srl); |
2861 | 2861 | // proc document and comment |
2862 | - elseif($cnt_loop>1) |
|
2862 | + elseif ($cnt_loop > 1) |
|
2863 | 2863 | $this->_spammerDocuments($member_srl, $isMoveToTrash); |
2864 | 2864 | |
2865 | 2865 | // get destination count |
@@ -2868,11 +2868,11 @@ discard block |
||
2868 | 2868 | |
2869 | 2869 | $total_count = Context::get('total_count'); |
2870 | 2870 | $remain_count = $cnt_document + $cnt_comment; |
2871 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
2871 | + if ($cnt_loop == 1) $total_count = $remain_count; |
|
2872 | 2872 | |
2873 | 2873 | // get progress percent |
2874 | - if($total_count > 0) |
|
2875 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
2874 | + if ($total_count > 0) |
|
2875 | + $progress = intval((($total_count - $remain_count) / $total_count) * 100); |
|
2876 | 2876 | else |
2877 | 2877 | $progress = 100; |
2878 | 2878 | |
@@ -2896,7 +2896,7 @@ discard block |
||
2896 | 2896 | **/ |
2897 | 2897 | private function _spammerMember($member_srl) { |
2898 | 2898 | $logged_info = Context::get('logged_info'); |
2899 | - $spam_description = trim( Context::get('spam_description') ); |
|
2899 | + $spam_description = trim(Context::get('spam_description')); |
|
2900 | 2900 | |
2901 | 2901 | $oMemberModel = getModel('member'); |
2902 | 2902 | $columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description'); |
@@ -2915,10 +2915,10 @@ discard block |
||
2915 | 2915 | $args->user_id = $member_info->user_id; |
2916 | 2916 | $args->nick_name = $member_info->nick_name; |
2917 | 2917 | $args->denied = "Y"; |
2918 | - $args->description = trim( $member_info->description ); |
|
2919 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
2918 | + $args->description = trim($member_info->description); |
|
2919 | + if ($args->description != "") $args->description .= "\n"; // add new line |
|
2920 | 2920 | |
2921 | - $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 . "]"; |
|
2921 | + $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."]"; |
|
2922 | 2922 | |
2923 | 2923 | $output = $this->updateMember($args, true); |
2924 | 2924 | |
@@ -2947,21 +2947,21 @@ discard block |
||
2947 | 2947 | // 1. proc comment, 2. proc document |
2948 | 2948 | $cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl); |
2949 | 2949 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
2950 | - if($cnt_comment > 0) |
|
2950 | + if ($cnt_comment > 0) |
|
2951 | 2951 | { |
2952 | 2952 | $columnList = array(); |
2953 | 2953 | $commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
2954 | - if($commentList) { |
|
2955 | - foreach($commentList as $v) { |
|
2954 | + if ($commentList) { |
|
2955 | + foreach ($commentList as $v) { |
|
2956 | 2956 | $oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash); |
2957 | 2957 | } |
2958 | 2958 | } |
2959 | - } elseif($cnt_document > 0) { |
|
2959 | + } elseif ($cnt_document > 0) { |
|
2960 | 2960 | $columnList = array(); |
2961 | 2961 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
2962 | - if($documentList) { |
|
2963 | - foreach($documentList as $v) { |
|
2964 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
2962 | + if ($documentList) { |
|
2963 | + foreach ($documentList as $v) { |
|
2964 | + if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
2965 | 2965 | else $oDocumentController->deleteDocument($v->document_srl); |
2966 | 2966 | } |
2967 | 2967 | } |
@@ -2973,24 +2973,24 @@ discard block |
||
2973 | 2973 | function _clearMemberCache($member_srl, $site_srl = 0) |
2974 | 2974 | { |
2975 | 2975 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
2976 | - if($oCacheHandler->isSupport()) |
|
2976 | + if ($oCacheHandler->isSupport()) |
|
2977 | 2977 | { |
2978 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl; |
|
2978 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl; |
|
2979 | 2979 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
2980 | 2980 | $oCacheHandler->delete($cache_key); |
2981 | 2981 | |
2982 | - if($site_srl !== 0) |
|
2982 | + if ($site_srl !== 0) |
|
2983 | 2983 | { |
2984 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0'; |
|
2984 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0'; |
|
2985 | 2985 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
2986 | 2986 | $oCacheHandler->delete($cache_key); |
2987 | 2987 | } |
2988 | 2988 | } |
2989 | 2989 | |
2990 | 2990 | $oCacheHandler = CacheHandler::getInstance('object'); |
2991 | - if($oCacheHandler->isSupport()) |
|
2991 | + if ($oCacheHandler->isSupport()) |
|
2992 | 2992 | { |
2993 | - $object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl; |
|
2993 | + $object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl; |
|
2994 | 2994 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
2995 | 2995 | $oCacheHandler->delete($cache_key); |
2996 | 2996 | } |
@@ -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); |
@@ -772,10 +868,13 @@ discard block |
||
772 | 868 | // Get file information |
773 | 869 | FileHandler::clearStatCache($target_file); |
774 | 870 | list($width, $height, $type) = @getimagesize($target_file); |
775 | - if(IMAGETYPE_PNG == $type) $ext = 'png'; |
|
776 | - elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
777 | - elseif(IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
778 | - else |
|
871 | + if(IMAGETYPE_PNG == $type) { |
|
872 | + $ext = 'png'; |
|
873 | + } elseif(IMAGETYPE_JPEG == $type) { |
|
874 | + $ext = 'jpg'; |
|
875 | + } elseif(IMAGETYPE_GIF == $type) { |
|
876 | + $ext = 'gif'; |
|
877 | + } else |
|
779 | 878 | { |
780 | 879 | return $this->stop('msg_not_uploaded_profile_image'); |
781 | 880 | } |
@@ -806,8 +905,7 @@ discard block |
||
806 | 905 | FileHandler::removeFilesInDir($target_path); |
807 | 906 | FileHandler::moveFile($temp_filename, $target_filename); |
808 | 907 | FileHandler::clearStatCache($target_filename); |
809 | - } |
|
810 | - else |
|
908 | + } else |
|
811 | 909 | { |
812 | 910 | // 파일 용량 제한 |
813 | 911 | $filesize = filesize($target_file); |
@@ -836,20 +934,30 @@ discard block |
||
836 | 934 | { |
837 | 935 | // Check if the file is successfully uploaded |
838 | 936 | $file = $_FILES['image_name']; |
839 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
937 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
938 | + return $this->stop('msg_not_uploaded_image_name'); |
|
939 | + } |
|
840 | 940 | // Ignore if member_srl is invalid or doesn't exist. |
841 | 941 | $member_srl = Context::get('member_srl'); |
842 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
942 | + if(!$member_srl) { |
|
943 | + return $this->stop('msg_not_uploaded_image_name'); |
|
944 | + } |
|
843 | 945 | |
844 | 946 | $logged_info = Context::get('logged_info'); |
845 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
947 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
948 | + return $this->stop('msg_not_uploaded_image_name'); |
|
949 | + } |
|
846 | 950 | // Return if member module is set not to use an image name or the user is not an administrator ; |
847 | 951 | $oMemberModel = getModel('member'); |
848 | 952 | $config = $oMemberModel->getMemberConfig(); |
849 | - if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
953 | + if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') { |
|
954 | + return $this->stop('msg_not_uploaded_image_name'); |
|
955 | + } |
|
850 | 956 | |
851 | 957 | $output = $this->insertImageName($member_srl, $file['tmp_name']); |
852 | - if(!$output->toBool()) return $output; |
|
958 | + if(!$output->toBool()) { |
|
959 | + return $output; |
|
960 | + } |
|
853 | 961 | |
854 | 962 | // Page refresh |
855 | 963 | //$this->setRefreshPage(); |
@@ -904,8 +1012,7 @@ discard block |
||
904 | 1012 | FileHandler::removeFilesInDir($target_path); |
905 | 1013 | FileHandler::moveFile($temp_filename, $target_filename); |
906 | 1014 | FileHandler::clearStatCache($target_filename); |
907 | - } |
|
908 | - else |
|
1015 | + } else |
|
909 | 1016 | { |
910 | 1017 | // 파일 용량 제한 |
911 | 1018 | $filesize = filesize($target_file); |
@@ -982,20 +1089,30 @@ discard block |
||
982 | 1089 | { |
983 | 1090 | // Check if the file is successfully uploaded |
984 | 1091 | $file = $_FILES['image_mark']; |
985 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
1092 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
1093 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
1094 | + } |
|
986 | 1095 | // Ignore if member_srl is invalid or doesn't exist. |
987 | 1096 | $member_srl = Context::get('member_srl'); |
988 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
1097 | + if(!$member_srl) { |
|
1098 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
1099 | + } |
|
989 | 1100 | |
990 | 1101 | $logged_info = Context::get('logged_info'); |
991 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
1102 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
1103 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
1104 | + } |
|
992 | 1105 | // Membership in the images mark the module using the ban was set by an administrator or return; |
993 | 1106 | $oMemberModel = getModel('member'); |
994 | 1107 | $config = $oMemberModel->getMemberConfig(); |
995 | - if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
1108 | + if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') { |
|
1109 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
1110 | + } |
|
996 | 1111 | |
997 | 1112 | $this->insertImageMark($member_srl, $file['tmp_name']); |
998 | - if(!$output->toBool()) return $output; |
|
1113 | + if(!$output->toBool()) { |
|
1114 | + return $output; |
|
1115 | + } |
|
999 | 1116 | |
1000 | 1117 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
1001 | 1118 | $this->setRedirectUrl($returnUrl); |
@@ -1046,8 +1163,7 @@ discard block |
||
1046 | 1163 | FileHandler::removeFilesInDir($target_path); |
1047 | 1164 | FileHandler::moveFile($temp_filename, $target_filename); |
1048 | 1165 | FileHandler::clearStatCache($target_filename); |
1049 | - } |
|
1050 | - else |
|
1166 | + } else |
|
1051 | 1167 | { |
1052 | 1168 | $filesize = filesize($target_file); |
1053 | 1169 | if($max_filesize && $filesize > ($max_filesize * 1024)) |
@@ -1099,14 +1215,18 @@ discard block |
||
1099 | 1215 | function procMemberFindAccount() |
1100 | 1216 | { |
1101 | 1217 | $email_address = Context::get('email_address'); |
1102 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1218 | + if(!$email_address) { |
|
1219 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
1220 | + } |
|
1103 | 1221 | |
1104 | 1222 | $oMemberModel = getModel('member'); |
1105 | 1223 | $oModuleModel = getModel('module'); |
1106 | 1224 | |
1107 | 1225 | // Check if a member having the same email address exists |
1108 | 1226 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1109 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1227 | + if(!$member_srl) { |
|
1228 | + return new BaseObject(-1, 'msg_email_not_exists'); |
|
1229 | + } |
|
1110 | 1230 | |
1111 | 1231 | // Get information of the member |
1112 | 1232 | $columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name'); |
@@ -1118,7 +1238,9 @@ discard block |
||
1118 | 1238 | $chk_args = new stdClass; |
1119 | 1239 | $chk_args->member_srl = $member_info->member_srl; |
1120 | 1240 | $output = executeQuery('member.chkAuthMail', $chk_args); |
1121 | - if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
1241 | + if($output->toBool() && $output->data->count != '0') { |
|
1242 | + return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
1243 | + } |
|
1122 | 1244 | } |
1123 | 1245 | |
1124 | 1246 | // Insert data into the authentication DB |
@@ -1131,7 +1253,9 @@ discard block |
||
1131 | 1253 | $args->is_register = 'N'; |
1132 | 1254 | |
1133 | 1255 | $output = executeQuery('member.insertAuthMail', $args); |
1134 | - if(!$output->toBool()) return $output; |
|
1256 | + if(!$output->toBool()) { |
|
1257 | + return $output; |
|
1258 | + } |
|
1135 | 1259 | // Get content of the email to send a member |
1136 | 1260 | Context::set('auth_args', $args); |
1137 | 1261 | |
@@ -1148,8 +1272,7 @@ discard block |
||
1148 | 1272 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1149 | 1273 | } |
1150 | 1274 | } |
1151 | - } |
|
1152 | - else |
|
1275 | + } else |
|
1153 | 1276 | { |
1154 | 1277 | $memberInfo[$lang->user_id] = $args->user_id; |
1155 | 1278 | $memberInfo[$lang->user_name] = $args->user_name; |
@@ -1158,13 +1281,19 @@ discard block |
||
1158 | 1281 | } |
1159 | 1282 | Context::set('memberInfo', $memberInfo); |
1160 | 1283 | |
1161 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1162 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1284 | + if(!$member_config->skin) { |
|
1285 | + $member_config->skin = "default"; |
|
1286 | + } |
|
1287 | + if(!$member_config->colorset) { |
|
1288 | + $member_config->colorset = "white"; |
|
1289 | + } |
|
1163 | 1290 | |
1164 | 1291 | Context::set('member_config', $member_config); |
1165 | 1292 | |
1166 | 1293 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1167 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1294 | + if(!is_dir($tpl_path)) { |
|
1295 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1296 | + } |
|
1168 | 1297 | |
1169 | 1298 | $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
1170 | 1299 | Context::set('find_url', $find_url); |
@@ -1207,19 +1336,25 @@ discard block |
||
1207 | 1336 | $find_account_question = trim(Context::get('find_account_question')); |
1208 | 1337 | $find_account_answer = trim(Context::get('find_account_answer')); |
1209 | 1338 | |
1210 | - if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
1339 | + if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) { |
|
1340 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
1341 | + } |
|
1211 | 1342 | |
1212 | 1343 | $oModuleModel = getModel('module'); |
1213 | 1344 | // Check if a member having the same email address exists |
1214 | 1345 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1215 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
1346 | + if(!$member_srl) { |
|
1347 | + return new BaseObject(-1, 'msg_email_not_exists'); |
|
1348 | + } |
|
1216 | 1349 | |
1217 | 1350 | // Get information of the member |
1218 | 1351 | $columnList = array('member_srl', 'find_account_question', 'find_account_answer'); |
1219 | 1352 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
1220 | 1353 | |
1221 | 1354 | // Display a message if no answer is entered |
1222 | - if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
1355 | + if(!$member_info->find_account_question || !$member_info->find_account_answer) { |
|
1356 | + return new BaseObject(-1, 'msg_question_not_exists'); |
|
1357 | + } |
|
1223 | 1358 | |
1224 | 1359 | // 답변 확인 |
1225 | 1360 | $hashed = $oPassword->checkAlgorithm($member_info->find_account_answer); |
@@ -1228,12 +1363,10 @@ discard block |
||
1228 | 1363 | if($member_info->find_account_question != $find_account_question) |
1229 | 1364 | { |
1230 | 1365 | $authed = false; |
1231 | - } |
|
1232 | - else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
1366 | + } else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
1233 | 1367 | { |
1234 | 1368 | $authed = false; |
1235 | - } |
|
1236 | - else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
1369 | + } else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
1237 | 1370 | { |
1238 | 1371 | $authed = false; |
1239 | 1372 | } |
@@ -1262,7 +1395,9 @@ discard block |
||
1262 | 1395 | $args->password = $temp_password; |
1263 | 1396 | $args->change_password_date = '1'; |
1264 | 1397 | $output = $this->updateMemberPassword($args); |
1265 | - if(!$output->toBool()) return $output; |
|
1398 | + if(!$output->toBool()) { |
|
1399 | + return $output; |
|
1400 | + } |
|
1266 | 1401 | |
1267 | 1402 | $_SESSION['xe_temp_password_' . $user_id] = $temp_password; |
1268 | 1403 | |
@@ -1319,8 +1454,7 @@ discard block |
||
1319 | 1454 | if($output->data->is_register == 'Y') |
1320 | 1455 | { |
1321 | 1456 | $args->denied = 'N'; |
1322 | - } |
|
1323 | - else |
|
1457 | + } else |
|
1324 | 1458 | { |
1325 | 1459 | $args->password = $oMemberModel->hashPassword($args->password); |
1326 | 1460 | } |
@@ -1354,33 +1488,45 @@ discard block |
||
1354 | 1488 | { |
1355 | 1489 | // Get an email_address |
1356 | 1490 | $email_address = Context::get('email_address'); |
1357 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
1491 | + if(!$email_address) { |
|
1492 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
1493 | + } |
|
1358 | 1494 | // Log test by using email_address |
1359 | 1495 | $oMemberModel = getModel('member'); |
1360 | 1496 | |
1361 | 1497 | $args = new stdClass; |
1362 | 1498 | $args->email_address = $email_address; |
1363 | 1499 | $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1364 | - if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
1500 | + if(!$memberSrl) { |
|
1501 | + return new BaseObject(-1, 'msg_not_exists_member'); |
|
1502 | + } |
|
1365 | 1503 | |
1366 | 1504 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address'); |
1367 | 1505 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList); |
1368 | 1506 | |
1369 | 1507 | $oModuleModel = getModel('module'); |
1370 | 1508 | $member_config = $oModuleModel->getModuleConfig('member'); |
1371 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1372 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1509 | + if(!$member_config->skin) { |
|
1510 | + $member_config->skin = "default"; |
|
1511 | + } |
|
1512 | + if(!$member_config->colorset) { |
|
1513 | + $member_config->colorset = "white"; |
|
1514 | + } |
|
1373 | 1515 | |
1374 | 1516 | // Check if a authentication mail has been sent previously |
1375 | 1517 | $chk_args = new stdClass; |
1376 | 1518 | $chk_args->member_srl = $member_info->member_srl; |
1377 | 1519 | $output = executeQuery('member.chkAuthMail', $chk_args); |
1378 | - if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
1520 | + if($output->toBool() && $output->data->count == '0') { |
|
1521 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
1522 | + } |
|
1379 | 1523 | |
1380 | 1524 | $auth_args = new stdClass; |
1381 | 1525 | $auth_args->member_srl = $member_info->member_srl; |
1382 | 1526 | $output = executeQueryArray('member.getAuthMailInfo', $auth_args); |
1383 | - if(!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
1527 | + if(!$output->data || !$output->data[0]->auth_key) { |
|
1528 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
1529 | + } |
|
1384 | 1530 | $auth_info = $output->data[0]; |
1385 | 1531 | |
1386 | 1532 | // Update the regdate of authmail entry |
@@ -1401,8 +1547,7 @@ discard block |
||
1401 | 1547 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1402 | 1548 | } |
1403 | 1549 | } |
1404 | - } |
|
1405 | - else |
|
1550 | + } else |
|
1406 | 1551 | { |
1407 | 1552 | $memberInfo[$lang->user_id] = $member_info->user_id; |
1408 | 1553 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1415,7 +1560,9 @@ discard block |
||
1415 | 1560 | Context::set('member_config', $member_config); |
1416 | 1561 | |
1417 | 1562 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1418 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1563 | + if(!is_dir($tpl_path)) { |
|
1564 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1565 | + } |
|
1419 | 1566 | |
1420 | 1567 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); |
1421 | 1568 | Context::set('auth_url', $auth_url); |
@@ -1493,7 +1640,9 @@ discard block |
||
1493 | 1640 | $auth_args->is_register = 'Y'; |
1494 | 1641 | |
1495 | 1642 | $output = executeQuery('member.insertAuthMail', $auth_args); |
1496 | - if(!$output->toBool()) return $output; |
|
1643 | + if(!$output->toBool()) { |
|
1644 | + return $output; |
|
1645 | + } |
|
1497 | 1646 | |
1498 | 1647 | $memberInfo->email_address = $newEmail; |
1499 | 1648 | |
@@ -1527,8 +1676,7 @@ discard block |
||
1527 | 1676 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1528 | 1677 | } |
1529 | 1678 | } |
1530 | - } |
|
1531 | - else |
|
1679 | + } else |
|
1532 | 1680 | { |
1533 | 1681 | $memberInfo[$lang->user_id] = $member_info->user_id; |
1534 | 1682 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1537,13 +1685,19 @@ discard block |
||
1537 | 1685 | } |
1538 | 1686 | Context::set('memberInfo', $memberInfo); |
1539 | 1687 | |
1540 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1541 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1688 | + if(!$member_config->skin) { |
|
1689 | + $member_config->skin = "default"; |
|
1690 | + } |
|
1691 | + if(!$member_config->colorset) { |
|
1692 | + $member_config->colorset = "white"; |
|
1693 | + } |
|
1542 | 1694 | |
1543 | 1695 | Context::set('member_config', $member_config); |
1544 | 1696 | |
1545 | 1697 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1546 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1698 | + if(!is_dir($tpl_path)) { |
|
1699 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1700 | + } |
|
1547 | 1701 | |
1548 | 1702 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
1549 | 1703 | Context::set('auth_url', $auth_url); |
@@ -1568,7 +1722,9 @@ discard block |
||
1568 | 1722 | { |
1569 | 1723 | $site_module_info = Context::get('site_module_info'); |
1570 | 1724 | $logged_info = Context::get('logged_info'); |
1571 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
1725 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
1726 | + return new BaseObject(-1,'msg_invalid_request'); |
|
1727 | + } |
|
1572 | 1728 | |
1573 | 1729 | $oMemberModel = getModel('member'); |
1574 | 1730 | $columnList = array('site_srl', 'group_srl', 'title'); |
@@ -1587,13 +1743,17 @@ discard block |
||
1587 | 1743 | { |
1588 | 1744 | $site_module_info = Context::get('site_module_info'); |
1589 | 1745 | $logged_info = Context::get('logged_info'); |
1590 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
1746 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
1747 | + return new BaseObject(-1,'msg_invalid_request'); |
|
1748 | + } |
|
1591 | 1749 | |
1592 | 1750 | $args = new stdClass; |
1593 | 1751 | $args->site_srl= $site_module_info->site_srl; |
1594 | 1752 | $args->member_srl = $logged_info->member_srl; |
1595 | 1753 | $output = executeQuery('member.deleteMembersGroup', $args); |
1596 | - if(!$output->toBool()) return $output; |
|
1754 | + if(!$output->toBool()) { |
|
1755 | + return $output; |
|
1756 | + } |
|
1597 | 1757 | $this->setMessage('success_deleted'); |
1598 | 1758 | $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl); |
1599 | 1759 | } |
@@ -1607,17 +1767,37 @@ discard block |
||
1607 | 1767 | */ |
1608 | 1768 | function setMemberConfig($args) |
1609 | 1769 | { |
1610 | - if(!$args->skin) $args->skin = "default"; |
|
1611 | - if(!$args->colorset) $args->colorset = "white"; |
|
1612 | - if(!$args->editor_skin) $args->editor_skin= "ckeditor"; |
|
1613 | - if(!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
1614 | - if($args->enable_join!='Y') $args->enable_join = 'N'; |
|
1770 | + if(!$args->skin) { |
|
1771 | + $args->skin = "default"; |
|
1772 | + } |
|
1773 | + if(!$args->colorset) { |
|
1774 | + $args->colorset = "white"; |
|
1775 | + } |
|
1776 | + if(!$args->editor_skin) { |
|
1777 | + $args->editor_skin= "ckeditor"; |
|
1778 | + } |
|
1779 | + if(!$args->editor_colorset) { |
|
1780 | + $args->editor_colorset = "moono"; |
|
1781 | + } |
|
1782 | + if($args->enable_join!='Y') { |
|
1783 | + $args->enable_join = 'N'; |
|
1784 | + } |
|
1615 | 1785 | $args->enable_openid= 'N'; |
1616 | - if($args->profile_image !='Y') $args->profile_image = 'N'; |
|
1617 | - if($args->image_name!='Y') $args->image_name = 'N'; |
|
1618 | - if($args->image_mark!='Y') $args->image_mark = 'N'; |
|
1619 | - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; |
|
1620 | - if(!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
1786 | + if($args->profile_image !='Y') { |
|
1787 | + $args->profile_image = 'N'; |
|
1788 | + } |
|
1789 | + if($args->image_name!='Y') { |
|
1790 | + $args->image_name = 'N'; |
|
1791 | + } |
|
1792 | + if($args->image_mark!='Y') { |
|
1793 | + $args->image_mark = 'N'; |
|
1794 | + } |
|
1795 | + if($args->group_image_mark!='Y') { |
|
1796 | + $args->group_image_mark = 'N'; |
|
1797 | + } |
|
1798 | + if(!trim(strip_tags($args->agreement))) { |
|
1799 | + $args->agreement = null; |
|
1800 | + } |
|
1621 | 1801 | $args->limit_day = (int)$args->limit_day; |
1622 | 1802 | |
1623 | 1803 | $agreement = trim($args->agreement); |
@@ -1625,7 +1805,9 @@ discard block |
||
1625 | 1805 | |
1626 | 1806 | $oModuleController = getController('module'); |
1627 | 1807 | $output = $oModuleController->insertModuleConfig('member',$args); |
1628 | - if(!$output->toBool()) return $output; |
|
1808 | + if(!$output->toBool()) { |
|
1809 | + return $output; |
|
1810 | + } |
|
1629 | 1811 | |
1630 | 1812 | $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
1631 | 1813 | FileHandler::writeFile($agreement_file, $agreement); |
@@ -1650,7 +1832,9 @@ discard block |
||
1650 | 1832 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
1651 | 1833 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
1652 | 1834 | |
1653 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
1835 | + if(!$check_signature) { |
|
1836 | + return FileHandler::removeFile($filename); |
|
1837 | + } |
|
1654 | 1838 | |
1655 | 1839 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
1656 | 1840 | FileHandler::makeDir($path); |
@@ -1684,7 +1868,9 @@ discard block |
||
1684 | 1868 | $args = new stdClass(); |
1685 | 1869 | $args->member_srl = $member_srl; |
1686 | 1870 | $args->group_srl = $group_srl; |
1687 | - if($site_srl) $args->site_srl = $site_srl; |
|
1871 | + if($site_srl) { |
|
1872 | + $args->site_srl = $site_srl; |
|
1873 | + } |
|
1688 | 1874 | |
1689 | 1875 | // Add |
1690 | 1876 | $output = executeQuery('member.addMemberToGroup',$args); |
@@ -1710,15 +1896,21 @@ discard block |
||
1710 | 1896 | $obj->member_srl = implode(',',$args->member_srl); |
1711 | 1897 | |
1712 | 1898 | $output = executeQueryArray('member.getMembersGroup', $obj); |
1713 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1899 | + if($output->data) { |
|
1900 | + foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1901 | + } |
|
1714 | 1902 | |
1715 | 1903 | $output = executeQuery('member.deleteMembersGroup', $obj); |
1716 | - if(!$output->toBool()) return $output; |
|
1904 | + if(!$output->toBool()) { |
|
1905 | + return $output; |
|
1906 | + } |
|
1717 | 1907 | |
1718 | 1908 | $inserted_members = array(); |
1719 | 1909 | foreach($args->member_srl as $key => $val) |
1720 | 1910 | { |
1721 | - if($inserted_members[$val]) continue; |
|
1911 | + if($inserted_members[$val]) { |
|
1912 | + continue; |
|
1913 | + } |
|
1722 | 1914 | $inserted_members[$val] = true; |
1723 | 1915 | |
1724 | 1916 | unset($obj); |
@@ -1728,7 +1920,9 @@ discard block |
||
1728 | 1920 | $obj->site_srl = $args->site_srl; |
1729 | 1921 | $obj->regdate = $date[$obj->member_srl]; |
1730 | 1922 | $output = executeQuery('member.addMemberToGroup', $obj); |
1731 | - if(!$output->toBool()) return $output; |
|
1923 | + if(!$output->toBool()) { |
|
1924 | + return $output; |
|
1925 | + } |
|
1732 | 1926 | |
1733 | 1927 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
1734 | 1928 | } |
@@ -1790,8 +1984,7 @@ discard block |
||
1790 | 1984 | if($config->identifier == 'user_id') |
1791 | 1985 | { |
1792 | 1986 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
1793 | - } |
|
1794 | - else |
|
1987 | + } else |
|
1795 | 1988 | { |
1796 | 1989 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
1797 | 1990 | } |
@@ -1800,8 +1993,7 @@ discard block |
||
1800 | 1993 | $do_auto_login = true; |
1801 | 1994 | } |
1802 | 1995 | |
1803 | - } |
|
1804 | - else |
|
1996 | + } else |
|
1805 | 1997 | { |
1806 | 1998 | $do_auto_login = true; |
1807 | 1999 | } |
@@ -1810,8 +2002,7 @@ discard block |
||
1810 | 2002 | if($do_auto_login) |
1811 | 2003 | { |
1812 | 2004 | $output = $this->doLogin($user_id); |
1813 | - } |
|
1814 | - else |
|
2005 | + } else |
|
1815 | 2006 | { |
1816 | 2007 | executeQuery('member.deleteAutologin', $args); |
1817 | 2008 | setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
@@ -1830,13 +2021,17 @@ discard block |
||
1830 | 2021 | function doLogin($user_id, $password = '', $keep_signed = false) |
1831 | 2022 | { |
1832 | 2023 | $user_id = strtolower($user_id); |
1833 | - if(!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
2024 | + if(!$user_id) { |
|
2025 | + return new BaseObject(-1, 'null_user_id'); |
|
2026 | + } |
|
1834 | 2027 | // Call a trigger before log-in (before) |
1835 | 2028 | $trigger_obj = new stdClass(); |
1836 | 2029 | $trigger_obj->user_id = $user_id; |
1837 | 2030 | $trigger_obj->password = $password; |
1838 | 2031 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
1839 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
2032 | + if(!$trigger_output->toBool()) { |
|
2033 | + return $trigger_output; |
|
2034 | + } |
|
1840 | 2035 | // Create a member model object |
1841 | 2036 | $oMemberModel = getModel('member'); |
1842 | 2037 | |
@@ -1851,15 +2046,18 @@ discard block |
||
1851 | 2046 | // Get user_id information |
1852 | 2047 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
1853 | 2048 | // Set an invalid user if no value returned |
1854 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
2049 | + if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) { |
|
2050 | + return $this->recordLoginError(-1, 'invalid_email_address'); |
|
2051 | + } |
|
1855 | 2052 | |
1856 | - } |
|
1857 | - else |
|
2053 | + } else |
|
1858 | 2054 | { |
1859 | 2055 | // Get user_id information |
1860 | 2056 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
1861 | 2057 | // Set an invalid user if no value returned |
1862 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
2058 | + if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) { |
|
2059 | + return $this->recordLoginError(-1, 'invalid_user_id'); |
|
2060 | + } |
|
1863 | 2061 | } |
1864 | 2062 | |
1865 | 2063 | $output = executeQuery('member.getLoginCountByIp', $args); |
@@ -1871,14 +2069,18 @@ discard block |
||
1871 | 2069 | if($term < $config->max_error_count_time) |
1872 | 2070 | { |
1873 | 2071 | $term = $config->max_error_count_time - $term; |
1874 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
1875 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
1876 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
1877 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
2072 | + if($term < 60) { |
|
2073 | + $term = intval($term).Context::getLang('unit_sec'); |
|
2074 | + } elseif(60 <= $term && $term < 3600) { |
|
2075 | + $term = intval($term/60).Context::getLang('unit_min'); |
|
2076 | + } elseif(3600 <= $term && $term < 86400) { |
|
2077 | + $term = intval($term/3600).Context::getLang('unit_hour'); |
|
2078 | + } else { |
|
2079 | + $term = intval($term/86400).Context::getLang('unit_day'); |
|
2080 | + } |
|
1878 | 2081 | |
1879 | 2082 | return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
1880 | - } |
|
1881 | - else |
|
2083 | + } else |
|
1882 | 2084 | { |
1883 | 2085 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
1884 | 2086 | $output = executeQuery('member.deleteLoginCountByIp', $args); |
@@ -1905,7 +2107,9 @@ discard block |
||
1905 | 2107 | return new BaseObject(-1,'msg_user_denied'); |
1906 | 2108 | } |
1907 | 2109 | // Notify if denied_date is less than the current time |
1908 | - 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"))); |
|
2110 | + if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) { |
|
2111 | + return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
2112 | + } |
|
1909 | 2113 | // Update the latest login time |
1910 | 2114 | $args->member_srl = $this->memberInfo->member_srl; |
1911 | 2115 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1954,7 +2158,9 @@ discard block |
||
1954 | 2158 | } |
1955 | 2159 | // Call a trigger after successfully log-in (after) |
1956 | 2160 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
1957 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
2161 | + if(!$trigger_output->toBool()) { |
|
2162 | + return $trigger_output; |
|
2163 | + } |
|
1958 | 2164 | // When user checked to use auto-login |
1959 | 2165 | if($keep_signed) |
1960 | 2166 | { |
@@ -1968,7 +2174,9 @@ discard block |
||
1968 | 2174 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
1969 | 2175 | executeQuery('member.deleteAutologin', $autologin_args); |
1970 | 2176 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
1971 | - if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
2177 | + if($autologin_output->toBool()) { |
|
2178 | + setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
2179 | + } |
|
1972 | 2180 | } |
1973 | 2181 | if($this->memberInfo->is_admin == 'Y') |
1974 | 2182 | { |
@@ -2057,7 +2265,9 @@ discard block |
||
2057 | 2265 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
2058 | 2266 | { |
2059 | 2267 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
2060 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
2268 | + if(!is_array($member_popup_menu_list)) { |
|
2269 | + $member_popup_menu_list = array(); |
|
2270 | + } |
|
2061 | 2271 | |
2062 | 2272 | $obj = new stdClass; |
2063 | 2273 | $obj->url = $url; |
@@ -2076,35 +2286,54 @@ discard block |
||
2076 | 2286 | { |
2077 | 2287 | // Call a trigger (before) |
2078 | 2288 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
2079 | - if(!$output->toBool()) return $output; |
|
2289 | + if(!$output->toBool()) { |
|
2290 | + return $output; |
|
2291 | + } |
|
2080 | 2292 | // Terms and Conditions portion of the information set up by members reaffirmed |
2081 | 2293 | $oModuleModel = getModel('module'); |
2082 | 2294 | $config = $oModuleModel->getModuleConfig('member'); |
2083 | 2295 | |
2084 | 2296 | $logged_info = Context::get('logged_info'); |
2085 | 2297 | // If the date of the temporary restrictions limit further information on the date of |
2086 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
2298 | + if($config->limit_day) { |
|
2299 | + $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
2300 | + } |
|
2087 | 2301 | |
2088 | 2302 | $args->member_srl = getNextSequence(); |
2089 | 2303 | $args->list_order = -1 * $args->member_srl; |
2090 | 2304 | |
2091 | 2305 | // Execute insert or update depending on the value of member_srl |
2092 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2306 | + if(!$args->user_id) { |
|
2307 | + $args->user_id = 't'.$args->member_srl; |
|
2308 | + } |
|
2093 | 2309 | // Enter the user's identity changed to lowercase |
2094 | - else $args->user_id = strtolower($args->user_id); |
|
2095 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
2096 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
2310 | + else { |
|
2311 | + $args->user_id = strtolower($args->user_id); |
|
2312 | + } |
|
2313 | + if(!$args->user_name) { |
|
2314 | + $args->user_name = $args->member_srl; |
|
2315 | + } |
|
2316 | + if(!$args->nick_name) { |
|
2317 | + $args->nick_name = $args->member_srl; |
|
2318 | + } |
|
2097 | 2319 | |
2098 | 2320 | // Control of essential parameters |
2099 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
2100 | - if($args->denied!='Y') $args->denied = 'N'; |
|
2101 | - if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y'; |
|
2321 | + if($args->allow_mailing!='Y') { |
|
2322 | + $args->allow_mailing = 'N'; |
|
2323 | + } |
|
2324 | + if($args->denied!='Y') { |
|
2325 | + $args->denied = 'N'; |
|
2326 | + } |
|
2327 | + if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) { |
|
2328 | + $args->allow_message = 'Y'; |
|
2329 | + } |
|
2102 | 2330 | |
2103 | 2331 | if($logged_info->is_admin == 'Y') |
2104 | 2332 | { |
2105 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
2106 | - } |
|
2107 | - else |
|
2333 | + if($args->is_admin!='Y') { |
|
2334 | + $args->is_admin = 'N'; |
|
2335 | + } |
|
2336 | + } else |
|
2108 | 2337 | { |
2109 | 2338 | unset($args->is_admin); |
2110 | 2339 | } |
@@ -2117,8 +2346,12 @@ discard block |
||
2117 | 2346 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2118 | 2347 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2119 | 2348 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2120 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2121 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
2349 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) { |
|
2350 | + $args->homepage = 'http://'.$args->homepage; |
|
2351 | + } |
|
2352 | + if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) { |
|
2353 | + $args->blog = 'http://'.$args->blog; |
|
2354 | + } |
|
2122 | 2355 | |
2123 | 2356 | // Create a model object |
2124 | 2357 | $oMemberModel = getModel('member'); |
@@ -2132,8 +2365,7 @@ discard block |
||
2132 | 2365 | return new BaseObject(-1, $message[$config->password_strength]); |
2133 | 2366 | } |
2134 | 2367 | $args->password = $oMemberModel->hashPassword($args->password); |
2135 | - } |
|
2136 | - elseif(!$args->password) |
|
2368 | + } elseif(!$args->password) |
|
2137 | 2369 | { |
2138 | 2370 | unset($args->password); |
2139 | 2371 | } |
@@ -2141,8 +2373,7 @@ discard block |
||
2141 | 2373 | if($args->find_account_answer && !$password_is_hashed) |
2142 | 2374 | { |
2143 | 2375 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
2144 | - } |
|
2145 | - elseif(!$args->find_account_answer) |
|
2376 | + } elseif(!$args->find_account_answer) |
|
2146 | 2377 | { |
2147 | 2378 | unset($args->find_account_answer); |
2148 | 2379 | } |
@@ -2183,8 +2414,12 @@ discard block |
||
2183 | 2414 | // Insert data into the DB |
2184 | 2415 | $args->list_order = -1 * $args->member_srl; |
2185 | 2416 | |
2186 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2187 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
2417 | + if(!$args->user_id) { |
|
2418 | + $args->user_id = 't'.$args->member_srl; |
|
2419 | + } |
|
2420 | + if(!$args->user_name) { |
|
2421 | + $args->user_name = $args->member_srl; |
|
2422 | + } |
|
2188 | 2423 | |
2189 | 2424 | $oDB = &DB::getInstance(); |
2190 | 2425 | $oDB->begin(); |
@@ -2196,8 +2431,11 @@ discard block |
||
2196 | 2431 | return $output; |
2197 | 2432 | } |
2198 | 2433 | |
2199 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2200 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2434 | + if(is_array($args->group_srl_list)) { |
|
2435 | + $group_srl_list = $args->group_srl_list; |
|
2436 | + } else { |
|
2437 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2438 | + } |
|
2201 | 2439 | // If no value is entered the default group, the value of group registration |
2202 | 2440 | if(!$args->group_srl_list) |
2203 | 2441 | { |
@@ -2214,8 +2452,7 @@ discard block |
||
2214 | 2452 | } |
2215 | 2453 | } |
2216 | 2454 | // If the value is the value of the group entered the group registration |
2217 | - } |
|
2218 | - else |
|
2455 | + } else |
|
2219 | 2456 | { |
2220 | 2457 | for($i=0;$i<count($group_srl_list);$i++) |
2221 | 2458 | { |
@@ -2276,27 +2513,39 @@ discard block |
||
2276 | 2513 | { |
2277 | 2514 | // Call a trigger (before) |
2278 | 2515 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
2279 | - if(!$output->toBool()) return $output; |
|
2516 | + if(!$output->toBool()) { |
|
2517 | + return $output; |
|
2518 | + } |
|
2280 | 2519 | // Create a model object |
2281 | 2520 | $oMemberModel = getModel('member'); |
2282 | 2521 | |
2283 | 2522 | $logged_info = Context::get('logged_info'); |
2284 | 2523 | // Get what you want to modify the original information |
2285 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2524 | + if(!$this->memberInfo) { |
|
2525 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2526 | + } |
|
2286 | 2527 | // Control of essential parameters |
2287 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
2288 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
2528 | + if($args->allow_mailing!='Y') { |
|
2529 | + $args->allow_mailing = 'N'; |
|
2530 | + } |
|
2531 | + if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) { |
|
2532 | + $args->allow_message = 'Y'; |
|
2533 | + } |
|
2289 | 2534 | |
2290 | 2535 | if($logged_info->is_admin == 'Y') |
2291 | 2536 | { |
2292 | - if($args->denied!='Y') $args->denied = 'N'; |
|
2293 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
2294 | - } |
|
2295 | - else |
|
2537 | + if($args->denied!='Y') { |
|
2538 | + $args->denied = 'N'; |
|
2539 | + } |
|
2540 | + if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) { |
|
2541 | + $args->is_admin = 'N'; |
|
2542 | + } |
|
2543 | + } else |
|
2296 | 2544 | { |
2297 | 2545 | unset($args->is_admin); |
2298 | - if($is_admin == false) |
|
2299 | - unset($args->denied); |
|
2546 | + if($is_admin == false) { |
|
2547 | + unset($args->denied); |
|
2548 | + } |
|
2300 | 2549 | if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
2301 | 2550 | { |
2302 | 2551 | return $this->stop('msg_invalid_request'); |
@@ -2304,13 +2553,19 @@ discard block |
||
2304 | 2553 | } |
2305 | 2554 | |
2306 | 2555 | // Sanitize user ID, username, nickname, homepage, blog |
2307 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2556 | + if($args->user_id) { |
|
2557 | + $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2558 | + } |
|
2308 | 2559 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2309 | 2560 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2310 | 2561 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2311 | 2562 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2312 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2313 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
2563 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) { |
|
2564 | + $args->homepage = 'http://'.$args->homepage; |
|
2565 | + } |
|
2566 | + if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) { |
|
2567 | + $args->blog = 'http://'.$args->blog; |
|
2568 | + } |
|
2314 | 2569 | |
2315 | 2570 | // check member identifier form |
2316 | 2571 | $config = $oMemberModel->getMemberConfig(); |
@@ -2327,8 +2582,7 @@ discard block |
||
2327 | 2582 | return new BaseObject(-1,'msg_exists_email_address'); |
2328 | 2583 | } |
2329 | 2584 | $args->email_address = $orgMemberInfo->email_address; |
2330 | - } |
|
2331 | - else |
|
2585 | + } else |
|
2332 | 2586 | { |
2333 | 2587 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
2334 | 2588 | if($member_srl && $args->member_srl != $member_srl) |
@@ -2385,16 +2639,14 @@ discard block |
||
2385 | 2639 | return new BaseObject(-1, $message[$config->password_strength]); |
2386 | 2640 | } |
2387 | 2641 | $args->password = $oMemberModel->hashPassword($args->password); |
2388 | - } |
|
2389 | - else |
|
2642 | + } else |
|
2390 | 2643 | { |
2391 | 2644 | $args->password = $orgMemberInfo->password; |
2392 | 2645 | } |
2393 | 2646 | |
2394 | 2647 | if($args->find_account_answer) { |
2395 | 2648 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
2396 | - } |
|
2397 | - else |
|
2649 | + } else |
|
2398 | 2650 | { |
2399 | 2651 | $oPassword = new Password(); |
2400 | 2652 | $hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer); |
@@ -2406,11 +2658,21 @@ discard block |
||
2406 | 2658 | } |
2407 | 2659 | } |
2408 | 2660 | |
2409 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
2410 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
2411 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
2412 | - if(!$args->description) $args->description = $orgMemberInfo->description; |
|
2413 | - if(!$args->birthday) $args->birthday = ''; |
|
2661 | + if(!$args->user_name) { |
|
2662 | + $args->user_name = $orgMemberInfo->user_name; |
|
2663 | + } |
|
2664 | + if(!$args->user_id) { |
|
2665 | + $args->user_id = $orgMemberInfo->user_id; |
|
2666 | + } |
|
2667 | + if(!$args->nick_name) { |
|
2668 | + $args->nick_name = $orgMemberInfo->nick_name; |
|
2669 | + } |
|
2670 | + if(!$args->description) { |
|
2671 | + $args->description = $orgMemberInfo->description; |
|
2672 | + } |
|
2673 | + if(!$args->birthday) { |
|
2674 | + $args->birthday = ''; |
|
2675 | + } |
|
2414 | 2676 | |
2415 | 2677 | $output = executeQuery('member.updateMember', $args); |
2416 | 2678 | |
@@ -2422,8 +2684,11 @@ discard block |
||
2422 | 2684 | |
2423 | 2685 | if($args->group_srl_list) |
2424 | 2686 | { |
2425 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2426 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2687 | + if(is_array($args->group_srl_list)) { |
|
2688 | + $group_srl_list = $args->group_srl_list; |
|
2689 | + } else { |
|
2690 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2691 | + } |
|
2427 | 2692 | // If the group information, group information changes |
2428 | 2693 | if(count($group_srl_list) > 0) |
2429 | 2694 | { |
@@ -2466,7 +2731,9 @@ discard block |
||
2466 | 2731 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
2467 | 2732 | |
2468 | 2733 | // Save Session |
2469 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2734 | + if(!$this->memberInfo) { |
|
2735 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2736 | + } |
|
2470 | 2737 | $logged_info = Context::get('logged_info'); |
2471 | 2738 | |
2472 | 2739 | $output->add('member_srl', $args->member_srl); |
@@ -2492,8 +2759,7 @@ discard block |
||
2492 | 2759 | } |
2493 | 2760 | |
2494 | 2761 | $args->password = $oMemberModel->hashPassword($args->password); |
2495 | - } |
|
2496 | - else if($args->hashed_password) |
|
2762 | + } else if($args->hashed_password) |
|
2497 | 2763 | { |
2498 | 2764 | $args->password = $args->hashed_password; |
2499 | 2765 | } |
@@ -2528,7 +2794,9 @@ discard block |
||
2528 | 2794 | $trigger_obj = new stdClass(); |
2529 | 2795 | $trigger_obj->member_srl = $member_srl; |
2530 | 2796 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
2531 | - if(!$output->toBool()) return $output; |
|
2797 | + if(!$output->toBool()) { |
|
2798 | + return $output; |
|
2799 | + } |
|
2532 | 2800 | // Create a model object |
2533 | 2801 | $oMemberModel = getModel('member'); |
2534 | 2802 | // Bringing the user's information |
@@ -2537,9 +2805,13 @@ discard block |
||
2537 | 2805 | $columnList = array('member_srl', 'is_admin'); |
2538 | 2806 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
2539 | 2807 | } |
2540 | - if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
2808 | + if(!$this->memberInfo) { |
|
2809 | + return new BaseObject(-1, 'msg_not_exists_member'); |
|
2810 | + } |
|
2541 | 2811 | // If managers can not be deleted |
2542 | - if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
2812 | + if($this->memberInfo->is_admin == 'Y') { |
|
2813 | + return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
2814 | + } |
|
2543 | 2815 | |
2544 | 2816 | $oDB = &DB::getInstance(); |
2545 | 2817 | $oDB->begin(); |
@@ -2603,7 +2875,9 @@ discard block |
||
2603 | 2875 | */ |
2604 | 2876 | function destroySessionInfo() |
2605 | 2877 | { |
2606 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
2878 | + if(!$_SESSION || !is_array($_SESSION)) { |
|
2879 | + return; |
|
2880 | + } |
|
2607 | 2881 | |
2608 | 2882 | $memberInfo = Context::get('logged_info'); |
2609 | 2883 | $memberSrl = $memberInfo->member_srl; |
@@ -2642,8 +2916,9 @@ discard block |
||
2642 | 2916 | } |
2643 | 2917 | $maxLevel = 0; |
2644 | 2918 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
2645 | - if(count($resultGroup) > 0) |
|
2646 | - $maxLevel = max(array_flip($resultGroup)); |
|
2919 | + if(count($resultGroup) > 0) { |
|
2920 | + $maxLevel = max(array_flip($resultGroup)); |
|
2921 | + } |
|
2647 | 2922 | |
2648 | 2923 | if($maxLevel > 0) |
2649 | 2924 | { |
@@ -2660,16 +2935,22 @@ discard block |
||
2660 | 2935 | |
2661 | 2936 | function procMemberModifyEmailAddress() |
2662 | 2937 | { |
2663 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
2938 | + if(!Context::get('is_logged')) { |
|
2939 | + return $this->stop('msg_not_logged'); |
|
2940 | + } |
|
2664 | 2941 | |
2665 | 2942 | $member_info = Context::get('logged_info'); |
2666 | 2943 | $newEmail = Context::get('email_address'); |
2667 | 2944 | |
2668 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
2945 | + if(!$newEmail) { |
|
2946 | + return $this->stop('msg_invalid_request'); |
|
2947 | + } |
|
2669 | 2948 | |
2670 | 2949 | $oMemberModel = getModel('member'); |
2671 | 2950 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
2672 | - if($member_srl) return new BaseObject(-1,'msg_exists_email_address'); |
|
2951 | + if($member_srl) { |
|
2952 | + return new BaseObject(-1,'msg_exists_email_address'); |
|
2953 | + } |
|
2673 | 2954 | |
2674 | 2955 | if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
2675 | 2956 | { |
@@ -2697,7 +2978,9 @@ discard block |
||
2697 | 2978 | $member_config = $oModuleModel->getModuleConfig('member'); |
2698 | 2979 | |
2699 | 2980 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
2700 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
2981 | + if(!is_dir($tpl_path)) { |
|
2982 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
2983 | + } |
|
2701 | 2984 | |
2702 | 2985 | global $lang; |
2703 | 2986 | |
@@ -2733,7 +3016,9 @@ discard block |
||
2733 | 3016 | { |
2734 | 3017 | $member_srl = Context::get('member_srl'); |
2735 | 3018 | $auth_key = Context::get('auth_key'); |
2736 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
3019 | + if(!$member_srl || !$auth_key) { |
|
3020 | + return $this->stop('msg_invalid_request'); |
|
3021 | + } |
|
2737 | 3022 | |
2738 | 3023 | // Test logs for finding password by user_id and authkey |
2739 | 3024 | $args = new stdClass; |
@@ -2742,7 +3027,9 @@ discard block |
||
2742 | 3027 | $output = executeQuery('member.getAuthMail', $args); |
2743 | 3028 | if(!$output->toBool() || $output->data->auth_key != $auth_key) |
2744 | 3029 | { |
2745 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
3030 | + if(strlen($output->data->auth_key) !== strlen($auth_key)) { |
|
3031 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
3032 | + } |
|
2746 | 3033 | return $this->stop('msg_invalid_modify_email_auth_key'); |
2747 | 3034 | } |
2748 | 3035 | |
@@ -2751,7 +3038,9 @@ discard block |
||
2751 | 3038 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
2752 | 3039 | |
2753 | 3040 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
2754 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
3041 | + if(!$output->toBool()) { |
|
3042 | + return $this->stop($output->getMessage()); |
|
3043 | + } |
|
2755 | 3044 | |
2756 | 3045 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
2757 | 3046 | executeQuery('member.deleteAuthChangeEmailAddress',$args); |
@@ -2772,7 +3061,9 @@ discard block |
||
2772 | 3061 | **/ |
2773 | 3062 | function triggerGetDocumentMenu(&$menu_list) |
2774 | 3063 | { |
2775 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
3064 | + if(!Context::get('is_logged')) { |
|
3065 | + return new BaseObject(); |
|
3066 | + } |
|
2776 | 3067 | |
2777 | 3068 | $logged_info = Context::get('logged_info'); |
2778 | 3069 | $document_srl = Context::get('target_srl'); |
@@ -2783,8 +3074,12 @@ discard block |
||
2783 | 3074 | $member_srl = $oDocument->get('member_srl'); |
2784 | 3075 | $module_srl = $oDocument->get('module_srl'); |
2785 | 3076 | |
2786 | - if(!$member_srl) return new BaseObject(); |
|
2787 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
3077 | + if(!$member_srl) { |
|
3078 | + return new BaseObject(); |
|
3079 | + } |
|
3080 | + if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
3081 | + return new BaseObject(); |
|
3082 | + } |
|
2788 | 3083 | |
2789 | 3084 | $oDocumentController = getController('document'); |
2790 | 3085 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2802,7 +3097,9 @@ discard block |
||
2802 | 3097 | **/ |
2803 | 3098 | function triggerGetCommentMenu(&$menu_list) |
2804 | 3099 | { |
2805 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
3100 | + if(!Context::get('is_logged')) { |
|
3101 | + return new BaseObject(); |
|
3102 | + } |
|
2806 | 3103 | |
2807 | 3104 | $logged_info = Context::get('logged_info'); |
2808 | 3105 | $comment_srl = Context::get('target_srl'); |
@@ -2813,8 +3110,12 @@ discard block |
||
2813 | 3110 | $module_srl = $oComment->get('module_srl'); |
2814 | 3111 | $member_srl = $oComment->get('member_srl'); |
2815 | 3112 | |
2816 | - if(!$member_srl) return new BaseObject(); |
|
2817 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
3113 | + if(!$member_srl) { |
|
3114 | + return new BaseObject(); |
|
3115 | + } |
|
3116 | + if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
3117 | + return new BaseObject(); |
|
3118 | + } |
|
2818 | 3119 | |
2819 | 3120 | $oCommentController = getController('comment'); |
2820 | 3121 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2830,7 +3131,9 @@ discard block |
||
2830 | 3131 | **/ |
2831 | 3132 | function procMemberSpammerManage() |
2832 | 3133 | { |
2833 | - if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted'); |
|
3134 | + if(!Context::get('is_logged')) { |
|
3135 | + return new BaseObject(-1,'msg_not_permitted'); |
|
3136 | + } |
|
2834 | 3137 | |
2835 | 3138 | $logged_info = Context::get('logged_info'); |
2836 | 3139 | $member_srl = Context::get('member_srl'); |
@@ -2838,8 +3141,9 @@ discard block |
||
2838 | 3141 | $cnt_loop = Context::get('cnt_loop'); |
2839 | 3142 | $proc_type = Context::get('proc_type'); |
2840 | 3143 | $isMoveToTrash = true; |
2841 | - if($proc_type == "delete") |
|
2842 | - $isMoveToTrash = false; |
|
3144 | + if($proc_type == "delete") { |
|
3145 | + $isMoveToTrash = false; |
|
3146 | + } |
|
2843 | 3147 | |
2844 | 3148 | // check grant |
2845 | 3149 | $oModuleModel = getModel('module'); |
@@ -2847,7 +3151,9 @@ discard block |
||
2847 | 3151 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
2848 | 3152 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
2849 | 3153 | |
2850 | - if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted'); |
|
3154 | + if(!$grant->manager) { |
|
3155 | + return new BaseObject(-1,'msg_not_permitted'); |
|
3156 | + } |
|
2851 | 3157 | |
2852 | 3158 | $proc_msg = ""; |
2853 | 3159 | |
@@ -2856,11 +3162,13 @@ discard block |
||
2856 | 3162 | |
2857 | 3163 | // delete or trash destination |
2858 | 3164 | // proc member |
2859 | - if($cnt_loop == 1) |
|
2860 | - $this->_spammerMember($member_srl); |
|
3165 | + if($cnt_loop == 1) { |
|
3166 | + $this->_spammerMember($member_srl); |
|
3167 | + } |
|
2861 | 3168 | // proc document and comment |
2862 | - elseif($cnt_loop>1) |
|
2863 | - $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
3169 | + elseif($cnt_loop>1) { |
|
3170 | + $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
3171 | + } |
|
2864 | 3172 | |
2865 | 3173 | // get destination count |
2866 | 3174 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
@@ -2868,13 +3176,16 @@ discard block |
||
2868 | 3176 | |
2869 | 3177 | $total_count = Context::get('total_count'); |
2870 | 3178 | $remain_count = $cnt_document + $cnt_comment; |
2871 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
3179 | + if($cnt_loop == 1) { |
|
3180 | + $total_count = $remain_count; |
|
3181 | + } |
|
2872 | 3182 | |
2873 | 3183 | // get progress percent |
2874 | - if($total_count > 0) |
|
2875 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
2876 | - else |
|
2877 | - $progress = 100; |
|
3184 | + if($total_count > 0) { |
|
3185 | + $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
3186 | + } else { |
|
3187 | + $progress = 100; |
|
3188 | + } |
|
2878 | 3189 | |
2879 | 3190 | $this->add('total_count', $total_count); |
2880 | 3191 | $this->add('remain_count', $remain_count); |
@@ -2916,7 +3227,10 @@ discard block |
||
2916 | 3227 | $args->nick_name = $member_info->nick_name; |
2917 | 3228 | $args->denied = "Y"; |
2918 | 3229 | $args->description = trim( $member_info->description ); |
2919 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
3230 | + if( $args->description != "" ) { |
|
3231 | + $args->description .= "\n"; |
|
3232 | + } |
|
3233 | + // add new line |
|
2920 | 3234 | |
2921 | 3235 | $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 . "]"; |
2922 | 3236 | |
@@ -2961,8 +3275,11 @@ discard block |
||
2961 | 3275 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
2962 | 3276 | if($documentList) { |
2963 | 3277 | foreach($documentList as $v) { |
2964 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
2965 | - else $oDocumentController->deleteDocument($v->document_srl); |
|
3278 | + if($isMoveToTrash) { |
|
3279 | + $oDocumentController->moveDocumentToTrash($v); |
|
3280 | + } else { |
|
3281 | + $oDocumentController->deleteDocument($v->document_srl); |
|
3282 | + } |
|
2966 | 3283 | } |
2967 | 3284 | } |
2968 | 3285 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | //Security |
22 | 22 | $security = new Security(); |
23 | - $security->encodeHTML('config.point_name','config.level_icon'); |
|
23 | + $security->encodeHTML('config.point_name', 'config.level_icon'); |
|
24 | 24 | $security->encodeHTML('module_info..'); |
25 | 25 | |
26 | 26 | // Set the template path |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | $oMemberModel = getModel('member'); |
40 | 40 | $group_list = $oMemberModel->getGroups(); |
41 | 41 | $selected_group_list = array(); |
42 | - if(count($group_list)) |
|
42 | + if (count($group_list)) |
|
43 | 43 | { |
44 | - foreach($group_list as $key => $val) |
|
44 | + foreach ($group_list as $key => $val) |
|
45 | 45 | { |
46 | 46 | $selected_group_list[$key] = $val; |
47 | 47 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | Context::set('group_list', $selected_group_list); |
50 | 50 | //Security |
51 | 51 | $security = new Security(); |
52 | - $security->encodeHTML('group_list..title','group_list..description'); |
|
52 | + $security->encodeHTML('group_list..title', 'group_list..description'); |
|
53 | 53 | |
54 | 54 | // Set the template |
55 | 55 | $this->setTemplateFile('config'); |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | $columnList = array('module_srl', 'mid', 'browser_title', 'module'); |
66 | 66 | $mid_list = $oModuleModel->getMidList(null, $columnList); |
67 | 67 | |
68 | - foreach($mid_list as $mid => $item) |
|
68 | + foreach ($mid_list as $mid => $item) |
|
69 | 69 | { |
70 | - if($item->module === 'page') |
|
70 | + if ($item->module === 'page') |
|
71 | 71 | { |
72 | 72 | unset($mid_list[$mid]); |
73 | 73 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | //Security |
80 | 80 | $security = new Security(); |
81 | - $security->encodeHTML('mid_list..browser_title','mid_list..mid'); |
|
81 | + $security->encodeHTML('mid_list..browser_title', 'mid_list..mid'); |
|
82 | 82 | |
83 | 83 | // Set the template |
84 | 84 | $this->setTemplateFile('module_config'); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | Context::set('group_list', $this->group_list); |
125 | 125 | //Security |
126 | 126 | $security = new Security(); |
127 | - $security->encodeHTML('group_list..title','group_list..description'); |
|
127 | + $security->encodeHTML('group_list..title', 'group_list..description'); |
|
128 | 128 | $security->encodeHTML('member_list..'); |
129 | 129 | $security->encodeHTML('search_target', 'search_keyword'); |
130 | 130 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | static $member_config; |
28 | 28 | |
29 | - if($member_config) |
|
29 | + if ($member_config) |
|
30 | 30 | { |
31 | 31 | return $member_config; |
32 | 32 | } |
@@ -35,47 +35,47 @@ discard block |
||
35 | 35 | $oModuleModel = getModel('module'); |
36 | 36 | $config = $oModuleModel->getModuleConfig('member'); |
37 | 37 | |
38 | - if(!$config->signupForm || !is_array($config->signupForm)) |
|
38 | + if (!$config->signupForm || !is_array($config->signupForm)) |
|
39 | 39 | { |
40 | 40 | $oMemberAdminController = getAdminController('member'); |
41 | 41 | $identifier = ($config->identifier) ? $config->identifier : 'email_address'; |
42 | 42 | $config->signupForm = $oMemberAdminController->createSignupForm($identifier); |
43 | 43 | } |
44 | 44 | //for multi language |
45 | - foreach($config->signupForm AS $key=>$value) |
|
45 | + foreach ($config->signupForm AS $key=>$value) |
|
46 | 46 | { |
47 | 47 | $config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title; |
48 | - if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y'; |
|
49 | - if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N'; |
|
48 | + if ($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y'; |
|
49 | + if ($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | // Get terms of user |
53 | 53 | $config->agreement = memberModel::_getAgreement(); |
54 | 54 | |
55 | - if(!$config->webmaster_name) $config->webmaster_name = 'webmaster'; |
|
55 | + if (!$config->webmaster_name) $config->webmaster_name = 'webmaster'; |
|
56 | 56 | |
57 | - if(!$config->image_name_max_width) $config->image_name_max_width = 90; |
|
58 | - if(!$config->image_name_max_height) $config->image_name_max_height = 20; |
|
59 | - if(!$config->image_name_max_filesize) $config->image_name_max_filesize = null; |
|
60 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = 20; |
|
61 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = 20; |
|
62 | - if(!$config->image_mark_max_filesize) $config->image_mark_max_filesize = null; |
|
63 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = 90; |
|
64 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = 90; |
|
65 | - if(!$config->profile_image_max_filesize) $config->profile_image_max_filesize = null; |
|
57 | + if (!$config->image_name_max_width) $config->image_name_max_width = 90; |
|
58 | + if (!$config->image_name_max_height) $config->image_name_max_height = 20; |
|
59 | + if (!$config->image_name_max_filesize) $config->image_name_max_filesize = null; |
|
60 | + if (!$config->image_mark_max_width) $config->image_mark_max_width = 20; |
|
61 | + if (!$config->image_mark_max_height) $config->image_mark_max_height = 20; |
|
62 | + if (!$config->image_mark_max_filesize) $config->image_mark_max_filesize = null; |
|
63 | + if (!$config->profile_image_max_width) $config->profile_image_max_width = 90; |
|
64 | + if (!$config->profile_image_max_height) $config->profile_image_max_height = 90; |
|
65 | + if (!$config->profile_image_max_filesize) $config->profile_image_max_filesize = null; |
|
66 | 66 | |
67 | - if(!$config->skin) $config->skin = 'default'; |
|
68 | - if(!$config->colorset) $config->colorset = 'white'; |
|
69 | - if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor'; |
|
70 | - if(!$config->group_image_mark) $config->group_image_mark = "N"; |
|
67 | + if (!$config->skin) $config->skin = 'default'; |
|
68 | + if (!$config->colorset) $config->colorset = 'white'; |
|
69 | + if (!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor'; |
|
70 | + if (!$config->group_image_mark) $config->group_image_mark = "N"; |
|
71 | 71 | |
72 | - if(!$config->identifier) $config->identifier = 'user_id'; |
|
72 | + if (!$config->identifier) $config->identifier = 'user_id'; |
|
73 | 73 | |
74 | - if(!$config->max_error_count) $config->max_error_count = 10; |
|
75 | - if(!$config->max_error_count_time) $config->max_error_count_time = 300; |
|
74 | + if (!$config->max_error_count) $config->max_error_count = 10; |
|
75 | + if (!$config->max_error_count_time) $config->max_error_count_time = 300; |
|
76 | 76 | |
77 | - if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor'; |
|
78 | - if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono'; |
|
77 | + if (!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor'; |
|
78 | + if (!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono'; |
|
79 | 79 | |
80 | 80 | $member_config = $config; |
81 | 81 | |
@@ -84,24 +84,24 @@ discard block |
||
84 | 84 | |
85 | 85 | function _getAgreement() |
86 | 86 | { |
87 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
88 | - if(is_readable($agreement_file)) |
|
87 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
88 | + if (is_readable($agreement_file)) |
|
89 | 89 | { |
90 | 90 | return FileHandler::readFile($agreement_file); |
91 | 91 | } |
92 | 92 | |
93 | 93 | $db_info = Context::getDBInfo(); |
94 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $db_info->lang_type . '.txt'; |
|
95 | - if(is_readable($agreement_file)) |
|
94 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$db_info->lang_type.'.txt'; |
|
95 | + if (is_readable($agreement_file)) |
|
96 | 96 | { |
97 | 97 | return FileHandler::readFile($agreement_file); |
98 | 98 | } |
99 | 99 | |
100 | 100 | $lang_selected = Context::loadLangSelected(); |
101 | - foreach($lang_selected as $key => $val) |
|
101 | + foreach ($lang_selected as $key => $val) |
|
102 | 102 | { |
103 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $key . '.txt'; |
|
104 | - if(is_readable($agreement_file)) |
|
103 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$key.'.txt'; |
|
104 | + if (is_readable($agreement_file)) |
|
105 | 105 | { |
106 | 106 | return FileHandler::readFile($agreement_file); |
107 | 107 | } |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | $logged_info = Context::get('logged_info'); |
122 | 122 | $act = Context::get('cur_act'); |
123 | 123 | // When click user's own nickname |
124 | - if($member_srl == $logged_info->member_srl) $member_info = $logged_info; |
|
124 | + if ($member_srl == $logged_info->member_srl) $member_info = $logged_info; |
|
125 | 125 | // When click other's nickname |
126 | 126 | else $member_info = $this->getMemberInfoByMemberSrl($member_srl); |
127 | 127 | |
128 | 128 | $member_srl = $member_info->member_srl; |
129 | - if(!$member_srl) return; |
|
129 | + if (!$member_srl) return; |
|
130 | 130 | // List variables |
131 | 131 | $user_id = $member_info->user_id; |
132 | 132 | $user_name = $member_info->user_name; |
@@ -135,18 +135,18 @@ discard block |
||
135 | 135 | |
136 | 136 | $oMemberController = getController('member'); |
137 | 137 | // Display member information (Don't display to non-logged user) |
138 | - if($logged_info->member_srl) |
|
138 | + if ($logged_info->member_srl) |
|
139 | 139 | { |
140 | - $url = getUrl('','mid',$mid,'act','dispMemberInfo','member_srl',$member_srl); |
|
141 | - $oMemberController->addMemberPopupMenu($url,'cmd_view_member_info',$icon_path,'self'); |
|
140 | + $url = getUrl('', 'mid', $mid, 'act', 'dispMemberInfo', 'member_srl', $member_srl); |
|
141 | + $oMemberController->addMemberPopupMenu($url, 'cmd_view_member_info', $icon_path, 'self'); |
|
142 | 142 | } |
143 | 143 | // When click other's nickname |
144 | - if($member_srl != $logged_info->member_srl && $logged_info->member_srl) |
|
144 | + if ($member_srl != $logged_info->member_srl && $logged_info->member_srl) |
|
145 | 145 | { |
146 | 146 | // Get email config |
147 | - foreach($this->module_config->signupForm as $field) |
|
147 | + foreach ($this->module_config->signupForm as $field) |
|
148 | 148 | { |
149 | - if($field->name == 'email_address') |
|
149 | + if ($field->name == 'email_address') |
|
150 | 150 | { |
151 | 151 | $email_config = $field; |
152 | 152 | break; |
@@ -154,36 +154,36 @@ discard block |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | // Send an email only if email address is public |
157 | - if(($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address) |
|
157 | + if (($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address) |
|
158 | 158 | { |
159 | 159 | $url = 'mailto:'.htmlspecialchars($member_info->email_address, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
160 | - $oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path); |
|
160 | + $oMemberController->addMemberPopupMenu($url, 'cmd_send_email', $icon_path); |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | // View homepage info |
164 | - if($member_info->homepage) |
|
164 | + if ($member_info->homepage) |
|
165 | 165 | $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank'); |
166 | 166 | // View blog info |
167 | - if($member_info->blog) |
|
167 | + if ($member_info->blog) |
|
168 | 168 | $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank'); |
169 | 169 | // Call a trigger (after) |
170 | 170 | ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null); |
171 | 171 | // Display a menu for editting member info to a top administrator |
172 | - if($logged_info->is_admin == 'Y') |
|
172 | + if ($logged_info->is_admin == 'Y') |
|
173 | 173 | { |
174 | - $url = getUrl('','module','admin','act','dispMemberAdminInsert','member_srl',$member_srl); |
|
175 | - $oMemberController->addMemberPopupMenu($url,'cmd_manage_member_info',$icon_path,'MemberModifyInfo'); |
|
174 | + $url = getUrl('', 'module', 'admin', 'act', 'dispMemberAdminInsert', 'member_srl', $member_srl); |
|
175 | + $oMemberController->addMemberPopupMenu($url, 'cmd_manage_member_info', $icon_path, 'MemberModifyInfo'); |
|
176 | 176 | |
177 | - $url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','member_srl','search_keyword',$member_srl); |
|
178 | - $oMemberController->addMemberPopupMenu($url,'cmd_trace_document',$icon_path,'TraceMemberDocument'); |
|
177 | + $url = getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl); |
|
178 | + $oMemberController->addMemberPopupMenu($url, 'cmd_trace_document', $icon_path, 'TraceMemberDocument'); |
|
179 | 179 | |
180 | - $url = getUrl('','module','admin','act','dispCommentAdminList','search_target','member_srl','search_keyword',$member_srl); |
|
181 | - $oMemberController->addMemberPopupMenu($url,'cmd_trace_comment',$icon_path,'TraceMemberComment'); |
|
180 | + $url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl); |
|
181 | + $oMemberController->addMemberPopupMenu($url, 'cmd_trace_comment', $icon_path, 'TraceMemberComment'); |
|
182 | 182 | } |
183 | 183 | // Change a language of pop-up menu |
184 | 184 | $menus = Context::get('member_popup_menu_list'); |
185 | 185 | $menus_count = count($menus); |
186 | - for($i=0;$i<$menus_count;$i++) |
|
186 | + for ($i = 0; $i < $menus_count; $i++) |
|
187 | 187 | { |
188 | 188 | $menus[$i]->str = Context::getLang($menus[$i]->str); |
189 | 189 | } |
@@ -195,16 +195,16 @@ discard block |
||
195 | 195 | * @brief Check if logged-in |
196 | 196 | */ |
197 | 197 | function isLogged() { |
198 | - if($_SESSION['is_logged']) |
|
198 | + if ($_SESSION['is_logged']) |
|
199 | 199 | { |
200 | - if(Mobile::isFromMobilePhone()) |
|
200 | + if (Mobile::isFromMobilePhone()) |
|
201 | 201 | { |
202 | 202 | return true; |
203 | 203 | } |
204 | - elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
204 | + elseif (filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
205 | 205 | { |
206 | 206 | // IPv6: require same /48 |
207 | - if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0) |
|
207 | + if (strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0) |
|
208 | 208 | { |
209 | 209 | return true; |
210 | 210 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | else |
213 | 213 | { |
214 | 214 | // IPv4: require same /24 |
215 | - if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) |
|
215 | + if (ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) |
|
216 | 216 | { |
217 | 217 | return true; |
218 | 218 | } |
@@ -229,23 +229,23 @@ discard block |
||
229 | 229 | function getLoggedInfo() |
230 | 230 | { |
231 | 231 | // Return session info if session info is requested and the user is logged-in |
232 | - if($this->isLogged()) |
|
232 | + if ($this->isLogged()) |
|
233 | 233 | { |
234 | 234 | $logged_info = Context::get('logged_info'); |
235 | 235 | // Admin/Group list defined depending on site_module_info |
236 | 236 | $site_module_info = Context::get('site_module_info'); |
237 | - if($site_module_info->site_srl) |
|
237 | + if ($site_module_info->site_srl) |
|
238 | 238 | { |
239 | 239 | $logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl); |
240 | 240 | // Add is_site_admin bool variable into logged_info if site_administrator is |
241 | 241 | $oModuleModel = getModel('module'); |
242 | - if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; |
|
242 | + if ($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; |
|
243 | 243 | else $logged_info->is_site_admin = false; |
244 | 244 | } |
245 | 245 | else |
246 | 246 | { |
247 | 247 | // Register a default group if the site doesn't have a member group |
248 | - if(count($logged_info->group_list) === 0) |
|
248 | + if (count($logged_info->group_list) === 0) |
|
249 | 249 | { |
250 | 250 | $default_group = $this->getDefaultGroup(0); |
251 | 251 | $oMemberController = getController('member'); |
@@ -268,13 +268,13 @@ discard block |
||
268 | 268 | */ |
269 | 269 | function getMemberInfoByUserID($user_id, $columnList = array()) |
270 | 270 | { |
271 | - if(!$user_id) return; |
|
271 | + if (!$user_id) return; |
|
272 | 272 | |
273 | 273 | $args = new stdClass; |
274 | 274 | $args->user_id = $user_id; |
275 | 275 | $output = executeQuery('member.getMemberInfo', $args); |
276 | - if(!$output->toBool()) return $output; |
|
277 | - if(!$output->data) return; |
|
276 | + if (!$output->toBool()) return $output; |
|
277 | + if (!$output->data) return; |
|
278 | 278 | |
279 | 279 | $member_info = $this->arrangeMemberInfo($output->data); |
280 | 280 | |
@@ -286,12 +286,12 @@ discard block |
||
286 | 286 | */ |
287 | 287 | function getMemberInfoByEmailAddress($email_address) |
288 | 288 | { |
289 | - if(!$email_address) return; |
|
289 | + if (!$email_address) return; |
|
290 | 290 | |
291 | 291 | $args = new stdClass(); |
292 | 292 | |
293 | - $db_info = Context::getDBInfo (); |
|
294 | - if($db_info->master_db['db_type'] == "cubrid") |
|
293 | + $db_info = Context::getDBInfo(); |
|
294 | + if ($db_info->master_db['db_type'] == "cubrid") |
|
295 | 295 | { |
296 | 296 | $args->email_address = strtolower($email_address); |
297 | 297 | $output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args); |
@@ -302,8 +302,8 @@ discard block |
||
302 | 302 | $output = executeQuery('member.getMemberInfoByEmailAddress', $args); |
303 | 303 | } |
304 | 304 | |
305 | - if(!$output->toBool()) return $output; |
|
306 | - if(!$output->data) return; |
|
305 | + if (!$output->toBool()) return $output; |
|
306 | + if (!$output->data) return; |
|
307 | 307 | |
308 | 308 | $member_info = $this->arrangeMemberInfo($output->data); |
309 | 309 | return $member_info; |
@@ -314,36 +314,36 @@ discard block |
||
314 | 314 | */ |
315 | 315 | function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array()) |
316 | 316 | { |
317 | - if(!$member_srl) return; |
|
317 | + if (!$member_srl) return; |
|
318 | 318 | |
319 | 319 | //columnList size zero... get full member info |
320 | - if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0) |
|
320 | + if (!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0) |
|
321 | 321 | { |
322 | 322 | $GLOBALS['__member_info__'][$member_srl] = false; |
323 | 323 | |
324 | 324 | $oCacheHandler = CacheHandler::getInstance('object'); |
325 | - if($oCacheHandler->isSupport()) |
|
325 | + if ($oCacheHandler->isSupport()) |
|
326 | 326 | { |
327 | 327 | $columnList = array(); |
328 | - $object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl; |
|
328 | + $object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl; |
|
329 | 329 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
330 | 330 | $GLOBALS['__member_info__'][$member_srl] = $oCacheHandler->get($cache_key); |
331 | 331 | } |
332 | 332 | |
333 | - if($GLOBALS['__member_info__'][$member_srl] === false) |
|
333 | + if ($GLOBALS['__member_info__'][$member_srl] === false) |
|
334 | 334 | { |
335 | 335 | $args = new stdClass(); |
336 | 336 | $args->member_srl = $member_srl; |
337 | 337 | $output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList); |
338 | - if(!$output->data) |
|
338 | + if (!$output->data) |
|
339 | 339 | { |
340 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass); |
|
340 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass); |
|
341 | 341 | return; |
342 | 342 | } |
343 | 343 | $this->arrangeMemberInfo($output->data, $site_srl); |
344 | 344 | |
345 | 345 | //insert in cache |
346 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
346 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
347 | 347 | } |
348 | 348 | } |
349 | 349 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | function arrangeMemberInfo($info, $site_srl = 0) |
357 | 357 | { |
358 | - if(!$GLOBALS['__member_info__'][$info->member_srl]) |
|
358 | + if (!$GLOBALS['__member_info__'][$info->member_srl]) |
|
359 | 359 | { |
360 | 360 | $oModuleModel = getModel('module'); |
361 | 361 | $config = $oModuleModel->getModuleConfig('member'); |
@@ -364,25 +364,25 @@ discard block |
||
364 | 364 | $info->profile_image = $this->getProfileImage($info->member_srl); |
365 | 365 | $info->image_name = $this->getImageName($info->member_srl); |
366 | 366 | $info->image_mark = $this->getImageMark($info->member_srl); |
367 | - if($config->group_image_mark=='Y') |
|
367 | + if ($config->group_image_mark == 'Y') |
|
368 | 368 | { |
369 | - $info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl); |
|
369 | + $info->group_mark = $this->getGroupImageMark($info->member_srl, $site_srl); |
|
370 | 370 | } |
371 | 371 | $info->signature = $this->getSignature($info->member_srl); |
372 | 372 | $info->group_list = $this->getMemberGroups($info->member_srl, $site_srl); |
373 | 373 | |
374 | 374 | $extra_vars = unserialize($info->extra_vars); |
375 | 375 | unset($info->extra_vars); |
376 | - if($extra_vars) |
|
376 | + if ($extra_vars) |
|
377 | 377 | { |
378 | - foreach($extra_vars as $key => $val) |
|
378 | + foreach ($extra_vars as $key => $val) |
|
379 | 379 | { |
380 | - if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val); |
|
381 | - if(!$info->{$key}) $info->{$key} = $val; |
|
380 | + if (!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val); |
|
381 | + if (!$info->{$key}) $info->{$key} = $val; |
|
382 | 382 | } |
383 | 383 | } |
384 | 384 | |
385 | - if(strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer)) |
|
385 | + if (strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer)) |
|
386 | 386 | { |
387 | 387 | $info->find_account_answer = null; |
388 | 388 | } |
@@ -394,13 +394,13 @@ discard block |
||
394 | 394 | $info->homepage = strip_tags($info->homepage); |
395 | 395 | $info->blog = strip_tags($info->blog); |
396 | 396 | |
397 | - if($extra_vars) |
|
397 | + if ($extra_vars) |
|
398 | 398 | { |
399 | - foreach($extra_vars as $key => $val) |
|
399 | + foreach ($extra_vars as $key => $val) |
|
400 | 400 | { |
401 | - if(is_array($val)) |
|
401 | + if (is_array($val)) |
|
402 | 402 | { |
403 | - $oSecurity->encodeHTML($key . '.'); |
|
403 | + $oSecurity->encodeHTML($key.'.'); |
|
404 | 404 | } |
405 | 405 | else |
406 | 406 | { |
@@ -411,12 +411,12 @@ discard block |
||
411 | 411 | |
412 | 412 | // Check format. |
413 | 413 | $oValidator = new Validator(); |
414 | - if(!$oValidator->applyRule('url', $info->homepage)) |
|
414 | + if (!$oValidator->applyRule('url', $info->homepage)) |
|
415 | 415 | { |
416 | 416 | $info->homepage = ''; |
417 | 417 | } |
418 | 418 | |
419 | - if(!$oValidator->applyRule('url', $info->blog)) |
|
419 | + if (!$oValidator->applyRule('url', $info->blog)) |
|
420 | 420 | { |
421 | 421 | $info->blog = ''; |
422 | 422 | } |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | */ |
466 | 466 | function getLoggedMemberSrl() |
467 | 467 | { |
468 | - if(!$this->isLogged()) return; |
|
468 | + if (!$this->isLogged()) return; |
|
469 | 469 | return $_SESSION['member_srl']; |
470 | 470 | } |
471 | 471 | |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | */ |
475 | 475 | function getLoggedUserID() |
476 | 476 | { |
477 | - if(!$this->isLogged()) return; |
|
477 | + if (!$this->isLogged()) return; |
|
478 | 478 | $logged_info = Context::get('logged_info'); |
479 | 479 | return $logged_info->user_id; |
480 | 480 | } |
@@ -489,16 +489,16 @@ discard block |
||
489 | 489 | // cache controll |
490 | 490 | $group_list = false; |
491 | 491 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
492 | - if($oCacheHandler->isSupport()) |
|
492 | + if ($oCacheHandler->isSupport()) |
|
493 | 493 | { |
494 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_'.$site_srl; |
|
494 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl; |
|
495 | 495 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
496 | 496 | $group_list = $oCacheHandler->get($cache_key); |
497 | 497 | } |
498 | 498 | |
499 | - if(!$member_groups[$member_srl][$site_srl] || $force_reload) |
|
499 | + if (!$member_groups[$member_srl][$site_srl] || $force_reload) |
|
500 | 500 | { |
501 | - if($group_list === false) |
|
501 | + if ($group_list === false) |
|
502 | 502 | { |
503 | 503 | $args = new stdClass(); |
504 | 504 | $args->member_srl = $member_srl; |
@@ -506,11 +506,11 @@ discard block |
||
506 | 506 | $output = executeQueryArray('member.getMemberGroups', $args); |
507 | 507 | $group_list = $output->data; |
508 | 508 | //insert in cache |
509 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
509 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
510 | 510 | } |
511 | - if(!$group_list) return array(); |
|
511 | + if (!$group_list) return array(); |
|
512 | 512 | |
513 | - foreach($group_list as $group) |
|
513 | + foreach ($group_list as $group) |
|
514 | 514 | { |
515 | 515 | $result[$group->group_srl] = $group->title; |
516 | 516 | } |
@@ -524,14 +524,14 @@ discard block |
||
524 | 524 | */ |
525 | 525 | function getMembersGroups($member_srls, $site_srl = 0) |
526 | 526 | { |
527 | - $args->member_srls = implode(',',$member_srls); |
|
527 | + $args->member_srls = implode(',', $member_srls); |
|
528 | 528 | $args->site_srl = $site_srl; |
529 | 529 | $args->sort_index = 'list_order'; |
530 | 530 | $output = executeQueryArray('member.getMembersGroups', $args); |
531 | - if(!$output->data) return array(); |
|
531 | + if (!$output->data) return array(); |
|
532 | 532 | |
533 | 533 | $result = array(); |
534 | - foreach($output->data as $key=>$val) |
|
534 | + foreach ($output->data as $key=>$val) |
|
535 | 535 | { |
536 | 536 | $result[$val->member_srl][] = $val->title; |
537 | 537 | } |
@@ -545,21 +545,21 @@ discard block |
||
545 | 545 | { |
546 | 546 | $default_group = false; |
547 | 547 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
548 | - if($oCacheHandler->isSupport()) |
|
548 | + if ($oCacheHandler->isSupport()) |
|
549 | 549 | { |
550 | 550 | $columnList = array(); |
551 | - $object_key = 'default_group_' . $site_srl; |
|
551 | + $object_key = 'default_group_'.$site_srl; |
|
552 | 552 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
553 | 553 | $default_group = $oCacheHandler->get($cache_key); |
554 | 554 | } |
555 | 555 | |
556 | - if($default_group === false) |
|
556 | + if ($default_group === false) |
|
557 | 557 | { |
558 | 558 | $args = new stdClass(); |
559 | 559 | $args->site_srl = $site_srl; |
560 | 560 | $output = executeQuery('member.getDefaultGroup', $args, $columnList); |
561 | 561 | $default_group = $output->data; |
562 | - if($oCacheHandler->isSupport()) |
|
562 | + if ($oCacheHandler->isSupport()) |
|
563 | 563 | { |
564 | 564 | $oCacheHandler->put($cache_key, $default_group); |
565 | 565 | } |
@@ -593,25 +593,25 @@ discard block |
||
593 | 593 | */ |
594 | 594 | function getGroups($site_srl = 0) |
595 | 595 | { |
596 | - if(!$GLOBALS['__group_info__'][$site_srl]) |
|
596 | + if (!$GLOBALS['__group_info__'][$site_srl]) |
|
597 | 597 | { |
598 | 598 | $result = array(); |
599 | 599 | |
600 | - if(!isset($site_srl)) |
|
600 | + if (!isset($site_srl)) |
|
601 | 601 | { |
602 | 602 | $site_srl = 0; |
603 | 603 | } |
604 | 604 | |
605 | 605 | $group_list = false; |
606 | 606 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
607 | - if($oCacheHandler->isSupport()) |
|
607 | + if ($oCacheHandler->isSupport()) |
|
608 | 608 | { |
609 | 609 | $object_key = 'member_groups:site_'.$site_srl; |
610 | 610 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
611 | 611 | $group_list = $oCacheHandler->get($cache_key); |
612 | 612 | } |
613 | 613 | |
614 | - if($group_list === false) |
|
614 | + if ($group_list === false) |
|
615 | 615 | { |
616 | 616 | $args = new stdClass(); |
617 | 617 | $args->site_srl = $site_srl; |
@@ -620,16 +620,16 @@ discard block |
||
620 | 620 | $output = executeQueryArray('member.getGroups', $args); |
621 | 621 | $group_list = $output->data; |
622 | 622 | //insert in cache |
623 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
623 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
624 | 624 | } |
625 | 625 | |
626 | - if(!$group_list) |
|
626 | + if (!$group_list) |
|
627 | 627 | { |
628 | 628 | return array(); |
629 | 629 | } |
630 | 630 | |
631 | 631 | |
632 | - foreach($group_list as $val) |
|
632 | + foreach ($group_list as $val) |
|
633 | 633 | { |
634 | 634 | $result[$val->group_srl] = $val; |
635 | 635 | } |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | // Set to ignore if a super administrator. |
661 | 661 | $logged_info = Context::get('logged_info'); |
662 | 662 | |
663 | - if(!$this->join_form_list) |
|
663 | + if (!$this->join_form_list) |
|
664 | 664 | { |
665 | 665 | // Argument setting to sort list_order column |
666 | 666 | $args = new stdClass(); |
@@ -668,11 +668,11 @@ discard block |
||
668 | 668 | $output = executeQuery('member.getJoinFormList', $args); |
669 | 669 | // NULL if output data deosn't exist |
670 | 670 | $join_form_list = $output->data; |
671 | - if(!$join_form_list) return NULL; |
|
671 | + if (!$join_form_list) return NULL; |
|
672 | 672 | // Need to unserialize because serialized array is inserted into DB in case of default_value |
673 | - if(!is_array($join_form_list)) $join_form_list = array($join_form_list); |
|
673 | + if (!is_array($join_form_list)) $join_form_list = array($join_form_list); |
|
674 | 674 | $join_form_count = count($join_form_list); |
675 | - for($i=0;$i<$join_form_count;$i++) |
|
675 | + for ($i = 0; $i < $join_form_count; $i++) |
|
676 | 676 | { |
677 | 677 | $join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name); |
678 | 678 | |
@@ -684,10 +684,10 @@ discard block |
||
684 | 684 | // Add language variable |
685 | 685 | $lang->extend_vars[$column_name] = $column_title; |
686 | 686 | // unserialize if the data type if checkbox, select and so on |
687 | - if(in_array($column_type, array('checkbox','select','radio'))) |
|
687 | + if (in_array($column_type, array('checkbox', 'select', 'radio'))) |
|
688 | 688 | { |
689 | 689 | $join_form_list[$i]->default_value = unserialize($default_value); |
690 | - if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = ''; |
|
690 | + if (!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = ''; |
|
691 | 691 | } |
692 | 692 | else |
693 | 693 | { |
@@ -699,16 +699,16 @@ discard block |
||
699 | 699 | $this->join_form_list = $list; |
700 | 700 | } |
701 | 701 | // Get object style if the filter_response is true |
702 | - if($filter_response && count($this->join_form_list)) |
|
702 | + if ($filter_response && count($this->join_form_list)) |
|
703 | 703 | { |
704 | - foreach($this->join_form_list as $key => $val) |
|
704 | + foreach ($this->join_form_list as $key => $val) |
|
705 | 705 | { |
706 | - if($val->is_active != 'Y') continue; |
|
706 | + if ($val->is_active != 'Y') continue; |
|
707 | 707 | unset($obj); |
708 | 708 | $obj->type = $val->column_type; |
709 | 709 | $obj->name = $val->column_name; |
710 | 710 | $obj->lang = $val->column_title; |
711 | - if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false; |
|
711 | + if ($logged_info->is_admin != 'Y') $obj->required = $val->required == 'Y' ?true:false; |
|
712 | 712 | else $obj->required = false; |
713 | 713 | $filter_output[] = $obj; |
714 | 714 | |
@@ -735,15 +735,15 @@ discard block |
||
735 | 735 | $args->sort_index = "list_order"; |
736 | 736 | $output = executeQueryArray('member.getJoinFormList', $args); |
737 | 737 | |
738 | - if(!$output->toBool()) |
|
738 | + if (!$output->toBool()) |
|
739 | 739 | { |
740 | 740 | return array(); |
741 | 741 | } |
742 | 742 | |
743 | 743 | $joinFormList = array(); |
744 | - foreach($output->data as $val) |
|
744 | + foreach ($output->data as $val) |
|
745 | 745 | { |
746 | - if($val->is_active != 'Y') |
|
746 | + if ($val->is_active != 'Y') |
|
747 | 747 | { |
748 | 748 | continue; |
749 | 749 | } |
@@ -760,20 +760,20 @@ discard block |
||
760 | 760 | function getCombineJoinForm($member_info) |
761 | 761 | { |
762 | 762 | $extend_form_list = $this->getJoinFormlist(); |
763 | - if(!$extend_form_list) return; |
|
763 | + if (!$extend_form_list) return; |
|
764 | 764 | // Member info is open only to an administrator and him/herself when is_private is true. |
765 | 765 | $logged_info = Context::get('logged_info'); |
766 | 766 | |
767 | - foreach($extend_form_list as $srl => $item) |
|
767 | + foreach ($extend_form_list as $srl => $item) |
|
768 | 768 | { |
769 | 769 | $column_name = $item->column_name; |
770 | 770 | $value = $member_info->{$column_name}; |
771 | 771 | |
772 | 772 | // Change values depening on the type of extend form |
773 | - switch($item->column_type) |
|
773 | + switch ($item->column_type) |
|
774 | 774 | { |
775 | 775 | case 'checkbox' : |
776 | - if($value && !is_array($value)) $value = array($value); |
|
776 | + if ($value && !is_array($value)) $value = array($value); |
|
777 | 777 | break; |
778 | 778 | case 'text' : |
779 | 779 | case 'homepage' : |
@@ -787,7 +787,7 @@ discard block |
||
787 | 787 | |
788 | 788 | $extend_form_list[$srl]->value = $value; |
789 | 789 | |
790 | - if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true; |
|
790 | + if ($member_info->{'open_'.$column_name} == 'Y') $extend_form_list[$srl]->is_opened = true; |
|
791 | 791 | else $extend_form_list[$srl]->is_opened = false; |
792 | 792 | } |
793 | 793 | return $extend_form_list; |
@@ -801,12 +801,12 @@ discard block |
||
801 | 801 | $args->member_join_form_srl = $member_join_form_srl; |
802 | 802 | $output = executeQuery('member.getJoinForm', $args); |
803 | 803 | $join_form = $output->data; |
804 | - if(!$join_form) return NULL; |
|
804 | + if (!$join_form) return NULL; |
|
805 | 805 | |
806 | 806 | $column_type = $join_form->column_type; |
807 | 807 | $default_value = $join_form->default_value; |
808 | 808 | |
809 | - if(in_array($column_type, array('checkbox','select','radio'))) |
|
809 | + if (in_array($column_type, array('checkbox', 'select', 'radio'))) |
|
810 | 810 | { |
811 | 811 | $join_form->default_value = unserialize($default_value); |
812 | 812 | } |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | */ |
824 | 824 | function getDeniedIDList() |
825 | 825 | { |
826 | - if(!$this->denied_id_list) |
|
826 | + if (!$this->denied_id_list) |
|
827 | 827 | { |
828 | 828 | $args->sort_index = "list_order"; |
829 | 829 | $args->page = Context::get('page'); |
@@ -839,14 +839,14 @@ discard block |
||
839 | 839 | function getDeniedIDs() |
840 | 840 | { |
841 | 841 | $output = executeQueryArray('member.getDeniedIDs'); |
842 | - if(!$output->toBool()) return array(); |
|
842 | + if (!$output->toBool()) return array(); |
|
843 | 843 | return $output->data; |
844 | 844 | } |
845 | 845 | |
846 | 846 | function getDeniedNickNames() |
847 | 847 | { |
848 | 848 | $output = executeQueryArray('member.getDeniedNickNames'); |
849 | - if(!$output->toBool()) |
|
849 | + if (!$output->toBool()) |
|
850 | 850 | { |
851 | 851 | return array(); |
852 | 852 | } |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | $args = new stdClass(); |
863 | 863 | $args->user_id = $user_id; |
864 | 864 | $output = executeQuery('member.chkDeniedID', $args); |
865 | - if($output->data->count) return true; |
|
865 | + if ($output->data->count) return true; |
|
866 | 866 | return false; |
867 | 867 | } |
868 | 868 | |
@@ -874,8 +874,8 @@ discard block |
||
874 | 874 | $args = new stdClass(); |
875 | 875 | $args->nick_name = $nickName; |
876 | 876 | $output = executeQuery('member.chkDeniedNickName', $args); |
877 | - if($output->data->count) return true; |
|
878 | - if(!$output->toBool()) |
|
877 | + if ($output->data->count) return true; |
|
878 | + if (!$output->toBool()) |
|
879 | 879 | { |
880 | 880 | return true; |
881 | 881 | } |
@@ -886,20 +886,20 @@ discard block |
||
886 | 886 | */ |
887 | 887 | function getProfileImage($member_srl) |
888 | 888 | { |
889 | - if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) |
|
889 | + if (!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) |
|
890 | 890 | { |
891 | 891 | $GLOBALS['__member_info__']['profile_image'][$member_srl] = null; |
892 | - $exts = array('gif','jpg','png'); |
|
893 | - for($i=0;$i<3;$i++) |
|
892 | + $exts = array('gif', 'jpg', 'png'); |
|
893 | + for ($i = 0; $i < 3; $i++) |
|
894 | 894 | { |
895 | 895 | $image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]); |
896 | - if(file_exists($image_name_file)) |
|
896 | + if (file_exists($image_name_file)) |
|
897 | 897 | { |
898 | 898 | list($width, $height, $type, $attrs) = getimagesize($image_name_file); |
899 | 899 | $info = new stdClass(); |
900 | 900 | $info->width = $width; |
901 | 901 | $info->height = $height; |
902 | - $info->src = Context::getRequestUri().$image_name_file . '?' . date('YmdHis', filemtime($image_name_file)); |
|
902 | + $info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file)); |
|
903 | 903 | $info->file = './'.$image_name_file; |
904 | 904 | $GLOBALS['__member_info__']['profile_image'][$member_srl] = $info; |
905 | 905 | break; |
@@ -915,16 +915,16 @@ discard block |
||
915 | 915 | */ |
916 | 916 | function getImageName($member_srl) |
917 | 917 | { |
918 | - if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) |
|
918 | + if (!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) |
|
919 | 919 | { |
920 | 920 | $image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl); |
921 | - if(file_exists($image_name_file)) |
|
921 | + if (file_exists($image_name_file)) |
|
922 | 922 | { |
923 | 923 | list($width, $height, $type, $attrs) = getimagesize($image_name_file); |
924 | 924 | $info = new stdClass; |
925 | 925 | $info->width = $width; |
926 | 926 | $info->height = $height; |
927 | - $info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file)); |
|
927 | + $info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file)); |
|
928 | 928 | $info->file = './'.$image_name_file; |
929 | 929 | $GLOBALS['__member_info__']['image_name'][$member_srl] = $info; |
930 | 930 | } |
@@ -938,15 +938,15 @@ discard block |
||
938 | 938 | */ |
939 | 939 | function getImageMark($member_srl) |
940 | 940 | { |
941 | - if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) |
|
941 | + if (!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) |
|
942 | 942 | { |
943 | 943 | $image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl); |
944 | - if(file_exists($image_mark_file)) |
|
944 | + if (file_exists($image_mark_file)) |
|
945 | 945 | { |
946 | 946 | list($width, $height, $type, $attrs) = getimagesize($image_mark_file); |
947 | 947 | $info->width = $width; |
948 | 948 | $info->height = $height; |
949 | - $info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file)); |
|
949 | + $info->src = Context::getRequestUri().$image_mark_file.'?'.date('YmdHis', filemtime($image_mark_file)); |
|
950 | 950 | $info->file = './'.$image_mark_file; |
951 | 951 | $GLOBALS['__member_info__']['image_mark'][$member_srl] = $info; |
952 | 952 | } |
@@ -960,27 +960,27 @@ discard block |
||
960 | 960 | /** |
961 | 961 | * @brief Get the image mark of the group |
962 | 962 | */ |
963 | - function getGroupImageMark($member_srl,$site_srl=0) |
|
963 | + function getGroupImageMark($member_srl, $site_srl = 0) |
|
964 | 964 | { |
965 | - if(!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl])) |
|
965 | + if (!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl])) |
|
966 | 966 | { |
967 | 967 | $oModuleModel = getModel('module'); |
968 | 968 | $config = $oModuleModel->getModuleConfig('member'); |
969 | - if($config->group_image_mark!='Y') |
|
969 | + if ($config->group_image_mark != 'Y') |
|
970 | 970 | { |
971 | 971 | return null; |
972 | 972 | } |
973 | - $member_group = $this->getMemberGroups($member_srl,$site_srl); |
|
973 | + $member_group = $this->getMemberGroups($member_srl, $site_srl); |
|
974 | 974 | $groups_info = $this->getGroups($site_srl); |
975 | - if(count($member_group) > 0 && is_array($member_group)) |
|
975 | + if (count($member_group) > 0 && is_array($member_group)) |
|
976 | 976 | { |
977 | 977 | $memberGroups = array_keys($member_group); |
978 | 978 | |
979 | - foreach($groups_info as $group_srl=>$group_info) |
|
979 | + foreach ($groups_info as $group_srl=>$group_info) |
|
980 | 980 | { |
981 | - if(in_array($group_srl, $memberGroups)) |
|
981 | + if (in_array($group_srl, $memberGroups)) |
|
982 | 982 | { |
983 | - if($group_info->image_mark) |
|
983 | + if ($group_info->image_mark) |
|
984 | 984 | { |
985 | 985 | $info = new stdClass(); |
986 | 986 | $info->title = $group_info->title; |
@@ -1004,10 +1004,10 @@ discard block |
||
1004 | 1004 | */ |
1005 | 1005 | function getSignature($member_srl) |
1006 | 1006 | { |
1007 | - if(!isset($GLOBALS['__member_info__']['signature'][$member_srl])) |
|
1007 | + if (!isset($GLOBALS['__member_info__']['signature'][$member_srl])) |
|
1008 | 1008 | { |
1009 | 1009 | $filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl); |
1010 | - if(file_exists($filename)) |
|
1010 | + if (file_exists($filename)) |
|
1011 | 1011 | { |
1012 | 1012 | $buff = FileHandler::readFile($filename); |
1013 | 1013 | $signature = preg_replace('/<\?.*?\?>/', '', $buff); |
@@ -1025,10 +1025,10 @@ discard block |
||
1025 | 1025 | * @param int $member_srl Set this to member_srl when comparing a member's password (optional) |
1026 | 1026 | * @return bool |
1027 | 1027 | */ |
1028 | - function isValidPassword($hashed_password, $password_text, $member_srl=null) |
|
1028 | + function isValidPassword($hashed_password, $password_text, $member_srl = null) |
|
1029 | 1029 | { |
1030 | 1030 | // False if no password in entered |
1031 | - if(!$password_text) |
|
1031 | + if (!$password_text) |
|
1032 | 1032 | { |
1033 | 1033 | return false; |
1034 | 1034 | } |
@@ -1037,31 +1037,31 @@ discard block |
||
1037 | 1037 | $oPassword = new Password(); |
1038 | 1038 | $current_algorithm = $oPassword->checkAlgorithm($hashed_password); |
1039 | 1039 | $match = $oPassword->checkPassword($password_text, $hashed_password, $current_algorithm); |
1040 | - if(!$match) |
|
1040 | + if (!$match) |
|
1041 | 1041 | { |
1042 | 1042 | return false; |
1043 | 1043 | } |
1044 | 1044 | |
1045 | 1045 | // Update the encryption method if necessary |
1046 | 1046 | $config = $this->getMemberConfig(); |
1047 | - if($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N') |
|
1047 | + if ($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N') |
|
1048 | 1048 | { |
1049 | 1049 | $need_upgrade = false; |
1050 | 1050 | |
1051 | - if(!$need_upgrade) |
|
1051 | + if (!$need_upgrade) |
|
1052 | 1052 | { |
1053 | 1053 | $required_algorithm = $oPassword->getCurrentlySelectedAlgorithm(); |
1054 | - if($required_algorithm !== $current_algorithm) $need_upgrade = true; |
|
1054 | + if ($required_algorithm !== $current_algorithm) $need_upgrade = true; |
|
1055 | 1055 | } |
1056 | 1056 | |
1057 | - if(!$need_upgrade) |
|
1057 | + if (!$need_upgrade) |
|
1058 | 1058 | { |
1059 | 1059 | $required_work_factor = $oPassword->getWorkFactor(); |
1060 | 1060 | $current_work_factor = $oPassword->checkWorkFactor($hashed_password); |
1061 | - if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; |
|
1061 | + if ($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; |
|
1062 | 1062 | } |
1063 | 1063 | |
1064 | - if($need_upgrade === true) |
|
1064 | + if ($need_upgrade === true) |
|
1065 | 1065 | { |
1066 | 1066 | $args = new stdClass(); |
1067 | 1067 | $args->member_srl = $member_srl; |
@@ -1089,27 +1089,27 @@ discard block |
||
1089 | 1089 | function checkPasswordStrength($password, $strength) |
1090 | 1090 | { |
1091 | 1091 | $logged_info = Context::get('logged_info'); |
1092 | - if($logged_info->is_admin == 'Y') return true; |
|
1092 | + if ($logged_info->is_admin == 'Y') return true; |
|
1093 | 1093 | |
1094 | - if($strength == NULL) |
|
1094 | + if ($strength == NULL) |
|
1095 | 1095 | { |
1096 | 1096 | $config = $this->getMemberConfig(); |
1097 | - $strength = $config->password_strength?$config->password_strength:'normal'; |
|
1097 | + $strength = $config->password_strength ? $config->password_strength : 'normal'; |
|
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | $length = strlen($password); |
1101 | 1101 | |
1102 | 1102 | switch ($strength) { |
1103 | 1103 | case 'high': |
1104 | - if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false; |
|
1104 | + if ($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false; |
|
1105 | 1105 | /* no break */ |
1106 | 1106 | |
1107 | 1107 | case 'normal': |
1108 | - if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false; |
|
1108 | + if ($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false; |
|
1109 | 1109 | break; |
1110 | 1110 | |
1111 | 1111 | case 'low': |
1112 | - if($length < 4) return false; |
|
1112 | + if ($length < 4) return false; |
|
1113 | 1113 | break; |
1114 | 1114 | } |
1115 | 1115 | |
@@ -1120,11 +1120,11 @@ discard block |
||
1120 | 1120 | { |
1121 | 1121 | $groupSrl = 0; |
1122 | 1122 | $output = $this->getGroups($site_srl); |
1123 | - if(is_array($output)) |
|
1123 | + if (is_array($output)) |
|
1124 | 1124 | { |
1125 | - foreach($output AS $key=>$value) |
|
1125 | + foreach ($output AS $key=>$value) |
|
1126 | 1126 | { |
1127 | - if($value->is_admin == 'Y') |
|
1127 | + if ($value->is_admin == 'Y') |
|
1128 | 1128 | { |
1129 | 1129 | $groupSrl = $value->group_srl; |
1130 | 1130 | break; |
@@ -45,37 +45,79 @@ discard block |
||
45 | 45 | foreach($config->signupForm AS $key=>$value) |
46 | 46 | { |
47 | 47 | $config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title; |
48 | - if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y'; |
|
49 | - if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N'; |
|
48 | + if($config->signupForm[$key]->isPublic != 'N') { |
|
49 | + $config->signupForm[$key]->isPublic = 'Y'; |
|
50 | + } |
|
51 | + if($value->name == 'find_account_question') { |
|
52 | + $config->signupForm[$key]->isPublic = 'N'; |
|
53 | + } |
|
50 | 54 | } |
51 | 55 | |
52 | 56 | // Get terms of user |
53 | 57 | $config->agreement = memberModel::_getAgreement(); |
54 | 58 | |
55 | - if(!$config->webmaster_name) $config->webmaster_name = 'webmaster'; |
|
59 | + if(!$config->webmaster_name) { |
|
60 | + $config->webmaster_name = 'webmaster'; |
|
61 | + } |
|
56 | 62 | |
57 | - if(!$config->image_name_max_width) $config->image_name_max_width = 90; |
|
58 | - if(!$config->image_name_max_height) $config->image_name_max_height = 20; |
|
59 | - if(!$config->image_name_max_filesize) $config->image_name_max_filesize = null; |
|
60 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = 20; |
|
61 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = 20; |
|
62 | - if(!$config->image_mark_max_filesize) $config->image_mark_max_filesize = null; |
|
63 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = 90; |
|
64 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = 90; |
|
65 | - if(!$config->profile_image_max_filesize) $config->profile_image_max_filesize = null; |
|
63 | + if(!$config->image_name_max_width) { |
|
64 | + $config->image_name_max_width = 90; |
|
65 | + } |
|
66 | + if(!$config->image_name_max_height) { |
|
67 | + $config->image_name_max_height = 20; |
|
68 | + } |
|
69 | + if(!$config->image_name_max_filesize) { |
|
70 | + $config->image_name_max_filesize = null; |
|
71 | + } |
|
72 | + if(!$config->image_mark_max_width) { |
|
73 | + $config->image_mark_max_width = 20; |
|
74 | + } |
|
75 | + if(!$config->image_mark_max_height) { |
|
76 | + $config->image_mark_max_height = 20; |
|
77 | + } |
|
78 | + if(!$config->image_mark_max_filesize) { |
|
79 | + $config->image_mark_max_filesize = null; |
|
80 | + } |
|
81 | + if(!$config->profile_image_max_width) { |
|
82 | + $config->profile_image_max_width = 90; |
|
83 | + } |
|
84 | + if(!$config->profile_image_max_height) { |
|
85 | + $config->profile_image_max_height = 90; |
|
86 | + } |
|
87 | + if(!$config->profile_image_max_filesize) { |
|
88 | + $config->profile_image_max_filesize = null; |
|
89 | + } |
|
66 | 90 | |
67 | - if(!$config->skin) $config->skin = 'default'; |
|
68 | - if(!$config->colorset) $config->colorset = 'white'; |
|
69 | - if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor'; |
|
70 | - if(!$config->group_image_mark) $config->group_image_mark = "N"; |
|
91 | + if(!$config->skin) { |
|
92 | + $config->skin = 'default'; |
|
93 | + } |
|
94 | + if(!$config->colorset) { |
|
95 | + $config->colorset = 'white'; |
|
96 | + } |
|
97 | + if(!$config->editor_skin || $config->editor_skin == 'default') { |
|
98 | + $config->editor_skin = 'ckeditor'; |
|
99 | + } |
|
100 | + if(!$config->group_image_mark) { |
|
101 | + $config->group_image_mark = "N"; |
|
102 | + } |
|
71 | 103 | |
72 | - if(!$config->identifier) $config->identifier = 'user_id'; |
|
104 | + if(!$config->identifier) { |
|
105 | + $config->identifier = 'user_id'; |
|
106 | + } |
|
73 | 107 | |
74 | - if(!$config->max_error_count) $config->max_error_count = 10; |
|
75 | - if(!$config->max_error_count_time) $config->max_error_count_time = 300; |
|
108 | + if(!$config->max_error_count) { |
|
109 | + $config->max_error_count = 10; |
|
110 | + } |
|
111 | + if(!$config->max_error_count_time) { |
|
112 | + $config->max_error_count_time = 300; |
|
113 | + } |
|
76 | 114 | |
77 | - if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor'; |
|
78 | - if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono'; |
|
115 | + if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') { |
|
116 | + $config->signature_editor_skin = 'ckeditor'; |
|
117 | + } |
|
118 | + if(!$config->sel_editor_colorset) { |
|
119 | + $config->sel_editor_colorset = 'moono'; |
|
120 | + } |
|
79 | 121 | |
80 | 122 | $member_config = $config; |
81 | 123 | |
@@ -121,12 +163,18 @@ discard block |
||
121 | 163 | $logged_info = Context::get('logged_info'); |
122 | 164 | $act = Context::get('cur_act'); |
123 | 165 | // When click user's own nickname |
124 | - if($member_srl == $logged_info->member_srl) $member_info = $logged_info; |
|
166 | + if($member_srl == $logged_info->member_srl) { |
|
167 | + $member_info = $logged_info; |
|
168 | + } |
|
125 | 169 | // When click other's nickname |
126 | - else $member_info = $this->getMemberInfoByMemberSrl($member_srl); |
|
170 | + else { |
|
171 | + $member_info = $this->getMemberInfoByMemberSrl($member_srl); |
|
172 | + } |
|
127 | 173 | |
128 | 174 | $member_srl = $member_info->member_srl; |
129 | - if(!$member_srl) return; |
|
175 | + if(!$member_srl) { |
|
176 | + return; |
|
177 | + } |
|
130 | 178 | // List variables |
131 | 179 | $user_id = $member_info->user_id; |
132 | 180 | $user_name = $member_info->user_name; |
@@ -161,11 +209,13 @@ discard block |
||
161 | 209 | } |
162 | 210 | } |
163 | 211 | // View homepage info |
164 | - if($member_info->homepage) |
|
165 | - $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank'); |
|
212 | + if($member_info->homepage) { |
|
213 | + $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank'); |
|
214 | + } |
|
166 | 215 | // View blog info |
167 | - if($member_info->blog) |
|
168 | - $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank'); |
|
216 | + if($member_info->blog) { |
|
217 | + $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank'); |
|
218 | + } |
|
169 | 219 | // Call a trigger (after) |
170 | 220 | ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null); |
171 | 221 | // Display a menu for editting member info to a top administrator |
@@ -200,16 +250,14 @@ discard block |
||
200 | 250 | if(Mobile::isFromMobilePhone()) |
201 | 251 | { |
202 | 252 | return true; |
203 | - } |
|
204 | - elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
253 | + } elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
205 | 254 | { |
206 | 255 | // IPv6: require same /48 |
207 | 256 | if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0) |
208 | 257 | { |
209 | 258 | return true; |
210 | 259 | } |
211 | - } |
|
212 | - else |
|
260 | + } else |
|
213 | 261 | { |
214 | 262 | // IPv4: require same /24 |
215 | 263 | if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) |
@@ -239,10 +287,12 @@ discard block |
||
239 | 287 | $logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl); |
240 | 288 | // Add is_site_admin bool variable into logged_info if site_administrator is |
241 | 289 | $oModuleModel = getModel('module'); |
242 | - if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; |
|
243 | - else $logged_info->is_site_admin = false; |
|
244 | - } |
|
245 | - else |
|
290 | + if($oModuleModel->isSiteAdmin($logged_info)) { |
|
291 | + $logged_info->is_site_admin = true; |
|
292 | + } else { |
|
293 | + $logged_info->is_site_admin = false; |
|
294 | + } |
|
295 | + } else |
|
246 | 296 | { |
247 | 297 | // Register a default group if the site doesn't have a member group |
248 | 298 | if(count($logged_info->group_list) === 0) |
@@ -268,13 +318,19 @@ discard block |
||
268 | 318 | */ |
269 | 319 | function getMemberInfoByUserID($user_id, $columnList = array()) |
270 | 320 | { |
271 | - if(!$user_id) return; |
|
321 | + if(!$user_id) { |
|
322 | + return; |
|
323 | + } |
|
272 | 324 | |
273 | 325 | $args = new stdClass; |
274 | 326 | $args->user_id = $user_id; |
275 | 327 | $output = executeQuery('member.getMemberInfo', $args); |
276 | - if(!$output->toBool()) return $output; |
|
277 | - if(!$output->data) return; |
|
328 | + if(!$output->toBool()) { |
|
329 | + return $output; |
|
330 | + } |
|
331 | + if(!$output->data) { |
|
332 | + return; |
|
333 | + } |
|
278 | 334 | |
279 | 335 | $member_info = $this->arrangeMemberInfo($output->data); |
280 | 336 | |
@@ -286,7 +342,9 @@ discard block |
||
286 | 342 | */ |
287 | 343 | function getMemberInfoByEmailAddress($email_address) |
288 | 344 | { |
289 | - if(!$email_address) return; |
|
345 | + if(!$email_address) { |
|
346 | + return; |
|
347 | + } |
|
290 | 348 | |
291 | 349 | $args = new stdClass(); |
292 | 350 | |
@@ -295,15 +353,18 @@ discard block |
||
295 | 353 | { |
296 | 354 | $args->email_address = strtolower($email_address); |
297 | 355 | $output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args); |
298 | - } |
|
299 | - else |
|
356 | + } else |
|
300 | 357 | { |
301 | 358 | $args->email_address = $email_address; |
302 | 359 | $output = executeQuery('member.getMemberInfoByEmailAddress', $args); |
303 | 360 | } |
304 | 361 | |
305 | - if(!$output->toBool()) return $output; |
|
306 | - if(!$output->data) return; |
|
362 | + if(!$output->toBool()) { |
|
363 | + return $output; |
|
364 | + } |
|
365 | + if(!$output->data) { |
|
366 | + return; |
|
367 | + } |
|
307 | 368 | |
308 | 369 | $member_info = $this->arrangeMemberInfo($output->data); |
309 | 370 | return $member_info; |
@@ -314,7 +375,9 @@ discard block |
||
314 | 375 | */ |
315 | 376 | function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array()) |
316 | 377 | { |
317 | - if(!$member_srl) return; |
|
378 | + if(!$member_srl) { |
|
379 | + return; |
|
380 | + } |
|
318 | 381 | |
319 | 382 | //columnList size zero... get full member info |
320 | 383 | if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0) |
@@ -337,13 +400,17 @@ discard block |
||
337 | 400 | $output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList); |
338 | 401 | if(!$output->data) |
339 | 402 | { |
340 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass); |
|
403 | + if($oCacheHandler->isSupport()) { |
|
404 | + $oCacheHandler->put($cache_key, new stdClass); |
|
405 | + } |
|
341 | 406 | return; |
342 | 407 | } |
343 | 408 | $this->arrangeMemberInfo($output->data, $site_srl); |
344 | 409 | |
345 | 410 | //insert in cache |
346 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
411 | + if($oCacheHandler->isSupport()) { |
|
412 | + $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
413 | + } |
|
347 | 414 | } |
348 | 415 | } |
349 | 416 | |
@@ -377,8 +444,12 @@ discard block |
||
377 | 444 | { |
378 | 445 | foreach($extra_vars as $key => $val) |
379 | 446 | { |
380 | - if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val); |
|
381 | - if(!$info->{$key}) $info->{$key} = $val; |
|
447 | + if(!is_array($val) && strpos($val, '|@|') !== FALSE) { |
|
448 | + $val = explode('|@|', $val); |
|
449 | + } |
|
450 | + if(!$info->{$key}) { |
|
451 | + $info->{$key} = $val; |
|
452 | + } |
|
382 | 453 | } |
383 | 454 | } |
384 | 455 | |
@@ -401,8 +472,7 @@ discard block |
||
401 | 472 | if(is_array($val)) |
402 | 473 | { |
403 | 474 | $oSecurity->encodeHTML($key . '.'); |
404 | - } |
|
405 | - else |
|
475 | + } else |
|
406 | 476 | { |
407 | 477 | $oSecurity->encodeHTML($key); |
408 | 478 | } |
@@ -465,7 +535,9 @@ discard block |
||
465 | 535 | */ |
466 | 536 | function getLoggedMemberSrl() |
467 | 537 | { |
468 | - if(!$this->isLogged()) return; |
|
538 | + if(!$this->isLogged()) { |
|
539 | + return; |
|
540 | + } |
|
469 | 541 | return $_SESSION['member_srl']; |
470 | 542 | } |
471 | 543 | |
@@ -474,7 +546,9 @@ discard block |
||
474 | 546 | */ |
475 | 547 | function getLoggedUserID() |
476 | 548 | { |
477 | - if(!$this->isLogged()) return; |
|
549 | + if(!$this->isLogged()) { |
|
550 | + return; |
|
551 | + } |
|
478 | 552 | $logged_info = Context::get('logged_info'); |
479 | 553 | return $logged_info->user_id; |
480 | 554 | } |
@@ -506,9 +580,13 @@ discard block |
||
506 | 580 | $output = executeQueryArray('member.getMemberGroups', $args); |
507 | 581 | $group_list = $output->data; |
508 | 582 | //insert in cache |
509 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
583 | + if($oCacheHandler->isSupport()) { |
|
584 | + $oCacheHandler->put($cache_key, $group_list); |
|
585 | + } |
|
586 | + } |
|
587 | + if(!$group_list) { |
|
588 | + return array(); |
|
510 | 589 | } |
511 | - if(!$group_list) return array(); |
|
512 | 590 | |
513 | 591 | foreach($group_list as $group) |
514 | 592 | { |
@@ -528,7 +606,9 @@ discard block |
||
528 | 606 | $args->site_srl = $site_srl; |
529 | 607 | $args->sort_index = 'list_order'; |
530 | 608 | $output = executeQueryArray('member.getMembersGroups', $args); |
531 | - if(!$output->data) return array(); |
|
609 | + if(!$output->data) { |
|
610 | + return array(); |
|
611 | + } |
|
532 | 612 | |
533 | 613 | $result = array(); |
534 | 614 | foreach($output->data as $key=>$val) |
@@ -620,7 +700,9 @@ discard block |
||
620 | 700 | $output = executeQueryArray('member.getGroups', $args); |
621 | 701 | $group_list = $output->data; |
622 | 702 | //insert in cache |
623 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
703 | + if($oCacheHandler->isSupport()) { |
|
704 | + $oCacheHandler->put($cache_key, $group_list); |
|
705 | + } |
|
624 | 706 | } |
625 | 707 | |
626 | 708 | if(!$group_list) |
@@ -668,9 +750,13 @@ discard block |
||
668 | 750 | $output = executeQuery('member.getJoinFormList', $args); |
669 | 751 | // NULL if output data deosn't exist |
670 | 752 | $join_form_list = $output->data; |
671 | - if(!$join_form_list) return NULL; |
|
753 | + if(!$join_form_list) { |
|
754 | + return NULL; |
|
755 | + } |
|
672 | 756 | // Need to unserialize because serialized array is inserted into DB in case of default_value |
673 | - if(!is_array($join_form_list)) $join_form_list = array($join_form_list); |
|
757 | + if(!is_array($join_form_list)) { |
|
758 | + $join_form_list = array($join_form_list); |
|
759 | + } |
|
674 | 760 | $join_form_count = count($join_form_list); |
675 | 761 | for($i=0;$i<$join_form_count;$i++) |
676 | 762 | { |
@@ -687,9 +773,10 @@ discard block |
||
687 | 773 | if(in_array($column_type, array('checkbox','select','radio'))) |
688 | 774 | { |
689 | 775 | $join_form_list[$i]->default_value = unserialize($default_value); |
690 | - if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = ''; |
|
691 | - } |
|
692 | - else |
|
776 | + if(!$join_form_list[$i]->default_value[0]) { |
|
777 | + $join_form_list[$i]->default_value = ''; |
|
778 | + } |
|
779 | + } else |
|
693 | 780 | { |
694 | 781 | $join_form_list[$i]->default_value = ''; |
695 | 782 | } |
@@ -703,13 +790,18 @@ discard block |
||
703 | 790 | { |
704 | 791 | foreach($this->join_form_list as $key => $val) |
705 | 792 | { |
706 | - if($val->is_active != 'Y') continue; |
|
793 | + if($val->is_active != 'Y') { |
|
794 | + continue; |
|
795 | + } |
|
707 | 796 | unset($obj); |
708 | 797 | $obj->type = $val->column_type; |
709 | 798 | $obj->name = $val->column_name; |
710 | 799 | $obj->lang = $val->column_title; |
711 | - if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false; |
|
712 | - else $obj->required = false; |
|
800 | + if($logged_info->is_admin != 'Y') { |
|
801 | + $obj->required = $val->required=='Y'?true:false; |
|
802 | + } else { |
|
803 | + $obj->required = false; |
|
804 | + } |
|
713 | 805 | $filter_output[] = $obj; |
714 | 806 | |
715 | 807 | unset($open_obj); |
@@ -760,7 +852,9 @@ discard block |
||
760 | 852 | function getCombineJoinForm($member_info) |
761 | 853 | { |
762 | 854 | $extend_form_list = $this->getJoinFormlist(); |
763 | - if(!$extend_form_list) return; |
|
855 | + if(!$extend_form_list) { |
|
856 | + return; |
|
857 | + } |
|
764 | 858 | // Member info is open only to an administrator and him/herself when is_private is true. |
765 | 859 | $logged_info = Context::get('logged_info'); |
766 | 860 | |
@@ -773,7 +867,9 @@ discard block |
||
773 | 867 | switch($item->column_type) |
774 | 868 | { |
775 | 869 | case 'checkbox' : |
776 | - if($value && !is_array($value)) $value = array($value); |
|
870 | + if($value && !is_array($value)) { |
|
871 | + $value = array($value); |
|
872 | + } |
|
777 | 873 | break; |
778 | 874 | case 'text' : |
779 | 875 | case 'homepage' : |
@@ -787,8 +883,11 @@ discard block |
||
787 | 883 | |
788 | 884 | $extend_form_list[$srl]->value = $value; |
789 | 885 | |
790 | - if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true; |
|
791 | - else $extend_form_list[$srl]->is_opened = false; |
|
886 | + if($member_info->{'open_'.$column_name}=='Y') { |
|
887 | + $extend_form_list[$srl]->is_opened = true; |
|
888 | + } else { |
|
889 | + $extend_form_list[$srl]->is_opened = false; |
|
890 | + } |
|
792 | 891 | } |
793 | 892 | return $extend_form_list; |
794 | 893 | } |
@@ -801,7 +900,9 @@ discard block |
||
801 | 900 | $args->member_join_form_srl = $member_join_form_srl; |
802 | 901 | $output = executeQuery('member.getJoinForm', $args); |
803 | 902 | $join_form = $output->data; |
804 | - if(!$join_form) return NULL; |
|
903 | + if(!$join_form) { |
|
904 | + return NULL; |
|
905 | + } |
|
805 | 906 | |
806 | 907 | $column_type = $join_form->column_type; |
807 | 908 | $default_value = $join_form->default_value; |
@@ -809,8 +910,7 @@ discard block |
||
809 | 910 | if(in_array($column_type, array('checkbox','select','radio'))) |
810 | 911 | { |
811 | 912 | $join_form->default_value = unserialize($default_value); |
812 | - } |
|
813 | - else |
|
913 | + } else |
|
814 | 914 | { |
815 | 915 | $join_form->default_value = ''; |
816 | 916 | } |
@@ -839,7 +939,9 @@ discard block |
||
839 | 939 | function getDeniedIDs() |
840 | 940 | { |
841 | 941 | $output = executeQueryArray('member.getDeniedIDs'); |
842 | - if(!$output->toBool()) return array(); |
|
942 | + if(!$output->toBool()) { |
|
943 | + return array(); |
|
944 | + } |
|
843 | 945 | return $output->data; |
844 | 946 | } |
845 | 947 | |
@@ -862,7 +964,9 @@ discard block |
||
862 | 964 | $args = new stdClass(); |
863 | 965 | $args->user_id = $user_id; |
864 | 966 | $output = executeQuery('member.chkDeniedID', $args); |
865 | - if($output->data->count) return true; |
|
967 | + if($output->data->count) { |
|
968 | + return true; |
|
969 | + } |
|
866 | 970 | return false; |
867 | 971 | } |
868 | 972 | |
@@ -874,7 +978,9 @@ discard block |
||
874 | 978 | $args = new stdClass(); |
875 | 979 | $args->nick_name = $nickName; |
876 | 980 | $output = executeQuery('member.chkDeniedNickName', $args); |
877 | - if($output->data->count) return true; |
|
981 | + if($output->data->count) { |
|
982 | + return true; |
|
983 | + } |
|
878 | 984 | if(!$output->toBool()) |
879 | 985 | { |
880 | 986 | return true; |
@@ -927,8 +1033,9 @@ discard block |
||
927 | 1033 | $info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file)); |
928 | 1034 | $info->file = './'.$image_name_file; |
929 | 1035 | $GLOBALS['__member_info__']['image_name'][$member_srl] = $info; |
1036 | + } else { |
|
1037 | + $GLOBALS['__member_info__']['image_name'][$member_srl] = null; |
|
930 | 1038 | } |
931 | - else $GLOBALS['__member_info__']['image_name'][$member_srl] = null; |
|
932 | 1039 | } |
933 | 1040 | return $GLOBALS['__member_info__']['image_name'][$member_srl]; |
934 | 1041 | } |
@@ -949,8 +1056,9 @@ discard block |
||
949 | 1056 | $info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file)); |
950 | 1057 | $info->file = './'.$image_mark_file; |
951 | 1058 | $GLOBALS['__member_info__']['image_mark'][$member_srl] = $info; |
1059 | + } else { |
|
1060 | + $GLOBALS['__member_info__']['image_mark'][$member_srl] = null; |
|
952 | 1061 | } |
953 | - else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null; |
|
954 | 1062 | } |
955 | 1063 | |
956 | 1064 | return $GLOBALS['__member_info__']['image_mark'][$member_srl]; |
@@ -992,9 +1100,13 @@ discard block |
||
992 | 1100 | } |
993 | 1101 | } |
994 | 1102 | } |
995 | - if (!$info) $GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N'; |
|
1103 | + if (!$info) { |
|
1104 | + $GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N'; |
|
1105 | + } |
|
1106 | + } |
|
1107 | + if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') { |
|
1108 | + return null; |
|
996 | 1109 | } |
997 | - if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') return null; |
|
998 | 1110 | |
999 | 1111 | return $GLOBALS['__member_info__']['group_image_mark'][$member_srl]; |
1000 | 1112 | } |
@@ -1012,8 +1124,9 @@ discard block |
||
1012 | 1124 | $buff = FileHandler::readFile($filename); |
1013 | 1125 | $signature = preg_replace('/<\?.*?\?>/', '', $buff); |
1014 | 1126 | $GLOBALS['__member_info__']['signature'][$member_srl] = $signature; |
1127 | + } else { |
|
1128 | + $GLOBALS['__member_info__']['signature'][$member_srl] = null; |
|
1015 | 1129 | } |
1016 | - else $GLOBALS['__member_info__']['signature'][$member_srl] = null; |
|
1017 | 1130 | } |
1018 | 1131 | return $GLOBALS['__member_info__']['signature'][$member_srl]; |
1019 | 1132 | } |
@@ -1051,14 +1164,18 @@ discard block |
||
1051 | 1164 | if(!$need_upgrade) |
1052 | 1165 | { |
1053 | 1166 | $required_algorithm = $oPassword->getCurrentlySelectedAlgorithm(); |
1054 | - if($required_algorithm !== $current_algorithm) $need_upgrade = true; |
|
1167 | + if($required_algorithm !== $current_algorithm) { |
|
1168 | + $need_upgrade = true; |
|
1169 | + } |
|
1055 | 1170 | } |
1056 | 1171 | |
1057 | 1172 | if(!$need_upgrade) |
1058 | 1173 | { |
1059 | 1174 | $required_work_factor = $oPassword->getWorkFactor(); |
1060 | 1175 | $current_work_factor = $oPassword->checkWorkFactor($hashed_password); |
1061 | - if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; |
|
1176 | + if($current_work_factor !== false && $required_work_factor > $current_work_factor) { |
|
1177 | + $need_upgrade = true; |
|
1178 | + } |
|
1062 | 1179 | } |
1063 | 1180 | |
1064 | 1181 | if($need_upgrade === true) |
@@ -1089,7 +1206,9 @@ discard block |
||
1089 | 1206 | function checkPasswordStrength($password, $strength) |
1090 | 1207 | { |
1091 | 1208 | $logged_info = Context::get('logged_info'); |
1092 | - if($logged_info->is_admin == 'Y') return true; |
|
1209 | + if($logged_info->is_admin == 'Y') { |
|
1210 | + return true; |
|
1211 | + } |
|
1093 | 1212 | |
1094 | 1213 | if($strength == NULL) |
1095 | 1214 | { |
@@ -1101,15 +1220,21 @@ discard block |
||
1101 | 1220 | |
1102 | 1221 | switch ($strength) { |
1103 | 1222 | case 'high': |
1104 | - if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false; |
|
1223 | + if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) { |
|
1224 | + return false; |
|
1225 | + } |
|
1105 | 1226 | /* no break */ |
1106 | 1227 | |
1107 | 1228 | case 'normal': |
1108 | - if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false; |
|
1229 | + if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) { |
|
1230 | + return false; |
|
1231 | + } |
|
1109 | 1232 | break; |
1110 | 1233 | |
1111 | 1234 | case 'low': |
1112 | - if($length < 4) return false; |
|
1235 | + if($length < 4) { |
|
1236 | + return false; |
|
1237 | + } |
|
1113 | 1238 | break; |
1114 | 1239 | } |
1115 | 1240 |
@@ -24,31 +24,31 @@ discard block |
||
24 | 24 | // if(Context::getRequestMethod() == "GET") return new BaseObject(-1, "msg_invalid_request"); |
25 | 25 | // Extract the necessary information in advance |
26 | 26 | $logged_info = Context::get('logged_info'); |
27 | - if($logged_info->is_admin != 'Y' || !checkCSRF()) |
|
27 | + if ($logged_info->is_admin != 'Y' || !checkCSRF()) |
|
28 | 28 | { |
29 | 29 | return new BaseObject(-1, 'msg_invalid_request'); |
30 | 30 | } |
31 | 31 | |
32 | - $args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date'); |
|
33 | - $oMemberModel = &getModel ('member'); |
|
34 | - $config = $oMemberModel->getMemberConfig (); |
|
32 | + $args = Context::gets('member_srl', 'email_address', 'find_account_answer', 'allow_mailing', 'allow_message', 'denied', 'is_admin', 'description', 'group_srl_list', 'limit_date'); |
|
33 | + $oMemberModel = &getModel('member'); |
|
34 | + $config = $oMemberModel->getMemberConfig(); |
|
35 | 35 | $getVars = array(); |
36 | - if($config->signupForm) |
|
36 | + if ($config->signupForm) |
|
37 | 37 | { |
38 | - foreach($config->signupForm as $formInfo) |
|
38 | + foreach ($config->signupForm as $formInfo) |
|
39 | 39 | { |
40 | - if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
40 | + if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
41 | 41 | { |
42 | 42 | $getVars[] = $formInfo->name; |
43 | 43 | } |
44 | 44 | } |
45 | 45 | } |
46 | - foreach($getVars as $val) |
|
46 | + foreach ($getVars as $val) |
|
47 | 47 | { |
48 | 48 | $args->{$val} = Context::get($val); |
49 | 49 | } |
50 | 50 | $args->member_srl = Context::get('member_srl'); |
51 | - if(Context::get('reset_password')) |
|
51 | + if (Context::get('reset_password')) |
|
52 | 52 | $args->password = Context::get('reset_password'); |
53 | 53 | else unset($args->password); |
54 | 54 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | unset($all_args->error_return_url); |
61 | 61 | unset($all_args->success_return_url); |
62 | 62 | unset($all_args->ruleset); |
63 | - if(!isset($args->limit_date)) $args->limit_date = ""; |
|
63 | + if (!isset($args->limit_date)) $args->limit_date = ""; |
|
64 | 64 | unset($all_args->password); |
65 | 65 | unset($all_args->password2); |
66 | 66 | unset($all_args->reset_password); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $extra_vars = delObjectVars($all_args, $args); |
69 | 69 | $args->extra_vars = serialize($extra_vars); |
70 | 70 | // Check if an original member exists having the member_srl |
71 | - if($args->member_srl) |
|
71 | + if ($args->member_srl) |
|
72 | 72 | { |
73 | 73 | // Create a member model object |
74 | 74 | $oMemberModel = getModel('member'); |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | $columnList = array('member_srl'); |
77 | 77 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList); |
78 | 78 | // If no original member exists, make a new one |
79 | - if($member_info->member_srl != $args->member_srl) unset($args->member_srl); |
|
79 | + if ($member_info->member_srl != $args->member_srl) unset($args->member_srl); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | // remove whitespace |
83 | 83 | $checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address'); |
84 | - foreach($checkInfos as $val) |
|
84 | + foreach ($checkInfos as $val) |
|
85 | 85 | { |
86 | - if(isset($args->{$val})) |
|
86 | + if (isset($args->{$val})) |
|
87 | 87 | { |
88 | 88 | $args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val}); |
89 | 89 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | $oMemberController = getController('member'); |
93 | 93 | // Execute insert or update depending on the value of member_srl |
94 | - if(!$args->member_srl) |
|
94 | + if (!$args->member_srl) |
|
95 | 95 | { |
96 | 96 | $args->password = Context::get('password'); |
97 | 97 | $output = $oMemberController->insertMember($args); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $msg_code = 'success_updated'; |
104 | 104 | } |
105 | 105 | |
106 | - if(!$output->toBool()) return $output; |
|
106 | + if (!$output->toBool()) return $output; |
|
107 | 107 | // Save Signature |
108 | 108 | $signature = Context::get('signature'); |
109 | 109 | $oMemberController->putSignature($args->member_srl, $signature); |
@@ -112,24 +112,24 @@ discard block |
||
112 | 112 | $this->setMessage($msg_code); |
113 | 113 | |
114 | 114 | $profile_image = $_FILES['profile_image']; |
115 | - if(is_uploaded_file($profile_image['tmp_name'])) |
|
115 | + if (is_uploaded_file($profile_image['tmp_name'])) |
|
116 | 116 | { |
117 | 117 | $output = $oMemberController->insertProfileImage($args->member_srl, $profile_image['tmp_name']); |
118 | - if(!$output->toBool()) return $output; |
|
118 | + if (!$output->toBool()) return $output; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | $image_mark = $_FILES['image_mark']; |
122 | - if(is_uploaded_file($image_mark['tmp_name'])) |
|
122 | + if (is_uploaded_file($image_mark['tmp_name'])) |
|
123 | 123 | { |
124 | 124 | $output = $oMemberController->insertImageMark($args->member_srl, $image_mark['tmp_name']); |
125 | - if(!$output->toBool()) return $output; |
|
125 | + if (!$output->toBool()) return $output; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | $image_name = $_FILES['image_name']; |
129 | 129 | if (is_uploaded_file($image_name['tmp_name'])) |
130 | 130 | { |
131 | 131 | $output = $oMemberController->insertImageName($args->member_srl, $image_name['tmp_name']); |
132 | - if(!$output->toBool()) return $output; |
|
132 | + if (!$output->toBool()) return $output; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminList'); |
@@ -147,9 +147,9 @@ discard block |
||
147 | 147 | |
148 | 148 | $oMemberController = getController('member'); |
149 | 149 | $output = $oMemberController->deleteMember($member_srl); |
150 | - if(!$output->toBool()) return $output; |
|
150 | + if (!$output->toBool()) return $output; |
|
151 | 151 | |
152 | - $this->add('page',Context::get('page')); |
|
152 | + $this->add('page', Context::get('page')); |
|
153 | 153 | $this->setMessage("success_deleted"); |
154 | 154 | } |
155 | 155 | |
@@ -168,26 +168,26 @@ discard block |
||
168 | 168 | ); |
169 | 169 | |
170 | 170 | $oPassword = new Password(); |
171 | - if(!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms())) |
|
171 | + if (!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms())) |
|
172 | 172 | { |
173 | 173 | $args->password_hashing_algorithm = 'md5'; |
174 | 174 | } |
175 | 175 | |
176 | 176 | $args->password_hashing_work_factor = intval($args->password_hashing_work_factor, 10); |
177 | - if($args->password_hashing_work_factor < 4) |
|
177 | + if ($args->password_hashing_work_factor < 4) |
|
178 | 178 | { |
179 | 179 | $args->password_hashing_work_factor = 4; |
180 | 180 | } |
181 | - if($args->password_hashing_work_factor > 16) |
|
181 | + if ($args->password_hashing_work_factor > 16) |
|
182 | 182 | { |
183 | 183 | $args->password_hashing_work_factor = 16; |
184 | 184 | } |
185 | - if($args->password_hashing_auto_upgrade != 'Y') |
|
185 | + if ($args->password_hashing_auto_upgrade != 'Y') |
|
186 | 186 | { |
187 | 187 | $args->password_hashing_auto_upgrade = 'N'; |
188 | 188 | } |
189 | 189 | |
190 | - if((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y') |
|
190 | + if ((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y') |
|
191 | 191 | { |
192 | 192 | return new BaseObject(-1, 'msg_mail_authorization'); |
193 | 193 | } |
@@ -222,20 +222,20 @@ discard block |
||
222 | 222 | $usable_list = Context::get('usable_list'); |
223 | 223 | $all_args = Context::getRequestVars(); |
224 | 224 | |
225 | - $args->limit_day = (int)$args->limit_day; |
|
226 | - if(!trim(strip_tags($args->agreement))) |
|
225 | + $args->limit_day = (int) $args->limit_day; |
|
226 | + if (!trim(strip_tags($args->agreement))) |
|
227 | 227 | { |
228 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
228 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
229 | 229 | FileHandler::removeFile($agreement_file); |
230 | 230 | $args->agreement = NULL; |
231 | 231 | } |
232 | 232 | |
233 | - if($args->redirect_url) |
|
233 | + if ($args->redirect_url) |
|
234 | 234 | { |
235 | 235 | $oModuleModel = getModel('module'); |
236 | 236 | $redirectModuleInfo = $oModuleModel->getModuleInfoByModuleSrl($args->redirect_url, array('mid')); |
237 | 237 | |
238 | - if(!$redirectModuleInfo) |
|
238 | + if (!$redirectModuleInfo) |
|
239 | 239 | { |
240 | 240 | return new BaseObject('-1', 'msg_exist_selected_module'); |
241 | 241 | } |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | $mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question'); |
275 | 275 | $extendItems = $oMemberModel->getJoinFormList(); |
276 | 276 | |
277 | - foreach($list_order as $key) |
|
277 | + foreach ($list_order as $key) |
|
278 | 278 | { |
279 | 279 | $signupItem = new stdClass(); |
280 | 280 | $signupItem->isIdentifier = ($key == $all_args->identifier); |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $signupItem->isUse = in_array($key, $usable_list) || $signupItem->required; |
288 | 288 | $signupItem->isPublic = ($all_args->{'is_'.$key.'_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N'; |
289 | 289 | |
290 | - if($signupItem->imageType) |
|
290 | + if ($signupItem->imageType) |
|
291 | 291 | { |
292 | 292 | $signupItem->max_width = $all_args->{$key.'_max_width'}; |
293 | 293 | $signupItem->max_height = $all_args->{$key.'_max_height'}; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | } |
296 | 296 | |
297 | 297 | // set extends form |
298 | - if(!$signupItem->isDefaultForm) |
|
298 | + if (!$signupItem->isDefaultForm) |
|
299 | 299 | { |
300 | 300 | $extendItem = $extendItems[$all_args->{$key.'_member_join_form_srl'}]; |
301 | 301 | $signupItem->type = $extendItem->column_type; |
@@ -304,13 +304,13 @@ discard block |
||
304 | 304 | $signupItem->description = $extendItem->description; |
305 | 305 | |
306 | 306 | // check usable value change, required/option |
307 | - if($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y')) |
|
307 | + if ($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y')) |
|
308 | 308 | { |
309 | 309 | unset($update_args); |
310 | 310 | $update_args = new stdClass; |
311 | 311 | $update_args->member_join_form_srl = $extendItem->member_join_form_srl; |
312 | - $update_args->is_active = $signupItem->isUse?'Y':'N'; |
|
313 | - $update_args->required = $signupItem->required?'Y':'N'; |
|
312 | + $update_args->is_active = $signupItem->isUse ? 'Y' : 'N'; |
|
313 | + $update_args->required = $signupItem->required ? 'Y' : 'N'; |
|
314 | 314 | |
315 | 315 | $update_output = executeQuery('member.updateJoinForm', $update_args); |
316 | 316 | } |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | $this->_createFindAccountByQuestion($args->identifier); |
328 | 328 | |
329 | 329 | // check agreement value exist |
330 | - if($args->agreement) |
|
330 | + if ($args->agreement) |
|
331 | 331 | { |
332 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
332 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
333 | 333 | $output = FileHandler::writeFile($agreement_file, $args->agreement); |
334 | 334 | |
335 | 335 | unset($args->agreement); |
@@ -357,16 +357,16 @@ discard block |
||
357 | 357 | 'after_logout_url' |
358 | 358 | ); |
359 | 359 | |
360 | - if(!$args->change_password_date) |
|
360 | + if (!$args->change_password_date) |
|
361 | 361 | { |
362 | 362 | $args->change_password_date = 0; |
363 | 363 | } |
364 | 364 | |
365 | - if(!trim(strip_tags($args->after_login_url))) |
|
365 | + if (!trim(strip_tags($args->after_login_url))) |
|
366 | 366 | { |
367 | 367 | $args->after_login_url = NULL; |
368 | 368 | } |
369 | - if(!trim(strip_tags($args->after_logout_url))) |
|
369 | + if (!trim(strip_tags($args->after_logout_url))) |
|
370 | 370 | { |
371 | 371 | $args->after_logout_url = NULL; |
372 | 372 | } |
@@ -393,17 +393,17 @@ discard block |
||
393 | 393 | ); |
394 | 394 | |
395 | 395 | $args->layout_srl = $args->layout_srl ? $args->layout_srl : NULL; |
396 | - if(!$args->skin) |
|
396 | + if (!$args->skin) |
|
397 | 397 | { |
398 | 398 | $args->skin = 'default'; |
399 | 399 | } |
400 | - if(!$args->colorset) |
|
400 | + if (!$args->colorset) |
|
401 | 401 | { |
402 | 402 | $args->colorset = 'white'; |
403 | 403 | } |
404 | 404 | |
405 | 405 | $args->mlayout_srl = $args->mlayout_srl ? $args->mlayout_srl : NULL; |
406 | - if(!$args->mskin) |
|
406 | + if (!$args->mskin) |
|
407 | 407 | { |
408 | 408 | $args->mskin = 'default'; |
409 | 409 | } |
@@ -426,12 +426,12 @@ discard block |
||
426 | 426 | $extendItems = $oMemberModel->getJoinFormList(); |
427 | 427 | |
428 | 428 | $items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark'); |
429 | - $mustRequireds = array('email_address', 'nick_name','password', 'find_account_question'); |
|
429 | + $mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question'); |
|
430 | 430 | $orgRequireds = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name'); |
431 | 431 | $orgUse = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name', 'homepage', 'blog', 'birthday'); |
432 | 432 | $list_order = array(); |
433 | 433 | |
434 | - foreach($items as $key) |
|
434 | + foreach ($items as $key) |
|
435 | 435 | { |
436 | 436 | unset($signupItem); |
437 | 437 | $signupItem = new stdClass; |
@@ -443,23 +443,23 @@ discard block |
||
443 | 443 | $signupItem->required = in_array($key, $orgRequireds); |
444 | 444 | $signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse); |
445 | 445 | $signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N'; |
446 | - if(in_array($key, array('find_account_question', 'password', 'email_address'))) |
|
446 | + if (in_array($key, array('find_account_question', 'password', 'email_address'))) |
|
447 | 447 | { |
448 | 448 | $signupItem->isPublic = 'N'; |
449 | 449 | } |
450 | 450 | $signupItem->isIdentifier = ($key == $identifier); |
451 | - if ($signupItem->imageType){ |
|
451 | + if ($signupItem->imageType) { |
|
452 | 452 | $signupItem->max_width = $config->{$key.'_max_width'}; |
453 | 453 | $signupItem->max_height = $config->{$key.'_max_height'}; |
454 | 454 | } |
455 | - if($signupItem->isIdentifier) |
|
455 | + if ($signupItem->isIdentifier) |
|
456 | 456 | array_unshift($list_order, $signupItem); |
457 | 457 | else |
458 | 458 | $list_order[] = $signupItem; |
459 | 459 | } |
460 | - if(is_array($extendItems)) |
|
460 | + if (is_array($extendItems)) |
|
461 | 461 | { |
462 | - foreach($extendItems as $form_srl=>$item_info) |
|
462 | + foreach ($extendItems as $form_srl=>$item_info) |
|
463 | 463 | { |
464 | 464 | unset($signupItem); |
465 | 465 | $signupItem = new stdClass; |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $signupItem->isUse = ($item_info->is_active == 'Y'); |
473 | 473 | $signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N'; |
474 | 474 | $signupItem->description = $item_info->description; |
475 | - if($signupItem->imageType) |
|
475 | + if ($signupItem->imageType) |
|
476 | 476 | { |
477 | 477 | $signupItem->max_width = $config->{$key.'_max_width'}; |
478 | 478 | $signupItem->max_height = $config->{$key.'_max_height'}; |
@@ -490,13 +490,13 @@ discard block |
||
490 | 490 | * @param string $agreement |
491 | 491 | * @return void |
492 | 492 | */ |
493 | - function _createSignupRuleset($signupForm, $agreement = null){ |
|
493 | + function _createSignupRuleset($signupForm, $agreement = null) { |
|
494 | 494 | $xml_file = './files/ruleset/insertMember.xml'; |
495 | - $buff = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL. |
|
496 | - '<ruleset version="1.5.0">' . PHP_EOL. |
|
497 | - '<customrules>' . PHP_EOL. |
|
498 | - '</customrules>' . PHP_EOL. |
|
499 | - '<fields>' . PHP_EOL . '%s' . PHP_EOL . '</fields>' . PHP_EOL. |
|
495 | + $buff = '<?xml version="1.0" encoding="utf-8"?>'.PHP_EOL. |
|
496 | + '<ruleset version="1.5.0">'.PHP_EOL. |
|
497 | + '<customrules>'.PHP_EOL. |
|
498 | + '</customrules>'.PHP_EOL. |
|
499 | + '<fields>'.PHP_EOL.'%s'.PHP_EOL.'</fields>'.PHP_EOL. |
|
500 | 500 | '</ruleset>'; |
501 | 501 | |
502 | 502 | $fields = array(); |
@@ -505,41 +505,41 @@ discard block |
||
505 | 505 | { |
506 | 506 | $fields[] = '<field name="accept_agreement"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /></field>'; |
507 | 507 | } |
508 | - foreach($signupForm as $formInfo) |
|
508 | + foreach ($signupForm as $formInfo) |
|
509 | 509 | { |
510 | - if($formInfo->required || $formInfo->mustRequired) |
|
510 | + if ($formInfo->required || $formInfo->mustRequired) |
|
511 | 511 | { |
512 | - if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip') |
|
512 | + if ($formInfo->type == 'tel' || $formInfo->type == 'kr_zip') |
|
513 | 513 | { |
514 | 514 | $fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name); |
515 | 515 | } |
516 | - else if($formInfo->name == 'password') |
|
516 | + else if ($formInfo->name == 'password') |
|
517 | 517 | { |
518 | 518 | $fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>'; |
519 | 519 | $fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>'; |
520 | 520 | } |
521 | - else if($formInfo->name == 'find_account_question') |
|
521 | + else if ($formInfo->name == 'find_account_question') |
|
522 | 522 | { |
523 | 523 | $fields[] = '<field name="find_account_question"><if test="$modify_find_account_answer" attr="required" value="true" /></field>'; |
524 | 524 | $fields[] = '<field name="find_account_answer" length=":250"><if test="$modify_find_account_answer" attr="required" value="true" /></field>'; |
525 | 525 | } |
526 | - else if($formInfo->name == 'email_address') |
|
526 | + else if ($formInfo->name == 'email_address') |
|
527 | 527 | { |
528 | 528 | $fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name); |
529 | 529 | } |
530 | - else if($formInfo->name == 'user_id') |
|
530 | + else if ($formInfo->name == 'user_id') |
|
531 | 531 | { |
532 | 532 | $fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name); |
533 | 533 | } |
534 | - else if($formInfo->name == 'nick_name') |
|
534 | + else if ($formInfo->name == 'nick_name') |
|
535 | 535 | { |
536 | 536 | $fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name); |
537 | 537 | } |
538 | - else if(strpos($formInfo->name, 'image') !== false) |
|
538 | + else if (strpos($formInfo->name, 'image') !== false) |
|
539 | 539 | { |
540 | 540 | $fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' && $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name); |
541 | 541 | } |
542 | - else if($formInfo->name == 'signature') |
|
542 | + else if ($formInfo->name == 'signature') |
|
543 | 543 | { |
544 | 544 | $fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>'; |
545 | 545 | } |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | FileHandler::writeFile($xml_file, $xml_buff); |
555 | 555 | unset($xml_buff); |
556 | 556 | |
557 | - $validator = new Validator($xml_file); |
|
557 | + $validator = new Validator($xml_file); |
|
558 | 558 | $validator->setCacheDir('files/cache'); |
559 | 559 | $validator->getJsPath(); |
560 | 560 | } |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | $xml_buff = sprintf($buff, implode('', $fields)); |
583 | 583 | Filehandler::writeFile($xml_file, $xml_buff); |
584 | 584 | |
585 | - $validator = new Validator($xml_file); |
|
585 | + $validator = new Validator($xml_file); |
|
586 | 586 | $validator->setCacheDir('files/cache'); |
587 | 587 | $validator->getJsPath(); |
588 | 588 | } |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | '</ruleset>'; |
604 | 604 | |
605 | 605 | $fields = array(); |
606 | - if($identifier == 'user_id') |
|
606 | + if ($identifier == 'user_id') |
|
607 | 607 | $fields[] = '<field name="user_id" required="true" rule="userid" />'; |
608 | 608 | |
609 | 609 | $fields[] = '<field name="email_address" required="true" rule="email" />'; |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | $xml_buff = sprintf($buff, implode('', $fields)); |
614 | 614 | Filehandler::writeFile($xml_file, $xml_buff); |
615 | 615 | |
616 | - $validator = new Validator($xml_file); |
|
616 | + $validator = new Validator($xml_file); |
|
617 | 617 | $validator->setCacheDir('files/cache'); |
618 | 618 | $validator->getJsPath(); |
619 | 619 | } |
@@ -624,12 +624,12 @@ discard block |
||
624 | 624 | */ |
625 | 625 | function procMemberAdminInsertGroup() |
626 | 626 | { |
627 | - $args = Context::gets('title','description','is_default','image_mark'); |
|
627 | + $args = Context::gets('title', 'description', 'is_default', 'image_mark'); |
|
628 | 628 | $output = $this->insertGroup($args); |
629 | - if(!$output->toBool()) return $output; |
|
629 | + if (!$output->toBool()) return $output; |
|
630 | 630 | |
631 | - $this->add('group_srl',''); |
|
632 | - $this->add('page',Context::get('page')); |
|
631 | + $this->add('group_srl', ''); |
|
632 | + $this->add('page', Context::get('page')); |
|
633 | 633 | $this->setMessage('success_registed'); |
634 | 634 | |
635 | 635 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList'); |
@@ -644,13 +644,13 @@ discard block |
||
644 | 644 | { |
645 | 645 | $group_srl = Context::get('group_srl'); |
646 | 646 | |
647 | - $args = Context::gets('group_srl','title','description','is_default','image_mark'); |
|
647 | + $args = Context::gets('group_srl', 'title', 'description', 'is_default', 'image_mark'); |
|
648 | 648 | $args->site_srl = 0; |
649 | 649 | $output = $this->updateGroup($args); |
650 | - if(!$output->toBool()) return $output; |
|
650 | + if (!$output->toBool()) return $output; |
|
651 | 651 | |
652 | - $this->add('group_srl',''); |
|
653 | - $this->add('page',Context::get('page')); |
|
652 | + $this->add('group_srl', ''); |
|
653 | + $this->add('page', Context::get('page')); |
|
654 | 654 | $this->setMessage('success_updated'); |
655 | 655 | |
656 | 656 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList'); |
@@ -666,10 +666,10 @@ discard block |
||
666 | 666 | $group_srl = Context::get('group_srl'); |
667 | 667 | |
668 | 668 | $output = $this->deleteGroup($group_srl); |
669 | - if(!$output->toBool()) return $output; |
|
669 | + if (!$output->toBool()) return $output; |
|
670 | 670 | |
671 | - $this->add('group_srl',''); |
|
672 | - $this->add('page',Context::get('page')); |
|
671 | + $this->add('group_srl', ''); |
|
672 | + $this->add('page', Context::get('page')); |
|
673 | 673 | $this->setMessage('success_deleted'); |
674 | 674 | |
675 | 675 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList'); |
@@ -691,10 +691,10 @@ discard block |
||
691 | 691 | $args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value'))); |
692 | 692 | $args->required = Context::get('required'); |
693 | 693 | $args->is_active = (isset($args->required)); |
694 | - if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N'; |
|
694 | + if (!in_array(strtoupper($args->required), array('Y', 'N')))$args->required = 'N'; |
|
695 | 695 | $args->description = Context::get('description') ? Context::get('description') : ''; |
696 | 696 | // Default values |
697 | - if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value)) |
|
697 | + if (in_array($args->column_type, array('checkbox', 'select', 'radio')) && count($args->default_value)) |
|
698 | 698 | { |
699 | 699 | $args->default_value = serialize($args->default_value); |
700 | 700 | } |
@@ -706,17 +706,17 @@ discard block |
||
706 | 706 | // Check ID duplicated |
707 | 707 | $oMemberModel = getModel('member'); |
708 | 708 | $config = $oMemberModel->getMemberConfig(); |
709 | - foreach($config->signupForm as $item) |
|
709 | + foreach ($config->signupForm as $item) |
|
710 | 710 | { |
711 | - if($item->name == $args->column_name) |
|
711 | + if ($item->name == $args->column_name) |
|
712 | 712 | { |
713 | - if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue; |
|
714 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
713 | + if ($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue; |
|
714 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
715 | 715 | } |
716 | 716 | } |
717 | 717 | // Fix if member_join_form_srl exists. Add if not exists. |
718 | 718 | $isInsert; |
719 | - if(!$args->member_join_form_srl) |
|
719 | + if (!$args->member_join_form_srl) |
|
720 | 720 | { |
721 | 721 | $isInsert = true; |
722 | 722 | $args->list_order = $args->member_join_form_srl = getNextSequence(); |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | $output = executeQuery('member.updateJoinForm', $args); |
728 | 728 | } |
729 | 729 | |
730 | - if(!$output->toBool()) return $output; |
|
730 | + if (!$output->toBool()) return $output; |
|
731 | 731 | |
732 | 732 | // memberConfig update |
733 | 733 | $signupItem = new stdClass(); |
@@ -744,15 +744,15 @@ discard block |
||
744 | 744 | $config = $oMemberModel->getMemberConfig(); |
745 | 745 | unset($config->agreement); |
746 | 746 | |
747 | - if($isInsert) |
|
747 | + if ($isInsert) |
|
748 | 748 | { |
749 | 749 | $config->signupForm[] = $signupItem; |
750 | 750 | } |
751 | 751 | else |
752 | 752 | { |
753 | - foreach($config->signupForm as $key=>$val) |
|
753 | + foreach ($config->signupForm as $key=>$val) |
|
754 | 754 | { |
755 | - if($val->member_join_form_srl == $signupItem->member_join_form_srl) |
|
755 | + if ($val->member_join_form_srl == $signupItem->member_join_form_srl) |
|
756 | 756 | { |
757 | 757 | $config->signupForm[$key] = $signupItem; |
758 | 758 | } |
@@ -780,9 +780,9 @@ discard block |
||
780 | 780 | $config = $oMemberModel->getMemberConfig(); |
781 | 781 | unset($config->agreement); |
782 | 782 | |
783 | - foreach($config->signupForm as $key=>$val) |
|
783 | + foreach ($config->signupForm as $key=>$val) |
|
784 | 784 | { |
785 | - if($val->member_join_form_srl == $member_join_form_srl) |
|
785 | + if ($val->member_join_form_srl == $member_join_form_srl) |
|
786 | 786 | { |
787 | 787 | unset($config->signupForm[$key]); |
788 | 788 | break; |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | $member_join_form_srl = Context::get('member_join_form_srl'); |
803 | 803 | $mode = Context::get('mode'); |
804 | 804 | |
805 | - switch($mode) |
|
805 | + switch ($mode) |
|
806 | 806 | { |
807 | 807 | case 'up' : |
808 | 808 | $output = $this->moveJoinFormUp($member_join_form_srl); |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | case 'update' : |
820 | 820 | break; |
821 | 821 | } |
822 | - if(!$output->toBool()) return $output; |
|
822 | + if (!$output->toBool()) return $output; |
|
823 | 823 | |
824 | 824 | $this->setMessage($msg_code); |
825 | 825 | } |
@@ -838,40 +838,40 @@ discard block |
||
838 | 838 | $oDB->begin(); |
839 | 839 | |
840 | 840 | $oMemberController = getController('member'); |
841 | - foreach($members as $key=>$member_srl) |
|
841 | + foreach ($members as $key=>$member_srl) |
|
842 | 842 | { |
843 | 843 | $args = new stdClass(); |
844 | 844 | $args->member_srl = $member_srl; |
845 | - switch($var->type) |
|
845 | + switch ($var->type) |
|
846 | 846 | { |
847 | 847 | case 'modify': |
848 | 848 | { |
849 | - if(count($groups) > 0) |
|
849 | + if (count($groups) > 0) |
|
850 | 850 | { |
851 | 851 | $args->site_srl = 0; |
852 | 852 | // One of its members to delete all the group |
853 | 853 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
854 | - if(!$output->toBool()) |
|
854 | + if (!$output->toBool()) |
|
855 | 855 | { |
856 | 856 | $oDB->rollback(); |
857 | 857 | return $output; |
858 | 858 | } |
859 | 859 | // Enter one of the loop a |
860 | - foreach($groups as $group_srl) |
|
860 | + foreach ($groups as $group_srl) |
|
861 | 861 | { |
862 | - $output = $oMemberController->addMemberToGroup($args->member_srl,$group_srl); |
|
863 | - if(!$output->toBool()) |
|
862 | + $output = $oMemberController->addMemberToGroup($args->member_srl, $group_srl); |
|
863 | + if (!$output->toBool()) |
|
864 | 864 | { |
865 | 865 | $oDB->rollback(); |
866 | 866 | return $output; |
867 | 867 | } |
868 | 868 | } |
869 | 869 | } |
870 | - if($var->denied) |
|
870 | + if ($var->denied) |
|
871 | 871 | { |
872 | 872 | $args->denied = $var->denied; |
873 | 873 | $output = executeQuery('member.updateMemberDeniedInfo', $args); |
874 | - if(!$output->toBool()) |
|
874 | + if (!$output->toBool()) |
|
875 | 875 | { |
876 | 876 | $oDB->rollback(); |
877 | 877 | return $output; |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | { |
885 | 885 | $oMemberController->memberInfo = null; |
886 | 886 | $output = $oMemberController->deleteMember($member_srl); |
887 | - if(!$output->toBool()) |
|
887 | + if (!$output->toBool()) |
|
888 | 888 | { |
889 | 889 | $oDB->rollback(); |
890 | 890 | return $output; |
@@ -897,15 +897,15 @@ discard block |
||
897 | 897 | |
898 | 898 | $message = $var->message; |
899 | 899 | // Send a message |
900 | - if($message) |
|
900 | + if ($message) |
|
901 | 901 | { |
902 | 902 | $oCommunicationController = getController('communication'); |
903 | 903 | |
904 | 904 | $logged_info = Context::get('logged_info'); |
905 | - $title = cut_str($message,10,'...'); |
|
905 | + $title = cut_str($message, 10, '...'); |
|
906 | 906 | $sender_member_srl = $logged_info->member_srl; |
907 | 907 | |
908 | - foreach($members as $member_srl) |
|
908 | + foreach ($members as $member_srl) |
|
909 | 909 | { |
910 | 910 | $oCommunicationController->sendMessage($sender_member_srl, $member_srl, $title, $message, false); |
911 | 911 | } |
@@ -922,14 +922,14 @@ discard block |
||
922 | 922 | function procMemberAdminDeleteMembers() |
923 | 923 | { |
924 | 924 | $target_member_srls = Context::get('target_member_srls'); |
925 | - if(!$target_member_srls) return new BaseObject(-1, 'msg_invalid_request'); |
|
925 | + if (!$target_member_srls) return new BaseObject(-1, 'msg_invalid_request'); |
|
926 | 926 | $member_srls = explode(',', $target_member_srls); |
927 | 927 | $oMemberController = getController('member'); |
928 | 928 | |
929 | - foreach($member_srls as $member) |
|
929 | + foreach ($member_srls as $member) |
|
930 | 930 | { |
931 | 931 | $output = $oMemberController->deleteMember($member); |
932 | - if(!$output->toBool()) |
|
932 | + if (!$output->toBool()) |
|
933 | 933 | { |
934 | 934 | $this->setMessage('failed_deleted'); |
935 | 935 | return $output; |
@@ -946,11 +946,11 @@ discard block |
||
946 | 946 | function procMemberAdminUpdateMembersGroup() |
947 | 947 | { |
948 | 948 | $member_srl = Context::get('member_srl'); |
949 | - if(!$member_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
950 | - $member_srls = explode(',',$member_srl); |
|
949 | + if (!$member_srl) return new BaseObject(-1, 'msg_invalid_request'); |
|
950 | + $member_srls = explode(',', $member_srl); |
|
951 | 951 | |
952 | 952 | $group_srl = Context::get('group_srls'); |
953 | - if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl); |
|
953 | + if (!is_array($group_srl)) $group_srls = explode('|@|', $group_srl); |
|
954 | 954 | else $group_srls = $group_srl; |
955 | 955 | |
956 | 956 | $oDB = &DB::getInstance(); |
@@ -959,7 +959,7 @@ discard block |
||
959 | 959 | $args = new stdClass; |
960 | 960 | $args->member_srl = $member_srl; |
961 | 961 | $output = executeQuery('member.deleteMembersGroup', $args); |
962 | - if(!$output->toBool()) |
|
962 | + if (!$output->toBool()) |
|
963 | 963 | { |
964 | 964 | $oDB->rollback(); |
965 | 965 | return $output; |
@@ -967,21 +967,21 @@ discard block |
||
967 | 967 | // Add to a selected group |
968 | 968 | $group_count = count($group_srls); |
969 | 969 | $member_count = count($member_srls); |
970 | - for($j=0;$j<$group_count;$j++) |
|
970 | + for ($j = 0; $j < $group_count; $j++) |
|
971 | 971 | { |
972 | - $group_srl = (int)trim($group_srls[$j]); |
|
973 | - if(!$group_srl) continue; |
|
974 | - for($i=0;$i<$member_count;$i++) |
|
972 | + $group_srl = (int) trim($group_srls[$j]); |
|
973 | + if (!$group_srl) continue; |
|
974 | + for ($i = 0; $i < $member_count; $i++) |
|
975 | 975 | { |
976 | - $member_srl = (int)trim($member_srls[$i]); |
|
977 | - if(!$member_srl) continue; |
|
976 | + $member_srl = (int) trim($member_srls[$i]); |
|
977 | + if (!$member_srl) continue; |
|
978 | 978 | |
979 | 979 | $args = new stdClass; |
980 | 980 | $args->member_srl = $member_srl; |
981 | 981 | $args->group_srl = $group_srl; |
982 | 982 | |
983 | 983 | $output = executeQuery('member.addMemberToGroup', $args); |
984 | - if(!$output->toBool()) |
|
984 | + if (!$output->toBool()) |
|
985 | 985 | { |
986 | 986 | $oDB->rollback(); |
987 | 987 | return $output; |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | |
995 | 995 | $this->setMessage('success_updated'); |
996 | 996 | |
997 | - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) |
|
997 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
998 | 998 | { |
999 | 999 | global $lang; |
1000 | 1000 | htmlHeader(); |
@@ -1015,19 +1015,19 @@ discard block |
||
1015 | 1015 | { |
1016 | 1016 | $user_ids = Context::get('user_id'); |
1017 | 1017 | |
1018 | - $user_ids = explode(',',$user_ids); |
|
1018 | + $user_ids = explode(',', $user_ids); |
|
1019 | 1019 | $success_ids = array(); |
1020 | 1020 | |
1021 | - foreach($user_ids as $val) |
|
1021 | + foreach ($user_ids as $val) |
|
1022 | 1022 | { |
1023 | 1023 | $val = trim($val); |
1024 | - if(!$val) continue; |
|
1024 | + if (!$val) continue; |
|
1025 | 1025 | |
1026 | 1026 | $output = $this->insertDeniedID($val, ''); |
1027 | - if($output->toBool()) $success_ids[] = $val; |
|
1027 | + if ($output->toBool()) $success_ids[] = $val; |
|
1028 | 1028 | } |
1029 | 1029 | |
1030 | - $this->add('user_ids', implode(',',$success_ids)); |
|
1030 | + $this->add('user_ids', implode(',', $success_ids)); |
|
1031 | 1031 | |
1032 | 1032 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminDeniedIDList'); |
1033 | 1033 | $this->setRedirectUrl($returnUrl); |
@@ -1044,10 +1044,10 @@ discard block |
||
1044 | 1044 | $mode = Context::get('mode'); |
1045 | 1045 | $mode = $mode ? $mode : 'insert'; |
1046 | 1046 | |
1047 | - if($mode == 'delete') |
|
1047 | + if ($mode == 'delete') |
|
1048 | 1048 | { |
1049 | 1049 | $output = $this->deleteDeniedNickName($nick_name); |
1050 | - if(!$output->toBool()) |
|
1050 | + if (!$output->toBool()) |
|
1051 | 1051 | { |
1052 | 1052 | return $output; |
1053 | 1053 | } |
@@ -1056,19 +1056,19 @@ discard block |
||
1056 | 1056 | } |
1057 | 1057 | else |
1058 | 1058 | { |
1059 | - $nick_names = explode(',',$nick_name); |
|
1059 | + $nick_names = explode(',', $nick_name); |
|
1060 | 1060 | $success_nick_names = array(); |
1061 | 1061 | |
1062 | - foreach($nick_names as $val) |
|
1062 | + foreach ($nick_names as $val) |
|
1063 | 1063 | { |
1064 | 1064 | $val = trim($val); |
1065 | - if(!$val) continue; |
|
1065 | + if (!$val) continue; |
|
1066 | 1066 | |
1067 | 1067 | $output = $this->insertDeniedNickName($val, ''); |
1068 | - if($output->toBool()) $success_nick_names[] = $val; |
|
1068 | + if ($output->toBool()) $success_nick_names[] = $val; |
|
1069 | 1069 | } |
1070 | 1070 | |
1071 | - $this->add('nick_names', implode(',',$success_nick_names)); |
|
1071 | + $this->add('nick_names', implode(',', $success_nick_names)); |
|
1072 | 1072 | } |
1073 | 1073 | } |
1074 | 1074 | |
@@ -1081,16 +1081,16 @@ discard block |
||
1081 | 1081 | $user_id = Context::get('user_id'); |
1082 | 1082 | $mode = Context::get('mode'); |
1083 | 1083 | |
1084 | - switch($mode) |
|
1084 | + switch ($mode) |
|
1085 | 1085 | { |
1086 | 1086 | case 'delete' : |
1087 | 1087 | $output = $this->deleteDeniedID($user_id); |
1088 | - if(!$output->toBool()) return $output; |
|
1088 | + if (!$output->toBool()) return $output; |
|
1089 | 1089 | $msg_code = 'success_deleted'; |
1090 | 1090 | break; |
1091 | 1091 | } |
1092 | 1092 | |
1093 | - $this->add('page',Context::get('page')); |
|
1093 | + $this->add('page', Context::get('page')); |
|
1094 | 1094 | $this->setMessage($msg_code); |
1095 | 1095 | } |
1096 | 1096 | |
@@ -1137,24 +1137,24 @@ discard block |
||
1137 | 1137 | */ |
1138 | 1138 | function insertGroup($args) |
1139 | 1139 | { |
1140 | - if(!$args->site_srl) $args->site_srl = 0; |
|
1140 | + if (!$args->site_srl) $args->site_srl = 0; |
|
1141 | 1141 | // Check the value of is_default. |
1142 | - if($args->is_default != 'Y') |
|
1142 | + if ($args->is_default != 'Y') |
|
1143 | 1143 | { |
1144 | 1144 | $args->is_default = 'N'; |
1145 | 1145 | } |
1146 | 1146 | else |
1147 | 1147 | { |
1148 | 1148 | $output = executeQuery('member.updateGroupDefaultClear', $args); |
1149 | - if(!$output->toBool()) return $output; |
|
1149 | + if (!$output->toBool()) return $output; |
|
1150 | 1150 | } |
1151 | 1151 | |
1152 | - if(!isset($args->list_order) || $args->list_order=='') |
|
1152 | + if (!isset($args->list_order) || $args->list_order == '') |
|
1153 | 1153 | { |
1154 | 1154 | $args->list_order = $args->group_srl; |
1155 | 1155 | } |
1156 | 1156 | |
1157 | - if(!$args->group_srl) $args->group_srl = getNextSequence(); |
|
1157 | + if (!$args->group_srl) $args->group_srl = getNextSequence(); |
|
1158 | 1158 | $args->list_order = $args->group_srl; |
1159 | 1159 | $output = executeQuery('member.insertGroup', $args); |
1160 | 1160 | $this->_deleteMemberGroupCache($args->site_srl); |
@@ -1169,17 +1169,17 @@ discard block |
||
1169 | 1169 | */ |
1170 | 1170 | function updateGroup($args) |
1171 | 1171 | { |
1172 | - if(!$args->site_srl) $args->site_srl = 0; |
|
1172 | + if (!$args->site_srl) $args->site_srl = 0; |
|
1173 | 1173 | // Check the value of is_default. |
1174 | - if(!$args->group_srl) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
1175 | - if($args->is_default!='Y') |
|
1174 | + if (!$args->group_srl) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
1175 | + if ($args->is_default != 'Y') |
|
1176 | 1176 | { |
1177 | 1177 | $args->is_default = 'N'; |
1178 | 1178 | } |
1179 | 1179 | else |
1180 | 1180 | { |
1181 | 1181 | $output = executeQuery('member.updateGroupDefaultClear', $args); |
1182 | - if(!$output->toBool()) return $output; |
|
1182 | + if (!$output->toBool()) return $output; |
|
1183 | 1183 | } |
1184 | 1184 | |
1185 | 1185 | $output = executeQuery('member.updateGroup', $args); |
@@ -1202,8 +1202,8 @@ discard block |
||
1202 | 1202 | $columnList = array('group_srl', 'is_default'); |
1203 | 1203 | $group_info = $oMemberModel->getGroup($group_srl, $columnList); |
1204 | 1204 | |
1205 | - if(!$group_info) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
1206 | - if($group_info->is_default == 'Y') return new BaseObject(-1, 'msg_not_delete_default'); |
|
1205 | + if (!$group_info) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
1206 | + if ($group_info->is_default == 'Y') return new BaseObject(-1, 'msg_not_delete_default'); |
|
1207 | 1207 | |
1208 | 1208 | // Get groups where is_default == 'Y' |
1209 | 1209 | $columnList = array('site_srl', 'group_srl'); |
@@ -1240,7 +1240,7 @@ discard block |
||
1240 | 1240 | $defaultGroup = $oMemberModel->getDefaultGroup(0); |
1241 | 1241 | $defaultGroupSrl = $defaultGroup->group_srl; |
1242 | 1242 | $group_srls = $vars->group_srls; |
1243 | - foreach($group_srls as $order=>$group_srl) |
|
1243 | + foreach ($group_srls as $order=>$group_srl) |
|
1244 | 1244 | { |
1245 | 1245 | $isInsert = false; |
1246 | 1246 | $update_args = new stdClass(); |
@@ -1249,9 +1249,9 @@ discard block |
||
1249 | 1249 | $update_args->image_mark = $vars->image_marks[$order]; |
1250 | 1250 | $update_args->list_order = $order + 1; |
1251 | 1251 | |
1252 | - if(!$update_args->title) continue; |
|
1252 | + if (!$update_args->title) continue; |
|
1253 | 1253 | |
1254 | - if(is_numeric($group_srl)) { |
|
1254 | + if (is_numeric($group_srl)) { |
|
1255 | 1255 | $update_args->group_srl = $group_srl; |
1256 | 1256 | $output = $this->updateGroup($update_args); |
1257 | 1257 | } |
@@ -1260,7 +1260,7 @@ discard block |
||
1260 | 1260 | $output = $this->insertGroup($update_args); |
1261 | 1261 | } |
1262 | 1262 | |
1263 | - if($vars->defaultGroup == $group_srl) { |
|
1263 | + if ($vars->defaultGroup == $group_srl) { |
|
1264 | 1264 | $defaultGroupSrl = $update_args->group_srl; |
1265 | 1265 | } |
1266 | 1266 | } |
@@ -1286,7 +1286,7 @@ discard block |
||
1286 | 1286 | { |
1287 | 1287 | $vars = Context::getRequestVars(); |
1288 | 1288 | |
1289 | - foreach($vars->group_srls as $key => $val) |
|
1289 | + foreach ($vars->group_srls as $key => $val) |
|
1290 | 1290 | { |
1291 | 1291 | $args = new stdClass; |
1292 | 1292 | $args->group_srl = $val; |
@@ -1307,7 +1307,7 @@ discard block |
||
1307 | 1307 | { |
1308 | 1308 | //remove from cache |
1309 | 1309 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
1310 | - if($oCacheHandler->isSupport()) |
|
1310 | + if ($oCacheHandler->isSupport()) |
|
1311 | 1311 | { |
1312 | 1312 | $oCacheHandler->invalidateGroupKey('member'); |
1313 | 1313 | } |
@@ -1324,7 +1324,7 @@ discard block |
||
1324 | 1324 | $args = new stdClass(); |
1325 | 1325 | $args->user_id = $user_id; |
1326 | 1326 | $args->description = $description; |
1327 | - $args->list_order = -1*getNextSequence(); |
|
1327 | + $args->list_order = -1 * getNextSequence(); |
|
1328 | 1328 | |
1329 | 1329 | return executeQuery('member.insertDeniedID', $args); |
1330 | 1330 | } |
@@ -1345,7 +1345,7 @@ discard block |
||
1345 | 1345 | */ |
1346 | 1346 | function deleteDeniedID($user_id) |
1347 | 1347 | { |
1348 | - if(!$user_id) unset($user_id); |
|
1348 | + if (!$user_id) unset($user_id); |
|
1349 | 1349 | |
1350 | 1350 | $args = new stdClass; |
1351 | 1351 | $args->user_id = $user_id; |
@@ -1359,7 +1359,7 @@ discard block |
||
1359 | 1359 | */ |
1360 | 1360 | function deleteDeniedNickName($nick_name) |
1361 | 1361 | { |
1362 | - if(!$nick_name) unset($nick_name); |
|
1362 | + if (!$nick_name) unset($nick_name); |
|
1363 | 1363 | |
1364 | 1364 | $args = new stdClass; |
1365 | 1365 | $args->nick_name = $nick_name; |
@@ -1398,16 +1398,16 @@ discard block |
||
1398 | 1398 | // Get a list of all join forms |
1399 | 1399 | $join_form_list = $oMemberModel->getJoinFormList(); |
1400 | 1400 | $join_form_srl_list = array_keys($join_form_list); |
1401 | - if(count($join_form_srl_list)<2) return new BaseObject(); |
|
1401 | + if (count($join_form_srl_list) < 2) return new BaseObject(); |
|
1402 | 1402 | |
1403 | 1403 | $prev_member_join_form = NULL; |
1404 | - foreach($join_form_list as $key => $val) |
|
1404 | + foreach ($join_form_list as $key => $val) |
|
1405 | 1405 | { |
1406 | - if($val->member_join_form_srl == $member_join_form_srl) break; |
|
1406 | + if ($val->member_join_form_srl == $member_join_form_srl) break; |
|
1407 | 1407 | $prev_member_join_form = $val; |
1408 | 1408 | } |
1409 | 1409 | // Return if no previous join form exists |
1410 | - if(!$prev_member_join_form) return new BaseObject(); |
|
1410 | + if (!$prev_member_join_form) return new BaseObject(); |
|
1411 | 1411 | // Information of the join form |
1412 | 1412 | $cur_args = new stdClass; |
1413 | 1413 | $cur_args->member_join_form_srl = $member_join_form_srl; |
@@ -1418,10 +1418,10 @@ discard block |
||
1418 | 1418 | $prev_args->list_order = $list_order; |
1419 | 1419 | // Execute Query |
1420 | 1420 | $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); |
1421 | - if(!$output->toBool()) return $output; |
|
1421 | + if (!$output->toBool()) return $output; |
|
1422 | 1422 | |
1423 | 1423 | executeQuery('member.updateMemberJoinFormListorder', $prev_args); |
1424 | - if(!$output->toBool()) return $output; |
|
1424 | + if (!$output->toBool()) return $output; |
|
1425 | 1425 | |
1426 | 1426 | return new BaseObject(); |
1427 | 1427 | } |
@@ -1445,16 +1445,16 @@ discard block |
||
1445 | 1445 | // Get information of all join forms |
1446 | 1446 | $join_form_list = $oMemberModel->getJoinFormList(); |
1447 | 1447 | $join_form_srl_list = array_keys($join_form_list); |
1448 | - if(count($join_form_srl_list)<2) return new BaseObject(); |
|
1448 | + if (count($join_form_srl_list) < 2) return new BaseObject(); |
|
1449 | 1449 | |
1450 | - for($i=0;$i<count($join_form_srl_list);$i++) |
|
1450 | + for ($i = 0; $i < count($join_form_srl_list); $i++) |
|
1451 | 1451 | { |
1452 | - if($join_form_srl_list[$i]==$member_join_form_srl) break; |
|
1452 | + if ($join_form_srl_list[$i] == $member_join_form_srl) break; |
|
1453 | 1453 | } |
1454 | 1454 | |
1455 | - $next_member_join_form_srl = $join_form_srl_list[$i+1]; |
|
1455 | + $next_member_join_form_srl = $join_form_srl_list[$i + 1]; |
|
1456 | 1456 | // Return if no previous join form exists |
1457 | - if(!$next_member_join_form_srl) return new BaseObject(); |
|
1457 | + if (!$next_member_join_form_srl) return new BaseObject(); |
|
1458 | 1458 | $next_member_join_form = $join_form_list[$next_member_join_form_srl]; |
1459 | 1459 | // Information of the join form |
1460 | 1460 | $cur_args = new stdClass; |
@@ -1466,10 +1466,10 @@ discard block |
||
1466 | 1466 | $next_args->list_order = $list_order; |
1467 | 1467 | // Execute Query |
1468 | 1468 | $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); |
1469 | - if(!$output->toBool()) return $output; |
|
1469 | + if (!$output->toBool()) return $output; |
|
1470 | 1470 | |
1471 | 1471 | $output = executeQuery('member.updateMemberJoinFormListorder', $next_args); |
1472 | - if(!$output->toBool()) return $output; |
|
1472 | + if (!$output->toBool()) return $output; |
|
1473 | 1473 | |
1474 | 1474 | return new BaseObject(); |
1475 | 1475 | } |
@@ -48,9 +48,11 @@ discard block |
||
48 | 48 | $args->{$val} = Context::get($val); |
49 | 49 | } |
50 | 50 | $args->member_srl = Context::get('member_srl'); |
51 | - if(Context::get('reset_password')) |
|
52 | - $args->password = Context::get('reset_password'); |
|
53 | - else unset($args->password); |
|
51 | + if(Context::get('reset_password')) { |
|
52 | + $args->password = Context::get('reset_password'); |
|
53 | + } else { |
|
54 | + unset($args->password); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | // Remove some unnecessary variables from all the vars |
56 | 58 | $all_args = Context::getRequestVars(); |
@@ -60,7 +62,9 @@ discard block |
||
60 | 62 | unset($all_args->error_return_url); |
61 | 63 | unset($all_args->success_return_url); |
62 | 64 | unset($all_args->ruleset); |
63 | - if(!isset($args->limit_date)) $args->limit_date = ""; |
|
65 | + if(!isset($args->limit_date)) { |
|
66 | + $args->limit_date = ""; |
|
67 | + } |
|
64 | 68 | unset($all_args->password); |
65 | 69 | unset($all_args->password2); |
66 | 70 | unset($all_args->reset_password); |
@@ -76,7 +80,9 @@ discard block |
||
76 | 80 | $columnList = array('member_srl'); |
77 | 81 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList); |
78 | 82 | // If no original member exists, make a new one |
79 | - if($member_info->member_srl != $args->member_srl) unset($args->member_srl); |
|
83 | + if($member_info->member_srl != $args->member_srl) { |
|
84 | + unset($args->member_srl); |
|
85 | + } |
|
80 | 86 | } |
81 | 87 | |
82 | 88 | // remove whitespace |
@@ -96,14 +102,15 @@ discard block |
||
96 | 102 | $args->password = Context::get('password'); |
97 | 103 | $output = $oMemberController->insertMember($args); |
98 | 104 | $msg_code = 'success_registed'; |
99 | - } |
|
100 | - else |
|
105 | + } else |
|
101 | 106 | { |
102 | 107 | $output = $oMemberController->updateMember($args); |
103 | 108 | $msg_code = 'success_updated'; |
104 | 109 | } |
105 | 110 | |
106 | - if(!$output->toBool()) return $output; |
|
111 | + if(!$output->toBool()) { |
|
112 | + return $output; |
|
113 | + } |
|
107 | 114 | // Save Signature |
108 | 115 | $signature = Context::get('signature'); |
109 | 116 | $oMemberController->putSignature($args->member_srl, $signature); |
@@ -115,21 +122,27 @@ discard block |
||
115 | 122 | if(is_uploaded_file($profile_image['tmp_name'])) |
116 | 123 | { |
117 | 124 | $output = $oMemberController->insertProfileImage($args->member_srl, $profile_image['tmp_name']); |
118 | - if(!$output->toBool()) return $output; |
|
125 | + if(!$output->toBool()) { |
|
126 | + return $output; |
|
127 | + } |
|
119 | 128 | } |
120 | 129 | |
121 | 130 | $image_mark = $_FILES['image_mark']; |
122 | 131 | if(is_uploaded_file($image_mark['tmp_name'])) |
123 | 132 | { |
124 | 133 | $output = $oMemberController->insertImageMark($args->member_srl, $image_mark['tmp_name']); |
125 | - if(!$output->toBool()) return $output; |
|
134 | + if(!$output->toBool()) { |
|
135 | + return $output; |
|
136 | + } |
|
126 | 137 | } |
127 | 138 | |
128 | 139 | $image_name = $_FILES['image_name']; |
129 | 140 | if (is_uploaded_file($image_name['tmp_name'])) |
130 | 141 | { |
131 | 142 | $output = $oMemberController->insertImageName($args->member_srl, $image_name['tmp_name']); |
132 | - if(!$output->toBool()) return $output; |
|
143 | + if(!$output->toBool()) { |
|
144 | + return $output; |
|
145 | + } |
|
133 | 146 | } |
134 | 147 | |
135 | 148 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminList'); |
@@ -147,7 +160,9 @@ discard block |
||
147 | 160 | |
148 | 161 | $oMemberController = getController('member'); |
149 | 162 | $output = $oMemberController->deleteMember($member_srl); |
150 | - if(!$output->toBool()) return $output; |
|
163 | + if(!$output->toBool()) { |
|
164 | + return $output; |
|
165 | + } |
|
151 | 166 | |
152 | 167 | $this->add('page',Context::get('page')); |
153 | 168 | $this->setMessage("success_deleted"); |
@@ -452,10 +467,11 @@ discard block |
||
452 | 467 | $signupItem->max_width = $config->{$key.'_max_width'}; |
453 | 468 | $signupItem->max_height = $config->{$key.'_max_height'}; |
454 | 469 | } |
455 | - if($signupItem->isIdentifier) |
|
456 | - array_unshift($list_order, $signupItem); |
|
457 | - else |
|
458 | - $list_order[] = $signupItem; |
|
470 | + if($signupItem->isIdentifier) { |
|
471 | + array_unshift($list_order, $signupItem); |
|
472 | + } else { |
|
473 | + $list_order[] = $signupItem; |
|
474 | + } |
|
459 | 475 | } |
460 | 476 | if(is_array($extendItems)) |
461 | 477 | { |
@@ -512,38 +528,30 @@ discard block |
||
512 | 528 | if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip') |
513 | 529 | { |
514 | 530 | $fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name); |
515 | - } |
|
516 | - else if($formInfo->name == 'password') |
|
531 | + } else if($formInfo->name == 'password') |
|
517 | 532 | { |
518 | 533 | $fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>'; |
519 | 534 | $fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>'; |
520 | - } |
|
521 | - else if($formInfo->name == 'find_account_question') |
|
535 | + } else if($formInfo->name == 'find_account_question') |
|
522 | 536 | { |
523 | 537 | $fields[] = '<field name="find_account_question"><if test="$modify_find_account_answer" attr="required" value="true" /></field>'; |
524 | 538 | $fields[] = '<field name="find_account_answer" length=":250"><if test="$modify_find_account_answer" attr="required" value="true" /></field>'; |
525 | - } |
|
526 | - else if($formInfo->name == 'email_address') |
|
539 | + } else if($formInfo->name == 'email_address') |
|
527 | 540 | { |
528 | 541 | $fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name); |
529 | - } |
|
530 | - else if($formInfo->name == 'user_id') |
|
542 | + } else if($formInfo->name == 'user_id') |
|
531 | 543 | { |
532 | 544 | $fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name); |
533 | - } |
|
534 | - else if($formInfo->name == 'nick_name') |
|
545 | + } else if($formInfo->name == 'nick_name') |
|
535 | 546 | { |
536 | 547 | $fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name); |
537 | - } |
|
538 | - else if(strpos($formInfo->name, 'image') !== false) |
|
548 | + } else if(strpos($formInfo->name, 'image') !== false) |
|
539 | 549 | { |
540 | 550 | $fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' && $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name); |
541 | - } |
|
542 | - else if($formInfo->name == 'signature') |
|
551 | + } else if($formInfo->name == 'signature') |
|
543 | 552 | { |
544 | 553 | $fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>'; |
545 | - } |
|
546 | - else |
|
554 | + } else |
|
547 | 555 | { |
548 | 556 | $fields[] = sprintf('<field name="%s" required="true" />', $formInfo->name); |
549 | 557 | } |
@@ -603,8 +611,9 @@ discard block |
||
603 | 611 | '</ruleset>'; |
604 | 612 | |
605 | 613 | $fields = array(); |
606 | - if($identifier == 'user_id') |
|
607 | - $fields[] = '<field name="user_id" required="true" rule="userid" />'; |
|
614 | + if($identifier == 'user_id') { |
|
615 | + $fields[] = '<field name="user_id" required="true" rule="userid" />'; |
|
616 | + } |
|
608 | 617 | |
609 | 618 | $fields[] = '<field name="email_address" required="true" rule="email" />'; |
610 | 619 | $fields[] = '<field name="find_account_question" required="true" />'; |
@@ -626,7 +635,9 @@ discard block |
||
626 | 635 | { |
627 | 636 | $args = Context::gets('title','description','is_default','image_mark'); |
628 | 637 | $output = $this->insertGroup($args); |
629 | - if(!$output->toBool()) return $output; |
|
638 | + if(!$output->toBool()) { |
|
639 | + return $output; |
|
640 | + } |
|
630 | 641 | |
631 | 642 | $this->add('group_srl',''); |
632 | 643 | $this->add('page',Context::get('page')); |
@@ -647,7 +658,9 @@ discard block |
||
647 | 658 | $args = Context::gets('group_srl','title','description','is_default','image_mark'); |
648 | 659 | $args->site_srl = 0; |
649 | 660 | $output = $this->updateGroup($args); |
650 | - if(!$output->toBool()) return $output; |
|
661 | + if(!$output->toBool()) { |
|
662 | + return $output; |
|
663 | + } |
|
651 | 664 | |
652 | 665 | $this->add('group_srl',''); |
653 | 666 | $this->add('page',Context::get('page')); |
@@ -666,7 +679,9 @@ discard block |
||
666 | 679 | $group_srl = Context::get('group_srl'); |
667 | 680 | |
668 | 681 | $output = $this->deleteGroup($group_srl); |
669 | - if(!$output->toBool()) return $output; |
|
682 | + if(!$output->toBool()) { |
|
683 | + return $output; |
|
684 | + } |
|
670 | 685 | |
671 | 686 | $this->add('group_srl',''); |
672 | 687 | $this->add('page',Context::get('page')); |
@@ -691,14 +706,15 @@ discard block |
||
691 | 706 | $args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value'))); |
692 | 707 | $args->required = Context::get('required'); |
693 | 708 | $args->is_active = (isset($args->required)); |
694 | - if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N'; |
|
709 | + if(!in_array(strtoupper($args->required), array('Y','N'))) { |
|
710 | + $args->required = 'N'; |
|
711 | + } |
|
695 | 712 | $args->description = Context::get('description') ? Context::get('description') : ''; |
696 | 713 | // Default values |
697 | 714 | if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value)) |
698 | 715 | { |
699 | 716 | $args->default_value = serialize($args->default_value); |
700 | - } |
|
701 | - else |
|
717 | + } else |
|
702 | 718 | { |
703 | 719 | $args->default_value = ''; |
704 | 720 | } |
@@ -710,7 +726,9 @@ discard block |
||
710 | 726 | { |
711 | 727 | if($item->name == $args->column_name) |
712 | 728 | { |
713 | - if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue; |
|
729 | + if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) { |
|
730 | + continue; |
|
731 | + } |
|
714 | 732 | return new BaseObject(-1,'msg_exists_user_id'); |
715 | 733 | } |
716 | 734 | } |
@@ -721,13 +739,14 @@ discard block |
||
721 | 739 | $isInsert = true; |
722 | 740 | $args->list_order = $args->member_join_form_srl = getNextSequence(); |
723 | 741 | $output = executeQuery('member.insertJoinForm', $args); |
724 | - } |
|
725 | - else |
|
742 | + } else |
|
726 | 743 | { |
727 | 744 | $output = executeQuery('member.updateJoinForm', $args); |
728 | 745 | } |
729 | 746 | |
730 | - if(!$output->toBool()) return $output; |
|
747 | + if(!$output->toBool()) { |
|
748 | + return $output; |
|
749 | + } |
|
731 | 750 | |
732 | 751 | // memberConfig update |
733 | 752 | $signupItem = new stdClass(); |
@@ -747,8 +766,7 @@ discard block |
||
747 | 766 | if($isInsert) |
748 | 767 | { |
749 | 768 | $config->signupForm[] = $signupItem; |
750 | - } |
|
751 | - else |
|
769 | + } else |
|
752 | 770 | { |
753 | 771 | foreach($config->signupForm as $key=>$val) |
754 | 772 | { |
@@ -819,7 +837,9 @@ discard block |
||
819 | 837 | case 'update' : |
820 | 838 | break; |
821 | 839 | } |
822 | - if(!$output->toBool()) return $output; |
|
840 | + if(!$output->toBool()) { |
|
841 | + return $output; |
|
842 | + } |
|
823 | 843 | |
824 | 844 | $this->setMessage($msg_code); |
825 | 845 | } |
@@ -922,7 +942,9 @@ discard block |
||
922 | 942 | function procMemberAdminDeleteMembers() |
923 | 943 | { |
924 | 944 | $target_member_srls = Context::get('target_member_srls'); |
925 | - if(!$target_member_srls) return new BaseObject(-1, 'msg_invalid_request'); |
|
945 | + if(!$target_member_srls) { |
|
946 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
947 | + } |
|
926 | 948 | $member_srls = explode(',', $target_member_srls); |
927 | 949 | $oMemberController = getController('member'); |
928 | 950 | |
@@ -946,12 +968,17 @@ discard block |
||
946 | 968 | function procMemberAdminUpdateMembersGroup() |
947 | 969 | { |
948 | 970 | $member_srl = Context::get('member_srl'); |
949 | - if(!$member_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
971 | + if(!$member_srl) { |
|
972 | + return new BaseObject(-1,'msg_invalid_request'); |
|
973 | + } |
|
950 | 974 | $member_srls = explode(',',$member_srl); |
951 | 975 | |
952 | 976 | $group_srl = Context::get('group_srls'); |
953 | - if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl); |
|
954 | - else $group_srls = $group_srl; |
|
977 | + if(!is_array($group_srl)) { |
|
978 | + $group_srls = explode('|@|', $group_srl); |
|
979 | + } else { |
|
980 | + $group_srls = $group_srl; |
|
981 | + } |
|
955 | 982 | |
956 | 983 | $oDB = &DB::getInstance(); |
957 | 984 | $oDB->begin(); |
@@ -970,11 +997,15 @@ discard block |
||
970 | 997 | for($j=0;$j<$group_count;$j++) |
971 | 998 | { |
972 | 999 | $group_srl = (int)trim($group_srls[$j]); |
973 | - if(!$group_srl) continue; |
|
1000 | + if(!$group_srl) { |
|
1001 | + continue; |
|
1002 | + } |
|
974 | 1003 | for($i=0;$i<$member_count;$i++) |
975 | 1004 | { |
976 | 1005 | $member_srl = (int)trim($member_srls[$i]); |
977 | - if(!$member_srl) continue; |
|
1006 | + if(!$member_srl) { |
|
1007 | + continue; |
|
1008 | + } |
|
978 | 1009 | |
979 | 1010 | $args = new stdClass; |
980 | 1011 | $args->member_srl = $member_srl; |
@@ -1021,10 +1052,14 @@ discard block |
||
1021 | 1052 | foreach($user_ids as $val) |
1022 | 1053 | { |
1023 | 1054 | $val = trim($val); |
1024 | - if(!$val) continue; |
|
1055 | + if(!$val) { |
|
1056 | + continue; |
|
1057 | + } |
|
1025 | 1058 | |
1026 | 1059 | $output = $this->insertDeniedID($val, ''); |
1027 | - if($output->toBool()) $success_ids[] = $val; |
|
1060 | + if($output->toBool()) { |
|
1061 | + $success_ids[] = $val; |
|
1062 | + } |
|
1028 | 1063 | } |
1029 | 1064 | |
1030 | 1065 | $this->add('user_ids', implode(',',$success_ids)); |
@@ -1053,8 +1088,7 @@ discard block |
||
1053 | 1088 | } |
1054 | 1089 | $msg_code = 'success_deleted'; |
1055 | 1090 | $this->setMessage($msg_code); |
1056 | - } |
|
1057 | - else |
|
1091 | + } else |
|
1058 | 1092 | { |
1059 | 1093 | $nick_names = explode(',',$nick_name); |
1060 | 1094 | $success_nick_names = array(); |
@@ -1062,10 +1096,14 @@ discard block |
||
1062 | 1096 | foreach($nick_names as $val) |
1063 | 1097 | { |
1064 | 1098 | $val = trim($val); |
1065 | - if(!$val) continue; |
|
1099 | + if(!$val) { |
|
1100 | + continue; |
|
1101 | + } |
|
1066 | 1102 | |
1067 | 1103 | $output = $this->insertDeniedNickName($val, ''); |
1068 | - if($output->toBool()) $success_nick_names[] = $val; |
|
1104 | + if($output->toBool()) { |
|
1105 | + $success_nick_names[] = $val; |
|
1106 | + } |
|
1069 | 1107 | } |
1070 | 1108 | |
1071 | 1109 | $this->add('nick_names', implode(',',$success_nick_names)); |
@@ -1085,7 +1123,9 @@ discard block |
||
1085 | 1123 | { |
1086 | 1124 | case 'delete' : |
1087 | 1125 | $output = $this->deleteDeniedID($user_id); |
1088 | - if(!$output->toBool()) return $output; |
|
1126 | + if(!$output->toBool()) { |
|
1127 | + return $output; |
|
1128 | + } |
|
1089 | 1129 | $msg_code = 'success_deleted'; |
1090 | 1130 | break; |
1091 | 1131 | } |
@@ -1137,16 +1177,19 @@ discard block |
||
1137 | 1177 | */ |
1138 | 1178 | function insertGroup($args) |
1139 | 1179 | { |
1140 | - if(!$args->site_srl) $args->site_srl = 0; |
|
1180 | + if(!$args->site_srl) { |
|
1181 | + $args->site_srl = 0; |
|
1182 | + } |
|
1141 | 1183 | // Check the value of is_default. |
1142 | 1184 | if($args->is_default != 'Y') |
1143 | 1185 | { |
1144 | 1186 | $args->is_default = 'N'; |
1145 | - } |
|
1146 | - else |
|
1187 | + } else |
|
1147 | 1188 | { |
1148 | 1189 | $output = executeQuery('member.updateGroupDefaultClear', $args); |
1149 | - if(!$output->toBool()) return $output; |
|
1190 | + if(!$output->toBool()) { |
|
1191 | + return $output; |
|
1192 | + } |
|
1150 | 1193 | } |
1151 | 1194 | |
1152 | 1195 | if(!isset($args->list_order) || $args->list_order=='') |
@@ -1154,7 +1197,9 @@ discard block |
||
1154 | 1197 | $args->list_order = $args->group_srl; |
1155 | 1198 | } |
1156 | 1199 | |
1157 | - if(!$args->group_srl) $args->group_srl = getNextSequence(); |
|
1200 | + if(!$args->group_srl) { |
|
1201 | + $args->group_srl = getNextSequence(); |
|
1202 | + } |
|
1158 | 1203 | $args->list_order = $args->group_srl; |
1159 | 1204 | $output = executeQuery('member.insertGroup', $args); |
1160 | 1205 | $this->_deleteMemberGroupCache($args->site_srl); |
@@ -1169,17 +1214,22 @@ discard block |
||
1169 | 1214 | */ |
1170 | 1215 | function updateGroup($args) |
1171 | 1216 | { |
1172 | - if(!$args->site_srl) $args->site_srl = 0; |
|
1217 | + if(!$args->site_srl) { |
|
1218 | + $args->site_srl = 0; |
|
1219 | + } |
|
1173 | 1220 | // Check the value of is_default. |
1174 | - if(!$args->group_srl) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
1221 | + if(!$args->group_srl) { |
|
1222 | + return new BaseObject(-1, 'lang->msg_not_founded'); |
|
1223 | + } |
|
1175 | 1224 | if($args->is_default!='Y') |
1176 | 1225 | { |
1177 | 1226 | $args->is_default = 'N'; |
1178 | - } |
|
1179 | - else |
|
1227 | + } else |
|
1180 | 1228 | { |
1181 | 1229 | $output = executeQuery('member.updateGroupDefaultClear', $args); |
1182 | - if(!$output->toBool()) return $output; |
|
1230 | + if(!$output->toBool()) { |
|
1231 | + return $output; |
|
1232 | + } |
|
1183 | 1233 | } |
1184 | 1234 | |
1185 | 1235 | $output = executeQuery('member.updateGroup', $args); |
@@ -1202,8 +1252,12 @@ discard block |
||
1202 | 1252 | $columnList = array('group_srl', 'is_default'); |
1203 | 1253 | $group_info = $oMemberModel->getGroup($group_srl, $columnList); |
1204 | 1254 | |
1205 | - if(!$group_info) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
1206 | - if($group_info->is_default == 'Y') return new BaseObject(-1, 'msg_not_delete_default'); |
|
1255 | + if(!$group_info) { |
|
1256 | + return new BaseObject(-1, 'lang->msg_not_founded'); |
|
1257 | + } |
|
1258 | + if($group_info->is_default == 'Y') { |
|
1259 | + return new BaseObject(-1, 'msg_not_delete_default'); |
|
1260 | + } |
|
1207 | 1261 | |
1208 | 1262 | // Get groups where is_default == 'Y' |
1209 | 1263 | $columnList = array('site_srl', 'group_srl'); |
@@ -1249,13 +1303,14 @@ discard block |
||
1249 | 1303 | $update_args->image_mark = $vars->image_marks[$order]; |
1250 | 1304 | $update_args->list_order = $order + 1; |
1251 | 1305 | |
1252 | - if(!$update_args->title) continue; |
|
1306 | + if(!$update_args->title) { |
|
1307 | + continue; |
|
1308 | + } |
|
1253 | 1309 | |
1254 | 1310 | if(is_numeric($group_srl)) { |
1255 | 1311 | $update_args->group_srl = $group_srl; |
1256 | 1312 | $output = $this->updateGroup($update_args); |
1257 | - } |
|
1258 | - else { |
|
1313 | + } else { |
|
1259 | 1314 | $update_args->group_srl = getNextSequence(); |
1260 | 1315 | $output = $this->insertGroup($update_args); |
1261 | 1316 | } |
@@ -1345,7 +1400,9 @@ discard block |
||
1345 | 1400 | */ |
1346 | 1401 | function deleteDeniedID($user_id) |
1347 | 1402 | { |
1348 | - if(!$user_id) unset($user_id); |
|
1403 | + if(!$user_id) { |
|
1404 | + unset($user_id); |
|
1405 | + } |
|
1349 | 1406 | |
1350 | 1407 | $args = new stdClass; |
1351 | 1408 | $args->user_id = $user_id; |
@@ -1359,7 +1416,9 @@ discard block |
||
1359 | 1416 | */ |
1360 | 1417 | function deleteDeniedNickName($nick_name) |
1361 | 1418 | { |
1362 | - if(!$nick_name) unset($nick_name); |
|
1419 | + if(!$nick_name) { |
|
1420 | + unset($nick_name); |
|
1421 | + } |
|
1363 | 1422 | |
1364 | 1423 | $args = new stdClass; |
1365 | 1424 | $args->nick_name = $nick_name; |
@@ -1398,16 +1457,22 @@ discard block |
||
1398 | 1457 | // Get a list of all join forms |
1399 | 1458 | $join_form_list = $oMemberModel->getJoinFormList(); |
1400 | 1459 | $join_form_srl_list = array_keys($join_form_list); |
1401 | - if(count($join_form_srl_list)<2) return new BaseObject(); |
|
1460 | + if(count($join_form_srl_list)<2) { |
|
1461 | + return new BaseObject(); |
|
1462 | + } |
|
1402 | 1463 | |
1403 | 1464 | $prev_member_join_form = NULL; |
1404 | 1465 | foreach($join_form_list as $key => $val) |
1405 | 1466 | { |
1406 | - if($val->member_join_form_srl == $member_join_form_srl) break; |
|
1467 | + if($val->member_join_form_srl == $member_join_form_srl) { |
|
1468 | + break; |
|
1469 | + } |
|
1407 | 1470 | $prev_member_join_form = $val; |
1408 | 1471 | } |
1409 | 1472 | // Return if no previous join form exists |
1410 | - if(!$prev_member_join_form) return new BaseObject(); |
|
1473 | + if(!$prev_member_join_form) { |
|
1474 | + return new BaseObject(); |
|
1475 | + } |
|
1411 | 1476 | // Information of the join form |
1412 | 1477 | $cur_args = new stdClass; |
1413 | 1478 | $cur_args->member_join_form_srl = $member_join_form_srl; |
@@ -1418,10 +1483,14 @@ discard block |
||
1418 | 1483 | $prev_args->list_order = $list_order; |
1419 | 1484 | // Execute Query |
1420 | 1485 | $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); |
1421 | - if(!$output->toBool()) return $output; |
|
1486 | + if(!$output->toBool()) { |
|
1487 | + return $output; |
|
1488 | + } |
|
1422 | 1489 | |
1423 | 1490 | executeQuery('member.updateMemberJoinFormListorder', $prev_args); |
1424 | - if(!$output->toBool()) return $output; |
|
1491 | + if(!$output->toBool()) { |
|
1492 | + return $output; |
|
1493 | + } |
|
1425 | 1494 | |
1426 | 1495 | return new BaseObject(); |
1427 | 1496 | } |
@@ -1445,16 +1514,22 @@ discard block |
||
1445 | 1514 | // Get information of all join forms |
1446 | 1515 | $join_form_list = $oMemberModel->getJoinFormList(); |
1447 | 1516 | $join_form_srl_list = array_keys($join_form_list); |
1448 | - if(count($join_form_srl_list)<2) return new BaseObject(); |
|
1517 | + if(count($join_form_srl_list)<2) { |
|
1518 | + return new BaseObject(); |
|
1519 | + } |
|
1449 | 1520 | |
1450 | 1521 | for($i=0;$i<count($join_form_srl_list);$i++) |
1451 | 1522 | { |
1452 | - if($join_form_srl_list[$i]==$member_join_form_srl) break; |
|
1523 | + if($join_form_srl_list[$i]==$member_join_form_srl) { |
|
1524 | + break; |
|
1525 | + } |
|
1453 | 1526 | } |
1454 | 1527 | |
1455 | 1528 | $next_member_join_form_srl = $join_form_srl_list[$i+1]; |
1456 | 1529 | // Return if no previous join form exists |
1457 | - if(!$next_member_join_form_srl) return new BaseObject(); |
|
1530 | + if(!$next_member_join_form_srl) { |
|
1531 | + return new BaseObject(); |
|
1532 | + } |
|
1458 | 1533 | $next_member_join_form = $join_form_list[$next_member_join_form_srl]; |
1459 | 1534 | // Information of the join form |
1460 | 1535 | $cur_args = new stdClass; |
@@ -1466,10 +1541,14 @@ discard block |
||
1466 | 1541 | $next_args->list_order = $list_order; |
1467 | 1542 | // Execute Query |
1468 | 1543 | $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); |
1469 | - if(!$output->toBool()) return $output; |
|
1544 | + if(!$output->toBool()) { |
|
1545 | + return $output; |
|
1546 | + } |
|
1470 | 1547 | |
1471 | 1548 | $output = executeQuery('member.updateMemberJoinFormListorder', $next_args); |
1472 | - if(!$output->toBool()) return $output; |
|
1549 | + if(!$output->toBool()) { |
|
1550 | + return $output; |
|
1551 | + } |
|
1473 | 1552 | |
1474 | 1553 | return new BaseObject(); |
1475 | 1554 | } |