Skip to content

Commit

Permalink
3.0.12
Browse files Browse the repository at this point in the history
Admin : block simultaneous updates
Recreate button : check activation value
  • Loading branch information
conseilgouz committed Mar 13, 2024
1 parent 78e1f6b commit 1c29f6b
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 25 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>2024-03-11</creationDate>
<creationDate>2024-03-13</creationDate>
<copyright>(C)2024 ConseilGouz. All rights reserved.</copyright>
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<version>3.0.11</version>
<version>3.0.12</version>
<description>CG Secure</description>
<scriptfile>script.install.php</scriptfile>
<files>
Expand Down
12 changes: 12 additions & 0 deletions com_cgsecure_changelog.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<changelogs>
<changelog>
<element>com_cgsecure</element>
<type>package</type>
<version>3.0.12</version>
<note>
<item>Update : 13/03/2024</item>
</note>
<fix>
<item>Admin : block simultaneous updates</item>
<item>Recreate button : check activation value</item>
</fix>
</changelog>
<changelog>
<element>com_cgsecure</element>
<type>package</type>
Expand Down
4 changes: 2 additions & 2 deletions packages/com_cgsecure/admin/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>2024-02-12</creationDate>
<creationDate>2024-03-13</creationDate>
<author>ConseilGouz</author>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<copyright>Copyright (C) 2024 ConseilGouz.com. All Rights Reserved</copyright>
<license>GNU/GPL Version 3 or later - https://www.gnu.org/licenses/gpl-3.0.html</license>
<version>3.0.9</version>
<version>3.0.12</version>
<namespace path="src">ConseilGouz\Component\CGSecure</namespace>
<description>COM_CGSECURE_XML_DESCRIPTION</description>
<install>
Expand Down
20 changes: 13 additions & 7 deletions packages/com_cgsecure/admin/src/View/Config/JsonView.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @component CG Secure
* Version : 3.0.11
* Version : 3.0.12
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
* @copyright (C) 2024 ConseilGouz. All Rights Reserved.
* @author ConseilGouz
Expand All @@ -11,15 +11,10 @@

defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\Registry\Registry;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\Filesystem\File;
use Joomla\Filesystem\Folder;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\AbstractView;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Response\JsonResponse;
use Exception;

Expand Down Expand Up @@ -50,6 +45,16 @@ public function display($tpl = null)
$access = (int)$input->get('access');
$this->security = $input->get('security');
$msg = "";

$wait = self::getServerConfigFilePath('.inprogress'); // create a temp. file to block other requests
if (file_exists($wait)) {
$arr = [];
$arr['retour'] = 'err : already in progress';
echo new JsonResponse($arr);
return;
}
$msg = 'wait...';
File::write($wait, $msg);
if ($type == 'robots') {
if ($access == 0) { // delete CG Secure lines from robots.txt file and delete cg_robots dir
$msg = $this->delRobots();
Expand All @@ -59,7 +64,7 @@ public function display($tpl = null)
} elseif ($type == 'htaccess') {
if ($access == 0) { // delete CG Secure lines from htaccess file
$msg = $this->delHTAccess();
$msg = $this->deleteIPSHTAccess();
$msg .= '<br>'.$this->deleteIPSHTAccess();
} elseif ($access == 1) {// add CG Secure lines to htaccess file
$msg = $this->addHTAccess();
// add .htaccess in images and media directories
Expand All @@ -68,6 +73,7 @@ public function display($tpl = null)
$msg = $this->deleteIPSHTAccess();
}
}
File::delete($wait);
$arr = [];
$arr['retour'] = $msg;
echo new JsonResponse($arr);
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>2024-03-11</creationDate>
<creationDate>2024-03-13</creationDate>
<author>ConseilGouz</author>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<copyright>Copyright (C) 2024 ConseilGouz.com. All Rights Reserved</copyright>
<license>GNU/GPL Version 3 or later - https://www.gnu.org/licenses/gpl-3.0.html</license>
<version>3.0.11</version>
<version>3.0.12</version>
<namespace path="src">ConseilGouz\Component\CGSecure</namespace>
<description>COM_CGSECURE_XML_DESCRIPTION</description>
<install>
Expand Down
12 changes: 8 additions & 4 deletions packages/com_cgsecure/media/js/reload.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* @component CG Secure
* Version : 2.1.5
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @copyright (C) 2022 ConseilGouz. All Rights Reserved.
* Version : 3.0.12
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
* @copyright (C) 2024 ConseilGouz. All Rights Reserved.
* @author ConseilGouz
**/
var timeout;
Expand All @@ -18,7 +18,9 @@ jQuery(document).ready(function($){
} else { // already exists
$security = $('input[id="jform_security"]').val();
}
create_htaccess($,1,$security); // create htaccess
$access = 0;
if ($('input[id="jform_htaccess1"]').hasClass('active')) $access= 1;
create_htaccess($,$access,$security); // create htaccess
})
});
function create_htaccess($,access,security) {
Expand All @@ -27,7 +29,9 @@ function create_htaccess($,access,security) {
data: { [token]: "1", task: "display", format: "json",type: "htaccess", access: access, security: security },
success: function(result, status, xhr) {
res = result.data.retour;
console.log('res : '+res);
$('#cg_result').html(res);
if (res.startsWith('err :')) return; // contains an error : exit
Joomla.submitbutton('config.apply'); // force save config.
},
error: function(message) {console.log(message.responseText)}
Expand Down
4 changes: 2 additions & 2 deletions packages/library_cgsecure/cgsecure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<name>CGSecure Library</name>
<libraryname>cgsecure</libraryname>
<author>ConseilGouz</author>
<version>3.0.11</version>
<creationDate>2024-03-11</creationDate>
<version>3.0.12</version>
<creationDate>2024-03-13</creationDate>
<copyright>(C)2024 ConseilGouz. All rights reserved.</copyright>
<license>GNU General Public License version 3 or later; https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
Expand Down
4 changes: 2 additions & 2 deletions packages/plg_authentication_cgsecure/cgsecure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension version="4.0" type="plugin" group="authentication" method="upgrade">
<name>PLG_AUTH_COUNTRY</name>
<author>ConseilGouz</author>
<creationDate>2024-03-11</creationDate>
<creationDate>2024-03-13</creationDate>
<copyright>(C)2024 ConseilGouz. All rights reserved.</copyright>
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<version>3.0.11</version>
<version>3.0.12</version>
<description>PLG_AUTH_COUNTRY_XML_DESCRIPTION</description>
<files>
<filename plugin="cgsecure">cgsecure.php</filename>
Expand Down
4 changes: 2 additions & 2 deletions packages/plg_system_cgsecure/cgsecure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension type="plugin" group="system" method="upgrade" version="4.0">
<name>System - CG Secure</name>
<author>conseilgouz</author>
<creationDate>2024-03-11</creationDate>
<creationDate>2024-03-13</creationDate>
<copyright>(C)2024 ConseilGouz. All rights reserved.</copyright>
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<version>3.0.11</version>
<version>3.0.12</version>
<description>CG_SECURE_DESC</description>
<files>
<filename plugin="cgsecure">cgsecure.php</filename>
Expand Down
4 changes: 2 additions & 2 deletions packages/plg_user_cgsecure/cgsecure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension version="4.0" type="plugin" group="user" method="upgrade">
<name>CG_COUNTRY</name>
<author>ConseilGouz</author>
<creationDate>2024-03-11</creationDate>
<creationDate>2024-03-13</creationDate>
<copyright>(C)2024 ConseilGouz. All rights reserved.</copyright>
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<version>3.0.11</version>
<version>3.0.121</version>
<description>CG_COUNTRY_XML_DESCRIPTION</description>
<files>
<filename plugin="cgsecure">cgsecure.php</filename>
Expand Down

0 comments on commit 1c29f6b

Please sign in to comment.