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.
$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.
$rcc = 'no';
$rcc = 'yes';
// Here you can disable and enable the navigation menu. Usefull if you have no subblogs and no home directory
$nav_drawer = 'yes';
// 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">
<?php
include '../config.php';
$passwd = filter_input(INPUT_POST, "passwd");
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 == "") {
?>
<section class="card">
@ -49,10 +56,8 @@ THE SOFTWARE.
</section>
<?php
} else {
chmod("passwd.txt", 0644);
$hash = file_get_contents("passwd.txt");
chmod("passwd.txt", 0000);
if (password_verify($passwd, $hash)) {
if ($passwd == $password) {
$_SESSION['login'] = true;
?>
<section class="card">
<div class="headline">File Upload</div>
@ -88,17 +93,6 @@ THE SOFTWARE.
<?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 {
?>
<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">
<div class="headline">File Upload</div>
<?php
if ($_FILES['userfile']['name'] == "") {
echo "<p>You have to choose a file!</p>";
} else {
$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>";
session_start();
if($_SESSION['login']){
if ($_FILES['userfile']['name'] == "") {
echo "<p>You have to choose a file!</p>";
} 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>");
}
}
}
?>