1
tjnemez
permission redirect
  • 2003/12/27 21:41

  • tjnemez

  • Home away from home

  • Posts: 1594

  • Since: 2003/9/21


when a user tries to access an area that is restricted for members, the redirect brings up user.php. i would like to have visitor redirected to register.php can anyone tell where i can edit this? thank you!

2
JackJ
Re: permission redirect
  • 2003/12/28 3:41

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


Interesting question. A very good text editor I would recommend is Crimson Editor, it has an excellent search by file/folder facility using keywords. It also takes you to the file/text concerned with one click. It is freeware.

Crimson Editor here

This is most of the files and text I found using this app. You will probably need to do similar for individual modules.

include/common.php

around line 209 (groups)

if (!$moduleperm_handler->checkRight('module_read', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
redirect_header(XOOPS_URL."/user.php",1,_NOPERM);
exit();

include/common.php

around line 214 (for anon users)

if (!$moduleperm_handler->checkRight('module_read', $xoopsModule->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) {
redirect_header(XOOPS_URL."/user.php",1,_NOPERM);
exit();

include/cp_header.php

around line 17

$moduleperm_handler = & xoops_gethandler( 'groupperm' );
if ( $xoopsUser ) {
if ( !$moduleperm_handler->checkRight( 'module_admin', $xoopsModule->getVar( 'mid' ), $xoopsUser->getGroups() ) ) {
redirect_header( XOOPS_URL . "/user.php", 1, _NOPERM );
exit();
}
} else {
redirect_header( XOOPS_URL . "/user.php", 1, _NOPERM );
exit();

For mydownloads

mydowloads/modfile.php

around line 81

} else {
$lid = intval($HTTP_GET_VARS['lid']);
if(empty($xoopsUser)){
redirect_header(XOOPS_URL."/user.php",2,_MD_MUSTREGFIRST);
exit();

mydownloads submit

mydownloads/submit.php

around line 37

if (empty($xoopsUser) && !$xoopsModuleConfig['anonpost']) {
redirect_header(XOOPS_URL."/user.php",2,_MD_MUSTREGFIRST);
exit();
}

Weblinks

mylinks/modlink.php

around line 34

if (!empty($HTTP_POST_VARS['submit'])) {
$eh = new ErrorHandler; //ErrorHandler object
if (empty($xoopsUser)) {
redirect_header(XOOPS_URL."/user.php",2,_MD_MUSTREGFIRST);
exit

also mylinks/modlink.php

around line 70

} else {
$lid = intval($HTTP_GET_VARS['lid']);
if (empty($xoopsUser)) {
redirect_header(XOOPS_URL."/user.php",2,_MD_MUSTREGFIRST);
exit();

newbb/viewforum.php

around line 98

$xoopsTpl->assign("forum_id", $forum);
if ( $can_post == 1 ) {
$xoopsTpl->assign('viewer_can_post', true);
$xoopsTpl->assign('forum_post_or_register', "\""._MD_POSTNEW."\"");
} else {
$xoopsTpl->assign('viewer_can_post', false);
if ( $show_reg == 1 ) {
$xoopsTpl->assign('forum_post_or_register', ''._MD_REGTOPOST.'');
} else {
$xoopsTpl->assign('forum_post_or_register', "");

newbb/viewtopic

around line 234

if ( $can_post == 1 ) {
$xoopsTpl->assign(array('viewer_can_post' => true, 'forum_post_or_register' => "\""._MD_POSTNEW."\""));
} else {
$xoopsTpl->assign('viewer_can_post', false);
if ( $show_reg == 1 ) {
$xoopsTpl->assign('forum_post_or_register', ''._MD_REGTOPOST.'');
} else {
$xoopsTpl->assign('forum_post_or_register', '');


regards

3
tjnemez
Re: permission redirect
  • 2003/12/28 3:45

  • tjnemez

  • Home away from home

  • Posts: 1594

  • Since: 2003/9/21


hey jackj,

cool, thanks very much for the info.

4
JackJ
Re: permission redirect
  • 2003/12/28 3:53

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


No problem.

If you get crimson editor and try the search by file facility (remember to put a checkmark in "subfolders"), a list appears at the bottom of the screen containing all the files that contain the text you are looking for. It shows you the paths as well--just click on one of the links at the bottom of the screen and it will take you directly to the file and text. The list remains at the bottom, so you can repeat this operation for each file.

The keyword I used was "redirect"


Login

Who's Online

164 user(s) are online (135 user(s) are browsing Support Forums)


Members: 0


Guests: 164


more...

Donat-O-Meter

Stats
Goal: AU$15.00
Due Date: Jun 30
Gross Amount: AU$0.00
Net Balance: AU$0.00
Left to go: AU$15.00
Make donations with PayPal!

Latest GitHub Commits