problem with modcp and rewrite

Discussions and support about the different URL Rewriting techniques for phpBB2.

Moderator: Moderators

problem with modcp and rewrite

Postby sceltic » Thu May 25, 2006 11:25 pm

I notice that the modcp mod is not working.

The moderator admin link redirects to index?

This is the mod code and link in there

Code: Select all
##############################################################
## MOD Title:      Moderator CP
## MOD Author:      kooky < [nospam]kooky@altern.org > (n/a) http://www.myphpbb.zaup.org/
## MOD Author:      Milkman < milkman@web-milk.co.uk > (Phill Sparks) http://www.lsucs.com/
## MOD Description:   This mod will add a Moderator Control Panel for all moderators.
##         They can disallow usernames, edit smilies, manage users accounts, ...
##         They have a similar link at the bottom, like the Admin.
##         Moderators are not allowed to edit Admin's accounts.
##         Admin is protected against mess made by moderators.
##         Admin can enable/disable each module.
## MOD Version:      1.1.1
##
## Installation Level:   Easy
## Installation Time:   5 minutes
## Files To Edit:   3
##         login.php
##         includes/page_tail.php
##         language/lang_english/lang_admin.php
## Included Files:   33
##         admin/admin_modcp.php
##         modcp/admin_disallow.php
##         modcp/admin_mass_email.php
##         modcp/admin_ranks.php
##         modcp/admin_smilies.php
##         modcp/admin_user_ban.php
##         modcp/admin_users.php
##         modcp/admin_words.php
##         modcp/functions_modcp.php
##         modcp/index.php
##         modcp/page_footer_mod.php
##         modcp/page_header_mod.php
##         modcp/pagestart.php
##         templates/subSilver/admin/modcp_config_body.tpl
##         templates/subSilver/modcp/disallow_body.tpl
##         templates/subSilver/modcp/index.htm
##         templates/subSilver/modcp/index_body.tpl
##         templates/subSilver/modcp/index_frameset.tpl
##         templates/subSilver/modcp/index_navigate.tpl
##         templates/subSilver/modcp/page_footer.tpl
##         templates/subSilver/modcp/page_header.tpl
##         templates/subSilver/modcp/ranks_edit_body.tpl
##         templates/subSilver/modcp/ranks_list_body.tpl
##         templates/subSilver/modcp/smile_edit_body.tpl
##         templates/subSilver/modcp/smile_import_body.tpl
##         templates/subSilver/modcp/smile_list_body.tpl
##         templates/subSilver/modcp/user_avatar_gallery.tpl
##         templates/subSilver/modcp/user_ban_body.tpl
##         templates/subSilver/modcp/user_edit_body.tpl
##         templates/subSilver/modcp/user_email_body.tpl
##         templates/subSilver/modcp/user_select_body.tpl
##         templates/subSilver/modcp/words_edit_body.tpl
##         templates/subSilver/modcp/words_list_body.tpl
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## 1. Copyright and special thanks!
## -----------
## This program is free software, you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation.
##
## This mod was originally made by Niels for his phpBB2 pre-loaded version.
## This individual part and the package were made by me with courtesy of Niels.
## This individual Mod is quite different from the original... and was improved...
## For any support about this mod, please don't contact/ask Niels.
##
## If you want to add this Mod to any database, please don't add
## my e-mail address to a topic, just point to my website (see above).
## (for spamming prevention)
##
## 2. Feature list
## -----------
## This MOD tries to enhance the Moderator Control Panel.
## - Added user_ban control for Mods (they couldn't ban ADMIN)
## - Mods cannot edit ADMIN or other MODs profile
## - Mods cannot delete users account (only disable account)
## - Fixed online status for a more real online status (modcp/index.php)
## - Added Username Color by default (modcp/index.php)
## - Disable Database size stat for Mods (modcp/index.php)
## - MODs (by default) can:
##     o Disallow username
##     o Mass email
##     o Edit ranks
##     o Edit smilies
##     o Ban users (unabled to ban ADMIN)
##     o Edit user profile (unabled to edit ADMIN or other MODs)
##     o Words censor
## - Admin enables/disables modules via AdminCP
## - Third part of the TRI FORCE (Username Color, User Level & ModCP)
##   http://www.phpbb.com/phpBB/viewtopic.php?t=205252
##
## if for any reason you want to remove or add other options, just delete/add
## the file in the modcp directory.
##
## 3. Compatibility / EasyMOD
## -----------
## This MOD is compatible with phpBB 2.0.18
## It will only work with PHP version 4.0.x and higher.
##
## It is also compatible with EasyMOD of Nuttzy and can be
## installed by it but is not yet certified EMC (EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## 4. Official last version link
## -----------
## Contact with email address quoted above without [nospam]
## Check this official link for latest updates...
## http://www.myphpbb.zaup.org/
##
##############################################################
## MOD History:
##
## 2005/11/20 - Version 1.1.1
##   - Updated to be compliant with phpBB 2.0.18
##
## 2005/08/15 - Version 1.1.0 (public release) - dedicated to Milkman
##   - Fixed issue with label in admin_modcp
##   - Updated selection box feature (contrib and modcp)
##   - Updated lang_admin.php (2 new entries)
##
## 2005/08/12 - Version 1.1.0_pre3 (Milkman)
##   - Updated the admin panel to test if a module is configurable.
##   - modcp/modcp_* updated to allow above.
##   - Added some missing lang values.
##
## 2005/08/06 - Version 1.1.0_pre2 (Milkman)
##   - Updated modcp/admin_users.php so that lower user_levels can't edit higher ones.
##
## 2005/08/02 - Version 1.1.0_pre1 (Milkman)
##   - Added improved permissions and checks to see if that user level has any reason to use the modcp
##   - Added a blank option at the top of the list of users on the User/Manage module.
##
## 2005/07/25 - Version 1.0.10
##   - Updated to phpBB 2.0.17
##   - Added new login feature to the modcp
##   - Fixed a mistake in admin_user_ban.php
##
## 2005/06/18 - Version 1.0.9
##   - Re-added admin_user_ban.php (removed it by mistake)
##
## 2005/01/02 - Version 1.0.8
##   - Fixed issue in modcp/index.php
##     (thanks to uni for reported this)
##
## 2004/12/28 - Version 1.0.7
##   - Fixed error in modcp/admin_users.php
##   - Fixed permissions addon
##   - Updated admin/admin_modcp.php and its .tpl
##
## 2004/12/26 - Version 1.0.6
##   - Fixed potential issue with MOD level
##   - Fixed a missing code for email in user_edit_body.tpl
##   - Added addon for User Level Mod to add Main Mod level
##   - Added ModCP settings in AdminCP (enable/disable modules)
##
## 2004/09/09 - Version 1.0.5
##   - Updated instructions for author notes
##   - Confirmed on phpBB 2.0.10
##
## 2004/07/17 - Version 1.0.4
##   - Updated to phpBB 2.0.9
##
## 2004/06/29 - Version 1.0.3
##   - Updated to phpBB 2.0.8
##   - EasyMod compliant
##   - Fixed a lot of bugs
##
## 2003/??/?? - Version 1.0.2
##   - Updated to phpBB 2.0.5
##   - Added a modcp dir in template dir
##   - Added Mod CP for phpBB 2.0.3 & 2.0.4 (see contrib/)
##
## 2003/??/?? - Version 1.0.1
##   - Moderators have not allowed to delete Mods accounts
##
## 2003/??/?? - Version 1.0.0
##   - Initial release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
# If you use a beta release of EasyMOD, this instructions will be executed!
# Please read author notes to update your database.
#
INSERT INTO `phpbb_config` (config_name, config_value) VALUES ('modcp_levels_used', '');

#
#-----[ COPY ]------------------------------------------
#
copy root/admin/admin_modcp.php to admin/admin_modcp.php
copy root/modcp/*.php to modcp/*.php
copy root/templates/subSilver/admin/modcp_config_body.tpl to templates/subSilver/admin/modcp_config_body.tpl
copy root/templates/subSilver/modcp/*.* to templates/subSilver/modcp/*.*

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Start add - ModCP
$lang['Modcp'] = 'Moderator CP';
$lang['Modcp_title'] = 'Moderator Control Panel';
$lang['Modcp_explain'] = 'The form below will allow you to customize all the Moderator CP options.';
$lang['Modcp_permissions'] = 'Module Permissions';
$lang['New_modules'] = 'New Modules';
$lang['New_modules_explain'] = 'Below is a list of modules that you have not configured yet. Select the permissions for each new module then click submit to install them.';
$lang['Module_no_install'] = 'Modules that cannot be installed.';
$lang['Module_no_install_explain'] = 'These modules cannot be configured. This probably means that they have not been modified to work with the modcp. Please contact your site administrator about this.<br /><strong>Note:</strong> These modules will be <u>enabled</u> by default.';
$lang['New_modules_no_install'] = 'There are no modules installed. Please see below.';
$lang['Module_not_present'] = 'This module no longer seems to be present. Please remove this module.';
$lang['Module_not_configure'] = 'This module cannot be configured.  Please check that the module file has been modified to work with the modcp.';
$lang['Module_disabled'] = 'You do not have permission to access this module. Please contact your forum administrator to gain access.';
$lang['No_one'] = 'No one';
$lang['Disable'] = 'Disable';
$lang['Remove'] = 'Remove';
$lang['Who_access'] = 'Who can access?';
// End add - ModCP

#
#-----[ OPEN ]------------------------------------------
#
login.php

#
#-----[ FIND ]------------------------------------------
#
   if( !$userdata['session_logged_in'] || (isset($HTTP_GET_VARS['admin'])
#
#-----[ IN-LINE FIND ]------------------------------------------
#
&& $userdata['user_level'] == ADMIN
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
&& ($userdata['user_level'] == ADMIN || in_array($userdata['user_level'], explode(',', $board_config['modcp_levels_used'])))
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php

#
#-----[ FIND ]------------------------------------------
#
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';

#
#-----[ IN-LINE FIND ]------------------------------------------
#
'';
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
((in_array($userdata['user_level'], explode(',', $board_config['modcp_levels_used']))) ? '<a href="modcp/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Mod_CP'] . '</a><br /><br />' : '');
#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------------
#
# EoM[list]

[/list]


Any ideas why this should not work?
sceltic
PR0
PR0
 
Posts: 55
Joined: Thu May 04, 2006 4:07 pm

Advertisement

Postby dcz » Fri May 26, 2006 8:22 am

Well, I don't think the install steps are the one causing problems, the files themselves maybe.


Could you post a download link ? the better being the link to the dev thread.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21291
Joined: Fri Apr 28, 2006 9:03 pm

Postby sceltic » Fri May 26, 2006 11:40 pm

sceltic
PR0
PR0
 
Posts: 55
Joined: Thu May 04, 2006 4:07 pm

Postby dcz » Fri May 26, 2006 11:57 pm

Aslo, was thinking of a quick one, try getting rid of this line in th e.htaccess :

Code: Select all
# FORUM PROTECTION RULE
RewriteRule ^phpbb/.+/([^/]+\.html)$ /phpbb/index.php [R=301,L]
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21291
Joined: Fri Apr 28, 2006 9:03 pm

Postby sceltic » Sat May 27, 2006 12:07 pm

I will try it DCZ

What did that rule do?

Out of interest what do you think of this mod?
sceltic
PR0
PR0
 
Posts: 55
Joined: Thu May 04, 2006 4:07 pm

Postby dcz » Sat May 27, 2006 4:17 pm

sceltic wrote:I will try it DCZ

What did that rule do?

Out of interest what do you think of this mod?


This rules is here to make sure anyone testing an URL like www.example.com/title-/url-xx.html is redirected to your forum's index with a nice 301. This make the URL standard to be more strict.

Without this rule-set, the URL will work with all relative path broken (because it's like there is a new folder level for the browser), no big deal, but better to lock this.

Then, I asked you to try this to find out if this would not be the clue, because it seem file are loaded from within a sub folder and this could mess with it.
Don't worry, if so, we'll find out a special fix to allow both the protection rule and the moderator mod to work ;)

Then, I have never tried it, so, I can't really tell.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21291
Joined: Fri Apr 28, 2006 9:03 pm


Return to phpBB2 mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests