Forums / Setup & design / How to retrive the admin role

How to retrive the admin role

Author Message

Vincent Lyu

Tuesday 11 July 2006 11:15:17 pm

Unfortunately,i deleted the admin role by mistake,how could i retrive it?

Create New Web,Create New World!

Xavier Dutoit

Wednesday 12 July 2006 11:25:07 pm

Create a role that grant all on all modules on all methods.

At the end you have something like
* * *

And put a user under that role
X+

http://www.sydesy.com

Vincent Lyu

Thursday 13 July 2006 12:22:22 am

i'm afraid i can't login as admin or other users,so could you tell me how to find the entry using mysql and update a new role?

Lazaro Ferreira

Thursday 13 July 2006 2:28:21 am

Hi,

I guess you can logon to mysql then look at

ezuser 

and

ezuser_role

tables in another ezpublish setup of the same version, look for

admin

login there you can get the information to fix your tables

Lazaro
http://www.mzbusiness.com

Ɓukasz Serwatka

Thursday 13 July 2006 4:22:49 am

Run following SQL queires:

First create new role:
INSERT INTO ezrole (version, name, is_new) VALUES('0', 'New role', '1');

Check id of new created role and use in (new policy) second query (replace ROLE_ID, with correct integer):
INSERT INTO ezpolicy (role_id, module_name, function_name) VALUES('ROLE_ID', '*', '*')

As third query run, 12 is contentobject_id of administrators user group, replace ROLE_ID with your:
INSERT INTO ezuser_role (contentobject_id, id, limit_identifier, limit_value, role_id) VALUES('12', NULL, '', '', 'ROLE_ID')

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Vincent Lyu

Thursday 13 July 2006 7:56:46 am

mysql> select * from ezpolicy;
+---------------+-----+-------------+---------+
| function_name | id | module_name | role_id |
+---------------+-----+-------------+---------+
| * | 308 | * | 2 |
| read | 352 | content | 1 |
| pdf | 353 | content | 1 |
| edit | 354 | content | 1 |
| * | 355 | content | 11 |
| login | 356 | user | 11 |
| preferences | 357 | user | 11 |
| * | 358 | content | 3 |
| login | 359 | user | 3 |
| preferences | 360 | user | 3 |
| * | 361 | * | 13 |
+---------------+-----+-------------+---------+
11 rows in set (0.00 sec)

mysql> select * from ezuser;
+------------------+----------------------+-----------+----------------------------------+----
----------+
| contentobject_id | email | login | password_hash | pas
hash_type |
+------------------+----------------------+-----------+----------------------------------+----
----------+
| 10 | nospam@ez.no | anonymous | cba40278b4197a74eb91bc9feb6faba1 |
2 |
| 12 | jerkwolf@hotmail.com | admin | 5929d1915a73e7446079f69857f9d89e |
2 |
| 64 | flashwolf@126.com | jerkwolf | b0835d955b2eca5f617a2acb8a9d1015 |
2 |
| 98 | flashwolf@sina.com | flashwolf | a1b5b31ff95d8c728dbfe93553d4b6da |
2 |
| 99 | lvwenshi@hotmail.com | lvwenshi | 6d7cac8cb0f1db5ec0a19e5ce5da341a |
2 |
| 100 | | | |
1 |
+------------------+----------------------+-----------+----------------------------------+----
----------+
6 rows in set (0.00 sec)

mysql> select * from ezuser_role;
+------------------+----+------------------+-------------+---------+
| contentobject_id | id | limit_identifier | limit_value | role_id |
+------------------+----+------------------+-------------+---------+
| 12 | 25 | | | 2 |
| 11 | 28 | | | 1 |
| 42 | 31 | | | 1 |
| 11 | 35 | | | 3 |
| 42 | 36 | | | 3 |
| 12 | 37 | | | 13 |
+------------------+----+------------------+-------------+---------+
6 rows in set (0.00 sec)

mysql> select * from ezrole;
+----+--------+---------------+-------+---------+
| id | is_new | name | value | version |
+----+--------+---------------+-------+---------+
| 1 | 0 | Anonymous | | 0 |
| 2 | 0 | Administrator | * | 0 |
| 3 | 0 | Editor | | 0 |
| 13 | 1 | New role | NULL | 0 |
+----+--------+---------------+-------+---------+
5 rows in set (0.00 sec)

This is my table,i follows your instruction did these step,but still login failed:

http://localhost/corporate_site_admin/user/login
====================================
[07/13/2006 10:47 pm] The system could not log you in.
Make sure that the username and password is correct.
All letters must be typed in using the correct case.
Please try again or contact the site administrator.
====================================

Create New Web,Create New World!

eZ debug

Timing: Jan 21 2025 02:36:28
Script start
Timing: Jan 21 2025 02:36:28
Module start 'content'
Timing: Jan 21 2025 02:36:28
Module end 'content'
Timing: Jan 21 2025 02:36:28
Script end

Main resources:

Total runtime0.2106 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 587.7109180.8359
Module start 'content' 0.00660.0039 768.5469101.9922
Module end 'content' 0.01050.2000 870.5391529.6797
Script end 0.2104  1,400.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.6576200.0002
Check MTime0.00140.6569200.0001
Mysql Total
Database connection0.00070.329510.0007
Mysqli_queries0.156974.49281410.0011
Looping result0.00140.67601390.0000
Template Total0.199794.810.1997
Template load0.00080.367910.0008
Template processing0.198994.432710.1989
Override
Cache load0.00050.248810.0005
Sytem overhead
Fetch class attribute can translate value0.00070.352310.0007
XML
Image XML parsing0.00030.141510.0003
General
dbfile0.00200.9583200.0001
String conversion0.00000.002830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

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

Time used to render debug report: 0.0002 secs