Skip to content

Commit

Permalink
Merge pull request #747 from causefx/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
causefx authored Dec 15, 2017
2 parents f13725a + b5b688d commit b39d8e7
Show file tree
Hide file tree
Showing 40 changed files with 2,209 additions and 391 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,4 @@ test*.php
tracy/
logs/
debug.php
OrganizrV2/*
11 changes: 8 additions & 3 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@
echo nzbgetConnect($_GET['list'] ? $_GET['list'] : die('Error!'));
die();
break;
case 'transmission-update':
qualifyUser(TRANSMISSIONHOMEAUTH, true);
echo transmissionConnect($_GET['list'] ? $_GET['list'] : die('Error!'));
die();
break;
case 'show-image':
qualifyUser(NZBGETHOMEAUTH, true);
header('Content-type: image/jpeg');
Expand All @@ -113,17 +118,17 @@
break;
case 'validate-invite':
$response = inviteCodes("check", $_POST['invitecode']);
$response['notify'] = sendResult($response, "check", $_POST['checkurl'], "CODE_SUCCESS", "CODE_ERROR");
$response['notify'] = sendResult($response, "check", 'Invite System', "CODE_SUCCESS", "CODE_ERROR");
break;
case 'use-invite':
if(inviteCodes("check", $_POST['invitecode'])){
$response = inviteCodes("use", $_POST['invitecode'], $_POST['inviteuser']);
$response['notify'] = sendResult(plexUserShare($_POST['inviteuser']), "check", $_POST['checkurl'], "INVITE_SUCCESS", "INVITE_ERROR");
$response['notify'] = sendResult(plexUserShare($_POST['inviteuser']), "check", 'Invite System', "INVITE_SUCCESS", "INVITE_ERROR");
}
break;
case 'join-plex':
$response = plexJoin($_POST['joinuser'], $_POST['joinemail'], $_POST['joinpassword']);
$response['notify'] = sendResult($response, "check", $_POST['checkurl'], "JOIN_SUCCESS", "JOIN_ERROR");
$response['notify'] = sendResult($response, "check", 'Invite System', "JOIN_SUCCESS", "JOIN_ERROR");
break;
default: // Stuff that you need admin for
qualifyUser('admin', true);
Expand Down
2 changes: 1 addition & 1 deletion api.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
unset($_POST['a']);
unset($_POST['k']);
unset($_POST['v']);

$result = array();
//Check Key
if (!isset($key)) {
$result['error'] = "No API Key Set";
Expand Down
103 changes: 22 additions & 81 deletions check.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,95 +8,58 @@
}

function check($extension) {

if (extension_loaded($extension)) :
echo '<div class="col-lg-3">';
if (extension_loaded($extension)) {
echo '<div class="col-lg-2">';
echo '<div class="panel panel-success">';
echo '<div class="panel-heading">';
echo '<h3 class="panel-title">'. $extension . '</h3>';
echo '</div>';
echo '<div style="color: gray" class="panel-body">';
echo $extension . ' is installed!';
echo 'Installed';
echo '</div></div></div>';

else :
echo '<div class="col-lg-3">';
}else{
echo '<div class="col-lg-2">';
echo '<div class="panel panel-danger">';
echo '<div class="panel-heading">';
echo '<h3 class="panel-title">'. $extension . '</h3>';
echo '</div>';
echo '<div style="color: gray" class="panel-body">';
echo $extension . ' is NOT loaded! Please install it before proceeding';

if($extension == "PDO_SQLITE") :

echo '<br/> If you are on Windows, please uncomment this line in php.ini: ;extension=php_pdo_sqlite.dll<br/>If you are on Ununtu, please install php5.3-sqlite or php7-sqlite depending on your version of PHP, then restart PHP service';

endif;

echo 'Missing';
echo '</div></div></div>';

endif;

}
}

function checkFunction($function) {

if (function_exists($function)) :
echo '<div class="col-lg-3">';
if (function_exists($function)) {
echo '<div class="col-lg-2">';
echo '<div class="panel panel-success">';
echo '<div class="panel-heading">';
echo '<h3 class="panel-title">'. $function . '</h3>';
echo '</div>';
echo '<div style="color: gray" class="panel-body">';
echo $function . ' is installed!';

if($function == "MAIL") :

echo '<br/> **Please make sure you can send email prior to installing as this is needed for password resets**';

endif;

echo 'Installed';
echo '</div></div></div>';

else :
echo '<div class="col-lg-3">';
}else{
echo '<div class="col-lg-2">';
echo '<div class="panel panel-danger">';
echo '<div class="panel-heading">';
echo '<h3 class="panel-title">'. $function . '</h3>';
echo '</div>';
echo '<div style="color: gray" class="panel-body">';
echo $function . ' is NOT loaded! Please install it before proceeding';

if($function == "MAIL") :

echo '<br/> **If you do not want to use password resets, this is okay not being installed** EDIT LINE 31 on user.php to "false" [const use_mail = false]';

endif;

echo 'Missing';
echo '</div></div></div>';

endif;

}
}

function getFilePermission($file) {

if (file_exists($file)) :

if (file_exists($file)) {
$length = strlen(decoct(fileperms($file)))-3;

if($file{strlen($file)-1}=='/') :

if($file{strlen($file)-1}=='/') {
$name = "Folder";

else :

}else{
$name = "File";

endif;

if (is_writable($file)) :
}
if (is_writable($file)) {
echo '<div class="col-lg-6">';
echo '<div class="panel panel-success">';
echo '<div class="panel-heading">';
Expand All @@ -105,7 +68,7 @@ function getFilePermission($file) {
echo '<div style="color: gray" class="panel-body">';
echo $file . ' is writable!';
echo '</div></div></div>';
else :
}else{
echo '<div class="col-lg-6">';
echo '<div class="panel panel-danger">';
echo '<div class="panel-heading">';
Expand All @@ -114,48 +77,32 @@ function getFilePermission($file) {
echo '<div style="color: gray" class="panel-body">';
echo $file . ' is NOT writable! Please change the permissions to make it writtable by the PHP User.';
echo '</div></div></div>';

endif;

endif;
}
}
}

?>

<!DOCTYPE html>

<html lang="en" class="no-js">

<head>

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="msapplication-tap-highlight" content="no" />

<title>Requirement Checker</title>

<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
<script src="bower_components/slimScroll/jquery.slimscroll.min.js"></script>

</head>

<body id="body-check" class="gray-bg" style="padding: 0;">

<div id="main-wrapper" class="main-wrapper">

<!--Content-->
<div id="content" style="margin:0 20px; overflow:hidden">

<h1><center>Check Requirements & Permissions</center></h1>

<div class="row">

<?php

check("PDO_SQLITE");
check("PDO");
check("SQLITE3");
Expand All @@ -178,7 +125,6 @@ function getFilePermission($file) {
</div>
<div class="row">
<?php

@getFilePermission($db);
@getFilePermission($folder);
getFilePermission((__DIR__));
Expand All @@ -192,11 +138,8 @@ function getFilePermission($file) {
echo '<div style="color: black" class="panel-body">';
echo phpinfo();
echo '</div></div>';

?>

</div>

</div>
<script>
$("body").niceScroll({
Expand All @@ -205,7 +148,5 @@ function getFilePermission($file) {
mousescrollstep: 60
});
</script>

</body>

</html>
15 changes: 9 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions config/configDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
"nzbgetUsername" => "",
"nzbgetPassword" => "",
"nzbgetHomeAuth" => false,
"transmissionURL" => "",
"transmissionUsername" => "",
"transmissionPassword" => "",
"transmissionHomeAuth" => false,
"sabnzbdURL" => "",
"sabnzbdKey" => "",
"sabnzbdHomeAuth" => false,
Expand Down Expand Up @@ -105,6 +109,7 @@
"downloadRefresh" => "30000",
"organizrAPI" => "",
"splash" => "false",
"splashAuth" => false,
"chat" => "false",
"chatAuth" => "false",
"installedTheme" => "",
Expand Down Expand Up @@ -137,5 +142,38 @@
"homepageOrderombi" => '12',
"homepageOrdercalendar" => '13',
"homepageOrdernoticeguest" => '14',
"homepageOrdertransmisson" => '15',
'requestedUserOnly' => 'true',
'emailTemplateCSS' => '',
'emailTempateLogo' => 'https://raw.githubusercontent.com/causefx/Organizr/master/images/organizr-logo-h.png',
'emailTemplateResetPassword' => '
<h2>Hey there {user}!</h2><br />
Looks like you forgot your password. Well, I got you... Here is your new password: {password}<br />
If you want to change it once you log in, you can. Head over to my website: {domain}<br />
',
'emailTemplateResetPasswordSubject' => 'Password Reset',
'emailTemplateInviteUser' => '
<h2>Hey there {user}!</h2><br />
Here is the invite code to join my cool media server: {inviteCode}<br/>
Head over to my website and enter the code to join: {domain}<br />
',
'emailTemplateInviteUserSubject' => 'You have been invited to join my server',
'emailTemplateRegisterUser' => '
<h2>Hey there {user}!</h2><br />
Welcome to me site.<br/>
If you need anything, please let me know.<br />
',
'emailTemplateRegisterUserSubject' => 'Thank you For Registering',
'emailTemplateCustomOne' => '',
'emailTemplateCustomOneName' => 'Template #1',
'emailTemplateCustomOneSubject' => '',
'emailTemplateCustomTwo' => '',
'emailTemplateCustomTwoName' => 'Template #2',
'emailTemplateCustomTwoSubject' => '',
'emailTemplateCustomThree' => '',
'emailTemplateCustomThreeName' => 'Template #3',
'emailTemplateCustomThreeSubject' => '',
'emailTemplateCustomFour' => '',
'emailTemplateCustomFourName' => 'Template #4',
'emailTemplateCustomFourSubject' => '',
);
Loading

0 comments on commit b39d8e7

Please sign in to comment.