11
timman
Re: Registration hack and module required....
  • 2005/2/2 16:46

  • timman

  • Just popping in

  • Posts: 18

  • Since: 2005/1/16


Hi Wheeler,

Thanks, could have used the search on this site

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

$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...

Cheers,

Tim

12
Wheeler
Re: Registration hack and module required....
  • 2005/2/2 17:07

  • Wheeler

  • Not too shy to talk

  • Posts: 145

  • Since: 2004/10/29


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

$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.

13
timman
Re: Registration hack and module required....
  • 2005/2/2 17:52

  • timman

  • Just popping in

  • Posts: 18

  • Since: 2005/1/16


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

14
Wheeler
Re: Registration hack and module required....
  • 2005/2/3 16:00

  • Wheeler

  • Not too shy to talk

  • Posts: 145

  • Since: 2004/10/29


timman,

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

Check ya later!

15
timman
Re: Registration hack and module required....
  • 2005/2/6 12:10

  • timman

  • Just popping in

  • Posts: 18

  • Since: 2005/1/16


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

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$num1); 
            
$pass $pass $tmp
            
$i++; 
      } 
      return 
$pass
}



Putting then into the database

$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

16
luciano
Re: Registration hack and module required....
  • 2005/2/6 12:48

  • luciano

  • Quite a regular

  • Posts: 261

  • Since: 2003/11/3


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

Login

Who's Online

293 user(s) are online (260 user(s) are browsing Support Forums)


Members: 0


Guests: 293


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits