fixed for next update and torrent import :D
if (is_array($row)) {
if (password_verify($passwd, $row['password'])) {
/* Check if password needs rehashing, if so then continue */
if (password_needs_rehash(sha1($row['password']), PASSWORD_DEFAULT)) {
/* Rehash existing password algorithm to BCRYPT and update */
$newhash = password_hash($passwd, PASSWORD_BCRYPT);
try {
$stmt = $pdo->prepare("UPDATE users SET password = ?, last_access = NOW(), last_login = NOW() WHERE user_id = ?");
$stmt->execute([$newhash, $row['user_id']]);
}
catch (PDOException $e) {
/* If there is a PDO exception, throw a STAccountsException exception. */
$STe = new STAccountsException($e);
$STe->setVarData(['query' => 'UPDATE users SET password = ?, last_access = NOW(), last_login = NOW() WHERE user_id = ?', 'values' => [$newhash, $row['user_id']]]);
throw $STe;
}
}
}
Quote:- How to create custom "card-header" and "card-body" for your login/recover/signup pages?
$this->view('user/login', $data, 'user');$this->view('user/login', $data, 'admin');$this->view('user/login', $data); <div class="row justify-content-center">
<form method="post" action="<?php echo URLROOT; ?>/login/submit" autocomplete="off">
<input type="hidden" name="token" value="<?php echo Token::generate(); ?>" />
<div class="form-group">
<label for="username"><?php echo Lang::T("USERNAME"); ?></label>
<input id="username" type="text" class="form-control" name="username" minlength="3" maxlength="25" required autofocus>
</div>
<div class="form-group">
<label for="password"><?php echo Lang::T("PASSWORD"); ?></label>
<input id="password" type="password" class="form-control" name="password" minlength="6" maxlength="16" required data-eye>
</div>
<div class="form-group">
<?php (new Captcha)->html(); ?>
<button type="submit" class="btn btn-warning btn-block"><?php echo Lang::T("LOGIN"); ?></button>
<center><i><?php echo Lang::T("COOKIES"); ?></i></center>
</div>
<div class="margin-top20 text-center">
<a href="<?php echo URLROOT; ?>/signup"><?php echo Lang::T("SIGNUP"); ?></a> |
<a href="<?php echo URLROOT; ?>/recover"><?php echo Lang::T("RECOVER_ACCOUNT"); ?></a>
</div>
</form>
</div>
Style::header($data['title']);
Style::begin($data['title']);
<div class="row justify-content-center">
<form method="post" action="<?php echo URLROOT; ?>/login/submit" autocomplete="off">
<input type="hidden" name="token" value="<?php echo Token::generate(); ?>" />
<div class="form-group">
<label for="username"><?php echo Lang::T("USERNAME"); ?></label>
<input id="username" type="text" class="form-control" name="username" minlength="3" maxlength="25" required autofocus>
</div>
<div class="form-group">
<label for="password"><?php echo Lang::T("PASSWORD"); ?></label>
<input id="password" type="password" class="form-control" name="password" minlength="6" maxlength="16" required data-eye>
</div>
<div class="form-group">
<?php (new Captcha)->html(); ?>
<button type="submit" class="btn btn-warning btn-block"><?php echo Lang::T("LOGIN"); ?></button>
<center><i><?php echo Lang::T("COOKIES"); ?></i></center>
</div>
<div class="margin-top20 text-center">
<a href="<?php echo URLROOT; ?>/signup"><?php echo Lang::T("SIGNUP"); ?></a> |
<a href="<?php echo URLROOT; ?>/recover"><?php echo Lang::T("RECOVER_ACCOUNT"); ?></a>
</div>
</form>
</div>
Style::end();
Style::footer();
<?php
class U2
{
public static function begin($caption = "-", $align = "justify")
{
$blockId = 'f-' . sha1($caption);
?>
<div class="card">
<div class="card-header">
<?php echo $caption ?>
<a data-toggle="collapse" href="#" class="showHide" id="<?php echo $blockId; ?>" style="float: right;"></a>
</div>
<div class="card-body slidingDiv<?php echo $blockId; ?>">
<?php
}
public static function end()
{
?>
</div>
</div>
<?php
}
Style::header($data['title']);
U2::begin($data['title']);
// login template code
U2::end();
Style::footer();
on 2021-06-09 17:57:38
$data = [
'title' => Lang::T("LOGIN")
];
$this->view('user/login', $data, 'user');$bigdata[
'lppostid' => $arr["id"],
'topic_userid' = $topicarr["userid"],
etc.............
] foreach ($data['topicsres'] as $topicarr) {
$topicid = $topicarr["id"];
$topic_userid = $topicarr["userid"];
$locked = $topicarr["locked"] == "yes";
$moved = $topicarr["moved"] == "yes";
$sticky = $topicarr["sticky"] == "yes";
//---- Get reply count
$res = DB::run("SELECT COUNT(*) FROM forum_posts WHERE topicid=$topicid");
$arr = $res->fetch(PDO::FETCH_LAZY);
$posts = $arr[0];
$replies = max(0, $posts - 1);
//---- Get userID and date of last post
$res = DB::run("SELECT * FROM forum_posts WHERE topicid=$topicid ORDER BY id DESC LIMIT 1");
$arr = $res->fetch(PDO::FETCH_ASSOC);
$lppostid = $arr["id"];
$lpuserid = (int) $arr["userid"];
$lpadded = TimeDate::utc_to_tz($arr["added"]);
//------ Get name of last poster
if ($lpuserid > 0) {
$res = DB::run("SELECT * FROM users WHERE id=$lpuserid");
if ($res->rowCount() == 1) {
$arr = $res->fetch(PDO::FETCH_ASSOC);
$lpusername = "<a href='" . URLROOT . "/profile?id=$lpuserid'>" . Users::coloredname($arr['username']) . "</a>";
} else {
$lpusername = "Deluser";
}
} else {
$lpusername = "Deluser";
}
//------ Get author
if ($topic_userid > 0) {
$res = DB::run("SELECT username FROM users WHERE id=$topic_userid");
if ($res->rowCount() == 1) {
$arr = $res->fetch(PDO::FETCH_ASSOC);
$lpauthor = "<a href='" . URLROOT . "/profile?id=$topic_userid'>" . Users::coloredname($arr['username']) . "</a>";
} else {
$lpauthor = "Deluser";
}
} else {
$lpauthor = "Deluser";
}
// Topic Views
$viewsq = DB::run("SELECT views FROM forum_topics WHERE id=$topicid");
$viewsa = $viewsq->fetch(PDO::FETCH_LAZY);
$views = $viewsa[0];
// End
//---- Print row
if ($_SESSION) {
$r = DB::run("SELECT lastpostread FROM forum_readposts WHERE userid=$_SESSION[id] AND topicid=$topicid");
$a = $r->fetch(PDO::FETCH_LAZY);
}
$new = !$a || $lppostid > $a[0];
$topicpic = ($locked ? ($new ? "folder_locked_new" : "folder_locked") : ($new ? "folder_new" : "folder"));
$subject = ($sticky ? "<b>" . Lang::T("FORUMS_STICKY") . ": </b>" : "") . "<a href='" . URLROOT . "/topic?topicid=$topicid'><b>" .
encodehtml(stripslashes($topicarr["subject"])) . "</b></a>$topicpages";
?>
print_r($data['topicsres'])
<?
$myarray1 = [];
foreach ($data['topicsres'] as $topicarr) {
$data['topicid'] = $topicarr["id"];
$data['topic_userid'] = $topicarr["userid"];
$data['locked'] = $topicarr["locked"] == "yes";
array_push($myarray1, $data);
}
print_r($myarray1);
No users online
Torrents
Members
Online