Is there anything like Evo's WebLoginPE to facilitate front-end user management in Revo?
Need to be able to change status, password and group assignment, along with a few custom fields.
discuss.answer
Susan, I have done this using Logins Update Profile and Change Password snippets and some custom code and it works great.
Good. I wasn't sure if the Update Profile allowed a Manager user to edit arbitrary users.
I had to create a custom snippet to list all user groups and it's users in order to edit the selected user but most of the hard work was already done by UpdateProfile snippet.
Thanks. This isn't a priority issue at the moment, but it's good to know that most of the work is already done
Hey Benmarte - I'm gonna need to implement something like this and thought probably Update Profile could do the trick and I can see how possibly the extra Peoples
http://rtfm.modx.com/extras/revo/peoples could help list the users.
But any other information you could share would be useful.
Basically my project needs the ability for a site admin to be to create new users and edit them from the front end.
Helen Warner
Number one pixel!
Proud to be linked with MODX at
Crimson Pixel
Looks as if pdoUsers would be a useful snippet for getting profile information on the users now need to find a solution to actually being able to update a profile. Have added a feature request
https://github.com/bezumkin/pdoTools !
Helen Warner
Number one pixel!
Proud to be linked with MODX at
Crimson Pixel
-
- 5,888 Posts
what is the reason, that it needs to be at frontend?
At backend a MIGXdb - CMP could probably do what you want.
From frontend a form and formit with a custom-hook like formit2db or a hook which runs a user - create/update processor could do it.
Thus is a client request - wants a website to manage users rather than utilising back end!
Did think about formit hook as a possibility too.
Getting modUser attributes isn't really a problem to display frontend it's more being able to modify them.
With UpdatePrrofile snippet you need to be logged in as that user for it work.
Helen Warner
Number one pixel!
Proud to be linked with MODX at
Crimson Pixel
-
- 5,888 Posts
something like this could be a start for a formit-hook (untested):
<?php
$success = true;
$data = $hook->getValues();
$extended = array();
foreach ($data as $key => $value) {
$field = explode('.', $key);
if (count($field) > 1) {
//extended field (json-array)
if ($field[0] == 'Profile_extended') {
$extended[$field[1]] = $value;
unset($data[$key]);
}
} elseif (substr($key, 0, 8) == 'Profile_') {
$data[substr($key, 8)] = $value;
unset($data[$key]);
}
}
$data['extended'] = $extended;
//$data['email'] = $data['Profile_email'];
$response = $modx->runProcessor('security/user/update', $data);
if ($response->isError()) {
$success = false;
$errormsg = $response->getMessage();
}
return $success;
user-fields needs to have the same input-name
profile-fields prefixed with 'Profile_'
extended fields prefixed with 'Profile_extended.'