Are private images/albums accessible using cpmFetch or not? Are private images/albums accessible using cpmFetch or not?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Are private images/albums accessible using cpmFetch or not?

Started by slausen, April 16, 2008, 07:19:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

slausen

Hi-

I'm testing out the display of private images using cpmFetch.

It seems like there is conflicting info about how to do this, or even whether it is possible. In the "What is CpmFetch and what it can do for you... READ THIS" thread there's a section that reads "This library will not display any images that are not viewable by the world or are not in an approved state" but then further down in that same post, there's a function "cpm_unlockPrivate($bool)" and a bulleted feature "Access override into private albums"

Also, in the cpm_config file, there's an override setting '$config_overrides['cfShowPrivate']' that is supposed to cause the app to "Consider non-public albums as displayable".

I set '$config_overrides['cfShowPrivate']' to true in the cpm_config,



// slausen - enabled retrieval of prvate images - 20080414
$config_overrides['cfShowPrivate'] = 'true';






Here is the code I am using:



// slausen - initialize call to cpmfetch - 20080414
include_once "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("./cpmfetch/cpmfetch_config.php");
// $objCpm->cpm_unlockPrivate(true);
$objCpm->cpm_setReturnType('html');
$options = array( 'imagewidth' => '170');

    $template_vars = array(
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{CUSTOM_FOOTER}' => $custom_footer,
        '{VANITY}' => (defined('THEME_IS_XHTML10_TRANSITIONAL') && $CONFIG['vanity_block']) ? theme_vanity() : '',
        '{LOGIN_FORM}' => $login_form,
// slausen - added call to grab random images via cpmfetch - 20080414
'{FETCHLASTADDED}' => $objCpm->cpm_viewLastAddedMedia(4,1,$options),
    );
// slausen - close cpmfetch DB connection and destroy object - 20080414
$objCpm->cpm_close();



You will notice that in this sample the cpm_unlockPrivate() call has been commented out. If I comment out the call to cpm_unlockPrivate(), the sample works fine, with the last added public images showing up in the correct size, where I want them to in the template.

But if I uncomment the call to cpm_unlockPrivate(), the template page bombs out at the call to '{FETCHLASTADDED}'. In the below excerpt from my template file, the ADMIN_MENU and GALLERY tags evaluate (although I noticed that the "Powered by Coppermine" footer is missing from the bottom of the gallery) with the cpg front page galleries and categories showing up. But it appears that any tags after FETCHLASTADDED don't get evaluated.



{ADMIN_MENU}{GALLERY}


</center>
        </div>

                <!-- MITTLERE SPALTE -->

                <div class="sidebar">
<center>
<h3><font color="#000000">Staff Picks<br>and<br>Recent Updates</font></h3>
{FETCHLASTADDED}



I am wondering if you could confirm that this functionality has been fully implemented, or maybe provide a sample showing the correct way to enable display of private albums, so I can locate where I messed up. Thanks.

vuud

The what it is page was written long ago under.

I think the function you are looking for is

cpm_unlock_private

The doc's are the best source.  But with it in the config file, you do not need to call it anyway and it should work.

I will note this on the page.
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

slausen

Quote from: vuud on April 16, 2008, 07:38:59 AM
The what it is page was written long ago under.

I think the function you are looking for is

cpm_unlock_private

The doc's are the best source.  But with it in the config file, you do not need to call it anyway and it should work.

I will note this on the page.

Thanks vuud! The revised spelling did the trick!