Redirection Suite - 2.03 fähig????

Probleme bei der regulären Arbeiten mit phpBB, Fragen zu Vorgehensweisen oder Funktionsweise sowie sonstige Fragen zu phpBB im Allgemeinen.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Benutzeravatar
Simpson
Ehemaliges Teammitglied
Beiträge: 1088
Registriert: 20.05.2002 17:35
Wohnort: Göttingen
Kontaktdaten:

Redirection Suite - 2.03 fähig????

Beitrag von Simpson »

Ich habe mir von http://www.phpbbhacks.com/viewhack.php?id=550 die Redirection Suite 9.0 (das ist die neuste) gezogen.

Die Redirection Suite besteht aus vielen Anleitungen, mich interessiert aber nur eine und zwar die folgende, welche dazu führen soll das man nach dem registrieren automatisch eingelogt wird:
##############################################################
## MOD Title: Redirect After Registration
## MOD Author: Thoul < tempshad@hotmail.com >
## MOD Description: Allows redirection on the registration confirmation page.
## MOD Version: 2.0.0
##
## Installation Level: Easy
## Installation Time: 2 Minutes
## Files To Edit: includes/usercp_register.php, login.php
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause
## malicious code to enter into your phpBB Forum. As such, phpBB will not offer
## support for MOD's not offered in our MOD-Database, located at:
## http://www.phpbb.com/mods/downloads/
##############################################################
## Author's Notes:
##
## This MOD allows you to redirect a user, to a page you specify, after they've
## registered. You have an option of allowing the user to be automatically logged in
## on that page also. (Don't confuse this phpBB's "Log me on automatically each
## visit" feature - this is a one time login.)
##
## There are three variables in the code to be added that you can change to modify
## how this mod behaves. They are found on these lines:
## $register_redirect = 'index.$phpEx';
## $rds_auto_login = TRUE;
## $rds_auto_each_login = 1;
##
## $register_redirect should be set to the url of the page to which the user will be
## redirected after registering. For example, if you want them to go to
## http://site.com/index.html, that line needs to read:
## $register_redirect = 'http://site.com/index.html';
##
## $rds_auto_login should be set to either TRUE or FALSE. If it is true and your
## board does not require account activation, then the user will automatically be
## logged in when sent to the page specified in $register_redirect (assuming that
## page is a phpBB enabled page). The registration confirmation page will not be
## displayed in this case. If $rds_auto_login is FALSE or your board does require
## account activation, then the user is redirected to the page specified in
## $register_redirect and the registration confirmation page will be displayed.
## Examples:
## $rds_auto_login = TRUE;
## $rds_auto_login = FALSE;
##
## $rds_auto_each_login should be set to either 0 or 1. If it is set to 1 (meaning
## TRUE), then the user will automatically be logged in each visit (just as if they
## had checked the box on the login page).
## Examples:
## $rds_auto_each_login = 0;
## $rds_auto_each_login = 1;
##
## (Special Notes: If you are familiar enough with phpBB, it's possible to add
## options to the registration form that will let the user choose if they want to
## be logged in automatically after registering ($rds_auto_login) or logged in
## automatically each visit ($rds_auto_each_login). I might add it to a future
## version of the mod as well, if someone wants the code for it.)
##
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above.
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To
## This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#

$message = $message . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

#
#-----[ REPLACE WITH ]------------------------------------------
#

/* Original phpBB code - commented out for Redirect After Registration MOD

$message = $message . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

*/
//
// MOD: Redirect After Registration
//

$register_redirect = 'index.$phpEx';
$rds_auto_login = TRUE;
$rds_auto_each_login = 1;

if ( $rds_auto_login && $board_config['require_activation'] == USER_ACTIVATION_NONE )
{
$login_str = '?username=' . urlencode($username) . '&password=' . urlencode($password_confirm) . '&login=Login';

if ( $rds_auto_each_login )
{
$login_str .= '&autologin=1';
}

$redirect_str = '&redirect=' . $register_redirect;

$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx" . $login_str . $redirect_str, true));
exit;
}
else
{
$message = $message . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid($register_redirect) . '">', '</a>');

$template->assign_vars(array(
"META" => '<meta http-equiv="refresh" content="5;url=' . append_sid($register_redirect) . '">')
);
}

//
// MOD: -END-
//

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

#
#-----[ FIND ]------------------------------------------
#

$username = isset($HTTP_POST_VARS['username']) ? $HTTP_POST_VARS['username'] : '';
$password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : '';

#
#-----[ REPLACE WITH ]------------------------------------------
#

/* Original phpBB code - commented out for Redirect After Registration MOD

$username = isset($HTTP_POST_VARS['username']) ? $HTTP_POST_VARS['username'] : '';
$password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : '';

*/
//
// MOD: Redirect After Registration
//

$username = isset($HTTP_POST_VARS['username']) ? $HTTP_POST_VARS['username'] : (isset($HTTP_GET_VARS['username']) ? urldecode($HTTP_GET_VARS['username']) : '');
$password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : (isset($HTTP_GET_VARS['password']) ? urldecode($HTTP_GET_VARS['password']) : '');

//
// MOD: -END-
//

#
#-----[ FIND ]------------------------------------------
#

if( !empty($HTTP_POST_VARS['redirect']) )
{
header($header_location . append_sid($HTTP_POST_VARS['redirect'], true));
exit;
}

#
#-----[ AFTER, ADD ]------------------------------------------
#

//
// MOD: Redirect After Registration
//

else if( !empty($HTTP_GET_VARS['redirect']) )
{
header($header_location . append_sid($HTTP_GET_VARS['redirect'], true));
exit;
}

//
// MOD: -END-
//

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

Mein Problem mit meinem sauber phpBB 2.03 Testboard:

Wenn man sich registriert, dann wird man weitergeleitet ins nix also ERROR 404 :( Nach dem Error 404, wenn ich dann das Forum direkt aufrufe dann bin ich allerdings tatsächlich eingelogt.

Ich weis nicht woran das liegt.

Mein Problem ist allerdings auch das der eine Absatz in der login.php 3 mal existiert, ich meine das hier in der Anleitung:
#
#
#-----[ FIND ]------------------------------------------
#

if( !empty($HTTP_POST_VARS['redirect']) )
{
header($header_location . append_sid($HTTP_POST_VARS['redirect'], true));
exit;
}

Ich habe das gleich mit dem erstgefunden Absatz gearbeitet, weis aber nicht ob das der richtige ist...
Benutzeravatar
Simpson
Ehemaliges Teammitglied
Beiträge: 1088
Registriert: 20.05.2002 17:35
Wohnort: Göttingen
Kontaktdaten:

Beitrag von Simpson »

Hab den Fehler

I haven't read every post in this thread i'm afraid so it might have been brought up already, but there is a small bug in the Redirect After Registration Mod...

this
Code:
$register_redirect = 'index.$phpEx';

should be
Code:
$register_redirect = 'index.' . $phpEx;

or
Code:
$register_redirect = "index.$phpEx";


Cheers!
Ach und das eine "elseif" muß natürlich "else if" heissen, is logi.
Benutzeravatar
Simpson
Ehemaliges Teammitglied
Beiträge: 1088
Registriert: 20.05.2002 17:35
Wohnort: Göttingen
Kontaktdaten:

Beitrag von Simpson »

Mist neues Prob :( das mit dem Auto Login wird nicht gesichert. Nach Browser schliessen und wieder öffnen ist man aus dem Forum ausgeloggt...
Benutzeravatar
Simpson
Ehemaliges Teammitglied
Beiträge: 1088
Registriert: 20.05.2002 17:35
Wohnort: Göttingen
Kontaktdaten:

Beitrag von Simpson »

Hmm, it looks like I left something out when I made the mod.

If you find this line in login.php:
Code:
$autologin = ( isset($HTTP_POST_VARS['autologin']) ) ? TRUE : 0;


And replace it with this line, that should fix it:
Code:
$autologin = isset($HTTP_POST_VARS['autologin']) ? TRUE : ( isset($HTTP_GET_VARS['autologin'] ) ? TRUE : 0);

Das war auch noch nötig und es gibt jetzt auch prompt ne neue Version 9.2.0 http://cyborgcentral.dynip.com/~pd/prog/rds.php



Jetzt werden alle neuregistrierten bei mir gleich automatisch eingelogt - so solls sein :)
Antworten

Zurück zu „phpBB 2.0: Administration, Benutzung und Betrieb“