Rangitaki 0.8

This commit is contained in:
mmk2410 2015-07-14 22:10:16 +02:00
parent f996fbc1db
commit 34a8798b95
7 changed files with 34 additions and 83 deletions

View file

@ -0,0 +1,7 @@
%TITLE: RCC stable
%DATE: 15 July 2015
%TAGS: rcc
RCC (Rangitaki Control Center) is now in a stable state. Even if it has just one feature right now, it is an important one: uploading your posts from the web. To use it you have to manually enable it in the config.php and you must set a password in rcc/password.php. If you were using rangitaki in an earlier version you should really upgrade to the latest version, out of security reasons.
I will add more features to RCC in coming releases, including a media upload and other features.

View file

@ -29,7 +29,7 @@ $bloganalytics = '';
// Footer - set here the text for your footer (e.g. a copyright info). You can replace the whole text after the '=' with your own one. // Footer - set here the text for your footer (e.g. a copyright info). You can replace the whole text after the '=' with your own one.
$blogfooter = 'Rangitaki ' . date("Y") . ' <a href="https://github.com/mmk2410/Rangitaki" target="blank">github.com/mmk2410/Rangitaki</a>'; $blogfooter = 'Rangitaki ' . date("Y") . ' <a href="https://github.com/mmk2410/Rangitaki" target="blank">github.com/mmk2410/Rangitaki</a>';
// This enables the optional rangitaki control center. Please read the documentation before you enable it. // This enables the optional rangitaki control center. Please read the documentation before you enable it.
$rcc = 'no'; $rcc = 'yes';
// Here you can disable and enable the navigation menu. Usefull if you have no subblogs and no home directory // Here you can disable and enable the navigation menu. Usefull if you have no subblogs and no home directory
$nav_drawer = 'yes'; $nav_drawer = 'yes';
// Set here the name of your theme. Read the documentation for more themes // Set here the name of your theme. Read the documentation for more themes

View file

@ -1,55 +0,0 @@
<!DOCTYPE html>
<!--
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<html>
<head>
<meta charset="UTF-8">
<title>Rangitaki Control Center</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<link rel="stylesheet" href="../res/rcc.css" />
</head>
<body>
<div class="header">
<a href="../" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<section class="card">
<div class="headline">Password Generator</div>
<?php
$passwd = filter_input(INPUT_POST, "passwd");
if (passwd == "") {
?>
<form action="./" method="post">
<p>New password:<br><br><input type="password" class="itextfield" name="passwd"/></p>
<input type="submit" value="Get password" class="button"/>
</form>
<?php
} else {
echo "<p style='word-wrap: break-word;'>" . password_hash($passwd, PASSWORD_DEFAULT) . "</p>";
}
?>
</section>
</div>
</body>
</html>

View file

@ -36,8 +36,15 @@ THE SOFTWARE.
<div class="main"> <div class="main">
<?php <?php
include '../config.php'; include '../config.php';
$passwd = filter_input(INPUT_POST, "passwd");
if ($rcc == "yes") { if ($rcc == "yes") {
include 'password.php';
session_start();
if(isset($_POST['passwd'])){
$passwd = $_POST['passwd'];
$_SESSION['passwd'] = $_POST['passwd'];
} else if(isset($_SESSION['passwd'])) {
$passwd = $_SESSION['passwd'];
}
if ($passwd == "") { if ($passwd == "") {
?> ?>
<section class="card"> <section class="card">
@ -49,10 +56,8 @@ THE SOFTWARE.
</section> </section>
<?php <?php
} else { } else {
chmod("passwd.txt", 0644); if ($passwd == $password) {
$hash = file_get_contents("passwd.txt"); $_SESSION['login'] = true;
chmod("passwd.txt", 0000);
if (password_verify($passwd, $hash)) {
?> ?>
<section class="card"> <section class="card">
<div class="headline">File Upload</div> <div class="headline">File Upload</div>
@ -88,17 +93,6 @@ THE SOFTWARE.
<?php <?php
} }
} }
?>
<section class="card">
<div class="headline">Password</div>
<p>
Generate a new password.
</p>
<a class="button" href="./genpas/">
GENERATOR
</a>
</section>
<?php
} else { } else {
?> ?>
<section class="card"> <section class="card">

View file

@ -1 +0,0 @@
$2y$10$vgN9txL19vvXKAT.ywFy5u0ApyZ3XAgExBtSff53RUJcnwbsNGBAm

3
rcc/password.php Normal file
View file

@ -0,0 +1,3 @@
<?php
// Set here your RCC password
$password = "setyourpassword";

View file

@ -37,17 +37,20 @@ THE SOFTWARE.
<section class="card"> <section class="card">
<div class="headline">File Upload</div> <div class="headline">File Upload</div>
<?php <?php
if ($_FILES['userfile']['name'] == "") { session_start();
echo "<p>You have to choose a file!</p>"; if($_SESSION['login']){
} else { if ($_FILES['userfile']['name'] == "") {
$blog = filter_input(INPUT_POST, "blog"); echo "<p>You have to choose a file!</p>";
$uploaddir = "../..//articles/$blog/";
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "<p>The post was successfully uploaded and is now published.</p>";
} else { } else {
echo "<p>During the uploading process an error occured! <br> Error Code:" . ($_FILES['userfile']['error'] . "</p>"); $blog = filter_input(INPUT_POST, "blog");
$uploaddir = "../..//articles/$blog/";
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "<p>The post was successfully uploaded and is now published.</p>";
} else {
echo "<p>During the uploading process an error occured! <br> Error Code:" . ($_FILES['userfile']['error'] . "</p>");
}
} }
} }
?> ?>