Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
5 + 7 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: Registration hack and module required....
by luciano on 2005/2/6 12:48:19

Am I? The code is a bit dutch and not complete, but it should be a good start for a module developper. Problem: I don't have the time to analyse the module structure but I'll give it a try.

As I see it, the generated codes should be assigned to a group and be printed on screen.

I've got a complete "basic" code generator and regsitration system for anyone who want's to give it a try

Cheers,

Luciano Pavaprotti
Re: Registration hack and module required....
by timman on 2005/2/6 12:10:11

Hmm... I'm not the amazing one, luciano is

Now, I installed registration keys (works fine) but at the admin side I need to enter a username and a code. So, that won't work. I will have to hack the module so it doesn't require a username. Registration will also need a modification.

Another thing is the code generator I would need. Entering the codes manually is not really an option.

Generating codes

le="color: #000000"><?php function ranpass($len = "8"){ $pass = NULL; for($i=0; $i<$len; $i++) { $char = chr(rand(48,122)); while (!ereg("[a-zA-Z0-9]", $char)){ if(strtoupper($char) == strtoupper($lchar)) continue; $char = chr(rand(48,90)); } $pass .= $char; $lchar = $char; } return $pass; } function makeRandomPassword() { $salt = "abchefghjkmnpqrstuvwxyz0123456789"; srand((double)microtime()*1000000); $i = 0; while ($i <= 7) { $num = rand() % 33; $tmp = substr($salt, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; }



Putting then into the database

le="color: #000000"><?php $link = mysql_connect("localhost", "databaseuname", "databasepassword"); $db =mysql_select_db("databasename"); for($i=0; $i<$howmuch; $i++) { $code = ranpass(); $result = mysql_query("INSERT INTO `codes` VALUES ('$code', '', '', '', '0000-00-00', '', '')"); if (!$result){ $fout = mysql_error(); echo $fout; }


Whatdoyouthink
Re: Registration hack and module required....
by Wheeler on 2005/2/3 16:00:31

timman,

You are amazing, great work! I am sure you will be successful at your goals.

Check ya later!
Re: Registration hack and module required....
by timman on 2005/2/2 17:52:42

I've got the cms, it's a flatfile thing based on flatout and htmlarea. The only thing is that I have an older version running, I'll send you login and pass by PM.

From the XOOPS point of view a full featured easy to use site generator would be a great asset. Imagine communities offering free (or paid) sites to their users.

But, the real problem is the login stuff... but the xoopermod seems close. I'll try it tomorrow. For now I really need a big rest
Re: Registration hack and module required....
by Wheeler on 2005/2/2 17:07:11

Thanks for sharing the code snipplet. It's what I needed to know. I'm sure we could work together

Quote:

timman wrote:
Create the dir and putting the files in it? According to my brother Luciano with

le="color: #000000"><?php $site =strtolower($naam); function cp($wf, $wto){ mkdir($wto,0777); $arr=ls_a($wf); foreach ($arr as $fn){ if($fn){ $fl="$wf/$fn"; $flto="$wto/$fn"; if(is_dir($fl)) cp($fl,$flto); else copy($fl,$flto); } } } function ls_a($wh){ if ($handle = opendir($wh)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." ) { if(!$files) $files="$file"; else $files="$filen$files"; } } closedir($handle); } $arr=explode("n",$files); return $arr; }


The files? A flatfile cms.

Now, I'll try this registration keys module to see what it does...


Also check out Members Homepages and tell me what you think. It should be possible to un-wrap it from xoops. Also, remember it is a prototype and is a first step towards something great.

Who's Online

191 user(s) are online (128 user(s) are browsing Support Forums)


Members: 0


Guests: 191


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits