Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
LogIn Show/Hide password
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods in Progress

2023-06-29 14:06:11
Hi guys, someone have needs to this one mod.
Here is it:




Tested on FireFox, TOR Browser and Chrome
login-show-hide-password.zip
Download



www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2023-06-29 16:27:53
I like your design style. I use top/bottom borders too in a container with a border-radius, makes for a clean look. Looks good! 👍
2023-06-29 19:01:58
Thank you @STorrents2020

Guys, I made a small correction to the php file (inedx.php and coockie login difficult), so just download it again please

Regards
account-login.zip
Download



www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2023-06-29 20:42:44
thank you Botanicar, but you force me to have a style of login like this one you give me work little rascal MDR 🤣  😊
Last edited by spiritblue on 2023-06-29 20:46:37
2023-06-29 20:49:53
Botanicar :
works well on test site
, but I don't adapt them to the theme


Last edited by spiritblue on 2023-06-30 15:41:11
2023-06-29 21:18:52
@spiritblue

download latest acount-login.zip and upload it, as I see you have old one


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2023-06-29 22:02:13
no i have the last one you uploaded
2023-06-29 22:32:02
thats pretty nice Botanicar. I need to try this. Just for fun tho, since I do this in mine, do you think filtering username and password is good? I do it on mine, so I figured I would post this. I think its correct. Mine has more code than the original, but I think I inserted what is correct for this specific code. If Im wrong, let me know. Just wanted to add some help to this code for filtering username and pass for more security I think
<?php

#================================#
#       TorrentTrader 3.00       #
#  https://torrenttrader.uk      #
#--------------------------------#
#       Modified by Botanicar    #
#================================#

require_once("backend/functions.php");
dbconn();

if (isset($_POST["username"]) && isset($_POST["password"])) {
   if (!empty($_POST["username"]) && !empty($_POST["password"])) {
       $username = filter_var($_POST["username"], FILTER_SANITIZE_STRING);
       $password = filter_var($_POST["password"], FILTER_SANITIZE_STRING);
       $password_hash = passhash($password);

$stmt = $GLOBALS["DBconnector"]->prepare("SELECT id, password, secret, status, enabled FROM users WHERE username = ? LIMIT 1");
$stmt->bind_param("s", $username);
$stmt->execute();

if ($stmt->error) {
die("Query failed: " . $stmt->error);
}

$res = $stmt->get_result();
$row = $res->fetch_assoc();

if ($row) {
if ($row["password"] !== $password_hash) {
$message = T_("LOGIN_INCORRECT");
} elseif ($row["status"] === "pending") {
$message = T_("ACCOUNT_PENDING");
} elseif ($row["enabled"] === "no") {
$message = T_("ACCOUNT_DISABLED");
} else
$message = T_("NO_EMPTY_FIELDS");

if (!$message)
{

logincookie($row["id"], $row["password"], $row["secret"], $_POST["remember"]);
if (!empty($_POST["returnto"])) {
header("Refresh: 0; url=" . $_POST["returnto"]);
die();
}
else {
header("Refresh: 0; url=index.php");
die();
}
} else {

show_error_msg(T_("ACCESS_DENIED"), $message, 1);
}
}

logoutcookie();
//stdhead(T_("LOGIN"));
 if ($nowarn)
show_error_msg("Error", $nowarn, 0);
?>

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2023-06-29 22:54:16
2023-06-30 12:16:55
Thanks @MicroMonkey   🥰
but from some reason that part get me a blank login page ...


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2023-06-30 19:05:25
2023-07-01 15:39:28
unsure. Here is my entire login page. I use recaptcha and IP checks, but you can ignore that and see if you can mix and match some code to fit your needs. My HTML is different, so just look at the code and see if anything is useful for you. I dont knwo why you would see a blank page. I tested it and that isnt what I saw, but I am using custom code, so things may not match up always. This also has my terrible attempt at password visibility toggle. I like yours better. I will play with that more when I have more time.
<?php
//crap mainly. filter username and pass. Prepare, bind and other assorted stupid shit
require_once("backend/functions.php");
dbconn();
session_start();

$site_config["LEFTNAV"] = $site_config["MIDDLENAV"] = $site_config["RIGHTNAV"] = false;

if (isset($_POST["username"]) && isset($_POST["password"])) {
   if (!empty($_POST["username"]) && !empty($_POST["password"])) {
       $username = filter_var($_POST["username"], FILTER_SANITIZE_STRING);
       $password = filter_var($_POST["password"], FILTER_SANITIZE_STRING);
       $password_hash = passhash($password);

$stmt = $GLOBALS["DBconnector"]->prepare("SELECT id, password, secret, status, enabled FROM users WHERE username = ? LIMIT 1");
$stmt->bind_param("s", $username);
$stmt->execute();

if ($stmt->error) {
die("Query failed: " . $stmt->error);
}

$res = $stmt->get_result();
$row = $res->fetch_assoc();

if ($row) {
if ($row["password"] !== $password_hash) {
$message = T_("LOGIN_INCORRECT");
} elseif ($row["status"] === "pending") {
$message = T_("ACCOUNT_PENDING");
} elseif ($row["enabled"] === "no") {
$message = T_("ACCOUNT_DISABLED");
} else {
// CAPTCHA validation
if (isset($_POST['g-recaptcha-response'])) {
$captcha = $_POST['g-recaptcha-response'];
if (!$captcha) {
echo "<script>alert('Please Check the Captcha box');</script>";
} else {
$secretKey = $site_config['SECRET'];
$ip = $_SERVER['REMOTE_ADDR'];
$response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secretKey&response=$captcha&remoteip=$ip");
$response = json_decode($response);

if ($response->success === true) {
// Login successful
logincookie($row["id"], $row["password"], $row["secret"]);

// IP history edits
$now = get_date_time();
$stmt = $GLOBALS["DBconnector"]->prepare("INSERT INTO iplog (ip, userid, added, lastused) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE timesused=timesused+1, lastused=?");
$stmt->bind_param("sissi", getip(), $row["id"], $now, $now, $now);
$stmt->execute();

if (!empty($_POST["returnto"])) {
header("Location: " . $_POST["returnto"]);
} else {
header("Location: index.php");
}
die();
} else {
echo "<script>alert('CAPTCHA_INVALID');</script>";
}
}
} else {
echo "<script>alert('CAPTCHA_MISSING');</script>";
}

}
} else {
$message = T_("LOGIN_INCORRECT");
}
} else {
$message = T_("NO_EMPTY_FIELDS");
}

if ($message) {
show_error_msg(T_("ACCESS_DENIED"), $message, 1);
}
}

logoutcookie();
?>


<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title><?php echo $site_config['SITENAME']; ?></title>
   <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
   <link rel="stylesheet" type="text/css" href="css/fontawesome-all.min.css">
   <link rel="stylesheet" type="text/css" href="css/iofrm-style.css">
   <link rel="stylesheet" type="text/css" href="css/iofrm-theme14.css">
   <style>
       body {
           min-height: 100vh;
       }
   </style>
</head>
<body>
   <div class="form-body" class="container-fluid">
       <div class="row">
           <div class="form-holder">
               <div class="form-content">
                   <div class="form-items">
                       <div class="website-logo-inside">
                           <a href="index.html">
                           </a>
                       </div>
                       <h3>Please log in to your account.</h3>
                       <div class="page-links">
                           <a href="account-login.php" class="active">Login</a>
                           <a href="account-signup.php">Register</a>
                           <a href="account-recover.php">Recover Account</a>
                           <!-- <a href="contact.php">Contact us with problems</a> -->
                       </div>
                       <form method="post" action="account-login.php">
                           <input class="form-control" type="text" name="username" placeholder="Username" required>
                           <div class="password-container">
                               <input class="form-control" type="password" name="password" id="password" placeholder="Password" required>
                               <button type="button" id="togglePassword" class="password-toggle-btn" onclick="togglePasswordVisibility()">
                                   Show
                               </button>
                           </div>
                           <center><div class="g-recaptcha" data-theme="light" data-sitekey="<?php echo $site_config['SITEKEY']; ?>"></div></center>
                           <?php
                           if (!empty($_REQUEST["returnto"])) {
                               print("<input type=\"hidden\" name=\"returnto\" value=\"" . cleanstr($_REQUEST["returnto"]) . "\" />\n");
                           }
                           ?>
                           <div class="form-button">
                               <button id="submit" type="submit" class="ibtn">Login</button>
                           </div>
                       </form>
                   </div>
               </div>
           </div>
       </div>
   </div>

   <script type="text/javascript" src="js/jquery.min.js"></script>
   <script type="text/javascript" src="js/popper.min.js"></script>
   <script type="text/javascript" src="js/bootstrap.min.js"></script>
   <script type="text/javascript" src="js/main.js"></script>
   <script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script>
   function togglePasswordVisibility() {
       var passwordInput = document.getElementById("password");
       var toggleButton = document.getElementById("togglePassword");

       if (passwordInput.type === "password") {
           passwordInput.type = "text";
           toggleButton.textContent = "Hide";
       } else {
           passwordInput.type = "password";
           toggleButton.textContent = "Show";
       }
   }
</script>
</body>
</html>

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2023-07-01 15:42:45
2023-07-01 21:40:04
I just finished her style and everything is fine, a lot of file backups but I finally managed to get what I wanted.
Thanks again to all of you !
@Botanicar  👍
@STorrents2020  👍
@MicroMonkey 👍


2023-07-02 12:04:05
Glad to help you my friend, enjoy in LIFE


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2023-07-02 15:51:36
Good choice!
2023-07-02 17:34:14
oh, I apparently already updated github a while back for sql security on the username and password. https://github.com/MicrosoulV3/TorrentTrader-v3
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2023-07-02 17:59:11
Is there a problem with this word and I should know a security trick that I don't know?  😕
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728