PATH:
home
/
centosnipponia
/
public_html
/
nipponiacom2
/
administrator
/
components
/
com_georedirects
<?php /** * @package Website GEO Redirects for Joomla * @copyright Copyright (C) 2019 SiteGuarding.com. All rights reserved. * @GNU General Public License */ defined( '_JEXEC' ) or die; ini_set("display_errors", "Off"); if (version_compare(JVERSION, '3.0', '<')) { if (JFactory::getApplication()->get('jquery') !== true) { // Load jQuery in no conflict mode with B/C support JHtml::script('../media/com_georedirects/jquery.min.js'); JHtml::script('../media/com_georedirects/jquery-migrate.min.js'); JHtml::script('../media/com_georedirects/jquery-noconflict.js'); JFactory::getApplication()->set('jquery', true); } } else { JHtml::_('jquery.framework'); // load jquery JHtml::_('jquery.ui'); } $document = JFactory::getDocument(); $document->addStyleSheet('../media/com_georedirects/semantic.min.css'); $document->addScript('../media/com_georedirects/semantic.min.js'); JToolBarHelper::title( JText::_( 'Website GEO Redirects for Joomla' )); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') define("DIRSEP", '\\'); else define("DIRSEP", '/'); $app = JFactory::getApplication(); $postData = $app->input->post->getArray(); if (isset($postData['submit'])) gpjm_check_action(); $params = gpjm_Get_Params(); $params['redirects'] = isset($params['redirects']) ? @json_decode($params['redirects'], true) : array(); //print_r($params); $myIP = $_SERVER["REMOTE_ADDR"]; if (isset($_SERVER["HTTP_X_REAL_IP"])) $myIP = $_SERVER["HTTP_X_REAL_IP"]; if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) $myIP = $_SERVER["HTTP_X_FORWARDED_FOR"]; if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) $myIP = $_SERVER["HTTP_CF_CONNECTING_IP"]; if (isset($_SERVER['HTTP_X_SUCURI_CLIENTIP'])) $myIP = $_SERVER['HTTP_X_SUCURI_CLIENTIP']; if (!class_exists('GEO_JM_Geo_IP2Country')) { include_once 'geo.php'; } if (filter_var($myIP, FILTER_VALIDATE_IP)) { $geo = new GEO_JM_Geo_IP2Country(); $myCountryCode = $geo->getCountryByIP($myIP); $myCountry = $geo->getNameByCountryCode($myCountryCode) ? $geo->getNameByCountryCode($myCountryCode) : ''; } ?> <style> td.redirect { padding: 5px!important; } .redirect .form input{height: 35px!important;} </style> <div class="sixteen wide column settblocks" id="block2"> <div class="ui segment"> <div class="welcome-panel-content"> <h1 style="text-align: center;">Joomla Security Tools</h1> <p style="text-align: center;"> <a target="_blank" href="https://www.siteguarding.com/en/security-dashboard?pgid=JGE2" target="_blank"><img src="<?php echo '../media/com_georedirects/images/b10.png'; ?>" /></a> <a target="_blank" href="https://www.siteguarding.com/en/security-dashboard?pgid=JGE2" target="_blank"><img src="<?php echo '../media/com_georedirects/images/b11.png'; ?>" /></a> <a target="_blank" href="https://www.siteguarding.com/en/security-dashboard?pgid=JGE2" target="_blank"><img src="<?php echo '../media/com_georedirects/images/b12.png'; ?>" /></a> <a target="_blank" href="https://www.siteguarding.com/en/security-dashboard?pgid=JGE2" target="_blank"><img src="<?php echo '../media/com_georedirects/images/b13.png'; ?>" /></a> <a target="_blank" href="https://www.siteguarding.com/en/security-dashboard?pgid=JGE2" target="_blank"><img src="<?php echo '../media/com_georedirects/images/b14.png'; ?>" /></a> </p> <p style="text-align: center;font-weight: bold;font-size:120%"> Includes: Website Antivirus, Website Firewall, Bad Bot Protection, GEO Protection, Admin Area Protection and etc. </p> <p style="text-align: center"> <a class="ui green button" target="_blank" href="https://www.siteguarding.com/en/security-dashboard?pgid=JGE2">Secure Your Website</a> </p> </div> </div> <h2 class="sg_center ui header">Website GEO Redirects for Joomla<span class="ui red horizontal mini label">free version</span></h2> <div class="ui info large message"> <b>Please note free version has some limits.</b> <br><br> Full version of GEO Website Protection is the security extension to limit access from unwanted counties. You will have: GEO Blocking, GEO Redirect, Graphs by blocked countries (last 24 hours, last 7 days, last 30 days), It’s easy to setup and free to use, Free support.<br> <center><a class="ui green mini button" target="_blank" href="https://www.siteguarding.com/en/buy-extention/joomla-geo-website-protection">Get Full Version</a></center> </div> <div class="ui segment"> <form method="post" action="index.php?option=com_georedirects"> <p>You can redirect the visitors from selected countries to specific page of your website or another domain.</p> <table class="ui single line selectable table"> <thead> <tr> <th>Country</th> <th>Redirect URL</th> </tr> </thead> <tbody> <?php foreach (GEO_JM_Geo_IP2Country::$country_list as $country_code => $country_name) { ?> <tr> <td class="two wide"><?php echo $country_name; ?></td> <td class="redirect"> <div class="ui form"> <input class="ui input sixteen wide field" placeholder="e.g. /contact-us or http://www.google.com/search" type="text" name="redirects[<?php echo $country_code; ?>]" value="<?php if (isset($params['redirects'][$country_code])) echo $params['redirects'][$country_code]; ?>"> </div> </td> </tr> <?php } ?> </tbody> </table> <input type="hidden" name="action" value="save_redirects"/> <center><input type="submit" name="submit" id="submit" class="ui green big button" value="Save & Apply"></center> </form> </div> </div> <?php function gpjm_check_action() { $app = JFactory::getApplication(); $postData = $app->input->post->getArray(); $action = ''; if (isset($_REQUEST['action'])) $action = trim($_REQUEST['action']); // Actions if ($action != '') { $action_message = ''; $message_type = ''; $params = gpjm_Get_Params(); switch ($action) { case 'save_redirects': $params['redirects'] = isset($postData['redirects']) ? array_filter($postData['redirects']) : array(); if (count($params['redirects']) > 5) { $action_message = 'Free version limit is 5 countries, ' . count($params['redirects']) . ' countries selected. Please get full version. <a target="_blank" href="https://www.siteguarding.com/en/buy-extention/joomla-geo-website-redirects">Full Version</a>'; $message_type = 'alert'; } else { $params['redirects'] = json_encode($params['redirects']); $action_message = 'GEO Redirects settings saved'; $message_type = 'ok'; gpjm_Set_Params($params); } break; } if ($action_message != '') { $message_data = array( 'type' => 'info_white', 'header' => '', 'message' => $action_message, 'button_text' => '', 'button_url' => '', 'help_text' => '' ); if ($message_type != '') $message_data['type'] = $message_type; echo '<div style="width:100%;margin-top: 10px;margin-bottom: 30px;">'; gpjm_PrintIconMessage($message_data); echo '</div>'; } } return gpjm_Get_Params(); } function gpjm_PrintIconMessage($data) { $rand_id = "id_".rand(1,10000).'_'.rand(1,10000); if ($data['type'] == '' || $data['type'] == 'alert') {$type_message = 'negative'; $icon = 'warning sign';} if ($data['type'] == 'ok') {$type_message = 'green'; $icon = 'checkmark box';} if ($data['type'] == 'info') {$type_message = 'yellow'; $icon = 'info';} if ($data['type'] == 'info_white') {$type_message = ''; $icon = 'info';} ?> <div class="ui large icon <?php echo $type_message; ?> message"> <i class="<?php echo $icon; ?> icon"></i> <div class="msg_block_row"> <?php if ((isset($data['button_text']) && $data['button_text'] != '') || (isset($data['help_text']) && $data['help_text'] != '')) { ?> <div class="msg_block_txt"> <?php if ($data['header'] != '') { ?> <div class="header"><?php echo $data['header']; ?></div> <?php } ?> <?php if ($data['message'] != '') { ?> <p><?php echo $data['message']; ?></p> <?php } ?> </div> <div class="msg_block_btn"> <?php if ($data['help_text'] != '') { ?> <a class="link_info" href="javascript:;" onclick="InfoBlock('<?php echo $rand_id; ?>');"><i class="help circle icon"></i></a> <?php } ?> <?php if ($data['button_text'] != '') { if (!isset($data['button_url_target']) || $data['button_url_target'] == true) $new_window = 'target="_blank"'; else $new_window = ''; ?> <a class="mini ui green button" <?php echo $new_window; ?> href="<?php echo $data['button_url']; ?>"><?php echo $data['button_text']; ?></a> <?php } ?> </div> <?php if ($data['help_text'] != '') { ?> <div style="clear: both;"></div> <div id="<?php echo $rand_id; ?>" style="display: none;"> <div class="ui divider"></div> <p><?php echo $data['help_text']; ?></p> </div> <?php } ?> <?php } else { ?> <?php if (isset($data['header']) && $data['header'] != '') { ?> <div class="header"><?php echo $data['header']; ?></div> <?php } ?> <?php if ($data['message'] != '') { ?> <p><?php echo $data['message']; ?></p> <?php } ?> <?php } ?> </div> </div> <?php } function gpjm_Get_Params() { if (!is_file(__DIR__ . DIRSEP . 'settings.php')) gpjm_Set_Params(false); $content = file_get_contents(__DIR__ . DIRSEP . 'settings.php'); return json_decode($content, true); } function gpjm_Set_Params($params) { if(!$params) { $params = array(); $params['redirects'] = ''; } $line = json_encode($params); $fp = fopen(dirname(__FILE__).'/settings.php', 'w'); fwrite($fp, $line); fclose($fp); }
[+]
..
[-] com_redirects.xml
[edit]
[-] geo.check.redirect.php
[edit]
[-] geo.mmdb
[edit]
[-] geo.php
[edit]
[-] georedirects.php
[edit]
[-] index.html
[edit]
[-] script.php
[edit]
[-] settings.php
[edit]
[-] .htaccess.disabled
[edit]