[Solved]: Removing CONFIG Button from the admin menu? [Solved]: Removing CONFIG Button from the admin menu?
 

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

[Solved]: Removing CONFIG Button from the admin menu?

Started by Scias, June 23, 2008, 08:59:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Scias

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.

steveeh131047

Scias,

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

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

Scias

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)

Scias

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

Scias

*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. ;)

steveeh131047

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:

addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');

becomes:

addbutton($sys_menu_buttons,'','','','login','');

Alternatively, if you don't want to edit the code, you could use the Final_Extract plugin.

Cheers,
Steve

Scias

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

steveeh131047

Sorry - I misunderstood what you were trying to do:

Quoteand 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

steveeh131047

The Config button is this entry
<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?

Scias

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.

Stramm

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

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.

Scias

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 ;)

Scias

yep it worked, stupid me over-sighting such a simple thing sigh. tyvm. :P