-
-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #328 from causefx/develop
Develop
- Loading branch information
Showing
126 changed files
with
2,850 additions
and
3,448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,145 @@ | ||
<?php | ||
// Include functions if not already included | ||
// Include functions and user | ||
require_once('functions.php'); | ||
require_once("user.php"); | ||
$GLOBALS['USER'] = new User('registration_callback'); | ||
|
||
// Upgrade environment | ||
upgradeCheck(); | ||
|
||
// Define Version | ||
define('INSTALLEDVERSION', '1.31'); | ||
|
||
// Lazyload settings | ||
$databaseConfig = configLazy('config/config.php'); | ||
|
||
// Authorization | ||
# Check if user is currently active and allowed to access resource | ||
//require_once("user.php"); | ||
# ^^ I think adding this does that? | ||
// Get Action | ||
if (isset($_POST['submit'])) { $action = $_POST['submit']; } | ||
if (isset($_POST['action'])) { $action = $_POST['action']; } | ||
if (isset($_GET['action'])) { $action = $_GET['action']; } | ||
if (isset($_GET['a'])) { $action = $_GET['a']; } | ||
unset($_POST['action']); | ||
|
||
// No Action | ||
if (!isset($action)) { | ||
debug_out('No Action Specified!',1); | ||
sendNotification(false, 'No Action Specified!'); | ||
} | ||
|
||
// Process Request | ||
$response = array(); | ||
switch ($_SERVER['REQUEST_METHOD']) { | ||
case 'GET': | ||
switch ($action) { | ||
case 'emby-image': | ||
qualifyUser(EMBYHOMEAUTH, true); | ||
getEmbyImage(); | ||
die(); | ||
break; | ||
case 'plex-image': | ||
qualifyUser(PLEXHOMEAUTH, true); | ||
getPlexImage(); | ||
die(); | ||
break; | ||
case 'emby-streams': | ||
qualifyUser(EMBYHOMEAUTH, true); | ||
echo getEmbyStreams(12); | ||
die(); | ||
break; | ||
case 'plex-streams': | ||
qualifyUser(PLEXHOMEAUTH, true); | ||
echo getPlexStreams(12); | ||
die(); | ||
break; | ||
case 'emby-recent': | ||
qualifyUser(EMBYHOMEAUTH, true); | ||
echo getEmbyRecent($_GET['type'], 12); | ||
die(); | ||
break; | ||
case 'plex-recent': | ||
qualifyUser(PLEXHOMEAUTH, true); | ||
echo getPlexRecent($_GET['type'], 12); | ||
die(); | ||
break; | ||
case 'sabnzbd-update': | ||
qualifyUser(SABNZBDHOMEAUTH, true); | ||
echo sabnzbdConnect($_GET['list'] ? $_GET['list'] : die('Error!')); | ||
die(); | ||
break; | ||
case 'nzbget-update': | ||
qualifyUser(NZBGETHOMEAUTH, true); | ||
echo nzbgetConnect($_GET['list'] ? $_GET['list'] : die('Error!')); | ||
die(); | ||
break; | ||
|
||
default: | ||
debug_out('Unsupported Action!',1); | ||
sendNotification(false, 'Unsupported Action!'); | ||
} | ||
break; | ||
case 'POST': | ||
// Check if the user is an admin and is allowed to commit values | ||
qualifyUser('admin', true); | ||
switch ($action) { | ||
case 'upload-images': | ||
uploadFiles('images/', array('jpg', 'png', 'svg', 'jpeg', 'bmp')); | ||
sendNotification(true); | ||
break; | ||
case 'remove-images': | ||
removeFiles('images/'.(isset($_POST['file'])?$_POST['file']:'')); | ||
sendNotification(true); | ||
break; | ||
case 'update-config': | ||
sendNotification(updateConfig($_POST)); | ||
break; | ||
case 'update-appearance': | ||
// Custom CSS Special Case START | ||
if (isset($_POST['customCSS'])) { | ||
if ($_POST['customCSS']) { | ||
write_ini_file($_POST['customCSS'], 'custom.css'); | ||
} else { | ||
unlink('custom.css'); | ||
} | ||
$response['parent']['reload'] = true; | ||
} | ||
unset($_POST['customCSS']); | ||
// Custom CSS Special Case END | ||
$response['notify'] = sendNotification(updateDBOptions($_POST),false,false); | ||
break; | ||
case 'deleteDB': | ||
deleteDatabase(); | ||
sendNotification(true, 'Database Deleted!'); | ||
break; | ||
case 'editCSS': | ||
write_ini_file($_POST["css-show"], "custom.css"); | ||
echo '<script>window.top.location = window.top.location.href.split(\'#\')[0];</script>'; | ||
case 'upgradeInstall': | ||
upgradeInstall(); | ||
$response['notify'] = sendNotification(true, 'Performing Checks', false); | ||
$response['tab']['goto'] = 'updatedb.php'; | ||
break; | ||
case 'forceBranchInstall': | ||
upgradeInstall(GIT_BRANCH); | ||
$response['notify'] = sendNotification(true, 'Performing Checks', false); | ||
$response['tab']['goto'] = 'updatedb.php'; | ||
break; | ||
case 'deleteLog': | ||
sendNotification(unlink(FAIL_LOG)); | ||
break; | ||
case 'submit-tabs': | ||
$response['notify'] = sendNotification(updateTabs($_POST) , false, false); | ||
$response['show_apply'] = true; | ||
break; | ||
default: | ||
debug_out('Unsupported Action!',1); | ||
sendNotification(false, 'Unsupported Action!'); | ||
} | ||
break; | ||
case 'PUT': | ||
|
||
sendNotification(false, 'Unsupported Action!'); | ||
break; | ||
case 'DELETE': | ||
|
||
sendNotification(false, 'Unsupported Action!'); | ||
break; | ||
default: | ||
debug_out('Unknown Request Type!',1); | ||
sendNotification(false, 'Unknown Request Type!'); | ||
} | ||
|
||
|
||
if ($response) { | ||
header('Content-Type: application/json'); | ||
echo json_encode($response); | ||
die(); | ||
} else { | ||
sendNotification(false, 'Error: No Output Specified!'); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
order deny,allow | ||
deny from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
div.colour-field { | ||
border: 1px solid #cbd3d5; | ||
border-radius: 5px; | ||
padding-top: 10px; | ||
padding-bottom: 10px; | ||
margin-bottom: 15px; | ||
} | ||
|
||
div.colour-field input { | ||
color: #000; | ||
} | ||
|
||
input.invalid { | ||
background-color: #ffb5b5 !important; | ||
} | ||
|
||
input.invalid + p.help-text::after { | ||
content: " - Does not match pattern!"; | ||
} | ||
|
||
|
||
div.form-content input:not([type=radio]) { | ||
width: 100% !important; | ||
} | ||
|
||
tab > div.row { | ||
padding: 0px 10px 0px 10px; | ||
} | ||
|
||
tab > div.row > div { | ||
padding: 1px 5px !important; | ||
} | ||
|
||
tab > div.row > div:first-child { | ||
max-width: 42px; | ||
} | ||
|
||
tab > div.row > div:first-child .tabIconView { | ||
width: 100% !important; | ||
margin: 7px 0px !important; | ||
} | ||
|
||
tab > div.row button { | ||
margin: 9px 0px !important; | ||
} | ||
|
||
tab > div.row div.custom-field { | ||
margin: 8px 0px !important; | ||
} | ||
|
||
tab p.help-text { | ||
margin: 0px !important; | ||
} | ||
|
||
#submitTabs ul > li { | ||
padding: 0px 10px !important; | ||
} |
Oops, something went wrong.