Commit 5a100825 authored by Emiliano Balbuena's avatar Emiliano Balbuena
Browse files

Merge remote-tracking branch 'origin/master' into goal/email-verification

parents 5ddf644e 42417e78
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -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();


+9 −0
Original line number Original line Diff line number Diff line
@@ -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);
+3 −1
Original line number Original line Diff line number Diff line
@@ -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'
+8 −8
Original line number Original line Diff line number Diff line
@@ -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');


+6 −6
Original line number Original line Diff line number Diff line
@@ -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