change the permission of all users
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
change the permission of all users
Hello all,
I would like to change the permission of all users on my site from author to registered, which table and field I should modify?
I'm using CB component.
Thanks,
I would like to change the permission of all users on my site from author to registered, which table and field I should modify?
I'm using CB component.
Thanks,
Last edited by gacon on Mon Sep 17, 2007 2:07 pm, edited 1 time in total.
Ý Nghĩa . com http://www.ynghia.com/
Re: change the permission of all users
Open (browse) the table named jos_core_acl_aro_groups. It will list the various types of users. Write down the group_id for the user type "Registered". For the sake of example, let's say that number is 18. Next, enter the following SQL command:
That should do the trick for you.
Of course, always make a backup of the table you are modifying and it's always a good idea to take your site offline while you do this kind of stuff.
Code: Select all
UPDATE jos_users SET gid=18, usertype='Registered' WHERE usertype='Author';
That should do the trick for you.
Of course, always make a backup of the table you are modifying and it's always a good idea to take your site offline while you do this kind of stuff.
__________________
Bruce Scherzinger
Bruce Scherzinger
Re: change the permission of all users
I have used this command:
UPDATE jos_users SET gid=18, usertype='Registered' WHERE id > 63;
When i check in the PhpMyAdmin window:
But when i use User Manage of Joomla, nothing change:
thanks for your help!
UPDATE jos_users SET gid=18, usertype='Registered' WHERE id > 63;
When i check in the PhpMyAdmin window:
But when i use User Manage of Joomla, nothing change:
thanks for your help!
Ý Nghĩa . com http://www.ynghia.com/
Re: change the permission of all users
This is the content of jos_core_acl_groups_aro_map
Note: I have removed the CB component
Thanks for your help!
Note: I have removed the CB component
Thanks for your help!
Last edited by gacon on Tue Sep 18, 2007 2:26 am, edited 1 time in total.
Ý Nghĩa . com http://www.ynghia.com/
Re: change the permission of all users
In the response I ended up deleting, I was trying to write an SQL statement that would set jos_core_acl_groups_aro_map.group_id to 18 for every user whose jos_users.id is > 67 (or whose jos_core_acl_aro.value > 67). I believe that's what is needed, though I am struggling to create a single SQL statement that does it. I am not sure it can be done entirely in SQL, but I have reached the limit of my MySQL expertise trying to solve this. It may require some coding (PHP or otherwise).
The following invalid SQL statement captures the spirit of what is needed, but does not work:
I apologize for leading you down this path only to get lost. Negative karma for me!
The following invalid SQL statement captures the spirit of what is needed, but does not work:
Code: Select all
...
UPDATE
(SELECT group_id FROM jos_core_acl_aro AS acl
INNER JOIN jos_core_acl_groups_aro_map AS map
ON acl.aro_id=map.aro_id
WHERE map.value>67 AND map.group_id=19)
AS temp_table
SET temp_table.group_id=18
...
I apologize for leading you down this path only to get lost. Negative karma for me!
__________________
Bruce Scherzinger
Bruce Scherzinger
Re: change the permission of all users
Something like this should work:
(from http://forum.joomla.org/index.php/topic,213582.0.html)
Code: Select all
UPDATE users, acl_map, aro
SET users.type='Registered', users.gid=18, acl_map.gid=18
WHERE users.type='Author' AND users.id=aro.userid AND aro.acl=acl_map.aro
(from http://forum.joomla.org/index.php/topic,213582.0.html)
http://thongtincongnghe.com/ - Thông tin công nghệ
Re: change the permission of all users
jcisio wrote:Something like this should work:Code: Select all
UPDATE users, acl_map, aro
SET users.type='Registered', users.gid=18, acl_map.gid=18
WHERE users.type='Author' AND[b] users.id=aro.userid[/b] AND aro.acl=acl_map.aro
(from http://forum.joomla.org/index.php/topic,213582.0.html)
You have tried? There is no the field userid in the table jos_core_acl_aro (I made in bold in your code).
Ý Nghĩa . com http://www.ynghia.com/
Re: change the permission of all users
gacon wrote:jcisio wrote:Something like this should work:Code: Select all
UPDATE users, acl_map, aro
SET users.type='Registered', users.gid=18, acl_map.gid=18
WHERE users.type='Author' AND[b] users.id=aro.userid[/b] AND aro.acl=acl_map.aro
(from http://forum.joomla.org/index.php/topic,213582.0.html)
You have tried? There is no the field userid in the table jos_core_acl_aro (I made in bold in your code).
I'm pretty sure, at least it's syntaxically correct.
ARO has a relation Access <-> Request (User Id, Group Id), feel free to modify to fit your need.
Last edited by jcisio on Mon Sep 24, 2007 1:40 pm, edited 1 time in total.
http://thongtincongnghe.com/ - Thông tin công nghệ
Re: change the permission of all users
not yet successful. Anyone can help me?
Ý Nghĩa . com http://www.ynghia.com/
Re: change the permission of all users
gacon wrote:not yet successful. Anyone can help me?
Have you tried my query ? Please post the one you tried if it didn't work.
http://thongtincongnghe.com/ - Thông tin công nghệ
Re: change the permission of all users
please review my previous post.
There is no the field userid in the table jos_core_acl_aro (I made in bold in your code).
Ý Nghĩa . com http://www.ynghia.com/
Re: change the permission of all users
gacon wrote:please review my previous post.There is no the field userid in the table jos_core_acl_aro (I made in bold in your code).
Change to the appropriate field (as I said before). The query shouldn't work and I don't have Joomla! db structure here, but if you change it, it will work. I just figure the idea, hope you get it.
http://thongtincongnghe.com/ - Thông tin công nghệ
- ircmaxell
- Joomla! Intern
- Posts: 52
- Joined: Thu Nov 10, 2005 3:10 am
- Location: BumbleF&%K, NJ
- Contact:
Re: change the permission of all users
This will sync your jos_core_acl_groups_aro_map with jos_users
Code: Select all
UPDATE jos_core_acl_groups_aro_map AS a
JOIN jos_core_acl_aro AS b ON a.aro_id = b.aro_id
JOIN jos_users AS c ON b.value = c.id
SET a.group_id = c.gid
Joomla Development WorkGroup - Joomla BugSquad!
http://www.joomlaperformance.com For All Your Joomla Performance Needs
http://www.ircmaxell.com
The greatest obstacle to discovery is not ignorance, but the delusion of knowledge.
http://www.joomlaperformance.com For All Your Joomla Performance Needs
http://www.ircmaxell.com
The greatest obstacle to discovery is not ignorance, but the delusion of knowledge.
Re: change the permission of all users
Thanks so much
It's well done with this command.
It's well done with this command.
ircmaxell wrote:This will sync your jos_core_acl_groups_aro_map with jos_usersCode: Select all
UPDATE jos_core_acl_groups_aro_map AS a
JOIN jos_core_acl_aro AS b ON a.aro_id = b.aro_id
JOIN jos_users AS c ON b.value = c.id
SET a.group_id = c.gid
Ý Nghĩa . com http://www.ynghia.com/