i apparently changed shit

This commit is contained in:
flash 2015-03-08 07:11:57 +01:00
parent 6a2a1a01be
commit 3a25026c5c
3 changed files with 16 additions and 2 deletions

View file

@ -12,17 +12,20 @@ class Configuration {
// Constructor
public static function init($local) {
// Store $local in $_LCNF
if(is_array($local))
self::$_LCNF = $local;
else
die('<h1>Failed to initialise configuration.</h1>');
}
// Initialise Database configuration values.
// Different from __construct as that is called before the database connection is initially
// established
public static function initDB() {
$_DATA = Database::fetch('config', true);
$_DBCN = array();
@ -30,10 +33,12 @@ class Configuration {
$_DBCN[$_CONF[0]] = $_CONF[1];
self::$_DCNF = $_DBCN;
}
// Get values from the configuration on the file system
public static function getLocalConfig($key, $subkey = null) {
if(array_key_exists($key, self::$_LCNF)) {
if($subkey)
return self::$_LCNF[$key][$subkey];
@ -41,10 +46,12 @@ class Configuration {
return self::$_LCNF[$key];
} else
return null;
}
// Dynamically set local configuration values, does not update the configuration file
public static function setLocalConfig($key, $subkey, $value) {
if($subkey) {
if(!isset(self::$_LCNF[$key])) {
self::$_LCNF[$key] = array();
@ -53,14 +60,17 @@ class Configuration {
} else {
self::$_LCNF[$key] = $value;
}
}
// Get values from the configuration in the database
public static function getConfig($key) {
if(array_key_exists($key, self::$_DCNF))
return self::$_DCNF[$key];
return self::$_DCNF[$key];
else
return null;
}
}

View file

@ -74,6 +74,7 @@ class Flashii {
// Error Handler
public static function ErrorHandler($errno, $errstr, $errfile, $errline) {
// Set some variables to work with including A HUGE fallback hackjob for the templates folder
$errstr = str_replace(self::getConfig('etc', 'localPath'), '', $errstr);
$errfile = str_replace(self::getConfig('etc', 'localPath'), '', $errfile);
@ -111,11 +112,14 @@ class Flashii {
// Die and display error message
die($error);
}
// Legacy password hashing to be able to validate passwords from users on the old backend.
public static function legacyPasswordHash($data) {
return hash('sha512', strrev(hash('sha512', $data)));
}
}

View file

@ -11,7 +11,7 @@ $fiiConf['db']['port'] = 3306;
$fiiConf['db']['username'] = 'flashii';
$fiiConf['db']['password'] = 'Ky2YQMr4vu4zcZE&yLZT!gQ&Wdf-CxrQLej+^PS6jS5AgAQh52yf6Br&mq-C8J=F3Yw$3wnMU7?ebA9r+Abe4J_kzzs57C8U22&#wytuf-veF9WEuHfP-GRHQ^?5pXbx';
$fiiConf['db']['database'] = 'flashii';
$fiiConf['db']['prefix'] = 'flashii_';
$fiiConf['db']['prefix'] = 'fii_';
// URLs (for modularity)
$fiiConf['urls']['main'] = 'iihsalf.net';