U-232 invite

Started by DarkWarrior, July 26, 2012, 01:49:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DarkWarrior

Quote from: Mindless on July 26, 2012, 05:02:02 PM
Then its simple logic - edit it

Code (php) Select
if(!$TBDEV['openreg'])
    stderr('Sorry', 'Invite only - Signups are closed presently');


To

Code (php) Select
if($TBDEV['openreg'])
    stderr('Sorry', 'Invite only - Signups are closed presently');


many thax  for this edit ok now can users get in ok with there invite to site and not took back to the page of site invite only ? when thay hed a invite sent via email?

Mindless

Then its simple logic - edit it

Code (php) Select
if(!$TBDEV['openreg'])
    stderr('Sorry', 'Invite only - Signups are closed presently');


To

Code (php) Select
if($TBDEV['openreg'])
    stderr('Sorry', 'Invite only - Signups are closed presently');

DarkWarrior

Quote from: Mindless on July 26, 2012, 04:23:59 PM
Code used ? let me see what you added to the file ?
Bigjoos-U-232-d996ecb

nothing add to files

<?php
/**
 *   http://btdev.net:1337/svn/test/Installer09_Beta
 *   Licence Info: GPL
 *   Copyright (C) 2010 BTDev Installer v.1
 *   A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
 *   Project Leaders: Mindless,putyn.
 **/
error_reporting(E_ALL);
define('SQL_DEBUG'1);
/* Compare php version for date/time stuff etc! */
if (version_compare(PHP_VERSION"5.1.0RC1"">="))
date_default_timezone_set('Europe/London');
define('TIME_NOW'time());
$TBDEV['time_adjust'] =  0;
$TBDEV['time_offset'] = '0'
$TBDEV['time_use_relative'] = 1;
$TBDEV['time_use_relative_format'] = '{--}, h:i A';
$TBDEV['time_joined'] = 'j-F y';
$TBDEV['time_short'] = 'jS F Y - h:i A';
$TBDEV['time_long'] = 'M j Y, h:i A';
$TBDEV['time_tiny'] = '';
$TBDEV['time_date'] = '';
// DB setup
$TBDEV['mysql_host'] = '#mysql_host';
$TBDEV['mysql_user'] = '#mysql_user';
$TBDEV['mysql_pass'] = '#mysql_pass';
$TBDEV['mysql_db']   = '#mysql_db';
// Cookie setup
$TBDEV['cookie_prefix']  = '#cookie_prefix'// This allows you to have multiple trackers, eg for demos, testing etc.
$TBDEV['cookie_path']    = '#cookie_path';   // ATTENTION: You should never need this unless the above applies eg: /tbdev
$TBDEV['cookie_domain']  = '#cookie_domain'// set to eg: .somedomain.com or is subdomain set to: .sub.somedomain.com
$TBDEV['site_online'] = 1;
$TBDEV['tracker_post_key'] = 'lsdflksfda4545frwe35@kk';
$TBDEV['max_torrent_size'] = 1000000;
$TBDEV['announce_interval'] = 60 30;
$TBDEV['signup_timeout'] = 86400 3;
$TBDEV['autoclean_interval'] = 900;
$TBDEV['autoslowclean_interval'] = 28800;
$TBDEV['autoslowclean_interval2'] = 57600;
$TBDEV['optimizedb_interval'] = 172800;
$TBDEV['minvotes'] = 1;
$TBDEV['max_dead_torrent_time'] = 3600;
$TBDEV['language'] = 'en';
$TBDEV['user_ratios'] = 1;
$TBDEV['bot_id'] = 2;
$TBDEV['coins'] = false;
$TBDEV['forums_online'] = 1;
$TBDEV['forums_autoshout_on'] = 1;
$TBDEV['forums_seedbonus_on'] = 1;
$TBDEV['maxsublength'] = 100
//latest posts limit
$TBDEV['latest_posts_limit'] = 5//query limit for latest forum posts on index
/** settings **/
$TBDEV['reports']      = 1;// 1/0 on/off
$TBDEV['karma']        = 1;// 1/0 on/off
$TBDEV['textbbcode']   = 1;// 1/0 on/off
$TBDEV['max_slots'] = 1// 1=On 0=Off
$TBDEV['user_slots'] = 20;
$TBDEV['p_user_slots'] = 30;
$TBDEV['user_ratio1_slots'] = 2;
$TBDEV['user_ratio2_slots'] = 3;
$TBDEV['user_ratio3_slots'] = 5;
$TBDEV['user_ratio4_slots'] = 10;
// Max users on site
$TBDEV['maxusers'] = 5000// LoL Who we kiddin' here?
$TBDEV['invites'] = 3500// LoL Who we kiddin' here?
$TBDEV['openreg'] = true//==true=open, false = closed
$TBDEV['failedlogins'] = 5// Maximum failed logins before ip ban
$TBDEV['flood_time'] = 900//comment/forum/pm flood limit
$TBDEV['readpost_expiry'] = 14*86400// 14 days
$TBDEV['expires']['latestuser'] = 0// 0 = infinite
/** define dirs **/
define('INCL_DIR'dirname(__FILE__).DIRECTORY_SEPARATOR);
define('ROOT_DIR'realpath(INCL_DIR.'..'.DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR);
define('ADMIN_DIR'ROOT_DIR.'admin'.DIRECTORY_SEPARATOR);
define('FORUM_DIR'ROOT_DIR.'forums'.DIRECTORY_SEPARATOR);
define('CACHE_DIR'ROOT_DIR.'cache'.DIRECTORY_SEPARATOR);
define('MODS_DIR'ROOT_DIR.'mods'.DIRECTORY_SEPARATOR);
define('LANG_DIR'ROOT_DIR.'lang'.DIRECTORY_SEPARATOR.$TBDEV['language'].DIRECTORY_SEPARATOR);  
define('TEMPLATE_DIR'ROOT_DIR.'templates'.DIRECTORY_SEPARATOR);
define('IMDB_DIR'ROOT_DIR.'imdb'.DIRECTORY_SEPARATOR);
$TBDEV["cache"] = ROOT_DIR.'cache';
$TBDEV['dictbreaker'] = ROOT_DIR.'dictbreaker';
$TBDEV['torrent_dir'] = ROOT_DIR.'torrents'# must be writable for httpd user   
$TBDEV['bucket_dir'] = ROOT_DIR .'bitbucket'# must be writable for httpd user 
$TBDEV['flood_file'] = INCL_DIR.'settings'.DIRECTORY_SEPARATOR.'limitfile.txt';
$TBDEV['nameblacklist'] = ROOT_DIR.'/cache/nameblacklist.txt';
# the first one will be displayed on the pages
$TBDEV['announce_urls'] = array();
$TBDEV['announce_urls'][] = '#announce_urls';
//$TBDEV['announce_urls'][] = "https://yoursite/announce.php";
//$TBDEV['announce_urls'] = "http://localhost:2710/announce";
//$TBDEV['announce_urls'] = "http://domain.com:83/announce.php";
if ($_SERVER["HTTP_HOST"] == "")
$_SERVER["HTTP_HOST"] = $_SERVER["SERVER_NAME"];
$TBDEV['baseurl'] = "http://" $_SERVER["HTTP_HOST"];
/*
## DO NOT UNCOMMENT THIS: IT'S FOR LATER USE!
$host = getenv( 'SERVER_NAME' );
$script = getenv( 'SCRIPT_NAME' );
$script = str_replace( "\\", "/", $script );

  if( $host AND $script )
  {
    $script = str_replace( '/index.php', '', $script );

    $TBDEV['baseurl'] = "http://{$host}{$script}";
  }
*/
// Email for sender/return path.
$TBDEV['site_email'] = '#site_email';
$TBDEV['site_name'] = '#site_name';
$TBDEV['language'] = 'en';
$TBDEV['msg_alert'] = 1// saves a query when off
$TBDEV['report_alert'] = 1// saves a query when off
$TBDEV['staffmsg_alert'] = 1// saves a query when off
$TBDEV['uploadapp_alert'] = 1// saves a query when off
$TBDEV['sql_error_log'] = ROOT_DIR.'logs'.DIRECTORY_SEPARATOR.'sql_err_'.date('M_D_Y').'.log';
$TBDEV['pic_base_url'] = "./pic/";
$TBDEV['stylesheet'] = "1";
//set this to size of user avatars
$TBDEV['av_img_height'] = 100;
$TBDEV['av_img_width'] = 100;
//set this to size of user signatures
$TBDEV['sig_img_height'] = 100;
$TBDEV['sig_img_width'] = 500;
$TBDEV['bucket_dir'] = ROOT_DIR '/bitbucket'# must be writable for httpd user  
$TBDEV['allowed_ext'] = array('image/gif''image/png''image/jpeg');
$TBDEV['bucket_maxsize'] = 500*1024#max size set to 500kb
//last 24 users online
$TBDEV['last24cache'] = CACHE_DIR.'last24/'.date('dmy').'.txt';
$TBDEV['last24record'] = CACHE_DIR.'last24record.txt';
$TBDEV['happyhour'] = CACHE_DIR.'happyhour'.DIRECTORY_SEPARATOR.'happyhour.txt';
$TBDEV['crazy_title'] ="w00t It's Crazyhour!";
$TBDEV['crazy_message'] ="All torrents are FREE and upload stats are TRIPLED!";
// Set this to the line break character sequence of your system
//$TBDEV['linebreak'] = "\r\n"; // not used at present.
define ('UC_USER'0);
define ('UC_POWER_USER'1);
define ('UC_VIP'2);
define ('UC_UPLOADER'3);
define ('UC_MODERATOR'4);
define ('UC_ADMINISTRATOR'5);
define ('UC_SYSOP'6);
//Do not modify -- versioning system
//This will help identify code for support issues at tbdev.net
define ('TBVERSION','TBDev_2009_svn');
?>



<?php
/**
 *   http://btdev.net:1337/svn/test/Installer09_Beta
 *   Licence Info: GPL
 *   Copyright (C) 2010 BTDev Installer v.1
 *   A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
 *   Project Leaders: Mindless,putyn.
 **/
/*
+------------------------------------------------
|   $Date$
|   $Revision$ 09 Final
|   $Invite
|   $Author$ Neptune,Bigjoos
|   $URL$
+------------------------------------------------
*/
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
require_once(
INCL_DIR.'user_functions.php');
require_once(
INCL_DIR.'password_functions.php');
dbconn();
loggedinorreturn();
$HTMLOUT ='';
$sure ='';
$lang array_mergeload_language('global'), load_language('invite_code') );

$do = (isset($_GET["do"]) ? $_GET["do"] : (isset($_POST["do"]) ? $_POST["do"] : ''));
$valid_actions = array('create_invite''delete_invite''confirm_account''view_page''send_email');
$do = (($do && in_array($do,$valid_actions,true)) ? $do '') or header("Location: ?do=view_page");

/**
 * @action Main Page
 */

if ($do == 'view_page') {
$query sql_query('SELECT * FROM users WHERE invitedby = ' sqlesc($CURUSER['id'])) or sqlerr(__FILE____LINE__);
$rows mysql_num_rows($query);

$HTMLOUT ='';

$HTMLOUT .= "
<table border='1' width='750' cellspacing='0' cellpadding='5'>
<tr class='table'>
<td colspan='7' class='colhead'><b>
{$lang['invites_users']}</b></td></tr>";

if(!
$rows){
$HTMLOUT .= "<tr><td colspan='7' class='colhead'>{$lang['invites_nousers']}</td></tr>";
} else {

$HTMLOUT .= "<tr class='tableb'>
<td align='center'><b>
{$lang['invites_username']}</b></td>
<td align='center'><b>
{$lang['invites_uploaded']}</b></td>
<td align='center'><b>
{$lang['invites_downloaded']}</b></td>
<td align='center'><b>
{$lang['invites_ratio']}</b></td>
<td align='center'><b>
{$lang['invites_status']}</b></td>
<td align='center'><b>
{$lang['invites_confirm']}</b></td>
</tr>"
;

for (
$i 0$i $rows; ++$i) { 
$arr mysql_fetch_assoc($query);

if (
$arr['status'] == 'pending')
$user "<td align='center'>" htmlspecialchars($arr['username']) . "</td>";
else
$user "<td align='center'><a href='{$TBDEV['baseurl']}/userdetails.php?id=$arr[id]'>" htmlspecialchars($arr['username']) . "</a>" .($arr["warned"] == "yes" "&nbsp;<img src='{$TBDEV['pic_base_url']}warned.gif' border='0' alt='Warned' />" "")."&nbsp;" .($arr["enabled"] == "no" "&nbsp;<img src='{$TBDEV['pic_base_url']}disabled.gif' border='0' alt='Disabled' />" "")."&nbsp;" .($arr["donor"] == "yes" "<img src='{$TBDEV['pic_base_url']}star.gif' border='0' alt='Donor' />" "")."</td>";

if (
$arr['downloaded'] > 0) {
$ratio number_format($arr['uploaded'] / $arr['downloaded'], 3);
$ratio "<font color='" get_ratio_color($ratio) . "'>".$ratio."</font>";
} else {
if (
$arr['uploaded'] > 0) {
$ratio 'Inf.';
}
else {
$ratio '---';
}
}

if (
$arr["status"] == 'confirmed')
$status "<font color='#1f7309'>{$lang['invites_confirm1']}</font>";
else
$status "<font color='#ca0226'>{$lang['invites_pend']}</font>";

$HTMLOUT .= "<tr class='tableb'>".$user."<td align='center'>" mksize($arr['uploaded']) . "</td><td align='center'>" mksize($arr['downloaded']) . "</td><td align='center'>".$ratio."</td><td align='center'>".$status."</td>";

if (
$arr['status'] == 'pending') {
$HTMLOUT .= "<td align='center'><a href='?do=confirm_account&amp;userid=".$arr['id']."&amp;sender=".$CURUSER['id']."'><img src='{$TBDEV['pic_base_url']}confirm.png' alt='confirm' title='Confirm' border='0' /></a></td></tr>";

else
$HTMLOUT .= "<td align='center'>---</td></tr>";
}

}
$HTMLOUT .= "</table><br />";

$select sql_query("SELECT * FROM invite_codes WHERE sender = ".$CURUSER['id']." AND status = 'Pending'") or sqlerr();
$num_row mysql_num_rows($select);
$HTMLOUT .= "<table border='1' width='750' cellspacing='0' cellpadding='5'>"."<tr class='tabletitle'><td colspan='6' class='colhead'><b>{$lang['invites_codes']}</b></td></tr>";

if(!
$num_row) {
$HTMLOUT.= "<tr class='tableb'><td colspan='1'>{$lang['invites_nocodes']}</td></tr>"
} else {
$HTMLOUT .= "<tr class='tableb'><td><b>{$lang['invites_send_code']}</b></td><td><b>{$lang['invites_date']}</b></td><td><b>{$lang['invites_delete']}</b></td><td><b>{$lang['invites_status']}</b></td></tr>";

for (
$i 0$i $num_row; ++$i)
{
$fetch_assoc mysql_fetch_assoc($select);                                  

$HTMLOUT .= "<tr class='tableb'>
<td>"
.$fetch_assoc['code']." <a href='?do=send_email&amp;id=".(int)$fetch_assoc['id']."'><img src='{$TBDEV['pic_base_url']}email.gif' border='0' alt='Email' title='Send Email' /></a></td>
<td>" 
get_date($fetch_assoc['invite_added'], ''0,1)."</td>";
$HTMLOUT .= "<td><a href='?do=delete_invite&amp;id=".$fetch_assoc['id']."&amp;sender=".$CURUSER['id']."'><img src='{$TBDEV['pic_base_url']}del.png' border='0' alt='Delete'/></a></td>
<td>"
.$fetch_assoc['status']."</td></tr>";
}
}

$HTMLOUT .= "<tr class='tableb'><td colspan='6' align='center'><form action='?do=create_invite' method='post'><input type='submit' value='{$lang['invites_create']}' style='height: 20px' /></form></td></tr>";
$HTMLOUT .= "</table>"
print 
stdhead('Invites') . $HTMLOUT stdfoot();
die;
}

/**
 * @action Create Invites
 */

elseif ($do =='create_invite') {

if (
$CURUSER['invites'] <= 0)
stderr($lang['invites_error'], $lang['invites_noinvite']);

if (
$CURUSER["invite_rights"] == 'no')
stderr($lang['invites_deny'], $lang['invites_disabled']);

$res sql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE____LINE__);
$arr mysql_fetch_row($res);
if (
$arr[0] >= $TBDEV['invites'])
stderr($lang['invites_error'], $lang['invites_limit']);

$invite md5(mksecret());

sql_query('INSERT INTO invite_codes (sender, invite_added, code) VALUES ( ' sqlesc((int)$CURUSER['id']) . ', ' sqlesc(time()) . ', ' sqlesc($invite) . ' )') or sqlerr(__FILE____LINE__);

sql_query('UPDATE users SET invites = invites - 1 WHERE id = ' sqlesc($CURUSER['id'])) or sqlerr(__FILE____LINE__);

header("Location: ?do=view_page");
}

/**
 * @action Send e-mail
 */

elseif ($do =='send_email') {

if (
$_SERVER["REQUEST_METHOD"] == "POST") {

$email = (isset($_POST['email'])? htmlentities($_POST['email']) : '');
$invite = (isset($_POST['code'])? $_POST['code'] : '');

if (!
$emailstderr($lang['invites_error'], $lang['invites_noemail']);

$check = (mysql_fetch_row(sql_query('SELECT COUNT(*) FROM users WHERE email = ' sqlesc($email)))) or sqlerr(__FILE____LINE__);
if (
$check[0] != 0stderr('Error''This email address is already in use!');

if (!
validemail($email)) stderr($lang['invites_error'], $lang['invites_invalidemail']);

$inviter htmlspecialchars($CURUSER['username']);
$body = <<<EOD
You have been invited to {$TBDEV['site_name']} by $inviter. They have
specified this address (
$email) as your email. If you do not know this person, please ignore this email. Please do not reply.

This is a private site and you must agree to the rules before you can enter:

{$TBDEV['baseurl']}/useragreement.php

{$TBDEV['baseurl']}/rules.php

{$TBDEV['baseurl']}/faq.php

------------------------------------------------------------

To confirm your invitation, you have to follow this link and type the invite code:

{$TBDEV['baseurl']}/invite_signup.php

Invite Code: 
$invite

------------------------------------------------------------

After you do this, your inviter need's to confirm your account. 
We urge you to read the RULES and FAQ before you start using 
{$TBDEV['site_name']}.
EOD;
$sendit mail($email"You have been invited to {$TBDEV['site_name']}"$body"From: {$TBDEV['site_email']}""-f{$TBDEV['site_email']}"); 

if (!
$senditstderr($lang['invites_error'], $lang['invites_unable']);
else 
stderr(''$lang['invites_confirmation']); }

$id = (isset($_GET['id']) ? (int)$_GET['id'] : (isset($_POST['id']) ? (int)$_POST['id'] : ''));

if (!
is_valid_id($id)) stderr($lang['invites_error'], $lang['invites_invalid']);

$query sql_query('SELECT * FROM invite_codes WHERE id = ' sqlesc($id) . ' AND sender = ' sqlesc($CURUSER['id']).' AND status = "Pending"') or sqlerr(__FILE____LINE__);
$fetch mysql_fetch_assoc($query) or stderr($lang['invites_error'], $lang['invites_noexsist']);


$HTMLOUT .= "<form method='post' action='?do=send_email'><table border='1' cellspacing='0' cellpadding='10'>
<tr><td class='rowhead'>E-Mail</td><td><input type='text' size='40' name='email' /></td></tr><tr><td colspan='2' align='center'><input type='hidden' name='code' value='"
.$fetch['code']."' /></td></tr><tr><td colspan='2' align='center'><input type='submit' value='Send e-mail' class='btn' /></td></tr></table></form>";
print 
stdhead('Invites') . $HTMLOUT stdfoot();
}

/**
 * @action Delete Invites
 */

elseif ($do =='delete_invite') {

$id = (isset($_GET["id"]) ? (int)$_GET["id"] : (isset($_POST["id"]) ? (int)$_POST["id"] : ''));

$query sql_query('SELECT * FROM invite_codes WHERE id = ' sqlesc($id) . ' AND sender = ' sqlesc($CURUSER['id']).' AND status = "Pending"') or sqlerr(__FILE____LINE__);
$assoc mysql_fetch_assoc($query);

if (!
$assoc)
stderr($lang['invites_error'],$lang['invites_noexsist']);

isset(
$_GET['sure']) && $sure htmlspecialchars($_GET['sure']);

if (!
$sure)
stderr($lang['invites_delete1'], $lang['invites_sure'].' Click <a href="'.$_SERVER['PHP_SELF'].'?do=delete_invite&amp;id='.$id.'&amp;sender='.$CURUSER['id'].'&amp;sure=yes">here</a> to delete it or <a href="?do=view_page">here</a> to go back.');

sql_query('DELETE FROM invite_codes WHERE id = ' sqlesc($id) . ' AND sender =' sqlesc($CURUSER['id'].' AND status = "Pending"')) or sqlerr(__FILE____LINE__);

sql_query('UPDATE users SET invites = invites + 1 WHERE id = '.sqlesc($CURUSER['id'])) or sqlerr(__FILE____LINE__);

header("Location: ?do=view_page");
}

/**
 * @action Confirm Accounts
 */

elseif ($do ='confirm_account') {

$userid = (isset($_GET["userid"]) ? (int)$_GET["userid"] : (isset($_POST["userid"]) ? (int)$_POST["userid"] : ''));

if (!
is_valid_id($userid))
stderr($lang['invites_error'], $lang['invites_invalid']);

$select sql_query('SELECT id, username FROM users WHERE id = ' sqlesc($userid) . ' AND invitedby = ' sqlesc($CURUSER['id'])) or sqlerr(__FILE____LINE__);
$assoc mysql_fetch_assoc($select);

if (!
$assoc)
stderr($lang['invites_error'], $lang['invites_errorid']);

isset(
$_GET['sure']) && $sure htmlspecialchars($_GET['sure']);

if (!
$sure)
stderr($lang['invites_confirm1'], $lang['invites_sure1'].' '.htmlspecialchars($assoc['username']).'\'s account? Click <a href="?do=confirm_account&amp;userid='.$userid.'&amp;sender='.$CURUSER['id'].'&amp;sure=yes">here</a> to confirm it or <a href="?do=view_page">here</a> to go back.');

sql_query('UPDATE users SET status = "confirmed" WHERE id = '.sqlesc($userid).' AND invitedby = '.sqlesc($CURUSER['id']).' AND status="pending"') or sqlerr(__FILE____LINE__);
//==pm to new invitee/////
$msg sqlesc("Hey there :wave:
Welcome to 
{$TBDEV['site_name']}!
  
We have made many changes to the site, and we hope you enjoy them! 
We have been working hard to make 
{$TBDEV['site_name']} somethin' special!

{$TBDEV['site_name']} has a strong community (just check out forums), and is a feature rich site. We hope you'll join in on all the fun!
 
Be sure to read the [url=
{$TBDEV['baseurl']}/rules.php]Rules[/url] and [url={$TBDEV['baseurl']}/faq.php]FAQ[/url] before you start using the site.
We are a strong friendly community here :D 
{$TBDEV['site_name']} is so much more then just torrents.
Just for kicks, we've started you out with 200.0 Karma Bonus  Points, and a couple of bonus GB to get ya started! 
so, enjoy  
cheers, 
{$TBDEV['site_name']} Staff");
$id $assoc["id"];
$subject sqlesc("Welcome to {$TBDEV['site_name']} !");
$added sqlesc(time());
sql_query("INSERT INTO messages (sender, subject, receiver, msg, added) VALUES (0, $subject$id$msg$added)") or sqlerr(__FILE____LINE__);
///////////////////end////////////
header("Location: ?do=view_page");
}
?>



<?php
/**
 *   http://btdev.net:1337/svn/test/Installer09_Beta
 *   Licence Info: GPL
 *   Copyright (C) 2010 BTDev Installer v.1
 *   A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
 *   Project Leaders: Mindless,putyn.
 **/
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
require_once(
INCL_DIR.'user_functions.php');
require_once(
CACHE_DIR.'timezones.php');
require_once(
INCL_DIR.'page_verify.php');
dbconn();
get_template();

$stdfoot = array(/** include js **/'js' => array('check','jquery.pstrength-min.1.2'));

$lang array_mergeload_language('global'), load_language('signup') );
$newpage = new page_verify(); 
$newpage->create('tkIs');

$res sql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE____LINE__);
$arr mysql_fetch_row($res);
if (
$arr[0] >= $TBDEV['maxusers'])
stderr("Sorry""The current user account limit (" number_format($TBDEV['maxusers']) . ") has been reached. Inactive accounts are pruned all the time, please check back again later...");

if(!
$TBDEV['openreg'])
    
stderr('Sorry''Invite only - Signups are closed presently');

// TIMEZONE STUFF
        
$offset = (string)$TBDEV['time_offset'];
        
        
$time_select "<select name='user_timezone'>";
        
        foreach( 
$TZ as $off => $words )
        {
          if ( 
preg_match("/^time_(-?[\d\.]+)$/"$off$match))
          {
            
$time_select .= $match[1] == $offset "<option value='{$match[1]}' selected='selected'>$words</option>\n" "<option value='{$match[1]}'>$words</option>\n";
          }
        }
        
        
$time_select .= "</select>";
    
// TIMEZONE END

$HTMLOUT='';

$HTMLOUT .= "
    <script type='text/javascript'>
    /*<![CDATA[*/
    $(function() {
    $('.password').pstrength();
    });
    /*]]>*/
    </script>"
;
// Normal Entry Point...
$value = array('...','...','...','...','...','...');
$value[rand(1,count($value)-1)] = 'X';
$HTMLOUT .="<script type='text/javascript' src='scripts/jquery.js'></script>
    <script type='text/javascript' src='scripts/jquery.simpleCaptcha-0.2.js'></script>
    <script type='text/javascript'>
  $(document).ready(function () {
  $('#captchainvite').simpleCaptcha();
    });
    </script>
<p>Note: You need cookies enabled to sign up or log in.</p>
<form method='post' action='
{$TBDEV['baseurl']}/take_invite_signup.php'>
<noscript>Javascript must be enabled to login and use this site</noscript>
<table border='1' cellspacing='0' cellpadding='10'>
<tr><td align='right' class='heading'>Desired username:</td><td align='left'><input type='text' size='40' name='wantusername' id='wantusername' onblur='checkit();' /><div id='namecheck'></div></td></tr>
<tr><td align='right' class='heading'>Pick a password:</td><td align='left'><input class='password' type='password' size='40' name='wantpassword' /></td></tr>
<tr><td align='right' class='heading'>Enter password again:</td><td align='left'><input type='password' size='40' name='passagain' /></td></tr>
<tr><td align='right' class='heading'>Enter invite-code:</td><td align='left'><input type='text' size='40' name='invite' /></td></tr>
<tr valign='top'><td align='right' class='heading'>Email address:</td><td align='left'><input type='text' size='40' name='email' />
<table width='250' border='0' cellspacing='0' cellpadding='0'><tr><td class='embedded'><font class='small'>The email address must be valid. The email address won't be publicly shown anywhere unless you chose to from your settings.</font></td></tr></table></td></tr>
<tr><td align='right' class='heading'>
{$lang['signup_timez']}</td><td align='left'>{$time_select}</td></tr>";
//==Passhint
     
$passhint="";
     
$questions = array(
    array("id"=> "1""question"=> "{$lang['signup_q1']}"),
array("id"=> "2""question"=> "{$lang['signup_q2']}"),
array("id"=> "3""question"=> "{$lang['signup_q3']}"),
array("id"=> "4""question"=> "{$lang['signup_q4']}"),
array("id"=> "5""question"=> "{$lang['signup_q5']}"),
array("id"=> "6""question"=> "{$lang['signup_q6']}"));
  foreach($questions as $sph){  
  $passhint .= "<option value='".$sph['id']."'>".$sph['question']."</option>\n"
  }
  $HTMLOUT .= "<tr><td align='right' class='heading'>{$lang['signup_select']}</td><td align='left'><select name='passhint'>\n$passhint\n</select></td></tr>
  <tr><td align='right' class='heading'>
{$lang['signup_enter']}</td><td align='left'><input type='text' size='40'  name='hintanswer' /><br /><font class='small'>{$lang['signup_this_answer']}<br />{$lang['signup_this_answer1']}</font></td></tr>
<tr><td align='right' class='heading'></td><td align='left'><input type='checkbox' name='rulesverify' value='yes' /> I will read the site rules page.<br />
<input type='checkbox' name='faqverify' value='yes' /> I agree to read the FAQ before asking questions.<br />
<input type='checkbox' name='ageverify' value='yes' /> I am at least 18 years old.</td></tr>
<tr><td class='rowhead' colspan='2' id='captchainvite'></td></tr>
<tr><td align='center' colspan='2'>Now click the button marked <strong>X</strong> to complete the sign up!</td></tr><tr>
<td colspan='2' align='center'>"
;
 for (
$i=0$i count($value); $i++) {
 
$HTMLOUT .= "<input name=\"submitme\" type=\"submit\" value=\"".$value[$i]."\" class=\"btn\" />";
 }
 
$HTMLOUT .= "</td></tr></table></form>";

print 
stdhead('Invites') . $HTMLOUT stdfoot($stdfoot);
?>


<?php
/**
 *   http://btdev.net:1337/svn/test/Installer09_Beta
 *   Licence Info: GPL
 *   Copyright (C) 2010 BTDev Installer v.1
 *   A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
 *   Project Leaders: Mindless,putyn.
 **/
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
require_once(
INCL_DIR.'user_functions.php');
require_once(
INCL_DIR.'password_functions.php');
require_once(
INCL_DIR.'page_verify.php');
dbconn();
get_template();

$lang array_mergeload_language('global'), load_language('takesignup') );

$newpage = new page_verify(); 
$newpage->check('tkIs');
$res sql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE____LINE__);
$arr mysql_fetch_row($res);
if (
$arr[0] >= $TBDEV['maxusers']) 
stderr($lang['stderr_errorhead'], sprintf($lang['stderr_ulimit'], $TBDEV['maxusers']));

if (!
mkglobal("wantusername:wantpassword:passagain:email:invite:captchaSelection:submitme:passhint:hintanswer"))
die();

if (
$submitme != 'X')
  
stderr('Ha Ha''You Missed, You plonker !');
  
 if(empty(
$captchaSelection) || $_SESSION['simpleCaptchaAnswer'] != $captchaSelection){
 
header('Location: invite_signup.php');
 exit();
 }

function 
validusername($username) {
if (
$username == "")
return 
false;
// The following characters are allowed in user names
$allowedchars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
for (
$i 0$i strlen($username); ++$i)
if (
strpos($allowedchars$username[$i]) === false)
return 
false;
return 
true
}

if (empty(
$wantusername) || empty($wantpassword) || empty($email) || empty($invite) || empty($passhint) || empty($hintanswer))
stderr("Error","Don't leave any fields blank.");

if(!
blacklist($wantusername))
 
stderr($lang['takesignup_user_error'],sprintf($lang['takesignup_badusername'],htmlspecialchars($wantusername)));

if (
strlen($wantusername) > 12)
stderr("Error","Sorry, username is too long (max is 12 chars)");

if (
$wantpassword != $passagain)
stderr("Error","The passwords didn't match! Must've typoed. Try again.");

if (
strlen($wantpassword) < 6)
stderr("Error","Sorry, password is too short (min is 6 chars)");

if (
strlen($wantpassword) > 40)
stderr("Error","Sorry, password is too long (max is 40 chars)");

if (
$wantpassword == $wantusername)
stderr("Error","Sorry, password cannot be same as user name.");

if (!
validemail($email))
stderr("Error","That doesn't look like a valid email address.");

if (!
validusername($wantusername))
stderr("Error","Invalid username.");

// make sure user agrees to everything...
if ($_POST["rulesverify"] != "yes" || $_POST["faqverify"] != "yes" || $_POST["ageverify"] != "yes")
stderr("Error","Sorry, you're not qualified to become a member of this site.");

// check if email addy is already in use
$a = (@mysql_fetch_row(sql_query('SELECT COUNT(*) FROM users WHERE email = ' sqlesc($email)))) or die(mysql_error());
if (
$a[0] != 0)
stderr('Error''The e-mail address <b>' htmlspecialchars($email) . '</b> is already in use.');

//=== check if ip addy is already in use
$c = (@mysql_fetch_row(sql_query("select count(*) from users where ip='" $_SERVER['REMOTE_ADDR'] . "'"))) or die(mysql_error());
if (
$c[0] != 0)
stderr("Error""The ip " $_SERVER['REMOTE_ADDR'] . " is already in use. We only allow one account per ip address.");

// TIMEZONE STUFF
    
if(isset($_POST["user_timezone"]) && preg_match('#^\-?\d{1,2}(?:\.\d{1,2})?$#'$_POST['user_timezone']))
    {
    
$time_offset sqlesc($_POST['user_timezone']);
    }
    else
    { 
    
$time_offset = isset($TBDEV['time_offset']) ? sqlesc($TBDEV['time_offset']) : '0'; }
    
// have a stab at getting dst parameter?
    
$dst_in_use localtime(time() + ($time_offset 3600), true);
    
// TIMEZONE STUFF END

$select_inv sql_query('SELECT sender, receiver, status FROM invite_codes WHERE code = ' sqlesc($invite)) or die(mysql_error());
$rows mysql_num_rows($select_inv);
$assoc mysql_fetch_assoc($select_inv);

if (
$rows == 0)
stderr("Error","Invite not found.\nPlease request a invite from one of our members.");

if (
$assoc["receiver"]!=0)
stderr("Error","Invite already taken.\nPlease request a new one from your inviter.");

    
$secret mksecret();
    
$wantpasshash make_passhash$secretmd5($wantpassword) );
    
$editsecret = ( !$arr[0] ? "" make_passhash_login_key() );
    
$wanthintanswer md5($hintanswer);
$new_user sql_query("INSERT INTO users (username, passhash, secret, passhint, hintanswer, editsecret, invitedby, email, ". (!$arr[0]?"class, ":"") ."added, last_access, last_login, time_offset, dst_in_use) VALUES (" .
implode(","array_map("sqlesc", array($wantusername$wantpasshash$secret$editsecret$passhint$wanthintanswer, (int)$assoc['sender'], $email))).
", ". (!$arr[0]?UC_SYSOP.", ":""). "'".  time() ."','".  time() ."','".  time() ."', $time_offset{$dst_in_use['tm_isdst']})");
$message "Welcome New {$TBDEV['site_name']} Member : - " htmlspecialchars($wantusername) . "";
if (!
$new_user) {
if (
mysql_errno() == 1062)
stderr("Error","Username already exists!");
stderr("Error","borked");
}

//===send PM to inviter
$sender $assoc["sender"];
$added sqlesc(time());
$msg sqlesc("Hey there [you] ! :wave:\nIt seems that someone you invited to {$TBDEV['site_name']} has arrived ! :clap2: \n\n Please go to your [url={$TBDEV['baseurl']}/invite.php]Invite page[/url] to confirm them so they can log in.\n\ncheers\n");
$subject sqlesc("Someone you invited has arrived!");
sql_query("INSERT INTO messages (sender, subject, receiver, msg, added) VALUES (0, $subject$sender$msg$added)") or sqlerr(__FILE____LINE__);
//////////////end/////////////////////
$id mysql_insert_id();
sql_query('UPDATE invite_codes SET receiver = ' sqlesc($id) . ', status = "Confirmed" WHERE sender = ' sqlesc((int)$assoc['sender']). ' AND code = ' sqlesc($invite)) or sqlerr(__FILE____LINE__);
write_log('User account '.htmlspecialchars($wantusername).' was created!');
autoshout($message);
stderr('Success','Signup successfull, Your inviter needs to confirm your account now before you can use your account !');
?>



invite

invite_signup

take_invite_signup

Mindless

Code used ? let me see what you added to the file ?

DarkWarrior

Quote from: Mindless on July 26, 2012, 03:07:53 PM
U-232 or Tbdev ?? - i have no idea what your on about - Dont muddy the water be specific, first what source are you using and what mod was used, if this was a mod then post on the mod so people know what codes being refereed to, at this present time this post is just rambles.

ok mindless its the very first u232 code you put out without the memcache

ok i set site to invite only now when a user sends out a invite to a mate  thay get the invite email ok now thay go to the link in the email to signup as you do fill it in then its taking you back to the page of this site invite only you must be invited to the site

Mindless

#10
@UniVeRsE ... U-232 or Tbdev ?? - i have no idea what your on about - Dont muddy the water be specific, first what source are you using and what mod was used, if this was a mod then post on the mod so people know what codes being referred to, at this present time your post is just a muddle to me. Now your referring to code made 2-3 year ago, lifted from archived documents, all these things are fixed in U-232 already, so don't be surprised to find many little basic things wrong in logic or typos, no post history here yet.

rickandmary

you have

$TBDEV['maxusers'] = 5000; // LoL Who we kiddin' here?
$TBDEV['invites'] = 3500; // LoL Who we kiddin' here?

you need to have $TBDEV['invites'] set higher than maxusers, your maxusers is at 5000, so you would need to set your invites higher than this

DarkWarrior

Quote from: rickandmary on July 26, 2012, 03:00:42 PM
you need to have the invites set higher than maxusers otherwise the site will take as it's reached it's limit and give the max signups reached error

// Max users on site
$TBDEV['maxusers'] = 5000; // LoL Who we kiddin' here?
$TBDEV['invites'] = 3500; // LoL Who we kiddin' here?
$TBDEV['openreg'] = true; //==true=open, false = closed
$TBDEV['failedlogins'] = 5; // Maximum failed logins before ip ban
$TBDEV['flood_time'] = 900; //comment/forum/pm flood limit
$TBDEV['readpost_expiry'] = 14*86400; // 14 days
$TBDEV['expires']['latestuser'] = 0; // 0 = infinite
/** define dirs **/

rickandmary

you need to have the invites set higher than maxusers otherwise the site will take as it's reached it's limit and give the max signups reached error

DarkWarrior

Quote from: rickandmary on July 26, 2012, 02:53:59 PM
ok i am not 100% sure where it is in that version but u should have something similar along lines of.

// Max users on site
$TBDEV['maxusers'] = 19500; // LoL Who we kiddin' here?
$TBDEV['invites'] = 25000; // set this to what you want
$TBDEV['openreg'] = true; //==true=open, false = closed

on tbdev09 it's in config.php
do you have invites set higher than maxusers to allow those invited to signup?
no i just testing the invite mod out and bug in it
yes in config set up as invite but now its  been taken off as no  peeps can get into the site with a invite

rickandmary

ok i am not 100% sure where it is in that version but u should have something similar along lines of.

// Max users on site
$TBDEV['maxusers'] = 19500; // LoL Who we kiddin' here?
$TBDEV['invites'] = 25000; // set this to what you want
$TBDEV['openreg'] = true; //==true=open, false = closed

on tbdev09 it's in config.php
do you have invites set higher than maxusers to allow those invited to signup?

DarkWarrior

<?php
/**
 *   http://btdev.net:1337/svn/test/Installer09_Beta
 *   Licence Info: GPL
 *   Copyright (C) 2010 BTDev Installer v.1
 *   A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
 *   Project Leaders: Mindless,putyn.
 **/
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
require_once(
INCL_DIR.'user_functions.php');
require_once(
CACHE_DIR.'timezones.php');
require_once(
INCL_DIR.'page_verify.php');
dbconn();
get_template();

$stdfoot = array(/** include js **/'js' => array('check','jquery.pstrength-min.1.2'));

$lang array_mergeload_language('global'), load_language('signup') );
$newpage = new page_verify(); 
$newpage->create('tkIs');

$res sql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE____LINE__);
$arr mysql_fetch_row($res);
if (
$arr[0] >= $TBDEV['maxusers'])
stderr("Sorry""The current user account limit (" number_format($TBDEV['maxusers']) . ") has been reached. Inactive accounts are pruned all the time, please check back again later...");

if(!
$TBDEV['openreg'])
    
stderr('Sorry''Invite only - Signups are closed presently');

// TIMEZONE STUFF
        
$offset = (string)$TBDEV['time_offset'];
        
        
$time_select "<select name='user_timezone'>";
        
        foreach( 
$TZ as $off => $words )
        {
          if ( 
preg_match("/^time_(-?[\d\.]+)$/"$off$match))
          {
            
$time_select .= $match[1] == $offset "<option value='{$match[1]}' selected='selected'>$words</option>\n" "<option value='{$match[1]}'>$words</option>\n";
          }
        }
        
        
$time_select .= "</select>";
    
// TIMEZONE END

$HTMLOUT='';

$HTMLOUT .= "
    <script type='text/javascript'>
    /*<![CDATA[*/
    $(function() {
    $('.password').pstrength();
    });
    /*]]>*/
    </script>"
;
// Normal Entry Point...
$value = array('...','...','...','...','...','...');
$value[rand(1,count($value)-1)] = 'X';
$HTMLOUT .="<script type='text/javascript' src='scripts/jquery.js'></script>
    <script type='text/javascript' src='scripts/jquery.simpleCaptcha-0.2.js'></script>
    <script type='text/javascript'>
  $(document).ready(function () {
  $('#captchainvite').simpleCaptcha();
    });
    </script>
<p>Note: You need cookies enabled to sign up or log in.</p>
<form method='post' action='
{$TBDEV['baseurl']}/take_invite_signup.php'>
<noscript>Javascript must be enabled to login and use this site</noscript>
<table border='1' cellspacing='0' cellpadding='10'>
<tr><td align='right' class='heading'>Desired username:</td><td align='left'><input type='text' size='40' name='wantusername' id='wantusername' onblur='checkit();' /><div id='namecheck'></div></td></tr>
<tr><td align='right' class='heading'>Pick a password:</td><td align='left'><input class='password' type='password' size='40' name='wantpassword' /></td></tr>
<tr><td align='right' class='heading'>Enter password again:</td><td align='left'><input type='password' size='40' name='passagain' /></td></tr>
<tr><td align='right' class='heading'>Enter invite-code:</td><td align='left'><input type='text' size='40' name='invite' /></td></tr>
<tr valign='top'><td align='right' class='heading'>Email address:</td><td align='left'><input type='text' size='40' name='email' />
<table width='250' border='0' cellspacing='0' cellpadding='0'><tr><td class='embedded'><font class='small'>The email address must be valid. The email address won't be publicly shown anywhere unless you chose to from your settings.</font></td></tr></table></td></tr>
<tr><td align='right' class='heading'>
{$lang['signup_timez']}</td><td align='left'>{$time_select}</td></tr>";
//==Passhint
     
$passhint="";
     
$questions = array(
    array("id"=> "1""question"=> "{$lang['signup_q1']}"),
array("id"=> "2""question"=> "{$lang['signup_q2']}"),
array("id"=> "3""question"=> "{$lang['signup_q3']}"),
array("id"=> "4""question"=> "{$lang['signup_q4']}"),
array("id"=> "5""question"=> "{$lang['signup_q5']}"),
array("id"=> "6""question"=> "{$lang['signup_q6']}"));
  foreach($questions as $sph){  
  $passhint .= "<option value='".$sph['id']."'>".$sph['question']."</option>\n"
  }
  $HTMLOUT .= "<tr><td align='right' class='heading'>{$lang['signup_select']}</td><td align='left'><select name='passhint'>\n$passhint\n</select></td></tr>
  <tr><td align='right' class='heading'>
{$lang['signup_enter']}</td><td align='left'><input type='text' size='40'  name='hintanswer' /><br /><font class='small'>{$lang['signup_this_answer']}<br />{$lang['signup_this_answer1']}</font></td></tr>
<tr><td align='right' class='heading'></td><td align='left'><input type='checkbox' name='rulesverify' value='yes' /> I will read the site rules page.<br />
<input type='checkbox' name='faqverify' value='yes' /> I agree to read the FAQ before asking questions.<br />
<input type='checkbox' name='ageverify' value='yes' /> I am at least 18 years old.</td></tr>
<tr><td class='rowhead' colspan='2' id='captchainvite'></td></tr>
<tr><td align='center' colspan='2'>Now click the button marked <strong>X</strong> to complete the sign up!</td></tr><tr>
<td colspan='2' align='center'>"
;
 for (
$i=0$i count($value); $i++) {
 
$HTMLOUT .= "<input name=\"submitme\" type=\"submit\" value=\"".$value[$i]."\" class=\"btn\" />";
 }
 
$HTMLOUT .= "</td></tr></table></form>";

print 
stdhead('Invites') . $HTMLOUT stdfoot($stdfoot);
?>



<p>Note: You need cookies enabled to sign up or log in.</p>
<form method='post' action='{$TBDEV['baseurl']}/take_invite_signup.php'>

DarkWarrior

Quote from: rickandmary on July 26, 2012, 02:40:41 PM
the link should go to invite_signup.php and not signup.php, so i would check your invite page and make sure it is linking to the proper page

e.g from u-232 v3 invite.php

To confirm your invitation, you have to follow this link and type the invite code:

{$INSTALLER09['baseurl']}/invite_signup.php

Invite Code: $invite

now would that be the invite_signup.php ?

rickandmary

#2
the link should go to invite_signup.php and not signup.php, so i would check your invite page and make sure it is linking to the proper page

e.g from u-232 v3 invite.php

To confirm your invitation, you have to follow this link and type the invite code:

{$INSTALLER09['baseurl']}/invite_signup.php

Invite Code: $invite

DarkWarrior

U-232 set site to invite
ok i set the site to invite and there bug in it peeps sending invite out thay go to there email to get into site and it takes them back to the page this sites invite only so peeps car`nt get into site with the invite that as been sent to them via a email by users that already on site