Jump to content

Recommended Posts

Posted

Hi,

I'm having some minor problems with my Processwire Intranet page, i created a small module to sync active directory users with Processwire (login and profile informations) via LDAP.

My user profile has more information than the active directory domain, and I want the user to be able to change the informations by himself on the intranet site.

 

At this time, i just sync the user informations inside of the page tree like this:

Quote

Home

- Employees

-- Employeename1

-- Employeename2

etc.

 

Now the big question is how can I make it, that the user can change the profile information on this Pages?

Or is it easier when i add the informations to the user profile? I already checked the "LoginRegister" Module, but there's one problem - the users are not allowed to change the password via the intranet site (the passwords are linked via LDAP).

 

I hope you can help me ? Thanks!

Posted

I think I didn't understood all the problem here but I am trying to answer anyway ?

From what I understand, you are trying to update the page JohnDoe (a page under Employees parent which act as a profile page) for the user JohnDoe - correct ?

My question is, why you do not use the user profile ? If your problem is the password field, you can remove it from the list of the editable fields in the LoginRegister module - as you can choose which field can be edited by the user.

 

 

Posted
30 minutes ago, flydev said:

From what I understand, you are trying to update the page JohnDoe (a page under Employees parent which act as a profile page) for the user JohnDoe - correct ?

correct ? 

30 minutes ago, flydev said:

My question is, why you do not use the user profile ? If your problem is the password field, you can remove it from the list of the editable fields in the LoginRegister module - as you can choose which field can be edited by the user.

Thats my problem, you cannot remove the password field in the LoginRegister Module (and also it's not possible to remove the email adress)

(only inside of the php code of the module ? )

Posted

Then with a hook, you can remove them, look :

On a module :

    $this->addHookAfter('LoginRegister::buildProfileForm', $this, 'renderProfileForm');

    protected function renderProfileForm($event) {
        $form = $event->return;
        foreach ($form->children as $field) {
            if ($field instanceof InputfieldEmail || $field instanceof InputfieldPassword) {
                $form->remove($field);
            }
        }
    }

 

or in ready.php :

wire()->addHookAfter('LoginRegister::buildProfileForm', function($event) {
    $form = $event->return;
    foreach ($form->children as $field) {
        if ($field instanceof InputfieldEmail || $field instanceof InputfieldPassword) {
            $form->remove($field);
        }
    }
});

 

  • Like 4

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...