Moodle
  1. Moodle
  2. MDL-36101

Coding error on logging into suspended account with Shibboleth

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Authentication
    • Labels:
    • Rank:
      44863

      Description

      To reproduce:

      1. Suspend an account which uses Shibboleth auth
      2. Log in using the account
      3. You will see a coding error

      Expected result: I would expect this to show a message to the user saying their account was suspended.

      Actual result: The error message is:

      Coding error detected, it must be fixed by a programmer: moodle_database::update_record_raw() id field must be specified.
      Debug info:
      Error code: codingerror
      Stack trace:
      
          line 1111 of /lib/dml/mysqli_native_moodle_database.php: coding_exception thrown
          line 1167 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
          line 3292 of /lib/moodlelib.php: call to mysqli_native_moodle_database->update_record()
          line 50 of /auth/shibboleth/index.php: call to update_user_login_times()
      
      Coding error detected, it must be fixed by a programmer: Invalid $user parameter in check_user_preferences_loaded() call, missing id field
      Debug info:
      Error code: codingerror
      Stack trace:
      
          line 1638 of /lib/moodlelib.php: coding_exception thrown
          line 1879 of /lib/moodlelib.php: call to check_user_preferences_loaded()
          line 8614 of /lib/moodlelib.php: call to get_user_preferences()
          line 651 of /lib/pagelib.php: call to get_user_device_type()
          line 732 of /lib/pagelib.php: call to moodle_page->magic_get_devicetypeinuse()
          line 1487 of /lib/pagelib.php: call to moodle_page->__get()
          line 1437 of /lib/pagelib.php: call to moodle_page->resolve_theme()
          line 1444 of /lib/setuplib.php: call to moodle_page->initialise_theme_and_output()
          line 366 of /lib/setuplib.php: call to bootstrap_renderer->__call()
          line 366 of /lib/setuplib.php: call to bootstrap_renderer->fatal_error()
          line ? of unknownfile: call to default_exception_handler()
      

      There are also 3 notices displayed before the error message:

      Strict standards: Creating default object from empty value in /moodle/web/lib/sessionlib.php on line 952 Call Stack: 0.0007 692000 1. {main}() /moodle/web/auth/shibboleth/index.php:0 0.2717 23977056 2. session_set_user() /moodle/web/auth/shibboleth/index.php:45 0.2717 23963504 3. sesskey() /moodle/web/lib/sessionlib.php:1072 
      
      Notice: Undefined property: stdClass::$currentlogin in /moodle/web/lib/moodlelib.php on line 3287 Call Stack: 0.0007 692000 1. {main}() /moodle/web/auth/shibboleth/index.php:0 0.2721 23964128 2. update_user_login_times() /moodle/web/auth/shibboleth/index.php:50 
      
      Notice: Undefined property: stdClass::$id in /moodle/web/lib/moodlelib.php on line 3290 Call Stack: 0.0007 692000 1. {main}() /moodle/web/auth/shibboleth/index.php:0 0.2721 23964128 2. update_user_login_times() /moodle/web/auth/shibboleth/index.php:50 
      

        Issue Links

          Activity

          Hide
          Michael Aherne added a comment -

          This is similar to, but not the same as, MDL-29386

          Show
          Michael Aherne added a comment - This is similar to, but not the same as, MDL-29386
          Hide
          Michael Aherne added a comment - - edited

          I have attached a patch that fixes this. I think it also fixes MDL-29386.

          Show
          Michael Aherne added a comment - - edited I have attached a patch that fixes this. I think it also fixes MDL-29386 .
          Hide
          Michael de Raadt added a comment -

          Thanks for reportign that and providing a fix.

          Show
          Michael de Raadt added a comment - Thanks for reportign that and providing a fix.
          Hide
          Dan Poltawski added a comment -

          Sending all 'waiting for peer review' issues to integration before freeze, as agreed in Integrators Meeting 19/10/12. We are doing this to ensure any 'integratable issues' will not got missed before freeze..

          Show
          Dan Poltawski added a comment - Sending all 'waiting for peer review' issues to integration before freeze, as agreed in Integrators Meeting 19/10/12. We are doing this to ensure any 'integratable issues' will not got missed before freeze..
          Hide
          Sam Hemelryk added a comment -

          Thanks Michael, the change looked good and has been integrated now.
          Just noting I backported to 22 and 23 as well.

          Show
          Sam Hemelryk added a comment - Thanks Michael, the change looked good and has been integrated now. Just noting I backported to 22 and 23 as well.
          Hide
          Michael Aherne added a comment -

          Excellent - thanks Sam!

          Show
          Michael Aherne added a comment - Excellent - thanks Sam!
          Hide
          Frédéric Massart added a comment -

          As suggested by Dan, I reviewed the patch instead of testing it. The patch looks good and should solve the issue. If required I can spend more time trying to understand the Shibboleth authentication system and try using our VM. Apparently Eloy has some knowledge about it and could be helpful. I am not passing the test yet.

          Show
          Frédéric Massart added a comment - As suggested by Dan, I reviewed the patch instead of testing it. The patch looks good and should solve the issue. If required I can spend more time trying to understand the Shibboleth authentication system and try using our VM. Apparently Eloy has some knowledge about it and could be helpful. I am not passing the test yet.
          Hide
          Dan Poltawski added a comment -

          Based on the fact we don't have a shib setup here [still], I think we need to pass this without testing.

          Show
          Dan Poltawski added a comment - Based on the fact we don't have a shib setup here [still] , I think we need to pass this without testing.
          Hide
          Frédéric Massart added a comment -

          Passing. Thanks!

          Show
          Frédéric Massart added a comment - Passing. Thanks!
          Hide
          Dan Poltawski added a comment -

          Hurray!

          You did it, congratulations! You have on Mojito credit to redeem after the release of Moodle 2.4

          Show
          Dan Poltawski added a comment - Hurray! You did it, congratulations! You have on Mojito credit to redeem after the release of Moodle 2.4

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: