From ea46bd0a4a040040c9cadd45441089bce9769bea Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Thu, 16 Feb 2017 03:07:26 -0500 Subject: Rm old content --- examples/class/setting.class.php | 90 ---------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 examples/class/setting.class.php (limited to 'examples/class/setting.class.php') diff --git a/examples/class/setting.class.php b/examples/class/setting.class.php deleted file mode 100644 index c0965a3..0000000 --- a/examples/class/setting.class.php +++ /dev/null @@ -1,90 +0,0 @@ -esc($key); - - $query = "SELECT `value` FROM `setting` WHERE `key` = '" . $escdKey . "'"; - $res = $db->query($query); - - if (count($res) == 0) - return false; - - return $res[0]['value']; - } - - /* - * Helper function for setting setting values on the database - */ - static function setValue($key, $value) - { - $db = parent::getDbConnection(); - $escdKey = $db->esc($key); - $escdValue = $db->esc($value); - - if (self::getValue($key) === false) - $query = "INSERT INTO setting (`key`, value) VALUES('" . $escdKey . "', '" . $escdValue . "')"; - else - $query = "UPDATE setting SET value = '" . $escdValue . "' WHERE `key` = '" . $escdKey . "'"; - - $db->query($query); - } - - /* - * Force or forbid SSL connections? - */ - static function settSSL($value = null) - { - $opt = "settSSL"; - - if ($value != null) - self::setValue($opt, $value); - - $value = self::getValue($opt); - - if ($value === false) - return "neither"; - - return $value; - } - - /* - * Should the app allow the public to signup their own accounts with Scrott? - */ - static function allowPublicSignup($value = null) - { - $opt = "allowPublicSignup"; - - if ($value != null) - self::setValue($opt, $value); - - return self::getValue($opt); - } -} - -?> -- cgit v1.2.3