[1.X.X] Housekeeping Release.

Status
Not open for further replies.

Jeffrey

Devbest Indian Tech Support
FindRetros Moderator
Feb 5, 2013
1,180
412
Guys Add this to your database:
Code:
ALTER TABLE `users` ADD `housekeeping_pin` VARCHAR(4)

Sledmore didnt have the Code, so i made one which will help other people faster.
------------------------
EDIT
You guys will manually have to add pins via User Table so you can actually get in.

@Donkeey

Don't Know if this will count as a doublepost, but
i made a table for the "Values"
If you use Sledmore's Housekeeping and want to use the page Values, Here is the sql which i made :)

Code:
SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for `values`
-- ----------------------------
DROP TABLE IF EXISTS `values`;
CREATE TABLE `values` (
  `name` varchar(100) NOT NULL,
  `imgurl` varchar(999) NOT NULL,
  `category` varchar(299) NOT NULL,
  `timestamp` int(255) NOT NULL,
  `start_amount` varchar(200) NOT NULL,
  `sold_amount` varchar(200) NOT NULL,
  `id` int(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
Last edited by a moderator:

SBste01

Member
Dec 16, 2013
44
3
The links in the thread, the "fix-them" ones, including the pastes and sqls have been reoved. I was wondering if you had any chance of keeping a spare seeing as I'm getting errors in different pages in my housekeeping. Thanks!
 

Jeffrey

Devbest Indian Tech Support
FindRetros Moderator
Feb 5, 2013
1,180
412
The links in the thread, the "fix-them" ones, including the pastes and sqls have been reoved. I was wondering if you had any chance of keeping a spare seeing as I'm getting errors in different pages in my housekeeping. Thanks!
I have them I think.. But it isnt that hard to make the sql's yourself...
 

Jeffrey

Devbest Indian Tech Support
FindRetros Moderator
Feb 5, 2013
1,180
412
I made the housekeeping_pin one by itself, but like.... I don't have the other stuff.
The Housekeeping Pin was already Provided in My Post ;)
If you want the Codes

Go to App -> Class.users.php and replace Your current final public function loginHK() with this one.
Code:
 final public function loginHK()
        {
                global $template, $_CONFIG, $core;
           
                if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }
           
                if(isset($_POST['login']))
                {   
                        $template->form->setData();
                        unset($template->form->error);
                   
                        if(isset($template->form->username) && isset($template->form->password) && isset($template->form->pincode))
                        {
                                if($this->nameTaken($template->form->username))
                                {     
                                        if($this->userValidation($template->form->username, $core->hashed($template->form->password)))
                                        {
                                                if($this->pinValidation($template->form->username, $core->hashed($template->form->password), $template->form->pincode))
                                                {                           
                                                        if(($this->getInfo($_SESSION['user']['id'], 'rank')) >= $_CONFIG['housekeeping']['rank'])
                                                        {
                                                                mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Success Login: Username: ".$template->form->username."')") or die(mysql_error());
                                                                $_SESSION["in_hk"] = true;
                                                                $_SESSION["pincode_set"] = true;
                                                                header("Location:".$_CONFIG['hotel']['url']."/ase/index.php?url=dash");
                                                                exit;
                                                        }
                                                        else
                                                        {
                                                                mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Failed to login: Incorrect level.')") or die(mysql_error());
                                                                $template->form->error = 'Incorrect access level.';
                                                                return;
                                                        }
                                                }
                                                else
                                                {
                                                        mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Failed to login: Wrong Pincode')") or die(mysql_error());
                                                        $template->form->error = 'Incorrect pincode.';
                                                        return;
                                                }   
                                        }
                                        else
                                        {
                                                mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Failed to login: Wrong Password')") or die(mysql_error());
                                                $template->form->error = 'Incorrect password.';
                                                return;
                                        }           
                                }
                                else
                                {
                                        mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Failed to login: No such user')") or die(mysql_error());
                                        $template->form->error = 'User does not exist.';
                                        return;
                                }
                        }
                        else
                        {
                                mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Failed to login: Missing fields.')") or die(mysql_error());
                                $template->form->error = 'Something was missing..';
                                return;
                        }
   
                        $template->form->unsetData();
                }
        }
        final public function pinValidation($username, $password, $pincode)
        {           
                global $engine;
                if($engine->num_rows("SELECT * FROM users WHERE username = '" . $username . "' AND password = '" . $password . "' AND housekeeping_pin = '" . $pincode . "' LIMIT 1") > 0)
                {
                        return true;
                }   
             
                return false;
        }
Code:
/*
Navicat MySQL Data Transfer

Source Server        : jeffreymathew.in_3306
Source Server Version : 50172
Source Host          : jeffreymathew.in:3306
Source Database      : jeffreym_habbo

Target Server Type    : MYSQL
Target Server Version : 50172
File Encoding        : 65001

Date: 2014-02-20 19:31:29
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for cms_housekeeping_logs
-- ----------------------------
DROP TABLE IF EXISTS `cms_housekeeping_logs`;
CREATE TABLE `cms_housekeeping_logs` (
  `id` int(100) NOT NULL,
  `userid` int(99) DEFAULT NULL,
  `ip_address` varchar(255) DEFAULT NULL,
  `page` varchar(255) DEFAULT NULL,
  `time` datetime DEFAULT NULL,
  `extra_data` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of cms_housekeeping_logs
-- ----------------------------
The Sql was made out from my head because i lost the original one :3 None the less this should work.
 
Last edited:

iExplicit

Member
Jul 30, 2013
140
23
For anyone who is looking for the cms_housekeeping_logs SQL

Here it is:

Code:
DROP TABLE IF EXISTS `cms_housekeeping_logs`;
CREATE TABLE `cms_housekeeping_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` int(11) DEFAULT NULL,
  `ip_address` varchar(125) DEFAULT NULL,
  `page` varchar(50) DEFAULT NULL,
  `time` varchar(75) DEFAULT NULL,
  `extra_data` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=306 DEFAULT CHARSET=latin1;
 

Jeffrey

Devbest Indian Tech Support
FindRetros Moderator
Feb 5, 2013
1,180
412
For anyone who is looking for the cms_housekeeping_logs SQL

Here it is:

Code:
DROP TABLE IF EXISTS `cms_housekeeping_logs`;
CREATE TABLE `cms_housekeeping_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` int(11) DEFAULT NULL,
  `ip_address` varchar(125) DEFAULT NULL,
  `page` varchar(50) DEFAULT NULL,
  `time` varchar(75) DEFAULT NULL,
  `extra_data` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=306 DEFAULT CHARSET=latin1;
Thanks i forgot it was cms_housekeping_logs xD The quoted post is the recommended SQL In order to run [1.X.X]
 

Tando

Norwegian Steam Engine
Oct 23, 2011
83
5
Pastebin says the paste has been removed. Can anyone provide what I'll need to set this up? :)
 

Jeffrey

Devbest Indian Tech Support
FindRetros Moderator
Feb 5, 2013
1,180
412
Pastebin says the paste has been removed. Can anyone provide what I'll need to set this up? :)
The Housekeeping Pin was already Provided in My Post ;)
If you want the Codes

Go to App -> Class.users.php and replace Your current final public function loginHK() with this one.
Code:
 final public function loginHK()
        {
                global $template, $_CONFIG, $core;
          
                if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }
          
                if(isset($_POST['login']))
                {  
                        $template->form->setData();
                        unset($template->form->error);
                  
                        if(isset($template->form->username) && isset($template->form->password) && isset($template->form->pincode))
                        {
                                if($this->nameTaken($template->form->username))
                                {    
                                        if($this->userValidation($template->form->username, $core->hashed($template->form->password)))
                                        {
                                                if($this->pinValidation($template->form->username, $core->hashed($template->form->password), $template->form->pincode))
                                                {                          
                                                        if(($this->getInfo($_SESSION['user']['id'], 'rank')) >= $_CONFIG['housekeeping']['rank'])
                                                        {
                                                                mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Success Login: Username: ".$template->form->username."')") or die(mysql_error());
                                                                $_SESSION["in_hk"] = true;
                                                                $_SESSION["pincode_set"] = true;
                                                                header("Location:".$_CONFIG['hotel']['url']."/ase/index.php?url=dash");
                                                                exit;
                                                        }
                                                        else
                                                        {
                                                                mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Failed to login: Incorrect level.')") or die(mysql_error());
                                                                $template->form->error = 'Incorrect access level.';
                                                                return;
                                                        }
                                                }
                                                else
                                                {
                                                        mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Failed to login: Wrong Pincode')") or die(mysql_error());
                                                        $template->form->error = 'Incorrect pincode.';
                                                        return;
                                                }  
                                        }
                                        else
                                        {
                                                mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Failed to login: Wrong Password')") or die(mysql_error());
                                                $template->form->error = 'Incorrect password.';
                                                return;
                                        }          
                                }
                                else
                                {
                                        mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Failed to login: No such user')") or die(mysql_error());
                                        $template->form->error = 'User does not exist.';
                                        return;
                                }
                        }
                        else
                        {
                                mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'Housekeeping Login', '".time()."', 'Failed to login: Missing fields.')") or die(mysql_error());
                                $template->form->error = 'Something was missing..';
                                return;
                        }
  
                        $template->form->unsetData();
                }
        }
        final public function pinValidation($username, $password, $pincode)
        {          
                global $engine;
                if($engine->num_rows("SELECT * FROM users WHERE username = '" . $username . "' AND password = '" . $password . "' AND housekeeping_pin = '" . $pincode . "' LIMIT 1") > 0)
                {
                        return true;
                }  
            
                return false;
        }
Code:
/*
Navicat MySQL Data Transfer

Source Server        : jeffreymathew.in_3306
Source Server Version : 50172
Source Host          : jeffreymathew.in:3306
Source Database      : jeffreym_habbo

Target Server Type    : MYSQL
Target Server Version : 50172
File Encoding        : 65001

Date: 2014-02-20 19:31:29
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for cms_housekeeping_logs
-- ----------------------------
DROP TABLE IF EXISTS `cms_housekeeping_logs`;
CREATE TABLE `cms_housekeeping_logs` (
  `id` int(100) NOT NULL,
  `userid` int(99) DEFAULT NULL,
  `ip_address` varchar(255) DEFAULT NULL,
  `page` varchar(255) DEFAULT NULL,
  `time` datetime DEFAULT NULL,
  `extra_data` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of cms_housekeeping_logs
-- ----------------------------
The Sql was made out from my head because i lost the original one :3 None the less this should work.
 

Tando

Norwegian Steam Engine
Oct 23, 2011
83
5
I get the error message: Field 'id' doesn't have a default value
When trying to add bans, give badges etc. Can someone please hlep? :)
 

Tando

Norwegian Steam Engine
Oct 23, 2011
83
5
Still having problems with this lads. Anyone who might be able to help me?
 

Baevus

the names ethan
Nov 4, 2012
565
47
Really old but Field 'big_image' doesn't have a default value in the second part of news.
 

Jeffrey

Devbest Indian Tech Support
FindRetros Moderator
Feb 5, 2013
1,180
412
Really old but Field 'big_image' doesn't have a default value in the second part of news.
What database are you using? Rev63(b) and/or what emulator. I'll give you a fix when i come back from a place :)
 
Status
Not open for further replies.

Users who are viewing this thread

Top