User login change => cannot access user image anymore

Author Message

Hugo Alexandre

Thursday 04 February 2010 2:22:29 am

Hi,

I changed a user's login by executing a script like :

$user = eZUser::fetchByName($login);
if (is_object($user))
{
$user->setAttribute("login",$newLogin);
$user->store();
}

It seemed to work but, after republishing the user's object, it is now impossible to access every image linked to the user (photos)... I tried to define a new one in the back office, but no new image was created anywhere.

Did I forget something in the script ?

Thanks for your help

Hugo

André R.

Thursday 04 February 2010 12:28:01 pm

You probably need to republish the content object of the user.

Might be that login is setup as name pattern for user class on your site?

Also remember that login is part of password hash, so I think you'll need to change password as well if it should be possible to login to the account again.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.