Advertisement:

Author Topic: RandomSecure_1.00  (Read 4085 times)

Offline zepp

  • Newbie
  • *
  • Posts: 9
RandomSecure_1.00
« on: August 21, 2009, 08:43:04 AM »
Link to Mod

Random Verification Questions

Version: 1.00 Date 2009-8-8
Compatibility: SMF 1.1.7..???

Features

Adds Random verification questions.  You can add up to 2 questions which must be answered by the applicant before registration is permitted.

The administrator creates up to 2 text files of questions and answers with "~" delimiter and places the files in the Sources directory. the registration program then parses the file and randomly selects a Q & A from each file and presents them on the registration screen.

These can be used for anti spam as in the original Mod or for registering a community of people who have common knowledge of the questions being asked.
(this is the reason I made the Modifications to this Mod....)
 
The questions should be kept relatively short  to be able to fit on one line per question. the text file can have any name, but must use the format

What month is has 28 days normally~february
What state is the largest~alaska
What color are bananas~yellow


Configuration

The settings for this modification are located in Admin -> Members -> Registration -> Settings.



Offline Dzonny

  • Localizer
  • SMF Super Hero
  • *
  • Posts: 11,917
  • Gender: Male
  • No sleep...
    • dzontra.nikola on Facebook
    • Dzonny on GitHub
    • dzontranikola on LinkedIn
    • @opusteniforum on Twitter
    • Samo opusteno
Re: RandomSecure_1.00
« Reply #1 on: August 21, 2009, 01:18:30 PM »
Nice mod zepp, it could be very userful as spam prevention....

Regards.

Offline zepp

  • Newbie
  • *
  • Posts: 9
Re: RandomSecure_1.00
« Reply #2 on: August 24, 2009, 04:15:42 PM »
Thanks,

I'm glad it might be useful for others....

I would like to start doing more programming, and this is a cool way to hone the skills needed. Any feedback or insight is welcomed.

Zepp

Offline Fra_Co

  • Newbie
  • *
  • Posts: 2
Re: RandomSecure_1.00
« Reply #3 on: March 08, 2010, 10:57:33 AM »
at every reg i see this on error log:

Code: [Select]
8: Undefined offset: 1
File: /blablabla/forum/Sources/Register.php
Line: 201

the code block is:

Quote
if (!empty($modSettings['rnd_ver_file_1']) && file_exists($sourcedir . '/' . $modSettings['rnd_ver_file_1']))
      {
      $QA_file = fopen($sourcedir . '/' . $modSettings['rnd_ver_file_1'], 'r');
      while(!feof($QA_file))
         $qna[]= fgets($QA_file);
      fclose($QA_file);   
      array_pop($qna);
      shuffle($qna);
      $qna = explode("~", $qna[0]);
      $modSettings['rnd_ver_ques_1']= $qna[0];// question from file
      $txt['rnd_ver_ans_1'] = $qna[1];//answer from file
    
      }
   if (!empty($modSettings['rnd_ver_file_2']) && file_exists($sourcedir . '/' . $modSettings['rnd_ver_file_2']))
      {
      $QA_file = fopen($sourcedir . '/' . $modSettings['rnd_ver_file_2'], 'r');
      while(!feof($QA_file))
         $qna[]= fgets($QA_file);
      fclose($QA_file);   
      array_pop($qna);
      shuffle($qna);
      $qna = explode("~", $qna[0]);
      $modSettings['rnd_ver_ques_2']= $qna[0];// question from file
      $txt['rnd_ver_ans_2'] = $qna[1];//answer from file
      }
   }

?

Offline TAB004

  • Semi-Newbie
  • *
  • Posts: 44
    • Ecoculture Village, a non-profit entity ~ Rediscovering & reinventing small rural communities! Eco sustainable, self sufficient, ethical community!
Re: RandomSecure_1.00
« Reply #4 on: March 23, 2010, 04:17:29 AM »
This mod is great except for that as I have been refreshing the registration page to see the questions randomly cycle through, sometimes there will be errors, such as:

 Answer all questions below
What color is spelled like grown?:    
brown :

 Answer all questions below
What color is grass?:    
green :

 Answer all questions below
What color sounds like bold?:    
gold :

 Answer all questions below
What color sounds like bold?:    
What color sounds like bold?:

 Answer all questions below
What color is grass?:    
What color is grass?:

 Answer all questions below
What color are oranges?:    
orange :

 Answer all questions below
What color is spelled like grown?:    
What color is spelled like grown?:

 Answer all questions below
What color is cloudless sky?:    
blue :

Most of the time it works fine, like this:


 Answer all questions below
What color is cloudless sky?:    
What shape has three sides?:

 Answer all questions below
What color is spelled like grown?:    
What is the 7th letter in the English alphabet?:

I would love to see this resolved because I think it is a great mod!
  :)
« Last Edit: March 23, 2010, 12:26:14 PM by TAB004 »

Offline TAB004

  • Semi-Newbie
  • *
  • Posts: 44
    • Ecoculture Village, a non-profit entity ~ Rediscovering & reinventing small rural communities! Eco sustainable, self sufficient, ethical community!
Re: RandomSecure_1.00
« Reply #5 on: March 23, 2010, 07:40:05 PM »
How do I change:

"Answer all questions below"

?

Offline Dzonny

  • Localizer
  • SMF Super Hero
  • *
  • Posts: 11,917
  • Gender: Male
  • No sleep...
    • dzontra.nikola on Facebook
    • Dzonny on GitHub
    • dzontranikola on LinkedIn
    • @opusteniforum on Twitter
    • Samo opusteno
Re: RandomSecure_1.00
« Reply #6 on: March 24, 2010, 09:04:16 AM »
How do I change:

"Answer all questions below"

?

Take a look at your Modifications.english.php and search for that string.