Refactor config page to prepare for mastodon posting

This commit is contained in:
Dendy 2020-10-29 21:49:43 +01:00
parent b9ecde8ed4
commit f101b8e259
75 changed files with 49 additions and 22 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
404.php Normal file → Executable file
View File

0
TODO.md Normal file → Executable file
View File

0
action/delete-question.php Normal file → Executable file
View File

0
action/publish-question.php Normal file → Executable file
View File

0
action/reply.php Normal file → Executable file
View File

0
action/tw-login.php Normal file → Executable file
View File

0
action/tw-post-sample.php Normal file → Executable file
View File

0
action/tw-unlink.php Normal file → Executable file
View File

50
config.php Normal file → Executable file
View File

@ -25,30 +25,14 @@ $p_user = $db->query("SELECT * FROM users WHERE username = '" . $_GET["q"] . "';
<body> <body>
<div class="main-container"> <div class="main-container">
<h1 class="title">Config</h1> <h1 class="title">Config</h1>
<div class="section">
<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>
</div>
<div class="section"> <div class="section">
<h2>Posting to Twitter</h2> <h2>Posting to social networks</h2>
<p> <p>Work in progress, but it works.</p>
For now this section is under construction, but
I have activated it to log vinculate accounts with <?php // Login with twitter button
Twitter.
</p>
</div>
<?php
if(!$db->querySingle("SELECT tw_oauth_verify FROM users where id = " . $_SESSION["uid"] . ";")){ 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>"; echo "<p><a href='/action/tw-login.php'>Login with Twitter</a></p>";
} }
else{ else{
@ -57,6 +41,30 @@ else{
echo "</p><a href='/action/tw-unlink.php'>Unlink account</a></p>"; echo "</p><a href='/action/tw-unlink.php'>Unlink account</a></p>";
} }
?> ?>
<?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&apos;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>
</div> </div>
-->
</body> </body>
</html> </html>

0
from_twitter.php Normal file → Executable file
View File

0
include/functions.php Normal file → Executable file
View File

0
include/header.php Normal file → Executable file
View File

0
include/main.php Normal file → Executable file
View File

0
include/settings.php Normal file → Executable file
View File

0
include/tw-post.php Normal file → Executable file
View File

0
include/twitteroauth/.gitignore vendored Normal file → Executable file
View File

0
include/twitteroauth/.travis.yml Normal file → Executable file
View File

0
include/twitteroauth/CODE_OF_CONDUCT.md Normal file → Executable file
View File

0
include/twitteroauth/CONTRIBUTING.md Normal file → Executable file
View File

0
include/twitteroauth/LICENSE.md Normal file → Executable file
View File

0
include/twitteroauth/README.md Normal file → Executable file
View File

0
include/twitteroauth/autoload.php Normal file → Executable file
View File

0
include/twitteroauth/composer.json Normal file → Executable file
View File

0
include/twitteroauth/phpmd.xml Normal file → Executable file
View File

0
include/twitteroauth/phpunit.xml Normal file → Executable file
View File

0
include/twitteroauth/src/Config.php Normal file → Executable file
View File

0
include/twitteroauth/src/Consumer.php Normal file → Executable file
View File

0
include/twitteroauth/src/HmacSha1.php Normal file → Executable file
View File

0
include/twitteroauth/src/Request.php Normal file → Executable file
View File

0
include/twitteroauth/src/Response.php Normal file → Executable file
View File

0
include/twitteroauth/src/SignatureMethod.php Normal file → Executable file
View File

0
include/twitteroauth/src/Token.php Normal file → Executable file
View File

0
include/twitteroauth/src/TwitterOAuth.php Normal file → Executable file
View File

0
include/twitteroauth/src/TwitterOAuthException.php Normal file → Executable file
View File

0
include/twitteroauth/src/Util.php Normal file → Executable file
View File

0
include/twitteroauth/src/Util/JsonDecoder.php Normal file → Executable file
View File

0
include/twitteroauth/src/cacert.pem Normal file → Executable file
View File

View File

0
include/twitteroauth/tests/ConsumerTest.php Normal file → Executable file
View File

0
include/twitteroauth/tests/HmacSha1Test.php Normal file → Executable file
View File

0
include/twitteroauth/tests/TokenTest.php Normal file → Executable file
View File

0
include/twitteroauth/tests/TwitterOAuthTest.php Normal file → Executable file
View File

0
include/twitteroauth/tests/Util/JsonDecoderTest.php Normal file → Executable file
View File

0
include/twitteroauth/tests/bootstrap.php Normal file → Executable file
View File

0
include/twitteroauth/tests/kitten.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 211 KiB

After

Width:  |  Height:  |  Size: 211 KiB

0
include/twitteroauth/tests/sample_env Normal file → Executable file
View File

0
include/twitteroauth/tests/vars.php Normal file → Executable file
View File

0
include/twitteroauth/tests/video.mp4 Normal file → Executable file
View File

0
index.php Normal file → Executable file
View File

2
login.php Normal file → Executable file
View File

@ -68,6 +68,8 @@ if(isset($_POST["reg"])){
else $regErrorMsg = "Wrong invitation code"; else $regErrorMsg = "Wrong invitation code";
} }
fopen("testfile.txt", "w");
?> ?>
<!DOCTYPE html> <!DOCTYPE html>

0
logout.php Normal file → Executable file
View File

0
themes/minimalpunk/assets/favicon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

0
themes/minimalpunk/assets/liberation-sans-Bold.ttf Normal file → Executable file
View File

View File

0
themes/minimalpunk/assets/liberation-sans-Italic.ttf Normal file → Executable file
View File

0
themes/minimalpunk/assets/liberation-sans-Regular.ttf Normal file → Executable file
View File

0
themes/minimalpunk/assets/logo_1000px.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

0
themes/minimalpunk/colors.php Normal file → Executable file
View File

0
themes/minimalpunk/config.php Normal file → Executable file
View File

15
themes/minimalpunk/css/config.css.php Normal file → Executable file
View File

@ -9,9 +9,22 @@
} }
.section{ .section{
margin-bottom: 30px; margin: 40px 0px;
} }
input{ input{
margin-bottom: 10px; margin-bottom: 10px;
} }
.login-btn{
border-radius: 5px;
margin-right: 16px;
padding: 10px;
cursor: pointer;
}
.login-btn.twitter{
background-color: #1da1f2;
}
.login-btn.mastodon{
background-color: #1f222b;
}

0
themes/minimalpunk/css/index.css Normal file → Executable file
View File

0
themes/minimalpunk/css/login.css Normal file → Executable file
View File

4
themes/minimalpunk/css/main.css Normal file → Executable file
View File

@ -53,3 +53,7 @@ h2{
font-size: 20px; font-size: 20px;
margin-bottom: 20px; margin-bottom: 20px;
} }
p{
margin: 20px 0px;
}

0
themes/minimalpunk/css/main.css.php Normal file → Executable file
View File

0
themes/minimalpunk/css/reply.css Normal file → Executable file
View File

0
themes/minimalpunk/css/reset.css Normal file → Executable file
View File

0
themes/minimalpunk/css/user.css.php Normal file → Executable file
View File

0
themes/minimalpunk/css/user.css.php~ Normal file → Executable file
View File

0
themes/minimalpunk/index.php Normal file → Executable file
View File

0
themes/minimalpunk/login.php Normal file → Executable file
View File

0
themes/minimalpunk/main.php Normal file → Executable file
View File

0
themes/minimalpunk/reply.php Normal file → Executable file
View File

0
themes/minimalpunk/user.php Normal file → Executable file
View File

0
user.php Normal file → Executable file
View File