Jump to content

Calling a form from a PHP hook class


jbob75
Go to solution Solved by jbob75,

Recommended Posts

I'm adding a piece of functionality to an existing SAML login plugin for the "owncloud" cloud storage application https://github.com/owncloud/apps/tree/master/user_saml

 

Within the lib/ directory of this plugin there is a hook class (hooks.php) which extracts SAML attributes and creates a user account based on this info. It currently expects email and name to be available to populate the user account details, which are not available in most identity providers. I'd like to provide a form that when a new user logs in, they can submit the personal information rather than have blank info be given by SAML.

 

At line 83 in this hooks.php file (available at the link above), i'd like to call a page or function that would present a form to the user (with three fields - firstname, surname and email), then on submit, return to the hook class making the three variables available to the rest of the hooks class code.

 

Since this hooks file is a 'processing' PHP file rather than a page that is rendering anything, and also part of the owncloud framework's workings, I don't think this can be done with just PHP and probably a combination of javascript/ajax might be needed.

 

Doesn anyone have an opinion on a solution to this, i.e. being able to move out of a hook class to provide a user interactive form, then continue from the place where the hook class was - utilising the fields the user provided?

Edited by jbob75
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.