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

PDO support in auth plugin needs to fail better

XMLWordPrintable

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

      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

            Unassigned Unassigned
            poltawski Dan Poltawski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.