Witam
Postawiłem cała strunkę wszystko działa.. tylko jak sie zarejestrowałem to mi wywaliło od razu bana? Jak stworzyć konto administratora?
Pozdrawiam!
$lsysopnames = array("Sysop", "admin", "mod", "mod2"); // Lista osób ktore sa leganie w zalodze.$lsysopnames = array("michal123", "adam", "jerzy");implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $email, (!$arr[0]?'confirmed':'pending')))).implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $email, 'confirmed'))).UPDATE users SET enabled='yes' WHERE id=1Parse error: syntax error, unexpected T_IF in /var/www/sites/yoyo.pl/t/o/torrot/takesignup.php on line 108A po próbie logowania się na konto które przed chwilą tworzyłem wyskakuje: Logowanie nieudane, Błąd: Nazwa użytkownika bądź hasło jest nieprawidłowe
Nie pamiętasz swojego hasła? Przypomnij je teraz!
if (!$ret) {
if (mysql_errno() == 1062)
bark("Użytkownik o podanym nicku istnieje, musisz podać inny!");
bark("borked");
}Dlaczego nie dochodzą wiadomości ani aktywujące ani zaproszenia? Czy to jest jakiś ogólny błąd czy trzeba coś ustawić?
<?
require_once("include/bittorrent.php");
dbconn();
$res = mysql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE__, __LINE__);
$arr = mysql_fetch_row($res);
if ($arr[0] >= $maxusers)
stderr("Bł±d", "Przepraszamy aktualny limit został osi±gnięty, nieaktywne konta użytkowników s± na bież±co kasowane. Prosimy spróbować póĽniej.");
if (!mkglobal("wantusername:wantpassword:passagain:email"))
die();
function bark($msg) {
stdhead();
stdmsg("Rejestracja nieudana!", $msg);
stdfoot();
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;
}
function isportopen($port)
{
$sd = @fsockopen($_SERVER["REMOTE_ADDR"], $port, $errno, $errstr, 1);
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("Przed zarejestrowaniem musisz wypełnić wszystkie pola w formularzu");
if (strlen($wantusername) > 12)
bark("Sorry, username is too long (max is 12 chars)");
if ($wantpassword != $passagain)
bark("The passwords didn't match! Must've typoed. Try again.");
if (strlen($wantpassword) < 6)
bark("Przepraszamy, twoje hasło jest za krótkie. Musi mieć minimum 6 znaków.");
if (strlen($wantpassword) > 40)
bark("Przepraszamy, twoje hasło jest za długie, maxymalna liczba to 40.");
if ($wantpassword == $wantusername)
bark("Sorry, password cannot be same as user name.");
if (!validemail($email))
bark("That doesn't look like a valid email address.");
if (!validusername($wantusername))
bark("Invalid username.");
// make sure user agrees to everything...
if ($_POST["rulesverify"] != "yes" || $_POST["faqverify"] != "yes" || $_POST["ageverify"] != "yes")
stderr("Rejestracja nieudana", "Przepraszamy, Nie spełniasz wymagań by zostać członkiem naszej strony.");
// check if email addy is already in use
$a = (@mysql_fetch_row(@mysql_query("select count(*) from users where email='$email'"))) or die(mysql_error());
if ($a[0] != 0)
bark("Konto o adresie e-mail $email istnieje, proszę podaj inne.");
// sprawdzanie podwójnego IP
$a = (@mysql_fetch_row(@mysql_query("select count(*) from users where ip='" . $_SERVER['REMOTE_ADDR'] . "'"))) or die(mysql_error());
if ($a[0] != 0)
bark("Twoje ip " . $_SERVER['REMOTE_ADDR'] . " zostało już wykorzystane. Pozwalamy posiadać tylko jedno konto na jedno ip.");
/*
// do simple proxy check
if (isproxy())
bark("You appear to be connecting through a proxy server. Your organization or ISP may use a transparent caching HTTP proxy. Please try and access the site on <a href=http://torrentbits.org:81/signup.php>port 81</a> (this should bypass the proxy server). <p><b>Note:</b> if you run an Internet-accessible web server on the local machine you need to shut it down until the sign-up is complete.");
*/
$secret = mksecret();
$wantpasshash = md5($wantpassword);
$editsecret = (!$arr[0]?"":mksecret());
$ret = mysql_query("INSERT INTO users (username, passhash, secret, editsecret, email, status, ". (!$arr[0]?"class, ":"") ."added) VALUES (" .
implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $email, 'confirmed'))).
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!$ret) {
if (mysql_errno() == 1062)
bark("Użytkownik o podanym nicku istnieje, musisz podać inny!");
bark("borked");
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$id = mysql_insert_id();
//write_log("User account $id ($wantusername) was created");
$psecret = md5($editsecret);
$body = <<<EOD
Zarejestrowales sie na stronie $SITENAME i podales swój adres e-mail ($email) jako kontaktowy.
Jesli nie rejestrowales sie na tej stronie prosze zignoruj ta wiadomosc. Oto adres IP osoby która podala twój e-mail {$_SERVER["REMOTE_ADDR"]}. Prosze nie odpisywac!.
Jesli chcesz potwierdzic rejestracje na stronie, prosze kliknac na ten link:
$DEFAULTBASEURL/confirm.php?id=$id&secret=$psecret
Gdy to zrobisz, bedziesz mógl korzystac z swojego nowego konta. Jesli tego nie zrobisz, twoje konto zostanie usuniete w ciagu pieciu dni. Prosimy najpierw zapoznac sie z REGULAMINEM oraz FAQ, zanim zaczniesz korzystac ze strony.
EOD;
if($arr[0])
mail($email, "$SITENAME Potwierdzenie rejestracji", $body, "From: $SITEEMAIL", "-f$SITEEMAIL");
else
logincookie($id, $wantpasshash);
header("Refresh: 0; url=ok.php?type=". (!$arr[0]?"sysop":("signup&email=" . urlencode($email))));
?>
$ret = mysql_query("INSERT INTO users (username, passhash, secret, editsecret, email, status, ". (!$arr[0]?"class, ":"") ."added) VALUES (" .
implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $email, 'confirmed'))).
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!$ret) {
if (mysql_errno() == 1062)
bark("Użytkownik o podanym nicku istnieje, musisz podać inny!");
bark("borked");
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$id = mysql_insert_id();$ret = mysql_query("INSERT INTO users (username, passhash, secret, editsecret, email, status, ". (!$arr[0]?"class, ":"") ."added) VALUES (" .
implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $email, 'confirmed'))).
", ". (!$arr[0]?UC_SYSOP.", ":""). "'" . get_date_time() . "')");
if (!$ret) {
if (mysql_errno() == 1062)
bark("Użytkownik o podanym nicku istnieje, musisz podać inny!");
bark("borked");
}
$id = mysql_insert_id();
$ret = mysql_query("INSERT INTO users (username, passhash, secret, editsecret, email, status, ". (!$arr[0]?"class, ":"") ."added) VALUES (" .
implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $email, 'confirmed'))).
", ". (!$arr[0]?UC_SYSOP.", ":""). "'" . get_date_time() . "')");
if (!$ret) {
if (mysql_errno() == 1062)
bark("Użytkownik o podanym nicku istnieje, musisz podać inny!");
bark("borked");
}
$id = mysql_insert_id();
A pytanie to czemu nie jestem na stronie administratorem tylko sysop'em?
Do tej pory bawiłem się rożnymi forami i tam była opcja w panelu administracyjnym odnośnie grup itp a tu?
Użytkownicy przeglądający to forum: Brak zalogowanych użytkowników i 0 gości