<?php
session_start();
if(!isset($_SESSION["uid"])){
	header("Location: /login");
	die();
}

include("include/header.php");
include("include/settings.php");


$db = new SQLite3('ask.db');

?>
<!DOCTYPE html>
<html>
<head>

<title>Config | LibreCat</title>
<?php include("themes/$theme_name/config.php"); ?>

</head>
<body>

<h1>Config</h1>

<p>
	For now this section is under construction, but
	I have activated it to log vinculate accounts with
	Twitter.
</p>

<?php
if(!$db->querySingle("SELECT tw_oauth_verify FROM users where id = " . $_SESSION["uid"] . ";")){
	echo "<p><a href='/action/tw-login.php'>Login with Twitter</a></p>";
}
else echo "<p><a href='/action/tw-post-sample'>Post test tweet</a>";
?>

</body>
</html>
