uawdijnntqw1x1x1
IP : 3.17.176.127
Hostname : ns1.eurodns.top
Kernel : Linux ns1.eurodns.top 4.18.0-553.5.1.lve.1.el7h.x86_64 #1 SMP Fri Jun 14 14:24:52 UTC 2024 x86_64
Disable Function : mail,sendmail,exec,passthru,shell_exec,system,popen,curl_multi_exec,show_source,eval,open_base
OS : Linux
PATH:
/
home
/
sudancam
/
public_html
/
..
/
.trash
/
wp-pagenavi.1
/
..
/
system.1
/
library
/
cart
/
user.php
/
/
<?php namespace Opencart\System\Library\Cart; class User { private $user_id; private $username; private $user_group_id; private $permission = []; public function __construct($registry) { $this->db = $registry->get('db'); $this->request = $registry->get('request'); $this->session = $registry->get('session'); if (isset($this->session->data['user_id'])) { $user_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "user` WHERE `user_id` = '" . (int)$this->session->data['user_id'] . "' AND `status` = '1'"); if ($user_query->num_rows) { $this->user_id = $user_query->row['user_id']; $this->username = $user_query->row['username']; $this->user_group_id = $user_query->row['user_group_id']; $this->db->query("UPDATE `" . DB_PREFIX . "user` SET `ip` = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "' WHERE `user_id` = '" . (int)$this->session->data['user_id'] . "'"); $user_group_query = $this->db->query("SELECT `permission` FROM `" . DB_PREFIX . "user_group` WHERE `user_group_id` = '" . (int)$user_query->row['user_group_id'] . "'"); $permissions = json_decode($user_group_query->row['permission'], true); if (is_array($permissions)) { foreach ($permissions as $key => $value) { $this->permission[$key] = $value; } } } else { $this->logout(); } } } public function login($username, $password) { $user_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "user` WHERE `username` = '" . $this->db->escape($username) . "' AND `status` = '1'"); if ($user_query->num_rows) { if (password_verify($password, $user_query->row['password'])) { $rehash = password_needs_rehash($user_query->row['password'], PASSWORD_DEFAULT); } elseif (isset($user_query->row['salt']) && $user_query->row['password'] == sha1($user_query->row['salt'] . sha1($user_query->row['salt'] . sha1($password)))) { $rehash = true; } elseif ($user_query->row['password'] == md5($password)) { $rehash = true; } else { return false; } if ($rehash) { $this->db->query("UPDATE `" . DB_PREFIX . "user` SET `password` = '" . $this->db->escape(password_hash($password, PASSWORD_DEFAULT)) . "' WHERE `user_id` = '" . (int)$user_query->row['user_id'] . "'"); } $this->session->data['user_id'] = $user_query->row['user_id']; $this->user_id = $user_query->row['user_id']; $this->username = $user_query->row['username']; $this->user_group_id = $user_query->row['user_group_id']; $user_group_query = $this->db->query("SELECT `permission` FROM `" . DB_PREFIX . "user_group` WHERE `user_group_id` = '" . (int)$user_query->row['user_group_id'] . "'"); $permissions = json_decode($user_group_query->row['permission'], true); if (is_array($permissions)) { foreach ($permissions as $key => $value) { $this->permission[$key] = $value; } } return true; } else { return false; } } public function logout() { unset($this->session->data['user_id']); $this->user_id = ''; $this->username = ''; } public function hasPermission($key, $value) { if (isset($this->permission[$key])) { return in_array($value, $this->permission[$key]); } else { return false; } } public function isLogged() { return $this->user_id; } public function getId() { return $this->user_id; } public function getUserName() { return $this->username; } public function getGroupId() { return $this->user_group_id; } }
/home/sudancam/public_html/../.trash/wp-pagenavi.1/../system.1/library/cart/user.php