\n", FILE_APPEND);
$_SESSION['idleirc-nick'] = stripslashes(htmlentities($_POST['nick']));
}
if (isset($_POST['channel']) && $_POST['channel']!="") {
file_put_contents("users/$username.php", "\n", FILE_APPEND);
$_SESSION['idleirc-channel'] = stripslashes(htmlentities($_POST['channel']));
}
if (isset($_POST['password']) && $_POST['password']!="") {
file_put_contents("users/$username.php", "\n", FILE_APPEND);
$_SESSION['idleirc-pass'] = md5($_POST['password']);
}
if ($allowMultiServer == "true") {
if (isset($_POST['servaddr']) && $_POST['servaddr']!="") {
file_put_contents("users/$username.php", "\n", FILE_APPEND);
$_SESSION['idleirc-servaddr'] = stripslashes(htmlentities($_POST['servaddr']));
}
if (isset($_POST['servport']) && $_POST['servport']!="") {
file_put_contents("users/$username.php", "\n", FILE_APPEND);
$_SESSION['idleirc-servport'] = stripslashes(htmlentities($_POST['servport']));
}
}
header("refresh: 0;url=index.php");
} else {
header("refresh: 0;url=index.php");
}
}
if (isset($_GET['register']) && $_GET['register'] == "go") {
if(isset($_POST['password']) && $_POST['password'] != "" && isset($_POST['password-again']) && $_POST['password-again'] != "" && $_POST['password'] == $_POST['password-again']) {
if(isset($_POST['username']) && $_POST['username'] != "") {
$username = stripslashes(htmlentities($_POST['username']));
$password = md5($_POST['password']);
$channame = isset($_POST['channel']) && ($_POST['channel'] !== "") ? htmlentities(stripslashes($_POST['channel'])) : $default_channel;
$nickname = isset($_POST['nick']) && ($_POST['nick'] !== "") ? htmlentities(stripslashes($_POST['nick'])) : $username;
$servaddr = isset($_POST['servaddr']) && ($_POST['servaddr'] !== "") ? htmlentities(stripslashes($_POST['servaddr'])) : $server;
$servport = isset($_POST['servport']) && ($_POST['servport'] !== "") ? htmlentities(stripslashes($_POST['servport'])) : $port;
file_put_contents("users/$username.php", "\n");
file_put_contents("users/.$username.first", "First time, start up\n");
$_SESSION['idleirc-user'] = $username;
$_SESSION['idleirc-nick'] = $nickname;
$_SESSION['idleirc-pass'] = $password;
$_SESSION['idleirc-channel'] = $channame;
$_SESSION['idleirc-servaddr'] = $servaddr;
$_SESSION['idleirc-servport'] = $servport;
header("refresh: 0;url=index.php");
} else {
echo "Please prove a username...";
}
} else {
echo "ERROR: Passwords did not match...";
}
}
// If web frontend is trying to login, process and connect
if (isset($_GET['do']) && $_GET['do']=="login" && isset($_POST['submitBtn']) && isset($_POST['password']) && $_POST['password']!=""){
$name = isset($_POST['username']) && ($_POST['username'] !== "") && file_exists("users/" . $_POST['username'] . ".php") ? htmlentities(stripslashes($_POST['username'])) : "Unnamed";
if(file_exists("users/$name.php")) {
include("users/$name.php");
if(md5($_POST['password']) == $userpass) {
$_SESSION['idleirc-user'] = $name;
$_SESSION['idleirc-nick'] = $usernickname;
$_SESSION['idleirc-pass'] = $userpass;
$_SESSION['idleirc-channel'] = $userchannel;
$_SESSION['idleirc-servaddr'] = $userserver;
$_SESSION['idleirc-servport'] = $userserverport;
header("refresh: 0;url=index.php");
} else {
echo "ERROR: Failed to login: password incorrect.";
}
} else {
echo "ERROR: Password for $name does not match";
}
}
?>
>
Back to IRC • Clear IRC logs
\n";
echo "\n";
}
} else if(isset($_GET['settings'])) {
$username = $_SESSION['idleirc-user'];
$logcontents = file_get_contents("users/$username.log");
if(file_exists("users/$username.php")) {
include("users/$username.php");
} else {
$userpass = "";
}
if(isset($_SESSION['idleirc-pass']) && $userpass != "" && $userpass == $_SESSION['idleirc-pass']) {
echo "
\n";
?>
Leave fields blank that you'd not like set. Fill in what you'd want to change and hit set. Settings will be saved and session will be updated
";
$get = file_get_contents("users/" . $_SESSION['idleirc-user'] . ".log");
echo $get;
echo "";
?>