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
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>
Please tell us what theme is that user using?
the standard theme
no change have been made to the source code exept the line i posted in the first post
In theme.php of the selected theme of that user find this code
<!-- 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).
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
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 ???
Post a link and test user account (non-admin) please.
Joachim
http://www.jhdefaar.be/Fotos/
u/p: coppermine/1234
thx for your help !
any luck gaugau?
The "strange error" is just a plain "file not found" error: http://www.jhdefaar.be/Forum/phpBB2/cpg_redir.php returns
QuoteNot 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
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
not sure what you did, logging in with test account works as expected though.
Joachim
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
the error has returned >:(
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