Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * WebControlSystem V1.0
- * Credits to Steve Winfield
- *
- * All rights reserved.
- **/
- if (!defined ('ON_PAGE'))
- exit ('Access not allowed.');
- /**
- * @seel model
- **/
- class User_Model extends Security_Model {
- public function __construct() {
- parent::__construct();
- }
- public function updateUserMotto($id, $motto) {
- if (!$this->driver->connected)
- $this->driver->connect();
- if ($stm = $this->driver->prepare('UPDATE users SET motto = ? WHERE id = '. (int)$id)) {
- $stm->bind_param('s', $motto);
- $stm->execute();
- } else {
- Core::error($this->driver->error);
- }
- }
- public function setUser($user, $userId, $userPass) {
- if (!$this->driver->connected)
- $this->driver->connect();
- if ($stm = $this->driver->prepare('SELECT id, username, real_name, password, look, credits, activity_points, vip_points, motto FROM users WHERE id = ? AND password = ? ORDER BY id DESC LIMIT 1')) {
- $stm->bind_param('is', $userId, $userPass);
- $stm->execute();
- $stm->store_result();
- if ($stm->num_rows > 0) {
- $stm->bind_result($user->Id, $user->Name, $user->RealName, $user->Password, $user->Figure, $user->Credits, $user->Pixels, $user->Shells, $user->Motto);
- $stm->fetch();
- return TRUE;
- } else {
- return FALSE;
- }
- } else {
- Core::error ($this->driver->error);
- return FALSE;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement