X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;f=index.php;h=3f64a27ddede8d88af26808b788ebc95b0b9b0c6;hb=0a144953e57bf457df61e58a3f94b0178c1f9707;hp=700f69a182a9cb0d81bd7b72821a8dbc57195337;hpb=f870b65ad60d8ea7456384d38f8db6fd01275990;p=dylansserver.git diff --git a/index.php b/index.php index 700f69a..3f64a27 100644 --- a/index.php +++ b/index.php @@ -3,19 +3,23 @@ abstract class cms { private $config_file = '/etc/dylanstestserver.ini'; protected $db; + protected $recaptcha_publickey; + protected $recaptcha_privatekey; public function __construct() { - $config = parse_ini_file($this->config_file); + $config = parse_ini_file($this->config_file, true); $this->db = new mysqli( - $config['domain'], - $config['user'], - $config['password'], - $config['database']); + $config[database]['domain'], + $config[database]['user'], + $config[database]['password'], + $config[database]['database']); if (mysqli_connect_errno()) { echo "Problem connecting to database: "; echo mysqli_connect_error(); exit(); } + $this->recaptcha_publickey = $config[recaptcha]['publickey']; + $this->recaptcha_privatekey = $config[recaptcha]['privatekey']; ob_start(); } @@ -30,7 +34,10 @@ abstract class cms { return 'index'; } else if (isset($_GET['project'])) { return 'project'; + } else if (isset($_GET['challenge'])) { + return 'captcha'; } + } public function query() { @@ -51,7 +58,7 @@ abstract class cms { call_user_func_array("mysqli_stmt_bind_result", $fields); $i = 0; while ($statement->fetch()) { - foreach ($row as $key1=>$value1) $return[$i][$key1] = $value1; + foreach ($row as $key=>$value) $return[$i][$key] = $value; $i++; } $statement->free_result(); @@ -63,8 +70,13 @@ abstract class cms { $scripts = ""; $stylesheets = ""; if (cms::determine_type() == "index") { - $scripts = ""; $home_link = "http://validator.w3.org/unicorn/check?ucn_uri=dylanstestserver.com&ucn_task=conformance#"; + } else if ($this->determine_type() == 'note') { + $scripts = ""; + $scripts .= ""; + $scripts .= ""; + $scripts .= ""; } echo <<