@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * It is used when a file list of the upload_target_srl is requested for creating/updating a document. |
| 21 | 21 | * Attempt to replace with sever-side session if upload_target_srl is not yet determined |
| 22 | 22 | * |
| 23 | - * @return void |
|
| 23 | + * @return Object|null |
|
| 24 | 24 | */ |
| 25 | 25 | function getFileList() |
| 26 | 26 | { |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | * Get file configurations |
| 147 | 147 | * |
| 148 | 148 | * @param int $module_srl If set this, returns specific module's configuration. Otherwise returns global configuration. |
| 149 | - * @return object Returns configuration. |
|
| 149 | + * @return stdClass Returns configuration. |
|
| 150 | 150 | */ |
| 151 | 151 | function getFileConfig($module_srl = null) |
| 152 | 152 | { |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | /** |
| 277 | 277 | * Return configurations of the attachement (it automatically checks if an administrator is) |
| 278 | 278 | * |
| 279 | - * @return object Returns a file configuration of current module. If user is admin, returns PHP's max file size and allow all file types. |
|
| 279 | + * @return stdClass Returns a file configuration of current module. If user is admin, returns PHP's max file size and allow all file types. |
|
| 280 | 280 | */ |
| 281 | 281 | function getUploadConfig() |
| 282 | 282 | { |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | * Return file configuration of the module |
| 331 | 331 | * |
| 332 | 332 | * @param int $module_srl The sequence of module to get configuration |
| 333 | - * @return object |
|
| 333 | + * @return stdClass |
|
| 334 | 334 | */ |
| 335 | 335 | function getFileModuleConfig($module_srl) |
| 336 | 336 | { |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | $mid = Context::get('mid'); |
| 30 | 30 | $editor_sequence = Context::get('editor_sequence'); |
| 31 | 31 | $upload_target_srl = Context::get('upload_target_srl'); |
| 32 | - if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
| 32 | + if (!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
| 33 | 33 | |
| 34 | - if($upload_target_srl) |
|
| 34 | + if ($upload_target_srl) |
|
| 35 | 35 | { |
| 36 | 36 | $oDocumentModel = getModel('document'); |
| 37 | 37 | $oCommentModel = getModel('comment'); |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | $oDocument = $oDocumentModel->getDocument($upload_target_srl); |
| 41 | 41 | |
| 42 | 42 | // comment 권한 확인 |
| 43 | - if(!$oDocument->isExists()) |
|
| 43 | + if (!$oDocument->isExists()) |
|
| 44 | 44 | { |
| 45 | 45 | $oComment = $oCommentModel->getComment($upload_target_srl); |
| 46 | - if($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted()) |
|
| 46 | + if ($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted()) |
|
| 47 | 47 | { |
| 48 | 48 | return new Object(-1, 'msg_not_permitted'); |
| 49 | 49 | } |
@@ -52,34 +52,34 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // document 권한 확인 |
| 55 | - if($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted()) |
|
| 55 | + if ($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted()) |
|
| 56 | 56 | { |
| 57 | 57 | return new Object(-1, 'msg_not_permitted'); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // 모듈 권한 확인 |
| 61 | - if($oDocument->isExists()) |
|
| 61 | + if ($oDocument->isExists()) |
|
| 62 | 62 | { |
| 63 | 63 | $grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')), $logged_info); |
| 64 | - if(!$grant->access) |
|
| 64 | + if (!$grant->access) |
|
| 65 | 65 | { |
| 66 | 66 | return new Object(-1, 'msg_not_permitted'); |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $tmp_files = $this->getFiles($upload_target_srl); |
| 71 | - if(!$tmp_files) $tmp_files = array(); |
|
| 71 | + if (!$tmp_files) $tmp_files = array(); |
|
| 72 | 72 | |
| 73 | - foreach($tmp_files as $file_info) |
|
| 73 | + foreach ($tmp_files as $file_info) |
|
| 74 | 74 | { |
| 75 | - if(!$file_info->file_srl) continue; |
|
| 75 | + if (!$file_info->file_srl) continue; |
|
| 76 | 76 | |
| 77 | 77 | $obj = new stdClass; |
| 78 | 78 | $obj->file_srl = $file_info->file_srl; |
| 79 | 79 | $obj->source_filename = $file_info->source_filename; |
| 80 | 80 | $obj->file_size = $file_info->file_size; |
| 81 | 81 | $obj->disp_file_size = FileHandler::filesize($file_info->file_size); |
| 82 | - if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl); |
|
| 82 | + if ($file_info->direct_download == 'N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl); |
|
| 83 | 83 | else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename); |
| 84 | 84 | $obj->direct_download = $file_info->direct_download; |
| 85 | 85 | $obj->cover_image = ($file_info->cover_image === 'Y') ? true : false; |
@@ -99,17 +99,17 @@ discard block |
||
| 99 | 99 | //$config = $oModuleModel->getModuleInfoByMid($mid); //perhaps config varialbles not used |
| 100 | 100 | |
| 101 | 101 | $file_config = $this->getUploadConfig(); |
| 102 | - $left_size = $file_config->allowed_attach_size*1024*1024 - $attached_size; |
|
| 102 | + $left_size = $file_config->allowed_attach_size * 1024 * 1024 - $attached_size; |
|
| 103 | 103 | // Settings of required information |
| 104 | 104 | $attached_size = FileHandler::filesize($attached_size); |
| 105 | - $allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size*1024*1024); |
|
| 106 | - $allowed_filesize = FileHandler::filesize($file_config->allowed_filesize*1024*1024); |
|
| 105 | + $allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024); |
|
| 106 | + $allowed_filesize = FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024); |
|
| 107 | 107 | $allowed_filetypes = $file_config->allowed_filetypes; |
| 108 | - $this->add("files",$files); |
|
| 109 | - $this->add("editor_sequence",$editor_sequence); |
|
| 110 | - $this->add("upload_target_srl",$upload_target_srl); |
|
| 111 | - $this->add("upload_status",$upload_status); |
|
| 112 | - $this->add("left_size",$left_size); |
|
| 108 | + $this->add("files", $files); |
|
| 109 | + $this->add("editor_sequence", $editor_sequence); |
|
| 110 | + $this->add("upload_target_srl", $upload_target_srl); |
|
| 111 | + $this->add("upload_status", $upload_status); |
|
| 112 | + $this->add("left_size", $left_size); |
|
| 113 | 113 | $this->add('attached_size', $attached_size); |
| 114 | 114 | $this->add('allowed_attach_size', $allowed_attach_size); |
| 115 | 115 | $this->add('allowed_filesize', $allowed_filesize); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $args = new stdClass(); |
| 128 | 128 | $args->upload_target_srl = $upload_target_srl; |
| 129 | 129 | $output = executeQuery('file.getFilesCount', $args); |
| 130 | - return (int)$output->data->count; |
|
| 130 | + return (int) $output->data->count; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * @param string $sid |
| 138 | 138 | * @return string Returns a url |
| 139 | 139 | */ |
| 140 | - function getDownloadUrl($file_srl, $sid, $module_srl="") |
|
| 140 | + function getDownloadUrl($file_srl, $sid, $module_srl = "") |
|
| 141 | 141 | { |
| 142 | 142 | return sprintf('?module=%s&act=%s&file_srl=%s&sid=%s&module_srl=%s', 'file', 'procFileDownload', $file_srl, $sid, $module_srl); |
| 143 | 143 | } |
@@ -155,12 +155,12 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | $file_module_config = $oModuleModel->getModuleConfig('file'); |
| 157 | 157 | |
| 158 | - if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl); |
|
| 159 | - if(!$file_config) $file_config = $file_module_config; |
|
| 158 | + if ($module_srl) $file_config = $oModuleModel->getModulePartConfig('file', $module_srl); |
|
| 159 | + if (!$file_config) $file_config = $file_module_config; |
|
| 160 | 160 | |
| 161 | 161 | $config = new stdClass(); |
| 162 | 162 | |
| 163 | - if($file_config) |
|
| 163 | + if ($file_config) |
|
| 164 | 164 | { |
| 165 | 165 | $config->allowed_filesize = $file_config->allowed_filesize; |
| 166 | 166 | $config->allowed_attach_size = $file_config->allowed_attach_size; |
@@ -171,31 +171,31 @@ discard block |
||
| 171 | 171 | $config->allow_outlink_format = $file_config->allow_outlink_format; |
| 172 | 172 | } |
| 173 | 173 | // Property for all files comes first than each property |
| 174 | - if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize; |
|
| 175 | - if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size; |
|
| 176 | - if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes; |
|
| 177 | - if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink; |
|
| 178 | - if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site; |
|
| 179 | - if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format; |
|
| 180 | - if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant; |
|
| 174 | + if (!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize; |
|
| 175 | + if (!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size; |
|
| 176 | + if (!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes; |
|
| 177 | + if (!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink; |
|
| 178 | + if (!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site; |
|
| 179 | + if (!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format; |
|
| 180 | + if (!$config->download_grant) $config->download_grant = $file_module_config->download_grant; |
|
| 181 | 181 | // Default setting if not exists |
| 182 | - if(!$config->allowed_filesize) $config->allowed_filesize = '2'; |
|
| 183 | - if(!$config->allowed_attach_size) $config->allowed_attach_size = '3'; |
|
| 184 | - if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*'; |
|
| 185 | - if(!$config->allow_outlink) $config->allow_outlink = 'Y'; |
|
| 186 | - if(!$config->download_grant) $config->download_grant = array(); |
|
| 182 | + if (!$config->allowed_filesize) $config->allowed_filesize = '2'; |
|
| 183 | + if (!$config->allowed_attach_size) $config->allowed_attach_size = '3'; |
|
| 184 | + if (!$config->allowed_filetypes) $config->allowed_filetypes = '*.*'; |
|
| 185 | + if (!$config->allow_outlink) $config->allow_outlink = 'Y'; |
|
| 186 | + if (!$config->download_grant) $config->download_grant = array(); |
|
| 187 | 187 | |
| 188 | 188 | $size = ini_get('upload_max_filesize'); |
| 189 | 189 | $unit = strtolower($size[strlen($size) - 1]); |
| 190 | - $size = (float)$size; |
|
| 191 | - if($unit == 'g') $size *= 1024; |
|
| 192 | - if($unit == 'k') $size /= 1024; |
|
| 190 | + $size = (float) $size; |
|
| 191 | + if ($unit == 'g') $size *= 1024; |
|
| 192 | + if ($unit == 'k') $size /= 1024; |
|
| 193 | 193 | |
| 194 | - if($config->allowed_filesize > $size) |
|
| 194 | + if ($config->allowed_filesize > $size) |
|
| 195 | 195 | { |
| 196 | 196 | $config->allowed_filesize = $size; |
| 197 | 197 | } |
| 198 | - if($config->allowed_attach_size > $size) |
|
| 198 | + if ($config->allowed_attach_size > $size) |
|
| 199 | 199 | { |
| 200 | 200 | $config->allowed_attach_size = $size; |
| 201 | 201 | } |
@@ -215,10 +215,10 @@ discard block |
||
| 215 | 215 | $args = new stdClass(); |
| 216 | 216 | $args->file_srl = $file_srl; |
| 217 | 217 | $output = executeQueryArray('file.getFile', $args, $columnList); |
| 218 | - if(!$output->toBool()) return $output; |
|
| 218 | + if (!$output->toBool()) return $output; |
|
| 219 | 219 | |
| 220 | 220 | // old version compatibility |
| 221 | - if(count($output->data) == 1) |
|
| 221 | + if (count($output->data) == 1) |
|
| 222 | 222 | { |
| 223 | 223 | $file = $output->data[0]; |
| 224 | 224 | $file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl); |
@@ -229,9 +229,9 @@ discard block |
||
| 229 | 229 | { |
| 230 | 230 | $fileList = array(); |
| 231 | 231 | |
| 232 | - if(is_array($output->data)) |
|
| 232 | + if (is_array($output->data)) |
|
| 233 | 233 | { |
| 234 | - foreach($output->data as $key=>$value) |
|
| 234 | + foreach ($output->data as $key=>$value) |
|
| 235 | 235 | { |
| 236 | 236 | $file = $value; |
| 237 | 237 | $file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl); |
@@ -255,13 +255,13 @@ discard block |
||
| 255 | 255 | $args = new stdClass(); |
| 256 | 256 | $args->upload_target_srl = $upload_target_srl; |
| 257 | 257 | $args->sort_index = $sortIndex; |
| 258 | - if($ckValid) $args->isvalid = 'Y'; |
|
| 258 | + if ($ckValid) $args->isvalid = 'Y'; |
|
| 259 | 259 | $output = executeQueryArray('file.getFiles', $args, $columnList); |
| 260 | - if(!$output->data) return; |
|
| 260 | + if (!$output->data) return; |
|
| 261 | 261 | |
| 262 | 262 | $file_list = $output->data; |
| 263 | 263 | |
| 264 | - if($file_list && !is_array($file_list)) $file_list = array($file_list); |
|
| 264 | + if ($file_list && !is_array($file_list)) $file_list = array($file_list); |
|
| 265 | 265 | |
| 266 | 266 | foreach ($file_list as &$file) |
| 267 | 267 | { |
@@ -284,14 +284,14 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | $module_srl = Context::get('module_srl'); |
| 286 | 286 | // Get the current module if module_srl doesn't exist |
| 287 | - if(!$module_srl) |
|
| 287 | + if (!$module_srl) |
|
| 288 | 288 | { |
| 289 | 289 | $current_module_info = Context::get('current_module_info'); |
| 290 | 290 | $module_srl = $current_module_info->module_srl; |
| 291 | 291 | } |
| 292 | 292 | $file_config = $this->getFileConfig($module_srl); |
| 293 | 293 | |
| 294 | - if($logged_info->is_admin == 'Y') |
|
| 294 | + if ($logged_info->is_admin == 'Y') |
|
| 295 | 295 | { |
| 296 | 296 | $iniPostMaxSize = FileHandler::returnbytes(ini_get('post_max_size')); |
| 297 | 297 | $iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize')); |
@@ -317,9 +317,9 @@ discard block |
||
| 317 | 317 | '%s : %s/ %s<br /> %s : %s (%s : %s)', |
| 318 | 318 | Context::getLang('allowed_attach_size'), |
| 319 | 319 | FileHandler::filesize($attached_size), |
| 320 | - FileHandler::filesize($file_config->allowed_attach_size*1024*1024), |
|
| 320 | + FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024), |
|
| 321 | 321 | Context::getLang('allowed_filesize'), |
| 322 | - FileHandler::filesize($file_config->allowed_filesize*1024*1024), |
|
| 322 | + FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024), |
|
| 323 | 323 | Context::getLang('allowed_filetypes'), |
| 324 | 324 | $file_config->allowed_filetypes |
| 325 | 325 | ); |
@@ -346,9 +346,9 @@ discard block |
||
| 346 | 346 | */ |
| 347 | 347 | function getFileGrant($file_info, $member_info) |
| 348 | 348 | { |
| 349 | - if(!$file_info) return null; |
|
| 349 | + if (!$file_info) return null; |
|
| 350 | 350 | |
| 351 | - if($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl]) |
|
| 351 | + if ($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl]) |
|
| 352 | 352 | { |
| 353 | 353 | $file_grant->is_deletable = true; |
| 354 | 354 | return $file_grant; |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | |
| 360 | 360 | $oDocumentModel = getModel('document'); |
| 361 | 361 | $oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl); |
| 362 | - if($oDocument->isExists()) $document_grant = $oDocument->isGranted(); |
|
| 362 | + if ($oDocument->isExists()) $document_grant = $oDocument->isGranted(); |
|
| 363 | 363 | |
| 364 | 364 | $file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager); |
| 365 | 365 | |
@@ -29,7 +29,9 @@ discard block |
||
| 29 | 29 | $mid = Context::get('mid'); |
| 30 | 30 | $editor_sequence = Context::get('editor_sequence'); |
| 31 | 31 | $upload_target_srl = Context::get('upload_target_srl'); |
| 32 | - if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
| 32 | + if(!$upload_target_srl) { |
|
| 33 | + $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
| 34 | + } |
|
| 33 | 35 | |
| 34 | 36 | if($upload_target_srl) |
| 35 | 37 | { |
@@ -68,26 +70,32 @@ discard block |
||
| 68 | 70 | } |
| 69 | 71 | |
| 70 | 72 | $tmp_files = $this->getFiles($upload_target_srl); |
| 71 | - if(!$tmp_files) $tmp_files = array(); |
|
| 73 | + if(!$tmp_files) { |
|
| 74 | + $tmp_files = array(); |
|
| 75 | + } |
|
| 72 | 76 | |
| 73 | 77 | foreach($tmp_files as $file_info) |
| 74 | 78 | { |
| 75 | - if(!$file_info->file_srl) continue; |
|
| 79 | + if(!$file_info->file_srl) { |
|
| 80 | + continue; |
|
| 81 | + } |
|
| 76 | 82 | |
| 77 | 83 | $obj = new stdClass; |
| 78 | 84 | $obj->file_srl = $file_info->file_srl; |
| 79 | 85 | $obj->source_filename = $file_info->source_filename; |
| 80 | 86 | $obj->file_size = $file_info->file_size; |
| 81 | 87 | $obj->disp_file_size = FileHandler::filesize($file_info->file_size); |
| 82 | - if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl); |
|
| 83 | - else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename); |
|
| 88 | + if($file_info->direct_download=='N') { |
|
| 89 | + $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl); |
|
| 90 | + } else { |
|
| 91 | + $obj->download_url = str_replace('./', '', $file_info->uploaded_filename); |
|
| 92 | + } |
|
| 84 | 93 | $obj->direct_download = $file_info->direct_download; |
| 85 | 94 | $obj->cover_image = ($file_info->cover_image === 'Y') ? true : false; |
| 86 | 95 | $files[] = $obj; |
| 87 | 96 | $attached_size += $file_info->file_size; |
| 88 | 97 | } |
| 89 | - } |
|
| 90 | - else |
|
| 98 | + } else |
|
| 91 | 99 | { |
| 92 | 100 | $upload_target_srl = 0; |
| 93 | 101 | $attached_size = 0; |
@@ -155,8 +163,12 @@ discard block |
||
| 155 | 163 | |
| 156 | 164 | $file_module_config = $oModuleModel->getModuleConfig('file'); |
| 157 | 165 | |
| 158 | - if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl); |
|
| 159 | - if(!$file_config) $file_config = $file_module_config; |
|
| 166 | + if($module_srl) { |
|
| 167 | + $file_config = $oModuleModel->getModulePartConfig('file',$module_srl); |
|
| 168 | + } |
|
| 169 | + if(!$file_config) { |
|
| 170 | + $file_config = $file_module_config; |
|
| 171 | + } |
|
| 160 | 172 | |
| 161 | 173 | $config = new stdClass(); |
| 162 | 174 | |
@@ -171,25 +183,53 @@ discard block |
||
| 171 | 183 | $config->allow_outlink_format = $file_config->allow_outlink_format; |
| 172 | 184 | } |
| 173 | 185 | // Property for all files comes first than each property |
| 174 | - if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize; |
|
| 175 | - if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size; |
|
| 176 | - if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes; |
|
| 177 | - if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink; |
|
| 178 | - if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site; |
|
| 179 | - if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format; |
|
| 180 | - if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant; |
|
| 186 | + if(!$config->allowed_filesize) { |
|
| 187 | + $config->allowed_filesize = $file_module_config->allowed_filesize; |
|
| 188 | + } |
|
| 189 | + if(!$config->allowed_attach_size) { |
|
| 190 | + $config->allowed_attach_size = $file_module_config->allowed_attach_size; |
|
| 191 | + } |
|
| 192 | + if(!$config->allowed_filetypes) { |
|
| 193 | + $config->allowed_filetypes = $file_module_config->allowed_filetypes; |
|
| 194 | + } |
|
| 195 | + if(!$config->allow_outlink) { |
|
| 196 | + $config->allow_outlink = $file_module_config->allow_outlink; |
|
| 197 | + } |
|
| 198 | + if(!$config->allow_outlink_site) { |
|
| 199 | + $config->allow_outlink_site = $file_module_config->allow_outlink_site; |
|
| 200 | + } |
|
| 201 | + if(!$config->allow_outlink_format) { |
|
| 202 | + $config->allow_outlink_format = $file_module_config->allow_outlink_format; |
|
| 203 | + } |
|
| 204 | + if(!$config->download_grant) { |
|
| 205 | + $config->download_grant = $file_module_config->download_grant; |
|
| 206 | + } |
|
| 181 | 207 | // Default setting if not exists |
| 182 | - if(!$config->allowed_filesize) $config->allowed_filesize = '2'; |
|
| 183 | - if(!$config->allowed_attach_size) $config->allowed_attach_size = '3'; |
|
| 184 | - if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*'; |
|
| 185 | - if(!$config->allow_outlink) $config->allow_outlink = 'Y'; |
|
| 186 | - if(!$config->download_grant) $config->download_grant = array(); |
|
| 208 | + if(!$config->allowed_filesize) { |
|
| 209 | + $config->allowed_filesize = '2'; |
|
| 210 | + } |
|
| 211 | + if(!$config->allowed_attach_size) { |
|
| 212 | + $config->allowed_attach_size = '3'; |
|
| 213 | + } |
|
| 214 | + if(!$config->allowed_filetypes) { |
|
| 215 | + $config->allowed_filetypes = '*.*'; |
|
| 216 | + } |
|
| 217 | + if(!$config->allow_outlink) { |
|
| 218 | + $config->allow_outlink = 'Y'; |
|
| 219 | + } |
|
| 220 | + if(!$config->download_grant) { |
|
| 221 | + $config->download_grant = array(); |
|
| 222 | + } |
|
| 187 | 223 | |
| 188 | 224 | $size = ini_get('upload_max_filesize'); |
| 189 | 225 | $unit = strtolower($size[strlen($size) - 1]); |
| 190 | 226 | $size = (float)$size; |
| 191 | - if($unit == 'g') $size *= 1024; |
|
| 192 | - if($unit == 'k') $size /= 1024; |
|
| 227 | + if($unit == 'g') { |
|
| 228 | + $size *= 1024; |
|
| 229 | + } |
|
| 230 | + if($unit == 'k') { |
|
| 231 | + $size /= 1024; |
|
| 232 | + } |
|
| 193 | 233 | |
| 194 | 234 | if($config->allowed_filesize > $size) |
| 195 | 235 | { |
@@ -215,7 +255,9 @@ discard block |
||
| 215 | 255 | $args = new stdClass(); |
| 216 | 256 | $args->file_srl = $file_srl; |
| 217 | 257 | $output = executeQueryArray('file.getFile', $args, $columnList); |
| 218 | - if(!$output->toBool()) return $output; |
|
| 258 | + if(!$output->toBool()) { |
|
| 259 | + return $output; |
|
| 260 | + } |
|
| 219 | 261 | |
| 220 | 262 | // old version compatibility |
| 221 | 263 | if(count($output->data) == 1) |
@@ -224,8 +266,7 @@ discard block |
||
| 224 | 266 | $file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl); |
| 225 | 267 | |
| 226 | 268 | return $file; |
| 227 | - } |
|
| 228 | - else |
|
| 269 | + } else |
|
| 229 | 270 | { |
| 230 | 271 | $fileList = array(); |
| 231 | 272 | |
@@ -255,13 +296,19 @@ discard block |
||
| 255 | 296 | $args = new stdClass(); |
| 256 | 297 | $args->upload_target_srl = $upload_target_srl; |
| 257 | 298 | $args->sort_index = $sortIndex; |
| 258 | - if($ckValid) $args->isvalid = 'Y'; |
|
| 299 | + if($ckValid) { |
|
| 300 | + $args->isvalid = 'Y'; |
|
| 301 | + } |
|
| 259 | 302 | $output = executeQueryArray('file.getFiles', $args, $columnList); |
| 260 | - if(!$output->data) return; |
|
| 303 | + if(!$output->data) { |
|
| 304 | + return; |
|
| 305 | + } |
|
| 261 | 306 | |
| 262 | 307 | $file_list = $output->data; |
| 263 | 308 | |
| 264 | - if($file_list && !is_array($file_list)) $file_list = array($file_list); |
|
| 309 | + if($file_list && !is_array($file_list)) { |
|
| 310 | + $file_list = array($file_list); |
|
| 311 | + } |
|
| 265 | 312 | |
| 266 | 313 | foreach ($file_list as &$file) |
| 267 | 314 | { |
@@ -346,7 +393,9 @@ discard block |
||
| 346 | 393 | */ |
| 347 | 394 | function getFileGrant($file_info, $member_info) |
| 348 | 395 | { |
| 349 | - if(!$file_info) return null; |
|
| 396 | + if(!$file_info) { |
|
| 397 | + return null; |
|
| 398 | + } |
|
| 350 | 399 | |
| 351 | 400 | if($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl]) |
| 352 | 401 | { |
@@ -359,7 +408,9 @@ discard block |
||
| 359 | 408 | |
| 360 | 409 | $oDocumentModel = getModel('document'); |
| 361 | 410 | $oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl); |
| 362 | - if($oDocument->isExists()) $document_grant = $oDocument->isGranted(); |
|
| 411 | + if($oDocument->isExists()) { |
|
| 412 | + $document_grant = $oDocument->isGranted(); |
|
| 413 | + } |
|
| 363 | 414 | |
| 364 | 415 | $file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager); |
| 365 | 416 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | function ModuleHandler($module = '', $act = '', $mid = '', $document_srl = '', $module_srl = '') |
| 36 | 36 | { |
| 37 | 37 | // If XE has not installed yet, set module as install |
| 38 | - if(!Context::isInstalled()) |
|
| 38 | + if (!Context::isInstalled()) |
|
| 39 | 39 | { |
| 40 | 40 | $this->module = 'install'; |
| 41 | 41 | $this->act = Context::get('act'); |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | $oContext = Context::getInstance(); |
| 46 | - if($oContext->isSuccessInit == FALSE) |
|
| 46 | + if ($oContext->isSuccessInit == FALSE) |
|
| 47 | 47 | { |
| 48 | 48 | $logged_info = Context::get('logged_info'); |
| 49 | - if($logged_info->is_admin != "Y") |
|
| 49 | + if ($logged_info->is_admin != "Y") |
|
| 50 | 50 | { |
| 51 | 51 | $this->error = 'msg_invalid_request'; |
| 52 | 52 | return; |
@@ -59,26 +59,26 @@ discard block |
||
| 59 | 59 | $this->mid = $mid ? $mid : Context::get('mid'); |
| 60 | 60 | $this->document_srl = $document_srl ? (int) $document_srl : (int) Context::get('document_srl'); |
| 61 | 61 | $this->module_srl = $module_srl ? (int) $module_srl : (int) Context::get('module_srl'); |
| 62 | - if($entry = Context::get('entry')) |
|
| 62 | + if ($entry = Context::get('entry')) |
|
| 63 | 63 | { |
| 64 | 64 | $this->entry = Context::convertEncodingStr($entry); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | // Validate variables to prevent XSS |
| 68 | 68 | $isInvalid = NULL; |
| 69 | - if($this->module && !preg_match("/^([a-z0-9\_\-]+)$/i", $this->module)) |
|
| 69 | + if ($this->module && !preg_match("/^([a-z0-9\_\-]+)$/i", $this->module)) |
|
| 70 | 70 | { |
| 71 | 71 | $isInvalid = TRUE; |
| 72 | 72 | } |
| 73 | - if($this->mid && !preg_match("/^([a-z0-9\_\-]+)$/i", $this->mid)) |
|
| 73 | + if ($this->mid && !preg_match("/^([a-z0-9\_\-]+)$/i", $this->mid)) |
|
| 74 | 74 | { |
| 75 | 75 | $isInvalid = TRUE; |
| 76 | 76 | } |
| 77 | - if($this->act && !preg_match("/^([a-z0-9\_\-]+)$/i", $this->act)) |
|
| 77 | + if ($this->act && !preg_match("/^([a-z0-9\_\-]+)$/i", $this->act)) |
|
| 78 | 78 | { |
| 79 | 79 | $isInvalid = TRUE; |
| 80 | 80 | } |
| 81 | - if($isInvalid) |
|
| 81 | + if ($isInvalid) |
|
| 82 | 82 | { |
| 83 | 83 | htmlHeader(); |
| 84 | 84 | echo Context::getLang("msg_invalid_request"); |
@@ -87,14 +87,14 @@ discard block |
||
| 87 | 87 | exit; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - if(isset($this->act) && (strlen($this->act) >= 4 && substr_compare($this->act, 'disp', 0, 4) === 0)) |
|
| 90 | + if (isset($this->act) && (strlen($this->act) >= 4 && substr_compare($this->act, 'disp', 0, 4) === 0)) |
|
| 91 | 91 | { |
| 92 | - if(Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && $_SERVER['HTTPS'] != 'on') |
|
| 92 | + if (Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && $_SERVER['HTTPS'] != 'on') |
|
| 93 | 93 | { |
| 94 | - if(Context::get('_https_port')!=null) { |
|
| 95 | - header('location:https://' . $_SERVER['HTTP_HOST'] . ':' . Context::get('_https_port') . $_SERVER['REQUEST_URI']); |
|
| 94 | + if (Context::get('_https_port') != null) { |
|
| 95 | + header('location:https://'.$_SERVER['HTTP_HOST'].':'.Context::get('_https_port').$_SERVER['REQUEST_URI']); |
|
| 96 | 96 | } else { |
| 97 | - header('location:https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); |
|
| 97 | + header('location:https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); |
|
| 98 | 98 | } |
| 99 | 99 | return; |
| 100 | 100 | } |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | // call a trigger before moduleHandler init |
| 104 | 104 | ModuleHandler::triggerCall('moduleHandler.init', 'before', $this); |
| 105 | - if(__ERROR_LOG__ == 1 && __DEBUG_OUTPUT__ == 0) |
|
| 105 | + if (__ERROR_LOG__ == 1 && __DEBUG_OUTPUT__ == 0) |
|
| 106 | 106 | { |
| 107 | - if(__DEBUG_PROTECT__ === 0 || __DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ == $_SERVER['REMOTE_ADDR']) |
|
| 107 | + if (__DEBUG_PROTECT__ === 0 || __DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ == $_SERVER['REMOTE_ADDR']) |
|
| 108 | 108 | { |
| 109 | 109 | set_error_handler(array($this, 'xeErrorLog'), E_WARNING); |
| 110 | 110 | register_shutdown_function(array($this, 'shutdownHandler')); |
@@ -115,40 +115,40 @@ discard block |
||
| 115 | 115 | $called_position = 'before_module_init'; |
| 116 | 116 | $oAddonController = getController('addon'); |
| 117 | 117 | $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? 'mobile' : 'pc'); |
| 118 | - if(file_exists($addon_file)) include($addon_file); |
|
| 118 | + if (file_exists($addon_file)) include($addon_file); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | public static function xeErrorLog($errnumber, $errormassage, $errorfile, $errorline, $errorcontext) |
| 122 | 122 | { |
| 123 | - if(($errnumber & 3) == 0 || error_reporting() == 0) |
|
| 123 | + if (($errnumber & 3) == 0 || error_reporting() == 0) |
|
| 124 | 124 | { |
| 125 | 125 | return false; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | set_error_handler(function() { }, ~0); |
| 129 | 129 | |
| 130 | - $debug_file = _XE_PATH_ . 'files/_debug_message.php'; |
|
| 131 | - if(!file_exists($debug_file)) |
|
| 130 | + $debug_file = _XE_PATH_.'files/_debug_message.php'; |
|
| 131 | + if (!file_exists($debug_file)) |
|
| 132 | 132 | { |
| 133 | 133 | $print[] = '<?php exit() ?>'; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | $errorname = self::getErrorType($errnumber); |
| 137 | - $print[] = '['.date('Y-m-d H:i:s').'] ' . $errorname . ' : ' . $errormassage; |
|
| 137 | + $print[] = '['.date('Y-m-d H:i:s').'] '.$errorname.' : '.$errormassage; |
|
| 138 | 138 | $backtrace_args = defined('DEBUG_BACKTRACE_IGNORE_ARGS') ? \DEBUG_BACKTRACE_IGNORE_ARGS : 0; |
| 139 | 139 | $backtrace = debug_backtrace($backtrace_args); |
| 140 | - if(count($backtrace) > 1 && $backtrace[1]['function'] === 'xeErrorLog' && !$backtrace[1]['class']) |
|
| 140 | + if (count($backtrace) > 1 && $backtrace[1]['function'] === 'xeErrorLog' && !$backtrace[1]['class']) |
|
| 141 | 141 | { |
| 142 | 142 | array_shift($backtrace); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - foreach($backtrace as $key => $value) |
|
| 145 | + foreach ($backtrace as $key => $value) |
|
| 146 | 146 | { |
| 147 | - $message = ' - ' . $value['file'] . ' : ' . $value['line']; |
|
| 147 | + $message = ' - '.$value['file'].' : '.$value['line']; |
|
| 148 | 148 | $print[] = $message; |
| 149 | 149 | } |
| 150 | 150 | $print[] = PHP_EOL; |
| 151 | - @file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND|LOCK_EX); |
|
| 151 | + @file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND | LOCK_EX); |
|
| 152 | 152 | restore_error_handler(); |
| 153 | 153 | |
| 154 | 154 | return true; |
@@ -164,21 +164,21 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | set_error_handler(function() { }, ~0); |
| 166 | 166 | |
| 167 | - $debug_file = _XE_PATH_ . 'files/_debug_message.php'; |
|
| 168 | - if(!file_exists($debug_file)) |
|
| 167 | + $debug_file = _XE_PATH_.'files/_debug_message.php'; |
|
| 168 | + if (!file_exists($debug_file)) |
|
| 169 | 169 | { |
| 170 | 170 | $print[] = '<?php exit() ?>'; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | $errorname = self::getErrorType($errinfo['type']); |
| 174 | 174 | $print[] = '['.date('Y-m-d H:i:s').']'; |
| 175 | - $print[] = $errorname . ' : ' . $errinfo['message']; |
|
| 175 | + $print[] = $errorname.' : '.$errinfo['message']; |
|
| 176 | 176 | |
| 177 | - $message = ' - ' . $errinfo['file'] . ' : ' . $errinfo['line']; |
|
| 177 | + $message = ' - '.$errinfo['file'].' : '.$errinfo['line']; |
|
| 178 | 178 | $print[] = $message; |
| 179 | 179 | |
| 180 | 180 | $print[] = PHP_EOL; |
| 181 | - @file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND|LOCK_EX); |
|
| 181 | + @file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND | LOCK_EX); |
|
| 182 | 182 | set_error_handler(array($this, 'dummyHandler'), ~0); |
| 183 | 183 | |
| 184 | 184 | return true; |
@@ -222,9 +222,9 @@ discard block |
||
| 222 | 222 | $defaultUrlInfo = parse_url($dbInfo->default_url); |
| 223 | 223 | $defaultHost = $defaultUrlInfo['host']; |
| 224 | 224 | |
| 225 | - foreach($urls as $url) |
|
| 225 | + foreach ($urls as $url) |
|
| 226 | 226 | { |
| 227 | - if(empty($url)) |
|
| 227 | + if (empty($url)) |
|
| 228 | 228 | { |
| 229 | 229 | continue; |
| 230 | 230 | } |
@@ -232,29 +232,29 @@ discard block |
||
| 232 | 232 | $urlInfo = parse_url($url); |
| 233 | 233 | $host = $urlInfo['host']; |
| 234 | 234 | |
| 235 | - if($host && ($host != $defaultHost && $host != $site_module_info->domain)) |
|
| 235 | + if ($host && ($host != $defaultHost && $host != $site_module_info->domain)) |
|
| 236 | 236 | { |
| 237 | 237 | throw new Exception('msg_default_url_is_null'); |
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - if(!$this->document_srl && $this->mid && $this->entry) |
|
| 241 | + if (!$this->document_srl && $this->mid && $this->entry) |
|
| 242 | 242 | { |
| 243 | 243 | $oDocumentModel = getModel('document'); |
| 244 | 244 | $this->document_srl = $oDocumentModel->getDocumentSrlByAlias($this->mid, $this->entry); |
| 245 | - if($this->document_srl) |
|
| 245 | + if ($this->document_srl) |
|
| 246 | 246 | { |
| 247 | 247 | Context::set('document_srl', $this->document_srl); |
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | // Get module's information based on document_srl, if it's specified |
| 252 | - if($this->document_srl) |
|
| 252 | + if ($this->document_srl) |
|
| 253 | 253 | { |
| 254 | 254 | |
| 255 | 255 | $module_info = $oModuleModel->getModuleInfoByDocumentSrl($this->document_srl); |
| 256 | 256 | // If the document does not exist, remove document_srl |
| 257 | - if(!$module_info) |
|
| 257 | + if (!$module_info) |
|
| 258 | 258 | { |
| 259 | 259 | unset($this->document_srl); |
| 260 | 260 | } |
@@ -262,13 +262,13 @@ discard block |
||
| 262 | 262 | { |
| 263 | 263 | // If it exists, compare mid based on the module information |
| 264 | 264 | // if mids are not matching, set it as the document's mid |
| 265 | - if(!$this->mid || ($this->mid != $module_info->mid)) |
|
| 265 | + if (!$this->mid || ($this->mid != $module_info->mid)) |
|
| 266 | 266 | { |
| 267 | 267 | |
| 268 | - if(Context::getRequestMethod() == 'GET') |
|
| 268 | + if (Context::getRequestMethod() == 'GET') |
|
| 269 | 269 | { |
| 270 | 270 | $this->mid = $module_info->mid; |
| 271 | - header('location:' . getNotEncodedSiteUrl($site_module_info->domain, 'mid', $this->mid, 'document_srl', $this->document_srl)); |
|
| 271 | + header('location:'.getNotEncodedSiteUrl($site_module_info->domain, 'mid', $this->mid, 'document_srl', $this->document_srl)); |
|
| 272 | 272 | return FALSE; |
| 273 | 273 | } |
| 274 | 274 | else |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | } |
| 281 | 281 | // if requested module is different from one of the document, remove the module information retrieved based on the document number |
| 282 | - if($this->module && $module_info->module != $this->module) |
|
| 282 | + if ($this->module && $module_info->module != $this->module) |
|
| 283 | 283 | { |
| 284 | 284 | unset($module_info); |
| 285 | 285 | } |
@@ -288,36 +288,36 @@ discard block |
||
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | // If module_info is not set yet, and there exists mid information, get module information based on the mid |
| 291 | - if(!$module_info && $this->mid) |
|
| 291 | + if (!$module_info && $this->mid) |
|
| 292 | 292 | { |
| 293 | 293 | $module_info = $oModuleModel->getModuleInfoByMid($this->mid, $site_module_info->site_srl); |
| 294 | 294 | //if($this->module && $module_info->module != $this->module) unset($module_info); |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | // redirect, if module_site_srl and site_srl are different |
| 298 | - if(!$this->module && !$module_info && $site_module_info->site_srl == 0 && $site_module_info->module_site_srl > 0) |
|
| 298 | + if (!$this->module && !$module_info && $site_module_info->site_srl == 0 && $site_module_info->module_site_srl > 0) |
|
| 299 | 299 | { |
| 300 | 300 | $site_info = $oModuleModel->getSiteInfo($site_module_info->module_site_srl); |
| 301 | - header("location:" . getNotEncodedSiteUrl($site_info->domain, 'mid', $site_module_info->mid)); |
|
| 301 | + header("location:".getNotEncodedSiteUrl($site_info->domain, 'mid', $site_module_info->mid)); |
|
| 302 | 302 | return FALSE; |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | // If module_info is not set still, and $module does not exist, find the default module |
| 306 | - if(!$module_info && !$this->module && !$this->mid) |
|
| 306 | + if (!$module_info && !$this->module && !$this->mid) |
|
| 307 | 307 | { |
| 308 | 308 | $module_info = $site_module_info; |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | - if(!$module_info && !$this->module && $site_module_info->module_site_srl) |
|
| 311 | + if (!$module_info && !$this->module && $site_module_info->module_site_srl) |
|
| 312 | 312 | { |
| 313 | 313 | $module_info = $site_module_info; |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | // redirect, if site_srl of module_info is different from one of site's module_info |
| 317 | - if($module_info && $module_info->site_srl != $site_module_info->site_srl && !isCrawler()) |
|
| 317 | + if ($module_info && $module_info->site_srl != $site_module_info->site_srl && !isCrawler()) |
|
| 318 | 318 | { |
| 319 | 319 | // If the module is of virtual site |
| 320 | - if($module_info->site_srl) |
|
| 320 | + if ($module_info->site_srl) |
|
| 321 | 321 | { |
| 322 | 322 | $site_info = $oModuleModel->getSiteInfo($module_info->site_srl); |
| 323 | 323 | $redirect_url = getNotEncodedSiteUrl($site_info->domain, 'mid', Context::get('mid'), 'document_srl', Context::get('document_srl'), 'module_srl', Context::get('module_srl'), 'entry', Context::get('entry')); |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | else |
| 327 | 327 | { |
| 328 | 328 | $db_info = Context::getDBInfo(); |
| 329 | - if(!$db_info->default_url) |
|
| 329 | + if (!$db_info->default_url) |
|
| 330 | 330 | { |
| 331 | 331 | return Context::getLang('msg_default_url_is_not_defined'); |
| 332 | 332 | } |
@@ -335,12 +335,12 @@ discard block |
||
| 335 | 335 | $redirect_url = getNotEncodedSiteUrl($db_info->default_url, 'mid', Context::get('mid'), 'document_srl', Context::get('document_srl'), 'module_srl', Context::get('module_srl'), 'entry', Context::get('entry')); |
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | - header("location:" . $redirect_url); |
|
| 338 | + header("location:".$redirect_url); |
|
| 339 | 339 | return FALSE; |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | // If module info was set, retrieve variables from the module information |
| 343 | - if($module_info) |
|
| 343 | + if ($module_info) |
|
| 344 | 344 | { |
| 345 | 345 | $this->module = $module_info->module; |
| 346 | 346 | $this->mid = $module_info->mid; |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | $targetSrl = (Mobile::isFromMobilePhone()) ? 'mlayout_srl' : 'layout_srl'; |
| 352 | 352 | |
| 353 | 353 | // use the site default layout. |
| 354 | - if($module_info->{$targetSrl} == -1) |
|
| 354 | + if ($module_info->{$targetSrl} == -1) |
|
| 355 | 355 | { |
| 356 | 356 | $oLayoutAdminModel = getAdminModel('layout'); |
| 357 | 357 | $layoutSrl = $oLayoutAdminModel->getSiteDefaultLayout($viewType, $module_info->site_srl); |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | // Set module and mid into module_info |
| 372 | - if(!isset($this->module_info)) |
|
| 372 | + if (!isset($this->module_info)) |
|
| 373 | 373 | { |
| 374 | 374 | $this->module_info = new stdClass(); |
| 375 | 375 | } |
@@ -380,21 +380,21 @@ discard block |
||
| 380 | 380 | $this->module_info->site_srl = $site_module_info->site_srl; |
| 381 | 381 | |
| 382 | 382 | // Still no module? it's an error |
| 383 | - if(!$this->module) |
|
| 383 | + if (!$this->module) |
|
| 384 | 384 | { |
| 385 | 385 | $this->error = 'msg_module_is_not_exists'; |
| 386 | 386 | $this->httpStatusCode = '404'; |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | // If mid exists, set mid into context |
| 390 | - if($this->mid) |
|
| 390 | + if ($this->mid) |
|
| 391 | 391 | { |
| 392 | 392 | Context::set('mid', $this->mid, TRUE); |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | // Call a trigger after moduleHandler init |
| 396 | 396 | $output = ModuleHandler::triggerCall('moduleHandler.init', 'after', $this->module_info); |
| 397 | - if(!$output->toBool()) |
|
| 397 | + if (!$output->toBool()) |
|
| 398 | 398 | { |
| 399 | 399 | $this->error = $output->getMessage(); |
| 400 | 400 | return TRUE; |
@@ -416,14 +416,14 @@ discard block |
||
| 416 | 416 | $display_mode = Mobile::isFromMobilePhone() ? 'mobile' : 'view'; |
| 417 | 417 | |
| 418 | 418 | // If error occurred while preparation, return a message instance |
| 419 | - if($this->error) |
|
| 419 | + if ($this->error) |
|
| 420 | 420 | { |
| 421 | 421 | $this->_setInputErrorToContext(); |
| 422 | 422 | $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); |
| 423 | 423 | $oMessageObject->setError(-1); |
| 424 | 424 | $oMessageObject->setMessage($this->error); |
| 425 | 425 | $oMessageObject->dispMessage(); |
| 426 | - if($this->httpStatusCode) |
|
| 426 | + if ($this->httpStatusCode) |
|
| 427 | 427 | { |
| 428 | 428 | $oMessageObject->setHttpStatusCode($this->httpStatusCode); |
| 429 | 429 | } |
@@ -434,22 +434,22 @@ discard block |
||
| 434 | 434 | $xml_info = $oModuleModel->getModuleActionXml($this->module); |
| 435 | 435 | |
| 436 | 436 | // If not installed yet, modify act |
| 437 | - if($this->module == "install") |
|
| 437 | + if ($this->module == "install") |
|
| 438 | 438 | { |
| 439 | - if(!$this->act || !$xml_info->action->{$this->act}) |
|
| 439 | + if (!$this->act || !$xml_info->action->{$this->act}) |
|
| 440 | 440 | { |
| 441 | 441 | $this->act = $xml_info->default_index_act; |
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | // if act exists, find type of the action, if not use default index act |
| 446 | - if(!$this->act) |
|
| 446 | + if (!$this->act) |
|
| 447 | 447 | { |
| 448 | 448 | $this->act = $xml_info->default_index_act; |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | // still no act means error |
| 452 | - if(!$this->act) |
|
| 452 | + if (!$this->act) |
|
| 453 | 453 | { |
| 454 | 454 | $this->error = 'msg_module_is_not_exists'; |
| 455 | 455 | $this->httpStatusCode = '404'; |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | $oMessageObject->setError(-1); |
| 460 | 460 | $oMessageObject->setMessage($this->error); |
| 461 | 461 | $oMessageObject->dispMessage(); |
| 462 | - if($this->httpStatusCode) |
|
| 462 | + if ($this->httpStatusCode) |
|
| 463 | 463 | { |
| 464 | 464 | $oMessageObject->setHttpStatusCode($this->httpStatusCode); |
| 465 | 465 | } |
@@ -470,17 +470,17 @@ discard block |
||
| 470 | 470 | $type = $xml_info->action->{$this->act}->type; |
| 471 | 471 | $ruleset = $xml_info->action->{$this->act}->ruleset; |
| 472 | 472 | $kind = stripos($this->act, 'admin') !== FALSE ? 'admin' : ''; |
| 473 | - if(!$kind && $this->module == 'admin') |
|
| 473 | + if (!$kind && $this->module == 'admin') |
|
| 474 | 474 | { |
| 475 | 475 | $kind = 'admin'; |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | // check REQUEST_METHOD in controller |
| 479 | - if($type == 'controller') |
|
| 479 | + if ($type == 'controller') |
|
| 480 | 480 | { |
| 481 | 481 | $allowedMethod = $xml_info->action->{$this->act}->method; |
| 482 | 482 | |
| 483 | - if(!$allowedMethod) |
|
| 483 | + if (!$allowedMethod) |
|
| 484 | 484 | { |
| 485 | 485 | $allowedMethodList[0] = 'POST'; |
| 486 | 486 | } |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | $allowedMethodList = explode('|', strtoupper($allowedMethod)); |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | - if(!in_array(strtoupper($_SERVER['REQUEST_METHOD']), $allowedMethodList)) |
|
| 492 | + if (!in_array(strtoupper($_SERVER['REQUEST_METHOD']), $allowedMethodList)) |
|
| 493 | 493 | { |
| 494 | 494 | $this->error = "msg_invalid_request"; |
| 495 | 495 | $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | } |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | - if($this->module_info->use_mobile != "Y") |
|
| 503 | + if ($this->module_info->use_mobile != "Y") |
|
| 504 | 504 | { |
| 505 | 505 | Mobile::setMobile(FALSE); |
| 506 | 506 | } |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | |
| 510 | 510 | // check CSRF for non-GET actions |
| 511 | 511 | $use_check_csrf = isset($xml_info->action->{$this->act}) && $xml_info->action->{$this->act}->check_csrf !== 'false'; |
| 512 | - if($use_check_csrf && $_SERVER['REQUEST_METHOD'] !== 'GET' && Context::isInstalled() && !checkCSRF()) |
|
| 512 | + if ($use_check_csrf && $_SERVER['REQUEST_METHOD'] !== 'GET' && Context::isInstalled() && !checkCSRF()) |
|
| 513 | 513 | { |
| 514 | 514 | $this->error = 'msg_invalid_request'; |
| 515 | 515 | $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | // Admin ip |
| 523 | - if($kind == 'admin' && $_SESSION['denied_admin'] == 'Y') |
|
| 523 | + if ($kind == 'admin' && $_SESSION['denied_admin'] == 'Y') |
|
| 524 | 524 | { |
| 525 | 525 | $this->_setInputErrorToContext(); |
| 526 | 526 | $this->error = "msg_not_permitted_act"; |
@@ -532,13 +532,13 @@ discard block |
||
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | // if(type == view, and case for using mobilephone) |
| 535 | - if($type == "view" && Mobile::isFromMobilePhone() && Context::isInstalled()) |
|
| 535 | + if ($type == "view" && Mobile::isFromMobilePhone() && Context::isInstalled()) |
|
| 536 | 536 | { |
| 537 | 537 | $orig_type = "view"; |
| 538 | 538 | $type = "mobile"; |
| 539 | 539 | // create a module instance |
| 540 | 540 | $oModule = $this->getModuleInstance($this->module, $type, $kind); |
| 541 | - if(!is_object($oModule) || !method_exists($oModule, $this->act)) |
|
| 541 | + if (!is_object($oModule) || !method_exists($oModule, $this->act)) |
|
| 542 | 542 | { |
| 543 | 543 | $type = $orig_type; |
| 544 | 544 | Mobile::setMobile(FALSE); |
@@ -551,14 +551,14 @@ discard block |
||
| 551 | 551 | $oModule = $this->getModuleInstance($this->module, $type, $kind); |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | - if(!is_object($oModule)) |
|
| 554 | + if (!is_object($oModule)) |
|
| 555 | 555 | { |
| 556 | 556 | $this->_setInputErrorToContext(); |
| 557 | 557 | $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); |
| 558 | 558 | $oMessageObject->setError(-1); |
| 559 | 559 | $oMessageObject->setMessage($this->error); |
| 560 | 560 | $oMessageObject->dispMessage(); |
| 561 | - if($this->httpStatusCode) |
|
| 561 | + if ($this->httpStatusCode) |
|
| 562 | 562 | { |
| 563 | 563 | $oMessageObject->setHttpStatusCode($this->httpStatusCode); |
| 564 | 564 | } |
@@ -566,10 +566,10 @@ discard block |
||
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | // If there is no such action in the module object |
| 569 | - if(!isset($xml_info->action->{$this->act}) || !method_exists($oModule, $this->act)) |
|
| 569 | + if (!isset($xml_info->action->{$this->act}) || !method_exists($oModule, $this->act)) |
|
| 570 | 570 | { |
| 571 | 571 | |
| 572 | - if(!Context::isInstalled()) |
|
| 572 | + if (!Context::isInstalled()) |
|
| 573 | 573 | { |
| 574 | 574 | $this->_setInputErrorToContext(); |
| 575 | 575 | $this->error = 'msg_invalid_request'; |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | $oMessageObject->setError(-1); |
| 578 | 578 | $oMessageObject->setMessage($this->error); |
| 579 | 579 | $oMessageObject->dispMessage(); |
| 580 | - if($this->httpStatusCode) |
|
| 580 | + if ($this->httpStatusCode) |
|
| 581 | 581 | { |
| 582 | 582 | $oMessageObject->setHttpStatusCode($this->httpStatusCode); |
| 583 | 583 | } |
@@ -586,12 +586,12 @@ discard block |
||
| 586 | 586 | |
| 587 | 587 | $forward = NULL; |
| 588 | 588 | // 1. Look for the module with action name |
| 589 | - if(preg_match('/^([a-z]+)([A-Z])([a-z0-9\_]+)(.*)$/', $this->act, $matches)) |
|
| 589 | + if (preg_match('/^([a-z]+)([A-Z])([a-z0-9\_]+)(.*)$/', $this->act, $matches)) |
|
| 590 | 590 | { |
| 591 | - $module = strtolower($matches[2] . $matches[3]); |
|
| 591 | + $module = strtolower($matches[2].$matches[3]); |
|
| 592 | 592 | $xml_info = $oModuleModel->getModuleActionXml($module); |
| 593 | 593 | |
| 594 | - if($xml_info->action->{$this->act} && ((stripos($this->act, 'admin') !== FALSE) || $xml_info->action->{$this->act}->standalone != 'false')) |
|
| 594 | + if ($xml_info->action->{$this->act} && ((stripos($this->act, 'admin') !== FALSE) || $xml_info->action->{$this->act}->standalone != 'false')) |
|
| 595 | 595 | { |
| 596 | 596 | $forward = new stdClass(); |
| 597 | 597 | $forward->module = $module; |
@@ -611,12 +611,12 @@ discard block |
||
| 611 | 611 | } |
| 612 | 612 | } |
| 613 | 613 | |
| 614 | - if(!$forward) |
|
| 614 | + if (!$forward) |
|
| 615 | 615 | { |
| 616 | 616 | $forward = $oModuleModel->getActionForward($this->act); |
| 617 | 617 | } |
| 618 | 618 | |
| 619 | - if($forward->module && $forward->type && $forward->act && $forward->act == $this->act) |
|
| 619 | + if ($forward->module && $forward->type && $forward->act && $forward->act == $this->act) |
|
| 620 | 620 | { |
| 621 | 621 | $kind = stripos($forward->act, 'admin') !== FALSE ? 'admin' : ''; |
| 622 | 622 | $type = $forward->type; |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | |
| 629 | 629 | // check CSRF for non-GET actions |
| 630 | 630 | $use_check_csrf = isset($xml_info->action->{$this->act}) && $xml_info->action->{$this->act}->check_csrf !== 'false'; |
| 631 | - if($use_check_csrf && $_SERVER['REQUEST_METHOD'] !== 'GET' && Context::isInstalled() && !checkCSRF()) |
|
| 631 | + if ($use_check_csrf && $_SERVER['REQUEST_METHOD'] !== 'GET' && Context::isInstalled() && !checkCSRF()) |
|
| 632 | 632 | { |
| 633 | 633 | $this->error = 'msg_invalid_request'; |
| 634 | 634 | $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); |
@@ -640,11 +640,11 @@ discard block |
||
| 640 | 640 | |
| 641 | 641 | // SECISSUE also check foward act method |
| 642 | 642 | // check REQUEST_METHOD in controller |
| 643 | - if($type == 'controller') |
|
| 643 | + if ($type == 'controller') |
|
| 644 | 644 | { |
| 645 | 645 | $allowedMethod = $xml_info->action->{$forward->act}->method; |
| 646 | 646 | |
| 647 | - if(!$allowedMethod) |
|
| 647 | + if (!$allowedMethod) |
|
| 648 | 648 | { |
| 649 | 649 | $allowedMethodList[0] = 'POST'; |
| 650 | 650 | } |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | $allowedMethodList = explode('|', strtoupper($allowedMethod)); |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | - if(!in_array(strtoupper($_SERVER['REQUEST_METHOD']), $allowedMethodList)) |
|
| 656 | + if (!in_array(strtoupper($_SERVER['REQUEST_METHOD']), $allowedMethodList)) |
|
| 657 | 657 | { |
| 658 | 658 | $this->error = "msg_invalid_request"; |
| 659 | 659 | $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); |
@@ -664,13 +664,13 @@ discard block |
||
| 664 | 664 | } |
| 665 | 665 | } |
| 666 | 666 | |
| 667 | - if($type == "view" && Mobile::isFromMobilePhone()) |
|
| 667 | + if ($type == "view" && Mobile::isFromMobilePhone()) |
|
| 668 | 668 | { |
| 669 | 669 | $orig_type = "view"; |
| 670 | 670 | $type = "mobile"; |
| 671 | 671 | // create a module instance |
| 672 | 672 | $oModule = $this->getModuleInstance($forward->module, $type, $kind); |
| 673 | - if(!is_object($oModule) || !method_exists($oModule, $this->act)) |
|
| 673 | + if (!is_object($oModule) || !method_exists($oModule, $this->act)) |
|
| 674 | 674 | { |
| 675 | 675 | $type = $orig_type; |
| 676 | 676 | Mobile::setMobile(FALSE); |
@@ -682,25 +682,25 @@ discard block |
||
| 682 | 682 | $oModule = $this->getModuleInstance($forward->module, $type, $kind); |
| 683 | 683 | } |
| 684 | 684 | |
| 685 | - if(!is_object($oModule)) |
|
| 685 | + if (!is_object($oModule)) |
|
| 686 | 686 | { |
| 687 | 687 | $this->_setInputErrorToContext(); |
| 688 | 688 | $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); |
| 689 | 689 | $oMessageObject->setError(-1); |
| 690 | 690 | $oMessageObject->setMessage('msg_module_is_not_exists'); |
| 691 | 691 | $oMessageObject->dispMessage(); |
| 692 | - if($this->httpStatusCode) |
|
| 692 | + if ($this->httpStatusCode) |
|
| 693 | 693 | { |
| 694 | 694 | $oMessageObject->setHttpStatusCode($this->httpStatusCode); |
| 695 | 695 | } |
| 696 | 696 | return $oMessageObject; |
| 697 | 697 | } |
| 698 | 698 | |
| 699 | - if($this->module == "admin" && $type == "view") |
|
| 699 | + if ($this->module == "admin" && $type == "view") |
|
| 700 | 700 | { |
| 701 | - if($logged_info->is_admin == 'Y') |
|
| 701 | + if ($logged_info->is_admin == 'Y') |
|
| 702 | 702 | { |
| 703 | - if($this->act != 'dispLayoutAdminLayoutModify') |
|
| 703 | + if ($this->act != 'dispLayoutAdminLayoutModify') |
|
| 704 | 704 | { |
| 705 | 705 | $oAdminView = getAdminView('admin'); |
| 706 | 706 | $oAdminView->makeGnbUrl($forward->module); |
@@ -720,10 +720,10 @@ discard block |
||
| 720 | 720 | return $oMessageObject; |
| 721 | 721 | } |
| 722 | 722 | } |
| 723 | - if($kind == 'admin') |
|
| 723 | + if ($kind == 'admin') |
|
| 724 | 724 | { |
| 725 | 725 | $grant = $oModuleModel->getGrant($this->module_info, $logged_info); |
| 726 | - if(!$grant->manager) |
|
| 726 | + if (!$grant->manager) |
|
| 727 | 727 | { |
| 728 | 728 | $this->_setInputErrorToContext(); |
| 729 | 729 | $this->error = 'msg_is_not_manager'; |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | } |
| 736 | 736 | else |
| 737 | 737 | { |
| 738 | - if(!$grant->is_admin && $this->module != $this->orig_module->module && $xml_info->permission->{$this->act} != 'manager') |
|
| 738 | + if (!$grant->is_admin && $this->module != $this->orig_module->module && $xml_info->permission->{$this->act} != 'manager') |
|
| 739 | 739 | { |
| 740 | 740 | $this->_setInputErrorToContext(); |
| 741 | 741 | $this->error = 'msg_is_not_administrator'; |
@@ -748,7 +748,7 @@ discard block |
||
| 748 | 748 | } |
| 749 | 749 | } |
| 750 | 750 | } |
| 751 | - else if($xml_info->default_index_act && method_exists($oModule, $xml_info->default_index_act)) |
|
| 751 | + else if ($xml_info->default_index_act && method_exists($oModule, $xml_info->default_index_act)) |
|
| 752 | 752 | { |
| 753 | 753 | $this->act = $xml_info->default_index_act; |
| 754 | 754 | } |
@@ -762,16 +762,16 @@ discard block |
||
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | // ruleset check... |
| 765 | - if(!empty($ruleset)) |
|
| 765 | + if (!empty($ruleset)) |
|
| 766 | 766 | { |
| 767 | 767 | $rulesetModule = $forward->module ? $forward->module : $this->module; |
| 768 | 768 | $rulesetFile = $oModuleModel->getValidatorFilePath($rulesetModule, $ruleset, $this->mid); |
| 769 | - if(!empty($rulesetFile)) |
|
| 769 | + if (!empty($rulesetFile)) |
|
| 770 | 770 | { |
| 771 | - if($_SESSION['XE_VALIDATOR_ERROR_LANG']) |
|
| 771 | + if ($_SESSION['XE_VALIDATOR_ERROR_LANG']) |
|
| 772 | 772 | { |
| 773 | 773 | $errorLang = $_SESSION['XE_VALIDATOR_ERROR_LANG']; |
| 774 | - foreach($errorLang as $key => $val) |
|
| 774 | + foreach ($errorLang as $key => $val) |
|
| 775 | 775 | { |
| 776 | 776 | Context::setLang($key, $val); |
| 777 | 777 | } |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | |
| 781 | 781 | $Validator = new Validator($rulesetFile); |
| 782 | 782 | $result = $Validator->validate(); |
| 783 | - if(!$result) |
|
| 783 | + if (!$result) |
|
| 784 | 784 | { |
| 785 | 785 | $lastError = $Validator->getLastError(); |
| 786 | 786 | $returnUrl = Context::get('error_return_url'); |
@@ -812,26 +812,26 @@ discard block |
||
| 812 | 812 | 'dispLayoutPreviewWithModule' => 1 |
| 813 | 813 | ); |
| 814 | 814 | $db_use_mobile = Mobile::isMobileEnabled(); |
| 815 | - if($type == "view" && $this->module_info->use_mobile == "Y" && Mobile::isMobileCheckByAgent() && !isset($skipAct[Context::get('act')]) && $db_use_mobile === true) |
|
| 815 | + if ($type == "view" && $this->module_info->use_mobile == "Y" && Mobile::isMobileCheckByAgent() && !isset($skipAct[Context::get('act')]) && $db_use_mobile === true) |
|
| 816 | 816 | { |
| 817 | 817 | global $lang; |
| 818 | 818 | $header = '<style>div.xe_mobile{opacity:0.7;margin:1em 0;padding:.5em;background:#333;border:1px solid #666;border-left:0;border-right:0}p.xe_mobile{text-align:center;margin:1em 0}a.xe_mobile{color:#ff0;font-weight:bold;font-size:24px}@media only screen and (min-width:500px){a.xe_mobile{font-size:15px}}</style>'; |
| 819 | - $footer = '<div class="xe_mobile"><p class="xe_mobile"><a class="xe_mobile" href="' . getUrl('m', '1') . '">' . $lang->msg_pc_to_mobile . '</a></p></div>'; |
|
| 819 | + $footer = '<div class="xe_mobile"><p class="xe_mobile"><a class="xe_mobile" href="'.getUrl('m', '1').'">'.$lang->msg_pc_to_mobile.'</a></p></div>'; |
|
| 820 | 820 | Context::addHtmlHeader($header); |
| 821 | 821 | Context::addHtmlFooter($footer); |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | - if($type == "view" && $kind != 'admin') |
|
| 824 | + if ($type == "view" && $kind != 'admin') |
|
| 825 | 825 | { |
| 826 | 826 | $module_config = $oModuleModel->getModuleConfig('module'); |
| 827 | - if($module_config->htmlFooter) |
|
| 827 | + if ($module_config->htmlFooter) |
|
| 828 | 828 | { |
| 829 | 829 | Context::addHtmlFooter($module_config->htmlFooter); |
| 830 | 830 | } |
| 831 | - if($module_config->siteTitle) |
|
| 831 | + if ($module_config->siteTitle) |
|
| 832 | 832 | { |
| 833 | 833 | $siteTitle = Context::getBrowserTitle(); |
| 834 | - if(!$siteTitle) |
|
| 834 | + if (!$siteTitle) |
|
| 835 | 835 | { |
| 836 | 836 | Context::setBrowserTitle($module_config->siteTitle); |
| 837 | 837 | } |
@@ -844,18 +844,18 @@ discard block |
||
| 844 | 844 | $procResult = $oModule->proc(); |
| 845 | 845 | |
| 846 | 846 | $methodList = array('XMLRPC' => 1, 'JSON' => 1, 'JS_CALLBACK' => 1); |
| 847 | - if(!$oModule->stop_proc && !isset($methodList[Context::getRequestMethod()])) |
|
| 847 | + if (!$oModule->stop_proc && !isset($methodList[Context::getRequestMethod()])) |
|
| 848 | 848 | { |
| 849 | 849 | $error = $oModule->getError(); |
| 850 | 850 | $message = $oModule->getMessage(); |
| 851 | 851 | $messageType = $oModule->getMessageType(); |
| 852 | 852 | $redirectUrl = $oModule->getRedirectUrl(); |
| 853 | - if($messageType == 'error') debugPrint($message, 'ERROR'); |
|
| 853 | + if ($messageType == 'error') debugPrint($message, 'ERROR'); |
|
| 854 | 854 | |
| 855 | - if(!$procResult) |
|
| 855 | + if (!$procResult) |
|
| 856 | 856 | { |
| 857 | 857 | $this->error = $message; |
| 858 | - if(!$redirectUrl && Context::get('error_return_url')) |
|
| 858 | + if (!$redirectUrl && Context::get('error_return_url')) |
|
| 859 | 859 | { |
| 860 | 860 | $redirectUrl = Context::get('error_return_url'); |
| 861 | 861 | } |
@@ -868,13 +868,13 @@ discard block |
||
| 868 | 868 | |
| 869 | 869 | $_SESSION['XE_VALIDATOR_ERROR'] = $error; |
| 870 | 870 | $_SESSION['XE_VALIDATOR_ID'] = Context::get('xe_validator_id'); |
| 871 | - if($message != 'success') |
|
| 871 | + if ($message != 'success') |
|
| 872 | 872 | { |
| 873 | 873 | $_SESSION['XE_VALIDATOR_MESSAGE'] = $message; |
| 874 | 874 | } |
| 875 | 875 | $_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = $messageType; |
| 876 | 876 | |
| 877 | - if(Context::get('xeVirtualRequestMethod') != 'xml') |
|
| 877 | + if (Context::get('xeVirtualRequestMethod') != 'xml') |
|
| 878 | 878 | { |
| 879 | 879 | $_SESSION['XE_VALIDATOR_RETURN_URL'] = $redirectUrl; |
| 880 | 880 | } |
@@ -890,27 +890,27 @@ discard block |
||
| 890 | 890 | * */ |
| 891 | 891 | function _setInputErrorToContext() |
| 892 | 892 | { |
| 893 | - if($_SESSION['XE_VALIDATOR_ERROR'] && !Context::get('XE_VALIDATOR_ERROR')) |
|
| 893 | + if ($_SESSION['XE_VALIDATOR_ERROR'] && !Context::get('XE_VALIDATOR_ERROR')) |
|
| 894 | 894 | { |
| 895 | 895 | Context::set('XE_VALIDATOR_ERROR', $_SESSION['XE_VALIDATOR_ERROR']); |
| 896 | 896 | } |
| 897 | - if($_SESSION['XE_VALIDATOR_MESSAGE'] && !Context::get('XE_VALIDATOR_MESSAGE')) |
|
| 897 | + if ($_SESSION['XE_VALIDATOR_MESSAGE'] && !Context::get('XE_VALIDATOR_MESSAGE')) |
|
| 898 | 898 | { |
| 899 | 899 | Context::set('XE_VALIDATOR_MESSAGE', $_SESSION['XE_VALIDATOR_MESSAGE']); |
| 900 | 900 | } |
| 901 | - if($_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] && !Context::get('XE_VALIDATOR_MESSAGE_TYPE')) |
|
| 901 | + if ($_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] && !Context::get('XE_VALIDATOR_MESSAGE_TYPE')) |
|
| 902 | 902 | { |
| 903 | 903 | Context::set('XE_VALIDATOR_MESSAGE_TYPE', $_SESSION['XE_VALIDATOR_MESSAGE_TYPE']); |
| 904 | 904 | } |
| 905 | - if($_SESSION['XE_VALIDATOR_RETURN_URL'] && !Context::get('XE_VALIDATOR_RETURN_URL')) |
|
| 905 | + if ($_SESSION['XE_VALIDATOR_RETURN_URL'] && !Context::get('XE_VALIDATOR_RETURN_URL')) |
|
| 906 | 906 | { |
| 907 | 907 | Context::set('XE_VALIDATOR_RETURN_URL', $_SESSION['XE_VALIDATOR_RETURN_URL']); |
| 908 | 908 | } |
| 909 | - if($_SESSION['XE_VALIDATOR_ID'] && !Context::get('XE_VALIDATOR_ID')) |
|
| 909 | + if ($_SESSION['XE_VALIDATOR_ID'] && !Context::get('XE_VALIDATOR_ID')) |
|
| 910 | 910 | { |
| 911 | 911 | Context::set('XE_VALIDATOR_ID', $_SESSION['XE_VALIDATOR_ID']); |
| 912 | 912 | } |
| 913 | - if(count($_SESSION['INPUT_ERROR'])) |
|
| 913 | + if (count($_SESSION['INPUT_ERROR'])) |
|
| 914 | 914 | { |
| 915 | 915 | Context::set('INPUT_ERROR', $_SESSION['INPUT_ERROR']); |
| 916 | 916 | } |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | { |
| 941 | 941 | $requestVars = Context::getRequestVars(); |
| 942 | 942 | unset($requestVars->act, $requestVars->mid, $requestVars->vid, $requestVars->success_return_url, $requestVars->error_return_url); |
| 943 | - foreach($requestVars AS $key => $value) |
|
| 943 | + foreach ($requestVars AS $key => $value) |
|
| 944 | 944 | { |
| 945 | 945 | $_SESSION['INPUT_ERROR'][$key] = $value; |
| 946 | 946 | } |
@@ -954,41 +954,41 @@ discard block |
||
| 954 | 954 | function displayContent($oModule = NULL) |
| 955 | 955 | { |
| 956 | 956 | // If the module is not set or not an object, set error |
| 957 | - if(!$oModule || !is_object($oModule)) |
|
| 957 | + if (!$oModule || !is_object($oModule)) |
|
| 958 | 958 | { |
| 959 | 959 | $this->error = 'msg_module_is_not_exists'; |
| 960 | 960 | $this->httpStatusCode = '404'; |
| 961 | 961 | } |
| 962 | 962 | |
| 963 | 963 | // If connection to DB has a problem even though it's not install module, set error |
| 964 | - if($this->module != 'install' && isset($GLOBALS['__DB__']) && $GLOBALS['__DB__'][Context::getDBType()]->isConnected() == FALSE) |
|
| 964 | + if ($this->module != 'install' && isset($GLOBALS['__DB__']) && $GLOBALS['__DB__'][Context::getDBType()]->isConnected() == FALSE) |
|
| 965 | 965 | { |
| 966 | 966 | $this->error = 'msg_dbconnect_failed'; |
| 967 | 967 | } |
| 968 | 968 | |
| 969 | 969 | // Call trigger after moduleHandler proc |
| 970 | 970 | $output = ModuleHandler::triggerCall('moduleHandler.proc', 'after', $oModule); |
| 971 | - if(!$output->toBool()) |
|
| 971 | + if (!$output->toBool()) |
|
| 972 | 972 | { |
| 973 | 973 | $this->error = $output->getMessage(); |
| 974 | 974 | } |
| 975 | 975 | |
| 976 | 976 | // Use message view object, if HTML call |
| 977 | 977 | $methodList = array('XMLRPC' => 1, 'JSON' => 1, 'JS_CALLBACK' => 1); |
| 978 | - if(!isset($methodList[Context::getRequestMethod()])) |
|
| 978 | + if (!isset($methodList[Context::getRequestMethod()])) |
|
| 979 | 979 | { |
| 980 | 980 | |
| 981 | - if($_SESSION['XE_VALIDATOR_RETURN_URL']) |
|
| 981 | + if ($_SESSION['XE_VALIDATOR_RETURN_URL']) |
|
| 982 | 982 | { |
| 983 | 983 | $display_handler = new DisplayHandler(); |
| 984 | 984 | $display_handler->_debugOutput(); |
| 985 | 985 | |
| 986 | - header('location:' . $_SESSION['XE_VALIDATOR_RETURN_URL']); |
|
| 986 | + header('location:'.$_SESSION['XE_VALIDATOR_RETURN_URL']); |
|
| 987 | 987 | return; |
| 988 | 988 | } |
| 989 | 989 | |
| 990 | 990 | // If error occurred, handle it |
| 991 | - if($this->error) |
|
| 991 | + if ($this->error) |
|
| 992 | 992 | { |
| 993 | 993 | // display content with message module instance |
| 994 | 994 | $type = Mobile::isFromMobilePhone() ? 'mobile' : 'view'; |
@@ -997,14 +997,14 @@ discard block |
||
| 997 | 997 | $oMessageObject->setMessage($this->error); |
| 998 | 998 | $oMessageObject->dispMessage(); |
| 999 | 999 | |
| 1000 | - if($oMessageObject->getHttpStatusCode() && $oMessageObject->getHttpStatusCode() != '200') |
|
| 1000 | + if ($oMessageObject->getHttpStatusCode() && $oMessageObject->getHttpStatusCode() != '200') |
|
| 1001 | 1001 | { |
| 1002 | 1002 | $this->_setHttpStatusMessage($oMessageObject->getHttpStatusCode()); |
| 1003 | 1003 | $oMessageObject->setTemplateFile('http_status_code'); |
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | 1006 | // If module was called normally, change the templates of the module into ones of the message view module |
| 1007 | - if($oModule) |
|
| 1007 | + if ($oModule) |
|
| 1008 | 1008 | { |
| 1009 | 1009 | $oModule->setTemplatePath($oMessageObject->getTemplatePath()); |
| 1010 | 1010 | $oModule->setTemplateFile($oMessageObject->getTemplateFile()); |
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | 1021 | // Check if layout_srl exists for the module |
| 1022 | - if(Mobile::isFromMobilePhone()) |
|
| 1022 | + if (Mobile::isFromMobilePhone()) |
|
| 1023 | 1023 | { |
| 1024 | 1024 | $layout_srl = $oModule->module_info->mlayout_srl; |
| 1025 | 1025 | } |
@@ -1029,58 +1029,58 @@ discard block |
||
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | // if layout_srl is rollback by module, set default layout |
| 1032 | - if($layout_srl == -1) |
|
| 1032 | + if ($layout_srl == -1) |
|
| 1033 | 1033 | { |
| 1034 | 1034 | $viewType = (Mobile::isFromMobilePhone()) ? 'M' : 'P'; |
| 1035 | 1035 | $oLayoutAdminModel = getAdminModel('layout'); |
| 1036 | 1036 | $layout_srl = $oLayoutAdminModel->getSiteDefaultLayout($viewType, $oModule->module_info->site_srl); |
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | - if($layout_srl && !$oModule->getLayoutFile()) |
|
| 1039 | + if ($layout_srl && !$oModule->getLayoutFile()) |
|
| 1040 | 1040 | { |
| 1041 | 1041 | |
| 1042 | 1042 | // If layout_srl exists, get information of the layout, and set the location of layout_path/ layout_file |
| 1043 | 1043 | $oLayoutModel = getModel('layout'); |
| 1044 | 1044 | $layout_info = $oLayoutModel->getLayout($layout_srl); |
| 1045 | - if($layout_info) |
|
| 1045 | + if ($layout_info) |
|
| 1046 | 1046 | { |
| 1047 | 1047 | |
| 1048 | 1048 | // Input extra_vars into $layout_info |
| 1049 | - if($layout_info->extra_var_count) |
|
| 1049 | + if ($layout_info->extra_var_count) |
|
| 1050 | 1050 | { |
| 1051 | 1051 | |
| 1052 | - foreach($layout_info->extra_var as $var_id => $val) |
|
| 1052 | + foreach ($layout_info->extra_var as $var_id => $val) |
|
| 1053 | 1053 | { |
| 1054 | - if($val->type == 'image') |
|
| 1054 | + if ($val->type == 'image') |
|
| 1055 | 1055 | { |
| 1056 | - if(strncmp('./files/attach/images/', $val->value, 22) === 0) |
|
| 1056 | + if (strncmp('./files/attach/images/', $val->value, 22) === 0) |
|
| 1057 | 1057 | { |
| 1058 | - $val->value = Context::getRequestUri() . substr($val->value, 2); |
|
| 1058 | + $val->value = Context::getRequestUri().substr($val->value, 2); |
|
| 1059 | 1059 | } |
| 1060 | 1060 | } |
| 1061 | 1061 | $layout_info->{$var_id} = $val->value; |
| 1062 | 1062 | } |
| 1063 | 1063 | } |
| 1064 | 1064 | // Set menus into context |
| 1065 | - if($layout_info->menu_count) |
|
| 1065 | + if ($layout_info->menu_count) |
|
| 1066 | 1066 | { |
| 1067 | - foreach($layout_info->menu as $menu_id => $menu) |
|
| 1067 | + foreach ($layout_info->menu as $menu_id => $menu) |
|
| 1068 | 1068 | { |
| 1069 | 1069 | // set default menu set(included home menu) |
| 1070 | - if(!$menu->menu_srl || $menu->menu_srl == -1) |
|
| 1070 | + if (!$menu->menu_srl || $menu->menu_srl == -1) |
|
| 1071 | 1071 | { |
| 1072 | 1072 | $oMenuAdminController = getAdminController('menu'); |
| 1073 | 1073 | $homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile(); |
| 1074 | 1074 | |
| 1075 | - if(FileHandler::exists($homeMenuCacheFile)) |
|
| 1075 | + if (FileHandler::exists($homeMenuCacheFile)) |
|
| 1076 | 1076 | { |
| 1077 | 1077 | include($homeMenuCacheFile); |
| 1078 | 1078 | } |
| 1079 | 1079 | |
| 1080 | - if(!$menu->menu_srl) |
|
| 1080 | + if (!$menu->menu_srl) |
|
| 1081 | 1081 | { |
| 1082 | - $menu->xml_file = str_replace('.xml.php', $homeMenuSrl . '.xml.php', $menu->xml_file); |
|
| 1083 | - $menu->php_file = str_replace('.php', $homeMenuSrl . '.php', $menu->php_file); |
|
| 1082 | + $menu->xml_file = str_replace('.xml.php', $homeMenuSrl.'.xml.php', $menu->xml_file); |
|
| 1083 | + $menu->php_file = str_replace('.php', $homeMenuSrl.'.php', $menu->php_file); |
|
| 1084 | 1084 | $layout_info->menu->{$menu_id}->menu_srl = $homeMenuSrl; |
| 1085 | 1085 | } |
| 1086 | 1086 | else |
@@ -1091,7 +1091,7 @@ discard block |
||
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | 1093 | $php_file = FileHandler::exists($menu->php_file); |
| 1094 | - if($php_file) |
|
| 1094 | + if ($php_file) |
|
| 1095 | 1095 | { |
| 1096 | 1096 | include($php_file); |
| 1097 | 1097 | } |
@@ -1107,17 +1107,17 @@ discard block |
||
| 1107 | 1107 | |
| 1108 | 1108 | // If layout was modified, use the modified version |
| 1109 | 1109 | $edited_layout = $oLayoutModel->getUserLayoutHtml($layout_info->layout_srl); |
| 1110 | - if(file_exists($edited_layout)) |
|
| 1110 | + if (file_exists($edited_layout)) |
|
| 1111 | 1111 | { |
| 1112 | 1112 | $oModule->setEditedLayoutFile($edited_layout); |
| 1113 | 1113 | } |
| 1114 | 1114 | } |
| 1115 | 1115 | } |
| 1116 | 1116 | $isLayoutDrop = Context::get('isLayoutDrop'); |
| 1117 | - if($isLayoutDrop) |
|
| 1117 | + if ($isLayoutDrop) |
|
| 1118 | 1118 | { |
| 1119 | 1119 | $kind = stripos($this->act, 'admin') !== FALSE ? 'admin' : ''; |
| 1120 | - if($kind == 'admin') |
|
| 1120 | + if ($kind == 'admin') |
|
| 1121 | 1121 | { |
| 1122 | 1122 | $oModule->setLayoutFile('popup_layout'); |
| 1123 | 1123 | } |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | function &getModuleInstance($module, $type = 'view', $kind = '') |
| 1156 | 1156 | { |
| 1157 | 1157 | |
| 1158 | - if(__DEBUG__ == 3) |
|
| 1158 | + if (__DEBUG__ == 3) |
|
| 1159 | 1159 | { |
| 1160 | 1160 | $start_time = getMicroTime(); |
| 1161 | 1161 | } |
@@ -1165,51 +1165,51 @@ discard block |
||
| 1165 | 1165 | $type = strtolower($type); |
| 1166 | 1166 | |
| 1167 | 1167 | $kinds = array('svc' => 1, 'admin' => 1); |
| 1168 | - if(!isset($kinds[$kind])) |
|
| 1168 | + if (!isset($kinds[$kind])) |
|
| 1169 | 1169 | { |
| 1170 | 1170 | $kind = 'svc'; |
| 1171 | 1171 | } |
| 1172 | 1172 | |
| 1173 | - $key = $module . '.' . ($kind != 'admin' ? '' : 'admin') . '.' . $type; |
|
| 1173 | + $key = $module.'.'.($kind != 'admin' ? '' : 'admin').'.'.$type; |
|
| 1174 | 1174 | |
| 1175 | - if(is_array($GLOBALS['__MODULE_EXTEND__']) && array_key_exists($key, $GLOBALS['__MODULE_EXTEND__'])) |
|
| 1175 | + if (is_array($GLOBALS['__MODULE_EXTEND__']) && array_key_exists($key, $GLOBALS['__MODULE_EXTEND__'])) |
|
| 1176 | 1176 | { |
| 1177 | 1177 | $module = $extend_module = $GLOBALS['__MODULE_EXTEND__'][$key]; |
| 1178 | 1178 | } |
| 1179 | 1179 | |
| 1180 | 1180 | // if there is no instance of the module in global variable, create a new one |
| 1181 | - if(!isset($GLOBALS['_loaded_module'][$module][$type][$kind])) |
|
| 1181 | + if (!isset($GLOBALS['_loaded_module'][$module][$type][$kind])) |
|
| 1182 | 1182 | { |
| 1183 | 1183 | ModuleHandler::_getModuleFilePath($module, $type, $kind, $class_path, $high_class_file, $class_file, $instance_name); |
| 1184 | 1184 | |
| 1185 | - if($extend_module && (!is_readable($high_class_file) || !is_readable($class_file))) |
|
| 1185 | + if ($extend_module && (!is_readable($high_class_file) || !is_readable($class_file))) |
|
| 1186 | 1186 | { |
| 1187 | 1187 | $module = $parent_module; |
| 1188 | 1188 | ModuleHandler::_getModuleFilePath($module, $type, $kind, $class_path, $high_class_file, $class_file, $instance_name); |
| 1189 | 1189 | } |
| 1190 | 1190 | |
| 1191 | 1191 | // Check if the base class and instance class exist |
| 1192 | - if(!class_exists($module, true)) |
|
| 1192 | + if (!class_exists($module, true)) |
|
| 1193 | 1193 | { |
| 1194 | 1194 | return NULL; |
| 1195 | 1195 | } |
| 1196 | - if(!class_exists($instance_name, true)) |
|
| 1196 | + if (!class_exists($instance_name, true)) |
|
| 1197 | 1197 | { |
| 1198 | 1198 | return NULL; |
| 1199 | 1199 | } |
| 1200 | 1200 | |
| 1201 | 1201 | // Create an instance |
| 1202 | 1202 | $oModule = new $instance_name(); |
| 1203 | - if(!is_object($oModule)) |
|
| 1203 | + if (!is_object($oModule)) |
|
| 1204 | 1204 | { |
| 1205 | 1205 | return NULL; |
| 1206 | 1206 | } |
| 1207 | 1207 | |
| 1208 | 1208 | // Load language files for the class |
| 1209 | - Context::loadLang($class_path . 'lang'); |
|
| 1210 | - if($extend_module) |
|
| 1209 | + Context::loadLang($class_path.'lang'); |
|
| 1210 | + if ($extend_module) |
|
| 1211 | 1211 | { |
| 1212 | - Context::loadLang(ModuleHandler::getModulePath($parent_module) . 'lang'); |
|
| 1212 | + Context::loadLang(ModuleHandler::getModulePath($parent_module).'lang'); |
|
| 1213 | 1213 | } |
| 1214 | 1214 | |
| 1215 | 1215 | // Set variables to the instance |
@@ -1217,10 +1217,10 @@ discard block |
||
| 1217 | 1217 | $oModule->setModulePath($class_path); |
| 1218 | 1218 | |
| 1219 | 1219 | // If the module has a constructor, run it. |
| 1220 | - if(!isset($GLOBALS['_called_constructor'][$instance_name])) |
|
| 1220 | + if (!isset($GLOBALS['_called_constructor'][$instance_name])) |
|
| 1221 | 1221 | { |
| 1222 | 1222 | $GLOBALS['_called_constructor'][$instance_name] = TRUE; |
| 1223 | - if(@method_exists($oModule, $instance_name)) |
|
| 1223 | + if (@method_exists($oModule, $instance_name)) |
|
| 1224 | 1224 | { |
| 1225 | 1225 | $oModule->{$instance_name}(); |
| 1226 | 1226 | } |
@@ -1230,7 +1230,7 @@ discard block |
||
| 1230 | 1230 | $GLOBALS['_loaded_module'][$module][$type][$kind] = $oModule; |
| 1231 | 1231 | } |
| 1232 | 1232 | |
| 1233 | - if(__DEBUG__ == 3) |
|
| 1233 | + if (__DEBUG__ == 3) |
|
| 1234 | 1234 | { |
| 1235 | 1235 | $GLOBALS['__elapsed_class_load__'] += getMicroTime() - $start_time; |
| 1236 | 1236 | } |
@@ -1246,17 +1246,17 @@ discard block |
||
| 1246 | 1246 | $highClassFile = sprintf('%s%s%s.class.php', _XE_PATH_, $classPath, $module); |
| 1247 | 1247 | $highClassFile = FileHandler::getRealPath($highClassFile); |
| 1248 | 1248 | |
| 1249 | - $types = array('view','controller','model','api','wap','mobile','class'); |
|
| 1250 | - if(!in_array($type, $types)) |
|
| 1249 | + $types = array('view', 'controller', 'model', 'api', 'wap', 'mobile', 'class'); |
|
| 1250 | + if (!in_array($type, $types)) |
|
| 1251 | 1251 | { |
| 1252 | 1252 | $type = $types[0]; |
| 1253 | 1253 | } |
| 1254 | - if($type == 'class') |
|
| 1254 | + if ($type == 'class') |
|
| 1255 | 1255 | { |
| 1256 | 1256 | $instanceName = '%s'; |
| 1257 | 1257 | $classFile = '%s%s.%s.php'; |
| 1258 | 1258 | } |
| 1259 | - elseif($kind == 'admin' && array_search($type, $types) < 3) |
|
| 1259 | + elseif ($kind == 'admin' && array_search($type, $types) < 3) |
|
| 1260 | 1260 | { |
| 1261 | 1261 | $instanceName = '%sAdmin%s'; |
| 1262 | 1262 | $classFile = '%s%s.admin.%s.php'; |
@@ -1281,26 +1281,26 @@ discard block |
||
| 1281 | 1281 | function triggerCall($trigger_name, $called_position, &$obj) |
| 1282 | 1282 | { |
| 1283 | 1283 | // skip if not installed |
| 1284 | - if(!Context::isInstalled()) |
|
| 1284 | + if (!Context::isInstalled()) |
|
| 1285 | 1285 | { |
| 1286 | 1286 | return new Object(); |
| 1287 | 1287 | } |
| 1288 | 1288 | |
| 1289 | 1289 | $oModuleModel = getModel('module'); |
| 1290 | 1290 | $triggers = $oModuleModel->getTriggers($trigger_name, $called_position); |
| 1291 | - if(!$triggers || count($triggers) < 1) |
|
| 1291 | + if (!$triggers || count($triggers) < 1) |
|
| 1292 | 1292 | { |
| 1293 | 1293 | return new Object(); |
| 1294 | 1294 | } |
| 1295 | 1295 | |
| 1296 | 1296 | //store before trigger call time |
| 1297 | 1297 | $before_trigger_time = NULL; |
| 1298 | - if(__LOG_SLOW_TRIGGER__> 0) |
|
| 1298 | + if (__LOG_SLOW_TRIGGER__ > 0) |
|
| 1299 | 1299 | { |
| 1300 | 1300 | $before_trigger_time = microtime(true); |
| 1301 | 1301 | } |
| 1302 | 1302 | |
| 1303 | - foreach($triggers as $item) |
|
| 1303 | + foreach ($triggers as $item) |
|
| 1304 | 1304 | { |
| 1305 | 1305 | $module = $item->module; |
| 1306 | 1306 | $type = $item->type; |
@@ -1308,7 +1308,7 @@ discard block |
||
| 1308 | 1308 | |
| 1309 | 1309 | // todo why don't we call a normal class object ? |
| 1310 | 1310 | $oModule = getModule($module, $type); |
| 1311 | - if(!$oModule || !method_exists($oModule, $called_method)) |
|
| 1311 | + if (!$oModule || !method_exists($oModule, $called_method)) |
|
| 1312 | 1312 | { |
| 1313 | 1313 | continue; |
| 1314 | 1314 | } |
@@ -1321,12 +1321,12 @@ discard block |
||
| 1321 | 1321 | $elapsed_time_trigger = $after_each_trigger_time - $before_each_trigger_time; |
| 1322 | 1322 | |
| 1323 | 1323 | $slowlog = new stdClass; |
| 1324 | - $slowlog->caller = $trigger_name . '.' . $called_position; |
|
| 1325 | - $slowlog->called = $module . '.' . $called_method; |
|
| 1324 | + $slowlog->caller = $trigger_name.'.'.$called_position; |
|
| 1325 | + $slowlog->called = $module.'.'.$called_method; |
|
| 1326 | 1326 | $slowlog->called_extension = $module; |
| 1327 | - if($trigger_name != 'XE.writeSlowlog') writeSlowlog('trigger', $elapsed_time_trigger, $slowlog); |
|
| 1327 | + if ($trigger_name != 'XE.writeSlowlog') writeSlowlog('trigger', $elapsed_time_trigger, $slowlog); |
|
| 1328 | 1328 | |
| 1329 | - if(is_object($output) && method_exists($output, 'toBool') && !$output->toBool()) |
|
| 1329 | + if (is_object($output) && method_exists($output, 'toBool') && !$output->toBool()) |
|
| 1330 | 1330 | { |
| 1331 | 1331 | return $output; |
| 1332 | 1332 | } |
@@ -1411,9 +1411,9 @@ discard block |
||
| 1411 | 1411 | '511' => 'Network Authentication Required', |
| 1412 | 1412 | ); |
| 1413 | 1413 | $statusMessage = $statusMessageList[$code]; |
| 1414 | - if(!$statusMessage) |
|
| 1414 | + if (!$statusMessage) |
|
| 1415 | 1415 | { |
| 1416 | - $statusMessage = 'HTTP ' . $code; |
|
| 1416 | + $statusMessage = 'HTTP '.$code; |
|
| 1417 | 1417 | } |
| 1418 | 1418 | |
| 1419 | 1419 | Context::set('http_status_code', $code); |
@@ -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 Object(-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 Object(-1,'null_user_id'); |
|
| 53 | - if(!$password) return new Object(-1,'null_password'); |
|
| 52 | + if (!$user_id) return new Object(-1, 'null_user_id'); |
|
| 53 | + if (!$password) return new Object(-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 Object(-1, $msg)); |
|
| 71 | + return $this->setRedirectUrl(getNotEncodedUrl('', 'vid', Context::get('vid'), 'mid', Context::get('mid'), 'act', 'dispMemberModifyPassword'), new Object(-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 Object(); |
| 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,25 +127,25 @@ discard block |
||
| 127 | 127 | $oModuleModel = &getModel('module'); |
| 128 | 128 | |
| 129 | 129 | // Check login information |
| 130 | - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); |
|
| 130 | + if (!Context::get('is_logged')) return new Object(-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 Object(-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 Object(-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 Object(-1, 'msg_is_secret'); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | // 모듈 권한 확인 |
| 147 | 147 | $grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')), $logged_info); |
| 148 | - if(!$grant->access) |
|
| 148 | + if (!$grant->access) |
|
| 149 | 149 | { |
| 150 | 150 | return new Object(-1, 'msg_not_permitted'); |
| 151 | 151 | } |
@@ -162,11 +162,11 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | // Check if already scrapped |
| 164 | 164 | $output = executeQuery('member.getScrapDocument', $args); |
| 165 | - if($output->data->count) return new Object(-1, 'msg_alreay_scrapped'); |
|
| 165 | + if ($output->data->count) return new Object(-1, 'msg_alreay_scrapped'); |
|
| 166 | 166 | |
| 167 | 167 | // Insert |
| 168 | 168 | $output = executeQuery('member.addScrapDocument', $args); |
| 169 | - if(!$output->toBool()) return $output; |
|
| 169 | + if (!$output->toBool()) return $output; |
|
| 170 | 170 | |
| 171 | 171 | $this->setError(-1); |
| 172 | 172 | $this->setMessage('success_registed'); |
@@ -180,11 +180,11 @@ discard block |
||
| 180 | 180 | function procMemberDeleteScrap() |
| 181 | 181 | { |
| 182 | 182 | // Check login information |
| 183 | - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); |
|
| 183 | + if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); |
|
| 184 | 184 | $logged_info = Context::get('logged_info'); |
| 185 | 185 | |
| 186 | - $document_srl = (int)Context::get('document_srl'); |
|
| 187 | - if(!$document_srl) return new Object(-1,'msg_invalid_request'); |
|
| 186 | + $document_srl = (int) Context::get('document_srl'); |
|
| 187 | + if (!$document_srl) return new Object(-1, 'msg_invalid_request'); |
|
| 188 | 188 | // Variables |
| 189 | 189 | $args = new stdClass; |
| 190 | 190 | $args->member_srl = $logged_info->member_srl; |
@@ -210,23 +210,23 @@ discard block |
||
| 210 | 210 | function procMemberDeleteSavedDocument() |
| 211 | 211 | { |
| 212 | 212 | // Check login information |
| 213 | - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); |
|
| 213 | + if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); |
|
| 214 | 214 | $logged_info = Context::get('logged_info'); |
| 215 | 215 | |
| 216 | - $document_srl = (int)Context::get('document_srl'); |
|
| 217 | - if(!$document_srl) return new Object(-1,'msg_invalid_request'); |
|
| 216 | + $document_srl = (int) Context::get('document_srl'); |
|
| 217 | + if (!$document_srl) return new Object(-1, 'msg_invalid_request'); |
|
| 218 | 218 | |
| 219 | 219 | $oDocumentModel = getModel('document'); |
| 220 | 220 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 221 | 221 | if ($oDocument->get('member_srl') != $logged_info->member_srl) |
| 222 | 222 | { |
| 223 | - return new Object(-1,'msg_invalid_request'); |
|
| 223 | + return new Object(-1, 'msg_invalid_request'); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | $configStatusList = $oDocumentModel->getStatusList(); |
| 227 | 227 | if ($oDocument->get('status') != $configStatusList['temp']) |
| 228 | 228 | { |
| 229 | - return new Object(-1,'msg_invalid_request'); |
|
| 229 | + return new Object(-1, 'msg_invalid_request'); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | $oDocumentController = getController('document'); |
@@ -242,37 +242,37 @@ discard block |
||
| 242 | 242 | { |
| 243 | 243 | $name = Context::get('name'); |
| 244 | 244 | $value = Context::get('value'); |
| 245 | - if(!$value) return; |
|
| 245 | + if (!$value) return; |
|
| 246 | 246 | |
| 247 | 247 | $oMemberModel = getModel('member'); |
| 248 | 248 | // Check if logged-in |
| 249 | 249 | $logged_info = Context::get('logged_info'); |
| 250 | 250 | |
| 251 | 251 | |
| 252 | - switch($name) |
|
| 252 | + switch ($name) |
|
| 253 | 253 | { |
| 254 | 254 | case 'user_id' : |
| 255 | 255 | // Check denied ID |
| 256 | - if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id'); |
|
| 256 | + if ($oMemberModel->isDeniedID($value)) return new Object(0, 'denied_user_id'); |
|
| 257 | 257 | // Check if duplicated |
| 258 | 258 | $member_srl = $oMemberModel->getMemberSrlByUserID($value); |
| 259 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id'); |
|
| 259 | + if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_user_id'); |
|
| 260 | 260 | break; |
| 261 | 261 | case 'nick_name' : |
| 262 | 262 | // Check denied ID |
| 263 | - if($oMemberModel->isDeniedNickName($value)) |
|
| 263 | + if ($oMemberModel->isDeniedNickName($value)) |
|
| 264 | 264 | { |
| 265 | - return new Object(0,'denied_nick_name'); |
|
| 265 | + return new Object(0, 'denied_nick_name'); |
|
| 266 | 266 | } |
| 267 | 267 | // Check if duplicated |
| 268 | 268 | $member_srl = $oMemberModel->getMemberSrlByNickName($value); |
| 269 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name'); |
|
| 269 | + if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_nick_name'); |
|
| 270 | 270 | |
| 271 | 271 | break; |
| 272 | 272 | case 'email_address' : |
| 273 | 273 | // Check if duplicated |
| 274 | 274 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($value); |
| 275 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address'); |
|
| 275 | + if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_email_address'); |
|
| 276 | 276 | break; |
| 277 | 277 | } |
| 278 | 278 | } |
@@ -284,25 +284,25 @@ discard block |
||
| 284 | 284 | */ |
| 285 | 285 | function procMemberInsert() |
| 286 | 286 | { |
| 287 | - if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request"); |
|
| 288 | - $oMemberModel = &getModel ('member'); |
|
| 287 | + if (Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request"); |
|
| 288 | + $oMemberModel = &getModel('member'); |
|
| 289 | 289 | $config = $oMemberModel->getMemberConfig(); |
| 290 | 290 | |
| 291 | 291 | // call a trigger (before) |
| 292 | - $trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config); |
|
| 293 | - if(!$trigger_output->toBool ()) return $trigger_output; |
|
| 292 | + $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config); |
|
| 293 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 294 | 294 | // Check if an administrator allows a membership |
| 295 | - if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled'); |
|
| 295 | + if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled'); |
|
| 296 | 296 | // Check if the user accept the license terms (only if terms exist) |
| 297 | - if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement'); |
|
| 297 | + if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement'); |
|
| 298 | 298 | |
| 299 | 299 | // Extract the necessary information in advance |
| 300 | 300 | $getVars = array(); |
| 301 | - if($config->signupForm) |
|
| 301 | + if ($config->signupForm) |
|
| 302 | 302 | { |
| 303 | - foreach($config->signupForm as $formInfo) |
|
| 303 | + foreach ($config->signupForm as $formInfo) |
|
| 304 | 304 | { |
| 305 | - if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 305 | + if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 306 | 306 | { |
| 307 | 307 | $getVars[] = $formInfo->name; |
| 308 | 308 | } |
@@ -310,22 +310,22 @@ discard block |
||
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | $args = new stdClass; |
| 313 | - foreach($getVars as $val) |
|
| 313 | + foreach ($getVars as $val) |
|
| 314 | 314 | { |
| 315 | 315 | $args->{$val} = Context::get($val); |
| 316 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 316 | + if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 317 | 317 | } |
| 318 | 318 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
| 319 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 319 | + if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 320 | 320 | |
| 321 | 321 | $args->find_account_answer = Context::get('find_account_answer'); |
| 322 | 322 | $args->allow_mailing = Context::get('allow_mailing'); |
| 323 | 323 | $args->allow_message = Context::get('allow_message'); |
| 324 | 324 | |
| 325 | - if($args->password1) $args->password = $args->password1; |
|
| 325 | + if ($args->password1) $args->password = $args->password1; |
|
| 326 | 326 | |
| 327 | 327 | // check password strength |
| 328 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 328 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 329 | 329 | { |
| 330 | 330 | $message = Context::getLang('about_password_strength'); |
| 331 | 331 | return new Object(-1, $message[$config->password_strength]); |
@@ -351,58 +351,58 @@ discard block |
||
| 351 | 351 | unset($all_args->secret_text); |
| 352 | 352 | |
| 353 | 353 | // Set the user state as "denied" when using mail authentication |
| 354 | - if($config->enable_confirm == 'Y') $args->denied = 'Y'; |
|
| 354 | + if ($config->enable_confirm == 'Y') $args->denied = 'Y'; |
|
| 355 | 355 | // Add extra vars after excluding necessary information from all the requested arguments |
| 356 | 356 | $extra_vars = delObjectVars($all_args, $args); |
| 357 | 357 | $args->extra_vars = serialize($extra_vars); |
| 358 | 358 | |
| 359 | 359 | // remove whitespace |
| 360 | 360 | $checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address'); |
| 361 | - foreach($checkInfos as $val) |
|
| 361 | + foreach ($checkInfos as $val) |
|
| 362 | 362 | { |
| 363 | - if(isset($args->{$val})) |
|
| 363 | + if (isset($args->{$val})) |
|
| 364 | 364 | { |
| 365 | 365 | $args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val}); |
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | $output = $this->insertMember($args); |
| 369 | - if(!$output->toBool()) return $output; |
|
| 369 | + if (!$output->toBool()) return $output; |
|
| 370 | 370 | |
| 371 | 371 | // insert ProfileImage, ImageName, ImageMark |
| 372 | 372 | $profile_image = $_FILES['profile_image']; |
| 373 | - if(is_uploaded_file($profile_image['tmp_name'])) |
|
| 373 | + if (is_uploaded_file($profile_image['tmp_name'])) |
|
| 374 | 374 | { |
| 375 | 375 | $this->insertProfileImage($args->member_srl, $profile_image['tmp_name']); |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | $image_mark = $_FILES['image_mark']; |
| 379 | - if(is_uploaded_file($image_mark['tmp_name'])) |
|
| 379 | + if (is_uploaded_file($image_mark['tmp_name'])) |
|
| 380 | 380 | { |
| 381 | 381 | $this->insertImageMark($args->member_srl, $image_mark['tmp_name']); |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | $image_name = $_FILES['image_name']; |
| 385 | - if(is_uploaded_file($image_name['tmp_name'])) |
|
| 385 | + if (is_uploaded_file($image_name['tmp_name'])) |
|
| 386 | 386 | { |
| 387 | 387 | $this->insertImageName($args->member_srl, $image_name['tmp_name']); |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | // If a virtual site, join the site |
| 391 | 391 | $site_module_info = Context::get('site_module_info'); |
| 392 | - if($site_module_info->site_srl > 0) |
|
| 392 | + if ($site_module_info->site_srl > 0) |
|
| 393 | 393 | { |
| 394 | 394 | $columnList = array('site_srl', 'group_srl'); |
| 395 | 395 | $default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList); |
| 396 | - if($default_group->group_srl) |
|
| 396 | + if ($default_group->group_srl) |
|
| 397 | 397 | { |
| 398 | 398 | $this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl); |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | } |
| 402 | 402 | // Log-in |
| 403 | - if($config->enable_confirm != 'Y') |
|
| 403 | + if ($config->enable_confirm != 'Y') |
|
| 404 | 404 | { |
| 405 | - if($config->identifier == 'email_address') |
|
| 405 | + if ($config->identifier == 'email_address') |
|
| 406 | 406 | { |
| 407 | 407 | $output = $this->doLogin($args->email_address); |
| 408 | 408 | } |
@@ -410,8 +410,8 @@ discard block |
||
| 410 | 410 | { |
| 411 | 411 | $output = $this->doLogin($args->user_id); |
| 412 | 412 | } |
| 413 | - if(!$output->toBool()) { |
|
| 414 | - if($output->error == -9) |
|
| 413 | + if (!$output->toBool()) { |
|
| 414 | + if ($output->error == -9) |
|
| 415 | 415 | $output->error = -11; |
| 416 | 416 | return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output); |
| 417 | 417 | } |
@@ -419,8 +419,8 @@ discard block |
||
| 419 | 419 | |
| 420 | 420 | // Results |
| 421 | 421 | $this->add('member_srl', $args->member_srl); |
| 422 | - if($config->redirect_url) $this->add('redirect_url', $config->redirect_url); |
|
| 423 | - if($config->enable_confirm == 'Y') |
|
| 422 | + if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url); |
|
| 423 | + if ($config->enable_confirm == 'Y') |
|
| 424 | 424 | { |
| 425 | 425 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
| 426 | 426 | $this->setMessage($msg); |
@@ -429,19 +429,19 @@ discard block |
||
| 429 | 429 | else $this->setMessage('success_registed'); |
| 430 | 430 | // Call a trigger (after) |
| 431 | 431 | $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config); |
| 432 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 432 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 433 | 433 | |
| 434 | - if($config->redirect_url) |
|
| 434 | + if ($config->redirect_url) |
|
| 435 | 435 | { |
| 436 | 436 | $returnUrl = $config->redirect_url; |
| 437 | 437 | } |
| 438 | 438 | else |
| 439 | 439 | { |
| 440 | - if(Context::get('success_return_url')) |
|
| 440 | + if (Context::get('success_return_url')) |
|
| 441 | 441 | { |
| 442 | 442 | $returnUrl = Context::get('success_return_url'); |
| 443 | 443 | } |
| 444 | - else if($_COOKIE['XE_REDIRECT_URL']) |
|
| 444 | + else if ($_COOKIE['XE_REDIRECT_URL']) |
|
| 445 | 445 | { |
| 446 | 446 | $returnUrl = $_COOKIE['XE_REDIRECT_URL']; |
| 447 | 447 | setcookie("XE_REDIRECT_URL", '', 1); |
@@ -455,26 +455,26 @@ discard block |
||
| 455 | 455 | |
| 456 | 456 | function procMemberModifyInfoBefore() |
| 457 | 457 | { |
| 458 | - if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD') |
|
| 458 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD') |
|
| 459 | 459 | { |
| 460 | 460 | return $this->stop('msg_invalid_request'); |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | - if(!Context::get('is_logged')) |
|
| 463 | + if (!Context::get('is_logged')) |
|
| 464 | 464 | { |
| 465 | 465 | return $this->stop('msg_not_logged'); |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | $password = Context::get('password'); |
| 469 | 469 | |
| 470 | - if(!$password) |
|
| 470 | + if (!$password) |
|
| 471 | 471 | { |
| 472 | 472 | return $this->stop('msg_invalid_request'); |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | $oMemberModel = getModel('member'); |
| 476 | 476 | |
| 477 | - if(!$this->memberInfo->password) |
|
| 477 | + if (!$this->memberInfo->password) |
|
| 478 | 478 | { |
| 479 | 479 | // Get information of logged-in user |
| 480 | 480 | $logged_info = Context::get('logged_info'); |
@@ -485,14 +485,14 @@ discard block |
||
| 485 | 485 | $this->memberInfo->password = $memberInfo->password; |
| 486 | 486 | } |
| 487 | 487 | // Verify the current password |
| 488 | - if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) |
|
| 488 | + if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) |
|
| 489 | 489 | { |
| 490 | 490 | return new Object(-1, 'invalid_password'); |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | $_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD'; |
| 494 | 494 | |
| 495 | - if(Context::get('success_return_url')) |
|
| 495 | + if (Context::get('success_return_url')) |
|
| 496 | 496 | { |
| 497 | 497 | $redirectUrl = Context::get('success_return_url'); |
| 498 | 498 | } |
@@ -510,12 +510,12 @@ discard block |
||
| 510 | 510 | */ |
| 511 | 511 | function procMemberModifyInfo() |
| 512 | 512 | { |
| 513 | - if(!Context::get('is_logged')) |
|
| 513 | + if (!Context::get('is_logged')) |
|
| 514 | 514 | { |
| 515 | 515 | return $this->stop('msg_not_logged'); |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | - if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
| 518 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
| 519 | 519 | { |
| 520 | 520 | return $this->stop('msg_invalid_request'); |
| 521 | 521 | } |
@@ -523,13 +523,13 @@ discard block |
||
| 523 | 523 | |
| 524 | 524 | // Extract the necessary information in advance |
| 525 | 525 | $oMemberModel = getModel('member'); |
| 526 | - $config = $oMemberModel->getMemberConfig (); |
|
| 527 | - $getVars = array('find_account_answer','allow_mailing','allow_message'); |
|
| 528 | - if($config->signupForm) |
|
| 526 | + $config = $oMemberModel->getMemberConfig(); |
|
| 527 | + $getVars = array('find_account_answer', 'allow_mailing', 'allow_message'); |
|
| 528 | + if ($config->signupForm) |
|
| 529 | 529 | { |
| 530 | - foreach($config->signupForm as $formInfo) |
|
| 530 | + foreach ($config->signupForm as $formInfo) |
|
| 531 | 531 | { |
| 532 | - if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 532 | + if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 533 | 533 | { |
| 534 | 534 | $getVars[] = $formInfo->name; |
| 535 | 535 | } |
@@ -537,16 +537,16 @@ discard block |
||
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | $args = new stdClass; |
| 540 | - foreach($getVars as $val) |
|
| 540 | + foreach ($getVars as $val) |
|
| 541 | 541 | { |
| 542 | 542 | $args->{$val} = Context::get($val); |
| 543 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 543 | + if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 544 | 544 | } |
| 545 | 545 | // Login Information |
| 546 | 546 | $logged_info = Context::get('logged_info'); |
| 547 | 547 | $args->member_srl = $logged_info->member_srl; |
| 548 | 548 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
| 549 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 549 | + if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 550 | 550 | // Remove some unnecessary variables from all the vars |
| 551 | 551 | $all_args = Context::getRequestVars(); |
| 552 | 552 | unset($all_args->module); |
@@ -570,9 +570,9 @@ discard block |
||
| 570 | 570 | |
| 571 | 571 | // remove whitespace |
| 572 | 572 | $checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address'); |
| 573 | - foreach($checkInfos as $val) |
|
| 573 | + foreach ($checkInfos as $val) |
|
| 574 | 574 | { |
| 575 | - if(isset($args->{$val})) |
|
| 575 | + if (isset($args->{$val})) |
|
| 576 | 576 | { |
| 577 | 577 | $args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val}); |
| 578 | 578 | } |
@@ -580,22 +580,22 @@ discard block |
||
| 580 | 580 | |
| 581 | 581 | // Execute insert or update depending on the value of member_srl |
| 582 | 582 | $output = $this->updateMember($args); |
| 583 | - if(!$output->toBool()) return $output; |
|
| 583 | + if (!$output->toBool()) return $output; |
|
| 584 | 584 | |
| 585 | 585 | $profile_image = $_FILES['profile_image']; |
| 586 | - if(is_uploaded_file($profile_image['tmp_name'])) |
|
| 586 | + if (is_uploaded_file($profile_image['tmp_name'])) |
|
| 587 | 587 | { |
| 588 | 588 | $this->insertProfileImage($args->member_srl, $profile_image['tmp_name']); |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | $image_mark = $_FILES['image_mark']; |
| 592 | - if(is_uploaded_file($image_mark['tmp_name'])) |
|
| 592 | + if (is_uploaded_file($image_mark['tmp_name'])) |
|
| 593 | 593 | { |
| 594 | 594 | $this->insertImageMark($args->member_srl, $image_mark['tmp_name']); |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | $image_name = $_FILES['image_name']; |
| 598 | - if(is_uploaded_file($image_name['tmp_name'])) |
|
| 598 | + if (is_uploaded_file($image_name['tmp_name'])) |
|
| 599 | 599 | { |
| 600 | 600 | $this->insertImageName($args->member_srl, $image_name['tmp_name']); |
| 601 | 601 | } |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | |
| 611 | 611 | // Call a trigger after successfully log-in (after) |
| 612 | 612 | $trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo); |
| 613 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 613 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 614 | 614 | |
| 615 | 615 | $this->setSessionInfo(); |
| 616 | 616 | // Return result |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | */ |
| 632 | 632 | function procMemberModifyPassword() |
| 633 | 633 | { |
| 634 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 634 | + if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 635 | 635 | // Extract the necessary information in advance |
| 636 | 636 | $current_password = trim(Context::get('current_password')); |
| 637 | 637 | $password = trim(Context::get('password1')); |
@@ -645,17 +645,17 @@ discard block |
||
| 645 | 645 | |
| 646 | 646 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 647 | 647 | // Verify the cuttent password |
| 648 | - if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password'); |
|
| 648 | + if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password'); |
|
| 649 | 649 | |
| 650 | 650 | // Check if a new password is as same as the previous password |
| 651 | - if($current_password == $password) return new Object(-1, 'invalid_new_password'); |
|
| 651 | + if ($current_password == $password) return new Object(-1, 'invalid_new_password'); |
|
| 652 | 652 | |
| 653 | 653 | // Execute insert or update depending on the value of member_srl |
| 654 | 654 | $args = new stdClass; |
| 655 | 655 | $args->member_srl = $member_srl; |
| 656 | 656 | $args->password = $password; |
| 657 | 657 | $output = $this->updateMemberPassword($args); |
| 658 | - if(!$output->toBool()) return $output; |
|
| 658 | + if (!$output->toBool()) return $output; |
|
| 659 | 659 | |
| 660 | 660 | $this->add('member_srl', $args->member_srl); |
| 661 | 661 | $this->setMessage('success_updated'); |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | */ |
| 672 | 672 | function procMemberLeave() |
| 673 | 673 | { |
| 674 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 674 | + if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 675 | 675 | // Extract the necessary information in advance |
| 676 | 676 | $password = trim(Context::get('password')); |
| 677 | 677 | // Get information of logged-in user |
@@ -680,17 +680,17 @@ discard block |
||
| 680 | 680 | // Create a member model object |
| 681 | 681 | $oMemberModel = getModel('member'); |
| 682 | 682 | // Get information of member_srl |
| 683 | - if(!$this->memberInfo->password) |
|
| 683 | + if (!$this->memberInfo->password) |
|
| 684 | 684 | { |
| 685 | 685 | $columnList = array('member_srl', 'password'); |
| 686 | 686 | $memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 687 | 687 | $this->memberInfo->password = $memberInfo->password; |
| 688 | 688 | } |
| 689 | 689 | // Verify the cuttent password |
| 690 | - if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password'); |
|
| 690 | + if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password'); |
|
| 691 | 691 | |
| 692 | 692 | $output = $this->deleteMember($member_srl); |
| 693 | - if(!$output->toBool()) return $output; |
|
| 693 | + if (!$output->toBool()) return $output; |
|
| 694 | 694 | // Destroy all session information |
| 695 | 695 | $this->destroySessionInfo(); |
| 696 | 696 | // Return success message |
@@ -709,17 +709,17 @@ discard block |
||
| 709 | 709 | { |
| 710 | 710 | // Check if the file is successfully uploaded |
| 711 | 711 | $file = $_FILES['profile_image']; |
| 712 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 712 | + if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 713 | 713 | // Ignore if member_srl is invalid or doesn't exist. |
| 714 | 714 | $member_srl = Context::get('member_srl'); |
| 715 | - if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 715 | + if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 716 | 716 | |
| 717 | 717 | $logged_info = Context::get('logged_info'); |
| 718 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 718 | + if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 719 | 719 | // Return if member module is set not to use an image name or the user is not an administrator ; |
| 720 | 720 | $oModuleModel = getModel('module'); |
| 721 | 721 | $config = $oModuleModel->getModuleConfig('member'); |
| 722 | - if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image'); |
|
| 722 | + if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image'); |
|
| 723 | 723 | |
| 724 | 724 | $this->insertProfileImage($member_srl, $file['tmp_name']); |
| 725 | 725 | // Page refresh |
@@ -741,25 +741,25 @@ discard block |
||
| 741 | 741 | { |
| 742 | 742 | |
| 743 | 743 | // Check uploaded file |
| 744 | - if(!checkUploadedFile($target_file)) return; |
|
| 744 | + if (!checkUploadedFile($target_file)) return; |
|
| 745 | 745 | |
| 746 | 746 | $oMemberModel = getModel('member'); |
| 747 | 747 | $config = $oMemberModel->getMemberConfig(); |
| 748 | 748 | |
| 749 | 749 | // Get an image size |
| 750 | 750 | $max_width = $config->profile_image_max_width; |
| 751 | - if(!$max_width) $max_width = "90"; |
|
| 751 | + if (!$max_width) $max_width = "90"; |
|
| 752 | 752 | $max_height = $config->profile_image_max_height; |
| 753 | - if(!$max_height) $max_height = "90"; |
|
| 753 | + if (!$max_height) $max_height = "90"; |
|
| 754 | 754 | // Get a target path to save |
| 755 | 755 | $target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl)); |
| 756 | 756 | FileHandler::makeDir($target_path); |
| 757 | 757 | |
| 758 | 758 | // Get file information |
| 759 | 759 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 760 | - if(IMAGETYPE_PNG == $type) $ext = 'png'; |
|
| 761 | - elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
| 762 | - elseif(IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
| 760 | + if (IMAGETYPE_PNG == $type) $ext = 'png'; |
|
| 761 | + elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
| 762 | + elseif (IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
| 763 | 763 | else |
| 764 | 764 | { |
| 765 | 765 | return; |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | |
| 770 | 770 | $target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext); |
| 771 | 771 | // Convert if the image size is larger than a given size or if the format is not a gif |
| 772 | - if(($width > $max_width || $height > $max_height ) && $type != 1) |
|
| 772 | + if (($width > $max_width || $height > $max_height) && $type != 1) |
|
| 773 | 773 | { |
| 774 | 774 | FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext); |
| 775 | 775 | } |
@@ -788,17 +788,17 @@ discard block |
||
| 788 | 788 | { |
| 789 | 789 | // Check if the file is successfully uploaded |
| 790 | 790 | $file = $_FILES['image_name']; |
| 791 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
| 791 | + if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
| 792 | 792 | // Ignore if member_srl is invalid or doesn't exist. |
| 793 | 793 | $member_srl = Context::get('member_srl'); |
| 794 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 794 | + if (!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 795 | 795 | |
| 796 | 796 | $logged_info = Context::get('logged_info'); |
| 797 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 797 | + if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 798 | 798 | // Return if member module is set not to use an image name or the user is not an administrator ; |
| 799 | 799 | $oModuleModel = getModel('module'); |
| 800 | 800 | $config = $oModuleModel->getModuleConfig('member'); |
| 801 | - if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
| 801 | + if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
| 802 | 802 | |
| 803 | 803 | $this->insertImageName($member_srl, $file['tmp_name']); |
| 804 | 804 | // Page refresh |
@@ -819,15 +819,15 @@ discard block |
||
| 819 | 819 | function insertImageName($member_srl, $target_file) |
| 820 | 820 | { |
| 821 | 821 | // Check uploaded file |
| 822 | - if(!checkUploadedFile($target_file)) return; |
|
| 822 | + if (!checkUploadedFile($target_file)) return; |
|
| 823 | 823 | |
| 824 | 824 | $oModuleModel = getModel('module'); |
| 825 | 825 | $config = $oModuleModel->getModuleConfig('member'); |
| 826 | 826 | // Get an image size |
| 827 | 827 | $max_width = $config->image_name_max_width; |
| 828 | - if(!$max_width) $max_width = "90"; |
|
| 828 | + if (!$max_width) $max_width = "90"; |
|
| 829 | 829 | $max_height = $config->image_name_max_height; |
| 830 | - if(!$max_height) $max_height = "20"; |
|
| 830 | + if (!$max_height) $max_height = "20"; |
|
| 831 | 831 | // Get a target path to save |
| 832 | 832 | $target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl)); |
| 833 | 833 | FileHandler::makeDir($target_path); |
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | // Get file information |
| 837 | 837 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 838 | 838 | // Convert if the image size is larger than a given size or if the format is not a gif |
| 839 | - if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
| 839 | + if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
| 840 | 840 | else @copy($target_file, $target_filename); |
| 841 | 841 | } |
| 842 | 842 | |
@@ -848,20 +848,20 @@ discard block |
||
| 848 | 848 | function procMemberDeleteProfileImage($_memberSrl = 0) |
| 849 | 849 | { |
| 850 | 850 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
| 851 | - if(!$member_srl) |
|
| 851 | + if (!$member_srl) |
|
| 852 | 852 | { |
| 853 | - return new Object(0,'success'); |
|
| 853 | + return new Object(0, 'success'); |
|
| 854 | 854 | } |
| 855 | 855 | |
| 856 | 856 | $logged_info = Context::get('logged_info'); |
| 857 | 857 | |
| 858 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 858 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 859 | 859 | { |
| 860 | 860 | $oMemberModel = getModel('member'); |
| 861 | 861 | $profile_image = $oMemberModel->getProfileImage($member_srl); |
| 862 | 862 | FileHandler::removeFile($profile_image->file); |
| 863 | 863 | } |
| 864 | - return new Object(0,'success'); |
|
| 864 | + return new Object(0, 'success'); |
|
| 865 | 865 | } |
| 866 | 866 | |
| 867 | 867 | /** |
@@ -872,20 +872,20 @@ discard block |
||
| 872 | 872 | function procMemberDeleteImageName($_memberSrl = 0) |
| 873 | 873 | { |
| 874 | 874 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
| 875 | - if(!$member_srl) |
|
| 875 | + if (!$member_srl) |
|
| 876 | 876 | { |
| 877 | - return new Object(0,'success'); |
|
| 877 | + return new Object(0, 'success'); |
|
| 878 | 878 | } |
| 879 | 879 | |
| 880 | 880 | $logged_info = Context::get('logged_info'); |
| 881 | 881 | |
| 882 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 882 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 883 | 883 | { |
| 884 | 884 | $oMemberModel = getModel('member'); |
| 885 | 885 | $image_name = $oMemberModel->getImageName($member_srl); |
| 886 | 886 | FileHandler::removeFile($image_name->file); |
| 887 | 887 | } |
| 888 | - return new Object(0,'success'); |
|
| 888 | + return new Object(0, 'success'); |
|
| 889 | 889 | } |
| 890 | 890 | |
| 891 | 891 | /** |
@@ -897,17 +897,17 @@ discard block |
||
| 897 | 897 | { |
| 898 | 898 | // Check if the file is successfully uploaded |
| 899 | 899 | $file = $_FILES['image_mark']; |
| 900 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 900 | + if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 901 | 901 | // Ignore if member_srl is invalid or doesn't exist. |
| 902 | 902 | $member_srl = Context::get('member_srl'); |
| 903 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 903 | + if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 904 | 904 | |
| 905 | 905 | $logged_info = Context::get('logged_info'); |
| 906 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 906 | + if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 907 | 907 | // Membership in the images mark the module using the ban was set by an administrator or return; |
| 908 | 908 | $oModuleModel = getModel('module'); |
| 909 | 909 | $config = $oModuleModel->getModuleConfig('member'); |
| 910 | - if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
| 910 | + if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
| 911 | 911 | |
| 912 | 912 | $this->insertImageMark($member_srl, $file['tmp_name']); |
| 913 | 913 | // Page refresh |
@@ -928,15 +928,15 @@ discard block |
||
| 928 | 928 | function insertImageMark($member_srl, $target_file) |
| 929 | 929 | { |
| 930 | 930 | // Check uploaded file |
| 931 | - if(!checkUploadedFile($target_file)) return; |
|
| 931 | + if (!checkUploadedFile($target_file)) return; |
|
| 932 | 932 | |
| 933 | 933 | $oModuleModel = getModel('module'); |
| 934 | 934 | $config = $oModuleModel->getModuleConfig('member'); |
| 935 | 935 | // Get an image size |
| 936 | 936 | $max_width = $config->image_mark_max_width; |
| 937 | - if(!$max_width) $max_width = "20"; |
|
| 937 | + if (!$max_width) $max_width = "20"; |
|
| 938 | 938 | $max_height = $config->image_mark_max_height; |
| 939 | - if(!$max_height) $max_height = "20"; |
|
| 939 | + if (!$max_height) $max_height = "20"; |
|
| 940 | 940 | |
| 941 | 941 | $target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); |
| 942 | 942 | FileHandler::makeDir($target_path); |
@@ -945,7 +945,7 @@ discard block |
||
| 945 | 945 | // Get file information |
| 946 | 946 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 947 | 947 | |
| 948 | - if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
| 948 | + if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
| 949 | 949 | else @copy($target_file, $target_filename); |
| 950 | 950 | } |
| 951 | 951 | |
@@ -957,20 +957,20 @@ discard block |
||
| 957 | 957 | function procMemberDeleteImageMark($_memberSrl = 0) |
| 958 | 958 | { |
| 959 | 959 | $member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl'); |
| 960 | - if(!$member_srl) |
|
| 960 | + if (!$member_srl) |
|
| 961 | 961 | { |
| 962 | - return new Object(0,'success'); |
|
| 962 | + return new Object(0, 'success'); |
|
| 963 | 963 | } |
| 964 | 964 | |
| 965 | 965 | $logged_info = Context::get('logged_info'); |
| 966 | 966 | |
| 967 | - if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 967 | + if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl)) |
|
| 968 | 968 | { |
| 969 | 969 | $oMemberModel = getModel('member'); |
| 970 | 970 | $image_mark = $oMemberModel->getImageMark($member_srl); |
| 971 | 971 | FileHandler::removeFile($image_mark->file); |
| 972 | 972 | } |
| 973 | - return new Object(0,'success'); |
|
| 973 | + return new Object(0, 'success'); |
|
| 974 | 974 | } |
| 975 | 975 | |
| 976 | 976 | /** |
@@ -981,26 +981,26 @@ discard block |
||
| 981 | 981 | function procMemberFindAccount() |
| 982 | 982 | { |
| 983 | 983 | $email_address = Context::get('email_address'); |
| 984 | - if(!$email_address) return new Object(-1, 'msg_invalid_request'); |
|
| 984 | + if (!$email_address) return new Object(-1, 'msg_invalid_request'); |
|
| 985 | 985 | |
| 986 | 986 | $oMemberModel = getModel('member'); |
| 987 | 987 | $oModuleModel = getModel('module'); |
| 988 | 988 | |
| 989 | 989 | // Check if a member having the same email address exists |
| 990 | 990 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 991 | - if(!$member_srl) return new Object(-1, 'msg_email_not_exists'); |
|
| 991 | + if (!$member_srl) return new Object(-1, 'msg_email_not_exists'); |
|
| 992 | 992 | |
| 993 | 993 | // Get information of the member |
| 994 | 994 | $columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name'); |
| 995 | 995 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 996 | 996 | |
| 997 | 997 | // Check if possible to find member's ID and password |
| 998 | - if($member_info->denied == 'Y') |
|
| 998 | + if ($member_info->denied == 'Y') |
|
| 999 | 999 | { |
| 1000 | 1000 | $chk_args = new stdClass; |
| 1001 | 1001 | $chk_args->member_srl = $member_info->member_srl; |
| 1002 | 1002 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1003 | - if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed'); |
|
| 1003 | + if ($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed'); |
|
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | 1006 | // Insert data into the authentication DB |
@@ -1013,19 +1013,19 @@ discard block |
||
| 1013 | 1013 | $args->is_register = 'N'; |
| 1014 | 1014 | |
| 1015 | 1015 | $output = executeQuery('member.insertAuthMail', $args); |
| 1016 | - if(!$output->toBool()) return $output; |
|
| 1016 | + if (!$output->toBool()) return $output; |
|
| 1017 | 1017 | // Get content of the email to send a member |
| 1018 | 1018 | Context::set('auth_args', $args); |
| 1019 | 1019 | |
| 1020 | 1020 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1021 | 1021 | $memberInfo = array(); |
| 1022 | 1022 | global $lang; |
| 1023 | - if(is_array($member_config->signupForm)) |
|
| 1023 | + if (is_array($member_config->signupForm)) |
|
| 1024 | 1024 | { |
| 1025 | - $exceptForm=array('password', 'find_account_question'); |
|
| 1026 | - foreach($member_config->signupForm as $form) |
|
| 1025 | + $exceptForm = array('password', 'find_account_question'); |
|
| 1026 | + foreach ($member_config->signupForm as $form) |
|
| 1027 | 1027 | { |
| 1028 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1028 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1029 | 1029 | { |
| 1030 | 1030 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1031 | 1031 | } |
@@ -1040,15 +1040,15 @@ discard block |
||
| 1040 | 1040 | } |
| 1041 | 1041 | Context::set('memberInfo', $memberInfo); |
| 1042 | 1042 | |
| 1043 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1044 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1043 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
| 1044 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1045 | 1045 | |
| 1046 | 1046 | Context::set('member_config', $member_config); |
| 1047 | 1047 | |
| 1048 | 1048 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1049 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1049 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1050 | 1050 | |
| 1051 | - $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
|
| 1051 | + $find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
|
| 1052 | 1052 | Context::set('find_url', $find_url); |
| 1053 | 1053 | |
| 1054 | 1054 | $oTemplate = &TemplateHandler::getInstance(); |
@@ -1058,19 +1058,19 @@ discard block |
||
| 1058 | 1058 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1059 | 1059 | // Send a mail |
| 1060 | 1060 | $oMail = new Mail(); |
| 1061 | - $oMail->setTitle( Context::getLang('msg_find_account_title') ); |
|
| 1061 | + $oMail->setTitle(Context::getLang('msg_find_account_title')); |
|
| 1062 | 1062 | $oMail->setContent($content); |
| 1063 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 1064 | - $oMail->setReceiptor( $member_info->user_name, $member_info->email_address ); |
|
| 1063 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 1064 | + $oMail->setReceiptor($member_info->user_name, $member_info->email_address); |
|
| 1065 | 1065 | $oMail->send(); |
| 1066 | 1066 | // Return message |
| 1067 | 1067 | $msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address); |
| 1068 | - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) |
|
| 1068 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 1069 | 1069 | { |
| 1070 | 1070 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount'); |
| 1071 | 1071 | $this->setRedirectUrl($returnUrl); |
| 1072 | 1072 | } |
| 1073 | - return new Object(0,$msg); |
|
| 1073 | + return new Object(0, $msg); |
|
| 1074 | 1074 | } |
| 1075 | 1075 | |
| 1076 | 1076 | /** |
@@ -1088,28 +1088,28 @@ discard block |
||
| 1088 | 1088 | $find_account_question = trim(Context::get('find_account_question')); |
| 1089 | 1089 | $find_account_answer = trim(Context::get('find_account_answer')); |
| 1090 | 1090 | |
| 1091 | - if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request'); |
|
| 1091 | + if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request'); |
|
| 1092 | 1092 | |
| 1093 | 1093 | $oModuleModel = getModel('module'); |
| 1094 | 1094 | // Check if a member having the same email address exists |
| 1095 | 1095 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1096 | - if(!$member_srl) return new Object(-1, 'msg_email_not_exists'); |
|
| 1096 | + if (!$member_srl) return new Object(-1, 'msg_email_not_exists'); |
|
| 1097 | 1097 | // Get information of the member |
| 1098 | 1098 | $columnList = array('member_srl', 'find_account_question', 'find_account_answer'); |
| 1099 | 1099 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 1100 | 1100 | |
| 1101 | 1101 | // Display a message if no answer is entered |
| 1102 | - if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists'); |
|
| 1102 | + if (!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists'); |
|
| 1103 | 1103 | |
| 1104 | - if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches'); |
|
| 1104 | + if (trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches'); |
|
| 1105 | 1105 | |
| 1106 | - if($config->identifier == 'email_address') |
|
| 1106 | + if ($config->identifier == 'email_address') |
|
| 1107 | 1107 | { |
| 1108 | 1108 | $user_id = $email_address; |
| 1109 | 1109 | } |
| 1110 | 1110 | |
| 1111 | 1111 | // Update to a temporary password and set change_password_date to 1 |
| 1112 | - $oPassword = new Password(); |
|
| 1112 | + $oPassword = new Password(); |
|
| 1113 | 1113 | $temp_password = $oPassword->createTemporaryPassword(8); |
| 1114 | 1114 | |
| 1115 | 1115 | $args = new stdClass(); |
@@ -1117,11 +1117,11 @@ discard block |
||
| 1117 | 1117 | $args->password = $temp_password; |
| 1118 | 1118 | $args->change_password_date = '1'; |
| 1119 | 1119 | $output = $this->updateMemberPassword($args); |
| 1120 | - if(!$output->toBool()) return $output; |
|
| 1120 | + if (!$output->toBool()) return $output; |
|
| 1121 | 1121 | |
| 1122 | - $_SESSION['xe_temp_password_' . $user_id] = $temp_password; |
|
| 1122 | + $_SESSION['xe_temp_password_'.$user_id] = $temp_password; |
|
| 1123 | 1123 | |
| 1124 | - $this->add('user_id',$user_id); |
|
| 1124 | + $this->add('user_id', $user_id); |
|
| 1125 | 1125 | |
| 1126 | 1126 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); |
| 1127 | 1127 | $this->setRedirectUrl($returnUrl.'&user_id='.$user_id); |
@@ -1141,7 +1141,7 @@ discard block |
||
| 1141 | 1141 | $member_srl = Context::get('member_srl'); |
| 1142 | 1142 | $auth_key = Context::get('auth_key'); |
| 1143 | 1143 | |
| 1144 | - if(!$member_srl || !$auth_key) |
|
| 1144 | + if (!$member_srl || !$auth_key) |
|
| 1145 | 1145 | { |
| 1146 | 1146 | return $this->stop('msg_invalid_request'); |
| 1147 | 1147 | } |
@@ -1152,9 +1152,9 @@ discard block |
||
| 1152 | 1152 | $args->auth_key = $auth_key; |
| 1153 | 1153 | $output = executeQuery('member.getAuthMail', $args); |
| 1154 | 1154 | |
| 1155 | - if(!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 1155 | + if (!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 1156 | 1156 | { |
| 1157 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) |
|
| 1157 | + if (strlen($output->data->auth_key) !== strlen($auth_key)) |
|
| 1158 | 1158 | { |
| 1159 | 1159 | executeQuery('member.deleteAuthMail', $args); |
| 1160 | 1160 | } |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | return $this->stop('msg_invalid_auth_key'); |
| 1163 | 1163 | } |
| 1164 | 1164 | |
| 1165 | - if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400) |
|
| 1165 | + if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400) |
|
| 1166 | 1166 | { |
| 1167 | 1167 | executeQuery('member.deleteAuthMail', $args); |
| 1168 | 1168 | return $this->stop('msg_invalid_auth_key'); |
@@ -1171,7 +1171,7 @@ discard block |
||
| 1171 | 1171 | $args->password = $output->data->new_password; |
| 1172 | 1172 | |
| 1173 | 1173 | // If credentials are correct, change the password to a new one |
| 1174 | - if($output->data->is_register == 'Y') |
|
| 1174 | + if ($output->data->is_register == 'Y') |
|
| 1175 | 1175 | { |
| 1176 | 1176 | $args->denied = 'N'; |
| 1177 | 1177 | } |
@@ -1184,13 +1184,13 @@ discard block |
||
| 1184 | 1184 | $is_register = $output->data->is_register; |
| 1185 | 1185 | |
| 1186 | 1186 | $output = executeQuery('member.updateMemberPassword', $args); |
| 1187 | - if(!$output->toBool()) |
|
| 1187 | + if (!$output->toBool()) |
|
| 1188 | 1188 | { |
| 1189 | 1189 | return $this->stop($output->getMessage()); |
| 1190 | 1190 | } |
| 1191 | 1191 | |
| 1192 | 1192 | // Remove all values having the member_srl from authentication table |
| 1193 | - executeQuery('member.deleteAuthMail',$args); |
|
| 1193 | + executeQuery('member.deleteAuthMail', $args); |
|
| 1194 | 1194 | |
| 1195 | 1195 | $this->_clearMemberCache($args->member_srl); |
| 1196 | 1196 | |
@@ -1209,33 +1209,33 @@ discard block |
||
| 1209 | 1209 | { |
| 1210 | 1210 | // Get an email_address |
| 1211 | 1211 | $email_address = Context::get('email_address'); |
| 1212 | - if(!$email_address) return new Object(-1, 'msg_invalid_request'); |
|
| 1212 | + if (!$email_address) return new Object(-1, 'msg_invalid_request'); |
|
| 1213 | 1213 | // Log test by using email_address |
| 1214 | 1214 | $oMemberModel = getModel('member'); |
| 1215 | 1215 | |
| 1216 | 1216 | $args = new stdClass; |
| 1217 | 1217 | $args->email_address = $email_address; |
| 1218 | 1218 | $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1219 | - if(!$memberSrl) return new Object(-1, 'msg_not_exists_member'); |
|
| 1219 | + if (!$memberSrl) return new Object(-1, 'msg_not_exists_member'); |
|
| 1220 | 1220 | |
| 1221 | 1221 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address'); |
| 1222 | 1222 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList); |
| 1223 | 1223 | |
| 1224 | 1224 | $oModuleModel = getModel('module'); |
| 1225 | 1225 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1226 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1227 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1226 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
| 1227 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1228 | 1228 | |
| 1229 | 1229 | // Check if a authentication mail has been sent previously |
| 1230 | 1230 | $chk_args = new stdClass; |
| 1231 | 1231 | $chk_args->member_srl = $member_info->member_srl; |
| 1232 | 1232 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1233 | - if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request'); |
|
| 1233 | + if ($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request'); |
|
| 1234 | 1234 | |
| 1235 | 1235 | $auth_args = new stdClass; |
| 1236 | 1236 | $auth_args->member_srl = $member_info->member_srl; |
| 1237 | 1237 | $output = executeQueryArray('member.getAuthMailInfo', $auth_args); |
| 1238 | - if(!$output->data || !$output->data[0]->auth_key) return new Object(-1, 'msg_invalid_request'); |
|
| 1238 | + if (!$output->data || !$output->data[0]->auth_key) return new Object(-1, 'msg_invalid_request'); |
|
| 1239 | 1239 | $auth_info = $output->data[0]; |
| 1240 | 1240 | |
| 1241 | 1241 | // Update the regdate of authmail entry |
@@ -1246,12 +1246,12 @@ discard block |
||
| 1246 | 1246 | |
| 1247 | 1247 | $memberInfo = array(); |
| 1248 | 1248 | global $lang; |
| 1249 | - if(is_array($member_config->signupForm)) |
|
| 1249 | + if (is_array($member_config->signupForm)) |
|
| 1250 | 1250 | { |
| 1251 | - $exceptForm=array('password', 'find_account_question'); |
|
| 1252 | - foreach($member_config->signupForm as $form) |
|
| 1251 | + $exceptForm = array('password', 'find_account_question'); |
|
| 1252 | + foreach ($member_config->signupForm as $form) |
|
| 1253 | 1253 | { |
| 1254 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1254 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1255 | 1255 | { |
| 1256 | 1256 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1257 | 1257 | } |
@@ -1270,19 +1270,19 @@ discard block |
||
| 1270 | 1270 | Context::set('member_config', $member_config); |
| 1271 | 1271 | |
| 1272 | 1272 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1273 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1273 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1274 | 1274 | |
| 1275 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); |
|
| 1275 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key); |
|
| 1276 | 1276 | Context::set('auth_url', $auth_url); |
| 1277 | 1277 | |
| 1278 | 1278 | $oTemplate = &TemplateHandler::getInstance(); |
| 1279 | 1279 | $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); |
| 1280 | 1280 | // Send a mail |
| 1281 | 1281 | $oMail = new Mail(); |
| 1282 | - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); |
|
| 1282 | + $oMail->setTitle(Context::getLang('msg_confirm_account_title')); |
|
| 1283 | 1283 | $oMail->setContent($content); |
| 1284 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 1285 | - $oMail->setReceiptor( $args->user_name, $args->email_address ); |
|
| 1284 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 1285 | + $oMail->setReceiptor($args->user_name, $args->email_address); |
|
| 1286 | 1286 | $oMail->send(); |
| 1287 | 1287 | |
| 1288 | 1288 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
@@ -1297,23 +1297,23 @@ discard block |
||
| 1297 | 1297 | $memberInfo = $_SESSION['auth_member_info']; |
| 1298 | 1298 | unset($_SESSION['auth_member_info']); |
| 1299 | 1299 | |
| 1300 | - if(!$memberInfo) |
|
| 1300 | + if (!$memberInfo) |
|
| 1301 | 1301 | { |
| 1302 | 1302 | return $this->stop('msg_invalid_request'); |
| 1303 | 1303 | } |
| 1304 | 1304 | |
| 1305 | 1305 | $newEmail = Context::get('email_address'); |
| 1306 | 1306 | |
| 1307 | - if(!$newEmail) |
|
| 1307 | + if (!$newEmail) |
|
| 1308 | 1308 | { |
| 1309 | 1309 | return $this->stop('msg_invalid_request'); |
| 1310 | 1310 | } |
| 1311 | 1311 | |
| 1312 | 1312 | $oMemberModel = getModel('member'); |
| 1313 | 1313 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
| 1314 | - if($member_srl) |
|
| 1314 | + if ($member_srl) |
|
| 1315 | 1315 | { |
| 1316 | - return new Object(-1,'msg_exists_email_address'); |
|
| 1316 | + return new Object(-1, 'msg_exists_email_address'); |
|
| 1317 | 1317 | } |
| 1318 | 1318 | |
| 1319 | 1319 | // remove all key by member_srl |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | $args->member_srl = $memberInfo->member_srl; |
| 1322 | 1322 | $output = executeQuery('member.deleteAuthMail', $args); |
| 1323 | 1323 | |
| 1324 | - if(!$output->toBool()) |
|
| 1324 | + if (!$output->toBool()) |
|
| 1325 | 1325 | { |
| 1326 | 1326 | return $output; |
| 1327 | 1327 | } |
@@ -1331,7 +1331,7 @@ discard block |
||
| 1331 | 1331 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
| 1332 | 1332 | |
| 1333 | 1333 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
| 1334 | - if(!$output->toBool()) |
|
| 1334 | + if (!$output->toBool()) |
|
| 1335 | 1335 | { |
| 1336 | 1336 | return $this->stop($output->getMessage()); |
| 1337 | 1337 | } |
@@ -1348,7 +1348,7 @@ discard block |
||
| 1348 | 1348 | $auth_args->is_register = 'Y'; |
| 1349 | 1349 | |
| 1350 | 1350 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 1351 | - if(!$output->toBool()) return $output; |
|
| 1351 | + if (!$output->toBool()) return $output; |
|
| 1352 | 1352 | |
| 1353 | 1353 | $memberInfo->email_address = $newEmail; |
| 1354 | 1354 | |
@@ -1372,12 +1372,12 @@ discard block |
||
| 1372 | 1372 | $memberInfo = array(); |
| 1373 | 1373 | |
| 1374 | 1374 | global $lang; |
| 1375 | - if(is_array($member_config->signupForm)) |
|
| 1375 | + if (is_array($member_config->signupForm)) |
|
| 1376 | 1376 | { |
| 1377 | - $exceptForm=array('password', 'find_account_question'); |
|
| 1378 | - foreach($member_config->signupForm as $form) |
|
| 1377 | + $exceptForm = array('password', 'find_account_question'); |
|
| 1378 | + foreach ($member_config->signupForm as $form) |
|
| 1379 | 1379 | { |
| 1380 | - if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1380 | + if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired)) |
|
| 1381 | 1381 | { |
| 1382 | 1382 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1383 | 1383 | } |
@@ -1392,25 +1392,25 @@ discard block |
||
| 1392 | 1392 | } |
| 1393 | 1393 | Context::set('memberInfo', $memberInfo); |
| 1394 | 1394 | |
| 1395 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1396 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1395 | + if (!$member_config->skin) $member_config->skin = "default"; |
|
| 1396 | + if (!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1397 | 1397 | |
| 1398 | 1398 | Context::set('member_config', $member_config); |
| 1399 | 1399 | |
| 1400 | 1400 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1401 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1401 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1402 | 1402 | |
| 1403 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
|
| 1403 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key); |
|
| 1404 | 1404 | Context::set('auth_url', $auth_url); |
| 1405 | 1405 | |
| 1406 | 1406 | $oTemplate = &TemplateHandler::getInstance(); |
| 1407 | 1407 | $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); |
| 1408 | 1408 | // Send a mail |
| 1409 | 1409 | $oMail = new Mail(); |
| 1410 | - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); |
|
| 1410 | + $oMail->setTitle(Context::getLang('msg_confirm_account_title')); |
|
| 1411 | 1411 | $oMail->setContent($content); |
| 1412 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 1413 | - $oMail->setReceiptor( $member_info->user_name, $member_info->email_address ); |
|
| 1412 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 1413 | + $oMail->setReceiptor($member_info->user_name, $member_info->email_address); |
|
| 1414 | 1414 | $oMail->send(); |
| 1415 | 1415 | } |
| 1416 | 1416 | |
@@ -1423,7 +1423,7 @@ discard block |
||
| 1423 | 1423 | { |
| 1424 | 1424 | $site_module_info = Context::get('site_module_info'); |
| 1425 | 1425 | $logged_info = Context::get('logged_info'); |
| 1426 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request'); |
|
| 1426 | + if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request'); |
|
| 1427 | 1427 | |
| 1428 | 1428 | $oMemberModel = getModel('member'); |
| 1429 | 1429 | $columnList = array('site_srl', 'group_srl', 'title'); |
@@ -1442,13 +1442,13 @@ discard block |
||
| 1442 | 1442 | { |
| 1443 | 1443 | $site_module_info = Context::get('site_module_info'); |
| 1444 | 1444 | $logged_info = Context::get('logged_info'); |
| 1445 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request'); |
|
| 1445 | + if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request'); |
|
| 1446 | 1446 | |
| 1447 | 1447 | $args = new stdClass; |
| 1448 | - $args->site_srl= $site_module_info->site_srl; |
|
| 1448 | + $args->site_srl = $site_module_info->site_srl; |
|
| 1449 | 1449 | $args->member_srl = $logged_info->member_srl; |
| 1450 | 1450 | $output = executeQuery('member.deleteMembersGroup', $args); |
| 1451 | - if(!$output->toBool()) return $output; |
|
| 1451 | + if (!$output->toBool()) return $output; |
|
| 1452 | 1452 | $this->setMessage('success_deleted'); |
| 1453 | 1453 | $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl); |
| 1454 | 1454 | } |
@@ -1462,25 +1462,25 @@ discard block |
||
| 1462 | 1462 | */ |
| 1463 | 1463 | function setMemberConfig($args) |
| 1464 | 1464 | { |
| 1465 | - if(!$args->skin) $args->skin = "default"; |
|
| 1466 | - if(!$args->colorset) $args->colorset = "white"; |
|
| 1467 | - if(!$args->editor_skin) $args->editor_skin= "ckeditor"; |
|
| 1468 | - if(!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
| 1469 | - if($args->enable_join!='Y') $args->enable_join = 'N'; |
|
| 1470 | - $args->enable_openid= 'N'; |
|
| 1471 | - if($args->profile_image !='Y') $args->profile_image = 'N'; |
|
| 1472 | - if($args->image_name!='Y') $args->image_name = 'N'; |
|
| 1473 | - if($args->image_mark!='Y') $args->image_mark = 'N'; |
|
| 1474 | - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; |
|
| 1475 | - if(!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
| 1476 | - $args->limit_day = (int)$args->limit_day; |
|
| 1465 | + if (!$args->skin) $args->skin = "default"; |
|
| 1466 | + if (!$args->colorset) $args->colorset = "white"; |
|
| 1467 | + if (!$args->editor_skin) $args->editor_skin = "ckeditor"; |
|
| 1468 | + if (!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
| 1469 | + if ($args->enable_join != 'Y') $args->enable_join = 'N'; |
|
| 1470 | + $args->enable_openid = 'N'; |
|
| 1471 | + if ($args->profile_image != 'Y') $args->profile_image = 'N'; |
|
| 1472 | + if ($args->image_name != 'Y') $args->image_name = 'N'; |
|
| 1473 | + if ($args->image_mark != 'Y') $args->image_mark = 'N'; |
|
| 1474 | + if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N'; |
|
| 1475 | + if (!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
| 1476 | + $args->limit_day = (int) $args->limit_day; |
|
| 1477 | 1477 | |
| 1478 | 1478 | $agreement = trim($args->agreement); |
| 1479 | 1479 | unset($args->agreement); |
| 1480 | 1480 | |
| 1481 | 1481 | $oModuleController = getController('module'); |
| 1482 | - $output = $oModuleController->insertModuleConfig('member',$args); |
|
| 1483 | - if(!$output->toBool()) return $output; |
|
| 1482 | + $output = $oModuleController->insertModuleConfig('member', $args); |
|
| 1483 | + if (!$output->toBool()) return $output; |
|
| 1484 | 1484 | |
| 1485 | 1485 | $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
| 1486 | 1486 | FileHandler::writeFile($agreement_file, $agreement); |
@@ -1501,11 +1501,11 @@ discard block |
||
| 1501 | 1501 | $signature = trim(removeHackTag($signature)); |
| 1502 | 1502 | $signature = preg_replace('/<(\/?)(embed|object|param)/is', '<$1$2', $signature); |
| 1503 | 1503 | |
| 1504 | - $check_signature = trim(str_replace(array(' ',"\n","\r"), '', strip_tags($signature, '<img><object>'))); |
|
| 1504 | + $check_signature = trim(str_replace(array(' ', "\n", "\r"), '', strip_tags($signature, '<img><object>'))); |
|
| 1505 | 1505 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
| 1506 | 1506 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
| 1507 | 1507 | |
| 1508 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
| 1508 | + if (!$check_signature) return FileHandler::removeFile($filename); |
|
| 1509 | 1509 | |
| 1510 | 1510 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
| 1511 | 1511 | FileHandler::makeDir($path); |
@@ -1534,15 +1534,15 @@ discard block |
||
| 1534 | 1534 | * |
| 1535 | 1535 | * @return Object |
| 1536 | 1536 | */ |
| 1537 | - function addMemberToGroup($member_srl, $group_srl, $site_srl=0) |
|
| 1537 | + function addMemberToGroup($member_srl, $group_srl, $site_srl = 0) |
|
| 1538 | 1538 | { |
| 1539 | 1539 | $args = new stdClass(); |
| 1540 | 1540 | $args->member_srl = $member_srl; |
| 1541 | 1541 | $args->group_srl = $group_srl; |
| 1542 | - if($site_srl) $args->site_srl = $site_srl; |
|
| 1542 | + if ($site_srl) $args->site_srl = $site_srl; |
|
| 1543 | 1543 | |
| 1544 | 1544 | // Add |
| 1545 | - $output = executeQuery('member.addMemberToGroup',$args); |
|
| 1545 | + $output = executeQuery('member.addMemberToGroup', $args); |
|
| 1546 | 1546 | $output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args); |
| 1547 | 1547 | |
| 1548 | 1548 | $this->_clearMemberCache($member_srl, $site_srl); |
@@ -1562,18 +1562,18 @@ discard block |
||
| 1562 | 1562 | { |
| 1563 | 1563 | $obj = new stdClass; |
| 1564 | 1564 | $obj->site_srl = $args->site_srl; |
| 1565 | - $obj->member_srl = implode(',',$args->member_srl); |
|
| 1565 | + $obj->member_srl = implode(',', $args->member_srl); |
|
| 1566 | 1566 | |
| 1567 | 1567 | $output = executeQueryArray('member.getMembersGroup', $obj); |
| 1568 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1568 | + if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1569 | 1569 | |
| 1570 | 1570 | $output = executeQuery('member.deleteMembersGroup', $obj); |
| 1571 | - if(!$output->toBool()) return $output; |
|
| 1571 | + if (!$output->toBool()) return $output; |
|
| 1572 | 1572 | |
| 1573 | 1573 | $inserted_members = array(); |
| 1574 | - foreach($args->member_srl as $key => $val) |
|
| 1574 | + foreach ($args->member_srl as $key => $val) |
|
| 1575 | 1575 | { |
| 1576 | - if($inserted_members[$val]) continue; |
|
| 1576 | + if ($inserted_members[$val]) continue; |
|
| 1577 | 1577 | $inserted_members[$val] = true; |
| 1578 | 1578 | |
| 1579 | 1579 | unset($obj); |
@@ -1583,7 +1583,7 @@ discard block |
||
| 1583 | 1583 | $obj->site_srl = $args->site_srl; |
| 1584 | 1584 | $obj->regdate = $date[$obj->member_srl]; |
| 1585 | 1585 | $output = executeQuery('member.addMemberToGroup', $obj); |
| 1586 | - if(!$output->toBool()) return $output; |
|
| 1586 | + if (!$output->toBool()) return $output; |
|
| 1587 | 1587 | |
| 1588 | 1588 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
| 1589 | 1589 | } |
@@ -1605,9 +1605,9 @@ discard block |
||
| 1605 | 1605 | // Get information of the key |
| 1606 | 1606 | $output = executeQuery('member.getAutologin', $args); |
| 1607 | 1607 | // If no information exists, delete a cookie |
| 1608 | - if(!$output->toBool() || !$output->data) |
|
| 1608 | + if (!$output->toBool() || !$output->data) |
|
| 1609 | 1609 | { |
| 1610 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
| 1610 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
| 1611 | 1611 | return; |
| 1612 | 1612 | } |
| 1613 | 1613 | |
@@ -1617,9 +1617,9 @@ discard block |
||
| 1617 | 1617 | $user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address; |
| 1618 | 1618 | $password = $output->data->password; |
| 1619 | 1619 | |
| 1620 | - if(!$user_id || !$password) |
|
| 1620 | + if (!$user_id || !$password) |
|
| 1621 | 1621 | { |
| 1622 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
| 1622 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
| 1623 | 1623 | return; |
| 1624 | 1624 | } |
| 1625 | 1625 | |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | $check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT']; |
| 1630 | 1630 | $check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32); |
| 1631 | 1631 | |
| 1632 | - if($check_key === substr($args->autologin_key, 32)) |
|
| 1632 | + if ($check_key === substr($args->autologin_key, 32)) |
|
| 1633 | 1633 | { |
| 1634 | 1634 | // Check change_password_date |
| 1635 | 1635 | $oModuleModel = getModel('module'); |
@@ -1637,12 +1637,12 @@ discard block |
||
| 1637 | 1637 | $limit_date = $member_config->change_password_date; |
| 1638 | 1638 | |
| 1639 | 1639 | // Check if change_password_date is set |
| 1640 | - if($limit_date > 0) |
|
| 1640 | + if ($limit_date > 0) |
|
| 1641 | 1641 | { |
| 1642 | 1642 | $oMemberModel = getModel('member'); |
| 1643 | 1643 | $columnList = array('member_srl', 'change_password_date'); |
| 1644 | 1644 | |
| 1645 | - if($config->identifier == 'user_id') |
|
| 1645 | + if ($config->identifier == 'user_id') |
|
| 1646 | 1646 | { |
| 1647 | 1647 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
| 1648 | 1648 | } |
@@ -1651,7 +1651,7 @@ discard block |
||
| 1651 | 1651 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
| 1652 | 1652 | } |
| 1653 | 1653 | |
| 1654 | - if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){ |
|
| 1654 | + if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) { |
|
| 1655 | 1655 | $do_auto_login = true; |
| 1656 | 1656 | } |
| 1657 | 1657 | |
@@ -1662,14 +1662,14 @@ discard block |
||
| 1662 | 1662 | } |
| 1663 | 1663 | } |
| 1664 | 1664 | |
| 1665 | - if($do_auto_login) |
|
| 1665 | + if ($do_auto_login) |
|
| 1666 | 1666 | { |
| 1667 | 1667 | $output = $this->doLogin($user_id); |
| 1668 | 1668 | } |
| 1669 | 1669 | else |
| 1670 | 1670 | { |
| 1671 | 1671 | executeQuery('member.deleteAutologin', $args); |
| 1672 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
|
| 1672 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365); |
|
| 1673 | 1673 | } |
| 1674 | 1674 | } |
| 1675 | 1675 | |
@@ -1685,13 +1685,13 @@ discard block |
||
| 1685 | 1685 | function doLogin($user_id, $password = '', $keep_signed = false) |
| 1686 | 1686 | { |
| 1687 | 1687 | $user_id = strtolower($user_id); |
| 1688 | - if(!$user_id) return new Object(-1, 'null_user_id'); |
|
| 1688 | + if (!$user_id) return new Object(-1, 'null_user_id'); |
|
| 1689 | 1689 | // Call a trigger before log-in (before) |
| 1690 | 1690 | $trigger_obj = new stdClass(); |
| 1691 | 1691 | $trigger_obj->user_id = $user_id; |
| 1692 | 1692 | $trigger_obj->password = $password; |
| 1693 | 1693 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
| 1694 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 1694 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 1695 | 1695 | // Create a member model object |
| 1696 | 1696 | $oMemberModel = getModel('member'); |
| 1697 | 1697 | |
@@ -1701,12 +1701,12 @@ discard block |
||
| 1701 | 1701 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
| 1702 | 1702 | |
| 1703 | 1703 | // check identifier |
| 1704 | - if($config->identifier == 'email_address') |
|
| 1704 | + if ($config->identifier == 'email_address') |
|
| 1705 | 1705 | { |
| 1706 | 1706 | // Get user_id information |
| 1707 | 1707 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
| 1708 | 1708 | // Set an invalid user if no value returned |
| 1709 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 1709 | + if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 1710 | 1710 | |
| 1711 | 1711 | } |
| 1712 | 1712 | else |
@@ -1714,24 +1714,24 @@ discard block |
||
| 1714 | 1714 | // Get user_id information |
| 1715 | 1715 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
| 1716 | 1716 | // Set an invalid user if no value returned |
| 1717 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 1717 | + if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 1718 | 1718 | } |
| 1719 | 1719 | |
| 1720 | 1720 | $output = executeQuery('member.getLoginCountByIp', $args); |
| 1721 | 1721 | $errorCount = $output->data->count; |
| 1722 | - if($errorCount >= $config->max_error_count) |
|
| 1722 | + if ($errorCount >= $config->max_error_count) |
|
| 1723 | 1723 | { |
| 1724 | 1724 | $last_update = strtotime($output->data->last_update); |
| 1725 | - $term = intval($_SERVER['REQUEST_TIME']-$last_update); |
|
| 1726 | - if($term < $config->max_error_count_time) |
|
| 1725 | + $term = intval($_SERVER['REQUEST_TIME'] - $last_update); |
|
| 1726 | + if ($term < $config->max_error_count_time) |
|
| 1727 | 1727 | { |
| 1728 | 1728 | $term = $config->max_error_count_time - $term; |
| 1729 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
| 1730 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
| 1731 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
| 1732 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
| 1729 | + if ($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
| 1730 | + elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min'); |
|
| 1731 | + elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour'); |
|
| 1732 | + else $term = intval($term / 86400).Context::getLang('unit_day'); |
|
| 1733 | 1733 | |
| 1734 | - return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
|
| 1734 | + return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term)); |
|
| 1735 | 1735 | } |
| 1736 | 1736 | else |
| 1737 | 1737 | { |
@@ -1741,13 +1741,13 @@ discard block |
||
| 1741 | 1741 | } |
| 1742 | 1742 | |
| 1743 | 1743 | // Password Check |
| 1744 | - if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
| 1744 | + if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
| 1745 | 1745 | { |
| 1746 | - return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo); |
|
| 1746 | + return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo); |
|
| 1747 | 1747 | } |
| 1748 | 1748 | |
| 1749 | 1749 | // If denied == 'Y', notify |
| 1750 | - if($this->memberInfo->denied == 'Y') |
|
| 1750 | + if ($this->memberInfo->denied == 'Y') |
|
| 1751 | 1751 | { |
| 1752 | 1752 | $args->member_srl = $this->memberInfo->member_srl; |
| 1753 | 1753 | $output = executeQuery('member.chkAuthMail', $args); |
@@ -1755,12 +1755,12 @@ discard block |
||
| 1755 | 1755 | { |
| 1756 | 1756 | $_SESSION['auth_member_srl'] = $this->memberInfo->member_srl; |
| 1757 | 1757 | $redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail'); |
| 1758 | - return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed')); |
|
| 1758 | + return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed')); |
|
| 1759 | 1759 | } |
| 1760 | - return new Object(-1,'msg_user_denied'); |
|
| 1760 | + return new Object(-1, 'msg_user_denied'); |
|
| 1761 | 1761 | } |
| 1762 | 1762 | // Notify if denied_date is less than the current time |
| 1763 | - if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
| 1763 | + if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) return new Object(-9, sprintf(Context::getLang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d"))); |
|
| 1764 | 1764 | // Update the latest login time |
| 1765 | 1765 | $args->member_srl = $this->memberInfo->member_srl; |
| 1766 | 1766 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1770,36 +1770,36 @@ discard block |
||
| 1770 | 1770 | |
| 1771 | 1771 | // Check if there is recoding table. |
| 1772 | 1772 | $oDB = &DB::getInstance(); |
| 1773 | - if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
| 1773 | + if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
| 1774 | 1774 | { |
| 1775 | 1775 | // check if there is login fail records. |
| 1776 | 1776 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
| 1777 | - if($output->data && $output->data->content) |
|
| 1777 | + if ($output->data && $output->data->content) |
|
| 1778 | 1778 | { |
| 1779 | 1779 | $title = Context::getLang('login_fail_report'); |
| 1780 | 1780 | $message = '<ul>'; |
| 1781 | 1781 | $content = unserialize($output->data->content); |
| 1782 | - if(count($content) > $config->max_error_count) |
|
| 1782 | + if (count($content) > $config->max_error_count) |
|
| 1783 | 1783 | { |
| 1784 | - foreach($content as $val) |
|
| 1784 | + foreach ($content as $val) |
|
| 1785 | 1785 | { |
| 1786 | - $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>'; |
|
| 1786 | + $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>'; |
|
| 1787 | 1787 | } |
| 1788 | 1788 | $message .= '</ul>'; |
| 1789 | - $content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa')); |
|
| 1789 | + $content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa')); |
|
| 1790 | 1790 | |
| 1791 | 1791 | //send message |
| 1792 | 1792 | $oCommunicationController = getController('communication'); |
| 1793 | 1793 | $oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true); |
| 1794 | 1794 | |
| 1795 | - if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
| 1795 | + if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
| 1796 | 1796 | { |
| 1797 | 1797 | $view_url = Context::getRequestUri(); |
| 1798 | - $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); |
|
| 1798 | + $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); |
|
| 1799 | 1799 | $oMail = new Mail(); |
| 1800 | 1800 | $oMail->setTitle($title); |
| 1801 | 1801 | $oMail->setContent($content); |
| 1802 | - $oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email); |
|
| 1802 | + $oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email); |
|
| 1803 | 1803 | $oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address); |
| 1804 | 1804 | $oMail->send(); |
| 1805 | 1805 | } |
@@ -1809,9 +1809,9 @@ discard block |
||
| 1809 | 1809 | } |
| 1810 | 1810 | // Call a trigger after successfully log-in (after) |
| 1811 | 1811 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
| 1812 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 1812 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
| 1813 | 1813 | // When user checked to use auto-login |
| 1814 | - if($keep_signed) |
|
| 1814 | + if ($keep_signed) |
|
| 1815 | 1815 | { |
| 1816 | 1816 | // Key generate for auto login |
| 1817 | 1817 | $oPassword = new Password(); |
@@ -1823,12 +1823,12 @@ discard block |
||
| 1823 | 1823 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
| 1824 | 1824 | executeQuery('member.deleteAutologin', $autologin_args); |
| 1825 | 1825 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
| 1826 | - if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
| 1826 | + if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000); |
|
| 1827 | 1827 | } |
| 1828 | - if($this->memberInfo->is_admin == 'Y') |
|
| 1828 | + if ($this->memberInfo->is_admin == 'Y') |
|
| 1829 | 1829 | { |
| 1830 | 1830 | $oMemberAdminModel = getAdminModel('member'); |
| 1831 | - if(!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
| 1831 | + if (!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
| 1832 | 1832 | { |
| 1833 | 1833 | $_SESSION['denied_admin'] = 'Y'; |
| 1834 | 1834 | } |
@@ -1846,18 +1846,18 @@ discard block |
||
| 1846 | 1846 | { |
| 1847 | 1847 | $oMemberModel = getModel('member'); |
| 1848 | 1848 | // If your information came through the current session information to extract information from the users |
| 1849 | - if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() ) |
|
| 1849 | + if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged()) |
|
| 1850 | 1850 | { |
| 1851 | 1851 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']); |
| 1852 | 1852 | // If you do not destroy the session Profile |
| 1853 | - if($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
| 1853 | + if ($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
| 1854 | 1854 | { |
| 1855 | 1855 | $this->destroySessionInfo(); |
| 1856 | 1856 | return; |
| 1857 | 1857 | } |
| 1858 | 1858 | } |
| 1859 | 1859 | // Stop using the session id is destroyed |
| 1860 | - if($this->memberInfo->denied=='Y') |
|
| 1860 | + if ($this->memberInfo->denied == 'Y') |
|
| 1861 | 1861 | { |
| 1862 | 1862 | $this->destroySessionInfo(); |
| 1863 | 1863 | return; |
@@ -1887,10 +1887,10 @@ discard block |
||
| 1887 | 1887 | Context::set('logged_info', $this->memberInfo); |
| 1888 | 1888 | |
| 1889 | 1889 | // Only the menu configuration of the user (such as an add-on to the menu can be changed) |
| 1890 | - $this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info'); |
|
| 1891 | - $this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
| 1892 | - $this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
| 1893 | - $this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document'); |
|
| 1890 | + $this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info'); |
|
| 1891 | + $this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
| 1892 | + $this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
| 1893 | + $this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document'); |
|
| 1894 | 1894 | } |
| 1895 | 1895 | |
| 1896 | 1896 | /** |
@@ -1912,7 +1912,7 @@ discard block |
||
| 1912 | 1912 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
| 1913 | 1913 | { |
| 1914 | 1914 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
| 1915 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
| 1915 | + if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
| 1916 | 1916 | |
| 1917 | 1917 | $obj = new stdClass; |
| 1918 | 1918 | $obj->url = $url; |
@@ -1931,33 +1931,33 @@ discard block |
||
| 1931 | 1931 | { |
| 1932 | 1932 | // Call a trigger (before) |
| 1933 | 1933 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
| 1934 | - if(!$output->toBool()) return $output; |
|
| 1934 | + if (!$output->toBool()) return $output; |
|
| 1935 | 1935 | // Terms and Conditions portion of the information set up by members reaffirmed |
| 1936 | 1936 | $oModuleModel = getModel('module'); |
| 1937 | 1937 | $config = $oModuleModel->getModuleConfig('member'); |
| 1938 | 1938 | |
| 1939 | 1939 | $logged_info = Context::get('logged_info'); |
| 1940 | 1940 | // If the date of the temporary restrictions limit further information on the date of |
| 1941 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
| 1941 | + if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24); |
|
| 1942 | 1942 | |
| 1943 | 1943 | $args->member_srl = getNextSequence(); |
| 1944 | 1944 | $args->list_order = -1 * $args->member_srl; |
| 1945 | 1945 | |
| 1946 | 1946 | // Execute insert or update depending on the value of member_srl |
| 1947 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 1947 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 1948 | 1948 | // Enter the user's identity changed to lowercase |
| 1949 | 1949 | else $args->user_id = strtolower($args->user_id); |
| 1950 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 1951 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
| 1950 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
| 1951 | + if (!$args->nick_name) $args->nick_name = $args->member_srl; |
|
| 1952 | 1952 | |
| 1953 | 1953 | // Control of essential parameters |
| 1954 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 1955 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 1956 | - if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y'; |
|
| 1954 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
| 1955 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
| 1956 | + if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y'; |
|
| 1957 | 1957 | |
| 1958 | - if($logged_info->is_admin == 'Y') |
|
| 1958 | + if ($logged_info->is_admin == 'Y') |
|
| 1959 | 1959 | { |
| 1960 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
| 1960 | + if ($args->is_admin != 'Y') $args->is_admin = 'N'; |
|
| 1961 | 1961 | } |
| 1962 | 1962 | else |
| 1963 | 1963 | { |
@@ -1972,88 +1972,88 @@ discard block |
||
| 1972 | 1972 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 1973 | 1973 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 1974 | 1974 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 1975 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 1976 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 1975 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 1976 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 1977 | 1977 | |
| 1978 | 1978 | // Create a model object |
| 1979 | 1979 | $oMemberModel = getModel('member'); |
| 1980 | 1980 | |
| 1981 | 1981 | // Check password strength |
| 1982 | - if($args->password && !$password_is_hashed) |
|
| 1982 | + if ($args->password && !$password_is_hashed) |
|
| 1983 | 1983 | { |
| 1984 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 1984 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 1985 | 1985 | { |
| 1986 | 1986 | $message = Context::getLang('about_password_strength'); |
| 1987 | 1987 | return new Object(-1, $message[$config->password_strength]); |
| 1988 | 1988 | } |
| 1989 | 1989 | $args->password = $oMemberModel->hashPassword($args->password); |
| 1990 | 1990 | } |
| 1991 | - elseif(!$args->password) |
|
| 1991 | + elseif (!$args->password) |
|
| 1992 | 1992 | { |
| 1993 | 1993 | unset($args->password); |
| 1994 | 1994 | } |
| 1995 | 1995 | |
| 1996 | 1996 | // Check if ID is prohibited |
| 1997 | - if($oMemberModel->isDeniedID($args->user_id)) |
|
| 1997 | + if ($oMemberModel->isDeniedID($args->user_id)) |
|
| 1998 | 1998 | { |
| 1999 | - return new Object(-1,'denied_user_id'); |
|
| 1999 | + return new Object(-1, 'denied_user_id'); |
|
| 2000 | 2000 | } |
| 2001 | 2001 | |
| 2002 | 2002 | // Check if ID is duplicate |
| 2003 | 2003 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2004 | - if($member_srl) |
|
| 2004 | + if ($member_srl) |
|
| 2005 | 2005 | { |
| 2006 | - return new Object(-1,'msg_exists_user_id'); |
|
| 2006 | + return new Object(-1, 'msg_exists_user_id'); |
|
| 2007 | 2007 | } |
| 2008 | 2008 | |
| 2009 | 2009 | // Check if nickname is prohibited |
| 2010 | - if($oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2010 | + if ($oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2011 | 2011 | { |
| 2012 | - return new Object(-1,'denied_nick_name'); |
|
| 2012 | + return new Object(-1, 'denied_nick_name'); |
|
| 2013 | 2013 | } |
| 2014 | 2014 | |
| 2015 | 2015 | // Check if nickname is duplicate |
| 2016 | 2016 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
| 2017 | - if($member_srl) |
|
| 2017 | + if ($member_srl) |
|
| 2018 | 2018 | { |
| 2019 | - return new Object(-1,'msg_exists_nick_name'); |
|
| 2019 | + return new Object(-1, 'msg_exists_nick_name'); |
|
| 2020 | 2020 | } |
| 2021 | 2021 | |
| 2022 | 2022 | // Check if email address is duplicate |
| 2023 | 2023 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
| 2024 | - if($member_srl) |
|
| 2024 | + if ($member_srl) |
|
| 2025 | 2025 | { |
| 2026 | - return new Object(-1,'msg_exists_email_address'); |
|
| 2026 | + return new Object(-1, 'msg_exists_email_address'); |
|
| 2027 | 2027 | } |
| 2028 | 2028 | |
| 2029 | 2029 | // Insert data into the DB |
| 2030 | 2030 | $args->list_order = -1 * $args->member_srl; |
| 2031 | 2031 | |
| 2032 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2033 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2032 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2033 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2034 | 2034 | |
| 2035 | 2035 | $oDB = &DB::getInstance(); |
| 2036 | 2036 | $oDB->begin(); |
| 2037 | 2037 | |
| 2038 | 2038 | $output = executeQuery('member.insertMember', $args); |
| 2039 | - if(!$output->toBool()) |
|
| 2039 | + if (!$output->toBool()) |
|
| 2040 | 2040 | { |
| 2041 | 2041 | $oDB->rollback(); |
| 2042 | 2042 | return $output; |
| 2043 | 2043 | } |
| 2044 | 2044 | |
| 2045 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2045 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2046 | 2046 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
| 2047 | 2047 | // If no value is entered the default group, the value of group registration |
| 2048 | - if(!$args->group_srl_list) |
|
| 2048 | + if (!$args->group_srl_list) |
|
| 2049 | 2049 | { |
| 2050 | 2050 | $columnList = array('site_srl', 'group_srl'); |
| 2051 | 2051 | $default_group = $oMemberModel->getDefaultGroup(0, $columnList); |
| 2052 | - if($default_group) |
|
| 2052 | + if ($default_group) |
|
| 2053 | 2053 | { |
| 2054 | 2054 | // Add to the default group |
| 2055 | - $output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl); |
|
| 2056 | - if(!$output->toBool()) |
|
| 2055 | + $output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl); |
|
| 2056 | + if (!$output->toBool()) |
|
| 2057 | 2057 | { |
| 2058 | 2058 | $oDB->rollback(); |
| 2059 | 2059 | return $output; |
@@ -2063,11 +2063,11 @@ discard block |
||
| 2063 | 2063 | } |
| 2064 | 2064 | else |
| 2065 | 2065 | { |
| 2066 | - for($i=0;$i<count($group_srl_list);$i++) |
|
| 2066 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
| 2067 | 2067 | { |
| 2068 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
| 2068 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
| 2069 | 2069 | |
| 2070 | - if(!$output->toBool()) |
|
| 2070 | + if (!$output->toBool()) |
|
| 2071 | 2071 | { |
| 2072 | 2072 | $oDB->rollback(); |
| 2073 | 2073 | return $output; |
@@ -2077,7 +2077,7 @@ discard block |
||
| 2077 | 2077 | |
| 2078 | 2078 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 2079 | 2079 | // When using email authentication mode (when you subscribed members denied a) certified mail sent |
| 2080 | - if($args->denied == 'Y') |
|
| 2080 | + if ($args->denied == 'Y') |
|
| 2081 | 2081 | { |
| 2082 | 2082 | // Insert data into the authentication DB |
| 2083 | 2083 | $oPassword = new Password(); |
@@ -2089,7 +2089,7 @@ discard block |
||
| 2089 | 2089 | $auth_args->is_register = 'Y'; |
| 2090 | 2090 | |
| 2091 | 2091 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 2092 | - if(!$output->toBool()) |
|
| 2092 | + if (!$output->toBool()) |
|
| 2093 | 2093 | { |
| 2094 | 2094 | $oDB->rollback(); |
| 2095 | 2095 | return $output; |
@@ -2097,10 +2097,10 @@ discard block |
||
| 2097 | 2097 | $this->_sendAuthMail($auth_args, $args); |
| 2098 | 2098 | } |
| 2099 | 2099 | // Call a trigger (after) |
| 2100 | - if($output->toBool()) |
|
| 2100 | + if ($output->toBool()) |
|
| 2101 | 2101 | { |
| 2102 | 2102 | $trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args); |
| 2103 | - if(!$trigger_output->toBool()) |
|
| 2103 | + if (!$trigger_output->toBool()) |
|
| 2104 | 2104 | { |
| 2105 | 2105 | $oDB->rollback(); |
| 2106 | 2106 | return $trigger_output; |
@@ -2122,41 +2122,41 @@ discard block |
||
| 2122 | 2122 | { |
| 2123 | 2123 | // Call a trigger (before) |
| 2124 | 2124 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
| 2125 | - if(!$output->toBool()) return $output; |
|
| 2125 | + if (!$output->toBool()) return $output; |
|
| 2126 | 2126 | // Create a model object |
| 2127 | 2127 | $oMemberModel = getModel('member'); |
| 2128 | 2128 | |
| 2129 | 2129 | $logged_info = Context::get('logged_info'); |
| 2130 | 2130 | // Get what you want to modify the original information |
| 2131 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2131 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2132 | 2132 | // Control of essential parameters |
| 2133 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 2134 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
| 2133 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
| 2134 | + if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y'; |
|
| 2135 | 2135 | |
| 2136 | - if($logged_info->is_admin == 'Y') |
|
| 2136 | + if ($logged_info->is_admin == 'Y') |
|
| 2137 | 2137 | { |
| 2138 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 2139 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
| 2138 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
| 2139 | + if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
| 2140 | 2140 | } |
| 2141 | 2141 | else |
| 2142 | 2142 | { |
| 2143 | 2143 | unset($args->is_admin); |
| 2144 | - if($is_admin == false) |
|
| 2144 | + if ($is_admin == false) |
|
| 2145 | 2145 | unset($args->denied); |
| 2146 | - if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
| 2146 | + if ($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
| 2147 | 2147 | { |
| 2148 | 2148 | return $this->stop('msg_invalid_request'); |
| 2149 | 2149 | } |
| 2150 | 2150 | } |
| 2151 | 2151 | |
| 2152 | 2152 | // Sanitize user ID, username, nickname, homepage, blog |
| 2153 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2153 | + if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2154 | 2154 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2155 | 2155 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2156 | 2156 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2157 | 2157 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2158 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2159 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2158 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2159 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2160 | 2160 | |
| 2161 | 2161 | // check member identifier form |
| 2162 | 2162 | $config = $oMemberModel->getMemberConfig(); |
@@ -2165,56 +2165,56 @@ discard block |
||
| 2165 | 2165 | $orgMemberInfo = $output->data; |
| 2166 | 2166 | |
| 2167 | 2167 | // Check if email address or user ID is duplicate |
| 2168 | - if($config->identifier == 'email_address') |
|
| 2168 | + if ($config->identifier == 'email_address') |
|
| 2169 | 2169 | { |
| 2170 | 2170 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
| 2171 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2171 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2172 | 2172 | { |
| 2173 | - return new Object(-1,'msg_exists_email_address'); |
|
| 2173 | + return new Object(-1, 'msg_exists_email_address'); |
|
| 2174 | 2174 | } |
| 2175 | 2175 | $args->email_address = $orgMemberInfo->email_address; |
| 2176 | 2176 | } |
| 2177 | 2177 | else |
| 2178 | 2178 | { |
| 2179 | 2179 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2180 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2180 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2181 | 2181 | { |
| 2182 | - return new Object(-1,'msg_exists_user_id'); |
|
| 2182 | + return new Object(-1, 'msg_exists_user_id'); |
|
| 2183 | 2183 | } |
| 2184 | 2184 | |
| 2185 | 2185 | $args->user_id = $orgMemberInfo->user_id; |
| 2186 | 2186 | } |
| 2187 | 2187 | |
| 2188 | - if($logged_info->is_admin !== 'Y') |
|
| 2188 | + if ($logged_info->is_admin !== 'Y') |
|
| 2189 | 2189 | { |
| 2190 | 2190 | // Check if ID is prohibited |
| 2191 | - if($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
| 2191 | + if ($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
| 2192 | 2192 | { |
| 2193 | - return new Object(-1,'denied_user_id'); |
|
| 2193 | + return new Object(-1, 'denied_user_id'); |
|
| 2194 | 2194 | } |
| 2195 | 2195 | |
| 2196 | 2196 | // Check if nickname is prohibited |
| 2197 | - if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2197 | + if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
| 2198 | 2198 | { |
| 2199 | 2199 | return new Object(-1, 'denied_nick_name'); |
| 2200 | 2200 | } |
| 2201 | 2201 | } |
| 2202 | 2202 | |
| 2203 | 2203 | // Check if ID is duplicate |
| 2204 | - if($args->user_id) |
|
| 2204 | + if ($args->user_id) |
|
| 2205 | 2205 | { |
| 2206 | 2206 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2207 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2207 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2208 | 2208 | { |
| 2209 | - return new Object(-1,'msg_exists_user_id'); |
|
| 2209 | + return new Object(-1, 'msg_exists_user_id'); |
|
| 2210 | 2210 | } |
| 2211 | 2211 | } |
| 2212 | 2212 | |
| 2213 | 2213 | // Check if nickname is duplicate |
| 2214 | 2214 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
| 2215 | - if($member_srl && $args->member_srl != $member_srl) |
|
| 2215 | + if ($member_srl && $args->member_srl != $member_srl) |
|
| 2216 | 2216 | { |
| 2217 | - return new Object(-1,'msg_exists_nick_name'); |
|
| 2217 | + return new Object(-1, 'msg_exists_nick_name'); |
|
| 2218 | 2218 | } |
| 2219 | 2219 | |
| 2220 | 2220 | list($args->email_id, $args->email_host) = explode('@', $args->email_address); |
@@ -2223,9 +2223,9 @@ discard block |
||
| 2223 | 2223 | $oDB->begin(); |
| 2224 | 2224 | |
| 2225 | 2225 | // Check password strength |
| 2226 | - if($args->password) |
|
| 2226 | + if ($args->password) |
|
| 2227 | 2227 | { |
| 2228 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2228 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2229 | 2229 | { |
| 2230 | 2230 | $message = Context::getLang('about_password_strength'); |
| 2231 | 2231 | return new Object(-1, $message[$config->password_strength]); |
@@ -2237,40 +2237,40 @@ discard block |
||
| 2237 | 2237 | $args->password = $orgMemberInfo->password; |
| 2238 | 2238 | } |
| 2239 | 2239 | |
| 2240 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
| 2241 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
| 2242 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2243 | - if(!$args->description) $args->description = $orgMemberInfo->description; |
|
| 2244 | - if(!$args->birthday) $args->birthday = ''; |
|
| 2240 | + if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
| 2241 | + if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
| 2242 | + if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2243 | + if (!$args->description) $args->description = $orgMemberInfo->description; |
|
| 2244 | + if (!$args->birthday) $args->birthday = ''; |
|
| 2245 | 2245 | |
| 2246 | 2246 | $output = executeQuery('member.updateMember', $args); |
| 2247 | 2247 | |
| 2248 | - if(!$output->toBool()) |
|
| 2248 | + if (!$output->toBool()) |
|
| 2249 | 2249 | { |
| 2250 | 2250 | $oDB->rollback(); |
| 2251 | 2251 | return $output; |
| 2252 | 2252 | } |
| 2253 | 2253 | |
| 2254 | - if($args->group_srl_list) |
|
| 2254 | + if ($args->group_srl_list) |
|
| 2255 | 2255 | { |
| 2256 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2256 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2257 | 2257 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
| 2258 | 2258 | // If the group information, group information changes |
| 2259 | - if(count($group_srl_list) > 0) |
|
| 2259 | + if (count($group_srl_list) > 0) |
|
| 2260 | 2260 | { |
| 2261 | 2261 | $args->site_srl = 0; |
| 2262 | 2262 | // One of its members to delete all the group |
| 2263 | 2263 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
| 2264 | - if(!$output->toBool()) |
|
| 2264 | + if (!$output->toBool()) |
|
| 2265 | 2265 | { |
| 2266 | 2266 | $oDB->rollback(); |
| 2267 | 2267 | return $output; |
| 2268 | 2268 | } |
| 2269 | 2269 | // Enter one of the loop a |
| 2270 | - for($i=0;$i<count($group_srl_list);$i++) |
|
| 2270 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
| 2271 | 2271 | { |
| 2272 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
| 2273 | - if(!$output->toBool()) |
|
| 2272 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
| 2273 | + if (!$output->toBool()) |
|
| 2274 | 2274 | { |
| 2275 | 2275 | $oDB->rollback(); |
| 2276 | 2276 | return $output; |
@@ -2282,9 +2282,9 @@ discard block |
||
| 2282 | 2282 | } |
| 2283 | 2283 | } |
| 2284 | 2284 | // Call a trigger (after) |
| 2285 | - if($output->toBool()) { |
|
| 2285 | + if ($output->toBool()) { |
|
| 2286 | 2286 | $trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args); |
| 2287 | - if(!$trigger_output->toBool()) |
|
| 2287 | + if (!$trigger_output->toBool()) |
|
| 2288 | 2288 | { |
| 2289 | 2289 | $oDB->rollback(); |
| 2290 | 2290 | return $trigger_output; |
@@ -2297,7 +2297,7 @@ discard block |
||
| 2297 | 2297 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
| 2298 | 2298 | |
| 2299 | 2299 | // Save Session |
| 2300 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2300 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2301 | 2301 | $logged_info = Context::get('logged_info'); |
| 2302 | 2302 | |
| 2303 | 2303 | $output->add('member_srl', $args->member_srl); |
@@ -2309,14 +2309,14 @@ discard block |
||
| 2309 | 2309 | */ |
| 2310 | 2310 | function updateMemberPassword($args) |
| 2311 | 2311 | { |
| 2312 | - if($args->password) |
|
| 2312 | + if ($args->password) |
|
| 2313 | 2313 | { |
| 2314 | 2314 | |
| 2315 | 2315 | // check password strength |
| 2316 | 2316 | $oMemberModel = getModel('member'); |
| 2317 | 2317 | $config = $oMemberModel->getMemberConfig(); |
| 2318 | 2318 | |
| 2319 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2319 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
| 2320 | 2320 | { |
| 2321 | 2321 | $message = Context::getLang('about_password_strength'); |
| 2322 | 2322 | return new Object(-1, $message[$config->password_strength]); |
@@ -2324,13 +2324,13 @@ discard block |
||
| 2324 | 2324 | |
| 2325 | 2325 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2326 | 2326 | } |
| 2327 | - else if($args->hashed_password) |
|
| 2327 | + else if ($args->hashed_password) |
|
| 2328 | 2328 | { |
| 2329 | 2329 | $args->password = $args->hashed_password; |
| 2330 | 2330 | } |
| 2331 | 2331 | |
| 2332 | 2332 | $output = executeQuery('member.updateMemberPassword', $args); |
| 2333 | - if($output->toBool()) |
|
| 2333 | + if ($output->toBool()) |
|
| 2334 | 2334 | { |
| 2335 | 2335 | $result = executeQuery('member.updateChangePasswordDate', $args); |
| 2336 | 2336 | } |
@@ -2349,18 +2349,18 @@ discard block |
||
| 2349 | 2349 | $trigger_obj = new stdClass(); |
| 2350 | 2350 | $trigger_obj->member_srl = $member_srl; |
| 2351 | 2351 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
| 2352 | - if(!$output->toBool()) return $output; |
|
| 2352 | + if (!$output->toBool()) return $output; |
|
| 2353 | 2353 | // Create a model object |
| 2354 | 2354 | $oMemberModel = getModel('member'); |
| 2355 | 2355 | // Bringing the user's information |
| 2356 | - if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
| 2356 | + if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
| 2357 | 2357 | { |
| 2358 | 2358 | $columnList = array('member_srl', 'is_admin'); |
| 2359 | 2359 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 2360 | 2360 | } |
| 2361 | - if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member'); |
|
| 2361 | + if (!$this->memberInfo) return new Object(-1, 'msg_not_exists_member'); |
|
| 2362 | 2362 | // If managers can not be deleted |
| 2363 | - if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin'); |
|
| 2363 | + if ($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin'); |
|
| 2364 | 2364 | |
| 2365 | 2365 | $oDB = &DB::getInstance(); |
| 2366 | 2366 | $oDB->begin(); |
@@ -2369,7 +2369,7 @@ discard block |
||
| 2369 | 2369 | $args->member_srl = $member_srl; |
| 2370 | 2370 | // Delete the entries in member_auth_mail |
| 2371 | 2371 | $output = executeQuery('member.deleteAuthMail', $args); |
| 2372 | - if(!$output->toBool()) |
|
| 2372 | + if (!$output->toBool()) |
|
| 2373 | 2373 | { |
| 2374 | 2374 | $oDB->rollback(); |
| 2375 | 2375 | return $output; |
@@ -2384,23 +2384,23 @@ discard block |
||
| 2384 | 2384 | */ |
| 2385 | 2385 | // Delete the entries in member_group_member |
| 2386 | 2386 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
| 2387 | - if(!$output->toBool()) |
|
| 2387 | + if (!$output->toBool()) |
|
| 2388 | 2388 | { |
| 2389 | 2389 | $oDB->rollback(); |
| 2390 | 2390 | return $output; |
| 2391 | 2391 | } |
| 2392 | 2392 | // member removed from the table |
| 2393 | 2393 | $output = executeQuery('member.deleteMember', $args); |
| 2394 | - if(!$output->toBool()) |
|
| 2394 | + if (!$output->toBool()) |
|
| 2395 | 2395 | { |
| 2396 | 2396 | $oDB->rollback(); |
| 2397 | 2397 | return $output; |
| 2398 | 2398 | } |
| 2399 | 2399 | // Call a trigger (after) |
| 2400 | - if($output->toBool()) |
|
| 2400 | + if ($output->toBool()) |
|
| 2401 | 2401 | { |
| 2402 | 2402 | $trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj); |
| 2403 | - if(!$trigger_output->toBool()) |
|
| 2403 | + if (!$trigger_output->toBool()) |
|
| 2404 | 2404 | { |
| 2405 | 2405 | $oDB->rollback(); |
| 2406 | 2406 | return $trigger_output; |
@@ -2424,23 +2424,23 @@ discard block |
||
| 2424 | 2424 | */ |
| 2425 | 2425 | function destroySessionInfo() |
| 2426 | 2426 | { |
| 2427 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
| 2427 | + if (!$_SESSION || !is_array($_SESSION)) return; |
|
| 2428 | 2428 | |
| 2429 | 2429 | $memberInfo = Context::get('logged_info'); |
| 2430 | 2430 | $memberSrl = $memberInfo->member_srl; |
| 2431 | 2431 | |
| 2432 | - foreach($_SESSION as $key => $val) |
|
| 2432 | + foreach ($_SESSION as $key => $val) |
|
| 2433 | 2433 | { |
| 2434 | 2434 | $_SESSION[$key] = ''; |
| 2435 | 2435 | } |
| 2436 | 2436 | |
| 2437 | 2437 | session_destroy(); |
| 2438 | - setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000); |
|
| 2439 | - setcookie('sso','',$_SERVER['REQUEST_TIME']-42000); |
|
| 2440 | - setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000); |
|
| 2438 | + setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000); |
|
| 2439 | + setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000); |
|
| 2440 | + setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000); |
|
| 2441 | 2441 | setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000); |
| 2442 | 2442 | |
| 2443 | - if($memberSrl || $_COOKIE['xeak']) |
|
| 2443 | + if ($memberSrl || $_COOKIE['xeak']) |
|
| 2444 | 2444 | { |
| 2445 | 2445 | $args = new stdClass(); |
| 2446 | 2446 | $args->member_srl = $memberSrl; |
@@ -2456,22 +2456,22 @@ discard block |
||
| 2456 | 2456 | $pointGroup = $pointModuleConfig->point_group; |
| 2457 | 2457 | |
| 2458 | 2458 | $levelGroup = array(); |
| 2459 | - if(is_array($pointGroup) && count($pointGroup)>0) |
|
| 2459 | + if (is_array($pointGroup) && count($pointGroup) > 0) |
|
| 2460 | 2460 | { |
| 2461 | 2461 | $levelGroup = array_flip($pointGroup); |
| 2462 | 2462 | ksort($levelGroup); |
| 2463 | 2463 | } |
| 2464 | 2464 | $maxLevel = 0; |
| 2465 | 2465 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
| 2466 | - if(count($resultGroup) > 0) |
|
| 2466 | + if (count($resultGroup) > 0) |
|
| 2467 | 2467 | $maxLevel = max(array_flip($resultGroup)); |
| 2468 | 2468 | |
| 2469 | - if($maxLevel > 0) |
|
| 2469 | + if ($maxLevel > 0) |
|
| 2470 | 2470 | { |
| 2471 | 2471 | $oPointModel = getModel('point'); |
| 2472 | 2472 | $originPoint = $oPointModel->getPoint($memberSrl); |
| 2473 | 2473 | |
| 2474 | - if($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
| 2474 | + if ($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
| 2475 | 2475 | { |
| 2476 | 2476 | $oPointController = getController('point'); |
| 2477 | 2477 | $oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update'); |
@@ -2481,18 +2481,18 @@ discard block |
||
| 2481 | 2481 | |
| 2482 | 2482 | function procMemberModifyEmailAddress() |
| 2483 | 2483 | { |
| 2484 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 2484 | + if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 2485 | 2485 | |
| 2486 | 2486 | $member_info = Context::get('logged_info'); |
| 2487 | 2487 | $newEmail = Context::get('email_address'); |
| 2488 | 2488 | |
| 2489 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
| 2489 | + if (!$newEmail) return $this->stop('msg_invalid_request'); |
|
| 2490 | 2490 | |
| 2491 | 2491 | $oMemberModel = getModel('member'); |
| 2492 | 2492 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
| 2493 | - if($member_srl) return new Object(-1,'msg_exists_email_address'); |
|
| 2493 | + if ($member_srl) return new Object(-1, 'msg_exists_email_address'); |
|
| 2494 | 2494 | |
| 2495 | - if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
| 2495 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
| 2496 | 2496 | { |
| 2497 | 2497 | return $this->stop('msg_invalid_request'); |
| 2498 | 2498 | } |
@@ -2508,7 +2508,7 @@ discard block |
||
| 2508 | 2508 | $oDB = &DB::getInstance(); |
| 2509 | 2509 | $oDB->begin(); |
| 2510 | 2510 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 2511 | - if(!$output->toBool()) |
|
| 2511 | + if (!$output->toBool()) |
|
| 2512 | 2512 | { |
| 2513 | 2513 | $oDB->rollback(); |
| 2514 | 2514 | return $output; |
@@ -2518,7 +2518,7 @@ discard block |
||
| 2518 | 2518 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 2519 | 2519 | |
| 2520 | 2520 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 2521 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 2521 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 2522 | 2522 | |
| 2523 | 2523 | global $lang; |
| 2524 | 2524 | |
@@ -2530,17 +2530,17 @@ discard block |
||
| 2530 | 2530 | |
| 2531 | 2531 | Context::set('newEmail', $newEmail); |
| 2532 | 2532 | |
| 2533 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
|
| 2533 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key); |
|
| 2534 | 2534 | Context::set('auth_url', $auth_url); |
| 2535 | 2535 | |
| 2536 | 2536 | $oTemplate = &TemplateHandler::getInstance(); |
| 2537 | 2537 | $content = $oTemplate->compile($tpl_path, 'confirm_member_new_email'); |
| 2538 | 2538 | |
| 2539 | 2539 | $oMail = new Mail(); |
| 2540 | - $oMail->setTitle( Context::getLang('title_modify_email_address') ); |
|
| 2540 | + $oMail->setTitle(Context::getLang('title_modify_email_address')); |
|
| 2541 | 2541 | $oMail->setContent($content); |
| 2542 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
| 2543 | - $oMail->setReceiptor( $member_info->nick_name, $newEmail ); |
|
| 2542 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
| 2543 | + $oMail->setReceiptor($member_info->nick_name, $newEmail); |
|
| 2544 | 2544 | $result = $oMail->send(); |
| 2545 | 2545 | |
| 2546 | 2546 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail); |
@@ -2554,16 +2554,16 @@ discard block |
||
| 2554 | 2554 | { |
| 2555 | 2555 | $member_srl = Context::get('member_srl'); |
| 2556 | 2556 | $auth_key = Context::get('auth_key'); |
| 2557 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
| 2557 | + if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
| 2558 | 2558 | |
| 2559 | 2559 | // Test logs for finding password by user_id and authkey |
| 2560 | 2560 | $args = new stdClass; |
| 2561 | 2561 | $args->member_srl = $member_srl; |
| 2562 | 2562 | $args->auth_key = $auth_key; |
| 2563 | 2563 | $output = executeQuery('member.getAuthMail', $args); |
| 2564 | - if(!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 2564 | + if (!$output->toBool() || $output->data->auth_key != $auth_key) |
|
| 2565 | 2565 | { |
| 2566 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 2566 | + if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 2567 | 2567 | return $this->stop('msg_invalid_modify_email_auth_key'); |
| 2568 | 2568 | } |
| 2569 | 2569 | |
@@ -2572,10 +2572,10 @@ discard block |
||
| 2572 | 2572 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
| 2573 | 2573 | |
| 2574 | 2574 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
| 2575 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
| 2575 | + if (!$output->toBool()) return $this->stop($output->getMessage()); |
|
| 2576 | 2576 | |
| 2577 | 2577 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
| 2578 | - executeQuery('member.deleteAuthChangeEmailAddress',$args); |
|
| 2578 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 2579 | 2579 | |
| 2580 | 2580 | $this->_clearMemberCache($args->member_srl); |
| 2581 | 2581 | |
@@ -2593,7 +2593,7 @@ discard block |
||
| 2593 | 2593 | **/ |
| 2594 | 2594 | function triggerGetDocumentMenu(&$menu_list) |
| 2595 | 2595 | { |
| 2596 | - if(!Context::get('is_logged')) return new Object(); |
|
| 2596 | + if (!Context::get('is_logged')) return new Object(); |
|
| 2597 | 2597 | |
| 2598 | 2598 | $logged_info = Context::get('logged_info'); |
| 2599 | 2599 | $document_srl = Context::get('target_srl'); |
@@ -2604,12 +2604,12 @@ discard block |
||
| 2604 | 2604 | $member_srl = $oDocument->get('member_srl'); |
| 2605 | 2605 | $module_srl = $oDocument->get('module_srl'); |
| 2606 | 2606 | |
| 2607 | - if(!$member_srl) return new Object(); |
|
| 2608 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object(); |
|
| 2607 | + if (!$member_srl) return new Object(); |
|
| 2608 | + if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object(); |
|
| 2609 | 2609 | |
| 2610 | 2610 | $oDocumentController = getController('document'); |
| 2611 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
| 2612 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup'); |
|
| 2611 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
| 2612 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
| 2613 | 2613 | |
| 2614 | 2614 | return new Object(); |
| 2615 | 2615 | } |
@@ -2623,7 +2623,7 @@ discard block |
||
| 2623 | 2623 | **/ |
| 2624 | 2624 | function triggerGetCommentMenu(&$menu_list) |
| 2625 | 2625 | { |
| 2626 | - if(!Context::get('is_logged')) return new Object(); |
|
| 2626 | + if (!Context::get('is_logged')) return new Object(); |
|
| 2627 | 2627 | |
| 2628 | 2628 | $logged_info = Context::get('logged_info'); |
| 2629 | 2629 | $comment_srl = Context::get('target_srl'); |
@@ -2634,12 +2634,12 @@ discard block |
||
| 2634 | 2634 | $module_srl = $oComment->get('module_srl'); |
| 2635 | 2635 | $member_srl = $oComment->get('member_srl'); |
| 2636 | 2636 | |
| 2637 | - if(!$member_srl) return new Object(); |
|
| 2638 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object(); |
|
| 2637 | + if (!$member_srl) return new Object(); |
|
| 2638 | + if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object(); |
|
| 2639 | 2639 | |
| 2640 | 2640 | $oCommentController = getController('comment'); |
| 2641 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
| 2642 | - $oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup'); |
|
| 2641 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
| 2642 | + $oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
| 2643 | 2643 | |
| 2644 | 2644 | return new Object(); |
| 2645 | 2645 | } |
@@ -2651,7 +2651,7 @@ discard block |
||
| 2651 | 2651 | **/ |
| 2652 | 2652 | function procMemberSpammerManage() |
| 2653 | 2653 | { |
| 2654 | - if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); |
|
| 2654 | + if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted'); |
|
| 2655 | 2655 | |
| 2656 | 2656 | $logged_info = Context::get('logged_info'); |
| 2657 | 2657 | $member_srl = Context::get('member_srl'); |
@@ -2659,7 +2659,7 @@ discard block |
||
| 2659 | 2659 | $cnt_loop = Context::get('cnt_loop'); |
| 2660 | 2660 | $proc_type = Context::get('proc_type'); |
| 2661 | 2661 | $isMoveToTrash = true; |
| 2662 | - if($proc_type == "delete") |
|
| 2662 | + if ($proc_type == "delete") |
|
| 2663 | 2663 | $isMoveToTrash = false; |
| 2664 | 2664 | |
| 2665 | 2665 | // check grant |
@@ -2668,7 +2668,7 @@ discard block |
||
| 2668 | 2668 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
| 2669 | 2669 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
| 2670 | 2670 | |
| 2671 | - if(!$grant->manager) return new Object(-1,'msg_not_permitted'); |
|
| 2671 | + if (!$grant->manager) return new Object(-1, 'msg_not_permitted'); |
|
| 2672 | 2672 | |
| 2673 | 2673 | $proc_msg = ""; |
| 2674 | 2674 | |
@@ -2677,10 +2677,10 @@ discard block |
||
| 2677 | 2677 | |
| 2678 | 2678 | // delete or trash destination |
| 2679 | 2679 | // proc member |
| 2680 | - if($cnt_loop == 1) |
|
| 2680 | + if ($cnt_loop == 1) |
|
| 2681 | 2681 | $this->_spammerMember($member_srl); |
| 2682 | 2682 | // proc document and comment |
| 2683 | - elseif($cnt_loop>1) |
|
| 2683 | + elseif ($cnt_loop > 1) |
|
| 2684 | 2684 | $this->_spammerDocuments($member_srl, $isMoveToTrash); |
| 2685 | 2685 | |
| 2686 | 2686 | // get destination count |
@@ -2689,11 +2689,11 @@ discard block |
||
| 2689 | 2689 | |
| 2690 | 2690 | $total_count = Context::get('total_count'); |
| 2691 | 2691 | $remain_count = $cnt_document + $cnt_comment; |
| 2692 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
| 2692 | + if ($cnt_loop == 1) $total_count = $remain_count; |
|
| 2693 | 2693 | |
| 2694 | 2694 | // get progress percent |
| 2695 | - if($total_count > 0) |
|
| 2696 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
| 2695 | + if ($total_count > 0) |
|
| 2696 | + $progress = intval((($total_count - $remain_count) / $total_count) * 100); |
|
| 2697 | 2697 | else |
| 2698 | 2698 | $progress = 100; |
| 2699 | 2699 | |
@@ -2717,7 +2717,7 @@ discard block |
||
| 2717 | 2717 | **/ |
| 2718 | 2718 | private function _spammerMember($member_srl) { |
| 2719 | 2719 | $logged_info = Context::get('logged_info'); |
| 2720 | - $spam_description = trim( Context::get('spam_description') ); |
|
| 2720 | + $spam_description = trim(Context::get('spam_description')); |
|
| 2721 | 2721 | |
| 2722 | 2722 | $oMemberModel = getModel('member'); |
| 2723 | 2723 | $columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description'); |
@@ -2736,10 +2736,10 @@ discard block |
||
| 2736 | 2736 | $args->user_id = $member_info->user_id; |
| 2737 | 2737 | $args->nick_name = $member_info->nick_name; |
| 2738 | 2738 | $args->denied = "Y"; |
| 2739 | - $args->description = trim( $member_info->description ); |
|
| 2740 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
| 2739 | + $args->description = trim($member_info->description); |
|
| 2740 | + if ($args->description != "") $args->description .= "\n"; // add new line |
|
| 2741 | 2741 | |
| 2742 | - $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 . "]"; |
|
| 2742 | + $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."]"; |
|
| 2743 | 2743 | |
| 2744 | 2744 | $output = $this->updateMember($args, true); |
| 2745 | 2745 | |
@@ -2768,21 +2768,21 @@ discard block |
||
| 2768 | 2768 | // 1. proc comment, 2. proc document |
| 2769 | 2769 | $cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl); |
| 2770 | 2770 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
| 2771 | - if($cnt_comment > 0) |
|
| 2771 | + if ($cnt_comment > 0) |
|
| 2772 | 2772 | { |
| 2773 | 2773 | $columnList = array(); |
| 2774 | 2774 | $commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
| 2775 | - if($commentList) { |
|
| 2776 | - foreach($commentList as $v) { |
|
| 2775 | + if ($commentList) { |
|
| 2776 | + foreach ($commentList as $v) { |
|
| 2777 | 2777 | $oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash); |
| 2778 | 2778 | } |
| 2779 | 2779 | } |
| 2780 | - } elseif($cnt_document > 0) { |
|
| 2780 | + } elseif ($cnt_document > 0) { |
|
| 2781 | 2781 | $columnList = array(); |
| 2782 | 2782 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
| 2783 | - if($documentList) { |
|
| 2784 | - foreach($documentList as $v) { |
|
| 2785 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
| 2783 | + if ($documentList) { |
|
| 2784 | + foreach ($documentList as $v) { |
|
| 2785 | + if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
| 2786 | 2786 | else $oDocumentController->deleteDocument($v->document_srl); |
| 2787 | 2787 | } |
| 2788 | 2788 | } |
@@ -2794,24 +2794,24 @@ discard block |
||
| 2794 | 2794 | function _clearMemberCache($member_srl, $site_srl = 0) |
| 2795 | 2795 | { |
| 2796 | 2796 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
| 2797 | - if($oCacheHandler->isSupport()) |
|
| 2797 | + if ($oCacheHandler->isSupport()) |
|
| 2798 | 2798 | { |
| 2799 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl; |
|
| 2799 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl; |
|
| 2800 | 2800 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 2801 | 2801 | $oCacheHandler->delete($cache_key); |
| 2802 | 2802 | |
| 2803 | - if($site_srl !== 0) |
|
| 2803 | + if ($site_srl !== 0) |
|
| 2804 | 2804 | { |
| 2805 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0'; |
|
| 2805 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0'; |
|
| 2806 | 2806 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 2807 | 2807 | $oCacheHandler->delete($cache_key); |
| 2808 | 2808 | } |
| 2809 | 2809 | } |
| 2810 | 2810 | |
| 2811 | 2811 | $oCacheHandler = CacheHandler::getInstance('object'); |
| 2812 | - if($oCacheHandler->isSupport()) |
|
| 2812 | + if ($oCacheHandler->isSupport()) |
|
| 2813 | 2813 | { |
| 2814 | - $object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl; |
|
| 2814 | + $object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl; |
|
| 2815 | 2815 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
| 2816 | 2816 | $oCacheHandler->delete($cache_key); |
| 2817 | 2817 | } |
@@ -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 Object(-1,'null_user_id'); |
|
| 53 | - if(!$password) return new Object(-1,'null_password'); |
|
| 58 | + if(!$user_id) { |
|
| 59 | + return new Object(-1,'null_user_id'); |
|
| 60 | + } |
|
| 61 | + if(!$password) { |
|
| 62 | + return new Object(-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 Object(); |
| 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 Object(-1, 'msg_not_logged'); |
|
| 146 | + if(!Context::get('is_logged')) { |
|
| 147 | + return new Object(-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 Object(-1,'msg_invalid_request'); |
|
| 152 | + if(!$document_srl) { |
|
| 153 | + $document_srl = (int)Context::get('target_srl'); |
|
| 154 | + } |
|
| 155 | + if(!$document_srl) { |
|
| 156 | + return new Object(-1,'msg_invalid_request'); |
|
| 157 | + } |
|
| 136 | 158 | |
| 137 | 159 | // Get document |
| 138 | 160 | $oDocumentModel = getModel('document'); |
@@ -162,11 +184,15 @@ discard block |
||
| 162 | 184 | |
| 163 | 185 | // Check if already scrapped |
| 164 | 186 | $output = executeQuery('member.getScrapDocument', $args); |
| 165 | - if($output->data->count) return new Object(-1, 'msg_alreay_scrapped'); |
|
| 187 | + if($output->data->count) { |
|
| 188 | + return new Object(-1, 'msg_alreay_scrapped'); |
|
| 189 | + } |
|
| 166 | 190 | |
| 167 | 191 | // Insert |
| 168 | 192 | $output = executeQuery('member.addScrapDocument', $args); |
| 169 | - if(!$output->toBool()) return $output; |
|
| 193 | + if(!$output->toBool()) { |
|
| 194 | + return $output; |
|
| 195 | + } |
|
| 170 | 196 | |
| 171 | 197 | $this->setError(-1); |
| 172 | 198 | $this->setMessage('success_registed'); |
@@ -180,11 +206,15 @@ discard block |
||
| 180 | 206 | function procMemberDeleteScrap() |
| 181 | 207 | { |
| 182 | 208 | // Check login information |
| 183 | - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); |
|
| 209 | + if(!Context::get('is_logged')) { |
|
| 210 | + return new Object(-1, 'msg_not_logged'); |
|
| 211 | + } |
|
| 184 | 212 | $logged_info = Context::get('logged_info'); |
| 185 | 213 | |
| 186 | 214 | $document_srl = (int)Context::get('document_srl'); |
| 187 | - if(!$document_srl) return new Object(-1,'msg_invalid_request'); |
|
| 215 | + if(!$document_srl) { |
|
| 216 | + return new Object(-1,'msg_invalid_request'); |
|
| 217 | + } |
|
| 188 | 218 | // Variables |
| 189 | 219 | $args = new stdClass; |
| 190 | 220 | $args->member_srl = $logged_info->member_srl; |
@@ -210,11 +240,15 @@ discard block |
||
| 210 | 240 | function procMemberDeleteSavedDocument() |
| 211 | 241 | { |
| 212 | 242 | // Check login information |
| 213 | - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); |
|
| 243 | + if(!Context::get('is_logged')) { |
|
| 244 | + return new Object(-1, 'msg_not_logged'); |
|
| 245 | + } |
|
| 214 | 246 | $logged_info = Context::get('logged_info'); |
| 215 | 247 | |
| 216 | 248 | $document_srl = (int)Context::get('document_srl'); |
| 217 | - if(!$document_srl) return new Object(-1,'msg_invalid_request'); |
|
| 249 | + if(!$document_srl) { |
|
| 250 | + return new Object(-1,'msg_invalid_request'); |
|
| 251 | + } |
|
| 218 | 252 | |
| 219 | 253 | $oDocumentModel = getModel('document'); |
| 220 | 254 | $oDocument = $oDocumentModel->getDocument($document_srl); |
@@ -242,7 +276,9 @@ discard block |
||
| 242 | 276 | { |
| 243 | 277 | $name = Context::get('name'); |
| 244 | 278 | $value = Context::get('value'); |
| 245 | - if(!$value) return; |
|
| 279 | + if(!$value) { |
|
| 280 | + return; |
|
| 281 | + } |
|
| 246 | 282 | |
| 247 | 283 | $oMemberModel = getModel('member'); |
| 248 | 284 | // Check if logged-in |
@@ -253,10 +289,14 @@ discard block |
||
| 253 | 289 | { |
| 254 | 290 | case 'user_id' : |
| 255 | 291 | // Check denied ID |
| 256 | - if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id'); |
|
| 292 | + if($oMemberModel->isDeniedID($value)) { |
|
| 293 | + return new Object(0,'denied_user_id'); |
|
| 294 | + } |
|
| 257 | 295 | // Check if duplicated |
| 258 | 296 | $member_srl = $oMemberModel->getMemberSrlByUserID($value); |
| 259 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id'); |
|
| 297 | + if($member_srl && $logged_info->member_srl != $member_srl ) { |
|
| 298 | + return new Object(0,'msg_exists_user_id'); |
|
| 299 | + } |
|
| 260 | 300 | break; |
| 261 | 301 | case 'nick_name' : |
| 262 | 302 | // Check denied ID |
@@ -266,13 +306,17 @@ discard block |
||
| 266 | 306 | } |
| 267 | 307 | // Check if duplicated |
| 268 | 308 | $member_srl = $oMemberModel->getMemberSrlByNickName($value); |
| 269 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name'); |
|
| 309 | + if($member_srl && $logged_info->member_srl != $member_srl ) { |
|
| 310 | + return new Object(0,'msg_exists_nick_name'); |
|
| 311 | + } |
|
| 270 | 312 | |
| 271 | 313 | break; |
| 272 | 314 | case 'email_address' : |
| 273 | 315 | // Check if duplicated |
| 274 | 316 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($value); |
| 275 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address'); |
|
| 317 | + if($member_srl && $logged_info->member_srl != $member_srl ) { |
|
| 318 | + return new Object(0,'msg_exists_email_address'); |
|
| 319 | + } |
|
| 276 | 320 | break; |
| 277 | 321 | } |
| 278 | 322 | } |
@@ -284,17 +328,25 @@ discard block |
||
| 284 | 328 | */ |
| 285 | 329 | function procMemberInsert() |
| 286 | 330 | { |
| 287 | - if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request"); |
|
| 331 | + if (Context::getRequestMethod () == "GET") { |
|
| 332 | + return new Object (-1, "msg_invalid_request"); |
|
| 333 | + } |
|
| 288 | 334 | $oMemberModel = &getModel ('member'); |
| 289 | 335 | $config = $oMemberModel->getMemberConfig(); |
| 290 | 336 | |
| 291 | 337 | // call a trigger (before) |
| 292 | 338 | $trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config); |
| 293 | - if(!$trigger_output->toBool ()) return $trigger_output; |
|
| 339 | + if(!$trigger_output->toBool ()) { |
|
| 340 | + return $trigger_output; |
|
| 341 | + } |
|
| 294 | 342 | // Check if an administrator allows a membership |
| 295 | - if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled'); |
|
| 343 | + if($config->enable_join != 'Y') { |
|
| 344 | + return $this->stop ('msg_signup_disabled'); |
|
| 345 | + } |
|
| 296 | 346 | // Check if the user accept the license terms (only if terms exist) |
| 297 | - if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement'); |
|
| 347 | + if($config->agreement && Context::get('accept_agreement')!='Y') { |
|
| 348 | + return $this->stop('msg_accept_agreement'); |
|
| 349 | + } |
|
| 298 | 350 | |
| 299 | 351 | // Extract the necessary information in advance |
| 300 | 352 | $getVars = array(); |
@@ -313,16 +365,22 @@ discard block |
||
| 313 | 365 | foreach($getVars as $val) |
| 314 | 366 | { |
| 315 | 367 | $args->{$val} = Context::get($val); |
| 316 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 368 | + if($val == 'birthday') { |
|
| 369 | + $args->birthday_ui = Context::get('birthday_ui'); |
|
| 370 | + } |
|
| 317 | 371 | } |
| 318 | 372 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
| 319 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 373 | + if(!$args->birthday && $args->birthday_ui) { |
|
| 374 | + $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 375 | + } |
|
| 320 | 376 | |
| 321 | 377 | $args->find_account_answer = Context::get('find_account_answer'); |
| 322 | 378 | $args->allow_mailing = Context::get('allow_mailing'); |
| 323 | 379 | $args->allow_message = Context::get('allow_message'); |
| 324 | 380 | |
| 325 | - if($args->password1) $args->password = $args->password1; |
|
| 381 | + if($args->password1) { |
|
| 382 | + $args->password = $args->password1; |
|
| 383 | + } |
|
| 326 | 384 | |
| 327 | 385 | // check password strength |
| 328 | 386 | if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
@@ -351,7 +409,9 @@ discard block |
||
| 351 | 409 | unset($all_args->secret_text); |
| 352 | 410 | |
| 353 | 411 | // Set the user state as "denied" when using mail authentication |
| 354 | - if($config->enable_confirm == 'Y') $args->denied = 'Y'; |
|
| 412 | + if($config->enable_confirm == 'Y') { |
|
| 413 | + $args->denied = 'Y'; |
|
| 414 | + } |
|
| 355 | 415 | // Add extra vars after excluding necessary information from all the requested arguments |
| 356 | 416 | $extra_vars = delObjectVars($all_args, $args); |
| 357 | 417 | $args->extra_vars = serialize($extra_vars); |
@@ -366,7 +426,9 @@ discard block |
||
| 366 | 426 | } |
| 367 | 427 | } |
| 368 | 428 | $output = $this->insertMember($args); |
| 369 | - if(!$output->toBool()) return $output; |
|
| 429 | + if(!$output->toBool()) { |
|
| 430 | + return $output; |
|
| 431 | + } |
|
| 370 | 432 | |
| 371 | 433 | // insert ProfileImage, ImageName, ImageMark |
| 372 | 434 | $profile_image = $_FILES['profile_image']; |
@@ -405,43 +467,46 @@ discard block |
||
| 405 | 467 | if($config->identifier == 'email_address') |
| 406 | 468 | { |
| 407 | 469 | $output = $this->doLogin($args->email_address); |
| 408 | - } |
|
| 409 | - else |
|
| 470 | + } else |
|
| 410 | 471 | { |
| 411 | 472 | $output = $this->doLogin($args->user_id); |
| 412 | 473 | } |
| 413 | 474 | if(!$output->toBool()) { |
| 414 | - if($output->error == -9) |
|
| 415 | - $output->error = -11; |
|
| 475 | + if($output->error == -9) { |
|
| 476 | + $output->error = -11; |
|
| 477 | + } |
|
| 416 | 478 | return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output); |
| 417 | 479 | } |
| 418 | 480 | } |
| 419 | 481 | |
| 420 | 482 | // Results |
| 421 | 483 | $this->add('member_srl', $args->member_srl); |
| 422 | - if($config->redirect_url) $this->add('redirect_url', $config->redirect_url); |
|
| 484 | + if($config->redirect_url) { |
|
| 485 | + $this->add('redirect_url', $config->redirect_url); |
|
| 486 | + } |
|
| 423 | 487 | if($config->enable_confirm == 'Y') |
| 424 | 488 | { |
| 425 | 489 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
| 426 | 490 | $this->setMessage($msg); |
| 427 | 491 | return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new Object(-12, $msg)); |
| 492 | + } else { |
|
| 493 | + $this->setMessage('success_registed'); |
|
| 428 | 494 | } |
| 429 | - else $this->setMessage('success_registed'); |
|
| 430 | 495 | // Call a trigger (after) |
| 431 | 496 | $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config); |
| 432 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 497 | + if(!$trigger_output->toBool()) { |
|
| 498 | + return $trigger_output; |
|
| 499 | + } |
|
| 433 | 500 | |
| 434 | 501 | if($config->redirect_url) |
| 435 | 502 | { |
| 436 | 503 | $returnUrl = $config->redirect_url; |
| 437 | - } |
|
| 438 | - else |
|
| 504 | + } else |
|
| 439 | 505 | { |
| 440 | 506 | if(Context::get('success_return_url')) |
| 441 | 507 | { |
| 442 | 508 | $returnUrl = Context::get('success_return_url'); |
| 443 | - } |
|
| 444 | - else if($_COOKIE['XE_REDIRECT_URL']) |
|
| 509 | + } else if($_COOKIE['XE_REDIRECT_URL']) |
|
| 445 | 510 | { |
| 446 | 511 | $returnUrl = $_COOKIE['XE_REDIRECT_URL']; |
| 447 | 512 | setcookie("XE_REDIRECT_URL", '', 1); |
@@ -495,8 +560,7 @@ discard block |
||
| 495 | 560 | if(Context::get('success_return_url')) |
| 496 | 561 | { |
| 497 | 562 | $redirectUrl = Context::get('success_return_url'); |
| 498 | - } |
|
| 499 | - else |
|
| 563 | + } else |
|
| 500 | 564 | { |
| 501 | 565 | $redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
| 502 | 566 | } |
@@ -540,13 +604,17 @@ discard block |
||
| 540 | 604 | foreach($getVars as $val) |
| 541 | 605 | { |
| 542 | 606 | $args->{$val} = Context::get($val); |
| 543 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
| 607 | + if($val == 'birthday') { |
|
| 608 | + $args->birthday_ui = Context::get('birthday_ui'); |
|
| 609 | + } |
|
| 544 | 610 | } |
| 545 | 611 | // Login Information |
| 546 | 612 | $logged_info = Context::get('logged_info'); |
| 547 | 613 | $args->member_srl = $logged_info->member_srl; |
| 548 | 614 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
| 549 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 615 | + if(!$args->birthday && $args->birthday_ui) { |
|
| 616 | + $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
| 617 | + } |
|
| 550 | 618 | // Remove some unnecessary variables from all the vars |
| 551 | 619 | $all_args = Context::getRequestVars(); |
| 552 | 620 | unset($all_args->module); |
@@ -580,7 +648,9 @@ discard block |
||
| 580 | 648 | |
| 581 | 649 | // Execute insert or update depending on the value of member_srl |
| 582 | 650 | $output = $this->updateMember($args); |
| 583 | - if(!$output->toBool()) return $output; |
|
| 651 | + if(!$output->toBool()) { |
|
| 652 | + return $output; |
|
| 653 | + } |
|
| 584 | 654 | |
| 585 | 655 | $profile_image = $_FILES['profile_image']; |
| 586 | 656 | if(is_uploaded_file($profile_image['tmp_name'])) |
@@ -610,7 +680,9 @@ discard block |
||
| 610 | 680 | |
| 611 | 681 | // Call a trigger after successfully log-in (after) |
| 612 | 682 | $trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo); |
| 613 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 683 | + if(!$trigger_output->toBool()) { |
|
| 684 | + return $trigger_output; |
|
| 685 | + } |
|
| 614 | 686 | |
| 615 | 687 | $this->setSessionInfo(); |
| 616 | 688 | // Return result |
@@ -631,7 +703,9 @@ discard block |
||
| 631 | 703 | */ |
| 632 | 704 | function procMemberModifyPassword() |
| 633 | 705 | { |
| 634 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 706 | + if(!Context::get('is_logged')) { |
|
| 707 | + return $this->stop('msg_not_logged'); |
|
| 708 | + } |
|
| 635 | 709 | // Extract the necessary information in advance |
| 636 | 710 | $current_password = trim(Context::get('current_password')); |
| 637 | 711 | $password = trim(Context::get('password1')); |
@@ -645,17 +719,23 @@ discard block |
||
| 645 | 719 | |
| 646 | 720 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 647 | 721 | // Verify the cuttent password |
| 648 | - if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password'); |
|
| 722 | + if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) { |
|
| 723 | + return new Object(-1, 'invalid_password'); |
|
| 724 | + } |
|
| 649 | 725 | |
| 650 | 726 | // Check if a new password is as same as the previous password |
| 651 | - if($current_password == $password) return new Object(-1, 'invalid_new_password'); |
|
| 727 | + if($current_password == $password) { |
|
| 728 | + return new Object(-1, 'invalid_new_password'); |
|
| 729 | + } |
|
| 652 | 730 | |
| 653 | 731 | // Execute insert or update depending on the value of member_srl |
| 654 | 732 | $args = new stdClass; |
| 655 | 733 | $args->member_srl = $member_srl; |
| 656 | 734 | $args->password = $password; |
| 657 | 735 | $output = $this->updateMemberPassword($args); |
| 658 | - if(!$output->toBool()) return $output; |
|
| 736 | + if(!$output->toBool()) { |
|
| 737 | + return $output; |
|
| 738 | + } |
|
| 659 | 739 | |
| 660 | 740 | $this->add('member_srl', $args->member_srl); |
| 661 | 741 | $this->setMessage('success_updated'); |
@@ -671,7 +751,9 @@ discard block |
||
| 671 | 751 | */ |
| 672 | 752 | function procMemberLeave() |
| 673 | 753 | { |
| 674 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 754 | + if(!Context::get('is_logged')) { |
|
| 755 | + return $this->stop('msg_not_logged'); |
|
| 756 | + } |
|
| 675 | 757 | // Extract the necessary information in advance |
| 676 | 758 | $password = trim(Context::get('password')); |
| 677 | 759 | // Get information of logged-in user |
@@ -687,10 +769,14 @@ discard block |
||
| 687 | 769 | $this->memberInfo->password = $memberInfo->password; |
| 688 | 770 | } |
| 689 | 771 | // Verify the cuttent password |
| 690 | - if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password'); |
|
| 772 | + if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) { |
|
| 773 | + return new Object(-1, 'invalid_password'); |
|
| 774 | + } |
|
| 691 | 775 | |
| 692 | 776 | $output = $this->deleteMember($member_srl); |
| 693 | - if(!$output->toBool()) return $output; |
|
| 777 | + if(!$output->toBool()) { |
|
| 778 | + return $output; |
|
| 779 | + } |
|
| 694 | 780 | // Destroy all session information |
| 695 | 781 | $this->destroySessionInfo(); |
| 696 | 782 | // Return success message |
@@ -709,17 +795,25 @@ discard block |
||
| 709 | 795 | { |
| 710 | 796 | // Check if the file is successfully uploaded |
| 711 | 797 | $file = $_FILES['profile_image']; |
| 712 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 798 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
| 799 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
| 800 | + } |
|
| 713 | 801 | // Ignore if member_srl is invalid or doesn't exist. |
| 714 | 802 | $member_srl = Context::get('member_srl'); |
| 715 | - if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 803 | + if(!$member_srl) { |
|
| 804 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
| 805 | + } |
|
| 716 | 806 | |
| 717 | 807 | $logged_info = Context::get('logged_info'); |
| 718 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
| 808 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
| 809 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
| 810 | + } |
|
| 719 | 811 | // Return if member module is set not to use an image name or the user is not an administrator ; |
| 720 | 812 | $oModuleModel = getModel('module'); |
| 721 | 813 | $config = $oModuleModel->getModuleConfig('member'); |
| 722 | - if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image'); |
|
| 814 | + if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') { |
|
| 815 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
| 816 | + } |
|
| 723 | 817 | |
| 724 | 818 | $this->insertProfileImage($member_srl, $file['tmp_name']); |
| 725 | 819 | // Page refresh |
@@ -741,26 +835,35 @@ discard block |
||
| 741 | 835 | { |
| 742 | 836 | |
| 743 | 837 | // Check uploaded file |
| 744 | - if(!checkUploadedFile($target_file)) return; |
|
| 838 | + if(!checkUploadedFile($target_file)) { |
|
| 839 | + return; |
|
| 840 | + } |
|
| 745 | 841 | |
| 746 | 842 | $oMemberModel = getModel('member'); |
| 747 | 843 | $config = $oMemberModel->getMemberConfig(); |
| 748 | 844 | |
| 749 | 845 | // Get an image size |
| 750 | 846 | $max_width = $config->profile_image_max_width; |
| 751 | - if(!$max_width) $max_width = "90"; |
|
| 847 | + if(!$max_width) { |
|
| 848 | + $max_width = "90"; |
|
| 849 | + } |
|
| 752 | 850 | $max_height = $config->profile_image_max_height; |
| 753 | - if(!$max_height) $max_height = "90"; |
|
| 851 | + if(!$max_height) { |
|
| 852 | + $max_height = "90"; |
|
| 853 | + } |
|
| 754 | 854 | // Get a target path to save |
| 755 | 855 | $target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl)); |
| 756 | 856 | FileHandler::makeDir($target_path); |
| 757 | 857 | |
| 758 | 858 | // Get file information |
| 759 | 859 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 760 | - if(IMAGETYPE_PNG == $type) $ext = 'png'; |
|
| 761 | - elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
| 762 | - elseif(IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
| 763 | - else |
|
| 860 | + if(IMAGETYPE_PNG == $type) { |
|
| 861 | + $ext = 'png'; |
|
| 862 | + } elseif(IMAGETYPE_JPEG == $type) { |
|
| 863 | + $ext = 'jpg'; |
|
| 864 | + } elseif(IMAGETYPE_GIF == $type) { |
|
| 865 | + $ext = 'gif'; |
|
| 866 | + } else |
|
| 764 | 867 | { |
| 765 | 868 | return; |
| 766 | 869 | } |
@@ -772,8 +875,7 @@ discard block |
||
| 772 | 875 | if(($width > $max_width || $height > $max_height ) && $type != 1) |
| 773 | 876 | { |
| 774 | 877 | FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext); |
| 775 | - } |
|
| 776 | - else |
|
| 878 | + } else |
|
| 777 | 879 | { |
| 778 | 880 | @copy($target_file, $target_filename); |
| 779 | 881 | } |
@@ -788,17 +890,25 @@ discard block |
||
| 788 | 890 | { |
| 789 | 891 | // Check if the file is successfully uploaded |
| 790 | 892 | $file = $_FILES['image_name']; |
| 791 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
| 893 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
| 894 | + return $this->stop('msg_not_uploaded_image_name'); |
|
| 895 | + } |
|
| 792 | 896 | // Ignore if member_srl is invalid or doesn't exist. |
| 793 | 897 | $member_srl = Context::get('member_srl'); |
| 794 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 898 | + if(!$member_srl) { |
|
| 899 | + return $this->stop('msg_not_uploaded_image_name'); |
|
| 900 | + } |
|
| 795 | 901 | |
| 796 | 902 | $logged_info = Context::get('logged_info'); |
| 797 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
| 903 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
| 904 | + return $this->stop('msg_not_uploaded_image_name'); |
|
| 905 | + } |
|
| 798 | 906 | // Return if member module is set not to use an image name or the user is not an administrator ; |
| 799 | 907 | $oModuleModel = getModel('module'); |
| 800 | 908 | $config = $oModuleModel->getModuleConfig('member'); |
| 801 | - if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
| 909 | + if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') { |
|
| 910 | + return $this->stop('msg_not_uploaded_image_name'); |
|
| 911 | + } |
|
| 802 | 912 | |
| 803 | 913 | $this->insertImageName($member_srl, $file['tmp_name']); |
| 804 | 914 | // Page refresh |
@@ -819,15 +929,21 @@ discard block |
||
| 819 | 929 | function insertImageName($member_srl, $target_file) |
| 820 | 930 | { |
| 821 | 931 | // Check uploaded file |
| 822 | - if(!checkUploadedFile($target_file)) return; |
|
| 932 | + if(!checkUploadedFile($target_file)) { |
|
| 933 | + return; |
|
| 934 | + } |
|
| 823 | 935 | |
| 824 | 936 | $oModuleModel = getModel('module'); |
| 825 | 937 | $config = $oModuleModel->getModuleConfig('member'); |
| 826 | 938 | // Get an image size |
| 827 | 939 | $max_width = $config->image_name_max_width; |
| 828 | - if(!$max_width) $max_width = "90"; |
|
| 940 | + if(!$max_width) { |
|
| 941 | + $max_width = "90"; |
|
| 942 | + } |
|
| 829 | 943 | $max_height = $config->image_name_max_height; |
| 830 | - if(!$max_height) $max_height = "20"; |
|
| 944 | + if(!$max_height) { |
|
| 945 | + $max_height = "20"; |
|
| 946 | + } |
|
| 831 | 947 | // Get a target path to save |
| 832 | 948 | $target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl)); |
| 833 | 949 | FileHandler::makeDir($target_path); |
@@ -836,8 +952,11 @@ discard block |
||
| 836 | 952 | // Get file information |
| 837 | 953 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 838 | 954 | // Convert if the image size is larger than a given size or if the format is not a gif |
| 839 | - if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
| 840 | - else @copy($target_file, $target_filename); |
|
| 955 | + if($width > $max_width || $height > $max_height || $type!=1) { |
|
| 956 | + FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
| 957 | + } else { |
|
| 958 | + @copy($target_file, $target_filename); |
|
| 959 | + } |
|
| 841 | 960 | } |
| 842 | 961 | |
| 843 | 962 | /** |
@@ -897,17 +1016,25 @@ discard block |
||
| 897 | 1016 | { |
| 898 | 1017 | // Check if the file is successfully uploaded |
| 899 | 1018 | $file = $_FILES['image_mark']; |
| 900 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1019 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
| 1020 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1021 | + } |
|
| 901 | 1022 | // Ignore if member_srl is invalid or doesn't exist. |
| 902 | 1023 | $member_srl = Context::get('member_srl'); |
| 903 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1024 | + if(!$member_srl) { |
|
| 1025 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1026 | + } |
|
| 904 | 1027 | |
| 905 | 1028 | $logged_info = Context::get('logged_info'); |
| 906 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1029 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
| 1030 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1031 | + } |
|
| 907 | 1032 | // Membership in the images mark the module using the ban was set by an administrator or return; |
| 908 | 1033 | $oModuleModel = getModel('module'); |
| 909 | 1034 | $config = $oModuleModel->getModuleConfig('member'); |
| 910 | - if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1035 | + if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') { |
|
| 1036 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
| 1037 | + } |
|
| 911 | 1038 | |
| 912 | 1039 | $this->insertImageMark($member_srl, $file['tmp_name']); |
| 913 | 1040 | // Page refresh |
@@ -928,15 +1055,21 @@ discard block |
||
| 928 | 1055 | function insertImageMark($member_srl, $target_file) |
| 929 | 1056 | { |
| 930 | 1057 | // Check uploaded file |
| 931 | - if(!checkUploadedFile($target_file)) return; |
|
| 1058 | + if(!checkUploadedFile($target_file)) { |
|
| 1059 | + return; |
|
| 1060 | + } |
|
| 932 | 1061 | |
| 933 | 1062 | $oModuleModel = getModel('module'); |
| 934 | 1063 | $config = $oModuleModel->getModuleConfig('member'); |
| 935 | 1064 | // Get an image size |
| 936 | 1065 | $max_width = $config->image_mark_max_width; |
| 937 | - if(!$max_width) $max_width = "20"; |
|
| 1066 | + if(!$max_width) { |
|
| 1067 | + $max_width = "20"; |
|
| 1068 | + } |
|
| 938 | 1069 | $max_height = $config->image_mark_max_height; |
| 939 | - if(!$max_height) $max_height = "20"; |
|
| 1070 | + if(!$max_height) { |
|
| 1071 | + $max_height = "20"; |
|
| 1072 | + } |
|
| 940 | 1073 | |
| 941 | 1074 | $target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); |
| 942 | 1075 | FileHandler::makeDir($target_path); |
@@ -945,8 +1078,11 @@ discard block |
||
| 945 | 1078 | // Get file information |
| 946 | 1079 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
| 947 | 1080 | |
| 948 | - if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
| 949 | - else @copy($target_file, $target_filename); |
|
| 1081 | + if($width > $max_width || $height > $max_height || $type!=1) { |
|
| 1082 | + FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
| 1083 | + } else { |
|
| 1084 | + @copy($target_file, $target_filename); |
|
| 1085 | + } |
|
| 950 | 1086 | } |
| 951 | 1087 | |
| 952 | 1088 | /** |
@@ -981,14 +1117,18 @@ discard block |
||
| 981 | 1117 | function procMemberFindAccount() |
| 982 | 1118 | { |
| 983 | 1119 | $email_address = Context::get('email_address'); |
| 984 | - if(!$email_address) return new Object(-1, 'msg_invalid_request'); |
|
| 1120 | + if(!$email_address) { |
|
| 1121 | + return new Object(-1, 'msg_invalid_request'); |
|
| 1122 | + } |
|
| 985 | 1123 | |
| 986 | 1124 | $oMemberModel = getModel('member'); |
| 987 | 1125 | $oModuleModel = getModel('module'); |
| 988 | 1126 | |
| 989 | 1127 | // Check if a member having the same email address exists |
| 990 | 1128 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 991 | - if(!$member_srl) return new Object(-1, 'msg_email_not_exists'); |
|
| 1129 | + if(!$member_srl) { |
|
| 1130 | + return new Object(-1, 'msg_email_not_exists'); |
|
| 1131 | + } |
|
| 992 | 1132 | |
| 993 | 1133 | // Get information of the member |
| 994 | 1134 | $columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name'); |
@@ -1000,7 +1140,9 @@ discard block |
||
| 1000 | 1140 | $chk_args = new stdClass; |
| 1001 | 1141 | $chk_args->member_srl = $member_info->member_srl; |
| 1002 | 1142 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1003 | - if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed'); |
|
| 1143 | + if($output->toBool() && $output->data->count != '0') { |
|
| 1144 | + return new Object(-1, 'msg_user_not_confirmed'); |
|
| 1145 | + } |
|
| 1004 | 1146 | } |
| 1005 | 1147 | |
| 1006 | 1148 | // Insert data into the authentication DB |
@@ -1013,7 +1155,9 @@ discard block |
||
| 1013 | 1155 | $args->is_register = 'N'; |
| 1014 | 1156 | |
| 1015 | 1157 | $output = executeQuery('member.insertAuthMail', $args); |
| 1016 | - if(!$output->toBool()) return $output; |
|
| 1158 | + if(!$output->toBool()) { |
|
| 1159 | + return $output; |
|
| 1160 | + } |
|
| 1017 | 1161 | // Get content of the email to send a member |
| 1018 | 1162 | Context::set('auth_args', $args); |
| 1019 | 1163 | |
@@ -1030,8 +1174,7 @@ discard block |
||
| 1030 | 1174 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1031 | 1175 | } |
| 1032 | 1176 | } |
| 1033 | - } |
|
| 1034 | - else |
|
| 1177 | + } else |
|
| 1035 | 1178 | { |
| 1036 | 1179 | $memberInfo[$lang->user_id] = $args->user_id; |
| 1037 | 1180 | $memberInfo[$lang->user_name] = $args->user_name; |
@@ -1040,13 +1183,19 @@ discard block |
||
| 1040 | 1183 | } |
| 1041 | 1184 | Context::set('memberInfo', $memberInfo); |
| 1042 | 1185 | |
| 1043 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1044 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1186 | + if(!$member_config->skin) { |
|
| 1187 | + $member_config->skin = "default"; |
|
| 1188 | + } |
|
| 1189 | + if(!$member_config->colorset) { |
|
| 1190 | + $member_config->colorset = "white"; |
|
| 1191 | + } |
|
| 1045 | 1192 | |
| 1046 | 1193 | Context::set('member_config', $member_config); |
| 1047 | 1194 | |
| 1048 | 1195 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1049 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1196 | + if(!is_dir($tpl_path)) { |
|
| 1197 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1198 | + } |
|
| 1050 | 1199 | |
| 1051 | 1200 | $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
| 1052 | 1201 | Context::set('find_url', $find_url); |
@@ -1088,20 +1237,28 @@ discard block |
||
| 1088 | 1237 | $find_account_question = trim(Context::get('find_account_question')); |
| 1089 | 1238 | $find_account_answer = trim(Context::get('find_account_answer')); |
| 1090 | 1239 | |
| 1091 | - if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request'); |
|
| 1240 | + if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) { |
|
| 1241 | + return new Object(-1, 'msg_invalid_request'); |
|
| 1242 | + } |
|
| 1092 | 1243 | |
| 1093 | 1244 | $oModuleModel = getModel('module'); |
| 1094 | 1245 | // Check if a member having the same email address exists |
| 1095 | 1246 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1096 | - if(!$member_srl) return new Object(-1, 'msg_email_not_exists'); |
|
| 1247 | + if(!$member_srl) { |
|
| 1248 | + return new Object(-1, 'msg_email_not_exists'); |
|
| 1249 | + } |
|
| 1097 | 1250 | // Get information of the member |
| 1098 | 1251 | $columnList = array('member_srl', 'find_account_question', 'find_account_answer'); |
| 1099 | 1252 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 1100 | 1253 | |
| 1101 | 1254 | // Display a message if no answer is entered |
| 1102 | - if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists'); |
|
| 1255 | + if(!$member_info->find_account_question || !$member_info->find_account_answer) { |
|
| 1256 | + return new Object(-1, 'msg_question_not_exists'); |
|
| 1257 | + } |
|
| 1103 | 1258 | |
| 1104 | - if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches'); |
|
| 1259 | + if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) { |
|
| 1260 | + return new Object(-1, 'msg_answer_not_matches'); |
|
| 1261 | + } |
|
| 1105 | 1262 | |
| 1106 | 1263 | if($config->identifier == 'email_address') |
| 1107 | 1264 | { |
@@ -1117,7 +1274,9 @@ discard block |
||
| 1117 | 1274 | $args->password = $temp_password; |
| 1118 | 1275 | $args->change_password_date = '1'; |
| 1119 | 1276 | $output = $this->updateMemberPassword($args); |
| 1120 | - if(!$output->toBool()) return $output; |
|
| 1277 | + if(!$output->toBool()) { |
|
| 1278 | + return $output; |
|
| 1279 | + } |
|
| 1121 | 1280 | |
| 1122 | 1281 | $_SESSION['xe_temp_password_' . $user_id] = $temp_password; |
| 1123 | 1282 | |
@@ -1174,8 +1333,7 @@ discard block |
||
| 1174 | 1333 | if($output->data->is_register == 'Y') |
| 1175 | 1334 | { |
| 1176 | 1335 | $args->denied = 'N'; |
| 1177 | - } |
|
| 1178 | - else |
|
| 1336 | + } else |
|
| 1179 | 1337 | { |
| 1180 | 1338 | $args->password = $oMemberModel->hashPassword($args->password); |
| 1181 | 1339 | } |
@@ -1209,33 +1367,45 @@ discard block |
||
| 1209 | 1367 | { |
| 1210 | 1368 | // Get an email_address |
| 1211 | 1369 | $email_address = Context::get('email_address'); |
| 1212 | - if(!$email_address) return new Object(-1, 'msg_invalid_request'); |
|
| 1370 | + if(!$email_address) { |
|
| 1371 | + return new Object(-1, 'msg_invalid_request'); |
|
| 1372 | + } |
|
| 1213 | 1373 | // Log test by using email_address |
| 1214 | 1374 | $oMemberModel = getModel('member'); |
| 1215 | 1375 | |
| 1216 | 1376 | $args = new stdClass; |
| 1217 | 1377 | $args->email_address = $email_address; |
| 1218 | 1378 | $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
| 1219 | - if(!$memberSrl) return new Object(-1, 'msg_not_exists_member'); |
|
| 1379 | + if(!$memberSrl) { |
|
| 1380 | + return new Object(-1, 'msg_not_exists_member'); |
|
| 1381 | + } |
|
| 1220 | 1382 | |
| 1221 | 1383 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address'); |
| 1222 | 1384 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList); |
| 1223 | 1385 | |
| 1224 | 1386 | $oModuleModel = getModel('module'); |
| 1225 | 1387 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 1226 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1227 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1388 | + if(!$member_config->skin) { |
|
| 1389 | + $member_config->skin = "default"; |
|
| 1390 | + } |
|
| 1391 | + if(!$member_config->colorset) { |
|
| 1392 | + $member_config->colorset = "white"; |
|
| 1393 | + } |
|
| 1228 | 1394 | |
| 1229 | 1395 | // Check if a authentication mail has been sent previously |
| 1230 | 1396 | $chk_args = new stdClass; |
| 1231 | 1397 | $chk_args->member_srl = $member_info->member_srl; |
| 1232 | 1398 | $output = executeQuery('member.chkAuthMail', $chk_args); |
| 1233 | - if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request'); |
|
| 1399 | + if($output->toBool() && $output->data->count == '0') { |
|
| 1400 | + return new Object(-1, 'msg_invalid_request'); |
|
| 1401 | + } |
|
| 1234 | 1402 | |
| 1235 | 1403 | $auth_args = new stdClass; |
| 1236 | 1404 | $auth_args->member_srl = $member_info->member_srl; |
| 1237 | 1405 | $output = executeQueryArray('member.getAuthMailInfo', $auth_args); |
| 1238 | - if(!$output->data || !$output->data[0]->auth_key) return new Object(-1, 'msg_invalid_request'); |
|
| 1406 | + if(!$output->data || !$output->data[0]->auth_key) { |
|
| 1407 | + return new Object(-1, 'msg_invalid_request'); |
|
| 1408 | + } |
|
| 1239 | 1409 | $auth_info = $output->data[0]; |
| 1240 | 1410 | |
| 1241 | 1411 | // Update the regdate of authmail entry |
@@ -1256,8 +1426,7 @@ discard block |
||
| 1256 | 1426 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1257 | 1427 | } |
| 1258 | 1428 | } |
| 1259 | - } |
|
| 1260 | - else |
|
| 1429 | + } else |
|
| 1261 | 1430 | { |
| 1262 | 1431 | $memberInfo[$lang->user_id] = $member_info->user_id; |
| 1263 | 1432 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1270,7 +1439,9 @@ discard block |
||
| 1270 | 1439 | Context::set('member_config', $member_config); |
| 1271 | 1440 | |
| 1272 | 1441 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1273 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1442 | + if(!is_dir($tpl_path)) { |
|
| 1443 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1444 | + } |
|
| 1274 | 1445 | |
| 1275 | 1446 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); |
| 1276 | 1447 | Context::set('auth_url', $auth_url); |
@@ -1348,7 +1519,9 @@ discard block |
||
| 1348 | 1519 | $auth_args->is_register = 'Y'; |
| 1349 | 1520 | |
| 1350 | 1521 | $output = executeQuery('member.insertAuthMail', $auth_args); |
| 1351 | - if(!$output->toBool()) return $output; |
|
| 1522 | + if(!$output->toBool()) { |
|
| 1523 | + return $output; |
|
| 1524 | + } |
|
| 1352 | 1525 | |
| 1353 | 1526 | $memberInfo->email_address = $newEmail; |
| 1354 | 1527 | |
@@ -1382,8 +1555,7 @@ discard block |
||
| 1382 | 1555 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
| 1383 | 1556 | } |
| 1384 | 1557 | } |
| 1385 | - } |
|
| 1386 | - else |
|
| 1558 | + } else |
|
| 1387 | 1559 | { |
| 1388 | 1560 | $memberInfo[$lang->user_id] = $member_info->user_id; |
| 1389 | 1561 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1392,13 +1564,19 @@ discard block |
||
| 1392 | 1564 | } |
| 1393 | 1565 | Context::set('memberInfo', $memberInfo); |
| 1394 | 1566 | |
| 1395 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
| 1396 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
| 1567 | + if(!$member_config->skin) { |
|
| 1568 | + $member_config->skin = "default"; |
|
| 1569 | + } |
|
| 1570 | + if(!$member_config->colorset) { |
|
| 1571 | + $member_config->colorset = "white"; |
|
| 1572 | + } |
|
| 1397 | 1573 | |
| 1398 | 1574 | Context::set('member_config', $member_config); |
| 1399 | 1575 | |
| 1400 | 1576 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 1401 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1577 | + if(!is_dir($tpl_path)) { |
|
| 1578 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 1579 | + } |
|
| 1402 | 1580 | |
| 1403 | 1581 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
| 1404 | 1582 | Context::set('auth_url', $auth_url); |
@@ -1423,7 +1601,9 @@ discard block |
||
| 1423 | 1601 | { |
| 1424 | 1602 | $site_module_info = Context::get('site_module_info'); |
| 1425 | 1603 | $logged_info = Context::get('logged_info'); |
| 1426 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request'); |
|
| 1604 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
| 1605 | + return new Object(-1,'msg_invalid_request'); |
|
| 1606 | + } |
|
| 1427 | 1607 | |
| 1428 | 1608 | $oMemberModel = getModel('member'); |
| 1429 | 1609 | $columnList = array('site_srl', 'group_srl', 'title'); |
@@ -1442,13 +1622,17 @@ discard block |
||
| 1442 | 1622 | { |
| 1443 | 1623 | $site_module_info = Context::get('site_module_info'); |
| 1444 | 1624 | $logged_info = Context::get('logged_info'); |
| 1445 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request'); |
|
| 1625 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
| 1626 | + return new Object(-1,'msg_invalid_request'); |
|
| 1627 | + } |
|
| 1446 | 1628 | |
| 1447 | 1629 | $args = new stdClass; |
| 1448 | 1630 | $args->site_srl= $site_module_info->site_srl; |
| 1449 | 1631 | $args->member_srl = $logged_info->member_srl; |
| 1450 | 1632 | $output = executeQuery('member.deleteMembersGroup', $args); |
| 1451 | - if(!$output->toBool()) return $output; |
|
| 1633 | + if(!$output->toBool()) { |
|
| 1634 | + return $output; |
|
| 1635 | + } |
|
| 1452 | 1636 | $this->setMessage('success_deleted'); |
| 1453 | 1637 | $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl); |
| 1454 | 1638 | } |
@@ -1462,17 +1646,37 @@ discard block |
||
| 1462 | 1646 | */ |
| 1463 | 1647 | function setMemberConfig($args) |
| 1464 | 1648 | { |
| 1465 | - if(!$args->skin) $args->skin = "default"; |
|
| 1466 | - if(!$args->colorset) $args->colorset = "white"; |
|
| 1467 | - if(!$args->editor_skin) $args->editor_skin= "ckeditor"; |
|
| 1468 | - if(!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
| 1469 | - if($args->enable_join!='Y') $args->enable_join = 'N'; |
|
| 1649 | + if(!$args->skin) { |
|
| 1650 | + $args->skin = "default"; |
|
| 1651 | + } |
|
| 1652 | + if(!$args->colorset) { |
|
| 1653 | + $args->colorset = "white"; |
|
| 1654 | + } |
|
| 1655 | + if(!$args->editor_skin) { |
|
| 1656 | + $args->editor_skin= "ckeditor"; |
|
| 1657 | + } |
|
| 1658 | + if(!$args->editor_colorset) { |
|
| 1659 | + $args->editor_colorset = "moono"; |
|
| 1660 | + } |
|
| 1661 | + if($args->enable_join!='Y') { |
|
| 1662 | + $args->enable_join = 'N'; |
|
| 1663 | + } |
|
| 1470 | 1664 | $args->enable_openid= 'N'; |
| 1471 | - if($args->profile_image !='Y') $args->profile_image = 'N'; |
|
| 1472 | - if($args->image_name!='Y') $args->image_name = 'N'; |
|
| 1473 | - if($args->image_mark!='Y') $args->image_mark = 'N'; |
|
| 1474 | - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; |
|
| 1475 | - if(!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
| 1665 | + if($args->profile_image !='Y') { |
|
| 1666 | + $args->profile_image = 'N'; |
|
| 1667 | + } |
|
| 1668 | + if($args->image_name!='Y') { |
|
| 1669 | + $args->image_name = 'N'; |
|
| 1670 | + } |
|
| 1671 | + if($args->image_mark!='Y') { |
|
| 1672 | + $args->image_mark = 'N'; |
|
| 1673 | + } |
|
| 1674 | + if($args->group_image_mark!='Y') { |
|
| 1675 | + $args->group_image_mark = 'N'; |
|
| 1676 | + } |
|
| 1677 | + if(!trim(strip_tags($args->agreement))) { |
|
| 1678 | + $args->agreement = null; |
|
| 1679 | + } |
|
| 1476 | 1680 | $args->limit_day = (int)$args->limit_day; |
| 1477 | 1681 | |
| 1478 | 1682 | $agreement = trim($args->agreement); |
@@ -1480,7 +1684,9 @@ discard block |
||
| 1480 | 1684 | |
| 1481 | 1685 | $oModuleController = getController('module'); |
| 1482 | 1686 | $output = $oModuleController->insertModuleConfig('member',$args); |
| 1483 | - if(!$output->toBool()) return $output; |
|
| 1687 | + if(!$output->toBool()) { |
|
| 1688 | + return $output; |
|
| 1689 | + } |
|
| 1484 | 1690 | |
| 1485 | 1691 | $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
| 1486 | 1692 | FileHandler::writeFile($agreement_file, $agreement); |
@@ -1505,7 +1711,9 @@ discard block |
||
| 1505 | 1711 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
| 1506 | 1712 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
| 1507 | 1713 | |
| 1508 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
| 1714 | + if(!$check_signature) { |
|
| 1715 | + return FileHandler::removeFile($filename); |
|
| 1716 | + } |
|
| 1509 | 1717 | |
| 1510 | 1718 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
| 1511 | 1719 | FileHandler::makeDir($path); |
@@ -1539,7 +1747,9 @@ discard block |
||
| 1539 | 1747 | $args = new stdClass(); |
| 1540 | 1748 | $args->member_srl = $member_srl; |
| 1541 | 1749 | $args->group_srl = $group_srl; |
| 1542 | - if($site_srl) $args->site_srl = $site_srl; |
|
| 1750 | + if($site_srl) { |
|
| 1751 | + $args->site_srl = $site_srl; |
|
| 1752 | + } |
|
| 1543 | 1753 | |
| 1544 | 1754 | // Add |
| 1545 | 1755 | $output = executeQuery('member.addMemberToGroup',$args); |
@@ -1565,15 +1775,21 @@ discard block |
||
| 1565 | 1775 | $obj->member_srl = implode(',',$args->member_srl); |
| 1566 | 1776 | |
| 1567 | 1777 | $output = executeQueryArray('member.getMembersGroup', $obj); |
| 1568 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1778 | + if($output->data) { |
|
| 1779 | + foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
| 1780 | + } |
|
| 1569 | 1781 | |
| 1570 | 1782 | $output = executeQuery('member.deleteMembersGroup', $obj); |
| 1571 | - if(!$output->toBool()) return $output; |
|
| 1783 | + if(!$output->toBool()) { |
|
| 1784 | + return $output; |
|
| 1785 | + } |
|
| 1572 | 1786 | |
| 1573 | 1787 | $inserted_members = array(); |
| 1574 | 1788 | foreach($args->member_srl as $key => $val) |
| 1575 | 1789 | { |
| 1576 | - if($inserted_members[$val]) continue; |
|
| 1790 | + if($inserted_members[$val]) { |
|
| 1791 | + continue; |
|
| 1792 | + } |
|
| 1577 | 1793 | $inserted_members[$val] = true; |
| 1578 | 1794 | |
| 1579 | 1795 | unset($obj); |
@@ -1583,7 +1799,9 @@ discard block |
||
| 1583 | 1799 | $obj->site_srl = $args->site_srl; |
| 1584 | 1800 | $obj->regdate = $date[$obj->member_srl]; |
| 1585 | 1801 | $output = executeQuery('member.addMemberToGroup', $obj); |
| 1586 | - if(!$output->toBool()) return $output; |
|
| 1802 | + if(!$output->toBool()) { |
|
| 1803 | + return $output; |
|
| 1804 | + } |
|
| 1587 | 1805 | |
| 1588 | 1806 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
| 1589 | 1807 | } |
@@ -1645,8 +1863,7 @@ discard block |
||
| 1645 | 1863 | if($config->identifier == 'user_id') |
| 1646 | 1864 | { |
| 1647 | 1865 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
| 1648 | - } |
|
| 1649 | - else |
|
| 1866 | + } else |
|
| 1650 | 1867 | { |
| 1651 | 1868 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
| 1652 | 1869 | } |
@@ -1655,8 +1872,7 @@ discard block |
||
| 1655 | 1872 | $do_auto_login = true; |
| 1656 | 1873 | } |
| 1657 | 1874 | |
| 1658 | - } |
|
| 1659 | - else |
|
| 1875 | + } else |
|
| 1660 | 1876 | { |
| 1661 | 1877 | $do_auto_login = true; |
| 1662 | 1878 | } |
@@ -1665,8 +1881,7 @@ discard block |
||
| 1665 | 1881 | if($do_auto_login) |
| 1666 | 1882 | { |
| 1667 | 1883 | $output = $this->doLogin($user_id); |
| 1668 | - } |
|
| 1669 | - else |
|
| 1884 | + } else |
|
| 1670 | 1885 | { |
| 1671 | 1886 | executeQuery('member.deleteAutologin', $args); |
| 1672 | 1887 | setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365); |
@@ -1685,13 +1900,17 @@ discard block |
||
| 1685 | 1900 | function doLogin($user_id, $password = '', $keep_signed = false) |
| 1686 | 1901 | { |
| 1687 | 1902 | $user_id = strtolower($user_id); |
| 1688 | - if(!$user_id) return new Object(-1, 'null_user_id'); |
|
| 1903 | + if(!$user_id) { |
|
| 1904 | + return new Object(-1, 'null_user_id'); |
|
| 1905 | + } |
|
| 1689 | 1906 | // Call a trigger before log-in (before) |
| 1690 | 1907 | $trigger_obj = new stdClass(); |
| 1691 | 1908 | $trigger_obj->user_id = $user_id; |
| 1692 | 1909 | $trigger_obj->password = $password; |
| 1693 | 1910 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
| 1694 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 1911 | + if(!$trigger_output->toBool()) { |
|
| 1912 | + return $trigger_output; |
|
| 1913 | + } |
|
| 1695 | 1914 | // Create a member model object |
| 1696 | 1915 | $oMemberModel = getModel('member'); |
| 1697 | 1916 | |
@@ -1706,15 +1925,18 @@ discard block |
||
| 1706 | 1925 | // Get user_id information |
| 1707 | 1926 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
| 1708 | 1927 | // Set an invalid user if no value returned |
| 1709 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 1928 | + if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) { |
|
| 1929 | + return $this->recordLoginError(-1, 'invalid_email_address'); |
|
| 1930 | + } |
|
| 1710 | 1931 | |
| 1711 | - } |
|
| 1712 | - else |
|
| 1932 | + } else |
|
| 1713 | 1933 | { |
| 1714 | 1934 | // Get user_id information |
| 1715 | 1935 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
| 1716 | 1936 | // Set an invalid user if no value returned |
| 1717 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 1937 | + if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) { |
|
| 1938 | + return $this->recordLoginError(-1, 'invalid_user_id'); |
|
| 1939 | + } |
|
| 1718 | 1940 | } |
| 1719 | 1941 | |
| 1720 | 1942 | $output = executeQuery('member.getLoginCountByIp', $args); |
@@ -1726,14 +1948,18 @@ discard block |
||
| 1726 | 1948 | if($term < $config->max_error_count_time) |
| 1727 | 1949 | { |
| 1728 | 1950 | $term = $config->max_error_count_time - $term; |
| 1729 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
| 1730 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
| 1731 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
| 1732 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
| 1951 | + if($term < 60) { |
|
| 1952 | + $term = intval($term).Context::getLang('unit_sec'); |
|
| 1953 | + } elseif(60 <= $term && $term < 3600) { |
|
| 1954 | + $term = intval($term/60).Context::getLang('unit_min'); |
|
| 1955 | + } elseif(3600 <= $term && $term < 86400) { |
|
| 1956 | + $term = intval($term/3600).Context::getLang('unit_hour'); |
|
| 1957 | + } else { |
|
| 1958 | + $term = intval($term/86400).Context::getLang('unit_day'); |
|
| 1959 | + } |
|
| 1733 | 1960 | |
| 1734 | 1961 | return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
| 1735 | - } |
|
| 1736 | - else |
|
| 1962 | + } else |
|
| 1737 | 1963 | { |
| 1738 | 1964 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
| 1739 | 1965 | $output = executeQuery('member.deleteLoginCountByIp', $args); |
@@ -1760,7 +1986,9 @@ discard block |
||
| 1760 | 1986 | return new Object(-1,'msg_user_denied'); |
| 1761 | 1987 | } |
| 1762 | 1988 | // Notify if denied_date is less than the current time |
| 1763 | - if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
| 1989 | + if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) { |
|
| 1990 | + return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
| 1991 | + } |
|
| 1764 | 1992 | // Update the latest login time |
| 1765 | 1993 | $args->member_srl = $this->memberInfo->member_srl; |
| 1766 | 1994 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1809,7 +2037,9 @@ discard block |
||
| 1809 | 2037 | } |
| 1810 | 2038 | // Call a trigger after successfully log-in (after) |
| 1811 | 2039 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
| 1812 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
| 2040 | + if(!$trigger_output->toBool()) { |
|
| 2041 | + return $trigger_output; |
|
| 2042 | + } |
|
| 1813 | 2043 | // When user checked to use auto-login |
| 1814 | 2044 | if($keep_signed) |
| 1815 | 2045 | { |
@@ -1823,7 +2053,9 @@ discard block |
||
| 1823 | 2053 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
| 1824 | 2054 | executeQuery('member.deleteAutologin', $autologin_args); |
| 1825 | 2055 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
| 1826 | - if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
| 2056 | + if($autologin_output->toBool()) { |
|
| 2057 | + setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000); |
|
| 2058 | + } |
|
| 1827 | 2059 | } |
| 1828 | 2060 | if($this->memberInfo->is_admin == 'Y') |
| 1829 | 2061 | { |
@@ -1912,7 +2144,9 @@ discard block |
||
| 1912 | 2144 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
| 1913 | 2145 | { |
| 1914 | 2146 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
| 1915 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
| 2147 | + if(!is_array($member_popup_menu_list)) { |
|
| 2148 | + $member_popup_menu_list = array(); |
|
| 2149 | + } |
|
| 1916 | 2150 | |
| 1917 | 2151 | $obj = new stdClass; |
| 1918 | 2152 | $obj->url = $url; |
@@ -1931,35 +2165,54 @@ discard block |
||
| 1931 | 2165 | { |
| 1932 | 2166 | // Call a trigger (before) |
| 1933 | 2167 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
| 1934 | - if(!$output->toBool()) return $output; |
|
| 2168 | + if(!$output->toBool()) { |
|
| 2169 | + return $output; |
|
| 2170 | + } |
|
| 1935 | 2171 | // Terms and Conditions portion of the information set up by members reaffirmed |
| 1936 | 2172 | $oModuleModel = getModel('module'); |
| 1937 | 2173 | $config = $oModuleModel->getModuleConfig('member'); |
| 1938 | 2174 | |
| 1939 | 2175 | $logged_info = Context::get('logged_info'); |
| 1940 | 2176 | // If the date of the temporary restrictions limit further information on the date of |
| 1941 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
| 2177 | + if($config->limit_day) { |
|
| 2178 | + $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
| 2179 | + } |
|
| 1942 | 2180 | |
| 1943 | 2181 | $args->member_srl = getNextSequence(); |
| 1944 | 2182 | $args->list_order = -1 * $args->member_srl; |
| 1945 | 2183 | |
| 1946 | 2184 | // Execute insert or update depending on the value of member_srl |
| 1947 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2185 | + if(!$args->user_id) { |
|
| 2186 | + $args->user_id = 't'.$args->member_srl; |
|
| 2187 | + } |
|
| 1948 | 2188 | // Enter the user's identity changed to lowercase |
| 1949 | - else $args->user_id = strtolower($args->user_id); |
|
| 1950 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 1951 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
| 2189 | + else { |
|
| 2190 | + $args->user_id = strtolower($args->user_id); |
|
| 2191 | + } |
|
| 2192 | + if(!$args->user_name) { |
|
| 2193 | + $args->user_name = $args->member_srl; |
|
| 2194 | + } |
|
| 2195 | + if(!$args->nick_name) { |
|
| 2196 | + $args->nick_name = $args->member_srl; |
|
| 2197 | + } |
|
| 1952 | 2198 | |
| 1953 | 2199 | // Control of essential parameters |
| 1954 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 1955 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 1956 | - if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y'; |
|
| 2200 | + if($args->allow_mailing!='Y') { |
|
| 2201 | + $args->allow_mailing = 'N'; |
|
| 2202 | + } |
|
| 2203 | + if($args->denied!='Y') { |
|
| 2204 | + $args->denied = 'N'; |
|
| 2205 | + } |
|
| 2206 | + if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) { |
|
| 2207 | + $args->allow_message = 'Y'; |
|
| 2208 | + } |
|
| 1957 | 2209 | |
| 1958 | 2210 | if($logged_info->is_admin == 'Y') |
| 1959 | 2211 | { |
| 1960 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
| 1961 | - } |
|
| 1962 | - else |
|
| 2212 | + if($args->is_admin!='Y') { |
|
| 2213 | + $args->is_admin = 'N'; |
|
| 2214 | + } |
|
| 2215 | + } else |
|
| 1963 | 2216 | { |
| 1964 | 2217 | unset($args->is_admin); |
| 1965 | 2218 | } |
@@ -1972,8 +2225,12 @@ discard block |
||
| 1972 | 2225 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 1973 | 2226 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 1974 | 2227 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 1975 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 1976 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2228 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) { |
|
| 2229 | + $args->homepage = 'http://'.$args->homepage; |
|
| 2230 | + } |
|
| 2231 | + if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) { |
|
| 2232 | + $args->blog = 'http://'.$args->blog; |
|
| 2233 | + } |
|
| 1977 | 2234 | |
| 1978 | 2235 | // Create a model object |
| 1979 | 2236 | $oMemberModel = getModel('member'); |
@@ -1987,8 +2244,7 @@ discard block |
||
| 1987 | 2244 | return new Object(-1, $message[$config->password_strength]); |
| 1988 | 2245 | } |
| 1989 | 2246 | $args->password = $oMemberModel->hashPassword($args->password); |
| 1990 | - } |
|
| 1991 | - elseif(!$args->password) |
|
| 2247 | + } elseif(!$args->password) |
|
| 1992 | 2248 | { |
| 1993 | 2249 | unset($args->password); |
| 1994 | 2250 | } |
@@ -2029,8 +2285,12 @@ discard block |
||
| 2029 | 2285 | // Insert data into the DB |
| 2030 | 2286 | $args->list_order = -1 * $args->member_srl; |
| 2031 | 2287 | |
| 2032 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
| 2033 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
| 2288 | + if(!$args->user_id) { |
|
| 2289 | + $args->user_id = 't'.$args->member_srl; |
|
| 2290 | + } |
|
| 2291 | + if(!$args->user_name) { |
|
| 2292 | + $args->user_name = $args->member_srl; |
|
| 2293 | + } |
|
| 2034 | 2294 | |
| 2035 | 2295 | $oDB = &DB::getInstance(); |
| 2036 | 2296 | $oDB->begin(); |
@@ -2042,8 +2302,11 @@ discard block |
||
| 2042 | 2302 | return $output; |
| 2043 | 2303 | } |
| 2044 | 2304 | |
| 2045 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2046 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2305 | + if(is_array($args->group_srl_list)) { |
|
| 2306 | + $group_srl_list = $args->group_srl_list; |
|
| 2307 | + } else { |
|
| 2308 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2309 | + } |
|
| 2047 | 2310 | // If no value is entered the default group, the value of group registration |
| 2048 | 2311 | if(!$args->group_srl_list) |
| 2049 | 2312 | { |
@@ -2060,8 +2323,7 @@ discard block |
||
| 2060 | 2323 | } |
| 2061 | 2324 | } |
| 2062 | 2325 | // If the value is the value of the group entered the group registration |
| 2063 | - } |
|
| 2064 | - else |
|
| 2326 | + } else |
|
| 2065 | 2327 | { |
| 2066 | 2328 | for($i=0;$i<count($group_srl_list);$i++) |
| 2067 | 2329 | { |
@@ -2122,27 +2384,39 @@ discard block |
||
| 2122 | 2384 | { |
| 2123 | 2385 | // Call a trigger (before) |
| 2124 | 2386 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
| 2125 | - if(!$output->toBool()) return $output; |
|
| 2387 | + if(!$output->toBool()) { |
|
| 2388 | + return $output; |
|
| 2389 | + } |
|
| 2126 | 2390 | // Create a model object |
| 2127 | 2391 | $oMemberModel = getModel('member'); |
| 2128 | 2392 | |
| 2129 | 2393 | $logged_info = Context::get('logged_info'); |
| 2130 | 2394 | // Get what you want to modify the original information |
| 2131 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2395 | + if(!$this->memberInfo) { |
|
| 2396 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2397 | + } |
|
| 2132 | 2398 | // Control of essential parameters |
| 2133 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
| 2134 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
| 2399 | + if($args->allow_mailing!='Y') { |
|
| 2400 | + $args->allow_mailing = 'N'; |
|
| 2401 | + } |
|
| 2402 | + if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) { |
|
| 2403 | + $args->allow_message = 'Y'; |
|
| 2404 | + } |
|
| 2135 | 2405 | |
| 2136 | 2406 | if($logged_info->is_admin == 'Y') |
| 2137 | 2407 | { |
| 2138 | - if($args->denied!='Y') $args->denied = 'N'; |
|
| 2139 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
| 2140 | - } |
|
| 2141 | - else |
|
| 2408 | + if($args->denied!='Y') { |
|
| 2409 | + $args->denied = 'N'; |
|
| 2410 | + } |
|
| 2411 | + if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) { |
|
| 2412 | + $args->is_admin = 'N'; |
|
| 2413 | + } |
|
| 2414 | + } else |
|
| 2142 | 2415 | { |
| 2143 | 2416 | unset($args->is_admin); |
| 2144 | - if($is_admin == false) |
|
| 2145 | - unset($args->denied); |
|
| 2417 | + if($is_admin == false) { |
|
| 2418 | + unset($args->denied); |
|
| 2419 | + } |
|
| 2146 | 2420 | if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
| 2147 | 2421 | { |
| 2148 | 2422 | return $this->stop('msg_invalid_request'); |
@@ -2150,13 +2424,19 @@ discard block |
||
| 2150 | 2424 | } |
| 2151 | 2425 | |
| 2152 | 2426 | // Sanitize user ID, username, nickname, homepage, blog |
| 2153 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2427 | + if($args->user_id) { |
|
| 2428 | + $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
| 2429 | + } |
|
| 2154 | 2430 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2155 | 2431 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2156 | 2432 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2157 | 2433 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 2158 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
| 2159 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
| 2434 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) { |
|
| 2435 | + $args->homepage = 'http://'.$args->homepage; |
|
| 2436 | + } |
|
| 2437 | + if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) { |
|
| 2438 | + $args->blog = 'http://'.$args->blog; |
|
| 2439 | + } |
|
| 2160 | 2440 | |
| 2161 | 2441 | // check member identifier form |
| 2162 | 2442 | $config = $oMemberModel->getMemberConfig(); |
@@ -2173,8 +2453,7 @@ discard block |
||
| 2173 | 2453 | return new Object(-1,'msg_exists_email_address'); |
| 2174 | 2454 | } |
| 2175 | 2455 | $args->email_address = $orgMemberInfo->email_address; |
| 2176 | - } |
|
| 2177 | - else |
|
| 2456 | + } else |
|
| 2178 | 2457 | { |
| 2179 | 2458 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
| 2180 | 2459 | if($member_srl && $args->member_srl != $member_srl) |
@@ -2231,17 +2510,26 @@ discard block |
||
| 2231 | 2510 | return new Object(-1, $message[$config->password_strength]); |
| 2232 | 2511 | } |
| 2233 | 2512 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2234 | - } |
|
| 2235 | - else |
|
| 2513 | + } else |
|
| 2236 | 2514 | { |
| 2237 | 2515 | $args->password = $orgMemberInfo->password; |
| 2238 | 2516 | } |
| 2239 | 2517 | |
| 2240 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
| 2241 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
| 2242 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2243 | - if(!$args->description) $args->description = $orgMemberInfo->description; |
|
| 2244 | - if(!$args->birthday) $args->birthday = ''; |
|
| 2518 | + if(!$args->user_name) { |
|
| 2519 | + $args->user_name = $orgMemberInfo->user_name; |
|
| 2520 | + } |
|
| 2521 | + if(!$args->user_id) { |
|
| 2522 | + $args->user_id = $orgMemberInfo->user_id; |
|
| 2523 | + } |
|
| 2524 | + if(!$args->nick_name) { |
|
| 2525 | + $args->nick_name = $orgMemberInfo->nick_name; |
|
| 2526 | + } |
|
| 2527 | + if(!$args->description) { |
|
| 2528 | + $args->description = $orgMemberInfo->description; |
|
| 2529 | + } |
|
| 2530 | + if(!$args->birthday) { |
|
| 2531 | + $args->birthday = ''; |
|
| 2532 | + } |
|
| 2245 | 2533 | |
| 2246 | 2534 | $output = executeQuery('member.updateMember', $args); |
| 2247 | 2535 | |
@@ -2253,8 +2541,11 @@ discard block |
||
| 2253 | 2541 | |
| 2254 | 2542 | if($args->group_srl_list) |
| 2255 | 2543 | { |
| 2256 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
| 2257 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2544 | + if(is_array($args->group_srl_list)) { |
|
| 2545 | + $group_srl_list = $args->group_srl_list; |
|
| 2546 | + } else { |
|
| 2547 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
| 2548 | + } |
|
| 2258 | 2549 | // If the group information, group information changes |
| 2259 | 2550 | if(count($group_srl_list) > 0) |
| 2260 | 2551 | { |
@@ -2297,7 +2588,9 @@ discard block |
||
| 2297 | 2588 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
| 2298 | 2589 | |
| 2299 | 2590 | // Save Session |
| 2300 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2591 | + if(!$this->memberInfo) { |
|
| 2592 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
| 2593 | + } |
|
| 2301 | 2594 | $logged_info = Context::get('logged_info'); |
| 2302 | 2595 | |
| 2303 | 2596 | $output->add('member_srl', $args->member_srl); |
@@ -2323,8 +2616,7 @@ discard block |
||
| 2323 | 2616 | } |
| 2324 | 2617 | |
| 2325 | 2618 | $args->password = $oMemberModel->hashPassword($args->password); |
| 2326 | - } |
|
| 2327 | - else if($args->hashed_password) |
|
| 2619 | + } else if($args->hashed_password) |
|
| 2328 | 2620 | { |
| 2329 | 2621 | $args->password = $args->hashed_password; |
| 2330 | 2622 | } |
@@ -2349,7 +2641,9 @@ discard block |
||
| 2349 | 2641 | $trigger_obj = new stdClass(); |
| 2350 | 2642 | $trigger_obj->member_srl = $member_srl; |
| 2351 | 2643 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
| 2352 | - if(!$output->toBool()) return $output; |
|
| 2644 | + if(!$output->toBool()) { |
|
| 2645 | + return $output; |
|
| 2646 | + } |
|
| 2353 | 2647 | // Create a model object |
| 2354 | 2648 | $oMemberModel = getModel('member'); |
| 2355 | 2649 | // Bringing the user's information |
@@ -2358,9 +2652,13 @@ discard block |
||
| 2358 | 2652 | $columnList = array('member_srl', 'is_admin'); |
| 2359 | 2653 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
| 2360 | 2654 | } |
| 2361 | - if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member'); |
|
| 2655 | + if(!$this->memberInfo) { |
|
| 2656 | + return new Object(-1, 'msg_not_exists_member'); |
|
| 2657 | + } |
|
| 2362 | 2658 | // If managers can not be deleted |
| 2363 | - if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin'); |
|
| 2659 | + if($this->memberInfo->is_admin == 'Y') { |
|
| 2660 | + return new Object(-1, 'msg_cannot_delete_admin'); |
|
| 2661 | + } |
|
| 2364 | 2662 | |
| 2365 | 2663 | $oDB = &DB::getInstance(); |
| 2366 | 2664 | $oDB->begin(); |
@@ -2424,7 +2722,9 @@ discard block |
||
| 2424 | 2722 | */ |
| 2425 | 2723 | function destroySessionInfo() |
| 2426 | 2724 | { |
| 2427 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
| 2725 | + if(!$_SESSION || !is_array($_SESSION)) { |
|
| 2726 | + return; |
|
| 2727 | + } |
|
| 2428 | 2728 | |
| 2429 | 2729 | $memberInfo = Context::get('logged_info'); |
| 2430 | 2730 | $memberSrl = $memberInfo->member_srl; |
@@ -2463,8 +2763,9 @@ discard block |
||
| 2463 | 2763 | } |
| 2464 | 2764 | $maxLevel = 0; |
| 2465 | 2765 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
| 2466 | - if(count($resultGroup) > 0) |
|
| 2467 | - $maxLevel = max(array_flip($resultGroup)); |
|
| 2766 | + if(count($resultGroup) > 0) { |
|
| 2767 | + $maxLevel = max(array_flip($resultGroup)); |
|
| 2768 | + } |
|
| 2468 | 2769 | |
| 2469 | 2770 | if($maxLevel > 0) |
| 2470 | 2771 | { |
@@ -2481,16 +2782,22 @@ discard block |
||
| 2481 | 2782 | |
| 2482 | 2783 | function procMemberModifyEmailAddress() |
| 2483 | 2784 | { |
| 2484 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
| 2785 | + if(!Context::get('is_logged')) { |
|
| 2786 | + return $this->stop('msg_not_logged'); |
|
| 2787 | + } |
|
| 2485 | 2788 | |
| 2486 | 2789 | $member_info = Context::get('logged_info'); |
| 2487 | 2790 | $newEmail = Context::get('email_address'); |
| 2488 | 2791 | |
| 2489 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
| 2792 | + if(!$newEmail) { |
|
| 2793 | + return $this->stop('msg_invalid_request'); |
|
| 2794 | + } |
|
| 2490 | 2795 | |
| 2491 | 2796 | $oMemberModel = getModel('member'); |
| 2492 | 2797 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
| 2493 | - if($member_srl) return new Object(-1,'msg_exists_email_address'); |
|
| 2798 | + if($member_srl) { |
|
| 2799 | + return new Object(-1,'msg_exists_email_address'); |
|
| 2800 | + } |
|
| 2494 | 2801 | |
| 2495 | 2802 | if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
| 2496 | 2803 | { |
@@ -2518,7 +2825,9 @@ discard block |
||
| 2518 | 2825 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 2519 | 2826 | |
| 2520 | 2827 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
| 2521 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 2828 | + if(!is_dir($tpl_path)) { |
|
| 2829 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
| 2830 | + } |
|
| 2522 | 2831 | |
| 2523 | 2832 | global $lang; |
| 2524 | 2833 | |
@@ -2554,7 +2863,9 @@ discard block |
||
| 2554 | 2863 | { |
| 2555 | 2864 | $member_srl = Context::get('member_srl'); |
| 2556 | 2865 | $auth_key = Context::get('auth_key'); |
| 2557 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
| 2866 | + if(!$member_srl || !$auth_key) { |
|
| 2867 | + return $this->stop('msg_invalid_request'); |
|
| 2868 | + } |
|
| 2558 | 2869 | |
| 2559 | 2870 | // Test logs for finding password by user_id and authkey |
| 2560 | 2871 | $args = new stdClass; |
@@ -2563,7 +2874,9 @@ discard block |
||
| 2563 | 2874 | $output = executeQuery('member.getAuthMail', $args); |
| 2564 | 2875 | if(!$output->toBool() || $output->data->auth_key != $auth_key) |
| 2565 | 2876 | { |
| 2566 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 2877 | + if(strlen($output->data->auth_key) !== strlen($auth_key)) { |
|
| 2878 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
| 2879 | + } |
|
| 2567 | 2880 | return $this->stop('msg_invalid_modify_email_auth_key'); |
| 2568 | 2881 | } |
| 2569 | 2882 | |
@@ -2572,7 +2885,9 @@ discard block |
||
| 2572 | 2885 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
| 2573 | 2886 | |
| 2574 | 2887 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
| 2575 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
| 2888 | + if(!$output->toBool()) { |
|
| 2889 | + return $this->stop($output->getMessage()); |
|
| 2890 | + } |
|
| 2576 | 2891 | |
| 2577 | 2892 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
| 2578 | 2893 | executeQuery('member.deleteAuthChangeEmailAddress',$args); |
@@ -2593,7 +2908,9 @@ discard block |
||
| 2593 | 2908 | **/ |
| 2594 | 2909 | function triggerGetDocumentMenu(&$menu_list) |
| 2595 | 2910 | { |
| 2596 | - if(!Context::get('is_logged')) return new Object(); |
|
| 2911 | + if(!Context::get('is_logged')) { |
|
| 2912 | + return new Object(); |
|
| 2913 | + } |
|
| 2597 | 2914 | |
| 2598 | 2915 | $logged_info = Context::get('logged_info'); |
| 2599 | 2916 | $document_srl = Context::get('target_srl'); |
@@ -2604,8 +2921,12 @@ discard block |
||
| 2604 | 2921 | $member_srl = $oDocument->get('member_srl'); |
| 2605 | 2922 | $module_srl = $oDocument->get('module_srl'); |
| 2606 | 2923 | |
| 2607 | - if(!$member_srl) return new Object(); |
|
| 2608 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object(); |
|
| 2924 | + if(!$member_srl) { |
|
| 2925 | + return new Object(); |
|
| 2926 | + } |
|
| 2927 | + if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
| 2928 | + return new Object(); |
|
| 2929 | + } |
|
| 2609 | 2930 | |
| 2610 | 2931 | $oDocumentController = getController('document'); |
| 2611 | 2932 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2623,7 +2944,9 @@ discard block |
||
| 2623 | 2944 | **/ |
| 2624 | 2945 | function triggerGetCommentMenu(&$menu_list) |
| 2625 | 2946 | { |
| 2626 | - if(!Context::get('is_logged')) return new Object(); |
|
| 2947 | + if(!Context::get('is_logged')) { |
|
| 2948 | + return new Object(); |
|
| 2949 | + } |
|
| 2627 | 2950 | |
| 2628 | 2951 | $logged_info = Context::get('logged_info'); |
| 2629 | 2952 | $comment_srl = Context::get('target_srl'); |
@@ -2634,8 +2957,12 @@ discard block |
||
| 2634 | 2957 | $module_srl = $oComment->get('module_srl'); |
| 2635 | 2958 | $member_srl = $oComment->get('member_srl'); |
| 2636 | 2959 | |
| 2637 | - if(!$member_srl) return new Object(); |
|
| 2638 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object(); |
|
| 2960 | + if(!$member_srl) { |
|
| 2961 | + return new Object(); |
|
| 2962 | + } |
|
| 2963 | + if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
| 2964 | + return new Object(); |
|
| 2965 | + } |
|
| 2639 | 2966 | |
| 2640 | 2967 | $oCommentController = getController('comment'); |
| 2641 | 2968 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2651,7 +2978,9 @@ discard block |
||
| 2651 | 2978 | **/ |
| 2652 | 2979 | function procMemberSpammerManage() |
| 2653 | 2980 | { |
| 2654 | - if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); |
|
| 2981 | + if(!Context::get('is_logged')) { |
|
| 2982 | + return new Object(-1,'msg_not_permitted'); |
|
| 2983 | + } |
|
| 2655 | 2984 | |
| 2656 | 2985 | $logged_info = Context::get('logged_info'); |
| 2657 | 2986 | $member_srl = Context::get('member_srl'); |
@@ -2659,8 +2988,9 @@ discard block |
||
| 2659 | 2988 | $cnt_loop = Context::get('cnt_loop'); |
| 2660 | 2989 | $proc_type = Context::get('proc_type'); |
| 2661 | 2990 | $isMoveToTrash = true; |
| 2662 | - if($proc_type == "delete") |
|
| 2663 | - $isMoveToTrash = false; |
|
| 2991 | + if($proc_type == "delete") { |
|
| 2992 | + $isMoveToTrash = false; |
|
| 2993 | + } |
|
| 2664 | 2994 | |
| 2665 | 2995 | // check grant |
| 2666 | 2996 | $oModuleModel = getModel('module'); |
@@ -2668,7 +2998,9 @@ discard block |
||
| 2668 | 2998 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
| 2669 | 2999 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
| 2670 | 3000 | |
| 2671 | - if(!$grant->manager) return new Object(-1,'msg_not_permitted'); |
|
| 3001 | + if(!$grant->manager) { |
|
| 3002 | + return new Object(-1,'msg_not_permitted'); |
|
| 3003 | + } |
|
| 2672 | 3004 | |
| 2673 | 3005 | $proc_msg = ""; |
| 2674 | 3006 | |
@@ -2677,11 +3009,13 @@ discard block |
||
| 2677 | 3009 | |
| 2678 | 3010 | // delete or trash destination |
| 2679 | 3011 | // proc member |
| 2680 | - if($cnt_loop == 1) |
|
| 2681 | - $this->_spammerMember($member_srl); |
|
| 3012 | + if($cnt_loop == 1) { |
|
| 3013 | + $this->_spammerMember($member_srl); |
|
| 3014 | + } |
|
| 2682 | 3015 | // proc document and comment |
| 2683 | - elseif($cnt_loop>1) |
|
| 2684 | - $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
| 3016 | + elseif($cnt_loop>1) { |
|
| 3017 | + $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
| 3018 | + } |
|
| 2685 | 3019 | |
| 2686 | 3020 | // get destination count |
| 2687 | 3021 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
@@ -2689,13 +3023,16 @@ discard block |
||
| 2689 | 3023 | |
| 2690 | 3024 | $total_count = Context::get('total_count'); |
| 2691 | 3025 | $remain_count = $cnt_document + $cnt_comment; |
| 2692 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
| 3026 | + if($cnt_loop == 1) { |
|
| 3027 | + $total_count = $remain_count; |
|
| 3028 | + } |
|
| 2693 | 3029 | |
| 2694 | 3030 | // get progress percent |
| 2695 | - if($total_count > 0) |
|
| 2696 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
| 2697 | - else |
|
| 2698 | - $progress = 100; |
|
| 3031 | + if($total_count > 0) { |
|
| 3032 | + $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
| 3033 | + } else { |
|
| 3034 | + $progress = 100; |
|
| 3035 | + } |
|
| 2699 | 3036 | |
| 2700 | 3037 | $this->add('total_count', $total_count); |
| 2701 | 3038 | $this->add('remain_count', $remain_count); |
@@ -2737,7 +3074,10 @@ discard block |
||
| 2737 | 3074 | $args->nick_name = $member_info->nick_name; |
| 2738 | 3075 | $args->denied = "Y"; |
| 2739 | 3076 | $args->description = trim( $member_info->description ); |
| 2740 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
| 3077 | + if( $args->description != "" ) { |
|
| 3078 | + $args->description .= "\n"; |
|
| 3079 | + } |
|
| 3080 | + // add new line |
|
| 2741 | 3081 | |
| 2742 | 3082 | $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 . "]"; |
| 2743 | 3083 | |
@@ -2782,8 +3122,11 @@ discard block |
||
| 2782 | 3122 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
| 2783 | 3123 | if($documentList) { |
| 2784 | 3124 | foreach($documentList as $v) { |
| 2785 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
| 2786 | - else $oDocumentController->deleteDocument($v->document_srl); |
|
| 3125 | + if($isMoveToTrash) { |
|
| 3126 | + $oDocumentController->moveDocumentToTrash($v); |
|
| 3127 | + } else { |
|
| 3128 | + $oDocumentController->deleteDocument($v->document_srl); |
|
| 3129 | + } |
|
| 2787 | 3130 | } |
| 2788 | 3131 | } |
| 2789 | 3132 | } |