Skip to content

Commit

Permalink
Merge pull request #653 from causefx/develop
Browse files Browse the repository at this point in the history
Fixed #186 - Added CouchPotato to Homepage
Fixed #316 - Added Weather ticker to Org User menu
Fixed #366 - Fixed Calendar Save on Edge
Fixed #373 #594 - Fixed LDAP Binding with new option
Fixed #441 - Added Open in New Window for Mobile
Fixed #490 - Added Media Popups for all media
Fixed #567 - Added Email section to email users
Fixed #569 #620 - Added Emby URL to links
Fixed #618 - Media Popups respect language now
Fixed #644 - Added JSON to check
Fixed #646 - Settings margins fixed

Added Ping for each tab
Added Splash screen
Added LayerCake Theme Selection
Added SpeedTest History
Added Built-In Chat
Added New Settings Page
Added New Top Bar Menu
Added Mass Email
Added CouchPotato to Homepage
Added Weather Ticker
Fixed LDAP
And More...
  • Loading branch information
causefx authored Oct 6, 2017
2 parents 8a6163a + 9e130d4 commit 36e3834
Show file tree
Hide file tree
Showing 818 changed files with 17,032 additions and 994 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ homepageSettings.ini.php
loginLog.json
custom.css
_config.yml
org.log
test.php
users.db
config/cacert.pem
config/config.php
config/config*.bak.php
config/users/
Expand Down
35 changes: 27 additions & 8 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
echo json_encode(getCalendar());
die();
break;
case 'get-ping':
echo getPing($_GET['url'], $_GET['style'], true);
die();
break;
case 'show-file':
$auth = ($_SERVER['HTTP_REFERER'] ? true : false);
if ($auth === false) { die("WTF? Bro! This is an internal function only"); }
Expand Down Expand Up @@ -107,8 +111,6 @@
$response['notify'] = sendResult($response, "check", $_POST['checkurl'], "CODE_SUCCESS", "CODE_ERROR");
break;
case 'use-invite':
//$response = inviteCodes("check", $_POST['invitecode']);
//$response = inviteCodes("use", $_POST['invitecode']);
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");
Expand All @@ -121,6 +123,13 @@
default: // Stuff that you need admin for
qualifyUser('admin', true);
switch ($action) {
case 'get-emails':
$response = printEmails(getEmails($_POST['type']));
break;
case 'mass-email':
massEmail($_POST['emailto'],$_POST['emailsubject'],$_POST['emailmessage']);
$response['notify'] = sendNotification(true, 'E-Mail Sent', false);
break;
case 'test-email':
sendResult(sendTestEmail($_POST['emailto'], $_POST['emailsenderemail'], $_POST['emailhost'], $_POST['emailauth'], $_POST['emailusername'], $_POST['emailpassword'], $_POST['emailtype'], $_POST['emailport'], $_POST['emailsendername']), "flask", "E-Mail TEST", "SUCCESS", "ERROR");
break;
Expand All @@ -143,7 +152,8 @@
sendNotification(true);
break;
case 'update-config':
sendNotification(updateConfig($_POST));
$response['notify'] = sendNotification(updateConfig($_POST));
$response['show_apply'] = true;
break;
case 'update-appearance':
// Custom CSS Special Case START
Expand All @@ -152,13 +162,15 @@
write_ini_file($_POST['customCSS'], 'custom.css');
} else {
unlink('custom.css');
}
$response['show_apply'] = true;
}
$response['notify'] = sendNotification(true,false,false);
$response['show_apply'] = true;
}
unset($_POST['customCSS']);
// Custom CSS Special Case END
if (!empty($_POST)) {
$response['notify'] = sendNotification(updateDBOptions($_POST),false,false);
$response['notify'] = sendNotification(updateDBOptions($_POST),false,false);
$response['show_apply'] = true;
}
break;
case 'deleteDB':
Expand All @@ -176,10 +188,17 @@
$response['tab']['goto'] = 'updatedb.php';
break;
case 'deleteLog':
sendNotification(unlink(FAIL_LOG));
$response['notify'] = sendNotification(unlink(FAIL_LOG));
$response['show_apply'] = true;
break;
case 'deleteChat':
$response['notify'] = sendNotification(unlink("chatpack.db"));
$response['show_apply'] = true;
$response['reload'] = true;
break;
case 'deleteOrgLog':
sendNotification(unlink("org.log"));
$response['notify'] = sendNotification(unlink("org.log"));
$response['show_apply'] = true;
break;
case 'submit-tabs':
$response['notify'] = sendNotification(updateTabs($_POST) , false, false);
Expand Down
44 changes: 34 additions & 10 deletions api.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,59 @@
<?php
// Include functions
require_once('functions.php');
// Lazyload settings
$databaseConfig = configLazy('config/config.php');
require_once('user.php');
$USER = new User('registration_callback');
// Get Action
if (isset($_POST['a'])) { $action = $_POST['a']; }
if (isset($_POST['k'])) { $key = $_POST['k']; }
if (isset($_POST['v'])) { $values = $_POST['v']; }
if (isset($_GET['a'])) { $action = $_GET['a']; }
if (isset($_GET['k'])) { $key = $_GET['k']; }
if (isset($_GET['v'])) { $values = explode('|',$_GET['v']); }
unset($_POST['a']);
unset($_POST['k']);
//Set Default Result
$result = "An error has occurred";
unset($_POST['v']);

//Check Key
if (!isset($key)) {
exit(json_encode("No API Key set"));
$result['error'] = "No API Key Set";
exit(json_encode($result));
}elseif (strtolower(ORGANIZRAPI) != strtolower($key)) {
exit(json_encode("API Key mismatch"));
$result['error'] = "API Key mismatch";
exit(json_encode($result));
}
//Start API Call
if (isset($action)) {
switch ($action) {
case "1":
$result = "test";
case "invite-user":
if($values){
if(count($values) == 2){
$user = null;
$email = $values[0];
$server = $values[1];
}else{
$user = $values[0];
$email = $values[1];
$server = $values[2];
}
$USER->invite_user("chris", "[email protected]", "plex");
$result['data'] = "User has been invited";
//$result['data'] = "user = $user | email = $email | server = $server";
}else{
$result['error'] = "No Values Were Set For Function";
}
break;
case "2":
$result = "other test";
break;
default:
$result = "$action not defined";
$result = "$action Not Defined As API Function";
}
}else{
$result['error'] = "No API Action Set";
}
//Set Default Result
if(!$result){
$result['error'] = "An error has occurred";
}
//return JSON array
exit(json_encode($result));
Expand Down
2 changes: 1 addition & 1 deletion auth.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$debug = false;
$debug = false; //CAREFUL WHEN SETTING TO TRUE AS THIS OPENS AUTH UP
require_once("user.php");
$USER = new User("registration_callback");
$ban = isset($_GET['ban']) ? strtoupper($_GET['ban']) : "";
Expand Down
2 changes: 2 additions & 0 deletions bower_components/morris.js/morris.css

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

Loading

0 comments on commit 36e3834

Please sign in to comment.