Exemple #1
0
 /**
  * Constructor
  * Art constructor, takes the UID of the object and the
  * object type.
  * @param int $uid
  * @param string $type
  * @param string $kind
  */
 public function __construct($uid, $type = 'album', $kind = 'default')
 {
     if (!Art::is_valid_type($type)) {
         return false;
     }
     $this->type = $type;
     $this->uid = intval($uid);
     $this->kind = $kind;
 }
Exemple #2
0
    // Check to see if they've got an interface session or a valid API session, if not GTFO
    if (!Session::exists('interface', $_COOKIE[AmpConfig::get('session_name')]) && !Session::exists('api', $_REQUEST['auth'])) {
        debug_event('image', 'Access denied, checked cookie session:' . $_COOKIE[AmpConfig::get('session_name')] . ' and auth:' . $_REQUEST['auth'], 1);
        exit;
    }
}
// If we aren't resizing just trash thumb
if (!AmpConfig::get('resize_images')) {
    $_GET['thumb'] = null;
}
// FIXME: Legacy stuff - should be removed after a version or so
if (!isset($_GET['object_type'])) {
    $_GET['object_type'] = 'album';
}
$type = $_GET['object_type'];
if (!Art::is_valid_type($type)) {
    exit;
}
/* Decide what size this image is */
$size = Art::get_thumb_size($_GET['thumb']);
$kind = isset($_GET['kind']) ? $_GET['kind'] : 'default';
$image = '';
$mime = '';
$filename = '';
$etag = '';
$typeManaged = false;
if (isset($_GET['type'])) {
    switch ($_GET['type']) {
        case 'popup':
            $typeManaged = true;
            require_once AmpConfig::get('prefix') . UI::find_template('show_big_art.inc.php');