Advanced search  

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

Pages: [1]   Go Down

Author Topic: Login redirect to different theme for user and administrator  (Read 4262 times)

0 Members and 1 Guest are viewing this topic.

dondo521

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Login redirect to different theme for user and administrator
« on: February 06, 2005, 04:04:30 am »

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
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Login redirect to different theme for user and administrator
« Reply #1 on: February 06, 2005, 12:37:59 pm »

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.
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Login redirect to different theme for user and administrator
« Reply #2 on: February 06, 2005, 06:59:01 pm »

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
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Login redirect to different theme for user and administrator
« Reply #3 on: February 06, 2005, 09:15:11 pm »

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;

Code: [Select]
// 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;

Code: [Select]
// 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.
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Login redirect to different theme for user and administrator
« Reply #4 on: February 06, 2005, 09:56:01 pm »

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

Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Login redirect to different theme for user and administrator
« Reply #5 on: February 06, 2005, 10:31:41 pm »

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.
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Login redirect to different theme for user and administrator
« Reply #6 on: February 06, 2005, 10:53:24 pm »

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
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Login redirect to different theme for user and administrator
« Reply #7 on: February 06, 2005, 11:01:03 pm »

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

dondo521

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Login redirect to different theme for user and administrator
« Reply #8 on: February 06, 2005, 11:17:18 pm »

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
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.