Login redirect to different theme for user and administrator Login redirect to different theme for user and administrator
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Login redirect to different theme for user and administrator

Started by dondo521, February 06, 2005, 04:04:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dondo521

Is it possible at the log in to have a theme for just the administrator and one just for the users?
That way I can alter the user theme to not have the admin menu but allow me as the administrator to still log in as the user and create albums, change album properties and such...
I have searched for something like this for an hour or so but have not found anything....

Thanks!
dondo521

Casper

yes, this is possible, (and I think it was posted how some time ago).  But, why do you want to remove the users admin menu?
If you do not allow them to have personal albums (group settings) they do not see it anyway.  And if you do allow personal albums, they will need it.

I'm not sure I follow your logic here.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

dondo521

The reason I want to do is that I don't see a way for me to create a users album and grant me as the administrator to set it up, but only allow the user and me to see it. I don't however want to grant the user access to change permissions and such.

Basically here's the deal:
I am setting up a photographers photo gallery.
I upload the photos.
The user gets a username and password to log in to see their photos but not be able to do anything else.
No one else can see them therefore no one else (except of course me and that user) can send e-cards and such.
If the user chooses to have their albums public I as the administrator would change that.

The guy I am setting this site up for wants me to have full access and permissions to the users albums and the user to be able to just see them and nothing else. So the thought was is that I would log on as that user and make what ever changes I had to using my administrator theme since there are certain things I can not do logging in as an administrator right now. For example if I log in as that user I am able to set the field of who can view the album to just that user and not a group. If I log in as the administrator to that album I can only grant permission of that album to a group or to just me as the administrator. Make sense?

That was why I thought of the different themes solution. That way I could take off some of the menu fields in the user theme so they would not be able to see them. And maybe if the photographer I am doing the web site for wants to change certain access rights for the user all I have to do is uncomment the menu fields that I am hiding in that user theme.

what do ya think?

Thanks,

dondo521

Casper

Ok, I don't think you need to have a theme change system for this.

What you need to do is remove the buttons from the user_admin menu.  If all you want to stop, is the ability to change the album settings, just remove the link to the modifyalb.php.  Find this code in the theme.php;

// HTML template for user admin menu
$template_user_admin_menu = <<<EOT

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>
                                <td class="admin_menu"><a href="albmgr.php" title="">{ALBMGR_LNK}</a></td>
                                <td class="admin_menu"><a href="modifyalb.php" title="">{MODIFYALB_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="">{MY_PROF_LNK}</a></td>
                        </tr>
                </table>
                </div>

EOT;


Change it to this;

// HTML template for user admin menu
$template_user_admin_menu = <<<EOT

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>
                                <td class="admin_menu"><a href="albmgr.php" title="">{ALBMGR_LNK}</a></td>
                             
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="">{MY_PROF_LNK}</a></td>
                        </tr>
                </table>
                </div>

EOT;


Do this in every theme on the server.  The user can still create the albums, but cannot modify their properties.

If he does not want them to create albums either, then remove the link to albmgr.php as well.  The admin will then have to log in as the user, and manually enter the url to the albmgr.php to create the albums.

The admin will still have full access to admin these albums when logged in as admin.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

dondo521

Thanks for the info Casper
I was actually kind of doing it that way at first, but it's too bad there isn't another method. Manually typing in urls when dealing with numerous customer albums is kind of a drag. That's what I was thinking of the admin theme solution. Or perhaps there was someway of having the user's show up as a selection like the groups do when selecting who can view the album. Then again I guess that would open up the possibility of a user selecting another user to access his files. Unless you didn't set up the user as having his own personal gallery and had the administrator (me) select the user in a category I made up...

If I did it that way I guess I could make every user it's own group, but again it would be great if there was someway that I as an administrator could select user from the access tab instead of just groups...that's why I had thought of the administrator theme scenario....

confused yet? ;)-lol!

dondo521


Casper

well, the easy way would be to only have 2 identical themes on the server, one with the user admin buttons, one without.
Set the one without as the default theme.

Then get the admin to type this on the end of the url, ?theme=name of theme with buttons.

He will only have to do this once, as the cookie remembers the theme selection.

He will then have the menu, his users will not.  He must not allow users to change theme.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

dondo521

That would be it my friend! :)
Perhaps there is someway to setup the login to do a "if I as the administrator log in with my password" it will default to my theme, so as to keep another level of protection but if you just type in the theme it won't work... ???

dondo521

Tranz

The code could probably be edited to assign a theme based on if it's the admin that is logged in.

dondo521

Actually when you think it out you're really back to square one.
Even if it logs you in to a different theme as the administrator you still don't have those access rights that the user has such as described above.

The only way to do it is if you as the administrator could log in as the user and somehow it would default to that administrator theme or rather the theme that doesn't have those certain menu fields commented out. But how would it know to do that if you are logging in as the user? ip verification? cookies? ???

dondo521