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: coppermine admin but not php-admin  (Read 6022 times)

0 Members and 1 Guest are viewing this topic.

GigaTexel

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
coppermine admin but not php-admin
« on: January 14, 2005, 11:00:04 am »

i want to give one specific forum user admin rights in coppermine but he has to remain a regular user on the phpbb forum

i searched the forum for my question and found that i needed to change this line in the init.inc.php file:

define('GALLERY_ADMIN_MODE', (USER_IS_ADMIN || USER_ID == 10) && $USER['am']);

so when the user with ID 10 logs, he becomes an admin

but now he gets a strange error when returning to the coppermine site

Code: [Select]
Template error
Failed to find block 'enter_admin_mode'(#(<!-- BEGIN enter_admin_mode -->)(.*?)(<!-- END enter_admin_mode -->)#s) in :

                <span class="topmenu">
<!-- BEGIN album_list -->
                        <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a> ::
<!-- END album_list -->
<!-- BEGIN my_gallery -->
                        <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a> ::
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
                        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a>  ::
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
                        <a href="{MY_PROF_TGT}">{MY_PROF_LNK}</a> ::
<!-- END my_profile -->
<!-- BEGIN faq -->
                        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a> ::
<!-- END faq -->

<!-- BEGIN leave_admin_mode -->
                        <a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a> ::
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
                        <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a> ::
<!-- END upload_pic -->
<!-- BEGIN register -->
                        <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a> ::
<!-- END register -->

<!-- BEGIN logout -->
                        <a href="{LOGOUT_TGT}">{LOGOUT_LNK}</a>
<!-- END logout -->
                        <br />
                        <a href="{LASTUP_TGT}">{LASTUP_LNK}</a> ::
                        <a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a> ::
                        <a href="{TOPN_TGT}">{TOPN_LNK}</a> ::
                        <a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a> ::
                        <a href="{FAV_TGT}">{FAV_LNK}</a> ::
                        <a href="{SEARCH_TGT}">{SEARCH_LNK}</a>
                </span>

Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: coppermine admin but not php-admin
« Reply #1 on: January 15, 2005, 09:05:07 am »

Please tell us what theme is that user using?
Logged
Chief Geek at Ranium Systems

GigaTexel

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: coppermine admin but not php-admin
« Reply #2 on: January 15, 2005, 10:58:16 am »

the standard theme

no change have been made to the source code exept the line i posted in the first post
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: coppermine admin but not php-admin
« Reply #3 on: January 15, 2005, 11:50:32 am »

In theme.php of the selected theme of that user find this code

Code: [Select]
<!-- BEGIN enter_admin_mode -->
        <a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a> ::
<!-- END enter_admin_mode -->

This code will be somewhere at the top in that file.

Report whether you find this code or not in theme.php of the selected theme of that user (user id 10).
Logged
Chief Geek at Ranium Systems

GigaTexel

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: coppermine admin but not php-admin
« Reply #4 on: January 15, 2005, 01:54:43 pm »

that code is present in every theme.php

i use the same theme (since coppermine is integrated in phpbb it is not possible to change themes, clicking on profile refers to the phpbb profile page) and i do have admin rights (i am the phpBB administrator)

for my account it all works perfect (with and without the changed code in include/init.inc.php)

i changed back the code and now his account works perfect (without the admin rights offcourse)
changing the code makes the error reappear
Logged

GigaTexel

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: coppermine admin but not php-admin
« Reply #5 on: January 15, 2005, 06:03:48 pm »

i managed to determine if he IS using the same theme as mine

i added the folowing line to the theme.php file:

<p>using default theme</p>

and indeed, when I log in the "using default theme" appears at the top of the page

when I change login to his account the "using default theme" line appears in the error !!!

Quote
Template error
Failed to find block 'enter_admin_mode'(#(<!-- BEGIN enter_admin_mode -->)(.*?)(<!-- END enter_admin_mode -->)#s) in :

                <span class="topmenu">
<p>using standard theme</p>[/b]
<!-- BEGIN album_list -->
                        <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a> ::
<!-- END album_list -->
<!-- BEGIN my_gallery -->
                        <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a> ::
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
                        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a>  ::
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
                        <a href="{MY_PROF_TGT}">{MY_PROF_LNK}</a> ::
<!-- END my_profile -->
<!-- BEGIN faq -->
                        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a> ::
<!-- END faq -->

<!-- BEGIN leave_admin_mode -->
                        <a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a> ::
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
                        <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a> ::
<!-- END upload_pic -->
<!-- BEGIN register -->
                        <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a> ::
<!-- END register -->

<!-- BEGIN logout -->
                        <a href="{LOGOUT_TGT}">{LOGOUT_LNK}</a>
<!-- END logout -->
                        <br />
                        <a href="{LASTUP_TGT}">{LASTUP_LNK}</a> ::
                        <a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a> ::
                        <a href="{TOPN_TGT}">{TOPN_LNK}</a> ::
                        <a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a> ::
                        <a href="{FAV_TGT}">{FAV_LNK}</a> ::
                        <a href="{SEARCH_TGT}">{SEARCH_LNK}</a>
                </span>

so now we're 100% sure we're using the same theme!

question remains: why is he getting that error, knowing that the section the script searches for IS present  ???
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: coppermine admin but not php-admin
« Reply #6 on: January 16, 2005, 05:15:27 am »

Post a link and test user account (non-admin) please.

Joachim
Logged

GigaTexel

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: coppermine admin but not php-admin
« Reply #7 on: January 16, 2005, 09:39:49 am »

http://www.jhdefaar.be/Fotos/

u/p: coppermine/1234

thx for your help !
Logged

GigaTexel

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: coppermine admin but not php-admin
« Reply #8 on: January 17, 2005, 06:25:47 pm »

any luck gaugau?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: coppermine admin but not php-admin
« Reply #9 on: January 18, 2005, 06:55:12 am »

The "strange error" is just a plain "file not found" error: http://www.jhdefaar.be/Forum/phpBB2/cpg_redir.php returns
Quote
Not Found
The requested URL /Forum/phpBB2/cpg_redir.php was not found on this server.

Apache/1.3.29 Server at www.jhdefaar.be Port 80
You should be able to solve this on your own by re-reading the integration section of the docs that come with coppermine: http://coppermine.sourceforge.net/manual.php#integrating_steps_special_phpbb_start

Joachim
Logged

GigaTexel

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: coppermine admin but not php-admin
« Reply #10 on: January 18, 2005, 08:46:20 am »

ok, i found the error

the extra integration file was not uploaded when performing some upgrades to the forum, stupid me !

however, the user doesn't get the admin-controls when logging in however his user_id in the phpbb DB is 10
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: coppermine admin but not php-admin
« Reply #11 on: January 19, 2005, 07:57:55 am »

not sure what you did, logging in with test account works as expected though.

Joachim
Logged

GigaTexel

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: coppermine admin but not php-admin
« Reply #12 on: January 19, 2005, 08:00:34 am »

yes but logging in with the second admin account doesn(t give him the appropriate admin rights

if you want, i can PM you the login/pw
Logged

GigaTexel

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: coppermine admin but not php-admin
« Reply #13 on: January 20, 2005, 09:40:25 am »

the error has returned  >:(
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: coppermine admin but not php-admin
« Reply #14 on: January 20, 2005, 01:55:11 pm »

bridging/integration means exactly what it says: there's no actual user management from coppermine when bridging is enabled - instead, the user management of the app coppermine is bridged with (the bbs) is taken into account; if a user is admin in the bbs, he'll be admin in coppermine. If he isn't, he won't be admin in coppermine neither.
Changing something in this hardcoded built-in relation is possible in theory, but not recommended (and as you can see not easy).
I'm not sure why you would want to fully trust this user to be admin on your coppermine install, while you don't trust him on your board. If he doesn't know his way around (or he can't fully be trusted), he'll be able to break things no matter what. Granting coppermine admin acces could be used (by a skilled person) to gain admin powers on the bbs (or any other script on the web account).
I'm sorry, if your hack doesn't work as expected I can't give you any more recommendations, as I don't run a phpbb install, so I have no means to test (or even look at the db structure), which means: I'm out of this thread. If someone is willing to take over, please do so.

Joachim
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 15 queries.