"Pecknet_Session", "auth" => "Pecknet_Default_Auth", "perm" => "Pecknet_Perm", "user" => "Pecknet_User")); include "include/main_header.inc"; function apply($username,$myfullname,$email,$web) { print "
"; print ""; print ""; print "
"; print "Username :"; print ""; print ""; print "
"; print "Full Name :"; print ""; print ""; print "
"; print "Email :"; print ""; print ""; print "(Required)\n"; print "
"; print "Web :"; print ""; print ""; print "(Optional)\n"; print "
"; print ""; print ""; print "
"; print ""; print ""; print ""; print "
"; print "
"; print "
"; } function end_() { print ""; global $menu; include "include/main_footer.inc"; } ?>

Pecknet User Application


\n"; if (!$username) { print "You must enter a Username
\n"; apply($username,$myfullname,$email,$web); end_(); exit; } $q->query("select * from auth_user where username='$username'"); if($q->num_rows()>0) { print "That Username is already taken. Please select another one.
\n"; apply("",$myfullname,$email,$web); end_(); exit; } if (!$myfullname) { print "You must enter a Full Name
\n"; apply($username,$myfullname,$email,$web); end_(); exit; } $q->query("select * from auth_user where fullname='$myfullname'"); if($q->num_rows()>0) { print "That Full Name is already taken. Please select another one.
\n"; apply($username,"",$email,$web); end_(); exit; } if (!$email) { print "You must enter an email address
\n"; apply($username,$myfullname,$email,$web); end_(); exit; } if (!ereg("\@",$email)) { print "You must enter a valid email address
\n"; apply($username,$myfullname,"",$web); end_(); exit; } $q->query("select * from auth_user where email='$email'"); if($q->num_rows()>0) { print "That email address is already used! Did you forget your account name or password? If so click here to have it emailed to you.
\n"; apply($username,$myfullname,"",$web); end_(); exit; } $letters_num = array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",0,1,2,3,4,5,6,7,8,9); srand((double)microtime()*1000000); $password=""; for($i=0; $i<8 ; $i++) { $password.=$letters_num[rand(0,35)]; } $hash_secret = "nowisthetime"; ## Create a uid and insert the user... $u_id=md5(uniqid($hash_secret)); $permlist = "user"; $query = "insert into auth_user values('$u_id','$username','$password','$permlist','$myfullname','$email')"; if($q->query($query)) { mail("$email","Pecknet Information","\nYour UserID : $username\nPassword : $password\n","From: webmaster@pecknet.com\nX-Mailer: PHP/" . phpversion()); print "Your Password has been emailed to you...
\n"; } else { print "Something went wrong... Please email the webmaster
\n"; } end_(); exit; } else { apply($username,$myfullname,$email,$web); end_(); } ?>