Exemple #1
0
     $skillet = new Skillet($auth);
     $skillet->requestUser($_POST["requestUser"]);
     print $skillet->printOutput();
 } else {
     if (isset($_POST["removeUser"])) {
         $skillet = new Skillet($auth);
         $skillet->removeUser($_POST["removeUser"]);
         print $skillet->printOutput();
     } else {
         if (isset($_POST["hideUnhideUser"])) {
             $skillet = new Skillet($auth);
             $skillet->hideUnhideUser($_POST["hideUnhideUser"]);
             print $skillet->printOutput();
         } else {
             if (isset($_POST["acceptUser"])) {
                 $skillet = new Skillet($auth);
                 $skillet->acceptUser($_POST["acceptUser"]);
                 print $skillet->printOutput();
             } else {
                 if (isset($_POST["profile_img"])) {
                     $content_id = $_POST["content_id"];
                     $file = $_POST["profile_img"];
                     $profile = new Profile($auth);
                     if (isset($_POST["unset"]) && $_POST["unset"] == "true") {
                         $profile->setProfileImage("");
                     } else {
                         $profile->setProfileImage($content_id . "/img_profile_" . $file . ".jpeg");
                     }
                     print $profile->printOutput();
                 }
             }
Exemple #2
0
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
**/
require_once 'rangeDownload.php';
require_once 'mime_content_type.php';
require_once 'Auth.php';
require_once 'Skillet.php';
require_once 'Utils.php';
$auth = new Auth();
try {
    $auth->authenticate();
    $utils = new Utils($auth);
    $file = $_GET["media"];
    $mediaArr = explode("/", $file);
    $skillet = new Skillet($auth);
    $check_user_skillet = $skillet->checkSkilletWithUserName(trim($mediaArr[1]));
    if (!$check_user_skillet) {
        $auth->setOutput(Auth::$FAIL, "The owner of this media is not in your skillet.");
        throw new Exception();
    }
    $contentDisposition = "inline";
    if (isset($_GET["original"])) {
        $contentDisposition = "attachment";
    }
    $path = $utils->get_path() . "/" . $file;
    if (file_exists($path)) {
        header("Content-Type:  " . mime_content_type($file));
        // do it for any device that supports byte-ranges not only iPhone
        if (isset($_SERVER['HTTP_RANGE'])) {
            rangeDownload($file);