@@ -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 | savecookie('XE_REDIRECT_URL'); |
@@ -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); |
@@ -766,20 +766,20 @@ discard block |
||
| 766 | 766 | $max_width = $config->profile_image_max_width; |
| 767 | 767 | $max_height = $config->profile_image_max_height; |
| 768 | 768 | $max_filesize = $config->profile_image_max_filesize; |
| 769 | - foreach($config->signupForm as $val) |
|
| 769 | + foreach ($config->signupForm as $val) |
|
| 770 | 770 | { |
| 771 | - if($val->name == "profile_image") |
|
| 771 | + if ($val->name == "profile_image") |
|
| 772 | 772 | $allow_transparent = $val->allow_transparent_thumbnail == 'Y'; |
| 773 | 773 | } |
| 774 | 774 | |
| 775 | - Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
|
| 775 | + Context::loadLang(_XE_PATH_.'modules/file/lang'); |
|
| 776 | 776 | |
| 777 | 777 | // Get file information |
| 778 | 778 | FileHandler::clearStatCache($target_file); |
| 779 | 779 | list($width, $height, $type) = @getimagesize($target_file); |
| 780 | - if(IMAGETYPE_PNG == $type) $ext = 'png'; |
|
| 781 | - elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
| 782 | - elseif(IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
| 780 | + if (IMAGETYPE_PNG == $type) $ext = 'png'; |
|
| 781 | + elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
| 782 | + elseif (IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
| 783 | 783 | else |
| 784 | 784 | { |
| 785 | 785 | return $this->stop('msg_not_uploaded_profile_image'); |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | $target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext); |
| 792 | 792 | |
| 793 | 793 | // Convert if the image size is larger than a given size or if the format is not a gif |
| 794 | - if(($width > $max_width || $height > $max_height ) && $type != 1) |
|
| 794 | + if (($width > $max_width || $height > $max_height) && $type != 1) |
|
| 795 | 795 | { |
| 796 | 796 | $temp_filename = sprintf('files/cache/tmp/profile_image_%d.%s', $member_srl, $ext); |
| 797 | 797 | FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, $ext, 'crop', $allow_transparent); |
@@ -799,10 +799,10 @@ discard block |
||
| 799 | 799 | // 파일 용량 제한 |
| 800 | 800 | FileHandler::clearStatCache($temp_filename); |
| 801 | 801 | $filesize = filesize($temp_filename); |
| 802 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 802 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 803 | 803 | { |
| 804 | 804 | FileHandler::removeFile($temp_filename); |
| 805 | - return $this->stop(implode(' ' , array( |
|
| 805 | + return $this->stop(implode(' ', array( |
|
| 806 | 806 | Context::getLang('msg_not_uploaded_profile_image'), |
| 807 | 807 | Context::getLang('msg_exceeds_limit_size') |
| 808 | 808 | ))); |
@@ -816,9 +816,9 @@ discard block |
||
| 816 | 816 | { |
| 817 | 817 | // 파일 용량 제한 |
| 818 | 818 | $filesize = filesize($target_file); |
| 819 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 819 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 820 | 820 | { |
| 821 | - return $this->stop(implode(' ' , array( |
|
| 821 | + return $this->stop(implode(' ', array( |
|
| 822 | 822 | Context::getLang('msg_not_uploaded_profile_image'), |
| 823 | 823 | Context::getLang('msg_exceeds_limit_size') |
| 824 | 824 | ))); |
@@ -841,20 +841,20 @@ discard block |
||
| 841 | 841 | { |
| 842 | 842 | // Check if the file is successfully uploaded |
| 843 | 843 | $file = $_FILES['image_name']; |
| 844 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
| 844 | + if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
| 845 | 845 | // Ignore if member_srl is invalid or doesn't exist. |
| 846 | 846 | $member_srl = Context::get('member_srl'); |
| 847 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 847 | + if (!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 848 | 848 | |
| 849 | 849 | $logged_info = Context::get('logged_info'); |
| 850 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 850 | + if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 851 | 851 | // Return if member module is set not to use an image name or the user is not an administrator ; |
| 852 | 852 | $oMemberModel = getModel('member'); |
| 853 | 853 | $config = $oMemberModel->getMemberConfig(); |
| 854 | - if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
| 854 | + if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
| 855 | 855 | |
| 856 | 856 | $output = $this->insertImageName($member_srl, $file['tmp_name']); |
| 857 | - if(!$output->toBool()) return $output; |
|
| 857 | + if (!$output->toBool()) return $output; |
|
| 858 | 858 | |
| 859 | 859 | // Page refresh |
| 860 | 860 | //$this->setRefreshPage(); |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | $max_height = $config->image_name_max_height; |
| 880 | 880 | $max_filesize = $config->image_name_max_filesize; |
| 881 | 881 | |
| 882 | - Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
|
| 882 | + Context::loadLang(_XE_PATH_.'modules/file/lang'); |
|
| 883 | 883 | |
| 884 | 884 | // Get a target path to save |
| 885 | 885 | $target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl)); |
@@ -889,7 +889,7 @@ discard block |
||
| 889 | 889 | // Get file information |
| 890 | 890 | list($width, $height, $type) = @getimagesize($target_file); |
| 891 | 891 | // Convert if the image size is larger than a given size or if the format is not a gif |
| 892 | - if($width > $max_width || $height > $max_height || $type!=1) |
|
| 892 | + if ($width > $max_width || $height > $max_height || $type != 1) |
|
| 893 | 893 | { |
| 894 | 894 | $temp_filename = sprintf('files/cache/tmp/image_name_%d.gif', $member_srl, $ext); |
| 895 | 895 | FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif'); |
@@ -897,10 +897,10 @@ discard block |
||
| 897 | 897 | // 파일 용량 제한 |
| 898 | 898 | FileHandler::clearStatCache($temp_filename); |
| 899 | 899 | $filesize = filesize($temp_filename); |
| 900 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 900 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 901 | 901 | { |
| 902 | 902 | FileHandler::removeFile($temp_filename); |
| 903 | - return $this->stop(implode(' ' , array( |
|
| 903 | + return $this->stop(implode(' ', array( |
|
| 904 | 904 | Context::getLang('msg_not_uploaded_image_name'), |
| 905 | 905 | Context::getLang('msg_exceeds_limit_size') |
| 906 | 906 | ))); |
@@ -914,9 +914,9 @@ discard block |
||
| 914 | 914 | { |
| 915 | 915 | // 파일 용량 제한 |
| 916 | 916 | $filesize = filesize($target_file); |
| 917 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 917 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 918 | 918 | { |
| 919 | - return $this->stop(implode(' ' , array( |
|
| 919 | + return $this->stop(implode(' ', array( |
|
| 920 | 920 | Context::getLang('msg_not_uploaded_image_name'), |
| 921 | 921 | Context::getLang('msg_exceeds_limit_size') |
| 922 | 922 | ))); |
@@ -938,20 +938,20 @@ discard block |
||
| 938 | 938 | function procMemberDeleteProfileImage($_memberSrl = 0) |
| 939 | 939 | { |
| 940 | 940 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
| 941 | - if(!$member_srl) |
|
| 941 | + if (!$member_srl) |
|
| 942 | 942 | { |
| 943 | - return new BaseObject(0,'success'); |
|
| 943 | + return new BaseObject(0, 'success'); |
|
| 944 | 944 | } |
| 945 | 945 | |
| 946 | 946 | $logged_info = Context::get('logged_info'); |
| 947 | 947 | |
| 948 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 948 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 949 | 949 | { |
| 950 | 950 | $oMemberModel = getModel('member'); |
| 951 | 951 | $profile_image = $oMemberModel->getProfileImage($member_srl); |
| 952 | 952 | FileHandler::removeFile($profile_image->file); |
| 953 | 953 | } |
| 954 | - return new BaseObject(0,'success'); |
|
| 954 | + return new BaseObject(0, 'success'); |
|
| 955 | 955 | } |
| 956 | 956 | |
| 957 | 957 | /** |
@@ -962,20 +962,20 @@ discard block |
||
| 962 | 962 | function procMemberDeleteImageName($_memberSrl = 0) |
| 963 | 963 | { |
| 964 | 964 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
| 965 | - if(!$member_srl) |
|
| 965 | + if (!$member_srl) |
|
| 966 | 966 | { |
| 967 | - return new BaseObject(0,'success'); |
|
| 967 | + return new BaseObject(0, 'success'); |
|
| 968 | 968 | } |
| 969 | 969 | |
| 970 | 970 | $logged_info = Context::get('logged_info'); |
| 971 | 971 | |
| 972 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 972 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 973 | 973 | { |
| 974 | 974 | $oMemberModel = getModel('member'); |
| 975 | 975 | $image_name = $oMemberModel->getImageName($member_srl); |
| 976 | 976 | FileHandler::removeFile($image_name->file); |
| 977 | 977 | } |
| 978 | - return new BaseObject(0,'success'); |
|
| 978 | + return new BaseObject(0, 'success'); |
|
| 979 | 979 | } |
| 980 | 980 | |
| 981 | 981 | /** |
@@ -987,20 +987,20 @@ discard block |
||
| 987 | 987 | { |
| 988 | 988 | // Check if the file is successfully uploaded |
| 989 | 989 | $file = $_FILES['image_mark']; |
| 990 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 990 | + if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 991 | 991 | // Ignore if member_srl is invalid or doesn't exist. |
| 992 | 992 | $member_srl = Context::get('member_srl'); |
| 993 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 993 | + if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 994 | 994 | |
| 995 | 995 | $logged_info = Context::get('logged_info'); |
| 996 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 996 | + if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 997 | 997 | // Membership in the images mark the module using the ban was set by an administrator or return; |
| 998 | 998 | $oMemberModel = getModel('member'); |
| 999 | 999 | $config = $oMemberModel->getMemberConfig(); |
| 1000 | - if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1000 | + if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1001 | 1001 | |
| 1002 | 1002 | $this->insertImageMark($member_srl, $file['tmp_name']); |
| 1003 | - if(!$output->toBool()) return $output; |
|
| 1003 | + if (!$output->toBool()) return $output; |
|
| 1004 | 1004 | |
| 1005 | 1005 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
| 1006 | 1006 | $this->setRedirectUrl($returnUrl); |
@@ -1022,7 +1022,7 @@ discard block |
||
| 1022 | 1022 | $max_height = $config->image_mark_max_height; |
| 1023 | 1023 | $max_filesize = $config->image_mark_max_filesize; |
| 1024 | 1024 | |
| 1025 | - Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
|
| 1025 | + Context::loadLang(_XE_PATH_.'modules/file/lang'); |
|
| 1026 | 1026 | |
| 1027 | 1027 | $target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); |
| 1028 | 1028 | FileHandler::makeDir($target_path); |
@@ -1031,7 +1031,7 @@ discard block |
||
| 1031 | 1031 | // Get file information |
| 1032 | 1032 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 1033 | 1033 | |
| 1034 | - if($width > $max_width || $height > $max_height || $type!=1) |
|
| 1034 | + if ($width > $max_width || $height > $max_height || $type != 1) |
|
| 1035 | 1035 | { |
| 1036 | 1036 | $temp_filename = sprintf('files/cache/tmp/image_mark_%d.gif', $member_srl); |
| 1037 | 1037 | FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif'); |
@@ -1039,10 +1039,10 @@ discard block |
||
| 1039 | 1039 | // 파일 용량 제한 |
| 1040 | 1040 | FileHandler::clearStatCache($temp_filename); |
| 1041 | 1041 | $filesize = filesize($temp_filename); |
| 1042 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 1042 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 1043 | 1043 | { |
| 1044 | 1044 | FileHandler::removeFile($temp_filename); |
| 1045 | - return $this->stop(implode(' ' , array( |
|
| 1045 | + return $this->stop(implode(' ', array( |
|
| 1046 | 1046 | Context::getLang('msg_not_uploaded_group_image_mark'), |
| 1047 | 1047 | Context::getLang('msg_exceeds_limit_size') |
| 1048 | 1048 | ))); |
@@ -1055,10 +1055,10 @@ discard block |
||
| 1055 | 1055 | else |
| 1056 | 1056 | { |
| 1057 | 1057 | $filesize = filesize($target_file); |
| 1058 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 1058 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 1059 | 1059 | { |
| 1060 | 1060 | FileHandler::removeFile($target_file); |
| 1061 | - return $this->stop(implode(' ' , array( |
|
| 1061 | + return $this->stop(implode(' ', array( |
|
| 1062 | 1062 | Context::getLang('msg_not_uploaded_group_image_mark'), |
| 1063 | 1063 | Context::getLang('msg_exceeds_limit_size') |
| 1064 | 1064 | ))); |
@@ -1080,20 +1080,20 @@ discard block |
||
| 1080 | 1080 | function procMemberDeleteImageMark($_memberSrl = 0) |
| 1081 | 1081 | { |
| 1082 | 1082 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
| 1083 | - if(!$member_srl) |
|
| 1083 | + if (!$member_srl) |
|
| 1084 | 1084 | { |
| 1085 | - return new BaseObject(0,'success'); |
|
| 1085 | + return new BaseObject(0, 'success'); |
|
| 1086 | 1086 | } |
| 1087 | 1087 | |
| 1088 | 1088 | $logged_info = Context::get('logged_info'); |
| 1089 | 1089 | |
| 1090 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 1090 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 1091 | 1091 | { |
| 1092 | 1092 | $oMemberModel = getModel('member'); |
| 1093 | 1093 | $image_mark = $oMemberModel->getImageMark($member_srl); |
| 1094 | 1094 | FileHandler::removeFile($image_mark->file); |
| 1095 | 1095 | } |
| 1096 | - return new BaseObject(0,'success'); |
|
| 1096 | + return new BaseObject(0, 'success'); |
|
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | 1099 | /** |
@@ -1104,26 +1104,26 @@ discard block |
||
| 1104 | 1104 | function procMemberFindAccount() |
| 1105 | 1105 | { |
| 1106 | 1106 | $email_address = Context::get('email_address'); |
| 1107 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1107 | + if (!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1108 | 1108 | |
| 1109 | 1109 | $oMemberModel = getModel('member'); |
| 1110 | 1110 | $oModuleModel = getModel('module'); |
| 1111 | 1111 | |
| 1112 | 1112 | // Check if a member having the same email address exists |
| 1113 | 1113 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1114 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1114 | + if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1115 | 1115 | |
| 1116 | 1116 | // Get information of the member |
| 1117 | 1117 | $columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name'); |
| 1118 | 1118 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 1119 | 1119 | |
| 1120 | 1120 | // Check if possible to find member's ID and password |
| 1121 | - if($member_info->denied == 'Y') |
|
| 1121 | + if ($member_info->denied == 'Y') |
|
| 1122 | 1122 | { |
| 1123 | 1123 | $chk_args = new stdClass; |
| 1124 | 1124 | $chk_args->member_srl = $member_info->member_srl; |
| 1125 | 1125 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1126 | - if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
| 1126 | + if ($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
| 1127 | 1127 | } |
| 1128 | 1128 | |
| 1129 | 1129 | // Insert data into the authentication DB |
@@ -1136,19 +1136,19 @@ discard block |
||
| 1136 | 1136 | $args->is_register = 'N'; |
| 1137 | 1137 | |
| 1138 | 1138 | $output = executeQuery('member.insertAuthMail', $args); |
| 1139 | - if(!$output->toBool()) return $output; |
|
| 1139 | + if (!$output->toBool()) return $output; |
|
| 1140 | 1140 | // Get content of the email to send a member |
| 1141 | 1141 | Context::set('auth_args', $args); |
| 1142 | 1142 | |
| 1143 | 1143 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1144 | 1144 | $memberInfo = array(); |
| 1145 | 1145 | global $lang; |
| 1146 | - if(is_array($member_config->signupForm)) |
|
| 1146 | + if (is_array($member_config->signupForm)) |
|
| 1147 | 1147 | { |
| 1148 | - $exceptForm=array('password', 'find_account_question'); |
|
| 1149 | - foreach($member_config->signupForm as $form) |
|
| 1148 | + $exceptForm = array('password', 'find_account_question'); |
|
| 1149 | + foreach ($member_config->signupForm as $form) |
|
| 1150 | 1150 | { |
| 1151 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1151 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1152 | 1152 | { |
| 1153 | 1153 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1154 | 1154 | } |
@@ -1163,15 +1163,15 @@ discard block |
||
| 1163 | 1163 | } |
| 1164 | 1164 | Context::set('memberInfo', $memberInfo); |
| 1165 | 1165 | |
| 1166 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1167 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1166 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
| 1167 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1168 | 1168 | |
| 1169 | 1169 | Context::set('member_config', $member_config); |
| 1170 | 1170 | |
| 1171 | 1171 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1172 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1172 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1173 | 1173 | |
| 1174 | - $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
|
| 1174 | + $find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
|
| 1175 | 1175 | Context::set('find_url', $find_url); |
| 1176 | 1176 | |
| 1177 | 1177 | $oTemplate = &TemplateHandler::getInstance(); |
@@ -1181,19 +1181,19 @@ discard block |
||
| 1181 | 1181 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1182 | 1182 | // Send a mail |
| 1183 | 1183 | $oMail = new Mail(); |
| 1184 | - $oMail->setTitle( Context::getLang('msg_find_account_title') ); |
|
| 1184 | + $oMail->setTitle(Context::getLang('msg_find_account_title')); |
|
| 1185 | 1185 | $oMail->setContent($content); |
| 1186 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 1187 | - $oMail->setReceiptor( $member_info->user_name, $member_info->email_address ); |
|
| 1186 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 1187 | + $oMail->setReceiptor($member_info->user_name, $member_info->email_address); |
|
| 1188 | 1188 | $oMail->send(); |
| 1189 | 1189 | // Return message |
| 1190 | 1190 | $msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address); |
| 1191 | - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) |
|
| 1191 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 1192 | 1192 | { |
| 1193 | 1193 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount'); |
| 1194 | 1194 | $this->setRedirectUrl($returnUrl); |
| 1195 | 1195 | } |
| 1196 | - return new BaseObject(0,$msg); |
|
| 1196 | + return new BaseObject(0, $msg); |
|
| 1197 | 1197 | } |
| 1198 | 1198 | |
| 1199 | 1199 | /** |
@@ -1204,7 +1204,7 @@ discard block |
||
| 1204 | 1204 | function procMemberFindAccountByQuestion() |
| 1205 | 1205 | { |
| 1206 | 1206 | $oMemberModel = getModel('member'); |
| 1207 | - $oPassword = new Password(); |
|
| 1207 | + $oPassword = new Password(); |
|
| 1208 | 1208 | $config = $oMemberModel->getMemberConfig(); |
| 1209 | 1209 | |
| 1210 | 1210 | $email_address = Context::get('email_address'); |
@@ -1212,49 +1212,49 @@ discard block |
||
| 1212 | 1212 | $find_account_question = trim(Context::get('find_account_question')); |
| 1213 | 1213 | $find_account_answer = trim(Context::get('find_account_answer')); |
| 1214 | 1214 | |
| 1215 | - if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1215 | + if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1216 | 1216 | |
| 1217 | 1217 | $oModuleModel = getModel('module'); |
| 1218 | 1218 | // Check if a member having the same email address exists |
| 1219 | 1219 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1220 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1220 | + if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1221 | 1221 | |
| 1222 | 1222 | // Get information of the member |
| 1223 | 1223 | $columnList = array('member_srl', 'find_account_question', 'find_account_answer'); |
| 1224 | 1224 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 1225 | 1225 | |
| 1226 | 1226 | // Display a message if no answer is entered |
| 1227 | - if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
| 1227 | + if (!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
| 1228 | 1228 | |
| 1229 | 1229 | // 답변 확인 |
| 1230 | 1230 | $hashed = $oPassword->checkAlgorithm($member_info->find_account_answer); |
| 1231 | 1231 | $authed = true; |
| 1232 | 1232 | $member_info->find_account_question = trim($member_info->find_account_question); |
| 1233 | - if($member_info->find_account_question != $find_account_question) |
|
| 1233 | + if ($member_info->find_account_question != $find_account_question) |
|
| 1234 | 1234 | { |
| 1235 | 1235 | $authed = false; |
| 1236 | 1236 | } |
| 1237 | - else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
| 1237 | + else if ($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
| 1238 | 1238 | { |
| 1239 | 1239 | $authed = false; |
| 1240 | 1240 | } |
| 1241 | - else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
| 1241 | + else if (!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
| 1242 | 1242 | { |
| 1243 | 1243 | $authed = false; |
| 1244 | 1244 | } |
| 1245 | 1245 | |
| 1246 | - if(!$authed) |
|
| 1246 | + if (!$authed) |
|
| 1247 | 1247 | { |
| 1248 | 1248 | return new BaseObject(-1, 'msg_answer_not_matches'); |
| 1249 | 1249 | } |
| 1250 | 1250 | |
| 1251 | 1251 | // answer가 동일하고 hash 되지 않았으면 hash 값으로 저장 |
| 1252 | - if($authed && !$hashed) |
|
| 1252 | + if ($authed && !$hashed) |
|
| 1253 | 1253 | { |
| 1254 | 1254 | $this->updateFindAccountAnswer($member_srl, $find_account_answer); |
| 1255 | 1255 | } |
| 1256 | 1256 | |
| 1257 | - if($config->identifier == 'email_address') |
|
| 1257 | + if ($config->identifier == 'email_address') |
|
| 1258 | 1258 | { |
| 1259 | 1259 | $user_id = $email_address; |
| 1260 | 1260 | } |
@@ -1267,11 +1267,11 @@ discard block |
||
| 1267 | 1267 | $args->password = $temp_password; |
| 1268 | 1268 | $args->change_password_date = '1'; |
| 1269 | 1269 | $output = $this->updateMemberPassword($args); |
| 1270 | - if(!$output->toBool()) return $output; |
|
| 1270 | + if (!$output->toBool()) return $output; |
|
| 1271 | 1271 | |
| 1272 | - $_SESSION['xe_temp_password_' . $user_id] = $temp_password; |
|
| 1272 | + $_SESSION['xe_temp_password_'.$user_id] = $temp_password; |
|
| 1273 | 1273 | |
| 1274 | - $this->add('user_id',$user_id); |
|
| 1274 | + $this->add('user_id', $user_id); |
|
| 1275 | 1275 | |
| 1276 | 1276 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); |
| 1277 | 1277 | $this->setRedirectUrl($returnUrl.'&user_id='.$user_id); |
@@ -1291,7 +1291,7 @@ discard block |
||
| 1291 | 1291 | $member_srl = Context::get('member_srl'); |
| 1292 | 1292 | $auth_key = Context::get('auth_key'); |
| 1293 | 1293 | |
| 1294 | - if(!$member_srl || !$auth_key) |
|
| 1294 | + if (!$member_srl || !$auth_key) |
|
| 1295 | 1295 | { |
| 1296 | 1296 | return $this->stop('msg_invalid_request'); |
| 1297 | 1297 | } |
@@ -1302,9 +1302,9 @@ discard block |
||
| 1302 | 1302 | $args->auth_key = $auth_key; |
| 1303 | 1303 | $output = executeQuery('member.getAuthMail', $args); |
| 1304 | 1304 | |
| 1305 | - if(!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 1305 | + if (!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 1306 | 1306 | { |
| 1307 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) |
|
| 1307 | + if (strlen($output->data->auth_key) !== strlen($auth_key)) |
|
| 1308 | 1308 | { |
| 1309 | 1309 | executeQuery('member.deleteAuthMail', $args); |
| 1310 | 1310 | } |
@@ -1312,7 +1312,7 @@ discard block |
||
| 1312 | 1312 | return $this->stop('msg_invalid_auth_key'); |
| 1313 | 1313 | } |
| 1314 | 1314 | |
| 1315 | - if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400) |
|
| 1315 | + if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400) |
|
| 1316 | 1316 | { |
| 1317 | 1317 | executeQuery('member.deleteAuthMail', $args); |
| 1318 | 1318 | return $this->stop('msg_invalid_auth_key'); |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | $args->password = $output->data->new_password; |
| 1322 | 1322 | |
| 1323 | 1323 | // If credentials are correct, change the password to a new one |
| 1324 | - if($output->data->is_register == 'Y') |
|
| 1324 | + if ($output->data->is_register == 'Y') |
|
| 1325 | 1325 | { |
| 1326 | 1326 | $args->denied = 'N'; |
| 1327 | 1327 | } |
@@ -1334,13 +1334,13 @@ discard block |
||
| 1334 | 1334 | $is_register = $output->data->is_register; |
| 1335 | 1335 | |
| 1336 | 1336 | $output = executeQuery('member.updateMemberPassword', $args); |
| 1337 | - if(!$output->toBool()) |
|
| 1337 | + if (!$output->toBool()) |
|
| 1338 | 1338 | { |
| 1339 | 1339 | return $this->stop($output->getMessage()); |
| 1340 | 1340 | } |
| 1341 | 1341 | |
| 1342 | 1342 | // Remove all values having the member_srl from authentication table |
| 1343 | - executeQuery('member.deleteAuthMail',$args); |
|
| 1343 | + executeQuery('member.deleteAuthMail', $args); |
|
| 1344 | 1344 | |
| 1345 | 1345 | $this->_clearMemberCache($args->member_srl); |
| 1346 | 1346 | |
@@ -1359,33 +1359,33 @@ discard block |
||
| 1359 | 1359 | { |
| 1360 | 1360 | // Get an email_address |
| 1361 | 1361 | $email_address = Context::get('email_address'); |
| 1362 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1362 | + if (!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1363 | 1363 | // Log test by using email_address |
| 1364 | 1364 | $oMemberModel = getModel('member'); |
| 1365 | 1365 | |
| 1366 | 1366 | $args = new stdClass; |
| 1367 | 1367 | $args->email_address = $email_address; |
| 1368 | 1368 | $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1369 | - if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 1369 | + if (!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 1370 | 1370 | |
| 1371 | 1371 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address'); |
| 1372 | 1372 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList); |
| 1373 | 1373 | |
| 1374 | 1374 | $oModuleModel = getModel('module'); |
| 1375 | 1375 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1376 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1377 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1376 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
| 1377 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1378 | 1378 | |
| 1379 | 1379 | // Check if a authentication mail has been sent previously |
| 1380 | 1380 | $chk_args = new stdClass; |
| 1381 | 1381 | $chk_args->member_srl = $member_info->member_srl; |
| 1382 | 1382 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1383 | - if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1383 | + if ($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1384 | 1384 | |
| 1385 | 1385 | $auth_args = new stdClass; |
| 1386 | 1386 | $auth_args->member_srl = $member_info->member_srl; |
| 1387 | 1387 | $output = executeQueryArray('member.getAuthMailInfo', $auth_args); |
| 1388 | - if(!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1388 | + if (!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1389 | 1389 | $auth_info = $output->data[0]; |
| 1390 | 1390 | |
| 1391 | 1391 | // Update the regdate of authmail entry |
@@ -1396,12 +1396,12 @@ discard block |
||
| 1396 | 1396 | |
| 1397 | 1397 | $memberInfo = array(); |
| 1398 | 1398 | global $lang; |
| 1399 | - if(is_array($member_config->signupForm)) |
|
| 1399 | + if (is_array($member_config->signupForm)) |
|
| 1400 | 1400 | { |
| 1401 | - $exceptForm=array('password', 'find_account_question'); |
|
| 1402 | - foreach($member_config->signupForm as $form) |
|
| 1401 | + $exceptForm = array('password', 'find_account_question'); |
|
| 1402 | + foreach ($member_config->signupForm as $form) |
|
| 1403 | 1403 | { |
| 1404 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1404 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1405 | 1405 | { |
| 1406 | 1406 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1407 | 1407 | } |
@@ -1420,19 +1420,19 @@ discard block |
||
| 1420 | 1420 | Context::set('member_config', $member_config); |
| 1421 | 1421 | |
| 1422 | 1422 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1423 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1423 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1424 | 1424 | |
| 1425 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); |
|
| 1425 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key); |
|
| 1426 | 1426 | Context::set('auth_url', $auth_url); |
| 1427 | 1427 | |
| 1428 | 1428 | $oTemplate = &TemplateHandler::getInstance(); |
| 1429 | 1429 | $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); |
| 1430 | 1430 | // Send a mail |
| 1431 | 1431 | $oMail = new Mail(); |
| 1432 | - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); |
|
| 1432 | + $oMail->setTitle(Context::getLang('msg_confirm_account_title')); |
|
| 1433 | 1433 | $oMail->setContent($content); |
| 1434 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 1435 | - $oMail->setReceiptor( $args->user_name, $args->email_address ); |
|
| 1434 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 1435 | + $oMail->setReceiptor($args->user_name, $args->email_address); |
|
| 1436 | 1436 | $oMail->send(); |
| 1437 | 1437 | |
| 1438 | 1438 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
@@ -1447,23 +1447,23 @@ discard block |
||
| 1447 | 1447 | $memberInfo = $_SESSION['auth_member_info']; |
| 1448 | 1448 | unset($_SESSION['auth_member_info']); |
| 1449 | 1449 | |
| 1450 | - if(!$memberInfo) |
|
| 1450 | + if (!$memberInfo) |
|
| 1451 | 1451 | { |
| 1452 | 1452 | return $this->stop('msg_invalid_request'); |
| 1453 | 1453 | } |
| 1454 | 1454 | |
| 1455 | 1455 | $newEmail = Context::get('email_address'); |
| 1456 | 1456 | |
| 1457 | - if(!$newEmail) |
|
| 1457 | + if (!$newEmail) |
|
| 1458 | 1458 | { |
| 1459 | 1459 | return $this->stop('msg_invalid_request'); |
| 1460 | 1460 | } |
| 1461 | 1461 | |
| 1462 | 1462 | $oMemberModel = getModel('member'); |
| 1463 | 1463 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
| 1464 | - if($member_srl) |
|
| 1464 | + if ($member_srl) |
|
| 1465 | 1465 | { |
| 1466 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
| 1466 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
| 1467 | 1467 | } |
| 1468 | 1468 | |
| 1469 | 1469 | // remove all key by member_srl |
@@ -1471,7 +1471,7 @@ discard block |
||
| 1471 | 1471 | $args->member_srl = $memberInfo->member_srl; |
| 1472 | 1472 | $output = executeQuery('member.deleteAuthMail', $args); |
| 1473 | 1473 | |
| 1474 | - if(!$output->toBool()) |
|
| 1474 | + if (!$output->toBool()) |
|
| 1475 | 1475 | { |
| 1476 | 1476 | return $output; |
| 1477 | 1477 | } |
@@ -1481,7 +1481,7 @@ discard block |
||
| 1481 | 1481 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
| 1482 | 1482 | |
| 1483 | 1483 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
| 1484 | - if(!$output->toBool()) |
|
| 1484 | + if (!$output->toBool()) |
|
| 1485 | 1485 | { |
| 1486 | 1486 | return $this->stop($output->getMessage()); |
| 1487 | 1487 | } |
@@ -1498,7 +1498,7 @@ discard block |
||
| 1498 | 1498 | $auth_args->is_register = 'Y'; |
| 1499 | 1499 | |
| 1500 | 1500 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 1501 | - if(!$output->toBool()) return $output; |
|
| 1501 | + if (!$output->toBool()) return $output; |
|
| 1502 | 1502 | |
| 1503 | 1503 | $memberInfo->email_address = $newEmail; |
| 1504 | 1504 | |
@@ -1522,12 +1522,12 @@ discard block |
||
| 1522 | 1522 | $memberInfo = array(); |
| 1523 | 1523 | |
| 1524 | 1524 | global $lang; |
| 1525 | - if(is_array($member_config->signupForm)) |
|
| 1525 | + if (is_array($member_config->signupForm)) |
|
| 1526 | 1526 | { |
| 1527 | - $exceptForm=array('password', 'find_account_question'); |
|
| 1528 | - foreach($member_config->signupForm as $form) |
|
| 1527 | + $exceptForm = array('password', 'find_account_question'); |
|
| 1528 | + foreach ($member_config->signupForm as $form) |
|
| 1529 | 1529 | { |
| 1530 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1530 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1531 | 1531 | { |
| 1532 | 1532 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1533 | 1533 | } |
@@ -1542,25 +1542,25 @@ discard block |
||
| 1542 | 1542 | } |
| 1543 | 1543 | Context::set('memberInfo', $memberInfo); |
| 1544 | 1544 | |
| 1545 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1546 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1545 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
| 1546 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1547 | 1547 | |
| 1548 | 1548 | Context::set('member_config', $member_config); |
| 1549 | 1549 | |
| 1550 | 1550 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1551 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1551 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1552 | 1552 | |
| 1553 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
|
| 1553 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key); |
|
| 1554 | 1554 | Context::set('auth_url', $auth_url); |
| 1555 | 1555 | |
| 1556 | 1556 | $oTemplate = &TemplateHandler::getInstance(); |
| 1557 | 1557 | $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); |
| 1558 | 1558 | // Send a mail |
| 1559 | 1559 | $oMail = new Mail(); |
| 1560 | - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); |
|
| 1560 | + $oMail->setTitle(Context::getLang('msg_confirm_account_title')); |
|
| 1561 | 1561 | $oMail->setContent($content); |
| 1562 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 1563 | - $oMail->setReceiptor( $member_info->user_name, $member_info->email_address ); |
|
| 1562 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 1563 | + $oMail->setReceiptor($member_info->user_name, $member_info->email_address); |
|
| 1564 | 1564 | $oMail->send(); |
| 1565 | 1565 | } |
| 1566 | 1566 | |
@@ -1573,7 +1573,7 @@ discard block |
||
| 1573 | 1573 | { |
| 1574 | 1574 | $site_module_info = Context::get('site_module_info'); |
| 1575 | 1575 | $logged_info = Context::get('logged_info'); |
| 1576 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
| 1576 | + if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1577 | 1577 | |
| 1578 | 1578 | $oMemberModel = getModel('member'); |
| 1579 | 1579 | $columnList = array('site_srl', 'group_srl', 'title'); |
@@ -1592,13 +1592,13 @@ discard block |
||
| 1592 | 1592 | { |
| 1593 | 1593 | $site_module_info = Context::get('site_module_info'); |
| 1594 | 1594 | $logged_info = Context::get('logged_info'); |
| 1595 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
| 1595 | + if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1596 | 1596 | |
| 1597 | 1597 | $args = new stdClass; |
| 1598 | - $args->site_srl= $site_module_info->site_srl; |
|
| 1598 | + $args->site_srl = $site_module_info->site_srl; |
|
| 1599 | 1599 | $args->member_srl = $logged_info->member_srl; |
| 1600 | 1600 | $output = executeQuery('member.deleteMembersGroup', $args); |
| 1601 | - if(!$output->toBool()) return $output; |
|
| 1601 | + if (!$output->toBool()) return $output; |
|
| 1602 | 1602 | $this->setMessage('success_deleted'); |
| 1603 | 1603 | $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl); |
| 1604 | 1604 | } |
@@ -1612,24 +1612,24 @@ discard block |
||
| 1612 | 1612 | */ |
| 1613 | 1613 | function setMemberConfig($args) |
| 1614 | 1614 | { |
| 1615 | - if(!$args->skin) $args->skin = "default"; |
|
| 1616 | - if(!$args->colorset) $args->colorset = "white"; |
|
| 1617 | - if(!$args->editor_skin) $args->editor_skin= "ckeditor"; |
|
| 1618 | - if(!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
| 1619 | - if($args->enable_join!='Y') $args->enable_join = 'N'; |
|
| 1620 | - if($args->profile_image !='Y') $args->profile_image = 'N'; |
|
| 1621 | - if($args->image_name!='Y') $args->image_name = 'N'; |
|
| 1622 | - if($args->image_mark!='Y') $args->image_mark = 'N'; |
|
| 1623 | - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; |
|
| 1624 | - if(!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
| 1625 | - $args->limit_day = (int)$args->limit_day; |
|
| 1615 | + if (!$args->skin) $args->skin = "default"; |
|
| 1616 | + if (!$args->colorset) $args->colorset = "white"; |
|
| 1617 | + if (!$args->editor_skin) $args->editor_skin = "ckeditor"; |
|
| 1618 | + if (!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
| 1619 | + if ($args->enable_join != 'Y') $args->enable_join = 'N'; |
|
| 1620 | + if ($args->profile_image != 'Y') $args->profile_image = 'N'; |
|
| 1621 | + if ($args->image_name != 'Y') $args->image_name = 'N'; |
|
| 1622 | + if ($args->image_mark != 'Y') $args->image_mark = 'N'; |
|
| 1623 | + if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N'; |
|
| 1624 | + if (!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
| 1625 | + $args->limit_day = (int) $args->limit_day; |
|
| 1626 | 1626 | |
| 1627 | 1627 | $agreement = trim($args->agreement); |
| 1628 | 1628 | unset($args->agreement); |
| 1629 | 1629 | |
| 1630 | 1630 | $oModuleController = getController('module'); |
| 1631 | - $output = $oModuleController->insertModuleConfig('member',$args); |
|
| 1632 | - if(!$output->toBool()) return $output; |
|
| 1631 | + $output = $oModuleController->insertModuleConfig('member', $args); |
|
| 1632 | + if (!$output->toBool()) return $output; |
|
| 1633 | 1633 | |
| 1634 | 1634 | $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
| 1635 | 1635 | FileHandler::writeFile($agreement_file, $agreement); |
@@ -1650,11 +1650,11 @@ discard block |
||
| 1650 | 1650 | $signature = trim(removeHackTag($signature)); |
| 1651 | 1651 | $signature = preg_replace('/<(\/?)(embed|object|param)/is', '<$1$2', $signature); |
| 1652 | 1652 | |
| 1653 | - $check_signature = trim(str_replace(array(' ',"\n","\r"), '', strip_tags($signature, '<img><object>'))); |
|
| 1653 | + $check_signature = trim(str_replace(array(' ', "\n", "\r"), '', strip_tags($signature, '<img><object>'))); |
|
| 1654 | 1654 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
| 1655 | 1655 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
| 1656 | 1656 | |
| 1657 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
| 1657 | + if (!$check_signature) return FileHandler::removeFile($filename); |
|
| 1658 | 1658 | |
| 1659 | 1659 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
| 1660 | 1660 | FileHandler::makeDir($path); |
@@ -1683,15 +1683,15 @@ discard block |
||
| 1683 | 1683 | * |
| 1684 | 1684 | * @return BaseObject |
| 1685 | 1685 | */ |
| 1686 | - function addMemberToGroup($member_srl, $group_srl, $site_srl=0) |
|
| 1686 | + function addMemberToGroup($member_srl, $group_srl, $site_srl = 0) |
|
| 1687 | 1687 | { |
| 1688 | 1688 | $args = new stdClass(); |
| 1689 | 1689 | $args->member_srl = $member_srl; |
| 1690 | 1690 | $args->group_srl = $group_srl; |
| 1691 | - if($site_srl) $args->site_srl = $site_srl; |
|
| 1691 | + if ($site_srl) $args->site_srl = $site_srl; |
|
| 1692 | 1692 | |
| 1693 | 1693 | // Add |
| 1694 | - $output = executeQuery('member.addMemberToGroup',$args); |
|
| 1694 | + $output = executeQuery('member.addMemberToGroup', $args); |
|
| 1695 | 1695 | $output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args); |
| 1696 | 1696 | |
| 1697 | 1697 | $this->_clearMemberCache($member_srl, $site_srl); |
@@ -1711,18 +1711,18 @@ discard block |
||
| 1711 | 1711 | { |
| 1712 | 1712 | $obj = new stdClass; |
| 1713 | 1713 | $obj->site_srl = $args->site_srl; |
| 1714 | - $obj->member_srl = implode(',',$args->member_srl); |
|
| 1714 | + $obj->member_srl = implode(',', $args->member_srl); |
|
| 1715 | 1715 | |
| 1716 | 1716 | $output = executeQueryArray('member.getMembersGroup', $obj); |
| 1717 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1717 | + if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1718 | 1718 | |
| 1719 | 1719 | $output = executeQuery('member.deleteMembersGroup', $obj); |
| 1720 | - if(!$output->toBool()) return $output; |
|
| 1720 | + if (!$output->toBool()) return $output; |
|
| 1721 | 1721 | |
| 1722 | 1722 | $inserted_members = array(); |
| 1723 | - foreach($args->member_srl as $key => $val) |
|
| 1723 | + foreach ($args->member_srl as $key => $val) |
|
| 1724 | 1724 | { |
| 1725 | - if($inserted_members[$val]) continue; |
|
| 1725 | + if ($inserted_members[$val]) continue; |
|
| 1726 | 1726 | $inserted_members[$val] = true; |
| 1727 | 1727 | |
| 1728 | 1728 | unset($obj); |
@@ -1732,7 +1732,7 @@ discard block |
||
| 1732 | 1732 | $obj->site_srl = $args->site_srl; |
| 1733 | 1733 | $obj->regdate = $date[$obj->member_srl]; |
| 1734 | 1734 | $output = executeQuery('member.addMemberToGroup', $obj); |
| 1735 | - if(!$output->toBool()) return $output; |
|
| 1735 | + if (!$output->toBool()) return $output; |
|
| 1736 | 1736 | |
| 1737 | 1737 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
| 1738 | 1738 | } |
@@ -1754,7 +1754,7 @@ discard block |
||
| 1754 | 1754 | // Get information of the key |
| 1755 | 1755 | $output = executeQuery('member.getAutologin', $args); |
| 1756 | 1756 | // If no information exists, delete a cookie |
| 1757 | - if(!$output->toBool() || !$output->data) |
|
| 1757 | + if (!$output->toBool() || !$output->data) |
|
| 1758 | 1758 | { |
| 1759 | 1759 | saveCookie('xeak'); |
| 1760 | 1760 | return; |
@@ -1766,7 +1766,7 @@ discard block |
||
| 1766 | 1766 | $user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address; |
| 1767 | 1767 | $password = $output->data->password; |
| 1768 | 1768 | |
| 1769 | - if(!$user_id || !$password) |
|
| 1769 | + if (!$user_id || !$password) |
|
| 1770 | 1770 | { |
| 1771 | 1771 | saveCookie('xeak'); |
| 1772 | 1772 | return; |
@@ -1778,7 +1778,7 @@ discard block |
||
| 1778 | 1778 | $check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT']; |
| 1779 | 1779 | $check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32); |
| 1780 | 1780 | |
| 1781 | - if($check_key === substr($args->autologin_key, 32)) |
|
| 1781 | + if ($check_key === substr($args->autologin_key, 32)) |
|
| 1782 | 1782 | { |
| 1783 | 1783 | // Check change_password_date |
| 1784 | 1784 | $oModuleModel = getModel('module'); |
@@ -1786,12 +1786,12 @@ discard block |
||
| 1786 | 1786 | $limit_date = $member_config->change_password_date; |
| 1787 | 1787 | |
| 1788 | 1788 | // Check if change_password_date is set |
| 1789 | - if($limit_date > 0) |
|
| 1789 | + if ($limit_date > 0) |
|
| 1790 | 1790 | { |
| 1791 | 1791 | $oMemberModel = getModel('member'); |
| 1792 | 1792 | $columnList = array('member_srl', 'change_password_date'); |
| 1793 | 1793 | |
| 1794 | - if($config->identifier == 'user_id') |
|
| 1794 | + if ($config->identifier == 'user_id') |
|
| 1795 | 1795 | { |
| 1796 | 1796 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
| 1797 | 1797 | } |
@@ -1800,7 +1800,7 @@ discard block |
||
| 1800 | 1800 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
| 1801 | 1801 | } |
| 1802 | 1802 | |
| 1803 | - if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){ |
|
| 1803 | + if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) { |
|
| 1804 | 1804 | $do_auto_login = true; |
| 1805 | 1805 | } |
| 1806 | 1806 | |
@@ -1811,7 +1811,7 @@ discard block |
||
| 1811 | 1811 | } |
| 1812 | 1812 | } |
| 1813 | 1813 | |
| 1814 | - if($do_auto_login) |
|
| 1814 | + if ($do_auto_login) |
|
| 1815 | 1815 | { |
| 1816 | 1816 | $output = $this->doLogin($user_id); |
| 1817 | 1817 | } |
@@ -1834,13 +1834,13 @@ discard block |
||
| 1834 | 1834 | function doLogin($user_id, $password = '', $keep_signed = false) |
| 1835 | 1835 | { |
| 1836 | 1836 | $user_id = strtolower($user_id); |
| 1837 | - if(!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
| 1837 | + if (!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
| 1838 | 1838 | // Call a trigger before log-in (before) |
| 1839 | 1839 | $trigger_obj = new stdClass(); |
| 1840 | 1840 | $trigger_obj->user_id = $user_id; |
| 1841 | 1841 | $trigger_obj->password = $password; |
| 1842 | 1842 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
| 1843 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 1843 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 1844 | 1844 | // Create a member model object |
| 1845 | 1845 | $oMemberModel = getModel('member'); |
| 1846 | 1846 | |
@@ -1850,12 +1850,12 @@ discard block |
||
| 1850 | 1850 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
| 1851 | 1851 | |
| 1852 | 1852 | // check identifier |
| 1853 | - if($config->identifier == 'email_address') |
|
| 1853 | + if ($config->identifier == 'email_address') |
|
| 1854 | 1854 | { |
| 1855 | 1855 | // Get user_id information |
| 1856 | 1856 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
| 1857 | 1857 | // Set an invalid user if no value returned |
| 1858 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 1858 | + if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 1859 | 1859 | |
| 1860 | 1860 | } |
| 1861 | 1861 | else |
@@ -1863,24 +1863,24 @@ discard block |
||
| 1863 | 1863 | // Get user_id information |
| 1864 | 1864 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
| 1865 | 1865 | // Set an invalid user if no value returned |
| 1866 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 1866 | + if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 1867 | 1867 | } |
| 1868 | 1868 | |
| 1869 | 1869 | $output = executeQuery('member.getLoginCountByIp', $args); |
| 1870 | 1870 | $errorCount = $output->data->count; |
| 1871 | - if($errorCount >= $config->max_error_count) |
|
| 1871 | + if ($errorCount >= $config->max_error_count) |
|
| 1872 | 1872 | { |
| 1873 | 1873 | $last_update = strtotime($output->data->last_update); |
| 1874 | - $term = intval($_SERVER['REQUEST_TIME']-$last_update); |
|
| 1875 | - if($term < $config->max_error_count_time) |
|
| 1874 | + $term = intval($_SERVER['REQUEST_TIME'] - $last_update); |
|
| 1875 | + if ($term < $config->max_error_count_time) |
|
| 1876 | 1876 | { |
| 1877 | 1877 | $term = $config->max_error_count_time - $term; |
| 1878 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
| 1879 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
| 1880 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
| 1881 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
| 1878 | + if ($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
| 1879 | + elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min'); |
|
| 1880 | + elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour'); |
|
| 1881 | + else $term = intval($term / 86400).Context::getLang('unit_day'); |
|
| 1882 | 1882 | |
| 1883 | - return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
|
| 1883 | + return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'), $term)); |
|
| 1884 | 1884 | } |
| 1885 | 1885 | else |
| 1886 | 1886 | { |
@@ -1890,13 +1890,13 @@ discard block |
||
| 1890 | 1890 | } |
| 1891 | 1891 | |
| 1892 | 1892 | // Password Check |
| 1893 | - if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
| 1893 | + if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
| 1894 | 1894 | { |
| 1895 | - return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo); |
|
| 1895 | + return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo); |
|
| 1896 | 1896 | } |
| 1897 | 1897 | |
| 1898 | 1898 | // If denied == 'Y', notify |
| 1899 | - if($this->memberInfo->denied == 'Y') |
|
| 1899 | + if ($this->memberInfo->denied == 'Y') |
|
| 1900 | 1900 | { |
| 1901 | 1901 | $args->member_srl = $this->memberInfo->member_srl; |
| 1902 | 1902 | $output = executeQuery('member.chkAuthMail', $args); |
@@ -1904,12 +1904,12 @@ discard block |
||
| 1904 | 1904 | { |
| 1905 | 1905 | $_SESSION['auth_member_srl'] = $this->memberInfo->member_srl; |
| 1906 | 1906 | $redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail'); |
| 1907 | - return $this->setRedirectUrl($redirectUrl, new BaseObject(-1,'msg_user_not_confirmed')); |
|
| 1907 | + return $this->setRedirectUrl($redirectUrl, new BaseObject(-1, 'msg_user_not_confirmed')); |
|
| 1908 | 1908 | } |
| 1909 | - return new BaseObject(-1,'msg_user_denied'); |
|
| 1909 | + return new BaseObject(-1, 'msg_user_denied'); |
|
| 1910 | 1910 | } |
| 1911 | 1911 | // Notify if denied_date is less than the current time |
| 1912 | - 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"))); |
|
| 1912 | + 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"))); |
|
| 1913 | 1913 | // Update the latest login time |
| 1914 | 1914 | $args->member_srl = $this->memberInfo->member_srl; |
| 1915 | 1915 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1919,36 +1919,36 @@ discard block |
||
| 1919 | 1919 | |
| 1920 | 1920 | // Check if there is recoding table. |
| 1921 | 1921 | $oDB = &DB::getInstance(); |
| 1922 | - if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
| 1922 | + if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
| 1923 | 1923 | { |
| 1924 | 1924 | // check if there is login fail records. |
| 1925 | 1925 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
| 1926 | - if($output->data && $output->data->content) |
|
| 1926 | + if ($output->data && $output->data->content) |
|
| 1927 | 1927 | { |
| 1928 | 1928 | $title = Context::getLang('login_fail_report'); |
| 1929 | 1929 | $message = '<ul>'; |
| 1930 | 1930 | $content = unserialize($output->data->content); |
| 1931 | - if(count($content) > $config->max_error_count) |
|
| 1931 | + if (count($content) > $config->max_error_count) |
|
| 1932 | 1932 | { |
| 1933 | - foreach($content as $val) |
|
| 1933 | + foreach ($content as $val) |
|
| 1934 | 1934 | { |
| 1935 | - $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>'; |
|
| 1935 | + $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>'; |
|
| 1936 | 1936 | } |
| 1937 | 1937 | $message .= '</ul>'; |
| 1938 | - $content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa')); |
|
| 1938 | + $content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa')); |
|
| 1939 | 1939 | |
| 1940 | 1940 | //send message |
| 1941 | 1941 | $oCommunicationController = getController('communication'); |
| 1942 | 1942 | $oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true); |
| 1943 | 1943 | |
| 1944 | - if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
| 1944 | + if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
| 1945 | 1945 | { |
| 1946 | 1946 | $view_url = Context::getRequestUri(); |
| 1947 | - $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); |
|
| 1947 | + $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); |
|
| 1948 | 1948 | $oMail = new Mail(); |
| 1949 | 1949 | $oMail->setTitle($title); |
| 1950 | 1950 | $oMail->setContent($content); |
| 1951 | - $oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email); |
|
| 1951 | + $oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email); |
|
| 1952 | 1952 | $oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address); |
| 1953 | 1953 | $oMail->send(); |
| 1954 | 1954 | } |
@@ -1958,9 +1958,9 @@ discard block |
||
| 1958 | 1958 | } |
| 1959 | 1959 | // Call a trigger after successfully log-in (after) |
| 1960 | 1960 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
| 1961 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 1961 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 1962 | 1962 | // When user checked to use auto-login |
| 1963 | - if($keep_signed) |
|
| 1963 | + if ($keep_signed) |
|
| 1964 | 1964 | { |
| 1965 | 1965 | // Key generate for auto login |
| 1966 | 1966 | $oPassword = new Password(); |
@@ -1972,12 +1972,12 @@ discard block |
||
| 1972 | 1972 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
| 1973 | 1973 | executeQuery('member.deleteAutologin', $autologin_args); |
| 1974 | 1974 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
| 1975 | - if($autologin_output->toBool()) saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME']+31536000); |
|
| 1975 | + if ($autologin_output->toBool()) saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME'] + 31536000); |
|
| 1976 | 1976 | } |
| 1977 | - if($this->memberInfo->is_admin == 'Y') |
|
| 1977 | + if ($this->memberInfo->is_admin == 'Y') |
|
| 1978 | 1978 | { |
| 1979 | 1979 | $oMemberAdminModel = getAdminModel('member'); |
| 1980 | - if(!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
| 1980 | + if (!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
| 1981 | 1981 | { |
| 1982 | 1982 | $_SESSION['denied_admin'] = 'Y'; |
| 1983 | 1983 | } |
@@ -1995,18 +1995,18 @@ discard block |
||
| 1995 | 1995 | { |
| 1996 | 1996 | $oMemberModel = getModel('member'); |
| 1997 | 1997 | // If your information came through the current session information to extract information from the users |
| 1998 | - if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() ) |
|
| 1998 | + if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged()) |
|
| 1999 | 1999 | { |
| 2000 | 2000 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']); |
| 2001 | 2001 | // If you do not destroy the session Profile |
| 2002 | - if($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
| 2002 | + if ($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
| 2003 | 2003 | { |
| 2004 | 2004 | $this->destroySessionInfo(); |
| 2005 | 2005 | return; |
| 2006 | 2006 | } |
| 2007 | 2007 | } |
| 2008 | 2008 | // Stop using the session id is destroyed |
| 2009 | - if($this->memberInfo->denied=='Y') |
|
| 2009 | + if ($this->memberInfo->denied == 'Y') |
|
| 2010 | 2010 | { |
| 2011 | 2011 | $this->destroySessionInfo(); |
| 2012 | 2012 | return; |
@@ -2036,10 +2036,10 @@ discard block |
||
| 2036 | 2036 | Context::set('logged_info', $this->memberInfo); |
| 2037 | 2037 | |
| 2038 | 2038 | // Only the menu configuration of the user (such as an add-on to the menu can be changed) |
| 2039 | - $this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info'); |
|
| 2040 | - $this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
| 2041 | - $this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
| 2042 | - $this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document'); |
|
| 2039 | + $this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info'); |
|
| 2040 | + $this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
| 2041 | + $this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
| 2042 | + $this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document'); |
|
| 2043 | 2043 | } |
| 2044 | 2044 | |
| 2045 | 2045 | /** |
@@ -2061,7 +2061,7 @@ discard block |
||
| 2061 | 2061 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
| 2062 | 2062 | { |
| 2063 | 2063 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
| 2064 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
| 2064 | + if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
| 2065 | 2065 | |
| 2066 | 2066 | $obj = new stdClass; |
| 2067 | 2067 | $obj->url = $url; |
@@ -2080,33 +2080,33 @@ discard block |
||
| 2080 | 2080 | { |
| 2081 | 2081 | // Call a trigger (before) |
| 2082 | 2082 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
| 2083 | - if(!$output->toBool()) return $output; |
|
| 2083 | + if (!$output->toBool()) return $output; |
|
| 2084 | 2084 | // Terms and Conditions portion of the information set up by members reaffirmed |
| 2085 | 2085 | $oModuleModel = getModel('module'); |
| 2086 | 2086 | $config = $oModuleModel->getModuleConfig('member'); |
| 2087 | 2087 | |
| 2088 | 2088 | $logged_info = Context::get('logged_info'); |
| 2089 | 2089 | // If the date of the temporary restrictions limit further information on the date of |
| 2090 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
| 2090 | + if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24); |
|
| 2091 | 2091 | |
| 2092 | 2092 | $args->member_srl = getNextSequence(); |
| 2093 | 2093 | $args->list_order = -1 * $args->member_srl; |
| 2094 | 2094 | |
| 2095 | 2095 | // Execute insert or update depending on the value of member_srl |
| 2096 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2096 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2097 | 2097 | // Enter the user's identity changed to lowercase |
| 2098 | 2098 | else $args->user_id = strtolower($args->user_id); |
| 2099 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2100 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
| 2099 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2100 | + if (!$args->nick_name) $args->nick_name = $args->member_srl; |
|
| 2101 | 2101 | |
| 2102 | 2102 | // Control of essential parameters |
| 2103 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 2104 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 2105 | - if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y'; |
|
| 2103 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
| 2104 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
| 2105 | + if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y'; |
|
| 2106 | 2106 | |
| 2107 | - if($logged_info->is_admin == 'Y') |
|
| 2107 | + if ($logged_info->is_admin == 'Y') |
|
| 2108 | 2108 | { |
| 2109 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
| 2109 | + if ($args->is_admin != 'Y') $args->is_admin = 'N'; |
|
| 2110 | 2110 | } |
| 2111 | 2111 | else |
| 2112 | 2112 | { |
@@ -2121,97 +2121,97 @@ discard block |
||
| 2121 | 2121 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2122 | 2122 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2123 | 2123 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2124 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2125 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2124 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2125 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2126 | 2126 | |
| 2127 | 2127 | // Create a model object |
| 2128 | 2128 | $oMemberModel = getModel('member'); |
| 2129 | 2129 | |
| 2130 | 2130 | // Check password strength |
| 2131 | - if($args->password && !$password_is_hashed) |
|
| 2131 | + if ($args->password && !$password_is_hashed) |
|
| 2132 | 2132 | { |
| 2133 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2133 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2134 | 2134 | { |
| 2135 | 2135 | $message = Context::getLang('about_password_strength'); |
| 2136 | 2136 | return new BaseObject(-1, $message[$config->password_strength]); |
| 2137 | 2137 | } |
| 2138 | 2138 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2139 | 2139 | } |
| 2140 | - elseif(!$args->password) |
|
| 2140 | + elseif (!$args->password) |
|
| 2141 | 2141 | { |
| 2142 | 2142 | unset($args->password); |
| 2143 | 2143 | } |
| 2144 | 2144 | |
| 2145 | - if($args->find_account_answer && !$password_is_hashed) |
|
| 2145 | + if ($args->find_account_answer && !$password_is_hashed) |
|
| 2146 | 2146 | { |
| 2147 | 2147 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
| 2148 | 2148 | } |
| 2149 | - elseif(!$args->find_account_answer) |
|
| 2149 | + elseif (!$args->find_account_answer) |
|
| 2150 | 2150 | { |
| 2151 | 2151 | unset($args->find_account_answer); |
| 2152 | 2152 | } |
| 2153 | 2153 | |
| 2154 | 2154 | // Check if ID is prohibited |
| 2155 | - if($oMemberModel->isDeniedID($args->user_id)) |
|
| 2155 | + if ($oMemberModel->isDeniedID($args->user_id)) |
|
| 2156 | 2156 | { |
| 2157 | - return new BaseObject(-1,'denied_user_id'); |
|
| 2157 | + return new BaseObject(-1, 'denied_user_id'); |
|
| 2158 | 2158 | } |
| 2159 | 2159 | |
| 2160 | 2160 | // Check if ID is duplicate |
| 2161 | 2161 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2162 | - if($member_srl) |
|
| 2162 | + if ($member_srl) |
|
| 2163 | 2163 | { |
| 2164 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
| 2164 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
| 2165 | 2165 | } |
| 2166 | 2166 | |
| 2167 | 2167 | // Check if nickname is prohibited |
| 2168 | - if($oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2168 | + if ($oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2169 | 2169 | { |
| 2170 | - return new BaseObject(-1,'denied_nick_name'); |
|
| 2170 | + return new BaseObject(-1, 'denied_nick_name'); |
|
| 2171 | 2171 | } |
| 2172 | 2172 | |
| 2173 | 2173 | // Check if nickname is duplicate |
| 2174 | 2174 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
| 2175 | - if($member_srl) |
|
| 2175 | + if ($member_srl) |
|
| 2176 | 2176 | { |
| 2177 | - return new BaseObject(-1,'msg_exists_nick_name'); |
|
| 2177 | + return new BaseObject(-1, 'msg_exists_nick_name'); |
|
| 2178 | 2178 | } |
| 2179 | 2179 | |
| 2180 | 2180 | // Check if email address is duplicate |
| 2181 | 2181 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
| 2182 | - if($member_srl) |
|
| 2182 | + if ($member_srl) |
|
| 2183 | 2183 | { |
| 2184 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
| 2184 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
| 2185 | 2185 | } |
| 2186 | 2186 | |
| 2187 | 2187 | // Insert data into the DB |
| 2188 | 2188 | $args->list_order = -1 * $args->member_srl; |
| 2189 | 2189 | |
| 2190 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2191 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2190 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2191 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2192 | 2192 | |
| 2193 | 2193 | $oDB = &DB::getInstance(); |
| 2194 | 2194 | $oDB->begin(); |
| 2195 | 2195 | |
| 2196 | 2196 | $output = executeQuery('member.insertMember', $args); |
| 2197 | - if(!$output->toBool()) |
|
| 2197 | + if (!$output->toBool()) |
|
| 2198 | 2198 | { |
| 2199 | 2199 | $oDB->rollback(); |
| 2200 | 2200 | return $output; |
| 2201 | 2201 | } |
| 2202 | 2202 | |
| 2203 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2203 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2204 | 2204 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
| 2205 | 2205 | // If no value is entered the default group, the value of group registration |
| 2206 | - if(!$args->group_srl_list) |
|
| 2206 | + if (!$args->group_srl_list) |
|
| 2207 | 2207 | { |
| 2208 | 2208 | $columnList = array('site_srl', 'group_srl'); |
| 2209 | 2209 | $default_group = $oMemberModel->getDefaultGroup(0, $columnList); |
| 2210 | - if($default_group) |
|
| 2210 | + if ($default_group) |
|
| 2211 | 2211 | { |
| 2212 | 2212 | // Add to the default group |
| 2213 | - $output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl); |
|
| 2214 | - if(!$output->toBool()) |
|
| 2213 | + $output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl); |
|
| 2214 | + if (!$output->toBool()) |
|
| 2215 | 2215 | { |
| 2216 | 2216 | $oDB->rollback(); |
| 2217 | 2217 | return $output; |
@@ -2221,11 +2221,11 @@ discard block |
||
| 2221 | 2221 | } |
| 2222 | 2222 | else |
| 2223 | 2223 | { |
| 2224 | - for($i=0;$i<count($group_srl_list);$i++) |
|
| 2224 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
| 2225 | 2225 | { |
| 2226 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
| 2226 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
| 2227 | 2227 | |
| 2228 | - if(!$output->toBool()) |
|
| 2228 | + if (!$output->toBool()) |
|
| 2229 | 2229 | { |
| 2230 | 2230 | $oDB->rollback(); |
| 2231 | 2231 | return $output; |
@@ -2235,7 +2235,7 @@ discard block |
||
| 2235 | 2235 | |
| 2236 | 2236 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 2237 | 2237 | // When using email authentication mode (when you subscribed members denied a) certified mail sent |
| 2238 | - if($args->denied == 'Y') |
|
| 2238 | + if ($args->denied == 'Y') |
|
| 2239 | 2239 | { |
| 2240 | 2240 | // Insert data into the authentication DB |
| 2241 | 2241 | $oPassword = new Password(); |
@@ -2247,7 +2247,7 @@ discard block |
||
| 2247 | 2247 | $auth_args->is_register = 'Y'; |
| 2248 | 2248 | |
| 2249 | 2249 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 2250 | - if(!$output->toBool()) |
|
| 2250 | + if (!$output->toBool()) |
|
| 2251 | 2251 | { |
| 2252 | 2252 | $oDB->rollback(); |
| 2253 | 2253 | return $output; |
@@ -2255,10 +2255,10 @@ discard block |
||
| 2255 | 2255 | $this->_sendAuthMail($auth_args, $args); |
| 2256 | 2256 | } |
| 2257 | 2257 | // Call a trigger (after) |
| 2258 | - if($output->toBool()) |
|
| 2258 | + if ($output->toBool()) |
|
| 2259 | 2259 | { |
| 2260 | 2260 | $trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args); |
| 2261 | - if(!$trigger_output->toBool()) |
|
| 2261 | + if (!$trigger_output->toBool()) |
|
| 2262 | 2262 | { |
| 2263 | 2263 | $oDB->rollback(); |
| 2264 | 2264 | return $trigger_output; |
@@ -2280,41 +2280,41 @@ discard block |
||
| 2280 | 2280 | { |
| 2281 | 2281 | // Call a trigger (before) |
| 2282 | 2282 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
| 2283 | - if(!$output->toBool()) return $output; |
|
| 2283 | + if (!$output->toBool()) return $output; |
|
| 2284 | 2284 | // Create a model object |
| 2285 | 2285 | $oMemberModel = getModel('member'); |
| 2286 | 2286 | |
| 2287 | 2287 | $logged_info = Context::get('logged_info'); |
| 2288 | 2288 | // Get what you want to modify the original information |
| 2289 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2289 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2290 | 2290 | // Control of essential parameters |
| 2291 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 2292 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
| 2291 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
| 2292 | + if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y'; |
|
| 2293 | 2293 | |
| 2294 | - if($logged_info->is_admin == 'Y') |
|
| 2294 | + if ($logged_info->is_admin == 'Y') |
|
| 2295 | 2295 | { |
| 2296 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 2297 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
| 2296 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
| 2297 | + if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
| 2298 | 2298 | } |
| 2299 | 2299 | else |
| 2300 | 2300 | { |
| 2301 | 2301 | unset($args->is_admin); |
| 2302 | - if($is_admin == false) |
|
| 2302 | + if ($is_admin == false) |
|
| 2303 | 2303 | unset($args->denied); |
| 2304 | - if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
| 2304 | + if ($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
| 2305 | 2305 | { |
| 2306 | 2306 | return $this->stop('msg_invalid_request'); |
| 2307 | 2307 | } |
| 2308 | 2308 | } |
| 2309 | 2309 | |
| 2310 | 2310 | // Sanitize user ID, username, nickname, homepage, blog |
| 2311 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2311 | + if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2312 | 2312 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2313 | 2313 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2314 | 2314 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2315 | 2315 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2316 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2317 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2316 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2317 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2318 | 2318 | |
| 2319 | 2319 | // check member identifier form |
| 2320 | 2320 | $config = $oMemberModel->getMemberConfig(); |
@@ -2323,56 +2323,56 @@ discard block |
||
| 2323 | 2323 | $orgMemberInfo = $output->data; |
| 2324 | 2324 | |
| 2325 | 2325 | // Check if email address or user ID is duplicate |
| 2326 | - if($config->identifier == 'email_address') |
|
| 2326 | + if ($config->identifier == 'email_address') |
|
| 2327 | 2327 | { |
| 2328 | 2328 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
| 2329 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2329 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2330 | 2330 | { |
| 2331 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
| 2331 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
| 2332 | 2332 | } |
| 2333 | 2333 | $args->email_address = $orgMemberInfo->email_address; |
| 2334 | 2334 | } |
| 2335 | 2335 | else |
| 2336 | 2336 | { |
| 2337 | 2337 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2338 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2338 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2339 | 2339 | { |
| 2340 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
| 2340 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
| 2341 | 2341 | } |
| 2342 | 2342 | |
| 2343 | 2343 | $args->user_id = $orgMemberInfo->user_id; |
| 2344 | 2344 | } |
| 2345 | 2345 | |
| 2346 | - if($logged_info->is_admin !== 'Y') |
|
| 2346 | + if ($logged_info->is_admin !== 'Y') |
|
| 2347 | 2347 | { |
| 2348 | 2348 | // Check if ID is prohibited |
| 2349 | - if($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
| 2349 | + if ($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
| 2350 | 2350 | { |
| 2351 | - return new BaseObject(-1,'denied_user_id'); |
|
| 2351 | + return new BaseObject(-1, 'denied_user_id'); |
|
| 2352 | 2352 | } |
| 2353 | 2353 | |
| 2354 | 2354 | // Check if nickname is prohibited |
| 2355 | - if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2355 | + if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2356 | 2356 | { |
| 2357 | 2357 | return new BaseObject(-1, 'denied_nick_name'); |
| 2358 | 2358 | } |
| 2359 | 2359 | } |
| 2360 | 2360 | |
| 2361 | 2361 | // Check if ID is duplicate |
| 2362 | - if($args->user_id) |
|
| 2362 | + if ($args->user_id) |
|
| 2363 | 2363 | { |
| 2364 | 2364 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2365 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2365 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2366 | 2366 | { |
| 2367 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
| 2367 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
| 2368 | 2368 | } |
| 2369 | 2369 | } |
| 2370 | 2370 | |
| 2371 | 2371 | // Check if nickname is duplicate |
| 2372 | 2372 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
| 2373 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2373 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2374 | 2374 | { |
| 2375 | - return new BaseObject(-1,'msg_exists_nick_name'); |
|
| 2375 | + return new BaseObject(-1, 'msg_exists_nick_name'); |
|
| 2376 | 2376 | } |
| 2377 | 2377 | |
| 2378 | 2378 | list($args->email_id, $args->email_host) = explode('@', $args->email_address); |
@@ -2381,9 +2381,9 @@ discard block |
||
| 2381 | 2381 | $oDB->begin(); |
| 2382 | 2382 | |
| 2383 | 2383 | // Check password strength |
| 2384 | - if($args->password) |
|
| 2384 | + if ($args->password) |
|
| 2385 | 2385 | { |
| 2386 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2386 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2387 | 2387 | { |
| 2388 | 2388 | $message = Context::getLang('about_password_strength'); |
| 2389 | 2389 | return new BaseObject(-1, $message[$config->password_strength]); |
@@ -2395,55 +2395,55 @@ discard block |
||
| 2395 | 2395 | $args->password = $orgMemberInfo->password; |
| 2396 | 2396 | } |
| 2397 | 2397 | |
| 2398 | - if($args->find_account_answer) { |
|
| 2398 | + if ($args->find_account_answer) { |
|
| 2399 | 2399 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
| 2400 | 2400 | } |
| 2401 | 2401 | else |
| 2402 | 2402 | { |
| 2403 | - $oPassword = new Password(); |
|
| 2403 | + $oPassword = new Password(); |
|
| 2404 | 2404 | $hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer); |
| 2405 | 2405 | |
| 2406 | - if($hashed) { |
|
| 2406 | + if ($hashed) { |
|
| 2407 | 2407 | $args->find_account_answer = $orgMemberInfo->find_account_answer; |
| 2408 | 2408 | } else { |
| 2409 | 2409 | $args->find_account_answer = $oPassword->createHash($orgMemberInfo->find_account_answer); |
| 2410 | 2410 | } |
| 2411 | 2411 | } |
| 2412 | 2412 | |
| 2413 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
| 2414 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
| 2415 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2416 | - if(!$args->description) $args->description = $orgMemberInfo->description; |
|
| 2417 | - if(!$args->birthday) $args->birthday = ''; |
|
| 2413 | + if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
| 2414 | + if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
| 2415 | + if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2416 | + if (!$args->description) $args->description = $orgMemberInfo->description; |
|
| 2417 | + if (!$args->birthday) $args->birthday = ''; |
|
| 2418 | 2418 | |
| 2419 | 2419 | $output = executeQuery('member.updateMember', $args); |
| 2420 | 2420 | |
| 2421 | - if(!$output->toBool()) |
|
| 2421 | + if (!$output->toBool()) |
|
| 2422 | 2422 | { |
| 2423 | 2423 | $oDB->rollback(); |
| 2424 | 2424 | return $output; |
| 2425 | 2425 | } |
| 2426 | 2426 | |
| 2427 | - if($args->group_srl_list) |
|
| 2427 | + if ($args->group_srl_list) |
|
| 2428 | 2428 | { |
| 2429 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2429 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2430 | 2430 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
| 2431 | 2431 | // If the group information, group information changes |
| 2432 | - if(count($group_srl_list) > 0) |
|
| 2432 | + if (count($group_srl_list) > 0) |
|
| 2433 | 2433 | { |
| 2434 | 2434 | $args->site_srl = 0; |
| 2435 | 2435 | // One of its members to delete all the group |
| 2436 | 2436 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
| 2437 | - if(!$output->toBool()) |
|
| 2437 | + if (!$output->toBool()) |
|
| 2438 | 2438 | { |
| 2439 | 2439 | $oDB->rollback(); |
| 2440 | 2440 | return $output; |
| 2441 | 2441 | } |
| 2442 | 2442 | // Enter one of the loop a |
| 2443 | - for($i=0;$i<count($group_srl_list);$i++) |
|
| 2443 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
| 2444 | 2444 | { |
| 2445 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
| 2446 | - if(!$output->toBool()) |
|
| 2445 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
| 2446 | + if (!$output->toBool()) |
|
| 2447 | 2447 | { |
| 2448 | 2448 | $oDB->rollback(); |
| 2449 | 2449 | return $output; |
@@ -2455,9 +2455,9 @@ discard block |
||
| 2455 | 2455 | } |
| 2456 | 2456 | } |
| 2457 | 2457 | // Call a trigger (after) |
| 2458 | - if($output->toBool()) { |
|
| 2458 | + if ($output->toBool()) { |
|
| 2459 | 2459 | $trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args); |
| 2460 | - if(!$trigger_output->toBool()) |
|
| 2460 | + if (!$trigger_output->toBool()) |
|
| 2461 | 2461 | { |
| 2462 | 2462 | $oDB->rollback(); |
| 2463 | 2463 | return $trigger_output; |
@@ -2470,7 +2470,7 @@ discard block |
||
| 2470 | 2470 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
| 2471 | 2471 | |
| 2472 | 2472 | // Save Session |
| 2473 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2473 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2474 | 2474 | $logged_info = Context::get('logged_info'); |
| 2475 | 2475 | |
| 2476 | 2476 | $output->add('member_srl', $args->member_srl); |
@@ -2482,14 +2482,14 @@ discard block |
||
| 2482 | 2482 | */ |
| 2483 | 2483 | function updateMemberPassword($args) |
| 2484 | 2484 | { |
| 2485 | - if($args->password) |
|
| 2485 | + if ($args->password) |
|
| 2486 | 2486 | { |
| 2487 | 2487 | |
| 2488 | 2488 | // check password strength |
| 2489 | 2489 | $oMemberModel = getModel('member'); |
| 2490 | 2490 | $config = $oMemberModel->getMemberConfig(); |
| 2491 | 2491 | |
| 2492 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2492 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2493 | 2493 | { |
| 2494 | 2494 | $message = Context::getLang('about_password_strength'); |
| 2495 | 2495 | return new BaseObject(-1, $message[$config->password_strength]); |
@@ -2497,13 +2497,13 @@ discard block |
||
| 2497 | 2497 | |
| 2498 | 2498 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2499 | 2499 | } |
| 2500 | - else if($args->hashed_password) |
|
| 2500 | + else if ($args->hashed_password) |
|
| 2501 | 2501 | { |
| 2502 | 2502 | $args->password = $args->hashed_password; |
| 2503 | 2503 | } |
| 2504 | 2504 | |
| 2505 | 2505 | $output = executeQuery('member.updateMemberPassword', $args); |
| 2506 | - if($output->toBool()) |
|
| 2506 | + if ($output->toBool()) |
|
| 2507 | 2507 | { |
| 2508 | 2508 | $result = executeQuery('member.updateChangePasswordDate', $args); |
| 2509 | 2509 | } |
@@ -2515,7 +2515,7 @@ discard block |
||
| 2515 | 2515 | |
| 2516 | 2516 | function updateFindAccountAnswer($member_srl, $answer) |
| 2517 | 2517 | { |
| 2518 | - $oPassword = new Password(); |
|
| 2518 | + $oPassword = new Password(); |
|
| 2519 | 2519 | |
| 2520 | 2520 | $args = new stdClass(); |
| 2521 | 2521 | $args->member_srl = $member_srl; |
@@ -2532,18 +2532,18 @@ discard block |
||
| 2532 | 2532 | $trigger_obj = new stdClass(); |
| 2533 | 2533 | $trigger_obj->member_srl = $member_srl; |
| 2534 | 2534 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
| 2535 | - if(!$output->toBool()) return $output; |
|
| 2535 | + if (!$output->toBool()) return $output; |
|
| 2536 | 2536 | // Create a model object |
| 2537 | 2537 | $oMemberModel = getModel('member'); |
| 2538 | 2538 | // Bringing the user's information |
| 2539 | - if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
| 2539 | + if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
| 2540 | 2540 | { |
| 2541 | 2541 | $columnList = array('member_srl', 'is_admin'); |
| 2542 | 2542 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 2543 | 2543 | } |
| 2544 | - if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 2544 | + if (!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 2545 | 2545 | // If managers can not be deleted |
| 2546 | - if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
| 2546 | + if ($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
| 2547 | 2547 | |
| 2548 | 2548 | $oDB = &DB::getInstance(); |
| 2549 | 2549 | $oDB->begin(); |
@@ -2552,7 +2552,7 @@ discard block |
||
| 2552 | 2552 | $args->member_srl = $member_srl; |
| 2553 | 2553 | // Delete the entries in member_auth_mail |
| 2554 | 2554 | $output = executeQuery('member.deleteAuthMail', $args); |
| 2555 | - if(!$output->toBool()) |
|
| 2555 | + if (!$output->toBool()) |
|
| 2556 | 2556 | { |
| 2557 | 2557 | $oDB->rollback(); |
| 2558 | 2558 | return $output; |
@@ -2567,23 +2567,23 @@ discard block |
||
| 2567 | 2567 | */ |
| 2568 | 2568 | // Delete the entries in member_group_member |
| 2569 | 2569 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
| 2570 | - if(!$output->toBool()) |
|
| 2570 | + if (!$output->toBool()) |
|
| 2571 | 2571 | { |
| 2572 | 2572 | $oDB->rollback(); |
| 2573 | 2573 | return $output; |
| 2574 | 2574 | } |
| 2575 | 2575 | // member removed from the table |
| 2576 | 2576 | $output = executeQuery('member.deleteMember', $args); |
| 2577 | - if(!$output->toBool()) |
|
| 2577 | + if (!$output->toBool()) |
|
| 2578 | 2578 | { |
| 2579 | 2579 | $oDB->rollback(); |
| 2580 | 2580 | return $output; |
| 2581 | 2581 | } |
| 2582 | 2582 | // Call a trigger (after) |
| 2583 | - if($output->toBool()) |
|
| 2583 | + if ($output->toBool()) |
|
| 2584 | 2584 | { |
| 2585 | 2585 | $trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj); |
| 2586 | - if(!$trigger_output->toBool()) |
|
| 2586 | + if (!$trigger_output->toBool()) |
|
| 2587 | 2587 | { |
| 2588 | 2588 | $oDB->rollback(); |
| 2589 | 2589 | return $trigger_output; |
@@ -2607,12 +2607,12 @@ discard block |
||
| 2607 | 2607 | */ |
| 2608 | 2608 | function destroySessionInfo() |
| 2609 | 2609 | { |
| 2610 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
| 2610 | + if (!$_SESSION || !is_array($_SESSION)) return; |
|
| 2611 | 2611 | |
| 2612 | 2612 | $memberInfo = Context::get('logged_info'); |
| 2613 | 2613 | $memberSrl = $memberInfo->member_srl; |
| 2614 | 2614 | |
| 2615 | - foreach($_SESSION as $key => $val) |
|
| 2615 | + foreach ($_SESSION as $key => $val) |
|
| 2616 | 2616 | { |
| 2617 | 2617 | $_SESSION[$key] = ''; |
| 2618 | 2618 | } |
@@ -2623,7 +2623,7 @@ discard block |
||
| 2623 | 2623 | saveCookie('xeak'); |
| 2624 | 2624 | saveCookie('xe_logged', 'false'); |
| 2625 | 2625 | |
| 2626 | - if($memberSrl || $_COOKIE['xeak']) |
|
| 2626 | + if ($memberSrl || $_COOKIE['xeak']) |
|
| 2627 | 2627 | { |
| 2628 | 2628 | $args = new stdClass(); |
| 2629 | 2629 | $args->member_srl = $memberSrl; |
@@ -2639,22 +2639,22 @@ discard block |
||
| 2639 | 2639 | $pointGroup = $pointModuleConfig->point_group; |
| 2640 | 2640 | |
| 2641 | 2641 | $levelGroup = array(); |
| 2642 | - if(is_array($pointGroup) && count($pointGroup)>0) |
|
| 2642 | + if (is_array($pointGroup) && count($pointGroup) > 0) |
|
| 2643 | 2643 | { |
| 2644 | 2644 | $levelGroup = array_flip($pointGroup); |
| 2645 | 2645 | ksort($levelGroup); |
| 2646 | 2646 | } |
| 2647 | 2647 | $maxLevel = 0; |
| 2648 | 2648 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
| 2649 | - if(count($resultGroup) > 0) |
|
| 2649 | + if (count($resultGroup) > 0) |
|
| 2650 | 2650 | $maxLevel = max(array_flip($resultGroup)); |
| 2651 | 2651 | |
| 2652 | - if($maxLevel > 0) |
|
| 2652 | + if ($maxLevel > 0) |
|
| 2653 | 2653 | { |
| 2654 | 2654 | $oPointModel = getModel('point'); |
| 2655 | 2655 | $originPoint = $oPointModel->getPoint($memberSrl); |
| 2656 | 2656 | |
| 2657 | - if($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
| 2657 | + if ($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
| 2658 | 2658 | { |
| 2659 | 2659 | $oPointController = getController('point'); |
| 2660 | 2660 | $oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update'); |
@@ -2664,18 +2664,18 @@ discard block |
||
| 2664 | 2664 | |
| 2665 | 2665 | function procMemberModifyEmailAddress() |
| 2666 | 2666 | { |
| 2667 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 2667 | + if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 2668 | 2668 | |
| 2669 | 2669 | $member_info = Context::get('logged_info'); |
| 2670 | 2670 | $newEmail = Context::get('email_address'); |
| 2671 | 2671 | |
| 2672 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
| 2672 | + if (!$newEmail) return $this->stop('msg_invalid_request'); |
|
| 2673 | 2673 | |
| 2674 | 2674 | $oMemberModel = getModel('member'); |
| 2675 | 2675 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
| 2676 | - if($member_srl) return new BaseObject(-1,'msg_exists_email_address'); |
|
| 2676 | + if ($member_srl) return new BaseObject(-1, 'msg_exists_email_address'); |
|
| 2677 | 2677 | |
| 2678 | - if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
| 2678 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
| 2679 | 2679 | { |
| 2680 | 2680 | return $this->stop('msg_invalid_request'); |
| 2681 | 2681 | } |
@@ -2691,7 +2691,7 @@ discard block |
||
| 2691 | 2691 | $oDB = &DB::getInstance(); |
| 2692 | 2692 | $oDB->begin(); |
| 2693 | 2693 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 2694 | - if(!$output->toBool()) |
|
| 2694 | + if (!$output->toBool()) |
|
| 2695 | 2695 | { |
| 2696 | 2696 | $oDB->rollback(); |
| 2697 | 2697 | return $output; |
@@ -2701,7 +2701,7 @@ discard block |
||
| 2701 | 2701 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 2702 | 2702 | |
| 2703 | 2703 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 2704 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 2704 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 2705 | 2705 | |
| 2706 | 2706 | global $lang; |
| 2707 | 2707 | |
@@ -2713,17 +2713,17 @@ discard block |
||
| 2713 | 2713 | |
| 2714 | 2714 | Context::set('newEmail', $newEmail); |
| 2715 | 2715 | |
| 2716 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
|
| 2716 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key); |
|
| 2717 | 2717 | Context::set('auth_url', $auth_url); |
| 2718 | 2718 | |
| 2719 | 2719 | $oTemplate = &TemplateHandler::getInstance(); |
| 2720 | 2720 | $content = $oTemplate->compile($tpl_path, 'confirm_member_new_email'); |
| 2721 | 2721 | |
| 2722 | 2722 | $oMail = new Mail(); |
| 2723 | - $oMail->setTitle( Context::getLang('title_modify_email_address') ); |
|
| 2723 | + $oMail->setTitle(Context::getLang('title_modify_email_address')); |
|
| 2724 | 2724 | $oMail->setContent($content); |
| 2725 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 2726 | - $oMail->setReceiptor( $member_info->nick_name, $newEmail ); |
|
| 2725 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 2726 | + $oMail->setReceiptor($member_info->nick_name, $newEmail); |
|
| 2727 | 2727 | $result = $oMail->send(); |
| 2728 | 2728 | |
| 2729 | 2729 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail); |
@@ -2737,16 +2737,16 @@ discard block |
||
| 2737 | 2737 | { |
| 2738 | 2738 | $member_srl = Context::get('member_srl'); |
| 2739 | 2739 | $auth_key = Context::get('auth_key'); |
| 2740 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
| 2740 | + if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
| 2741 | 2741 | |
| 2742 | 2742 | // Test logs for finding password by user_id and authkey |
| 2743 | 2743 | $args = new stdClass; |
| 2744 | 2744 | $args->member_srl = $member_srl; |
| 2745 | 2745 | $args->auth_key = $auth_key; |
| 2746 | 2746 | $output = executeQuery('member.getAuthMail', $args); |
| 2747 | - if(!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 2747 | + if (!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 2748 | 2748 | { |
| 2749 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 2749 | + if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 2750 | 2750 | return $this->stop('msg_invalid_modify_email_auth_key'); |
| 2751 | 2751 | } |
| 2752 | 2752 | |
@@ -2755,10 +2755,10 @@ discard block |
||
| 2755 | 2755 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
| 2756 | 2756 | |
| 2757 | 2757 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
| 2758 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
| 2758 | + if (!$output->toBool()) return $this->stop($output->getMessage()); |
|
| 2759 | 2759 | |
| 2760 | 2760 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
| 2761 | - executeQuery('member.deleteAuthChangeEmailAddress',$args); |
|
| 2761 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 2762 | 2762 | |
| 2763 | 2763 | $this->_clearMemberCache($args->member_srl); |
| 2764 | 2764 | |
@@ -2776,7 +2776,7 @@ discard block |
||
| 2776 | 2776 | **/ |
| 2777 | 2777 | function triggerGetDocumentMenu(&$menu_list) |
| 2778 | 2778 | { |
| 2779 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
| 2779 | + if (!Context::get('is_logged')) return new BaseObject(); |
|
| 2780 | 2780 | |
| 2781 | 2781 | $logged_info = Context::get('logged_info'); |
| 2782 | 2782 | $document_srl = Context::get('target_srl'); |
@@ -2787,12 +2787,12 @@ discard block |
||
| 2787 | 2787 | $member_srl = $oDocument->get('member_srl'); |
| 2788 | 2788 | $module_srl = $oDocument->get('module_srl'); |
| 2789 | 2789 | |
| 2790 | - if(!$member_srl) return new BaseObject(); |
|
| 2791 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
| 2790 | + if (!$member_srl) return new BaseObject(); |
|
| 2791 | + if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject(); |
|
| 2792 | 2792 | |
| 2793 | 2793 | $oDocumentController = getController('document'); |
| 2794 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
| 2795 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup'); |
|
| 2794 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
| 2795 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
| 2796 | 2796 | |
| 2797 | 2797 | return new BaseObject(); |
| 2798 | 2798 | } |
@@ -2806,7 +2806,7 @@ discard block |
||
| 2806 | 2806 | **/ |
| 2807 | 2807 | function triggerGetCommentMenu(&$menu_list) |
| 2808 | 2808 | { |
| 2809 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
| 2809 | + if (!Context::get('is_logged')) return new BaseObject(); |
|
| 2810 | 2810 | |
| 2811 | 2811 | $logged_info = Context::get('logged_info'); |
| 2812 | 2812 | $comment_srl = Context::get('target_srl'); |
@@ -2817,12 +2817,12 @@ discard block |
||
| 2817 | 2817 | $module_srl = $oComment->get('module_srl'); |
| 2818 | 2818 | $member_srl = $oComment->get('member_srl'); |
| 2819 | 2819 | |
| 2820 | - if(!$member_srl) return new BaseObject(); |
|
| 2821 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
| 2820 | + if (!$member_srl) return new BaseObject(); |
|
| 2821 | + if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject(); |
|
| 2822 | 2822 | |
| 2823 | 2823 | $oCommentController = getController('comment'); |
| 2824 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
| 2825 | - $oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup'); |
|
| 2824 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
| 2825 | + $oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
| 2826 | 2826 | |
| 2827 | 2827 | return new BaseObject(); |
| 2828 | 2828 | } |
@@ -2834,7 +2834,7 @@ discard block |
||
| 2834 | 2834 | **/ |
| 2835 | 2835 | function procMemberSpammerManage() |
| 2836 | 2836 | { |
| 2837 | - if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted'); |
|
| 2837 | + if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted'); |
|
| 2838 | 2838 | |
| 2839 | 2839 | $logged_info = Context::get('logged_info'); |
| 2840 | 2840 | $member_srl = Context::get('member_srl'); |
@@ -2842,7 +2842,7 @@ discard block |
||
| 2842 | 2842 | $cnt_loop = Context::get('cnt_loop'); |
| 2843 | 2843 | $proc_type = Context::get('proc_type'); |
| 2844 | 2844 | $isMoveToTrash = true; |
| 2845 | - if($proc_type == "delete") |
|
| 2845 | + if ($proc_type == "delete") |
|
| 2846 | 2846 | $isMoveToTrash = false; |
| 2847 | 2847 | |
| 2848 | 2848 | // check grant |
@@ -2851,7 +2851,7 @@ discard block |
||
| 2851 | 2851 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
| 2852 | 2852 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
| 2853 | 2853 | |
| 2854 | - if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted'); |
|
| 2854 | + if (!$grant->manager) return new BaseObject(-1, 'msg_not_permitted'); |
|
| 2855 | 2855 | |
| 2856 | 2856 | $proc_msg = ""; |
| 2857 | 2857 | |
@@ -2860,10 +2860,10 @@ discard block |
||
| 2860 | 2860 | |
| 2861 | 2861 | // delete or trash destination |
| 2862 | 2862 | // proc member |
| 2863 | - if($cnt_loop == 1) |
|
| 2863 | + if ($cnt_loop == 1) |
|
| 2864 | 2864 | $this->_spammerMember($member_srl); |
| 2865 | 2865 | // proc document and comment |
| 2866 | - elseif($cnt_loop>1) |
|
| 2866 | + elseif ($cnt_loop > 1) |
|
| 2867 | 2867 | $this->_spammerDocuments($member_srl, $isMoveToTrash); |
| 2868 | 2868 | |
| 2869 | 2869 | // get destination count |
@@ -2872,11 +2872,11 @@ discard block |
||
| 2872 | 2872 | |
| 2873 | 2873 | $total_count = Context::get('total_count'); |
| 2874 | 2874 | $remain_count = $cnt_document + $cnt_comment; |
| 2875 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
| 2875 | + if ($cnt_loop == 1) $total_count = $remain_count; |
|
| 2876 | 2876 | |
| 2877 | 2877 | // get progress percent |
| 2878 | - if($total_count > 0) |
|
| 2879 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
| 2878 | + if ($total_count > 0) |
|
| 2879 | + $progress = intval((($total_count - $remain_count) / $total_count) * 100); |
|
| 2880 | 2880 | else |
| 2881 | 2881 | $progress = 100; |
| 2882 | 2882 | |
@@ -2900,7 +2900,7 @@ discard block |
||
| 2900 | 2900 | **/ |
| 2901 | 2901 | private function _spammerMember($member_srl) { |
| 2902 | 2902 | $logged_info = Context::get('logged_info'); |
| 2903 | - $spam_description = trim( Context::get('spam_description') ); |
|
| 2903 | + $spam_description = trim(Context::get('spam_description')); |
|
| 2904 | 2904 | |
| 2905 | 2905 | $oMemberModel = getModel('member'); |
| 2906 | 2906 | $columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description'); |
@@ -2919,10 +2919,10 @@ discard block |
||
| 2919 | 2919 | $args->user_id = $member_info->user_id; |
| 2920 | 2920 | $args->nick_name = $member_info->nick_name; |
| 2921 | 2921 | $args->denied = "Y"; |
| 2922 | - $args->description = trim( $member_info->description ); |
|
| 2923 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
| 2922 | + $args->description = trim($member_info->description); |
|
| 2923 | + if ($args->description != "") $args->description .= "\n"; // add new line |
|
| 2924 | 2924 | |
| 2925 | - $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 . "]"; |
|
| 2925 | + $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."]"; |
|
| 2926 | 2926 | |
| 2927 | 2927 | $output = $this->updateMember($args, true); |
| 2928 | 2928 | |
@@ -2951,21 +2951,21 @@ discard block |
||
| 2951 | 2951 | // 1. proc comment, 2. proc document |
| 2952 | 2952 | $cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl); |
| 2953 | 2953 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
| 2954 | - if($cnt_comment > 0) |
|
| 2954 | + if ($cnt_comment > 0) |
|
| 2955 | 2955 | { |
| 2956 | 2956 | $columnList = array(); |
| 2957 | 2957 | $commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
| 2958 | - if($commentList) { |
|
| 2959 | - foreach($commentList as $v) { |
|
| 2958 | + if ($commentList) { |
|
| 2959 | + foreach ($commentList as $v) { |
|
| 2960 | 2960 | $oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash); |
| 2961 | 2961 | } |
| 2962 | 2962 | } |
| 2963 | - } elseif($cnt_document > 0) { |
|
| 2963 | + } elseif ($cnt_document > 0) { |
|
| 2964 | 2964 | $columnList = array(); |
| 2965 | 2965 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
| 2966 | - if($documentList) { |
|
| 2967 | - foreach($documentList as $v) { |
|
| 2968 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
| 2966 | + if ($documentList) { |
|
| 2967 | + foreach ($documentList as $v) { |
|
| 2968 | + if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
| 2969 | 2969 | else $oDocumentController->deleteDocument($v->document_srl); |
| 2970 | 2970 | } |
| 2971 | 2971 | } |
@@ -2977,24 +2977,24 @@ discard block |
||
| 2977 | 2977 | function _clearMemberCache($member_srl, $site_srl = 0) |
| 2978 | 2978 | { |
| 2979 | 2979 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
| 2980 | - if($oCacheHandler->isSupport()) |
|
| 2980 | + if ($oCacheHandler->isSupport()) |
|
| 2981 | 2981 | { |
| 2982 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl; |
|
| 2982 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl; |
|
| 2983 | 2983 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 2984 | 2984 | $oCacheHandler->delete($cache_key); |
| 2985 | 2985 | |
| 2986 | - if($site_srl !== 0) |
|
| 2986 | + if ($site_srl !== 0) |
|
| 2987 | 2987 | { |
| 2988 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0'; |
|
| 2988 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0'; |
|
| 2989 | 2989 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 2990 | 2990 | $oCacheHandler->delete($cache_key); |
| 2991 | 2991 | } |
| 2992 | 2992 | } |
| 2993 | 2993 | |
| 2994 | 2994 | $oCacheHandler = CacheHandler::getInstance('object'); |
| 2995 | - if($oCacheHandler->isSupport()) |
|
| 2995 | + if ($oCacheHandler->isSupport()) |
|
| 2996 | 2996 | { |
| 2997 | - $object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl; |
|
| 2997 | + $object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl; |
|
| 2998 | 2998 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 2999 | 2999 | $oCacheHandler->delete($cache_key); |
| 3000 | 3000 | } |
@@ -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 | savecookie('XE_REDIRECT_URL'); |
@@ -513,8 +578,7 @@ discard block |
||
| 513 | 578 | if(Context::get('success_return_url')) |
| 514 | 579 | { |
| 515 | 580 | $redirectUrl = Context::get('success_return_url'); |
| 516 | - } |
|
| 517 | - else |
|
| 581 | + } else |
|
| 518 | 582 | { |
| 519 | 583 | $redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
| 520 | 584 | } |
@@ -558,7 +622,9 @@ discard block |
||
| 558 | 622 | foreach($getVars as $val) |
| 559 | 623 | { |
| 560 | 624 | $args->{$val} = Context::get($val); |
| 561 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 625 | + if($val == 'birthday') { |
|
| 626 | + $args->birthday_ui = Context::get('birthday_ui'); |
|
| 627 | + } |
|
| 562 | 628 | if($val == 'find_account_answer' && !Context::get($val)) { |
| 563 | 629 | unset($args->{$val}); |
| 564 | 630 | } |
@@ -568,7 +634,9 @@ discard block |
||
| 568 | 634 | $logged_info = Context::get('logged_info'); |
| 569 | 635 | $args->member_srl = $logged_info->member_srl; |
| 570 | 636 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
| 571 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 637 | + if(!$args->birthday && $args->birthday_ui) { |
|
| 638 | + $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 639 | + } |
|
| 572 | 640 | |
| 573 | 641 | // Remove some unnecessary variables from all the vars |
| 574 | 642 | $all_args = Context::getRequestVars(); |
@@ -603,7 +671,9 @@ discard block |
||
| 603 | 671 | |
| 604 | 672 | // Execute insert or update depending on the value of member_srl |
| 605 | 673 | $output = $this->updateMember($args); |
| 606 | - if(!$output->toBool()) return $output; |
|
| 674 | + if(!$output->toBool()) { |
|
| 675 | + return $output; |
|
| 676 | + } |
|
| 607 | 677 | |
| 608 | 678 | $profile_image = $_FILES['profile_image']; |
| 609 | 679 | if(is_uploaded_file($profile_image['tmp_name'])) |
@@ -633,7 +703,9 @@ discard block |
||
| 633 | 703 | |
| 634 | 704 | // Call a trigger after successfully log-in (after) |
| 635 | 705 | $trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo); |
| 636 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 706 | + if(!$trigger_output->toBool()) { |
|
| 707 | + return $trigger_output; |
|
| 708 | + } |
|
| 637 | 709 | |
| 638 | 710 | $this->setSessionInfo(); |
| 639 | 711 | // Return result |
@@ -654,7 +726,9 @@ discard block |
||
| 654 | 726 | */ |
| 655 | 727 | function procMemberModifyPassword() |
| 656 | 728 | { |
| 657 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 729 | + if(!Context::get('is_logged')) { |
|
| 730 | + return $this->stop('msg_not_logged'); |
|
| 731 | + } |
|
| 658 | 732 | // Extract the necessary information in advance |
| 659 | 733 | $current_password = trim(Context::get('current_password')); |
| 660 | 734 | $password = trim(Context::get('password1')); |
@@ -668,17 +742,23 @@ discard block |
||
| 668 | 742 | |
| 669 | 743 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 670 | 744 | // Verify the cuttent password |
| 671 | - if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new BaseObject(-1, 'invalid_password'); |
|
| 745 | + if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) { |
|
| 746 | + return new BaseObject(-1, 'invalid_password'); |
|
| 747 | + } |
|
| 672 | 748 | |
| 673 | 749 | // Check if a new password is as same as the previous password |
| 674 | - if($current_password == $password) return new BaseObject(-1, 'invalid_new_password'); |
|
| 750 | + if($current_password == $password) { |
|
| 751 | + return new BaseObject(-1, 'invalid_new_password'); |
|
| 752 | + } |
|
| 675 | 753 | |
| 676 | 754 | // Execute insert or update depending on the value of member_srl |
| 677 | 755 | $args = new stdClass; |
| 678 | 756 | $args->member_srl = $member_srl; |
| 679 | 757 | $args->password = $password; |
| 680 | 758 | $output = $this->updateMemberPassword($args); |
| 681 | - if(!$output->toBool()) return $output; |
|
| 759 | + if(!$output->toBool()) { |
|
| 760 | + return $output; |
|
| 761 | + } |
|
| 682 | 762 | |
| 683 | 763 | $this->add('member_srl', $args->member_srl); |
| 684 | 764 | $this->setMessage('success_updated'); |
@@ -694,7 +774,9 @@ discard block |
||
| 694 | 774 | */ |
| 695 | 775 | function procMemberLeave() |
| 696 | 776 | { |
| 697 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 777 | + if(!Context::get('is_logged')) { |
|
| 778 | + return $this->stop('msg_not_logged'); |
|
| 779 | + } |
|
| 698 | 780 | // Extract the necessary information in advance |
| 699 | 781 | $password = trim(Context::get('password')); |
| 700 | 782 | // Get information of logged-in user |
@@ -710,10 +792,14 @@ discard block |
||
| 710 | 792 | $this->memberInfo->password = $memberInfo->password; |
| 711 | 793 | } |
| 712 | 794 | // Verify the cuttent password |
| 713 | - if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new BaseObject(-1, 'invalid_password'); |
|
| 795 | + if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) { |
|
| 796 | + return new BaseObject(-1, 'invalid_password'); |
|
| 797 | + } |
|
| 714 | 798 | |
| 715 | 799 | $output = $this->deleteMember($member_srl); |
| 716 | - if(!$output->toBool()) return $output; |
|
| 800 | + if(!$output->toBool()) { |
|
| 801 | + return $output; |
|
| 802 | + } |
|
| 717 | 803 | // Destroy all session information |
| 718 | 804 | $this->destroySessionInfo(); |
| 719 | 805 | // Return success message |
@@ -732,20 +818,30 @@ discard block |
||
| 732 | 818 | { |
| 733 | 819 | // Check if the file is successfully uploaded |
| 734 | 820 | $file = $_FILES['profile_image']; |
| 735 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 821 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
| 822 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
| 823 | + } |
|
| 736 | 824 | // Ignore if member_srl is invalid or doesn't exist. |
| 737 | 825 | $member_srl = Context::get('member_srl'); |
| 738 | - if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 826 | + if(!$member_srl) { |
|
| 827 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
| 828 | + } |
|
| 739 | 829 | |
| 740 | 830 | $logged_info = Context::get('logged_info'); |
| 741 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 831 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
| 832 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
| 833 | + } |
|
| 742 | 834 | // Return if member module is set not to use an image name or the user is not an administrator ; |
| 743 | 835 | $oMemberModel = getModel('member'); |
| 744 | 836 | $config = $oMemberModel->getMemberConfig(); |
| 745 | - if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image'); |
|
| 837 | + if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') { |
|
| 838 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
| 839 | + } |
|
| 746 | 840 | |
| 747 | 841 | $output = $this->insertProfileImage($member_srl, $file['tmp_name']); |
| 748 | - if(!$output->toBool()) return $output; |
|
| 842 | + if(!$output->toBool()) { |
|
| 843 | + return $output; |
|
| 844 | + } |
|
| 749 | 845 | |
| 750 | 846 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
| 751 | 847 | $this->setRedirectUrl($returnUrl); |
@@ -768,8 +864,9 @@ discard block |
||
| 768 | 864 | $max_filesize = $config->profile_image_max_filesize; |
| 769 | 865 | foreach($config->signupForm as $val) |
| 770 | 866 | { |
| 771 | - if($val->name == "profile_image") |
|
| 772 | - $allow_transparent = $val->allow_transparent_thumbnail == 'Y'; |
|
| 867 | + if($val->name == "profile_image") { |
|
| 868 | + $allow_transparent = $val->allow_transparent_thumbnail == 'Y'; |
|
| 869 | + } |
|
| 773 | 870 | } |
| 774 | 871 | |
| 775 | 872 | Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
@@ -777,10 +874,13 @@ discard block |
||
| 777 | 874 | // Get file information |
| 778 | 875 | FileHandler::clearStatCache($target_file); |
| 779 | 876 | list($width, $height, $type) = @getimagesize($target_file); |
| 780 | - if(IMAGETYPE_PNG == $type) $ext = 'png'; |
|
| 781 | - elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
| 782 | - elseif(IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
| 783 | - else |
|
| 877 | + if(IMAGETYPE_PNG == $type) { |
|
| 878 | + $ext = 'png'; |
|
| 879 | + } elseif(IMAGETYPE_JPEG == $type) { |
|
| 880 | + $ext = 'jpg'; |
|
| 881 | + } elseif(IMAGETYPE_GIF == $type) { |
|
| 882 | + $ext = 'gif'; |
|
| 883 | + } else |
|
| 784 | 884 | { |
| 785 | 885 | return $this->stop('msg_not_uploaded_profile_image'); |
| 786 | 886 | } |
@@ -811,8 +911,7 @@ discard block |
||
| 811 | 911 | FileHandler::removeFilesInDir($target_path); |
| 812 | 912 | FileHandler::moveFile($temp_filename, $target_filename); |
| 813 | 913 | FileHandler::clearStatCache($target_filename); |
| 814 | - } |
|
| 815 | - else |
|
| 914 | + } else |
|
| 816 | 915 | { |
| 817 | 916 | // 파일 용량 제한 |
| 818 | 917 | $filesize = filesize($target_file); |
@@ -841,20 +940,30 @@ discard block |
||
| 841 | 940 | { |
| 842 | 941 | // Check if the file is successfully uploaded |
| 843 | 942 | $file = $_FILES['image_name']; |
| 844 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
| 943 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
| 944 | + return $this->stop('msg_not_uploaded_image_name'); |
|
| 945 | + } |
|
| 845 | 946 | // Ignore if member_srl is invalid or doesn't exist. |
| 846 | 947 | $member_srl = Context::get('member_srl'); |
| 847 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 948 | + if(!$member_srl) { |
|
| 949 | + return $this->stop('msg_not_uploaded_image_name'); |
|
| 950 | + } |
|
| 848 | 951 | |
| 849 | 952 | $logged_info = Context::get('logged_info'); |
| 850 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 953 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
| 954 | + return $this->stop('msg_not_uploaded_image_name'); |
|
| 955 | + } |
|
| 851 | 956 | // Return if member module is set not to use an image name or the user is not an administrator ; |
| 852 | 957 | $oMemberModel = getModel('member'); |
| 853 | 958 | $config = $oMemberModel->getMemberConfig(); |
| 854 | - if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
| 959 | + if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') { |
|
| 960 | + return $this->stop('msg_not_uploaded_image_name'); |
|
| 961 | + } |
|
| 855 | 962 | |
| 856 | 963 | $output = $this->insertImageName($member_srl, $file['tmp_name']); |
| 857 | - if(!$output->toBool()) return $output; |
|
| 964 | + if(!$output->toBool()) { |
|
| 965 | + return $output; |
|
| 966 | + } |
|
| 858 | 967 | |
| 859 | 968 | // Page refresh |
| 860 | 969 | //$this->setRefreshPage(); |
@@ -909,8 +1018,7 @@ discard block |
||
| 909 | 1018 | FileHandler::removeFilesInDir($target_path); |
| 910 | 1019 | FileHandler::moveFile($temp_filename, $target_filename); |
| 911 | 1020 | FileHandler::clearStatCache($target_filename); |
| 912 | - } |
|
| 913 | - else |
|
| 1021 | + } else |
|
| 914 | 1022 | { |
| 915 | 1023 | // 파일 용량 제한 |
| 916 | 1024 | $filesize = filesize($target_file); |
@@ -987,20 +1095,30 @@ discard block |
||
| 987 | 1095 | { |
| 988 | 1096 | // Check if the file is successfully uploaded |
| 989 | 1097 | $file = $_FILES['image_mark']; |
| 990 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1098 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
| 1099 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1100 | + } |
|
| 991 | 1101 | // Ignore if member_srl is invalid or doesn't exist. |
| 992 | 1102 | $member_srl = Context::get('member_srl'); |
| 993 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1103 | + if(!$member_srl) { |
|
| 1104 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1105 | + } |
|
| 994 | 1106 | |
| 995 | 1107 | $logged_info = Context::get('logged_info'); |
| 996 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1108 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
| 1109 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1110 | + } |
|
| 997 | 1111 | // Membership in the images mark the module using the ban was set by an administrator or return; |
| 998 | 1112 | $oMemberModel = getModel('member'); |
| 999 | 1113 | $config = $oMemberModel->getMemberConfig(); |
| 1000 | - if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1114 | + if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') { |
|
| 1115 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1116 | + } |
|
| 1001 | 1117 | |
| 1002 | 1118 | $this->insertImageMark($member_srl, $file['tmp_name']); |
| 1003 | - if(!$output->toBool()) return $output; |
|
| 1119 | + if(!$output->toBool()) { |
|
| 1120 | + return $output; |
|
| 1121 | + } |
|
| 1004 | 1122 | |
| 1005 | 1123 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
| 1006 | 1124 | $this->setRedirectUrl($returnUrl); |
@@ -1051,8 +1169,7 @@ discard block |
||
| 1051 | 1169 | FileHandler::removeFilesInDir($target_path); |
| 1052 | 1170 | FileHandler::moveFile($temp_filename, $target_filename); |
| 1053 | 1171 | FileHandler::clearStatCache($target_filename); |
| 1054 | - } |
|
| 1055 | - else |
|
| 1172 | + } else |
|
| 1056 | 1173 | { |
| 1057 | 1174 | $filesize = filesize($target_file); |
| 1058 | 1175 | if($max_filesize && $filesize > ($max_filesize * 1024)) |
@@ -1104,14 +1221,18 @@ discard block |
||
| 1104 | 1221 | function procMemberFindAccount() |
| 1105 | 1222 | { |
| 1106 | 1223 | $email_address = Context::get('email_address'); |
| 1107 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1224 | + if(!$email_address) { |
|
| 1225 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1226 | + } |
|
| 1108 | 1227 | |
| 1109 | 1228 | $oMemberModel = getModel('member'); |
| 1110 | 1229 | $oModuleModel = getModel('module'); |
| 1111 | 1230 | |
| 1112 | 1231 | // Check if a member having the same email address exists |
| 1113 | 1232 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1114 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1233 | + if(!$member_srl) { |
|
| 1234 | + return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1235 | + } |
|
| 1115 | 1236 | |
| 1116 | 1237 | // Get information of the member |
| 1117 | 1238 | $columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name'); |
@@ -1123,7 +1244,9 @@ discard block |
||
| 1123 | 1244 | $chk_args = new stdClass; |
| 1124 | 1245 | $chk_args->member_srl = $member_info->member_srl; |
| 1125 | 1246 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1126 | - if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
| 1247 | + if($output->toBool() && $output->data->count != '0') { |
|
| 1248 | + return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
| 1249 | + } |
|
| 1127 | 1250 | } |
| 1128 | 1251 | |
| 1129 | 1252 | // Insert data into the authentication DB |
@@ -1136,7 +1259,9 @@ discard block |
||
| 1136 | 1259 | $args->is_register = 'N'; |
| 1137 | 1260 | |
| 1138 | 1261 | $output = executeQuery('member.insertAuthMail', $args); |
| 1139 | - if(!$output->toBool()) return $output; |
|
| 1262 | + if(!$output->toBool()) { |
|
| 1263 | + return $output; |
|
| 1264 | + } |
|
| 1140 | 1265 | // Get content of the email to send a member |
| 1141 | 1266 | Context::set('auth_args', $args); |
| 1142 | 1267 | |
@@ -1153,8 +1278,7 @@ discard block |
||
| 1153 | 1278 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1154 | 1279 | } |
| 1155 | 1280 | } |
| 1156 | - } |
|
| 1157 | - else |
|
| 1281 | + } else |
|
| 1158 | 1282 | { |
| 1159 | 1283 | $memberInfo[$lang->user_id] = $args->user_id; |
| 1160 | 1284 | $memberInfo[$lang->user_name] = $args->user_name; |
@@ -1163,13 +1287,19 @@ discard block |
||
| 1163 | 1287 | } |
| 1164 | 1288 | Context::set('memberInfo', $memberInfo); |
| 1165 | 1289 | |
| 1166 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1167 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1290 | + if(!$member_config->skin) { |
|
| 1291 | + $member_config->skin = "default"; |
|
| 1292 | + } |
|
| 1293 | + if(!$member_config->colorset) { |
|
| 1294 | + $member_config->colorset = "white"; |
|
| 1295 | + } |
|
| 1168 | 1296 | |
| 1169 | 1297 | Context::set('member_config', $member_config); |
| 1170 | 1298 | |
| 1171 | 1299 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1172 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1300 | + if(!is_dir($tpl_path)) { |
|
| 1301 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1302 | + } |
|
| 1173 | 1303 | |
| 1174 | 1304 | $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
| 1175 | 1305 | Context::set('find_url', $find_url); |
@@ -1212,19 +1342,25 @@ discard block |
||
| 1212 | 1342 | $find_account_question = trim(Context::get('find_account_question')); |
| 1213 | 1343 | $find_account_answer = trim(Context::get('find_account_answer')); |
| 1214 | 1344 | |
| 1215 | - if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1345 | + if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) { |
|
| 1346 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1347 | + } |
|
| 1216 | 1348 | |
| 1217 | 1349 | $oModuleModel = getModel('module'); |
| 1218 | 1350 | // Check if a member having the same email address exists |
| 1219 | 1351 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1220 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1352 | + if(!$member_srl) { |
|
| 1353 | + return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1354 | + } |
|
| 1221 | 1355 | |
| 1222 | 1356 | // Get information of the member |
| 1223 | 1357 | $columnList = array('member_srl', 'find_account_question', 'find_account_answer'); |
| 1224 | 1358 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 1225 | 1359 | |
| 1226 | 1360 | // Display a message if no answer is entered |
| 1227 | - if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
| 1361 | + if(!$member_info->find_account_question || !$member_info->find_account_answer) { |
|
| 1362 | + return new BaseObject(-1, 'msg_question_not_exists'); |
|
| 1363 | + } |
|
| 1228 | 1364 | |
| 1229 | 1365 | // 답변 확인 |
| 1230 | 1366 | $hashed = $oPassword->checkAlgorithm($member_info->find_account_answer); |
@@ -1233,12 +1369,10 @@ discard block |
||
| 1233 | 1369 | if($member_info->find_account_question != $find_account_question) |
| 1234 | 1370 | { |
| 1235 | 1371 | $authed = false; |
| 1236 | - } |
|
| 1237 | - else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
| 1372 | + } else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
| 1238 | 1373 | { |
| 1239 | 1374 | $authed = false; |
| 1240 | - } |
|
| 1241 | - else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
| 1375 | + } else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
| 1242 | 1376 | { |
| 1243 | 1377 | $authed = false; |
| 1244 | 1378 | } |
@@ -1267,7 +1401,9 @@ discard block |
||
| 1267 | 1401 | $args->password = $temp_password; |
| 1268 | 1402 | $args->change_password_date = '1'; |
| 1269 | 1403 | $output = $this->updateMemberPassword($args); |
| 1270 | - if(!$output->toBool()) return $output; |
|
| 1404 | + if(!$output->toBool()) { |
|
| 1405 | + return $output; |
|
| 1406 | + } |
|
| 1271 | 1407 | |
| 1272 | 1408 | $_SESSION['xe_temp_password_' . $user_id] = $temp_password; |
| 1273 | 1409 | |
@@ -1324,8 +1460,7 @@ discard block |
||
| 1324 | 1460 | if($output->data->is_register == 'Y') |
| 1325 | 1461 | { |
| 1326 | 1462 | $args->denied = 'N'; |
| 1327 | - } |
|
| 1328 | - else |
|
| 1463 | + } else |
|
| 1329 | 1464 | { |
| 1330 | 1465 | $args->password = $oMemberModel->hashPassword($args->password); |
| 1331 | 1466 | } |
@@ -1359,33 +1494,45 @@ discard block |
||
| 1359 | 1494 | { |
| 1360 | 1495 | // Get an email_address |
| 1361 | 1496 | $email_address = Context::get('email_address'); |
| 1362 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1497 | + if(!$email_address) { |
|
| 1498 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1499 | + } |
|
| 1363 | 1500 | // Log test by using email_address |
| 1364 | 1501 | $oMemberModel = getModel('member'); |
| 1365 | 1502 | |
| 1366 | 1503 | $args = new stdClass; |
| 1367 | 1504 | $args->email_address = $email_address; |
| 1368 | 1505 | $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1369 | - if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 1506 | + if(!$memberSrl) { |
|
| 1507 | + return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 1508 | + } |
|
| 1370 | 1509 | |
| 1371 | 1510 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address'); |
| 1372 | 1511 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList); |
| 1373 | 1512 | |
| 1374 | 1513 | $oModuleModel = getModel('module'); |
| 1375 | 1514 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1376 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1377 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1515 | + if(!$member_config->skin) { |
|
| 1516 | + $member_config->skin = "default"; |
|
| 1517 | + } |
|
| 1518 | + if(!$member_config->colorset) { |
|
| 1519 | + $member_config->colorset = "white"; |
|
| 1520 | + } |
|
| 1378 | 1521 | |
| 1379 | 1522 | // Check if a authentication mail has been sent previously |
| 1380 | 1523 | $chk_args = new stdClass; |
| 1381 | 1524 | $chk_args->member_srl = $member_info->member_srl; |
| 1382 | 1525 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1383 | - if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1526 | + if($output->toBool() && $output->data->count == '0') { |
|
| 1527 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1528 | + } |
|
| 1384 | 1529 | |
| 1385 | 1530 | $auth_args = new stdClass; |
| 1386 | 1531 | $auth_args->member_srl = $member_info->member_srl; |
| 1387 | 1532 | $output = executeQueryArray('member.getAuthMailInfo', $auth_args); |
| 1388 | - if(!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1533 | + if(!$output->data || !$output->data[0]->auth_key) { |
|
| 1534 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1535 | + } |
|
| 1389 | 1536 | $auth_info = $output->data[0]; |
| 1390 | 1537 | |
| 1391 | 1538 | // Update the regdate of authmail entry |
@@ -1406,8 +1553,7 @@ discard block |
||
| 1406 | 1553 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1407 | 1554 | } |
| 1408 | 1555 | } |
| 1409 | - } |
|
| 1410 | - else |
|
| 1556 | + } else |
|
| 1411 | 1557 | { |
| 1412 | 1558 | $memberInfo[$lang->user_id] = $member_info->user_id; |
| 1413 | 1559 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1420,7 +1566,9 @@ discard block |
||
| 1420 | 1566 | Context::set('member_config', $member_config); |
| 1421 | 1567 | |
| 1422 | 1568 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1423 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1569 | + if(!is_dir($tpl_path)) { |
|
| 1570 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1571 | + } |
|
| 1424 | 1572 | |
| 1425 | 1573 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); |
| 1426 | 1574 | Context::set('auth_url', $auth_url); |
@@ -1498,7 +1646,9 @@ discard block |
||
| 1498 | 1646 | $auth_args->is_register = 'Y'; |
| 1499 | 1647 | |
| 1500 | 1648 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 1501 | - if(!$output->toBool()) return $output; |
|
| 1649 | + if(!$output->toBool()) { |
|
| 1650 | + return $output; |
|
| 1651 | + } |
|
| 1502 | 1652 | |
| 1503 | 1653 | $memberInfo->email_address = $newEmail; |
| 1504 | 1654 | |
@@ -1532,8 +1682,7 @@ discard block |
||
| 1532 | 1682 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1533 | 1683 | } |
| 1534 | 1684 | } |
| 1535 | - } |
|
| 1536 | - else |
|
| 1685 | + } else |
|
| 1537 | 1686 | { |
| 1538 | 1687 | $memberInfo[$lang->user_id] = $member_info->user_id; |
| 1539 | 1688 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1542,13 +1691,19 @@ discard block |
||
| 1542 | 1691 | } |
| 1543 | 1692 | Context::set('memberInfo', $memberInfo); |
| 1544 | 1693 | |
| 1545 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1546 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1694 | + if(!$member_config->skin) { |
|
| 1695 | + $member_config->skin = "default"; |
|
| 1696 | + } |
|
| 1697 | + if(!$member_config->colorset) { |
|
| 1698 | + $member_config->colorset = "white"; |
|
| 1699 | + } |
|
| 1547 | 1700 | |
| 1548 | 1701 | Context::set('member_config', $member_config); |
| 1549 | 1702 | |
| 1550 | 1703 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1551 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1704 | + if(!is_dir($tpl_path)) { |
|
| 1705 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1706 | + } |
|
| 1552 | 1707 | |
| 1553 | 1708 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
| 1554 | 1709 | Context::set('auth_url', $auth_url); |
@@ -1573,7 +1728,9 @@ discard block |
||
| 1573 | 1728 | { |
| 1574 | 1729 | $site_module_info = Context::get('site_module_info'); |
| 1575 | 1730 | $logged_info = Context::get('logged_info'); |
| 1576 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
| 1731 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
| 1732 | + return new BaseObject(-1,'msg_invalid_request'); |
|
| 1733 | + } |
|
| 1577 | 1734 | |
| 1578 | 1735 | $oMemberModel = getModel('member'); |
| 1579 | 1736 | $columnList = array('site_srl', 'group_srl', 'title'); |
@@ -1592,13 +1749,17 @@ discard block |
||
| 1592 | 1749 | { |
| 1593 | 1750 | $site_module_info = Context::get('site_module_info'); |
| 1594 | 1751 | $logged_info = Context::get('logged_info'); |
| 1595 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
| 1752 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
| 1753 | + return new BaseObject(-1,'msg_invalid_request'); |
|
| 1754 | + } |
|
| 1596 | 1755 | |
| 1597 | 1756 | $args = new stdClass; |
| 1598 | 1757 | $args->site_srl= $site_module_info->site_srl; |
| 1599 | 1758 | $args->member_srl = $logged_info->member_srl; |
| 1600 | 1759 | $output = executeQuery('member.deleteMembersGroup', $args); |
| 1601 | - if(!$output->toBool()) return $output; |
|
| 1760 | + if(!$output->toBool()) { |
|
| 1761 | + return $output; |
|
| 1762 | + } |
|
| 1602 | 1763 | $this->setMessage('success_deleted'); |
| 1603 | 1764 | $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl); |
| 1604 | 1765 | } |
@@ -1612,16 +1773,36 @@ discard block |
||
| 1612 | 1773 | */ |
| 1613 | 1774 | function setMemberConfig($args) |
| 1614 | 1775 | { |
| 1615 | - if(!$args->skin) $args->skin = "default"; |
|
| 1616 | - if(!$args->colorset) $args->colorset = "white"; |
|
| 1617 | - if(!$args->editor_skin) $args->editor_skin= "ckeditor"; |
|
| 1618 | - if(!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
| 1619 | - if($args->enable_join!='Y') $args->enable_join = 'N'; |
|
| 1620 | - if($args->profile_image !='Y') $args->profile_image = 'N'; |
|
| 1621 | - if($args->image_name!='Y') $args->image_name = 'N'; |
|
| 1622 | - if($args->image_mark!='Y') $args->image_mark = 'N'; |
|
| 1623 | - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; |
|
| 1624 | - if(!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
| 1776 | + if(!$args->skin) { |
|
| 1777 | + $args->skin = "default"; |
|
| 1778 | + } |
|
| 1779 | + if(!$args->colorset) { |
|
| 1780 | + $args->colorset = "white"; |
|
| 1781 | + } |
|
| 1782 | + if(!$args->editor_skin) { |
|
| 1783 | + $args->editor_skin= "ckeditor"; |
|
| 1784 | + } |
|
| 1785 | + if(!$args->editor_colorset) { |
|
| 1786 | + $args->editor_colorset = "moono"; |
|
| 1787 | + } |
|
| 1788 | + if($args->enable_join!='Y') { |
|
| 1789 | + $args->enable_join = 'N'; |
|
| 1790 | + } |
|
| 1791 | + if($args->profile_image !='Y') { |
|
| 1792 | + $args->profile_image = 'N'; |
|
| 1793 | + } |
|
| 1794 | + if($args->image_name!='Y') { |
|
| 1795 | + $args->image_name = 'N'; |
|
| 1796 | + } |
|
| 1797 | + if($args->image_mark!='Y') { |
|
| 1798 | + $args->image_mark = 'N'; |
|
| 1799 | + } |
|
| 1800 | + if($args->group_image_mark!='Y') { |
|
| 1801 | + $args->group_image_mark = 'N'; |
|
| 1802 | + } |
|
| 1803 | + if(!trim(strip_tags($args->agreement))) { |
|
| 1804 | + $args->agreement = null; |
|
| 1805 | + } |
|
| 1625 | 1806 | $args->limit_day = (int)$args->limit_day; |
| 1626 | 1807 | |
| 1627 | 1808 | $agreement = trim($args->agreement); |
@@ -1629,7 +1810,9 @@ discard block |
||
| 1629 | 1810 | |
| 1630 | 1811 | $oModuleController = getController('module'); |
| 1631 | 1812 | $output = $oModuleController->insertModuleConfig('member',$args); |
| 1632 | - if(!$output->toBool()) return $output; |
|
| 1813 | + if(!$output->toBool()) { |
|
| 1814 | + return $output; |
|
| 1815 | + } |
|
| 1633 | 1816 | |
| 1634 | 1817 | $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
| 1635 | 1818 | FileHandler::writeFile($agreement_file, $agreement); |
@@ -1654,7 +1837,9 @@ discard block |
||
| 1654 | 1837 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
| 1655 | 1838 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
| 1656 | 1839 | |
| 1657 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
| 1840 | + if(!$check_signature) { |
|
| 1841 | + return FileHandler::removeFile($filename); |
|
| 1842 | + } |
|
| 1658 | 1843 | |
| 1659 | 1844 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
| 1660 | 1845 | FileHandler::makeDir($path); |
@@ -1688,7 +1873,9 @@ discard block |
||
| 1688 | 1873 | $args = new stdClass(); |
| 1689 | 1874 | $args->member_srl = $member_srl; |
| 1690 | 1875 | $args->group_srl = $group_srl; |
| 1691 | - if($site_srl) $args->site_srl = $site_srl; |
|
| 1876 | + if($site_srl) { |
|
| 1877 | + $args->site_srl = $site_srl; |
|
| 1878 | + } |
|
| 1692 | 1879 | |
| 1693 | 1880 | // Add |
| 1694 | 1881 | $output = executeQuery('member.addMemberToGroup',$args); |
@@ -1714,15 +1901,21 @@ discard block |
||
| 1714 | 1901 | $obj->member_srl = implode(',',$args->member_srl); |
| 1715 | 1902 | |
| 1716 | 1903 | $output = executeQueryArray('member.getMembersGroup', $obj); |
| 1717 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1904 | + if($output->data) { |
|
| 1905 | + foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1906 | + } |
|
| 1718 | 1907 | |
| 1719 | 1908 | $output = executeQuery('member.deleteMembersGroup', $obj); |
| 1720 | - if(!$output->toBool()) return $output; |
|
| 1909 | + if(!$output->toBool()) { |
|
| 1910 | + return $output; |
|
| 1911 | + } |
|
| 1721 | 1912 | |
| 1722 | 1913 | $inserted_members = array(); |
| 1723 | 1914 | foreach($args->member_srl as $key => $val) |
| 1724 | 1915 | { |
| 1725 | - if($inserted_members[$val]) continue; |
|
| 1916 | + if($inserted_members[$val]) { |
|
| 1917 | + continue; |
|
| 1918 | + } |
|
| 1726 | 1919 | $inserted_members[$val] = true; |
| 1727 | 1920 | |
| 1728 | 1921 | unset($obj); |
@@ -1732,7 +1925,9 @@ discard block |
||
| 1732 | 1925 | $obj->site_srl = $args->site_srl; |
| 1733 | 1926 | $obj->regdate = $date[$obj->member_srl]; |
| 1734 | 1927 | $output = executeQuery('member.addMemberToGroup', $obj); |
| 1735 | - if(!$output->toBool()) return $output; |
|
| 1928 | + if(!$output->toBool()) { |
|
| 1929 | + return $output; |
|
| 1930 | + } |
|
| 1736 | 1931 | |
| 1737 | 1932 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
| 1738 | 1933 | } |
@@ -1794,8 +1989,7 @@ discard block |
||
| 1794 | 1989 | if($config->identifier == 'user_id') |
| 1795 | 1990 | { |
| 1796 | 1991 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
| 1797 | - } |
|
| 1798 | - else |
|
| 1992 | + } else |
|
| 1799 | 1993 | { |
| 1800 | 1994 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
| 1801 | 1995 | } |
@@ -1804,8 +1998,7 @@ discard block |
||
| 1804 | 1998 | $do_auto_login = true; |
| 1805 | 1999 | } |
| 1806 | 2000 | |
| 1807 | - } |
|
| 1808 | - else |
|
| 2001 | + } else |
|
| 1809 | 2002 | { |
| 1810 | 2003 | $do_auto_login = true; |
| 1811 | 2004 | } |
@@ -1814,8 +2007,7 @@ discard block |
||
| 1814 | 2007 | if($do_auto_login) |
| 1815 | 2008 | { |
| 1816 | 2009 | $output = $this->doLogin($user_id); |
| 1817 | - } |
|
| 1818 | - else |
|
| 2010 | + } else |
|
| 1819 | 2011 | { |
| 1820 | 2012 | executeQuery('member.deleteAutologin', $args); |
| 1821 | 2013 | saveCookie('xeak'); |
@@ -1834,13 +2026,17 @@ discard block |
||
| 1834 | 2026 | function doLogin($user_id, $password = '', $keep_signed = false) |
| 1835 | 2027 | { |
| 1836 | 2028 | $user_id = strtolower($user_id); |
| 1837 | - if(!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
| 2029 | + if(!$user_id) { |
|
| 2030 | + return new BaseObject(-1, 'null_user_id'); |
|
| 2031 | + } |
|
| 1838 | 2032 | // Call a trigger before log-in (before) |
| 1839 | 2033 | $trigger_obj = new stdClass(); |
| 1840 | 2034 | $trigger_obj->user_id = $user_id; |
| 1841 | 2035 | $trigger_obj->password = $password; |
| 1842 | 2036 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
| 1843 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 2037 | + if(!$trigger_output->toBool()) { |
|
| 2038 | + return $trigger_output; |
|
| 2039 | + } |
|
| 1844 | 2040 | // Create a member model object |
| 1845 | 2041 | $oMemberModel = getModel('member'); |
| 1846 | 2042 | |
@@ -1855,15 +2051,18 @@ discard block |
||
| 1855 | 2051 | // Get user_id information |
| 1856 | 2052 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
| 1857 | 2053 | // Set an invalid user if no value returned |
| 1858 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 2054 | + if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) { |
|
| 2055 | + return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 2056 | + } |
|
| 1859 | 2057 | |
| 1860 | - } |
|
| 1861 | - else |
|
| 2058 | + } else |
|
| 1862 | 2059 | { |
| 1863 | 2060 | // Get user_id information |
| 1864 | 2061 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
| 1865 | 2062 | // Set an invalid user if no value returned |
| 1866 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 2063 | + if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) { |
|
| 2064 | + return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 2065 | + } |
|
| 1867 | 2066 | } |
| 1868 | 2067 | |
| 1869 | 2068 | $output = executeQuery('member.getLoginCountByIp', $args); |
@@ -1875,14 +2074,18 @@ discard block |
||
| 1875 | 2074 | if($term < $config->max_error_count_time) |
| 1876 | 2075 | { |
| 1877 | 2076 | $term = $config->max_error_count_time - $term; |
| 1878 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
| 1879 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
| 1880 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
| 1881 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
| 2077 | + if($term < 60) { |
|
| 2078 | + $term = intval($term).Context::getLang('unit_sec'); |
|
| 2079 | + } elseif(60 <= $term && $term < 3600) { |
|
| 2080 | + $term = intval($term/60).Context::getLang('unit_min'); |
|
| 2081 | + } elseif(3600 <= $term && $term < 86400) { |
|
| 2082 | + $term = intval($term/3600).Context::getLang('unit_hour'); |
|
| 2083 | + } else { |
|
| 2084 | + $term = intval($term/86400).Context::getLang('unit_day'); |
|
| 2085 | + } |
|
| 1882 | 2086 | |
| 1883 | 2087 | return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
| 1884 | - } |
|
| 1885 | - else |
|
| 2088 | + } else |
|
| 1886 | 2089 | { |
| 1887 | 2090 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
| 1888 | 2091 | $output = executeQuery('member.deleteLoginCountByIp', $args); |
@@ -1909,7 +2112,9 @@ discard block |
||
| 1909 | 2112 | return new BaseObject(-1,'msg_user_denied'); |
| 1910 | 2113 | } |
| 1911 | 2114 | // Notify if denied_date is less than the current time |
| 1912 | - 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"))); |
|
| 2115 | + if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) { |
|
| 2116 | + return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
| 2117 | + } |
|
| 1913 | 2118 | // Update the latest login time |
| 1914 | 2119 | $args->member_srl = $this->memberInfo->member_srl; |
| 1915 | 2120 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1958,7 +2163,9 @@ discard block |
||
| 1958 | 2163 | } |
| 1959 | 2164 | // Call a trigger after successfully log-in (after) |
| 1960 | 2165 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
| 1961 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 2166 | + if(!$trigger_output->toBool()) { |
|
| 2167 | + return $trigger_output; |
|
| 2168 | + } |
|
| 1962 | 2169 | // When user checked to use auto-login |
| 1963 | 2170 | if($keep_signed) |
| 1964 | 2171 | { |
@@ -1972,7 +2179,9 @@ discard block |
||
| 1972 | 2179 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
| 1973 | 2180 | executeQuery('member.deleteAutologin', $autologin_args); |
| 1974 | 2181 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
| 1975 | - if($autologin_output->toBool()) saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME']+31536000); |
|
| 2182 | + if($autologin_output->toBool()) { |
|
| 2183 | + saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME']+31536000); |
|
| 2184 | + } |
|
| 1976 | 2185 | } |
| 1977 | 2186 | if($this->memberInfo->is_admin == 'Y') |
| 1978 | 2187 | { |
@@ -2061,7 +2270,9 @@ discard block |
||
| 2061 | 2270 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
| 2062 | 2271 | { |
| 2063 | 2272 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
| 2064 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
| 2273 | + if(!is_array($member_popup_menu_list)) { |
|
| 2274 | + $member_popup_menu_list = array(); |
|
| 2275 | + } |
|
| 2065 | 2276 | |
| 2066 | 2277 | $obj = new stdClass; |
| 2067 | 2278 | $obj->url = $url; |
@@ -2080,35 +2291,54 @@ discard block |
||
| 2080 | 2291 | { |
| 2081 | 2292 | // Call a trigger (before) |
| 2082 | 2293 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
| 2083 | - if(!$output->toBool()) return $output; |
|
| 2294 | + if(!$output->toBool()) { |
|
| 2295 | + return $output; |
|
| 2296 | + } |
|
| 2084 | 2297 | // Terms and Conditions portion of the information set up by members reaffirmed |
| 2085 | 2298 | $oModuleModel = getModel('module'); |
| 2086 | 2299 | $config = $oModuleModel->getModuleConfig('member'); |
| 2087 | 2300 | |
| 2088 | 2301 | $logged_info = Context::get('logged_info'); |
| 2089 | 2302 | // If the date of the temporary restrictions limit further information on the date of |
| 2090 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
| 2303 | + if($config->limit_day) { |
|
| 2304 | + $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
| 2305 | + } |
|
| 2091 | 2306 | |
| 2092 | 2307 | $args->member_srl = getNextSequence(); |
| 2093 | 2308 | $args->list_order = -1 * $args->member_srl; |
| 2094 | 2309 | |
| 2095 | 2310 | // Execute insert or update depending on the value of member_srl |
| 2096 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2311 | + if(!$args->user_id) { |
|
| 2312 | + $args->user_id = 't'.$args->member_srl; |
|
| 2313 | + } |
|
| 2097 | 2314 | // Enter the user's identity changed to lowercase |
| 2098 | - else $args->user_id = strtolower($args->user_id); |
|
| 2099 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2100 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
| 2315 | + else { |
|
| 2316 | + $args->user_id = strtolower($args->user_id); |
|
| 2317 | + } |
|
| 2318 | + if(!$args->user_name) { |
|
| 2319 | + $args->user_name = $args->member_srl; |
|
| 2320 | + } |
|
| 2321 | + if(!$args->nick_name) { |
|
| 2322 | + $args->nick_name = $args->member_srl; |
|
| 2323 | + } |
|
| 2101 | 2324 | |
| 2102 | 2325 | // Control of essential parameters |
| 2103 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 2104 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 2105 | - if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y'; |
|
| 2326 | + if($args->allow_mailing!='Y') { |
|
| 2327 | + $args->allow_mailing = 'N'; |
|
| 2328 | + } |
|
| 2329 | + if($args->denied!='Y') { |
|
| 2330 | + $args->denied = 'N'; |
|
| 2331 | + } |
|
| 2332 | + if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) { |
|
| 2333 | + $args->allow_message = 'Y'; |
|
| 2334 | + } |
|
| 2106 | 2335 | |
| 2107 | 2336 | if($logged_info->is_admin == 'Y') |
| 2108 | 2337 | { |
| 2109 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
| 2110 | - } |
|
| 2111 | - else |
|
| 2338 | + if($args->is_admin!='Y') { |
|
| 2339 | + $args->is_admin = 'N'; |
|
| 2340 | + } |
|
| 2341 | + } else |
|
| 2112 | 2342 | { |
| 2113 | 2343 | unset($args->is_admin); |
| 2114 | 2344 | } |
@@ -2121,8 +2351,12 @@ discard block |
||
| 2121 | 2351 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2122 | 2352 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2123 | 2353 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2124 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2125 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2354 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) { |
|
| 2355 | + $args->homepage = 'http://'.$args->homepage; |
|
| 2356 | + } |
|
| 2357 | + if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) { |
|
| 2358 | + $args->blog = 'http://'.$args->blog; |
|
| 2359 | + } |
|
| 2126 | 2360 | |
| 2127 | 2361 | // Create a model object |
| 2128 | 2362 | $oMemberModel = getModel('member'); |
@@ -2136,8 +2370,7 @@ discard block |
||
| 2136 | 2370 | return new BaseObject(-1, $message[$config->password_strength]); |
| 2137 | 2371 | } |
| 2138 | 2372 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2139 | - } |
|
| 2140 | - elseif(!$args->password) |
|
| 2373 | + } elseif(!$args->password) |
|
| 2141 | 2374 | { |
| 2142 | 2375 | unset($args->password); |
| 2143 | 2376 | } |
@@ -2145,8 +2378,7 @@ discard block |
||
| 2145 | 2378 | if($args->find_account_answer && !$password_is_hashed) |
| 2146 | 2379 | { |
| 2147 | 2380 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
| 2148 | - } |
|
| 2149 | - elseif(!$args->find_account_answer) |
|
| 2381 | + } elseif(!$args->find_account_answer) |
|
| 2150 | 2382 | { |
| 2151 | 2383 | unset($args->find_account_answer); |
| 2152 | 2384 | } |
@@ -2187,8 +2419,12 @@ discard block |
||
| 2187 | 2419 | // Insert data into the DB |
| 2188 | 2420 | $args->list_order = -1 * $args->member_srl; |
| 2189 | 2421 | |
| 2190 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2191 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2422 | + if(!$args->user_id) { |
|
| 2423 | + $args->user_id = 't'.$args->member_srl; |
|
| 2424 | + } |
|
| 2425 | + if(!$args->user_name) { |
|
| 2426 | + $args->user_name = $args->member_srl; |
|
| 2427 | + } |
|
| 2192 | 2428 | |
| 2193 | 2429 | $oDB = &DB::getInstance(); |
| 2194 | 2430 | $oDB->begin(); |
@@ -2200,8 +2436,11 @@ discard block |
||
| 2200 | 2436 | return $output; |
| 2201 | 2437 | } |
| 2202 | 2438 | |
| 2203 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2204 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2439 | + if(is_array($args->group_srl_list)) { |
|
| 2440 | + $group_srl_list = $args->group_srl_list; |
|
| 2441 | + } else { |
|
| 2442 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2443 | + } |
|
| 2205 | 2444 | // If no value is entered the default group, the value of group registration |
| 2206 | 2445 | if(!$args->group_srl_list) |
| 2207 | 2446 | { |
@@ -2218,8 +2457,7 @@ discard block |
||
| 2218 | 2457 | } |
| 2219 | 2458 | } |
| 2220 | 2459 | // If the value is the value of the group entered the group registration |
| 2221 | - } |
|
| 2222 | - else |
|
| 2460 | + } else |
|
| 2223 | 2461 | { |
| 2224 | 2462 | for($i=0;$i<count($group_srl_list);$i++) |
| 2225 | 2463 | { |
@@ -2280,27 +2518,39 @@ discard block |
||
| 2280 | 2518 | { |
| 2281 | 2519 | // Call a trigger (before) |
| 2282 | 2520 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
| 2283 | - if(!$output->toBool()) return $output; |
|
| 2521 | + if(!$output->toBool()) { |
|
| 2522 | + return $output; |
|
| 2523 | + } |
|
| 2284 | 2524 | // Create a model object |
| 2285 | 2525 | $oMemberModel = getModel('member'); |
| 2286 | 2526 | |
| 2287 | 2527 | $logged_info = Context::get('logged_info'); |
| 2288 | 2528 | // Get what you want to modify the original information |
| 2289 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2529 | + if(!$this->memberInfo) { |
|
| 2530 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2531 | + } |
|
| 2290 | 2532 | // Control of essential parameters |
| 2291 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 2292 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
| 2533 | + if($args->allow_mailing!='Y') { |
|
| 2534 | + $args->allow_mailing = 'N'; |
|
| 2535 | + } |
|
| 2536 | + if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) { |
|
| 2537 | + $args->allow_message = 'Y'; |
|
| 2538 | + } |
|
| 2293 | 2539 | |
| 2294 | 2540 | if($logged_info->is_admin == 'Y') |
| 2295 | 2541 | { |
| 2296 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 2297 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
| 2298 | - } |
|
| 2299 | - else |
|
| 2542 | + if($args->denied!='Y') { |
|
| 2543 | + $args->denied = 'N'; |
|
| 2544 | + } |
|
| 2545 | + if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) { |
|
| 2546 | + $args->is_admin = 'N'; |
|
| 2547 | + } |
|
| 2548 | + } else |
|
| 2300 | 2549 | { |
| 2301 | 2550 | unset($args->is_admin); |
| 2302 | - if($is_admin == false) |
|
| 2303 | - unset($args->denied); |
|
| 2551 | + if($is_admin == false) { |
|
| 2552 | + unset($args->denied); |
|
| 2553 | + } |
|
| 2304 | 2554 | if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
| 2305 | 2555 | { |
| 2306 | 2556 | return $this->stop('msg_invalid_request'); |
@@ -2308,13 +2558,19 @@ discard block |
||
| 2308 | 2558 | } |
| 2309 | 2559 | |
| 2310 | 2560 | // Sanitize user ID, username, nickname, homepage, blog |
| 2311 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2561 | + if($args->user_id) { |
|
| 2562 | + $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2563 | + } |
|
| 2312 | 2564 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2313 | 2565 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2314 | 2566 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2315 | 2567 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2316 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2317 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2568 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) { |
|
| 2569 | + $args->homepage = 'http://'.$args->homepage; |
|
| 2570 | + } |
|
| 2571 | + if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) { |
|
| 2572 | + $args->blog = 'http://'.$args->blog; |
|
| 2573 | + } |
|
| 2318 | 2574 | |
| 2319 | 2575 | // check member identifier form |
| 2320 | 2576 | $config = $oMemberModel->getMemberConfig(); |
@@ -2331,8 +2587,7 @@ discard block |
||
| 2331 | 2587 | return new BaseObject(-1,'msg_exists_email_address'); |
| 2332 | 2588 | } |
| 2333 | 2589 | $args->email_address = $orgMemberInfo->email_address; |
| 2334 | - } |
|
| 2335 | - else |
|
| 2590 | + } else |
|
| 2336 | 2591 | { |
| 2337 | 2592 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2338 | 2593 | if($member_srl && $args->member_srl != $member_srl) |
@@ -2389,16 +2644,14 @@ discard block |
||
| 2389 | 2644 | return new BaseObject(-1, $message[$config->password_strength]); |
| 2390 | 2645 | } |
| 2391 | 2646 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2392 | - } |
|
| 2393 | - else |
|
| 2647 | + } else |
|
| 2394 | 2648 | { |
| 2395 | 2649 | $args->password = $orgMemberInfo->password; |
| 2396 | 2650 | } |
| 2397 | 2651 | |
| 2398 | 2652 | if($args->find_account_answer) { |
| 2399 | 2653 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
| 2400 | - } |
|
| 2401 | - else |
|
| 2654 | + } else |
|
| 2402 | 2655 | { |
| 2403 | 2656 | $oPassword = new Password(); |
| 2404 | 2657 | $hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer); |
@@ -2410,11 +2663,21 @@ discard block |
||
| 2410 | 2663 | } |
| 2411 | 2664 | } |
| 2412 | 2665 | |
| 2413 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
| 2414 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
| 2415 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2416 | - if(!$args->description) $args->description = $orgMemberInfo->description; |
|
| 2417 | - if(!$args->birthday) $args->birthday = ''; |
|
| 2666 | + if(!$args->user_name) { |
|
| 2667 | + $args->user_name = $orgMemberInfo->user_name; |
|
| 2668 | + } |
|
| 2669 | + if(!$args->user_id) { |
|
| 2670 | + $args->user_id = $orgMemberInfo->user_id; |
|
| 2671 | + } |
|
| 2672 | + if(!$args->nick_name) { |
|
| 2673 | + $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2674 | + } |
|
| 2675 | + if(!$args->description) { |
|
| 2676 | + $args->description = $orgMemberInfo->description; |
|
| 2677 | + } |
|
| 2678 | + if(!$args->birthday) { |
|
| 2679 | + $args->birthday = ''; |
|
| 2680 | + } |
|
| 2418 | 2681 | |
| 2419 | 2682 | $output = executeQuery('member.updateMember', $args); |
| 2420 | 2683 | |
@@ -2426,8 +2689,11 @@ discard block |
||
| 2426 | 2689 | |
| 2427 | 2690 | if($args->group_srl_list) |
| 2428 | 2691 | { |
| 2429 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2430 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2692 | + if(is_array($args->group_srl_list)) { |
|
| 2693 | + $group_srl_list = $args->group_srl_list; |
|
| 2694 | + } else { |
|
| 2695 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2696 | + } |
|
| 2431 | 2697 | // If the group information, group information changes |
| 2432 | 2698 | if(count($group_srl_list) > 0) |
| 2433 | 2699 | { |
@@ -2470,7 +2736,9 @@ discard block |
||
| 2470 | 2736 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
| 2471 | 2737 | |
| 2472 | 2738 | // Save Session |
| 2473 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2739 | + if(!$this->memberInfo) { |
|
| 2740 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2741 | + } |
|
| 2474 | 2742 | $logged_info = Context::get('logged_info'); |
| 2475 | 2743 | |
| 2476 | 2744 | $output->add('member_srl', $args->member_srl); |
@@ -2496,8 +2764,7 @@ discard block |
||
| 2496 | 2764 | } |
| 2497 | 2765 | |
| 2498 | 2766 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2499 | - } |
|
| 2500 | - else if($args->hashed_password) |
|
| 2767 | + } else if($args->hashed_password) |
|
| 2501 | 2768 | { |
| 2502 | 2769 | $args->password = $args->hashed_password; |
| 2503 | 2770 | } |
@@ -2532,7 +2799,9 @@ discard block |
||
| 2532 | 2799 | $trigger_obj = new stdClass(); |
| 2533 | 2800 | $trigger_obj->member_srl = $member_srl; |
| 2534 | 2801 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
| 2535 | - if(!$output->toBool()) return $output; |
|
| 2802 | + if(!$output->toBool()) { |
|
| 2803 | + return $output; |
|
| 2804 | + } |
|
| 2536 | 2805 | // Create a model object |
| 2537 | 2806 | $oMemberModel = getModel('member'); |
| 2538 | 2807 | // Bringing the user's information |
@@ -2541,9 +2810,13 @@ discard block |
||
| 2541 | 2810 | $columnList = array('member_srl', 'is_admin'); |
| 2542 | 2811 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 2543 | 2812 | } |
| 2544 | - if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 2813 | + if(!$this->memberInfo) { |
|
| 2814 | + return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 2815 | + } |
|
| 2545 | 2816 | // If managers can not be deleted |
| 2546 | - if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
| 2817 | + if($this->memberInfo->is_admin == 'Y') { |
|
| 2818 | + return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
| 2819 | + } |
|
| 2547 | 2820 | |
| 2548 | 2821 | $oDB = &DB::getInstance(); |
| 2549 | 2822 | $oDB->begin(); |
@@ -2607,7 +2880,9 @@ discard block |
||
| 2607 | 2880 | */ |
| 2608 | 2881 | function destroySessionInfo() |
| 2609 | 2882 | { |
| 2610 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
| 2883 | + if(!$_SESSION || !is_array($_SESSION)) { |
|
| 2884 | + return; |
|
| 2885 | + } |
|
| 2611 | 2886 | |
| 2612 | 2887 | $memberInfo = Context::get('logged_info'); |
| 2613 | 2888 | $memberSrl = $memberInfo->member_srl; |
@@ -2646,8 +2921,9 @@ discard block |
||
| 2646 | 2921 | } |
| 2647 | 2922 | $maxLevel = 0; |
| 2648 | 2923 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
| 2649 | - if(count($resultGroup) > 0) |
|
| 2650 | - $maxLevel = max(array_flip($resultGroup)); |
|
| 2924 | + if(count($resultGroup) > 0) { |
|
| 2925 | + $maxLevel = max(array_flip($resultGroup)); |
|
| 2926 | + } |
|
| 2651 | 2927 | |
| 2652 | 2928 | if($maxLevel > 0) |
| 2653 | 2929 | { |
@@ -2664,16 +2940,22 @@ discard block |
||
| 2664 | 2940 | |
| 2665 | 2941 | function procMemberModifyEmailAddress() |
| 2666 | 2942 | { |
| 2667 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 2943 | + if(!Context::get('is_logged')) { |
|
| 2944 | + return $this->stop('msg_not_logged'); |
|
| 2945 | + } |
|
| 2668 | 2946 | |
| 2669 | 2947 | $member_info = Context::get('logged_info'); |
| 2670 | 2948 | $newEmail = Context::get('email_address'); |
| 2671 | 2949 | |
| 2672 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
| 2950 | + if(!$newEmail) { |
|
| 2951 | + return $this->stop('msg_invalid_request'); |
|
| 2952 | + } |
|
| 2673 | 2953 | |
| 2674 | 2954 | $oMemberModel = getModel('member'); |
| 2675 | 2955 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
| 2676 | - if($member_srl) return new BaseObject(-1,'msg_exists_email_address'); |
|
| 2956 | + if($member_srl) { |
|
| 2957 | + return new BaseObject(-1,'msg_exists_email_address'); |
|
| 2958 | + } |
|
| 2677 | 2959 | |
| 2678 | 2960 | if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
| 2679 | 2961 | { |
@@ -2701,7 +2983,9 @@ discard block |
||
| 2701 | 2983 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 2702 | 2984 | |
| 2703 | 2985 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 2704 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 2986 | + if(!is_dir($tpl_path)) { |
|
| 2987 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 2988 | + } |
|
| 2705 | 2989 | |
| 2706 | 2990 | global $lang; |
| 2707 | 2991 | |
@@ -2737,7 +3021,9 @@ discard block |
||
| 2737 | 3021 | { |
| 2738 | 3022 | $member_srl = Context::get('member_srl'); |
| 2739 | 3023 | $auth_key = Context::get('auth_key'); |
| 2740 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
| 3024 | + if(!$member_srl || !$auth_key) { |
|
| 3025 | + return $this->stop('msg_invalid_request'); |
|
| 3026 | + } |
|
| 2741 | 3027 | |
| 2742 | 3028 | // Test logs for finding password by user_id and authkey |
| 2743 | 3029 | $args = new stdClass; |
@@ -2746,7 +3032,9 @@ discard block |
||
| 2746 | 3032 | $output = executeQuery('member.getAuthMail', $args); |
| 2747 | 3033 | if(!$output->toBool() || $output->data->auth_key != $auth_key) |
| 2748 | 3034 | { |
| 2749 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 3035 | + if(strlen($output->data->auth_key) !== strlen($auth_key)) { |
|
| 3036 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 3037 | + } |
|
| 2750 | 3038 | return $this->stop('msg_invalid_modify_email_auth_key'); |
| 2751 | 3039 | } |
| 2752 | 3040 | |
@@ -2755,7 +3043,9 @@ discard block |
||
| 2755 | 3043 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
| 2756 | 3044 | |
| 2757 | 3045 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
| 2758 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
| 3046 | + if(!$output->toBool()) { |
|
| 3047 | + return $this->stop($output->getMessage()); |
|
| 3048 | + } |
|
| 2759 | 3049 | |
| 2760 | 3050 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
| 2761 | 3051 | executeQuery('member.deleteAuthChangeEmailAddress',$args); |
@@ -2776,7 +3066,9 @@ discard block |
||
| 2776 | 3066 | **/ |
| 2777 | 3067 | function triggerGetDocumentMenu(&$menu_list) |
| 2778 | 3068 | { |
| 2779 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
| 3069 | + if(!Context::get('is_logged')) { |
|
| 3070 | + return new BaseObject(); |
|
| 3071 | + } |
|
| 2780 | 3072 | |
| 2781 | 3073 | $logged_info = Context::get('logged_info'); |
| 2782 | 3074 | $document_srl = Context::get('target_srl'); |
@@ -2787,8 +3079,12 @@ discard block |
||
| 2787 | 3079 | $member_srl = $oDocument->get('member_srl'); |
| 2788 | 3080 | $module_srl = $oDocument->get('module_srl'); |
| 2789 | 3081 | |
| 2790 | - if(!$member_srl) return new BaseObject(); |
|
| 2791 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
| 3082 | + if(!$member_srl) { |
|
| 3083 | + return new BaseObject(); |
|
| 3084 | + } |
|
| 3085 | + if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
| 3086 | + return new BaseObject(); |
|
| 3087 | + } |
|
| 2792 | 3088 | |
| 2793 | 3089 | $oDocumentController = getController('document'); |
| 2794 | 3090 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2806,7 +3102,9 @@ discard block |
||
| 2806 | 3102 | **/ |
| 2807 | 3103 | function triggerGetCommentMenu(&$menu_list) |
| 2808 | 3104 | { |
| 2809 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
| 3105 | + if(!Context::get('is_logged')) { |
|
| 3106 | + return new BaseObject(); |
|
| 3107 | + } |
|
| 2810 | 3108 | |
| 2811 | 3109 | $logged_info = Context::get('logged_info'); |
| 2812 | 3110 | $comment_srl = Context::get('target_srl'); |
@@ -2817,8 +3115,12 @@ discard block |
||
| 2817 | 3115 | $module_srl = $oComment->get('module_srl'); |
| 2818 | 3116 | $member_srl = $oComment->get('member_srl'); |
| 2819 | 3117 | |
| 2820 | - if(!$member_srl) return new BaseObject(); |
|
| 2821 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
| 3118 | + if(!$member_srl) { |
|
| 3119 | + return new BaseObject(); |
|
| 3120 | + } |
|
| 3121 | + if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
| 3122 | + return new BaseObject(); |
|
| 3123 | + } |
|
| 2822 | 3124 | |
| 2823 | 3125 | $oCommentController = getController('comment'); |
| 2824 | 3126 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2834,7 +3136,9 @@ discard block |
||
| 2834 | 3136 | **/ |
| 2835 | 3137 | function procMemberSpammerManage() |
| 2836 | 3138 | { |
| 2837 | - if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted'); |
|
| 3139 | + if(!Context::get('is_logged')) { |
|
| 3140 | + return new BaseObject(-1,'msg_not_permitted'); |
|
| 3141 | + } |
|
| 2838 | 3142 | |
| 2839 | 3143 | $logged_info = Context::get('logged_info'); |
| 2840 | 3144 | $member_srl = Context::get('member_srl'); |
@@ -2842,8 +3146,9 @@ discard block |
||
| 2842 | 3146 | $cnt_loop = Context::get('cnt_loop'); |
| 2843 | 3147 | $proc_type = Context::get('proc_type'); |
| 2844 | 3148 | $isMoveToTrash = true; |
| 2845 | - if($proc_type == "delete") |
|
| 2846 | - $isMoveToTrash = false; |
|
| 3149 | + if($proc_type == "delete") { |
|
| 3150 | + $isMoveToTrash = false; |
|
| 3151 | + } |
|
| 2847 | 3152 | |
| 2848 | 3153 | // check grant |
| 2849 | 3154 | $oModuleModel = getModel('module'); |
@@ -2851,7 +3156,9 @@ discard block |
||
| 2851 | 3156 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
| 2852 | 3157 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
| 2853 | 3158 | |
| 2854 | - if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted'); |
|
| 3159 | + if(!$grant->manager) { |
|
| 3160 | + return new BaseObject(-1,'msg_not_permitted'); |
|
| 3161 | + } |
|
| 2855 | 3162 | |
| 2856 | 3163 | $proc_msg = ""; |
| 2857 | 3164 | |
@@ -2860,11 +3167,13 @@ discard block |
||
| 2860 | 3167 | |
| 2861 | 3168 | // delete or trash destination |
| 2862 | 3169 | // proc member |
| 2863 | - if($cnt_loop == 1) |
|
| 2864 | - $this->_spammerMember($member_srl); |
|
| 3170 | + if($cnt_loop == 1) { |
|
| 3171 | + $this->_spammerMember($member_srl); |
|
| 3172 | + } |
|
| 2865 | 3173 | // proc document and comment |
| 2866 | - elseif($cnt_loop>1) |
|
| 2867 | - $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
| 3174 | + elseif($cnt_loop>1) { |
|
| 3175 | + $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
| 3176 | + } |
|
| 2868 | 3177 | |
| 2869 | 3178 | // get destination count |
| 2870 | 3179 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
@@ -2872,13 +3181,16 @@ discard block |
||
| 2872 | 3181 | |
| 2873 | 3182 | $total_count = Context::get('total_count'); |
| 2874 | 3183 | $remain_count = $cnt_document + $cnt_comment; |
| 2875 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
| 3184 | + if($cnt_loop == 1) { |
|
| 3185 | + $total_count = $remain_count; |
|
| 3186 | + } |
|
| 2876 | 3187 | |
| 2877 | 3188 | // get progress percent |
| 2878 | - if($total_count > 0) |
|
| 2879 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
| 2880 | - else |
|
| 2881 | - $progress = 100; |
|
| 3189 | + if($total_count > 0) { |
|
| 3190 | + $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
| 3191 | + } else { |
|
| 3192 | + $progress = 100; |
|
| 3193 | + } |
|
| 2882 | 3194 | |
| 2883 | 3195 | $this->add('total_count', $total_count); |
| 2884 | 3196 | $this->add('remain_count', $remain_count); |
@@ -2920,7 +3232,10 @@ discard block |
||
| 2920 | 3232 | $args->nick_name = $member_info->nick_name; |
| 2921 | 3233 | $args->denied = "Y"; |
| 2922 | 3234 | $args->description = trim( $member_info->description ); |
| 2923 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
| 3235 | + if( $args->description != "" ) { |
|
| 3236 | + $args->description .= "\n"; |
|
| 3237 | + } |
|
| 3238 | + // add new line |
|
| 2924 | 3239 | |
| 2925 | 3240 | $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 . "]"; |
| 2926 | 3241 | |
@@ -2965,8 +3280,11 @@ discard block |
||
| 2965 | 3280 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
| 2966 | 3281 | if($documentList) { |
| 2967 | 3282 | foreach($documentList as $v) { |
| 2968 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
| 2969 | - else $oDocumentController->deleteDocument($v->document_srl); |
|
| 3283 | + if($isMoveToTrash) { |
|
| 3284 | + $oDocumentController->moveDocumentToTrash($v); |
|
| 3285 | + } else { |
|
| 3286 | + $oDocumentController->deleteDocument($v->document_srl); |
|
| 3287 | + } |
|
| 2970 | 3288 | } |
| 2971 | 3289 | } |
| 2972 | 3290 | } |
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | function member() |
| 22 | 22 | { |
| 23 | - if(!Context::isInstalled()) return; |
|
| 23 | + if (!Context::isInstalled()) return; |
|
| 24 | 24 | |
| 25 | 25 | $oModuleModel = getModel('module'); |
| 26 | 26 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 27 | 27 | |
| 28 | 28 | // Set to use SSL upon actions related member join/information/password and so on. 2013.02.15 |
| 29 | - if(!Context::isExistsSSLAction('dispMemberModifyPassword') && Context::getSslStatus() == 'optional') |
|
| 29 | + if (!Context::isExistsSSLAction('dispMemberModifyPassword') && Context::getSslStatus() == 'optional') |
|
| 30 | 30 | { |
| 31 | 31 | $ssl_actions = array('dispMemberModifyPassword', 'dispMemberSignUpForm', 'dispMemberModifyInfo', 'dispMemberModifyEmailAddress', 'dispMemberGetTempPassword', 'dispMemberResendAuthMail', 'dispMemberLoginForm', 'dispMemberFindAccount', 'dispMemberLeave', 'procMemberLogin', 'procMemberModifyPassword', 'procMemberInsert', 'procMemberModifyInfo', 'procMemberFindAccount', 'procMemberModifyEmailAddress', 'procMemberResendAuthMail', 'procMemberLeave'/*, 'getMemberMenu'*/, 'procMemberFindAccountByQuestion'); |
| 32 | 32 | Context::addSSLActions($ssl_actions); |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | $oModuleController = getController('module'); |
| 45 | 45 | |
| 46 | 46 | $oDB = &DB::getInstance(); |
| 47 | - $oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true); |
|
| 47 | + $oDB->addIndex("member_group", "idx_site_title", array("site_srl", "title"), true); |
|
| 48 | 48 | |
| 49 | 49 | $oModuleModel = getModel('module'); |
| 50 | 50 | $config = $oModuleModel->getModuleConfig('member'); |
| 51 | 51 | |
| 52 | - if(empty($config)) |
|
| 52 | + if (empty($config)) |
|
| 53 | 53 | { |
| 54 | 54 | $isNotInstall = true; |
| 55 | 55 | $config = new stdClass; |
@@ -57,29 +57,29 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | // Set the basic information |
| 59 | 59 | $config->enable_join = 'Y'; |
| 60 | - if(!$config->enable_auth_mail) $config->enable_auth_mail = 'N'; |
|
| 61 | - if(!$config->image_name) $config->image_name = 'Y'; |
|
| 62 | - if(!$config->image_mark) $config->image_mark = 'Y'; |
|
| 63 | - if(!$config->profile_image) $config->profile_image = 'Y'; |
|
| 64 | - if(!$config->image_name_max_width) $config->image_name_max_width = '90'; |
|
| 65 | - if(!$config->image_name_max_height) $config->image_name_max_height = '20'; |
|
| 66 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = '20'; |
|
| 67 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = '20'; |
|
| 68 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = '90'; |
|
| 69 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = '90'; |
|
| 70 | - if($config->group_image_mark!='Y') $config->group_image_mark = 'N'; |
|
| 71 | - if(!$config->password_strength) $config->password_strength = 'normal'; |
|
| 60 | + if (!$config->enable_auth_mail) $config->enable_auth_mail = 'N'; |
|
| 61 | + if (!$config->image_name) $config->image_name = 'Y'; |
|
| 62 | + if (!$config->image_mark) $config->image_mark = 'Y'; |
|
| 63 | + if (!$config->profile_image) $config->profile_image = 'Y'; |
|
| 64 | + if (!$config->image_name_max_width) $config->image_name_max_width = '90'; |
|
| 65 | + if (!$config->image_name_max_height) $config->image_name_max_height = '20'; |
|
| 66 | + if (!$config->image_mark_max_width) $config->image_mark_max_width = '20'; |
|
| 67 | + if (!$config->image_mark_max_height) $config->image_mark_max_height = '20'; |
|
| 68 | + if (!$config->profile_image_max_width) $config->profile_image_max_width = '90'; |
|
| 69 | + if (!$config->profile_image_max_height) $config->profile_image_max_height = '90'; |
|
| 70 | + if ($config->group_image_mark != 'Y') $config->group_image_mark = 'N'; |
|
| 71 | + if (!$config->password_strength) $config->password_strength = 'normal'; |
|
| 72 | 72 | |
| 73 | - if(!$config->password_hashing_algorithm) |
|
| 73 | + if (!$config->password_hashing_algorithm) |
|
| 74 | 74 | { |
| 75 | 75 | $oPassword = new Password(); |
| 76 | 76 | $config->password_hashing_algorithm = $oPassword->getBestAlgorithm(); |
| 77 | 77 | } |
| 78 | - if(!$config->password_hashing_work_factor) |
|
| 78 | + if (!$config->password_hashing_work_factor) |
|
| 79 | 79 | { |
| 80 | 80 | $config->password_hashing_work_factor = 8; |
| 81 | 81 | } |
| 82 | - if(!$config->password_hashing_auto_upgrade) |
|
| 82 | + if (!$config->password_hashing_auto_upgrade) |
|
| 83 | 83 | { |
| 84 | 84 | $config->password_hashing_auto_upgrade = 'Y'; |
| 85 | 85 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $oMemberController = getController('member'); |
| 91 | 91 | $oMemberAdminController = getAdminController('member'); |
| 92 | 92 | |
| 93 | - if(!$config->signupForm || !is_array($config->signupForm)) |
|
| 93 | + if (!$config->signupForm || !is_array($config->signupForm)) |
|
| 94 | 94 | { |
| 95 | 95 | $identifier = $isNotInstall ? 'email_address' : 'user_id'; |
| 96 | 96 | |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - $oModuleController->insertModuleConfig('member',$config); |
|
| 108 | + $oModuleController->insertModuleConfig('member', $config); |
|
| 109 | 109 | |
| 110 | 110 | $groups = $oMemberModel->getGroups(); |
| 111 | - if(!count($groups)) |
|
| 111 | + if (!count($groups)) |
|
| 112 | 112 | { |
| 113 | 113 | // Set an administrator, regular member(group1), and associate member(group2) |
| 114 | 114 | $group_args = new stdClass; |
@@ -134,10 +134,10 @@ discard block |
||
| 134 | 134 | $admin_args = new stdClass; |
| 135 | 135 | $admin_args->is_admin = 'Y'; |
| 136 | 136 | $output = executeQuery('member.getMemberList', $admin_args); |
| 137 | - if(!$output->data) |
|
| 137 | + if (!$output->data) |
|
| 138 | 138 | { |
| 139 | - $admin_info = Context::gets('password','nick_name','email_address', 'user_id'); |
|
| 140 | - if($admin_info->email_address) |
|
| 139 | + $admin_info = Context::gets('password', 'nick_name', 'email_address', 'user_id'); |
|
| 140 | + if ($admin_info->email_address) |
|
| 141 | 141 | { |
| 142 | 142 | $admin_info->user_name = 'admin'; |
| 143 | 143 | // Insert admin information |
@@ -149,16 +149,16 @@ discard block |
||
| 149 | 149 | // Register denied ID(default + module name) |
| 150 | 150 | $oModuleModel = getModel('module'); |
| 151 | 151 | $module_list = $oModuleModel->getModuleList(); |
| 152 | - foreach($module_list as $key => $val) |
|
| 152 | + foreach ($module_list as $key => $val) |
|
| 153 | 153 | { |
| 154 | - $oMemberAdminController->insertDeniedID($val->module,''); |
|
| 154 | + $oMemberAdminController->insertDeniedID($val->module, ''); |
|
| 155 | 155 | } |
| 156 | - $oMemberAdminController->insertDeniedID('www',''); |
|
| 157 | - $oMemberAdminController->insertDeniedID('root',''); |
|
| 158 | - $oMemberAdminController->insertDeniedID('administrator',''); |
|
| 159 | - $oMemberAdminController->insertDeniedID('telnet',''); |
|
| 160 | - $oMemberAdminController->insertDeniedID('ftp',''); |
|
| 161 | - $oMemberAdminController->insertDeniedID('http',''); |
|
| 156 | + $oMemberAdminController->insertDeniedID('www', ''); |
|
| 157 | + $oMemberAdminController->insertDeniedID('root', ''); |
|
| 158 | + $oMemberAdminController->insertDeniedID('administrator', ''); |
|
| 159 | + $oMemberAdminController->insertDeniedID('telnet', ''); |
|
| 160 | + $oMemberAdminController->insertDeniedID('ftp', ''); |
|
| 161 | + $oMemberAdminController->insertDeniedID('http', ''); |
|
| 162 | 162 | // Create cache directory to use in the member module |
| 163 | 163 | FileHandler::makeDir('./files/member_extra_info/image_name'); |
| 164 | 164 | FileHandler::makeDir('./files/member_extra_info/image_mark'); |
@@ -183,76 +183,76 @@ discard block |
||
| 183 | 183 | $oModuleModel = getModel('module'); |
| 184 | 184 | $oModuleController = getController('module'); |
| 185 | 185 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
| 186 | - if($oModuleModel->needUpdate($version_update_id)) |
|
| 186 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
| 187 | 187 | { |
| 188 | 188 | // check member directory (11/08/2007 added) |
| 189 | - if(!is_dir("./files/member_extra_info")) return true; |
|
| 189 | + if (!is_dir("./files/member_extra_info")) return true; |
|
| 190 | 190 | // check member directory (22/10/2007 added) |
| 191 | - if(!is_dir("./files/member_extra_info/profile_image")) return true; |
|
| 191 | + if (!is_dir("./files/member_extra_info/profile_image")) return true; |
|
| 192 | 192 | // Add a column(is_register) to "member_auth_mail" table (22/04/2008) |
| 193 | 193 | $act = $oDB->isColumnExists("member_auth_mail", "is_register"); |
| 194 | - if(!$act) return true; |
|
| 194 | + if (!$act) return true; |
|
| 195 | 195 | // Add a column(site_srl) to "member_group_member" table (11/15/2008) |
| 196 | - if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true; |
|
| 197 | - if(!$oDB->isColumnExists("member_group", "site_srl")) return true; |
|
| 198 | - if($oDB->isIndexExists("member_group","uni_member_group_title")) return true; |
|
| 196 | + if (!$oDB->isColumnExists("member_group_member", "site_srl")) return true; |
|
| 197 | + if (!$oDB->isColumnExists("member_group", "site_srl")) return true; |
|
| 198 | + if ($oDB->isIndexExists("member_group", "uni_member_group_title")) return true; |
|
| 199 | 199 | |
| 200 | 200 | // Add a column for list_order (05/18/2011) |
| 201 | - if(!$oDB->isColumnExists("member_group", "list_order")) return true; |
|
| 201 | + if (!$oDB->isColumnExists("member_group", "list_order")) return true; |
|
| 202 | 202 | |
| 203 | 203 | // image_mark 추가 (2009. 02. 14) |
| 204 | - if(!$oDB->isColumnExists("member_group", "image_mark")) return true; |
|
| 204 | + if (!$oDB->isColumnExists("member_group", "image_mark")) return true; |
|
| 205 | 205 | // Add c column for password expiration date |
| 206 | - if(!$oDB->isColumnExists("member", "change_password_date")) return true; |
|
| 206 | + if (!$oDB->isColumnExists("member", "change_password_date")) return true; |
|
| 207 | 207 | |
| 208 | 208 | // Add columns of question and answer to verify a password |
| 209 | - if(!$oDB->isColumnExists("member", "find_account_question")) return true; |
|
| 210 | - if(!$oDB->isColumnExists("member", "find_account_answer")) return true; |
|
| 209 | + if (!$oDB->isColumnExists("member", "find_account_question")) return true; |
|
| 210 | + if (!$oDB->isColumnExists("member", "find_account_answer")) return true; |
|
| 211 | 211 | |
| 212 | - if(!$oDB->isColumnExists("member", "list_order")) return true; |
|
| 213 | - if(!$oDB->isIndexExists("member","idx_list_order")) return true; |
|
| 212 | + if (!$oDB->isColumnExists("member", "list_order")) return true; |
|
| 213 | + if (!$oDB->isIndexExists("member", "idx_list_order")) return true; |
|
| 214 | 214 | |
| 215 | 215 | $oModuleModel = getModel('module'); |
| 216 | 216 | $config = $oModuleModel->getModuleConfig('member'); |
| 217 | 217 | // check signup form ordering info |
| 218 | - if(!$config->signupForm) return true; |
|
| 218 | + if (!$config->signupForm) return true; |
|
| 219 | 219 | |
| 220 | - foreach($config->signupForm as $form) |
|
| 220 | + foreach ($config->signupForm as $form) |
|
| 221 | 221 | { |
| 222 | - if($form->name === 'email_address' && $form->isPublic !== 'N') |
|
| 222 | + if ($form->name === 'email_address' && $form->isPublic !== 'N') |
|
| 223 | 223 | { |
| 224 | 224 | return true; |
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | // check agreement field exist |
| 229 | - if($config->agreement) return true; |
|
| 229 | + if ($config->agreement) return true; |
|
| 230 | 230 | |
| 231 | - if($config->skin) |
|
| 231 | + if ($config->skin) |
|
| 232 | 232 | { |
| 233 | 233 | $config_parse = explode('.', $config->skin); |
| 234 | - if(count($config_parse) > 1) |
|
| 234 | + if (count($config_parse) > 1) |
|
| 235 | 235 | { |
| 236 | 236 | $template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]); |
| 237 | - if(is_dir($template_path)) return true; |
|
| 237 | + if (is_dir($template_path)) return true; |
|
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | // supprot multilanguage agreement. |
| 242 | - if(is_readable('./files/member_extra_info/agreement.txt')) return true; |
|
| 242 | + if (is_readable('./files/member_extra_info/agreement.txt')) return true; |
|
| 243 | 243 | |
| 244 | 244 | // 2013. 11. 22 add menu when popup document menu called |
| 245 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true; |
|
| 246 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true; |
|
| 245 | + if (!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true; |
|
| 246 | + if (!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true; |
|
| 247 | 247 | |
| 248 | 248 | $oModuleController->insertUpdatedLog($version_update_id); |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - if(!is_readable('./files/ruleset/insertMember.xml')) return true; |
|
| 252 | - if(!is_readable('./files/ruleset/login.xml')) return true; |
|
| 253 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true; |
|
| 251 | + if (!is_readable('./files/ruleset/insertMember.xml')) return true; |
|
| 252 | + if (!is_readable('./files/ruleset/login.xml')) return true; |
|
| 253 | + if (!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true; |
|
| 254 | 254 | |
| 255 | - if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true; |
|
| 255 | + if ($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true; |
|
| 256 | 256 | |
| 257 | 257 | return false; |
| 258 | 258 | } |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $oMemberAdminController = getAdminController('member'); |
| 271 | 271 | $config = $oModuleModel->getModuleConfig('member'); |
| 272 | 272 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
| 273 | - if($oModuleModel->needUpdate($version_update_id)) |
|
| 273 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
| 274 | 274 | { |
| 275 | 275 | // Check member directory |
| 276 | 276 | FileHandler::makeDir('./files/member_extra_info/image_name'); |
@@ -278,74 +278,74 @@ discard block |
||
| 278 | 278 | FileHandler::makeDir('./files/member_extra_info/signature'); |
| 279 | 279 | FileHandler::makeDir('./files/member_extra_info/profile_image'); |
| 280 | 280 | // Add a column |
| 281 | - if(!$oDB->isColumnExists("member_auth_mail", "is_register")) |
|
| 281 | + if (!$oDB->isColumnExists("member_auth_mail", "is_register")) |
|
| 282 | 282 | { |
| 283 | 283 | $oDB->addColumn("member_auth_mail", "is_register", "char", 1, "N", true); |
| 284 | 284 | } |
| 285 | 285 | // Add a column(site_srl) to "member_group_member" table (11/15/2008) |
| 286 | - if(!$oDB->isColumnExists("member_group_member", "site_srl")) |
|
| 286 | + if (!$oDB->isColumnExists("member_group_member", "site_srl")) |
|
| 287 | 287 | { |
| 288 | 288 | $oDB->addColumn("member_group_member", "site_srl", "number", 11, 0, true); |
| 289 | 289 | $oDB->addIndex("member_group_member", "idx_site_srl", "site_srl", false); |
| 290 | 290 | } |
| 291 | - if(!$oDB->isColumnExists("member_group", "site_srl")) |
|
| 291 | + if (!$oDB->isColumnExists("member_group", "site_srl")) |
|
| 292 | 292 | { |
| 293 | 293 | $oDB->addColumn("member_group", "site_srl", "number", 11, 0, true); |
| 294 | - $oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true); |
|
| 294 | + $oDB->addIndex("member_group", "idx_site_title", array("site_srl", "title"), true); |
|
| 295 | 295 | } |
| 296 | - if($oDB->isIndexExists("member_group","uni_member_group_title")) |
|
| 296 | + if ($oDB->isIndexExists("member_group", "uni_member_group_title")) |
|
| 297 | 297 | { |
| 298 | - $oDB->dropIndex("member_group","uni_member_group_title",true); |
|
| 298 | + $oDB->dropIndex("member_group", "uni_member_group_title", true); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | // Add a column(list_order) to "member_group" table (05/18/2011) |
| 302 | - if(!$oDB->isColumnExists("member_group", "list_order")) |
|
| 302 | + if (!$oDB->isColumnExists("member_group", "list_order")) |
|
| 303 | 303 | { |
| 304 | 304 | $oDB->addColumn("member_group", "list_order", "number", 11, '', true); |
| 305 | - $oDB->addIndex("member_group","idx_list_order", "list_order",false); |
|
| 305 | + $oDB->addIndex("member_group", "idx_list_order", "list_order", false); |
|
| 306 | 306 | $output = executeQuery('member.updateAllMemberGroupListOrder'); |
| 307 | 307 | } |
| 308 | 308 | // Add a column for image_mark (02/14/2009) |
| 309 | - if(!$oDB->isColumnExists("member_group", "image_mark")) |
|
| 309 | + if (!$oDB->isColumnExists("member_group", "image_mark")) |
|
| 310 | 310 | { |
| 311 | 311 | $oDB->addColumn("member_group", "image_mark", "text"); |
| 312 | 312 | } |
| 313 | 313 | // Add a column for password expiration date |
| 314 | - if(!$oDB->isColumnExists("member", "change_password_date")) |
|
| 314 | + if (!$oDB->isColumnExists("member", "change_password_date")) |
|
| 315 | 315 | { |
| 316 | 316 | $oDB->addColumn("member", "change_password_date", "date"); |
| 317 | 317 | executeQuery('member.updateAllChangePasswordDate'); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | // Add columns of question and answer to verify a password |
| 321 | - if(!$oDB->isColumnExists("member", "find_account_question")) |
|
| 321 | + if (!$oDB->isColumnExists("member", "find_account_question")) |
|
| 322 | 322 | { |
| 323 | 323 | $oDB->addColumn("member", "find_account_question", "number", 11); |
| 324 | 324 | } |
| 325 | - if(!$oDB->isColumnExists("member", "find_account_answer")) |
|
| 325 | + if (!$oDB->isColumnExists("member", "find_account_answer")) |
|
| 326 | 326 | { |
| 327 | 327 | $oDB->addColumn("member", "find_account_answer", "varchar", 250); |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | - if(!$oDB->isColumnExists("member", "list_order")) |
|
| 330 | + if (!$oDB->isColumnExists("member", "list_order")) |
|
| 331 | 331 | { |
| 332 | 332 | $oDB->addColumn("member", "list_order", "number", 11); |
| 333 | 333 | @set_time_limit(0); |
| 334 | 334 | $args->list_order = 'member_srl'; |
| 335 | - executeQuery('member.updateMemberListOrderAll',$args); |
|
| 335 | + executeQuery('member.updateMemberListOrderAll', $args); |
|
| 336 | 336 | executeQuery('member.updateMemberListOrderAll'); |
| 337 | 337 | } |
| 338 | - if(!$oDB->isIndexExists("member","idx_list_order")) |
|
| 338 | + if (!$oDB->isIndexExists("member", "idx_list_order")) |
|
| 339 | 339 | { |
| 340 | - $oDB->addIndex("member","idx_list_order", array("list_order")); |
|
| 340 | + $oDB->addIndex("member", "idx_list_order", array("list_order")); |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | $config = $oModuleModel->getModuleConfig('member'); |
| 344 | 344 | |
| 345 | 345 | // check agreement value exist |
| 346 | - if($config->agreement) |
|
| 346 | + if ($config->agreement) |
|
| 347 | 347 | { |
| 348 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
| 348 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
| 349 | 349 | $output = FileHandler::writeFile($agreement_file, $config->agreement); |
| 350 | 350 | |
| 351 | 351 | $config->agreement = NULL; |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | // check signup form ordering info |
| 356 | - if(!$config->signupForm || !is_array($config->signupForm)) |
|
| 356 | + if (!$config->signupForm || !is_array($config->signupForm)) |
|
| 357 | 357 | { |
| 358 | 358 | $identifier = 'email_address'; |
| 359 | 359 | |
@@ -364,9 +364,9 @@ discard block |
||
| 364 | 364 | |
| 365 | 365 | // 회원정보에서 이메일 노출 제거 |
| 366 | 366 | // @see https://github.com/xpressengine/xe-core/issues/2177 |
| 367 | - foreach($config->signupForm as $form) |
|
| 367 | + foreach ($config->signupForm as $form) |
|
| 368 | 368 | { |
| 369 | - if($form->name === 'email_address') |
|
| 369 | + if ($form->name === 'email_address') |
|
| 370 | 370 | { |
| 371 | 371 | $form->isPublic = 'N'; |
| 372 | 372 | break; |
@@ -374,13 +374,13 @@ discard block |
||
| 374 | 374 | } |
| 375 | 375 | $oModuleController->updateModuleConfig('member', $config); |
| 376 | 376 | |
| 377 | - if($config->skin) |
|
| 377 | + if ($config->skin) |
|
| 378 | 378 | { |
| 379 | 379 | $config_parse = explode('.', $config->skin); |
| 380 | 380 | if (count($config_parse) > 1) |
| 381 | 381 | { |
| 382 | 382 | $template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]); |
| 383 | - if(is_dir($template_path)) |
|
| 383 | + if (is_dir($template_path)) |
|
| 384 | 384 | { |
| 385 | 385 | $config->skin = implode('|@|', $config_parse); |
| 386 | 386 | $oModuleController = getController('module'); |
@@ -390,15 +390,15 @@ discard block |
||
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | // 2013. 11. 22 add menu when popup document menu called |
| 393 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) |
|
| 393 | + if (!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) |
|
| 394 | 394 | $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'); |
| 395 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) |
|
| 395 | + if (!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) |
|
| 396 | 396 | $oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'); |
| 397 | 397 | |
| 398 | - if(is_readable('./files/member_extra_info/agreement.txt')) |
|
| 398 | + if (is_readable('./files/member_extra_info/agreement.txt')) |
|
| 399 | 399 | { |
| 400 | 400 | $source_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
| 401 | - $target_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
| 401 | + $target_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
| 402 | 402 | |
| 403 | 403 | FileHandler::rename($source_file, $target_file); |
| 404 | 404 | } |
@@ -407,14 +407,14 @@ discard block |
||
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | FileHandler::makeDir('./files/ruleset'); |
| 410 | - if(!is_readable('./files/ruleset/insertMember.xml')) |
|
| 410 | + if (!is_readable('./files/ruleset/insertMember.xml')) |
|
| 411 | 411 | $oMemberAdminController->_createSignupRuleset($config->signupForm); |
| 412 | - if(!is_readable('./files/ruleset/login.xml')) |
|
| 412 | + if (!is_readable('./files/ruleset/login.xml')) |
|
| 413 | 413 | $oMemberAdminController->_createLoginRuleset($config->identifier); |
| 414 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) |
|
| 414 | + if (!is_readable('./files/ruleset/find_member_account_by_question.xml')) |
|
| 415 | 415 | $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
| 416 | 416 | |
| 417 | - if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) |
|
| 417 | + if ($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) |
|
| 418 | 418 | { |
| 419 | 419 | $oMemberAdminController->_createSignupRuleset($config->signupForm); |
| 420 | 420 | $oModuleController->insertUpdatedLog('member.1.8.43.recreate_signup_ruleset'); |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | */ |
| 438 | 438 | function recordLoginError($error = 0, $message = 'success') |
| 439 | 439 | { |
| 440 | - if($error == 0) return new BaseObject($error, $message); |
|
| 440 | + if ($error == 0) return new BaseObject($error, $message); |
|
| 441 | 441 | |
| 442 | 442 | // Create a member model object |
| 443 | 443 | $oMemberModel = getModel('member'); |
@@ -445,18 +445,18 @@ discard block |
||
| 445 | 445 | |
| 446 | 446 | // Check if there is recoding table. |
| 447 | 447 | $oDB = &DB::getInstance(); |
| 448 | - if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 448 | + if (!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 449 | 449 | |
| 450 | 450 | $args = new stdClass(); |
| 451 | 451 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
| 452 | 452 | |
| 453 | 453 | $output = executeQuery('member.getLoginCountByIp', $args); |
| 454 | - if($output->data && $output->data->count) |
|
| 454 | + if ($output->data && $output->data->count) |
|
| 455 | 455 | { |
| 456 | 456 | $last_update = strtotime($output->data->last_update); |
| 457 | - $term = intval($_SERVER['REQUEST_TIME']-$last_update); |
|
| 457 | + $term = intval($_SERVER['REQUEST_TIME'] - $last_update); |
|
| 458 | 458 | //update, if IP address access in a short time, update count. If not, make count 1. |
| 459 | - if($term < $config->max_error_count_time) |
|
| 459 | + if ($term < $config->max_error_count_time) |
|
| 460 | 460 | { |
| 461 | 461 | $args->count = $output->data->count + 1; |
| 462 | 462 | } |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | */ |
| 483 | 483 | function recordMemberLoginError($error = 0, $message = 'success', $args = NULL) |
| 484 | 484 | { |
| 485 | - if($error == 0 || !$args->member_srl) return new BaseObject($error, $message); |
|
| 485 | + if ($error == 0 || !$args->member_srl) return new BaseObject($error, $message); |
|
| 486 | 486 | |
| 487 | 487 | // Create a member model object |
| 488 | 488 | $oMemberModel = getModel('member'); |
@@ -490,21 +490,21 @@ discard block |
||
| 490 | 490 | |
| 491 | 491 | // Check if there is recoding table. |
| 492 | 492 | $oDB = &DB::getInstance(); |
| 493 | - if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 493 | + if (!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 494 | 494 | |
| 495 | 495 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
| 496 | - if($output->data && $output->data->content) |
|
| 496 | + if ($output->data && $output->data->content) |
|
| 497 | 497 | { |
| 498 | 498 | //update |
| 499 | 499 | $content = unserialize($output->data->content); |
| 500 | - $content[] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |
|
| 500 | + $content[] = array($_SERVER['REMOTE_ADDR'], Context::getLang($message), $_SERVER['REQUEST_TIME']); |
|
| 501 | 501 | $args->content = serialize($content); |
| 502 | 502 | $output = executeQuery('member.updateLoginCountHistoryByMemberSrl', $args); |
| 503 | 503 | } |
| 504 | 504 | else |
| 505 | 505 | { |
| 506 | 506 | //insert |
| 507 | - $content[0] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |
|
| 507 | + $content[0] = array($_SERVER['REMOTE_ADDR'], Context::getLang($message), $_SERVER['REQUEST_TIME']); |
|
| 508 | 508 | $args->content = serialize($content); |
| 509 | 509 | $output = executeQuery('member.insertLoginCountHistoryByMemberSrl', $args); |
| 510 | 510 | } |
@@ -20,7 +20,9 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | function member() |
| 22 | 22 | { |
| 23 | - if(!Context::isInstalled()) return; |
|
| 23 | + if(!Context::isInstalled()) { |
|
| 24 | + return; |
|
| 25 | + } |
|
| 24 | 26 | |
| 25 | 27 | $oModuleModel = getModel('module'); |
| 26 | 28 | $member_config = $oModuleModel->getModuleConfig('member'); |
@@ -57,18 +59,42 @@ discard block |
||
| 57 | 59 | |
| 58 | 60 | // Set the basic information |
| 59 | 61 | $config->enable_join = 'Y'; |
| 60 | - if(!$config->enable_auth_mail) $config->enable_auth_mail = 'N'; |
|
| 61 | - if(!$config->image_name) $config->image_name = 'Y'; |
|
| 62 | - if(!$config->image_mark) $config->image_mark = 'Y'; |
|
| 63 | - if(!$config->profile_image) $config->profile_image = 'Y'; |
|
| 64 | - if(!$config->image_name_max_width) $config->image_name_max_width = '90'; |
|
| 65 | - if(!$config->image_name_max_height) $config->image_name_max_height = '20'; |
|
| 66 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = '20'; |
|
| 67 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = '20'; |
|
| 68 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = '90'; |
|
| 69 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = '90'; |
|
| 70 | - if($config->group_image_mark!='Y') $config->group_image_mark = 'N'; |
|
| 71 | - if(!$config->password_strength) $config->password_strength = 'normal'; |
|
| 62 | + if(!$config->enable_auth_mail) { |
|
| 63 | + $config->enable_auth_mail = 'N'; |
|
| 64 | + } |
|
| 65 | + if(!$config->image_name) { |
|
| 66 | + $config->image_name = 'Y'; |
|
| 67 | + } |
|
| 68 | + if(!$config->image_mark) { |
|
| 69 | + $config->image_mark = 'Y'; |
|
| 70 | + } |
|
| 71 | + if(!$config->profile_image) { |
|
| 72 | + $config->profile_image = 'Y'; |
|
| 73 | + } |
|
| 74 | + if(!$config->image_name_max_width) { |
|
| 75 | + $config->image_name_max_width = '90'; |
|
| 76 | + } |
|
| 77 | + if(!$config->image_name_max_height) { |
|
| 78 | + $config->image_name_max_height = '20'; |
|
| 79 | + } |
|
| 80 | + if(!$config->image_mark_max_width) { |
|
| 81 | + $config->image_mark_max_width = '20'; |
|
| 82 | + } |
|
| 83 | + if(!$config->image_mark_max_height) { |
|
| 84 | + $config->image_mark_max_height = '20'; |
|
| 85 | + } |
|
| 86 | + if(!$config->profile_image_max_width) { |
|
| 87 | + $config->profile_image_max_width = '90'; |
|
| 88 | + } |
|
| 89 | + if(!$config->profile_image_max_height) { |
|
| 90 | + $config->profile_image_max_height = '90'; |
|
| 91 | + } |
|
| 92 | + if($config->group_image_mark!='Y') { |
|
| 93 | + $config->group_image_mark = 'N'; |
|
| 94 | + } |
|
| 95 | + if(!$config->password_strength) { |
|
| 96 | + $config->password_strength = 'normal'; |
|
| 97 | + } |
|
| 72 | 98 | |
| 73 | 99 | if(!$config->password_hashing_algorithm) |
| 74 | 100 | { |
@@ -186,36 +212,64 @@ discard block |
||
| 186 | 212 | if($oModuleModel->needUpdate($version_update_id)) |
| 187 | 213 | { |
| 188 | 214 | // check member directory (11/08/2007 added) |
| 189 | - if(!is_dir("./files/member_extra_info")) return true; |
|
| 215 | + if(!is_dir("./files/member_extra_info")) { |
|
| 216 | + return true; |
|
| 217 | + } |
|
| 190 | 218 | // check member directory (22/10/2007 added) |
| 191 | - if(!is_dir("./files/member_extra_info/profile_image")) return true; |
|
| 219 | + if(!is_dir("./files/member_extra_info/profile_image")) { |
|
| 220 | + return true; |
|
| 221 | + } |
|
| 192 | 222 | // Add a column(is_register) to "member_auth_mail" table (22/04/2008) |
| 193 | 223 | $act = $oDB->isColumnExists("member_auth_mail", "is_register"); |
| 194 | - if(!$act) return true; |
|
| 224 | + if(!$act) { |
|
| 225 | + return true; |
|
| 226 | + } |
|
| 195 | 227 | // Add a column(site_srl) to "member_group_member" table (11/15/2008) |
| 196 | - if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true; |
|
| 197 | - if(!$oDB->isColumnExists("member_group", "site_srl")) return true; |
|
| 198 | - if($oDB->isIndexExists("member_group","uni_member_group_title")) return true; |
|
| 228 | + if(!$oDB->isColumnExists("member_group_member", "site_srl")) { |
|
| 229 | + return true; |
|
| 230 | + } |
|
| 231 | + if(!$oDB->isColumnExists("member_group", "site_srl")) { |
|
| 232 | + return true; |
|
| 233 | + } |
|
| 234 | + if($oDB->isIndexExists("member_group","uni_member_group_title")) { |
|
| 235 | + return true; |
|
| 236 | + } |
|
| 199 | 237 | |
| 200 | 238 | // Add a column for list_order (05/18/2011) |
| 201 | - if(!$oDB->isColumnExists("member_group", "list_order")) return true; |
|
| 239 | + if(!$oDB->isColumnExists("member_group", "list_order")) { |
|
| 240 | + return true; |
|
| 241 | + } |
|
| 202 | 242 | |
| 203 | 243 | // image_mark 추가 (2009. 02. 14) |
| 204 | - if(!$oDB->isColumnExists("member_group", "image_mark")) return true; |
|
| 244 | + if(!$oDB->isColumnExists("member_group", "image_mark")) { |
|
| 245 | + return true; |
|
| 246 | + } |
|
| 205 | 247 | // Add c column for password expiration date |
| 206 | - if(!$oDB->isColumnExists("member", "change_password_date")) return true; |
|
| 248 | + if(!$oDB->isColumnExists("member", "change_password_date")) { |
|
| 249 | + return true; |
|
| 250 | + } |
|
| 207 | 251 | |
| 208 | 252 | // Add columns of question and answer to verify a password |
| 209 | - if(!$oDB->isColumnExists("member", "find_account_question")) return true; |
|
| 210 | - if(!$oDB->isColumnExists("member", "find_account_answer")) return true; |
|
| 253 | + if(!$oDB->isColumnExists("member", "find_account_question")) { |
|
| 254 | + return true; |
|
| 255 | + } |
|
| 256 | + if(!$oDB->isColumnExists("member", "find_account_answer")) { |
|
| 257 | + return true; |
|
| 258 | + } |
|
| 211 | 259 | |
| 212 | - if(!$oDB->isColumnExists("member", "list_order")) return true; |
|
| 213 | - if(!$oDB->isIndexExists("member","idx_list_order")) return true; |
|
| 260 | + if(!$oDB->isColumnExists("member", "list_order")) { |
|
| 261 | + return true; |
|
| 262 | + } |
|
| 263 | + if(!$oDB->isIndexExists("member","idx_list_order")) { |
|
| 264 | + return true; |
|
| 265 | + } |
|
| 214 | 266 | |
| 215 | 267 | $oModuleModel = getModel('module'); |
| 216 | 268 | $config = $oModuleModel->getModuleConfig('member'); |
| 217 | 269 | // check signup form ordering info |
| 218 | - if(!$config->signupForm) return true; |
|
| 270 | + if(!$config->signupForm) { |
|
| 271 | + return true; |
|
| 272 | + } |
|
| 219 | 273 | |
| 220 | 274 | foreach($config->signupForm as $form) |
| 221 | 275 | { |
@@ -226,7 +280,9 @@ discard block |
||
| 226 | 280 | } |
| 227 | 281 | |
| 228 | 282 | // check agreement field exist |
| 229 | - if($config->agreement) return true; |
|
| 283 | + if($config->agreement) { |
|
| 284 | + return true; |
|
| 285 | + } |
|
| 230 | 286 | |
| 231 | 287 | if($config->skin) |
| 232 | 288 | { |
@@ -234,25 +290,41 @@ discard block |
||
| 234 | 290 | if(count($config_parse) > 1) |
| 235 | 291 | { |
| 236 | 292 | $template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]); |
| 237 | - if(is_dir($template_path)) return true; |
|
| 293 | + if(is_dir($template_path)) { |
|
| 294 | + return true; |
|
| 295 | + } |
|
| 238 | 296 | } |
| 239 | 297 | } |
| 240 | 298 | |
| 241 | 299 | // supprot multilanguage agreement. |
| 242 | - if(is_readable('./files/member_extra_info/agreement.txt')) return true; |
|
| 300 | + if(is_readable('./files/member_extra_info/agreement.txt')) { |
|
| 301 | + return true; |
|
| 302 | + } |
|
| 243 | 303 | |
| 244 | 304 | // 2013. 11. 22 add menu when popup document menu called |
| 245 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true; |
|
| 246 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true; |
|
| 305 | + if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) { |
|
| 306 | + return true; |
|
| 307 | + } |
|
| 308 | + if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) { |
|
| 309 | + return true; |
|
| 310 | + } |
|
| 247 | 311 | |
| 248 | 312 | $oModuleController->insertUpdatedLog($version_update_id); |
| 249 | 313 | } |
| 250 | 314 | |
| 251 | - if(!is_readable('./files/ruleset/insertMember.xml')) return true; |
|
| 252 | - if(!is_readable('./files/ruleset/login.xml')) return true; |
|
| 253 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true; |
|
| 315 | + if(!is_readable('./files/ruleset/insertMember.xml')) { |
|
| 316 | + return true; |
|
| 317 | + } |
|
| 318 | + if(!is_readable('./files/ruleset/login.xml')) { |
|
| 319 | + return true; |
|
| 320 | + } |
|
| 321 | + if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) { |
|
| 322 | + return true; |
|
| 323 | + } |
|
| 254 | 324 | |
| 255 | - if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true; |
|
| 325 | + if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) { |
|
| 326 | + return true; |
|
| 327 | + } |
|
| 256 | 328 | |
| 257 | 329 | return false; |
| 258 | 330 | } |
@@ -390,10 +462,12 @@ discard block |
||
| 390 | 462 | } |
| 391 | 463 | |
| 392 | 464 | // 2013. 11. 22 add menu when popup document menu called |
| 393 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) |
|
| 394 | - $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'); |
|
| 395 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) |
|
| 396 | - $oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'); |
|
| 465 | + if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) { |
|
| 466 | + $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'); |
|
| 467 | + } |
|
| 468 | + if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) { |
|
| 469 | + $oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'); |
|
| 470 | + } |
|
| 397 | 471 | |
| 398 | 472 | if(is_readable('./files/member_extra_info/agreement.txt')) |
| 399 | 473 | { |
@@ -407,12 +481,15 @@ discard block |
||
| 407 | 481 | } |
| 408 | 482 | |
| 409 | 483 | FileHandler::makeDir('./files/ruleset'); |
| 410 | - if(!is_readable('./files/ruleset/insertMember.xml')) |
|
| 411 | - $oMemberAdminController->_createSignupRuleset($config->signupForm); |
|
| 412 | - if(!is_readable('./files/ruleset/login.xml')) |
|
| 413 | - $oMemberAdminController->_createLoginRuleset($config->identifier); |
|
| 414 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) |
|
| 415 | - $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
|
| 484 | + if(!is_readable('./files/ruleset/insertMember.xml')) { |
|
| 485 | + $oMemberAdminController->_createSignupRuleset($config->signupForm); |
|
| 486 | + } |
|
| 487 | + if(!is_readable('./files/ruleset/login.xml')) { |
|
| 488 | + $oMemberAdminController->_createLoginRuleset($config->identifier); |
|
| 489 | + } |
|
| 490 | + if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) { |
|
| 491 | + $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
|
| 492 | + } |
|
| 416 | 493 | |
| 417 | 494 | if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) |
| 418 | 495 | { |
@@ -437,7 +514,9 @@ discard block |
||
| 437 | 514 | */ |
| 438 | 515 | function recordLoginError($error = 0, $message = 'success') |
| 439 | 516 | { |
| 440 | - if($error == 0) return new BaseObject($error, $message); |
|
| 517 | + if($error == 0) { |
|
| 518 | + return new BaseObject($error, $message); |
|
| 519 | + } |
|
| 441 | 520 | |
| 442 | 521 | // Create a member model object |
| 443 | 522 | $oMemberModel = getModel('member'); |
@@ -445,7 +524,9 @@ discard block |
||
| 445 | 524 | |
| 446 | 525 | // Check if there is recoding table. |
| 447 | 526 | $oDB = &DB::getInstance(); |
| 448 | - if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 527 | + if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') { |
|
| 528 | + return new BaseObject($error, $message); |
|
| 529 | + } |
|
| 449 | 530 | |
| 450 | 531 | $args = new stdClass(); |
| 451 | 532 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
@@ -459,16 +540,14 @@ discard block |
||
| 459 | 540 | if($term < $config->max_error_count_time) |
| 460 | 541 | { |
| 461 | 542 | $args->count = $output->data->count + 1; |
| 462 | - } |
|
| 463 | - else |
|
| 543 | + } else |
|
| 464 | 544 | { |
| 465 | 545 | $args->count = 1; |
| 466 | 546 | } |
| 467 | 547 | unset($oMemberModel); |
| 468 | 548 | unset($config); |
| 469 | 549 | $output = executeQuery('member.updateLoginCountByIp', $args); |
| 470 | - } |
|
| 471 | - else |
|
| 550 | + } else |
|
| 472 | 551 | { |
| 473 | 552 | //insert |
| 474 | 553 | $args->count = 1; |
@@ -482,7 +561,9 @@ discard block |
||
| 482 | 561 | */ |
| 483 | 562 | function recordMemberLoginError($error = 0, $message = 'success', $args = NULL) |
| 484 | 563 | { |
| 485 | - if($error == 0 || !$args->member_srl) return new BaseObject($error, $message); |
|
| 564 | + if($error == 0 || !$args->member_srl) { |
|
| 565 | + return new BaseObject($error, $message); |
|
| 566 | + } |
|
| 486 | 567 | |
| 487 | 568 | // Create a member model object |
| 488 | 569 | $oMemberModel = getModel('member'); |
@@ -490,7 +571,9 @@ discard block |
||
| 490 | 571 | |
| 491 | 572 | // Check if there is recoding table. |
| 492 | 573 | $oDB = &DB::getInstance(); |
| 493 | - if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 574 | + if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') { |
|
| 575 | + return new BaseObject($error, $message); |
|
| 576 | + } |
|
| 494 | 577 | |
| 495 | 578 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
| 496 | 579 | if($output->data && $output->data->content) |
@@ -500,8 +583,7 @@ discard block |
||
| 500 | 583 | $content[] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |
| 501 | 584 | $args->content = serialize($content); |
| 502 | 585 | $output = executeQuery('member.updateLoginCountHistoryByMemberSrl', $args); |
| 503 | - } |
|
| 504 | - else |
|
| 586 | + } else |
|
| 505 | 587 | { |
| 506 | 588 | //insert |
| 507 | 589 | $content[0] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |