|
|
@@ -1,14 +1,16 @@
|
|
|
<?php
|
|
|
// Include functions
|
|
|
require_once('user.php');
|
|
|
-$USER = new User('registration_callback');
|
|
|
+$USER = new User();
|
|
|
// 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']); }
|
|
|
+if (isset($_GET['v'])) {
|
|
|
+ $values = (strpos($_GET['v'], '|') !== false ? explode('|',$_GET['v']) : $_GET['v']);
|
|
|
+}
|
|
|
unset($_POST['a']);
|
|
|
unset($_POST['k']);
|
|
|
unset($_POST['v']);
|
|
|
@@ -35,6 +37,7 @@ if (isset($action)) {
|
|
|
$email = $values[1];
|
|
|
$server = $values[2];
|
|
|
}
|
|
|
+ //$USER = new User();
|
|
|
$USER->invite_user("chris", "causefx@me.com", "plex");
|
|
|
$result['data'] = "User has been invited";
|
|
|
//$result['data'] = "user = $user | email = $email | server = $server";
|
|
|
@@ -42,8 +45,25 @@ if (isset($action)) {
|
|
|
$result['error'] = "No Values Were Set For Function";
|
|
|
}
|
|
|
break;
|
|
|
- case "2":
|
|
|
- $result = "other test";
|
|
|
+ case "ombi":
|
|
|
+ if($values){
|
|
|
+ switch ($values) {
|
|
|
+ case 'plex-update':
|
|
|
+ $ombi = ombiAPI('plex-cache');
|
|
|
+ if($ombi){
|
|
|
+ $result['data'] = "Plex Content Cache Successful";
|
|
|
+ }else{
|
|
|
+ $result['error'] = "Plex Content Cache Error";
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ $result['error'] = "$values is not a valid Ombi function";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $result['error'] = "No Ombi Action Supplied";
|
|
|
+ }
|
|
|
+
|
|
|
break;
|
|
|
default:
|
|
|
$result = "$action Not Defined As API Function";
|
|
|
@@ -57,4 +77,4 @@ if(!$result){
|
|
|
}
|
|
|
//return JSON array
|
|
|
exit(json_encode($result));
|
|
|
-?>
|
|
|
+?>
|