Fix references to site in api.php.

(cherry picked from commit c301393)
This commit is contained in:
Darko
2015-06-08 09:29:27 +02:00
parent 26926daef0
commit 178913091c
+4 -3
View File
@@ -1,5 +1,6 @@
<?php
use newznab\utility\Utility;
use newznab\db\Settings;
$rc = new ReleaseComments;
@@ -94,8 +95,8 @@ if ($page->users->isLoggedIn()) {
//
// A hash of the users ip to record against the api hit
//
if ($page->site->storeuserips == 1)
$hosthash = $page->users->getHostHash($_SERVER["REMOTE_ADDR"], $page->site->siteseed);
if ($page->settings->getSetting('storeuserips') == 1)
$hosthash = $page->users->getHostHash($_SERVER["REMOTE_ADDR"], $page->settings->getSetting('siteseed'));
$maxRequests = $res['apirequests'];
}
}
@@ -441,7 +442,7 @@ switch ($function) {
case 'r':
verifyEmptyParameter('email');
if (!in_array((int)$page->site->registerstatus, [Sites::REGISTER_STATUS_OPEN, Sites::REGISTER_STATUS_API_ONLY])) {
if (!in_array((int)$page->settings->getSetting('registerstatus'), [Settings::REGISTER_STATUS_OPEN, Settings::REGISTER_STATUS_API_ONLY])) {
showApiError(104);
}