|
@@ -14,32 +14,24 @@ if (isset($_REQUEST['series'])) {
|
|
|
|
|
|
|
|
# Did the user request an update?
|
|
# Did the user request an update?
|
|
|
if ($series !== false && isset($_POST['Save'])) {
|
|
if ($series !== false && isset($_POST['Save'])) {
|
|
|
- # Require auth (or for the time being, specific IP addresses)
|
|
|
|
|
- if (preg_match('/^(?:172\.19\.[17]\.|2602:3f:e50d:76|74\.93\.97\.65)/', $_SERVER['REMOTE_ADDR'])) {
|
|
|
|
|
-
|
|
|
|
|
- # Grab the current settings for comparison
|
|
|
|
|
- $series_last = readFlags($series);
|
|
|
|
|
- $seasons_last = findSeasons($series);
|
|
|
|
|
-
|
|
|
|
|
- # Save series and season data
|
|
|
|
|
- saveFlags($series, $_POST, $series_last, $seasons_last);
|
|
|
|
|
- saveSeasons($series, $_POST, $series_last, $seasons_last);
|
|
|
|
|
- } else {
|
|
|
|
|
- echo '<h4 style="color: red;">Cannot save: User not authenticated</h4>';
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ require_authentication();
|
|
|
|
|
+
|
|
|
|
|
+ # Grab the current settings for comparison
|
|
|
|
|
+ $series_last = readFlags($series);
|
|
|
|
|
+ $seasons_last = findSeasons($series);
|
|
|
|
|
+
|
|
|
|
|
+ # Save series and season data
|
|
|
|
|
+ saveFlags($series, $_POST, $series_last, $seasons_last);
|
|
|
|
|
+ saveSeasons($series, $_POST, $series_last, $seasons_last);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
# Did the user add a season?
|
|
# Did the user add a season?
|
|
|
if ($series !== false && isset($_POST['AddSeason'])) {
|
|
if ($series !== false && isset($_POST['AddSeason'])) {
|
|
|
- # Require auth (or for the time being, specific IP addresses)
|
|
|
|
|
- if (preg_match('/^(?:172\.19\.[17]\.|2602:3f:e50d:76|74\.93\.97\.65)/', $_SERVER['REMOTE_ADDR'])) {
|
|
|
|
|
-
|
|
|
|
|
- # Add a season folder
|
|
|
|
|
- $season = intval($_POST['season_add']);
|
|
|
|
|
- addSeason($series, $season);
|
|
|
|
|
- } else {
|
|
|
|
|
- echo '<h4 style="color: red;">Cannot save: User not authenticated</h4>';
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ require_authentication();
|
|
|
|
|
+
|
|
|
|
|
+ # Add a season folder
|
|
|
|
|
+ $season = intval($_POST['season_add']);
|
|
|
|
|
+ addSeason($series, $season);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
# Did the user delete a season?
|
|
# Did the user delete a season?
|
|
@@ -52,28 +44,19 @@ if ($series !== false) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if ($season !== false) {
|
|
if ($season !== false) {
|
|
|
|
|
+ require_authentication();
|
|
|
|
|
|
|
|
- # Require auth (or for the time being, specific IP addresses)
|
|
|
|
|
- if (preg_match('/^(?:172\.19\.[17]\.|2602:3f:e50d:76|74\.93\.97\.65)/', $_SERVER['REMOTE_ADDR'])) {
|
|
|
|
|
-
|
|
|
|
|
- # Remove a season folder (if empty)
|
|
|
|
|
- delSeason($series, $season);
|
|
|
|
|
- } else {
|
|
|
|
|
- echo '<h4 style="color: red;">Cannot save: User not authenticated</h4>';
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ # Remove a season folder (if empty)
|
|
|
|
|
+ delSeason($series, $season);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
# Did the user add a series?
|
|
# Did the user add a series?
|
|
|
if ($series === false && isset($_POST['series_add'])) {
|
|
if ($series === false && isset($_POST['series_add'])) {
|
|
|
- # Require auth (or for the time being, specific IP addresses)
|
|
|
|
|
- if (preg_match('/^(?:172\.19\.[17]\.|2602:3f:e50d:76|74\.93\.97\.65)/', $_SERVER['REMOTE_ADDR'])) {
|
|
|
|
|
|
|
+ require_authentication();
|
|
|
|
|
|
|
|
- # Add a series folder
|
|
|
|
|
- $series = addSeries($_POST['series_add']);
|
|
|
|
|
- } else {
|
|
|
|
|
- echo '<h4 style="color: red;">Cannot save: User not authenticated</h4>';
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ # Add a series folder
|
|
|
|
|
+ $series = addSeries($_POST['series_add']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#=========================================================================================
|
|
#=========================================================================================
|