Forums / Setup & design / No more admin login and passwd in data base
Pascal France
Thursday 12 October 2006 6:12:02 am
Hi,
I don't know why, but the line:
14 | pascal@linuxorable.fr | admin | c78e3b0f3d9244ed8c6d1c29464bdff9 | 2 |
doesn't exist anymore in the ezuser table. Only this one:
10 | nospam@ez.no | anonymous | 4e6f6184135228ccd45f8233d72a0363 | 2 |
is present.
I just would like to know the commande line to add the line with the hash passwd of the admin which is in the db_data.dba file (c78e3b0f3d9244ed8c6d1c29464bdff9).
I know how to update fields but not how to create them.
Regards
Pascal
Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish
Claudia Kosny
Thursday 12 October 2006 6:39:16 am
Hi Pascal
Do you still have the user object?If yes:
This for the hash type md5_user which you can find in your site.ini. If you use another hash type you need to change the password_hash and the hash_type number $hash_type_nr = 2; $password_hash = md5('YOUR LOGIN' . "\n" . 'YOUR PASSWORD');$query = "INSERT INTO ezuser VALUES(USER_OBJECT_ID, 14, 'YOUR EMAIL', 'YOUR LOGIN', $password_hash, $hash_type_nr)";
(Replace all words in capitals with your settings)
If you do not have the user content object anymore I don't know what to do.
Remember to make a backup of your database before doing this.
Greetings from Luxembourg
Claudia
Thursday 12 October 2006 9:34:15 am
Hi Claudia,
In fact, I wanted the mysql command to add the admin line.
Now, the ezuser table contents only:
and no other line.
If I want to modify one value of this line I can use:
UPDATE ezuser SET password_hash="fdgss1254456sds456s1ssssssds" WHERE contentobject_id="14";
or
UPDATE ezuser SET email="pascal@anywhere.com" WHERE contentobject_id="14";
but how to create a new line in this ezuser table ?
Thursday 12 October 2006 10:01:38 am
Well, the mysql command is:
INSERT INTO `ezuser` (`contentobject_id`, `email`, `login`, `password_hash`, `password_hash_type`) VALUES ('14', 'france@gmail.com', 'admin', 'c78e3b0f3d9244ed8c6d1c29464bdff9', '2');
but I can't login.
I cleared the caches, restarted Mysql but I can't login
I don't find anything in var/log/ or var/my_siteaccess/log/
Thursday 12 October 2006 10:36:27 am
Yes, you are right - the user_object_id was to much... I really shouldn't post something when I am busy with other stuff. Ok, hopefully I will be a bit more careful now.
I do not know where all the user relevant data is stored and how you lost your admin user, so I am not sure how to solve your problem. Check whether the user is enabled (table ezuser_setting). Enable full debug output and check whether you can see anything in there. Make sure that the object with the id 14 still exists (just fetch it in a template).Make sure the user is a child of the admin user group.
What happens when you try to login? Do you get a message about the password being wrong, does it tell you about wrong permissions or what?
Also have a look at this post - this might help you to create a new admin user if nothing else works.http://ez.no/community/forum/developer/loosing_administrator_user/re_loosing_administrator_user__7
Good luck
Thursday 12 October 2006 11:22:43 am
fortunately I do 3 backup per day ;-)
So a diff between two backup files tells me the admin user has been removed just like some user roles.