2020-05-21 15:57:59 +00:00
|
|
|
<?php
|
2020-08-16 05:54:12 +00:00
|
|
|
session_start();
|
|
|
|
if(!isset($_SESSION["uid"])){
|
|
|
|
header("Location: /login");
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
|
2020-05-21 17:19:38 +00:00
|
|
|
include("include/header.php");
|
2020-05-31 10:39:08 +00:00
|
|
|
include("include/settings.php");
|
2020-08-16 05:54:12 +00:00
|
|
|
|
|
|
|
$db = new SQLite3('ask.db');
|
2020-05-21 15:57:59 +00:00
|
|
|
|
2020-08-30 20:21:57 +00:00
|
|
|
$p_user = $db->query("SELECT * FROM users WHERE username = '" . $_GET["q"] . "';")->fetchArray(SQLITE3_ASSOC);
|
|
|
|
//var_dump($p_user);
|
|
|
|
|
2020-05-21 15:57:59 +00:00
|
|
|
?>
|
2020-05-31 10:39:08 +00:00
|
|
|
<!DOCTYPE html>
|
2020-05-21 15:57:59 +00:00
|
|
|
<html>
|
2020-05-31 10:39:08 +00:00
|
|
|
<head>
|
|
|
|
|
|
|
|
<title>Config | LibreCat</title>
|
|
|
|
<?php include("themes/$theme_name/config.php"); ?>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
2020-08-30 20:21:57 +00:00
|
|
|
<div class="main-container">
|
|
|
|
<h1 class="title">Config</h1>
|
|
|
|
|
|
|
|
<div class="section">
|
2020-10-29 20:49:43 +00:00
|
|
|
<h2>Posting to social networks</h2>
|
|
|
|
<p>Work in progress, but it works.</p>
|
|
|
|
|
|
|
|
<?php // Login with twitter button
|
2020-08-16 05:54:12 +00:00
|
|
|
if(!$db->querySingle("SELECT tw_oauth_verify FROM users where id = " . $_SESSION["uid"] . ";")){
|
2020-10-29 20:49:43 +00:00
|
|
|
|
2020-08-16 05:54:12 +00:00
|
|
|
echo "<p><a href='/action/tw-login.php'>Login with Twitter</a></p>";
|
|
|
|
}
|
2020-08-30 20:21:57 +00:00
|
|
|
else{
|
|
|
|
echo "<p><a href='/action/tw-post-sample'>Post test tweet</a></p>";
|
|
|
|
echo "<br/>";
|
|
|
|
echo "</p><a href='/action/tw-unlink.php'>Unlink account</a></p>";
|
|
|
|
}
|
2020-08-16 05:54:12 +00:00
|
|
|
?>
|
2020-10-29 20:49:43 +00:00
|
|
|
|
|
|
|
<?php //Login with mastodon pleroma
|
|
|
|
if(!$db->querySingle("SELECT tw_oauth_verify FROM users where id = " . $_SESSION["uid"] . ";")){
|
|
|
|
|
|
|
|
echo "<p><a href='/action/tw-login.php'>Login with Mastodon</a></p>";
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
echo "<p><a href='/action/tw-post-sample'>Post test tweet</a></p>";
|
|
|
|
echo "<br/>";
|
|
|
|
echo "</p><a href='/action/tw-unlink.php'>Unlink account</a></p>";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<!--
|
|
|
|
<div class="section" style="opacity:0.25;">
|
|
|
|
<h2>Account settings (WIP, doesn't work)</h2>
|
|
|
|
<form>
|
|
|
|
<p>Username</p>
|
|
|
|
<input label="name" type="text"/>
|
|
|
|
<p>Name</p>
|
|
|
|
<input label="username" type="text"/>
|
|
|
|
<p>Profile photo</p>
|
|
|
|
<input type="file"/>
|
|
|
|
</form>
|
2020-08-30 20:21:57 +00:00
|
|
|
</div>
|
2020-10-29 20:49:43 +00:00
|
|
|
-->
|
2020-05-31 10:39:08 +00:00
|
|
|
</body>
|
2020-05-21 15:57:59 +00:00
|
|
|
</html>
|