I am trying to manually update the prev_last_login, last_login and last_action parameter for the users but It seem like my code is not working as the parameters are not getting updated.
Here is my code
$time = time(); $user = get_user($guid); $user->prev_last_login = $user->last_login; $user->last_login = $time; $user->last_action = $time; $user->save();
Can anyone tell me where am I making the mistake.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- Rohit Gupta@Rohit_1990_3676
Rohit Gupta - 0 likes
You must log in to post replies.You can't use $user->save() in this case.
Look at setLastAction() and setLastLogin() functions
This did the trick.
Is there any function for prev_last_login??