@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | static $member_config; |
| 28 | 28 | |
| 29 | - if($member_config) |
|
| 29 | + if ($member_config) |
|
| 30 | 30 | { |
| 31 | 31 | return $member_config; |
| 32 | 32 | } |
@@ -35,42 +35,42 @@ discard block |
||
| 35 | 35 | $oModuleModel = getModel('module'); |
| 36 | 36 | $config = $oModuleModel->getModuleConfig('member'); |
| 37 | 37 | |
| 38 | - if(!$config->signupForm || !is_array($config->signupForm)) |
|
| 38 | + if (!$config->signupForm || !is_array($config->signupForm)) |
|
| 39 | 39 | { |
| 40 | 40 | $oMemberAdminController = getAdminController('member'); |
| 41 | 41 | $identifier = ($config->identifier) ? $config->identifier : 'email_address'; |
| 42 | 42 | $config->signupForm = $oMemberAdminController->createSignupForm($identifier); |
| 43 | 43 | } |
| 44 | 44 | //for multi language |
| 45 | - foreach($config->signupForm AS $key=>$value) |
|
| 45 | + foreach ($config->signupForm AS $key=>$value) |
|
| 46 | 46 | { |
| 47 | 47 | $config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title; |
| 48 | - if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y'; |
|
| 49 | - if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N'; |
|
| 48 | + if ($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y'; |
|
| 49 | + if ($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N'; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // Get terms of user |
| 53 | 53 | $config->agreement = memberModel::_getAgreement(); |
| 54 | 54 | |
| 55 | - if(!$config->webmaster_name) $config->webmaster_name = 'webmaster'; |
|
| 56 | - if(!$config->image_name_max_width) $config->image_name_max_width = 90; |
|
| 57 | - if(!$config->image_name_max_height) $config->image_name_max_height = 20; |
|
| 58 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = 20; |
|
| 59 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = 20; |
|
| 60 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = 90; |
|
| 61 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = 90; |
|
| 62 | - if(!$config->skin) $config->skin = 'default'; |
|
| 63 | - if(!$config->colorset) $config->colorset = 'white'; |
|
| 64 | - if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor'; |
|
| 65 | - if(!$config->group_image_mark) $config->group_image_mark = "N"; |
|
| 55 | + if (!$config->webmaster_name) $config->webmaster_name = 'webmaster'; |
|
| 56 | + if (!$config->image_name_max_width) $config->image_name_max_width = 90; |
|
| 57 | + if (!$config->image_name_max_height) $config->image_name_max_height = 20; |
|
| 58 | + if (!$config->image_mark_max_width) $config->image_mark_max_width = 20; |
|
| 59 | + if (!$config->image_mark_max_height) $config->image_mark_max_height = 20; |
|
| 60 | + if (!$config->profile_image_max_width) $config->profile_image_max_width = 90; |
|
| 61 | + if (!$config->profile_image_max_height) $config->profile_image_max_height = 90; |
|
| 62 | + if (!$config->skin) $config->skin = 'default'; |
|
| 63 | + if (!$config->colorset) $config->colorset = 'white'; |
|
| 64 | + if (!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor'; |
|
| 65 | + if (!$config->group_image_mark) $config->group_image_mark = "N"; |
|
| 66 | 66 | |
| 67 | - if(!$config->identifier) $config->identifier = 'user_id'; |
|
| 67 | + if (!$config->identifier) $config->identifier = 'user_id'; |
|
| 68 | 68 | |
| 69 | - if(!$config->max_error_count) $config->max_error_count = 10; |
|
| 70 | - if(!$config->max_error_count_time) $config->max_error_count_time = 300; |
|
| 69 | + if (!$config->max_error_count) $config->max_error_count = 10; |
|
| 70 | + if (!$config->max_error_count_time) $config->max_error_count_time = 300; |
|
| 71 | 71 | |
| 72 | - if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor'; |
|
| 73 | - if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono'; |
|
| 72 | + if (!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor'; |
|
| 73 | + if (!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono'; |
|
| 74 | 74 | |
| 75 | 75 | $member_config = $config; |
| 76 | 76 | |
@@ -79,24 +79,24 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | function _getAgreement() |
| 81 | 81 | { |
| 82 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
| 83 | - if(is_readable($agreement_file)) |
|
| 82 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
| 83 | + if (is_readable($agreement_file)) |
|
| 84 | 84 | { |
| 85 | 85 | return FileHandler::readFile($agreement_file); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $db_info = Context::getDBInfo(); |
| 89 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $db_info->lang_type . '.txt'; |
|
| 90 | - if(is_readable($agreement_file)) |
|
| 89 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$db_info->lang_type.'.txt'; |
|
| 90 | + if (is_readable($agreement_file)) |
|
| 91 | 91 | { |
| 92 | 92 | return FileHandler::readFile($agreement_file); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $lang_selected = Context::loadLangSelected(); |
| 96 | - foreach($lang_selected as $key => $val) |
|
| 96 | + foreach ($lang_selected as $key => $val) |
|
| 97 | 97 | { |
| 98 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $key . '.txt'; |
|
| 99 | - if(is_readable($agreement_file)) |
|
| 98 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$key.'.txt'; |
|
| 99 | + if (is_readable($agreement_file)) |
|
| 100 | 100 | { |
| 101 | 101 | return FileHandler::readFile($agreement_file); |
| 102 | 102 | } |
@@ -116,12 +116,12 @@ discard block |
||
| 116 | 116 | $logged_info = Context::get('logged_info'); |
| 117 | 117 | $act = Context::get('cur_act'); |
| 118 | 118 | // When click user's own nickname |
| 119 | - if($member_srl == $logged_info->member_srl) $member_info = $logged_info; |
|
| 119 | + if ($member_srl == $logged_info->member_srl) $member_info = $logged_info; |
|
| 120 | 120 | // When click other's nickname |
| 121 | 121 | else $member_info = $this->getMemberInfoByMemberSrl($member_srl); |
| 122 | 122 | |
| 123 | 123 | $member_srl = $member_info->member_srl; |
| 124 | - if(!$member_srl) return; |
|
| 124 | + if (!$member_srl) return; |
|
| 125 | 125 | // List variables |
| 126 | 126 | $user_id = $member_info->user_id; |
| 127 | 127 | $user_name = $member_info->user_name; |
@@ -130,18 +130,18 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | $oMemberController = getController('member'); |
| 132 | 132 | // Display member information (Don't display to non-logged user) |
| 133 | - if($logged_info->member_srl) |
|
| 133 | + if ($logged_info->member_srl) |
|
| 134 | 134 | { |
| 135 | - $url = getUrl('','mid',$mid,'act','dispMemberInfo','member_srl',$member_srl); |
|
| 136 | - $oMemberController->addMemberPopupMenu($url,'cmd_view_member_info',$icon_path,'self'); |
|
| 135 | + $url = getUrl('', 'mid', $mid, 'act', 'dispMemberInfo', 'member_srl', $member_srl); |
|
| 136 | + $oMemberController->addMemberPopupMenu($url, 'cmd_view_member_info', $icon_path, 'self'); |
|
| 137 | 137 | } |
| 138 | 138 | // When click other's nickname |
| 139 | - if($member_srl != $logged_info->member_srl && $logged_info->member_srl) |
|
| 139 | + if ($member_srl != $logged_info->member_srl && $logged_info->member_srl) |
|
| 140 | 140 | { |
| 141 | 141 | // Get email config |
| 142 | - foreach($this->module_config->signupForm as $field) |
|
| 142 | + foreach ($this->module_config->signupForm as $field) |
|
| 143 | 143 | { |
| 144 | - if($field->name == 'email_address') |
|
| 144 | + if ($field->name == 'email_address') |
|
| 145 | 145 | { |
| 146 | 146 | $email_config = $field; |
| 147 | 147 | break; |
@@ -149,36 +149,36 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // Send an email only if email address is public |
| 152 | - if(($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address) |
|
| 152 | + if (($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address) |
|
| 153 | 153 | { |
| 154 | 154 | $url = 'mailto:'.htmlspecialchars($member_info->email_address, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 155 | - $oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path); |
|
| 155 | + $oMemberController->addMemberPopupMenu($url, 'cmd_send_email', $icon_path); |
|
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | // View homepage info |
| 159 | - if($member_info->homepage) |
|
| 159 | + if ($member_info->homepage) |
|
| 160 | 160 | $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank'); |
| 161 | 161 | // View blog info |
| 162 | - if($member_info->blog) |
|
| 162 | + if ($member_info->blog) |
|
| 163 | 163 | $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank'); |
| 164 | 164 | // Call a trigger (after) |
| 165 | 165 | ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null); |
| 166 | 166 | // Display a menu for editting member info to a top administrator |
| 167 | - if($logged_info->is_admin == 'Y') |
|
| 167 | + if ($logged_info->is_admin == 'Y') |
|
| 168 | 168 | { |
| 169 | - $url = getUrl('','module','admin','act','dispMemberAdminInsert','member_srl',$member_srl); |
|
| 170 | - $oMemberController->addMemberPopupMenu($url,'cmd_manage_member_info',$icon_path,'MemberModifyInfo'); |
|
| 169 | + $url = getUrl('', 'module', 'admin', 'act', 'dispMemberAdminInsert', 'member_srl', $member_srl); |
|
| 170 | + $oMemberController->addMemberPopupMenu($url, 'cmd_manage_member_info', $icon_path, 'MemberModifyInfo'); |
|
| 171 | 171 | |
| 172 | - $url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','member_srl','search_keyword',$member_srl); |
|
| 173 | - $oMemberController->addMemberPopupMenu($url,'cmd_trace_document',$icon_path,'TraceMemberDocument'); |
|
| 172 | + $url = getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl); |
|
| 173 | + $oMemberController->addMemberPopupMenu($url, 'cmd_trace_document', $icon_path, 'TraceMemberDocument'); |
|
| 174 | 174 | |
| 175 | - $url = getUrl('','module','admin','act','dispCommentAdminList','search_target','member_srl','search_keyword',$member_srl); |
|
| 176 | - $oMemberController->addMemberPopupMenu($url,'cmd_trace_comment',$icon_path,'TraceMemberComment'); |
|
| 175 | + $url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl); |
|
| 176 | + $oMemberController->addMemberPopupMenu($url, 'cmd_trace_comment', $icon_path, 'TraceMemberComment'); |
|
| 177 | 177 | } |
| 178 | 178 | // Change a language of pop-up menu |
| 179 | 179 | $menus = Context::get('member_popup_menu_list'); |
| 180 | 180 | $menus_count = count($menus); |
| 181 | - for($i=0;$i<$menus_count;$i++) |
|
| 181 | + for ($i = 0; $i < $menus_count; $i++) |
|
| 182 | 182 | { |
| 183 | 183 | $menus[$i]->str = Context::getLang($menus[$i]->str); |
| 184 | 184 | } |
@@ -190,16 +190,16 @@ discard block |
||
| 190 | 190 | * @brief Check if logged-in |
| 191 | 191 | */ |
| 192 | 192 | function isLogged() { |
| 193 | - if($_SESSION['is_logged']) |
|
| 193 | + if ($_SESSION['is_logged']) |
|
| 194 | 194 | { |
| 195 | - if(Mobile::isFromMobilePhone()) |
|
| 195 | + if (Mobile::isFromMobilePhone()) |
|
| 196 | 196 | { |
| 197 | 197 | return true; |
| 198 | 198 | } |
| 199 | - elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
| 199 | + elseif (filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
| 200 | 200 | { |
| 201 | 201 | // IPv6: require same /48 |
| 202 | - if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0) |
|
| 202 | + if (strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0) |
|
| 203 | 203 | { |
| 204 | 204 | return true; |
| 205 | 205 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | else |
| 208 | 208 | { |
| 209 | 209 | // IPv4: require same /24 |
| 210 | - if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) |
|
| 210 | + if (ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) |
|
| 211 | 211 | { |
| 212 | 212 | return true; |
| 213 | 213 | } |
@@ -224,23 +224,23 @@ discard block |
||
| 224 | 224 | function getLoggedInfo() |
| 225 | 225 | { |
| 226 | 226 | // Return session info if session info is requested and the user is logged-in |
| 227 | - if($this->isLogged()) |
|
| 227 | + if ($this->isLogged()) |
|
| 228 | 228 | { |
| 229 | 229 | $logged_info = Context::get('logged_info'); |
| 230 | 230 | // Admin/Group list defined depending on site_module_info |
| 231 | 231 | $site_module_info = Context::get('site_module_info'); |
| 232 | - if($site_module_info->site_srl) |
|
| 232 | + if ($site_module_info->site_srl) |
|
| 233 | 233 | { |
| 234 | 234 | $logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl); |
| 235 | 235 | // Add is_site_admin bool variable into logged_info if site_administrator is |
| 236 | 236 | $oModuleModel = getModel('module'); |
| 237 | - if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; |
|
| 237 | + if ($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; |
|
| 238 | 238 | else $logged_info->is_site_admin = false; |
| 239 | 239 | } |
| 240 | 240 | else |
| 241 | 241 | { |
| 242 | 242 | // Register a default group if the site doesn't have a member group |
| 243 | - if(count($logged_info->group_list) === 0) |
|
| 243 | + if (count($logged_info->group_list) === 0) |
|
| 244 | 244 | { |
| 245 | 245 | $default_group = $this->getDefaultGroup(0); |
| 246 | 246 | $oMemberController = getController('member'); |
@@ -263,13 +263,13 @@ discard block |
||
| 263 | 263 | */ |
| 264 | 264 | function getMemberInfoByUserID($user_id, $columnList = array()) |
| 265 | 265 | { |
| 266 | - if(!$user_id) return; |
|
| 266 | + if (!$user_id) return; |
|
| 267 | 267 | |
| 268 | 268 | $args = new stdClass; |
| 269 | 269 | $args->user_id = $user_id; |
| 270 | 270 | $output = executeQuery('member.getMemberInfo', $args); |
| 271 | - if(!$output->toBool()) return $output; |
|
| 272 | - if(!$output->data) return; |
|
| 271 | + if (!$output->toBool()) return $output; |
|
| 272 | + if (!$output->data) return; |
|
| 273 | 273 | |
| 274 | 274 | $member_info = $this->arrangeMemberInfo($output->data); |
| 275 | 275 | |
@@ -281,12 +281,12 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | function getMemberInfoByEmailAddress($email_address) |
| 283 | 283 | { |
| 284 | - if(!$email_address) return; |
|
| 284 | + if (!$email_address) return; |
|
| 285 | 285 | |
| 286 | 286 | $args = new stdClass(); |
| 287 | 287 | |
| 288 | - $db_info = Context::getDBInfo (); |
|
| 289 | - if($db_info->master_db['db_type'] == "cubrid") |
|
| 288 | + $db_info = Context::getDBInfo(); |
|
| 289 | + if ($db_info->master_db['db_type'] == "cubrid") |
|
| 290 | 290 | { |
| 291 | 291 | $args->email_address = strtolower($email_address); |
| 292 | 292 | $output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args); |
@@ -297,8 +297,8 @@ discard block |
||
| 297 | 297 | $output = executeQuery('member.getMemberInfoByEmailAddress', $args); |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | - if(!$output->toBool()) return $output; |
|
| 301 | - if(!$output->data) return; |
|
| 300 | + if (!$output->toBool()) return $output; |
|
| 301 | + if (!$output->data) return; |
|
| 302 | 302 | |
| 303 | 303 | $member_info = $this->arrangeMemberInfo($output->data); |
| 304 | 304 | return $member_info; |
@@ -309,36 +309,36 @@ discard block |
||
| 309 | 309 | */ |
| 310 | 310 | function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array()) |
| 311 | 311 | { |
| 312 | - if(!$member_srl) return; |
|
| 312 | + if (!$member_srl) return; |
|
| 313 | 313 | |
| 314 | 314 | //columnList size zero... get full member info |
| 315 | - if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0) |
|
| 315 | + if (!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0) |
|
| 316 | 316 | { |
| 317 | 317 | $GLOBALS['__member_info__'][$member_srl] = false; |
| 318 | 318 | |
| 319 | 319 | $oCacheHandler = CacheHandler::getInstance('object'); |
| 320 | - if($oCacheHandler->isSupport()) |
|
| 320 | + if ($oCacheHandler->isSupport()) |
|
| 321 | 321 | { |
| 322 | 322 | $columnList = array(); |
| 323 | - $object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl; |
|
| 323 | + $object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl; |
|
| 324 | 324 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 325 | 325 | $GLOBALS['__member_info__'][$member_srl] = $oCacheHandler->get($cache_key); |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | - if($GLOBALS['__member_info__'][$member_srl] === false) |
|
| 328 | + if ($GLOBALS['__member_info__'][$member_srl] === false) |
|
| 329 | 329 | { |
| 330 | 330 | $args = new stdClass(); |
| 331 | 331 | $args->member_srl = $member_srl; |
| 332 | 332 | $output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList); |
| 333 | - if(!$output->data) |
|
| 333 | + if (!$output->data) |
|
| 334 | 334 | { |
| 335 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass); |
|
| 335 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass); |
|
| 336 | 336 | return; |
| 337 | 337 | } |
| 338 | 338 | $this->arrangeMemberInfo($output->data, $site_srl); |
| 339 | 339 | |
| 340 | 340 | //insert in cache |
| 341 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
| 341 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
| 342 | 342 | } |
| 343 | 343 | } |
| 344 | 344 | |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | */ |
| 351 | 351 | function arrangeMemberInfo($info, $site_srl = 0) |
| 352 | 352 | { |
| 353 | - if(!$GLOBALS['__member_info__'][$info->member_srl]) |
|
| 353 | + if (!$GLOBALS['__member_info__'][$info->member_srl]) |
|
| 354 | 354 | { |
| 355 | 355 | $oModuleModel = getModel('module'); |
| 356 | 356 | $config = $oModuleModel->getModuleConfig('member'); |
@@ -359,25 +359,25 @@ discard block |
||
| 359 | 359 | $info->profile_image = $this->getProfileImage($info->member_srl); |
| 360 | 360 | $info->image_name = $this->getImageName($info->member_srl); |
| 361 | 361 | $info->image_mark = $this->getImageMark($info->member_srl); |
| 362 | - if($config->group_image_mark=='Y') |
|
| 362 | + if ($config->group_image_mark == 'Y') |
|
| 363 | 363 | { |
| 364 | - $info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl); |
|
| 364 | + $info->group_mark = $this->getGroupImageMark($info->member_srl, $site_srl); |
|
| 365 | 365 | } |
| 366 | 366 | $info->signature = $this->getSignature($info->member_srl); |
| 367 | 367 | $info->group_list = $this->getMemberGroups($info->member_srl, $site_srl); |
| 368 | 368 | |
| 369 | 369 | $extra_vars = unserialize($info->extra_vars); |
| 370 | 370 | unset($info->extra_vars); |
| 371 | - if($extra_vars) |
|
| 371 | + if ($extra_vars) |
|
| 372 | 372 | { |
| 373 | - foreach($extra_vars as $key => $val) |
|
| 373 | + foreach ($extra_vars as $key => $val) |
|
| 374 | 374 | { |
| 375 | - if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val); |
|
| 376 | - if(!$info->{$key}) $info->{$key} = $val; |
|
| 375 | + if (!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val); |
|
| 376 | + if (!$info->{$key}) $info->{$key} = $val; |
|
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | - if(strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer)) |
|
| 380 | + if (strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer)) |
|
| 381 | 381 | { |
| 382 | 382 | $info->find_account_answer = null; |
| 383 | 383 | } |
@@ -389,13 +389,13 @@ discard block |
||
| 389 | 389 | $info->homepage = strip_tags($info->homepage); |
| 390 | 390 | $info->blog = strip_tags($info->blog); |
| 391 | 391 | |
| 392 | - if($extra_vars) |
|
| 392 | + if ($extra_vars) |
|
| 393 | 393 | { |
| 394 | - foreach($extra_vars as $key => $val) |
|
| 394 | + foreach ($extra_vars as $key => $val) |
|
| 395 | 395 | { |
| 396 | - if(is_array($val)) |
|
| 396 | + if (is_array($val)) |
|
| 397 | 397 | { |
| 398 | - $oSecurity->encodeHTML($key . '.'); |
|
| 398 | + $oSecurity->encodeHTML($key.'.'); |
|
| 399 | 399 | } |
| 400 | 400 | else |
| 401 | 401 | { |
@@ -406,12 +406,12 @@ discard block |
||
| 406 | 406 | |
| 407 | 407 | // Check format. |
| 408 | 408 | $oValidator = new Validator(); |
| 409 | - if(!$oValidator->applyRule('url', $info->homepage)) |
|
| 409 | + if (!$oValidator->applyRule('url', $info->homepage)) |
|
| 410 | 410 | { |
| 411 | 411 | $info->homepage = ''; |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | - if(!$oValidator->applyRule('url', $info->blog)) |
|
| 414 | + if (!$oValidator->applyRule('url', $info->blog)) |
|
| 415 | 415 | { |
| 416 | 416 | $info->blog = ''; |
| 417 | 417 | } |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | */ |
| 461 | 461 | function getLoggedMemberSrl() |
| 462 | 462 | { |
| 463 | - if(!$this->isLogged()) return; |
|
| 463 | + if (!$this->isLogged()) return; |
|
| 464 | 464 | return $_SESSION['member_srl']; |
| 465 | 465 | } |
| 466 | 466 | |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | */ |
| 470 | 470 | function getLoggedUserID() |
| 471 | 471 | { |
| 472 | - if(!$this->isLogged()) return; |
|
| 472 | + if (!$this->isLogged()) return; |
|
| 473 | 473 | $logged_info = Context::get('logged_info'); |
| 474 | 474 | return $logged_info->user_id; |
| 475 | 475 | } |
@@ -484,16 +484,16 @@ discard block |
||
| 484 | 484 | // cache controll |
| 485 | 485 | $group_list = false; |
| 486 | 486 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
| 487 | - if($oCacheHandler->isSupport()) |
|
| 487 | + if ($oCacheHandler->isSupport()) |
|
| 488 | 488 | { |
| 489 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_'.$site_srl; |
|
| 489 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl; |
|
| 490 | 490 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 491 | 491 | $group_list = $oCacheHandler->get($cache_key); |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | - if(!$member_groups[$member_srl][$site_srl] || $force_reload) |
|
| 494 | + if (!$member_groups[$member_srl][$site_srl] || $force_reload) |
|
| 495 | 495 | { |
| 496 | - if($group_list === false) |
|
| 496 | + if ($group_list === false) |
|
| 497 | 497 | { |
| 498 | 498 | $args = new stdClass(); |
| 499 | 499 | $args->member_srl = $member_srl; |
@@ -501,11 +501,11 @@ discard block |
||
| 501 | 501 | $output = executeQueryArray('member.getMemberGroups', $args); |
| 502 | 502 | $group_list = $output->data; |
| 503 | 503 | //insert in cache |
| 504 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
| 504 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
| 505 | 505 | } |
| 506 | - if(!$group_list) return array(); |
|
| 506 | + if (!$group_list) return array(); |
|
| 507 | 507 | |
| 508 | - foreach($group_list as $group) |
|
| 508 | + foreach ($group_list as $group) |
|
| 509 | 509 | { |
| 510 | 510 | $result[$group->group_srl] = $group->title; |
| 511 | 511 | } |
@@ -519,14 +519,14 @@ discard block |
||
| 519 | 519 | */ |
| 520 | 520 | function getMembersGroups($member_srls, $site_srl = 0) |
| 521 | 521 | { |
| 522 | - $args->member_srls = implode(',',$member_srls); |
|
| 522 | + $args->member_srls = implode(',', $member_srls); |
|
| 523 | 523 | $args->site_srl = $site_srl; |
| 524 | 524 | $args->sort_index = 'list_order'; |
| 525 | 525 | $output = executeQueryArray('member.getMembersGroups', $args); |
| 526 | - if(!$output->data) return array(); |
|
| 526 | + if (!$output->data) return array(); |
|
| 527 | 527 | |
| 528 | 528 | $result = array(); |
| 529 | - foreach($output->data as $key=>$val) |
|
| 529 | + foreach ($output->data as $key=>$val) |
|
| 530 | 530 | { |
| 531 | 531 | $result[$val->member_srl][] = $val->title; |
| 532 | 532 | } |
@@ -540,21 +540,21 @@ discard block |
||
| 540 | 540 | { |
| 541 | 541 | $default_group = false; |
| 542 | 542 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
| 543 | - if($oCacheHandler->isSupport()) |
|
| 543 | + if ($oCacheHandler->isSupport()) |
|
| 544 | 544 | { |
| 545 | 545 | $columnList = array(); |
| 546 | - $object_key = 'default_group_' . $site_srl; |
|
| 546 | + $object_key = 'default_group_'.$site_srl; |
|
| 547 | 547 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 548 | 548 | $default_group = $oCacheHandler->get($cache_key); |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | - if($default_group === false) |
|
| 551 | + if ($default_group === false) |
|
| 552 | 552 | { |
| 553 | 553 | $args = new stdClass(); |
| 554 | 554 | $args->site_srl = $site_srl; |
| 555 | 555 | $output = executeQuery('member.getDefaultGroup', $args, $columnList); |
| 556 | 556 | $default_group = $output->data; |
| 557 | - if($oCacheHandler->isSupport()) |
|
| 557 | + if ($oCacheHandler->isSupport()) |
|
| 558 | 558 | { |
| 559 | 559 | $oCacheHandler->put($cache_key, $default_group); |
| 560 | 560 | } |
@@ -588,25 +588,25 @@ discard block |
||
| 588 | 588 | */ |
| 589 | 589 | function getGroups($site_srl = 0) |
| 590 | 590 | { |
| 591 | - if(!$GLOBALS['__group_info__'][$site_srl]) |
|
| 591 | + if (!$GLOBALS['__group_info__'][$site_srl]) |
|
| 592 | 592 | { |
| 593 | 593 | $result = array(); |
| 594 | 594 | |
| 595 | - if(!isset($site_srl)) |
|
| 595 | + if (!isset($site_srl)) |
|
| 596 | 596 | { |
| 597 | 597 | $site_srl = 0; |
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | $group_list = false; |
| 601 | 601 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
| 602 | - if($oCacheHandler->isSupport()) |
|
| 602 | + if ($oCacheHandler->isSupport()) |
|
| 603 | 603 | { |
| 604 | 604 | $object_key = 'member_groups:site_'.$site_srl; |
| 605 | 605 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 606 | 606 | $group_list = $oCacheHandler->get($cache_key); |
| 607 | 607 | } |
| 608 | 608 | |
| 609 | - if($group_list === false) |
|
| 609 | + if ($group_list === false) |
|
| 610 | 610 | { |
| 611 | 611 | $args = new stdClass(); |
| 612 | 612 | $args->site_srl = $site_srl; |
@@ -615,16 +615,16 @@ discard block |
||
| 615 | 615 | $output = executeQueryArray('member.getGroups', $args); |
| 616 | 616 | $group_list = $output->data; |
| 617 | 617 | //insert in cache |
| 618 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
| 618 | + if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
| 619 | 619 | } |
| 620 | 620 | |
| 621 | - if(!$group_list) |
|
| 621 | + if (!$group_list) |
|
| 622 | 622 | { |
| 623 | 623 | return array(); |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | |
| 627 | - foreach($group_list as $val) |
|
| 627 | + foreach ($group_list as $val) |
|
| 628 | 628 | { |
| 629 | 629 | $result[$val->group_srl] = $val; |
| 630 | 630 | } |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | // Set to ignore if a super administrator. |
| 656 | 656 | $logged_info = Context::get('logged_info'); |
| 657 | 657 | |
| 658 | - if(!$this->join_form_list) |
|
| 658 | + if (!$this->join_form_list) |
|
| 659 | 659 | { |
| 660 | 660 | // Argument setting to sort list_order column |
| 661 | 661 | $args = new stdClass(); |
@@ -663,11 +663,11 @@ discard block |
||
| 663 | 663 | $output = executeQuery('member.getJoinFormList', $args); |
| 664 | 664 | // NULL if output data deosn't exist |
| 665 | 665 | $join_form_list = $output->data; |
| 666 | - if(!$join_form_list) return NULL; |
|
| 666 | + if (!$join_form_list) return NULL; |
|
| 667 | 667 | // Need to unserialize because serialized array is inserted into DB in case of default_value |
| 668 | - if(!is_array($join_form_list)) $join_form_list = array($join_form_list); |
|
| 668 | + if (!is_array($join_form_list)) $join_form_list = array($join_form_list); |
|
| 669 | 669 | $join_form_count = count($join_form_list); |
| 670 | - for($i=0;$i<$join_form_count;$i++) |
|
| 670 | + for ($i = 0; $i < $join_form_count; $i++) |
|
| 671 | 671 | { |
| 672 | 672 | $join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name); |
| 673 | 673 | |
@@ -679,10 +679,10 @@ discard block |
||
| 679 | 679 | // Add language variable |
| 680 | 680 | $lang->extend_vars[$column_name] = $column_title; |
| 681 | 681 | // unserialize if the data type if checkbox, select and so on |
| 682 | - if(in_array($column_type, array('checkbox','select','radio'))) |
|
| 682 | + if (in_array($column_type, array('checkbox', 'select', 'radio'))) |
|
| 683 | 683 | { |
| 684 | 684 | $join_form_list[$i]->default_value = unserialize($default_value); |
| 685 | - if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = ''; |
|
| 685 | + if (!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = ''; |
|
| 686 | 686 | } |
| 687 | 687 | else |
| 688 | 688 | { |
@@ -694,16 +694,16 @@ discard block |
||
| 694 | 694 | $this->join_form_list = $list; |
| 695 | 695 | } |
| 696 | 696 | // Get object style if the filter_response is true |
| 697 | - if($filter_response && count($this->join_form_list)) |
|
| 697 | + if ($filter_response && count($this->join_form_list)) |
|
| 698 | 698 | { |
| 699 | - foreach($this->join_form_list as $key => $val) |
|
| 699 | + foreach ($this->join_form_list as $key => $val) |
|
| 700 | 700 | { |
| 701 | - if($val->is_active != 'Y') continue; |
|
| 701 | + if ($val->is_active != 'Y') continue; |
|
| 702 | 702 | unset($obj); |
| 703 | 703 | $obj->type = $val->column_type; |
| 704 | 704 | $obj->name = $val->column_name; |
| 705 | 705 | $obj->lang = $val->column_title; |
| 706 | - if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false; |
|
| 706 | + if ($logged_info->is_admin != 'Y') $obj->required = $val->required == 'Y' ? true : false; |
|
| 707 | 707 | else $obj->required = false; |
| 708 | 708 | $filter_output[] = $obj; |
| 709 | 709 | |
@@ -730,15 +730,15 @@ discard block |
||
| 730 | 730 | $args->sort_index = "list_order"; |
| 731 | 731 | $output = executeQueryArray('member.getJoinFormList', $args); |
| 732 | 732 | |
| 733 | - if(!$output->toBool()) |
|
| 733 | + if (!$output->toBool()) |
|
| 734 | 734 | { |
| 735 | 735 | return array(); |
| 736 | 736 | } |
| 737 | 737 | |
| 738 | 738 | $joinFormList = array(); |
| 739 | - foreach($output->data as $val) |
|
| 739 | + foreach ($output->data as $val) |
|
| 740 | 740 | { |
| 741 | - if($val->is_active != 'Y') |
|
| 741 | + if ($val->is_active != 'Y') |
|
| 742 | 742 | { |
| 743 | 743 | continue; |
| 744 | 744 | } |
@@ -755,20 +755,20 @@ discard block |
||
| 755 | 755 | function getCombineJoinForm($member_info) |
| 756 | 756 | { |
| 757 | 757 | $extend_form_list = $this->getJoinFormlist(); |
| 758 | - if(!$extend_form_list) return; |
|
| 758 | + if (!$extend_form_list) return; |
|
| 759 | 759 | // Member info is open only to an administrator and him/herself when is_private is true. |
| 760 | 760 | $logged_info = Context::get('logged_info'); |
| 761 | 761 | |
| 762 | - foreach($extend_form_list as $srl => $item) |
|
| 762 | + foreach ($extend_form_list as $srl => $item) |
|
| 763 | 763 | { |
| 764 | 764 | $column_name = $item->column_name; |
| 765 | 765 | $value = $member_info->{$column_name}; |
| 766 | 766 | |
| 767 | 767 | // Change values depening on the type of extend form |
| 768 | - switch($item->column_type) |
|
| 768 | + switch ($item->column_type) |
|
| 769 | 769 | { |
| 770 | 770 | case 'checkbox' : |
| 771 | - if($value && !is_array($value)) $value = array($value); |
|
| 771 | + if ($value && !is_array($value)) $value = array($value); |
|
| 772 | 772 | break; |
| 773 | 773 | case 'text' : |
| 774 | 774 | case 'homepage' : |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | |
| 783 | 783 | $extend_form_list[$srl]->value = $value; |
| 784 | 784 | |
| 785 | - if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true; |
|
| 785 | + if ($member_info->{'open_'.$column_name} == 'Y') $extend_form_list[$srl]->is_opened = true; |
|
| 786 | 786 | else $extend_form_list[$srl]->is_opened = false; |
| 787 | 787 | } |
| 788 | 788 | return $extend_form_list; |
@@ -796,12 +796,12 @@ discard block |
||
| 796 | 796 | $args->member_join_form_srl = $member_join_form_srl; |
| 797 | 797 | $output = executeQuery('member.getJoinForm', $args); |
| 798 | 798 | $join_form = $output->data; |
| 799 | - if(!$join_form) return NULL; |
|
| 799 | + if (!$join_form) return NULL; |
|
| 800 | 800 | |
| 801 | 801 | $column_type = $join_form->column_type; |
| 802 | 802 | $default_value = $join_form->default_value; |
| 803 | 803 | |
| 804 | - if(in_array($column_type, array('checkbox','select','radio'))) |
|
| 804 | + if (in_array($column_type, array('checkbox', 'select', 'radio'))) |
|
| 805 | 805 | { |
| 806 | 806 | $join_form->default_value = unserialize($default_value); |
| 807 | 807 | } |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | */ |
| 819 | 819 | function getDeniedIDList() |
| 820 | 820 | { |
| 821 | - if(!$this->denied_id_list) |
|
| 821 | + if (!$this->denied_id_list) |
|
| 822 | 822 | { |
| 823 | 823 | $args->sort_index = "list_order"; |
| 824 | 824 | $args->page = Context::get('page'); |
@@ -834,14 +834,14 @@ discard block |
||
| 834 | 834 | function getDeniedIDs() |
| 835 | 835 | { |
| 836 | 836 | $output = executeQueryArray('member.getDeniedIDs'); |
| 837 | - if(!$output->toBool()) return array(); |
|
| 837 | + if (!$output->toBool()) return array(); |
|
| 838 | 838 | return $output->data; |
| 839 | 839 | } |
| 840 | 840 | |
| 841 | 841 | function getDeniedNickNames() |
| 842 | 842 | { |
| 843 | 843 | $output = executeQueryArray('member.getDeniedNickNames'); |
| 844 | - if(!$output->toBool()) |
|
| 844 | + if (!$output->toBool()) |
|
| 845 | 845 | { |
| 846 | 846 | return array(); |
| 847 | 847 | } |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | $args = new stdClass(); |
| 858 | 858 | $args->user_id = $user_id; |
| 859 | 859 | $output = executeQuery('member.chkDeniedID', $args); |
| 860 | - if($output->data->count) return true; |
|
| 860 | + if ($output->data->count) return true; |
|
| 861 | 861 | return false; |
| 862 | 862 | } |
| 863 | 863 | |
@@ -869,8 +869,8 @@ discard block |
||
| 869 | 869 | $args = new stdClass(); |
| 870 | 870 | $args->nick_name = $nickName; |
| 871 | 871 | $output = executeQuery('member.chkDeniedNickName', $args); |
| 872 | - if($output->data->count) return true; |
|
| 873 | - if(!$output->toBool()) |
|
| 872 | + if ($output->data->count) return true; |
|
| 873 | + if (!$output->toBool()) |
|
| 874 | 874 | { |
| 875 | 875 | return true; |
| 876 | 876 | } |
@@ -881,20 +881,20 @@ discard block |
||
| 881 | 881 | */ |
| 882 | 882 | function getProfileImage($member_srl) |
| 883 | 883 | { |
| 884 | - if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) |
|
| 884 | + if (!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) |
|
| 885 | 885 | { |
| 886 | 886 | $GLOBALS['__member_info__']['profile_image'][$member_srl] = null; |
| 887 | - $exts = array('gif','jpg','png'); |
|
| 888 | - for($i=0;$i<3;$i++) |
|
| 887 | + $exts = array('gif', 'jpg', 'png'); |
|
| 888 | + for ($i = 0; $i < 3; $i++) |
|
| 889 | 889 | { |
| 890 | 890 | $image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]); |
| 891 | - if(file_exists($image_name_file)) |
|
| 891 | + if (file_exists($image_name_file)) |
|
| 892 | 892 | { |
| 893 | 893 | list($width, $height, $type, $attrs) = getimagesize($image_name_file); |
| 894 | 894 | $info = new stdClass(); |
| 895 | 895 | $info->width = $width; |
| 896 | 896 | $info->height = $height; |
| 897 | - $info->src = Context::getRequestUri().$image_name_file . '?' . date('YmdHis', filemtime($image_name_file)); |
|
| 897 | + $info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file)); |
|
| 898 | 898 | $info->file = './'.$image_name_file; |
| 899 | 899 | $GLOBALS['__member_info__']['profile_image'][$member_srl] = $info; |
| 900 | 900 | break; |
@@ -910,16 +910,16 @@ discard block |
||
| 910 | 910 | */ |
| 911 | 911 | function getImageName($member_srl) |
| 912 | 912 | { |
| 913 | - if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) |
|
| 913 | + if (!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) |
|
| 914 | 914 | { |
| 915 | 915 | $image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl); |
| 916 | - if(file_exists($image_name_file)) |
|
| 916 | + if (file_exists($image_name_file)) |
|
| 917 | 917 | { |
| 918 | 918 | list($width, $height, $type, $attrs) = getimagesize($image_name_file); |
| 919 | 919 | $info = new stdClass; |
| 920 | 920 | $info->width = $width; |
| 921 | 921 | $info->height = $height; |
| 922 | - $info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file)); |
|
| 922 | + $info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file)); |
|
| 923 | 923 | $info->file = './'.$image_name_file; |
| 924 | 924 | $GLOBALS['__member_info__']['image_name'][$member_srl] = $info; |
| 925 | 925 | } |
@@ -933,15 +933,15 @@ discard block |
||
| 933 | 933 | */ |
| 934 | 934 | function getImageMark($member_srl) |
| 935 | 935 | { |
| 936 | - if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) |
|
| 936 | + if (!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) |
|
| 937 | 937 | { |
| 938 | 938 | $image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl); |
| 939 | - if(file_exists($image_mark_file)) |
|
| 939 | + if (file_exists($image_mark_file)) |
|
| 940 | 940 | { |
| 941 | 941 | list($width, $height, $type, $attrs) = getimagesize($image_mark_file); |
| 942 | 942 | $info->width = $width; |
| 943 | 943 | $info->height = $height; |
| 944 | - $info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file)); |
|
| 944 | + $info->src = Context::getRequestUri().$image_mark_file.'?'.date('YmdHis', filemtime($image_mark_file)); |
|
| 945 | 945 | $info->file = './'.$image_mark_file; |
| 946 | 946 | $GLOBALS['__member_info__']['image_mark'][$member_srl] = $info; |
| 947 | 947 | } |
@@ -955,27 +955,27 @@ discard block |
||
| 955 | 955 | /** |
| 956 | 956 | * @brief Get the image mark of the group |
| 957 | 957 | */ |
| 958 | - function getGroupImageMark($member_srl,$site_srl=0) |
|
| 958 | + function getGroupImageMark($member_srl, $site_srl = 0) |
|
| 959 | 959 | { |
| 960 | - if(!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl])) |
|
| 960 | + if (!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl])) |
|
| 961 | 961 | { |
| 962 | 962 | $oModuleModel = getModel('module'); |
| 963 | 963 | $config = $oModuleModel->getModuleConfig('member'); |
| 964 | - if($config->group_image_mark!='Y') |
|
| 964 | + if ($config->group_image_mark != 'Y') |
|
| 965 | 965 | { |
| 966 | 966 | return null; |
| 967 | 967 | } |
| 968 | - $member_group = $this->getMemberGroups($member_srl,$site_srl); |
|
| 968 | + $member_group = $this->getMemberGroups($member_srl, $site_srl); |
|
| 969 | 969 | $groups_info = $this->getGroups($site_srl); |
| 970 | - if(count($member_group) > 0 && is_array($member_group)) |
|
| 970 | + if (count($member_group) > 0 && is_array($member_group)) |
|
| 971 | 971 | { |
| 972 | 972 | $memberGroups = array_keys($member_group); |
| 973 | 973 | |
| 974 | - foreach($groups_info as $group_srl=>$group_info) |
|
| 974 | + foreach ($groups_info as $group_srl=>$group_info) |
|
| 975 | 975 | { |
| 976 | - if(in_array($group_srl, $memberGroups)) |
|
| 976 | + if (in_array($group_srl, $memberGroups)) |
|
| 977 | 977 | { |
| 978 | - if($group_info->image_mark) |
|
| 978 | + if ($group_info->image_mark) |
|
| 979 | 979 | { |
| 980 | 980 | $info = new stdClass(); |
| 981 | 981 | $info->title = $group_info->title; |
@@ -999,10 +999,10 @@ discard block |
||
| 999 | 999 | */ |
| 1000 | 1000 | function getSignature($member_srl) |
| 1001 | 1001 | { |
| 1002 | - if(!isset($GLOBALS['__member_info__']['signature'][$member_srl])) |
|
| 1002 | + if (!isset($GLOBALS['__member_info__']['signature'][$member_srl])) |
|
| 1003 | 1003 | { |
| 1004 | 1004 | $filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl); |
| 1005 | - if(file_exists($filename)) |
|
| 1005 | + if (file_exists($filename)) |
|
| 1006 | 1006 | { |
| 1007 | 1007 | $buff = FileHandler::readFile($filename); |
| 1008 | 1008 | $signature = preg_replace('/<\?.*\?>/', '', $buff); |
@@ -1020,10 +1020,10 @@ discard block |
||
| 1020 | 1020 | * @param int $member_srl Set this to member_srl when comparing a member's password (optional) |
| 1021 | 1021 | * @return bool |
| 1022 | 1022 | */ |
| 1023 | - function isValidPassword($hashed_password, $password_text, $member_srl=null) |
|
| 1023 | + function isValidPassword($hashed_password, $password_text, $member_srl = null) |
|
| 1024 | 1024 | { |
| 1025 | 1025 | // False if no password in entered |
| 1026 | - if(!$password_text) |
|
| 1026 | + if (!$password_text) |
|
| 1027 | 1027 | { |
| 1028 | 1028 | return false; |
| 1029 | 1029 | } |
@@ -1032,31 +1032,31 @@ discard block |
||
| 1032 | 1032 | $oPassword = new Password(); |
| 1033 | 1033 | $current_algorithm = $oPassword->checkAlgorithm($hashed_password); |
| 1034 | 1034 | $match = $oPassword->checkPassword($password_text, $hashed_password, $current_algorithm); |
| 1035 | - if(!$match) |
|
| 1035 | + if (!$match) |
|
| 1036 | 1036 | { |
| 1037 | 1037 | return false; |
| 1038 | 1038 | } |
| 1039 | 1039 | |
| 1040 | 1040 | // Update the encryption method if necessary |
| 1041 | 1041 | $config = $this->getMemberConfig(); |
| 1042 | - if($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N') |
|
| 1042 | + if ($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N') |
|
| 1043 | 1043 | { |
| 1044 | 1044 | $need_upgrade = false; |
| 1045 | 1045 | |
| 1046 | - if(!$need_upgrade) |
|
| 1046 | + if (!$need_upgrade) |
|
| 1047 | 1047 | { |
| 1048 | 1048 | $required_algorithm = $oPassword->getCurrentlySelectedAlgorithm(); |
| 1049 | - if($required_algorithm !== $current_algorithm) $need_upgrade = true; |
|
| 1049 | + if ($required_algorithm !== $current_algorithm) $need_upgrade = true; |
|
| 1050 | 1050 | } |
| 1051 | 1051 | |
| 1052 | - if(!$need_upgrade) |
|
| 1052 | + if (!$need_upgrade) |
|
| 1053 | 1053 | { |
| 1054 | 1054 | $required_work_factor = $oPassword->getWorkFactor(); |
| 1055 | 1055 | $current_work_factor = $oPassword->checkWorkFactor($hashed_password); |
| 1056 | - if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; |
|
| 1056 | + if ($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; |
|
| 1057 | 1057 | } |
| 1058 | 1058 | |
| 1059 | - if($need_upgrade === true) |
|
| 1059 | + if ($need_upgrade === true) |
|
| 1060 | 1060 | { |
| 1061 | 1061 | $args = new stdClass(); |
| 1062 | 1062 | $args->member_srl = $member_srl; |
@@ -1084,27 +1084,27 @@ discard block |
||
| 1084 | 1084 | function checkPasswordStrength($password, $strength) |
| 1085 | 1085 | { |
| 1086 | 1086 | $logged_info = Context::get('logged_info'); |
| 1087 | - if($logged_info->is_admin == 'Y') return true; |
|
| 1087 | + if ($logged_info->is_admin == 'Y') return true; |
|
| 1088 | 1088 | |
| 1089 | - if($strength == NULL) |
|
| 1089 | + if ($strength == NULL) |
|
| 1090 | 1090 | { |
| 1091 | 1091 | $config = $this->getMemberConfig(); |
| 1092 | - $strength = $config->password_strength?$config->password_strength:'normal'; |
|
| 1092 | + $strength = $config->password_strength ? $config->password_strength : 'normal'; |
|
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | $length = strlen($password); |
| 1096 | 1096 | |
| 1097 | 1097 | switch ($strength) { |
| 1098 | 1098 | case 'high': |
| 1099 | - if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false; |
|
| 1099 | + if ($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false; |
|
| 1100 | 1100 | /* no break */ |
| 1101 | 1101 | |
| 1102 | 1102 | case 'normal': |
| 1103 | - if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false; |
|
| 1103 | + if ($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false; |
|
| 1104 | 1104 | break; |
| 1105 | 1105 | |
| 1106 | 1106 | case 'low': |
| 1107 | - if($length < 4) return false; |
|
| 1107 | + if ($length < 4) return false; |
|
| 1108 | 1108 | break; |
| 1109 | 1109 | } |
| 1110 | 1110 | |
@@ -1115,11 +1115,11 @@ discard block |
||
| 1115 | 1115 | { |
| 1116 | 1116 | $groupSrl = 0; |
| 1117 | 1117 | $output = $this->getGroups($site_srl); |
| 1118 | - if(is_array($output)) |
|
| 1118 | + if (is_array($output)) |
|
| 1119 | 1119 | { |
| 1120 | - foreach($output AS $key=>$value) |
|
| 1120 | + foreach ($output AS $key=>$value) |
|
| 1121 | 1121 | { |
| 1122 | - if($value->is_admin == 'Y') |
|
| 1122 | + if ($value->is_admin == 'Y') |
|
| 1123 | 1123 | { |
| 1124 | 1124 | $groupSrl = $value->group_srl; |
| 1125 | 1125 | break; |
@@ -45,32 +45,68 @@ discard block |
||
| 45 | 45 | foreach($config->signupForm AS $key=>$value) |
| 46 | 46 | { |
| 47 | 47 | $config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title; |
| 48 | - if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y'; |
|
| 49 | - if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N'; |
|
| 48 | + if($config->signupForm[$key]->isPublic != 'N') { |
|
| 49 | + $config->signupForm[$key]->isPublic = 'Y'; |
|
| 50 | + } |
|
| 51 | + if($value->name == 'find_account_question') { |
|
| 52 | + $config->signupForm[$key]->isPublic = 'N'; |
|
| 53 | + } |
|
| 50 | 54 | } |
| 51 | 55 | |
| 52 | 56 | // Get terms of user |
| 53 | 57 | $config->agreement = memberModel::_getAgreement(); |
| 54 | 58 | |
| 55 | - if(!$config->webmaster_name) $config->webmaster_name = 'webmaster'; |
|
| 56 | - if(!$config->image_name_max_width) $config->image_name_max_width = 90; |
|
| 57 | - if(!$config->image_name_max_height) $config->image_name_max_height = 20; |
|
| 58 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = 20; |
|
| 59 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = 20; |
|
| 60 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = 90; |
|
| 61 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = 90; |
|
| 62 | - if(!$config->skin) $config->skin = 'default'; |
|
| 63 | - if(!$config->colorset) $config->colorset = 'white'; |
|
| 64 | - if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor'; |
|
| 65 | - if(!$config->group_image_mark) $config->group_image_mark = "N"; |
|
| 59 | + if(!$config->webmaster_name) { |
|
| 60 | + $config->webmaster_name = 'webmaster'; |
|
| 61 | + } |
|
| 62 | + if(!$config->image_name_max_width) { |
|
| 63 | + $config->image_name_max_width = 90; |
|
| 64 | + } |
|
| 65 | + if(!$config->image_name_max_height) { |
|
| 66 | + $config->image_name_max_height = 20; |
|
| 67 | + } |
|
| 68 | + if(!$config->image_mark_max_width) { |
|
| 69 | + $config->image_mark_max_width = 20; |
|
| 70 | + } |
|
| 71 | + if(!$config->image_mark_max_height) { |
|
| 72 | + $config->image_mark_max_height = 20; |
|
| 73 | + } |
|
| 74 | + if(!$config->profile_image_max_width) { |
|
| 75 | + $config->profile_image_max_width = 90; |
|
| 76 | + } |
|
| 77 | + if(!$config->profile_image_max_height) { |
|
| 78 | + $config->profile_image_max_height = 90; |
|
| 79 | + } |
|
| 80 | + if(!$config->skin) { |
|
| 81 | + $config->skin = 'default'; |
|
| 82 | + } |
|
| 83 | + if(!$config->colorset) { |
|
| 84 | + $config->colorset = 'white'; |
|
| 85 | + } |
|
| 86 | + if(!$config->editor_skin || $config->editor_skin == 'default') { |
|
| 87 | + $config->editor_skin = 'ckeditor'; |
|
| 88 | + } |
|
| 89 | + if(!$config->group_image_mark) { |
|
| 90 | + $config->group_image_mark = "N"; |
|
| 91 | + } |
|
| 66 | 92 | |
| 67 | - if(!$config->identifier) $config->identifier = 'user_id'; |
|
| 93 | + if(!$config->identifier) { |
|
| 94 | + $config->identifier = 'user_id'; |
|
| 95 | + } |
|
| 68 | 96 | |
| 69 | - if(!$config->max_error_count) $config->max_error_count = 10; |
|
| 70 | - if(!$config->max_error_count_time) $config->max_error_count_time = 300; |
|
| 97 | + if(!$config->max_error_count) { |
|
| 98 | + $config->max_error_count = 10; |
|
| 99 | + } |
|
| 100 | + if(!$config->max_error_count_time) { |
|
| 101 | + $config->max_error_count_time = 300; |
|
| 102 | + } |
|
| 71 | 103 | |
| 72 | - if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor'; |
|
| 73 | - if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono'; |
|
| 104 | + if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') { |
|
| 105 | + $config->signature_editor_skin = 'ckeditor'; |
|
| 106 | + } |
|
| 107 | + if(!$config->sel_editor_colorset) { |
|
| 108 | + $config->sel_editor_colorset = 'moono'; |
|
| 109 | + } |
|
| 74 | 110 | |
| 75 | 111 | $member_config = $config; |
| 76 | 112 | |
@@ -116,12 +152,18 @@ discard block |
||
| 116 | 152 | $logged_info = Context::get('logged_info'); |
| 117 | 153 | $act = Context::get('cur_act'); |
| 118 | 154 | // When click user's own nickname |
| 119 | - if($member_srl == $logged_info->member_srl) $member_info = $logged_info; |
|
| 155 | + if($member_srl == $logged_info->member_srl) { |
|
| 156 | + $member_info = $logged_info; |
|
| 157 | + } |
|
| 120 | 158 | // When click other's nickname |
| 121 | - else $member_info = $this->getMemberInfoByMemberSrl($member_srl); |
|
| 159 | + else { |
|
| 160 | + $member_info = $this->getMemberInfoByMemberSrl($member_srl); |
|
| 161 | + } |
|
| 122 | 162 | |
| 123 | 163 | $member_srl = $member_info->member_srl; |
| 124 | - if(!$member_srl) return; |
|
| 164 | + if(!$member_srl) { |
|
| 165 | + return; |
|
| 166 | + } |
|
| 125 | 167 | // List variables |
| 126 | 168 | $user_id = $member_info->user_id; |
| 127 | 169 | $user_name = $member_info->user_name; |
@@ -156,11 +198,13 @@ discard block |
||
| 156 | 198 | } |
| 157 | 199 | } |
| 158 | 200 | // View homepage info |
| 159 | - if($member_info->homepage) |
|
| 160 | - $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank'); |
|
| 201 | + if($member_info->homepage) { |
|
| 202 | + $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank'); |
|
| 203 | + } |
|
| 161 | 204 | // View blog info |
| 162 | - if($member_info->blog) |
|
| 163 | - $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank'); |
|
| 205 | + if($member_info->blog) { |
|
| 206 | + $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank'); |
|
| 207 | + } |
|
| 164 | 208 | // Call a trigger (after) |
| 165 | 209 | ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null); |
| 166 | 210 | // Display a menu for editting member info to a top administrator |
@@ -195,16 +239,14 @@ discard block |
||
| 195 | 239 | if(Mobile::isFromMobilePhone()) |
| 196 | 240 | { |
| 197 | 241 | return true; |
| 198 | - } |
|
| 199 | - elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
| 242 | + } elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) |
|
| 200 | 243 | { |
| 201 | 244 | // IPv6: require same /48 |
| 202 | 245 | if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0) |
| 203 | 246 | { |
| 204 | 247 | return true; |
| 205 | 248 | } |
| 206 | - } |
|
| 207 | - else |
|
| 249 | + } else |
|
| 208 | 250 | { |
| 209 | 251 | // IPv4: require same /24 |
| 210 | 252 | if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) |
@@ -234,10 +276,12 @@ discard block |
||
| 234 | 276 | $logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl); |
| 235 | 277 | // Add is_site_admin bool variable into logged_info if site_administrator is |
| 236 | 278 | $oModuleModel = getModel('module'); |
| 237 | - if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; |
|
| 238 | - else $logged_info->is_site_admin = false; |
|
| 239 | - } |
|
| 240 | - else |
|
| 279 | + if($oModuleModel->isSiteAdmin($logged_info)) { |
|
| 280 | + $logged_info->is_site_admin = true; |
|
| 281 | + } else { |
|
| 282 | + $logged_info->is_site_admin = false; |
|
| 283 | + } |
|
| 284 | + } else |
|
| 241 | 285 | { |
| 242 | 286 | // Register a default group if the site doesn't have a member group |
| 243 | 287 | if(count($logged_info->group_list) === 0) |
@@ -263,13 +307,19 @@ discard block |
||
| 263 | 307 | */ |
| 264 | 308 | function getMemberInfoByUserID($user_id, $columnList = array()) |
| 265 | 309 | { |
| 266 | - if(!$user_id) return; |
|
| 310 | + if(!$user_id) { |
|
| 311 | + return; |
|
| 312 | + } |
|
| 267 | 313 | |
| 268 | 314 | $args = new stdClass; |
| 269 | 315 | $args->user_id = $user_id; |
| 270 | 316 | $output = executeQuery('member.getMemberInfo', $args); |
| 271 | - if(!$output->toBool()) return $output; |
|
| 272 | - if(!$output->data) return; |
|
| 317 | + if(!$output->toBool()) { |
|
| 318 | + return $output; |
|
| 319 | + } |
|
| 320 | + if(!$output->data) { |
|
| 321 | + return; |
|
| 322 | + } |
|
| 273 | 323 | |
| 274 | 324 | $member_info = $this->arrangeMemberInfo($output->data); |
| 275 | 325 | |
@@ -281,7 +331,9 @@ discard block |
||
| 281 | 331 | */ |
| 282 | 332 | function getMemberInfoByEmailAddress($email_address) |
| 283 | 333 | { |
| 284 | - if(!$email_address) return; |
|
| 334 | + if(!$email_address) { |
|
| 335 | + return; |
|
| 336 | + } |
|
| 285 | 337 | |
| 286 | 338 | $args = new stdClass(); |
| 287 | 339 | |
@@ -290,15 +342,18 @@ discard block |
||
| 290 | 342 | { |
| 291 | 343 | $args->email_address = strtolower($email_address); |
| 292 | 344 | $output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args); |
| 293 | - } |
|
| 294 | - else |
|
| 345 | + } else |
|
| 295 | 346 | { |
| 296 | 347 | $args->email_address = $email_address; |
| 297 | 348 | $output = executeQuery('member.getMemberInfoByEmailAddress', $args); |
| 298 | 349 | } |
| 299 | 350 | |
| 300 | - if(!$output->toBool()) return $output; |
|
| 301 | - if(!$output->data) return; |
|
| 351 | + if(!$output->toBool()) { |
|
| 352 | + return $output; |
|
| 353 | + } |
|
| 354 | + if(!$output->data) { |
|
| 355 | + return; |
|
| 356 | + } |
|
| 302 | 357 | |
| 303 | 358 | $member_info = $this->arrangeMemberInfo($output->data); |
| 304 | 359 | return $member_info; |
@@ -309,7 +364,9 @@ discard block |
||
| 309 | 364 | */ |
| 310 | 365 | function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array()) |
| 311 | 366 | { |
| 312 | - if(!$member_srl) return; |
|
| 367 | + if(!$member_srl) { |
|
| 368 | + return; |
|
| 369 | + } |
|
| 313 | 370 | |
| 314 | 371 | //columnList size zero... get full member info |
| 315 | 372 | if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0) |
@@ -332,13 +389,17 @@ discard block |
||
| 332 | 389 | $output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList); |
| 333 | 390 | if(!$output->data) |
| 334 | 391 | { |
| 335 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass); |
|
| 392 | + if($oCacheHandler->isSupport()) { |
|
| 393 | + $oCacheHandler->put($cache_key, new stdClass); |
|
| 394 | + } |
|
| 336 | 395 | return; |
| 337 | 396 | } |
| 338 | 397 | $this->arrangeMemberInfo($output->data, $site_srl); |
| 339 | 398 | |
| 340 | 399 | //insert in cache |
| 341 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
| 400 | + if($oCacheHandler->isSupport()) { |
|
| 401 | + $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]); |
|
| 402 | + } |
|
| 342 | 403 | } |
| 343 | 404 | } |
| 344 | 405 | |
@@ -372,8 +433,12 @@ discard block |
||
| 372 | 433 | { |
| 373 | 434 | foreach($extra_vars as $key => $val) |
| 374 | 435 | { |
| 375 | - if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val); |
|
| 376 | - if(!$info->{$key}) $info->{$key} = $val; |
|
| 436 | + if(!is_array($val) && strpos($val, '|@|') !== FALSE) { |
|
| 437 | + $val = explode('|@|', $val); |
|
| 438 | + } |
|
| 439 | + if(!$info->{$key}) { |
|
| 440 | + $info->{$key} = $val; |
|
| 441 | + } |
|
| 377 | 442 | } |
| 378 | 443 | } |
| 379 | 444 | |
@@ -396,8 +461,7 @@ discard block |
||
| 396 | 461 | if(is_array($val)) |
| 397 | 462 | { |
| 398 | 463 | $oSecurity->encodeHTML($key . '.'); |
| 399 | - } |
|
| 400 | - else |
|
| 464 | + } else |
|
| 401 | 465 | { |
| 402 | 466 | $oSecurity->encodeHTML($key); |
| 403 | 467 | } |
@@ -460,7 +524,9 @@ discard block |
||
| 460 | 524 | */ |
| 461 | 525 | function getLoggedMemberSrl() |
| 462 | 526 | { |
| 463 | - if(!$this->isLogged()) return; |
|
| 527 | + if(!$this->isLogged()) { |
|
| 528 | + return; |
|
| 529 | + } |
|
| 464 | 530 | return $_SESSION['member_srl']; |
| 465 | 531 | } |
| 466 | 532 | |
@@ -469,7 +535,9 @@ discard block |
||
| 469 | 535 | */ |
| 470 | 536 | function getLoggedUserID() |
| 471 | 537 | { |
| 472 | - if(!$this->isLogged()) return; |
|
| 538 | + if(!$this->isLogged()) { |
|
| 539 | + return; |
|
| 540 | + } |
|
| 473 | 541 | $logged_info = Context::get('logged_info'); |
| 474 | 542 | return $logged_info->user_id; |
| 475 | 543 | } |
@@ -501,9 +569,13 @@ discard block |
||
| 501 | 569 | $output = executeQueryArray('member.getMemberGroups', $args); |
| 502 | 570 | $group_list = $output->data; |
| 503 | 571 | //insert in cache |
| 504 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
| 572 | + if($oCacheHandler->isSupport()) { |
|
| 573 | + $oCacheHandler->put($cache_key, $group_list); |
|
| 574 | + } |
|
| 575 | + } |
|
| 576 | + if(!$group_list) { |
|
| 577 | + return array(); |
|
| 505 | 578 | } |
| 506 | - if(!$group_list) return array(); |
|
| 507 | 579 | |
| 508 | 580 | foreach($group_list as $group) |
| 509 | 581 | { |
@@ -523,7 +595,9 @@ discard block |
||
| 523 | 595 | $args->site_srl = $site_srl; |
| 524 | 596 | $args->sort_index = 'list_order'; |
| 525 | 597 | $output = executeQueryArray('member.getMembersGroups', $args); |
| 526 | - if(!$output->data) return array(); |
|
| 598 | + if(!$output->data) { |
|
| 599 | + return array(); |
|
| 600 | + } |
|
| 527 | 601 | |
| 528 | 602 | $result = array(); |
| 529 | 603 | foreach($output->data as $key=>$val) |
@@ -615,7 +689,9 @@ discard block |
||
| 615 | 689 | $output = executeQueryArray('member.getGroups', $args); |
| 616 | 690 | $group_list = $output->data; |
| 617 | 691 | //insert in cache |
| 618 | - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list); |
|
| 692 | + if($oCacheHandler->isSupport()) { |
|
| 693 | + $oCacheHandler->put($cache_key, $group_list); |
|
| 694 | + } |
|
| 619 | 695 | } |
| 620 | 696 | |
| 621 | 697 | if(!$group_list) |
@@ -663,9 +739,13 @@ discard block |
||
| 663 | 739 | $output = executeQuery('member.getJoinFormList', $args); |
| 664 | 740 | // NULL if output data deosn't exist |
| 665 | 741 | $join_form_list = $output->data; |
| 666 | - if(!$join_form_list) return NULL; |
|
| 742 | + if(!$join_form_list) { |
|
| 743 | + return NULL; |
|
| 744 | + } |
|
| 667 | 745 | // Need to unserialize because serialized array is inserted into DB in case of default_value |
| 668 | - if(!is_array($join_form_list)) $join_form_list = array($join_form_list); |
|
| 746 | + if(!is_array($join_form_list)) { |
|
| 747 | + $join_form_list = array($join_form_list); |
|
| 748 | + } |
|
| 669 | 749 | $join_form_count = count($join_form_list); |
| 670 | 750 | for($i=0;$i<$join_form_count;$i++) |
| 671 | 751 | { |
@@ -682,9 +762,10 @@ discard block |
||
| 682 | 762 | if(in_array($column_type, array('checkbox','select','radio'))) |
| 683 | 763 | { |
| 684 | 764 | $join_form_list[$i]->default_value = unserialize($default_value); |
| 685 | - if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = ''; |
|
| 686 | - } |
|
| 687 | - else |
|
| 765 | + if(!$join_form_list[$i]->default_value[0]) { |
|
| 766 | + $join_form_list[$i]->default_value = ''; |
|
| 767 | + } |
|
| 768 | + } else |
|
| 688 | 769 | { |
| 689 | 770 | $join_form_list[$i]->default_value = ''; |
| 690 | 771 | } |
@@ -698,13 +779,18 @@ discard block |
||
| 698 | 779 | { |
| 699 | 780 | foreach($this->join_form_list as $key => $val) |
| 700 | 781 | { |
| 701 | - if($val->is_active != 'Y') continue; |
|
| 782 | + if($val->is_active != 'Y') { |
|
| 783 | + continue; |
|
| 784 | + } |
|
| 702 | 785 | unset($obj); |
| 703 | 786 | $obj->type = $val->column_type; |
| 704 | 787 | $obj->name = $val->column_name; |
| 705 | 788 | $obj->lang = $val->column_title; |
| 706 | - if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false; |
|
| 707 | - else $obj->required = false; |
|
| 789 | + if($logged_info->is_admin != 'Y') { |
|
| 790 | + $obj->required = $val->required=='Y'?true:false; |
|
| 791 | + } else { |
|
| 792 | + $obj->required = false; |
|
| 793 | + } |
|
| 708 | 794 | $filter_output[] = $obj; |
| 709 | 795 | |
| 710 | 796 | unset($open_obj); |
@@ -755,7 +841,9 @@ discard block |
||
| 755 | 841 | function getCombineJoinForm($member_info) |
| 756 | 842 | { |
| 757 | 843 | $extend_form_list = $this->getJoinFormlist(); |
| 758 | - if(!$extend_form_list) return; |
|
| 844 | + if(!$extend_form_list) { |
|
| 845 | + return; |
|
| 846 | + } |
|
| 759 | 847 | // Member info is open only to an administrator and him/herself when is_private is true. |
| 760 | 848 | $logged_info = Context::get('logged_info'); |
| 761 | 849 | |
@@ -768,7 +856,9 @@ discard block |
||
| 768 | 856 | switch($item->column_type) |
| 769 | 857 | { |
| 770 | 858 | case 'checkbox' : |
| 771 | - if($value && !is_array($value)) $value = array($value); |
|
| 859 | + if($value && !is_array($value)) { |
|
| 860 | + $value = array($value); |
|
| 861 | + } |
|
| 772 | 862 | break; |
| 773 | 863 | case 'text' : |
| 774 | 864 | case 'homepage' : |
@@ -782,8 +872,11 @@ discard block |
||
| 782 | 872 | |
| 783 | 873 | $extend_form_list[$srl]->value = $value; |
| 784 | 874 | |
| 785 | - if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true; |
|
| 786 | - else $extend_form_list[$srl]->is_opened = false; |
|
| 875 | + if($member_info->{'open_'.$column_name}=='Y') { |
|
| 876 | + $extend_form_list[$srl]->is_opened = true; |
|
| 877 | + } else { |
|
| 878 | + $extend_form_list[$srl]->is_opened = false; |
|
| 879 | + } |
|
| 787 | 880 | } |
| 788 | 881 | return $extend_form_list; |
| 789 | 882 | } |
@@ -796,7 +889,9 @@ discard block |
||
| 796 | 889 | $args->member_join_form_srl = $member_join_form_srl; |
| 797 | 890 | $output = executeQuery('member.getJoinForm', $args); |
| 798 | 891 | $join_form = $output->data; |
| 799 | - if(!$join_form) return NULL; |
|
| 892 | + if(!$join_form) { |
|
| 893 | + return NULL; |
|
| 894 | + } |
|
| 800 | 895 | |
| 801 | 896 | $column_type = $join_form->column_type; |
| 802 | 897 | $default_value = $join_form->default_value; |
@@ -804,8 +899,7 @@ discard block |
||
| 804 | 899 | if(in_array($column_type, array('checkbox','select','radio'))) |
| 805 | 900 | { |
| 806 | 901 | $join_form->default_value = unserialize($default_value); |
| 807 | - } |
|
| 808 | - else |
|
| 902 | + } else |
|
| 809 | 903 | { |
| 810 | 904 | $join_form->default_value = ''; |
| 811 | 905 | } |
@@ -834,7 +928,9 @@ discard block |
||
| 834 | 928 | function getDeniedIDs() |
| 835 | 929 | { |
| 836 | 930 | $output = executeQueryArray('member.getDeniedIDs'); |
| 837 | - if(!$output->toBool()) return array(); |
|
| 931 | + if(!$output->toBool()) { |
|
| 932 | + return array(); |
|
| 933 | + } |
|
| 838 | 934 | return $output->data; |
| 839 | 935 | } |
| 840 | 936 | |
@@ -857,7 +953,9 @@ discard block |
||
| 857 | 953 | $args = new stdClass(); |
| 858 | 954 | $args->user_id = $user_id; |
| 859 | 955 | $output = executeQuery('member.chkDeniedID', $args); |
| 860 | - if($output->data->count) return true; |
|
| 956 | + if($output->data->count) { |
|
| 957 | + return true; |
|
| 958 | + } |
|
| 861 | 959 | return false; |
| 862 | 960 | } |
| 863 | 961 | |
@@ -869,7 +967,9 @@ discard block |
||
| 869 | 967 | $args = new stdClass(); |
| 870 | 968 | $args->nick_name = $nickName; |
| 871 | 969 | $output = executeQuery('member.chkDeniedNickName', $args); |
| 872 | - if($output->data->count) return true; |
|
| 970 | + if($output->data->count) { |
|
| 971 | + return true; |
|
| 972 | + } |
|
| 873 | 973 | if(!$output->toBool()) |
| 874 | 974 | { |
| 875 | 975 | return true; |
@@ -922,8 +1022,9 @@ discard block |
||
| 922 | 1022 | $info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file)); |
| 923 | 1023 | $info->file = './'.$image_name_file; |
| 924 | 1024 | $GLOBALS['__member_info__']['image_name'][$member_srl] = $info; |
| 1025 | + } else { |
|
| 1026 | + $GLOBALS['__member_info__']['image_name'][$member_srl] = null; |
|
| 925 | 1027 | } |
| 926 | - else $GLOBALS['__member_info__']['image_name'][$member_srl] = null; |
|
| 927 | 1028 | } |
| 928 | 1029 | return $GLOBALS['__member_info__']['image_name'][$member_srl]; |
| 929 | 1030 | } |
@@ -944,8 +1045,9 @@ discard block |
||
| 944 | 1045 | $info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file)); |
| 945 | 1046 | $info->file = './'.$image_mark_file; |
| 946 | 1047 | $GLOBALS['__member_info__']['image_mark'][$member_srl] = $info; |
| 1048 | + } else { |
|
| 1049 | + $GLOBALS['__member_info__']['image_mark'][$member_srl] = null; |
|
| 947 | 1050 | } |
| 948 | - else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null; |
|
| 949 | 1051 | } |
| 950 | 1052 | |
| 951 | 1053 | return $GLOBALS['__member_info__']['image_mark'][$member_srl]; |
@@ -987,9 +1089,13 @@ discard block |
||
| 987 | 1089 | } |
| 988 | 1090 | } |
| 989 | 1091 | } |
| 990 | - if (!$info) $GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N'; |
|
| 1092 | + if (!$info) { |
|
| 1093 | + $GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N'; |
|
| 1094 | + } |
|
| 1095 | + } |
|
| 1096 | + if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') { |
|
| 1097 | + return null; |
|
| 991 | 1098 | } |
| 992 | - if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') return null; |
|
| 993 | 1099 | |
| 994 | 1100 | return $GLOBALS['__member_info__']['group_image_mark'][$member_srl]; |
| 995 | 1101 | } |
@@ -1007,8 +1113,9 @@ discard block |
||
| 1007 | 1113 | $buff = FileHandler::readFile($filename); |
| 1008 | 1114 | $signature = preg_replace('/<\?.*\?>/', '', $buff); |
| 1009 | 1115 | $GLOBALS['__member_info__']['signature'][$member_srl] = $signature; |
| 1116 | + } else { |
|
| 1117 | + $GLOBALS['__member_info__']['signature'][$member_srl] = null; |
|
| 1010 | 1118 | } |
| 1011 | - else $GLOBALS['__member_info__']['signature'][$member_srl] = null; |
|
| 1012 | 1119 | } |
| 1013 | 1120 | return $GLOBALS['__member_info__']['signature'][$member_srl]; |
| 1014 | 1121 | } |
@@ -1046,14 +1153,18 @@ discard block |
||
| 1046 | 1153 | if(!$need_upgrade) |
| 1047 | 1154 | { |
| 1048 | 1155 | $required_algorithm = $oPassword->getCurrentlySelectedAlgorithm(); |
| 1049 | - if($required_algorithm !== $current_algorithm) $need_upgrade = true; |
|
| 1156 | + if($required_algorithm !== $current_algorithm) { |
|
| 1157 | + $need_upgrade = true; |
|
| 1158 | + } |
|
| 1050 | 1159 | } |
| 1051 | 1160 | |
| 1052 | 1161 | if(!$need_upgrade) |
| 1053 | 1162 | { |
| 1054 | 1163 | $required_work_factor = $oPassword->getWorkFactor(); |
| 1055 | 1164 | $current_work_factor = $oPassword->checkWorkFactor($hashed_password); |
| 1056 | - if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; |
|
| 1165 | + if($current_work_factor !== false && $required_work_factor > $current_work_factor) { |
|
| 1166 | + $need_upgrade = true; |
|
| 1167 | + } |
|
| 1057 | 1168 | } |
| 1058 | 1169 | |
| 1059 | 1170 | if($need_upgrade === true) |
@@ -1084,7 +1195,9 @@ discard block |
||
| 1084 | 1195 | function checkPasswordStrength($password, $strength) |
| 1085 | 1196 | { |
| 1086 | 1197 | $logged_info = Context::get('logged_info'); |
| 1087 | - if($logged_info->is_admin == 'Y') return true; |
|
| 1198 | + if($logged_info->is_admin == 'Y') { |
|
| 1199 | + return true; |
|
| 1200 | + } |
|
| 1088 | 1201 | |
| 1089 | 1202 | if($strength == NULL) |
| 1090 | 1203 | { |
@@ -1096,15 +1209,21 @@ discard block |
||
| 1096 | 1209 | |
| 1097 | 1210 | switch ($strength) { |
| 1098 | 1211 | case 'high': |
| 1099 | - if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false; |
|
| 1212 | + if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) { |
|
| 1213 | + return false; |
|
| 1214 | + } |
|
| 1100 | 1215 | /* no break */ |
| 1101 | 1216 | |
| 1102 | 1217 | case 'normal': |
| 1103 | - if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false; |
|
| 1218 | + if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) { |
|
| 1219 | + return false; |
|
| 1220 | + } |
|
| 1104 | 1221 | break; |
| 1105 | 1222 | |
| 1106 | 1223 | case 'low': |
| 1107 | - if($length < 4) return false; |
|
| 1224 | + if($length < 4) { |
|
| 1225 | + return false; |
|
| 1226 | + } |
|
| 1108 | 1227 | break; |
| 1109 | 1228 | } |
| 1110 | 1229 | |