Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.5
Author Message
skycast
New Member
New Member



Joined: May 10, 2004
Posts: 3

PostPosted: Wed Oct 20, 2004 5:52 pm Reply with quote

I was wondering if there was an Auto Activation hack available for 7.5? Does the current release work?

Thanks,

Tom
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Oct 20, 2004 9:55 pm Reply with quote

I am coding it right now and am about 90% done. I'll finish it tomorrow. It's much simpler than my last one too Wink
 
View user's profile Send private message
Raven







PostPosted: Thu Oct 21, 2004 7:04 pm Reply with quote

Give this a try. You will be slightly modifying 2 functions in modules/Your_Account/index.php. Your 2 functions should resemble this if you have Chatserv's 2.6 patches installed
Code:
function finishNewUser($username, $user_email, $user_password, $random_num, $gfx_check) {

    global $stop, $EditedMessage, $adminmail, $sitename, $Default_Theme, $user_prefix, $db, $storyhome, $module_name, $nukeurl;
    include("header.php");
    include("config.php");
    userCheck($username, $user_email);
    $user_regdate = date("M d, Y");
    if (!isset($stop)) {
   $datekey = date("F j");
   $rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
   $code = substr($rcode, 2, 6);
   if (extension_loaded("gd") AND $code != $gfx_check AND ($gfx_chk == 3 OR $gfx_chk == 4 OR $gfx_chk == 6 OR $gfx_chk == 7)) {
       Header("Location: modules.php?name=$module_name");
       die();
   }
        mt_srand ((double)microtime()*1000000);
        $maxran = 1000000;
        $check_num = mt_rand(0, $maxran);
   $check_num = md5($check_num);
   $time = time();
   $finishlink = "$nukeurl/modules.php?name=$module_name&op=activate&username=$username&check_num=$check_num";
   $new_password = md5($user_password);
   $username = check_html($username, nohtml);
   $user_email = check_html($user_email, nohtml);
   $result = $db->sql_query("INSERT INTO ".$user_prefix."_users_temp (user_id, username, user_email, user_password, user_regdate, check_num, time) VALUES (NULL, '$username', '$user_email', '$new_password', '$user_regdate', '$check_num', '$time')");
   if(!$result) {
       echo ""._ERROR."<br>";
   } else {
       $message = ""._WELCOMETO." $sitename!\n\n"._YOUUSEDEMAIL." ($user_email) "._TOREGISTER." $sitename.\n\n "._TOFINISHUSER."\n\n $finishlink\n\n "._FOLLOWINGMEM."\n\n"._UNICKNAME." $username\n"._UPASSWORD." $user_password";
       $subject = ""._ACTIVATIONSUB."";
       $from = "$adminmail";
       mail($user_email, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());
       title("$sitename: "._USERREGLOGIN."");
       OpenTable();
       echo "<center><b>"._ACCOUNTCREATED."</b><br><br>";
       echo ""._YOUAREREGISTERED.""
           ."<br><br>"
      .""._FINISHUSERCONF."<br><br>"
      .""._THANKSUSER." $sitename!</center>";
       CloseTable();
   }
    } else {
   echo "$stop";
    }
    include("footer.php");
}

function activate($username, $check_num) {
    global $db, $user_prefix, $module_name, $language;
    $past = time()-86400;
    $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE time < $past");
    $sql = "SELECT * FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'";
    $result = $db->sql_query($sql);
    if ($db->sql_numrows($result) == 1) {
   $row = $db->sql_fetchrow($result);
   if ($check_num == $row[check_num]) {
       $db->sql_query("INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_password, user_avatar, user_avatar_type, user_regdate, user_lang) VALUES (NULL, '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', 3, '$row[user_regdate]', '$language')");
       $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'");
       include("header.php");
       title(""._ACTIVATIONYES."");
       OpenTable();
       echo "<center><b>$row[username]:</b> "._ACTMSG."</center>";
       CloseTable();
       include("footer.php");
       die();
   } else {
       include("header.php");
       title(""._ACTIVATIONERROR."");
       OpenTable();
       echo "<center>"._ACTERROR1."</center>";
       CloseTable();
       include("footer.php");
       die();
   }
    } else {
   include("header.php");
   title(""._ACTIVATIONERROR."");
   OpenTable();
   echo "<center>"._ACTERROR2."</center>";
   CloseTable();
   include("footer.php");
   die();
    }

}

Change them to this
Code:
function finishNewUser($username, $user_email, $user_password, $random_num, $gfx_check) {

    global $stop, $EditedMessage, $adminmail, $sitename, $Default_Theme, $user_prefix, $db, $storyhome, $module_name, $nukeurl;
    include_once("header.php");
    include_once("config.php");
    userCheck($username, $user_email);
    $user_regdate = date("M d, Y");
    if (!isset($stop)) {
   $datekey = date("F j");
   $rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
   $code = substr($rcode, 2, 6);
   if (extension_loaded("gd") AND $code != $gfx_check AND ($gfx_chk == 3 OR $gfx_chk == 4 OR $gfx_chk == 6 OR $gfx_chk == 7)) {
       Header("Location: modules.php?name=$module_name");
       die();
   }
        mt_srand ((double)microtime()*1000000);
        $maxran = 1000000;
        $check_num = mt_rand(0, $maxran);
   $check_num = md5($check_num);
   $time = time();
   $finishlink = "$nukeurl/modules.php?name=$module_name&op=activate&username=$username&check_num=$check_num";
   $new_password = md5($user_password);
   $username = check_html($username, nohtml);
   $user_email = check_html($user_email, nohtml);
   $result = $db->sql_query("INSERT INTO ".$user_prefix."_users_temp (user_id, username, user_email, user_password, user_regdate, check_num, time) VALUES (NULL, '$username', '$user_email', '$new_password', '$user_regdate', '$check_num', '$time')");
   if(!$result) {
      echo ""._ERROR."<br>";
   } else {
         activate($username, $check_num);
         $message = ""._WELCOMETO." $sitename!\n\n"._YOUUSEDEMAIL." ($user_email) "._TOREGISTER." $sitename.\n\n "._UNICKNAME." $username\n"._UPASSWORD." $user_password";
         $subject = ""._ACTIVATIONSUB."";
         $from = "$adminmail";
         mail($user_email, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());
         title("$sitename: "._USERREGLOGIN."");
         OpenTable();
         echo "<center><b>"._ACCOUNTCREATED."</b><br><br>";
         echo ""._YOUAREREGISTERED.""
               ."<br><br>"
      .""._FINISHUSERCONF."<br><br>"
      .""._THANKSUSER." $sitename!</center>";
         CloseTable();
      }
   } else {
      echo "$stop";
  }
  include_once("footer.php");
}

function activate($username, $check_num) {
   global $db, $user_prefix, $module_name, $language;
   $past = time()-86400;
   $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE time < $past");
   $sql = "SELECT * FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'";
   $result = $db->sql_query($sql);
   if ($db->sql_numrows($result) == 1) {
      $row = $db->sql_fetchrow($result);
      if ($check_num == $row[check_num]) {
         $db->sql_query("INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_password, user_avatar, user_avatar_type, user_regdate, user_lang) VALUES (NULL, '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', 3, '$row[user_regdate]', '$language')");
         $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'");
         include_once("header.php");
         title(""._ACTIVATIONYES."");
         OpenTable();
         echo "<center><b>$row[username]:</b> "._ACTMSG."</center>";
         CloseTable();
         return;
         include_once("footer.php");
         die();
      } else {
         include_once("header.php");
         title(""._ACTIVATIONERROR."");
         OpenTable();
         echo "<center>"._ACTERROR1."</center>";
         CloseTable();
         include_once("footer.php");
         die();
      }
   } else {
      include_once("header.php");
      title(""._ACTIVATIONERROR."");
      OpenTable();
      echo "<center>"._ACTERROR2."</center>";
      CloseTable();
      include_once("footer.php");
      die();
   }
}

You will need to modify the language file to state verbiage to the effect that you will receive a confirmation email but they don't have to activate it. Or, just comment out the mail() call altogether.
 
Para620
Regular
Regular



Joined: Mar 16, 2004
Posts: 62

PostPosted: Fri Oct 22, 2004 3:01 am Reply with quote

The hack you have on the site still works for 7.5 Raven. I used it before and gave it a shot on 7.5 and no problems have been found.

_________________
www.commoguru.com 
View user's profile Send private message
Raven







PostPosted: Fri Oct 22, 2004 6:57 am Reply with quote

That's good to now. This one is easier to code though Smile
 
Bluezzz
Involved
Involved



Joined: Feb 08, 2005
Posts: 290
Location: USA

PostPosted: Wed Feb 09, 2005 12:16 am Reply with quote

I'm running PHPnuke 7.5, I installed the hack for it (yes I installed the one for 7.5). I can fill out the reg form and submit it, when I get to the activation page I get the following error...

Table 'xxxxxxx_nuke1.nuke_users_verify' doesn't exist

Regardless of the error the activation does occur and the new user can login but I am concerned that the above error shows to the new user : o/

Any help/ideas would be appreciated. I'm somewhat new to PHP so I sure hope help isn't overly complicated. And yes I have searched the forums, have been here most of the day as a guest.

Thanks in advance!

Bluezzz
 
View user's profile Send private message
Raven







PostPosted: Wed Feb 09, 2005 5:12 am Reply with quote

This hack doesn't reference nuke_users_verify so it couldn't be causing your error. You must have another addon/hack that's causing it.
 
Bluezzz







PostPosted: Wed Feb 09, 2005 12:58 pm Reply with quote

That is the error I get when trying to use the hack tho, I don't get it any other time. However, I have dabbled in PHPnuke before and if I recall I'm to *import* the .sql ... I didn't do that, I simply copied it to the sql folder. Can someone please refresh my memory on the steps I need to take to Import a table from myPHPadmin? I bet that's what the problem is Embarassed
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.5

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©