Hi All, I really need this module for some project. As I know coding Drupal I putted my hands on work and I got my heavy modified version of this module. I just want to share here in case if someone is interested, and why not, maybe it can be added to an stable version (works fine for my purposes)

I'm using the hook hook_form_FORM_ID_alter to improve overall performance here. The core function is replaced to fit my new logic and drupal7 new functions (you can't use user_load() with array now, only id)

I changed the settings page to finally leave only two options:

  • Mode: Ive Implemented 3 modes 'Off', 'Mixed' and 'Certificate Only', Mixed is a validation using Drupal Standard Access + Certificate
  • I removed something else, as I consulted here, creation of user with certificate can be complicated, plus using form_alter, i am using validation when I'm login in, so a logged user to make active the 'override login option' is no longer valid.

Added a permission 'login without certificates' in order to avoid the site 'unloggable', you can assign a role that can access without certificate and, as always, user 1 can log in in extreme cases (still need be configured in mixed mode).

Now authmap is great implementation to validate certificate with Drupal user credentials (used on mixed mode). I changed the authmap_submit form in order to make the current certificate be attached to the user which I am editing, no to the current user.

Since I really dont know hot to patch this, I'm attaching the .module file, fell free to comment, ask, rant or whatever. Any feedback will be really appreciated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ZeiP’s picture

Priority: Major » Normal
Status: Active » Needs work
FileSize
19.59 KB

Thanks for sharing this! I created a patch of your modifications, you can find it attached to this comment. This should make it easier to apply the changes again when updating for example :)

I'll try to make time to look into the changes and apply them to the official version also. Thanks again for sharing your work!