By vembloud on
Hi,
does anyone know, howto unset user data(meant some variables in variable "data"). I try this but it doesnt work...
function unsetUserData() {
global $user;
$user_data = unserialize($user->data);
unset($user_data['variable_which_i_created_before']);
user_save( $user , $user_data);
}
Comments
I think you need to do
I think you need to do something like this:
You may take a look at user_save but I'm pretty sure it takes all of the unsaved key values from the user object and saves them in the data array.
.
I tried it but it doesnt work. Variable is stil set...
Where are you calling this
Where are you calling this function?
Contact me to contract me for D7 -> D10/11 migrations.
.
Function is called in Menu callback function.
Class IsUsers is for another system users (lets call IS).
I save infomation about IS user login into drupal user variable.
And when IS user logout I want to clear drupal user data related to IS login (Login, Role, Unit, epire).
set category argument
I know 'account' is a default value for user_save category argument. But pass it manually to the user_save.
Without it, it didn't work for me when I wanted to update user.
Best,
Marjan
.
Sorry, I dont understand, can you show me an example?
You forced me to open up my
You forced me to open up my project and look how we actually do it. I just remembered wrong :)
This is definitely working for us. I hope it works for you.
Great, it works fine ;)
Great, it works fine ;) Thanks a lot...