Code:<?php
/**************************************************************************/
/* EZ Registration Modification for RavenNuke v2.40.01
/* =======================================================================*/
/* By: R. Keith Rosenlof (aka Wizarium, PHrEEkie, EZCom_Keith)
/* Script Support: http://www.ezcommunities.com
/**************************************************************************/
/* RN Your Account: Advanced User Management for RavenNuke
/* =======================================================================*/
/*
/* Copyright (c) 2008-2009, RavenPHPScripts.com http://www.ravenphpscripts.com
/*
/* This program is free software. You can redistribute it and/or modify it
/* under the terms of the GNU General Public License as published by the
/* Free Software Foundation, version 2 of the license.
/*
/**************************************************************************/
/* RN Your Account is the based on:
/* CNB Your Account http://www.phpnuke.org.br
/* NSN Your Account by Bob Marion, http://www.nukescripts.net
/**************************************************************************/
/*########################################################################*/
// BEGIN CONFIGURATION
/*########################################################################*/
// Here you can define the DEFAULT account settings each New User will get
// after they click the activation email.
//
$language = 'english'; // Set default language
$broadcast = '0'; // 0 off, 1 on - User can receive Broadcast messages.
$newsletter = '0'; // 0 off, 1 on - Typically set to 0 so that Users need to opt in to newsletter after login
$user_viewemail = '0'; // 0 off, 1 on - Allow others to view this User's email. Typically set to 0
$user_allow_viewonline = '1'; // 0 off, 1 on - Shows as online or Hidden. RN2.40.01 default is 0 (hidden)
$user_notify = '0'; // 0 off, 1 on - Email about responses to posts. Typically this is 0. Users generally like to toggle that for individual posts.
$user_notify_pm = '1'; // 0 off, 1 on - Email when Private Message received. RN2.40.01 default is 0
$user_popup_pm = '0'; // 0 off, 1 on - New Private Message Notification in a pop-up window when logged into website. RN2.40.01 default is 0
$user_attachsig = '1'; // 0 off, 1 on - Attach User's signature to every post. RN2.40.01 default is 0
$user_allowbbcode = '1'; // 0 off, 1 on - Allow BBCode in Forums. RN2.40.01 default is 0
$user_allowhtml = '1'; // 0 off, 1 on - Allow HTML in Forums. RN2.40.01 default is 0
$user_allowsmile = '1'; // 0 off, 1 on - Allow for Smilies in Forums. RN2.40.01 default is 0
$user_timezone = '-5'; // 0 (zero) is GMT. Anything else is the offset to GMT. Default value should probably be your server's system time setting.
$user_dateformat = 'l d F Y H:i'; // search for function date() at php.net if you wish to alter this. RN2.40.01 default is 'l d F Y H:i'
/*########################################################################*/
// END CONFIGURATION
/*########################################################################*/
if (!defined('RNYA')) {
header('Location: ../../../index.php');
die();
}
// Check and clean the _users_temp table in the DB
if ($ya_config['expiring'] != 0) {
$past = time() - $ya_config['expiring'];
$res = $db->sql_query('SELECT user_id FROM ' . $user_prefix . '_users_temp WHERE time < \'' . $past . '\'');
while (list($uid) = $db->sql_fetchrow($res)) {
$uid = intval($uid);
$db->sql_query('DELETE FROM ' . $user_prefix . '_users_temp WHERE user_id = \'' . $uid . '\'');
$db->sql_query('DELETE FROM ' . $user_prefix . '_users_temp_field_values WHERE uid = \'' . $uid . '\'');
}
$db->sql_query('OPTIMIZE TABLE ' . $user_prefix . '_users_temp_field_values');
$db->sql_query('OPTIMIZE TABLE ' . $user_prefix . '_users_temp');
}
// Sanitize user submitted variables
$username = isset($username) ? addslashes(trim(check_html($username, 'nohtml'))) : '';
$check_num = isset($check_num) ? addslashes(trim(check_html($check_num, 'nohtml'))) : '';
if ($forceLowerCaseUserName) $ya_username = strtolower($ya_username); //Added by Raven 7/3/2005 Modified for RN v2.10.00
// See if we have valid user and activation code
$result = $db->sql_query('SELECT * FROM ' . $user_prefix . '_users_temp WHERE username=\'' . $username . '\' AND check_num=\'' . $check_num . '\'');
if ($db->sql_numrows($result) == 1) {
$row = $db->sql_fetchrow($result);
$username = $row['username'];
$realname = $row['name'];
$user_email = $row['user_email'];
$user_regdate = $row['user_regdate'];
$user_password = $row['user_password'];
$user_email = addslashes(check_html($user_email, 'nohtml'));
$lv = time();
if (isset($realname) && empty($realname)) {
$realname = $username;
}
// Finally, add user to the actual _users DB
$sql = 'INSERT INTO ' . $user_prefix . '_users '
. '(user_id, name, username, user_email, femail, user_website, user_avatar, user_regdate, user_icq, user_occ, '
. 'user_from, user_interests, user_sig, user_viewemail, user_theme, user_aim, user_yim, user_msnm, user_password, '
. 'storynum, umode, uorder, thold, noscore, bio, ublockon, ublock, theme, commentmax, counter, newsletter, user_posts, '
. 'user_attachsig, user_rank, user_level, broadcast, popmeson, user_active, user_session_time, user_session_page, '
. 'user_lastvisit, user_timezone, user_style, user_lang, user_dateformat, user_new_privmsg, user_unread_privmsg, '
. 'user_last_privmsg, user_emailtime, user_allowhtml, user_allowbbcode, user_allowsmile, user_allowavatar, '
. 'user_allow_pm, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_avatar_type, user_sig_bbcode_uid, '
. 'user_actkey, user_newpasswd, points, last_ip, user_login_tries, user_last_login_try, agreedtos, lastsitevisit) '
. 'VALUES (NULL, \'' . $realname . '\', \'' . $username . '\', \'' . $user_email . '\', \'\', \'\', \'gallery/blank.gif\', \'' . $user_regdate . '\', '
. 'NULL, NULL, NULL, \'\', NULL, \'' . $user_viewemail . '\', NULL, NULL, NULL, NULL, \'' . $user_password . '\', \'10\', \'nested\', \'0\', \'0\', \'0\', '
. 'NULL, \'0\', NULL, \'\', \'4096\', \'0\', \'' . $newsletter . '\', \'0\', \'' . $user_attachsig . '\', \'0\', \'1\', \'' . $broadcast . '\', \'0\', '
. '\'1\', \'0\', \'0\', \'0\', \'' . $user_timezone . '\', NULL, \'' . $language . '\', \'' . $user_dateformat . '\', \'0\', \'0\', \'0\', NULL, '
. '\'' . $user_allowhtml . '\', \'' . $user_allowbbcode . '\', \'' . $user_allowsmile . '\', \'1\', \'1\', \'' . $user_allow_viewonline . '\', '
. '\'' . $user_notify . '\', \'' . $user_notify_pm . '\', \'' . $user_popup_pm . '\', \'3\', NULL, NULL, NULL, \'0\', \'0\', \'0\', \'0\', \'1\', \'0\')';
// This code break is to test the Insert into the DB. Uncomment it to reveal what it's trying to do. You can copy/paste the
// results from your browser to support forums for advice.
// die('$sql =<br />' . $sql);
$db->sql_query($sql);
$new_uid = $db->sql_nextid();
if ($new_uid !== false && $new_uid != 0) {;
$db->sql_query('DELETE FROM ' . $user_prefix . '_users_temp WHERE username=\'' . $username . '\'');
$res = $db->sql_query('SELECT * FROM ' . $user_prefix . '_users_temp_field_values WHERE uid = \'' . $row['user_id'] . '\'');
while ($sqlvalue = $db->sql_fetchrow($res)) {
$db->sql_query('INSERT INTO ' . $user_prefix . '_users_field_values (uid, fid, value) VALUES (\'' . $new_uid . '\', \'' . $sqlvalue['fid'] . '\', \'' . $sqlvalue['value'] . '\')');
}
$db->sql_query('DELETE FROM ' . $user_prefix . '_users_temp_field_values WHERE uid=\'' . $row['user_id'] . '\'');
$db->sql_query('OPTIMIZE TABLE ' . $user_prefix . '_users_temp_field_values');
$db->sql_query('OPTIMIZE TABLE ' . $user_prefix . '_users_temp');
}
include_once 'header.php';
title(_ACTIVATIONYES);
OpenTable();
$result = $db->sql_query('SELECT * FROM ' . $user_prefix . '_users WHERE username=\'' . $username . '\' AND user_password=\'' . $user_password . '\'');
if ($db->sql_numrows($result) == 1) {
$userinfo = $db->sql_fetchrow($result);
yacookie($userinfo['user_id'], $userinfo['username'], $userinfo['user_password'], $userinfo['storynum'], $userinfo['umode'], $userinfo['uorder'], $userinfo['thold'], $userinfo['noscore'], $userinfo['ublockon'], $userinfo['theme'], $userinfo['commentmax']);
echo '<center><b>' . $row['username'] . ':</b> ' . _ACTMSG4 . '</center>';
} else {
echo '<center>' . _SOMETHINGWRONG . '</center><br />';
}
CloseTable();
include_once 'footer.php';
die();
} else {
// Username, Activation Code, or both did not match anything in the DB
include_once 'header.php';
title(_ACTIVATIONERROR);
OpenTable();
echo '<center>' . _ACTERROR . '</center>';
CloseTable();
include_once 'footer.php';
die();
}
?>
|