@@ -755,9 +755,9 @@ discard block |
||
| 755 | 755 | * Insert a profile image |
| 756 | 756 | * |
| 757 | 757 | * @param int $member_srl |
| 758 | - * @param object $target_file |
|
| 758 | + * @param string $target_file |
|
| 759 | 759 | * |
| 760 | - * @return void |
|
| 760 | + * @return BaseObject |
|
| 761 | 761 | */ |
| 762 | 762 | function insertProfileImage($member_srl, $target_file) |
| 763 | 763 | { |
@@ -867,9 +867,9 @@ discard block |
||
| 867 | 867 | * Insert a image name |
| 868 | 868 | * |
| 869 | 869 | * @param int $member_srl |
| 870 | - * @param object $target_file |
|
| 870 | + * @param string $target_file |
|
| 871 | 871 | * |
| 872 | - * @return void |
|
| 872 | + * @return BaseObject |
|
| 873 | 873 | */ |
| 874 | 874 | function insertImageName($member_srl, $target_file) |
| 875 | 875 | { |
@@ -957,7 +957,7 @@ discard block |
||
| 957 | 957 | /** |
| 958 | 958 | * Delete Image name |
| 959 | 959 | * |
| 960 | - * @return void |
|
| 960 | + * @return BaseObject |
|
| 961 | 961 | */ |
| 962 | 962 | function procMemberDeleteImageName($_memberSrl = 0) |
| 963 | 963 | { |
@@ -1010,9 +1010,9 @@ discard block |
||
| 1010 | 1010 | * Insert a image mark |
| 1011 | 1011 | * |
| 1012 | 1012 | * @param int $member_srl |
| 1013 | - * @param object $target_file |
|
| 1013 | + * @param string $target_file |
|
| 1014 | 1014 | * |
| 1015 | - * @return void |
|
| 1015 | + * @return BaseObject |
|
| 1016 | 1016 | */ |
| 1017 | 1017 | function insertImageMark($member_srl, $target_file) |
| 1018 | 1018 | { |
@@ -1532,6 +1532,9 @@ discard block |
||
| 1532 | 1532 | $this->setRedirectUrl($returnUrl); |
| 1533 | 1533 | } |
| 1534 | 1534 | |
| 1535 | + /** |
|
| 1536 | + * @param stdClass $auth_args |
|
| 1537 | + */ |
|
| 1535 | 1538 | function _sendAuthMail($auth_args, $member_info) |
| 1536 | 1539 | { |
| 1537 | 1540 | $oMemberModel = getModel('member'); |
@@ -1664,7 +1667,7 @@ discard block |
||
| 1664 | 1667 | * @param int $member_srl |
| 1665 | 1668 | * @param string $signature |
| 1666 | 1669 | * |
| 1667 | - * @return void |
|
| 1670 | + * @return boolean|null |
|
| 1668 | 1671 | */ |
| 1669 | 1672 | function putSignature($member_srl, $signature) |
| 1670 | 1673 | { |
@@ -2066,6 +2069,8 @@ discard block |
||
| 2066 | 2069 | /** |
| 2067 | 2070 | * Logged method for providing a personalized menu |
| 2068 | 2071 | * Login information is used in the output widget, or personalized page |
| 2072 | + * @param string $act |
|
| 2073 | + * @param string $str |
|
| 2069 | 2074 | */ |
| 2070 | 2075 | function addMemberMenu($act, $str) |
| 2071 | 2076 | { |
@@ -2096,6 +2101,7 @@ discard block |
||
| 2096 | 2101 | |
| 2097 | 2102 | /** |
| 2098 | 2103 | * Add users to the member table |
| 2104 | + * @param stdClass $args |
|
| 2099 | 2105 | */ |
| 2100 | 2106 | function insertMember(&$args, $password_is_hashed = false) |
| 2101 | 2107 | { |
@@ -2296,6 +2302,7 @@ discard block |
||
| 2296 | 2302 | * Modify member information |
| 2297 | 2303 | * |
| 2298 | 2304 | * @param bool $is_admin , modified 2013-11-22 |
| 2305 | + * @param stdClass $args |
|
| 2299 | 2306 | */ |
| 2300 | 2307 | function updateMember($args, $is_admin = FALSE) |
| 2301 | 2308 | { |
@@ -2500,6 +2507,7 @@ discard block |
||
| 2500 | 2507 | |
| 2501 | 2508 | /** |
| 2502 | 2509 | * Modify member password |
| 2510 | + * @param stdClass $args |
|
| 2503 | 2511 | */ |
| 2504 | 2512 | function updateMemberPassword($args) |
| 2505 | 2513 | { |
@@ -2534,6 +2542,9 @@ discard block |
||
| 2534 | 2542 | return $output; |
| 2535 | 2543 | } |
| 2536 | 2544 | |
| 2545 | + /** |
|
| 2546 | + * @param string $answer |
|
| 2547 | + */ |
|
| 2537 | 2548 | function updateFindAccountAnswer($member_srl, $answer) |
| 2538 | 2549 | { |
| 2539 | 2550 | $oPassword = new Password(); |
@@ -2793,7 +2804,7 @@ discard block |
||
| 2793 | 2804 | * |
| 2794 | 2805 | * @param array &$menu_list |
| 2795 | 2806 | * |
| 2796 | - * @return object |
|
| 2807 | + * @return BaseObject |
|
| 2797 | 2808 | **/ |
| 2798 | 2809 | function triggerGetDocumentMenu(&$menu_list) |
| 2799 | 2810 | { |
@@ -2823,7 +2834,7 @@ discard block |
||
| 2823 | 2834 | * |
| 2824 | 2835 | * @param array &$menu_list |
| 2825 | 2836 | * |
| 2826 | - * @return object |
|
| 2837 | + * @return BaseObject |
|
| 2827 | 2838 | **/ |
| 2828 | 2839 | function triggerGetCommentMenu(&$menu_list) |
| 2829 | 2840 | { |
@@ -2851,7 +2862,7 @@ discard block |
||
| 2851 | 2862 | /** |
| 2852 | 2863 | * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string |
| 2853 | 2864 | * |
| 2854 | - * @return object |
|
| 2865 | + * @return BaseObject |
|
| 2855 | 2866 | **/ |
| 2856 | 2867 | function procMemberSpammerManage() |
| 2857 | 2868 | { |
@@ -34,25 +34,25 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | function procMemberLogin($user_id = null, $password = null, $keep_signed = null) |
| 36 | 36 | { |
| 37 | - if(!$user_id && !$password && Context::getRequestMethod() == 'GET') |
|
| 37 | + if (!$user_id && !$password && Context::getRequestMethod() == 'GET') |
|
| 38 | 38 | { |
| 39 | 39 | $this->setRedirectUrl(getNotEncodedUrl('')); |
| 40 | 40 | return new BaseObject(-1, 'null_user_id'); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | // Variables |
| 44 | - if(!$user_id) $user_id = Context::get('user_id'); |
|
| 44 | + if (!$user_id) $user_id = Context::get('user_id'); |
|
| 45 | 45 | $user_id = trim($user_id); |
| 46 | 46 | |
| 47 | - if(!$password) $password = Context::get('password'); |
|
| 47 | + if (!$password) $password = Context::get('password'); |
|
| 48 | 48 | $password = trim($password); |
| 49 | 49 | |
| 50 | - if(!$keep_signed) $keep_signed = Context::get('keep_signed'); |
|
| 50 | + if (!$keep_signed) $keep_signed = Context::get('keep_signed'); |
|
| 51 | 51 | // Return an error when id and password doesn't exist |
| 52 | - if(!$user_id) return new BaseObject(-1,'null_user_id'); |
|
| 53 | - if(!$password) return new BaseObject(-1,'null_password'); |
|
| 52 | + if (!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
| 53 | + if (!$password) return new BaseObject(-1, 'null_password'); |
|
| 54 | 54 | |
| 55 | - $output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false); |
|
| 55 | + $output = $this->doLogin($user_id, $password, $keep_signed == 'Y' ?true:false); |
|
| 56 | 56 | if (!$output->toBool()) return $output; |
| 57 | 57 | |
| 58 | 58 | $oModuleModel = getModel('module'); |
@@ -62,13 +62,13 @@ discard block |
||
| 62 | 62 | $limit_date = $config->change_password_date; |
| 63 | 63 | |
| 64 | 64 | // Check if change_password_date is set |
| 65 | - if($limit_date > 0) |
|
| 65 | + if ($limit_date > 0) |
|
| 66 | 66 | { |
| 67 | 67 | $oMemberModel = getModel('member'); |
| 68 | - if($this->memberInfo->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day'))) |
|
| 68 | + if ($this->memberInfo->change_password_date < date('YmdHis', strtotime('-'.$limit_date.' day'))) |
|
| 69 | 69 | { |
| 70 | 70 | $msg = sprintf(Context::getLang('msg_change_password_date'), $limit_date); |
| 71 | - return $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword'), new BaseObject(-1, $msg)); |
|
| 71 | + return $this->setRedirectUrl(getNotEncodedUrl('', 'vid', Context::get('vid'), 'mid', Context::get('mid'), 'act', 'dispMemberModifyPassword'), new BaseObject(-1, $msg)); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $args->member_srl = $this->memberInfo->member_srl; |
| 78 | 78 | executeQuery('member.deleteAuthMail', $args); |
| 79 | 79 | |
| 80 | - if(!$config->after_login_url) |
|
| 80 | + if (!$config->after_login_url) |
|
| 81 | 81 | { |
| 82 | 82 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); |
| 83 | 83 | } |
@@ -98,18 +98,18 @@ discard block |
||
| 98 | 98 | // Call a trigger before log-out (before) |
| 99 | 99 | $logged_info = Context::get('logged_info'); |
| 100 | 100 | $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info); |
| 101 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 101 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 102 | 102 | // Destroy session information |
| 103 | 103 | $this->destroySessionInfo(); |
| 104 | 104 | // Call a trigger after log-out (after) |
| 105 | 105 | $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info); |
| 106 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 106 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 107 | 107 | |
| 108 | 108 | $output = new BaseObject(); |
| 109 | 109 | |
| 110 | 110 | $oModuleModel = getModel('module'); |
| 111 | 111 | $config = $oModuleModel->getModuleConfig('member'); |
| 112 | - if($config->after_logout_url) |
|
| 112 | + if ($config->after_logout_url) |
|
| 113 | 113 | $output->redirect_url = $config->after_logout_url; |
| 114 | 114 | |
| 115 | 115 | $this->_clearMemberCache($logged_info->member_srl); |
@@ -127,18 +127,18 @@ discard block |
||
| 127 | 127 | $oModuleModel = &getModel('module'); |
| 128 | 128 | |
| 129 | 129 | // Check login information |
| 130 | - if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
| 130 | + if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
| 131 | 131 | $logged_info = Context::get('logged_info'); |
| 132 | 132 | |
| 133 | - $document_srl = (int)Context::get('document_srl'); |
|
| 134 | - if(!$document_srl) $document_srl = (int)Context::get('target_srl'); |
|
| 135 | - if(!$document_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
| 133 | + $document_srl = (int) Context::get('document_srl'); |
|
| 134 | + if (!$document_srl) $document_srl = (int) Context::get('target_srl'); |
|
| 135 | + if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 136 | 136 | |
| 137 | 137 | // Get document |
| 138 | 138 | $oDocumentModel = getModel('document'); |
| 139 | 139 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 140 | 140 | |
| 141 | - if($oDocument->isSecret() && !$oDocument->isGranted()) |
|
| 141 | + if ($oDocument->isSecret() && !$oDocument->isGranted()) |
|
| 142 | 142 | { |
| 143 | 143 | return new BaseObject(-1, 'msg_is_secret'); |
| 144 | 144 | } |
@@ -147,19 +147,19 @@ discard block |
||
| 147 | 147 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')); |
| 148 | 148 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
| 149 | 149 | |
| 150 | - if(!$grant->access) |
|
| 150 | + if (!$grant->access) |
|
| 151 | 151 | { |
| 152 | 152 | return new BaseObject(-1, 'msg_not_permitted'); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | // 게시판 모듈에서 글 목록 보기 권한이 없으면 스크랩 제한 |
| 156 | - if($module_info->module === 'board' && isset($grant->list) && !$grant->list) |
|
| 156 | + if ($module_info->module === 'board' && isset($grant->list) && !$grant->list) |
|
| 157 | 157 | { |
| 158 | 158 | return new BaseObject(-1, 'msg_not_permitted'); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | // 게시판 모듈에서 상담 기능 사용 시 권한이 없는 게시물(타인의 게시물) 스크랩 제한 |
| 162 | - if($module_info->module === 'board' && |
|
| 162 | + if ($module_info->module === 'board' && |
|
| 163 | 163 | $module_info->consultation === 'Y' && |
| 164 | 164 | isset($grant->consultation_read) && |
| 165 | 165 | !$grant->consultation_read && !$oDocument->isGranted() |
@@ -180,11 +180,11 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | // Check if already scrapped |
| 182 | 182 | $output = executeQuery('member.getScrapDocument', $args); |
| 183 | - if($output->data->count) return new BaseObject(-1, 'msg_alreay_scrapped'); |
|
| 183 | + if ($output->data->count) return new BaseObject(-1, 'msg_alreay_scrapped'); |
|
| 184 | 184 | |
| 185 | 185 | // Insert |
| 186 | 186 | $output = executeQuery('member.addScrapDocument', $args); |
| 187 | - if(!$output->toBool()) return $output; |
|
| 187 | + if (!$output->toBool()) return $output; |
|
| 188 | 188 | |
| 189 | 189 | $this->setError(-1); |
| 190 | 190 | $this->setMessage('success_registed'); |
@@ -198,11 +198,11 @@ discard block |
||
| 198 | 198 | function procMemberDeleteScrap() |
| 199 | 199 | { |
| 200 | 200 | // Check login information |
| 201 | - if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
| 201 | + if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
| 202 | 202 | $logged_info = Context::get('logged_info'); |
| 203 | 203 | |
| 204 | - $document_srl = (int)Context::get('document_srl'); |
|
| 205 | - if(!$document_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
| 204 | + $document_srl = (int) Context::get('document_srl'); |
|
| 205 | + if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 206 | 206 | // Variables |
| 207 | 207 | $args = new stdClass; |
| 208 | 208 | $args->member_srl = $logged_info->member_srl; |
@@ -228,23 +228,23 @@ discard block |
||
| 228 | 228 | function procMemberDeleteSavedDocument() |
| 229 | 229 | { |
| 230 | 230 | // Check login information |
| 231 | - if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
| 231 | + if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged'); |
|
| 232 | 232 | $logged_info = Context::get('logged_info'); |
| 233 | 233 | |
| 234 | - $document_srl = (int)Context::get('document_srl'); |
|
| 235 | - if(!$document_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
| 234 | + $document_srl = (int) Context::get('document_srl'); |
|
| 235 | + if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 236 | 236 | |
| 237 | 237 | $oDocumentModel = getModel('document'); |
| 238 | 238 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 239 | 239 | if ($oDocument->get('member_srl') != $logged_info->member_srl) |
| 240 | 240 | { |
| 241 | - return new BaseObject(-1,'msg_invalid_request'); |
|
| 241 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | $configStatusList = $oDocumentModel->getStatusList(); |
| 245 | 245 | if ($oDocument->get('status') != $configStatusList['temp']) |
| 246 | 246 | { |
| 247 | - return new BaseObject(-1,'msg_invalid_request'); |
|
| 247 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | $oDocumentController = getController('document'); |
@@ -260,37 +260,37 @@ discard block |
||
| 260 | 260 | { |
| 261 | 261 | $name = Context::get('name'); |
| 262 | 262 | $value = Context::get('value'); |
| 263 | - if(!$value) return; |
|
| 263 | + if (!$value) return; |
|
| 264 | 264 | |
| 265 | 265 | $oMemberModel = getModel('member'); |
| 266 | 266 | // Check if logged-in |
| 267 | 267 | $logged_info = Context::get('logged_info'); |
| 268 | 268 | |
| 269 | 269 | |
| 270 | - switch($name) |
|
| 270 | + switch ($name) |
|
| 271 | 271 | { |
| 272 | 272 | case 'user_id' : |
| 273 | 273 | // Check denied ID |
| 274 | - if($oMemberModel->isDeniedID($value)) return new BaseObject(0,'denied_user_id'); |
|
| 274 | + if ($oMemberModel->isDeniedID($value)) return new BaseObject(0, 'denied_user_id'); |
|
| 275 | 275 | // Check if duplicated |
| 276 | 276 | $member_srl = $oMemberModel->getMemberSrlByUserID($value); |
| 277 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_user_id'); |
|
| 277 | + if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_user_id'); |
|
| 278 | 278 | break; |
| 279 | 279 | case 'nick_name' : |
| 280 | 280 | // Check denied ID |
| 281 | - if($oMemberModel->isDeniedNickName($value)) |
|
| 281 | + if ($oMemberModel->isDeniedNickName($value)) |
|
| 282 | 282 | { |
| 283 | - return new BaseObject(0,'denied_nick_name'); |
|
| 283 | + return new BaseObject(0, 'denied_nick_name'); |
|
| 284 | 284 | } |
| 285 | 285 | // Check if duplicated |
| 286 | 286 | $member_srl = $oMemberModel->getMemberSrlByNickName($value); |
| 287 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_nick_name'); |
|
| 287 | + if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_nick_name'); |
|
| 288 | 288 | |
| 289 | 289 | break; |
| 290 | 290 | case 'email_address' : |
| 291 | 291 | // Check if duplicated |
| 292 | 292 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($value); |
| 293 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_email_address'); |
|
| 293 | + if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_email_address'); |
|
| 294 | 294 | break; |
| 295 | 295 | } |
| 296 | 296 | } |
@@ -302,25 +302,25 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | function procMemberInsert() |
| 304 | 304 | { |
| 305 | - if (Context::getRequestMethod () == "GET") return new BaseObject(-1, "msg_invalid_request"); |
|
| 306 | - $oMemberModel = &getModel ('member'); |
|
| 305 | + if (Context::getRequestMethod() == "GET") return new BaseObject(-1, "msg_invalid_request"); |
|
| 306 | + $oMemberModel = &getModel('member'); |
|
| 307 | 307 | $config = $oMemberModel->getMemberConfig(); |
| 308 | 308 | |
| 309 | 309 | // call a trigger (before) |
| 310 | - $trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config); |
|
| 311 | - if(!$trigger_output->toBool ()) return $trigger_output; |
|
| 310 | + $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config); |
|
| 311 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 312 | 312 | // Check if an administrator allows a membership |
| 313 | - if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled'); |
|
| 313 | + if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled'); |
|
| 314 | 314 | // Check if the user accept the license terms (only if terms exist) |
| 315 | - if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement'); |
|
| 315 | + if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement'); |
|
| 316 | 316 | |
| 317 | 317 | // Extract the necessary information in advance |
| 318 | 318 | $getVars = array(); |
| 319 | - if($config->signupForm) |
|
| 319 | + if ($config->signupForm) |
|
| 320 | 320 | { |
| 321 | - foreach($config->signupForm as $formInfo) |
|
| 321 | + foreach ($config->signupForm as $formInfo) |
|
| 322 | 322 | { |
| 323 | - if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 323 | + if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 324 | 324 | { |
| 325 | 325 | $getVars[] = $formInfo->name; |
| 326 | 326 | } |
@@ -328,22 +328,22 @@ discard block |
||
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | $args = new stdClass; |
| 331 | - foreach($getVars as $val) |
|
| 331 | + foreach ($getVars as $val) |
|
| 332 | 332 | { |
| 333 | 333 | $args->{$val} = Context::get($val); |
| 334 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 334 | + if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 335 | 335 | } |
| 336 | 336 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
| 337 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 337 | + if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 338 | 338 | |
| 339 | 339 | $args->find_account_answer = Context::get('find_account_answer'); |
| 340 | 340 | $args->allow_mailing = Context::get('allow_mailing'); |
| 341 | 341 | $args->allow_message = Context::get('allow_message'); |
| 342 | 342 | |
| 343 | - if($args->password1) $args->password = $args->password1; |
|
| 343 | + if ($args->password1) $args->password = $args->password1; |
|
| 344 | 344 | |
| 345 | 345 | // check password strength |
| 346 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 346 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 347 | 347 | { |
| 348 | 348 | $message = Context::getLang('about_password_strength'); |
| 349 | 349 | return new BaseObject(-1, $message[$config->password_strength]); |
@@ -369,58 +369,58 @@ discard block |
||
| 369 | 369 | unset($all_args->secret_text); |
| 370 | 370 | |
| 371 | 371 | // Set the user state as "denied" when using mail authentication |
| 372 | - if($config->enable_confirm == 'Y') $args->denied = 'Y'; |
|
| 372 | + if ($config->enable_confirm == 'Y') $args->denied = 'Y'; |
|
| 373 | 373 | // Add extra vars after excluding necessary information from all the requested arguments |
| 374 | 374 | $extra_vars = delObjectVars($all_args, $args); |
| 375 | 375 | $args->extra_vars = serialize($extra_vars); |
| 376 | 376 | |
| 377 | 377 | // remove whitespace |
| 378 | 378 | $checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address'); |
| 379 | - foreach($checkInfos as $val) |
|
| 379 | + foreach ($checkInfos as $val) |
|
| 380 | 380 | { |
| 381 | - if(isset($args->{$val})) |
|
| 381 | + if (isset($args->{$val})) |
|
| 382 | 382 | { |
| 383 | 383 | $args->{$val} = preg_replace('/[\pZ\pC]+/u', '', html_entity_decode($args->{$val})); |
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | $output = $this->insertMember($args); |
| 387 | - if(!$output->toBool()) return $output; |
|
| 387 | + if (!$output->toBool()) return $output; |
|
| 388 | 388 | |
| 389 | 389 | // insert ProfileImage, ImageName, ImageMark |
| 390 | 390 | $profile_image = Context::get('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 = Context::get('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 = Context::get('image_name'); |
| 403 | - if(is_uploaded_file($image_name['tmp_name'])) |
|
| 403 | + if (is_uploaded_file($image_name['tmp_name'])) |
|
| 404 | 404 | { |
| 405 | 405 | $this->insertImageName($args->member_srl, $image_name['tmp_name']); |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | // If a virtual site, join the site |
| 409 | 409 | $site_module_info = Context::get('site_module_info'); |
| 410 | - if($site_module_info->site_srl > 0) |
|
| 410 | + if ($site_module_info->site_srl > 0) |
|
| 411 | 411 | { |
| 412 | 412 | $columnList = array('site_srl', 'group_srl'); |
| 413 | 413 | $default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList); |
| 414 | - if($default_group->group_srl) |
|
| 414 | + if ($default_group->group_srl) |
|
| 415 | 415 | { |
| 416 | 416 | $this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl); |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | } |
| 420 | 420 | // Log-in |
| 421 | - if($config->enable_confirm != 'Y') |
|
| 421 | + if ($config->enable_confirm != 'Y') |
|
| 422 | 422 | { |
| 423 | - if($config->identifier == 'email_address') |
|
| 423 | + if ($config->identifier == 'email_address') |
|
| 424 | 424 | { |
| 425 | 425 | $output = $this->doLogin($args->email_address); |
| 426 | 426 | } |
@@ -428,8 +428,8 @@ discard block |
||
| 428 | 428 | { |
| 429 | 429 | $output = $this->doLogin($args->user_id); |
| 430 | 430 | } |
| 431 | - if(!$output->toBool()) { |
|
| 432 | - if($output->error == -9) |
|
| 431 | + if (!$output->toBool()) { |
|
| 432 | + if ($output->error == -9) |
|
| 433 | 433 | $output->error = -11; |
| 434 | 434 | return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output); |
| 435 | 435 | } |
@@ -437,8 +437,8 @@ discard block |
||
| 437 | 437 | |
| 438 | 438 | // Results |
| 439 | 439 | $this->add('member_srl', $args->member_srl); |
| 440 | - if($config->redirect_url) $this->add('redirect_url', $config->redirect_url); |
|
| 441 | - if($config->enable_confirm == 'Y') |
|
| 440 | + if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url); |
|
| 441 | + if ($config->enable_confirm == 'Y') |
|
| 442 | 442 | { |
| 443 | 443 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
| 444 | 444 | $this->setMessage($msg); |
@@ -447,19 +447,19 @@ discard block |
||
| 447 | 447 | else $this->setMessage('success_registed'); |
| 448 | 448 | // Call a trigger (after) |
| 449 | 449 | $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config); |
| 450 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 450 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 451 | 451 | |
| 452 | - if($config->redirect_url) |
|
| 452 | + if ($config->redirect_url) |
|
| 453 | 453 | { |
| 454 | 454 | $returnUrl = $config->redirect_url; |
| 455 | 455 | } |
| 456 | 456 | else |
| 457 | 457 | { |
| 458 | - if(Context::get('success_return_url')) |
|
| 458 | + if (Context::get('success_return_url')) |
|
| 459 | 459 | { |
| 460 | 460 | $returnUrl = Context::get('success_return_url'); |
| 461 | 461 | } |
| 462 | - else if($_COOKIE['XE_REDIRECT_URL']) |
|
| 462 | + else if ($_COOKIE['XE_REDIRECT_URL']) |
|
| 463 | 463 | { |
| 464 | 464 | $returnUrl = $_COOKIE['XE_REDIRECT_URL']; |
| 465 | 465 | setcookie("XE_REDIRECT_URL", '', 1); |
@@ -473,26 +473,26 @@ discard block |
||
| 473 | 473 | |
| 474 | 474 | function procMemberModifyInfoBefore() |
| 475 | 475 | { |
| 476 | - if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD') |
|
| 476 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD') |
|
| 477 | 477 | { |
| 478 | 478 | return $this->stop('msg_invalid_request'); |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | - if(!Context::get('is_logged')) |
|
| 481 | + if (!Context::get('is_logged')) |
|
| 482 | 482 | { |
| 483 | 483 | return $this->stop('msg_not_logged'); |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | $password = Context::get('password'); |
| 487 | 487 | |
| 488 | - if(!$password) |
|
| 488 | + if (!$password) |
|
| 489 | 489 | { |
| 490 | 490 | return $this->stop('msg_invalid_request'); |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | $oMemberModel = getModel('member'); |
| 494 | 494 | |
| 495 | - if(!$this->memberInfo->password) |
|
| 495 | + if (!$this->memberInfo->password) |
|
| 496 | 496 | { |
| 497 | 497 | // Get information of logged-in user |
| 498 | 498 | $logged_info = Context::get('logged_info'); |
@@ -503,14 +503,14 @@ discard block |
||
| 503 | 503 | $this->memberInfo->password = $memberInfo->password; |
| 504 | 504 | } |
| 505 | 505 | // Verify the current password |
| 506 | - if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) |
|
| 506 | + if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) |
|
| 507 | 507 | { |
| 508 | 508 | return new BaseObject(-1, 'invalid_password'); |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | $_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD'; |
| 512 | 512 | |
| 513 | - if(Context::get('success_return_url')) |
|
| 513 | + if (Context::get('success_return_url')) |
|
| 514 | 514 | { |
| 515 | 515 | $redirectUrl = Context::get('success_return_url'); |
| 516 | 516 | } |
@@ -528,12 +528,12 @@ discard block |
||
| 528 | 528 | */ |
| 529 | 529 | function procMemberModifyInfo() |
| 530 | 530 | { |
| 531 | - if(!Context::get('is_logged')) |
|
| 531 | + if (!Context::get('is_logged')) |
|
| 532 | 532 | { |
| 533 | 533 | return $this->stop('msg_not_logged'); |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | - if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
| 536 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
| 537 | 537 | { |
| 538 | 538 | return $this->stop('msg_invalid_request'); |
| 539 | 539 | } |
@@ -541,13 +541,13 @@ discard block |
||
| 541 | 541 | |
| 542 | 542 | // Extract the necessary information in advance |
| 543 | 543 | $oMemberModel = getModel('member'); |
| 544 | - $config = $oMemberModel->getMemberConfig (); |
|
| 545 | - $getVars = array('find_account_answer','allow_mailing','allow_message'); |
|
| 546 | - if($config->signupForm) |
|
| 544 | + $config = $oMemberModel->getMemberConfig(); |
|
| 545 | + $getVars = array('find_account_answer', 'allow_mailing', 'allow_message'); |
|
| 546 | + if ($config->signupForm) |
|
| 547 | 547 | { |
| 548 | - foreach($config->signupForm as $formInfo) |
|
| 548 | + foreach ($config->signupForm as $formInfo) |
|
| 549 | 549 | { |
| 550 | - if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 550 | + if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 551 | 551 | { |
| 552 | 552 | $getVars[] = $formInfo->name; |
| 553 | 553 | } |
@@ -555,11 +555,11 @@ discard block |
||
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | $args = new stdClass; |
| 558 | - foreach($getVars as $val) |
|
| 558 | + foreach ($getVars as $val) |
|
| 559 | 559 | { |
| 560 | 560 | $args->{$val} = Context::get($val); |
| 561 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 562 | - if($val == 'find_account_answer' && !Context::get($val)) { |
|
| 561 | + if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 562 | + if ($val == 'find_account_answer' && !Context::get($val)) { |
|
| 563 | 563 | unset($args->{$val}); |
| 564 | 564 | } |
| 565 | 565 | } |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | $logged_info = Context::get('logged_info'); |
| 569 | 569 | $args->member_srl = $logged_info->member_srl; |
| 570 | 570 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
| 571 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 571 | + if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 572 | 572 | |
| 573 | 573 | // Remove some unnecessary variables from all the vars |
| 574 | 574 | $all_args = Context::getRequestVars(); |
@@ -593,9 +593,9 @@ discard block |
||
| 593 | 593 | |
| 594 | 594 | // remove whitespace |
| 595 | 595 | $checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address'); |
| 596 | - foreach($checkInfos as $val) |
|
| 596 | + foreach ($checkInfos as $val) |
|
| 597 | 597 | { |
| 598 | - if(isset($args->{$val})) |
|
| 598 | + if (isset($args->{$val})) |
|
| 599 | 599 | { |
| 600 | 600 | $args->{$val} = preg_replace('/[\pZ\pC]+/u', '', html_entity_decode($args->{$val})); |
| 601 | 601 | } |
@@ -603,22 +603,22 @@ discard block |
||
| 603 | 603 | |
| 604 | 604 | // Execute insert or update depending on the value of member_srl |
| 605 | 605 | $output = $this->updateMember($args); |
| 606 | - if(!$output->toBool()) return $output; |
|
| 606 | + if (!$output->toBool()) return $output; |
|
| 607 | 607 | |
| 608 | 608 | $profile_image = Context::get('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 = Context::get('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 = Context::get('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 = Context::get('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 = Context::get('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 = Context::get('image_mark'); |
| 990 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 990 | + if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 991 | 991 | // Ignore if member_srl is invalid or doesn't exist. |
| 992 | 992 | $member_srl = Context::get('member_srl'); |
| 993 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 993 | + if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 994 | 994 | |
| 995 | 995 | $logged_info = Context::get('logged_info'); |
| 996 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 996 | + if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 997 | 997 | // Membership in the images mark the module using the ban was set by an administrator or return; |
| 998 | 998 | $oMemberModel = getModel('member'); |
| 999 | 999 | $config = $oMemberModel->getMemberConfig(); |
| 1000 | - if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1000 | + if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1001 | 1001 | |
| 1002 | 1002 | $this->insertImageMark($member_srl, $file['tmp_name']); |
| 1003 | - if(!$output->toBool()) return $output; |
|
| 1003 | + if (!$output->toBool()) return $output; |
|
| 1004 | 1004 | |
| 1005 | 1005 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
| 1006 | 1006 | $this->setRedirectUrl($returnUrl); |
@@ -1022,7 +1022,7 @@ discard block |
||
| 1022 | 1022 | $max_height = $config->image_mark_max_height; |
| 1023 | 1023 | $max_filesize = $config->image_mark_max_filesize; |
| 1024 | 1024 | |
| 1025 | - Context::loadLang(_XE_PATH_ . 'modules/file/lang'); |
|
| 1025 | + Context::loadLang(_XE_PATH_.'modules/file/lang'); |
|
| 1026 | 1026 | |
| 1027 | 1027 | $target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); |
| 1028 | 1028 | FileHandler::makeDir($target_path); |
@@ -1031,7 +1031,7 @@ discard block |
||
| 1031 | 1031 | // Get file information |
| 1032 | 1032 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 1033 | 1033 | |
| 1034 | - if($width > $max_width || $height > $max_height || $type!=1) |
|
| 1034 | + if ($width > $max_width || $height > $max_height || $type != 1) |
|
| 1035 | 1035 | { |
| 1036 | 1036 | $temp_filename = sprintf('files/cache/tmp/image_mark_%d.gif', $member_srl); |
| 1037 | 1037 | FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif'); |
@@ -1039,10 +1039,10 @@ discard block |
||
| 1039 | 1039 | // 파일 용량 제한 |
| 1040 | 1040 | FileHandler::clearStatCache($temp_filename); |
| 1041 | 1041 | $filesize = filesize($temp_filename); |
| 1042 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 1042 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 1043 | 1043 | { |
| 1044 | 1044 | FileHandler::removeFile($temp_filename); |
| 1045 | - return $this->stop(implode(' ' , array( |
|
| 1045 | + return $this->stop(implode(' ', array( |
|
| 1046 | 1046 | Context::getLang('msg_not_uploaded_group_image_mark'), |
| 1047 | 1047 | Context::getLang('msg_exceeds_limit_size') |
| 1048 | 1048 | ))); |
@@ -1055,10 +1055,10 @@ discard block |
||
| 1055 | 1055 | else |
| 1056 | 1056 | { |
| 1057 | 1057 | $filesize = filesize($target_file); |
| 1058 | - if($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 1058 | + if ($max_filesize && $filesize > ($max_filesize * 1024)) |
|
| 1059 | 1059 | { |
| 1060 | 1060 | FileHandler::removeFile($target_file); |
| 1061 | - return $this->stop(implode(' ' , array( |
|
| 1061 | + return $this->stop(implode(' ', array( |
|
| 1062 | 1062 | Context::getLang('msg_not_uploaded_group_image_mark'), |
| 1063 | 1063 | Context::getLang('msg_exceeds_limit_size') |
| 1064 | 1064 | ))); |
@@ -1080,20 +1080,20 @@ discard block |
||
| 1080 | 1080 | function procMemberDeleteImageMark($_memberSrl = 0) |
| 1081 | 1081 | { |
| 1082 | 1082 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
| 1083 | - if(!$member_srl) |
|
| 1083 | + if (!$member_srl) |
|
| 1084 | 1084 | { |
| 1085 | - return new BaseObject(0,'success'); |
|
| 1085 | + return new BaseObject(0, 'success'); |
|
| 1086 | 1086 | } |
| 1087 | 1087 | |
| 1088 | 1088 | $logged_info = Context::get('logged_info'); |
| 1089 | 1089 | |
| 1090 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 1090 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 1091 | 1091 | { |
| 1092 | 1092 | $oMemberModel = getModel('member'); |
| 1093 | 1093 | $image_mark = $oMemberModel->getImageMark($member_srl); |
| 1094 | 1094 | FileHandler::removeFile($image_mark->file); |
| 1095 | 1095 | } |
| 1096 | - return new BaseObject(0,'success'); |
|
| 1096 | + return new BaseObject(0, 'success'); |
|
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | 1099 | /** |
@@ -1104,26 +1104,26 @@ discard block |
||
| 1104 | 1104 | function procMemberFindAccount() |
| 1105 | 1105 | { |
| 1106 | 1106 | $email_address = Context::get('email_address'); |
| 1107 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1107 | + if (!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1108 | 1108 | |
| 1109 | 1109 | $oMemberModel = getModel('member'); |
| 1110 | 1110 | $oModuleModel = getModel('module'); |
| 1111 | 1111 | |
| 1112 | 1112 | // Check if a member having the same email address exists |
| 1113 | 1113 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1114 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1114 | + if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1115 | 1115 | |
| 1116 | 1116 | // Get information of the member |
| 1117 | 1117 | $columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name'); |
| 1118 | 1118 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 1119 | 1119 | |
| 1120 | 1120 | // Check if possible to find member's ID and password |
| 1121 | - if($member_info->denied == 'Y') |
|
| 1121 | + if ($member_info->denied == 'Y') |
|
| 1122 | 1122 | { |
| 1123 | 1123 | $chk_args = new stdClass; |
| 1124 | 1124 | $chk_args->member_srl = $member_info->member_srl; |
| 1125 | 1125 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1126 | - if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
| 1126 | + if ($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
| 1127 | 1127 | } |
| 1128 | 1128 | |
| 1129 | 1129 | // Insert data into the authentication DB |
@@ -1136,19 +1136,19 @@ discard block |
||
| 1136 | 1136 | $args->is_register = 'N'; |
| 1137 | 1137 | |
| 1138 | 1138 | $output = executeQuery('member.insertAuthMail', $args); |
| 1139 | - if(!$output->toBool()) return $output; |
|
| 1139 | + if (!$output->toBool()) return $output; |
|
| 1140 | 1140 | // Get content of the email to send a member |
| 1141 | 1141 | Context::set('auth_args', $args); |
| 1142 | 1142 | |
| 1143 | 1143 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1144 | 1144 | $memberInfo = array(); |
| 1145 | 1145 | global $lang; |
| 1146 | - if(is_array($member_config->signupForm)) |
|
| 1146 | + if (is_array($member_config->signupForm)) |
|
| 1147 | 1147 | { |
| 1148 | - $exceptForm=array('password', 'find_account_question'); |
|
| 1149 | - foreach($member_config->signupForm as $form) |
|
| 1148 | + $exceptForm = array('password', 'find_account_question'); |
|
| 1149 | + foreach ($member_config->signupForm as $form) |
|
| 1150 | 1150 | { |
| 1151 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1151 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1152 | 1152 | { |
| 1153 | 1153 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1154 | 1154 | } |
@@ -1163,15 +1163,15 @@ discard block |
||
| 1163 | 1163 | } |
| 1164 | 1164 | Context::set('memberInfo', $memberInfo); |
| 1165 | 1165 | |
| 1166 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1167 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1166 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
| 1167 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1168 | 1168 | |
| 1169 | 1169 | Context::set('member_config', $member_config); |
| 1170 | 1170 | |
| 1171 | 1171 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1172 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1172 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1173 | 1173 | |
| 1174 | - $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
|
| 1174 | + $find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
|
| 1175 | 1175 | Context::set('find_url', $find_url); |
| 1176 | 1176 | |
| 1177 | 1177 | $oTemplate = &TemplateHandler::getInstance(); |
@@ -1181,19 +1181,19 @@ discard block |
||
| 1181 | 1181 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1182 | 1182 | // Send a mail |
| 1183 | 1183 | $oMail = new Mail(); |
| 1184 | - $oMail->setTitle( Context::getLang('msg_find_account_title') ); |
|
| 1184 | + $oMail->setTitle(Context::getLang('msg_find_account_title')); |
|
| 1185 | 1185 | $oMail->setContent($content); |
| 1186 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 1187 | - $oMail->setReceiptor( $member_info->user_name, $member_info->email_address ); |
|
| 1186 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 1187 | + $oMail->setReceiptor($member_info->user_name, $member_info->email_address); |
|
| 1188 | 1188 | $oMail->send(); |
| 1189 | 1189 | // Return message |
| 1190 | 1190 | $msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address); |
| 1191 | - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) |
|
| 1191 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 1192 | 1192 | { |
| 1193 | 1193 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount'); |
| 1194 | 1194 | $this->setRedirectUrl($returnUrl); |
| 1195 | 1195 | } |
| 1196 | - return new BaseObject(0,$msg); |
|
| 1196 | + return new BaseObject(0, $msg); |
|
| 1197 | 1197 | } |
| 1198 | 1198 | |
| 1199 | 1199 | /** |
@@ -1204,7 +1204,7 @@ discard block |
||
| 1204 | 1204 | function procMemberFindAccountByQuestion() |
| 1205 | 1205 | { |
| 1206 | 1206 | $oMemberModel = getModel('member'); |
| 1207 | - $oPassword = new Password(); |
|
| 1207 | + $oPassword = new Password(); |
|
| 1208 | 1208 | $config = $oMemberModel->getMemberConfig(); |
| 1209 | 1209 | |
| 1210 | 1210 | $email_address = Context::get('email_address'); |
@@ -1212,49 +1212,49 @@ discard block |
||
| 1212 | 1212 | $find_account_question = trim(Context::get('find_account_question')); |
| 1213 | 1213 | $find_account_answer = trim(Context::get('find_account_answer')); |
| 1214 | 1214 | |
| 1215 | - if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1215 | + if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1216 | 1216 | |
| 1217 | 1217 | $oModuleModel = getModel('module'); |
| 1218 | 1218 | // Check if a member having the same email address exists |
| 1219 | 1219 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1220 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1220 | + if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1221 | 1221 | |
| 1222 | 1222 | // Get information of the member |
| 1223 | 1223 | $columnList = array('member_srl', 'find_account_question', 'find_account_answer'); |
| 1224 | 1224 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 1225 | 1225 | |
| 1226 | 1226 | // Display a message if no answer is entered |
| 1227 | - if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
| 1227 | + if (!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
| 1228 | 1228 | |
| 1229 | 1229 | // 답변 확인 |
| 1230 | 1230 | $hashed = $oPassword->checkAlgorithm($member_info->find_account_answer); |
| 1231 | 1231 | $authed = true; |
| 1232 | 1232 | $member_info->find_account_question = trim($member_info->find_account_question); |
| 1233 | - if($member_info->find_account_question != $find_account_question) |
|
| 1233 | + if ($member_info->find_account_question != $find_account_question) |
|
| 1234 | 1234 | { |
| 1235 | 1235 | $authed = false; |
| 1236 | 1236 | } |
| 1237 | - else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
| 1237 | + else if ($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
| 1238 | 1238 | { |
| 1239 | 1239 | $authed = false; |
| 1240 | 1240 | } |
| 1241 | - else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
| 1241 | + else if (!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
| 1242 | 1242 | { |
| 1243 | 1243 | $authed = false; |
| 1244 | 1244 | } |
| 1245 | 1245 | |
| 1246 | - if(!$authed) |
|
| 1246 | + if (!$authed) |
|
| 1247 | 1247 | { |
| 1248 | 1248 | return new BaseObject(-1, 'msg_answer_not_matches'); |
| 1249 | 1249 | } |
| 1250 | 1250 | |
| 1251 | 1251 | // answer가 동일하고 hash 되지 않았으면 hash 값으로 저장 |
| 1252 | - if($authed && !$hashed) |
|
| 1252 | + if ($authed && !$hashed) |
|
| 1253 | 1253 | { |
| 1254 | 1254 | $this->updateFindAccountAnswer($member_srl, $find_account_answer); |
| 1255 | 1255 | } |
| 1256 | 1256 | |
| 1257 | - if($config->identifier == 'email_address') |
|
| 1257 | + if ($config->identifier == 'email_address') |
|
| 1258 | 1258 | { |
| 1259 | 1259 | $user_id = $email_address; |
| 1260 | 1260 | } |
@@ -1267,11 +1267,11 @@ discard block |
||
| 1267 | 1267 | $args->password = $temp_password; |
| 1268 | 1268 | $args->change_password_date = '1'; |
| 1269 | 1269 | $output = $this->updateMemberPassword($args); |
| 1270 | - if(!$output->toBool()) return $output; |
|
| 1270 | + if (!$output->toBool()) return $output; |
|
| 1271 | 1271 | |
| 1272 | - $_SESSION['xe_temp_password_' . $user_id] = $temp_password; |
|
| 1272 | + $_SESSION['xe_temp_password_'.$user_id] = $temp_password; |
|
| 1273 | 1273 | |
| 1274 | - $this->add('user_id',$user_id); |
|
| 1274 | + $this->add('user_id', $user_id); |
|
| 1275 | 1275 | |
| 1276 | 1276 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); |
| 1277 | 1277 | $this->setRedirectUrl($returnUrl.'&user_id='.$user_id); |
@@ -1291,7 +1291,7 @@ discard block |
||
| 1291 | 1291 | $member_srl = Context::get('member_srl'); |
| 1292 | 1292 | $auth_key = Context::get('auth_key'); |
| 1293 | 1293 | |
| 1294 | - if(!$member_srl || !$auth_key) |
|
| 1294 | + if (!$member_srl || !$auth_key) |
|
| 1295 | 1295 | { |
| 1296 | 1296 | return $this->stop('msg_invalid_request'); |
| 1297 | 1297 | } |
@@ -1302,9 +1302,9 @@ discard block |
||
| 1302 | 1302 | $args->auth_key = $auth_key; |
| 1303 | 1303 | $output = executeQuery('member.getAuthMail', $args); |
| 1304 | 1304 | |
| 1305 | - if(!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 1305 | + if (!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 1306 | 1306 | { |
| 1307 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) |
|
| 1307 | + if (strlen($output->data->auth_key) !== strlen($auth_key)) |
|
| 1308 | 1308 | { |
| 1309 | 1309 | executeQuery('member.deleteAuthMail', $args); |
| 1310 | 1310 | } |
@@ -1312,7 +1312,7 @@ discard block |
||
| 1312 | 1312 | return $this->stop('msg_invalid_auth_key'); |
| 1313 | 1313 | } |
| 1314 | 1314 | |
| 1315 | - if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400) |
|
| 1315 | + if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400) |
|
| 1316 | 1316 | { |
| 1317 | 1317 | executeQuery('member.deleteAuthMail', $args); |
| 1318 | 1318 | |
@@ -1327,7 +1327,7 @@ discard block |
||
| 1327 | 1327 | $auth_args->is_register = 'Y'; |
| 1328 | 1328 | |
| 1329 | 1329 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 1330 | - if(!$output->toBool()) return $output; |
|
| 1330 | + if (!$output->toBool()) return $output; |
|
| 1331 | 1331 | |
| 1332 | 1332 | // resend auth mail. |
| 1333 | 1333 | $this->_sendAuthMail($auth_args, $memberInfo); |
@@ -1341,7 +1341,7 @@ discard block |
||
| 1341 | 1341 | $args->password = $output->data->new_password; |
| 1342 | 1342 | |
| 1343 | 1343 | // If credentials are correct, change the password to a new one |
| 1344 | - if($output->data->is_register == 'Y') |
|
| 1344 | + if ($output->data->is_register == 'Y') |
|
| 1345 | 1345 | { |
| 1346 | 1346 | $args->denied = 'N'; |
| 1347 | 1347 | } |
@@ -1354,13 +1354,13 @@ discard block |
||
| 1354 | 1354 | $is_register = $output->data->is_register; |
| 1355 | 1355 | |
| 1356 | 1356 | $output = executeQuery('member.updateMemberPassword', $args); |
| 1357 | - if(!$output->toBool()) |
|
| 1357 | + if (!$output->toBool()) |
|
| 1358 | 1358 | { |
| 1359 | 1359 | return $this->stop($output->getMessage()); |
| 1360 | 1360 | } |
| 1361 | 1361 | |
| 1362 | 1362 | // Remove all values having the member_srl from authentication table |
| 1363 | - executeQuery('member.deleteAuthMail',$args); |
|
| 1363 | + executeQuery('member.deleteAuthMail', $args); |
|
| 1364 | 1364 | |
| 1365 | 1365 | $this->_clearMemberCache($args->member_srl); |
| 1366 | 1366 | |
@@ -1379,33 +1379,33 @@ discard block |
||
| 1379 | 1379 | { |
| 1380 | 1380 | // Get an email_address |
| 1381 | 1381 | $email_address = Context::get('email_address'); |
| 1382 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1382 | + if (!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1383 | 1383 | // Log test by using email_address |
| 1384 | 1384 | $oMemberModel = getModel('member'); |
| 1385 | 1385 | |
| 1386 | 1386 | $args = new stdClass; |
| 1387 | 1387 | $args->email_address = $email_address; |
| 1388 | 1388 | $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1389 | - if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 1389 | + if (!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 1390 | 1390 | |
| 1391 | 1391 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address'); |
| 1392 | 1392 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList); |
| 1393 | 1393 | |
| 1394 | 1394 | $oModuleModel = getModel('module'); |
| 1395 | 1395 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1396 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1397 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1396 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
| 1397 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1398 | 1398 | |
| 1399 | 1399 | // Check if a authentication mail has been sent previously |
| 1400 | 1400 | $chk_args = new stdClass; |
| 1401 | 1401 | $chk_args->member_srl = $member_info->member_srl; |
| 1402 | 1402 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1403 | - if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1403 | + if ($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1404 | 1404 | |
| 1405 | 1405 | $auth_args = new stdClass; |
| 1406 | 1406 | $auth_args->member_srl = $member_info->member_srl; |
| 1407 | 1407 | $output = executeQueryArray('member.getAuthMailInfo', $auth_args); |
| 1408 | - if(!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1408 | + if (!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1409 | 1409 | $auth_info = $output->data[0]; |
| 1410 | 1410 | |
| 1411 | 1411 | // Update the regdate of authmail entry |
@@ -1416,12 +1416,12 @@ discard block |
||
| 1416 | 1416 | |
| 1417 | 1417 | $memberInfo = array(); |
| 1418 | 1418 | global $lang; |
| 1419 | - if(is_array($member_config->signupForm)) |
|
| 1419 | + if (is_array($member_config->signupForm)) |
|
| 1420 | 1420 | { |
| 1421 | - $exceptForm=array('password', 'find_account_question'); |
|
| 1422 | - foreach($member_config->signupForm as $form) |
|
| 1421 | + $exceptForm = array('password', 'find_account_question'); |
|
| 1422 | + foreach ($member_config->signupForm as $form) |
|
| 1423 | 1423 | { |
| 1424 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1424 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1425 | 1425 | { |
| 1426 | 1426 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1427 | 1427 | } |
@@ -1440,19 +1440,19 @@ discard block |
||
| 1440 | 1440 | Context::set('member_config', $member_config); |
| 1441 | 1441 | |
| 1442 | 1442 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1443 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1443 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1444 | 1444 | |
| 1445 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); |
|
| 1445 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key); |
|
| 1446 | 1446 | Context::set('auth_url', $auth_url); |
| 1447 | 1447 | |
| 1448 | 1448 | $oTemplate = &TemplateHandler::getInstance(); |
| 1449 | 1449 | $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); |
| 1450 | 1450 | // Send a mail |
| 1451 | 1451 | $oMail = new Mail(); |
| 1452 | - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); |
|
| 1452 | + $oMail->setTitle(Context::getLang('msg_confirm_account_title')); |
|
| 1453 | 1453 | $oMail->setContent($content); |
| 1454 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 1455 | - $oMail->setReceiptor( $args->user_name, $args->email_address ); |
|
| 1454 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 1455 | + $oMail->setReceiptor($args->user_name, $args->email_address); |
|
| 1456 | 1456 | $oMail->send(); |
| 1457 | 1457 | |
| 1458 | 1458 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
@@ -1467,23 +1467,23 @@ discard block |
||
| 1467 | 1467 | $memberInfo = $_SESSION['auth_member_info']; |
| 1468 | 1468 | unset($_SESSION['auth_member_info']); |
| 1469 | 1469 | |
| 1470 | - if(!$memberInfo) |
|
| 1470 | + if (!$memberInfo) |
|
| 1471 | 1471 | { |
| 1472 | 1472 | return $this->stop('msg_invalid_request'); |
| 1473 | 1473 | } |
| 1474 | 1474 | |
| 1475 | 1475 | $newEmail = Context::get('email_address'); |
| 1476 | 1476 | |
| 1477 | - if(!$newEmail) |
|
| 1477 | + if (!$newEmail) |
|
| 1478 | 1478 | { |
| 1479 | 1479 | return $this->stop('msg_invalid_request'); |
| 1480 | 1480 | } |
| 1481 | 1481 | |
| 1482 | 1482 | $oMemberModel = getModel('member'); |
| 1483 | 1483 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
| 1484 | - if($member_srl) |
|
| 1484 | + if ($member_srl) |
|
| 1485 | 1485 | { |
| 1486 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
| 1486 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
| 1487 | 1487 | } |
| 1488 | 1488 | |
| 1489 | 1489 | // remove all key by member_srl |
@@ -1491,7 +1491,7 @@ discard block |
||
| 1491 | 1491 | $args->member_srl = $memberInfo->member_srl; |
| 1492 | 1492 | $output = executeQuery('member.deleteAuthMail', $args); |
| 1493 | 1493 | |
| 1494 | - if(!$output->toBool()) |
|
| 1494 | + if (!$output->toBool()) |
|
| 1495 | 1495 | { |
| 1496 | 1496 | return $output; |
| 1497 | 1497 | } |
@@ -1501,7 +1501,7 @@ discard block |
||
| 1501 | 1501 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
| 1502 | 1502 | |
| 1503 | 1503 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
| 1504 | - if(!$output->toBool()) |
|
| 1504 | + if (!$output->toBool()) |
|
| 1505 | 1505 | { |
| 1506 | 1506 | return $this->stop($output->getMessage()); |
| 1507 | 1507 | } |
@@ -1518,7 +1518,7 @@ discard block |
||
| 1518 | 1518 | $auth_args->is_register = 'Y'; |
| 1519 | 1519 | |
| 1520 | 1520 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 1521 | - if(!$output->toBool()) return $output; |
|
| 1521 | + if (!$output->toBool()) return $output; |
|
| 1522 | 1522 | |
| 1523 | 1523 | $memberInfo->email_address = $newEmail; |
| 1524 | 1524 | |
@@ -1542,12 +1542,12 @@ discard block |
||
| 1542 | 1542 | $memberInfo = array(); |
| 1543 | 1543 | |
| 1544 | 1544 | global $lang; |
| 1545 | - if(is_array($member_config->signupForm)) |
|
| 1545 | + if (is_array($member_config->signupForm)) |
|
| 1546 | 1546 | { |
| 1547 | - $exceptForm=array('password', 'find_account_question'); |
|
| 1548 | - foreach($member_config->signupForm as $form) |
|
| 1547 | + $exceptForm = array('password', 'find_account_question'); |
|
| 1548 | + foreach ($member_config->signupForm as $form) |
|
| 1549 | 1549 | { |
| 1550 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1550 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1551 | 1551 | { |
| 1552 | 1552 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1553 | 1553 | } |
@@ -1562,25 +1562,25 @@ discard block |
||
| 1562 | 1562 | } |
| 1563 | 1563 | Context::set('memberInfo', $memberInfo); |
| 1564 | 1564 | |
| 1565 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1566 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1565 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
| 1566 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1567 | 1567 | |
| 1568 | 1568 | Context::set('member_config', $member_config); |
| 1569 | 1569 | |
| 1570 | 1570 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1571 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1571 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1572 | 1572 | |
| 1573 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
|
| 1573 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key); |
|
| 1574 | 1574 | Context::set('auth_url', $auth_url); |
| 1575 | 1575 | |
| 1576 | 1576 | $oTemplate = &TemplateHandler::getInstance(); |
| 1577 | 1577 | $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); |
| 1578 | 1578 | // Send a mail |
| 1579 | 1579 | $oMail = new Mail(); |
| 1580 | - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); |
|
| 1580 | + $oMail->setTitle(Context::getLang('msg_confirm_account_title')); |
|
| 1581 | 1581 | $oMail->setContent($content); |
| 1582 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 1583 | - $oMail->setReceiptor( $member_info->user_name, $member_info->email_address ); |
|
| 1582 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 1583 | + $oMail->setReceiptor($member_info->user_name, $member_info->email_address); |
|
| 1584 | 1584 | $oMail->send(); |
| 1585 | 1585 | } |
| 1586 | 1586 | |
@@ -1593,7 +1593,7 @@ discard block |
||
| 1593 | 1593 | { |
| 1594 | 1594 | $site_module_info = Context::get('site_module_info'); |
| 1595 | 1595 | $logged_info = Context::get('logged_info'); |
| 1596 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
| 1596 | + if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1597 | 1597 | |
| 1598 | 1598 | $oMemberModel = getModel('member'); |
| 1599 | 1599 | $columnList = array('site_srl', 'group_srl', 'title'); |
@@ -1612,13 +1612,13 @@ discard block |
||
| 1612 | 1612 | { |
| 1613 | 1613 | $site_module_info = Context::get('site_module_info'); |
| 1614 | 1614 | $logged_info = Context::get('logged_info'); |
| 1615 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
| 1615 | + if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1616 | 1616 | |
| 1617 | 1617 | $args = new stdClass; |
| 1618 | - $args->site_srl= $site_module_info->site_srl; |
|
| 1618 | + $args->site_srl = $site_module_info->site_srl; |
|
| 1619 | 1619 | $args->member_srl = $logged_info->member_srl; |
| 1620 | 1620 | $output = executeQuery('member.deleteMembersGroup', $args); |
| 1621 | - if(!$output->toBool()) return $output; |
|
| 1621 | + if (!$output->toBool()) return $output; |
|
| 1622 | 1622 | $this->setMessage('success_deleted'); |
| 1623 | 1623 | $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl); |
| 1624 | 1624 | } |
@@ -1632,25 +1632,25 @@ discard block |
||
| 1632 | 1632 | */ |
| 1633 | 1633 | function setMemberConfig($args) |
| 1634 | 1634 | { |
| 1635 | - if(!$args->skin) $args->skin = "default"; |
|
| 1636 | - if(!$args->colorset) $args->colorset = "white"; |
|
| 1637 | - if(!$args->editor_skin) $args->editor_skin= "ckeditor"; |
|
| 1638 | - if(!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
| 1639 | - if($args->enable_join!='Y') $args->enable_join = 'N'; |
|
| 1640 | - $args->enable_openid= 'N'; |
|
| 1641 | - if($args->profile_image !='Y') $args->profile_image = 'N'; |
|
| 1642 | - if($args->image_name!='Y') $args->image_name = 'N'; |
|
| 1643 | - if($args->image_mark!='Y') $args->image_mark = 'N'; |
|
| 1644 | - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; |
|
| 1645 | - if(!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
| 1646 | - $args->limit_day = (int)$args->limit_day; |
|
| 1635 | + if (!$args->skin) $args->skin = "default"; |
|
| 1636 | + if (!$args->colorset) $args->colorset = "white"; |
|
| 1637 | + if (!$args->editor_skin) $args->editor_skin = "ckeditor"; |
|
| 1638 | + if (!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
| 1639 | + if ($args->enable_join != 'Y') $args->enable_join = 'N'; |
|
| 1640 | + $args->enable_openid = 'N'; |
|
| 1641 | + if ($args->profile_image != 'Y') $args->profile_image = 'N'; |
|
| 1642 | + if ($args->image_name != 'Y') $args->image_name = 'N'; |
|
| 1643 | + if ($args->image_mark != 'Y') $args->image_mark = 'N'; |
|
| 1644 | + if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N'; |
|
| 1645 | + if (!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
| 1646 | + $args->limit_day = (int) $args->limit_day; |
|
| 1647 | 1647 | |
| 1648 | 1648 | $agreement = trim($args->agreement); |
| 1649 | 1649 | unset($args->agreement); |
| 1650 | 1650 | |
| 1651 | 1651 | $oModuleController = getController('module'); |
| 1652 | - $output = $oModuleController->insertModuleConfig('member',$args); |
|
| 1653 | - if(!$output->toBool()) return $output; |
|
| 1652 | + $output = $oModuleController->insertModuleConfig('member', $args); |
|
| 1653 | + if (!$output->toBool()) return $output; |
|
| 1654 | 1654 | |
| 1655 | 1655 | $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
| 1656 | 1656 | FileHandler::writeFile($agreement_file, $agreement); |
@@ -1671,11 +1671,11 @@ discard block |
||
| 1671 | 1671 | $signature = trim(removeHackTag($signature)); |
| 1672 | 1672 | $signature = preg_replace('/<(\/?)(embed|object|param)/is', '<$1$2', $signature); |
| 1673 | 1673 | |
| 1674 | - $check_signature = trim(str_replace(array(' ',"\n","\r"), '', strip_tags($signature, '<img><object>'))); |
|
| 1674 | + $check_signature = trim(str_replace(array(' ', "\n", "\r"), '', strip_tags($signature, '<img><object>'))); |
|
| 1675 | 1675 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
| 1676 | 1676 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
| 1677 | 1677 | |
| 1678 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
| 1678 | + if (!$check_signature) return FileHandler::removeFile($filename); |
|
| 1679 | 1679 | |
| 1680 | 1680 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
| 1681 | 1681 | FileHandler::makeDir($path); |
@@ -1704,15 +1704,15 @@ discard block |
||
| 1704 | 1704 | * |
| 1705 | 1705 | * @return BaseObject |
| 1706 | 1706 | */ |
| 1707 | - function addMemberToGroup($member_srl, $group_srl, $site_srl=0) |
|
| 1707 | + function addMemberToGroup($member_srl, $group_srl, $site_srl = 0) |
|
| 1708 | 1708 | { |
| 1709 | 1709 | $args = new stdClass(); |
| 1710 | 1710 | $args->member_srl = $member_srl; |
| 1711 | 1711 | $args->group_srl = $group_srl; |
| 1712 | - if($site_srl) $args->site_srl = $site_srl; |
|
| 1712 | + if ($site_srl) $args->site_srl = $site_srl; |
|
| 1713 | 1713 | |
| 1714 | 1714 | // Add |
| 1715 | - $output = executeQuery('member.addMemberToGroup',$args); |
|
| 1715 | + $output = executeQuery('member.addMemberToGroup', $args); |
|
| 1716 | 1716 | $output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args); |
| 1717 | 1717 | |
| 1718 | 1718 | $this->_clearMemberCache($member_srl, $site_srl); |
@@ -1732,18 +1732,18 @@ discard block |
||
| 1732 | 1732 | { |
| 1733 | 1733 | $obj = new stdClass; |
| 1734 | 1734 | $obj->site_srl = $args->site_srl; |
| 1735 | - $obj->member_srl = implode(',',$args->member_srl); |
|
| 1735 | + $obj->member_srl = implode(',', $args->member_srl); |
|
| 1736 | 1736 | |
| 1737 | 1737 | $output = executeQueryArray('member.getMembersGroup', $obj); |
| 1738 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1738 | + if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1739 | 1739 | |
| 1740 | 1740 | $output = executeQuery('member.deleteMembersGroup', $obj); |
| 1741 | - if(!$output->toBool()) return $output; |
|
| 1741 | + if (!$output->toBool()) return $output; |
|
| 1742 | 1742 | |
| 1743 | 1743 | $inserted_members = array(); |
| 1744 | - foreach($args->member_srl as $key => $val) |
|
| 1744 | + foreach ($args->member_srl as $key => $val) |
|
| 1745 | 1745 | { |
| 1746 | - if($inserted_members[$val]) continue; |
|
| 1746 | + if ($inserted_members[$val]) continue; |
|
| 1747 | 1747 | $inserted_members[$val] = true; |
| 1748 | 1748 | |
| 1749 | 1749 | unset($obj); |
@@ -1753,7 +1753,7 @@ discard block |
||
| 1753 | 1753 | $obj->site_srl = $args->site_srl; |
| 1754 | 1754 | $obj->regdate = $date[$obj->member_srl]; |
| 1755 | 1755 | $output = executeQuery('member.addMemberToGroup', $obj); |
| 1756 | - if(!$output->toBool()) return $output; |
|
| 1756 | + if (!$output->toBool()) return $output; |
|
| 1757 | 1757 | |
| 1758 | 1758 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
| 1759 | 1759 | } |
@@ -1775,9 +1775,9 @@ discard block |
||
| 1775 | 1775 | // Get information of the key |
| 1776 | 1776 | $output = executeQuery('member.getAutologin', $args); |
| 1777 | 1777 | // If no information exists, delete a cookie |
| 1778 | - if(!$output->toBool() || !$output->data) |
|
| 1778 | + if (!$output->toBool() || !$output->data) |
|
| 1779 | 1779 | { |
| 1780 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
| 1780 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
| 1781 | 1781 | return; |
| 1782 | 1782 | } |
| 1783 | 1783 | |
@@ -1787,9 +1787,9 @@ discard block |
||
| 1787 | 1787 | $user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address; |
| 1788 | 1788 | $password = $output->data->password; |
| 1789 | 1789 | |
| 1790 | - if(!$user_id || !$password) |
|
| 1790 | + if (!$user_id || !$password) |
|
| 1791 | 1791 | { |
| 1792 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
| 1792 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
| 1793 | 1793 | return; |
| 1794 | 1794 | } |
| 1795 | 1795 | |
@@ -1799,7 +1799,7 @@ discard block |
||
| 1799 | 1799 | $check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT']; |
| 1800 | 1800 | $check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32); |
| 1801 | 1801 | |
| 1802 | - if($check_key === substr($args->autologin_key, 32)) |
|
| 1802 | + if ($check_key === substr($args->autologin_key, 32)) |
|
| 1803 | 1803 | { |
| 1804 | 1804 | // Check change_password_date |
| 1805 | 1805 | $oModuleModel = getModel('module'); |
@@ -1807,12 +1807,12 @@ discard block |
||
| 1807 | 1807 | $limit_date = $member_config->change_password_date; |
| 1808 | 1808 | |
| 1809 | 1809 | // Check if change_password_date is set |
| 1810 | - if($limit_date > 0) |
|
| 1810 | + if ($limit_date > 0) |
|
| 1811 | 1811 | { |
| 1812 | 1812 | $oMemberModel = getModel('member'); |
| 1813 | 1813 | $columnList = array('member_srl', 'change_password_date'); |
| 1814 | 1814 | |
| 1815 | - if($config->identifier == 'user_id') |
|
| 1815 | + if ($config->identifier == 'user_id') |
|
| 1816 | 1816 | { |
| 1817 | 1817 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
| 1818 | 1818 | } |
@@ -1821,7 +1821,7 @@ discard block |
||
| 1821 | 1821 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
| 1822 | 1822 | } |
| 1823 | 1823 | |
| 1824 | - if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){ |
|
| 1824 | + if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) { |
|
| 1825 | 1825 | $do_auto_login = true; |
| 1826 | 1826 | } |
| 1827 | 1827 | |
@@ -1832,14 +1832,14 @@ discard block |
||
| 1832 | 1832 | } |
| 1833 | 1833 | } |
| 1834 | 1834 | |
| 1835 | - if($do_auto_login) |
|
| 1835 | + if ($do_auto_login) |
|
| 1836 | 1836 | { |
| 1837 | 1837 | $output = $this->doLogin($user_id); |
| 1838 | 1838 | } |
| 1839 | 1839 | else |
| 1840 | 1840 | { |
| 1841 | 1841 | executeQuery('member.deleteAutologin', $args); |
| 1842 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
| 1842 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
| 1843 | 1843 | } |
| 1844 | 1844 | } |
| 1845 | 1845 | |
@@ -1855,13 +1855,13 @@ discard block |
||
| 1855 | 1855 | function doLogin($user_id, $password = '', $keep_signed = false) |
| 1856 | 1856 | { |
| 1857 | 1857 | $user_id = strtolower($user_id); |
| 1858 | - if(!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
| 1858 | + if (!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
| 1859 | 1859 | // Call a trigger before log-in (before) |
| 1860 | 1860 | $trigger_obj = new stdClass(); |
| 1861 | 1861 | $trigger_obj->user_id = $user_id; |
| 1862 | 1862 | $trigger_obj->password = $password; |
| 1863 | 1863 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
| 1864 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 1864 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 1865 | 1865 | // Create a member model object |
| 1866 | 1866 | $oMemberModel = getModel('member'); |
| 1867 | 1867 | |
@@ -1871,12 +1871,12 @@ discard block |
||
| 1871 | 1871 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
| 1872 | 1872 | |
| 1873 | 1873 | // check identifier |
| 1874 | - if($config->identifier == 'email_address') |
|
| 1874 | + if ($config->identifier == 'email_address') |
|
| 1875 | 1875 | { |
| 1876 | 1876 | // Get user_id information |
| 1877 | 1877 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
| 1878 | 1878 | // Set an invalid user if no value returned |
| 1879 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 1879 | + if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 1880 | 1880 | |
| 1881 | 1881 | } |
| 1882 | 1882 | else |
@@ -1884,24 +1884,24 @@ discard block |
||
| 1884 | 1884 | // Get user_id information |
| 1885 | 1885 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
| 1886 | 1886 | // Set an invalid user if no value returned |
| 1887 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 1887 | + if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 1888 | 1888 | } |
| 1889 | 1889 | |
| 1890 | 1890 | $output = executeQuery('member.getLoginCountByIp', $args); |
| 1891 | 1891 | $errorCount = $output->data->count; |
| 1892 | - if($errorCount >= $config->max_error_count) |
|
| 1892 | + if ($errorCount >= $config->max_error_count) |
|
| 1893 | 1893 | { |
| 1894 | 1894 | $last_update = strtotime($output->data->last_update); |
| 1895 | - $term = intval($_SERVER['REQUEST_TIME']-$last_update); |
|
| 1896 | - if($term < $config->max_error_count_time) |
|
| 1895 | + $term = intval($_SERVER['REQUEST_TIME'] - $last_update); |
|
| 1896 | + if ($term < $config->max_error_count_time) |
|
| 1897 | 1897 | { |
| 1898 | 1898 | $term = $config->max_error_count_time - $term; |
| 1899 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
| 1900 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
| 1901 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
| 1902 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
| 1899 | + if ($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
| 1900 | + elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min'); |
|
| 1901 | + elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour'); |
|
| 1902 | + else $term = intval($term / 86400).Context::getLang('unit_day'); |
|
| 1903 | 1903 | |
| 1904 | - return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
|
| 1904 | + return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'), $term)); |
|
| 1905 | 1905 | } |
| 1906 | 1906 | else |
| 1907 | 1907 | { |
@@ -1911,13 +1911,13 @@ discard block |
||
| 1911 | 1911 | } |
| 1912 | 1912 | |
| 1913 | 1913 | // Password Check |
| 1914 | - if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
| 1914 | + if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
| 1915 | 1915 | { |
| 1916 | - return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo); |
|
| 1916 | + return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo); |
|
| 1917 | 1917 | } |
| 1918 | 1918 | |
| 1919 | 1919 | // If denied == 'Y', notify |
| 1920 | - if($this->memberInfo->denied == 'Y') |
|
| 1920 | + if ($this->memberInfo->denied == 'Y') |
|
| 1921 | 1921 | { |
| 1922 | 1922 | $args->member_srl = $this->memberInfo->member_srl; |
| 1923 | 1923 | $output = executeQuery('member.chkAuthMail', $args); |
@@ -1925,12 +1925,12 @@ discard block |
||
| 1925 | 1925 | { |
| 1926 | 1926 | $_SESSION['auth_member_srl'] = $this->memberInfo->member_srl; |
| 1927 | 1927 | $redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail'); |
| 1928 | - return $this->setRedirectUrl($redirectUrl, new BaseObject(-1,'msg_user_not_confirmed')); |
|
| 1928 | + return $this->setRedirectUrl($redirectUrl, new BaseObject(-1, 'msg_user_not_confirmed')); |
|
| 1929 | 1929 | } |
| 1930 | - return new BaseObject(-1,'msg_user_denied'); |
|
| 1930 | + return new BaseObject(-1, 'msg_user_denied'); |
|
| 1931 | 1931 | } |
| 1932 | 1932 | // Notify if denied_date is less than the current time |
| 1933 | - if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
| 1933 | + if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) return new BaseObject(-9, sprintf(Context::getLang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d"))); |
|
| 1934 | 1934 | // Update the latest login time |
| 1935 | 1935 | $args->member_srl = $this->memberInfo->member_srl; |
| 1936 | 1936 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1940,36 +1940,36 @@ discard block |
||
| 1940 | 1940 | |
| 1941 | 1941 | // Check if there is recoding table. |
| 1942 | 1942 | $oDB = &DB::getInstance(); |
| 1943 | - if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
| 1943 | + if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
| 1944 | 1944 | { |
| 1945 | 1945 | // check if there is login fail records. |
| 1946 | 1946 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
| 1947 | - if($output->data && $output->data->content) |
|
| 1947 | + if ($output->data && $output->data->content) |
|
| 1948 | 1948 | { |
| 1949 | 1949 | $title = Context::getLang('login_fail_report'); |
| 1950 | 1950 | $message = '<ul>'; |
| 1951 | 1951 | $content = unserialize($output->data->content); |
| 1952 | - if(count($content) > $config->max_error_count) |
|
| 1952 | + if (count($content) > $config->max_error_count) |
|
| 1953 | 1953 | { |
| 1954 | - foreach($content as $val) |
|
| 1954 | + foreach ($content as $val) |
|
| 1955 | 1955 | { |
| 1956 | - $message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa',$val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>'; |
|
| 1956 | + $message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa', $val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>'; |
|
| 1957 | 1957 | } |
| 1958 | 1958 | $message .= '</ul>'; |
| 1959 | - $content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa')); |
|
| 1959 | + $content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa')); |
|
| 1960 | 1960 | |
| 1961 | 1961 | //send message |
| 1962 | 1962 | $oCommunicationController = getController('communication'); |
| 1963 | 1963 | $oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true); |
| 1964 | 1964 | |
| 1965 | - if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
| 1965 | + if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
| 1966 | 1966 | { |
| 1967 | 1967 | $view_url = Context::getRequestUri(); |
| 1968 | - $content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>",$content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id); |
|
| 1968 | + $content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>", $content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id); |
|
| 1969 | 1969 | $oMail = new Mail(); |
| 1970 | 1970 | $oMail->setTitle($title); |
| 1971 | 1971 | $oMail->setContent($content); |
| 1972 | - $oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email); |
|
| 1972 | + $oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email); |
|
| 1973 | 1973 | $oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address); |
| 1974 | 1974 | $oMail->send(); |
| 1975 | 1975 | } |
@@ -1979,9 +1979,9 @@ discard block |
||
| 1979 | 1979 | } |
| 1980 | 1980 | // Call a trigger after successfully log-in (after) |
| 1981 | 1981 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
| 1982 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 1982 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 1983 | 1983 | // When user checked to use auto-login |
| 1984 | - if($keep_signed) |
|
| 1984 | + if ($keep_signed) |
|
| 1985 | 1985 | { |
| 1986 | 1986 | // Key generate for auto login |
| 1987 | 1987 | $oPassword = new Password(); |
@@ -1993,12 +1993,12 @@ discard block |
||
| 1993 | 1993 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
| 1994 | 1994 | executeQuery('member.deleteAutologin', $autologin_args); |
| 1995 | 1995 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
| 1996 | - if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
| 1996 | + if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000); |
|
| 1997 | 1997 | } |
| 1998 | - if($this->memberInfo->is_admin == 'Y') |
|
| 1998 | + if ($this->memberInfo->is_admin == 'Y') |
|
| 1999 | 1999 | { |
| 2000 | 2000 | $oMemberAdminModel = getAdminModel('member'); |
| 2001 | - if(!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
| 2001 | + if (!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
| 2002 | 2002 | { |
| 2003 | 2003 | $_SESSION['denied_admin'] = 'Y'; |
| 2004 | 2004 | } |
@@ -2016,18 +2016,18 @@ discard block |
||
| 2016 | 2016 | { |
| 2017 | 2017 | $oMemberModel = getModel('member'); |
| 2018 | 2018 | // If your information came through the current session information to extract information from the users |
| 2019 | - if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() ) |
|
| 2019 | + if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged()) |
|
| 2020 | 2020 | { |
| 2021 | 2021 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']); |
| 2022 | 2022 | // If you do not destroy the session Profile |
| 2023 | - if($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
| 2023 | + if ($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
| 2024 | 2024 | { |
| 2025 | 2025 | $this->destroySessionInfo(); |
| 2026 | 2026 | return; |
| 2027 | 2027 | } |
| 2028 | 2028 | } |
| 2029 | 2029 | // Stop using the session id is destroyed |
| 2030 | - if($this->memberInfo->denied=='Y') |
|
| 2030 | + if ($this->memberInfo->denied == 'Y') |
|
| 2031 | 2031 | { |
| 2032 | 2032 | $this->destroySessionInfo(); |
| 2033 | 2033 | return; |
@@ -2057,10 +2057,10 @@ discard block |
||
| 2057 | 2057 | Context::set('logged_info', $this->memberInfo); |
| 2058 | 2058 | |
| 2059 | 2059 | // Only the menu configuration of the user (such as an add-on to the menu can be changed) |
| 2060 | - $this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info'); |
|
| 2061 | - $this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
| 2062 | - $this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
| 2063 | - $this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document'); |
|
| 2060 | + $this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info'); |
|
| 2061 | + $this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
| 2062 | + $this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
| 2063 | + $this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document'); |
|
| 2064 | 2064 | } |
| 2065 | 2065 | |
| 2066 | 2066 | /** |
@@ -2082,7 +2082,7 @@ discard block |
||
| 2082 | 2082 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
| 2083 | 2083 | { |
| 2084 | 2084 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
| 2085 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
| 2085 | + if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
| 2086 | 2086 | |
| 2087 | 2087 | $obj = new stdClass; |
| 2088 | 2088 | $obj->url = $url; |
@@ -2101,33 +2101,33 @@ discard block |
||
| 2101 | 2101 | { |
| 2102 | 2102 | // Call a trigger (before) |
| 2103 | 2103 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
| 2104 | - if(!$output->toBool()) return $output; |
|
| 2104 | + if (!$output->toBool()) return $output; |
|
| 2105 | 2105 | // Terms and Conditions portion of the information set up by members reaffirmed |
| 2106 | 2106 | $oModuleModel = getModel('module'); |
| 2107 | 2107 | $config = $oModuleModel->getModuleConfig('member'); |
| 2108 | 2108 | |
| 2109 | 2109 | $logged_info = Context::get('logged_info'); |
| 2110 | 2110 | // If the date of the temporary restrictions limit further information on the date of |
| 2111 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
| 2111 | + if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24); |
|
| 2112 | 2112 | |
| 2113 | 2113 | $args->member_srl = getNextSequence(); |
| 2114 | 2114 | $args->list_order = -1 * $args->member_srl; |
| 2115 | 2115 | |
| 2116 | 2116 | // Execute insert or update depending on the value of member_srl |
| 2117 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2117 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2118 | 2118 | // Enter the user's identity changed to lowercase |
| 2119 | 2119 | else $args->user_id = strtolower($args->user_id); |
| 2120 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2121 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
| 2120 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2121 | + if (!$args->nick_name) $args->nick_name = $args->member_srl; |
|
| 2122 | 2122 | |
| 2123 | 2123 | // Control of essential parameters |
| 2124 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 2125 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 2126 | - if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y'; |
|
| 2124 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
| 2125 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
| 2126 | + if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y'; |
|
| 2127 | 2127 | |
| 2128 | - if($logged_info->is_admin == 'Y') |
|
| 2128 | + if ($logged_info->is_admin == 'Y') |
|
| 2129 | 2129 | { |
| 2130 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
| 2130 | + if ($args->is_admin != 'Y') $args->is_admin = 'N'; |
|
| 2131 | 2131 | } |
| 2132 | 2132 | else |
| 2133 | 2133 | { |
@@ -2142,97 +2142,97 @@ discard block |
||
| 2142 | 2142 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2143 | 2143 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2144 | 2144 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2145 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2146 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2145 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2146 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2147 | 2147 | |
| 2148 | 2148 | // Create a model object |
| 2149 | 2149 | $oMemberModel = getModel('member'); |
| 2150 | 2150 | |
| 2151 | 2151 | // Check password strength |
| 2152 | - if($args->password && !$password_is_hashed) |
|
| 2152 | + if ($args->password && !$password_is_hashed) |
|
| 2153 | 2153 | { |
| 2154 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2154 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2155 | 2155 | { |
| 2156 | 2156 | $message = Context::getLang('about_password_strength'); |
| 2157 | 2157 | return new BaseObject(-1, $message[$config->password_strength]); |
| 2158 | 2158 | } |
| 2159 | 2159 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2160 | 2160 | } |
| 2161 | - elseif(!$args->password) |
|
| 2161 | + elseif (!$args->password) |
|
| 2162 | 2162 | { |
| 2163 | 2163 | unset($args->password); |
| 2164 | 2164 | } |
| 2165 | 2165 | |
| 2166 | - if($args->find_account_answer && !$password_is_hashed) |
|
| 2166 | + if ($args->find_account_answer && !$password_is_hashed) |
|
| 2167 | 2167 | { |
| 2168 | 2168 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
| 2169 | 2169 | } |
| 2170 | - elseif(!$args->find_account_answer) |
|
| 2170 | + elseif (!$args->find_account_answer) |
|
| 2171 | 2171 | { |
| 2172 | 2172 | unset($args->find_account_answer); |
| 2173 | 2173 | } |
| 2174 | 2174 | |
| 2175 | 2175 | // Check if ID is prohibited |
| 2176 | - if($oMemberModel->isDeniedID($args->user_id)) |
|
| 2176 | + if ($oMemberModel->isDeniedID($args->user_id)) |
|
| 2177 | 2177 | { |
| 2178 | - return new BaseObject(-1,'denied_user_id'); |
|
| 2178 | + return new BaseObject(-1, 'denied_user_id'); |
|
| 2179 | 2179 | } |
| 2180 | 2180 | |
| 2181 | 2181 | // Check if ID is duplicate |
| 2182 | 2182 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2183 | - if($member_srl) |
|
| 2183 | + if ($member_srl) |
|
| 2184 | 2184 | { |
| 2185 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
| 2185 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
| 2186 | 2186 | } |
| 2187 | 2187 | |
| 2188 | 2188 | // Check if nickname is prohibited |
| 2189 | - if($oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2189 | + if ($oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2190 | 2190 | { |
| 2191 | - return new BaseObject(-1,'denied_nick_name'); |
|
| 2191 | + return new BaseObject(-1, 'denied_nick_name'); |
|
| 2192 | 2192 | } |
| 2193 | 2193 | |
| 2194 | 2194 | // Check if nickname is duplicate |
| 2195 | 2195 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
| 2196 | - if($member_srl) |
|
| 2196 | + if ($member_srl) |
|
| 2197 | 2197 | { |
| 2198 | - return new BaseObject(-1,'msg_exists_nick_name'); |
|
| 2198 | + return new BaseObject(-1, 'msg_exists_nick_name'); |
|
| 2199 | 2199 | } |
| 2200 | 2200 | |
| 2201 | 2201 | // Check if email address is duplicate |
| 2202 | 2202 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
| 2203 | - if($member_srl) |
|
| 2203 | + if ($member_srl) |
|
| 2204 | 2204 | { |
| 2205 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
| 2205 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
| 2206 | 2206 | } |
| 2207 | 2207 | |
| 2208 | 2208 | // Insert data into the DB |
| 2209 | 2209 | $args->list_order = -1 * $args->member_srl; |
| 2210 | 2210 | |
| 2211 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2212 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2211 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2212 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2213 | 2213 | |
| 2214 | 2214 | $oDB = &DB::getInstance(); |
| 2215 | 2215 | $oDB->begin(); |
| 2216 | 2216 | |
| 2217 | 2217 | $output = executeQuery('member.insertMember', $args); |
| 2218 | - if(!$output->toBool()) |
|
| 2218 | + if (!$output->toBool()) |
|
| 2219 | 2219 | { |
| 2220 | 2220 | $oDB->rollback(); |
| 2221 | 2221 | return $output; |
| 2222 | 2222 | } |
| 2223 | 2223 | |
| 2224 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2224 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2225 | 2225 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
| 2226 | 2226 | // If no value is entered the default group, the value of group registration |
| 2227 | - if(!$args->group_srl_list) |
|
| 2227 | + if (!$args->group_srl_list) |
|
| 2228 | 2228 | { |
| 2229 | 2229 | $columnList = array('site_srl', 'group_srl'); |
| 2230 | 2230 | $default_group = $oMemberModel->getDefaultGroup(0, $columnList); |
| 2231 | - if($default_group) |
|
| 2231 | + if ($default_group) |
|
| 2232 | 2232 | { |
| 2233 | 2233 | // Add to the default group |
| 2234 | - $output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl); |
|
| 2235 | - if(!$output->toBool()) |
|
| 2234 | + $output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl); |
|
| 2235 | + if (!$output->toBool()) |
|
| 2236 | 2236 | { |
| 2237 | 2237 | $oDB->rollback(); |
| 2238 | 2238 | return $output; |
@@ -2242,11 +2242,11 @@ discard block |
||
| 2242 | 2242 | } |
| 2243 | 2243 | else |
| 2244 | 2244 | { |
| 2245 | - for($i=0;$i<count($group_srl_list);$i++) |
|
| 2245 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
| 2246 | 2246 | { |
| 2247 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
| 2247 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
| 2248 | 2248 | |
| 2249 | - if(!$output->toBool()) |
|
| 2249 | + if (!$output->toBool()) |
|
| 2250 | 2250 | { |
| 2251 | 2251 | $oDB->rollback(); |
| 2252 | 2252 | return $output; |
@@ -2256,7 +2256,7 @@ discard block |
||
| 2256 | 2256 | |
| 2257 | 2257 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 2258 | 2258 | // When using email authentication mode (when you subscribed members denied a) certified mail sent |
| 2259 | - if($args->denied == 'Y') |
|
| 2259 | + if ($args->denied == 'Y') |
|
| 2260 | 2260 | { |
| 2261 | 2261 | // Insert data into the authentication DB |
| 2262 | 2262 | $oPassword = new Password(); |
@@ -2268,7 +2268,7 @@ discard block |
||
| 2268 | 2268 | $auth_args->is_register = 'Y'; |
| 2269 | 2269 | |
| 2270 | 2270 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 2271 | - if(!$output->toBool()) |
|
| 2271 | + if (!$output->toBool()) |
|
| 2272 | 2272 | { |
| 2273 | 2273 | $oDB->rollback(); |
| 2274 | 2274 | return $output; |
@@ -2276,10 +2276,10 @@ discard block |
||
| 2276 | 2276 | $this->_sendAuthMail($auth_args, $args); |
| 2277 | 2277 | } |
| 2278 | 2278 | // Call a trigger (after) |
| 2279 | - if($output->toBool()) |
|
| 2279 | + if ($output->toBool()) |
|
| 2280 | 2280 | { |
| 2281 | 2281 | $trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args); |
| 2282 | - if(!$trigger_output->toBool()) |
|
| 2282 | + if (!$trigger_output->toBool()) |
|
| 2283 | 2283 | { |
| 2284 | 2284 | $oDB->rollback(); |
| 2285 | 2285 | return $trigger_output; |
@@ -2301,41 +2301,41 @@ discard block |
||
| 2301 | 2301 | { |
| 2302 | 2302 | // Call a trigger (before) |
| 2303 | 2303 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
| 2304 | - if(!$output->toBool()) return $output; |
|
| 2304 | + if (!$output->toBool()) return $output; |
|
| 2305 | 2305 | // Create a model object |
| 2306 | 2306 | $oMemberModel = getModel('member'); |
| 2307 | 2307 | |
| 2308 | 2308 | $logged_info = Context::get('logged_info'); |
| 2309 | 2309 | // Get what you want to modify the original information |
| 2310 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2310 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2311 | 2311 | // Control of essential parameters |
| 2312 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 2313 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
| 2312 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
| 2313 | + if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y'; |
|
| 2314 | 2314 | |
| 2315 | - if($logged_info->is_admin == 'Y') |
|
| 2315 | + if ($logged_info->is_admin == 'Y') |
|
| 2316 | 2316 | { |
| 2317 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 2318 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
| 2317 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
| 2318 | + if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
| 2319 | 2319 | } |
| 2320 | 2320 | else |
| 2321 | 2321 | { |
| 2322 | 2322 | unset($args->is_admin); |
| 2323 | - if($is_admin == false) |
|
| 2323 | + if ($is_admin == false) |
|
| 2324 | 2324 | unset($args->denied); |
| 2325 | - if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
| 2325 | + if ($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
| 2326 | 2326 | { |
| 2327 | 2327 | return $this->stop('msg_invalid_request'); |
| 2328 | 2328 | } |
| 2329 | 2329 | } |
| 2330 | 2330 | |
| 2331 | 2331 | // Sanitize user ID, username, nickname, homepage, blog |
| 2332 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2332 | + if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2333 | 2333 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2334 | 2334 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2335 | 2335 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2336 | 2336 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2337 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2338 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2337 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2338 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2339 | 2339 | |
| 2340 | 2340 | // check member identifier form |
| 2341 | 2341 | $config = $oMemberModel->getMemberConfig(); |
@@ -2344,56 +2344,56 @@ discard block |
||
| 2344 | 2344 | $orgMemberInfo = $output->data; |
| 2345 | 2345 | |
| 2346 | 2346 | // Check if email address or user ID is duplicate |
| 2347 | - if($config->identifier == 'email_address') |
|
| 2347 | + if ($config->identifier == 'email_address') |
|
| 2348 | 2348 | { |
| 2349 | 2349 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
| 2350 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2350 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2351 | 2351 | { |
| 2352 | - return new BaseObject(-1,'msg_exists_email_address'); |
|
| 2352 | + return new BaseObject(-1, 'msg_exists_email_address'); |
|
| 2353 | 2353 | } |
| 2354 | 2354 | $args->email_address = $orgMemberInfo->email_address; |
| 2355 | 2355 | } |
| 2356 | 2356 | else |
| 2357 | 2357 | { |
| 2358 | 2358 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2359 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2359 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2360 | 2360 | { |
| 2361 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
| 2361 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
| 2362 | 2362 | } |
| 2363 | 2363 | |
| 2364 | 2364 | $args->user_id = $orgMemberInfo->user_id; |
| 2365 | 2365 | } |
| 2366 | 2366 | |
| 2367 | - if($logged_info->is_admin !== 'Y') |
|
| 2367 | + if ($logged_info->is_admin !== 'Y') |
|
| 2368 | 2368 | { |
| 2369 | 2369 | // Check if ID is prohibited |
| 2370 | - if($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
| 2370 | + if ($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
| 2371 | 2371 | { |
| 2372 | - return new BaseObject(-1,'denied_user_id'); |
|
| 2372 | + return new BaseObject(-1, 'denied_user_id'); |
|
| 2373 | 2373 | } |
| 2374 | 2374 | |
| 2375 | 2375 | // Check if nickname is prohibited |
| 2376 | - if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2376 | + if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2377 | 2377 | { |
| 2378 | 2378 | return new BaseObject(-1, 'denied_nick_name'); |
| 2379 | 2379 | } |
| 2380 | 2380 | } |
| 2381 | 2381 | |
| 2382 | 2382 | // Check if ID is duplicate |
| 2383 | - if($args->user_id) |
|
| 2383 | + if ($args->user_id) |
|
| 2384 | 2384 | { |
| 2385 | 2385 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2386 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2386 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2387 | 2387 | { |
| 2388 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
| 2388 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
| 2389 | 2389 | } |
| 2390 | 2390 | } |
| 2391 | 2391 | |
| 2392 | 2392 | // Check if nickname is duplicate |
| 2393 | 2393 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
| 2394 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2394 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2395 | 2395 | { |
| 2396 | - return new BaseObject(-1,'msg_exists_nick_name'); |
|
| 2396 | + return new BaseObject(-1, 'msg_exists_nick_name'); |
|
| 2397 | 2397 | } |
| 2398 | 2398 | |
| 2399 | 2399 | list($args->email_id, $args->email_host) = explode('@', $args->email_address); |
@@ -2402,9 +2402,9 @@ discard block |
||
| 2402 | 2402 | $oDB->begin(); |
| 2403 | 2403 | |
| 2404 | 2404 | // Check password strength |
| 2405 | - if($args->password) |
|
| 2405 | + if ($args->password) |
|
| 2406 | 2406 | { |
| 2407 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2407 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2408 | 2408 | { |
| 2409 | 2409 | $message = Context::getLang('about_password_strength'); |
| 2410 | 2410 | return new BaseObject(-1, $message[$config->password_strength]); |
@@ -2416,55 +2416,55 @@ discard block |
||
| 2416 | 2416 | $args->password = $orgMemberInfo->password; |
| 2417 | 2417 | } |
| 2418 | 2418 | |
| 2419 | - if($args->find_account_answer) { |
|
| 2419 | + if ($args->find_account_answer) { |
|
| 2420 | 2420 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
| 2421 | 2421 | } |
| 2422 | 2422 | else |
| 2423 | 2423 | { |
| 2424 | - $oPassword = new Password(); |
|
| 2424 | + $oPassword = new Password(); |
|
| 2425 | 2425 | $hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer); |
| 2426 | 2426 | |
| 2427 | - if($hashed) { |
|
| 2427 | + if ($hashed) { |
|
| 2428 | 2428 | $args->find_account_answer = $orgMemberInfo->find_account_answer; |
| 2429 | 2429 | } else { |
| 2430 | 2430 | $args->find_account_answer = $oPassword->createHash($orgMemberInfo->find_account_answer); |
| 2431 | 2431 | } |
| 2432 | 2432 | } |
| 2433 | 2433 | |
| 2434 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
| 2435 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
| 2436 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2437 | - if(!isset($args->description)) $args->description = $orgMemberInfo->description; |
|
| 2438 | - if(!$args->birthday) $args->birthday = ''; |
|
| 2434 | + if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
| 2435 | + if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
| 2436 | + if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2437 | + if (!isset($args->description)) $args->description = $orgMemberInfo->description; |
|
| 2438 | + if (!$args->birthday) $args->birthday = ''; |
|
| 2439 | 2439 | |
| 2440 | 2440 | $output = executeQuery('member.updateMember', $args); |
| 2441 | 2441 | |
| 2442 | - if(!$output->toBool()) |
|
| 2442 | + if (!$output->toBool()) |
|
| 2443 | 2443 | { |
| 2444 | 2444 | $oDB->rollback(); |
| 2445 | 2445 | return $output; |
| 2446 | 2446 | } |
| 2447 | 2447 | |
| 2448 | - if($args->group_srl_list) |
|
| 2448 | + if ($args->group_srl_list) |
|
| 2449 | 2449 | { |
| 2450 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2450 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2451 | 2451 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
| 2452 | 2452 | // If the group information, group information changes |
| 2453 | - if(count($group_srl_list) > 0) |
|
| 2453 | + if (count($group_srl_list) > 0) |
|
| 2454 | 2454 | { |
| 2455 | 2455 | $args->site_srl = 0; |
| 2456 | 2456 | // One of its members to delete all the group |
| 2457 | 2457 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
| 2458 | - if(!$output->toBool()) |
|
| 2458 | + if (!$output->toBool()) |
|
| 2459 | 2459 | { |
| 2460 | 2460 | $oDB->rollback(); |
| 2461 | 2461 | return $output; |
| 2462 | 2462 | } |
| 2463 | 2463 | // Enter one of the loop a |
| 2464 | - for($i=0;$i<count($group_srl_list);$i++) |
|
| 2464 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
| 2465 | 2465 | { |
| 2466 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
| 2467 | - if(!$output->toBool()) |
|
| 2466 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
| 2467 | + if (!$output->toBool()) |
|
| 2468 | 2468 | { |
| 2469 | 2469 | $oDB->rollback(); |
| 2470 | 2470 | return $output; |
@@ -2476,9 +2476,9 @@ discard block |
||
| 2476 | 2476 | } |
| 2477 | 2477 | } |
| 2478 | 2478 | // Call a trigger (after) |
| 2479 | - if($output->toBool()) { |
|
| 2479 | + if ($output->toBool()) { |
|
| 2480 | 2480 | $trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args); |
| 2481 | - if(!$trigger_output->toBool()) |
|
| 2481 | + if (!$trigger_output->toBool()) |
|
| 2482 | 2482 | { |
| 2483 | 2483 | $oDB->rollback(); |
| 2484 | 2484 | return $trigger_output; |
@@ -2491,7 +2491,7 @@ discard block |
||
| 2491 | 2491 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
| 2492 | 2492 | |
| 2493 | 2493 | // Save Session |
| 2494 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2494 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2495 | 2495 | $logged_info = Context::get('logged_info'); |
| 2496 | 2496 | |
| 2497 | 2497 | $output->add('member_srl', $args->member_srl); |
@@ -2503,14 +2503,14 @@ discard block |
||
| 2503 | 2503 | */ |
| 2504 | 2504 | function updateMemberPassword($args) |
| 2505 | 2505 | { |
| 2506 | - if($args->password) |
|
| 2506 | + if ($args->password) |
|
| 2507 | 2507 | { |
| 2508 | 2508 | |
| 2509 | 2509 | // check password strength |
| 2510 | 2510 | $oMemberModel = getModel('member'); |
| 2511 | 2511 | $config = $oMemberModel->getMemberConfig(); |
| 2512 | 2512 | |
| 2513 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2513 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2514 | 2514 | { |
| 2515 | 2515 | $message = Context::getLang('about_password_strength'); |
| 2516 | 2516 | return new BaseObject(-1, $message[$config->password_strength]); |
@@ -2518,13 +2518,13 @@ discard block |
||
| 2518 | 2518 | |
| 2519 | 2519 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2520 | 2520 | } |
| 2521 | - else if($args->hashed_password) |
|
| 2521 | + else if ($args->hashed_password) |
|
| 2522 | 2522 | { |
| 2523 | 2523 | $args->password = $args->hashed_password; |
| 2524 | 2524 | } |
| 2525 | 2525 | |
| 2526 | 2526 | $output = executeQuery('member.updateMemberPassword', $args); |
| 2527 | - if($output->toBool()) |
|
| 2527 | + if ($output->toBool()) |
|
| 2528 | 2528 | { |
| 2529 | 2529 | $result = executeQuery('member.updateChangePasswordDate', $args); |
| 2530 | 2530 | } |
@@ -2536,7 +2536,7 @@ discard block |
||
| 2536 | 2536 | |
| 2537 | 2537 | function updateFindAccountAnswer($member_srl, $answer) |
| 2538 | 2538 | { |
| 2539 | - $oPassword = new Password(); |
|
| 2539 | + $oPassword = new Password(); |
|
| 2540 | 2540 | |
| 2541 | 2541 | $args = new stdClass(); |
| 2542 | 2542 | $args->member_srl = $member_srl; |
@@ -2553,18 +2553,18 @@ discard block |
||
| 2553 | 2553 | $trigger_obj = new stdClass(); |
| 2554 | 2554 | $trigger_obj->member_srl = $member_srl; |
| 2555 | 2555 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
| 2556 | - if(!$output->toBool()) return $output; |
|
| 2556 | + if (!$output->toBool()) return $output; |
|
| 2557 | 2557 | // Create a model object |
| 2558 | 2558 | $oMemberModel = getModel('member'); |
| 2559 | 2559 | // Bringing the user's information |
| 2560 | - if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
| 2560 | + if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
| 2561 | 2561 | { |
| 2562 | 2562 | $columnList = array('member_srl', 'is_admin'); |
| 2563 | 2563 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 2564 | 2564 | } |
| 2565 | - if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 2565 | + if (!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 2566 | 2566 | // If managers can not be deleted |
| 2567 | - if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
| 2567 | + if ($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
| 2568 | 2568 | |
| 2569 | 2569 | $oDB = &DB::getInstance(); |
| 2570 | 2570 | $oDB->begin(); |
@@ -2573,7 +2573,7 @@ discard block |
||
| 2573 | 2573 | $args->member_srl = $member_srl; |
| 2574 | 2574 | // Delete the entries in member_auth_mail |
| 2575 | 2575 | $output = executeQuery('member.deleteAuthMail', $args); |
| 2576 | - if(!$output->toBool()) |
|
| 2576 | + if (!$output->toBool()) |
|
| 2577 | 2577 | { |
| 2578 | 2578 | $oDB->rollback(); |
| 2579 | 2579 | return $output; |
@@ -2588,23 +2588,23 @@ discard block |
||
| 2588 | 2588 | */ |
| 2589 | 2589 | // Delete the entries in member_group_member |
| 2590 | 2590 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
| 2591 | - if(!$output->toBool()) |
|
| 2591 | + if (!$output->toBool()) |
|
| 2592 | 2592 | { |
| 2593 | 2593 | $oDB->rollback(); |
| 2594 | 2594 | return $output; |
| 2595 | 2595 | } |
| 2596 | 2596 | // member removed from the table |
| 2597 | 2597 | $output = executeQuery('member.deleteMember', $args); |
| 2598 | - if(!$output->toBool()) |
|
| 2598 | + if (!$output->toBool()) |
|
| 2599 | 2599 | { |
| 2600 | 2600 | $oDB->rollback(); |
| 2601 | 2601 | return $output; |
| 2602 | 2602 | } |
| 2603 | 2603 | // Call a trigger (after) |
| 2604 | - if($output->toBool()) |
|
| 2604 | + if ($output->toBool()) |
|
| 2605 | 2605 | { |
| 2606 | 2606 | $trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj); |
| 2607 | - if(!$trigger_output->toBool()) |
|
| 2607 | + if (!$trigger_output->toBool()) |
|
| 2608 | 2608 | { |
| 2609 | 2609 | $oDB->rollback(); |
| 2610 | 2610 | return $trigger_output; |
@@ -2628,23 +2628,23 @@ discard block |
||
| 2628 | 2628 | */ |
| 2629 | 2629 | function destroySessionInfo() |
| 2630 | 2630 | { |
| 2631 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
| 2631 | + if (!$_SESSION || !is_array($_SESSION)) return; |
|
| 2632 | 2632 | |
| 2633 | 2633 | $memberInfo = Context::get('logged_info'); |
| 2634 | 2634 | $memberSrl = $memberInfo->member_srl; |
| 2635 | 2635 | |
| 2636 | - foreach($_SESSION as $key => $val) |
|
| 2636 | + foreach ($_SESSION as $key => $val) |
|
| 2637 | 2637 | { |
| 2638 | 2638 | $_SESSION[$key] = ''; |
| 2639 | 2639 | } |
| 2640 | 2640 | |
| 2641 | 2641 | session_destroy(); |
| 2642 | - setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000); |
|
| 2643 | - setcookie('sso','',$_SERVER['REQUEST_TIME']-42000); |
|
| 2644 | - setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000); |
|
| 2642 | + setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000); |
|
| 2643 | + setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000); |
|
| 2644 | + setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000); |
|
| 2645 | 2645 | setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000); |
| 2646 | 2646 | |
| 2647 | - if($memberSrl || $_COOKIE['xeak']) |
|
| 2647 | + if ($memberSrl || $_COOKIE['xeak']) |
|
| 2648 | 2648 | { |
| 2649 | 2649 | $args = new stdClass(); |
| 2650 | 2650 | $args->member_srl = $memberSrl; |
@@ -2660,22 +2660,22 @@ discard block |
||
| 2660 | 2660 | $pointGroup = $pointModuleConfig->point_group; |
| 2661 | 2661 | |
| 2662 | 2662 | $levelGroup = array(); |
| 2663 | - if(is_array($pointGroup) && count($pointGroup)>0) |
|
| 2663 | + if (is_array($pointGroup) && count($pointGroup) > 0) |
|
| 2664 | 2664 | { |
| 2665 | 2665 | $levelGroup = array_flip($pointGroup); |
| 2666 | 2666 | ksort($levelGroup); |
| 2667 | 2667 | } |
| 2668 | 2668 | $maxLevel = 0; |
| 2669 | 2669 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
| 2670 | - if(count($resultGroup) > 0) |
|
| 2670 | + if (count($resultGroup) > 0) |
|
| 2671 | 2671 | $maxLevel = max(array_flip($resultGroup)); |
| 2672 | 2672 | |
| 2673 | - if($maxLevel > 0) |
|
| 2673 | + if ($maxLevel > 0) |
|
| 2674 | 2674 | { |
| 2675 | 2675 | $oPointModel = getModel('point'); |
| 2676 | 2676 | $originPoint = $oPointModel->getPoint($memberSrl); |
| 2677 | 2677 | |
| 2678 | - if($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
| 2678 | + if ($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
| 2679 | 2679 | { |
| 2680 | 2680 | $oPointController = getController('point'); |
| 2681 | 2681 | $oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update'); |
@@ -2685,18 +2685,18 @@ discard block |
||
| 2685 | 2685 | |
| 2686 | 2686 | function procMemberModifyEmailAddress() |
| 2687 | 2687 | { |
| 2688 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 2688 | + if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 2689 | 2689 | |
| 2690 | 2690 | $member_info = Context::get('logged_info'); |
| 2691 | 2691 | $newEmail = Context::get('email_address'); |
| 2692 | 2692 | |
| 2693 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
| 2693 | + if (!$newEmail) return $this->stop('msg_invalid_request'); |
|
| 2694 | 2694 | |
| 2695 | 2695 | $oMemberModel = getModel('member'); |
| 2696 | 2696 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
| 2697 | - if($member_srl) return new BaseObject(-1,'msg_exists_email_address'); |
|
| 2697 | + if ($member_srl) return new BaseObject(-1, 'msg_exists_email_address'); |
|
| 2698 | 2698 | |
| 2699 | - if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
| 2699 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
| 2700 | 2700 | { |
| 2701 | 2701 | return $this->stop('msg_invalid_request'); |
| 2702 | 2702 | } |
@@ -2712,7 +2712,7 @@ discard block |
||
| 2712 | 2712 | $oDB = &DB::getInstance(); |
| 2713 | 2713 | $oDB->begin(); |
| 2714 | 2714 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 2715 | - if(!$output->toBool()) |
|
| 2715 | + if (!$output->toBool()) |
|
| 2716 | 2716 | { |
| 2717 | 2717 | $oDB->rollback(); |
| 2718 | 2718 | return $output; |
@@ -2722,7 +2722,7 @@ discard block |
||
| 2722 | 2722 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 2723 | 2723 | |
| 2724 | 2724 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 2725 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 2725 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 2726 | 2726 | |
| 2727 | 2727 | global $lang; |
| 2728 | 2728 | |
@@ -2734,17 +2734,17 @@ discard block |
||
| 2734 | 2734 | |
| 2735 | 2735 | Context::set('newEmail', $newEmail); |
| 2736 | 2736 | |
| 2737 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
|
| 2737 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key); |
|
| 2738 | 2738 | Context::set('auth_url', $auth_url); |
| 2739 | 2739 | |
| 2740 | 2740 | $oTemplate = &TemplateHandler::getInstance(); |
| 2741 | 2741 | $content = $oTemplate->compile($tpl_path, 'confirm_member_new_email'); |
| 2742 | 2742 | |
| 2743 | 2743 | $oMail = new Mail(); |
| 2744 | - $oMail->setTitle( Context::getLang('title_modify_email_address') ); |
|
| 2744 | + $oMail->setTitle(Context::getLang('title_modify_email_address')); |
|
| 2745 | 2745 | $oMail->setContent($content); |
| 2746 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 2747 | - $oMail->setReceiptor( $member_info->nick_name, $newEmail ); |
|
| 2746 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 2747 | + $oMail->setReceiptor($member_info->nick_name, $newEmail); |
|
| 2748 | 2748 | $result = $oMail->send(); |
| 2749 | 2749 | |
| 2750 | 2750 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail); |
@@ -2758,16 +2758,16 @@ discard block |
||
| 2758 | 2758 | { |
| 2759 | 2759 | $member_srl = Context::get('member_srl'); |
| 2760 | 2760 | $auth_key = Context::get('auth_key'); |
| 2761 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
| 2761 | + if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
| 2762 | 2762 | |
| 2763 | 2763 | // Test logs for finding password by user_id and authkey |
| 2764 | 2764 | $args = new stdClass; |
| 2765 | 2765 | $args->member_srl = $member_srl; |
| 2766 | 2766 | $args->auth_key = $auth_key; |
| 2767 | 2767 | $output = executeQuery('member.getAuthMail', $args); |
| 2768 | - if(!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 2768 | + if (!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 2769 | 2769 | { |
| 2770 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 2770 | + if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 2771 | 2771 | return $this->stop('msg_invalid_modify_email_auth_key'); |
| 2772 | 2772 | } |
| 2773 | 2773 | |
@@ -2776,10 +2776,10 @@ discard block |
||
| 2776 | 2776 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
| 2777 | 2777 | |
| 2778 | 2778 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
| 2779 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
| 2779 | + if (!$output->toBool()) return $this->stop($output->getMessage()); |
|
| 2780 | 2780 | |
| 2781 | 2781 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
| 2782 | - executeQuery('member.deleteAuthChangeEmailAddress',$args); |
|
| 2782 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 2783 | 2783 | |
| 2784 | 2784 | $this->_clearMemberCache($args->member_srl); |
| 2785 | 2785 | |
@@ -2797,7 +2797,7 @@ discard block |
||
| 2797 | 2797 | **/ |
| 2798 | 2798 | function triggerGetDocumentMenu(&$menu_list) |
| 2799 | 2799 | { |
| 2800 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
| 2800 | + if (!Context::get('is_logged')) return new BaseObject(); |
|
| 2801 | 2801 | |
| 2802 | 2802 | $logged_info = Context::get('logged_info'); |
| 2803 | 2803 | $document_srl = Context::get('target_srl'); |
@@ -2808,12 +2808,12 @@ discard block |
||
| 2808 | 2808 | $member_srl = $oDocument->get('member_srl'); |
| 2809 | 2809 | $module_srl = $oDocument->get('module_srl'); |
| 2810 | 2810 | |
| 2811 | - if(!$member_srl) return new BaseObject(); |
|
| 2812 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
| 2811 | + if (!$member_srl) return new BaseObject(); |
|
| 2812 | + if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject(); |
|
| 2813 | 2813 | |
| 2814 | 2814 | $oDocumentController = getController('document'); |
| 2815 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
| 2816 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup'); |
|
| 2815 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
| 2816 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
| 2817 | 2817 | |
| 2818 | 2818 | return new BaseObject(); |
| 2819 | 2819 | } |
@@ -2827,7 +2827,7 @@ discard block |
||
| 2827 | 2827 | **/ |
| 2828 | 2828 | function triggerGetCommentMenu(&$menu_list) |
| 2829 | 2829 | { |
| 2830 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
| 2830 | + if (!Context::get('is_logged')) return new BaseObject(); |
|
| 2831 | 2831 | |
| 2832 | 2832 | $logged_info = Context::get('logged_info'); |
| 2833 | 2833 | $comment_srl = Context::get('target_srl'); |
@@ -2838,12 +2838,12 @@ discard block |
||
| 2838 | 2838 | $module_srl = $oComment->get('module_srl'); |
| 2839 | 2839 | $member_srl = $oComment->get('member_srl'); |
| 2840 | 2840 | |
| 2841 | - if(!$member_srl) return new BaseObject(); |
|
| 2842 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
| 2841 | + if (!$member_srl) return new BaseObject(); |
|
| 2842 | + if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject(); |
|
| 2843 | 2843 | |
| 2844 | 2844 | $oCommentController = getController('comment'); |
| 2845 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
| 2846 | - $oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup'); |
|
| 2845 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
| 2846 | + $oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
| 2847 | 2847 | |
| 2848 | 2848 | return new BaseObject(); |
| 2849 | 2849 | } |
@@ -2855,7 +2855,7 @@ discard block |
||
| 2855 | 2855 | **/ |
| 2856 | 2856 | function procMemberSpammerManage() |
| 2857 | 2857 | { |
| 2858 | - if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted'); |
|
| 2858 | + if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted'); |
|
| 2859 | 2859 | |
| 2860 | 2860 | $logged_info = Context::get('logged_info'); |
| 2861 | 2861 | $member_srl = Context::get('member_srl'); |
@@ -2863,7 +2863,7 @@ discard block |
||
| 2863 | 2863 | $cnt_loop = Context::get('cnt_loop'); |
| 2864 | 2864 | $proc_type = Context::get('proc_type'); |
| 2865 | 2865 | $isMoveToTrash = true; |
| 2866 | - if($proc_type == "delete") |
|
| 2866 | + if ($proc_type == "delete") |
|
| 2867 | 2867 | $isMoveToTrash = false; |
| 2868 | 2868 | |
| 2869 | 2869 | // check grant |
@@ -2872,7 +2872,7 @@ discard block |
||
| 2872 | 2872 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
| 2873 | 2873 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
| 2874 | 2874 | |
| 2875 | - if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted'); |
|
| 2875 | + if (!$grant->manager) return new BaseObject(-1, 'msg_not_permitted'); |
|
| 2876 | 2876 | |
| 2877 | 2877 | $proc_msg = ""; |
| 2878 | 2878 | |
@@ -2881,10 +2881,10 @@ discard block |
||
| 2881 | 2881 | |
| 2882 | 2882 | // delete or trash destination |
| 2883 | 2883 | // proc member |
| 2884 | - if($cnt_loop == 1) |
|
| 2884 | + if ($cnt_loop == 1) |
|
| 2885 | 2885 | $this->_spammerMember($member_srl); |
| 2886 | 2886 | // proc document and comment |
| 2887 | - elseif($cnt_loop>1) |
|
| 2887 | + elseif ($cnt_loop > 1) |
|
| 2888 | 2888 | $this->_spammerDocuments($member_srl, $isMoveToTrash); |
| 2889 | 2889 | |
| 2890 | 2890 | // get destination count |
@@ -2893,11 +2893,11 @@ discard block |
||
| 2893 | 2893 | |
| 2894 | 2894 | $total_count = Context::get('total_count'); |
| 2895 | 2895 | $remain_count = $cnt_document + $cnt_comment; |
| 2896 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
| 2896 | + if ($cnt_loop == 1) $total_count = $remain_count; |
|
| 2897 | 2897 | |
| 2898 | 2898 | // get progress percent |
| 2899 | - if($total_count > 0) |
|
| 2900 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
| 2899 | + if ($total_count > 0) |
|
| 2900 | + $progress = intval((($total_count - $remain_count) / $total_count) * 100); |
|
| 2901 | 2901 | else |
| 2902 | 2902 | $progress = 100; |
| 2903 | 2903 | |
@@ -2921,7 +2921,7 @@ discard block |
||
| 2921 | 2921 | **/ |
| 2922 | 2922 | private function _spammerMember($member_srl) { |
| 2923 | 2923 | $logged_info = Context::get('logged_info'); |
| 2924 | - $spam_description = trim( Context::get('spam_description') ); |
|
| 2924 | + $spam_description = trim(Context::get('spam_description')); |
|
| 2925 | 2925 | |
| 2926 | 2926 | $oMemberModel = getModel('member'); |
| 2927 | 2927 | $columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description'); |
@@ -2940,10 +2940,10 @@ discard block |
||
| 2940 | 2940 | $args->user_id = $member_info->user_id; |
| 2941 | 2941 | $args->nick_name = $member_info->nick_name; |
| 2942 | 2942 | $args->denied = "Y"; |
| 2943 | - $args->description = trim( $member_info->description ); |
|
| 2944 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
| 2943 | + $args->description = trim($member_info->description); |
|
| 2944 | + if ($args->description != "") $args->description .= "\n"; // add new line |
|
| 2945 | 2945 | |
| 2946 | - $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 . "]"; |
|
| 2946 | + $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."]"; |
|
| 2947 | 2947 | |
| 2948 | 2948 | $output = $this->updateMember($args, true); |
| 2949 | 2949 | |
@@ -2972,21 +2972,21 @@ discard block |
||
| 2972 | 2972 | // 1. proc comment, 2. proc document |
| 2973 | 2973 | $cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl); |
| 2974 | 2974 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
| 2975 | - if($cnt_comment > 0) |
|
| 2975 | + if ($cnt_comment > 0) |
|
| 2976 | 2976 | { |
| 2977 | 2977 | $columnList = array(); |
| 2978 | 2978 | $commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
| 2979 | - if($commentList) { |
|
| 2980 | - foreach($commentList as $v) { |
|
| 2979 | + if ($commentList) { |
|
| 2980 | + foreach ($commentList as $v) { |
|
| 2981 | 2981 | $oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash); |
| 2982 | 2982 | } |
| 2983 | 2983 | } |
| 2984 | - } elseif($cnt_document > 0) { |
|
| 2984 | + } elseif ($cnt_document > 0) { |
|
| 2985 | 2985 | $columnList = array(); |
| 2986 | 2986 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
| 2987 | - if($documentList) { |
|
| 2988 | - foreach($documentList as $v) { |
|
| 2989 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
| 2987 | + if ($documentList) { |
|
| 2988 | + foreach ($documentList as $v) { |
|
| 2989 | + if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
| 2990 | 2990 | else $oDocumentController->deleteDocument($v->document_srl); |
| 2991 | 2991 | } |
| 2992 | 2992 | } |
@@ -2998,24 +2998,24 @@ discard block |
||
| 2998 | 2998 | function _clearMemberCache($member_srl, $site_srl = 0) |
| 2999 | 2999 | { |
| 3000 | 3000 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
| 3001 | - if($oCacheHandler->isSupport()) |
|
| 3001 | + if ($oCacheHandler->isSupport()) |
|
| 3002 | 3002 | { |
| 3003 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl; |
|
| 3003 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl; |
|
| 3004 | 3004 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 3005 | 3005 | $oCacheHandler->delete($cache_key); |
| 3006 | 3006 | |
| 3007 | - if($site_srl !== 0) |
|
| 3007 | + if ($site_srl !== 0) |
|
| 3008 | 3008 | { |
| 3009 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0'; |
|
| 3009 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0'; |
|
| 3010 | 3010 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 3011 | 3011 | $oCacheHandler->delete($cache_key); |
| 3012 | 3012 | } |
| 3013 | 3013 | } |
| 3014 | 3014 | |
| 3015 | 3015 | $oCacheHandler = CacheHandler::getInstance('object'); |
| 3016 | - if($oCacheHandler->isSupport()) |
|
| 3016 | + if ($oCacheHandler->isSupport()) |
|
| 3017 | 3017 | { |
| 3018 | - $object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl; |
|
| 3018 | + $object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl; |
|
| 3019 | 3019 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 3020 | 3020 | $oCacheHandler->delete($cache_key); |
| 3021 | 3021 | } |
@@ -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 = Context::get('profile_image'); |
@@ -423,43 +485,46 @@ discard block |
||
| 423 | 485 | if($config->identifier == 'email_address') |
| 424 | 486 | { |
| 425 | 487 | $output = $this->doLogin($args->email_address); |
| 426 | - } |
|
| 427 | - else |
|
| 488 | + } else |
|
| 428 | 489 | { |
| 429 | 490 | $output = $this->doLogin($args->user_id); |
| 430 | 491 | } |
| 431 | 492 | if(!$output->toBool()) { |
| 432 | - if($output->error == -9) |
|
| 433 | - $output->error = -11; |
|
| 493 | + if($output->error == -9) { |
|
| 494 | + $output->error = -11; |
|
| 495 | + } |
|
| 434 | 496 | return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output); |
| 435 | 497 | } |
| 436 | 498 | } |
| 437 | 499 | |
| 438 | 500 | // Results |
| 439 | 501 | $this->add('member_srl', $args->member_srl); |
| 440 | - if($config->redirect_url) $this->add('redirect_url', $config->redirect_url); |
|
| 502 | + if($config->redirect_url) { |
|
| 503 | + $this->add('redirect_url', $config->redirect_url); |
|
| 504 | + } |
|
| 441 | 505 | if($config->enable_confirm == 'Y') |
| 442 | 506 | { |
| 443 | 507 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
| 444 | 508 | $this->setMessage($msg); |
| 445 | 509 | return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new BaseObject(-12, $msg)); |
| 510 | + } else { |
|
| 511 | + $this->setMessage('success_registed'); |
|
| 446 | 512 | } |
| 447 | - else $this->setMessage('success_registed'); |
|
| 448 | 513 | // Call a trigger (after) |
| 449 | 514 | $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config); |
| 450 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 515 | + if(!$trigger_output->toBool()) { |
|
| 516 | + return $trigger_output; |
|
| 517 | + } |
|
| 451 | 518 | |
| 452 | 519 | if($config->redirect_url) |
| 453 | 520 | { |
| 454 | 521 | $returnUrl = $config->redirect_url; |
| 455 | - } |
|
| 456 | - else |
|
| 522 | + } else |
|
| 457 | 523 | { |
| 458 | 524 | if(Context::get('success_return_url')) |
| 459 | 525 | { |
| 460 | 526 | $returnUrl = Context::get('success_return_url'); |
| 461 | - } |
|
| 462 | - else if($_COOKIE['XE_REDIRECT_URL']) |
|
| 527 | + } else if($_COOKIE['XE_REDIRECT_URL']) |
|
| 463 | 528 | { |
| 464 | 529 | $returnUrl = $_COOKIE['XE_REDIRECT_URL']; |
| 465 | 530 | setcookie("XE_REDIRECT_URL", '', 1); |
@@ -513,8 +578,7 @@ discard block |
||
| 513 | 578 | if(Context::get('success_return_url')) |
| 514 | 579 | { |
| 515 | 580 | $redirectUrl = Context::get('success_return_url'); |
| 516 | - } |
|
| 517 | - else |
|
| 581 | + } else |
|
| 518 | 582 | { |
| 519 | 583 | $redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
| 520 | 584 | } |
@@ -558,7 +622,9 @@ discard block |
||
| 558 | 622 | foreach($getVars as $val) |
| 559 | 623 | { |
| 560 | 624 | $args->{$val} = Context::get($val); |
| 561 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 625 | + if($val == 'birthday') { |
|
| 626 | + $args->birthday_ui = Context::get('birthday_ui'); |
|
| 627 | + } |
|
| 562 | 628 | if($val == 'find_account_answer' && !Context::get($val)) { |
| 563 | 629 | unset($args->{$val}); |
| 564 | 630 | } |
@@ -568,7 +634,9 @@ discard block |
||
| 568 | 634 | $logged_info = Context::get('logged_info'); |
| 569 | 635 | $args->member_srl = $logged_info->member_srl; |
| 570 | 636 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
| 571 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 637 | + if(!$args->birthday && $args->birthday_ui) { |
|
| 638 | + $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 639 | + } |
|
| 572 | 640 | |
| 573 | 641 | // Remove some unnecessary variables from all the vars |
| 574 | 642 | $all_args = Context::getRequestVars(); |
@@ -603,7 +671,9 @@ discard block |
||
| 603 | 671 | |
| 604 | 672 | // Execute insert or update depending on the value of member_srl |
| 605 | 673 | $output = $this->updateMember($args); |
| 606 | - if(!$output->toBool()) return $output; |
|
| 674 | + if(!$output->toBool()) { |
|
| 675 | + return $output; |
|
| 676 | + } |
|
| 607 | 677 | |
| 608 | 678 | $profile_image = Context::get('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 = Context::get('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 = Context::get('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 = Context::get('image_mark'); |
| 990 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1098 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
| 1099 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1100 | + } |
|
| 991 | 1101 | // Ignore if member_srl is invalid or doesn't exist. |
| 992 | 1102 | $member_srl = Context::get('member_srl'); |
| 993 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1103 | + if(!$member_srl) { |
|
| 1104 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1105 | + } |
|
| 994 | 1106 | |
| 995 | 1107 | $logged_info = Context::get('logged_info'); |
| 996 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1108 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
| 1109 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1110 | + } |
|
| 997 | 1111 | // Membership in the images mark the module using the ban was set by an administrator or return; |
| 998 | 1112 | $oMemberModel = getModel('member'); |
| 999 | 1113 | $config = $oMemberModel->getMemberConfig(); |
| 1000 | - if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1114 | + if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') { |
|
| 1115 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1116 | + } |
|
| 1001 | 1117 | |
| 1002 | 1118 | $this->insertImageMark($member_srl, $file['tmp_name']); |
| 1003 | - if(!$output->toBool()) return $output; |
|
| 1119 | + if(!$output->toBool()) { |
|
| 1120 | + return $output; |
|
| 1121 | + } |
|
| 1004 | 1122 | |
| 1005 | 1123 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
| 1006 | 1124 | $this->setRedirectUrl($returnUrl); |
@@ -1051,8 +1169,7 @@ discard block |
||
| 1051 | 1169 | FileHandler::removeFilesInDir($target_path); |
| 1052 | 1170 | FileHandler::moveFile($temp_filename, $target_filename); |
| 1053 | 1171 | FileHandler::clearStatCache($target_filename); |
| 1054 | - } |
|
| 1055 | - else |
|
| 1172 | + } else |
|
| 1056 | 1173 | { |
| 1057 | 1174 | $filesize = filesize($target_file); |
| 1058 | 1175 | if($max_filesize && $filesize > ($max_filesize * 1024)) |
@@ -1104,14 +1221,18 @@ discard block |
||
| 1104 | 1221 | function procMemberFindAccount() |
| 1105 | 1222 | { |
| 1106 | 1223 | $email_address = Context::get('email_address'); |
| 1107 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1224 | + if(!$email_address) { |
|
| 1225 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1226 | + } |
|
| 1108 | 1227 | |
| 1109 | 1228 | $oMemberModel = getModel('member'); |
| 1110 | 1229 | $oModuleModel = getModel('module'); |
| 1111 | 1230 | |
| 1112 | 1231 | // Check if a member having the same email address exists |
| 1113 | 1232 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1114 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1233 | + if(!$member_srl) { |
|
| 1234 | + return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1235 | + } |
|
| 1115 | 1236 | |
| 1116 | 1237 | // Get information of the member |
| 1117 | 1238 | $columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name'); |
@@ -1123,7 +1244,9 @@ discard block |
||
| 1123 | 1244 | $chk_args = new stdClass; |
| 1124 | 1245 | $chk_args->member_srl = $member_info->member_srl; |
| 1125 | 1246 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1126 | - if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
| 1247 | + if($output->toBool() && $output->data->count != '0') { |
|
| 1248 | + return new BaseObject(-1, 'msg_user_not_confirmed'); |
|
| 1249 | + } |
|
| 1127 | 1250 | } |
| 1128 | 1251 | |
| 1129 | 1252 | // Insert data into the authentication DB |
@@ -1136,7 +1259,9 @@ discard block |
||
| 1136 | 1259 | $args->is_register = 'N'; |
| 1137 | 1260 | |
| 1138 | 1261 | $output = executeQuery('member.insertAuthMail', $args); |
| 1139 | - if(!$output->toBool()) return $output; |
|
| 1262 | + if(!$output->toBool()) { |
|
| 1263 | + return $output; |
|
| 1264 | + } |
|
| 1140 | 1265 | // Get content of the email to send a member |
| 1141 | 1266 | Context::set('auth_args', $args); |
| 1142 | 1267 | |
@@ -1153,8 +1278,7 @@ discard block |
||
| 1153 | 1278 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1154 | 1279 | } |
| 1155 | 1280 | } |
| 1156 | - } |
|
| 1157 | - else |
|
| 1281 | + } else |
|
| 1158 | 1282 | { |
| 1159 | 1283 | $memberInfo[$lang->user_id] = $args->user_id; |
| 1160 | 1284 | $memberInfo[$lang->user_name] = $args->user_name; |
@@ -1163,13 +1287,19 @@ discard block |
||
| 1163 | 1287 | } |
| 1164 | 1288 | Context::set('memberInfo', $memberInfo); |
| 1165 | 1289 | |
| 1166 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1167 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1290 | + if(!$member_config->skin) { |
|
| 1291 | + $member_config->skin = "default"; |
|
| 1292 | + } |
|
| 1293 | + if(!$member_config->colorset) { |
|
| 1294 | + $member_config->colorset = "white"; |
|
| 1295 | + } |
|
| 1168 | 1296 | |
| 1169 | 1297 | Context::set('member_config', $member_config); |
| 1170 | 1298 | |
| 1171 | 1299 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1172 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1300 | + if(!is_dir($tpl_path)) { |
|
| 1301 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1302 | + } |
|
| 1173 | 1303 | |
| 1174 | 1304 | $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
| 1175 | 1305 | Context::set('find_url', $find_url); |
@@ -1212,19 +1342,25 @@ discard block |
||
| 1212 | 1342 | $find_account_question = trim(Context::get('find_account_question')); |
| 1213 | 1343 | $find_account_answer = trim(Context::get('find_account_answer')); |
| 1214 | 1344 | |
| 1215 | - if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1345 | + if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) { |
|
| 1346 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1347 | + } |
|
| 1216 | 1348 | |
| 1217 | 1349 | $oModuleModel = getModel('module'); |
| 1218 | 1350 | // Check if a member having the same email address exists |
| 1219 | 1351 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1220 | - if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1352 | + if(!$member_srl) { |
|
| 1353 | + return new BaseObject(-1, 'msg_email_not_exists'); |
|
| 1354 | + } |
|
| 1221 | 1355 | |
| 1222 | 1356 | // Get information of the member |
| 1223 | 1357 | $columnList = array('member_srl', 'find_account_question', 'find_account_answer'); |
| 1224 | 1358 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 1225 | 1359 | |
| 1226 | 1360 | // Display a message if no answer is entered |
| 1227 | - if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists'); |
|
| 1361 | + if(!$member_info->find_account_question || !$member_info->find_account_answer) { |
|
| 1362 | + return new BaseObject(-1, 'msg_question_not_exists'); |
|
| 1363 | + } |
|
| 1228 | 1364 | |
| 1229 | 1365 | // 답변 확인 |
| 1230 | 1366 | $hashed = $oPassword->checkAlgorithm($member_info->find_account_answer); |
@@ -1233,12 +1369,10 @@ discard block |
||
| 1233 | 1369 | if($member_info->find_account_question != $find_account_question) |
| 1234 | 1370 | { |
| 1235 | 1371 | $authed = false; |
| 1236 | - } |
|
| 1237 | - else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
| 1372 | + } else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer)) |
|
| 1238 | 1373 | { |
| 1239 | 1374 | $authed = false; |
| 1240 | - } |
|
| 1241 | - else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
| 1375 | + } else if(!$hashed && $find_account_answer != $member_info->find_account_answer) |
|
| 1242 | 1376 | { |
| 1243 | 1377 | $authed = false; |
| 1244 | 1378 | } |
@@ -1267,7 +1401,9 @@ discard block |
||
| 1267 | 1401 | $args->password = $temp_password; |
| 1268 | 1402 | $args->change_password_date = '1'; |
| 1269 | 1403 | $output = $this->updateMemberPassword($args); |
| 1270 | - if(!$output->toBool()) return $output; |
|
| 1404 | + if(!$output->toBool()) { |
|
| 1405 | + return $output; |
|
| 1406 | + } |
|
| 1271 | 1407 | |
| 1272 | 1408 | $_SESSION['xe_temp_password_' . $user_id] = $temp_password; |
| 1273 | 1409 | |
@@ -1327,7 +1463,9 @@ discard block |
||
| 1327 | 1463 | $auth_args->is_register = 'Y'; |
| 1328 | 1464 | |
| 1329 | 1465 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 1330 | - if(!$output->toBool()) return $output; |
|
| 1466 | + if(!$output->toBool()) { |
|
| 1467 | + return $output; |
|
| 1468 | + } |
|
| 1331 | 1469 | |
| 1332 | 1470 | // resend auth mail. |
| 1333 | 1471 | $this->_sendAuthMail($auth_args, $memberInfo); |
@@ -1344,8 +1482,7 @@ discard block |
||
| 1344 | 1482 | if($output->data->is_register == 'Y') |
| 1345 | 1483 | { |
| 1346 | 1484 | $args->denied = 'N'; |
| 1347 | - } |
|
| 1348 | - else |
|
| 1485 | + } else |
|
| 1349 | 1486 | { |
| 1350 | 1487 | $args->password = $oMemberModel->hashPassword($args->password); |
| 1351 | 1488 | } |
@@ -1379,33 +1516,45 @@ discard block |
||
| 1379 | 1516 | { |
| 1380 | 1517 | // Get an email_address |
| 1381 | 1518 | $email_address = Context::get('email_address'); |
| 1382 | - if(!$email_address) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1519 | + if(!$email_address) { |
|
| 1520 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1521 | + } |
|
| 1383 | 1522 | // Log test by using email_address |
| 1384 | 1523 | $oMemberModel = getModel('member'); |
| 1385 | 1524 | |
| 1386 | 1525 | $args = new stdClass; |
| 1387 | 1526 | $args->email_address = $email_address; |
| 1388 | 1527 | $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1389 | - if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 1528 | + if(!$memberSrl) { |
|
| 1529 | + return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 1530 | + } |
|
| 1390 | 1531 | |
| 1391 | 1532 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address'); |
| 1392 | 1533 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList); |
| 1393 | 1534 | |
| 1394 | 1535 | $oModuleModel = getModel('module'); |
| 1395 | 1536 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1396 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1397 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1537 | + if(!$member_config->skin) { |
|
| 1538 | + $member_config->skin = "default"; |
|
| 1539 | + } |
|
| 1540 | + if(!$member_config->colorset) { |
|
| 1541 | + $member_config->colorset = "white"; |
|
| 1542 | + } |
|
| 1398 | 1543 | |
| 1399 | 1544 | // Check if a authentication mail has been sent previously |
| 1400 | 1545 | $chk_args = new stdClass; |
| 1401 | 1546 | $chk_args->member_srl = $member_info->member_srl; |
| 1402 | 1547 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1403 | - if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1548 | + if($output->toBool() && $output->data->count == '0') { |
|
| 1549 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1550 | + } |
|
| 1404 | 1551 | |
| 1405 | 1552 | $auth_args = new stdClass; |
| 1406 | 1553 | $auth_args->member_srl = $member_info->member_srl; |
| 1407 | 1554 | $output = executeQueryArray('member.getAuthMailInfo', $auth_args); |
| 1408 | - if(!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1555 | + if(!$output->data || !$output->data[0]->auth_key) { |
|
| 1556 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 1557 | + } |
|
| 1409 | 1558 | $auth_info = $output->data[0]; |
| 1410 | 1559 | |
| 1411 | 1560 | // Update the regdate of authmail entry |
@@ -1426,8 +1575,7 @@ discard block |
||
| 1426 | 1575 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1427 | 1576 | } |
| 1428 | 1577 | } |
| 1429 | - } |
|
| 1430 | - else |
|
| 1578 | + } else |
|
| 1431 | 1579 | { |
| 1432 | 1580 | $memberInfo[$lang->user_id] = $member_info->user_id; |
| 1433 | 1581 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1440,7 +1588,9 @@ discard block |
||
| 1440 | 1588 | Context::set('member_config', $member_config); |
| 1441 | 1589 | |
| 1442 | 1590 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1443 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1591 | + if(!is_dir($tpl_path)) { |
|
| 1592 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1593 | + } |
|
| 1444 | 1594 | |
| 1445 | 1595 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); |
| 1446 | 1596 | Context::set('auth_url', $auth_url); |
@@ -1518,7 +1668,9 @@ discard block |
||
| 1518 | 1668 | $auth_args->is_register = 'Y'; |
| 1519 | 1669 | |
| 1520 | 1670 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 1521 | - if(!$output->toBool()) return $output; |
|
| 1671 | + if(!$output->toBool()) { |
|
| 1672 | + return $output; |
|
| 1673 | + } |
|
| 1522 | 1674 | |
| 1523 | 1675 | $memberInfo->email_address = $newEmail; |
| 1524 | 1676 | |
@@ -1552,8 +1704,7 @@ discard block |
||
| 1552 | 1704 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1553 | 1705 | } |
| 1554 | 1706 | } |
| 1555 | - } |
|
| 1556 | - else |
|
| 1707 | + } else |
|
| 1557 | 1708 | { |
| 1558 | 1709 | $memberInfo[$lang->user_id] = $member_info->user_id; |
| 1559 | 1710 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1562,13 +1713,19 @@ discard block |
||
| 1562 | 1713 | } |
| 1563 | 1714 | Context::set('memberInfo', $memberInfo); |
| 1564 | 1715 | |
| 1565 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1566 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1716 | + if(!$member_config->skin) { |
|
| 1717 | + $member_config->skin = "default"; |
|
| 1718 | + } |
|
| 1719 | + if(!$member_config->colorset) { |
|
| 1720 | + $member_config->colorset = "white"; |
|
| 1721 | + } |
|
| 1567 | 1722 | |
| 1568 | 1723 | Context::set('member_config', $member_config); |
| 1569 | 1724 | |
| 1570 | 1725 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1571 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1726 | + if(!is_dir($tpl_path)) { |
|
| 1727 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1728 | + } |
|
| 1572 | 1729 | |
| 1573 | 1730 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
| 1574 | 1731 | Context::set('auth_url', $auth_url); |
@@ -1593,7 +1750,9 @@ discard block |
||
| 1593 | 1750 | { |
| 1594 | 1751 | $site_module_info = Context::get('site_module_info'); |
| 1595 | 1752 | $logged_info = Context::get('logged_info'); |
| 1596 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
| 1753 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
| 1754 | + return new BaseObject(-1,'msg_invalid_request'); |
|
| 1755 | + } |
|
| 1597 | 1756 | |
| 1598 | 1757 | $oMemberModel = getModel('member'); |
| 1599 | 1758 | $columnList = array('site_srl', 'group_srl', 'title'); |
@@ -1612,13 +1771,17 @@ discard block |
||
| 1612 | 1771 | { |
| 1613 | 1772 | $site_module_info = Context::get('site_module_info'); |
| 1614 | 1773 | $logged_info = Context::get('logged_info'); |
| 1615 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request'); |
|
| 1774 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
| 1775 | + return new BaseObject(-1,'msg_invalid_request'); |
|
| 1776 | + } |
|
| 1616 | 1777 | |
| 1617 | 1778 | $args = new stdClass; |
| 1618 | 1779 | $args->site_srl= $site_module_info->site_srl; |
| 1619 | 1780 | $args->member_srl = $logged_info->member_srl; |
| 1620 | 1781 | $output = executeQuery('member.deleteMembersGroup', $args); |
| 1621 | - if(!$output->toBool()) return $output; |
|
| 1782 | + if(!$output->toBool()) { |
|
| 1783 | + return $output; |
|
| 1784 | + } |
|
| 1622 | 1785 | $this->setMessage('success_deleted'); |
| 1623 | 1786 | $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl); |
| 1624 | 1787 | } |
@@ -1632,17 +1795,37 @@ discard block |
||
| 1632 | 1795 | */ |
| 1633 | 1796 | function setMemberConfig($args) |
| 1634 | 1797 | { |
| 1635 | - if(!$args->skin) $args->skin = "default"; |
|
| 1636 | - if(!$args->colorset) $args->colorset = "white"; |
|
| 1637 | - if(!$args->editor_skin) $args->editor_skin= "ckeditor"; |
|
| 1638 | - if(!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
| 1639 | - if($args->enable_join!='Y') $args->enable_join = 'N'; |
|
| 1798 | + if(!$args->skin) { |
|
| 1799 | + $args->skin = "default"; |
|
| 1800 | + } |
|
| 1801 | + if(!$args->colorset) { |
|
| 1802 | + $args->colorset = "white"; |
|
| 1803 | + } |
|
| 1804 | + if(!$args->editor_skin) { |
|
| 1805 | + $args->editor_skin= "ckeditor"; |
|
| 1806 | + } |
|
| 1807 | + if(!$args->editor_colorset) { |
|
| 1808 | + $args->editor_colorset = "moono"; |
|
| 1809 | + } |
|
| 1810 | + if($args->enable_join!='Y') { |
|
| 1811 | + $args->enable_join = 'N'; |
|
| 1812 | + } |
|
| 1640 | 1813 | $args->enable_openid= 'N'; |
| 1641 | - if($args->profile_image !='Y') $args->profile_image = 'N'; |
|
| 1642 | - if($args->image_name!='Y') $args->image_name = 'N'; |
|
| 1643 | - if($args->image_mark!='Y') $args->image_mark = 'N'; |
|
| 1644 | - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; |
|
| 1645 | - if(!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
| 1814 | + if($args->profile_image !='Y') { |
|
| 1815 | + $args->profile_image = 'N'; |
|
| 1816 | + } |
|
| 1817 | + if($args->image_name!='Y') { |
|
| 1818 | + $args->image_name = 'N'; |
|
| 1819 | + } |
|
| 1820 | + if($args->image_mark!='Y') { |
|
| 1821 | + $args->image_mark = 'N'; |
|
| 1822 | + } |
|
| 1823 | + if($args->group_image_mark!='Y') { |
|
| 1824 | + $args->group_image_mark = 'N'; |
|
| 1825 | + } |
|
| 1826 | + if(!trim(strip_tags($args->agreement))) { |
|
| 1827 | + $args->agreement = null; |
|
| 1828 | + } |
|
| 1646 | 1829 | $args->limit_day = (int)$args->limit_day; |
| 1647 | 1830 | |
| 1648 | 1831 | $agreement = trim($args->agreement); |
@@ -1650,7 +1833,9 @@ discard block |
||
| 1650 | 1833 | |
| 1651 | 1834 | $oModuleController = getController('module'); |
| 1652 | 1835 | $output = $oModuleController->insertModuleConfig('member',$args); |
| 1653 | - if(!$output->toBool()) return $output; |
|
| 1836 | + if(!$output->toBool()) { |
|
| 1837 | + return $output; |
|
| 1838 | + } |
|
| 1654 | 1839 | |
| 1655 | 1840 | $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
| 1656 | 1841 | FileHandler::writeFile($agreement_file, $agreement); |
@@ -1675,7 +1860,9 @@ discard block |
||
| 1675 | 1860 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
| 1676 | 1861 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
| 1677 | 1862 | |
| 1678 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
| 1863 | + if(!$check_signature) { |
|
| 1864 | + return FileHandler::removeFile($filename); |
|
| 1865 | + } |
|
| 1679 | 1866 | |
| 1680 | 1867 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
| 1681 | 1868 | FileHandler::makeDir($path); |
@@ -1709,7 +1896,9 @@ discard block |
||
| 1709 | 1896 | $args = new stdClass(); |
| 1710 | 1897 | $args->member_srl = $member_srl; |
| 1711 | 1898 | $args->group_srl = $group_srl; |
| 1712 | - if($site_srl) $args->site_srl = $site_srl; |
|
| 1899 | + if($site_srl) { |
|
| 1900 | + $args->site_srl = $site_srl; |
|
| 1901 | + } |
|
| 1713 | 1902 | |
| 1714 | 1903 | // Add |
| 1715 | 1904 | $output = executeQuery('member.addMemberToGroup',$args); |
@@ -1735,15 +1924,21 @@ discard block |
||
| 1735 | 1924 | $obj->member_srl = implode(',',$args->member_srl); |
| 1736 | 1925 | |
| 1737 | 1926 | $output = executeQueryArray('member.getMembersGroup', $obj); |
| 1738 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1927 | + if($output->data) { |
|
| 1928 | + foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1929 | + } |
|
| 1739 | 1930 | |
| 1740 | 1931 | $output = executeQuery('member.deleteMembersGroup', $obj); |
| 1741 | - if(!$output->toBool()) return $output; |
|
| 1932 | + if(!$output->toBool()) { |
|
| 1933 | + return $output; |
|
| 1934 | + } |
|
| 1742 | 1935 | |
| 1743 | 1936 | $inserted_members = array(); |
| 1744 | 1937 | foreach($args->member_srl as $key => $val) |
| 1745 | 1938 | { |
| 1746 | - if($inserted_members[$val]) continue; |
|
| 1939 | + if($inserted_members[$val]) { |
|
| 1940 | + continue; |
|
| 1941 | + } |
|
| 1747 | 1942 | $inserted_members[$val] = true; |
| 1748 | 1943 | |
| 1749 | 1944 | unset($obj); |
@@ -1753,7 +1948,9 @@ discard block |
||
| 1753 | 1948 | $obj->site_srl = $args->site_srl; |
| 1754 | 1949 | $obj->regdate = $date[$obj->member_srl]; |
| 1755 | 1950 | $output = executeQuery('member.addMemberToGroup', $obj); |
| 1756 | - if(!$output->toBool()) return $output; |
|
| 1951 | + if(!$output->toBool()) { |
|
| 1952 | + return $output; |
|
| 1953 | + } |
|
| 1757 | 1954 | |
| 1758 | 1955 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
| 1759 | 1956 | } |
@@ -1815,8 +2012,7 @@ discard block |
||
| 1815 | 2012 | if($config->identifier == 'user_id') |
| 1816 | 2013 | { |
| 1817 | 2014 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
| 1818 | - } |
|
| 1819 | - else |
|
| 2015 | + } else |
|
| 1820 | 2016 | { |
| 1821 | 2017 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
| 1822 | 2018 | } |
@@ -1825,8 +2021,7 @@ discard block |
||
| 1825 | 2021 | $do_auto_login = true; |
| 1826 | 2022 | } |
| 1827 | 2023 | |
| 1828 | - } |
|
| 1829 | - else |
|
| 2024 | + } else |
|
| 1830 | 2025 | { |
| 1831 | 2026 | $do_auto_login = true; |
| 1832 | 2027 | } |
@@ -1835,8 +2030,7 @@ discard block |
||
| 1835 | 2030 | if($do_auto_login) |
| 1836 | 2031 | { |
| 1837 | 2032 | $output = $this->doLogin($user_id); |
| 1838 | - } |
|
| 1839 | - else |
|
| 2033 | + } else |
|
| 1840 | 2034 | { |
| 1841 | 2035 | executeQuery('member.deleteAutologin', $args); |
| 1842 | 2036 | setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
@@ -1855,13 +2049,17 @@ discard block |
||
| 1855 | 2049 | function doLogin($user_id, $password = '', $keep_signed = false) |
| 1856 | 2050 | { |
| 1857 | 2051 | $user_id = strtolower($user_id); |
| 1858 | - if(!$user_id) return new BaseObject(-1, 'null_user_id'); |
|
| 2052 | + if(!$user_id) { |
|
| 2053 | + return new BaseObject(-1, 'null_user_id'); |
|
| 2054 | + } |
|
| 1859 | 2055 | // Call a trigger before log-in (before) |
| 1860 | 2056 | $trigger_obj = new stdClass(); |
| 1861 | 2057 | $trigger_obj->user_id = $user_id; |
| 1862 | 2058 | $trigger_obj->password = $password; |
| 1863 | 2059 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
| 1864 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 2060 | + if(!$trigger_output->toBool()) { |
|
| 2061 | + return $trigger_output; |
|
| 2062 | + } |
|
| 1865 | 2063 | // Create a member model object |
| 1866 | 2064 | $oMemberModel = getModel('member'); |
| 1867 | 2065 | |
@@ -1876,15 +2074,18 @@ discard block |
||
| 1876 | 2074 | // Get user_id information |
| 1877 | 2075 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
| 1878 | 2076 | // Set an invalid user if no value returned |
| 1879 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 2077 | + if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) { |
|
| 2078 | + return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 2079 | + } |
|
| 1880 | 2080 | |
| 1881 | - } |
|
| 1882 | - else |
|
| 2081 | + } else |
|
| 1883 | 2082 | { |
| 1884 | 2083 | // Get user_id information |
| 1885 | 2084 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
| 1886 | 2085 | // Set an invalid user if no value returned |
| 1887 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 2086 | + if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) { |
|
| 2087 | + return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 2088 | + } |
|
| 1888 | 2089 | } |
| 1889 | 2090 | |
| 1890 | 2091 | $output = executeQuery('member.getLoginCountByIp', $args); |
@@ -1896,14 +2097,18 @@ discard block |
||
| 1896 | 2097 | if($term < $config->max_error_count_time) |
| 1897 | 2098 | { |
| 1898 | 2099 | $term = $config->max_error_count_time - $term; |
| 1899 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
| 1900 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
| 1901 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
| 1902 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
| 2100 | + if($term < 60) { |
|
| 2101 | + $term = intval($term).Context::getLang('unit_sec'); |
|
| 2102 | + } elseif(60 <= $term && $term < 3600) { |
|
| 2103 | + $term = intval($term/60).Context::getLang('unit_min'); |
|
| 2104 | + } elseif(3600 <= $term && $term < 86400) { |
|
| 2105 | + $term = intval($term/3600).Context::getLang('unit_hour'); |
|
| 2106 | + } else { |
|
| 2107 | + $term = intval($term/86400).Context::getLang('unit_day'); |
|
| 2108 | + } |
|
| 1903 | 2109 | |
| 1904 | 2110 | return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
| 1905 | - } |
|
| 1906 | - else |
|
| 2111 | + } else |
|
| 1907 | 2112 | { |
| 1908 | 2113 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
| 1909 | 2114 | $output = executeQuery('member.deleteLoginCountByIp', $args); |
@@ -1930,7 +2135,9 @@ discard block |
||
| 1930 | 2135 | return new BaseObject(-1,'msg_user_denied'); |
| 1931 | 2136 | } |
| 1932 | 2137 | // Notify if denied_date is less than the current time |
| 1933 | - if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
| 2138 | + if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) { |
|
| 2139 | + return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
| 2140 | + } |
|
| 1934 | 2141 | // Update the latest login time |
| 1935 | 2142 | $args->member_srl = $this->memberInfo->member_srl; |
| 1936 | 2143 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1979,7 +2186,9 @@ discard block |
||
| 1979 | 2186 | } |
| 1980 | 2187 | // Call a trigger after successfully log-in (after) |
| 1981 | 2188 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
| 1982 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 2189 | + if(!$trigger_output->toBool()) { |
|
| 2190 | + return $trigger_output; |
|
| 2191 | + } |
|
| 1983 | 2192 | // When user checked to use auto-login |
| 1984 | 2193 | if($keep_signed) |
| 1985 | 2194 | { |
@@ -1993,7 +2202,9 @@ discard block |
||
| 1993 | 2202 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
| 1994 | 2203 | executeQuery('member.deleteAutologin', $autologin_args); |
| 1995 | 2204 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
| 1996 | - if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
| 2205 | + if($autologin_output->toBool()) { |
|
| 2206 | + setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
| 2207 | + } |
|
| 1997 | 2208 | } |
| 1998 | 2209 | if($this->memberInfo->is_admin == 'Y') |
| 1999 | 2210 | { |
@@ -2082,7 +2293,9 @@ discard block |
||
| 2082 | 2293 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
| 2083 | 2294 | { |
| 2084 | 2295 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
| 2085 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
| 2296 | + if(!is_array($member_popup_menu_list)) { |
|
| 2297 | + $member_popup_menu_list = array(); |
|
| 2298 | + } |
|
| 2086 | 2299 | |
| 2087 | 2300 | $obj = new stdClass; |
| 2088 | 2301 | $obj->url = $url; |
@@ -2101,35 +2314,54 @@ discard block |
||
| 2101 | 2314 | { |
| 2102 | 2315 | // Call a trigger (before) |
| 2103 | 2316 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
| 2104 | - if(!$output->toBool()) return $output; |
|
| 2317 | + if(!$output->toBool()) { |
|
| 2318 | + return $output; |
|
| 2319 | + } |
|
| 2105 | 2320 | // Terms and Conditions portion of the information set up by members reaffirmed |
| 2106 | 2321 | $oModuleModel = getModel('module'); |
| 2107 | 2322 | $config = $oModuleModel->getModuleConfig('member'); |
| 2108 | 2323 | |
| 2109 | 2324 | $logged_info = Context::get('logged_info'); |
| 2110 | 2325 | // If the date of the temporary restrictions limit further information on the date of |
| 2111 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
| 2326 | + if($config->limit_day) { |
|
| 2327 | + $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
| 2328 | + } |
|
| 2112 | 2329 | |
| 2113 | 2330 | $args->member_srl = getNextSequence(); |
| 2114 | 2331 | $args->list_order = -1 * $args->member_srl; |
| 2115 | 2332 | |
| 2116 | 2333 | // Execute insert or update depending on the value of member_srl |
| 2117 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2334 | + if(!$args->user_id) { |
|
| 2335 | + $args->user_id = 't'.$args->member_srl; |
|
| 2336 | + } |
|
| 2118 | 2337 | // Enter the user's identity changed to lowercase |
| 2119 | - else $args->user_id = strtolower($args->user_id); |
|
| 2120 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2121 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
| 2338 | + else { |
|
| 2339 | + $args->user_id = strtolower($args->user_id); |
|
| 2340 | + } |
|
| 2341 | + if(!$args->user_name) { |
|
| 2342 | + $args->user_name = $args->member_srl; |
|
| 2343 | + } |
|
| 2344 | + if(!$args->nick_name) { |
|
| 2345 | + $args->nick_name = $args->member_srl; |
|
| 2346 | + } |
|
| 2122 | 2347 | |
| 2123 | 2348 | // Control of essential parameters |
| 2124 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 2125 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 2126 | - if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y'; |
|
| 2349 | + if($args->allow_mailing!='Y') { |
|
| 2350 | + $args->allow_mailing = 'N'; |
|
| 2351 | + } |
|
| 2352 | + if($args->denied!='Y') { |
|
| 2353 | + $args->denied = 'N'; |
|
| 2354 | + } |
|
| 2355 | + if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) { |
|
| 2356 | + $args->allow_message = 'Y'; |
|
| 2357 | + } |
|
| 2127 | 2358 | |
| 2128 | 2359 | if($logged_info->is_admin == 'Y') |
| 2129 | 2360 | { |
| 2130 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
| 2131 | - } |
|
| 2132 | - else |
|
| 2361 | + if($args->is_admin!='Y') { |
|
| 2362 | + $args->is_admin = 'N'; |
|
| 2363 | + } |
|
| 2364 | + } else |
|
| 2133 | 2365 | { |
| 2134 | 2366 | unset($args->is_admin); |
| 2135 | 2367 | } |
@@ -2142,8 +2374,12 @@ discard block |
||
| 2142 | 2374 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2143 | 2375 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2144 | 2376 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2145 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2146 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2377 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) { |
|
| 2378 | + $args->homepage = 'http://'.$args->homepage; |
|
| 2379 | + } |
|
| 2380 | + if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) { |
|
| 2381 | + $args->blog = 'http://'.$args->blog; |
|
| 2382 | + } |
|
| 2147 | 2383 | |
| 2148 | 2384 | // Create a model object |
| 2149 | 2385 | $oMemberModel = getModel('member'); |
@@ -2157,8 +2393,7 @@ discard block |
||
| 2157 | 2393 | return new BaseObject(-1, $message[$config->password_strength]); |
| 2158 | 2394 | } |
| 2159 | 2395 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2160 | - } |
|
| 2161 | - elseif(!$args->password) |
|
| 2396 | + } elseif(!$args->password) |
|
| 2162 | 2397 | { |
| 2163 | 2398 | unset($args->password); |
| 2164 | 2399 | } |
@@ -2166,8 +2401,7 @@ discard block |
||
| 2166 | 2401 | if($args->find_account_answer && !$password_is_hashed) |
| 2167 | 2402 | { |
| 2168 | 2403 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
| 2169 | - } |
|
| 2170 | - elseif(!$args->find_account_answer) |
|
| 2404 | + } elseif(!$args->find_account_answer) |
|
| 2171 | 2405 | { |
| 2172 | 2406 | unset($args->find_account_answer); |
| 2173 | 2407 | } |
@@ -2208,8 +2442,12 @@ discard block |
||
| 2208 | 2442 | // Insert data into the DB |
| 2209 | 2443 | $args->list_order = -1 * $args->member_srl; |
| 2210 | 2444 | |
| 2211 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2212 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2445 | + if(!$args->user_id) { |
|
| 2446 | + $args->user_id = 't'.$args->member_srl; |
|
| 2447 | + } |
|
| 2448 | + if(!$args->user_name) { |
|
| 2449 | + $args->user_name = $args->member_srl; |
|
| 2450 | + } |
|
| 2213 | 2451 | |
| 2214 | 2452 | $oDB = &DB::getInstance(); |
| 2215 | 2453 | $oDB->begin(); |
@@ -2221,8 +2459,11 @@ discard block |
||
| 2221 | 2459 | return $output; |
| 2222 | 2460 | } |
| 2223 | 2461 | |
| 2224 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2225 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2462 | + if(is_array($args->group_srl_list)) { |
|
| 2463 | + $group_srl_list = $args->group_srl_list; |
|
| 2464 | + } else { |
|
| 2465 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2466 | + } |
|
| 2226 | 2467 | // If no value is entered the default group, the value of group registration |
| 2227 | 2468 | if(!$args->group_srl_list) |
| 2228 | 2469 | { |
@@ -2239,8 +2480,7 @@ discard block |
||
| 2239 | 2480 | } |
| 2240 | 2481 | } |
| 2241 | 2482 | // If the value is the value of the group entered the group registration |
| 2242 | - } |
|
| 2243 | - else |
|
| 2483 | + } else |
|
| 2244 | 2484 | { |
| 2245 | 2485 | for($i=0;$i<count($group_srl_list);$i++) |
| 2246 | 2486 | { |
@@ -2301,27 +2541,39 @@ discard block |
||
| 2301 | 2541 | { |
| 2302 | 2542 | // Call a trigger (before) |
| 2303 | 2543 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
| 2304 | - if(!$output->toBool()) return $output; |
|
| 2544 | + if(!$output->toBool()) { |
|
| 2545 | + return $output; |
|
| 2546 | + } |
|
| 2305 | 2547 | // Create a model object |
| 2306 | 2548 | $oMemberModel = getModel('member'); |
| 2307 | 2549 | |
| 2308 | 2550 | $logged_info = Context::get('logged_info'); |
| 2309 | 2551 | // Get what you want to modify the original information |
| 2310 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2552 | + if(!$this->memberInfo) { |
|
| 2553 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2554 | + } |
|
| 2311 | 2555 | // Control of essential parameters |
| 2312 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 2313 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
| 2556 | + if($args->allow_mailing!='Y') { |
|
| 2557 | + $args->allow_mailing = 'N'; |
|
| 2558 | + } |
|
| 2559 | + if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) { |
|
| 2560 | + $args->allow_message = 'Y'; |
|
| 2561 | + } |
|
| 2314 | 2562 | |
| 2315 | 2563 | if($logged_info->is_admin == 'Y') |
| 2316 | 2564 | { |
| 2317 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 2318 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
| 2319 | - } |
|
| 2320 | - else |
|
| 2565 | + if($args->denied!='Y') { |
|
| 2566 | + $args->denied = 'N'; |
|
| 2567 | + } |
|
| 2568 | + if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) { |
|
| 2569 | + $args->is_admin = 'N'; |
|
| 2570 | + } |
|
| 2571 | + } else |
|
| 2321 | 2572 | { |
| 2322 | 2573 | unset($args->is_admin); |
| 2323 | - if($is_admin == false) |
|
| 2324 | - unset($args->denied); |
|
| 2574 | + if($is_admin == false) { |
|
| 2575 | + unset($args->denied); |
|
| 2576 | + } |
|
| 2325 | 2577 | if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
| 2326 | 2578 | { |
| 2327 | 2579 | return $this->stop('msg_invalid_request'); |
@@ -2329,13 +2581,19 @@ discard block |
||
| 2329 | 2581 | } |
| 2330 | 2582 | |
| 2331 | 2583 | // Sanitize user ID, username, nickname, homepage, blog |
| 2332 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2584 | + if($args->user_id) { |
|
| 2585 | + $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2586 | + } |
|
| 2333 | 2587 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2334 | 2588 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2335 | 2589 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2336 | 2590 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2337 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2338 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2591 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) { |
|
| 2592 | + $args->homepage = 'http://'.$args->homepage; |
|
| 2593 | + } |
|
| 2594 | + if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) { |
|
| 2595 | + $args->blog = 'http://'.$args->blog; |
|
| 2596 | + } |
|
| 2339 | 2597 | |
| 2340 | 2598 | // check member identifier form |
| 2341 | 2599 | $config = $oMemberModel->getMemberConfig(); |
@@ -2352,8 +2610,7 @@ discard block |
||
| 2352 | 2610 | return new BaseObject(-1,'msg_exists_email_address'); |
| 2353 | 2611 | } |
| 2354 | 2612 | $args->email_address = $orgMemberInfo->email_address; |
| 2355 | - } |
|
| 2356 | - else |
|
| 2613 | + } else |
|
| 2357 | 2614 | { |
| 2358 | 2615 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2359 | 2616 | if($member_srl && $args->member_srl != $member_srl) |
@@ -2410,16 +2667,14 @@ discard block |
||
| 2410 | 2667 | return new BaseObject(-1, $message[$config->password_strength]); |
| 2411 | 2668 | } |
| 2412 | 2669 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2413 | - } |
|
| 2414 | - else |
|
| 2670 | + } else |
|
| 2415 | 2671 | { |
| 2416 | 2672 | $args->password = $orgMemberInfo->password; |
| 2417 | 2673 | } |
| 2418 | 2674 | |
| 2419 | 2675 | if($args->find_account_answer) { |
| 2420 | 2676 | $args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer); |
| 2421 | - } |
|
| 2422 | - else |
|
| 2677 | + } else |
|
| 2423 | 2678 | { |
| 2424 | 2679 | $oPassword = new Password(); |
| 2425 | 2680 | $hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer); |
@@ -2431,11 +2686,21 @@ discard block |
||
| 2431 | 2686 | } |
| 2432 | 2687 | } |
| 2433 | 2688 | |
| 2434 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
| 2435 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
| 2436 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2437 | - if(!isset($args->description)) $args->description = $orgMemberInfo->description; |
|
| 2438 | - if(!$args->birthday) $args->birthday = ''; |
|
| 2689 | + if(!$args->user_name) { |
|
| 2690 | + $args->user_name = $orgMemberInfo->user_name; |
|
| 2691 | + } |
|
| 2692 | + if(!$args->user_id) { |
|
| 2693 | + $args->user_id = $orgMemberInfo->user_id; |
|
| 2694 | + } |
|
| 2695 | + if(!$args->nick_name) { |
|
| 2696 | + $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2697 | + } |
|
| 2698 | + if(!isset($args->description)) { |
|
| 2699 | + $args->description = $orgMemberInfo->description; |
|
| 2700 | + } |
|
| 2701 | + if(!$args->birthday) { |
|
| 2702 | + $args->birthday = ''; |
|
| 2703 | + } |
|
| 2439 | 2704 | |
| 2440 | 2705 | $output = executeQuery('member.updateMember', $args); |
| 2441 | 2706 | |
@@ -2447,8 +2712,11 @@ discard block |
||
| 2447 | 2712 | |
| 2448 | 2713 | if($args->group_srl_list) |
| 2449 | 2714 | { |
| 2450 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2451 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2715 | + if(is_array($args->group_srl_list)) { |
|
| 2716 | + $group_srl_list = $args->group_srl_list; |
|
| 2717 | + } else { |
|
| 2718 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2719 | + } |
|
| 2452 | 2720 | // If the group information, group information changes |
| 2453 | 2721 | if(count($group_srl_list) > 0) |
| 2454 | 2722 | { |
@@ -2491,7 +2759,9 @@ discard block |
||
| 2491 | 2759 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
| 2492 | 2760 | |
| 2493 | 2761 | // Save Session |
| 2494 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2762 | + if(!$this->memberInfo) { |
|
| 2763 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2764 | + } |
|
| 2495 | 2765 | $logged_info = Context::get('logged_info'); |
| 2496 | 2766 | |
| 2497 | 2767 | $output->add('member_srl', $args->member_srl); |
@@ -2517,8 +2787,7 @@ discard block |
||
| 2517 | 2787 | } |
| 2518 | 2788 | |
| 2519 | 2789 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2520 | - } |
|
| 2521 | - else if($args->hashed_password) |
|
| 2790 | + } else if($args->hashed_password) |
|
| 2522 | 2791 | { |
| 2523 | 2792 | $args->password = $args->hashed_password; |
| 2524 | 2793 | } |
@@ -2553,7 +2822,9 @@ discard block |
||
| 2553 | 2822 | $trigger_obj = new stdClass(); |
| 2554 | 2823 | $trigger_obj->member_srl = $member_srl; |
| 2555 | 2824 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
| 2556 | - if(!$output->toBool()) return $output; |
|
| 2825 | + if(!$output->toBool()) { |
|
| 2826 | + return $output; |
|
| 2827 | + } |
|
| 2557 | 2828 | // Create a model object |
| 2558 | 2829 | $oMemberModel = getModel('member'); |
| 2559 | 2830 | // Bringing the user's information |
@@ -2562,9 +2833,13 @@ discard block |
||
| 2562 | 2833 | $columnList = array('member_srl', 'is_admin'); |
| 2563 | 2834 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 2564 | 2835 | } |
| 2565 | - if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 2836 | + if(!$this->memberInfo) { |
|
| 2837 | + return new BaseObject(-1, 'msg_not_exists_member'); |
|
| 2838 | + } |
|
| 2566 | 2839 | // If managers can not be deleted |
| 2567 | - if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
| 2840 | + if($this->memberInfo->is_admin == 'Y') { |
|
| 2841 | + return new BaseObject(-1, 'msg_cannot_delete_admin'); |
|
| 2842 | + } |
|
| 2568 | 2843 | |
| 2569 | 2844 | $oDB = &DB::getInstance(); |
| 2570 | 2845 | $oDB->begin(); |
@@ -2628,7 +2903,9 @@ discard block |
||
| 2628 | 2903 | */ |
| 2629 | 2904 | function destroySessionInfo() |
| 2630 | 2905 | { |
| 2631 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
| 2906 | + if(!$_SESSION || !is_array($_SESSION)) { |
|
| 2907 | + return; |
|
| 2908 | + } |
|
| 2632 | 2909 | |
| 2633 | 2910 | $memberInfo = Context::get('logged_info'); |
| 2634 | 2911 | $memberSrl = $memberInfo->member_srl; |
@@ -2667,8 +2944,9 @@ discard block |
||
| 2667 | 2944 | } |
| 2668 | 2945 | $maxLevel = 0; |
| 2669 | 2946 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
| 2670 | - if(count($resultGroup) > 0) |
|
| 2671 | - $maxLevel = max(array_flip($resultGroup)); |
|
| 2947 | + if(count($resultGroup) > 0) { |
|
| 2948 | + $maxLevel = max(array_flip($resultGroup)); |
|
| 2949 | + } |
|
| 2672 | 2950 | |
| 2673 | 2951 | if($maxLevel > 0) |
| 2674 | 2952 | { |
@@ -2685,16 +2963,22 @@ discard block |
||
| 2685 | 2963 | |
| 2686 | 2964 | function procMemberModifyEmailAddress() |
| 2687 | 2965 | { |
| 2688 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 2966 | + if(!Context::get('is_logged')) { |
|
| 2967 | + return $this->stop('msg_not_logged'); |
|
| 2968 | + } |
|
| 2689 | 2969 | |
| 2690 | 2970 | $member_info = Context::get('logged_info'); |
| 2691 | 2971 | $newEmail = Context::get('email_address'); |
| 2692 | 2972 | |
| 2693 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
| 2973 | + if(!$newEmail) { |
|
| 2974 | + return $this->stop('msg_invalid_request'); |
|
| 2975 | + } |
|
| 2694 | 2976 | |
| 2695 | 2977 | $oMemberModel = getModel('member'); |
| 2696 | 2978 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
| 2697 | - if($member_srl) return new BaseObject(-1,'msg_exists_email_address'); |
|
| 2979 | + if($member_srl) { |
|
| 2980 | + return new BaseObject(-1,'msg_exists_email_address'); |
|
| 2981 | + } |
|
| 2698 | 2982 | |
| 2699 | 2983 | if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
| 2700 | 2984 | { |
@@ -2722,7 +3006,9 @@ discard block |
||
| 2722 | 3006 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 2723 | 3007 | |
| 2724 | 3008 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 2725 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 3009 | + if(!is_dir($tpl_path)) { |
|
| 3010 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 3011 | + } |
|
| 2726 | 3012 | |
| 2727 | 3013 | global $lang; |
| 2728 | 3014 | |
@@ -2758,7 +3044,9 @@ discard block |
||
| 2758 | 3044 | { |
| 2759 | 3045 | $member_srl = Context::get('member_srl'); |
| 2760 | 3046 | $auth_key = Context::get('auth_key'); |
| 2761 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
| 3047 | + if(!$member_srl || !$auth_key) { |
|
| 3048 | + return $this->stop('msg_invalid_request'); |
|
| 3049 | + } |
|
| 2762 | 3050 | |
| 2763 | 3051 | // Test logs for finding password by user_id and authkey |
| 2764 | 3052 | $args = new stdClass; |
@@ -2767,7 +3055,9 @@ discard block |
||
| 2767 | 3055 | $output = executeQuery('member.getAuthMail', $args); |
| 2768 | 3056 | if(!$output->toBool() || $output->data->auth_key != $auth_key) |
| 2769 | 3057 | { |
| 2770 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 3058 | + if(strlen($output->data->auth_key) !== strlen($auth_key)) { |
|
| 3059 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 3060 | + } |
|
| 2771 | 3061 | return $this->stop('msg_invalid_modify_email_auth_key'); |
| 2772 | 3062 | } |
| 2773 | 3063 | |
@@ -2776,7 +3066,9 @@ discard block |
||
| 2776 | 3066 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
| 2777 | 3067 | |
| 2778 | 3068 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
| 2779 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
| 3069 | + if(!$output->toBool()) { |
|
| 3070 | + return $this->stop($output->getMessage()); |
|
| 3071 | + } |
|
| 2780 | 3072 | |
| 2781 | 3073 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
| 2782 | 3074 | executeQuery('member.deleteAuthChangeEmailAddress',$args); |
@@ -2797,7 +3089,9 @@ discard block |
||
| 2797 | 3089 | **/ |
| 2798 | 3090 | function triggerGetDocumentMenu(&$menu_list) |
| 2799 | 3091 | { |
| 2800 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
| 3092 | + if(!Context::get('is_logged')) { |
|
| 3093 | + return new BaseObject(); |
|
| 3094 | + } |
|
| 2801 | 3095 | |
| 2802 | 3096 | $logged_info = Context::get('logged_info'); |
| 2803 | 3097 | $document_srl = Context::get('target_srl'); |
@@ -2808,8 +3102,12 @@ discard block |
||
| 2808 | 3102 | $member_srl = $oDocument->get('member_srl'); |
| 2809 | 3103 | $module_srl = $oDocument->get('module_srl'); |
| 2810 | 3104 | |
| 2811 | - if(!$member_srl) return new BaseObject(); |
|
| 2812 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
| 3105 | + if(!$member_srl) { |
|
| 3106 | + return new BaseObject(); |
|
| 3107 | + } |
|
| 3108 | + if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
| 3109 | + return new BaseObject(); |
|
| 3110 | + } |
|
| 2813 | 3111 | |
| 2814 | 3112 | $oDocumentController = getController('document'); |
| 2815 | 3113 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2827,7 +3125,9 @@ discard block |
||
| 2827 | 3125 | **/ |
| 2828 | 3126 | function triggerGetCommentMenu(&$menu_list) |
| 2829 | 3127 | { |
| 2830 | - if(!Context::get('is_logged')) return new BaseObject(); |
|
| 3128 | + if(!Context::get('is_logged')) { |
|
| 3129 | + return new BaseObject(); |
|
| 3130 | + } |
|
| 2831 | 3131 | |
| 2832 | 3132 | $logged_info = Context::get('logged_info'); |
| 2833 | 3133 | $comment_srl = Context::get('target_srl'); |
@@ -2838,8 +3138,12 @@ discard block |
||
| 2838 | 3138 | $module_srl = $oComment->get('module_srl'); |
| 2839 | 3139 | $member_srl = $oComment->get('member_srl'); |
| 2840 | 3140 | |
| 2841 | - if(!$member_srl) return new BaseObject(); |
|
| 2842 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject(); |
|
| 3141 | + if(!$member_srl) { |
|
| 3142 | + return new BaseObject(); |
|
| 3143 | + } |
|
| 3144 | + if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
| 3145 | + return new BaseObject(); |
|
| 3146 | + } |
|
| 2843 | 3147 | |
| 2844 | 3148 | $oCommentController = getController('comment'); |
| 2845 | 3149 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2855,7 +3159,9 @@ discard block |
||
| 2855 | 3159 | **/ |
| 2856 | 3160 | function procMemberSpammerManage() |
| 2857 | 3161 | { |
| 2858 | - if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted'); |
|
| 3162 | + if(!Context::get('is_logged')) { |
|
| 3163 | + return new BaseObject(-1,'msg_not_permitted'); |
|
| 3164 | + } |
|
| 2859 | 3165 | |
| 2860 | 3166 | $logged_info = Context::get('logged_info'); |
| 2861 | 3167 | $member_srl = Context::get('member_srl'); |
@@ -2863,8 +3169,9 @@ discard block |
||
| 2863 | 3169 | $cnt_loop = Context::get('cnt_loop'); |
| 2864 | 3170 | $proc_type = Context::get('proc_type'); |
| 2865 | 3171 | $isMoveToTrash = true; |
| 2866 | - if($proc_type == "delete") |
|
| 2867 | - $isMoveToTrash = false; |
|
| 3172 | + if($proc_type == "delete") { |
|
| 3173 | + $isMoveToTrash = false; |
|
| 3174 | + } |
|
| 2868 | 3175 | |
| 2869 | 3176 | // check grant |
| 2870 | 3177 | $oModuleModel = getModel('module'); |
@@ -2872,7 +3179,9 @@ discard block |
||
| 2872 | 3179 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
| 2873 | 3180 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
| 2874 | 3181 | |
| 2875 | - if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted'); |
|
| 3182 | + if(!$grant->manager) { |
|
| 3183 | + return new BaseObject(-1,'msg_not_permitted'); |
|
| 3184 | + } |
|
| 2876 | 3185 | |
| 2877 | 3186 | $proc_msg = ""; |
| 2878 | 3187 | |
@@ -2881,11 +3190,13 @@ discard block |
||
| 2881 | 3190 | |
| 2882 | 3191 | // delete or trash destination |
| 2883 | 3192 | // proc member |
| 2884 | - if($cnt_loop == 1) |
|
| 2885 | - $this->_spammerMember($member_srl); |
|
| 3193 | + if($cnt_loop == 1) { |
|
| 3194 | + $this->_spammerMember($member_srl); |
|
| 3195 | + } |
|
| 2886 | 3196 | // proc document and comment |
| 2887 | - elseif($cnt_loop>1) |
|
| 2888 | - $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
| 3197 | + elseif($cnt_loop>1) { |
|
| 3198 | + $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
| 3199 | + } |
|
| 2889 | 3200 | |
| 2890 | 3201 | // get destination count |
| 2891 | 3202 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
@@ -2893,13 +3204,16 @@ discard block |
||
| 2893 | 3204 | |
| 2894 | 3205 | $total_count = Context::get('total_count'); |
| 2895 | 3206 | $remain_count = $cnt_document + $cnt_comment; |
| 2896 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
| 3207 | + if($cnt_loop == 1) { |
|
| 3208 | + $total_count = $remain_count; |
|
| 3209 | + } |
|
| 2897 | 3210 | |
| 2898 | 3211 | // get progress percent |
| 2899 | - if($total_count > 0) |
|
| 2900 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
| 2901 | - else |
|
| 2902 | - $progress = 100; |
|
| 3212 | + if($total_count > 0) { |
|
| 3213 | + $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
| 3214 | + } else { |
|
| 3215 | + $progress = 100; |
|
| 3216 | + } |
|
| 2903 | 3217 | |
| 2904 | 3218 | $this->add('total_count', $total_count); |
| 2905 | 3219 | $this->add('remain_count', $remain_count); |
@@ -2941,7 +3255,10 @@ discard block |
||
| 2941 | 3255 | $args->nick_name = $member_info->nick_name; |
| 2942 | 3256 | $args->denied = "Y"; |
| 2943 | 3257 | $args->description = trim( $member_info->description ); |
| 2944 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
| 3258 | + if( $args->description != "" ) { |
|
| 3259 | + $args->description .= "\n"; |
|
| 3260 | + } |
|
| 3261 | + // add new line |
|
| 2945 | 3262 | |
| 2946 | 3263 | $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 . "]"; |
| 2947 | 3264 | |
@@ -2986,8 +3303,11 @@ discard block |
||
| 2986 | 3303 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
| 2987 | 3304 | if($documentList) { |
| 2988 | 3305 | foreach($documentList as $v) { |
| 2989 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
| 2990 | - else $oDocumentController->deleteDocument($v->document_srl); |
|
| 3306 | + if($isMoveToTrash) { |
|
| 3307 | + $oDocumentController->moveDocumentToTrash($v); |
|
| 3308 | + } else { |
|
| 3309 | + $oDocumentController->deleteDocument($v->document_srl); |
|
| 3310 | + } |
|
| 2991 | 3311 | } |
| 2992 | 3312 | } |
| 2993 | 3313 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | class board extends ModuleObject |
| 11 | 11 | { |
| 12 | - var $search_option = array('title_content','title','content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션 |
|
| 12 | + var $search_option = array('title_content', 'title', 'content', 'comment', 'user_name', 'nick_name', 'user_id', 'tag'); ///< 검색 옵션 |
|
| 13 | 13 | |
| 14 | 14 | var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'blamed_count', 'readed_count', 'comment_count', 'title', 'nick_name', 'user_name', 'user_id'); // 정렬 옵션 |
| 15 | 15 | |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | function __construct() |
| 27 | 27 | { |
| 28 | - if(!Context::isInstalled()) return; |
|
| 28 | + if (!Context::isInstalled()) return; |
|
| 29 | 29 | |
| 30 | - if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
|
| 30 | + if (!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
|
| 31 | 31 | { |
| 32 | 32 | $ssl_actions = array('dispBoardWrite', 'dispBoardWriteComment', 'dispBoardReplyComment', 'dispBoardModifyComment', 'dispBoardDelete', 'dispBoardDeleteComment', 'procBoardInsertDocument', 'procBoardDeleteDocument', 'procBoardInsertComment', 'procBoardDeleteComment', 'procBoardVerificationPassword'); |
| 33 | 33 | Context::addSSLActions($ssl_actions); |
| 34 | 34 | } |
| 35 | - if(!Context::isExistsSSLAction('dispTempSavedList') && Context::getSslStatus() == 'optional') |
|
| 35 | + if (!Context::isExistsSSLAction('dispTempSavedList') && Context::getSslStatus() == 'optional') |
|
| 36 | 36 | { |
| 37 | 37 | Context::addSSLAction('dispTempSavedList'); |
| 38 | 38 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $args = new stdClass; |
| 55 | 55 | $args->site_srl = 0; |
| 56 | 56 | $output = executeQuery('module.getSite', $args); |
| 57 | - if(!$output->data->index_module_srl) |
|
| 57 | + if (!$output->data->index_module_srl) |
|
| 58 | 58 | { |
| 59 | 59 | $args->mid = 'board'; |
| 60 | 60 | $args->module = 'board'; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $args->site_srl = 0; |
| 64 | 64 | $output = $oModuleController->insertModule($args); |
| 65 | 65 | |
| 66 | - if($output->toBool()) |
|
| 66 | + if ($output->toBool()) |
|
| 67 | 67 | { |
| 68 | 68 | $module_srl = $output->get('module_srl'); |
| 69 | 69 | |
@@ -87,13 +87,13 @@ discard block |
||
| 87 | 87 | $oModuleModel = getModel('module'); |
| 88 | 88 | $oModuleController = getController('module'); |
| 89 | 89 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
| 90 | - if($oModuleModel->needUpdate($version_update_id)) |
|
| 90 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
| 91 | 91 | { |
| 92 | 92 | // 2007. 10. 17 get the member menu trigger |
| 93 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
| 93 | + if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
| 94 | 94 | |
| 95 | 95 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
| 96 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
| 96 | + if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
| 97 | 97 | |
| 98 | 98 | $oModuleController->insertUpdatedLog($version_update_id); |
| 99 | 99 | } |
@@ -109,16 +109,16 @@ discard block |
||
| 109 | 109 | $oModuleModel = getModel('module'); |
| 110 | 110 | $oModuleController = getController('module'); |
| 111 | 111 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
| 112 | - if($oModuleModel->needUpdate($version_update_id)) |
|
| 112 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
| 113 | 113 | { |
| 114 | 114 | // 2007. 10. 17 check the member menu trigger, if it is not existed then insert |
| 115 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) |
|
| 115 | + if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) |
|
| 116 | 116 | { |
| 117 | 117 | $oModuleController->insertTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
| 121 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) |
|
| 121 | + if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) |
|
| 122 | 122 | { |
| 123 | 123 | $oModuleController->insertTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'); |
| 124 | 124 | } |
@@ -131,12 +131,12 @@ discard block |
||
| 131 | 131 | function moduleUninstall() |
| 132 | 132 | { |
| 133 | 133 | $output = executeQueryArray("board.getAllBoard"); |
| 134 | - if(!$output->data) return new BaseObject(); |
|
| 134 | + if (!$output->data) return new BaseObject(); |
|
| 135 | 135 | @set_time_limit(0); |
| 136 | 136 | |
| 137 | 137 | $oModuleController = getController('module'); |
| 138 | 138 | |
| 139 | - foreach($output->data as $board) |
|
| 139 | + foreach ($output->data as $board) |
|
| 140 | 140 | { |
| 141 | 141 | $oModuleController->deleteModule($board->module_srl); |
| 142 | 142 | } |
@@ -25,7 +25,9 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | function __construct() |
| 27 | 27 | { |
| 28 | - if(!Context::isInstalled()) return; |
|
| 28 | + if(!Context::isInstalled()) { |
|
| 29 | + return; |
|
| 30 | + } |
|
| 29 | 31 | |
| 30 | 32 | if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
| 31 | 33 | { |
@@ -90,10 +92,14 @@ discard block |
||
| 90 | 92 | if($oModuleModel->needUpdate($version_update_id)) |
| 91 | 93 | { |
| 92 | 94 | // 2007. 10. 17 get the member menu trigger |
| 93 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
| 95 | + if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) { |
|
| 96 | + return true; |
|
| 97 | + } |
|
| 94 | 98 | |
| 95 | 99 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
| 96 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
| 100 | + if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) { |
|
| 101 | + return true; |
|
| 102 | + } |
|
| 97 | 103 | |
| 98 | 104 | $oModuleController->insertUpdatedLog($version_update_id); |
| 99 | 105 | } |
@@ -131,7 +137,9 @@ discard block |
||
| 131 | 137 | function moduleUninstall() |
| 132 | 138 | { |
| 133 | 139 | $output = executeQueryArray("board.getAllBoard"); |
| 134 | - if(!$output->data) return new BaseObject(); |
|
| 140 | + if(!$output->data) { |
|
| 141 | + return new BaseObject(); |
|
| 142 | + } |
|
| 135 | 143 | @set_time_limit(0); |
| 136 | 144 | |
| 137 | 145 | $oModuleController = getController('module'); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | function __construct() |
| 17 | 17 | { |
| 18 | - if(Context::isInstalled()) $this->session_started= true; |
|
| 18 | + if (Context::isInstalled()) $this->session_started = true; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | function moduleInstall() |
| 25 | 25 | { |
| 26 | 26 | $oDB = &DB::getInstance(); |
| 27 | - $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid")); |
|
| 27 | + $oDB->addIndex("session", "idx_session_update_mid", array("member_srl", "last_update", "cur_mid")); |
|
| 28 | 28 | |
| 29 | 29 | return new BaseObject(); |
| 30 | 30 | } |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | $oModuleModel = getModel('module'); |
| 39 | 39 | $oModuleController = getController('module'); |
| 40 | 40 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
| 41 | - if($oModuleModel->needUpdate($version_update_id)) |
|
| 41 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
| 42 | 42 | { |
| 43 | - if(!$oDB->isTableExists('session')) return true; |
|
| 44 | - if(!$oDB->isColumnExists("session","cur_mid")) return true; |
|
| 45 | - if(!$oDB->isIndexExists("session","idx_session_update_mid")) return true; |
|
| 43 | + if (!$oDB->isTableExists('session')) return true; |
|
| 44 | + if (!$oDB->isColumnExists("session", "cur_mid")) return true; |
|
| 45 | + if (!$oDB->isIndexExists("session", "idx_session_update_mid")) return true; |
|
| 46 | 46 | |
| 47 | 47 | $oModuleController->insertUpdatedLog($version_update_id); |
| 48 | 48 | } |
@@ -59,19 +59,19 @@ discard block |
||
| 59 | 59 | $oModuleModel = getModel('module'); |
| 60 | 60 | $oModuleController = getController('module'); |
| 61 | 61 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
| 62 | - if($oModuleModel->needUpdate($version_update_id)) |
|
| 62 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
| 63 | 63 | { |
| 64 | - if(!$oDB->isTableExists('session')) |
|
| 64 | + if (!$oDB->isTableExists('session')) |
|
| 65 | 65 | { |
| 66 | 66 | $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml'); |
| 67 | 67 | } |
| 68 | - if(!$oDB->isColumnExists("session","cur_mid")) |
|
| 68 | + if (!$oDB->isColumnExists("session", "cur_mid")) |
|
| 69 | 69 | { |
| 70 | - $oDB->addColumn('session',"cur_mid","varchar",128); |
|
| 70 | + $oDB->addColumn('session', "cur_mid", "varchar", 128); |
|
| 71 | 71 | } |
| 72 | - if(!$oDB->isIndexExists("session","idx_session_update_mid")) |
|
| 72 | + if (!$oDB->isIndexExists("session", "idx_session_update_mid")) |
|
| 73 | 73 | { |
| 74 | - $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid")); |
|
| 74 | + $oDB->addIndex("session", "idx_session_update_mid", array("member_srl", "last_update", "cur_mid")); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | $oModuleController->insertUpdatedLog($version_update_id); |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | function unSerializeSession($val) |
| 87 | 87 | { |
| 88 | - $vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); |
|
| 89 | - for($i=0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]); |
|
| 88 | + $vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); |
|
| 89 | + for ($i = 0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]); |
|
| 90 | 90 | return $result; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -95,11 +95,11 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | function serializeSession($data) |
| 97 | 97 | { |
| 98 | - if(!count($data)) return; |
|
| 98 | + if (!count($data)) return; |
|
| 99 | 99 | |
| 100 | 100 | $str = ''; |
| 101 | - foreach($data as $key => $val) $str .= $key.'|'.serialize($val); |
|
| 102 | - return substr($str, 0, strlen($str)-1).'}'; |
|
| 101 | + foreach ($data as $key => $val) $str .= $key.'|'.serialize($val); |
|
| 102 | + return substr($str, 0, strlen($str) - 1).'}'; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -15,7 +15,9 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | function __construct() |
| 17 | 17 | { |
| 18 | - if(Context::isInstalled()) $this->session_started= true; |
|
| 18 | + if(Context::isInstalled()) { |
|
| 19 | + $this->session_started= true; |
|
| 20 | + } |
|
| 19 | 21 | } |
| 20 | 22 | |
| 21 | 23 | /** |
@@ -40,9 +42,15 @@ discard block |
||
| 40 | 42 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
| 41 | 43 | if($oModuleModel->needUpdate($version_update_id)) |
| 42 | 44 | { |
| 43 | - if(!$oDB->isTableExists('session')) return true; |
|
| 44 | - if(!$oDB->isColumnExists("session","cur_mid")) return true; |
|
| 45 | - if(!$oDB->isIndexExists("session","idx_session_update_mid")) return true; |
|
| 45 | + if(!$oDB->isTableExists('session')) { |
|
| 46 | + return true; |
|
| 47 | + } |
|
| 48 | + if(!$oDB->isColumnExists("session","cur_mid")) { |
|
| 49 | + return true; |
|
| 50 | + } |
|
| 51 | + if(!$oDB->isIndexExists("session","idx_session_update_mid")) { |
|
| 52 | + return true; |
|
| 53 | + } |
|
| 46 | 54 | |
| 47 | 55 | $oModuleController->insertUpdatedLog($version_update_id); |
| 48 | 56 | } |
@@ -86,7 +94,9 @@ discard block |
||
| 86 | 94 | function unSerializeSession($val) |
| 87 | 95 | { |
| 88 | 96 | $vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); |
| 89 | - for($i=0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]); |
|
| 97 | + for($i=0; $vars[$i]; $i++) { |
|
| 98 | + $result[$vars[$i++]] = unserialize($vars[$i]); |
|
| 99 | + } |
|
| 90 | 100 | return $result; |
| 91 | 101 | } |
| 92 | 102 | |
@@ -95,10 +105,14 @@ discard block |
||
| 95 | 105 | */ |
| 96 | 106 | function serializeSession($data) |
| 97 | 107 | { |
| 98 | - if(!count($data)) return; |
|
| 108 | + if(!count($data)) { |
|
| 109 | + return; |
|
| 110 | + } |
|
| 99 | 111 | |
| 100 | 112 | $str = ''; |
| 101 | - foreach($data as $key => $val) $str .= $key.'|'.serialize($val); |
|
| 113 | + foreach($data as $key => $val) { |
|
| 114 | + $str .= $key.'|'.serialize($val); |
|
| 115 | + } |
|
| 102 | 116 | return substr($str, 0, strlen($str)-1).'}'; |
| 103 | 117 | } |
| 104 | 118 | |
@@ -24,31 +24,31 @@ discard block |
||
| 24 | 24 | // if(Context::getRequestMethod() == "GET") return new BaseObject(-1, "msg_invalid_request"); |
| 25 | 25 | // Extract the necessary information in advance |
| 26 | 26 | $logged_info = Context::get('logged_info'); |
| 27 | - if($logged_info->is_admin != 'Y' || !checkCSRF()) |
|
| 27 | + if ($logged_info->is_admin != 'Y' || !checkCSRF()) |
|
| 28 | 28 | { |
| 29 | 29 | return new BaseObject(-1, 'msg_invalid_request'); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - $args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date'); |
|
| 33 | - $oMemberModel = &getModel ('member'); |
|
| 32 | + $args = Context::gets('member_srl', 'email_address', 'find_account_answer', 'allow_mailing', 'allow_message', 'denied', 'is_admin', 'description', 'group_srl_list', 'limit_date'); |
|
| 33 | + $oMemberModel = &getModel('member'); |
|
| 34 | 34 | $config = $oMemberModel->getMemberConfig(); |
| 35 | 35 | $getVars = array(); |
| 36 | - if($config->signupForm) |
|
| 36 | + if ($config->signupForm) |
|
| 37 | 37 | { |
| 38 | - foreach($config->signupForm as $formInfo) |
|
| 38 | + foreach ($config->signupForm as $formInfo) |
|
| 39 | 39 | { |
| 40 | - if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 40 | + if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 41 | 41 | { |
| 42 | 42 | $getVars[] = $formInfo->name; |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | - foreach($getVars as $val) |
|
| 46 | + foreach ($getVars as $val) |
|
| 47 | 47 | { |
| 48 | 48 | $args->{$val} = Context::get($val); |
| 49 | 49 | } |
| 50 | 50 | $args->member_srl = Context::get('member_srl'); |
| 51 | - if(Context::get('reset_password')) |
|
| 51 | + if (Context::get('reset_password')) |
|
| 52 | 52 | $args->password = Context::get('reset_password'); |
| 53 | 53 | else unset($args->password); |
| 54 | 54 | |
@@ -64,14 +64,14 @@ discard block |
||
| 64 | 64 | unset($all_args->password2); |
| 65 | 65 | unset($all_args->reset_password); |
| 66 | 66 | |
| 67 | - if(!isset($args->limit_date)) $args->limit_date = ""; |
|
| 68 | - if(!isset($args->description)) $args->description = ""; |
|
| 67 | + if (!isset($args->limit_date)) $args->limit_date = ""; |
|
| 68 | + if (!isset($args->description)) $args->description = ""; |
|
| 69 | 69 | |
| 70 | 70 | // Add extra vars after excluding necessary information from all the requested arguments |
| 71 | 71 | $extra_vars = delObjectVars($all_args, $args); |
| 72 | 72 | $args->extra_vars = serialize($extra_vars); |
| 73 | 73 | // Check if an original member exists having the member_srl |
| 74 | - if($args->member_srl) |
|
| 74 | + if ($args->member_srl) |
|
| 75 | 75 | { |
| 76 | 76 | // Create a member model object |
| 77 | 77 | $oMemberModel = getModel('member'); |
@@ -79,14 +79,14 @@ discard block |
||
| 79 | 79 | $columnList = array('member_srl'); |
| 80 | 80 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList); |
| 81 | 81 | // If no original member exists, make a new one |
| 82 | - if($member_info->member_srl != $args->member_srl) unset($args->member_srl); |
|
| 82 | + if ($member_info->member_srl != $args->member_srl) unset($args->member_srl); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // remove whitespace |
| 86 | 86 | $checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address'); |
| 87 | - foreach($checkInfos as $val) |
|
| 87 | + foreach ($checkInfos as $val) |
|
| 88 | 88 | { |
| 89 | - if(isset($args->{$val})) |
|
| 89 | + if (isset($args->{$val})) |
|
| 90 | 90 | { |
| 91 | 91 | $args->{$val} = preg_replace('/[\pZ\pC]+/u', '', html_entity_decode($args->{$val})); |
| 92 | 92 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $oMemberController = getController('member'); |
| 96 | 96 | // Execute insert or update depending on the value of member_srl |
| 97 | - if(!$args->member_srl) |
|
| 97 | + if (!$args->member_srl) |
|
| 98 | 98 | { |
| 99 | 99 | $args->password = Context::get('password'); |
| 100 | 100 | $output = $oMemberController->insertMember($args); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $msg_code = 'success_updated'; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - if(!$output->toBool()) return $output; |
|
| 109 | + if (!$output->toBool()) return $output; |
|
| 110 | 110 | // Save Signature |
| 111 | 111 | $signature = Context::get('signature'); |
| 112 | 112 | $oMemberController->putSignature($args->member_srl, $signature); |
@@ -115,24 +115,24 @@ discard block |
||
| 115 | 115 | $this->setMessage($msg_code); |
| 116 | 116 | |
| 117 | 117 | $profile_image = Context::get('profile_image'); |
| 118 | - if(is_uploaded_file($profile_image['tmp_name'])) |
|
| 118 | + if (is_uploaded_file($profile_image['tmp_name'])) |
|
| 119 | 119 | { |
| 120 | 120 | $output = $oMemberController->insertProfileImage($args->member_srl, $profile_image['tmp_name']); |
| 121 | - if(!$output->toBool()) return $output; |
|
| 121 | + if (!$output->toBool()) return $output; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | $image_mark = Context::get('image_mark'); |
| 125 | - if(is_uploaded_file($image_mark['tmp_name'])) |
|
| 125 | + if (is_uploaded_file($image_mark['tmp_name'])) |
|
| 126 | 126 | { |
| 127 | 127 | $output = $oMemberController->insertImageMark($args->member_srl, $image_mark['tmp_name']); |
| 128 | - if(!$output->toBool()) return $output; |
|
| 128 | + if (!$output->toBool()) return $output; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | $image_name = Context::get('image_name'); |
| 132 | 132 | if (is_uploaded_file($image_name['tmp_name'])) |
| 133 | 133 | { |
| 134 | 134 | $output = $oMemberController->insertImageName($args->member_srl, $image_name['tmp_name']); |
| 135 | - if(!$output->toBool()) return $output; |
|
| 135 | + if (!$output->toBool()) return $output; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminList'); |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | $oMemberController = getController('member'); |
| 152 | 152 | $output = $oMemberController->deleteMember($member_srl); |
| 153 | - if(!$output->toBool()) return $output; |
|
| 153 | + if (!$output->toBool()) return $output; |
|
| 154 | 154 | |
| 155 | - $this->add('page',Context::get('page')); |
|
| 155 | + $this->add('page', Context::get('page')); |
|
| 156 | 156 | $this->setMessage("success_deleted"); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -171,26 +171,26 @@ discard block |
||
| 171 | 171 | ); |
| 172 | 172 | |
| 173 | 173 | $oPassword = new Password(); |
| 174 | - if(!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms())) |
|
| 174 | + if (!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms())) |
|
| 175 | 175 | { |
| 176 | 176 | $args->password_hashing_algorithm = 'md5'; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | $args->password_hashing_work_factor = intval($args->password_hashing_work_factor, 10); |
| 180 | - if($args->password_hashing_work_factor < 4) |
|
| 180 | + if ($args->password_hashing_work_factor < 4) |
|
| 181 | 181 | { |
| 182 | 182 | $args->password_hashing_work_factor = 4; |
| 183 | 183 | } |
| 184 | - if($args->password_hashing_work_factor > 16) |
|
| 184 | + if ($args->password_hashing_work_factor > 16) |
|
| 185 | 185 | { |
| 186 | 186 | $args->password_hashing_work_factor = 16; |
| 187 | 187 | } |
| 188 | - if($args->password_hashing_auto_upgrade != 'Y') |
|
| 188 | + if ($args->password_hashing_auto_upgrade != 'Y') |
|
| 189 | 189 | { |
| 190 | 190 | $args->password_hashing_auto_upgrade = 'N'; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - if((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y') |
|
| 193 | + if ((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y') |
|
| 194 | 194 | { |
| 195 | 195 | return new BaseObject(-1, 'msg_mail_authorization'); |
| 196 | 196 | } |
@@ -225,20 +225,20 @@ discard block |
||
| 225 | 225 | $usable_list = Context::get('usable_list'); |
| 226 | 226 | $all_args = Context::getRequestVars(); |
| 227 | 227 | |
| 228 | - $args->limit_day = (int)$args->limit_day; |
|
| 229 | - if(!trim(strip_tags($args->agreement))) |
|
| 228 | + $args->limit_day = (int) $args->limit_day; |
|
| 229 | + if (!trim(strip_tags($args->agreement))) |
|
| 230 | 230 | { |
| 231 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
| 231 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
| 232 | 232 | FileHandler::removeFile($agreement_file); |
| 233 | 233 | $args->agreement = NULL; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - if($args->redirect_url) |
|
| 236 | + if ($args->redirect_url) |
|
| 237 | 237 | { |
| 238 | 238 | $oModuleModel = getModel('module'); |
| 239 | 239 | $redirectModuleInfo = $oModuleModel->getModuleInfoByModuleSrl($args->redirect_url, array('mid')); |
| 240 | 240 | |
| 241 | - if(!$redirectModuleInfo) |
|
| 241 | + if (!$redirectModuleInfo) |
|
| 242 | 242 | { |
| 243 | 243 | return new BaseObject('-1', 'msg_exist_selected_module'); |
| 244 | 244 | } |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question'); |
| 278 | 278 | $extendItems = $oMemberModel->getJoinFormList(); |
| 279 | 279 | |
| 280 | - foreach($list_order as $key) |
|
| 280 | + foreach ($list_order as $key) |
|
| 281 | 281 | { |
| 282 | 282 | $signupItem = new stdClass(); |
| 283 | 283 | $signupItem->isIdentifier = ($key == $all_args->identifier); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $signupItem->isUse = in_array($key, $usable_list) || $signupItem->required; |
| 291 | 291 | $signupItem->isPublic = ($all_args->{'is_'.$key.'_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N'; |
| 292 | 292 | |
| 293 | - if($signupItem->imageType) |
|
| 293 | + if ($signupItem->imageType) |
|
| 294 | 294 | { |
| 295 | 295 | $signupItem->max_width = $all_args->{$key.'_max_width'}; |
| 296 | 296 | $signupItem->max_height = $all_args->{$key.'_max_height'}; |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | // set extends form |
| 302 | - if(!$signupItem->isDefaultForm) |
|
| 302 | + if (!$signupItem->isDefaultForm) |
|
| 303 | 303 | { |
| 304 | 304 | $extendItem = $extendItems[$all_args->{$key.'_member_join_form_srl'}]; |
| 305 | 305 | $signupItem->type = $extendItem->column_type; |
@@ -308,13 +308,13 @@ discard block |
||
| 308 | 308 | $signupItem->description = $extendItem->description; |
| 309 | 309 | |
| 310 | 310 | // check usable value change, required/option |
| 311 | - if($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y')) |
|
| 311 | + if ($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y')) |
|
| 312 | 312 | { |
| 313 | 313 | unset($update_args); |
| 314 | 314 | $update_args = new stdClass; |
| 315 | 315 | $update_args->member_join_form_srl = $extendItem->member_join_form_srl; |
| 316 | - $update_args->is_active = $signupItem->isUse?'Y':'N'; |
|
| 317 | - $update_args->required = $signupItem->required?'Y':'N'; |
|
| 316 | + $update_args->is_active = $signupItem->isUse ? 'Y' : 'N'; |
|
| 317 | + $update_args->required = $signupItem->required ? 'Y' : 'N'; |
|
| 318 | 318 | |
| 319 | 319 | $update_output = executeQuery('member.updateJoinForm', $update_args); |
| 320 | 320 | } |
@@ -331,9 +331,9 @@ discard block |
||
| 331 | 331 | $this->_createFindAccountByQuestion($args->identifier); |
| 332 | 332 | |
| 333 | 333 | // check agreement value exist |
| 334 | - if($args->agreement) |
|
| 334 | + if ($args->agreement) |
|
| 335 | 335 | { |
| 336 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
| 336 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
| 337 | 337 | $output = FileHandler::writeFile($agreement_file, $args->agreement); |
| 338 | 338 | |
| 339 | 339 | unset($args->agreement); |
@@ -361,16 +361,16 @@ discard block |
||
| 361 | 361 | 'after_logout_url' |
| 362 | 362 | ); |
| 363 | 363 | |
| 364 | - if(!$args->change_password_date) |
|
| 364 | + if (!$args->change_password_date) |
|
| 365 | 365 | { |
| 366 | 366 | $args->change_password_date = 0; |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - if(!trim(strip_tags($args->after_login_url))) |
|
| 369 | + if (!trim(strip_tags($args->after_login_url))) |
|
| 370 | 370 | { |
| 371 | 371 | $args->after_login_url = NULL; |
| 372 | 372 | } |
| 373 | - if(!trim(strip_tags($args->after_logout_url))) |
|
| 373 | + if (!trim(strip_tags($args->after_logout_url))) |
|
| 374 | 374 | { |
| 375 | 375 | $args->after_logout_url = NULL; |
| 376 | 376 | } |
@@ -397,17 +397,17 @@ discard block |
||
| 397 | 397 | ); |
| 398 | 398 | |
| 399 | 399 | $args->layout_srl = $args->layout_srl ? $args->layout_srl : NULL; |
| 400 | - if(!$args->skin) |
|
| 400 | + if (!$args->skin) |
|
| 401 | 401 | { |
| 402 | 402 | $args->skin = 'default'; |
| 403 | 403 | } |
| 404 | - if(!$args->colorset) |
|
| 404 | + if (!$args->colorset) |
|
| 405 | 405 | { |
| 406 | 406 | $args->colorset = 'white'; |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | $args->mlayout_srl = $args->mlayout_srl ? $args->mlayout_srl : NULL; |
| 410 | - if(!$args->mskin) |
|
| 410 | + if (!$args->mskin) |
|
| 411 | 411 | { |
| 412 | 412 | $args->mskin = 'default'; |
| 413 | 413 | } |
@@ -430,12 +430,12 @@ discard block |
||
| 430 | 430 | $extendItems = $oMemberModel->getJoinFormList(); |
| 431 | 431 | |
| 432 | 432 | $items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark'); |
| 433 | - $mustRequireds = array('email_address', 'nick_name','password', 'find_account_question'); |
|
| 433 | + $mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question'); |
|
| 434 | 434 | $orgRequireds = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name'); |
| 435 | 435 | $orgUse = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name', 'homepage', 'blog', 'birthday'); |
| 436 | 436 | $list_order = array(); |
| 437 | 437 | |
| 438 | - foreach($items as $key) |
|
| 438 | + foreach ($items as $key) |
|
| 439 | 439 | { |
| 440 | 440 | unset($signupItem); |
| 441 | 441 | $signupItem = new stdClass; |
@@ -447,23 +447,23 @@ discard block |
||
| 447 | 447 | $signupItem->required = in_array($key, $orgRequireds); |
| 448 | 448 | $signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse); |
| 449 | 449 | $signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N'; |
| 450 | - if(in_array($key, array('find_account_question', 'password', 'email_address'))) |
|
| 450 | + if (in_array($key, array('find_account_question', 'password', 'email_address'))) |
|
| 451 | 451 | { |
| 452 | 452 | $signupItem->isPublic = 'N'; |
| 453 | 453 | } |
| 454 | 454 | $signupItem->isIdentifier = ($key == $identifier); |
| 455 | - if ($signupItem->imageType){ |
|
| 455 | + if ($signupItem->imageType) { |
|
| 456 | 456 | $signupItem->max_width = $config->{$key.'_max_width'}; |
| 457 | 457 | $signupItem->max_height = $config->{$key.'_max_height'}; |
| 458 | 458 | } |
| 459 | - if($signupItem->isIdentifier) |
|
| 459 | + if ($signupItem->isIdentifier) |
|
| 460 | 460 | array_unshift($list_order, $signupItem); |
| 461 | 461 | else |
| 462 | 462 | $list_order[] = $signupItem; |
| 463 | 463 | } |
| 464 | - if(is_array($extendItems)) |
|
| 464 | + if (is_array($extendItems)) |
|
| 465 | 465 | { |
| 466 | - foreach($extendItems as $form_srl=>$item_info) |
|
| 466 | + foreach ($extendItems as $form_srl=>$item_info) |
|
| 467 | 467 | { |
| 468 | 468 | unset($signupItem); |
| 469 | 469 | $signupItem = new stdClass; |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | $signupItem->isUse = ($item_info->is_active == 'Y'); |
| 477 | 477 | $signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N'; |
| 478 | 478 | $signupItem->description = $item_info->description; |
| 479 | - if($signupItem->imageType) |
|
| 479 | + if ($signupItem->imageType) |
|
| 480 | 480 | { |
| 481 | 481 | $signupItem->max_width = $config->{$key.'_max_width'}; |
| 482 | 482 | $signupItem->max_height = $config->{$key.'_max_height'}; |
@@ -494,13 +494,13 @@ discard block |
||
| 494 | 494 | * @param string $agreement |
| 495 | 495 | * @return void |
| 496 | 496 | */ |
| 497 | - function _createSignupRuleset($signupForm, $agreement = null){ |
|
| 497 | + function _createSignupRuleset($signupForm, $agreement = null) { |
|
| 498 | 498 | $xml_file = './files/ruleset/insertMember.xml'; |
| 499 | - $buff = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL. |
|
| 500 | - '<ruleset version="1.5.0">' . PHP_EOL. |
|
| 501 | - '<customrules>' . PHP_EOL. |
|
| 502 | - '</customrules>' . PHP_EOL. |
|
| 503 | - '<fields>' . PHP_EOL . '%s' . PHP_EOL . '</fields>' . PHP_EOL. |
|
| 499 | + $buff = '<?xml version="1.0" encoding="utf-8"?>'.PHP_EOL. |
|
| 500 | + '<ruleset version="1.5.0">'.PHP_EOL. |
|
| 501 | + '<customrules>'.PHP_EOL. |
|
| 502 | + '</customrules>'.PHP_EOL. |
|
| 503 | + '<fields>'.PHP_EOL.'%s'.PHP_EOL.'</fields>'.PHP_EOL. |
|
| 504 | 504 | '</ruleset>'; |
| 505 | 505 | |
| 506 | 506 | $fields = array(); |
@@ -509,41 +509,41 @@ discard block |
||
| 509 | 509 | { |
| 510 | 510 | $fields[] = '<field name="accept_agreement"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /></field>'; |
| 511 | 511 | } |
| 512 | - foreach($signupForm as $formInfo) |
|
| 512 | + foreach ($signupForm as $formInfo) |
|
| 513 | 513 | { |
| 514 | - if($formInfo->required || $formInfo->mustRequired) |
|
| 514 | + if ($formInfo->required || $formInfo->mustRequired) |
|
| 515 | 515 | { |
| 516 | - if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip') |
|
| 516 | + if ($formInfo->type == 'tel' || $formInfo->type == 'kr_zip') |
|
| 517 | 517 | { |
| 518 | 518 | $fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name); |
| 519 | 519 | } |
| 520 | - else if($formInfo->name == 'password') |
|
| 520 | + else if ($formInfo->name == 'password') |
|
| 521 | 521 | { |
| 522 | 522 | $fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>'; |
| 523 | 523 | $fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>'; |
| 524 | 524 | } |
| 525 | - else if($formInfo->name == 'find_account_question') |
|
| 525 | + else if ($formInfo->name == 'find_account_question') |
|
| 526 | 526 | { |
| 527 | 527 | $fields[] = '<field name="find_account_question"><if test="$modify_find_account_answer" attr="required" value="true" /></field>'; |
| 528 | 528 | $fields[] = '<field name="find_account_answer" length=":250"><if test="$modify_find_account_answer" attr="required" value="true" /></field>'; |
| 529 | 529 | } |
| 530 | - else if($formInfo->name == 'email_address') |
|
| 530 | + else if ($formInfo->name == 'email_address') |
|
| 531 | 531 | { |
| 532 | 532 | $fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name); |
| 533 | 533 | } |
| 534 | - else if($formInfo->name == 'user_id') |
|
| 534 | + else if ($formInfo->name == 'user_id') |
|
| 535 | 535 | { |
| 536 | 536 | $fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name); |
| 537 | 537 | } |
| 538 | - else if($formInfo->name == 'nick_name') |
|
| 538 | + else if ($formInfo->name == 'nick_name') |
|
| 539 | 539 | { |
| 540 | 540 | $fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name); |
| 541 | 541 | } |
| 542 | - else if(strpos($formInfo->name, 'image') !== false) |
|
| 542 | + else if (strpos($formInfo->name, 'image') !== false) |
|
| 543 | 543 | { |
| 544 | 544 | $fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' && $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name); |
| 545 | 545 | } |
| 546 | - else if($formInfo->name == 'signature') |
|
| 546 | + else if ($formInfo->name == 'signature') |
|
| 547 | 547 | { |
| 548 | 548 | $fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>'; |
| 549 | 549 | } |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | FileHandler::writeFile($xml_file, $xml_buff); |
| 559 | 559 | unset($xml_buff); |
| 560 | 560 | |
| 561 | - $validator = new Validator($xml_file); |
|
| 561 | + $validator = new Validator($xml_file); |
|
| 562 | 562 | $validator->setCacheDir('files/cache'); |
| 563 | 563 | $validator->getJsPath(); |
| 564 | 564 | } |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | $xml_buff = sprintf($buff, implode('', $fields)); |
| 587 | 587 | Filehandler::writeFile($xml_file, $xml_buff); |
| 588 | 588 | |
| 589 | - $validator = new Validator($xml_file); |
|
| 589 | + $validator = new Validator($xml_file); |
|
| 590 | 590 | $validator->setCacheDir('files/cache'); |
| 591 | 591 | $validator->getJsPath(); |
| 592 | 592 | } |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | '</ruleset>'; |
| 608 | 608 | |
| 609 | 609 | $fields = array(); |
| 610 | - if($identifier == 'user_id') |
|
| 610 | + if ($identifier == 'user_id') |
|
| 611 | 611 | $fields[] = '<field name="user_id" required="true" rule="userid" />'; |
| 612 | 612 | |
| 613 | 613 | $fields[] = '<field name="email_address" required="true" rule="email" />'; |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $xml_buff = sprintf($buff, implode('', $fields)); |
| 618 | 618 | Filehandler::writeFile($xml_file, $xml_buff); |
| 619 | 619 | |
| 620 | - $validator = new Validator($xml_file); |
|
| 620 | + $validator = new Validator($xml_file); |
|
| 621 | 621 | $validator->setCacheDir('files/cache'); |
| 622 | 622 | $validator->getJsPath(); |
| 623 | 623 | } |
@@ -628,12 +628,12 @@ discard block |
||
| 628 | 628 | */ |
| 629 | 629 | function procMemberAdminInsertGroup() |
| 630 | 630 | { |
| 631 | - $args = Context::gets('title','description','is_default','image_mark'); |
|
| 631 | + $args = Context::gets('title', 'description', 'is_default', 'image_mark'); |
|
| 632 | 632 | $output = $this->insertGroup($args); |
| 633 | - if(!$output->toBool()) return $output; |
|
| 633 | + if (!$output->toBool()) return $output; |
|
| 634 | 634 | |
| 635 | - $this->add('group_srl',''); |
|
| 636 | - $this->add('page',Context::get('page')); |
|
| 635 | + $this->add('group_srl', ''); |
|
| 636 | + $this->add('page', Context::get('page')); |
|
| 637 | 637 | $this->setMessage('success_registed'); |
| 638 | 638 | |
| 639 | 639 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList'); |
@@ -648,13 +648,13 @@ discard block |
||
| 648 | 648 | { |
| 649 | 649 | $group_srl = Context::get('group_srl'); |
| 650 | 650 | |
| 651 | - $args = Context::gets('group_srl','title','description','is_default','image_mark'); |
|
| 651 | + $args = Context::gets('group_srl', 'title', 'description', 'is_default', 'image_mark'); |
|
| 652 | 652 | $args->site_srl = 0; |
| 653 | 653 | $output = $this->updateGroup($args); |
| 654 | - if(!$output->toBool()) return $output; |
|
| 654 | + if (!$output->toBool()) return $output; |
|
| 655 | 655 | |
| 656 | - $this->add('group_srl',''); |
|
| 657 | - $this->add('page',Context::get('page')); |
|
| 656 | + $this->add('group_srl', ''); |
|
| 657 | + $this->add('page', Context::get('page')); |
|
| 658 | 658 | $this->setMessage('success_updated'); |
| 659 | 659 | |
| 660 | 660 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList'); |
@@ -670,10 +670,10 @@ discard block |
||
| 670 | 670 | $group_srl = Context::get('group_srl'); |
| 671 | 671 | |
| 672 | 672 | $output = $this->deleteGroup($group_srl); |
| 673 | - if(!$output->toBool()) return $output; |
|
| 673 | + if (!$output->toBool()) return $output; |
|
| 674 | 674 | |
| 675 | - $this->add('group_srl',''); |
|
| 676 | - $this->add('page',Context::get('page')); |
|
| 675 | + $this->add('group_srl', ''); |
|
| 676 | + $this->add('page', Context::get('page')); |
|
| 677 | 677 | $this->setMessage('success_deleted'); |
| 678 | 678 | |
| 679 | 679 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList'); |
@@ -695,10 +695,10 @@ discard block |
||
| 695 | 695 | $args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value'))); |
| 696 | 696 | $args->required = Context::get('required'); |
| 697 | 697 | $args->is_active = (isset($args->required)); |
| 698 | - if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N'; |
|
| 698 | + if (!in_array(strtoupper($args->required), array('Y', 'N')))$args->required = 'N'; |
|
| 699 | 699 | $args->description = Context::get('description') ? Context::get('description') : ''; |
| 700 | 700 | // Default values |
| 701 | - if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value)) |
|
| 701 | + if (in_array($args->column_type, array('checkbox', 'select', 'radio')) && count($args->default_value)) |
|
| 702 | 702 | { |
| 703 | 703 | $args->default_value = serialize($args->default_value); |
| 704 | 704 | } |
@@ -710,17 +710,17 @@ discard block |
||
| 710 | 710 | // Check ID duplicated |
| 711 | 711 | $oMemberModel = getModel('member'); |
| 712 | 712 | $config = $oMemberModel->getMemberConfig(); |
| 713 | - foreach($config->signupForm as $item) |
|
| 713 | + foreach ($config->signupForm as $item) |
|
| 714 | 714 | { |
| 715 | - if($item->name == $args->column_name) |
|
| 715 | + if ($item->name == $args->column_name) |
|
| 716 | 716 | { |
| 717 | - if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue; |
|
| 718 | - return new BaseObject(-1,'msg_exists_user_id'); |
|
| 717 | + if ($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue; |
|
| 718 | + return new BaseObject(-1, 'msg_exists_user_id'); |
|
| 719 | 719 | } |
| 720 | 720 | } |
| 721 | 721 | // Fix if member_join_form_srl exists. Add if not exists. |
| 722 | 722 | $isInsert; |
| 723 | - if(!$args->member_join_form_srl) |
|
| 723 | + if (!$args->member_join_form_srl) |
|
| 724 | 724 | { |
| 725 | 725 | $isInsert = true; |
| 726 | 726 | $args->list_order = $args->member_join_form_srl = getNextSequence(); |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | $output = executeQuery('member.updateJoinForm', $args); |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | - if(!$output->toBool()) return $output; |
|
| 734 | + if (!$output->toBool()) return $output; |
|
| 735 | 735 | |
| 736 | 736 | // memberConfig update |
| 737 | 737 | $signupItem = new stdClass(); |
@@ -748,15 +748,15 @@ discard block |
||
| 748 | 748 | $config = $oMemberModel->getMemberConfig(); |
| 749 | 749 | unset($config->agreement); |
| 750 | 750 | |
| 751 | - if($isInsert) |
|
| 751 | + if ($isInsert) |
|
| 752 | 752 | { |
| 753 | 753 | $config->signupForm[] = $signupItem; |
| 754 | 754 | } |
| 755 | 755 | else |
| 756 | 756 | { |
| 757 | - foreach($config->signupForm as $key=>$val) |
|
| 757 | + foreach ($config->signupForm as $key=>$val) |
|
| 758 | 758 | { |
| 759 | - if($val->member_join_form_srl == $signupItem->member_join_form_srl) |
|
| 759 | + if ($val->member_join_form_srl == $signupItem->member_join_form_srl) |
|
| 760 | 760 | { |
| 761 | 761 | $config->signupForm[$key] = $signupItem; |
| 762 | 762 | } |
@@ -784,9 +784,9 @@ discard block |
||
| 784 | 784 | $config = $oMemberModel->getMemberConfig(); |
| 785 | 785 | unset($config->agreement); |
| 786 | 786 | |
| 787 | - foreach($config->signupForm as $key=>$val) |
|
| 787 | + foreach ($config->signupForm as $key=>$val) |
|
| 788 | 788 | { |
| 789 | - if($val->member_join_form_srl == $member_join_form_srl) |
|
| 789 | + if ($val->member_join_form_srl == $member_join_form_srl) |
|
| 790 | 790 | { |
| 791 | 791 | unset($config->signupForm[$key]); |
| 792 | 792 | break; |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | $member_join_form_srl = Context::get('member_join_form_srl'); |
| 807 | 807 | $mode = Context::get('mode'); |
| 808 | 808 | |
| 809 | - switch($mode) |
|
| 809 | + switch ($mode) |
|
| 810 | 810 | { |
| 811 | 811 | case 'up' : |
| 812 | 812 | $output = $this->moveJoinFormUp($member_join_form_srl); |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | case 'update' : |
| 824 | 824 | break; |
| 825 | 825 | } |
| 826 | - if(!$output->toBool()) return $output; |
|
| 826 | + if (!$output->toBool()) return $output; |
|
| 827 | 827 | |
| 828 | 828 | $this->setMessage($msg_code); |
| 829 | 829 | } |
@@ -842,40 +842,40 @@ discard block |
||
| 842 | 842 | $oDB->begin(); |
| 843 | 843 | |
| 844 | 844 | $oMemberController = getController('member'); |
| 845 | - foreach($members as $key=>$member_srl) |
|
| 845 | + foreach ($members as $key=>$member_srl) |
|
| 846 | 846 | { |
| 847 | 847 | $args = new stdClass(); |
| 848 | 848 | $args->member_srl = $member_srl; |
| 849 | - switch($var->type) |
|
| 849 | + switch ($var->type) |
|
| 850 | 850 | { |
| 851 | 851 | case 'modify': |
| 852 | 852 | { |
| 853 | - if(count($groups) > 0) |
|
| 853 | + if (count($groups) > 0) |
|
| 854 | 854 | { |
| 855 | 855 | $args->site_srl = 0; |
| 856 | 856 | // One of its members to delete all the group |
| 857 | 857 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
| 858 | - if(!$output->toBool()) |
|
| 858 | + if (!$output->toBool()) |
|
| 859 | 859 | { |
| 860 | 860 | $oDB->rollback(); |
| 861 | 861 | return $output; |
| 862 | 862 | } |
| 863 | 863 | // Enter one of the loop a |
| 864 | - foreach($groups as $group_srl) |
|
| 864 | + foreach ($groups as $group_srl) |
|
| 865 | 865 | { |
| 866 | - $output = $oMemberController->addMemberToGroup($args->member_srl,$group_srl); |
|
| 867 | - if(!$output->toBool()) |
|
| 866 | + $output = $oMemberController->addMemberToGroup($args->member_srl, $group_srl); |
|
| 867 | + if (!$output->toBool()) |
|
| 868 | 868 | { |
| 869 | 869 | $oDB->rollback(); |
| 870 | 870 | return $output; |
| 871 | 871 | } |
| 872 | 872 | } |
| 873 | 873 | } |
| 874 | - if($var->denied) |
|
| 874 | + if ($var->denied) |
|
| 875 | 875 | { |
| 876 | 876 | $args->denied = $var->denied; |
| 877 | 877 | $output = executeQuery('member.updateMemberDeniedInfo', $args); |
| 878 | - if(!$output->toBool()) |
|
| 878 | + if (!$output->toBool()) |
|
| 879 | 879 | { |
| 880 | 880 | $oDB->rollback(); |
| 881 | 881 | return $output; |
@@ -888,7 +888,7 @@ discard block |
||
| 888 | 888 | { |
| 889 | 889 | $oMemberController->memberInfo = null; |
| 890 | 890 | $output = $oMemberController->deleteMember($member_srl); |
| 891 | - if(!$output->toBool()) |
|
| 891 | + if (!$output->toBool()) |
|
| 892 | 892 | { |
| 893 | 893 | $oDB->rollback(); |
| 894 | 894 | return $output; |
@@ -901,15 +901,15 @@ discard block |
||
| 901 | 901 | |
| 902 | 902 | $message = $var->message; |
| 903 | 903 | // Send a message |
| 904 | - if($message) |
|
| 904 | + if ($message) |
|
| 905 | 905 | { |
| 906 | 906 | $oCommunicationController = getController('communication'); |
| 907 | 907 | |
| 908 | 908 | $logged_info = Context::get('logged_info'); |
| 909 | - $title = cut_str($message,10,'...'); |
|
| 909 | + $title = cut_str($message, 10, '...'); |
|
| 910 | 910 | $sender_member_srl = $logged_info->member_srl; |
| 911 | 911 | |
| 912 | - foreach($members as $member_srl) |
|
| 912 | + foreach ($members as $member_srl) |
|
| 913 | 913 | { |
| 914 | 914 | $oCommunicationController->sendMessage($sender_member_srl, $member_srl, $title, $message, false); |
| 915 | 915 | } |
@@ -926,14 +926,14 @@ discard block |
||
| 926 | 926 | function procMemberAdminDeleteMembers() |
| 927 | 927 | { |
| 928 | 928 | $target_member_srls = Context::get('target_member_srls'); |
| 929 | - if(!$target_member_srls) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 929 | + if (!$target_member_srls) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 930 | 930 | $member_srls = explode(',', $target_member_srls); |
| 931 | 931 | $oMemberController = getController('member'); |
| 932 | 932 | |
| 933 | - foreach($member_srls as $member) |
|
| 933 | + foreach ($member_srls as $member) |
|
| 934 | 934 | { |
| 935 | 935 | $output = $oMemberController->deleteMember($member); |
| 936 | - if(!$output->toBool()) |
|
| 936 | + if (!$output->toBool()) |
|
| 937 | 937 | { |
| 938 | 938 | $this->setMessage('failed_deleted'); |
| 939 | 939 | return $output; |
@@ -950,11 +950,11 @@ discard block |
||
| 950 | 950 | function procMemberAdminUpdateMembersGroup() |
| 951 | 951 | { |
| 952 | 952 | $member_srl = Context::get('member_srl'); |
| 953 | - if(!$member_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
| 954 | - $member_srls = explode(',',$member_srl); |
|
| 953 | + if (!$member_srl) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 954 | + $member_srls = explode(',', $member_srl); |
|
| 955 | 955 | |
| 956 | 956 | $group_srl = Context::get('group_srls'); |
| 957 | - if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl); |
|
| 957 | + if (!is_array($group_srl)) $group_srls = explode('|@|', $group_srl); |
|
| 958 | 958 | else $group_srls = $group_srl; |
| 959 | 959 | |
| 960 | 960 | $oDB = &DB::getInstance(); |
@@ -963,7 +963,7 @@ discard block |
||
| 963 | 963 | $args = new stdClass; |
| 964 | 964 | $args->member_srl = $member_srl; |
| 965 | 965 | $output = executeQuery('member.deleteMembersGroup', $args); |
| 966 | - if(!$output->toBool()) |
|
| 966 | + if (!$output->toBool()) |
|
| 967 | 967 | { |
| 968 | 968 | $oDB->rollback(); |
| 969 | 969 | return $output; |
@@ -971,21 +971,21 @@ discard block |
||
| 971 | 971 | // Add to a selected group |
| 972 | 972 | $group_count = count($group_srls); |
| 973 | 973 | $member_count = count($member_srls); |
| 974 | - for($j=0;$j<$group_count;$j++) |
|
| 974 | + for ($j = 0; $j < $group_count; $j++) |
|
| 975 | 975 | { |
| 976 | - $group_srl = (int)trim($group_srls[$j]); |
|
| 977 | - if(!$group_srl) continue; |
|
| 978 | - for($i=0;$i<$member_count;$i++) |
|
| 976 | + $group_srl = (int) trim($group_srls[$j]); |
|
| 977 | + if (!$group_srl) continue; |
|
| 978 | + for ($i = 0; $i < $member_count; $i++) |
|
| 979 | 979 | { |
| 980 | - $member_srl = (int)trim($member_srls[$i]); |
|
| 981 | - if(!$member_srl) continue; |
|
| 980 | + $member_srl = (int) trim($member_srls[$i]); |
|
| 981 | + if (!$member_srl) continue; |
|
| 982 | 982 | |
| 983 | 983 | $args = new stdClass; |
| 984 | 984 | $args->member_srl = $member_srl; |
| 985 | 985 | $args->group_srl = $group_srl; |
| 986 | 986 | |
| 987 | 987 | $output = executeQuery('member.addMemberToGroup', $args); |
| 988 | - if(!$output->toBool()) |
|
| 988 | + if (!$output->toBool()) |
|
| 989 | 989 | { |
| 990 | 990 | $oDB->rollback(); |
| 991 | 991 | return $output; |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | |
| 999 | 999 | $this->setMessage('success_updated'); |
| 1000 | 1000 | |
| 1001 | - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) |
|
| 1001 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 1002 | 1002 | { |
| 1003 | 1003 | global $lang; |
| 1004 | 1004 | htmlHeader(); |
@@ -1019,19 +1019,19 @@ discard block |
||
| 1019 | 1019 | { |
| 1020 | 1020 | $user_ids = Context::get('user_id'); |
| 1021 | 1021 | |
| 1022 | - $user_ids = explode(',',$user_ids); |
|
| 1022 | + $user_ids = explode(',', $user_ids); |
|
| 1023 | 1023 | $success_ids = array(); |
| 1024 | 1024 | |
| 1025 | - foreach($user_ids as $val) |
|
| 1025 | + foreach ($user_ids as $val) |
|
| 1026 | 1026 | { |
| 1027 | 1027 | $val = trim($val); |
| 1028 | - if(!$val) continue; |
|
| 1028 | + if (!$val) continue; |
|
| 1029 | 1029 | |
| 1030 | 1030 | $output = $this->insertDeniedID($val, ''); |
| 1031 | - if($output->toBool()) $success_ids[] = $val; |
|
| 1031 | + if ($output->toBool()) $success_ids[] = $val; |
|
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | - $this->add('user_ids', implode(',',$success_ids)); |
|
| 1034 | + $this->add('user_ids', implode(',', $success_ids)); |
|
| 1035 | 1035 | |
| 1036 | 1036 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminDeniedIDList'); |
| 1037 | 1037 | $this->setRedirectUrl($returnUrl); |
@@ -1048,10 +1048,10 @@ discard block |
||
| 1048 | 1048 | $mode = Context::get('mode'); |
| 1049 | 1049 | $mode = $mode ? $mode : 'insert'; |
| 1050 | 1050 | |
| 1051 | - if($mode == 'delete') |
|
| 1051 | + if ($mode == 'delete') |
|
| 1052 | 1052 | { |
| 1053 | 1053 | $output = $this->deleteDeniedNickName($nick_name); |
| 1054 | - if(!$output->toBool()) |
|
| 1054 | + if (!$output->toBool()) |
|
| 1055 | 1055 | { |
| 1056 | 1056 | return $output; |
| 1057 | 1057 | } |
@@ -1060,19 +1060,19 @@ discard block |
||
| 1060 | 1060 | } |
| 1061 | 1061 | else |
| 1062 | 1062 | { |
| 1063 | - $nick_names = explode(',',$nick_name); |
|
| 1063 | + $nick_names = explode(',', $nick_name); |
|
| 1064 | 1064 | $success_nick_names = array(); |
| 1065 | 1065 | |
| 1066 | - foreach($nick_names as $val) |
|
| 1066 | + foreach ($nick_names as $val) |
|
| 1067 | 1067 | { |
| 1068 | 1068 | $val = trim($val); |
| 1069 | - if(!$val) continue; |
|
| 1069 | + if (!$val) continue; |
|
| 1070 | 1070 | |
| 1071 | 1071 | $output = $this->insertDeniedNickName($val, ''); |
| 1072 | - if($output->toBool()) $success_nick_names[] = $val; |
|
| 1072 | + if ($output->toBool()) $success_nick_names[] = $val; |
|
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | - $this->add('nick_names', implode(',',$success_nick_names)); |
|
| 1075 | + $this->add('nick_names', implode(',', $success_nick_names)); |
|
| 1076 | 1076 | } |
| 1077 | 1077 | } |
| 1078 | 1078 | |
@@ -1085,16 +1085,16 @@ discard block |
||
| 1085 | 1085 | $user_id = Context::get('user_id'); |
| 1086 | 1086 | $mode = Context::get('mode'); |
| 1087 | 1087 | |
| 1088 | - switch($mode) |
|
| 1088 | + switch ($mode) |
|
| 1089 | 1089 | { |
| 1090 | 1090 | case 'delete' : |
| 1091 | 1091 | $output = $this->deleteDeniedID($user_id); |
| 1092 | - if(!$output->toBool()) return $output; |
|
| 1092 | + if (!$output->toBool()) return $output; |
|
| 1093 | 1093 | $msg_code = 'success_deleted'; |
| 1094 | 1094 | break; |
| 1095 | 1095 | } |
| 1096 | 1096 | |
| 1097 | - $this->add('page',Context::get('page')); |
|
| 1097 | + $this->add('page', Context::get('page')); |
|
| 1098 | 1098 | $this->setMessage($msg_code); |
| 1099 | 1099 | } |
| 1100 | 1100 | |
@@ -1141,24 +1141,24 @@ discard block |
||
| 1141 | 1141 | */ |
| 1142 | 1142 | function insertGroup($args) |
| 1143 | 1143 | { |
| 1144 | - if(!$args->site_srl) $args->site_srl = 0; |
|
| 1144 | + if (!$args->site_srl) $args->site_srl = 0; |
|
| 1145 | 1145 | // Check the value of is_default. |
| 1146 | - if($args->is_default != 'Y') |
|
| 1146 | + if ($args->is_default != 'Y') |
|
| 1147 | 1147 | { |
| 1148 | 1148 | $args->is_default = 'N'; |
| 1149 | 1149 | } |
| 1150 | 1150 | else |
| 1151 | 1151 | { |
| 1152 | 1152 | $output = executeQuery('member.updateGroupDefaultClear', $args); |
| 1153 | - if(!$output->toBool()) return $output; |
|
| 1153 | + if (!$output->toBool()) return $output; |
|
| 1154 | 1154 | } |
| 1155 | 1155 | |
| 1156 | - if(!isset($args->list_order) || $args->list_order=='') |
|
| 1156 | + if (!isset($args->list_order) || $args->list_order == '') |
|
| 1157 | 1157 | { |
| 1158 | 1158 | $args->list_order = $args->group_srl; |
| 1159 | 1159 | } |
| 1160 | 1160 | |
| 1161 | - if(!$args->group_srl) $args->group_srl = getNextSequence(); |
|
| 1161 | + if (!$args->group_srl) $args->group_srl = getNextSequence(); |
|
| 1162 | 1162 | $args->list_order = $args->group_srl; |
| 1163 | 1163 | $output = executeQuery('member.insertGroup', $args); |
| 1164 | 1164 | $this->_deleteMemberGroupCache($args->site_srl); |
@@ -1173,17 +1173,17 @@ discard block |
||
| 1173 | 1173 | */ |
| 1174 | 1174 | function updateGroup($args) |
| 1175 | 1175 | { |
| 1176 | - if(!$args->site_srl) $args->site_srl = 0; |
|
| 1176 | + if (!$args->site_srl) $args->site_srl = 0; |
|
| 1177 | 1177 | // Check the value of is_default. |
| 1178 | - if(!$args->group_srl) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
| 1179 | - if($args->is_default!='Y') |
|
| 1178 | + if (!$args->group_srl) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
| 1179 | + if ($args->is_default != 'Y') |
|
| 1180 | 1180 | { |
| 1181 | 1181 | $args->is_default = 'N'; |
| 1182 | 1182 | } |
| 1183 | 1183 | else |
| 1184 | 1184 | { |
| 1185 | 1185 | $output = executeQuery('member.updateGroupDefaultClear', $args); |
| 1186 | - if(!$output->toBool()) return $output; |
|
| 1186 | + if (!$output->toBool()) return $output; |
|
| 1187 | 1187 | } |
| 1188 | 1188 | |
| 1189 | 1189 | $output = executeQuery('member.updateGroup', $args); |
@@ -1206,8 +1206,8 @@ discard block |
||
| 1206 | 1206 | $columnList = array('group_srl', 'is_default'); |
| 1207 | 1207 | $group_info = $oMemberModel->getGroup($group_srl, $columnList); |
| 1208 | 1208 | |
| 1209 | - if(!$group_info) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
| 1210 | - if($group_info->is_default == 'Y') return new BaseObject(-1, 'msg_not_delete_default'); |
|
| 1209 | + if (!$group_info) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
| 1210 | + if ($group_info->is_default == 'Y') return new BaseObject(-1, 'msg_not_delete_default'); |
|
| 1211 | 1211 | |
| 1212 | 1212 | // Get groups where is_default == 'Y' |
| 1213 | 1213 | $columnList = array('site_srl', 'group_srl'); |
@@ -1244,7 +1244,7 @@ discard block |
||
| 1244 | 1244 | $defaultGroup = $oMemberModel->getDefaultGroup(0); |
| 1245 | 1245 | $defaultGroupSrl = $defaultGroup->group_srl; |
| 1246 | 1246 | $group_srls = $vars->group_srls; |
| 1247 | - foreach($group_srls as $order=>$group_srl) |
|
| 1247 | + foreach ($group_srls as $order=>$group_srl) |
|
| 1248 | 1248 | { |
| 1249 | 1249 | $isInsert = false; |
| 1250 | 1250 | $update_args = new stdClass(); |
@@ -1253,9 +1253,9 @@ discard block |
||
| 1253 | 1253 | $update_args->image_mark = $vars->image_marks[$order]; |
| 1254 | 1254 | $update_args->list_order = $order + 1; |
| 1255 | 1255 | |
| 1256 | - if(!$update_args->title) continue; |
|
| 1256 | + if (!$update_args->title) continue; |
|
| 1257 | 1257 | |
| 1258 | - if(is_numeric($group_srl)) { |
|
| 1258 | + if (is_numeric($group_srl)) { |
|
| 1259 | 1259 | $update_args->group_srl = $group_srl; |
| 1260 | 1260 | $output = $this->updateGroup($update_args); |
| 1261 | 1261 | } |
@@ -1264,7 +1264,7 @@ discard block |
||
| 1264 | 1264 | $output = $this->insertGroup($update_args); |
| 1265 | 1265 | } |
| 1266 | 1266 | |
| 1267 | - if($vars->defaultGroup == $group_srl) { |
|
| 1267 | + if ($vars->defaultGroup == $group_srl) { |
|
| 1268 | 1268 | $defaultGroupSrl = $update_args->group_srl; |
| 1269 | 1269 | } |
| 1270 | 1270 | } |
@@ -1290,7 +1290,7 @@ discard block |
||
| 1290 | 1290 | { |
| 1291 | 1291 | $vars = Context::getRequestVars(); |
| 1292 | 1292 | |
| 1293 | - foreach($vars->group_srls as $key => $val) |
|
| 1293 | + foreach ($vars->group_srls as $key => $val) |
|
| 1294 | 1294 | { |
| 1295 | 1295 | $args = new stdClass; |
| 1296 | 1296 | $args->group_srl = $val; |
@@ -1311,7 +1311,7 @@ discard block |
||
| 1311 | 1311 | { |
| 1312 | 1312 | //remove from cache |
| 1313 | 1313 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
| 1314 | - if($oCacheHandler->isSupport()) |
|
| 1314 | + if ($oCacheHandler->isSupport()) |
|
| 1315 | 1315 | { |
| 1316 | 1316 | $oCacheHandler->invalidateGroupKey('member'); |
| 1317 | 1317 | } |
@@ -1328,7 +1328,7 @@ discard block |
||
| 1328 | 1328 | $args = new stdClass(); |
| 1329 | 1329 | $args->user_id = $user_id; |
| 1330 | 1330 | $args->description = $description; |
| 1331 | - $args->list_order = -1*getNextSequence(); |
|
| 1331 | + $args->list_order = -1 * getNextSequence(); |
|
| 1332 | 1332 | |
| 1333 | 1333 | return executeQuery('member.insertDeniedID', $args); |
| 1334 | 1334 | } |
@@ -1349,7 +1349,7 @@ discard block |
||
| 1349 | 1349 | */ |
| 1350 | 1350 | function deleteDeniedID($user_id) |
| 1351 | 1351 | { |
| 1352 | - if(!$user_id) unset($user_id); |
|
| 1352 | + if (!$user_id) unset($user_id); |
|
| 1353 | 1353 | |
| 1354 | 1354 | $args = new stdClass; |
| 1355 | 1355 | $args->user_id = $user_id; |
@@ -1363,7 +1363,7 @@ discard block |
||
| 1363 | 1363 | */ |
| 1364 | 1364 | function deleteDeniedNickName($nick_name) |
| 1365 | 1365 | { |
| 1366 | - if(!$nick_name) unset($nick_name); |
|
| 1366 | + if (!$nick_name) unset($nick_name); |
|
| 1367 | 1367 | |
| 1368 | 1368 | $args = new stdClass; |
| 1369 | 1369 | $args->nick_name = $nick_name; |
@@ -1402,16 +1402,16 @@ discard block |
||
| 1402 | 1402 | // Get a list of all join forms |
| 1403 | 1403 | $join_form_list = $oMemberModel->getJoinFormList(); |
| 1404 | 1404 | $join_form_srl_list = array_keys($join_form_list); |
| 1405 | - if(count($join_form_srl_list)<2) return new BaseObject(); |
|
| 1405 | + if (count($join_form_srl_list) < 2) return new BaseObject(); |
|
| 1406 | 1406 | |
| 1407 | 1407 | $prev_member_join_form = NULL; |
| 1408 | - foreach($join_form_list as $key => $val) |
|
| 1408 | + foreach ($join_form_list as $key => $val) |
|
| 1409 | 1409 | { |
| 1410 | - if($val->member_join_form_srl == $member_join_form_srl) break; |
|
| 1410 | + if ($val->member_join_form_srl == $member_join_form_srl) break; |
|
| 1411 | 1411 | $prev_member_join_form = $val; |
| 1412 | 1412 | } |
| 1413 | 1413 | // Return if no previous join form exists |
| 1414 | - if(!$prev_member_join_form) return new BaseObject(); |
|
| 1414 | + if (!$prev_member_join_form) return new BaseObject(); |
|
| 1415 | 1415 | // Information of the join form |
| 1416 | 1416 | $cur_args = new stdClass; |
| 1417 | 1417 | $cur_args->member_join_form_srl = $member_join_form_srl; |
@@ -1422,10 +1422,10 @@ discard block |
||
| 1422 | 1422 | $prev_args->list_order = $list_order; |
| 1423 | 1423 | // Execute Query |
| 1424 | 1424 | $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); |
| 1425 | - if(!$output->toBool()) return $output; |
|
| 1425 | + if (!$output->toBool()) return $output; |
|
| 1426 | 1426 | |
| 1427 | 1427 | executeQuery('member.updateMemberJoinFormListorder', $prev_args); |
| 1428 | - if(!$output->toBool()) return $output; |
|
| 1428 | + if (!$output->toBool()) return $output; |
|
| 1429 | 1429 | |
| 1430 | 1430 | return new BaseObject(); |
| 1431 | 1431 | } |
@@ -1449,16 +1449,16 @@ discard block |
||
| 1449 | 1449 | // Get information of all join forms |
| 1450 | 1450 | $join_form_list = $oMemberModel->getJoinFormList(); |
| 1451 | 1451 | $join_form_srl_list = array_keys($join_form_list); |
| 1452 | - if(count($join_form_srl_list)<2) return new BaseObject(); |
|
| 1452 | + if (count($join_form_srl_list) < 2) return new BaseObject(); |
|
| 1453 | 1453 | |
| 1454 | - for($i=0;$i<count($join_form_srl_list);$i++) |
|
| 1454 | + for ($i = 0; $i < count($join_form_srl_list); $i++) |
|
| 1455 | 1455 | { |
| 1456 | - if($join_form_srl_list[$i]==$member_join_form_srl) break; |
|
| 1456 | + if ($join_form_srl_list[$i] == $member_join_form_srl) break; |
|
| 1457 | 1457 | } |
| 1458 | 1458 | |
| 1459 | - $next_member_join_form_srl = $join_form_srl_list[$i+1]; |
|
| 1459 | + $next_member_join_form_srl = $join_form_srl_list[$i + 1]; |
|
| 1460 | 1460 | // Return if no previous join form exists |
| 1461 | - if(!$next_member_join_form_srl) return new BaseObject(); |
|
| 1461 | + if (!$next_member_join_form_srl) return new BaseObject(); |
|
| 1462 | 1462 | $next_member_join_form = $join_form_list[$next_member_join_form_srl]; |
| 1463 | 1463 | // Information of the join form |
| 1464 | 1464 | $cur_args = new stdClass; |
@@ -1470,10 +1470,10 @@ discard block |
||
| 1470 | 1470 | $next_args->list_order = $list_order; |
| 1471 | 1471 | // Execute Query |
| 1472 | 1472 | $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); |
| 1473 | - if(!$output->toBool()) return $output; |
|
| 1473 | + if (!$output->toBool()) return $output; |
|
| 1474 | 1474 | |
| 1475 | 1475 | $output = executeQuery('member.updateMemberJoinFormListorder', $next_args); |
| 1476 | - if(!$output->toBool()) return $output; |
|
| 1476 | + if (!$output->toBool()) return $output; |
|
| 1477 | 1477 | |
| 1478 | 1478 | return new BaseObject(); |
| 1479 | 1479 | } |
@@ -48,9 +48,11 @@ discard block |
||
| 48 | 48 | $args->{$val} = Context::get($val); |
| 49 | 49 | } |
| 50 | 50 | $args->member_srl = Context::get('member_srl'); |
| 51 | - if(Context::get('reset_password')) |
|
| 52 | - $args->password = Context::get('reset_password'); |
|
| 53 | - else unset($args->password); |
|
| 51 | + if(Context::get('reset_password')) { |
|
| 52 | + $args->password = Context::get('reset_password'); |
|
| 53 | + } else { |
|
| 54 | + unset($args->password); |
|
| 55 | + } |
|
| 54 | 56 | |
| 55 | 57 | // Remove some unnecessary variables from all the vars |
| 56 | 58 | $all_args = Context::getRequestVars(); |
@@ -64,8 +66,12 @@ discard block |
||
| 64 | 66 | unset($all_args->password2); |
| 65 | 67 | unset($all_args->reset_password); |
| 66 | 68 | |
| 67 | - if(!isset($args->limit_date)) $args->limit_date = ""; |
|
| 68 | - if(!isset($args->description)) $args->description = ""; |
|
| 69 | + if(!isset($args->limit_date)) { |
|
| 70 | + $args->limit_date = ""; |
|
| 71 | + } |
|
| 72 | + if(!isset($args->description)) { |
|
| 73 | + $args->description = ""; |
|
| 74 | + } |
|
| 69 | 75 | |
| 70 | 76 | // Add extra vars after excluding necessary information from all the requested arguments |
| 71 | 77 | $extra_vars = delObjectVars($all_args, $args); |
@@ -79,7 +85,9 @@ discard block |
||
| 79 | 85 | $columnList = array('member_srl'); |
| 80 | 86 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList); |
| 81 | 87 | // If no original member exists, make a new one |
| 82 | - if($member_info->member_srl != $args->member_srl) unset($args->member_srl); |
|
| 88 | + if($member_info->member_srl != $args->member_srl) { |
|
| 89 | + unset($args->member_srl); |
|
| 90 | + } |
|
| 83 | 91 | } |
| 84 | 92 | |
| 85 | 93 | // remove whitespace |
@@ -99,14 +107,15 @@ discard block |
||
| 99 | 107 | $args->password = Context::get('password'); |
| 100 | 108 | $output = $oMemberController->insertMember($args); |
| 101 | 109 | $msg_code = 'success_registed'; |
| 102 | - } |
|
| 103 | - else |
|
| 110 | + } else |
|
| 104 | 111 | { |
| 105 | 112 | $output = $oMemberController->updateMember($args); |
| 106 | 113 | $msg_code = 'success_updated'; |
| 107 | 114 | } |
| 108 | 115 | |
| 109 | - if(!$output->toBool()) return $output; |
|
| 116 | + if(!$output->toBool()) { |
|
| 117 | + return $output; |
|
| 118 | + } |
|
| 110 | 119 | // Save Signature |
| 111 | 120 | $signature = Context::get('signature'); |
| 112 | 121 | $oMemberController->putSignature($args->member_srl, $signature); |
@@ -118,21 +127,27 @@ discard block |
||
| 118 | 127 | if(is_uploaded_file($profile_image['tmp_name'])) |
| 119 | 128 | { |
| 120 | 129 | $output = $oMemberController->insertProfileImage($args->member_srl, $profile_image['tmp_name']); |
| 121 | - if(!$output->toBool()) return $output; |
|
| 130 | + if(!$output->toBool()) { |
|
| 131 | + return $output; |
|
| 132 | + } |
|
| 122 | 133 | } |
| 123 | 134 | |
| 124 | 135 | $image_mark = Context::get('image_mark'); |
| 125 | 136 | if(is_uploaded_file($image_mark['tmp_name'])) |
| 126 | 137 | { |
| 127 | 138 | $output = $oMemberController->insertImageMark($args->member_srl, $image_mark['tmp_name']); |
| 128 | - if(!$output->toBool()) return $output; |
|
| 139 | + if(!$output->toBool()) { |
|
| 140 | + return $output; |
|
| 141 | + } |
|
| 129 | 142 | } |
| 130 | 143 | |
| 131 | 144 | $image_name = Context::get('image_name'); |
| 132 | 145 | if (is_uploaded_file($image_name['tmp_name'])) |
| 133 | 146 | { |
| 134 | 147 | $output = $oMemberController->insertImageName($args->member_srl, $image_name['tmp_name']); |
| 135 | - if(!$output->toBool()) return $output; |
|
| 148 | + if(!$output->toBool()) { |
|
| 149 | + return $output; |
|
| 150 | + } |
|
| 136 | 151 | } |
| 137 | 152 | |
| 138 | 153 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminList'); |
@@ -150,7 +165,9 @@ discard block |
||
| 150 | 165 | |
| 151 | 166 | $oMemberController = getController('member'); |
| 152 | 167 | $output = $oMemberController->deleteMember($member_srl); |
| 153 | - if(!$output->toBool()) return $output; |
|
| 168 | + if(!$output->toBool()) { |
|
| 169 | + return $output; |
|
| 170 | + } |
|
| 154 | 171 | |
| 155 | 172 | $this->add('page',Context::get('page')); |
| 156 | 173 | $this->setMessage("success_deleted"); |
@@ -456,10 +473,11 @@ discard block |
||
| 456 | 473 | $signupItem->max_width = $config->{$key.'_max_width'}; |
| 457 | 474 | $signupItem->max_height = $config->{$key.'_max_height'}; |
| 458 | 475 | } |
| 459 | - if($signupItem->isIdentifier) |
|
| 460 | - array_unshift($list_order, $signupItem); |
|
| 461 | - else |
|
| 462 | - $list_order[] = $signupItem; |
|
| 476 | + if($signupItem->isIdentifier) { |
|
| 477 | + array_unshift($list_order, $signupItem); |
|
| 478 | + } else { |
|
| 479 | + $list_order[] = $signupItem; |
|
| 480 | + } |
|
| 463 | 481 | } |
| 464 | 482 | if(is_array($extendItems)) |
| 465 | 483 | { |
@@ -516,38 +534,30 @@ discard block |
||
| 516 | 534 | if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip') |
| 517 | 535 | { |
| 518 | 536 | $fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name); |
| 519 | - } |
|
| 520 | - else if($formInfo->name == 'password') |
|
| 537 | + } else if($formInfo->name == 'password') |
|
| 521 | 538 | { |
| 522 | 539 | $fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>'; |
| 523 | 540 | $fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>'; |
| 524 | - } |
|
| 525 | - else if($formInfo->name == 'find_account_question') |
|
| 541 | + } else if($formInfo->name == 'find_account_question') |
|
| 526 | 542 | { |
| 527 | 543 | $fields[] = '<field name="find_account_question"><if test="$modify_find_account_answer" attr="required" value="true" /></field>'; |
| 528 | 544 | $fields[] = '<field name="find_account_answer" length=":250"><if test="$modify_find_account_answer" attr="required" value="true" /></field>'; |
| 529 | - } |
|
| 530 | - else if($formInfo->name == 'email_address') |
|
| 545 | + } else if($formInfo->name == 'email_address') |
|
| 531 | 546 | { |
| 532 | 547 | $fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name); |
| 533 | - } |
|
| 534 | - else if($formInfo->name == 'user_id') |
|
| 548 | + } else if($formInfo->name == 'user_id') |
|
| 535 | 549 | { |
| 536 | 550 | $fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name); |
| 537 | - } |
|
| 538 | - else if($formInfo->name == 'nick_name') |
|
| 551 | + } else if($formInfo->name == 'nick_name') |
|
| 539 | 552 | { |
| 540 | 553 | $fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name); |
| 541 | - } |
|
| 542 | - else if(strpos($formInfo->name, 'image') !== false) |
|
| 554 | + } else if(strpos($formInfo->name, 'image') !== false) |
|
| 543 | 555 | { |
| 544 | 556 | $fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' && $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name); |
| 545 | - } |
|
| 546 | - else if($formInfo->name == 'signature') |
|
| 557 | + } else if($formInfo->name == 'signature') |
|
| 547 | 558 | { |
| 548 | 559 | $fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>'; |
| 549 | - } |
|
| 550 | - else |
|
| 560 | + } else |
|
| 551 | 561 | { |
| 552 | 562 | $fields[] = sprintf('<field name="%s" required="true" />', $formInfo->name); |
| 553 | 563 | } |
@@ -607,8 +617,9 @@ discard block |
||
| 607 | 617 | '</ruleset>'; |
| 608 | 618 | |
| 609 | 619 | $fields = array(); |
| 610 | - if($identifier == 'user_id') |
|
| 611 | - $fields[] = '<field name="user_id" required="true" rule="userid" />'; |
|
| 620 | + if($identifier == 'user_id') { |
|
| 621 | + $fields[] = '<field name="user_id" required="true" rule="userid" />'; |
|
| 622 | + } |
|
| 612 | 623 | |
| 613 | 624 | $fields[] = '<field name="email_address" required="true" rule="email" />'; |
| 614 | 625 | $fields[] = '<field name="find_account_question" required="true" />'; |
@@ -630,7 +641,9 @@ discard block |
||
| 630 | 641 | { |
| 631 | 642 | $args = Context::gets('title','description','is_default','image_mark'); |
| 632 | 643 | $output = $this->insertGroup($args); |
| 633 | - if(!$output->toBool()) return $output; |
|
| 644 | + if(!$output->toBool()) { |
|
| 645 | + return $output; |
|
| 646 | + } |
|
| 634 | 647 | |
| 635 | 648 | $this->add('group_srl',''); |
| 636 | 649 | $this->add('page',Context::get('page')); |
@@ -651,7 +664,9 @@ discard block |
||
| 651 | 664 | $args = Context::gets('group_srl','title','description','is_default','image_mark'); |
| 652 | 665 | $args->site_srl = 0; |
| 653 | 666 | $output = $this->updateGroup($args); |
| 654 | - if(!$output->toBool()) return $output; |
|
| 667 | + if(!$output->toBool()) { |
|
| 668 | + return $output; |
|
| 669 | + } |
|
| 655 | 670 | |
| 656 | 671 | $this->add('group_srl',''); |
| 657 | 672 | $this->add('page',Context::get('page')); |
@@ -670,7 +685,9 @@ discard block |
||
| 670 | 685 | $group_srl = Context::get('group_srl'); |
| 671 | 686 | |
| 672 | 687 | $output = $this->deleteGroup($group_srl); |
| 673 | - if(!$output->toBool()) return $output; |
|
| 688 | + if(!$output->toBool()) { |
|
| 689 | + return $output; |
|
| 690 | + } |
|
| 674 | 691 | |
| 675 | 692 | $this->add('group_srl',''); |
| 676 | 693 | $this->add('page',Context::get('page')); |
@@ -695,14 +712,15 @@ discard block |
||
| 695 | 712 | $args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value'))); |
| 696 | 713 | $args->required = Context::get('required'); |
| 697 | 714 | $args->is_active = (isset($args->required)); |
| 698 | - if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N'; |
|
| 715 | + if(!in_array(strtoupper($args->required), array('Y','N'))) { |
|
| 716 | + $args->required = 'N'; |
|
| 717 | + } |
|
| 699 | 718 | $args->description = Context::get('description') ? Context::get('description') : ''; |
| 700 | 719 | // Default values |
| 701 | 720 | if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value)) |
| 702 | 721 | { |
| 703 | 722 | $args->default_value = serialize($args->default_value); |
| 704 | - } |
|
| 705 | - else |
|
| 723 | + } else |
|
| 706 | 724 | { |
| 707 | 725 | $args->default_value = ''; |
| 708 | 726 | } |
@@ -714,7 +732,9 @@ discard block |
||
| 714 | 732 | { |
| 715 | 733 | if($item->name == $args->column_name) |
| 716 | 734 | { |
| 717 | - if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue; |
|
| 735 | + if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) { |
|
| 736 | + continue; |
|
| 737 | + } |
|
| 718 | 738 | return new BaseObject(-1,'msg_exists_user_id'); |
| 719 | 739 | } |
| 720 | 740 | } |
@@ -725,13 +745,14 @@ discard block |
||
| 725 | 745 | $isInsert = true; |
| 726 | 746 | $args->list_order = $args->member_join_form_srl = getNextSequence(); |
| 727 | 747 | $output = executeQuery('member.insertJoinForm', $args); |
| 728 | - } |
|
| 729 | - else |
|
| 748 | + } else |
|
| 730 | 749 | { |
| 731 | 750 | $output = executeQuery('member.updateJoinForm', $args); |
| 732 | 751 | } |
| 733 | 752 | |
| 734 | - if(!$output->toBool()) return $output; |
|
| 753 | + if(!$output->toBool()) { |
|
| 754 | + return $output; |
|
| 755 | + } |
|
| 735 | 756 | |
| 736 | 757 | // memberConfig update |
| 737 | 758 | $signupItem = new stdClass(); |
@@ -751,8 +772,7 @@ discard block |
||
| 751 | 772 | if($isInsert) |
| 752 | 773 | { |
| 753 | 774 | $config->signupForm[] = $signupItem; |
| 754 | - } |
|
| 755 | - else |
|
| 775 | + } else |
|
| 756 | 776 | { |
| 757 | 777 | foreach($config->signupForm as $key=>$val) |
| 758 | 778 | { |
@@ -823,7 +843,9 @@ discard block |
||
| 823 | 843 | case 'update' : |
| 824 | 844 | break; |
| 825 | 845 | } |
| 826 | - if(!$output->toBool()) return $output; |
|
| 846 | + if(!$output->toBool()) { |
|
| 847 | + return $output; |
|
| 848 | + } |
|
| 827 | 849 | |
| 828 | 850 | $this->setMessage($msg_code); |
| 829 | 851 | } |
@@ -926,7 +948,9 @@ discard block |
||
| 926 | 948 | function procMemberAdminDeleteMembers() |
| 927 | 949 | { |
| 928 | 950 | $target_member_srls = Context::get('target_member_srls'); |
| 929 | - if(!$target_member_srls) return new BaseObject(-1, 'msg_invalid_request'); |
|
| 951 | + if(!$target_member_srls) { |
|
| 952 | + return new BaseObject(-1, 'msg_invalid_request'); |
|
| 953 | + } |
|
| 930 | 954 | $member_srls = explode(',', $target_member_srls); |
| 931 | 955 | $oMemberController = getController('member'); |
| 932 | 956 | |
@@ -950,12 +974,17 @@ discard block |
||
| 950 | 974 | function procMemberAdminUpdateMembersGroup() |
| 951 | 975 | { |
| 952 | 976 | $member_srl = Context::get('member_srl'); |
| 953 | - if(!$member_srl) return new BaseObject(-1,'msg_invalid_request'); |
|
| 977 | + if(!$member_srl) { |
|
| 978 | + return new BaseObject(-1,'msg_invalid_request'); |
|
| 979 | + } |
|
| 954 | 980 | $member_srls = explode(',',$member_srl); |
| 955 | 981 | |
| 956 | 982 | $group_srl = Context::get('group_srls'); |
| 957 | - if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl); |
|
| 958 | - else $group_srls = $group_srl; |
|
| 983 | + if(!is_array($group_srl)) { |
|
| 984 | + $group_srls = explode('|@|', $group_srl); |
|
| 985 | + } else { |
|
| 986 | + $group_srls = $group_srl; |
|
| 987 | + } |
|
| 959 | 988 | |
| 960 | 989 | $oDB = &DB::getInstance(); |
| 961 | 990 | $oDB->begin(); |
@@ -974,11 +1003,15 @@ discard block |
||
| 974 | 1003 | for($j=0;$j<$group_count;$j++) |
| 975 | 1004 | { |
| 976 | 1005 | $group_srl = (int)trim($group_srls[$j]); |
| 977 | - if(!$group_srl) continue; |
|
| 1006 | + if(!$group_srl) { |
|
| 1007 | + continue; |
|
| 1008 | + } |
|
| 978 | 1009 | for($i=0;$i<$member_count;$i++) |
| 979 | 1010 | { |
| 980 | 1011 | $member_srl = (int)trim($member_srls[$i]); |
| 981 | - if(!$member_srl) continue; |
|
| 1012 | + if(!$member_srl) { |
|
| 1013 | + continue; |
|
| 1014 | + } |
|
| 982 | 1015 | |
| 983 | 1016 | $args = new stdClass; |
| 984 | 1017 | $args->member_srl = $member_srl; |
@@ -1025,10 +1058,14 @@ discard block |
||
| 1025 | 1058 | foreach($user_ids as $val) |
| 1026 | 1059 | { |
| 1027 | 1060 | $val = trim($val); |
| 1028 | - if(!$val) continue; |
|
| 1061 | + if(!$val) { |
|
| 1062 | + continue; |
|
| 1063 | + } |
|
| 1029 | 1064 | |
| 1030 | 1065 | $output = $this->insertDeniedID($val, ''); |
| 1031 | - if($output->toBool()) $success_ids[] = $val; |
|
| 1066 | + if($output->toBool()) { |
|
| 1067 | + $success_ids[] = $val; |
|
| 1068 | + } |
|
| 1032 | 1069 | } |
| 1033 | 1070 | |
| 1034 | 1071 | $this->add('user_ids', implode(',',$success_ids)); |
@@ -1057,8 +1094,7 @@ discard block |
||
| 1057 | 1094 | } |
| 1058 | 1095 | $msg_code = 'success_deleted'; |
| 1059 | 1096 | $this->setMessage($msg_code); |
| 1060 | - } |
|
| 1061 | - else |
|
| 1097 | + } else |
|
| 1062 | 1098 | { |
| 1063 | 1099 | $nick_names = explode(',',$nick_name); |
| 1064 | 1100 | $success_nick_names = array(); |
@@ -1066,10 +1102,14 @@ discard block |
||
| 1066 | 1102 | foreach($nick_names as $val) |
| 1067 | 1103 | { |
| 1068 | 1104 | $val = trim($val); |
| 1069 | - if(!$val) continue; |
|
| 1105 | + if(!$val) { |
|
| 1106 | + continue; |
|
| 1107 | + } |
|
| 1070 | 1108 | |
| 1071 | 1109 | $output = $this->insertDeniedNickName($val, ''); |
| 1072 | - if($output->toBool()) $success_nick_names[] = $val; |
|
| 1110 | + if($output->toBool()) { |
|
| 1111 | + $success_nick_names[] = $val; |
|
| 1112 | + } |
|
| 1073 | 1113 | } |
| 1074 | 1114 | |
| 1075 | 1115 | $this->add('nick_names', implode(',',$success_nick_names)); |
@@ -1089,7 +1129,9 @@ discard block |
||
| 1089 | 1129 | { |
| 1090 | 1130 | case 'delete' : |
| 1091 | 1131 | $output = $this->deleteDeniedID($user_id); |
| 1092 | - if(!$output->toBool()) return $output; |
|
| 1132 | + if(!$output->toBool()) { |
|
| 1133 | + return $output; |
|
| 1134 | + } |
|
| 1093 | 1135 | $msg_code = 'success_deleted'; |
| 1094 | 1136 | break; |
| 1095 | 1137 | } |
@@ -1141,16 +1183,19 @@ discard block |
||
| 1141 | 1183 | */ |
| 1142 | 1184 | function insertGroup($args) |
| 1143 | 1185 | { |
| 1144 | - if(!$args->site_srl) $args->site_srl = 0; |
|
| 1186 | + if(!$args->site_srl) { |
|
| 1187 | + $args->site_srl = 0; |
|
| 1188 | + } |
|
| 1145 | 1189 | // Check the value of is_default. |
| 1146 | 1190 | if($args->is_default != 'Y') |
| 1147 | 1191 | { |
| 1148 | 1192 | $args->is_default = 'N'; |
| 1149 | - } |
|
| 1150 | - else |
|
| 1193 | + } else |
|
| 1151 | 1194 | { |
| 1152 | 1195 | $output = executeQuery('member.updateGroupDefaultClear', $args); |
| 1153 | - if(!$output->toBool()) return $output; |
|
| 1196 | + if(!$output->toBool()) { |
|
| 1197 | + return $output; |
|
| 1198 | + } |
|
| 1154 | 1199 | } |
| 1155 | 1200 | |
| 1156 | 1201 | if(!isset($args->list_order) || $args->list_order=='') |
@@ -1158,7 +1203,9 @@ discard block |
||
| 1158 | 1203 | $args->list_order = $args->group_srl; |
| 1159 | 1204 | } |
| 1160 | 1205 | |
| 1161 | - if(!$args->group_srl) $args->group_srl = getNextSequence(); |
|
| 1206 | + if(!$args->group_srl) { |
|
| 1207 | + $args->group_srl = getNextSequence(); |
|
| 1208 | + } |
|
| 1162 | 1209 | $args->list_order = $args->group_srl; |
| 1163 | 1210 | $output = executeQuery('member.insertGroup', $args); |
| 1164 | 1211 | $this->_deleteMemberGroupCache($args->site_srl); |
@@ -1173,17 +1220,22 @@ discard block |
||
| 1173 | 1220 | */ |
| 1174 | 1221 | function updateGroup($args) |
| 1175 | 1222 | { |
| 1176 | - if(!$args->site_srl) $args->site_srl = 0; |
|
| 1223 | + if(!$args->site_srl) { |
|
| 1224 | + $args->site_srl = 0; |
|
| 1225 | + } |
|
| 1177 | 1226 | // Check the value of is_default. |
| 1178 | - if(!$args->group_srl) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
| 1227 | + if(!$args->group_srl) { |
|
| 1228 | + return new BaseObject(-1, 'lang->msg_not_founded'); |
|
| 1229 | + } |
|
| 1179 | 1230 | if($args->is_default!='Y') |
| 1180 | 1231 | { |
| 1181 | 1232 | $args->is_default = 'N'; |
| 1182 | - } |
|
| 1183 | - else |
|
| 1233 | + } else |
|
| 1184 | 1234 | { |
| 1185 | 1235 | $output = executeQuery('member.updateGroupDefaultClear', $args); |
| 1186 | - if(!$output->toBool()) return $output; |
|
| 1236 | + if(!$output->toBool()) { |
|
| 1237 | + return $output; |
|
| 1238 | + } |
|
| 1187 | 1239 | } |
| 1188 | 1240 | |
| 1189 | 1241 | $output = executeQuery('member.updateGroup', $args); |
@@ -1206,8 +1258,12 @@ discard block |
||
| 1206 | 1258 | $columnList = array('group_srl', 'is_default'); |
| 1207 | 1259 | $group_info = $oMemberModel->getGroup($group_srl, $columnList); |
| 1208 | 1260 | |
| 1209 | - if(!$group_info) return new BaseObject(-1, 'lang->msg_not_founded'); |
|
| 1210 | - if($group_info->is_default == 'Y') return new BaseObject(-1, 'msg_not_delete_default'); |
|
| 1261 | + if(!$group_info) { |
|
| 1262 | + return new BaseObject(-1, 'lang->msg_not_founded'); |
|
| 1263 | + } |
|
| 1264 | + if($group_info->is_default == 'Y') { |
|
| 1265 | + return new BaseObject(-1, 'msg_not_delete_default'); |
|
| 1266 | + } |
|
| 1211 | 1267 | |
| 1212 | 1268 | // Get groups where is_default == 'Y' |
| 1213 | 1269 | $columnList = array('site_srl', 'group_srl'); |
@@ -1253,13 +1309,14 @@ discard block |
||
| 1253 | 1309 | $update_args->image_mark = $vars->image_marks[$order]; |
| 1254 | 1310 | $update_args->list_order = $order + 1; |
| 1255 | 1311 | |
| 1256 | - if(!$update_args->title) continue; |
|
| 1312 | + if(!$update_args->title) { |
|
| 1313 | + continue; |
|
| 1314 | + } |
|
| 1257 | 1315 | |
| 1258 | 1316 | if(is_numeric($group_srl)) { |
| 1259 | 1317 | $update_args->group_srl = $group_srl; |
| 1260 | 1318 | $output = $this->updateGroup($update_args); |
| 1261 | - } |
|
| 1262 | - else { |
|
| 1319 | + } else { |
|
| 1263 | 1320 | $update_args->group_srl = getNextSequence(); |
| 1264 | 1321 | $output = $this->insertGroup($update_args); |
| 1265 | 1322 | } |
@@ -1349,7 +1406,9 @@ discard block |
||
| 1349 | 1406 | */ |
| 1350 | 1407 | function deleteDeniedID($user_id) |
| 1351 | 1408 | { |
| 1352 | - if(!$user_id) unset($user_id); |
|
| 1409 | + if(!$user_id) { |
|
| 1410 | + unset($user_id); |
|
| 1411 | + } |
|
| 1353 | 1412 | |
| 1354 | 1413 | $args = new stdClass; |
| 1355 | 1414 | $args->user_id = $user_id; |
@@ -1363,7 +1422,9 @@ discard block |
||
| 1363 | 1422 | */ |
| 1364 | 1423 | function deleteDeniedNickName($nick_name) |
| 1365 | 1424 | { |
| 1366 | - if(!$nick_name) unset($nick_name); |
|
| 1425 | + if(!$nick_name) { |
|
| 1426 | + unset($nick_name); |
|
| 1427 | + } |
|
| 1367 | 1428 | |
| 1368 | 1429 | $args = new stdClass; |
| 1369 | 1430 | $args->nick_name = $nick_name; |
@@ -1402,16 +1463,22 @@ discard block |
||
| 1402 | 1463 | // Get a list of all join forms |
| 1403 | 1464 | $join_form_list = $oMemberModel->getJoinFormList(); |
| 1404 | 1465 | $join_form_srl_list = array_keys($join_form_list); |
| 1405 | - if(count($join_form_srl_list)<2) return new BaseObject(); |
|
| 1466 | + if(count($join_form_srl_list)<2) { |
|
| 1467 | + return new BaseObject(); |
|
| 1468 | + } |
|
| 1406 | 1469 | |
| 1407 | 1470 | $prev_member_join_form = NULL; |
| 1408 | 1471 | foreach($join_form_list as $key => $val) |
| 1409 | 1472 | { |
| 1410 | - if($val->member_join_form_srl == $member_join_form_srl) break; |
|
| 1473 | + if($val->member_join_form_srl == $member_join_form_srl) { |
|
| 1474 | + break; |
|
| 1475 | + } |
|
| 1411 | 1476 | $prev_member_join_form = $val; |
| 1412 | 1477 | } |
| 1413 | 1478 | // Return if no previous join form exists |
| 1414 | - if(!$prev_member_join_form) return new BaseObject(); |
|
| 1479 | + if(!$prev_member_join_form) { |
|
| 1480 | + return new BaseObject(); |
|
| 1481 | + } |
|
| 1415 | 1482 | // Information of the join form |
| 1416 | 1483 | $cur_args = new stdClass; |
| 1417 | 1484 | $cur_args->member_join_form_srl = $member_join_form_srl; |
@@ -1422,10 +1489,14 @@ discard block |
||
| 1422 | 1489 | $prev_args->list_order = $list_order; |
| 1423 | 1490 | // Execute Query |
| 1424 | 1491 | $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); |
| 1425 | - if(!$output->toBool()) return $output; |
|
| 1492 | + if(!$output->toBool()) { |
|
| 1493 | + return $output; |
|
| 1494 | + } |
|
| 1426 | 1495 | |
| 1427 | 1496 | executeQuery('member.updateMemberJoinFormListorder', $prev_args); |
| 1428 | - if(!$output->toBool()) return $output; |
|
| 1497 | + if(!$output->toBool()) { |
|
| 1498 | + return $output; |
|
| 1499 | + } |
|
| 1429 | 1500 | |
| 1430 | 1501 | return new BaseObject(); |
| 1431 | 1502 | } |
@@ -1449,16 +1520,22 @@ discard block |
||
| 1449 | 1520 | // Get information of all join forms |
| 1450 | 1521 | $join_form_list = $oMemberModel->getJoinFormList(); |
| 1451 | 1522 | $join_form_srl_list = array_keys($join_form_list); |
| 1452 | - if(count($join_form_srl_list)<2) return new BaseObject(); |
|
| 1523 | + if(count($join_form_srl_list)<2) { |
|
| 1524 | + return new BaseObject(); |
|
| 1525 | + } |
|
| 1453 | 1526 | |
| 1454 | 1527 | for($i=0;$i<count($join_form_srl_list);$i++) |
| 1455 | 1528 | { |
| 1456 | - if($join_form_srl_list[$i]==$member_join_form_srl) break; |
|
| 1529 | + if($join_form_srl_list[$i]==$member_join_form_srl) { |
|
| 1530 | + break; |
|
| 1531 | + } |
|
| 1457 | 1532 | } |
| 1458 | 1533 | |
| 1459 | 1534 | $next_member_join_form_srl = $join_form_srl_list[$i+1]; |
| 1460 | 1535 | // Return if no previous join form exists |
| 1461 | - if(!$next_member_join_form_srl) return new BaseObject(); |
|
| 1536 | + if(!$next_member_join_form_srl) { |
|
| 1537 | + return new BaseObject(); |
|
| 1538 | + } |
|
| 1462 | 1539 | $next_member_join_form = $join_form_list[$next_member_join_form_srl]; |
| 1463 | 1540 | // Information of the join form |
| 1464 | 1541 | $cur_args = new stdClass; |
@@ -1470,10 +1547,14 @@ discard block |
||
| 1470 | 1547 | $next_args->list_order = $list_order; |
| 1471 | 1548 | // Execute Query |
| 1472 | 1549 | $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); |
| 1473 | - if(!$output->toBool()) return $output; |
|
| 1550 | + if(!$output->toBool()) { |
|
| 1551 | + return $output; |
|
| 1552 | + } |
|
| 1474 | 1553 | |
| 1475 | 1554 | $output = executeQuery('member.updateMemberJoinFormListorder', $next_args); |
| 1476 | - if(!$output->toBool()) return $output; |
|
| 1555 | + if(!$output->toBool()) { |
|
| 1556 | + return $output; |
|
| 1557 | + } |
|
| 1477 | 1558 | |
| 1478 | 1559 | return new BaseObject(); |
| 1479 | 1560 | } |
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | function __construct() |
| 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; |
@@ -58,29 +58,29 @@ discard block |
||
| 58 | 58 | // Set the basic information |
| 59 | 59 | $config->enable_join = 'Y'; |
| 60 | 60 | $config->enable_openid = 'N'; |
| 61 | - if(!$config->enable_auth_mail) $config->enable_auth_mail = 'N'; |
|
| 62 | - if(!$config->image_name) $config->image_name = 'Y'; |
|
| 63 | - if(!$config->image_mark) $config->image_mark = 'Y'; |
|
| 64 | - if(!$config->profile_image) $config->profile_image = 'Y'; |
|
| 65 | - if(!$config->image_name_max_width) $config->image_name_max_width = '90'; |
|
| 66 | - if(!$config->image_name_max_height) $config->image_name_max_height = '20'; |
|
| 67 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = '20'; |
|
| 68 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = '20'; |
|
| 69 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = '90'; |
|
| 70 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = '90'; |
|
| 71 | - if($config->group_image_mark!='Y') $config->group_image_mark = 'N'; |
|
| 72 | - if(!$config->password_strength) $config->password_strength = 'normal'; |
|
| 61 | + if (!$config->enable_auth_mail) $config->enable_auth_mail = 'N'; |
|
| 62 | + if (!$config->image_name) $config->image_name = 'Y'; |
|
| 63 | + if (!$config->image_mark) $config->image_mark = 'Y'; |
|
| 64 | + if (!$config->profile_image) $config->profile_image = 'Y'; |
|
| 65 | + if (!$config->image_name_max_width) $config->image_name_max_width = '90'; |
|
| 66 | + if (!$config->image_name_max_height) $config->image_name_max_height = '20'; |
|
| 67 | + if (!$config->image_mark_max_width) $config->image_mark_max_width = '20'; |
|
| 68 | + if (!$config->image_mark_max_height) $config->image_mark_max_height = '20'; |
|
| 69 | + if (!$config->profile_image_max_width) $config->profile_image_max_width = '90'; |
|
| 70 | + if (!$config->profile_image_max_height) $config->profile_image_max_height = '90'; |
|
| 71 | + if ($config->group_image_mark != 'Y') $config->group_image_mark = 'N'; |
|
| 72 | + if (!$config->password_strength) $config->password_strength = 'normal'; |
|
| 73 | 73 | |
| 74 | - if(!$config->password_hashing_algorithm) |
|
| 74 | + if (!$config->password_hashing_algorithm) |
|
| 75 | 75 | { |
| 76 | 76 | $oPassword = new Password(); |
| 77 | 77 | $config->password_hashing_algorithm = $oPassword->getBestAlgorithm(); |
| 78 | 78 | } |
| 79 | - if(!$config->password_hashing_work_factor) |
|
| 79 | + if (!$config->password_hashing_work_factor) |
|
| 80 | 80 | { |
| 81 | 81 | $config->password_hashing_work_factor = 8; |
| 82 | 82 | } |
| 83 | - if(!$config->password_hashing_auto_upgrade) |
|
| 83 | + if (!$config->password_hashing_auto_upgrade) |
|
| 84 | 84 | { |
| 85 | 85 | $config->password_hashing_auto_upgrade = 'Y'; |
| 86 | 86 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $oMemberController = getController('member'); |
| 92 | 92 | $oMemberAdminController = getAdminController('member'); |
| 93 | 93 | |
| 94 | - if(!$config->signupForm || !is_array($config->signupForm)) |
|
| 94 | + if (!$config->signupForm || !is_array($config->signupForm)) |
|
| 95 | 95 | { |
| 96 | 96 | $identifier = $isNotInstall ? 'email_address' : 'user_id'; |
| 97 | 97 | |
@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $oModuleController->insertModuleConfig('member',$config); |
|
| 109 | + $oModuleController->insertModuleConfig('member', $config); |
|
| 110 | 110 | |
| 111 | 111 | $groups = $oMemberModel->getGroups(); |
| 112 | - if(!count($groups)) |
|
| 112 | + if (!count($groups)) |
|
| 113 | 113 | { |
| 114 | 114 | // Set an administrator, regular member(group1), and associate member(group2) |
| 115 | 115 | $group_args = new stdClass; |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | $admin_args = new stdClass; |
| 136 | 136 | $admin_args->is_admin = 'Y'; |
| 137 | 137 | $output = executeQuery('member.getMemberList', $admin_args); |
| 138 | - if(!$output->data) |
|
| 138 | + if (!$output->data) |
|
| 139 | 139 | { |
| 140 | - $admin_info = Context::gets('password','nick_name','email_address', 'user_id'); |
|
| 141 | - if($admin_info->email_address) |
|
| 140 | + $admin_info = Context::gets('password', 'nick_name', 'email_address', 'user_id'); |
|
| 141 | + if ($admin_info->email_address) |
|
| 142 | 142 | { |
| 143 | 143 | $admin_info->user_name = 'admin'; |
| 144 | 144 | // Insert admin information |
@@ -150,16 +150,16 @@ discard block |
||
| 150 | 150 | // Register denied ID(default + module name) |
| 151 | 151 | $oModuleModel = getModel('module'); |
| 152 | 152 | $module_list = $oModuleModel->getModuleList(); |
| 153 | - foreach($module_list as $key => $val) |
|
| 153 | + foreach ($module_list as $key => $val) |
|
| 154 | 154 | { |
| 155 | - $oMemberAdminController->insertDeniedID($val->module,''); |
|
| 155 | + $oMemberAdminController->insertDeniedID($val->module, ''); |
|
| 156 | 156 | } |
| 157 | - $oMemberAdminController->insertDeniedID('www',''); |
|
| 158 | - $oMemberAdminController->insertDeniedID('root',''); |
|
| 159 | - $oMemberAdminController->insertDeniedID('administrator',''); |
|
| 160 | - $oMemberAdminController->insertDeniedID('telnet',''); |
|
| 161 | - $oMemberAdminController->insertDeniedID('ftp',''); |
|
| 162 | - $oMemberAdminController->insertDeniedID('http',''); |
|
| 157 | + $oMemberAdminController->insertDeniedID('www', ''); |
|
| 158 | + $oMemberAdminController->insertDeniedID('root', ''); |
|
| 159 | + $oMemberAdminController->insertDeniedID('administrator', ''); |
|
| 160 | + $oMemberAdminController->insertDeniedID('telnet', ''); |
|
| 161 | + $oMemberAdminController->insertDeniedID('ftp', ''); |
|
| 162 | + $oMemberAdminController->insertDeniedID('http', ''); |
|
| 163 | 163 | // Create cache directory to use in the member module |
| 164 | 164 | FileHandler::makeDir('./files/member_extra_info/image_name'); |
| 165 | 165 | FileHandler::makeDir('./files/member_extra_info/image_mark'); |
@@ -184,76 +184,76 @@ discard block |
||
| 184 | 184 | $oModuleModel = getModel('module'); |
| 185 | 185 | $oModuleController = getController('module'); |
| 186 | 186 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
| 187 | - if($oModuleModel->needUpdate($version_update_id)) |
|
| 187 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
| 188 | 188 | { |
| 189 | 189 | // check member directory (11/08/2007 added) |
| 190 | - if(!is_dir("./files/member_extra_info")) return true; |
|
| 190 | + if (!is_dir("./files/member_extra_info")) return true; |
|
| 191 | 191 | // check member directory (22/10/2007 added) |
| 192 | - if(!is_dir("./files/member_extra_info/profile_image")) return true; |
|
| 192 | + if (!is_dir("./files/member_extra_info/profile_image")) return true; |
|
| 193 | 193 | // Add a column(is_register) to "member_auth_mail" table (22/04/2008) |
| 194 | 194 | $act = $oDB->isColumnExists("member_auth_mail", "is_register"); |
| 195 | - if(!$act) return true; |
|
| 195 | + if (!$act) return true; |
|
| 196 | 196 | // Add a column(site_srl) to "member_group_member" table (11/15/2008) |
| 197 | - if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true; |
|
| 198 | - if(!$oDB->isColumnExists("member_group", "site_srl")) return true; |
|
| 199 | - if($oDB->isIndexExists("member_group","uni_member_group_title")) return true; |
|
| 197 | + if (!$oDB->isColumnExists("member_group_member", "site_srl")) return true; |
|
| 198 | + if (!$oDB->isColumnExists("member_group", "site_srl")) return true; |
|
| 199 | + if ($oDB->isIndexExists("member_group", "uni_member_group_title")) return true; |
|
| 200 | 200 | |
| 201 | 201 | // Add a column for list_order (05/18/2011) |
| 202 | - if(!$oDB->isColumnExists("member_group", "list_order")) return true; |
|
| 202 | + if (!$oDB->isColumnExists("member_group", "list_order")) return true; |
|
| 203 | 203 | |
| 204 | 204 | // image_mark 추가 (2009. 02. 14) |
| 205 | - if(!$oDB->isColumnExists("member_group", "image_mark")) return true; |
|
| 205 | + if (!$oDB->isColumnExists("member_group", "image_mark")) return true; |
|
| 206 | 206 | // Add c column for password expiration date |
| 207 | - if(!$oDB->isColumnExists("member", "change_password_date")) return true; |
|
| 207 | + if (!$oDB->isColumnExists("member", "change_password_date")) return true; |
|
| 208 | 208 | |
| 209 | 209 | // Add columns of question and answer to verify a password |
| 210 | - if(!$oDB->isColumnExists("member", "find_account_question")) return true; |
|
| 211 | - if(!$oDB->isColumnExists("member", "find_account_answer")) return true; |
|
| 210 | + if (!$oDB->isColumnExists("member", "find_account_question")) return true; |
|
| 211 | + if (!$oDB->isColumnExists("member", "find_account_answer")) return true; |
|
| 212 | 212 | |
| 213 | - if(!$oDB->isColumnExists("member", "list_order")) return true; |
|
| 214 | - if(!$oDB->isIndexExists("member","idx_list_order")) return true; |
|
| 213 | + if (!$oDB->isColumnExists("member", "list_order")) return true; |
|
| 214 | + if (!$oDB->isIndexExists("member", "idx_list_order")) return true; |
|
| 215 | 215 | |
| 216 | 216 | $oModuleModel = getModel('module'); |
| 217 | 217 | $config = $oModuleModel->getModuleConfig('member'); |
| 218 | 218 | // check signup form ordering info |
| 219 | - if(!$config->signupForm) return true; |
|
| 219 | + if (!$config->signupForm) return true; |
|
| 220 | 220 | |
| 221 | - foreach($config->signupForm as $form) |
|
| 221 | + foreach ($config->signupForm as $form) |
|
| 222 | 222 | { |
| 223 | - if($form->name === 'email_address' && $form->isPublic !== 'N') |
|
| 223 | + if ($form->name === 'email_address' && $form->isPublic !== 'N') |
|
| 224 | 224 | { |
| 225 | 225 | return true; |
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | // check agreement field exist |
| 230 | - if($config->agreement) return true; |
|
| 230 | + if ($config->agreement) return true; |
|
| 231 | 231 | |
| 232 | - if($config->skin) |
|
| 232 | + if ($config->skin) |
|
| 233 | 233 | { |
| 234 | 234 | $config_parse = explode('.', $config->skin); |
| 235 | - if(count($config_parse) > 1) |
|
| 235 | + if (count($config_parse) > 1) |
|
| 236 | 236 | { |
| 237 | 237 | $template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]); |
| 238 | - if(is_dir($template_path)) return true; |
|
| 238 | + if (is_dir($template_path)) return true; |
|
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | // supprot multilanguage agreement. |
| 243 | - if(is_readable('./files/member_extra_info/agreement.txt')) return true; |
|
| 243 | + if (is_readable('./files/member_extra_info/agreement.txt')) return true; |
|
| 244 | 244 | |
| 245 | 245 | // 2013. 11. 22 add menu when popup document menu called |
| 246 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true; |
|
| 247 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true; |
|
| 246 | + if (!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true; |
|
| 247 | + if (!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true; |
|
| 248 | 248 | |
| 249 | 249 | $oModuleController->insertUpdatedLog($version_update_id); |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | - if(!is_readable('./files/ruleset/insertMember.xml')) return true; |
|
| 253 | - if(!is_readable('./files/ruleset/login.xml')) return true; |
|
| 254 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true; |
|
| 252 | + if (!is_readable('./files/ruleset/insertMember.xml')) return true; |
|
| 253 | + if (!is_readable('./files/ruleset/login.xml')) return true; |
|
| 254 | + if (!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true; |
|
| 255 | 255 | |
| 256 | - if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true; |
|
| 256 | + if ($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true; |
|
| 257 | 257 | |
| 258 | 258 | return false; |
| 259 | 259 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $oMemberAdminController = getAdminController('member'); |
| 272 | 272 | $config = $oModuleModel->getModuleConfig('member'); |
| 273 | 273 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
| 274 | - if($oModuleModel->needUpdate($version_update_id)) |
|
| 274 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
| 275 | 275 | { |
| 276 | 276 | // Check member directory |
| 277 | 277 | FileHandler::makeDir('./files/member_extra_info/image_name'); |
@@ -279,74 +279,74 @@ discard block |
||
| 279 | 279 | FileHandler::makeDir('./files/member_extra_info/signature'); |
| 280 | 280 | FileHandler::makeDir('./files/member_extra_info/profile_image'); |
| 281 | 281 | // Add a column |
| 282 | - if(!$oDB->isColumnExists("member_auth_mail", "is_register")) |
|
| 282 | + if (!$oDB->isColumnExists("member_auth_mail", "is_register")) |
|
| 283 | 283 | { |
| 284 | 284 | $oDB->addColumn("member_auth_mail", "is_register", "char", 1, "N", true); |
| 285 | 285 | } |
| 286 | 286 | // Add a column(site_srl) to "member_group_member" table (11/15/2008) |
| 287 | - if(!$oDB->isColumnExists("member_group_member", "site_srl")) |
|
| 287 | + if (!$oDB->isColumnExists("member_group_member", "site_srl")) |
|
| 288 | 288 | { |
| 289 | 289 | $oDB->addColumn("member_group_member", "site_srl", "number", 11, 0, true); |
| 290 | 290 | $oDB->addIndex("member_group_member", "idx_site_srl", "site_srl", false); |
| 291 | 291 | } |
| 292 | - if(!$oDB->isColumnExists("member_group", "site_srl")) |
|
| 292 | + if (!$oDB->isColumnExists("member_group", "site_srl")) |
|
| 293 | 293 | { |
| 294 | 294 | $oDB->addColumn("member_group", "site_srl", "number", 11, 0, true); |
| 295 | - $oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true); |
|
| 295 | + $oDB->addIndex("member_group", "idx_site_title", array("site_srl", "title"), true); |
|
| 296 | 296 | } |
| 297 | - if($oDB->isIndexExists("member_group","uni_member_group_title")) |
|
| 297 | + if ($oDB->isIndexExists("member_group", "uni_member_group_title")) |
|
| 298 | 298 | { |
| 299 | - $oDB->dropIndex("member_group","uni_member_group_title",true); |
|
| 299 | + $oDB->dropIndex("member_group", "uni_member_group_title", true); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | // Add a column(list_order) to "member_group" table (05/18/2011) |
| 303 | - if(!$oDB->isColumnExists("member_group", "list_order")) |
|
| 303 | + if (!$oDB->isColumnExists("member_group", "list_order")) |
|
| 304 | 304 | { |
| 305 | 305 | $oDB->addColumn("member_group", "list_order", "number", 11, '', true); |
| 306 | - $oDB->addIndex("member_group","idx_list_order", "list_order",false); |
|
| 306 | + $oDB->addIndex("member_group", "idx_list_order", "list_order", false); |
|
| 307 | 307 | $output = executeQuery('member.updateAllMemberGroupListOrder'); |
| 308 | 308 | } |
| 309 | 309 | // Add a column for image_mark (02/14/2009) |
| 310 | - if(!$oDB->isColumnExists("member_group", "image_mark")) |
|
| 310 | + if (!$oDB->isColumnExists("member_group", "image_mark")) |
|
| 311 | 311 | { |
| 312 | 312 | $oDB->addColumn("member_group", "image_mark", "text"); |
| 313 | 313 | } |
| 314 | 314 | // Add a column for password expiration date |
| 315 | - if(!$oDB->isColumnExists("member", "change_password_date")) |
|
| 315 | + if (!$oDB->isColumnExists("member", "change_password_date")) |
|
| 316 | 316 | { |
| 317 | 317 | $oDB->addColumn("member", "change_password_date", "date"); |
| 318 | 318 | executeQuery('member.updateAllChangePasswordDate'); |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | // Add columns of question and answer to verify a password |
| 322 | - if(!$oDB->isColumnExists("member", "find_account_question")) |
|
| 322 | + if (!$oDB->isColumnExists("member", "find_account_question")) |
|
| 323 | 323 | { |
| 324 | 324 | $oDB->addColumn("member", "find_account_question", "number", 11); |
| 325 | 325 | } |
| 326 | - if(!$oDB->isColumnExists("member", "find_account_answer")) |
|
| 326 | + if (!$oDB->isColumnExists("member", "find_account_answer")) |
|
| 327 | 327 | { |
| 328 | 328 | $oDB->addColumn("member", "find_account_answer", "varchar", 250); |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | - if(!$oDB->isColumnExists("member", "list_order")) |
|
| 331 | + if (!$oDB->isColumnExists("member", "list_order")) |
|
| 332 | 332 | { |
| 333 | 333 | $oDB->addColumn("member", "list_order", "number", 11); |
| 334 | 334 | @set_time_limit(0); |
| 335 | 335 | $args->list_order = 'member_srl'; |
| 336 | - executeQuery('member.updateMemberListOrderAll',$args); |
|
| 336 | + executeQuery('member.updateMemberListOrderAll', $args); |
|
| 337 | 337 | executeQuery('member.updateMemberListOrderAll'); |
| 338 | 338 | } |
| 339 | - if(!$oDB->isIndexExists("member","idx_list_order")) |
|
| 339 | + if (!$oDB->isIndexExists("member", "idx_list_order")) |
|
| 340 | 340 | { |
| 341 | - $oDB->addIndex("member","idx_list_order", array("list_order")); |
|
| 341 | + $oDB->addIndex("member", "idx_list_order", array("list_order")); |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | $config = $oModuleModel->getModuleConfig('member'); |
| 345 | 345 | |
| 346 | 346 | // check agreement value exist |
| 347 | - if($config->agreement) |
|
| 347 | + if ($config->agreement) |
|
| 348 | 348 | { |
| 349 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
| 349 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
| 350 | 350 | $output = FileHandler::writeFile($agreement_file, $config->agreement); |
| 351 | 351 | |
| 352 | 352 | $config->agreement = NULL; |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | // check signup form ordering info |
| 357 | - if(!$config->signupForm || !is_array($config->signupForm)) |
|
| 357 | + if (!$config->signupForm || !is_array($config->signupForm)) |
|
| 358 | 358 | { |
| 359 | 359 | $identifier = 'email_address'; |
| 360 | 360 | |
@@ -365,9 +365,9 @@ discard block |
||
| 365 | 365 | |
| 366 | 366 | // 회원정보에서 이메일 노출 제거 |
| 367 | 367 | // @see https://github.com/xpressengine/xe-core/issues/2177 |
| 368 | - foreach($config->signupForm as $form) |
|
| 368 | + foreach ($config->signupForm as $form) |
|
| 369 | 369 | { |
| 370 | - if($form->name === 'email_address') |
|
| 370 | + if ($form->name === 'email_address') |
|
| 371 | 371 | { |
| 372 | 372 | $form->isPublic = 'N'; |
| 373 | 373 | break; |
@@ -375,13 +375,13 @@ discard block |
||
| 375 | 375 | } |
| 376 | 376 | $oModuleController->updateModuleConfig('member', $config); |
| 377 | 377 | |
| 378 | - if($config->skin) |
|
| 378 | + if ($config->skin) |
|
| 379 | 379 | { |
| 380 | 380 | $config_parse = explode('.', $config->skin); |
| 381 | 381 | if (count($config_parse) > 1) |
| 382 | 382 | { |
| 383 | 383 | $template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]); |
| 384 | - if(is_dir($template_path)) |
|
| 384 | + if (is_dir($template_path)) |
|
| 385 | 385 | { |
| 386 | 386 | $config->skin = implode('|@|', $config_parse); |
| 387 | 387 | $oModuleController = getController('module'); |
@@ -391,15 +391,15 @@ discard block |
||
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | // 2013. 11. 22 add menu when popup document menu called |
| 394 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) |
|
| 394 | + if (!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) |
|
| 395 | 395 | $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'); |
| 396 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) |
|
| 396 | + if (!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) |
|
| 397 | 397 | $oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'); |
| 398 | 398 | |
| 399 | - if(is_readable('./files/member_extra_info/agreement.txt')) |
|
| 399 | + if (is_readable('./files/member_extra_info/agreement.txt')) |
|
| 400 | 400 | { |
| 401 | 401 | $source_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
| 402 | - $target_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
| 402 | + $target_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
| 403 | 403 | |
| 404 | 404 | FileHandler::rename($source_file, $target_file); |
| 405 | 405 | } |
@@ -408,14 +408,14 @@ discard block |
||
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | FileHandler::makeDir('./files/ruleset'); |
| 411 | - if(!is_readable('./files/ruleset/insertMember.xml')) |
|
| 411 | + if (!is_readable('./files/ruleset/insertMember.xml')) |
|
| 412 | 412 | $oMemberAdminController->_createSignupRuleset($config->signupForm); |
| 413 | - if(!is_readable('./files/ruleset/login.xml')) |
|
| 413 | + if (!is_readable('./files/ruleset/login.xml')) |
|
| 414 | 414 | $oMemberAdminController->_createLoginRuleset($config->identifier); |
| 415 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) |
|
| 415 | + if (!is_readable('./files/ruleset/find_member_account_by_question.xml')) |
|
| 416 | 416 | $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
| 417 | 417 | |
| 418 | - if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) |
|
| 418 | + if ($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) |
|
| 419 | 419 | { |
| 420 | 420 | $oMemberAdminController->_createSignupRuleset($config->signupForm); |
| 421 | 421 | $oModuleController->insertUpdatedLog('member.1.8.43.recreate_signup_ruleset'); |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | */ |
| 439 | 439 | function recordLoginError($error = 0, $message = 'success') |
| 440 | 440 | { |
| 441 | - if($error == 0) return new BaseObject($error, $message); |
|
| 441 | + if ($error == 0) return new BaseObject($error, $message); |
|
| 442 | 442 | |
| 443 | 443 | // Create a member model object |
| 444 | 444 | $oMemberModel = getModel('member'); |
@@ -446,18 +446,18 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | // Check if there is recoding table. |
| 448 | 448 | $oDB = &DB::getInstance(); |
| 449 | - if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 449 | + if (!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 450 | 450 | |
| 451 | 451 | $args = new stdClass(); |
| 452 | 452 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
| 453 | 453 | |
| 454 | 454 | $output = executeQuery('member.getLoginCountByIp', $args); |
| 455 | - if($output->data && $output->data->count) |
|
| 455 | + if ($output->data && $output->data->count) |
|
| 456 | 456 | { |
| 457 | 457 | $last_update = strtotime($output->data->last_update); |
| 458 | - $term = intval($_SERVER['REQUEST_TIME']-$last_update); |
|
| 458 | + $term = intval($_SERVER['REQUEST_TIME'] - $last_update); |
|
| 459 | 459 | //update, if IP address access in a short time, update count. If not, make count 1. |
| 460 | - if($term < $config->max_error_count_time) |
|
| 460 | + if ($term < $config->max_error_count_time) |
|
| 461 | 461 | { |
| 462 | 462 | $args->count = $output->data->count + 1; |
| 463 | 463 | } |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | */ |
| 484 | 484 | function recordMemberLoginError($error = 0, $message = 'success', $args = NULL) |
| 485 | 485 | { |
| 486 | - if($error == 0 || !$args->member_srl) return new BaseObject($error, $message); |
|
| 486 | + if ($error == 0 || !$args->member_srl) return new BaseObject($error, $message); |
|
| 487 | 487 | |
| 488 | 488 | // Create a member model object |
| 489 | 489 | $oMemberModel = getModel('member'); |
@@ -491,21 +491,21 @@ discard block |
||
| 491 | 491 | |
| 492 | 492 | // Check if there is recoding table. |
| 493 | 493 | $oDB = &DB::getInstance(); |
| 494 | - if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 494 | + if (!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 495 | 495 | |
| 496 | 496 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
| 497 | - if($output->data && $output->data->content) |
|
| 497 | + if ($output->data && $output->data->content) |
|
| 498 | 498 | { |
| 499 | 499 | //update |
| 500 | 500 | $content = unserialize($output->data->content); |
| 501 | - $content[] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |
|
| 501 | + $content[] = array($_SERVER['REMOTE_ADDR'], Context::getLang($message), $_SERVER['REQUEST_TIME']); |
|
| 502 | 502 | $args->content = serialize($content); |
| 503 | 503 | $output = executeQuery('member.updateLoginCountHistoryByMemberSrl', $args); |
| 504 | 504 | } |
| 505 | 505 | else |
| 506 | 506 | { |
| 507 | 507 | //insert |
| 508 | - $content[0] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |
|
| 508 | + $content[0] = array($_SERVER['REMOTE_ADDR'], Context::getLang($message), $_SERVER['REQUEST_TIME']); |
|
| 509 | 509 | $args->content = serialize($content); |
| 510 | 510 | $output = executeQuery('member.insertLoginCountHistoryByMemberSrl', $args); |
| 511 | 511 | } |
@@ -20,7 +20,9 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | function __construct() |
| 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'); |
@@ -58,18 +60,42 @@ discard block |
||
| 58 | 60 | // Set the basic information |
| 59 | 61 | $config->enable_join = 'Y'; |
| 60 | 62 | $config->enable_openid = 'N'; |
| 61 | - if(!$config->enable_auth_mail) $config->enable_auth_mail = 'N'; |
|
| 62 | - if(!$config->image_name) $config->image_name = 'Y'; |
|
| 63 | - if(!$config->image_mark) $config->image_mark = 'Y'; |
|
| 64 | - if(!$config->profile_image) $config->profile_image = 'Y'; |
|
| 65 | - if(!$config->image_name_max_width) $config->image_name_max_width = '90'; |
|
| 66 | - if(!$config->image_name_max_height) $config->image_name_max_height = '20'; |
|
| 67 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = '20'; |
|
| 68 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = '20'; |
|
| 69 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = '90'; |
|
| 70 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = '90'; |
|
| 71 | - if($config->group_image_mark!='Y') $config->group_image_mark = 'N'; |
|
| 72 | - if(!$config->password_strength) $config->password_strength = 'normal'; |
|
| 63 | + if(!$config->enable_auth_mail) { |
|
| 64 | + $config->enable_auth_mail = 'N'; |
|
| 65 | + } |
|
| 66 | + if(!$config->image_name) { |
|
| 67 | + $config->image_name = 'Y'; |
|
| 68 | + } |
|
| 69 | + if(!$config->image_mark) { |
|
| 70 | + $config->image_mark = 'Y'; |
|
| 71 | + } |
|
| 72 | + if(!$config->profile_image) { |
|
| 73 | + $config->profile_image = 'Y'; |
|
| 74 | + } |
|
| 75 | + if(!$config->image_name_max_width) { |
|
| 76 | + $config->image_name_max_width = '90'; |
|
| 77 | + } |
|
| 78 | + if(!$config->image_name_max_height) { |
|
| 79 | + $config->image_name_max_height = '20'; |
|
| 80 | + } |
|
| 81 | + if(!$config->image_mark_max_width) { |
|
| 82 | + $config->image_mark_max_width = '20'; |
|
| 83 | + } |
|
| 84 | + if(!$config->image_mark_max_height) { |
|
| 85 | + $config->image_mark_max_height = '20'; |
|
| 86 | + } |
|
| 87 | + if(!$config->profile_image_max_width) { |
|
| 88 | + $config->profile_image_max_width = '90'; |
|
| 89 | + } |
|
| 90 | + if(!$config->profile_image_max_height) { |
|
| 91 | + $config->profile_image_max_height = '90'; |
|
| 92 | + } |
|
| 93 | + if($config->group_image_mark!='Y') { |
|
| 94 | + $config->group_image_mark = 'N'; |
|
| 95 | + } |
|
| 96 | + if(!$config->password_strength) { |
|
| 97 | + $config->password_strength = 'normal'; |
|
| 98 | + } |
|
| 73 | 99 | |
| 74 | 100 | if(!$config->password_hashing_algorithm) |
| 75 | 101 | { |
@@ -187,36 +213,64 @@ discard block |
||
| 187 | 213 | if($oModuleModel->needUpdate($version_update_id)) |
| 188 | 214 | { |
| 189 | 215 | // check member directory (11/08/2007 added) |
| 190 | - if(!is_dir("./files/member_extra_info")) return true; |
|
| 216 | + if(!is_dir("./files/member_extra_info")) { |
|
| 217 | + return true; |
|
| 218 | + } |
|
| 191 | 219 | // check member directory (22/10/2007 added) |
| 192 | - if(!is_dir("./files/member_extra_info/profile_image")) return true; |
|
| 220 | + if(!is_dir("./files/member_extra_info/profile_image")) { |
|
| 221 | + return true; |
|
| 222 | + } |
|
| 193 | 223 | // Add a column(is_register) to "member_auth_mail" table (22/04/2008) |
| 194 | 224 | $act = $oDB->isColumnExists("member_auth_mail", "is_register"); |
| 195 | - if(!$act) return true; |
|
| 225 | + if(!$act) { |
|
| 226 | + return true; |
|
| 227 | + } |
|
| 196 | 228 | // Add a column(site_srl) to "member_group_member" table (11/15/2008) |
| 197 | - if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true; |
|
| 198 | - if(!$oDB->isColumnExists("member_group", "site_srl")) return true; |
|
| 199 | - if($oDB->isIndexExists("member_group","uni_member_group_title")) return true; |
|
| 229 | + if(!$oDB->isColumnExists("member_group_member", "site_srl")) { |
|
| 230 | + return true; |
|
| 231 | + } |
|
| 232 | + if(!$oDB->isColumnExists("member_group", "site_srl")) { |
|
| 233 | + return true; |
|
| 234 | + } |
|
| 235 | + if($oDB->isIndexExists("member_group","uni_member_group_title")) { |
|
| 236 | + return true; |
|
| 237 | + } |
|
| 200 | 238 | |
| 201 | 239 | // Add a column for list_order (05/18/2011) |
| 202 | - if(!$oDB->isColumnExists("member_group", "list_order")) return true; |
|
| 240 | + if(!$oDB->isColumnExists("member_group", "list_order")) { |
|
| 241 | + return true; |
|
| 242 | + } |
|
| 203 | 243 | |
| 204 | 244 | // image_mark 추가 (2009. 02. 14) |
| 205 | - if(!$oDB->isColumnExists("member_group", "image_mark")) return true; |
|
| 245 | + if(!$oDB->isColumnExists("member_group", "image_mark")) { |
|
| 246 | + return true; |
|
| 247 | + } |
|
| 206 | 248 | // Add c column for password expiration date |
| 207 | - if(!$oDB->isColumnExists("member", "change_password_date")) return true; |
|
| 249 | + if(!$oDB->isColumnExists("member", "change_password_date")) { |
|
| 250 | + return true; |
|
| 251 | + } |
|
| 208 | 252 | |
| 209 | 253 | // Add columns of question and answer to verify a password |
| 210 | - if(!$oDB->isColumnExists("member", "find_account_question")) return true; |
|
| 211 | - if(!$oDB->isColumnExists("member", "find_account_answer")) return true; |
|
| 254 | + if(!$oDB->isColumnExists("member", "find_account_question")) { |
|
| 255 | + return true; |
|
| 256 | + } |
|
| 257 | + if(!$oDB->isColumnExists("member", "find_account_answer")) { |
|
| 258 | + return true; |
|
| 259 | + } |
|
| 212 | 260 | |
| 213 | - if(!$oDB->isColumnExists("member", "list_order")) return true; |
|
| 214 | - if(!$oDB->isIndexExists("member","idx_list_order")) return true; |
|
| 261 | + if(!$oDB->isColumnExists("member", "list_order")) { |
|
| 262 | + return true; |
|
| 263 | + } |
|
| 264 | + if(!$oDB->isIndexExists("member","idx_list_order")) { |
|
| 265 | + return true; |
|
| 266 | + } |
|
| 215 | 267 | |
| 216 | 268 | $oModuleModel = getModel('module'); |
| 217 | 269 | $config = $oModuleModel->getModuleConfig('member'); |
| 218 | 270 | // check signup form ordering info |
| 219 | - if(!$config->signupForm) return true; |
|
| 271 | + if(!$config->signupForm) { |
|
| 272 | + return true; |
|
| 273 | + } |
|
| 220 | 274 | |
| 221 | 275 | foreach($config->signupForm as $form) |
| 222 | 276 | { |
@@ -227,7 +281,9 @@ discard block |
||
| 227 | 281 | } |
| 228 | 282 | |
| 229 | 283 | // check agreement field exist |
| 230 | - if($config->agreement) return true; |
|
| 284 | + if($config->agreement) { |
|
| 285 | + return true; |
|
| 286 | + } |
|
| 231 | 287 | |
| 232 | 288 | if($config->skin) |
| 233 | 289 | { |
@@ -235,25 +291,41 @@ discard block |
||
| 235 | 291 | if(count($config_parse) > 1) |
| 236 | 292 | { |
| 237 | 293 | $template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]); |
| 238 | - if(is_dir($template_path)) return true; |
|
| 294 | + if(is_dir($template_path)) { |
|
| 295 | + return true; |
|
| 296 | + } |
|
| 239 | 297 | } |
| 240 | 298 | } |
| 241 | 299 | |
| 242 | 300 | // supprot multilanguage agreement. |
| 243 | - if(is_readable('./files/member_extra_info/agreement.txt')) return true; |
|
| 301 | + if(is_readable('./files/member_extra_info/agreement.txt')) { |
|
| 302 | + return true; |
|
| 303 | + } |
|
| 244 | 304 | |
| 245 | 305 | // 2013. 11. 22 add menu when popup document menu called |
| 246 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true; |
|
| 247 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true; |
|
| 306 | + if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) { |
|
| 307 | + return true; |
|
| 308 | + } |
|
| 309 | + if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) { |
|
| 310 | + return true; |
|
| 311 | + } |
|
| 248 | 312 | |
| 249 | 313 | $oModuleController->insertUpdatedLog($version_update_id); |
| 250 | 314 | } |
| 251 | 315 | |
| 252 | - if(!is_readable('./files/ruleset/insertMember.xml')) return true; |
|
| 253 | - if(!is_readable('./files/ruleset/login.xml')) return true; |
|
| 254 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true; |
|
| 316 | + if(!is_readable('./files/ruleset/insertMember.xml')) { |
|
| 317 | + return true; |
|
| 318 | + } |
|
| 319 | + if(!is_readable('./files/ruleset/login.xml')) { |
|
| 320 | + return true; |
|
| 321 | + } |
|
| 322 | + if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) { |
|
| 323 | + return true; |
|
| 324 | + } |
|
| 255 | 325 | |
| 256 | - if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true; |
|
| 326 | + if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) { |
|
| 327 | + return true; |
|
| 328 | + } |
|
| 257 | 329 | |
| 258 | 330 | return false; |
| 259 | 331 | } |
@@ -391,10 +463,12 @@ discard block |
||
| 391 | 463 | } |
| 392 | 464 | |
| 393 | 465 | // 2013. 11. 22 add menu when popup document menu called |
| 394 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) |
|
| 395 | - $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'); |
|
| 396 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) |
|
| 397 | - $oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'); |
|
| 466 | + if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) { |
|
| 467 | + $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'); |
|
| 468 | + } |
|
| 469 | + if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) { |
|
| 470 | + $oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'); |
|
| 471 | + } |
|
| 398 | 472 | |
| 399 | 473 | if(is_readable('./files/member_extra_info/agreement.txt')) |
| 400 | 474 | { |
@@ -408,12 +482,15 @@ discard block |
||
| 408 | 482 | } |
| 409 | 483 | |
| 410 | 484 | FileHandler::makeDir('./files/ruleset'); |
| 411 | - if(!is_readable('./files/ruleset/insertMember.xml')) |
|
| 412 | - $oMemberAdminController->_createSignupRuleset($config->signupForm); |
|
| 413 | - if(!is_readable('./files/ruleset/login.xml')) |
|
| 414 | - $oMemberAdminController->_createLoginRuleset($config->identifier); |
|
| 415 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) |
|
| 416 | - $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
|
| 485 | + if(!is_readable('./files/ruleset/insertMember.xml')) { |
|
| 486 | + $oMemberAdminController->_createSignupRuleset($config->signupForm); |
|
| 487 | + } |
|
| 488 | + if(!is_readable('./files/ruleset/login.xml')) { |
|
| 489 | + $oMemberAdminController->_createLoginRuleset($config->identifier); |
|
| 490 | + } |
|
| 491 | + if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) { |
|
| 492 | + $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
|
| 493 | + } |
|
| 417 | 494 | |
| 418 | 495 | if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) |
| 419 | 496 | { |
@@ -438,7 +515,9 @@ discard block |
||
| 438 | 515 | */ |
| 439 | 516 | function recordLoginError($error = 0, $message = 'success') |
| 440 | 517 | { |
| 441 | - if($error == 0) return new BaseObject($error, $message); |
|
| 518 | + if($error == 0) { |
|
| 519 | + return new BaseObject($error, $message); |
|
| 520 | + } |
|
| 442 | 521 | |
| 443 | 522 | // Create a member model object |
| 444 | 523 | $oMemberModel = getModel('member'); |
@@ -446,7 +525,9 @@ discard block |
||
| 446 | 525 | |
| 447 | 526 | // Check if there is recoding table. |
| 448 | 527 | $oDB = &DB::getInstance(); |
| 449 | - if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 528 | + if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') { |
|
| 529 | + return new BaseObject($error, $message); |
|
| 530 | + } |
|
| 450 | 531 | |
| 451 | 532 | $args = new stdClass(); |
| 452 | 533 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
@@ -460,16 +541,14 @@ discard block |
||
| 460 | 541 | if($term < $config->max_error_count_time) |
| 461 | 542 | { |
| 462 | 543 | $args->count = $output->data->count + 1; |
| 463 | - } |
|
| 464 | - else |
|
| 544 | + } else |
|
| 465 | 545 | { |
| 466 | 546 | $args->count = 1; |
| 467 | 547 | } |
| 468 | 548 | unset($oMemberModel); |
| 469 | 549 | unset($config); |
| 470 | 550 | $output = executeQuery('member.updateLoginCountByIp', $args); |
| 471 | - } |
|
| 472 | - else |
|
| 551 | + } else |
|
| 473 | 552 | { |
| 474 | 553 | //insert |
| 475 | 554 | $args->count = 1; |
@@ -483,7 +562,9 @@ discard block |
||
| 483 | 562 | */ |
| 484 | 563 | function recordMemberLoginError($error = 0, $message = 'success', $args = NULL) |
| 485 | 564 | { |
| 486 | - if($error == 0 || !$args->member_srl) return new BaseObject($error, $message); |
|
| 565 | + if($error == 0 || !$args->member_srl) { |
|
| 566 | + return new BaseObject($error, $message); |
|
| 567 | + } |
|
| 487 | 568 | |
| 488 | 569 | // Create a member model object |
| 489 | 570 | $oMemberModel = getModel('member'); |
@@ -491,7 +572,9 @@ discard block |
||
| 491 | 572 | |
| 492 | 573 | // Check if there is recoding table. |
| 493 | 574 | $oDB = &DB::getInstance(); |
| 494 | - if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message); |
|
| 575 | + if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') { |
|
| 576 | + return new BaseObject($error, $message); |
|
| 577 | + } |
|
| 495 | 578 | |
| 496 | 579 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
| 497 | 580 | if($output->data && $output->data->content) |
@@ -501,8 +584,7 @@ discard block |
||
| 501 | 584 | $content[] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |
| 502 | 585 | $args->content = serialize($content); |
| 503 | 586 | $output = executeQuery('member.updateLoginCountHistoryByMemberSrl', $args); |
| 504 | - } |
|
| 505 | - else |
|
| 587 | + } else |
|
| 506 | 588 | { |
| 507 | 589 | //insert |
| 508 | 590 | $content[0] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |
@@ -51,12 +51,12 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | function setExtraVarKeys($extra_keys) |
| 53 | 53 | { |
| 54 | - if(!is_array($extra_keys) || count($extra_keys) < 1) |
|
| 54 | + if (!is_array($extra_keys) || count($extra_keys) < 1) |
|
| 55 | 55 | { |
| 56 | 56 | return; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - foreach($extra_keys as $val) |
|
| 59 | + foreach ($extra_keys as $val) |
|
| 60 | 60 | { |
| 61 | 61 | $obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value, $val->eid); |
| 62 | 62 | $this->keys[$val->idx] = $obj; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | function __construct($module_srl, $idx, $name, $type = 'text', $default = null, $desc = '', $is_required = 'N', $search = 'N', $value = null, $eid = '') |
| 161 | 161 | { |
| 162 | - if(!$idx) |
|
| 162 | + if (!$idx) |
|
| 163 | 163 | { |
| 164 | 164 | return; |
| 165 | 165 | } |
@@ -197,36 +197,36 @@ discard block |
||
| 197 | 197 | function _getTypeValue($type, $value) |
| 198 | 198 | { |
| 199 | 199 | $value = trim($value); |
| 200 | - if(!isset($value)) |
|
| 200 | + if (!isset($value)) |
|
| 201 | 201 | { |
| 202 | 202 | return; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - switch($type) |
|
| 205 | + switch ($type) |
|
| 206 | 206 | { |
| 207 | 207 | case 'homepage' : |
| 208 | - if($value && !preg_match('/^([a-z]+):\/\//i', $value)) |
|
| 208 | + if ($value && !preg_match('/^([a-z]+):\/\//i', $value)) |
|
| 209 | 209 | { |
| 210 | - $value = 'http://' . $value; |
|
| 210 | + $value = 'http://'.$value; |
|
| 211 | 211 | } |
| 212 | 212 | return htmlspecialchars($value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 213 | 213 | |
| 214 | 214 | case 'tel' : |
| 215 | - if(is_array($value)) |
|
| 215 | + if (is_array($value)) |
|
| 216 | 216 | { |
| 217 | 217 | $values = $value; |
| 218 | 218 | } |
| 219 | - elseif(strpos($value, '|@|') !== FALSE) |
|
| 219 | + elseif (strpos($value, '|@|') !== FALSE) |
|
| 220 | 220 | { |
| 221 | 221 | $values = explode('|@|', $value); |
| 222 | 222 | } |
| 223 | - elseif(strpos($value, ',') !== FALSE) |
|
| 223 | + elseif (strpos($value, ',') !== FALSE) |
|
| 224 | 224 | { |
| 225 | 225 | $values = explode(',', $value); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | $values = array_values($values); |
| 229 | - for($i = 0, $c = count($values); $i < $c; $i++) |
|
| 229 | + for ($i = 0, $c = count($values); $i < $c; $i++) |
|
| 230 | 230 | { |
| 231 | 231 | $values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
| 232 | 232 | } |
@@ -235,15 +235,15 @@ discard block |
||
| 235 | 235 | case 'checkbox' : |
| 236 | 236 | case 'radio' : |
| 237 | 237 | case 'select' : |
| 238 | - if(is_array($value)) |
|
| 238 | + if (is_array($value)) |
|
| 239 | 239 | { |
| 240 | 240 | $values = $value; |
| 241 | 241 | } |
| 242 | - elseif(strpos($value, '|@|') !== FALSE) |
|
| 242 | + elseif (strpos($value, '|@|') !== FALSE) |
|
| 243 | 243 | { |
| 244 | 244 | $values = explode('|@|', $value); |
| 245 | 245 | } |
| 246 | - elseif(strpos($value, ',') !== FALSE) |
|
| 246 | + elseif (strpos($value, ',') !== FALSE) |
|
| 247 | 247 | { |
| 248 | 248 | $values = explode(',', $value); |
| 249 | 249 | } |
@@ -253,18 +253,18 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | $values = array_values($values); |
| 256 | - for($i = 0, $c = count($values); $i < $c; $i++) |
|
| 256 | + for ($i = 0, $c = count($values); $i < $c; $i++) |
|
| 257 | 257 | { |
| 258 | 258 | $values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
| 259 | 259 | } |
| 260 | 260 | return $values; |
| 261 | 261 | |
| 262 | 262 | case 'kr_zip' : |
| 263 | - if(is_array($value)) |
|
| 263 | + if (is_array($value)) |
|
| 264 | 264 | { |
| 265 | 265 | $values = $value; |
| 266 | 266 | } |
| 267 | - elseif(strpos($value, '|@|') !== false) |
|
| 267 | + elseif (strpos($value, '|@|') !== false) |
|
| 268 | 268 | { |
| 269 | 269 | $values = explode('|@|', $value); |
| 270 | 270 | } |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | $values = array_values($values); |
| 277 | - for($i = 0, $c = count($values); $i < $c; $i++) |
|
| 277 | + for ($i = 0, $c = count($values); $i < $c; $i++) |
|
| 278 | 278 | { |
| 279 | 279 | $values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
| 280 | 280 | } |
@@ -308,10 +308,10 @@ discard block |
||
| 308 | 308 | { |
| 309 | 309 | $value = $this->_getTypeValue($this->type, $this->value); |
| 310 | 310 | |
| 311 | - switch($this->type) |
|
| 311 | + switch ($this->type) |
|
| 312 | 312 | { |
| 313 | 313 | case 'homepage' : |
| 314 | - return ($value) ? (sprintf('<a href="%s" target="_blank">%s</a>', $value, strlen($value) > 60 ? substr($value, 0, 40) . '...' . substr($value, -10) : $value)) : ""; |
|
| 314 | + return ($value) ? (sprintf('<a href="%s" target="_blank">%s</a>', $value, strlen($value) > 60 ? substr($value, 0, 40).'...'.substr($value, -10) : $value)) : ""; |
|
| 315 | 315 | |
| 316 | 316 | case 'email_address' : |
| 317 | 317 | return ($value) ? sprintf('<a href="mailto:%s">%s</a>', $value, $value) : ""; |
@@ -328,14 +328,14 @@ discard block |
||
| 328 | 328 | case 'checkbox' : |
| 329 | 329 | case 'select' : |
| 330 | 330 | case 'radio' : |
| 331 | - if(is_array($value)) |
|
| 331 | + if (is_array($value)) |
|
| 332 | 332 | { |
| 333 | 333 | return implode(',', $value); |
| 334 | 334 | } |
| 335 | 335 | return $value; |
| 336 | 336 | |
| 337 | 337 | case 'kr_zip' : |
| 338 | - if(is_array($value)) |
|
| 338 | + if (is_array($value)) |
|
| 339 | 339 | { |
| 340 | 340 | return implode(' ', $value); |
| 341 | 341 | } |
@@ -360,77 +360,77 @@ discard block |
||
| 360 | 360 | $name = $this->name; |
| 361 | 361 | $value = $this->_getTypeValue($this->type, $this->value); |
| 362 | 362 | $default = $this->_getTypeValue($this->type, $this->default); |
| 363 | - $column_name = 'extra_vars' . $this->idx; |
|
| 364 | - $tmp_id = $column_name . '-' . $id_num++; |
|
| 363 | + $column_name = 'extra_vars'.$this->idx; |
|
| 364 | + $tmp_id = $column_name.'-'.$id_num++; |
|
| 365 | 365 | |
| 366 | 366 | $buff = array(); |
| 367 | - switch($type) |
|
| 367 | + switch ($type) |
|
| 368 | 368 | { |
| 369 | 369 | // Homepage |
| 370 | 370 | case 'homepage' : |
| 371 | - $buff[] = '<input type="text" name="' . $column_name . '" value="' . $value . '" class="homepage" />'; |
|
| 371 | + $buff[] = '<input type="text" name="'.$column_name.'" value="'.$value.'" class="homepage" />'; |
|
| 372 | 372 | break; |
| 373 | 373 | // Email Address |
| 374 | 374 | case 'email_address' : |
| 375 | - $buff[] = '<input type="text" name="' . $column_name . '" value="' . $value . '" class="email_address" />'; |
|
| 375 | + $buff[] = '<input type="text" name="'.$column_name.'" value="'.$value.'" class="email_address" />'; |
|
| 376 | 376 | break; |
| 377 | 377 | // Phone Number |
| 378 | 378 | case 'tel' : |
| 379 | - $buff[] = '<input type="text" name="' . $column_name . '[]" value="' . $value[0] . '" size="4" maxlength="4" class="tel" />'; |
|
| 380 | - $buff[] = '<input type="text" name="' . $column_name . '[]" value="' . $value[1] . '" size="4" maxlength="4" class="tel" />'; |
|
| 381 | - $buff[] = '<input type="text" name="' . $column_name . '[]" value="' . $value[2] . '" size="4" maxlength="4" class="tel" />'; |
|
| 379 | + $buff[] = '<input type="text" name="'.$column_name.'[]" value="'.$value[0].'" size="4" maxlength="4" class="tel" />'; |
|
| 380 | + $buff[] = '<input type="text" name="'.$column_name.'[]" value="'.$value[1].'" size="4" maxlength="4" class="tel" />'; |
|
| 381 | + $buff[] = '<input type="text" name="'.$column_name.'[]" value="'.$value[2].'" size="4" maxlength="4" class="tel" />'; |
|
| 382 | 382 | break; |
| 383 | 383 | // textarea |
| 384 | 384 | case 'textarea' : |
| 385 | - $buff[] = '<textarea name="' . $column_name . '" rows="8" cols="42">' . $value . '</textarea>'; |
|
| 385 | + $buff[] = '<textarea name="'.$column_name.'" rows="8" cols="42">'.$value.'</textarea>'; |
|
| 386 | 386 | break; |
| 387 | 387 | // multiple choice |
| 388 | 388 | case 'checkbox' : |
| 389 | 389 | $buff[] = '<ul>'; |
| 390 | - foreach($default as $v) |
|
| 390 | + foreach ($default as $v) |
|
| 391 | 391 | { |
| 392 | 392 | $checked = ''; |
| 393 | - if($value && in_array(trim($v), $value)) |
|
| 393 | + if ($value && in_array(trim($v), $value)) |
|
| 394 | 394 | { |
| 395 | 395 | $checked = ' checked="checked"'; |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | // Temporary ID for labeling |
| 399 | - $tmp_id = $column_name . '-' . $id_num++; |
|
| 399 | + $tmp_id = $column_name.'-'.$id_num++; |
|
| 400 | 400 | |
| 401 | - $buff[] =' <li><input type="checkbox" name="' . $column_name . '[]" id="' . $tmp_id . '" value="' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '" ' . $checked . ' /><label for="' . $tmp_id . '">' . $v . '</label></li>'; |
|
| 401 | + $buff[] = ' <li><input type="checkbox" name="'.$column_name.'[]" id="'.$tmp_id.'" value="'.htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false).'" '.$checked.' /><label for="'.$tmp_id.'">'.$v.'</label></li>'; |
|
| 402 | 402 | } |
| 403 | 403 | $buff[] = '</ul>'; |
| 404 | 404 | break; |
| 405 | 405 | // single choice |
| 406 | 406 | case 'select' : |
| 407 | - $buff[] = '<select name="' . $column_name . '" class="select">'; |
|
| 408 | - foreach($default as $v) |
|
| 407 | + $buff[] = '<select name="'.$column_name.'" class="select">'; |
|
| 408 | + foreach ($default as $v) |
|
| 409 | 409 | { |
| 410 | 410 | $selected = ''; |
| 411 | - if($value && in_array(trim($v), $value)) |
|
| 411 | + if ($value && in_array(trim($v), $value)) |
|
| 412 | 412 | { |
| 413 | 413 | $selected = ' selected="selected"'; |
| 414 | 414 | } |
| 415 | - $buff[] = ' <option value="' . $v . '" ' . $selected . '>' . $v . '</option>'; |
|
| 415 | + $buff[] = ' <option value="'.$v.'" '.$selected.'>'.$v.'</option>'; |
|
| 416 | 416 | } |
| 417 | 417 | $buff[] = '</select>'; |
| 418 | 418 | break; |
| 419 | 419 | // radio |
| 420 | 420 | case 'radio' : |
| 421 | 421 | $buff[] = '<ul>'; |
| 422 | - foreach($default as $v) |
|
| 422 | + foreach ($default as $v) |
|
| 423 | 423 | { |
| 424 | 424 | $checked = ''; |
| 425 | - if($value && in_array(trim($v), $value)) |
|
| 425 | + if ($value && in_array(trim($v), $value)) |
|
| 426 | 426 | { |
| 427 | 427 | $checked = ' checked="checked"'; |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | // Temporary ID for labeling |
| 431 | - $tmp_id = $column_name . '-' . $id_num++; |
|
| 431 | + $tmp_id = $column_name.'-'.$id_num++; |
|
| 432 | 432 | |
| 433 | - $buff[] = '<li><input type="radio" name="' . $column_name . '" id="' . $tmp_id . '" ' . $checked . ' value="' . $v . '" class="radio" /><label for="' . $tmp_id . '">' . $v . '</label></li>'; |
|
| 433 | + $buff[] = '<li><input type="radio" name="'.$column_name.'" id="'.$tmp_id.'" '.$checked.' value="'.$v.'" class="radio" /><label for="'.$tmp_id.'">'.$v.'</label></li>'; |
|
| 434 | 434 | } |
| 435 | 435 | $buff[] = '</ul>'; |
| 436 | 436 | break; |
@@ -439,44 +439,44 @@ discard block |
||
| 439 | 439 | // datepicker javascript plugin load |
| 440 | 440 | Context::loadJavascriptPlugin('ui.datepicker'); |
| 441 | 441 | |
| 442 | - $buff[] = '<input type="hidden" name="' . $column_name . '" value="' . $value . '" />'; |
|
| 443 | - $buff[] = '<input type="text" id="date_' . $column_name . '" value="' . zdate($value, 'Y-m-d') . '" class="date" />'; |
|
| 444 | - $buff[] = '<input type="button" value="' . Context::getLang('cmd_delete') . '" class="btn" id="dateRemover_' . $column_name . '" />'; |
|
| 445 | - $buff[] = '<script type="text/javascript">'; |
|
| 442 | + $buff[] = '<input type="hidden" name="'.$column_name.'" value="'.$value.'" />'; |
|
| 443 | + $buff[] = '<input type="text" id="date_'.$column_name.'" value="'.zdate($value, 'Y-m-d').'" class="date" />'; |
|
| 444 | + $buff[] = '<input type="button" value="'.Context::getLang('cmd_delete').'" class="btn" id="dateRemover_'.$column_name.'" />'; |
|
| 445 | + $buff[] = '<script type="text/javascript">'; |
|
| 446 | 446 | $buff[] = '//<![CDATA['; |
| 447 | - $buff[] = '(function($){'; |
|
| 448 | - $buff[] = '$(function(){'; |
|
| 449 | - $buff[] = ' var option = { dateFormat: "yy-mm-dd", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\'-100:+10\', onSelect:function(){'; |
|
| 450 | - $buff[] = ' $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}'; |
|
| 451 | - $buff[] = ' };'; |
|
| 452 | - $buff[] = ' $.extend(option,$.datepicker.regional[\'' . Context::getLangType() . '\']);'; |
|
| 453 | - $buff[] = ' $("#date_' . $column_name . '").datepicker(option);'; |
|
| 454 | - $buff[] = ' $("#date_' . $column_name . '").datepicker("option", "dateFormat", "yy-mm-dd");'; |
|
| 455 | - $buff[] = ' $("#dateRemover_' . $column_name . '").click(function(){'; |
|
| 456 | - $buff[] = ' $(this).siblings("input").val("");'; |
|
| 457 | - $buff[] = ' return false;'; |
|
| 458 | - $buff[] = ' })'; |
|
| 459 | - $buff[] = '});'; |
|
| 460 | - $buff[] = '})(jQuery);'; |
|
| 447 | + $buff[] = '(function($){'; |
|
| 448 | + $buff[] = '$(function(){'; |
|
| 449 | + $buff[] = ' var option = { dateFormat: "yy-mm-dd", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\'-100:+10\', onSelect:function(){'; |
|
| 450 | + $buff[] = ' $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}'; |
|
| 451 | + $buff[] = ' };'; |
|
| 452 | + $buff[] = ' $.extend(option,$.datepicker.regional[\''.Context::getLangType().'\']);'; |
|
| 453 | + $buff[] = ' $("#date_'.$column_name.'").datepicker(option);'; |
|
| 454 | + $buff[] = ' $("#date_'.$column_name.'").datepicker("option", "dateFormat", "yy-mm-dd");'; |
|
| 455 | + $buff[] = ' $("#dateRemover_'.$column_name.'").click(function(){'; |
|
| 456 | + $buff[] = ' $(this).siblings("input").val("");'; |
|
| 457 | + $buff[] = ' return false;'; |
|
| 458 | + $buff[] = ' })'; |
|
| 459 | + $buff[] = '});'; |
|
| 460 | + $buff[] = '})(jQuery);'; |
|
| 461 | 461 | $buff[] = '//]]>'; |
| 462 | 462 | $buff[] = '</script>'; |
| 463 | 463 | break; |
| 464 | 464 | // address |
| 465 | 465 | case "kr_zip" : |
| 466 | - if(($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel , 'getKrzipCodeSearchHtml' )) |
|
| 466 | + if (($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel, 'getKrzipCodeSearchHtml')) |
|
| 467 | 467 | { |
| 468 | - $buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value); |
|
| 468 | + $buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value); |
|
| 469 | 469 | } |
| 470 | 470 | break; |
| 471 | 471 | // General text |
| 472 | 472 | default : |
| 473 | - $buff[] =' <input type="text" name="' . $column_name . '" value="' . ($value ? $value : $default) . '" class="text" />'; |
|
| 473 | + $buff[] = ' <input type="text" name="'.$column_name.'" value="'.($value ? $value : $default).'" class="text" />'; |
|
| 474 | 474 | } |
| 475 | - if($this->desc) |
|
| 475 | + if ($this->desc) |
|
| 476 | 476 | { |
| 477 | 477 | $oModuleController = getController('module'); |
| 478 | 478 | $oModuleController->replaceDefinedLangCode($this->desc); |
| 479 | - $buff[] = '<p>' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '</p>'; |
|
| 479 | + $buff[] = '<p>'.htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false).'</p>'; |
|
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | return join(PHP_EOL, $buff); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | function __construct($auto_connect = TRUE) |
| 24 | 24 | { |
| 25 | 25 | $this->_setDBInfo(); |
| 26 | - if($auto_connect) $this->_connect(); |
|
| 26 | + if ($auto_connect) $this->_connect(); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | function __connect($connection) |
| 45 | 45 | { |
| 46 | 46 | // Attempt to connect |
| 47 | - if($connection["db_port"]) |
|
| 47 | + if ($connection["db_port"]) |
|
| 48 | 48 | { |
| 49 | 49 | $result = @mysqli_connect($connection["db_hostname"] |
| 50 | 50 | , $connection["db_userid"] |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | , $connection["db_database"]); |
| 61 | 61 | } |
| 62 | 62 | $error = mysqli_connect_errno(); |
| 63 | - if($error) |
|
| 63 | + if ($error) |
|
| 64 | 64 | { |
| 65 | 65 | $this->setError($error, mysqli_connect_error()); |
| 66 | 66 | return; |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $connection = $this->_getConnection('master'); |
| 91 | 91 | |
| 92 | - if(!$transactionLevel) |
|
| 92 | + if (!$transactionLevel) |
|
| 93 | 93 | { |
| 94 | 94 | $this->_query("begin"); |
| 95 | 95 | } |
| 96 | 96 | else |
| 97 | 97 | { |
| 98 | - $this->_query("SAVEPOINT SP" . $transactionLevel, $connection); |
|
| 98 | + $this->_query("SAVEPOINT SP".$transactionLevel, $connection); |
|
| 99 | 99 | } |
| 100 | 100 | return true; |
| 101 | 101 | } |
@@ -111,14 +111,14 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | $point = $transactionLevel - 1; |
| 113 | 113 | |
| 114 | - if($point) |
|
| 114 | + if ($point) |
|
| 115 | 115 | { |
| 116 | - $this->_query("ROLLBACK TO SP" . $point, $connection); |
|
| 116 | + $this->_query("ROLLBACK TO SP".$point, $connection); |
|
| 117 | 117 | } |
| 118 | 118 | else |
| 119 | 119 | { |
| 120 | 120 | mysqli_rollback($connection); |
| 121 | - $this->setQueryLog( array("query"=>"rollback") ); |
|
| 121 | + $this->setQueryLog(array("query"=>"rollback")); |
|
| 122 | 122 | } |
| 123 | 123 | return true; |
| 124 | 124 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | { |
| 133 | 133 | $connection = $this->_getConnection('master'); |
| 134 | 134 | mysqli_commit($connection); |
| 135 | - $this->setQueryLog( array("query"=>"commit") ); |
|
| 135 | + $this->setQueryLog(array("query"=>"commit")); |
|
| 136 | 136 | return true; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -145,11 +145,11 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | function addQuotes($string) |
| 147 | 147 | { |
| 148 | - if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
| 148 | + if (version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
| 149 | 149 | { |
| 150 | 150 | $string = stripslashes(str_replace("\\", "\\\\", $string)); |
| 151 | 151 | } |
| 152 | - if(!is_numeric($string)) |
|
| 152 | + if (!is_numeric($string)) |
|
| 153 | 153 | { |
| 154 | 154 | $connection = $this->_getConnection('master'); |
| 155 | 155 | $string = mysqli_escape_string($connection, $string); |
@@ -166,23 +166,23 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | function __query($query, $connection) |
| 168 | 168 | { |
| 169 | - if($this->use_prepared_statements == 'Y') |
|
| 169 | + if ($this->use_prepared_statements == 'Y') |
|
| 170 | 170 | { |
| 171 | 171 | // 1. Prepare query |
| 172 | 172 | $stmt = mysqli_prepare($connection, $query); |
| 173 | - if($stmt) |
|
| 173 | + if ($stmt) |
|
| 174 | 174 | { |
| 175 | 175 | $types = ''; |
| 176 | 176 | $params = array(); |
| 177 | 177 | $this->_prepareQueryParameters($types, $params); |
| 178 | 178 | |
| 179 | - if(!empty($params)) |
|
| 179 | + if (!empty($params)) |
|
| 180 | 180 | { |
| 181 | 181 | $args[0] = $stmt; |
| 182 | 182 | $args[1] = $types; |
| 183 | 183 | |
| 184 | 184 | $i = 2; |
| 185 | - foreach($params as $key => $param) |
|
| 185 | + foreach ($params as $key => $param) |
|
| 186 | 186 | { |
| 187 | 187 | $copy[$key] = $param; |
| 188 | 188 | $args[$i++] = &$copy[$key]; |
@@ -190,18 +190,18 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | // 2. Bind parameters |
| 192 | 192 | $status = call_user_func_array('mysqli_stmt_bind_param', $args); |
| 193 | - if(!$status) |
|
| 193 | + if (!$status) |
|
| 194 | 194 | { |
| 195 | - $this->setError(-1, "Invalid arguments: $query" . mysqli_error($connection)); |
|
| 195 | + $this->setError(-1, "Invalid arguments: $query".mysqli_error($connection)); |
|
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | // 3. Execute query |
| 200 | 200 | $status = mysqli_stmt_execute($stmt); |
| 201 | 201 | |
| 202 | - if(!$status) |
|
| 202 | + if (!$status) |
|
| 203 | 203 | { |
| 204 | - $this->setError(-1, "Prepared statement failed: $query" . mysqli_error($connection)); |
|
| 204 | + $this->setError(-1, "Prepared statement failed: $query".mysqli_error($connection)); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | // Return stmt for other processing - like retrieving resultset (_fetch) |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $result = mysqli_query($connection, $query); |
| 214 | 214 | // Error Check |
| 215 | 215 | $error = mysqli_error($connection); |
| 216 | - if($error) |
|
| 216 | + if ($error) |
|
| 217 | 217 | { |
| 218 | 218 | $this->setError(mysqli_errno($connection), $error); |
| 219 | 219 | } |
@@ -232,23 +232,23 @@ discard block |
||
| 232 | 232 | { |
| 233 | 233 | $types = ''; |
| 234 | 234 | $params = array(); |
| 235 | - if(!$this->param) |
|
| 235 | + if (!$this->param) |
|
| 236 | 236 | { |
| 237 | 237 | return; |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | - foreach($this->param as $k => $o) |
|
| 240 | + foreach ($this->param as $k => $o) |
|
| 241 | 241 | { |
| 242 | 242 | $value = $o->getUnescapedValue(); |
| 243 | 243 | $type = $o->getType(); |
| 244 | 244 | |
| 245 | 245 | // Skip column names -> this should be concatenated to query string |
| 246 | - if($o->isColumnName()) |
|
| 246 | + if ($o->isColumnName()) |
|
| 247 | 247 | { |
| 248 | 248 | continue; |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - switch($type) |
|
| 251 | + switch ($type) |
|
| 252 | 252 | { |
| 253 | 253 | case 'number' : |
| 254 | 254 | $type = 'i'; |
@@ -260,9 +260,9 @@ discard block |
||
| 260 | 260 | $type = 's'; |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | - if(is_array($value)) |
|
| 263 | + if (is_array($value)) |
|
| 264 | 264 | { |
| 265 | - foreach($value as $v) |
|
| 265 | + foreach ($value as $v) |
|
| 266 | 266 | { |
| 267 | 267 | $params[] = $v; |
| 268 | 268 | $types .= $type; |
@@ -284,12 +284,12 @@ discard block |
||
| 284 | 284 | */ |
| 285 | 285 | function _fetch($result, $arrayIndexEndValue = NULL) |
| 286 | 286 | { |
| 287 | - if($this->use_prepared_statements != 'Y') |
|
| 287 | + if ($this->use_prepared_statements != 'Y') |
|
| 288 | 288 | { |
| 289 | 289 | return parent::_fetch($result, $arrayIndexEndValue); |
| 290 | 290 | } |
| 291 | 291 | $output = array(); |
| 292 | - if(!$this->isConnected() || $this->isError() || !$result) |
|
| 292 | + if (!$this->isConnected() || $this->isError() || !$result) |
|
| 293 | 293 | { |
| 294 | 294 | return $output; |
| 295 | 295 | } |
@@ -305,25 +305,25 @@ discard block |
||
| 305 | 305 | * MYSQLI_TYPE for longtext is 252 |
| 306 | 306 | */ |
| 307 | 307 | $longtext_exists = false; |
| 308 | - foreach($fields as $field) |
|
| 308 | + foreach ($fields as $field) |
|
| 309 | 309 | { |
| 310 | - if(isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 310 | + if (isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 311 | 311 | { |
| 312 | - $field->name = 'repeat_' . $field->name; |
|
| 312 | + $field->name = 'repeat_'.$field->name; |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | // Array passed needs to contain references, not values |
| 316 | 316 | $row[$field->name] = ""; |
| 317 | 317 | $resultArray[$field->name] = &$row[$field->name]; |
| 318 | 318 | |
| 319 | - if($field->type == 252) |
|
| 319 | + if ($field->type == 252) |
|
| 320 | 320 | { |
| 321 | 321 | $longtext_exists = true; |
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | $resultArray = array_merge(array($stmt), $resultArray); |
| 325 | 325 | |
| 326 | - if($longtext_exists) |
|
| 326 | + if ($longtext_exists) |
|
| 327 | 327 | { |
| 328 | 328 | mysqli_stmt_store_result($stmt); |
| 329 | 329 | } |
@@ -331,17 +331,17 @@ discard block |
||
| 331 | 331 | call_user_func_array('mysqli_stmt_bind_result', $resultArray); |
| 332 | 332 | |
| 333 | 333 | $rows = array(); |
| 334 | - while(mysqli_stmt_fetch($stmt)) |
|
| 334 | + while (mysqli_stmt_fetch($stmt)) |
|
| 335 | 335 | { |
| 336 | 336 | $resultObject = new stdClass(); |
| 337 | 337 | |
| 338 | - foreach($resultArray as $key => $value) |
|
| 338 | + foreach ($resultArray as $key => $value) |
|
| 339 | 339 | { |
| 340 | - if($key === 0) |
|
| 340 | + if ($key === 0) |
|
| 341 | 341 | { |
| 342 | 342 | continue; // Skip stmt object |
| 343 | 343 | } |
| 344 | - if(strpos($key, 'repeat_')) |
|
| 344 | + if (strpos($key, 'repeat_')) |
|
| 345 | 345 | { |
| 346 | 346 | $key = substr($key, 6); |
| 347 | 347 | } |
@@ -353,9 +353,9 @@ discard block |
||
| 353 | 353 | |
| 354 | 354 | mysqli_stmt_close($stmt); |
| 355 | 355 | |
| 356 | - if($arrayIndexEndValue) |
|
| 356 | + if ($arrayIndexEndValue) |
|
| 357 | 357 | { |
| 358 | - foreach($rows as $row) |
|
| 358 | + foreach ($rows as $row) |
|
| 359 | 359 | { |
| 360 | 360 | $output[$arrayIndexEndValue--] = $row; |
| 361 | 361 | } |
@@ -365,9 +365,9 @@ discard block |
||
| 365 | 365 | $output = $rows; |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | - if(count($output) == 1) |
|
| 368 | + if (count($output) == 1) |
|
| 369 | 369 | { |
| 370 | - if(isset($arrayIndexEndValue)) |
|
| 370 | + if (isset($arrayIndexEndValue)) |
|
| 371 | 371 | { |
| 372 | 372 | return $output; |
| 373 | 373 | } |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | */ |
| 389 | 389 | function _executeInsertAct($queryObject, $with_values = false) |
| 390 | 390 | { |
| 391 | - if($this->use_prepared_statements != 'Y') |
|
| 391 | + if ($this->use_prepared_statements != 'Y') |
|
| 392 | 392 | { |
| 393 | 393 | return parent::_executeInsertAct($queryObject); |
| 394 | 394 | } |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | */ |
| 407 | 407 | function _executeUpdateAct($queryObject, $with_values = false) |
| 408 | 408 | { |
| 409 | - if($this->use_prepared_statements != 'Y') |
|
| 409 | + if ($this->use_prepared_statements != 'Y') |
|
| 410 | 410 | { |
| 411 | 411 | return parent::_executeUpdateAct($queryObject); |
| 412 | 412 | } |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | */ |
| 425 | 425 | function _executeDeleteAct($queryObject, $with_values = false) |
| 426 | 426 | { |
| 427 | - if($this->use_prepared_statements != 'Y') |
|
| 427 | + if ($this->use_prepared_statements != 'Y') |
|
| 428 | 428 | { |
| 429 | 429 | return parent::_executeDeleteAct($queryObject); |
| 430 | 430 | } |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | */ |
| 446 | 446 | function _executeSelectAct($queryObject, $connection = null, $with_values = false) |
| 447 | 447 | { |
| 448 | - if($this->use_prepared_statements != 'Y') |
|
| 448 | + if ($this->use_prepared_statements != 'Y') |
|
| 449 | 449 | { |
| 450 | 450 | return parent::_executeSelectAct($queryObject, $connection); |
| 451 | 451 | } |
@@ -503,13 +503,13 @@ discard block |
||
| 503 | 503 | $xml_obj = $oXml->parse($xml_doc); |
| 504 | 504 | // Create a table schema |
| 505 | 505 | $table_name = $xml_obj->table->attrs->name; |
| 506 | - if($this->isTableExists($table_name)) |
|
| 506 | + if ($this->isTableExists($table_name)) |
|
| 507 | 507 | { |
| 508 | 508 | return; |
| 509 | 509 | } |
| 510 | - $table_name = $this->prefix . $table_name; |
|
| 510 | + $table_name = $this->prefix.$table_name; |
|
| 511 | 511 | |
| 512 | - if(!is_array($xml_obj->table->column)) |
|
| 512 | + if (!is_array($xml_obj->table->column)) |
|
| 513 | 513 | { |
| 514 | 514 | $columns[] = $xml_obj->table->column; |
| 515 | 515 | } |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | $columns = $xml_obj->table->column; |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | - foreach($columns as $column) |
|
| 521 | + foreach ($columns as $column) |
|
| 522 | 522 | { |
| 523 | 523 | $name = $column->attrs->name; |
| 524 | 524 | $type = $column->attrs->type; |
@@ -530,47 +530,47 @@ discard block |
||
| 530 | 530 | $default = $column->attrs->default; |
| 531 | 531 | $auto_increment = $column->attrs->auto_increment; |
| 532 | 532 | |
| 533 | - $column_schema[] = sprintf('`%s` %s%s %s %s %s', $name, $this->column_type[$type], $size ? '(' . $size . ')' : '', isset($default) ? "default '" . $default . "'" : '', $notnull ? 'not null' : '', $auto_increment ? 'auto_increment' : ''); |
|
| 533 | + $column_schema[] = sprintf('`%s` %s%s %s %s %s', $name, $this->column_type[$type], $size ? '('.$size.')' : '', isset($default) ? "default '".$default."'" : '', $notnull ? 'not null' : '', $auto_increment ? 'auto_increment' : ''); |
|
| 534 | 534 | |
| 535 | - if($primary_key) |
|
| 535 | + if ($primary_key) |
|
| 536 | 536 | { |
| 537 | 537 | $primary_list[] = $name; |
| 538 | 538 | } |
| 539 | - else if($unique) |
|
| 539 | + else if ($unique) |
|
| 540 | 540 | { |
| 541 | 541 | $unique_list[$unique][] = $name; |
| 542 | 542 | } |
| 543 | - else if($index) |
|
| 543 | + else if ($index) |
|
| 544 | 544 | { |
| 545 | 545 | $index_list[$index][] = $name; |
| 546 | 546 | } |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | - if(count($primary_list)) |
|
| 549 | + if (count($primary_list)) |
|
| 550 | 550 | { |
| 551 | - $column_schema[] = sprintf("primary key (%s)", '`' . implode($primary_list, '`,`') . '`'); |
|
| 551 | + $column_schema[] = sprintf("primary key (%s)", '`'.implode($primary_list, '`,`').'`'); |
|
| 552 | 552 | } |
| 553 | 553 | |
| 554 | - if(count($unique_list)) |
|
| 554 | + if (count($unique_list)) |
|
| 555 | 555 | { |
| 556 | - foreach($unique_list as $key => $val) |
|
| 556 | + foreach ($unique_list as $key => $val) |
|
| 557 | 557 | { |
| 558 | - $column_schema[] = sprintf("unique %s (%s)", $key, '`' . implode($val, '`,`') . '`'); |
|
| 558 | + $column_schema[] = sprintf("unique %s (%s)", $key, '`'.implode($val, '`,`').'`'); |
|
| 559 | 559 | } |
| 560 | 560 | } |
| 561 | 561 | |
| 562 | - if(count($index_list)) |
|
| 562 | + if (count($index_list)) |
|
| 563 | 563 | { |
| 564 | - foreach($index_list as $key => $val) |
|
| 564 | + foreach ($index_list as $key => $val) |
|
| 565 | 565 | { |
| 566 | - $column_schema[] = sprintf("index %s (%s)", $key, '`' . implode($val, '`,`') . '`'); |
|
| 566 | + $column_schema[] = sprintf("index %s (%s)", $key, '`'.implode($val, '`,`').'`'); |
|
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | $schema = sprintf('create table `%s` (%s%s) %s;', $this->addQuotes($table_name), "\n", implode($column_schema, ",\n"), "ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_general_ci"); |
| 571 | 571 | |
| 572 | 572 | $output = $this->_query($schema); |
| 573 | - if(!$output) |
|
| 573 | + if (!$output) |
|
| 574 | 574 | { |
| 575 | 575 | return false; |
| 576 | 576 | } |
@@ -23,7 +23,9 @@ discard block |
||
| 23 | 23 | function __construct($auto_connect = TRUE) |
| 24 | 24 | { |
| 25 | 25 | $this->_setDBInfo(); |
| 26 | - if($auto_connect) $this->_connect(); |
|
| 26 | + if($auto_connect) { |
|
| 27 | + $this->_connect(); |
|
| 28 | + } |
|
| 27 | 29 | } |
| 28 | 30 | |
| 29 | 31 | /** |
@@ -51,8 +53,7 @@ discard block |
||
| 51 | 53 | , $connection["db_password"] |
| 52 | 54 | , $connection["db_database"] |
| 53 | 55 | , $connection["db_port"]); |
| 54 | - } |
|
| 55 | - else |
|
| 56 | + } else |
|
| 56 | 57 | { |
| 57 | 58 | $result = @mysqli_connect($connection["db_hostname"] |
| 58 | 59 | , $connection["db_userid"] |
@@ -92,8 +93,7 @@ discard block |
||
| 92 | 93 | if(!$transactionLevel) |
| 93 | 94 | { |
| 94 | 95 | $this->_query("begin"); |
| 95 | - } |
|
| 96 | - else |
|
| 96 | + } else |
|
| 97 | 97 | { |
| 98 | 98 | $this->_query("SAVEPOINT SP" . $transactionLevel, $connection); |
| 99 | 99 | } |
@@ -114,8 +114,7 @@ discard block |
||
| 114 | 114 | if($point) |
| 115 | 115 | { |
| 116 | 116 | $this->_query("ROLLBACK TO SP" . $point, $connection); |
| 117 | - } |
|
| 118 | - else |
|
| 117 | + } else |
|
| 119 | 118 | { |
| 120 | 119 | mysqli_rollback($connection); |
| 121 | 120 | $this->setQueryLog( array("query"=>"rollback") ); |
@@ -267,8 +266,7 @@ discard block |
||
| 267 | 266 | $params[] = $v; |
| 268 | 267 | $types .= $type; |
| 269 | 268 | } |
| 270 | - } |
|
| 271 | - else |
|
| 269 | + } else |
|
| 272 | 270 | { |
| 273 | 271 | $params[] = $value; |
| 274 | 272 | $types .= $type; |
@@ -307,10 +305,12 @@ discard block |
||
| 307 | 305 | $longtext_exists = false; |
| 308 | 306 | foreach($fields as $field) |
| 309 | 307 | { |
| 310 | - if(isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 308 | + if(isset($resultArray[$field->name])) { |
|
| 309 | + // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 311 | 310 | { |
| 312 | 311 | $field->name = 'repeat_' . $field->name; |
| 313 | 312 | } |
| 313 | + } |
|
| 314 | 314 | |
| 315 | 315 | // Array passed needs to contain references, not values |
| 316 | 316 | $row[$field->name] = ""; |
@@ -359,8 +359,7 @@ discard block |
||
| 359 | 359 | { |
| 360 | 360 | $output[$arrayIndexEndValue--] = $row; |
| 361 | 361 | } |
| 362 | - } |
|
| 363 | - else |
|
| 362 | + } else |
|
| 364 | 363 | { |
| 365 | 364 | $output = $rows; |
| 366 | 365 | } |
@@ -370,8 +369,7 @@ discard block |
||
| 370 | 369 | if(isset($arrayIndexEndValue)) |
| 371 | 370 | { |
| 372 | 371 | return $output; |
| 373 | - } |
|
| 374 | - else |
|
| 372 | + } else |
|
| 375 | 373 | { |
| 376 | 374 | return $output[0]; |
| 377 | 375 | } |
@@ -512,8 +510,7 @@ discard block |
||
| 512 | 510 | if(!is_array($xml_obj->table->column)) |
| 513 | 511 | { |
| 514 | 512 | $columns[] = $xml_obj->table->column; |
| 515 | - } |
|
| 516 | - else |
|
| 513 | + } else |
|
| 517 | 514 | { |
| 518 | 515 | $columns = $xml_obj->table->column; |
| 519 | 516 | } |
@@ -535,12 +532,10 @@ discard block |
||
| 535 | 532 | if($primary_key) |
| 536 | 533 | { |
| 537 | 534 | $primary_list[] = $name; |
| 538 | - } |
|
| 539 | - else if($unique) |
|
| 535 | + } else if($unique) |
|
| 540 | 536 | { |
| 541 | 537 | $unique_list[$unique][] = $name; |
| 542 | - } |
|
| 543 | - else if($index) |
|
| 538 | + } else if($index) |
|
| 544 | 539 | { |
| 545 | 540 | $index_list[$index][] = $name; |
| 546 | 541 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | function __construct($auto_connect = TRUE) |
| 47 | 47 | { |
| 48 | 48 | $this->_setDBInfo(); |
| 49 | - if($auto_connect) $this->_connect(); |
|
| 49 | + if ($auto_connect) $this->_connect(); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -67,32 +67,32 @@ discard block |
||
| 67 | 67 | function __connect($connection) |
| 68 | 68 | { |
| 69 | 69 | // Ignore if no DB information exists |
| 70 | - if(strpos($connection["db_hostname"], ':') === false && $connection["db_port"]) |
|
| 70 | + if (strpos($connection["db_hostname"], ':') === false && $connection["db_port"]) |
|
| 71 | 71 | { |
| 72 | - $connection["db_hostname"] .= ':' . $connection["db_port"]; |
|
| 72 | + $connection["db_hostname"] .= ':'.$connection["db_port"]; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // Attempt to connect |
| 76 | 76 | $result = @mysql_connect($connection["db_hostname"], $connection["db_userid"], $connection["db_password"]); |
| 77 | - if(!$result) |
|
| 77 | + if (!$result) |
|
| 78 | 78 | { |
| 79 | 79 | exit('XE cannot connect to DB.'); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - if(mysql_error()) |
|
| 82 | + if (mysql_error()) |
|
| 83 | 83 | { |
| 84 | 84 | $this->setError(mysql_errno(), mysql_error()); |
| 85 | 85 | return; |
| 86 | 86 | } |
| 87 | 87 | // Error appears if the version is lower than 4.1 |
| 88 | - if(version_compare(mysql_get_server_info($result), '4.1', '<')) |
|
| 88 | + if (version_compare(mysql_get_server_info($result), '4.1', '<')) |
|
| 89 | 89 | { |
| 90 | - $this->setError(-1, 'XE cannot be installed under the version of mysql 4.1. Current mysql version is ' . mysql_get_server_info()); |
|
| 90 | + $this->setError(-1, 'XE cannot be installed under the version of mysql 4.1. Current mysql version is '.mysql_get_server_info()); |
|
| 91 | 91 | return; |
| 92 | 92 | } |
| 93 | 93 | // select db |
| 94 | 94 | @mysql_select_db($connection["db_database"], $result); |
| 95 | - if(mysql_error()) |
|
| 95 | + if (mysql_error()) |
|
| 96 | 96 | { |
| 97 | 97 | $this->setError(mysql_errno(), mysql_error()); |
| 98 | 98 | return; |
@@ -131,11 +131,11 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | function addQuotes($string) |
| 133 | 133 | { |
| 134 | - if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
| 134 | + if (version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
| 135 | 135 | { |
| 136 | 136 | $string = stripslashes(str_replace("\\", "\\\\", $string)); |
| 137 | 137 | } |
| 138 | - if(!is_numeric($string)) |
|
| 138 | + if (!is_numeric($string)) |
|
| 139 | 139 | { |
| 140 | 140 | $string = @mysql_real_escape_string($string); |
| 141 | 141 | } |
@@ -181,14 +181,14 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | function __query($query, $connection) |
| 183 | 183 | { |
| 184 | - if(!$connection) |
|
| 184 | + if (!$connection) |
|
| 185 | 185 | { |
| 186 | 186 | exit('XE cannot handle DB connection.'); |
| 187 | 187 | } |
| 188 | 188 | // Run the query statement |
| 189 | 189 | $result = mysql_query($query, $connection); |
| 190 | 190 | // Error Check |
| 191 | - if(mysql_error($connection)) |
|
| 191 | + if (mysql_error($connection)) |
|
| 192 | 192 | { |
| 193 | 193 | $this->setError(mysql_errno($connection), mysql_error($connection)); |
| 194 | 194 | } |
@@ -205,13 +205,13 @@ discard block |
||
| 205 | 205 | function _fetch($result, $arrayIndexEndValue = NULL) |
| 206 | 206 | { |
| 207 | 207 | $output = array(); |
| 208 | - if(!$this->isConnected() || $this->isError() || !$result) |
|
| 208 | + if (!$this->isConnected() || $this->isError() || !$result) |
|
| 209 | 209 | { |
| 210 | 210 | return $output; |
| 211 | 211 | } |
| 212 | - while($tmp = $this->db_fetch_object($result)) |
|
| 212 | + while ($tmp = $this->db_fetch_object($result)) |
|
| 213 | 213 | { |
| 214 | - if($arrayIndexEndValue) |
|
| 214 | + if ($arrayIndexEndValue) |
|
| 215 | 215 | { |
| 216 | 216 | $output[$arrayIndexEndValue--] = $tmp; |
| 217 | 217 | } |
@@ -220,9 +220,9 @@ discard block |
||
| 220 | 220 | $output[] = $tmp; |
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | - if(count($output) == 1) |
|
| 223 | + if (count($output) == 1) |
|
| 224 | 224 | { |
| 225 | - if(isset($arrayIndexEndValue)) |
|
| 225 | + if (isset($arrayIndexEndValue)) |
|
| 226 | 226 | { |
| 227 | 227 | return $output; |
| 228 | 228 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | $query = sprintf("insert into `%ssequence` (seq) values ('0')", $this->prefix); |
| 246 | 246 | $this->_query($query); |
| 247 | 247 | $sequence = $this->db_insert_id(); |
| 248 | - if($sequence % 10000 == 0) |
|
| 248 | + if ($sequence % 10000 == 0) |
|
| 249 | 249 | { |
| 250 | 250 | $query = sprintf("delete from `%ssequence` where seq < %d", $this->prefix, $sequence); |
| 251 | 251 | $this->_query($query); |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $query = sprintf("select password('%s') as password, old_password('%s') as old_password", $this->addQuotes($password), $this->addQuotes($password)); |
| 266 | 266 | $result = $this->_query($query); |
| 267 | 267 | $tmp = $this->_fetch($result); |
| 268 | - if($tmp->password === $saved_password || $tmp->old_password === $saved_password) |
|
| 268 | + if ($tmp->password === $saved_password || $tmp->old_password === $saved_password) |
|
| 269 | 269 | { |
| 270 | 270 | return true; |
| 271 | 271 | } |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $query = sprintf("show tables like '%s%s'", $this->prefix, $this->addQuotes($target_name)); |
| 283 | 283 | $result = $this->_query($query); |
| 284 | 284 | $tmp = $this->_fetch($result); |
| 285 | - if(!$tmp) |
|
| 285 | + if (!$tmp) |
|
| 286 | 286 | { |
| 287 | 287 | return false; |
| 288 | 288 | } |
@@ -302,13 +302,13 @@ discard block |
||
| 302 | 302 | function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = null, $notnull = false) |
| 303 | 303 | { |
| 304 | 304 | $type = $this->column_type[$type]; |
| 305 | - if(strtoupper($type) == 'INTEGER') |
|
| 305 | + if (strtoupper($type) == 'INTEGER') |
|
| 306 | 306 | { |
| 307 | 307 | $size = ''; |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | $query = sprintf("alter table `%s%s` add `%s` ", $this->prefix, $table_name, $column_name); |
| 311 | - if($size) |
|
| 311 | + if ($size) |
|
| 312 | 312 | { |
| 313 | 313 | $query .= sprintf(" %s(%s) ", $type, $size); |
| 314 | 314 | } |
@@ -316,11 +316,11 @@ discard block |
||
| 316 | 316 | { |
| 317 | 317 | $query .= sprintf(" %s ", $type); |
| 318 | 318 | } |
| 319 | - if(isset($default)) |
|
| 319 | + if (isset($default)) |
|
| 320 | 320 | { |
| 321 | 321 | $query .= sprintf(" default '%s' ", $default); |
| 322 | 322 | } |
| 323 | - if($notnull) |
|
| 323 | + if ($notnull) |
|
| 324 | 324 | { |
| 325 | 325 | $query .= " not null "; |
| 326 | 326 | } |
@@ -350,18 +350,18 @@ discard block |
||
| 350 | 350 | { |
| 351 | 351 | $query = sprintf("show fields from `%s%s`", $this->prefix, $table_name); |
| 352 | 352 | $result = $this->_query($query); |
| 353 | - if($this->isError()) |
|
| 353 | + if ($this->isError()) |
|
| 354 | 354 | { |
| 355 | 355 | return; |
| 356 | 356 | } |
| 357 | 357 | $output = $this->_fetch($result); |
| 358 | - if($output) |
|
| 358 | + if ($output) |
|
| 359 | 359 | { |
| 360 | 360 | $column_name = strtolower($column_name); |
| 361 | - foreach($output as $key => $val) |
|
| 361 | + foreach ($output as $key => $val) |
|
| 362 | 362 | { |
| 363 | 363 | $name = strtolower($val->Field); |
| 364 | - if($column_name == $name) |
|
| 364 | + if ($column_name == $name) |
|
| 365 | 365 | { |
| 366 | 366 | return true; |
| 367 | 367 | } |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | */ |
| 383 | 383 | function addIndex($table_name, $index_name, $target_columns, $is_unique = false) |
| 384 | 384 | { |
| 385 | - if(!is_array($target_columns)) |
|
| 385 | + if (!is_array($target_columns)) |
|
| 386 | 386 | { |
| 387 | 387 | $target_columns = array($target_columns); |
| 388 | 388 | } |
@@ -415,23 +415,23 @@ discard block |
||
| 415 | 415 | //$query = sprintf("show indexes from %s%s where key_name = '%s' ", $this->prefix, $table_name, $index_name); |
| 416 | 416 | $query = sprintf("show indexes from `%s%s`", $this->prefix, $table_name); |
| 417 | 417 | $result = $this->_query($query); |
| 418 | - if($this->isError()) |
|
| 418 | + if ($this->isError()) |
|
| 419 | 419 | { |
| 420 | 420 | return; |
| 421 | 421 | } |
| 422 | 422 | $output = $this->_fetch($result); |
| 423 | - if(!$output) |
|
| 423 | + if (!$output) |
|
| 424 | 424 | { |
| 425 | 425 | return; |
| 426 | 426 | } |
| 427 | - if(!is_array($output)) |
|
| 427 | + if (!is_array($output)) |
|
| 428 | 428 | { |
| 429 | 429 | $output = array($output); |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | - for($i = 0; $i < count($output); $i++) |
|
| 432 | + for ($i = 0; $i < count($output); $i++) |
|
| 433 | 433 | { |
| 434 | - if($output[$i]->Key_name == $index_name) |
|
| 434 | + if ($output[$i]->Key_name == $index_name) |
|
| 435 | 435 | { |
| 436 | 436 | return true; |
| 437 | 437 | } |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | */ |
| 457 | 457 | function createTableByXmlFile($file_name) |
| 458 | 458 | { |
| 459 | - if(!file_exists($file_name)) |
|
| 459 | + if (!file_exists($file_name)) |
|
| 460 | 460 | { |
| 461 | 461 | return; |
| 462 | 462 | } |
@@ -481,13 +481,13 @@ discard block |
||
| 481 | 481 | $xml_obj = $oXml->parse($xml_doc); |
| 482 | 482 | // Create a table schema |
| 483 | 483 | $table_name = $xml_obj->table->attrs->name; |
| 484 | - if($this->isTableExists($table_name)) |
|
| 484 | + if ($this->isTableExists($table_name)) |
|
| 485 | 485 | { |
| 486 | 486 | return; |
| 487 | 487 | } |
| 488 | - $table_name = $this->prefix . $table_name; |
|
| 488 | + $table_name = $this->prefix.$table_name; |
|
| 489 | 489 | |
| 490 | - if(!is_array($xml_obj->table->column)) |
|
| 490 | + if (!is_array($xml_obj->table->column)) |
|
| 491 | 491 | { |
| 492 | 492 | $columns[] = $xml_obj->table->column; |
| 493 | 493 | } |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | $unique_list = array(); |
| 501 | 501 | $index_list = array(); |
| 502 | 502 | |
| 503 | - foreach($columns as $column) |
|
| 503 | + foreach ($columns as $column) |
|
| 504 | 504 | { |
| 505 | 505 | $name = $column->attrs->name; |
| 506 | 506 | $type = $column->attrs->type; |
@@ -512,47 +512,47 @@ discard block |
||
| 512 | 512 | $default = $column->attrs->default; |
| 513 | 513 | $auto_increment = $column->attrs->auto_increment; |
| 514 | 514 | |
| 515 | - $column_schema[] = sprintf('`%s` %s%s %s %s %s', $name, $this->column_type[$type], $size ? '(' . $size . ')' : '', isset($default) ? "default '" . $default . "'" : '', $notnull ? 'not null' : '', $auto_increment ? 'auto_increment' : ''); |
|
| 515 | + $column_schema[] = sprintf('`%s` %s%s %s %s %s', $name, $this->column_type[$type], $size ? '('.$size.')' : '', isset($default) ? "default '".$default."'" : '', $notnull ? 'not null' : '', $auto_increment ? 'auto_increment' : ''); |
|
| 516 | 516 | |
| 517 | - if($primary_key) |
|
| 517 | + if ($primary_key) |
|
| 518 | 518 | { |
| 519 | 519 | $primary_list[] = $name; |
| 520 | 520 | } |
| 521 | - else if($unique) |
|
| 521 | + else if ($unique) |
|
| 522 | 522 | { |
| 523 | 523 | $unique_list[$unique][] = $name; |
| 524 | 524 | } |
| 525 | - else if($index) |
|
| 525 | + else if ($index) |
|
| 526 | 526 | { |
| 527 | 527 | $index_list[$index][] = $name; |
| 528 | 528 | } |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | - if(count($primary_list)) |
|
| 531 | + if (count($primary_list)) |
|
| 532 | 532 | { |
| 533 | - $column_schema[] = sprintf("primary key (%s)", '`' . implode($primary_list, '`,`') . '`'); |
|
| 533 | + $column_schema[] = sprintf("primary key (%s)", '`'.implode($primary_list, '`,`').'`'); |
|
| 534 | 534 | } |
| 535 | 535 | |
| 536 | - if(count($unique_list)) |
|
| 536 | + if (count($unique_list)) |
|
| 537 | 537 | { |
| 538 | - foreach($unique_list as $key => $val) |
|
| 538 | + foreach ($unique_list as $key => $val) |
|
| 539 | 539 | { |
| 540 | - $column_schema[] = sprintf("unique %s (%s)", $key, '`' . implode($val, '`,`') . '`'); |
|
| 540 | + $column_schema[] = sprintf("unique %s (%s)", $key, '`'.implode($val, '`,`').'`'); |
|
| 541 | 541 | } |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | - if(count($index_list)) |
|
| 544 | + if (count($index_list)) |
|
| 545 | 545 | { |
| 546 | - foreach($index_list as $key => $val) |
|
| 546 | + foreach ($index_list as $key => $val) |
|
| 547 | 547 | { |
| 548 | - $column_schema[] = sprintf("index %s (%s)", $key, '`' . implode($val, '`,`') . '`'); |
|
| 548 | + $column_schema[] = sprintf("index %s (%s)", $key, '`'.implode($val, '`,`').'`'); |
|
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | $schema = sprintf('create table `%s` (%s%s) %s;', $this->addQuotes($table_name), "\n", implode($column_schema, ",\n"), "ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci"); |
| 553 | 553 | |
| 554 | 554 | $output = $this->_query($schema); |
| 555 | - if(!$output) |
|
| 555 | + if (!$output) |
|
| 556 | 556 | return false; |
| 557 | 557 | } |
| 558 | 558 | |
@@ -565,8 +565,8 @@ discard block |
||
| 565 | 565 | function _executeInsertAct($queryObject, $with_values = true) |
| 566 | 566 | { |
| 567 | 567 | $query = $this->getInsertSql($queryObject, $with_values, true); |
| 568 | - $query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : ''; |
|
| 569 | - if(is_a($query, 'BaseObject')) |
|
| 568 | + $query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' '.$this->comment_syntax, $this->query_id) : ''; |
|
| 569 | + if (is_a($query, 'BaseObject')) |
|
| 570 | 570 | { |
| 571 | 571 | return; |
| 572 | 572 | } |
@@ -582,13 +582,13 @@ discard block |
||
| 582 | 582 | function _executeUpdateAct($queryObject, $with_values = true) |
| 583 | 583 | { |
| 584 | 584 | $query = $this->getUpdateSql($queryObject, $with_values, true); |
| 585 | - if(is_a($query, 'BaseObject')) |
|
| 585 | + if (is_a($query, 'BaseObject')) |
|
| 586 | 586 | { |
| 587 | - if(!$query->toBool()) return $query; |
|
| 587 | + if (!$query->toBool()) return $query; |
|
| 588 | 588 | else return; |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | - $query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : ''; |
|
| 591 | + $query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' '.$this->comment_syntax, $this->query_id) : ''; |
|
| 592 | 592 | |
| 593 | 593 | |
| 594 | 594 | return $this->_query($query); |
@@ -603,8 +603,8 @@ discard block |
||
| 603 | 603 | function _executeDeleteAct($queryObject, $with_values = true) |
| 604 | 604 | { |
| 605 | 605 | $query = $this->getDeleteSql($queryObject, $with_values, true); |
| 606 | - $query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : ''; |
|
| 607 | - if(is_a($query, 'BaseObject')) |
|
| 606 | + $query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' '.$this->comment_syntax, $this->query_id) : ''; |
|
| 607 | + if (is_a($query, 'BaseObject')) |
|
| 608 | 608 | { |
| 609 | 609 | return; |
| 610 | 610 | } |
@@ -624,21 +624,21 @@ discard block |
||
| 624 | 624 | { |
| 625 | 625 | $limit = $queryObject->getLimit(); |
| 626 | 626 | $result = NULL; |
| 627 | - if($limit && $limit->isPageHandler()) |
|
| 627 | + if ($limit && $limit->isPageHandler()) |
|
| 628 | 628 | { |
| 629 | 629 | return $this->queryPageLimit($queryObject, $result, $connection, $with_values); |
| 630 | 630 | } |
| 631 | 631 | else |
| 632 | 632 | { |
| 633 | 633 | $query = $this->getSelectSql($queryObject, $with_values); |
| 634 | - if(is_a($query, 'BaseObject')) |
|
| 634 | + if (is_a($query, 'BaseObject')) |
|
| 635 | 635 | { |
| 636 | 636 | return; |
| 637 | 637 | } |
| 638 | - $query .= (__DEBUG_QUERY__ & 1 && $queryObject->queryID) ? sprintf(' ' . $this->comment_syntax, $queryObject->queryID) : ''; |
|
| 638 | + $query .= (__DEBUG_QUERY__ & 1 && $queryObject->queryID) ? sprintf(' '.$this->comment_syntax, $queryObject->queryID) : ''; |
|
| 639 | 639 | |
| 640 | 640 | $result = $this->_query($query, $connection); |
| 641 | - if($this->isError()) |
|
| 641 | + if ($this->isError()) |
|
| 642 | 642 | { |
| 643 | 643 | return $this->queryError($queryObject); |
| 644 | 644 | } |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | $buff = new BaseObject(); |
| 648 | 648 | $buff->data = $data; |
| 649 | 649 | |
| 650 | - if($queryObject->usesClickCount()) |
|
| 650 | + if ($queryObject->usesClickCount()) |
|
| 651 | 651 | { |
| 652 | 652 | $update_query = $this->getClickCountQuery($queryObject); |
| 653 | 653 | $this->_executeUpdateAct($update_query, $with_values); |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | function queryError($queryObject) |
| 709 | 709 | { |
| 710 | 710 | $limit = $queryObject->getLimit(); |
| 711 | - if($limit && $limit->isPageHandler()) |
|
| 711 | + if ($limit && $limit->isPageHandler()) |
|
| 712 | 712 | { |
| 713 | 713 | $buff = new BaseObject(); |
| 714 | 714 | $buff->total_count = 0; |
@@ -737,48 +737,48 @@ discard block |
||
| 737 | 737 | $limit = $queryObject->getLimit(); |
| 738 | 738 | // Total count |
| 739 | 739 | $temp_where = $queryObject->getWhereString($with_values, false); |
| 740 | - $count_query = sprintf('select count(*) as "count" %s %s', 'FROM ' . $queryObject->getFromString($with_values), ($temp_where === '' ? '' : ' WHERE ' . $temp_where)); |
|
| 740 | + $count_query = sprintf('select count(*) as "count" %s %s', 'FROM '.$queryObject->getFromString($with_values), ($temp_where === '' ? '' : ' WHERE '.$temp_where)); |
|
| 741 | 741 | |
| 742 | 742 | // Check for distinct query and if found update count query structure |
| 743 | 743 | $temp_select = $queryObject->getSelectString($with_values); |
| 744 | 744 | $uses_distinct = stripos($temp_select, "distinct") !== false; |
| 745 | 745 | $uses_groupby = $queryObject->getGroupByString() != ''; |
| 746 | - if($uses_distinct || $uses_groupby) |
|
| 746 | + if ($uses_distinct || $uses_groupby) |
|
| 747 | 747 | { |
| 748 | 748 | $count_query = sprintf('select %s %s %s %s' |
| 749 | 749 | , $temp_select == '*' ? '1' : $temp_select |
| 750 | - , 'FROM ' . $queryObject->getFromString($with_values) |
|
| 751 | - , ($temp_where === '' ? '' : ' WHERE ' . $temp_where) |
|
| 752 | - , ($uses_groupby ? ' GROUP BY ' . $queryObject->getGroupByString() : '') |
|
| 750 | + , 'FROM '.$queryObject->getFromString($with_values) |
|
| 751 | + , ($temp_where === '' ? '' : ' WHERE '.$temp_where) |
|
| 752 | + , ($uses_groupby ? ' GROUP BY '.$queryObject->getGroupByString() : '') |
|
| 753 | 753 | ); |
| 754 | 754 | |
| 755 | 755 | // If query uses grouping or distinct, count from original select |
| 756 | 756 | $count_query = sprintf('select count(*) as "count" from (%s) xet', $count_query); |
| 757 | 757 | } |
| 758 | 758 | |
| 759 | - $count_query .= (__DEBUG_QUERY__ & 1 && $queryObject->queryID) ? sprintf(' ' . $this->comment_syntax, $queryObject->queryID) : ''; |
|
| 759 | + $count_query .= (__DEBUG_QUERY__ & 1 && $queryObject->queryID) ? sprintf(' '.$this->comment_syntax, $queryObject->queryID) : ''; |
|
| 760 | 760 | $result_count = $this->_query($count_query, $connection); |
| 761 | 761 | $count_output = $this->_fetch($result_count); |
| 762 | 762 | $total_count = (int) (isset($count_output->count) ? $count_output->count : NULL); |
| 763 | 763 | |
| 764 | 764 | $list_count = $limit->list_count->getValue(); |
| 765 | - if(!$list_count) |
|
| 765 | + if (!$list_count) |
|
| 766 | 766 | { |
| 767 | 767 | $list_count = 20; |
| 768 | 768 | } |
| 769 | 769 | $page_count = $limit->page_count->getValue(); |
| 770 | - if(!$page_count) |
|
| 770 | + if (!$page_count) |
|
| 771 | 771 | { |
| 772 | 772 | $page_count = 10; |
| 773 | 773 | } |
| 774 | 774 | $page = $limit->page->getValue(); |
| 775 | - if(!$page || $page < 1) |
|
| 775 | + if (!$page || $page < 1) |
|
| 776 | 776 | { |
| 777 | 777 | $page = 1; |
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | // total pages |
| 781 | - if($total_count) |
|
| 781 | + if ($total_count) |
|
| 782 | 782 | { |
| 783 | 783 | $total_page = (int) (($total_count - 1) / $list_count) + 1; |
| 784 | 784 | } |
@@ -788,7 +788,7 @@ discard block |
||
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | // check the page variables |
| 791 | - if($page > $total_page) |
|
| 791 | + if ($page > $total_page) |
|
| 792 | 792 | { |
| 793 | 793 | // If requested page is bigger than total number of pages, return empty list |
| 794 | 794 | $buff = new BaseObject(); |
@@ -803,9 +803,9 @@ discard block |
||
| 803 | 803 | |
| 804 | 804 | $query = $this->getSelectPageSql($queryObject, $with_values, $start_count, $list_count); |
| 805 | 805 | |
| 806 | - $query .= (__DEBUG_QUERY__ & 1 && $queryObject->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : ''; |
|
| 806 | + $query .= (__DEBUG_QUERY__ & 1 && $queryObject->query_id) ? sprintf(' '.$this->comment_syntax, $this->query_id) : ''; |
|
| 807 | 807 | $result = $this->_query($query, $connection); |
| 808 | - if($this->isError()) |
|
| 808 | + if ($this->isError()) |
|
| 809 | 809 | { |
| 810 | 810 | return $this->queryError($queryObject); |
| 811 | 811 | } |
@@ -833,44 +833,44 @@ discard block |
||
| 833 | 833 | function getSelectPageSql($query, $with_values = true, $start_count = 0, $list_count = 0) |
| 834 | 834 | { |
| 835 | 835 | $select = $query->getSelectString($with_values); |
| 836 | - if($select == '') |
|
| 836 | + if ($select == '') |
|
| 837 | 837 | { |
| 838 | 838 | return new BaseObject(-1, "Invalid query"); |
| 839 | 839 | } |
| 840 | - $select = 'SELECT ' . $select; |
|
| 840 | + $select = 'SELECT '.$select; |
|
| 841 | 841 | |
| 842 | 842 | $from = $query->getFromString($with_values); |
| 843 | - if($from == '') |
|
| 843 | + if ($from == '') |
|
| 844 | 844 | { |
| 845 | 845 | return new BaseObject(-1, "Invalid query"); |
| 846 | 846 | } |
| 847 | - $from = ' FROM ' . $from; |
|
| 847 | + $from = ' FROM '.$from; |
|
| 848 | 848 | |
| 849 | 849 | $where = $query->getWhereString($with_values); |
| 850 | - if($where != '') |
|
| 850 | + if ($where != '') |
|
| 851 | 851 | { |
| 852 | - $where = ' WHERE ' . $where; |
|
| 852 | + $where = ' WHERE '.$where; |
|
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | $groupBy = $query->getGroupByString(); |
| 856 | - if($groupBy != '') |
|
| 856 | + if ($groupBy != '') |
|
| 857 | 857 | { |
| 858 | - $groupBy = ' GROUP BY ' . $groupBy; |
|
| 858 | + $groupBy = ' GROUP BY '.$groupBy; |
|
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | $orderBy = $query->getOrderByString(); |
| 862 | - if($orderBy != '') |
|
| 862 | + if ($orderBy != '') |
|
| 863 | 863 | { |
| 864 | - $orderBy = ' ORDER BY ' . $orderBy; |
|
| 864 | + $orderBy = ' ORDER BY '.$orderBy; |
|
| 865 | 865 | } |
| 866 | 866 | |
| 867 | 867 | $limit = $query->getLimitString(); |
| 868 | - if($limit != '') |
|
| 868 | + if ($limit != '') |
|
| 869 | 869 | { |
| 870 | 870 | $limit = sprintf(' LIMIT %d, %d', $start_count, $list_count); |
| 871 | 871 | } |
| 872 | 872 | |
| 873 | - return $select . ' ' . $from . ' ' . $where . ' ' . $groupBy . ' ' . $orderBy . ' ' . $limit; |
|
| 873 | + return $select.' '.$from.' '.$where.' '.$groupBy.' '.$orderBy.' '.$limit; |
|
| 874 | 874 | } |
| 875 | 875 | |
| 876 | 876 | } |
@@ -46,7 +46,9 @@ discard block |
||
| 46 | 46 | function __construct($auto_connect = TRUE) |
| 47 | 47 | { |
| 48 | 48 | $this->_setDBInfo(); |
| 49 | - if($auto_connect) $this->_connect(); |
|
| 49 | + if($auto_connect) { |
|
| 50 | + $this->_connect(); |
|
| 51 | + } |
|
| 50 | 52 | } |
| 51 | 53 | |
| 52 | 54 | /** |
@@ -214,8 +216,7 @@ discard block |
||
| 214 | 216 | if($arrayIndexEndValue) |
| 215 | 217 | { |
| 216 | 218 | $output[$arrayIndexEndValue--] = $tmp; |
| 217 | - } |
|
| 218 | - else |
|
| 219 | + } else |
|
| 219 | 220 | { |
| 220 | 221 | $output[] = $tmp; |
| 221 | 222 | } |
@@ -225,8 +226,7 @@ discard block |
||
| 225 | 226 | if(isset($arrayIndexEndValue)) |
| 226 | 227 | { |
| 227 | 228 | return $output; |
| 228 | - } |
|
| 229 | - else |
|
| 229 | + } else |
|
| 230 | 230 | { |
| 231 | 231 | return $output[0]; |
| 232 | 232 | } |
@@ -311,8 +311,7 @@ discard block |
||
| 311 | 311 | if($size) |
| 312 | 312 | { |
| 313 | 313 | $query .= sprintf(" %s(%s) ", $type, $size); |
| 314 | - } |
|
| 315 | - else |
|
| 314 | + } else |
|
| 316 | 315 | { |
| 317 | 316 | $query .= sprintf(" %s ", $type); |
| 318 | 317 | } |
@@ -490,8 +489,7 @@ discard block |
||
| 490 | 489 | if(!is_array($xml_obj->table->column)) |
| 491 | 490 | { |
| 492 | 491 | $columns[] = $xml_obj->table->column; |
| 493 | - } |
|
| 494 | - else |
|
| 492 | + } else |
|
| 495 | 493 | { |
| 496 | 494 | $columns = $xml_obj->table->column; |
| 497 | 495 | } |
@@ -517,12 +515,10 @@ discard block |
||
| 517 | 515 | if($primary_key) |
| 518 | 516 | { |
| 519 | 517 | $primary_list[] = $name; |
| 520 | - } |
|
| 521 | - else if($unique) |
|
| 518 | + } else if($unique) |
|
| 522 | 519 | { |
| 523 | 520 | $unique_list[$unique][] = $name; |
| 524 | - } |
|
| 525 | - else if($index) |
|
| 521 | + } else if($index) |
|
| 526 | 522 | { |
| 527 | 523 | $index_list[$index][] = $name; |
| 528 | 524 | } |
@@ -552,8 +548,9 @@ discard block |
||
| 552 | 548 | $schema = sprintf('create table `%s` (%s%s) %s;', $this->addQuotes($table_name), "\n", implode($column_schema, ",\n"), "ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci"); |
| 553 | 549 | |
| 554 | 550 | $output = $this->_query($schema); |
| 555 | - if(!$output) |
|
| 556 | - return false; |
|
| 551 | + if(!$output) { |
|
| 552 | + return false; |
|
| 553 | + } |
|
| 557 | 554 | } |
| 558 | 555 | |
| 559 | 556 | /** |
@@ -584,8 +581,11 @@ discard block |
||
| 584 | 581 | $query = $this->getUpdateSql($queryObject, $with_values, true); |
| 585 | 582 | if(is_a($query, 'BaseObject')) |
| 586 | 583 | { |
| 587 | - if(!$query->toBool()) return $query; |
|
| 588 | - else return; |
|
| 584 | + if(!$query->toBool()) { |
|
| 585 | + return $query; |
|
| 586 | + } else { |
|
| 587 | + return; |
|
| 588 | + } |
|
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | $query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : ''; |
@@ -627,8 +627,7 @@ discard block |
||
| 627 | 627 | if($limit && $limit->isPageHandler()) |
| 628 | 628 | { |
| 629 | 629 | return $this->queryPageLimit($queryObject, $result, $connection, $with_values); |
| 630 | - } |
|
| 631 | - else |
|
| 630 | + } else |
|
| 632 | 631 | { |
| 633 | 632 | $query = $this->getSelectSql($queryObject, $with_values); |
| 634 | 633 | if(is_a($query, 'BaseObject')) |
@@ -717,8 +716,7 @@ discard block |
||
| 717 | 716 | $buff->data = array(); |
| 718 | 717 | $buff->page_navigation = new PageHandler(/* $total_count */0, /* $total_page */1, /* $page */1, /* $page_count */10); //default page handler values |
| 719 | 718 | return $buff; |
| 720 | - } |
|
| 721 | - else |
|
| 719 | + } else |
|
| 722 | 720 | { |
| 723 | 721 | return; |
| 724 | 722 | } |
@@ -781,8 +779,7 @@ discard block |
||
| 781 | 779 | if($total_count) |
| 782 | 780 | { |
| 783 | 781 | $total_page = (int) (($total_count - 1) / $list_count) + 1; |
| 784 | - } |
|
| 785 | - else |
|
| 782 | + } else |
|
| 786 | 783 | { |
| 787 | 784 | $total_page = 1; |
| 788 | 785 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | function __construct($auto_connect = TRUE) |
| 46 | 46 | { |
| 47 | 47 | $this->_setDBInfo(); |
| 48 | - if($auto_connect) $this->_connect(); |
|
| 48 | + if ($auto_connect) $this->_connect(); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | //sqlsrv_configure( 'LogSubsystems', SQLSRV_LOG_SYSTEM_ALL ); |
| 71 | 71 | $result = @sqlsrv_connect($connection["db_hostname"], array('Database' => $connection["db_database"], 'UID' => $connection["db_userid"], 'PWD' => $connection["db_password"])); |
| 72 | 72 | |
| 73 | - if(!$result) |
|
| 73 | + if (!$result) |
|
| 74 | 74 | { |
| 75 | 75 | $errors = print_r(sqlsrv_errors(), true); |
| 76 | - $this->setError(-1, 'database connect fail' . PHP_EOL . $errors); |
|
| 76 | + $this->setError(-1, 'database connect fail'.PHP_EOL.$errors); |
|
| 77 | 77 | return; |
| 78 | 78 | } |
| 79 | 79 | return $result; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | function addQuotes($string) |
| 101 | 101 | { |
| 102 | - if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
| 102 | + if (version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
| 103 | 103 | { |
| 104 | 104 | $string = stripslashes(str_replace("\\", "\\\\", $string)); |
| 105 | 105 | } |
@@ -117,16 +117,16 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $connection = $this->_getConnection('master'); |
| 119 | 119 | |
| 120 | - if(!$transactionLevel) |
|
| 120 | + if (!$transactionLevel) |
|
| 121 | 121 | { |
| 122 | - if(sqlsrv_begin_transaction($connection) === false) |
|
| 122 | + if (sqlsrv_begin_transaction($connection) === false) |
|
| 123 | 123 | { |
| 124 | 124 | return; |
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | else |
| 128 | 128 | { |
| 129 | - $this->_query("SAVE TRANS SP" . $transactionLevel, $connection); |
|
| 129 | + $this->_query("SAVE TRANS SP".$transactionLevel, $connection); |
|
| 130 | 130 | } |
| 131 | 131 | return true; |
| 132 | 132 | } |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $point = $transactionLevel - 1; |
| 144 | 144 | |
| 145 | - if($point) |
|
| 145 | + if ($point) |
|
| 146 | 146 | { |
| 147 | - $this->_query("ROLLBACK TRANS SP" . $point, $connection); |
|
| 147 | + $this->_query("ROLLBACK TRANS SP".$point, $connection); |
|
| 148 | 148 | } |
| 149 | 149 | else |
| 150 | 150 | { |
@@ -176,18 +176,18 @@ discard block |
||
| 176 | 176 | { |
| 177 | 177 | $_param = array(); |
| 178 | 178 | |
| 179 | - if(count($this->param)) |
|
| 179 | + if (count($this->param)) |
|
| 180 | 180 | { |
| 181 | - foreach($this->param as $k => $o) |
|
| 181 | + foreach ($this->param as $k => $o) |
|
| 182 | 182 | { |
| 183 | - if($o->isColumnName()) |
|
| 183 | + if ($o->isColumnName()) |
|
| 184 | 184 | { |
| 185 | 185 | continue; |
| 186 | 186 | } |
| 187 | - if($o->getType() == 'number') |
|
| 187 | + if ($o->getType() == 'number') |
|
| 188 | 188 | { |
| 189 | 189 | $value = $o->getUnescapedValue(); |
| 190 | - if(is_array($value)) |
|
| 190 | + if (is_array($value)) |
|
| 191 | 191 | { |
| 192 | 192 | $_param = array_merge($_param, $value); |
| 193 | 193 | } |
@@ -199,9 +199,9 @@ discard block |
||
| 199 | 199 | else |
| 200 | 200 | { |
| 201 | 201 | $value = $o->getUnescapedValue(); |
| 202 | - if(is_array($value)) |
|
| 202 | + if (is_array($value)) |
|
| 203 | 203 | { |
| 204 | - foreach($value as $v) |
|
| 204 | + foreach ($value as $v) |
|
| 205 | 205 | { |
| 206 | 206 | $_param[] = array($v, SQLSRV_PARAM_IN, SQLSRV_PHPTYPE_STRING('utf-8')); |
| 207 | 207 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | // Run the query statement |
| 218 | 218 | $result = false; |
| 219 | - if(count($_param)) |
|
| 219 | + if (count($_param)) |
|
| 220 | 220 | { |
| 221 | 221 | $args = $this->_getParametersByReference($_param); |
| 222 | 222 | $stmt = sqlsrv_prepare($connection, $query, $args); |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | $stmt = sqlsrv_prepare($connection, $query); |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - if(!$stmt) |
|
| 229 | + if (!$stmt) |
|
| 230 | 230 | { |
| 231 | 231 | $result = false; |
| 232 | 232 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | // Error Check |
| 239 | - if(!$result) |
|
| 239 | + if (!$result) |
|
| 240 | 240 | { |
| 241 | 241 | $this->setError(print_r(sqlsrv_errors(), true)); |
| 242 | 242 | } |
@@ -259,9 +259,9 @@ discard block |
||
| 259 | 259 | $copy = array(); |
| 260 | 260 | $args = array(); |
| 261 | 261 | $i = 0; |
| 262 | - foreach($_param as $key => $value) |
|
| 262 | + foreach ($_param as $key => $value) |
|
| 263 | 263 | { |
| 264 | - if(is_array($value)) |
|
| 264 | + if (is_array($value)) |
|
| 265 | 265 | { |
| 266 | 266 | $value_copy = $value; |
| 267 | 267 | $value_arg = array(); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | function _fetch($result, $arrayIndexEndValue = NULL) |
| 289 | 289 | { |
| 290 | 290 | $output = array(); |
| 291 | - if(!$this->isConnected() || $this->isError() || !$result) |
|
| 291 | + if (!$this->isConnected() || $this->isError() || !$result) |
|
| 292 | 292 | { |
| 293 | 293 | return $output; |
| 294 | 294 | } |
@@ -296,18 +296,18 @@ discard block |
||
| 296 | 296 | $c = sqlsrv_num_fields($result); |
| 297 | 297 | $m = null; |
| 298 | 298 | |
| 299 | - while(sqlsrv_fetch($result)) |
|
| 299 | + while (sqlsrv_fetch($result)) |
|
| 300 | 300 | { |
| 301 | - if(!$m) |
|
| 301 | + if (!$m) |
|
| 302 | 302 | { |
| 303 | 303 | $m = sqlsrv_field_metadata($result); |
| 304 | 304 | } |
| 305 | 305 | unset($row); |
| 306 | - for($i = 0; $i < $c; $i++) |
|
| 306 | + for ($i = 0; $i < $c; $i++) |
|
| 307 | 307 | { |
| 308 | 308 | $row->{$m[$i]['Name']} = sqlsrv_get_field($result, $i, SQLSRV_PHPTYPE_STRING('utf-8')); |
| 309 | 309 | } |
| 310 | - if($arrayIndexEndValue) |
|
| 310 | + if ($arrayIndexEndValue) |
|
| 311 | 311 | { |
| 312 | 312 | $output[$arrayIndexEndValue--] = $row; |
| 313 | 313 | } |
@@ -317,9 +317,9 @@ discard block |
||
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - if(count($output) == 1) |
|
| 320 | + if (count($output) == 1) |
|
| 321 | 321 | { |
| 322 | - if(isset($arrayIndexEndValue)) |
|
| 322 | + if (isset($arrayIndexEndValue)) |
|
| 323 | 323 | { |
| 324 | 324 | return $output; |
| 325 | 325 | } |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $result = $this->_query($query); |
| 361 | 361 | $tmp = $this->_fetch($result); |
| 362 | 362 | |
| 363 | - if(!$tmp) |
|
| 363 | + if (!$tmp) |
|
| 364 | 364 | { |
| 365 | 365 | return false; |
| 366 | 366 | } |
@@ -379,18 +379,18 @@ discard block |
||
| 379 | 379 | */ |
| 380 | 380 | function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = null, $notnull = false) |
| 381 | 381 | { |
| 382 | - if($this->isColumnExists($table_name, $column_name)) |
|
| 382 | + if ($this->isColumnExists($table_name, $column_name)) |
|
| 383 | 383 | { |
| 384 | 384 | return; |
| 385 | 385 | } |
| 386 | 386 | $type = $this->column_type[$type]; |
| 387 | - if(strtoupper($type) == 'INTEGER') |
|
| 387 | + if (strtoupper($type) == 'INTEGER') |
|
| 388 | 388 | { |
| 389 | 389 | $size = ''; |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | $query = sprintf("alter table %s%s add \"%s\" ", $this->prefix, $table_name, $column_name); |
| 393 | - if($size) |
|
| 393 | + if ($size) |
|
| 394 | 394 | { |
| 395 | 395 | $query .= sprintf(" %s(%s) ", $type, $size); |
| 396 | 396 | } |
@@ -399,11 +399,11 @@ discard block |
||
| 399 | 399 | $query .= sprintf(" %s ", $type); |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | - if(isset($default)) |
|
| 402 | + if (isset($default)) |
|
| 403 | 403 | { |
| 404 | 404 | $query .= sprintf(" default '%s' ", $default); |
| 405 | 405 | } |
| 406 | - if($notnull) |
|
| 406 | + if ($notnull) |
|
| 407 | 407 | { |
| 408 | 408 | $query .= " not null "; |
| 409 | 409 | } |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | */ |
| 420 | 420 | function dropColumn($table_name, $column_name) |
| 421 | 421 | { |
| 422 | - if(!$this->isColumnExists($table_name, $column_name)) |
|
| 422 | + if (!$this->isColumnExists($table_name, $column_name)) |
|
| 423 | 423 | { |
| 424 | 424 | return; |
| 425 | 425 | } |
@@ -437,12 +437,12 @@ discard block |
||
| 437 | 437 | { |
| 438 | 438 | $query = sprintf("select syscolumns.name as name from syscolumns, sysobjects where sysobjects.name = '%s%s' and sysobjects.id = syscolumns.id and syscolumns.name = '%s'", $this->prefix, $table_name, $column_name); |
| 439 | 439 | $result = $this->_query($query); |
| 440 | - if($this->isError()) |
|
| 440 | + if ($this->isError()) |
|
| 441 | 441 | { |
| 442 | 442 | return; |
| 443 | 443 | } |
| 444 | 444 | $tmp = $this->_fetch($result); |
| 445 | - if(!$tmp->name) |
|
| 445 | + if (!$tmp->name) |
|
| 446 | 446 | { |
| 447 | 447 | return false; |
| 448 | 448 | } |
@@ -461,11 +461,11 @@ discard block |
||
| 461 | 461 | */ |
| 462 | 462 | function addIndex($table_name, $index_name, $target_columns, $is_unique = false) |
| 463 | 463 | { |
| 464 | - if($this->isIndexExists($table_name, $index_name)) |
|
| 464 | + if ($this->isIndexExists($table_name, $index_name)) |
|
| 465 | 465 | { |
| 466 | 466 | return; |
| 467 | 467 | } |
| 468 | - if(!is_array($target_columns)) |
|
| 468 | + if (!is_array($target_columns)) |
|
| 469 | 469 | { |
| 470 | 470 | $target_columns = array($target_columns); |
| 471 | 471 | } |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | */ |
| 484 | 484 | function dropIndex($table_name, $index_name, $is_unique = false) |
| 485 | 485 | { |
| 486 | - if(!$this->isIndexExists($table_name, $index_name)) |
|
| 486 | + if (!$this->isIndexExists($table_name, $index_name)) |
|
| 487 | 487 | { |
| 488 | 488 | return; |
| 489 | 489 | } |
@@ -502,13 +502,13 @@ discard block |
||
| 502 | 502 | $query = sprintf("select sysindexes.name as name from sysindexes, sysobjects where sysobjects.name = '%s%s' and sysobjects.id = sysindexes.id and sysindexes.name = '%s'", $this->prefix, $table_name, $index_name); |
| 503 | 503 | |
| 504 | 504 | $result = $this->_query($query); |
| 505 | - if($this->isError()) |
|
| 505 | + if ($this->isError()) |
|
| 506 | 506 | { |
| 507 | 507 | return; |
| 508 | 508 | } |
| 509 | 509 | $tmp = $this->_fetch($result); |
| 510 | 510 | |
| 511 | - if(!$tmp->name) |
|
| 511 | + if (!$tmp->name) |
|
| 512 | 512 | { |
| 513 | 513 | return false; |
| 514 | 514 | } |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | */ |
| 533 | 533 | function createTableByXmlFile($file_name) |
| 534 | 534 | { |
| 535 | - if(!file_exists($file_name)) |
|
| 535 | + if (!file_exists($file_name)) |
|
| 536 | 536 | { |
| 537 | 537 | return; |
| 538 | 538 | } |
@@ -557,22 +557,22 @@ discard block |
||
| 557 | 557 | $xml_obj = $oXml->parse($xml_doc); |
| 558 | 558 | // Create a table schema |
| 559 | 559 | $table_name = $xml_obj->table->attrs->name; |
| 560 | - if($this->isTableExists($table_name)) |
|
| 560 | + if ($this->isTableExists($table_name)) |
|
| 561 | 561 | { |
| 562 | 562 | return; |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | - if($table_name == 'sequence') |
|
| 565 | + if ($table_name == 'sequence') |
|
| 566 | 566 | { |
| 567 | - $table_name = $this->prefix . $table_name; |
|
| 567 | + $table_name = $this->prefix.$table_name; |
|
| 568 | 568 | $query = sprintf('create table %s ( sequence int identity(1,1), seq int )', $table_name); |
| 569 | 569 | return $this->_query($query); |
| 570 | 570 | } |
| 571 | 571 | else |
| 572 | 572 | { |
| 573 | - $table_name = $this->prefix . $table_name; |
|
| 573 | + $table_name = $this->prefix.$table_name; |
|
| 574 | 574 | |
| 575 | - if(!is_array($xml_obj->table->column)) |
|
| 575 | + if (!is_array($xml_obj->table->column)) |
|
| 576 | 576 | { |
| 577 | 577 | $columns[] = $xml_obj->table->column; |
| 578 | 578 | } |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | $index_list = array(); |
| 587 | 587 | |
| 588 | 588 | $typeList = array('number' => 1, 'text' => 1); |
| 589 | - foreach($columns as $column) |
|
| 589 | + foreach ($columns as $column) |
|
| 590 | 590 | { |
| 591 | 591 | $name = $column->attrs->name; |
| 592 | 592 | $type = $column->attrs->type; |
@@ -598,48 +598,48 @@ discard block |
||
| 598 | 598 | $default = $column->attrs->default; |
| 599 | 599 | $auto_increment = $column->attrs->auto_increment; |
| 600 | 600 | |
| 601 | - $column_schema[] = sprintf('[%s] %s%s %s %s %s', $name, $this->column_type[$type], !isset($typeList[$type]) && $size ? '(' . $size . ')' : '', isset($default) ? "default '" . $default . "'" : '', $notnull ? 'not null' : 'null', $auto_increment ? 'identity(1,1)' : ''); |
|
| 601 | + $column_schema[] = sprintf('[%s] %s%s %s %s %s', $name, $this->column_type[$type], !isset($typeList[$type]) && $size ? '('.$size.')' : '', isset($default) ? "default '".$default."'" : '', $notnull ? 'not null' : 'null', $auto_increment ? 'identity(1,1)' : ''); |
|
| 602 | 602 | |
| 603 | - if($primary_key) |
|
| 603 | + if ($primary_key) |
|
| 604 | 604 | { |
| 605 | 605 | $primary_list[] = $name; |
| 606 | 606 | } |
| 607 | - else if($unique) |
|
| 607 | + else if ($unique) |
|
| 608 | 608 | { |
| 609 | 609 | $unique_list[$unique][] = $name; |
| 610 | 610 | } |
| 611 | - else if($index) |
|
| 611 | + else if ($index) |
|
| 612 | 612 | { |
| 613 | 613 | $index_list[$index][] = $name; |
| 614 | 614 | } |
| 615 | 615 | } |
| 616 | 616 | |
| 617 | - if(count($primary_list)) |
|
| 617 | + if (count($primary_list)) |
|
| 618 | 618 | { |
| 619 | - $column_schema[] = sprintf("primary key (%s)", '"' . implode($primary_list, '","') . '"'); |
|
| 619 | + $column_schema[] = sprintf("primary key (%s)", '"'.implode($primary_list, '","').'"'); |
|
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | $schema = sprintf('create table [%s] (%s%s)', $this->addQuotes($table_name), "\n", implode($column_schema, ",\n")); |
| 623 | 623 | $output = $this->_query($schema); |
| 624 | - if(!$output) |
|
| 624 | + if (!$output) |
|
| 625 | 625 | { |
| 626 | 626 | return false; |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | - if(count($unique_list)) |
|
| 629 | + if (count($unique_list)) |
|
| 630 | 630 | { |
| 631 | - foreach($unique_list as $key => $val) |
|
| 631 | + foreach ($unique_list as $key => $val) |
|
| 632 | 632 | { |
| 633 | - $query = sprintf("create unique index %s on %s (%s);", $key, $table_name, '[' . implode('],[', $val) . ']'); |
|
| 633 | + $query = sprintf("create unique index %s on %s (%s);", $key, $table_name, '['.implode('],[', $val).']'); |
|
| 634 | 634 | $this->_query($query); |
| 635 | 635 | } |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | - if(count($index_list)) |
|
| 638 | + if (count($index_list)) |
|
| 639 | 639 | { |
| 640 | - foreach($index_list as $key => $val) |
|
| 640 | + foreach ($index_list as $key => $val) |
|
| 641 | 641 | { |
| 642 | - $query = sprintf("create index %s on %s (%s);", $key, $table_name, '[' . implode('],[', $val) . ']'); |
|
| 642 | + $query = sprintf("create index %s on %s (%s);", $key, $table_name, '['.implode('],[', $val).']'); |
|
| 643 | 643 | $this->_query($query); |
| 644 | 644 | } |
| 645 | 645 | } |
@@ -682,34 +682,34 @@ discard block |
||
| 682 | 682 | function getUpdateSql($query, $with_values = true, $with_priority = false) |
| 683 | 683 | { |
| 684 | 684 | $columnsList = $query->getUpdateString($with_values); |
| 685 | - if($columnsList == '') |
|
| 685 | + if ($columnsList == '') |
|
| 686 | 686 | { |
| 687 | 687 | return new BaseObject(-1, "Invalid query"); |
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | $from = $query->getFromString($with_values); |
| 691 | - if($from == '') |
|
| 691 | + if ($from == '') |
|
| 692 | 692 | { |
| 693 | 693 | return new BaseObject(-1, "Invalid query"); |
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | $tables = $query->getTables(); |
| 697 | 697 | $alias_list = ''; |
| 698 | - foreach($tables as $table) |
|
| 698 | + foreach ($tables as $table) |
|
| 699 | 699 | { |
| 700 | 700 | $alias_list .= $table->getAlias(); |
| 701 | 701 | } |
| 702 | 702 | implode(',', explode(' ', $alias_list)); |
| 703 | 703 | |
| 704 | 704 | $where = $query->getWhereString($with_values); |
| 705 | - if($where != '') |
|
| 705 | + if ($where != '') |
|
| 706 | 706 | { |
| 707 | - $where = ' WHERE ' . $where; |
|
| 707 | + $where = ' WHERE '.$where; |
|
| 708 | 708 | } |
| 709 | 709 | |
| 710 | 710 | $priority = $with_priority ? $query->getPriority() : ''; |
| 711 | 711 | |
| 712 | - return "UPDATE $priority $alias_list SET $columnsList FROM " . $from . $where; |
|
| 712 | + return "UPDATE $priority $alias_list SET $columnsList FROM ".$from.$where; |
|
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | /** |
@@ -730,7 +730,7 @@ discard block |
||
| 730 | 730 | * @param boolean $with_values |
| 731 | 731 | * @return string |
| 732 | 732 | */ |
| 733 | - function getSelectSql($query, $with_values = TRUE, $connection=NULL) |
|
| 733 | + function getSelectSql($query, $with_values = TRUE, $connection = NULL) |
|
| 734 | 734 | { |
| 735 | 735 | $with_values = false; |
| 736 | 736 | |
@@ -740,75 +740,75 @@ discard block |
||
| 740 | 740 | $limit = ''; |
| 741 | 741 | $limitCount = ''; |
| 742 | 742 | $limitQueryPart = $query->getLimit(); |
| 743 | - if($limitQueryPart) |
|
| 743 | + if ($limitQueryPart) |
|
| 744 | 744 | { |
| 745 | 745 | $limitCount = $limitQueryPart->getLimit(); |
| 746 | 746 | } |
| 747 | - if($limitCount != '') |
|
| 747 | + if ($limitCount != '') |
|
| 748 | 748 | { |
| 749 | - $limit = 'SELECT TOP ' . $limitCount; |
|
| 749 | + $limit = 'SELECT TOP '.$limitCount; |
|
| 750 | 750 | } |
| 751 | 751 | |
| 752 | 752 | $select = $query->getSelectString($with_values); |
| 753 | - if($select == '') |
|
| 753 | + if ($select == '') |
|
| 754 | 754 | { |
| 755 | 755 | return new BaseObject(-1, "Invalid query"); |
| 756 | 756 | } |
| 757 | - if($limit != '') |
|
| 757 | + if ($limit != '') |
|
| 758 | 758 | { |
| 759 | - $select = $limit . ' ' . $select; |
|
| 759 | + $select = $limit.' '.$select; |
|
| 760 | 760 | } |
| 761 | 761 | else |
| 762 | 762 | { |
| 763 | - $select = 'SELECT ' . $select; |
|
| 763 | + $select = 'SELECT '.$select; |
|
| 764 | 764 | } |
| 765 | 765 | |
| 766 | 766 | $from = $query->getFromString($with_values); |
| 767 | - if($from == '') |
|
| 767 | + if ($from == '') |
|
| 768 | 768 | { |
| 769 | 769 | return new BaseObject(-1, "Invalid query"); |
| 770 | 770 | } |
| 771 | - $from = ' FROM ' . $from; |
|
| 771 | + $from = ' FROM '.$from; |
|
| 772 | 772 | |
| 773 | 773 | $where = $query->getWhereString($with_values); |
| 774 | - if($where != '') |
|
| 774 | + if ($where != '') |
|
| 775 | 775 | { |
| 776 | - $where = ' WHERE ' . $where; |
|
| 776 | + $where = ' WHERE '.$where; |
|
| 777 | 777 | } |
| 778 | 778 | |
| 779 | 779 | $groupBy = $query->getGroupByString(); |
| 780 | - if($groupBy != '') |
|
| 780 | + if ($groupBy != '') |
|
| 781 | 781 | { |
| 782 | - $groupBy = ' GROUP BY ' . $groupBy; |
|
| 782 | + $groupBy = ' GROUP BY '.$groupBy; |
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | $orderBy = $query->getOrderByString(); |
| 786 | - if($orderBy != '') |
|
| 786 | + if ($orderBy != '') |
|
| 787 | 787 | { |
| 788 | - $orderBy = ' ORDER BY ' . $orderBy; |
|
| 788 | + $orderBy = ' ORDER BY '.$orderBy; |
|
| 789 | 789 | } |
| 790 | 790 | |
| 791 | - if($limitCount != '' && $query->limit->start > 0) |
|
| 791 | + if ($limitCount != '' && $query->limit->start > 0) |
|
| 792 | 792 | { |
| 793 | 793 | $order = $query->getOrder(); |
| 794 | 794 | $first_columns = array(); |
| 795 | - foreach($order as $val) |
|
| 795 | + foreach ($order as $val) |
|
| 796 | 796 | { |
| 797 | 797 | $tmpColumnName = $val->getPureColumnName(); |
| 798 | - $first_columns[] = sprintf('%s(%s) as %s', $val->getPureSortOrder()=='asc'?'max':'min', $tmpColumnName, $tmpColumnName); |
|
| 798 | + $first_columns[] = sprintf('%s(%s) as %s', $val->getPureSortOrder() == 'asc' ? 'max' : 'min', $tmpColumnName, $tmpColumnName); |
|
| 799 | 799 | $first_sub_columns[] = $tmpColumnName; |
| 800 | 800 | } |
| 801 | 801 | |
| 802 | - $first_query = sprintf("select %s from (select top %d %s %s %s %s %s) xet", implode(',',$first_columns), $query->limit->start, implode(',',$first_sub_columns), $from, $where, $groupBy, $orderBy); |
|
| 802 | + $first_query = sprintf("select %s from (select top %d %s %s %s %s %s) xet", implode(',', $first_columns), $query->limit->start, implode(',', $first_sub_columns), $from, $where, $groupBy, $orderBy); |
|
| 803 | 803 | $this->param = $query->getArguments(); |
| 804 | 804 | $result = $this->__query($first_query, $connection); |
| 805 | 805 | $tmp = $this->_fetch($result); |
| 806 | 806 | |
| 807 | 807 | $sub_cond = array(); |
| 808 | - foreach($order as $k => $v) |
|
| 808 | + foreach ($order as $k => $v) |
|
| 809 | 809 | { |
| 810 | 810 | //for example... use Document |
| 811 | - if(get_class($v->sort_order) == 'SortArgument') |
|
| 811 | + if (get_class($v->sort_order) == 'SortArgument') |
|
| 812 | 812 | { |
| 813 | 813 | $sort_order = $v->sort_order->value; |
| 814 | 814 | } |
@@ -818,19 +818,19 @@ discard block |
||
| 818 | 818 | $sort_order = $v->sort_order; |
| 819 | 819 | } |
| 820 | 820 | |
| 821 | - $sub_cond[] = sprintf("%s %s '%s'", $v->getPureColumnName(), $sort_order=='asc'?'>':'<', $tmp->{$v->getPureColumnName()}); |
|
| 821 | + $sub_cond[] = sprintf("%s %s '%s'", $v->getPureColumnName(), $sort_order == 'asc' ? '>' : '<', $tmp->{$v->getPureColumnName()}); |
|
| 822 | 822 | } |
| 823 | 823 | |
| 824 | - if(!$where) |
|
| 824 | + if (!$where) |
|
| 825 | 825 | { |
| 826 | - $sub_condition = ' WHERE ( '.implode(' and ',$sub_cond).' )'; |
|
| 826 | + $sub_condition = ' WHERE ( '.implode(' and ', $sub_cond).' )'; |
|
| 827 | 827 | } |
| 828 | 828 | else |
| 829 | 829 | { |
| 830 | - $sub_condition = ' and ( '.implode(' and ',$sub_cond).' )'; |
|
| 830 | + $sub_condition = ' and ( '.implode(' and ', $sub_cond).' )'; |
|
| 831 | 831 | } |
| 832 | 832 | } |
| 833 | - return $select . ' ' . $from . ' ' . $where .$sub_condition. ' ' . $groupBy . ' ' . $orderBy; |
|
| 833 | + return $select.' '.$from.' '.$where.$sub_condition.' '.$groupBy.' '.$orderBy; |
|
| 834 | 834 | } |
| 835 | 835 | |
| 836 | 836 | /** |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | { |
| 846 | 846 | $query = $this->getSelectSql($queryObject, true, $connection); |
| 847 | 847 | |
| 848 | - if(strpos($query, "substr")) |
|
| 848 | + if (strpos($query, "substr")) |
|
| 849 | 849 | { |
| 850 | 850 | $query = str_replace("substr", "substring", $query); |
| 851 | 851 | } |
@@ -853,10 +853,10 @@ discard block |
||
| 853 | 853 | // TODO Decide if we continue to pass parameters like this |
| 854 | 854 | $this->param = $queryObject->getArguments(); |
| 855 | 855 | |
| 856 | - $query .= (__DEBUG_QUERY__ & 1 && $output->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : ''; |
|
| 856 | + $query .= (__DEBUG_QUERY__ & 1 && $output->query_id) ? sprintf(' '.$this->comment_syntax, $this->query_id) : ''; |
|
| 857 | 857 | $result = $this->_query($query, $connection); |
| 858 | 858 | |
| 859 | - if($this->isError()) |
|
| 859 | + if ($this->isError()) |
|
| 860 | 860 | { |
| 861 | 861 | return $this->queryError($queryObject); |
| 862 | 862 | } |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | function queryError($queryObject) |
| 885 | 885 | { |
| 886 | 886 | $limit = $queryObject->getLimit(); |
| 887 | - if($limit && $limit->isPageHandler()) |
|
| 887 | + if ($limit && $limit->isPageHandler()) |
|
| 888 | 888 | { |
| 889 | 889 | $buff = new BaseObject(); |
| 890 | 890 | $buff->total_count = 0; |
@@ -910,52 +910,52 @@ discard block |
||
| 910 | 910 | function queryPageLimit($queryObject, $result, $connection) |
| 911 | 911 | { |
| 912 | 912 | $limit = $queryObject->getLimit(); |
| 913 | - if($limit && $limit->isPageHandler()) |
|
| 913 | + if ($limit && $limit->isPageHandler()) |
|
| 914 | 914 | { |
| 915 | 915 | // Total count |
| 916 | 916 | $temp_where = $queryObject->getWhereString(true, false); |
| 917 | - $count_query = sprintf('select count(*) as "count" %s %s', 'FROM ' . $queryObject->getFromString(), ($temp_where === '' ? '' : ' WHERE ' . $temp_where)); |
|
| 917 | + $count_query = sprintf('select count(*) as "count" %s %s', 'FROM '.$queryObject->getFromString(), ($temp_where === '' ? '' : ' WHERE '.$temp_where)); |
|
| 918 | 918 | |
| 919 | 919 | // Check for distinct query and if found update count query structure |
| 920 | 920 | $temp_select = $queryObject->getSelectString(true); |
| 921 | 921 | $uses_distinct = stripos($temp_select, "distinct") !== false; |
| 922 | 922 | $uses_groupby = $queryObject->getGroupByString() != ''; |
| 923 | - if($uses_distinct || $uses_groupby) |
|
| 923 | + if ($uses_distinct || $uses_groupby) |
|
| 924 | 924 | { |
| 925 | 925 | $count_query = sprintf('select %s %s %s %s' |
| 926 | 926 | , $temp_select |
| 927 | - , 'FROM ' . $queryObject->getFromString(true) |
|
| 928 | - , ($temp_where === '' ? '' : ' WHERE ' . $temp_where) |
|
| 929 | - , ($uses_groupby ? ' GROUP BY ' . $queryObject->getGroupByString() : '') |
|
| 927 | + , 'FROM '.$queryObject->getFromString(true) |
|
| 928 | + , ($temp_where === '' ? '' : ' WHERE '.$temp_where) |
|
| 929 | + , ($uses_groupby ? ' GROUP BY '.$queryObject->getGroupByString() : '') |
|
| 930 | 930 | ); |
| 931 | 931 | |
| 932 | 932 | // If query uses grouping or distinct, count from original select |
| 933 | 933 | $count_query = sprintf('select count(*) as "count" from (%s) xet', $count_query); |
| 934 | 934 | } |
| 935 | 935 | |
| 936 | - $count_query .= (__DEBUG_QUERY__ & 1 && $queryObject->queryID) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : ''; |
|
| 936 | + $count_query .= (__DEBUG_QUERY__ & 1 && $queryObject->queryID) ? sprintf(' '.$this->comment_syntax, $this->query_id) : ''; |
|
| 937 | 937 | $this->param = $queryObject->getArguments(); |
| 938 | 938 | $result_count = $this->_query($count_query, $connection); |
| 939 | 939 | $count_output = $this->_fetch($result_count); |
| 940 | 940 | $total_count = (int) $count_output->count; |
| 941 | 941 | |
| 942 | 942 | $list_count = $limit->list_count->getValue(); |
| 943 | - if(!$list_count) |
|
| 943 | + if (!$list_count) |
|
| 944 | 944 | { |
| 945 | 945 | $list_count = 20; |
| 946 | 946 | } |
| 947 | 947 | $page_count = $limit->page_count->getValue(); |
| 948 | - if(!$page_count) |
|
| 948 | + if (!$page_count) |
|
| 949 | 949 | { |
| 950 | 950 | $page_count = 10; |
| 951 | 951 | } |
| 952 | 952 | $page = $limit->page->getValue(); |
| 953 | - if(!$page || $page < 1) |
|
| 953 | + if (!$page || $page < 1) |
|
| 954 | 954 | { |
| 955 | 955 | $page = 1; |
| 956 | 956 | } |
| 957 | 957 | // Total pages |
| 958 | - if($total_count) |
|
| 958 | + if ($total_count) |
|
| 959 | 959 | { |
| 960 | 960 | $total_page = (int) (($total_count - 1) / $list_count) + 1; |
| 961 | 961 | } |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | } |
| 966 | 966 | |
| 967 | 967 | // check the page variables |
| 968 | - if($page > $total_page) |
|
| 968 | + if ($page > $total_page) |
|
| 969 | 969 | { |
| 970 | 970 | // If requested page is bigger than total number of pages, return empty list |
| 971 | 971 | |
@@ -977,7 +977,7 @@ discard block |
||
| 977 | 977 | $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); |
| 978 | 978 | return $buff; |
| 979 | 979 | |
| 980 | - if($queryObject->usesClickCount()) |
|
| 980 | + if ($queryObject->usesClickCount()) |
|
| 981 | 981 | { |
| 982 | 982 | $update_query = $this->getClickCountQuery($queryObject); |
| 983 | 983 | $this->_executeUpdateAct($update_query); |
@@ -45,7 +45,9 @@ discard block |
||
| 45 | 45 | function __construct($auto_connect = TRUE) |
| 46 | 46 | { |
| 47 | 47 | $this->_setDBInfo(); |
| 48 | - if($auto_connect) $this->_connect(); |
|
| 48 | + if($auto_connect) { |
|
| 49 | + $this->_connect(); |
|
| 50 | + } |
|
| 49 | 51 | } |
| 50 | 52 | |
| 51 | 53 | /** |
@@ -123,8 +125,7 @@ discard block |
||
| 123 | 125 | { |
| 124 | 126 | return; |
| 125 | 127 | } |
| 126 | - } |
|
| 127 | - else |
|
| 128 | + } else |
|
| 128 | 129 | { |
| 129 | 130 | $this->_query("SAVE TRANS SP" . $transactionLevel, $connection); |
| 130 | 131 | } |
@@ -145,8 +146,7 @@ discard block |
||
| 145 | 146 | if($point) |
| 146 | 147 | { |
| 147 | 148 | $this->_query("ROLLBACK TRANS SP" . $point, $connection); |
| 148 | - } |
|
| 149 | - else |
|
| 149 | + } else |
|
| 150 | 150 | { |
| 151 | 151 | sqlsrv_rollback($connection); |
| 152 | 152 | } |
@@ -190,13 +190,11 @@ discard block |
||
| 190 | 190 | if(is_array($value)) |
| 191 | 191 | { |
| 192 | 192 | $_param = array_merge($_param, $value); |
| 193 | - } |
|
| 194 | - else |
|
| 193 | + } else |
|
| 195 | 194 | { |
| 196 | 195 | $_param[] = $o->getUnescapedValue(); |
| 197 | 196 | } |
| 198 | - } |
|
| 199 | - else |
|
| 197 | + } else |
|
| 200 | 198 | { |
| 201 | 199 | $value = $o->getUnescapedValue(); |
| 202 | 200 | if(is_array($value)) |
@@ -205,8 +203,7 @@ discard block |
||
| 205 | 203 | { |
| 206 | 204 | $_param[] = array($v, SQLSRV_PARAM_IN, SQLSRV_PHPTYPE_STRING('utf-8')); |
| 207 | 205 | } |
| 208 | - } |
|
| 209 | - else |
|
| 206 | + } else |
|
| 210 | 207 | { |
| 211 | 208 | $_param[] = array($value, SQLSRV_PARAM_IN, SQLSRV_PHPTYPE_STRING('utf-8')); |
| 212 | 209 | } |
@@ -220,8 +217,7 @@ discard block |
||
| 220 | 217 | { |
| 221 | 218 | $args = $this->_getParametersByReference($_param); |
| 222 | 219 | $stmt = sqlsrv_prepare($connection, $query, $args); |
| 223 | - } |
|
| 224 | - else |
|
| 220 | + } else |
|
| 225 | 221 | { |
| 226 | 222 | $stmt = sqlsrv_prepare($connection, $query); |
| 227 | 223 | } |
@@ -229,8 +225,7 @@ discard block |
||
| 229 | 225 | if(!$stmt) |
| 230 | 226 | { |
| 231 | 227 | $result = false; |
| 232 | - } |
|
| 233 | - else |
|
| 228 | + } else |
|
| 234 | 229 | { |
| 235 | 230 | $result = sqlsrv_execute($stmt); |
| 236 | 231 | } |
@@ -268,8 +263,7 @@ discard block |
||
| 268 | 263 | $value_arg[] = &$value_copy[0]; |
| 269 | 264 | $value_arg[] = $value_copy[1]; |
| 270 | 265 | $value_arg[] = $value_copy[2]; |
| 271 | - } |
|
| 272 | - else |
|
| 266 | + } else |
|
| 273 | 267 | { |
| 274 | 268 | $value_arg = $value; |
| 275 | 269 | } |
@@ -310,8 +304,7 @@ discard block |
||
| 310 | 304 | if($arrayIndexEndValue) |
| 311 | 305 | { |
| 312 | 306 | $output[$arrayIndexEndValue--] = $row; |
| 313 | - } |
|
| 314 | - else |
|
| 307 | + } else |
|
| 315 | 308 | { |
| 316 | 309 | $output[] = $row; |
| 317 | 310 | } |
@@ -322,8 +315,7 @@ discard block |
||
| 322 | 315 | if(isset($arrayIndexEndValue)) |
| 323 | 316 | { |
| 324 | 317 | return $output; |
| 325 | - } |
|
| 326 | - else |
|
| 318 | + } else |
|
| 327 | 319 | { |
| 328 | 320 | return $output[0]; |
| 329 | 321 | } |
@@ -393,8 +385,7 @@ discard block |
||
| 393 | 385 | if($size) |
| 394 | 386 | { |
| 395 | 387 | $query .= sprintf(" %s(%s) ", $type, $size); |
| 396 | - } |
|
| 397 | - else |
|
| 388 | + } else |
|
| 398 | 389 | { |
| 399 | 390 | $query .= sprintf(" %s ", $type); |
| 400 | 391 | } |
@@ -567,16 +558,14 @@ discard block |
||
| 567 | 558 | $table_name = $this->prefix . $table_name; |
| 568 | 559 | $query = sprintf('create table %s ( sequence int identity(1,1), seq int )', $table_name); |
| 569 | 560 | return $this->_query($query); |
| 570 | - } |
|
| 571 | - else |
|
| 561 | + } else |
|
| 572 | 562 | { |
| 573 | 563 | $table_name = $this->prefix . $table_name; |
| 574 | 564 | |
| 575 | 565 | if(!is_array($xml_obj->table->column)) |
| 576 | 566 | { |
| 577 | 567 | $columns[] = $xml_obj->table->column; |
| 578 | - } |
|
| 579 | - else |
|
| 568 | + } else |
|
| 580 | 569 | { |
| 581 | 570 | $columns = $xml_obj->table->column; |
| 582 | 571 | } |
@@ -603,12 +592,10 @@ discard block |
||
| 603 | 592 | if($primary_key) |
| 604 | 593 | { |
| 605 | 594 | $primary_list[] = $name; |
| 606 | - } |
|
| 607 | - else if($unique) |
|
| 595 | + } else if($unique) |
|
| 608 | 596 | { |
| 609 | 597 | $unique_list[$unique][] = $name; |
| 610 | - } |
|
| 611 | - else if($index) |
|
| 598 | + } else if($index) |
|
| 612 | 599 | { |
| 613 | 600 | $index_list[$index][] = $name; |
| 614 | 601 | } |
@@ -757,8 +744,7 @@ discard block |
||
| 757 | 744 | if($limit != '') |
| 758 | 745 | { |
| 759 | 746 | $select = $limit . ' ' . $select; |
| 760 | - } |
|
| 761 | - else |
|
| 747 | + } else |
|
| 762 | 748 | { |
| 763 | 749 | $select = 'SELECT ' . $select; |
| 764 | 750 | } |
@@ -824,8 +810,7 @@ discard block |
||
| 824 | 810 | if(!$where) |
| 825 | 811 | { |
| 826 | 812 | $sub_condition = ' WHERE ( '.implode(' and ',$sub_cond).' )'; |
| 827 | - } |
|
| 828 | - else |
|
| 813 | + } else |
|
| 829 | 814 | { |
| 830 | 815 | $sub_condition = ' and ( '.implode(' and ',$sub_cond).' )'; |
| 831 | 816 | } |
@@ -859,8 +844,7 @@ discard block |
||
| 859 | 844 | if($this->isError()) |
| 860 | 845 | { |
| 861 | 846 | return $this->queryError($queryObject); |
| 862 | - } |
|
| 863 | - else |
|
| 847 | + } else |
|
| 864 | 848 | { |
| 865 | 849 | return $this->queryPageLimit($queryObject, $result, $connection); |
| 866 | 850 | } |
@@ -893,8 +877,7 @@ discard block |
||
| 893 | 877 | $buff->data = array(); |
| 894 | 878 | $buff->page_navigation = new PageHandler(/* $total_count */0, /* $total_page */1, /* $page */1, /* $page_count */10); //default page handler values |
| 895 | 879 | return $buff; |
| 896 | - } |
|
| 897 | - else |
|
| 880 | + } else |
|
| 898 | 881 | { |
| 899 | 882 | return; |
| 900 | 883 | } |
@@ -958,8 +941,7 @@ discard block |
||
| 958 | 941 | if($total_count) |
| 959 | 942 | { |
| 960 | 943 | $total_page = (int) (($total_count - 1) / $list_count) + 1; |
| 961 | - } |
|
| 962 | - else |
|
| 944 | + } else |
|
| 963 | 945 | { |
| 964 | 946 | $total_page = 1; |
| 965 | 947 | } |
@@ -995,8 +977,7 @@ discard block |
||
| 995 | 977 | $buff->page = $page; |
| 996 | 978 | $buff->data = $data; |
| 997 | 979 | $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); |
| 998 | - } |
|
| 999 | - else |
|
| 980 | + } else |
|
| 1000 | 981 | { |
| 1001 | 982 | $data = $this->_fetch($result); |
| 1002 | 983 | $buff = new BaseObject(); |