Q:

Change the Last Logged In date

I'm trying to write a custom password reset script that adds rewards points to the accounts of all those that reset their passwords. A customised link to this will only be sent to the customers that have never logged into their account before (About 900 of them).
I need to know how to change the customer's last logged in date so that they can only get the rewards points once. This is the way I make sure that they haven't reset their password before.
$logCustomer = Mage::getModel('log/customer')->loadByCustomer($customer);
$lastVisited = $logCustomer->getLoginAtTimestamp();

if ($lastVisited == NULL)
{
  // Reset password
  // Add reward points to account
}

A:

When the customer logs in, this date will be updated automatically. However, if you need to change this manually you can do so with the following statement:
$customerLog = Mage::getModel('log/customer')->loadByCustomer($customer);
$customerLog->setLoginAt('2013-12-31 00:00:00');
$customerLog->save();

