Skip to content

Commit

Permalink
Fixes and Features added
Browse files Browse the repository at this point in the history
Fixed #25 - Added option to have logo in title bar - Image has to be
250px on width and 50px on height
Fixed #40 - Added option to change the loading icon
Fixed #57 - Timezone error on older php
  • Loading branch information
causefx committed Jan 22, 2017
1 parent 389d25d commit 9f666e2
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 10 deletions.
1 change: 1 addition & 0 deletions check.php
Expand Up @@ -163,6 +163,7 @@ function getFilePermission($file) {
check("PDO_SQLITE");
check("PDO");
check("Zip");
check("openssl");
checkFunction("MAIL");
checkFunction("fopen");

Expand Down
Binary file added images/rutorrent.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 47 additions & 7 deletions index.php
Expand Up @@ -21,6 +21,7 @@
$activetabtext = "#FFFFFF";
$inactiveicon = "#FFFFFF";
$inactivetext = "#FFFFFF";
$loadingIcon = "images/organizr.png";
$baseURL = "";

function registration_callback($username, $email, $userdir){
Expand Down Expand Up @@ -56,6 +57,24 @@ function write_ini_file($content, $path) {
return $success;

}

function getTimezone(){

if (ini_get('date.timezone')) :

echo ini_get('date.timezone');

elseif (date_default_timezone_get()) :

echo date_default_timezone_get();

else :

echo "America/Los_Angeles";

endif;

}

if(isset($_POST['action'])) :

Expand Down Expand Up @@ -194,6 +213,7 @@ function write_ini_file($content, $path) {
endif;

$userpic = md5( strtolower( trim( $USER->email ) ) );
if(!empty(LOADINGICON)) : $loadingIcon = LOADINGICON; endif;

endif;

Expand All @@ -212,7 +232,7 @@ function write_ini_file($content, $path) {
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="msapplication-tap-highlight" content="no" />

<title><?=$title;?><?php if($title !== "Organizr") : echo "- Organizr"; endif; ?></title>
<title><?=$title;?><?php if($title !== "Organizr") : echo " - Organizr"; endif; ?></title>

<link rel="stylesheet" href="<?=$baseURL;?>bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="<?=$baseURL;?>bower_components/font-awesome/css/font-awesome.min.css">
Expand Down Expand Up @@ -268,7 +288,7 @@ function write_ini_file($content, $path) {
<div></div>
<div></div>
<div></div>
<logo class="logo"><img height="192px" src="images/organizr.png"></logo>
<logo class="logo"><img height="192px" src="<?=$loadingIcon;?>"></logo>

</div>

Expand All @@ -283,12 +303,12 @@ function write_ini_file($content, $path) {
<style>
.bottom-bnts a {

background: <?=$bottombar;?>;
color: <?=$topbartext;?>;
background: <?=$bottombar;?> !important;
color: <?=$topbartext;?> !important;

}.bottom-bnts {

background-color: <?=$bottombar;?>;
background-color: <?=$bottombar;?> !important;

}.gn-menu-main {

Expand Down Expand Up @@ -506,7 +526,27 @@ function write_ini_file($content, $path) {

<li class="top-clock">

<span><span style="color:<?=$topbartext;?>;"><b><?=$title;?></b></span></span>
<?php

if($configReady == "Yes") :

if(empty(TITLELOGO)) :

echo "<span><span style=\"color: topbartext\"><b>$title</b></span></span>";

else :

echo "<img height='50px' width='250px' src='" . TITLELOGO . "'>";

endif;

else :

echo "<span><span style=\"color: topbartext\"><b>$title</b></span></span>";

endif;

?>

</li>

Expand Down Expand Up @@ -664,7 +704,7 @@ function write_ini_file($content, $path) {

<h5>Set Database Location</h5>

<input type="text" class="form-control material" name="timezone" autofocus value="<?php echo date_default_timezone_get();?>" autocorrect="off" autocapitalize="off" required>
<input type="text" class="form-control material" name="timezone" autofocus value="<?php echo getTimezone();?>" autocorrect="off" autocapitalize="off" required>

<h5>Set Timezone</h5>

Expand Down
98 changes: 95 additions & 3 deletions settings.php
Expand Up @@ -35,8 +35,24 @@ function printArray($arrayName){

}

$dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
function write_ini_file($content, $path) {

if (!$handle = fopen($path, 'w')) {

return false;

}

$success = fwrite($handle, $content);

fclose($handle);

return $success;

}

$dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
$databaseLocation = "databaseLocation.ini.php";
$userdirpath = USER_HOME;
$userdirpath = substr_replace($userdirpath, "", -1);

Expand Down Expand Up @@ -285,6 +301,26 @@ function rcopy($src, $dst) {
echo "<script>window.parent.location.reload(true);</script>";

endif;

if($action == "createLocation") :

$databaseData = '; <?php die("Access denied"); ?>' . "\r\n";

foreach ($_POST as $postName => $postValue) {

if($postName !== "action") :

if(substr($postValue, -1) == "/") : $postValue = rtrim($postValue, "/"); endif;

$databaseData .= $postName . " = \"" . $postValue . "\"\r\n";

endif;

}

write_ini_file($databaseData, $databaseLocation);

endif;

if(!isset($_POST['op'])) :

Expand Down Expand Up @@ -592,12 +628,18 @@ function rcopy($src, $dst) {

</li>

<li>
<li>

<a href="#loginlog" data-toggle="tab"><i class="fa fa-file-text-o indigo"></i></a>

</li>

<li>

<a href="#systemSettings" data-toggle="tab"><i class="fa fa-cog gray"></i></a>

</li>

<li>

<a href="#about" data-toggle="tab"><i class="fa fa-info red-orange"></i></a>
Expand Down Expand Up @@ -995,6 +1037,56 @@ function rcopy($src, $dst) {

</div>

<div class="tab-pane big-box fade in" id="systemSettings">

<div class="row">

<div class="col-lg-12">

<div class="gray-bg content-box big-box box-shadow">

<form class="content-form form-inline" name="systemSettings" id="systemSettings" action="" method="POST">

<input type="hidden" name="action" value="createLocation" />

<div class="form-group">

<input type="text" class="form-control gray" name="databaseLocation" placeholder="databaseLocation" autocorrect="off" autocapitalize="off" value="<?php echo DATABASE_LOCATION;?>">

</div>

<div class="form-group">

<input type="text" class="form-control gray" name="timezone" placeholder="timezone" value="<?php echo TIMEZONE;?>">

</div>

<div class="form-group">

<input type="text" class="form-control gray" name="titleLogo" placeholder="Logo URL for title" value="<?php echo TITLELOGO;?>">

</div>

<div class="form-group">

<input type="text" class="form-control gray" name="loadingIcon" placeholder="Loading Icon URL" value="<?php echo LOADINGICON;?>">

</div>



<button type="submit" class="btn btn-success btn-icon waves waves-circle waves-effect waves-float"><i class="fa fa-floppy-o"></i></button>

</form>

</div>

</div>

</div>

</div>

<div class="tab-pane big-box fade in" id="loginlog">

<div class="table-responsive">
Expand Down Expand Up @@ -1854,7 +1946,7 @@ function changeColor(elementName, elementColor) {
dataType: "json",
success: function(github) {

var currentVersion = "0.995";
var currentVersion = "0.997";
var githubVersion = github.tag_name;
var githubDescription = github.body;
var githubName = github.name;
Expand Down
2 changes: 2 additions & 0 deletions user.php
Expand Up @@ -11,6 +11,8 @@
define('USER_HOME', $databaseConfig['databaseLocation'] . '/users/');
define('DATABASE_LOCATION', $databaseConfig['databaseLocation'] . '/');
if(!empty($databaseConfig['timezone'])) : define('TIMEZONE', $databaseConfig['timezone']); else : define('TIMEZONE', 'America/Los_Angeles'); endif;
if(!empty($databaseConfig['titleLogo'])) : define('TITLELOGO', $databaseConfig['titleLogo']); else : define('TITLELOGO', ''); endif;
if(!empty($databaseConfig['loadingIcon'])) : define('LOADINGICON', $databaseConfig['loadingIcon']); else : define('LOADINGICON', ''); endif;
define('FAIL_LOG', 'loginLog.json');

class User
Expand Down

0 comments on commit 9f666e2

Please sign in to comment.