function login($params) { global $MW, $project; $success = 1; if (empty($params)) { return false; } if (empty($params['username'])) { output_message('alert', 'You did not provide your username'); $success = 0; } if (empty($params['sha_pass_hash'])) { output_message('alert', 'You did not provide your password'); $success = 0; } $res = $this->DB->selectRow("\r\n SELECT `id`,`username`,`sha_pass_hash`,`locked` FROM `account`\r\n WHERE `username` = ?", $params['username']); if ($res['id'] < 1) { $success = 0; output_message('alert', 'Bad username'); } if (get_banned($res[id], 1) == TRUE) { output_message('alert', 'Your account is currently banned'); $success = 0; } if ($res['activation_code'] != null) { output_message('alert', 'Your account is not active'); $success = 0; } if ($success != 1) { return false; } if (strtoupper($res['sha_pass_hash']) == strtoupper($params['sha_pass_hash'])) { $this->user['id'] = $res['id']; $this->user['name'] = $res['username']; // $this->user['level'] = $res2; $generated_key = $this->generate_key(); addOrUpdateAccountKeys($res['id'], $generated_key); $uservars_hash = serialize(array($res['id'], $generated_key)); $cookie_expire_time = intval($MW->getConfig->generic->account_key_retain_length); if (!$cookie_expire_time) { $cookie_expire_time = 60 * 60 * 24 * 365; //default is 1 year } (string) ($cookie_name = $MW->getConfig->generic->site_cookie); (string) ($cookie_href = $MW->getConfig->temp->site_href); (int) ($cookie_delay = time() + $cookie_expire_time); setcookie($cookie_name, $uservars_hash, $cookie_delay, $cookie_href); if ((int) $MW->getConfig->generic->onlinelist_on) { $this->onlinelist_delguest(); } // !! return true; } else { output_message('alert', 'Your password is incorrect'); return false; } }
<div class="col-sm-9"> <input type="text" class="form-control" value="' . $row['page'] . '" readonly /><br /> </div> <label class="col-sm-3 control-label"><i class="fa fa-external-link"></i> Referer URL: </label> <div class="col-sm-9"> <input type="text" class="form-control" value="' . $row['referer_url'] . '" readonly /><br /> </div> </div> </div> <footer class="panel-footer"> <div class="row"> <div class="row"> <div class="col-md-8 text-left"> '; if (get_banned($row['ip']) == 'Yes') { echo ' <a href="bans-ip?delete-id=' . get_bannedid($row['ip']) . '" class="btn btn-success">Unban</a> '; } else { echo ' <a href="bans-ip?ip=' . $row['ip'] . '&reason=' . $row['type'] . '" class="btn btn-warning">Ban</a> '; } echo ' <a href="logs?delete-id=' . $row['id'] . '" class="btn btn-danger">Delete</a> </div> <div class="col-md-4 text-right"> <button class="btn btn-default modal-dismiss">Close</button> </div> </div>