0

in my drupal system i use the basic_wemail module along with a custom module i created that creates a postfix mail alias for a new user, so we can provide users with free email addresses as part of the service.

The basic_webmail module has a user form where a user can input their email address and logins for the module to save the email credentials as serialised user data. Since we dont want users to update this information and only to use the email credentials created by our custom postfix integration, but user_update(), user_insert() and user_presave() all work on a form submit, is there another way to pragmatically update a users serialised data?

0
 $edit = array(
    'basic_webmail_username' => $full_username,
    'basic_webmail_password' => $password,
  );

user_save($user, $edit);

echo('lol that was easier than i thought');

user_save();

0

You may also use this short snippet to update an existing user

// load user object
$existingUser = user_load('USERID');
// update some user property
$existingUser->some_property = 'blah';
// save existing user
user_save((object) array('uid' => $existingUser->uid), (array) $existingUser);

Hope it works for you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.