Moodle
  1. Moodle
  2. MDL-38373

Strict standards error with auth_radius

    Details

    • Testing Instructions:
      Hide

      (borrowed from MDL-37625)

      Requirements

      1. Debug developer enabled. To get any NOTICE/WARN...
      2. a RADIUS server
      3. the PHP RADIUS extension installed and available on the web server of your Moodle testing site

      Testing steps

      1. log into your Moodle test site as a system administrator
      2. configure the RADIUS auth plugin in Moodle by going to the following path in the Settings block – Site administration -> Plugins -> Authentication -> Manage authentication
      3. enable and configure the RADIUS server plugin so that it communicates with your RADIUS server
      4. log out of the Moodle site
      5. attempt to log into the Moodle site using the credentials for a test user from the RADIUS server
      6. you should be able to successfully log in and have a new account created for you if you have never logged in with that user before
      Show
      (borrowed from MDL-37625 ) Requirements Debug developer enabled. To get any NOTICE/WARN... a RADIUS server if you don't have one available you can setup one using FreeRADIUS – http://freeradius.org/ the PHP RADIUS extension installed and available on the web server of your Moodle testing site Testing steps log into your Moodle test site as a system administrator configure the RADIUS auth plugin in Moodle by going to the following path in the Settings block – Site administration -> Plugins -> Authentication -> Manage authentication enable and configure the RADIUS server plugin so that it communicates with your RADIUS server log out of the Moodle site attempt to log into the Moodle site using the credentials for a test user from the RADIUS server you should be able to successfully log in and have a new account created for you if you have never logged in with that user before
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull 2.4 Branch:
    • Pull Master Branch:
    • Rank:
      48281

      Description

      This is a followup of MDL-37625.

      When it was being tested this strict standards notice was shown:

      Strict Standards: Non-static method PEAR::loadExtension() should not
      be called statically, assuming $this from incompatible context in
      lib/pear/Auth/RADIUS.php on line 49
      

      And this was commented there:

      it seems that the class has not been changed as trunk continue showing that static behavior:

      http://svn.php.net/viewvc/pear/packages/Auth_RADIUS/trunk/RADIUS.php?revision=257341&view=markup

      So, or we fix that in the PEAR wrapper or we consider switching to another (pure or wrapper) lib. If this had to be voted, I'd say "pure" is better (less dependencies). Like, for example:

      http://www.phpclasses.org/package/4326-PHP-Authenticate-users-with-a-RADIUS-server.html

      Although I don't know much really. Adding Jonathan Harker here coz he did the initial (and current) implementation.

        Issue Links

          Activity

          Hide
          Eloy Lafuente (stronk7) added a comment -

          To fix this directly in the pear class was really trivial, so here are the changes for 23, 24 and master. For your consideration, dear peer-reviewer.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - To fix this directly in the pear class was really trivial, so here are the changes for 23, 24 and master. For your consideration, dear peer-reviewer. Ciao
          Hide
          Andrew Davis added a comment -

          Trivial indeed.

          [Y] Syntax
          [NA] Output
          [Y] Whitespace
          [NA] Language
          [NA] Databases
          [Y] Testing
          [NA] Security
          [NA] Documentation
          [Y] Git
          [Y] Sanity check

          You are go for integration.

          Show
          Andrew Davis added a comment - Trivial indeed. [Y] Syntax [NA] Output [Y] Whitespace [NA] Language [NA] Databases [Y] Testing [NA] Security [NA] Documentation [Y] Git [Y] Sanity check You are go for integration.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          tricking the system... lol

          Show
          Eloy Lafuente (stronk7) added a comment - tricking the system... lol
          Hide
          Damyon Wiese added a comment -

          In testing this (before my radius server is working properly) I get this on login attempts:

          Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /home/damyonw/Documents/Moodle/integration/master/moodle/auth/radius/auth.php on line 108 Radius send failed: Error sending request: No valid RADIUS responses received

          Show
          Damyon Wiese added a comment - In testing this (before my radius server is working properly) I get this on login attempts: Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /home/damyonw/Documents/Moodle/integration/master/moodle/auth/radius/auth.php on line 108 Radius send failed: Error sending request: No valid RADIUS responses received
          Hide
          Damyon Wiese added a comment -

          One more thing - that I couldn't find documented anywhere is that the php5-mcrypt package is required for CHAP authentication. Without this you get this error on login:

          Fatal error: Call to undefined function mcrypt_module_open() in /home/damyonw/Documents/Moodle/integration/master/moodle/lib/pear/Crypt/CHAP.php on line 262

          Show
          Damyon Wiese added a comment - One more thing - that I couldn't find documented anywhere is that the php5-mcrypt package is required for CHAP authentication. Without this you get this error on login: Fatal error: Call to undefined function mcrypt_module_open() in /home/damyonw/Documents/Moodle/integration/master/moodle/lib/pear/Crypt/CHAP.php on line 262
          Hide
          Damyon Wiese added a comment -

          Thanks Eloy, I've integrated this now with an additional patch for the extra strict warning I found.

          I tested this on 23, 24 and master branches against our freeradius QA VM.

          Integrated to 23, 24 and master.

          Show
          Damyon Wiese added a comment - Thanks Eloy, I've integrated this now with an additional patch for the extra strict warning I found. I tested this on 23, 24 and master branches against our freeradius QA VM. Integrated to 23, 24 and master.
          Hide
          Damyon Wiese added a comment -

          Passing this as I tested it on all branches in integration.

          Show
          Damyon Wiese added a comment - Passing this as I tested it on all branches in integration.
          Hide
          Damyon Wiese added a comment -

          This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads).

          Thanks for your contributions!

          Show
          Damyon Wiese added a comment - This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads). Thanks for your contributions!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Damyon, thanks for extending the solution to the other warnings! I did the change without trying at all, just was an obvious API warn. Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Damyon, thanks for extending the solution to the other warnings! I did the change without trying at all, just was an obvious API warn. Thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: