Skip to content

Commit

Permalink
Merge pull request #46 from ticgal/revert-45-bugfix/sanitizedSecret
Browse files Browse the repository at this point in the history
Revert "Bugfix/sanitized secret"
  • Loading branch information
FrancisTicgal authored Apr 9, 2024
2 parents 1844fde + 2bf294d commit 9d4812b
Show file tree
Hide file tree
Showing 11 changed files with 419 additions and 615 deletions.
4 changes: 0 additions & 4 deletions css/link.css

This file was deleted.

64 changes: 31 additions & 33 deletions front/config.form.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<?php

/**
* -------------------------------------------------------------------------
* OneTimeSecret plugin for GLPI
* Copyright (C) 2021-2024 by the TICgal Team.
* https://www.tic.gal
* -------------------------------------------------------------------------
* LICENSE
* This file is part of the OneTimeSecret plugin.
* OneTimeSecret plugin is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* OneTimeSecret plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with OneTimeSecret. If not, see
* <http: //www.gnu.org/licenses />.
* -------------------------------------------------------------------------
* @package OneTimeSecret
* @author the TICgal team
* @copyright Copyright (c) 2021-2024 TICgal team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link https://www.tic.gal
* @since 2021
* -------------------------------------------------------------------------
*/
/*
-------------------------------------------------------------------------
OneTimeSecret plugin for GLPI
Copyright (C) 2021-2023 by the TICgal Team.
https://www.tic.gal
-------------------------------------------------------------------------
LICENSE
This file is part of the OneTimeSecret plugin.
OneTimeSecret plugin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
OneTimeSecret plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OneTimeSecret. If not, see
<http: //www.gnu.org/licenses />.
--------------------------------------------------------------------------
@package OneTimeSecret
@author the TICgal team
@copyright Copyright (c) 2021-2023 TICgal team
@license AGPL License 3.0 or (at your option) any later version
http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link https://www.tic.gal
@since 2021-2023
----------------------------------------------------------------------
*/

include('../../../inc/includes.php');

Expand All @@ -42,10 +42,8 @@
$config = new PluginOnetimesecretConfig();
if (isset($_POST["update"])) {
$config->check($_POST['id'], UPDATE);
$_POST["apikey"] = (new GLPIKey())->encrypt($_POST["apikey"]);
$config->update($_POST);
Html::back();
}

$redirect = $CFG_GLPI["root_doc"] . "/front/config.form.php";
$redirect .= "?forcetab=" . urlencode('PluginOnetimesecretConfig$1');
Html::redirect($redirect);
Html::redirect($CFG_GLPI["root_doc"] . "/front/config.form.php?forcetab=" . urlencode('PluginOnetimesecretConfig$1'));
58 changes: 29 additions & 29 deletions front/link.form.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<?php

/**
* -------------------------------------------------------------------------
* OneTimeSecret plugin for GLPI
* Copyright (C) 2021-2024 by the TICgal Team.
* https://www.tic.gal
* -------------------------------------------------------------------------
* LICENSE
* This file is part of the OneTimeSecret plugin.
* OneTimeSecret plugin is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* OneTimeSecret plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with OneTimeSecret. If not, see
* <http: //www.gnu.org/licenses />.
* -------------------------------------------------------------------------
* @package OneTimeSecret
* @author the TICgal team
* @copyright Copyright (c) 2021-2024 TICgal team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link https://www.tic.gal
* @since 2021
* -------------------------------------------------------------------------
*/
/*
-------------------------------------------------------------------------
OneTimeSecret plugin for GLPI
Copyright (C) 2021-2023 by the TICgal Team.
https://www.tic.gal
-------------------------------------------------------------------------
LICENSE
This file is part of the OneTimeSecret plugin.
OneTimeSecret plugin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
OneTimeSecret plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OneTimeSecret. If not, see
<http: //www.gnu.org/licenses />.
--------------------------------------------------------------------------
@package OneTimeSecret
@author the TICgal team
@copyright Copyright (c) 2021-2023 TICgal team
@license AGPL License 3.0 or (at your option) any later version
http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link https://www.tic.gal
@since 2021-2023
----------------------------------------------------------------------
*/

include('../../../inc/includes.php');

Expand Down
73 changes: 31 additions & 42 deletions hook.php
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
<?php

/**
* -------------------------------------------------------------------------
* OneTimeSecret plugin for GLPI
* Copyright (C) 2021-2024 by the TICgal Team.
* https://www.tic.gal
* -------------------------------------------------------------------------
* LICENSE
* This file is part of the OneTimeSecret plugin.
* OneTimeSecret plugin is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* OneTimeSecret plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with OneTimeSecret. If not, see
* <http: //www.gnu.org/licenses />.
* -------------------------------------------------------------------------
* @package OneTimeSecret
* @author the TICgal team
* @copyright Copyright (c) 2021-2024 TICgal team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link https://www.tic.gal
* @since 2021
* -------------------------------------------------------------------------
*/
/*
-------------------------------------------------------------------------
OneTimeSecret plugin for GLPI
Copyright (C) 2021-2023 by the TICgal Team.
https://www.tic.gal
-------------------------------------------------------------------------
LICENSE
This file is part of the OneTimeSecret plugin.
OneTimeSecret plugin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
OneTimeSecret plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OneTimeSecret. If not, see
<http: //www.gnu.org/licenses />.
--------------------------------------------------------------------------
@package OneTimeSecret
@author the TICgal team
@copyright Copyright (c) 2021-2023 TICgal team
@license AGPL License 3.0 or (at your option) any later version
http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link https://www.tic.gal
@since 2021-2023
----------------------------------------------------------------------
*/

/**
* plugin_onetimesecret_install
*
* @return bool
*/
function plugin_onetimesecret_install(): bool
function plugin_onetimesecret_install()
{
$migration = new Migration(PLUGIN_ONETIMESECRET_VERSION);

Expand All @@ -51,7 +46,6 @@ function plugin_onetimesecret_install(): bool
}
}
}

$conf = Config::getConfigurationValues('core', ['notifications_push']);
if (!isset($conf['notifications_push'])) {
Config::setConfigurationValues('core', ['notifications_push' => 0]);
Expand All @@ -60,12 +54,7 @@ function plugin_onetimesecret_install(): bool
return true;
}

/**
* plugin_onetimesecret_uninstall
*
* @return bool
*/
function plugin_onetimesecret_uninstall(): bool
function plugin_onetimesecret_uninstall()
{
$migration = new Migration(PLUGIN_ONETIMESECRET_VERSION);

Expand Down
Loading

0 comments on commit 9d4812b

Please sign in to comment.