<?php
/*
Generated by OutputBooks Team
*/

if (!defined("\x42\x41\123\x45\x50\x41\124\110")) {
    exit("\x4e\x6f\40\144\151\x72\145\x63\x74\x20\x73\x63\x72\x69\x70\164\40\141\143\x63\145\x73\x73\40\x61\x6c\154\x6f\167\x65\x64");
}
class Oauth2 extends MY_Controller
{
    function __construct()
    {
        parent::__construct();
        $this->load->model("\x6f\x61\x75\x74\150\62\x4d\157\x64\145\x6c");
    }
    public function connected($app = "\147\157\157\x67\154\145")
    {
        goto x0BaE;
        NJamR:
        $this->response->write();
        goto pJdPb;
        yTYyU:
        if ($result) {
            $this->response->success();
        } else {
            $this->response->error();
        }
        goto NJamR;
        x0BaE:
        $result = $this->oauth2Model->connected($app);
        goto yTYyU;
        pJdPb:
    }
    public function connect($app = "\147\157\157\147\x6c\145")
    {
        $result = $this->oauth2Model->connect($app);
    }
    public function disconnect($app = "\147\157\157\x67\x6c\x65")
    {
        goto hhj6V;
        INImK:
        $this->response->write();
        goto EuanE;
        znQiG:
        $this->response->success("\x44\151\163\x63\x6f\x6e\x6e\145\143\164\x65\144");
        goto INImK;
        hhj6V:
        $this->oauth2Model->disconnect($app);
        goto znQiG;
        EuanE:
    }
    public function callback($app = "\147\x6f\157\x67\154\x65", $code = '')
    {
        $result = $this->oauth2Model->callback($app, $code);
        if ($result) {
            echo "\74\x73\143\162\x69\x70\x74\x3e\x77\x69\156\144\157\x77\x2e\x6f\x70\x65\156\145\162\x2e\x6c\x6f\143\x61\164\151\x6f\156\x2e\x72\x65\154\x6f\141\x64\x28\51\x3b\x77\151\156\x64\157\x77\x2e\143\x6c\x6f\163\145\x28\51\x3b\x3c\x2f\x73\143\x72\151\160\164\x3e";
        } else {
            goto Nu8r4;
            yHdXZ:
            if ($this->oauth2Model->message) {
                echo "\x61\x6c\145\162\x74\50\x27" . $this->oauth2Model->message . "\x27\51\73";
            }
            goto KU2X4;
            Nu8r4:
            echo "\x3c\163\143\162\x69\x70\x74\76";
            goto yHdXZ;
            KU2X4:
            echo "\167\x69\x6e\144\x6f\x77\56\x63\x6c\x6f\x73\x65\x28\x29\x3b\x3c\x2f\x73\x63\162\x69\160\164\x3e";
            goto Q0LXq;
            Q0LXq:
        }
    }
    public function save($app = "\147\x6f\x6f\x67\154\x65")
    {
        goto QLfGt;
        QLfGt:
        $data = $this->request->post();
        goto unxG_;
        QMgql:
        $this->response->write();
        goto bsjsg;
        unxG_:
        $resp = $this->oauth2Model->saveSettings($app, $data);
        goto DDeEM;
        DDeEM:
        if (!empty($resp)) {
            $this->response->success("\x53\141\x76\145\x64\x20\x53\165\x63\x63\145\163\163\146\165\154\154\x79");
        }
        goto QMgql;
        bsjsg:
    }
    public function dirs()
    {
        goto VKG67;
        VKG67:
        $dirs = $this->oauth2Model->getdirs();
        goto qineg;
        gC6rZ:
        $this->response->write();
        goto oPH3N;
        qineg:
        if (!empty($dirs)) {
            $this->response->success();
            $this->response->set_data("\151\164\x65\x6d\163", $dirs, true);
        } else {
            if ($this->oauth2Model->message) {
                $this->response->success($this->oauth2Model->message);
            }
        }
        goto gC6rZ;
        oPH3N:
    }
    public function files($folderID = '')
    {
        goto ZABwF;
        nGON2:
        $this->response->write();
        goto R2NIP;
        ZABwF:
        $files = $this->oauth2Model->getfiles($folderID);
        goto Rbq83;
        Rbq83:
        if (!empty($files)) {
            $this->response->success();
            $this->response->set_data("\x69\x74\x65\155\x73", $files, true);
        } else {
            if ($this->oauth2Model->message) {
                $this->response->success($this->oauth2Model->message);
            }
        }
        goto nGON2;
        R2NIP:
    }
    public function download($fileID = '')
    {
        goto Rsni3;
        rxst8:
        $this->response->write();
        goto mAQSi;
        inNwl:
        $files = $this->oauth2Model->download($fileID);
        goto hFZxx;
        hFZxx:
        if (!empty($files)) {
            $this->response->success();
            $this->response->set_data("\x69\164\x65\155\x73", $files);
        } else {
            if ($this->oauth2Model->message) {
                $this->response->success($this->oauth2Model->message);
            }
        }
        goto rxst8;
        Rsni3:
        if (!$fileID) {
            goto y5dds;
            tuWvW:
            return false;
            goto Itc5C;
            y5dds:
            $this->response->error("\x46\x69\154\145\40\x49\144\40\x4d\151\163\x73\x69\x6e\147");
            goto juhSX;
            juhSX:
            $this->response->write();
            goto tuWvW;
            Itc5C:
        }
        goto inNwl;
        mAQSi:
    }
}
