diff --git a/classes/mobile/Mobile.class.php b/classes/mobile/Mobile.class.php index 5eb750c24..5e3972ca8 100644 --- a/classes/mobile/Mobile.class.php +++ b/classes/mobile/Mobile.class.php @@ -46,11 +46,11 @@ class Mobile // Try to detect from URL arguments and cookies, and finally fall back to user-agent detection. $m = Context::get('m'); $cookie = (isset($_COOKIE['mobile']) && $_SESSION['user_agent'] === md5($_SERVER['HTTP_USER_AGENT'])) ? $_COOKIE['mobile'] : null; - if ($m === '1' || $cookie === 'true') + if ($m === '1' || ($m === null && $cookie === 'true')) { self::$_ismobile = TRUE; } - elseif ($m === '0' || $cookie === 'false') + elseif ($m === '0' || ($m === null && $cookie === 'false')) { self::$_ismobile = FALSE; } @@ -60,7 +60,7 @@ class Mobile } // Set cookie to prevent recalculation. - if (!$cookie) + if ($cookie !== (self::$_ismobile ? 'true' : 'false')) { $_SESSION['user_agent'] = md5($_SERVER['HTTP_USER_AGENT']); $_COOKIE['mobile'] = self::$_ismobile ? 'true' : 'false'; diff --git a/common/framework/parsers/langparser.php b/common/framework/parsers/langparser.php index 756201fdb..2f868edef 100644 --- a/common/framework/parsers/langparser.php +++ b/common/framework/parsers/langparser.php @@ -58,7 +58,7 @@ class LangParser } // Load the XML lang file. - $xml = @simplexml_load_file($filename); + $xml = simplexml_load_string(Storage::read($filename)); if ($xml === false) { Storage::write($output_filename, ''); diff --git a/common/framework/storage.php b/common/framework/storage.php index 969d880d9..88367e8bc 100644 --- a/common/framework/storage.php +++ b/common/framework/storage.php @@ -240,11 +240,16 @@ class Storage } } - if (self::$safe_overwrite && strncasecmp($mode, 'a', 1)) + if (self::$safe_overwrite && strncasecmp($mode, 'a', 1) && @is_writable($destination_dir)) { + $use_atomic_rename = true; $original_filename = $filename; $filename = $filename . '.tmp.' . microtime(true); } + else + { + $use_atomic_rename = false; + } if ($fp = @fopen($filename, $mode)) { @@ -275,7 +280,7 @@ class Storage @chmod($filename, ($perms === null ? (0666 & ~self::getUmask()) : $perms)); - if (self::$safe_overwrite && strncasecmp($mode, 'a', 1)) + if ($use_atomic_rename) { $rename_success = @rename($filename, $original_filename); if (!$rename_success) @@ -350,14 +355,20 @@ class Storage } elseif (self::isDirectory($destination)) { + $destination_dir = $destination; $destination = $destination . '/' . basename($source); } - if (self::$safe_overwrite) + if (self::$safe_overwrite && @is_writable($destination_dir)) { + $use_atomic_rename = true; $original_destination = $destination; $destination = $destination . '.tmp.' . microtime(true); } + else + { + $use_atomic_rename = false; + } $copy_success = @copy($source, $destination); if (!$copy_success) @@ -382,7 +393,7 @@ class Storage @chmod($destination, $destination_perms); } - if (self::$safe_overwrite) + if ($use_atomic_rename) { $rename_success = @rename($destination, $original_destination); if (!$rename_success) diff --git a/modules/board/board.view.php b/modules/board/board.view.php index 43761aa77..6c5dab7ce 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -821,7 +821,7 @@ class boardView extends board } // if the document is not existed, then back to the board content page - if(!$oDocument->isExists()) + if(!$oDocument || !$oDocument->isExists()) { return $this->dispBoardContent(); } diff --git a/modules/member/lang/en.php b/modules/member/lang/en.php index e3ce7b070..9e48d9c7c 100644 --- a/modules/member/lang/en.php +++ b/modules/member/lang/en.php @@ -48,6 +48,7 @@ $lang->enable_find_account_question = 'Account recovery using question/answer'; $lang->enable_ssl = 'Enable SSL'; $lang->msg_email_confirmation_required = 'A confirmation e-mail will be sent. Please check your email address carefully.'; $lang->security_sign_in = 'Sign in using enhanced security'; +$lang->member_limited = 'Limited'; $lang->limit_day = 'Temporary Limit Date'; $lang->limit_day_description = 'Description for Temporary Limit Date'; $lang->limit_date = 'Limit Date'; diff --git a/modules/member/lang/ko.php b/modules/member/lang/ko.php index 15e71a0b2..5497ddaa8 100644 --- a/modules/member/lang/ko.php +++ b/modules/member/lang/ko.php @@ -48,6 +48,7 @@ $lang->enable_find_account_question = '질문/답변 인증 사용'; $lang->enable_ssl = 'SSL 기능 사용'; $lang->msg_email_confirmation_required = '인증 메일이 발송되니 정확하게 입력해 주시기 바랍니다.'; $lang->security_sign_in = '보안로그인 사용'; +$lang->member_limited = '임시 제한'; $lang->limit_day = '임시 제한 일자'; $lang->limit_day_description = '임시 제한 일자 설명'; $lang->limit_date = '제한일'; diff --git a/modules/member/member.controller.php b/modules/member/member.controller.php index 51e9c6cdc..915a25a04 100644 --- a/modules/member/member.controller.php +++ b/modules/member/member.controller.php @@ -1756,13 +1756,16 @@ class memberController extends member $redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail'); return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed')); } - return new Object(-1, ($this->memberInfo->refused_reason)? lang('msg_user_denied') . "\n" . $this->memberInfo->refused_reason : 'msg_user_denied'); + + $refused_reason = $this->memberInfo->refused_reason ? ('
' . lang('refused_reason') . ': ' . $this->memberInfo->refused_reason) : ''; + return new Object(-1, lang('msg_user_denied') . $refused_reason); } // Notify if user is limited if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) { - return new Object(-9,sprintf(lang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); + $limited_reason = $this->memberInfo->limited_reason ? ('
' . lang('refused_reason') . ': ' . $this->memberInfo->limited_reason) : ''; + return new Object(-9, sprintf(lang('msg_user_limited'), zdate($this->memberInfo->limit_date,"Y-m-d")) . $limited_reason); } // Do not allow login as admin if not in allowed IP list diff --git a/modules/member/tpl/insert_member.html b/modules/member/tpl/insert_member.html index 861826f18..dd8da7963 100644 --- a/modules/member/tpl/insert_member.html +++ b/modules/member/tpl/insert_member.html @@ -92,6 +92,13 @@ {$lang->about_limit_date} +
+ +
+ + {$lang->about_refused_reason} +
+
@@ -136,6 +143,11 @@ onSelect:function(){ $(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,"")) + if($('#until').val()){ + limited_reason_division.slideDown(200); + } else { + limited_reason_division.slideUp(200); + } } }; $.extend($.datepicker.regional['{$lang_type}'],option); @@ -147,7 +159,9 @@ } $(".dateRemover").click(function() { $(this).prevAll('input').val(''); - return false;}); + limited_reason_division.slideUp(200); + return false; + }); }); var refused_reason_division = $('.div_refused_reason'); @@ -165,5 +179,11 @@ refused_reason_division.slideUp(200); } }); + + var limited_reason_division = $('.div_limited_reason'); + if(!$('#until').val()) + { + limited_reason_division.hide(); + } })(jQuery); diff --git a/modules/member/tpl/member_list.html b/modules/member/tpl/member_list.html index 18bc43e5b..f40c3f92f 100644 --- a/modules/member/tpl/member_list.html +++ b/modules/member/tpl/member_list.html @@ -48,7 +48,15 @@ {@ $member_info['group_list'] = implode(', ', $member_info['group_list'])} {$member_info[$name]} - {$lang->denied}{$lang->approval} + + + {$lang->denied} + + {$lang->member_limited} + + {$lang->approval} + + {zdate($member_info['regdate'], 'Y-m-d')} {zdate($member_info['last_login'], 'Y-m-d')} {$member_info['group_list']}  diff --git a/modules/ncenterlite/ncenterlite.admin.controller.php b/modules/ncenterlite/ncenterlite.admin.controller.php index aa2c553bc..33d0023d9 100644 --- a/modules/ncenterlite/ncenterlite.admin.controller.php +++ b/modules/ncenterlite/ncenterlite.admin.controller.php @@ -55,20 +55,19 @@ class ncenterliteAdminController extends ncenterlite $config->mention_suffixes = array_map('trim', explode(',', $config->mention_suffixes)); } } - + if ($obj->disp_act == 'dispNcenterliteAdminSeletedmid') { - if (!$config->hide_module_srls) + if (!$obj->hide_module_srls) { $config->hide_module_srls = array(); } - if (!$config->admin_notify_module_srls) + if (!$obj->admin_notify_module_srls) { $config->admin_notify_module_srls = array(); } } - - $output = $oModuleController->updateModuleConfig('ncenterlite', $config); + $output = $oModuleController->insertModuleConfig('ncenterlite', $config); if(!$output->toBool()) { return new Object(-1, 'ncenterlite_msg_setting_error'); diff --git a/modules/ncenterlite/skins/default/NotifyList.html b/modules/ncenterlite/skins/default/NotifyList.html index dae56b337..6428b8878 100644 --- a/modules/ncenterlite/skins/default/NotifyList.html +++ b/modules/ncenterlite/skins/default/NotifyList.html @@ -36,9 +36,11 @@ diff --git a/modules/ncenterlite/skins/default_bottom/NotifyList.html b/modules/ncenterlite/skins/default_bottom/NotifyList.html index dae56b337..c3369bf08 100644 --- a/modules/ncenterlite/skins/default_bottom/NotifyList.html +++ b/modules/ncenterlite/skins/default_bottom/NotifyList.html @@ -35,10 +35,12 @@ diff --git a/tests/unit/framework/StorageTest.php b/tests/unit/framework/StorageTest.php index f12b797a1..d7dd46ddb 100644 --- a/tests/unit/framework/StorageTest.php +++ b/tests/unit/framework/StorageTest.php @@ -9,11 +9,13 @@ class StorageTest extends \Codeception\TestCase\Test public function _after() { + @chmod(\RX_BASEDIR . 'tests/_output', 0755); Rhymix\Framework\Storage::deleteDirectory(\RX_BASEDIR . 'tests/_output', false); } public function _failed() { + @chmod(\RX_BASEDIR . 'tests/_output', 0755); Rhymix\Framework\Storage::deleteDirectory(\RX_BASEDIR . 'tests/_output', false); } @@ -191,13 +193,28 @@ class StorageTest extends \Codeception\TestCase\Test { $source = \RX_BASEDIR . 'tests/_output/copy.source.txt'; $target = \RX_BASEDIR . 'tests/_output/copy.target.txt'; + $target_dir = \RX_BASEDIR . 'tests/_output'; file_put_contents($source, 'foobarbaz'); chmod($source, 0646); + // Copy with exact destination filename $this->assertTrue(Rhymix\Framework\Storage::copy($source, $target)); $this->assertTrue(file_exists($target)); $this->assertTrue(file_get_contents($target) === 'foobarbaz'); + // Copy into directory with source filename + $this->assertTrue(Rhymix\Framework\Storage::copy($source, $target_dir)); + $this->assertTrue(file_exists($target_dir . '/copy.source.txt')); + $this->assertTrue(file_get_contents($target_dir . '/copy.source.txt') === 'foobarbaz'); + + // Copy into directory with no write permissions + chmod($target_dir, 0555); + file_put_contents($source, 'foobarbaz has changed'); + $this->assertTrue(Rhymix\Framework\Storage::copy($source, $target)); + $this->assertTrue(file_exists($target)); + $this->assertTrue(file_get_contents($target) === 'foobarbaz has changed'); + chmod($target_dir, 0755); + if (strncasecmp(\PHP_OS, 'Win', 3) !== 0) { $this->assertEquals(0646, fileperms($target) & 0777);