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.

eZ debug

Timing: Jan 30 2025 21:47:31
Script start
Timing: Jan 30 2025 21:47:31
Module start 'layout'
Timing: Jan 30 2025 21:47:31
Module start 'content'
Timing: Jan 30 2025 21:47:31
Module end 'content'
Timing: Jan 30 2025 21:47:31
Script end

Main resources:

Total runtime0.0228 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.2578151.2266
Module start 'layout' 0.00450.0033 739.4844220.7188
Module start 'content' 0.00780.0133 960.2031997.8047
Module end 'content' 0.02110.0017 1,958.007829.9922
Script end 0.0227  1,988.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002912.5592140.0002
Check MTime0.00104.5494140.0001
Mysql Total
Database connection0.00062.617610.0006
Mysqli_queries0.00187.840230.0006
Looping result0.00000.038710.0000
Template Total0.00125.510.0012
Template load0.00104.312710.0010
Template processing0.00031.150710.0003
Override
Cache load0.00073.083510.0007
General
dbfile0.00135.588080.0002
String conversion0.00000.026240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs