You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-05-25 20:57:11

jetriixsm
Member
Registered: 2024-05-25
Posts: 14

CSRF Error When i try to activate my plugin

Hello im developing a plugin i followed all the steps from the documentation the problem is when i try to activate the plugin glpi show me an error "¡Complement Whatsapp with CSRF incompatible!" idk why in my setup.php file i have this:

<?php
define('Whatsapp_Version','1.0.0');
function plugin_init_whatsappapi(){
    global $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['csrf_compliant']['whatsappapi'] = true;
    $PLUGIN_HOOKS['item_add']['whatsappapi'] = ['Ticket' => 'Whatsapp_ticket__updateitem_called'];
    $PLUGIN_HOOKS['item_update']['whatsappapi'] = ['Ticket' => 'Whatsapp_ticket__updateitem_called'];
}
 function plugin_version_whatsappapi(){
    return[
        'name'          =>  'Whatsapp',
        'version'       => '1.0.0',
        'author'        => 'Julian ',
        'license'       => 'GPLv2+',
        'requirements'  => [
            'glpi'   => [
            'min'    => '9.1'
            ]
         ]
    ];
 }
?>

Error(this happend when i try to activate the plugin):
FluxBB bbcode test

Offline

#2 2024-05-25 23:30:11

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,809
Website

Re: CSRF Error When i try to activate my plugin

Which version of GLPI are you testing the plugin with?


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#3 2024-05-27 17:24:18

jetriixsm
Member
Registered: 2024-05-25
Posts: 14

Re: CSRF Error When i try to activate my plugin

cconard96 wrote:

Which version of GLPI are you testing the plugin with?

im currently using GLPI 10.0.12

Offline

#4 2024-05-27 19:09:09

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,809
Website

Re: CSRF Error When i try to activate my plugin

Is the plugin located in "plugins/whatsappapi" or "marketplace/whatsappapi" with the setup.php and hook.php files directly inside the plugin folder?


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#5 2024-05-27 19:21:36

jetriixsm
Member
Registered: 2024-05-25
Posts: 14

Re: CSRF Error When i try to activate my plugin

cconard96 wrote:

Is the plugin located in "plugins/whatsappapi" or "marketplace/whatsappapi" with the setup.php and hook.php files directly inside the plugin folder?

its located in plugins/whatsappapi

FluxBB bbcode test

Last edited by jetriixsm (2024-05-27 22:11:02)

Offline

#6 2024-05-28 14:07:26

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,809
Website

Re: CSRF Error When i try to activate my plugin

The plugin folder name is case sensitive I believe. It has to match the internal name you choose for your plugin exactly. You would need to use "whatsappapi" for both the plugin folder name and the code.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#7 2024-05-28 17:25:20

jetriixsm
Member
Registered: 2024-05-25
Posts: 14

Re: CSRF Error When i try to activate my plugin

cconard96 wrote:

The plugin folder name is case sensitive I believe. It has to match the internal name you choose for your plugin exactly. You would need to use "whatsappapi" for both the plugin folder name and the code.

Thanks u so much bro, that was the error. After change the name folder i could activate the plugin

Offline

#8 2024-09-16 18:56:07

teqo.it
Member
Registered: 2023-10-04
Posts: 2

Re: CSRF Error When i try to activate my plugin

hello can you share the link of plugin.

Offline

Board footer

Powered by FluxBB