• Index
  • » Users
  • » 4thdimension
  • » Posts



Actually it's a live site, I've been trying to do the work on it early morning / late at night.
Let me know what works best for you.


So In my never ending endeavor to learn, I tried to modify the script on my own.  I found out the URL for Mighty registration is the following:


So I modified your script and got it to work, it takes the user to the correct details page, but it throws a 500 error once I type in the password field.  At that point it locks up the site and I have to manually uninstall everything to get it running correctly again.

Here's how I modified your scrip Maybe it would be something simple to fix:


// no direct access
defined('_JEXEC') or die('Restricted access');


class plgSystemForcePasswordChange extends JPlugin
    function plgSystemForcePasswordChange(&$subject, $config)
        parent::__construct($subject, $config);

    function onAfterRoute()
        $user = &JFactory::getUser();

        $option = JRequest::getVar('option');
        $view = JRequest::getVar('view');
        $task = JRequest::getVar('task');
        $layout = JRequest::getVar('layout');

        if(!$user->guest && $user->lastvisitDate == "0000-00-00 00:00:00")
            // The user is not a guest and their lastvisitDate is zeros

            if($option == "com_juser" && $task == "save")
                // The user is saving their profile

                // Set the last visit date to a real value so we won't continue forcing them to update their profile
                $date = JFactory::getDate();
                $user->lastvisitDate = $date->toMySQL();
            else if(!($option == "com_juser" && $view == "user" && $layout == "mydetails"))
                // The user is not on the edit profile form

                // Update lastvisitDate back to zero
                $dbo = &JFactory::getDBO();
                $query = "UPDATE #__users ".
                    "SET lastvisitDate = ".$dbo->quote("0000-00-00 00:00:00")." ".
                    "WHERE id = ".$dbo->quote($user->id);
                // Redirect to edit profile
                $app = &JFactory::getApplication();
                    $this->params->get("message", "You must update your password before continuing to use the site.")

Thanks again for all your help, I really do appreciate this a lot!

I think that would work... thanks a lot for your help!

Also the info provided by Mighty Registration is here:

<!-- m --><a class="postlink" href="http://www.mightyextensions.com/knowledge-base/faq/list/answers/12-user">http://www.mightyextensions.com/knowled ... rs/12-user</a><!-- m -->

So I tried it, and it worked perfect! Except for one thing... I'm using mighty registration to gather additional info from my users, and the main point for me wanting to do this is to get my users to update all of their details.  So when I run the plugin it takes them to the Main joomla registration page.  I think I could make this work by updating the "forcepasswordchange.php" and changing "com_user" to "com_juser"  But I'm stuck on the "Redirect to edit profile" link.  I don't know the location of the Mighty Registration edit profile link.

Thanks again for all your help!!!

The plugin you created, "force password check" is very close to what I've been searching for, but I need it to force every user to reset their password / update their details on next login. I tried modifying the code, but was unsuccessful. Any help you could give me would be greatly appreciated.


  • Index
  • » Users
  • » 4thdimension
  • » Posts

Board Info

Board Stats
Total Topics:
Total Polls:
Total Posts:
Posts this week:
User Info
Total Users:
Newest User:
[email protected]
Members Online:
Guests Online:

There are no members online
Social Stream
Refer and Earn

Like our extensions? You're not alone! That's why they're used on tens of thousands of websites. Now you can earn 20% of any sale you refer to SourceCoast.com.

We provide excellent documentation, well laid out sales pages and great support. All you need to do is spread the word and we'll take care of the rest.

Learn About Our Affiliate Program