I want to be able to have 4 admins on my site. How do I go about giving all 4 admin rights to the site? Any help would be greatly appreciated!
I want to be able to have 4 admins on my site. How do I go about giving all 4 admin rights to the site? Any help would be greatly appreciated! |
Hello,
I am not sure if there is a menu driven way to do this, I couldn't find one. I did go out to take a look and try to fnd a way to help you. I found a solution that works. Someone else may have a better one.
I looked at the Admins table in the database and noticed that it had 2 fields, one for Nick and another for Password. I also noticed that the password was encrypted, but to test it out I simply added a new record with a password. Well, as you might expect this did not work because the login program is expecting an encrypted string. So, I thought maybe the same encryption algorithym is used for the Profiles. As a test, I looked at the profiles table and created a query to insert a row into the Admins table using one of the Profile's credentials. This worked and created a new Admin that was able to login and perform Admin functions.
Steps to take to replicate what I did.
1. Backup your database just to be safe. 2. Create a profile for the user you want to be an admin or if they already have one, locate their ID in the profiles table. 3. Run the following query to add them to the Admins table:
INSERT into `Admins` SELECT `NickName`,`Password` FROM `Profiles` WHERE `ID` = <<insert ID here>>
4. Goto your Admin Panel and login using the new Nick
This workaround worked for me. I would test it on a test server first to ensure it works the way you want. I wouldn't doubt there is an easier way. I am sure we will hear about it in this thread if there is.
With a little bit of digging, I am sure I could find the call to the encryption program and make a simple menu driven mod out of this, which makes me wonder if it hasn't already been created or if there is a much simpler way to do this than manually going into the database. I can't find one on the Menus.
Also, I am new to Dolphin, so if any of the Expertz on here see some issue with the method I have posted, please let me know. I can't think of a reason why simply adding a row to Admins in this way would adversely affect anything.
|
One more thing. The Admin Nick can only be 10 characters, so the Profile Nick will be truncated if it is longer. |
Thanks so much for your thoughts on this matter. I should have googled this but I didnt think of it. When I did I found this at this link:
http://www.boonex.com/unity/blog/entry/Dolphin_Admin#7018
Sounds like the same process you came up with but I like your idea better. |
I tried what you suggested and it work very well. Now I have a member as an admin. However I noticed one thing. When I log into the main site I do not have the admin control panel link by the member name at the top. I also dont have the Admin box when looking at the profile like the real admin account does. Do you know where this is being stored from the difference of admin, mod and standard user? |
I am not sure about that. If I come across it, I will let you know.
If you login through the /admin panel and then goto homepage from the dashboard, I notice that it looks exactly the same for all admins, it greets you as admin. BTW - Just to be safe, I tested the password reset functionality and it appears that the user can only change their admin password and not the Admin user password.
I will look at the index page and try to determine how it "senses" the call from the dashboard (identifies the user as an Admin) and then how it displays the Admin Panel option. One thing to consider is that the user's admin password and their profile password do not have to be kept in synch since they are stored in separate tables and managed through separate processes. I suppose as long as the /admin panle is called from the link then a password will be requested if required. I will try to find some time to play around with this concept.
I supposed a simple query to check for the existence of the user nick in the admin table could be used as a conditional display criteria for a link on the top of the page. That may be a straightforwrd change to the php file / function that handles the creation of the top menu. Hmmmm ..... |
I wish I knew more about PHP programming but I dont. Sounds like you are very good with this. I appreciate your help.
Yeah I was thinking about the password issues as well but its no big deal since I only have 4 admins. I can manually delete their admin account and re-create it once they change their password. |
I figured out how to include an Admin Panel button for these users.
The following will add the Admin Panel button to the top of the screen if the Profile User is also an Admin. It will open the Admin panel in a separate window.
1. Find the file templates/uni/scripts/functions.php (or use the file in your custom template if you are using one) 2, Back this file up to provide a way to revert if this doesn't work for you. 2. Find the function HelloMemberSection 3. Find ob_start(); 4. Just below this add:
$memberID = (int)$_COOKIE['memberID'];
if( $logged['member'] && mysql_num_rows ($AdminCheck) ) <div class="hello_actions">
5. If you are using a custom template then you should apply the style to these spans. You should be able see examples in the subsequent 'if' clause.
6. Save the file 7. Test the change 8. If you experience problems then revert back to the original file
I hope this helps. It helped me learn a bit more about how the scripts work. I have a lot more to learn. :)
|
I noticed after using this for a while that this only allows you to log into the admin control panel using your username and password. Not really what I am after. I want to be able to have my admins to have their own accounts and go to the admin panel and not be logged out to admin but still have all admin privileges. |
since there is no more admin table in D7, here is what I had to do: |
Boonexpert has written an incredible piece of work:
http://www.boonex.com/m/multi-admin-access
that could be your moderation nightmare answer. When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support |