Name for a new authentication plugin

Name for a new authentication plugin

por Aharon Ben-Shemer -
Número de respostas: 2

I want to add a new authentication plugin (Moodle 2.2.2), and I am trying to figure out whether it shoud be named 'auth_xxx' or 'auth/xxx'.

I notice that even plugins follow a naming convention like "auth_xxx", e.g. "auth_db", in their version.php file end up creating settings named 'auth/xxx' as soon as the settings page is saved. I traced this to line 108 of the method print_auth_lock_options in admin/admin_config.php which seems assumes the slash and, I believe, creates settings in mdl_config_plugins accordingly.

What is the "official" standard here? I want to call print_auth_lock_options in my config.html file (to keep it simple), but I also think that the underscore is more officially blessed than the slash. Do I need to clone the print_auth_lock_options method and use my own version? I would be changing only line 108

$pluginconfig = get_config("auth/$auth");

to

$pluginconfig = get_config("auth_$auth");

which seems kind of crazy.

I am also going to post this in the General Development forum.

Thanks,

Aharon

Media de puntuacións: -
En resposta a Aharon Ben-Shemer

Re: Name for a new authentication plugin

por Iñaki Arenaza -
Imaxe de Core developers Imaxe de Documentation writers Imaxe de Particularly helpful Moodlers Imaxe de Peer reviewers Imaxe de Plugin developers
Hi Aharon,

it's 'auth_$authname' for the plugin name (in version.php, and in the places where you call role_assign/role_unassign() for example), but it's 'auth/$authname' for the plugin configuration settings (and thus in get_config()/set_config())

Saludos.
Iñaki.