Posted on : 2018-09-28 06:44:48 View Type: public
marco miana

Hi! My user should change the password after the first login. How can I do this? Thanks Pat

Hi! My user should change the password after the first login. How can I do this? Thanks Pat

Hi you have to implement this yourself in script and for that you should have basic PHP knowledge as well.
When system is running it includes the users class $new_user = new Users; so you already have an object $new_user but you can create new objects of user class if you want else you can use this already available user object. Now user class provides a method or function function get_user_meta($user_id, $term) and one more function set_user_meta($user_id, $term)
Basically when user is loging in which you can track in login.php file, just create a new function or run if else conditions. To check after login, if user already have password_changed value if that value does not exist in user_meta table, system can save a value by set_user_meta function to something like change.
And on dashboard, you can check if user already changed password, if not then it should re direct user to user profile page with message to change password. You can place this redirection in system_load.php or header.php these files are included in all files. So any file user try to load they will be redirected to their profile page to change password. And where password update is working in /classes/users edit_profile or update_user, there you can set_user_meta >> password_change >> changed from change.
This way you can achieve the required method.

If you want us to do this we can help you and we will charge you 35$ to include this feature thanks.
Click one of our contacts below to chat on WhatsApp
Do you have any questions?

