Skip to content

Commit

Permalink
push
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Junker committed Sep 14, 2020
1 parent 26aa4d6 commit bb83aba
Show file tree
Hide file tree
Showing 17 changed files with 200 additions and 155 deletions.
31 changes: 23 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
# Pb2.0Bfx0
# Pb2.0Bfx0RCA
> This Version isn't backward compatible to older versions
> The install wizard doesn't work.
This is a release Candidate version. Issues will be tracked in #49

## Additions
* Added better class system
* Better organisation of code
* Added HTTP-Errors 400, 405, 410, 414, 423
* Updated files to new code conventions
* Added experimental information to installer.
## Changes
* Better organisation of code
* Renamed profil.php in profile.php
* Added more documentation to code
* Moved blogsite, index and HTTP-Errors to page.php
* Added all translations
* Updated files to new code conventions
## Removed
* Removed is_there_usoc.json
* Added more documentation
* Moved HTTP-Errors to page.php
* Moved index page to normal pages.
* Moved blogsite to page.php
* fixed #48
* /errors/*
* blog.php
* blogsite.php
* option for a hash
## Fixed bugs
* #48
* And other
# Pb1.8Bfx0
* Fixed #43, #28 and other bugs.
# Pb1.7Bfx1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/9c5f474aa55e4eb1a63729a4692aaf90)](https://www.codacy.com/gh/Case-Games/USOC?utm_source=github.com&utm_medium=referral&utm_content=Case-Games/USOC&utm_campaign=Badge_Grade)
Useful simple open-source CMS

![](https://img.shields.io/badge/Version%20in%20developement%20in%20this%20branch-Pb2.0Bfx0-blue)
![](https://img.shields.io/badge/Version%20in%20developement%20in%20this%20branch-Pb2.0Bfx0RCA-blue)
# Is it ready to use
No. In the moment you shouldn't use it
# How can I help
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Old pre-alpha and pre-beta versions aren't supported with bugfixes.
### Pre-Beta
| Version | Supported|Newest Version|
| ------- | ---------|--------------|
| Pb2.0 | :x: | Pb2.0Bfx0 |
| Pb2.0 | :x: | Pb2.0Bfx0RCA |
| Pb1.8 | :x: | Pb1.8Bfx0 |
| Pb1.7 | :x: | Pb1.7Bfx1 |
| Pb1.6 | :x: | Pb1.6Bfx0 |
Expand Down
4 changes: 2 additions & 2 deletions site/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
}else{
?>
<form action="login.php" method="post">
<label for="B"><?php echo $U->getLang("login.username") ?></label>
<label for="B"><?php echo $U->getLang("login.username.g") ?></label>
<input name="B" type="text" />
<label for="P"><?php echo $U->getLang("login.password") ?></label>
<label for="P"><?php echo $U->getLang("login.password.g") ?></label>
<input name="P" type="password" />
<input type="submit" />
</form>
Expand Down
2 changes: 1 addition & 1 deletion site/admin/pages/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?URL=mainpage">Back</a>
<h1>USOC</h1>
<h2>Useful Simple Open-source CMS</h2>
<p><?php echo $U->getLang("admin.about.version") ?>: Pb2.0Bfx0</p>
<p><?php echo $U->getLang("admin.about.version") ?>: Pb2.0Bfx0RCA</p>
<p><?php echo $U->getLang("admin.about.license") ?></p>
<p>By Case Games 2020</p>
<p><?php echo $U->getLang("admin.about.developed_by") ?></p>
Expand Down
2 changes: 1 addition & 1 deletion site/changepassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
newClass();
?>
<!DOCTYPE html>
<html lang="<?php echo $U->getSetting("site.lang"); ?> dir="ltr">
<html lang="<?php echo $U->getSetting("site.lang"); ?>" dir="ltr">
<head>
<?php
include_once "siteelements/head.php";
Expand Down
16 changes: 8 additions & 8 deletions site/includes/class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
if(gettype($USOC) == "array"){
/**
* This function initialise the U class in $U if it doesn't exist
* @version Pb2.0Bfx0
* @since Pb2.0Bfx0
* @version Pb2.0Bfx0RCA
* @since Pb2.0Bfx0RCA
*/
function newClass(){
global $U;
Expand All @@ -21,25 +21,25 @@ function newClass(){
* This class only works when configuration.php is included.
* Use newClass() and not this class.
* @see newClass()
* @version Pb2.0Bfx0
* @since Pb2.0Bfx0
* @version Pb2.0Bfx0RCA
* @since Pb2.0Bfx0RCA
*/
class U{
/**
* Version name.
* @since Pb2.0Bfx0
* @since Pb2.0Bfx0RCA
* @var string
*/
public $version = "Pb2.0Bfx0";
public $version = "Pb2.0Bfx0RCA";
/**
* Version code
* @since Pb2.0Bfx0
* @since Pb2.0Bfx0RCA
* @var int
*/
public $version_code = 20200900;
/**
* True when USOC is modded.
* @since Pb2.0Bfx0
* @since Pb2.0Bfx0RCA
* @var boolean
*/
public $modded = false;
Expand Down
4 changes: 2 additions & 2 deletions site/includes/getErrorSite.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* This function return the code for the Error Page with error $error
* When it can't find the string in the default language it searches the string in en-en
* @see U For more informations about U.
* @version Pb2.0Bfx0
* @since Pb2.0Bfx0
* @version Pb2.0Bfx0RCA
* @since Pb2.0Bfx0RCA
* @param string $error String with the error (example: "404")
* @return string The code
*/
Expand Down
4 changes: 2 additions & 2 deletions site/includes/getLang.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* This function gets a string from the localisation files. It uses the default language.
* When it can't find the string in the default language it searches the string in en-en
* @see U For more informations about U.
* @version Pb2.0Bfx0
* @since Pb2.0Bfx0
* @version Pb2.0Bfx0RCA
* @since Pb2.0Bfx0RCA
* @param string $string The name of the string. (For example: login.name)
* @return string The translated string
*/
Expand Down
4 changes: 2 additions & 2 deletions site/includes/getProfilePicture.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* This is a function for the class U.
* This function gets a value from the "settings" database.
* @see U For more informations about U.
* @version Pb2.0Bfx0
* @since Pb2.0Bfx0
* @version Pb2.0Bfx0RCA
* @since Pb2.0Bfx0RCA
* @param string $name The name of the setting. (For example: login.name)
* @return mixed The value from the database.
*/
Expand Down
4 changes: 2 additions & 2 deletions site/includes/getSetting.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* This is a function for the class U.
* This function gets a value from the "settings" database.
* @see U For more informations about U.
* @version Pb2.0Bfx0
* @since Pb2.0Bfx0
* @version Pb2.0Bfx0RCA
* @since Pb2.0Bfx0RCA
* @param string $name The name of the setting. (For example: login.name)
* @return mixed The value from the database.
*/
Expand Down
1 change: 1 addition & 0 deletions site/install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</head>
<body>
<h1>Install USOC</h1>
<h2>Experimantal feature. Sometimes doesn't work</h2>
<ul>
<li>Version: Pa1.8Bfx0</li>
<li>You need PHP 7: <?php if (PHP_VERSION_ID > 69999){echo "Yes!";}else{echo "You must update!";} ?></li>
Expand Down
17 changes: 15 additions & 2 deletions site/lang/en-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@
"login.login_closed": "Login closed",
"login.succeed": "Login succeeded",
"login.fail": "Login failed",
"login.not_logged_in": "Not logged in",
"login.not_logged_in": "Not logged in.",
"login.already": "Already logged in",
"login.locked": "Your %d is permanently blocked",
"login.account": "account",
"login.2fa": "2 factor authentication",
"login.2fa": "Two factor authentication",
"login.2fa.with": "Two factor authentication with %a",
"login.2fa.false_code": "Code isn't correct",
"login.2fa.succeed": "%a connected",
"login.2fa.already": "Already connected.",
"login.2fa.google_authenticator": "Google Authenticator",
"login.2fa.google_authenticator.code": "Code from the Google Authenticator App:",
"login.2fa.google_authenticator.manual": "<b>Two factor authentication with Google Authenticator</b><p>Scan following code with Google Authenticator</p><p>Attention! If you log in with your Google Account 2Fa doesn't work</p>",
"login.changepass": "Change password",
"login.changepass.twopassword": "Please type in two times the equal password. Or please type in a valid password.",
"login.changepass.not_filled": "Not everything filled up or not logged in.",
Expand All @@ -40,12 +44,18 @@
"login.oAuth.google": "Google Account",
"login.oAuth.fail": "Already a %a connected",
"login.oAuth.error_fail": "Error",
"login.oAuth.connect": "Connect %a",
"login.invalid": "Invalid %a",
"login.username": "username",
"login.password": "password",
"login.password.repeat": "repeat password",
"login.username.g": "Username",
"login.password.g": "Password",
"login.password.repeat.g": "Repeat password",
"login.mail": "mailadress",
"login.fail_same_password": "Not the same password",
"login.fillout": "Please fill out everything",
"login.logout": "You're logged out",
"blog": "blog",
"blog.readmore": "Read more...",
"login.account.password_changed": "Password changed",
Expand Down Expand Up @@ -77,4 +87,7 @@
"admin.send": "Send",
"admin.back": "Back",
"admin.welcome": "Welcome!",
"profile": "Profile",
"profile.settings": "Profile settings",
""
}
50 changes: 29 additions & 21 deletions site/login.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php session_start() ?>
<?php
session_start();
include_once "configuration.php";
include_once "includes/class.inc.php";
newClass();
?>
<!DOCTYPE html>
<html lang="<?php echo $U->getSetting("site.lang") ?>" dir="ltr">
<head>
Expand Down Expand Up @@ -34,26 +39,29 @@ function onSignIn(googleUser) {
?>
<article>
<?php
if(isset($_GET["ERROR"])){
echo "<p id='error'>".getError($_GET["ERROR"],"de")."</p>";
}
if (isset($_SESSION["User_ID"])) {
echo "Bereits angemeldet";
}elseif($U->getSetting("login.login_open")==0){
echo "<h3>Login Geschlossen</h3>";
}else{
echo <<<HEREDOC
<form action="login/login.php" method="post">
Benutzername:
<input type="text" name="B" />
Passwort:
<input type="password" name="P" />
<input type="submit" name="button"/>
</form>
<h5>Mit Google anmelden</h5>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
HEREDOC;
}
if(isset($_GET["ERROR"])){
echo "<p id='error'>".@getError($_GET["ERROR"],"de")."</p>";
}
if (isset($_SESSION["User_ID"])) {
echo $U->getLang("login.already");
}elseif($U->getSetting("login.login_open")==0){
echo "<h3>".$U->getLang("login.login_closed")."</h3>";
}else{
$HTML = <<<HEREDOC
<form action="login/login.php" method="post">
<label for="B">%a</label>
<input type="text" name="B" />
<label for="P">%b</label>
<input type="password" name="P" />
<input type="submit" name="button"/>
</form>
<h5>Mit Google anmelden</h5>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
HEREDOC;
$HTML = str_replace("%a",$U->getLang("login.username.g"),$HTML);
$HTML = str_replace("%b",$U->getLang("login.password.g"),$HTML);
echo $HTML;
}
?>
<form style="display:none;" action="login/googlelogintoken.php" method="post">
<input type="text" name="token" />
Expand Down
9 changes: 6 additions & 3 deletions site/logout.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?php
session_start();
session_destroy();
include "configuration.php";
include "/includes/class.inc.php";
newClass();
?>
<!DOCTYPE html>
<html lang="<?php echo $U->getSetting("site.lang") ?>" dir="ltr">
<head>
<meta charset="utf-8">
<title>Case Games</title>
<meta charset="<?php echo $U->getLang("lang.charset"); ?>">
<title><?php echo getSetting("site.name") ?></title>
<link rel="stylesheet" href="style/css.php" type="text/css" />
<meta name="google-signin-client_id" content="*.apps.googleusercontent.com">
<script src="https://apis.google.com/js/platform.js" async defer></script>
Expand Down Expand Up @@ -35,7 +38,7 @@ function onLoad() {
include_once "siteelements/header.php"
?>
<article>
<h1>Sie wurden ausgeloggt</h1>
<h1><?php echo $U->getLang("login.logout");?></h1>
</article>
<?php
include_once "siteelements/footer.php"
Expand Down
Loading

0 comments on commit bb83aba

Please sign in to comment.