Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-58769

PDO support in auth plugin needs to fail better

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Do
    • 3.3
    • None
    • Authentication
    • MOODLE_33_STABLE

    Description

      When the PDO connection string results in failing connection, Moodle doesn't detect it and results in an incomphrensible error on attemtping to login:

      Exception - Call to a member function prepare() on boolean
       
      More information about this error
       
      ×Debug info: 
      Error code: generalexceptionmessage
      ×Stack trace:
      line 468 of /lib/adodb/drivers/adodb-pdo.inc.php: Error thrown
      line 1252 of /lib/adodb/adodb.inc.php: call to ADODB_pdo->_query()
      line 1230 of /lib/adodb/adodb.inc.php: call to ADOConnection->_Execute()
      line 115 of /auth/db/auth.php: call to ADOConnection->Execute()
      line 4312 of /lib/moodlelib.php: call to auth_plugin_db->user_login()
      line 154 of /login/index.php: call to authenticate_user_login()
      

      Steps to reproduce:

      1. Add external database auth plugin
      2. Set the type to pdo and set the connection string to something which will cause it to fail, eg.:
        1. Set the host to 'pgsql:host=localhost;port=5432;dbname=enroltest;user= enroltest;password=enroltest'
        2. Don't set the username and password in the auth plugin settings
      3. Try to login with a junk username

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              poltawski Dan Poltawski
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: