derricksmith / phpsaml

GLPI Plugin - SAML integration using the Onelogin SAML Library
MIT License
32 stars 24 forks source link

Not able to install the plugin on the GLPI 10.0.1 #86

Closed rajesh-rengaraj closed 2 years ago

rajesh-rengaraj commented 2 years ago

Hi, derrick smith phpsaml plugin cannot install in GLPI 10.0.1. Please help me with this issue.

oswalvas commented 2 years ago

Hello, I also have the same issue.

alessandrocaetanob commented 2 years ago

Download the branch 1.2.0 and change the function plugin_phpsaml_check_prerequisites on setup.php line 68 from:

function plugin_phpsaml_check_prerequisites()
{

    if (version_compare(GLPI_VERSION, '9.4', 'lt') || version_compare(GLPI_VERSION, '10.0.0', 'gt')) {
        echo "This plugin requires GLPI >= 9.4 and GLPI <= 10.0.2";
        return false;
    }

    return true;
}

To

function plugin_phpsaml_check_prerequisites()
{

    if (version_compare(GLPI_VERSION, '9.4', 'lt') || version_compare(GLPI_VERSION, '10.0.2', 'gt')) {
        echo "This plugin requires GLPI >= 9.4 and GLPI <= 10.0.2";
        return false;
    }

    return true;
}

This will allow it to be installed on GLPI versions 9.4 to 10.0.2 with no problems.

derricksmith commented 2 years ago

Version 1.3 works with GLPI v10. I haven't created a release yet but you can download the branch.

swalker-aup commented 2 years ago

Hi Derrick,

I only see branch 1.2 listed (https://github.com/derricksmith/phpsaml/branches), but you've mentioned branch 1.3. Am I missing something?

Thanks for all the work you do on this project!

rajesh-rengaraj commented 2 years ago

Hi Derricksmith,

First of all thanks for the reply. I really appreciate your help As per your suggestions I have made the changes in the plugin. But during the installation am receiving the below error. Please help me with this issue.

error populate glpi_plugin_phpsaml_configs Incorrect integer value: '' for column glpi.glpi_plugin_phpsaml_configs.jit at row 1

Regards,

Rajesh R Network Team Mallow Technologies Private Limited

On 28-Jun-2022, at 9:28 PM, Alessandro Caetano Beltrão @.***> wrote:

Download the branch 1.2.0 https://github.com/derricksmith/phpsaml/tree/Version-1.2.0 and change the function plugin_phpsaml_check_prerequisites on setup.php line 68 from:

function plugin_phpsaml_check_prerequisites() {

if (version_compare(GLPI_VERSION, '9.4', 'lt') || version_compare(GLPI_VERSION, '10.0.0', 'gt')) {
    echo "This plugin requires GLPI >= 9.4 and GLPI <= 10.0.2";
    return false;
}

return true;

} To

function plugin_phpsaml_check_prerequisites() {

if (version_compare(GLPI_VERSION, '9.4', 'lt') || version_compare(GLPI_VERSION, '10.0.2', 'gt')) {
    echo "This plugin requires GLPI >= 9.4 and GLPI <= 10.0.2";
    return false;
}

return true;

} This will allow it to be installed on GLPI versions 9.4 to 10.0.2 with no problems.

— Reply to this email directly, view it on GitHub https://github.com/derricksmith/phpsaml/issues/86#issuecomment-1168897078, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFM2UBEUBKOIZLR4J76ST6DVRMOLXANCNFSM5Z6BWQSA. You are receiving this because you authored the thread.

b0n0is commented 2 years ago

Download the branch 1.2.0 and change the function plugin_phpsaml_check_prerequisites on setup.php line 68 from:

function plugin_phpsaml_check_prerequisites()
{

    if (version_compare(GLPI_VERSION, '9.4', 'lt') || version_compare(GLPI_VERSION, '10.0.0', 'gt')) {
        echo "This plugin requires GLPI >= 9.4 and GLPI <= 10.0.2";
        return false;
    }

    return true;
}

To

function plugin_phpsaml_check_prerequisites()
{

    if (version_compare(GLPI_VERSION, '9.4', 'lt') || version_compare(GLPI_VERSION, '10.0.2', 'gt')) {
        echo "This plugin requires GLPI >= 9.4 and GLPI <= 10.0.2";
        return false;
    }

    return true;
}

This will allow it to be installed on GLPI versions 9.4 to 10.0.2 with no problems.

Hi Alessandro, I did that some days ago, and it doesn't work for me, GLIP stop working can't reach the web application I had to disable the plugin by the CLI and when I check the status I have this error: 2022-07-05 15_13_34-Remote Desktop Manager Free  PPSUPPORT

thanks

breno404 commented 2 years ago

Hi guys, I changed the code locally

Summary: In ./front/config.php Search for "$phpSamlConfig->showForm()" and replace for "$phpSamlConfig->showForm($_POST["id"])"

In ./front/config.form.php Search for "$phpsamlconf->showForm()" and replace for "$phpsamlconf->showForm($_POST["id"])"

In ./inc/config.class.php Search for "function showForm()" and replace for "function showForm($ID, array $options = [])"

This worked for me.

derricksmith commented 2 years ago

Fixed in Version 1.2.1. Take a look and let me know if there are any issues.

rajesh-rengaraj commented 2 years ago

Hi Derricksmith,

I have tried your updated plugin Phpsaml 1.2.1 with glpi version 10. But am I not able to save the settings. Please help me on this issue.

Regards,

Rajesh R Network Team Mallow Technologies Private Limited

On 15-Jul-2022, at 1:05 AM, Derrick Smith @.***> wrote:

Fixed in Version 1.2.1. Take a look and let me know if there are any issues.

— Reply to this email directly, view it on GitHub https://github.com/derricksmith/phpsaml/issues/86#issuecomment-1184824310, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFM2UBFYE3OLRZXV7HJDQSDVUBTZ3ANCNFSM5Z6BWQSA. You are receiving this because you authored the thread.

alessandrocaetanob commented 2 years ago

Sorry @b0n0is, I forgot to include something @derricksmith commented on issue #75. For the plugin to work, you have the change line 53 on the file inc/config.class.php from:

function showForm(){

to:

function showForm($ID, array $options = []) {

derricksmith commented 2 years ago

Sorry @b0n0is, I forgot to include something @derricksmith commented on issue #75. For the plugin to work, you have the change line 53 on the file inc/config.class.php from:

function showForm(){

to:

function showForm($ID, array $options = []) {

This is included in Version 1.2.1

alessandrocaetanob commented 2 years ago

Nice! That's even better, so people just need to download the version from the new branch :)

b0n0is commented 2 years ago

Hello @alessandrocaetanob @derricksmith thanks you both of you for the update I tired the version 1.2.1 and 1.2.0 with changing the code of the files: install.php and inc/config.class.php I have same error when I tried to install the plugin image

for information I updated my production GLPI 9.5.3 with plugin 1.1.1 to GLPI 10.0.1 also had to update my php from 7.3 to 8.1 (maybe php version issue)

kind regards ;)

EDIT: 22/07

i just updated a new glpi 10.0.2 test from my production, PHP 7.4 is the minimum require fir the 10th version. so the plugin 1.2.1 works good with GLPI 10.0.2 and PHP 7.4 but not work with PHP 8.0

derricksmith commented 2 years ago

Fixed on line 22 of update.class.php in Version 1.2.1. Added is_array($array) to conditional.

Test and let me know if you still receive an error.

b0n0is commented 2 years ago

installation done without problem on php 8.1 got an error with php7.4 but plugin installed and activated image

I have another issue, I can't update the configuration

Ketchup31 commented 2 years ago

Same for me than @b0n0is. I cannot save the configuration. PHP 7.4.20 GLPI 10.0.0.2 phpsaml: 1.2.1

derricksmith commented 2 years ago

What columns are in the phpsaml plugin table?

derricksmith commented 2 years ago

Issue is resolved in https://github.com/derricksmith/phpsaml/pull/106

Can you confirm?