Friday 04 March 2016 2:36:31 pm - 1 reply
I'm using the ez Publish community version 5.4.
Currently I'm implementing a LDAP user login. I want to update some user data like the passwort and the email-address of an existing user in ez with data from an active directory everytime a user logs in successfully with LDAP.
To accomplish this I'm using the user service of the repository-object and the UserUpdateStruct (code snippet):
$userService = $repository->getUserService();
$userUpdateStruct = $userService->newUserUpdateStuct();
$userUpdateStruct->password = 'password';
$userUpdateStruct->email = 'email@example.com';
$updatedUser = $userService->updateUser($ezUser, $userUpdateStruct);
So far this works for me. My problem is, if I change the email-address of a user in the backend, next time I'm updating the email-adress, it isn't changed. In the backend or the user-profile I see the old email-address. But when I use
$email = $ezUser->email;
the attribute email has the new updated address.
I would be very thankful if someone could tell me how to update the email-address in the profile of a user and in the backend using the UserUpdateStruct. I know of a contentMetadataUpdatestruct and a contententUpdateStruct, which can be assigned to a UserUpdateStruct, but I don't know how to use them or if it would help me. I couldn't find anything about how to use them either.
You must be logged in to post messages in this topic!