mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-30 15:52:17 +09:00
Allow sitelock immediately after install (#160)
This commit is contained in:
parent
9e9b09464f
commit
605fdec1a2
10 changed files with 84 additions and 10 deletions
|
|
@ -153,9 +153,31 @@ class installView extends install
|
|||
|
||||
// Always use SSL if installing via SSL.
|
||||
Context::set('use_ssl', RX_SSL ? 'always' : 'none');
|
||||
Context::set('sitelock_ip_range', $this->detectUserIPRange());
|
||||
$this->setTemplateFile('other_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect the IP range of the user.
|
||||
*/
|
||||
function detectUserIPRange()
|
||||
{
|
||||
if (RX_CLIENT_IP_VERSION === 4)
|
||||
{
|
||||
return preg_replace('/\.\d+$/', '.*', RX_CLIENT_IP);
|
||||
}
|
||||
elseif (function_exists('inet_pton'))
|
||||
{
|
||||
$binary = inet_pton(RX_CLIENT_IP);
|
||||
$binary = substr($binary, 0, 8) . str_repeat(chr(0), 8);
|
||||
return inet_ntop($binary) . '/64';
|
||||
}
|
||||
else
|
||||
{
|
||||
return RX_CLIENT_IP;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect best time zone for the user.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue