Skip to content

Commit

Permalink
2.3.0
Browse files Browse the repository at this point in the history
Joomla 5.x compatibility
  • Loading branch information
conseilgouz committed Jul 15, 2023
1 parent 0e9825d commit 49cb40e
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 18 deletions.
4 changes: 2 additions & 2 deletions cgsecureinstaller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension version="4.0" type="plugin" group="system" method="upgrade">
<name>plgcgsecureinstaller</name>
<author>ConseilGouz</author>
<creationDate>2023-03-28</creationDate>
<creationDate>2023-07-15</creationDate>
<copyright>(C)2023 ConseilGouz. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<version>2.2.8</version>
<version>2.3.0</version>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<description>CG Secure</description>
<scriptfile>script.install.php</scriptfile>
Expand Down
11 changes: 11 additions & 0 deletions com_cgsecure_changelog.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<changelogs>
<changelog>
<element>com_cgsecure</element>
<type>package</type>
<version>2.3.0</version>
<note>
<item>Update : 15/07/2023</item>
</note>
<fix>
<item>Joomla 5.x compatibility</item>
</fix>
</changelog>
<changelog>
<element>com_cgsecure</element>
<type>package</type>
Expand Down
2 changes: 1 addition & 1 deletion packages/com_cgsecure/admin/src/View/Config/JsonView.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function display($tpl = null) {
}
$arr = [];
$arr['retour'] = $msg;
echo new \JResponseJson($arr);
echo new JsonResponse($arr);
}
// delete CG Secure information in .htaccess file
private function delHTAccess() {
Expand Down
6 changes: 3 additions & 3 deletions packages/com_cgsecure/admin/tmpl/config/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<div id="j-main-container">
<?php endif;?>
<div class="nr-main-header">
<h2><?php echo JText::_('CGSECURE_CONFIG'); ?></h2>
<p><?php echo JText::_('CGSECURE_CONFIG_DESC'); ?></p>
<h2><?php echo Text::_('CGSECURE_CONFIG'); ?></h2>
<p><?php echo Text::_('CGSECURE_CONFIG_DESC'); ?></p>
</div>
<div class="nr-main-content">
<form action="<?php echo Route::_('index.php?option=com_cgsecure&view=config'); ?>" method="post" name="adminForm" id="adminForm" class="form-validate">
Expand All @@ -46,7 +46,7 @@

foreach ($this->form->getFieldSets() as $key => $fieldset)
{
echo HTMLHelper::_('uitab.addTab', 'tab', $fieldset->name, JText::_($fieldset->label));
echo HTMLHelper::_('uitab.addTab', 'tab', $fieldset->name, Text::_($fieldset->label));
echo $this->form->renderFieldSet($fieldset->name);
echo HTMLHelper::_('uitab.endTab');
}
Expand Down
10 changes: 5 additions & 5 deletions packages/com_cgsecure/admin/tmpl/logs/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@
<input type="checkbox" name="toggle" value="" title="<?php echo Text::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
</th>
<th width="5%" class="center">
<?php echo JHtml::_('grid.sort', 'COM_CGSECURE_ID', 'a.id', $listDirn, $listOrder); ?>
<?php echo HTMLHelper::_('grid.sort', 'COM_CGSECURE_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
<th width="15%" class="center">
<?php echo JHtml::_('grid.sort', 'COM_CGSECURE_IP', 'a.ip', $listDirn, $listOrder); ?>
<?php echo HTMLHelper::_('grid.sort', 'COM_CGSECURE_IP', 'a.ip', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="center">
<?php echo JHtml::_('grid.sort', 'COM_CGSECURE_COUNTRY', 'a.country', $listDirn, $listOrder); ?>
<?php echo HTMLHelper::_('grid.sort', 'COM_CGSECURE_COUNTRY', 'a.country', $listDirn, $listOrder); ?>
</th>
<th width="20%" class="center">
<?php echo JHtml::_('grid.sort', 'COM_CGSECURE_LOGS_ACTION', 'a.action', $listDirn, $listOrder); ?>
<?php echo HTMLHelper::_('grid.sort', 'COM_CGSECURE_LOGS_ACTION', 'a.action', $listDirn, $listOrder); ?>
</th>
<th width="20%" class="center">
<?php echo JHtml::_('grid.sort', 'COM_CGSECURE_LOGS_ATTEMPTDATE', 'a.attempt_date', $listDirn, $listOrder); ?>
<?php echo HTMLHelper::_('grid.sort', 'COM_CGSECURE_LOGS_ATTEMPTDATE', 'a.attempt_date', $listDirn, $listOrder); ?>
</th>


Expand Down
4 changes: 2 additions & 2 deletions packages/com_cgsecure/cgsecure.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="4.0" method="upgrade">
<name>COM_CGSECURE</name>
<creationDate>2023-03-28</creationDate>
<creationDate>2023-07-15</creationDate>
<author>ConseilGouz</author>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<copyright>Copyright (C) 2023 ConseilGouz.com. All Rights Reserved</copyright>
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>2.2.8</version>
<version>2.3.0</version>
<namespace path="src">ConseilGouz\Component\CGSecure</namespace>
<description>COM_CGSECURE_XML_DESCRIPTION</description>
<install>
Expand Down
8 changes: 5 additions & 3 deletions packages/com_cgsecure/media/cg_no_robot/index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @component CG Secure
* Version : 2.1.5
* Version : 2.3.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @copyright (C) 2022 ConseilGouz. All Rights Reserved.
* @author ConseilGouz
Expand All @@ -10,6 +10,8 @@
*/
use Joomla\CMS\Log\Log;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;

const _JEXEC = 1;
define('BLACKHOLE_PATH', dirname(__FILE__) .'/');

Expand Down Expand Up @@ -86,14 +88,14 @@ function blackhole_sanitize($string) {
<title>Erreur: CG Secure HtAccess Blocked</title></head>';
$tmp = '<style>.text-center {text-align: center !important;}.align-self-center{align-self: center !important;}</style>';
$tmp .= '<body class="error-page" style="" ><div class="text-center align-self-center">';
$tmp .= '<h1>'.JText::_('CGSECURE_MSG_H1').'</h1>';
$tmp .= '<h1>'.Text::_('CGSECURE_MSG_H1').'</h1>';
$tmp .= '<div>' ;
$prefixe = $_SERVER['SERVER_NAME'];
$prefixe = substr(str_replace('www.','',$prefixe),0,2);
$ctl = false;
$errtype = "e"; // supposed blocking error
// init error message
$err = JText::sprintf('CGSECURE_MSG_BAD',$ua);
$err = Text::sprintf('CGSECURE_MSG_BAD',$ua);
$tmp .= $err.'</div></body></html>';
echo $tmp;
$err = $prefixe.$errtype.'-'.$err;
Expand Down
4 changes: 2 additions & 2 deletions packages/plg_system_cgsecure/cgsecure.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @package CGSecure
* from karebu secure (kSesure)
* Version : 2.2.6
* Version : 2.3.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @copyright (C) 2023 ConseilGouz. All Rights Reserved.
* @author ConseilGouz
Expand Down Expand Up @@ -66,7 +66,7 @@ function onAfterDispatch()
{
if (substr(php_sapi_name(), 0, 3) == 'cgi')
{
Factory::getApplication()->enqueueMessage(JText::_('CG_SECURE_NOT_APACHE_HANDLER'),'error');
Factory::getApplication()->enqueueMessage(Text::_('CG_SECURE_NOT_APACHE_HANDLER'),'error');
return true;
}

Expand Down

0 comments on commit 49cb40e

Please sign in to comment.