Loading Api/Factory.php +4 −1 Original line number Original line Diff line number Diff line Loading @@ -181,7 +181,10 @@ class Factory 'status' => 'success', //should success be assumed? 'status' => 'success', //should success be assumed? ], $data); ], $data); if (ob_get_level() > 1) { // New PSR-7 Router has an OB started all the time ob_end_clean(); ob_end_clean(); } static::setCORSHeader(); static::setCORSHeader(); Loading Controllers/api/v1/blog.php +9 −0 Original line number Original line Diff line number Diff line Loading @@ -337,6 +337,15 @@ class blog implements Interfaces\Api ]); ]); } } // This is a first create blog that should have a banner // We are trying to stop spam with this check if ($blog->isPublished() && !$editing && !is_uploaded_file($_FILES['file']['tmp_name'])) { return Factory::response([ 'status' => 'error', 'message' => 'You must upload a banner' ]); } try { try { if ($editing) { if ($editing) { $saved = $manager->update($blog); $saved = $manager->update($blog); Loading Controllers/api/v2/pro/channel.php +3 −1 Original line number Original line Diff line number Diff line Loading @@ -28,11 +28,13 @@ class channel implements Interfaces\Api */ */ public function get($pages) public function get($pages) { { $currentUser = Session::getLoggedinUser(); $channel = new User(strtolower($pages[0])); $channel = new User(strtolower($pages[0])); $channel->fullExport = true; //get counts $channel->fullExport = true; //get counts $channel->exportCounts = true; $channel->exportCounts = true; if (!$channel->isPro()) { if (!$channel->isPro() && $channel->getGuid() !== $currentUser->getGuid()) { return Factory::response([ return Factory::response([ 'status' => 'error', 'status' => 'error', 'message' => 'E_NOT_PRO' 'message' => 'E_NOT_PRO' Loading Controllers/api/v2/pro/settings.php +8 −8 Original line number Original line Diff line number Diff line Loading @@ -75,14 +75,14 @@ class settings implements Interfaces\Api ->setUser($user) ->setUser($user) ->setActor(Session::getLoggedinUser()); ->setActor(Session::getLoggedinUser()); if (!$manager->isActive()) { // if (!$manager->isActive()) { return Factory::response([ // return Factory::response([ 'status' => 'error', // 'status' => 'error', 'message' => 'You are not Pro', // 'message' => 'You are not Pro', ]); // ]); } // } if (isset($_POST['domain'])) { if (isset($_POST['domain']) && $manager->isActive()) { /** @var ProDomain $proDomain */ /** @var ProDomain $proDomain */ $proDomain = Di::_()->get('Pro\Domain'); $proDomain = Di::_()->get('Pro\Domain'); Loading Controllers/api/v2/pro/settings/assets.php +6 −6 Original line number Original line Diff line number Diff line Loading @@ -85,12 +85,12 @@ class assets implements Interfaces\Api ->setUser($user) ->setUser($user) ->setActor(Session::getLoggedinUser()); ->setActor(Session::getLoggedinUser()); if (!$manager->isActive()) { // if (!$manager->isActive()) { return Factory::response([ // return Factory::response([ 'status' => 'error', // 'status' => 'error', 'message' => 'You are not Pro', // 'message' => 'You are not Pro', ]); // ]); } // } /** @var AssetsManager $assetsManager */ /** @var AssetsManager $assetsManager */ $assetsManager = Di::_()->get('Pro\Assets\Manager'); $assetsManager = Di::_()->get('Pro\Assets\Manager'); Loading Loading
Api/Factory.php +4 −1 Original line number Original line Diff line number Diff line Loading @@ -181,7 +181,10 @@ class Factory 'status' => 'success', //should success be assumed? 'status' => 'success', //should success be assumed? ], $data); ], $data); if (ob_get_level() > 1) { // New PSR-7 Router has an OB started all the time ob_end_clean(); ob_end_clean(); } static::setCORSHeader(); static::setCORSHeader(); Loading
Controllers/api/v1/blog.php +9 −0 Original line number Original line Diff line number Diff line Loading @@ -337,6 +337,15 @@ class blog implements Interfaces\Api ]); ]); } } // This is a first create blog that should have a banner // We are trying to stop spam with this check if ($blog->isPublished() && !$editing && !is_uploaded_file($_FILES['file']['tmp_name'])) { return Factory::response([ 'status' => 'error', 'message' => 'You must upload a banner' ]); } try { try { if ($editing) { if ($editing) { $saved = $manager->update($blog); $saved = $manager->update($blog); Loading
Controllers/api/v2/pro/channel.php +3 −1 Original line number Original line Diff line number Diff line Loading @@ -28,11 +28,13 @@ class channel implements Interfaces\Api */ */ public function get($pages) public function get($pages) { { $currentUser = Session::getLoggedinUser(); $channel = new User(strtolower($pages[0])); $channel = new User(strtolower($pages[0])); $channel->fullExport = true; //get counts $channel->fullExport = true; //get counts $channel->exportCounts = true; $channel->exportCounts = true; if (!$channel->isPro()) { if (!$channel->isPro() && $channel->getGuid() !== $currentUser->getGuid()) { return Factory::response([ return Factory::response([ 'status' => 'error', 'status' => 'error', 'message' => 'E_NOT_PRO' 'message' => 'E_NOT_PRO' Loading
Controllers/api/v2/pro/settings.php +8 −8 Original line number Original line Diff line number Diff line Loading @@ -75,14 +75,14 @@ class settings implements Interfaces\Api ->setUser($user) ->setUser($user) ->setActor(Session::getLoggedinUser()); ->setActor(Session::getLoggedinUser()); if (!$manager->isActive()) { // if (!$manager->isActive()) { return Factory::response([ // return Factory::response([ 'status' => 'error', // 'status' => 'error', 'message' => 'You are not Pro', // 'message' => 'You are not Pro', ]); // ]); } // } if (isset($_POST['domain'])) { if (isset($_POST['domain']) && $manager->isActive()) { /** @var ProDomain $proDomain */ /** @var ProDomain $proDomain */ $proDomain = Di::_()->get('Pro\Domain'); $proDomain = Di::_()->get('Pro\Domain'); Loading
Controllers/api/v2/pro/settings/assets.php +6 −6 Original line number Original line Diff line number Diff line Loading @@ -85,12 +85,12 @@ class assets implements Interfaces\Api ->setUser($user) ->setUser($user) ->setActor(Session::getLoggedinUser()); ->setActor(Session::getLoggedinUser()); if (!$manager->isActive()) { // if (!$manager->isActive()) { return Factory::response([ // return Factory::response([ 'status' => 'error', // 'status' => 'error', 'message' => 'You are not Pro', // 'message' => 'You are not Pro', ]); // ]); } // } /** @var AssetsManager $assetsManager */ /** @var AssetsManager $assetsManager */ $assetsManager = Di::_()->get('Pro\Assets\Manager'); $assetsManager = Di::_()->get('Pro\Assets\Manager'); Loading