Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Downloads (http://www.bvlist.com/forumdisplay.php?f=16)
-   -   SoftMP3 & SweDVDR Source Code (http://www.bvlist.com/showthread.php?t=2693)

codedash 14th July 2009 13:23

Since this is a fuly working source of a successful site, can some coders here make it a bit easier to get it working. To need the essential steps that we make to install tbdev. Or a guide from someone that got it working.

Morbidawn 20th July 2009 09:20

is it just me or i can see swedvdr.org :: Login online and fully functional again :|

cnb 20th July 2009 20:00

Quote:

Originally Posted by codedash (Post 13357)
Since this is a fuly working source of a successful site, can some coders here make it a bit easier to get it working. To need the essential steps that we make to install tbdev. Or a guide from someone that got it working.


KiD 20th July 2009 20:18

..
 
Quote:

Originally Posted by codedash (Post 13357)
Since this is a fuly working source of a successful site, can some coders here make it a bit easier to get it working. To need the essential steps that we make to install tbdev. Or a guide from someone that got it working.

Mate, can you code?? Its easy to setup tbdev.. im a php n00b and i can do it..! Please read the readme files for original tbdev source and your running for sure..!

Njep 21st July 2009 22:21

swedvdr source code
 
Is there anyone who have or can help me make a open signup for swedvdr source

Thanks in advance

OiNK 11th October 2009 08:40

Quote:

Originally Posted by Zepp (Post 11989)
You have to change login functions

Can you explain me what exactly i have to do on SoftMP3 source?

underx 28th October 2009 23:44

Please how to create admin account ?? :(

cube 29th November 2009 13:26

[quote=phogo;11839]
......
I

alexxandeer 29th November 2009 16:30

Quote:

Originally Posted by cube (Post 17871)
i downloaded to test it on localhost but i get this errror:
Code:

Parse error:  syntax error, unexpected $end in C:\xampp\htdocs\include\bittorrent.php on line 3178
what seems to be the problem ?

this tracker is coded for linux and use some pkg that xampp dont support ! :)

cube 29th November 2009 23:23

thanks alexxandeer. i tested it on linux and it works, well almost. I tried making an user but no luck so i tried the user.sql that Morbidawn uploaded, no errors on the import bur whn I try to login nothing happens. the recover.php works sens email to reset password and email with new password but no luck again on logging in.

Runny 11th January 2010 15:58

I might be a bit slow ;-)
But can anyone explain how to sign up on the swedvdr source?
It's installed and so on, but can't sign up.

Thx in advance.

Rendevous 30th January 2010 08:42

i signup in softmp3 source with adduser.php ,but tracker.php and announce.php is missing

somebody get it worked?

Phogo 16th February 2010 16:13

The soft MP3 Source uses a C tracker, it is all there and fuctional

Fantazy 31st March 2010 19:04

So...
 
We are pretty new to this but have freetime on our hands and would like to play with a tracker and swedvdrs source is the one that is nice to look at.

So do we have to use linux as OS insteed of windows for it to work ok?

DavePL 30th April 2010 15:48

Still, no one was able to open the code? :unknown:

If anyone knows please explain.

Sorry for my English

OiNK 1st May 2010 18:06

I opened Softmp3 source... and i am translating it to english right now....

DavePL 1st May 2010 23:08

Source softmp3. (Help)
 
\

joeroberts 2nd May 2010 07:16

Quote:

Originally Posted by DavePL (Post 22741)
Still, no one was able to open the code? :unknown:

If anyone knows please explain.

Sorry for my English

was easy just opened it with winrar no proplems.

OiNK 3rd May 2010 18:04

SoftMP3 instalation tutorial (for noobs)
 
Ok... i will explain you what to do (for xampp)
1: Unrar softmp3 archive in htdocs folder....
2: Create a database named softmp3... (from phpmyadmin)
3:In the DATABASE folder you`ll find a file... so you need to import it to the database you created (from phpmyadmin)
4: Edit include/bittorrent.php file and change softmp3.org with your IP (or 127.0.0.1) everywhere you find it...
NOTE... I recommand to use your real IP or your (sub)domain because if you use 127.0.0.1 noone excepting you will be able to login to the tracker...
5: In phpmyadmin go to invites table (in your softmp3 database) and click to Insert...: id: 1, userid: 1, email: write your mail here, skapad: let it how it is, secret: 1234
6: In broswer go to adress: http://YOUR_IP/signup.php?secret=1234 And create your account
7: Go back to phpmyadmin... and in the table users you`ll find your username... Edit it... and in the field "class" put 9 (this is the sysop class number)
8: go to table iplock, and create a table for your IP: id: 1, userid: 1, ip: Your_IP, comment: Your USERNAME
9: Go to browser... and type http://Your_IP and login with your details... and now you are a sysop.
10: After that you will need the tracker.php file... for the announce... (you will find this one in the SweDVDR source archive... and you will need a coder to edit it a bit....

Warning... all staff addons are in sweedish... and a part of source is in sweedish too...


Thats.. all
I hope i didn't forgot any step... and anyway I don't recommend this source for a beginner...

Sorry for my english... I am drunk at the time of post...

Fantazy 12th May 2010 14:25

Quote:

Originally Posted by OiNK (Post 22796)
Ok... i will explain you what to do (for xampp)
1: Unrar softmp3 archive in htdocs folder....
2: Create a database named softmp3... (from phpmyadmin)
3:In the DATABASE folder you`ll find a file... so you need to import it to the database you created (from phpmyadmin)
4: Edit include/bittorrent.php file and change softmp3.org with your IP (or 127.0.0.1) everywhere you find it...
NOTE... I recommand to use your real IP or your (sub)domain because if you use 127.0.0.1 noone excepting you will be able to login to the tracker...
5: In phpmyadmin go to invites table (in your softmp3 database) and click to Insert...: id: 1, userid: 1, email: write your mail here, skapad: let it how it is, secret: 1234
6: In broswer go to adress: http://YOUR_IP/signup.php?secret=1234 And create your account
7: Go back to phpmyadmin... and in the table users you`ll find your username... Edit it... and in the field "class" put 9 (this is the sysop class number)
8: go to table iplock, and create a table for your IP: id: 1, userid: 1, ip: Your_IP, comment: Your USERNAME
9: Go to browser... and type http://Your_IP and login with your details... and now you are a sysop.
10: After that you will need the tracker.php file... for the announce... (you will find this one in the SweDVDR source archive... and you will need a coder to edit it a bit....

Warning... all staff addons are in sweedish... and a part of source is in sweedish too...


Thats.. all
I hope i didn't forgot any step... and anyway I don't recommend this source for a beginner...

Sorry for my english... I am drunk at the time of post...


All worked fine bur when i try to register at my adress signup.php?secret=1234

the register button never gets clickable?

I read that it only works in linux?

I tried with swedvdrs source might i add...

DavePL 25th May 2010 15:39

Here is where you set the announce because when you insert a torrent is old announce "softmp3"
I saw the code in tracker.php but could someone tell the where and what to do ..

I have a question or need to softmp3 announce.php file or just tracker.php? Result in me that I have not left seed. :sos:

swedal 13th October 2010 00:11

hello
 
hello I'm about to put up a torrent site for the source code of softmp3 but when I register myself, I get this message how do I do.
-> The invite URL you got There Is disability or Already Used.

KingStress 26th January 2011 19:14

Sorry for bumping this old thread, but I think it's better than creating new one for my question.
Can anybody tell me which source this one is based? TBDev? Which version?

Ulovlig 8th February 2011 01:05

Quote:

Originally Posted by KingStress (Post 26581)
Sorry for bumping this old thread, but I think it's better than creating new one for my question.
Can anybody tell me which source this one is based? TBDev? Which version?

Tbdev yes

KingStress 9th February 2011 20:42

Quote:

Originally Posted by Ulovlig (Post 26732)
Tbdev yes

Do you know what version?

safira218 25th February 2011 11:18

Quote:

Originally Posted by Njep (Post 11857)
not know if this working : dfc66de15f257f927cc2be752ac4fa1c

If this won`t work we need to try to open that damned signup somehow. I tried a few things to edit the signup.php and takesignup.php but didn`t work. So i replaced those 2 files with 2 of my own from another tbdev source, the signup was open but it wouldn`t creat no damn account. I`m begining to remain out of ideas, hope someone elese is trying to figure this source out, i would really love to use it for a longer time


_______________
linkbuilding service
linkbuilding services
link building services

Berzerker 13th November 2012 00:23

Hi ...

so I got that source running... admin account created... But when I try to log in with my userdetails.... nothing happens... it takes me back to login.php and the two fields with Username and Password are blank... any ideas ?

Chez 16th November 2012 13:15

English sources ?:muscle:

Champ 10th May 2013 15:53

what should i do, because o dont have seed. in torrent in source code - softmp3
maybe i should download tracker.php from swedvdr?
and what should i change in this code ?

thank you very much

Berzerker 6th October 2014 23:24

Hi ...

you don't have to download the tracker.php from SWEDVDR ... just compile the baroktracker.c from directory TRACKER in your shell and it will work fine I think...

I am having the same problem here :

I tried to compile the barotracker.c with the command :

Code:

gcc baroktracker.c -o baroktracker
But didn't work so far... Does anybody habe the solution to get the announce running ?

firefly007 7th October 2014 08:32

You did not give the error.. please paste the error here!

Berzerker 7th October 2014 08:45

Here it is :

Code:

baroktracker.c:273:6: warning: conflicting types for built-in function âlogâ [en                                                                                                                              abled by default]
/tmp/ccoPukxw.o: In function `tracker_handle_announce':
baroktracker.c:(.text+0x17e4): undefined reference to `mysql_real_escape_string'
baroktracker.c:(.text+0x181a): undefined reference to `mysql_use_result'
baroktracker.c:(.text+0x183a): undefined reference to `mysql_error'
baroktracker.c:(.text+0x186a): undefined reference to `mysql_fetch_row'
baroktracker.c:(.text+0x188e): undefined reference to `mysql_free_result'
baroktracker.c:(.text+0x189d): undefined reference to `mysql_errno'
baroktracker.c:(.text+0x1900): undefined reference to `mysql_error'
baroktracker.c:(.text+0x196f): undefined reference to `mysql_free_result'
baroktracker.c:(.text+0x1988): undefined reference to `mysql_free_result'
baroktracker.c:(.text+0x19b2): undefined reference to `mysql_real_escape_string'
baroktracker.c:(.text+0x19e8): undefined reference to `mysql_use_result'
baroktracker.c:(.text+0x1a08): undefined reference to `mysql_error'
baroktracker.c:(.text+0x1a38): undefined reference to `mysql_fetch_row'
baroktracker.c:(.text+0x1a5c): undefined reference to `mysql_errno'
baroktracker.c:(.text+0x1ab5): undefined reference to `mysql_free_result'
baroktracker.c:(.text+0x1ace): undefined reference to `mysql_error'
baroktracker.c:(.text+0x1af4): undefined reference to `mysql_free_result'
baroktracker.c:(.text+0x1b42): undefined reference to `mysql_free_result'
baroktracker.c:(.text+0x2271): undefined reference to `mysql_real_escape_string'
/tmp/ccoPukxw.o: In function `tracker_handle_scrape':
baroktracker.c:(.text+0x2685): undefined reference to `mysql_real_escape_string'
baroktracker.c:(.text+0x26b8): undefined reference to `mysql_store_result'
baroktracker.c:(.text+0x26d2): undefined reference to `mysql_error'
baroktracker.c:(.text+0x26ff): undefined reference to `mysql_num_rows'
baroktracker.c:(.text+0x272b): undefined reference to `mysql_free_result'
baroktracker.c:(.text+0x2772): undefined reference to `mysql_free_result'
baroktracker.c:(.text+0x27a4): undefined reference to `mysql_fetch_row'
baroktracker.c:(.text+0x286a): undefined reference to `mysql_free_result'
baroktracker.c:(.text+0x289d): undefined reference to `mysql_fetch_row'
baroktracker.c:(.text+0x28ce): undefined reference to `mysql_free_result'
/tmp/ccoPukxw.o: In function `peer_remove':
baroktracker.c:(.text+0x4557): undefined reference to `mysql_affected_rows'
/tmp/ccoPukxw.o: In function `db_init':
baroktracker.c:(.text+0x4ae1): undefined reference to `mysql_init'
baroktracker.c:(.text+0x4b03): undefined reference to `mysql_error'
/tmp/ccoPukxw.o: In function `db_connect':
baroktracker.c:(.text+0x4b7f): undefined reference to `mysql_real_connect'
baroktracker.c:(.text+0x4b93): undefined reference to `mysql_error'
/tmp/ccoPukxw.o: In function `db_query':
baroktracker.c:(.text+0x4ccf): undefined reference to `mysql_query'
baroktracker.c:(.text+0x4ce2): undefined reference to `mysql_error'
baroktracker.c:(.text+0x4d08): undefined reference to `mysql_errno'
baroktracker.c:(.text+0x4d1e): undefined reference to `mysql_errno'
collect2: error: ld returned 1 exit status


joeroberts 7th October 2014 13:50

looks like Mysql is not loading.

Berzerker 7th October 2014 15:25

I need I have to check the includes if they are linked correct... or I need another compile command...

Does nobody have the Installation.txt ?

Bump: So sorry for double post...

I got that source running now including the announce...

Now I have the problem that I want to make the site open for registration without secret.

Here is the signup.php :

PHP Code:

<?

require_once("include/bittorrent.php");
dbconn();


if(!isset(
$_GET[secret])){
httperr();
}
$secret sqlesc($_GET[secret]);
$s mysql_query("SELECT * FROM invites WHERE secret = $secret") or sqlerr(__FILE____LINE__);
if(
mysql_num_rows($s) != 1){
stderr("Error","The invite-URL you got there is invalid or already used.");
}
$b mysql_fetch_array($s);
$email $b[email];
stdhead("Signup");


?>


<script type="text/javascript" language="JavaScript">


function checkName() {

wantusername = document.getElementById('wantusername').value;

    var url = 'checkName.php?wantusername=' + escape(wantusername);
    try {
        request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
                try {
                    request = new ActiveXObject("Microsoft.XMLHTTP");
                    } catch (e2) {
                        request = false;
                                }
                }

if (!request && typeof XMLHttpRequest != 'undefined') {
request = new XMLHttpRequest();
}
    request.open("GET", url, true);
    global_content = wantusername;
    request.onreadystatechange = gom;
    request.send(null);
}

function gom() {
  if (request.readyState == 4) {
      if (request.status == 200) {
        var response = request.responseText;        
        document.getElementById("zipResult").innerHTML = response;
        
        
        if(response.substring(0,20) == '<font color=#cc0000>')
        document.reform.submitt.disabled = true;
        else if(response.substring(0,20) == '<font color=#33cc33>')
        document.reform.submitt.disabled = false;
            
        
      }
  }
}


function testPass()
{

document.getElementById("td0").style.backgroundColor = 'white';
document.getElementById("td1").style.backgroundColor = 'white';
document.getElementById("td2").style.backgroundColor = 'white';
document.getElementById("td3").style.backgroundColor = 'white';

    var p = document.getElementById("wantpassword");

    if (p.value == "")
    {
        return;
    }

    var level = 5
    if (!(/[a-zåäö]/.test(p.value) && /[A-ZÅÄÖ]/.test(p.value)))
        level -=1;
    if (!/[0-9]/.test(p.value))
        level -=1;
    if (!/[^0-9a-zåäö]/i.test(p.value))
        level -=1;;
    if (p.value.length < 6)
        level -=1;
    if (p.value.length < 9)
        level -=1;

if(level == 1)
color='red';
else if(level == 2)
color='yellow';
else if(level > 2)
color='green';


for(i = 0; i < level; i++)
{
var cp = document.getElementById("td" + i);
cp.style.backgroundColor = color;
}

}



</script>

<p>
<form method="post" action="takesignup.php" name="reform">
<table border="1" cellspacing=0 cellpadding="10">

<tr><td align="right" class="heading">Username:</td><td align=left><input type="text" size="40" name="wantusername" id="wantusername" onblur="checkName();" />

</td>
<td width="250">
<div id="zipResult"></div></td></tr>


<tr>
<td align="right" class="heading">
Gender
</td>
<td>
<input type=radio name="gender" value=1>Male
<input type=radio name="gender" value=2>Female
<input type=radio name="gender" value=0 checked>None
</td>
<td></td>
</tr>

<tr>
<td align="right" class="heading">
Age
</td>
<td>
<input type="text" name="alder" size=2 MAXLENGTH=2 />
</td>
<td></td>
</tr>


<tr><td align="right" class="heading">Password:</td><td align=left><input type="password" size="40" name="wantpassword" id="wantpassword" onkeyUp="javascript:testPass();" />
</td><td>
Level of security: 
<table border=1 cellspacing=0 cellpadding=2 width="200">
<tr>
<td id="td0">&nbsp;</td>
<td id="td1">&nbsp;</td>
<td id="td2">&nbsp;</td>
<td id="td3">&nbsp;</td>
</tr>
</table>

</td></tr>
<tr><td align="right" class="heading">Repeat password:</td><td align=left><input type="password" size="40" name="passagain" />
</td><td>


</td></tr>

<tr><td align="right" class="heading">Language:</td><td align=left width=200>


<?
echo "<label><input type=radio name=language value=swe checked><img src=/pic/flag/sweden.gif></label>
<label><input type=radio name=language value=eng><img src=/pic/flag/uk.gif></label>
<label><input type=radio name=language value=nor><img src=/pic/flag/norway.gif></label>
<label><input type=radio name=language value=dkk><img src=/pic/flag/denmark.gif></label>
<label><input type=radio name=language value=fin><img src=/pic/flag/finland.gif></label>
<label><input type=radio name=language value=fra><img src=/pic/flag/france.gif></label>
<label><input type=radio name=language value=dut><img src=/pic/flag/netherlands.gif></label>
<label><input type=radio name=language value=ger><img src=/pic/flag/germany.gif></label>"
;
?>


</td></tr>



<input type=hidden name=invitekod value="<? echo $_GET[secret]; ?>"> 
<input type=hidden name=email value="<? echo $email?>">
<tr><td colspan="3" align="center"><input type=submit value="Sign up!" style='height: 25px' name="submitt" disabled></td></tr>
</table>
</form>
<?

stdfoot
();

?>

And the takesignup.php :

PHP Code:

<?

require_once("include/bittorrent.php");
dbconn();

    
set_time_limit(0);
    
ignore_user_abort(1);

if (!
mkglobal("wantusername:wantpassword:passagain:email:language:invitekod"))
    
httperr();

function 
bark($msg) {
  
stdhead();
    
stdmsg("Failed!"$msg);
  
stdfoot();
  exit;
}

function 
validinvitekod($kod)
{
$o mysql_query("SELECT * FROM invites WHERE secret = '$kod';") or sqlerr(__FILE____LINE__);
$b mysql_num_rows($o);

if(
$b == 1)
return 
True;
else
return 
False;
}




$eh sqlesc($wantusername);
$count mysql_query("SELECT * FROM users WHERE username = $eh;") or sqlerr(__FILE____LINE__);

if(
mysql_num_rows($count)>0)
{
stderr("Error","Username taken.");
}





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;
}

function 
validatepass($pass)
{

//if((ctype_digit($pass) || ctype_alpha($pass)) && strlen($pass) <7)
//bark("The password must contain both letters and digits.");

if($pass == 'abc123')
bark("Oh please... abc123 is the worst password ever.");

if(
$pass == 'hejsan')
bark("Oh please... hejsan is the worst password ever.");

if(
$pass == '123456')
bark("Oh please... 123456 is the worst password ever.");

if(
$pass == 'password')
bark("Oh please... password is the worst password ever.");

if(
$pass == 'qwerty')
bark("Oh please... qwerty is the worst password ever.");

if(
$pass == 'hejhej')
bark("Oh please... hejhej is the worst password ever.");

if(
$pass == 'bajskorv')
bark("Oh please... bajskorv is the worst password ever.");

if(
$pass == 'kalle')
bark("Oh please... kalle is the worst password ever.");

if(
$pass == 'general')
bark("Oh please... general is the worst password ever.");

if (
strlen($pass) < 6)
    
bark("Password too short (atleast 6 chars)");
if (
strlen($pass) > 20)
    
bark("Password too long (maximum 20 chars)");

return 
true;
}

function 
isportopen($port)
{
    global 
$HTTP_SERVER_VARS;
    
$sd = @fsockopen($HTTP_SERVER_VARS["REMOTE_ADDR"], $port$errno$errstr1);
    if (
$sd)
    {
        
fclose($sd);
        return 
true;
    }
    else
        return 
false;
}
/*
function isproxy()
{
    $ports = array(80, 88, 1075, 1080, 1180, 1182, 2282, 3128, 3332, 5490, 6588, 7033, 7441, 8000, 8080, 8085, 8090, 8095, 8100, 8105, 8110, 8888, 22788);
    for ($i = 0; $i < count($ports); ++$i)
        if (isportopen($ports[$i])) return true;
    return false;
}
*/
if (empty($wantusername) || empty($wantpassword) || empty($email))
    
bark("Dont leave any fields blank.");

if (
strlen($wantusername) > 12)
    
bark("Username too long. (Max 12 chars)");

if (
$wantpassword != $passagain)
    
bark("Password missmatch.");


if (
$wantpassword == $wantusername)
    
bark("The password cant be the same as the username.");

if (!
validusername($wantusername))
    
bark("Invalid username");


if (!
validatepass($wantpassword))
    
bark("Pick another password...");

if (!
validinvitekod($invitekod))
    
bark("Bad invitecode.");

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

// make sure user agrees to everything...

$a = (@mysql_fetch_row(@mysql_query("select count(*) from users where email='$email'"))) or die(mysql_error());
if (
$a[0] != 0)
  
bark("The e-mail address $email is already in use.");


$wantpasshash "temp";

$gender 0+$_POST["gender"];
$alder 0+$_POST["alder"];

$b mysql_query("SELECT * FROM invites WHERE secret = '$invitekod';") or sqlerr(__FILE____LINE__);
$oo mysql_fetch_array($b);

$inv $oo[userid];
$ip $_SERVER["REMOTE_ADDR"];

$passkey md5($CURUSER['username'].get_date_time().$CURUSER['passhash']);

//$ret = mysql_query("INSERT INTO users (username, passhash, email, passkey, invited_by, added, last_access,byttpass) VALUES (" .implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $email, $passkey, $inv))) .",'" . get_date_time() . "','" . get_date_time() . "',1)");

$ret mysql_query("INSERT INTO users (username, passhash, email, passkey, invited_by, language, added, last_access, ip, gender, alder) VALUES (" .implode(","array_map("sqlesc", array($wantusername$wantpasshash$email$passkey$inv$language))) .",'" get_date_time() . "','" get_date_time() . "', '$ip', $gender$alder)");


if (!
$ret) {
    if (
mysql_errno() == 1062)
        
bark("MySQL fel i skapning av kontot!");
    
bark("Fel?");
}
            
$uid  mysql_insert_id();

$msg sqlesc("The invite sent to {$email} is accepted and he/she choosed [url=/userdetails.php?id={$uid}][b]{$wantusername}[/b][/url] as username.");
$dt sqlesc(get_date_time());
mysql_query("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(1, $inv$dt$msg, 'Invite accepted')") or sqlerr(__FILE____LINE__);



$ro mysql_fetch_array(mysql_query("SELECT added FROM users WHERE id = $uid LIMIT 1"));
$nyhash md5(md5($wantpassword.$ro["added"])."korvspad1".$wantpassword);
mysql_query("UPDATE users SET passhash = '$nyhash' WHERE id = $uid LIMIT 1;") or sqlerr(__FILE____LINE__);

// Ny-Regg-Koll


$ip $_SERVER["REMOTE_ADDR"];
$iplog mysql_query("SELECT COUNT(*) FROM iplog WHERE ip = '$ip'") or sqlerr(__FILE____LINE__);
$iplog mysql_fetch_array($iplog);

$host gethostbyaddr($ip);


$regg mysql_query("SELECT COUNT(*) FROM inlogg WHERE ip = '$ip'");
$regg mysql_fetch_array($regg);

$ilog $iplog[0] + $regg[0];


$level1 mysql_num_rows(mysql_query("SELECT enabled FROM `inlogg` JOIN users on  inlogg.uid = users.id WHERE inlogg.ip = '$ip' AND enabled = 'no'"));

$level2 mysql_num_rows(mysql_query("SELECT enabled FROM `iplog` JOIN users on iplog.userid = users.id WHERE iplog.ip = '$ip' AND enabled = 'no'"));

if( (
$level1+$level2) > )
$level 1;
else
$level 0;

mysql_query("INSERT INTO nyregg(userid, datum, ip, hostname, email, log_mail, log_ip, level) VALUES($uid, '".get_date_time()."', '$ip', '$host', '$email', 0, $ilog$level)") or sqlerr(__FILE____LINE__);


// Regg-koll-slut







mysql_query("DELETE FROM invites WHERE secret = '$invitekod';") or sqlerr(__FILE____LINE__);

$passh md5($HTTP_SERVER_VARS["REMOTE_ADDR"].$nyhash."hejsan".$HTTP_SERVER_VARS["REMOTE_ADDR"]);
logincookie($uid$passh);





header("Refresh: 0; url=faq.php");


?>

So the first thing I recognized is in signup this part :

PHP Code:

if(!isset($_GET[secret])){
httperr();
}
$secret sqlesc($_GET[secret]);
$s mysql_query("SELECT * FROM invites WHERE secret = $secret") or sqlerr(__FILE____LINE__);
if(
mysql_num_rows($s) != 1){
stderr("Error","The invite-URL you got there is invalid or already used.");
}
$b mysql_fetch_array($s); 

Then this here :

PHP Code:

<input type=hidden name=invitekod value="<? echo $_GET[secret]; ?>">

And in takesignup.php these parts :

PHP Code:

function validinvitekod($kod)
{
$o mysql_query("SELECT * FROM invites WHERE secret = '$kod';") or sqlerr(__FILE____LINE__);
$b mysql_num_rows($o);

if(
$b == 1)
return 
True;
else
return 
False;


and this :

PHP Code:

if (!validinvitekod($invitekod))
    
bark("Bad invitecode."); 

then this :

PHP Code:

$b mysql_query("SELECT * FROM invites WHERE secret = '$invitekod';") or sqlerr(__FILE____LINE__);
$oo mysql_fetch_array($b);

$inv $oo[userid]; 

Also I think we need to remove this :

PHP Code:

$msg sqlesc("The invite sent to {$email} is accepted and he/she choosed [url=/userdetails.php?id={$uid}][b]{$wantusername}[/b][/url] as username.");
$dt sqlesc(get_date_time());
mysql_query("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(1, $inv$dt$msg, 'Invite accepted')") or sqlerr(__FILE____LINE__); 

And last but not least this :

PHP Code:

mysql_query("DELETE FROM invites WHERE secret = '$invitekod';") or sqlerr(__FILE____LINE__); 

Lets try if it works if I remove those lines :P

I will repost here it it worked...

Greetz

Bump: // EDIT 2 :

Got it !!!

The script barked with the valid Email so I deactivated it :

Here is the new signup.php and takrsignup.php for use WITHOUT SECRET CODE !!!

signup.php :

PHP Code:

<?

require_once("include/bittorrent.php");
dbconn();


$email $b[email];
stdhead("Signup");


?>


<script type="text/javascript" language="JavaScript">


function checkName() {

wantusername = document.getElementById('wantusername').value;

    var url = 'checkName.php?wantusername=' + escape(wantusername);
    try {
        request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
                try {
                    request = new ActiveXObject("Microsoft.XMLHTTP");
                    } catch (e2) {
                        request = false;
                                }
                }

if (!request && typeof XMLHttpRequest != 'undefined') {
request = new XMLHttpRequest();
}
    request.open("GET", url, true);
    global_content = wantusername;
    request.onreadystatechange = gom;
    request.send(null);
}

function gom() {
  if (request.readyState == 4) {
      if (request.status == 200) {
        var response = request.responseText;        
        document.getElementById("zipResult").innerHTML = response;
        
        
        if(response.substring(0,20) == '<font color=#cc0000>')
        document.reform.submitt.disabled = true;
        else if(response.substring(0,20) == '<font color=#33cc33>')
        document.reform.submitt.disabled = false;
            
        
      }
  }
}


function testPass()
{

document.getElementById("td0").style.backgroundColor = 'white';
document.getElementById("td1").style.backgroundColor = 'white';
document.getElementById("td2").style.backgroundColor = 'white';
document.getElementById("td3").style.backgroundColor = 'white';

    var p = document.getElementById("wantpassword");

    if (p.value == "")
    {
        return;
    }

    var level = 5
    if (!(/[a-zåäö]/.test(p.value) && /[A-ZÅÄÖ]/.test(p.value)))
        level -=1;
    if (!/[0-9]/.test(p.value))
        level -=1;
    if (!/[^0-9a-zåäö]/i.test(p.value))
        level -=1;;
    if (p.value.length < 6)
        level -=1;
    if (p.value.length < 9)
        level -=1;

if(level == 1)
color='red';
else if(level == 2)
color='yellow';
else if(level > 2)
color='green';


for(i = 0; i < level; i++)
{
var cp = document.getElementById("td" + i);
cp.style.backgroundColor = color;
}

}



</script>

<p>
<form method="post" action="takesignup.php" name="reform">
<table border="1" cellspacing=0 cellpadding="10">

<tr><td align="right" class="heading">Username:</td><td align=left><input type="text" size="40" name="wantusername" id="wantusername" onblur="checkName();" />

</td>
<td width="250">
<div id="zipResult"></div></td></tr>


<tr>
<td align="right" class="heading">
Gender
</td>
<td>
<input type=radio name="gender" value=1>Male
<input type=radio name="gender" value=2>Female
<input type=radio name="gender" value=0 checked>None
</td>
<td></td>
</tr>

<tr>
<td align="right" class="heading">
Age
</td>
<td>
<input type="text" name="alder" size=2 MAXLENGTH=2 />
</td>
<td></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.'?></td></tr>
</font></td></tr></table>

<tr><td align="right" class="heading">Password:</td><td align=left><input type="password" size="40" name="wantpassword" id="wantpassword" onkeyUp="javascript:testPass();" />
</td><td>
Level of security: 
<table border=1 cellspacing=0 cellpadding=2 width="200">
<tr>
<td id="td0">&nbsp;</td>
<td id="td1">&nbsp;</td>
<td id="td2">&nbsp;</td>
<td id="td3">&nbsp;</td>
</tr>
</table>

</td></tr>
<tr><td align="right" class="heading">Repeat password:</td><td align=left><input type="password" size="40" name="passagain" />
</td><td>


</td></tr>

<tr><td align="right" class="heading">Language:</td><td align=left width=200>


<?
echo "<label><input type=radio name=language value=swe checked><img src=/pic/flag/sweden.gif></label>
<label><input type=radio name=language value=eng><img src=/pic/flag/uk.gif></label>
<label><input type=radio name=language value=nor><img src=/pic/flag/norway.gif></label>
<label><input type=radio name=language value=dkk><img src=/pic/flag/denmark.gif></label>
<label><input type=radio name=language value=fin><img src=/pic/flag/finland.gif></label>
<label><input type=radio name=language value=fra><img src=/pic/flag/france.gif></label>
<label><input type=radio name=language value=dut><img src=/pic/flag/netherlands.gif></label>
<label><input type=radio name=language value=ger><img src=/pic/flag/germany.gif></label>"
;
?>


</td></tr>

<tr><td colspan="3" align="center"><input type=submit value="Sign up!" style='height: 25px' name="submitt" disabled></td></tr>
</table>
</form>
<?

stdfoot
();

?>

takesignup.php :

PHP Code:

<?

require_once("include/bittorrent.php");
dbconn();

    
set_time_limit(0);
    
ignore_user_abort(1);

if (!
mkglobal("wantusername:wantpassword:passagain:email:language"))
    
httperr();

function 
bark($msg) {
  
stdhead();
    
stdmsg("Failed!"$msg);
  
stdfoot();
  exit;
}


$eh sqlesc($wantusername);
$count mysql_query("SELECT * FROM users WHERE username = $eh;") or sqlerr(__FILE____LINE__);

if(
mysql_num_rows($count)>0)
{
stderr("Error","Username taken.");
}





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;
}

function 
validatepass($pass)
{

//if((ctype_digit($pass) || ctype_alpha($pass)) && strlen($pass) <7)
//bark("The password must contain both letters and digits.");

if($pass == 'abc123')
bark("Oh please... abc123 is the worst password ever.");

if(
$pass == 'hejsan')
bark("Oh please... hejsan is the worst password ever.");

if(
$pass == '123456')
bark("Oh please... 123456 is the worst password ever.");

if(
$pass == 'password')
bark("Oh please... password is the worst password ever.");

if(
$pass == 'qwerty')
bark("Oh please... qwerty is the worst password ever.");

if(
$pass == 'hejhej')
bark("Oh please... hejhej is the worst password ever.");

if(
$pass == 'bajskorv')
bark("Oh please... bajskorv is the worst password ever.");

if(
$pass == 'kalle')
bark("Oh please... kalle is the worst password ever.");

if(
$pass == 'general')
bark("Oh please... general is the worst password ever.");

if (
strlen($pass) < 6)
    
bark("Password too short (atleast 6 chars)");
if (
strlen($pass) > 20)
    
bark("Password too long (maximum 20 chars)");

return 
true;
}

function 
isportopen($port)
{
    global 
$HTTP_SERVER_VARS;
    
$sd = @fsockopen($HTTP_SERVER_VARS["REMOTE_ADDR"], $port$errno$errstr1);
    if (
$sd)
    {
        
fclose($sd);
        return 
true;
    }
    else
        return 
false;
}
/*
function isproxy()
{
    $ports = array(80, 88, 1075, 1080, 1180, 1182, 2282, 3128, 3332, 5490, 6588, 7033, 7441, 8000, 8080, 8085, 8090, 8095, 8100, 8105, 8110, 8888, 22788);
    for ($i = 0; $i < count($ports); ++$i)
        if (isportopen($ports[$i])) return true;
    return false;
}
*/
if (empty($wantusername) || empty($wantpassword))
    
bark("Dont leave any fields blank.");

if (
strlen($wantusername) > 12)
    
bark("Username too long. (Max 12 chars)");

if (
$wantpassword != $passagain)
    
bark("Password missmatch.");


if (
$wantpassword == $wantusername)
    
bark("The password cant be the same as the username.");

if (!
validusername($wantusername))
    
bark("Invalid username");


if (!
validatepass($wantpassword))
    
bark("Pick another password...");

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

// make sure user agrees to everything...

$a = (@mysql_fetch_row(@mysql_query("select count(*) from users where email='$email'"))) or die(mysql_error());
if (
$a[0] != 0)
  
bark("The e-mail address $email is already in use.");


$wantpasshash "temp";

$gender 0+$_POST["gender"];
$alder 0+$_POST["alder"];

$ip $_SERVER["REMOTE_ADDR"];

$passkey md5($CURUSER['username'].get_date_time().$CURUSER['passhash']);

//$ret = mysql_query("INSERT INTO users (username, passhash, email, passkey, added, last_access,byttpass) VALUES (" .implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $email, $passkey))) .",'" . get_date_time() . "','" . get_date_time() . "',1)");

$ret mysql_query("INSERT INTO users (username, passhash, email, passkey, language, added, last_access, ip, gender, alder) VALUES (" .implode(","array_map("sqlesc", array($wantusername$wantpasshash$email$passkey$language))) .",'" get_date_time() . "','" get_date_time() . "', '$ip', $gender$alder)");


if (!
$ret) {
    if (
mysql_errno() == 1062)
        
bark("MySQL fel i skapning av kontot!");
    
bark("Fel?");
}
            
$uid  mysql_insert_id();



$ro mysql_fetch_array(mysql_query("SELECT added FROM users WHERE id = $uid LIMIT 1"));
$nyhash md5(md5($wantpassword.$ro["added"])."korvspad1".$wantpassword);
mysql_query("UPDATE users SET passhash = '$nyhash' WHERE id = $uid LIMIT 1;") or sqlerr(__FILE____LINE__);

// Ny-Regg-Koll


$ip $_SERVER["REMOTE_ADDR"];
$iplog mysql_query("SELECT COUNT(*) FROM iplog WHERE ip = '$ip'") or sqlerr(__FILE____LINE__);
$iplog mysql_fetch_array($iplog);

$host gethostbyaddr($ip);


$regg mysql_query("SELECT COUNT(*) FROM inlogg WHERE ip = '$ip'");
$regg mysql_fetch_array($regg);

$ilog $iplog[0] + $regg[0];


$level1 mysql_num_rows(mysql_query("SELECT enabled FROM `inlogg` JOIN users on  inlogg.uid = users.id WHERE inlogg.ip = '$ip' AND enabled = 'no'"));

$level2 mysql_num_rows(mysql_query("SELECT enabled FROM `iplog` JOIN users on iplog.userid = users.id WHERE iplog.ip = '$ip' AND enabled = 'no'"));

if( (
$level1+$level2) > )
$level 1;
else
$level 0;

mysql_query("INSERT INTO nyregg(userid, datum, ip, hostname, email, log_mail, log_ip, level) VALUES($uid, '".get_date_time()."', '$ip', '$host', '$email', 0, $ilog$level)") or sqlerr(__FILE____LINE__);


// Regg-koll-slut

$passh md5($HTTP_SERVER_VARS["REMOTE_ADDR"].$nyhash."hejsan".$HTTP_SERVER_VARS["REMOTE_ADDR"]);
logincookie($uid$passh);





header("Refresh: 0; url=faq.php");


?>

Have fun with it :-)

urliks 12th October 2014 11:14

hello. direct, very flawed system. None of the systems can not register even if I registered it can not login. swedvr I do not work at all. softmp3 tikaiproblēmas with signup.php and takesignup.php as well as something login.php error. as if you've tried everything written, vinalga work.

djpytter 17th September 2018 17:54

Berzerker works perfect
 
Berzerker works perfect what you posted here but on Softmp3 not works to login.
The user was created is confirmed is all ok but login.php not works and login_old_.php not works and takelogin.php I think is ok but not works to login in my account!
somebody can tell me how can I login. or what must to change for works to login in the account!

Thanks in advenced!


All times are GMT +2. The time now is 00:52.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.