Advanced Registration Options - SP1.1 1.01 Now you can choose between these options: - registration is open for all new members (standard) - just Administrators can register new members - registration is complete closed Modifications for SP1: - confirm deletion of logfile now per Java-Popup - reversed order of loglist - useless code removed - errormessages are now done with "&fatal_error"-tags dOCda S!, reworked and translated by Spikecity http://forums.spikecity.net Sources/Admin.pl $txt{'693'}
$regtxt{'22'}
sub ShowClickLog { ##### Advanced Registration Options ##### sub DeleteLog { &is_admin; unlink("$memberdir/newreg.txt"); $yySetLocation = qq~$cgi;action=showadminlog~; &redirectexit; } sub ShowAdminLog { &is_admin; if (-e "$memberdir/newreg.txt") { fopen(FILE, "$memberdir/newreg.txt"); @loglist = ; fclose(FILE); @loglist = reverse(@loglist); $count = @loglist; $deletelog = qq( $regtxt{'28'} ); } $yytitle = $regtxt{'22'}; $yymain .= qq~
$regtxt{'23'}

$regtxt{'29'}

~; foreach $curmem (@loglist) { chomp $curmem; ($regmem, $aname, $ip, $logdate) = split(/\|/, $curmem); if ($logdate eq '') { $logdate = "no entry"; } &FormatUserName($curmem); if (-e "$memberdir/$regmem.dat") { $profileurl = qq($regmem); } else { $profileurl = "$regmem"; } $temp = qq(); $yymain .= qq~ $temp ~; $count--; } $yymain .= qq~ $deletelog
# $regtxt{'24'} $regtxt{'25'} $regtxt{'26'} $regtxt{'27'}
$count$profileurl$aname$ip$logdate


$regtxt{'30'}

~; &template; exit; } ##### Advanced Registration Options #####
Sources/AdminEdit.pl if ($enable_news) { $newschecked = "checked" } ##### Advanced Registration Options ##### if ($regop eq "0") { $standregs = "checked"; } elsif ($regop eq "1") { $adminregs = "checked"; } else { $closeregs = "checked"; } if ($reglog) { $reglog = "checked" } ##### Advanced Registration Options ##### $txt{'584'} $regtxt{'15'} $regtxt{'13'} $regtxt{'03'} $regtxt{'21'} $regtxt{'04'} $regtxt{'14'}
push(@onoff, "enable_notification_board"); ##### Advanced Registration Options ##### push(@onoff, "regoption", "reglog"); ##### Advanced Registration Options ##### $use_flock = $FORM{'use_flock'} || 0; ##### Advanced Registration Options ##### $regoption = $FORM{'regoption'} || 0; ##### Advanced Registration Options ##### $color{'fadertext'} = $FORM{'fadertext'} || '#D4AD00'; ##### Advanced Registration Options ##### $color{'regcolor'} = $FORM{'regcolor'} || '#FFFFFF'; $color{'regcolor2'} = $FORM{'regcolor2'} || '#6E94B7'; ##### Advanced Registration Options ##### \$color{'fadertext'} = "$color{'fadertext'}"; # Color of text in the NewsFader (news color) ##### Advanced Registration Options ##### \$color{'regcolor'} = "$color{'regcolor'}"; # Color of text in the Register Option (Admin Name and Pass) \$color{'regcolor2'} = "$color{'regcolor2'}"; # Color of background in the Register Option (Admin Name and Pass) ##### Advanced Registration Options ##### \$enable_news = $enable_news; # Set to 1 to turn news on, or 0 to set news off ##### Advanced Registration Options ##### \$regop = $regoption; # Choose your Register Option: admin; close or stand \$reglog = $reglog; # Set to 1 if you want to enable logfiles for admin registrations ##### Advanced Registration Options ##### Sources/Register.pl sub Register { ##### Advanced Registration Options ##### if ($regop == 2) { &fatal_error("$regtxt{'12'}"); } if ($regop == 0) { $regtext = qq($txt{'97'} $txt{'517'}); } else { $regtext = qq($regtxt{'16'}); } ##### Advanced Registration Options ##### $txt{'97'} $txt{'97'} $txt{'517'} $regtext if ($RegAgree) { fopen(FILE, "$vardir/agreement.txt"); @agreement = ; ##### Advanced Registration Options ##### if ($regop == 1) { $yymain .= qq~
* $regtxt{'01'}:
* $regtxt{'02'}:
~; } ##### Advanced Registration Options #####
sub Register2 { if($FORM{'regagree'} eq "no") { $yySetLocation = qq~$scripturl~; &redirectexit; } ##### Advanced Registration Options ##### if ($regop == 2) { $yymain .= qq~
$regtxt{'08'}
$regtxt{'12'}
~; &template; exit; } ##### Advanced Registration Options #####
if($member{'email'} eq "$curban") { &fatal_error("$txt{'678'}$txt{'430'}!"); } } ##### Advanced Registration Options ##### if ($regop == 1) { $Admin = $member{'AdminName'}; $Passcode = $member{'AdminPass'}; ### CHECK IF NAME WAS ENTERED ### if ($Admin eq "") { &fatal_error($regtxt{'06'}); } ### END CHECK IF NAME WAS ENTERED ### ### CHECK FOR VALID USER ACCOUNT ### $FORM{'AdminName'} =~ s/\s/_/g; $Admin = $FORM{'AdminName'}; if(-e("$memberdir/$Admin.dat")) { fopen(FILE, "$memberdir/$Admin.dat"); @member = ; chomp($member[7]); fclose(FILE); } else { &fatal_error("$regtxt{'07'}"); } ### END CHECK FOR VALID USER ACCOUNT ### ### CHECK IF A PASSWORD WAS ENTERED ### if ($Passcode eq "") { &fatal_error("$regtxt{'10'} $Admin!"); } ### END CHECK IF A PASSWORD WAS ENTERED ### ### CHECK IF PASSWORD WAS CORRECT ### chomp($member[0]); if($member[0] ne "$Passcode") { &fatal_error("$regtxt{'11'} $Admin!"); } ### END CHECK IF PASSWORD WAS CORRECT ### ### CHECK IF USER IS AN ADMIN ### if ($member[7] ne 'Administrator') { &fatal_error("$regtxt{'09'}"); } ### END CHECK IF USER IS AN ADMIN ### } ##### Advanced Registration Options ##### my $membershiptotal = @memberlist + 1; fopen(FILE, "+>$memberdir/members.ttl"); print FILE qq~$membershiptotal|$member{'username'}~; fclose(FILE); ##### Advanced Registration Options ##### if ($regop == 1 && $reglog == 1) { fopen(LIST, ">>$memberdir/newreg.txt"); print LIST "$member{'username'}|$member{'AdminName'}|$ENV{'REMOTE_ADDR'}|$date\n"; close(LIST); } ##### Advanced Registration Options ##### $yymain .= qq~

$txt{'97'} $txt{'97'}

$txt{'431'}



~;
##### Advanced Registration Options ##### if ($reglog eq "1") { $loginfo = "$regtxt{'20'}" } else { $loginfo = qq(); } if ($regop eq "0") { $yymain .= qq~

$txt{'97'} $txt{'97'}

$txt{'431'}



~; } elsif ($regop == 1) { $yymain .= qq~
$regtxt{'17'}
$regtxt{'18'} »$FORM{'AdminName'}«$regtxt{'19'} »$FORM{'username'}«!$loginfo
~; } ##### Advanced Registration Options #####
Sources/Subs.pl $yymenu .= qq~$menusep$img{'logout'}~; } ##### Advanced Registration Options ##### if ($regop == 1) { $yymenu .= qq~$menusep$img{'logout'}$menusep$img{'register'}~; } else { $yymenu .= qq~$menusep$img{'logout'}~; } } ##### Advanced Registration Options ##### english.lng $yycopyright = qq~$mbname » Powered by YaBB $YaBBversion!
\nYaBB © 2000-2002,
Xnull. All Rights Reserved.~;
##### Advanced Registration Options ##### $regtxt{'01'} = "Admin Name"; $regtxt{'02'} = "Admin Pass"; $regtxt{'03'} = "Just allow Admins registering new Users?"; $regtxt{'04'} = "Admin Registration Text Color"; $regtxt{'05'} = "Please use your back button!"; $regtxt{'06'} = "No admin name was entered!"; $regtxt{'07'} = "Sorry but this is not a valid members-account!"; $regtxt{'08'} = "Are you sure you want to remove the LogFile of the Administrators Registrations?"; $regtxt{'09'} = "Sorry but your are not allowed to register new members!"; $regtxt{'10'} = "Sorry but you forgot to enter your password"; $regtxt{'11'} = "Sorry but this was not the correct password for"; $regtxt{'12'} = "Sorry but registrations are closed for now! Please check back later!"; $regtxt{'13'} = "Close Registrations"; $regtxt{'14'} = "Admin Registration Background Color"; $regtxt{'15'} = "Standard Registrations"; $regtxt{'16'} = "Attention! Just Administrators can register new Users! Please contact an Administrator for an account!"; $regtxt{'17'} = "NEW MEMBER REGGED SUCCESSFUL"; $regtxt{'18'} = "Hello"; $regtxt{'19'} = "! You have successful
registered the new Member"; $regtxt{'20'} = "
Your actions are logged!"; $regtxt{'21'} = "Enable LogFiles for Admin Regs?"; $regtxt{'22'} = "View Admin registrations log"; $regtxt{'23'} = "Administrator Registration Logfile"; $regtxt{'24'} = "REGGED USER"; $regtxt{'25'} = "REGGED BY"; $regtxt{'26'} = "ADMIN IP"; $regtxt{'27'} = "REG DATE"; $regtxt{'28'} = "Delete Logfile"; $regtxt{'29'} = "These registrations are logged:"; $regtxt{'30'} = "End of Logfile!"; ##### Advanced Registration Options #####
YaBB.pl elsif ($action eq 'do_clean_log') { require "$sourcedir/Admin.pl"; &do_clean_log; } ##### Advanced Registration Options ##### elsif ($action eq 'deletelog') { require "$sourcedir/Admin.pl"; &DeleteLog; } ##### Advanced Registration Options ##### elsif ($action eq 'clean_log') { require "$sourcedir/Admin.pl"; &clean_log; } ##### Advanced Registration Options ##### elsif ($action eq 'convol') { require "$sourcedir/Admin.pl"; &Convol; } ##### Advanced Registration Options ##### elsif ($action eq 'showclicks') { require "$sourcedir/Admin.pl"; &ShowClickLog; } ##### Advanced Registration Options ##### elsif ($action eq 'showadminlog') { require "$sourcedir/Admin.pl"; &ShowAdminLog; } ##### Advanced Registration Options #####