Share » Forums » Developer » Help: Admin is not allowed

Help: Admin is not allowed

Help: Admin is not allowed

Thursday 20 May 2004 6:48:52 pm - 3 replies

Author Message

Dominik Pich

Friday 21 May 2004 1:31:13 am

        $user =& eZUser::fetch( $forgotPasswdObj->attribute( 'user_id' ) );
        $email = $user->attribute( 'email' );

        $ini =& eZINI::instance();
        $passwordLength = $ini->variable( "UserSettings", "GeneratePasswordLength" );
        $password = eZUser::createPassword( $passwordLength );
        $passwordConfirm = $password;

        $userToSendEmail =& $user;
        $user->setInformation( $user->id(), $user->attribute( 'login' ), $email, $password, $passwordConfirm );
        $user->store();

It changed the password of the admin - set a new one you know

lin vin

Saturday 22 May 2004 9:01:11 am

Thank you for your reply!
But when i fetch the ezuser by id as following:

$user =& eZUser::fetch( 14 );//14 is the id of admin

I cant fetch any user.

lin vin

Saturday 22 May 2004 9:37:11 am

I got it!!
The db is not connected.I add the codes:

$db =& eZDB::instance();
$db->connect("localhost",$the_database,"root","");

However,it cant get any user, because the $connection in "lib/classes/ezdb/ezmysqldb.php" is false.Then i change the code:
$result =& mysql_query( $sql, $connection );
to
$result =& mysql_query( $sql);

Then i got it.
But I think it is not the best way.

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu