How to save user fields in Joomla using php?

How to save user fields in Joomla using php?

//portal.goaskle.com 21 01 2022 sync email with joomla on save
        $usero = JFactory::getUser();
        $userId = (int) $usero->id; 
        $newuser = $usero->getInstance($userId);
        $newuser->email = 'you new email for save';
        $newuser->save();
//portal.goaskle.com 21 01 2022 sync email with joomla on save 

Additional fields:

These are the properties automatically generated on a call to getUser(), in the order defined in the API documentation

id - The unique, numerical user id. (In other Joomla database tables this id is used as the foreign key to point to the associated user record).
name - The name of the user. (e.g. Vint Cerf)
username - The login/screen name of the user. (e.g. shmuffin1979)
email - The email address of the user. (e.g. crashoverride@hackers.com)
password - The encrypted version of the user's password
password_clear - Set to the user's password only when it is being changed. Otherwise, remains blank.
block - Set to '1' when the user is set to 'blocked' in Joomla (ie prevented from logging on)
sendEmail - Specifies whether this user should receive system emails or not
registerDate - Set to the date when the user was first registered.
lastvisitDate - Set to the date the user last visited the site.
activation - an activation token. This is used when the site allows users to self-register. To complete account setup, an email is sent to the person who has self-registered, and the link embedded in the email contains this activation token.
params - a json string of name/value pairs for the subsidiary user attributes (see below).
groups - an associative array of group id => (string) group id for the user groups which this user is a member of
guest - If the user is not logged in, this variable will be set to '1'. The other variables will be unset or default values.
lastResetTime - Set to the last time the password was reset.
resetCount - Counts the number of password resets.
requireReset - indicates that this user will be forced to reset the password the next time they log in.

Метаданные статьи

Идентификатор статьи:
65
Категория:
Дата добавления:
21.01.2022 11:09:20
Просмотры:
121
Рейтинг (Голоса):
(0)

Связанные статьи