diff --git a/admin/install.php b/admin/install.php
index 471b5c9e..a2da67f5 100644
--- a/admin/install.php
+++ b/admin/install.php
@@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-16 23:01:33
* @Last Modified by: prpr
- * @Last Modified time: 2016-02-03 15:45:46
+ * @Last Modified time: 2016-02-03 15:51:27
*
* Create tables automatically
*/
@@ -35,12 +35,12 @@ if (!file_exists("./install.lock")) {
`preference` varchar(10) NOT NULL,
`skin_hash` varchar(64) NOT NULL,
`cape_hash` varchar(64) NOT NULL,
- `last_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+ `last_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15;";
if(!$conn->query($sql)) {
- utils::raise(1, "Creating tables failed. ".$conn->error);
+ die("Creating tables failed.
".$conn->error);
}
/**
@@ -62,8 +62,8 @@ if (!file_exists("./install.lock")) {
";
if (!is_dir("../textures/")) {
- echo mkdir("../textures/") ? "Creating textures directory..." :
- "Creating textures directory failed."
+ echo mkdir("../textures/") ? "Creating textures directory...
" :
+ "Creating textures directory failed. Check permissons.
";
}
echo "Successfully installed. Index";
diff --git a/includes/user.class.php b/includes/user.class.php
index 78e01850..934dd428 100644
--- a/includes/user.class.php
+++ b/includes/user.class.php
@@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-16 23:01:33
* @Last Modified by: prpr
- * @Last Modified time: 2016-02-03 14:00:51
+ * @Last Modified time: 2016-02-03 15:52:29
*/
class user
@@ -77,7 +77,6 @@ class user
$data = fread(fopen($filename, 'r'), filesize($filename));
return $data;
} else {
- header('Content-type: application/json');
utils::raise(-1, 'Texture no longer exists.');
}
}
diff --git a/includes/utils.class.php b/includes/utils.class.php
index 1c3cae2d..96779cbd 100644
--- a/includes/utils.class.php
+++ b/includes/utils.class.php
@@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-16 23:01:33
* @Last Modified by: prpr
- * @Last Modified time: 2016-02-03 10:41:31
+ * @Last Modified time: 2016-02-03 15:52:39
*/
class utils
@@ -18,6 +18,7 @@ class utils
public static function raise($errno = -1, $msg = "Error occured.") {
$exception['errno'] = $errno;
$exception['msg'] = $msg;
+ header('Content-type: application/json');
die(json_encode($exception));
}