mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 06:13:32 +09:00
Clean up admin IP whitelist and block at login time
This commit is contained in:
parent
a499aa0d1f
commit
9e9b09464f
17 changed files with 92 additions and 38 deletions
|
|
@ -584,7 +584,23 @@ class adminAdminController extends admin
|
|||
if (!IpFilter::validate($whitelist)) {
|
||||
return new Object(-1, 'msg_invalid_ip');
|
||||
}
|
||||
|
||||
$denied_ip = array_map('trim', preg_split('/[\r\n]/', $vars->admin_denied_ip));
|
||||
$denied_ip = array_unique(array_filter($denied_ip, function($item) {
|
||||
return $item !== '';
|
||||
}));
|
||||
if (!IpFilter::validate($whitelist)) {
|
||||
return new Object(-1, 'msg_invalid_ip');
|
||||
}
|
||||
|
||||
$oMemberAdminModel = getAdminModel('member');
|
||||
if (!$oMemberAdminModel->getMemberAdminIPCheck($allowed_ip, $denied_ip))
|
||||
{
|
||||
return new Object(-1, 'msg_current_ip_will_be_denied');
|
||||
}
|
||||
|
||||
Rhymix\Framework\Config::set('admin.allow', array_values($allowed_ip));
|
||||
Rhymix\Framework\Config::set('admin.deny', array_values($denied_ip));
|
||||
|
||||
// Save
|
||||
Rhymix\Framework\Config::save();
|
||||
|
|
|
|||
|
|
@ -115,9 +115,12 @@ $lang->input_footer_script = 'Footer script';
|
|||
$lang->detail_input_footer_script = 'The script is inserted into the bottom of body. It does not work at admin page.';
|
||||
$lang->corp = 'Crop(Cut)';
|
||||
$lang->ratio = 'Ratio(Keep Aspect)';
|
||||
$lang->admin_ip_limit = 'Sepcify IP address band that can access the admin page.';
|
||||
$lang->admin_ip_allow = 'IP addresses allowed to log in as administrator';
|
||||
$lang->admin_ip_deny = 'IP addresses forbidden to log in as administrator';
|
||||
$lang->local_ip_address = 'Local IP address';
|
||||
$lang->about_admin_ip_limit = 'Specify IP address which can access to admin page. Please note that only the specified IP addresses can access the admin page.';
|
||||
$lang->about_admin_ip_allow = 'If this list is not empty, the administrator will only be able to log in from one of the listed IP addresses.';
|
||||
$lang->about_admin_ip_deny = 'This list can be used to designate IP addresses that are not allowed to log in as administrator.';
|
||||
$lang->msg_current_ip_will_be_denied = 'The given IP list cannot be applied, as they would block your own IP address.';
|
||||
$lang->detail_about_ftp_info = 'FTP information is needed for easyinstall when save_mode = on.';
|
||||
$lang->allow_use_favicon = 'Do you want to use favicon?';
|
||||
$lang->about_use_favicon = 'You can upload 16x16 size<em>*.ico</em> file only.';
|
||||
|
|
|
|||
|
|
@ -110,9 +110,12 @@ $lang->input_footer_script = '下段(footer)スクリプト';
|
|||
$lang->detail_input_footer_script = '最下段にコードを追加します。管理者ページでは遂行できません。';
|
||||
$lang->corp = '切り取り';
|
||||
$lang->ratio = 'Ratio(縦横の比率をキープ)';
|
||||
$lang->admin_ip_limit = '管理者のIPアドレス帯域';
|
||||
$lang->admin_ip_allow = '管理者ログイン許容IP';
|
||||
$lang->admin_ip_deny = '管理者ログイン禁止IP';
|
||||
$lang->local_ip_address = 'ローカルIPアドレス';
|
||||
$lang->about_admin_ip_limit = '該当IPについてのみ管理者ページへアクセスできるため、注意してください。IP帯域情報は、/files/config/db.config.php ファイルに保存されます。Change the line to multiple IP.';
|
||||
$lang->about_admin_ip_allow = 'ここでIPアドレスの一覧を表示すると、そのIPのみ、管理者のログインが可能になります。すべてのIPからのログインを許可するには、リストを空白のままに。';
|
||||
$lang->about_admin_ip_deny = 'ここに記載され、IPアドレスは、管理者のログインが禁止されます。';
|
||||
$lang->msg_current_ip_will_be_denied = '入力された設定によると、現在ログインして、管理者のIPアドレスもブロックされます。再度確認してください。';
|
||||
$lang->detail_about_ftp_info = 'FTP情報を入力すれば簡単設置を可能にします。FTP情報は files/config/ftp.config.php ファイルに保存されます。簡単設置ができない場合、PHPのsafe_modeをOnへ変更が必要です。';
|
||||
$lang->allow_use_favicon = 'ファビコン設定';
|
||||
$lang->about_use_favicon = '16 x 16 サイズの<em>*.ico</em> ファイルのみ登録できます。';
|
||||
|
|
|
|||
|
|
@ -112,9 +112,12 @@ $lang->input_footer_script = '하단(footer) 스크립트';
|
|||
$lang->detail_input_footer_script = '최하단에 코드를 삽입합니다. 관리자 페이지에서는 수행되지 않습니다.';
|
||||
$lang->corp = 'Crop(잘라내기)';
|
||||
$lang->ratio = 'Ratio(비율 맞추기)';
|
||||
$lang->admin_ip_limit = '관리자 IP대역';
|
||||
$lang->admin_ip_allow = '관리자 로그인 허용 IP';
|
||||
$lang->admin_ip_deny = '관리자 로그인 금지 IP';
|
||||
$lang->local_ip_address = '로컬 IP 주소';
|
||||
$lang->about_admin_ip_limit = '관리자 페이지로 접근가능한 IP대역을 지정합니다. 해당 IP에 대해서만 관리자 페이지로 접근이 가능하므로 주의 바랍니다.';
|
||||
$lang->about_admin_ip_allow = '여기에 IP 주소를 나열하면 해당 IP에서만 관리자 로그인이 가능하게 됩니다. 모든 IP에서 로그인을 허용하려면 목록을 비워 두십시오.';
|
||||
$lang->about_admin_ip_deny = '여기에 나열된 IP 주소에서는 관리자 로그인이 금지됩니다.';
|
||||
$lang->msg_current_ip_will_be_denied = '주어진 설정에 따르면 현재 로그인하신 관리자의 IP 주소도 차단됩니다. 다시 확인해 주십시오.';
|
||||
$lang->detail_about_ftp_info = 'safe_mode = on 상태에서 쉬운설치를 사용하려면 FTP 정보를 입력해야 합니다.';
|
||||
$lang->allow_use_favicon = '파비콘 지정';
|
||||
$lang->about_use_favicon = '16 x 16 크기의<em>*.ico</em> 파일 업로드 권장.';
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ $lang->input_footer_script = 'Alt (footer) Script Eklemek';
|
|||
$lang->detail_input_footer_script = 'Script alt tarafa eklenmiştir. Yönetici sayfası çalışmıyor.';
|
||||
$lang->corp = 'Crop (Kesme)';
|
||||
$lang->ratio = 'Ratio(Yüzde Ayarı)';
|
||||
$lang->admin_ip_limit = 'Yönetici sayfasına ulaşabileceğiniz IP aralığını belirleyiniz.';
|
||||
$lang->admin_ip_allow = 'Yönetici sayfasına ulaşabileceğiniz IP aralığını belirleyiniz.';
|
||||
$lang->local_ip_address = 'Yerel IP adresi';
|
||||
$lang->about_admin_ip_limit = 'Sadece bu IP adresi üzerinden yönetici sayfasına erişim mümkündür.IP-bant bilgileri /files/config/db.config.php dosyasında saklanır. Satıra birden fazla öğe girin.';
|
||||
$lang->detail_about_ftp_info = 'Kolay kurulum sağlayan FTP bilgilerini girdiğinizde. FTP bilgi, dosya / config / ftp.config.php dosyasında saklanır. Kolay yükleme sizin için mümkün değilse, PHP\'nin safe_mode ayarını On şeklinde değiştiriniz.';
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ $lang->input_footer_script = '输入页脚脚本';
|
|||
$lang->detail_input_footer_script = '该脚本将被插入到页面的底部. 页面管理将无效.';
|
||||
$lang->corp = '裁剪';
|
||||
$lang->ratio = '缩放';
|
||||
$lang->admin_ip_limit = '后台IP绑定';
|
||||
$lang->admin_ip_allow = '后台IP绑定';
|
||||
$lang->local_ip_address = '本地IP地址';
|
||||
$lang->about_admin_ip_limit = '请注意,只有绑定的IP才能访问后台。IP信息将保存在 /files/config/db.config.php. 每行一个IP。';
|
||||
$lang->detail_about_ftp_info = '当设定FTP信息来启用快捷安装。FTP的信息保存在 /files/config/ftp.config.php. 如果不启用快捷安装,请务必将开启PHP安全模式';
|
||||
|
|
|
|||
|
|
@ -20,10 +20,17 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="admin_allowed_ip">{$lang->admin_ip_limit} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_admin_iplist" target="_blank">{$lang->help}</a></label>
|
||||
<label class="x_control-label" for="admin_allowed_ip">{$lang->admin_ip_allow}</label>
|
||||
<div class="x_controls">
|
||||
<textarea name="admin_allowed_ip" id="admin_allowed_ip" rows="4" cols="42" placeholder="{$remote_addr} ({$lang->local_ip_address})" style="margin-right:10px">{$admin_allowed_ip}</textarea>
|
||||
<p class="x_help-block">{$lang->about_ipaddress_input}</p>
|
||||
<p class="x_help-block">{$lang->about_admin_ip_allow}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="admin_denied_ip">{$lang->admin_ip_deny}</label>
|
||||
<div class="x_controls">
|
||||
<textarea name="admin_denied_ip" id="admin_denied_ip" rows="4" cols="42" style="margin-right:10px">{$admin_denied_ip}</textarea>
|
||||
<p class="x_help-block">{$lang->about_admin_ip_deny}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_clearfix btnArea">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue