Right now, only absolute paths will work for the setting samlhookfile. That is because when the setting is used it's used from moodle/auth/saml directory, but when the input is validated, it's validated from moodle/admin. So, my value of "../../local/myplugin/auth_hooks.php" is valid and will work, but fails validation on the settings form.
I placed my hook file in a custom local plugin. The fact that I have to use an absolute path ties my hands in my development and staging environments. I have to install Moodle in the exact same place.
To fix this, maybe the plugin could assume that if the path does not begin with a "/" (or "\" on Windows?) then the path is relative to dirroot.
Or it could be more explicit and use a token. Like a valid value could be "[dirroot]/local/myplugin/auth_hooks.php" and that's expanded to $CFG->dirroot . '/local/myplugin/auth_hooks.php' for use and for validation.
Right now, only absolute paths will work for the setting samlhookfile. That is because when the setting is used it's used from moodle/auth/saml directory, but when the input is validated, it's validated from moodle/admin. So, my value of "../../local/myplugin/auth_hooks.php" is valid and will work, but fails validation on the settings form.
I placed my hook file in a custom local plugin. The fact that I have to use an absolute path ties my hands in my development and staging environments. I have to install Moodle in the exact same place.
To fix this, maybe the plugin could assume that if the path does not begin with a "/" (or "\" on Windows?) then the path is relative to dirroot.
Or it could be more explicit and use a token. Like a valid value could be "[dirroot]/local/myplugin/auth_hooks.php" and that's expanded to $CFG->dirroot . '/local/myplugin/auth_hooks.php' for use and for validation.
What do you think?