login_logout_redirect.mod 1.0 Lets you specify a board to enter automatically upon login or standard login and lets you specify a board or URL to redirect to after logout or standard logout. DaveB http://www.davesworldzone.com Sources/Admin.pl my($snfchecked, $fls1, $fls2, $fls3, $utfchecked, $truncchecked, $mts1, $mts2, $mts3, $tsl6, $tsl5, $tsl4, $tsl3, $tsl2, $tsl1); my($lds1, $lds2, $lods1, $lods2, $lods3); # figure out what to print if ($logindirect == 0) { $lds1 = ' selected'; } elsif ($logindirect == 1) { $lds2 = ' selected'; } else { $lds1 = ' selected'; } if ($logoutdirect == 0) { $lods1 = ' selected'; } elsif ($logoutdirect == 1) { $lods2 = ' selected'; } elsif ($logoutdirect == 2) { $lods3 = ' selected'; } else { $lods1 = ' selected'; } $txt{'392'} Login Redirect Type Login Redirect Board (use board id) Logout Redirect Type Logout Redirect Board (use board id) or URL
########## Feature Settings ########## ########## Login/Logout Redirect ########## \$logindirect = $logindirect; # Set to 0 for standard, 1 to redirect to board set in \$redirectin \$logoutdirect = $logoutdirect; # Set to 0 for standard, 1 to redirect to board set in \$redirectout, 2 to redirect to a URL set in \$redirectout \$redirectin = "$redirectin"; # Board to enter after login if \$logindirect is set to 1 \$redirectout = "$redirectout"; # Board to enter after logout if \$logoutdirect is set to 1, URL to go to if \$logoutdirect is set to 2 # If empty fields are submitted, set them to default-values to save yabb from crashing $logindirect = $FORM{'logindirect'} || 0; $logoutdirect = $FORM{'logoutdirect'} || 0; $redirectin = $FORM{'redirectin'}; $redirectout = $FORM{'redirectout'}; Sources/LogInOut.pl &WriteLog; &redirectinternal; &WriteLog; if($logindirect == 0) { &redirectinternal; } elsif ($logindirect == 1) { $yySetLocation = qq~$scripturl?board=$redirectin~; &redirectexit; } else { &redirectinternal; } $ENV{'HTTP_COOKIE'} = ''; &redirectinternal; $ENV{'HTTP_COOKIE'} = ''; if($logoutdirect == 0) { &redirectinternal; } elsif ($logoutdirect == 1) { $yySetLocation = qq~$scripturl?board=$redirectout~; &redirectexit; } elsif ($logoutdirect == 2) { $yySetLocation = qq~$redirectout~; &redirectexit; } else { &redirectinternal; }