Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [Solved]: Removing CONFIG Button from the admin menu?  (Read 4601 times)

0 Members and 1 Guest are viewing this topic.

Scias

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 86
[Solved]: Removing CONFIG Button from the admin menu?
« on: June 23, 2008, 08:59:59 am »

as i had asked a question before, pertaining about limiting access to a group, basically a moderator, and finding there is no way to do such, i was curious if there is a way to literally "hide" the config button on the admin menu? wether it means removing the button totally, and re-adding it if i need to change things, or whatever, i dont mind, im just curious of whats possible.

if i did not explain well enough, i apologize.
« Last Edit: July 01, 2008, 03:48:24 pm by Joachim Müller »
Logged

steveeh131047

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Posts: 217
Re: Removing CONFIG Button from the admin menu?
« Reply #1 on: June 23, 2008, 09:55:43 am »

Scias,

To remove a button: http://forum.coppermine-gallery.net/index.php/topic,25197.0.html

Rather than
Quote
re-adding it if i need to change things
you could just create another theme which includes the button and which only you use.
Logged

Scias

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 86
Re: Removing CONFIG Button from the admin menu?
« Reply #2 on: June 23, 2008, 11:34:00 pm »

ahh, tyvm, as one of the admins stated it's not possible to make "moderator" level admin permission, i thought a simple fix as removing the most vital button(s) would be undoable, or he would have suggested it, but i guess a shot in the dark proved worth while hehe, tyvm :) and yep i use 2 different themes, one for normal, and one for "speedy" (like batch adding)
Logged

Scias

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 86
Re: Removing CONFIG Button from the admin menu?
« Reply #3 on: June 24, 2008, 04:09:26 am »

well! i found the stuff, added the needed pieces, commented them out (via the / method), but it seems to not remove such buttons, looks like im missing something, hm... ill update when i figure it out. :P
Logged

Scias

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 86
Re: Removing CONFIG Button from the admin menu?
« Reply #4 on: June 24, 2008, 04:53:35 am »

*grumbles about not being able to edit old posts*, i have done everything explained in that thread, and tryed about 10 of my own "theorys" none have worked at all unfortunately. and i believe the LOGIN is on a different setup then the admin menu (atleast it appears so), so it may need something different done to it. ;)
Logged

steveeh131047

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Posts: 217
Re: Removing CONFIG Button from the admin menu?
« Reply #5 on: June 24, 2008, 10:27:10 am »

Scias,

Login is part of the System Menu.

Look in themes/sample/theme.php and you'll see Login as one entry in the HTML template for template sys_menu buttons.
Paver's first posting in http://forum.coppermine-gallery.net/index.php/topic,26897.0.html explains how to edit sys_menu.

Basically you need to copy:
Quote
    * function assemble_template_buttons
    * function addbutton
    * variable $template_sys_menu
    * variable $template_sub_menu
    * block to fill in $template_sys_menu
    * block to fill in $template_sub_menu

from themes/sample/theme.php across to themes/mynewthemewithoutloginbutton/theme.php - this code is line 59 thru 150 in my text editor.

Then edit out the Login button. Don't just comment out the appropriate line or you'll get a "block error". Instead, replace the {tokens} with null strings like this:

Code: [Select]
addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');
becomes:

Code: [Select]
addbutton($sys_menu_buttons,'','','','login','');
Alternatively, if you don't want to edit the code, you could use the Final_Extract plugin.

Cheers,
Steve
Logged

Scias

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 86
Re: Removing CONFIG Button from the admin menu?
« Reply #6 on: June 24, 2008, 10:56:25 am »

erm... i was speaking about the ADMIN MENU and the buttons from it, not about the log in at all? hehe :P
Logged

steveeh131047

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Posts: 217
Re: Removing CONFIG Button from the admin menu?
« Reply #7 on: June 24, 2008, 11:39:04 am »

Sorry - I misunderstood what you were trying to do:

Quote
and i believe the LOGIN is on a different setup then the admin menu (atleast it appears so), so it may need something different done to it.

Steve
Logged

steveeh131047

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Posts: 217
Re: Removing CONFIG Button from the admin menu?
« Reply #8 on: June 24, 2008, 11:50:46 am »

The Config button is this entry
Code: [Select]
<td class="admin_menu"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></td>in  "HTML template for gallery admin menu"

Have you tried just deleting this line for the theme you are trying to change?
Logged

Scias

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 86
Re: Removing CONFIG Button from the admin menu?
« Reply #9 on: June 25, 2008, 12:00:20 am »

sorry for late reply, was sleeping in for once! and as i recalled, simply deleting it wouldnt work, as it originally was not in the theme (using igames theme), so it would simply revert back, and still appear :) i tryed adding that section, then commenting it out, to no avail aswell.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Removing CONFIG Button from the admin menu?
« Reply #10 on: June 25, 2008, 09:01:25 am »

What you want to do is basically nothing else than believing in the dumbness of your mods. A webmaster (or mod) with very basic skills and 15 minutes of time can download coppermine and take a look how it works. Then he's able to edit all settings (if you give him admin rights). When he's got admin rights, he's able to wipe your server. So be sure whom to give these rights. Removing some links won't make it any better.
If I remeber right there's a mod that offers some moderator features. Use that.
Maybe limit the access to the config by user id and not group. This still isn't safe at all but a little bit better than just hiding the link.
Best is, as mentioned already several times, not to give away admin rights to people you do not fully trust.

steveeh131047

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Posts: 217
Re: Removing CONFIG Button from the admin menu?
« Reply #11 on: June 25, 2008, 10:35:01 am »

I just tried it in the igames theme and it works just fine!

Copy across everything between (and including) "// HTML template for gallery admin menu" and "EOT;" from themes/sample/theme.php to themes/igames/theme.php and then delete the line I said.

BUT NOTE STRAMM'S COMMENT ABOUT HOW INSECURE THIS METHOD IS.
Logged

Scias

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 86
Re: Removing CONFIG Button from the admin menu?
« Reply #12 on: June 26, 2008, 08:55:24 pm »

sorry for no reply, was up for 32 hours solid+out doing stuff during that time, so last 2 days have been... a mess. lol :P

to stramm, im WELL aware of trust issues, etc, im just more-so trying to remove key things, to STOP accidents, or people going "hm, whats this" and accidently screwing with something, just to save some headaches.

steve, ty, ill try it out, just doesnt make sense, but though i may be over-looking the part actually calling the admin section from that code, so removing it should actually work. ill give it a shot ;)
Logged

Scias

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 86
Re: Removing CONFIG Button from the admin menu?
« Reply #13 on: July 01, 2008, 06:11:05 am »

yep it worked, stupid me over-sighting such a simple thing sigh. tyvm. :P
Logged
Pages: [1]   Go Up
 

Page created in 0.032 seconds with 20 queries.