Moodle
  1. Moodle
  2. MDL-39323

Undefined property: stdClass::$start_tls in HEAD/auth/ldap/auth.php on line 2051

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5.1
    • Component/s: Authentication
    • Labels:
    • Database:
      Any
    • Testing Instructions:
      Hide

      These testing instructions assume you already have a working LDAP configuration in your Moodle site.

      1. Before applying the fix, log in as an admin and enable DEVELOPER level debugging.
      2. Log out.
      3. Log in as any user that uses LDAP as her authentication method.
      4. You should see a notice saying "Undefined property: stdClass::$start_tls in HEAD/auth/ldap/auth.php on line 2051" (line number may vary slightly).
      5. Log out.
      6. Apply the fix.
      7. Log in as admin. You should be presented with an upgrade screen for both the CAS and LDAP plugins. Follow the instructions and finish the upgrade (it should finish successfully).
      8. Log out.
      9. Log in as any user that uses LDAP as her authentication method. This time you shouldn't see any notice at all.
      Show
      These testing instructions assume you already have a working LDAP configuration in your Moodle site. Before applying the fix, log in as an admin and enable DEVELOPER level debugging. Log out. Log in as any user that uses LDAP as her authentication method. You should see a notice saying "Undefined property: stdClass::$start_tls in HEAD/auth/ldap/auth.php on line 2051" (line number may vary slightly). Log out. Apply the fix. Log in as admin. You should be presented with an upgrade screen for both the CAS and LDAP plugins. Follow the instructions and finish the upgrade (it should finish successfully). Log out. Log in as any user that uses LDAP as her authentication method. This time you shouldn't see any notice at all.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull 2.5 Branch:
      wip_25_mdl-39323_fix_start_tls_undefined_notice
    • Pull Master Branch:
      wip_master_mdl-39323_fix_start_tls_undefined_notice
    • Rank:
      49946

      Description

      In our moodle nightly, we have this notice when authenticating with the ldap auth method:

      Undefined property: stdClass::$start_tls in HEAD/auth/ldap/auth.php on line 2051
      

        Activity

        Hide
        Petr Škoda added a comment - - edited

        Hello, two small issues:
        1/ set_config() should not get bools such as false, it gets converted to 0 in DB layer
        2/ the correct package is @package auth_ldap, @subpackage is usually not used

        Show
        Petr Škoda added a comment - - edited Hello, two small issues: 1/ set_config() should not get bools such as false, it gets converted to 0 in DB layer 2/ the correct package is @package auth_ldap, @subpackage is usually not used
        Hide
        Iñaki Arenaza added a comment -

        Hi Petr,

        I've just pushed a new version with the issues you mention already fixed.

        If you give me an OK, I'll submit it for integration.

        Show
        Iñaki Arenaza added a comment - Hi Petr, I've just pushed a new version with the issues you mention already fixed. If you give me an OK, I'll submit it for integration.
        Hide
        Stephen Bloomer added a comment -

        I think this is the same problem that I am getting, although showing slightly different.

        Notice: Undefined property: stdClass::$start_tls in C:\moodle\auth\ldap\auth.php on line 2060 Notice: Undefined property: stdClass::$start_tls in C:\moodle\auth\ldap\auth.php on line 2060 Notice: Undefined property: stdClass::$start_tls in C:\moodle\auth\ldap\auth.php on line 2060

        Windows 2008 R2 server, MySQL, PHP, IIS

        Show
        Stephen Bloomer added a comment - I think this is the same problem that I am getting, although showing slightly different. Notice: Undefined property: stdClass::$start_tls in C:\moodle\auth\ldap\auth.php on line 2060 Notice: Undefined property: stdClass::$start_tls in C:\moodle\auth\ldap\auth.php on line 2060 Notice: Undefined property: stdClass::$start_tls in C:\moodle\auth\ldap\auth.php on line 2060 Windows 2008 R2 server, MySQL, PHP, IIS
        Hide
        Dan Poltawski added a comment -

        Hi Iñaki,

        I thought about this one for a while, because normally we rely the admin upgrade settings to set the values, but because this is an auth plugin, we can't rely on that, because its required before the upgrade can happen, so your solution seems correct.

        However, you are setting the config value even if the config is already set, which will change the configuration for anyone who has already configured this value.

        Please can you check if the value has been set before settings it to 0 and then this can be integrated.

        thanks,
        Dan

        Show
        Dan Poltawski added a comment - Hi Iñaki, I thought about this one for a while, because normally we rely the admin upgrade settings to set the values, but because this is an auth plugin, we can't rely on that, because its required before the upgrade can happen, so your solution seems correct. However, you are setting the config value even if the config is already set, which will change the configuration for anyone who has already configured this value. Please can you check if the value has been set before settings it to 0 and then this can be integrated. thanks, Dan
        Hide
        CiBoT added a comment -

        Moving this reopened issue out from current integration. Please, re-submit it for integration once ready.

        Show
        CiBoT added a comment - Moving this reopened issue out from current integration. Please, re-submit it for integration once ready.
        Hide
        Iñaki Arenaza added a comment -

        Hi Dan,

        I'll add the test you propose and re-submit.

        Show
        Iñaki Arenaza added a comment - Hi Dan, I'll add the test you propose and re-submit.
        Hide
        Iñaki Arenaza added a comment -

        Hi Dan,

        I've pushed a new version of the patch, for 2.5 and master.

        Saludos.
        Iñaki.

        Show
        Iñaki Arenaza added a comment - Hi Dan, I've pushed a new version of the patch, for 2.5 and master. Saludos. Iñaki.
        Hide
        Yatim Ghani added a comment -

        I am also encountering the same problem in Moodle 2.5 (Build: 20130514)

        Upon logging in with a valid ldap user I will get the following errors on the next page after I click on Login :

        Notice: Undefined property: stdClass::$start_tls in C:\inetpub\wwwroot\Moodle\moodle\auth\ldap\auth.php on line 2060

        Notice: Undefined property: stdClass::$start_tls in C:\inetpub\wwwroot\Moodle\moodle\auth\ldap\auth.php on line 2060

        I have to click on Continue in order to get to the Moodle main page.

        Show
        Yatim Ghani added a comment - I am also encountering the same problem in Moodle 2.5 (Build: 20130514) Upon logging in with a valid ldap user I will get the following errors on the next page after I click on Login : Notice: Undefined property: stdClass::$start_tls in C:\inetpub\wwwroot\Moodle\moodle\auth\ldap\auth.php on line 2060 Notice: Undefined property: stdClass::$start_tls in C:\inetpub\wwwroot\Moodle\moodle\auth\ldap\auth.php on line 2060 I have to click on Continue in order to get to the Moodle main page.
        Hide
        Dan Poltawski added a comment -

        Thanks! I've integrated this now to master and 2.5

        Show
        Dan Poltawski added a comment - Thanks! I've integrated this now to master and 2.5
        Hide
        Dan Poltawski added a comment -

        The CI server detected that there was a problem with the ldap savepoint version number (which I didn't spot, my bad). I pushed a fix:
        http://git.moodle.org/gw?p=integration.git;a=commitdiff;h=94b3894aae97bd16da998244e4171920b0d2209f;hp=2f6568796af1efa42ab4c769ff7632190c955f96

        Show
        Dan Poltawski added a comment - The CI server detected that there was a problem with the ldap savepoint version number (which I didn't spot, my bad). I pushed a fix: http://git.moodle.org/gw?p=integration.git;a=commitdiff;h=94b3894aae97bd16da998244e4171920b0d2209f;hp=2f6568796af1efa42ab4c769ff7632190c955f96
        Hide
        Yatim Ghani added a comment -

        the ldap authentication is working in my Moodle 2.5 now..thanks

        Show
        Yatim Ghani added a comment - the ldap authentication is working in my Moodle 2.5 now..thanks
        Hide
        Jason Fowler added a comment -

        Thanks Inaki, all good!

        Show
        Jason Fowler added a comment - Thanks Inaki, all good!
        Hide
        Damyon Wiese added a comment -

        Thanks for your contribution! This issue has been reviewed, integrated, tested and now released to everyone.

        Closing as Fixed!

        Show
        Damyon Wiese added a comment - Thanks for your contribution! This issue has been reviewed, integrated, tested and now released to everyone. Closing as Fixed!

          People

          • Votes:
            4 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: