Skip to content

Commit

Permalink
Update to 1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
denysdesign committed Mar 23, 2018
1 parent b80c86d commit 9eed189
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 47 deletions.
88 changes: 44 additions & 44 deletions jumobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function onAfterRender()
return true;
}

if(@$_COOKIE['jumobi'] == '0')
if(@$_COOKIE[$this->params->get('cookiename')] == '0')
{
return true;
}
Expand Down Expand Up @@ -138,6 +138,48 @@ public function onAfterRender()
return true;
}

/**
*
* @return string
*
* @since 1.0
*/
private function get_ip()
{
if(!empty(getenv('HTTP_CLIENT_IP')))
{
$ipaddress = getenv('HTTP_CLIENT_IP');
}
elseif(!empty(getenv('HTTP_X_FORWARDED_FOR')))
{
$ipaddress = getenv('HTTP_X_FORWARDED_FOR');
}
elseif(!empty(getenv('HTTP_X_FORWARDED')))
{
$ipaddress = getenv('HTTP_X_FORWARDED');
}
elseif(!empty(getenv('HTTP_FORWARDED_FOR')))
{
$ipaddress = getenv('HTTP_FORWARDED_FOR');
}
elseif(!empty(getenv('HTTP_FORWARDED')))
{
$ipaddress = getenv('HTTP_FORWARDED');
}
elseif(!empty(getenv('REMOTE_ADDR')))
{
$ipaddress = getenv('REMOTE_ADDR');
}
else
{
$ipaddress = 'UNKNOWN';
}

$ips = explode(',', $ipaddress);

return trim($ips[0]);
}

/**
*
* @return bool
Expand All @@ -154,7 +196,7 @@ public function onAfterInitialise()
return true;
}

if(@$_COOKIE['jumobi'] == '0')
if(@$_COOKIE[$this->params->get('cookiename')] == '0')
{
return true;
}
Expand Down Expand Up @@ -285,46 +327,4 @@ public function onAfterInitialise()

return true;
}

/**
*
* @return string
*
* @since 1.0
*/
private function get_ip()
{
if(!empty(getenv('HTTP_CLIENT_IP')))
{
$ipaddress = getenv('HTTP_CLIENT_IP');
}
elseif(!empty(getenv('HTTP_X_FORWARDED_FOR')))
{
$ipaddress = getenv('HTTP_X_FORWARDED_FOR');
}
elseif(!empty(getenv('HTTP_X_FORWARDED')))
{
$ipaddress = getenv('HTTP_X_FORWARDED');
}
elseif(!empty(getenv('HTTP_FORWARDED_FOR')))
{
$ipaddress = getenv('HTTP_FORWARDED_FOR');
}
elseif(!empty(getenv('HTTP_FORWARDED')))
{
$ipaddress = getenv('HTTP_FORWARDED');
}
elseif(!empty(getenv('REMOTE_ADDR')))
{
$ipaddress = getenv('REMOTE_ADDR');
}
else
{
$ipaddress = 'UNKNOWN';
}

$ips = explode(',', $ipaddress);

return trim($ips[0]);
}
}
11 changes: 9 additions & 2 deletions jumobile.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin" group="system" method="upgrade">
<name>PLG_SYSTEM_JUMOBILE</name>
<creationDate>12.02.2018</creationDate>
<creationDate>23.03.2018</creationDate>
<author>Denys Nosov</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://joomla-ua.org</authorUrl>
<version>1.8.3</version>
<version>1.8.4</version>
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<copyright>(C) 2016-2018 Joomla! Ukraine. All rights reserved.</copyright>
<description>PLG_SYSTEM_JUMOBILE_XML_DESCRIPTION</description>
Expand Down Expand Up @@ -141,6 +141,13 @@
label="PLG_SYSTEM_JUMOBILE_EXPIRES_TIME"
/>

<field
name="cookiename"
label="PLG_SYSTEM_JUMOBILE_COOKIE_NAME"
type="text"
default="jumobile"
/>

<field
name="devmode"
class="btn-group"
Expand Down
3 changes: 2 additions & 1 deletion language/en-GB.plg_system_jumobile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ PLG_SYSTEM_JUMOBILE_CACHE="Allow Brawser Cache"
PLG_SYSTEM_JUMOBILE_PRAGMA="Pragma"
PLG_SYSTEM_JUMOBILE_CC="Cache-Control"
PLG_SYSTEM_JUMOBILE_EXPIRES="Expires"
PLG_SYSTEM_JUMOBILE_EXPIRES_TIME="Expires time"
PLG_SYSTEM_JUMOBILE_EXPIRES_TIME="Expires time"
PLG_SYSTEM_JUMOBILE_COOKIE_NAME="Cookie name"

0 comments on commit 9eed189

Please sign in to comment.