Forums / Developer / php script problem / Comment47213

Author Topic

Kristof Coomans

Wednesday 25 October 2006 1:55:10 am

Comment47213

To log in as admin from inside the script, you should use:

include_once( 'kernel/classes/datatypes/ezuser/ezuser.php' );
$user = eZUser::fetchByName('admin');
$userID = $user->attribute( 'contentobject_id' );
eZUser::setCurrentlyLoggedInUser( $user, $userID );

If you use the long cli options then you have to specify their values with =

--login=admin --password=pwdadmin

Do you have any special chars in your password? You should escape them for your shell.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org