*.flv Movies won´t play by restricted Access

Kleiner Kobold

Joined: 2009-02-17
Posts: 43
Posted: Sun, 2010-06-06 09:04

Hi,

i installed as an upgrade from Pre Release to RC1 (Santa Fe), and now i have a Problem: i uploaded some *.flv Movies which should be seen only by a Special Group.

So lets say i have a Group called "Family"

now i have an Album Called "Daughter"
this Album Contain 3 Subfolders:

"Pictures", "Movies" and "Pictures made by Daughter"

when i give Access to "Everybody" for the Folder "Movies" the Movies are playing, as soon as i Restrict the Access only to "Family" the movies want play anymore then i found a Phenomenon: the movies i started with Access to everybody will play also after i restricted the Access only to family.

The same happens if i move the Folder to the Main folder and it doesent make a Difference if i create the folder directly in the Main Folder.

oh, and if i try it with IE 8 i get this Error:

[img]http://drinkuth.name/Bilderspeicher/gallery.JPG[/img]

Any Sugggestions or Solutions?

Kind Regards

Chris

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2010-06-06 17:11

Upgrade again to a experimental version.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Kleiner Kobold

Joined: 2009-02-17
Posts: 43
Posted: Sat, 2010-07-31 22:50

Hi,

i upgraded to the latest release... RC2

now it wont play anyhow it doesent matter how the Permission are set and i didnt get an Error either.

So what can i do?

Thanks for Helpfull answers

Kind Regards Chris

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2010-08-01 00:07

RC2 is not the experimantal version:
upgrade to the latest code

Please read this thread s awell, might be related
http://gallery.menalto.com/node/97179

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
sumtig

Joined: 2010-07-29
Posts: 4
Posted: Mon, 2010-08-02 15:34

Somehow I think it is related to my large FLV issue. See my post for details.
How big is your *.flv files? what is the memory_limit in your php.ini?

 
Kleiner Kobold

Joined: 2009-02-17
Posts: 43
Posted: Mon, 2010-08-02 16:39

Hi,

sorry dindt had time yet will try it this Weekend
but as far as i know the limit is about 64 MB

and the files are all not larger then 20 MB

Kind Regards

Chris

 
Kleiner Kobold

Joined: 2009-02-17
Posts: 43
Posted: Fri, 2010-08-06 20:21

Ok, so,

the Memory is set up to 512M and the biggest file is about 128M the smallest is 1M it doesent matter which one i start it wont play.

i upgraded to the newest Code. but it still wont play, all what i see is a big white nothing, no Error Message no Movie:

[img]http://drinkuth.name/Bilderspeicher/novideo.jpg[/img]

so my idea is to use a different player like flowplayer but my Programming Level is far far beyond to implement the flowplayer... is there a package i can use?
Or a step by step instruction made for idi... eh Beginners?

Kind Regards Chris

 
Kleiner Kobold

Joined: 2009-02-17
Posts: 43
Posted: Sat, 2010-08-07 19:53

ok, i didn´t get a video only the Player pops up for a short time.

forget the thing about the different Player as i saw it is allredy the Flowplayer installed.

@floridave:

i installed this version as of the Link you posted:

http://sourceforge.net/project/showfiles.php?group_id=7130&package_id=308580

and the memory in php.ini is set to 128M or could be there another php.ini and how can i find this out?

Kind regards

Chris

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2010-08-09 05:47

try this version:
http://github.com/gallery/gallery3/archives/master

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
rlparadise

Joined: 2009-12-27
Posts: 65
Posted: Tue, 2010-08-10 16:58

All,

I am troubleshooting a similar problem (mp4 vs flv) on this thread with the current GIT version http://github.com/gallery/gallery3/archives/master:

http://gallery.menalto.com/node/97138

I have some hacks but will post when I figure anything out. In earlier versions of G3, I had a workaround that I posted in this thread:

http://gallery.menalto.com/node/93658

I was seeing the same "stream not found error" or blank screen but I cannot reproduce that in the latest GIT. So, if you haven't pulled in the latest, feel free to try the workaround from above.

 
rlparadise

Joined: 2009-12-27
Posts: 65
Posted: Tue, 2010-08-10 17:02

Chris,

For what it is worth, I don't think this is a Flowplayer or G3 issue. I now think it is at the PHP or Apache level so I wouldn't go to the effort of trying to implement a custom player in your G3 install.

 
rlparadise

Joined: 2009-12-27
Posts: 65
Posted: Wed, 2010-08-11 05:24

Chris,

I am now thinking this one line code change will fix your problem:

http://gallery.menalto.com/node/93658

I assume this happens for all FLV files that are restricted access?

 
Kleiner Kobold

Joined: 2009-02-17
Posts: 43
Posted: Fri, 2010-09-03 21:05

Hi,

sorry for late Answer, was a little Bussy, i tried it, but won´t work.

it looks like before

[img]http://drinkuth.name/Bilderspeicher/error%20Gallery.JPG[/img]

and the File looks like this:

<?php defined("SYSPATH") or die("No direct script access.");
/**
 * Gallery - a web based photo album viewer and editor
 * Copyright (C) 2000-2010 Bharat Mediratta
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
 */
/**
 * Proxy access to files in var/albums and var/resizes, making sure that the session user has
 * access to view these files.
 *
 * Security Philosophy: we do not use the information provided to find if the file exists on
 * disk.  We use this information only to locate the correct item in the database and then we
 * *only* use information from the database to find and proxy the correct file.  This way all user
 * input is sanitized against the database before we perform any file I/O.
 */
class File_Proxy_Controller extends Controller {
  public function __call($function, $args) {
    // request_uri: gallery3/var/trunk/albums/foo/bar.jpg
    $request_uri = rawurldecode(Input::instance()->server("REQUEST_URI"));

    $request_uri = preg_replace("/\?.*/", "", $request_uri);

    // var_uri: gallery3/var/
    $var_uri = url::file("var/");

    // Make sure that the request is for a file inside var
    $offset = strpos(rawurldecode($request_uri), $var_uri);
    if ($offset !== 0) {
      throw new Kohana_404_Exception();
    }

    $file_uri = substr($request_uri, strlen($var_uri));

    // Make sure that we don't leave the var dir
    if (strpos($file_uri, "..") !== false) {
      throw new Kohana_404_Exception();
    }

    list ($type, $path) = explode("/", $file_uri, 2);
    if ($type != "resizes" && $type != "albums" && $type != "thumbs") {
      throw new Kohana_404_Exception();
    }

    // If the last element is .album.jpg, pop that off since it's not a real item
    $path = preg_replace("|/.album.jpg$|", "", $path);
    $encoded_path = array();
    foreach (explode("/", $path) as $path_part) {
      $encoded_path[] = rawurlencode($path_part);
    }
    $encoded_path = implode("/", $encoded_path);
    // We now have the relative path to the item.  Search for it in the path cache
    // The patch cache is urlencoded so re-encode the path. (it was decoded earlier to
    // insure that the paths are normalized.
    $item = ORM::factory("item")
      ->where("relative_path_cache", "=", $encoded_path)->find();
    if (!$item->loaded()) {
      // We didn't turn it up.  It's possible that the relative_path_cache is out of date here.
      // There was fallback code, but bharat deleted it in 8f1bca74.  If it turns out to be
      // necessary, it's easily resurrected.

      // If we're looking for a .jpg then it's it's possible that we're requesting the thumbnail
      // for a movie.  In that case, the .flv, .mp4 or .m4v file would have been converted to a
      // .jpg. So try some alternate types:
      if (preg_match('/.jpg$/', $path)) {
        foreach (array("flv", "mp4", "m4v") as $ext) {
          $movie_path = preg_replace('/.jpg$/', ".$ext", $encoded_path);
          $item = ORM::factory("item")->where("relative_path_cache", "=", $movie_path)->find();
          if ($item->loaded()) {
            break;
          }
        }
      }
    }

    if (!$item->loaded()) {
      throw new Kohana_404_Exception();
    }

    // Make sure we have access to the item
    if (!access::can("view", $item)) {
      throw new Kohana_404_Exception();
    }

    // Make sure we have view_full access to the original
    if ($type == "albums" && !access::can("view_full", $item)) {
      throw new Kohana_404_Exception();
    }

    // Don't try to load a directory
    if ($type == "albums" && $item->is_album()) {
      throw new Kohana_404_Exception();
    }

    if ($type == "albums") {
      $file = $item->file_path();
    } else if ($type == "resizes") {
      $file = $item->resize_path();
    } else {
      $file = $item->thumb_path();
    }

    if (!file_exists($file)) {
      throw new Kohana_404_Exception();
    }

    header("Pragma:");
    // Check that the content hasn't expired or it wasn't changed since cached
    expires::check(2592000, $item->updated);

    // We don't need to save the session for this request
    Session::instance()->abort_save();

    expires::set(2592000, $item->updated);  // 30 days

    // Dump out the image.  If the item is a movie, then its thumbnail will be a JPG.
    if ($item->is_movie() && $type != "albums") {
      header("Content-type: image/jpeg");
    } else {
      header("Content-Type: $item->mime_type");
    }
    Kohana::close_buffers(false);
    readfile($file);
  }
}

// Dump out the image.  If the item is a movie, then its thumbnail will be a JPG.
    if ($item->is_movie() && $type != "albums") {
      header("Content-type: image/jpeg");
    } else {
      header("Content-Type: $item->mime_type");
    }

    header("Content-Length: " . filesize($file));

    Kohana::close_buffers(false);
    $fd = fopen($file, "rb");
    fpassthru($fd);
    fclose($fd);

so, suggestions anyone?

Kind Regards Chris

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2010-09-04 20:15

I can't reproduce this problem with the latest code. Would you please upgrade to the latest experimental version and try again? See the link in my signature.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
Kleiner Kobold

Joined: 2009-02-17
Posts: 43
Posted: Thu, 2010-09-16 19:26

ok,

i updated to latest experimental version but still want play. Could it have something do do with the rights for the Album folder? I deleted the (Album) Folder and uploaded all movie Files again but still want play.

Maybe i wait for the Final Version and reinstall the Gallery from the Scratch

Kind Regards

Chris