GuestReg (Unofficial 1.4)

All new Coranto Addons, updates and patches to addons, will be released here...also, get support for addons within!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

GuestReg (Unofficial 1.4)

Postby Pirate Elf » Sat Jun 14, 2008 1:21 am

I am not entirely sure who wrote GuestReg however I noted that it has some issues with the way it displays users onscreen. Since I haven't a clue if it's closed source or not I am posting an adjustment here:

*Update* I believe this addon was written by Aerosoul and I believe it is open source. However if I am wrong this will be taken down immediately!
(Virus Scanned With Bit Defender 2008, but that doesn't mean you should EVER trust the interweb! Please virus scan everything and be sure to look through any code if you can attain source)

Code: Select all
#! NAME GuestReg
#! DESCRIPTION Allows user to auto-register themselves without admin intervention.
#! VERSION 1.4

my $addon = new Addon('GuestReg');
$addon->addAdminFunction('GuestReg','View who (and when) registered with GuestReg.','GuestReg');

sub GuestReg {
   $TheTime = time;
   foreach $i (split(/\|x\|/,$CConfig{'userdata'})) {
      $user{$i} = 1;
   foreach $i (split(/\|x\|/,$CConfig{'GuestRegUsers'})) {
      ($r_user,$r_time,$r_ip) = split(/!x!/,$i);
      if ($user{$r_user}) {
   $CConfig{'GuestRegUsers'} = join('|x|',@regusers);
   $users = 0;
   $users++ foreach (@regusers);
   print $addon->heading('GuestReg Registration History') . q~<center><table width="80%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td width="33%" align="center" class="lightgbg"><b>User</b></td><td width="33%" align="center" class="lightgbg"><b>Date</b></td><td width="33%" align="center" class="lightgbg"><b>IP</b></td></tr>~;
   if ($users > 0) {
      foreach $i (@regusers) {
         ($r_user,$r_time,$r_ip) = split(/!x!/,$i);
         $r_time = GetTheDate($r_time);
         print qq~<tr><td width="33%"><font size="-1">$r_user</font></td><td width="33%" align="center"><font size="-1">$r_time</font></td><td width="33%" align="center"><font size="-1">$r_ip</font></td></tr>~;
   } else {
      print q~<tr><td width="100%" align="center" colspan="3"><font size="-1">There are no users that have registered through GuestReg.</font></td></tr>~;
   print q~</table></center><br>~;

my $GuestRegBuild = <<'END CODE';
   foreach $i (split(/\|x\|/,$CConfig{'GuestRegUsers'})) {
      ($r_user,$r_time,$r_ip) = split(/!x!/,$i);
      $user{$r_user} = 1;
   if (($CConfig{'GuestRegNoBuild'}) && ($user{$CurrentUser})) {
      if ($in{'action'} eq 'submitsave') {
         SimpleConfirmationPage($Messages{'SaveNews_Title'},"$Messages{'SaveNews_Message'} $Messages{'SaveNews_Message_NoAuto'}");
      } elsif ($in{'action'} eq 'modify-editsave') {
         SimpleConfirmationPage($Messages{'ModifySave_Title'},"$Messages{'ModifySave_Message'} $Messages{'ModifySave_Message_NoAuto'}",0,1);
      } else {
         CRcough('You are not allowed to build news.');

my $GuestRegSettings = <<'END CODE';
   $CConfig{'GuestRegLevel'} = 1 unless ($CConfig{'GuestRegLevel'});
   for ($i = 3;$i > 0;--$i) {
      $GuestRegUserLevel{$i} = ' selected' if ($i == $CConfig{'GuestRegLevel'});
   $GuestRegLevels = qq~<select name="GuestRegLevel"><option value="1"$GuestRegUserLevel{'1'}>Standard</option><option value="2"$GuestRegUserLevel{'2'}>High</option><option value="3"$GuestRegUserLevel{'3'}>Administrator</option></select>~;
   foreach $i (split(/\(delim\)/,$CConfig{'GuestRegRequired'})) {
      $GuestRegField{$i} = ' selected';
   if (keys %userDB) {
      $GuestRegRequired = qq~<select name="GuestRegRequired" size="5" multiple><option value="(All)"$GuestRegField{'(All)'}>(All)</option>~;
      foreach $i (sort keys %userDB) {
         $GuestRegRequired .= qq~<option value="$i"$GuestRegField{$i}>$i</option>~;
      $GuestRegRequired .= '<option value="(none)"> </option></select>';
   } else {
      $GuestRegRequired = 'There are no user fields.';
   $addon->addAdvancedSetting('GuestRegTemplate','Template','Select which template to use on the GuestReg pages.',GetTMPLSelect());
   $addon->addAdvancedSetting('GuestRegDisable','Disable New Users','Do you want to auto disable each new user that signs up? They will not be able to access Coranto until an admin enables them in the administration section.',yn);
   $addon->addAdvancedSetting('GuestRegPrefix','User Prefix','This allows you to allow a prefix to all users that sign up, to help you with distinguishing them in Coranto. Leave empty to disable.');
   $addon->addAdvancedSetting('GuestRegSuccess','Success Message or URL','When a new user registers this will be the message displayed to the user. Alternatively you can forward the user to a location of your choice; just begin the URL with "http://". In the success message you may use "&lt;UserName&gt;" to display the username of the user. Leave empty to display the default message (The user "&lt;UserName&gt;" has been successfully registered.).');
   $addon->addAdvancedSetting('GuestRegTitle','Success Page Title','The title of the success page; the page to which the user goes after a successfull sign up. Ignore this option if you set the above to be a URL. Leave empty to use the standard title (User Registration).');
   $addon->addAdvancedSetting('GuestRegLevel','User Level','When a new user registers, this will be the "User Level" of the user. It is recomended that this option is set to either "Standard" or "High". The "Administrator" level is never recommended, unless you really trust your visitors.',$GuestRegLevels);
   $addon->addAdvancedSetting('GuestRegRequired','Required Fields','Choose which user fields must be filled in upon signup. The fields you select here will appear on the "Required Fields" section, on the registration form. To make multiple selections, Windows users hold down CTRL, Mac users hold down Option, and most UNIX users hold down CTRL. To remove all fields, de-select them all (CTRL+Click) and then select the very last option, which appears as nothing, but it is there (it doesn not have a name, it is just an empty space - you have to click on it to find it).',$GuestRegRequired);
   $addon->addAdvancedSetting('GuestRegAdmin','Allow Admin Fields','Do you want to allow users to sign up using fields that have permissions which state that only administrators can edit them?',yn);
   $addon->addAdvancedSetting('GuestRegNoBuild','Prevent Build News','Do you want to prevent all users registered through GuestReg from accessing "Build News"?',yn);



All I did was fix it show it shows the users that have signed up with guest reg in a nice neat table instead of the weird broken thing that was 1.3.
Nichts ist für dich
Nichts war für dich
Nichts bleibt für dich
Für immer
Pirate Elf
Posts: 732
Joined: Wed Jan 31, 2007 9:45 pm

Return to Addon Release and Support

Who is online

Users browsing this forum: No registered users and 2 guests