Hi there.
I have 4 user groups.
1. Guest
2. Registered
3. VIP
I am using cpgshop as a photo shop plugin.
Question:
Is there a way that I can enable just certain users under the usergroup "VIP" to have access to the full size images for a specific album ?
I am willing to pay a bit if someone can help me with this.
Thank you
JohannM
( www.youth-sport-fotos.com )
<!--Coppermine Photo Gallery 1.5.28 (stable)-->
Please upgrade to 1.5.40, you are at risk.
Try the Fullsize Access plugin:
http://forum.coppermine-gallery.net/index.php/topic,74870.msg360460.html#msg360460
Jeff
Thanx for the reply.
What I mean is to controll access to full size images "per specific user", not a "suer group".
Regards
Johann
Coppermine's access is based around groups... You can define users to multiple groups, and if ANY group has access, the user will have access...
You could add group VIPFullsize and add it as an additional group to those in VIP that should have access to full-size images (setting group access with the plugin Jeff mentioned...)
Or even go further to VIPFullsizeAlbumx...
Hi Gmc
Im not really understanding your reply.
I will try to make it a bit more clear. I want to grant a certain/specific user "VIP" access to a specific "Album" ....
Is this possable ?
My site: http://int.youth-sport-fotos.com
Regards
Johann
As suggested, you will need to create a group with the specific permissions you wish, in this case access to full size images. You then simply add the user you wish to have these permissions to that group.
Sorry, I might sound stupid (again) ... how to you add a specific user to the group I created "VIP" which have permissions to view thumbs, intermediate and larger photo.
Thanx for your reply.
Sorry ... I read your rely again.
Ok, first ... I did create a group called "VIP" with all access right.
E.g. the user George1234 I grant access to the group VIP ....
Issue still is: I want to restrict this user to a specific Album, since I sell "VIP" downloads (per album). But I don't want this user to be able to download the full size images for any album, but only from a spesific album.
With aother words: Group:User:Album
Hope this make sence.
Quote from: JohannM on March 20, 2016, 12:39:50 PM
Issue still is: I want to restrict this user to a specific Album, since I sell "VIP" downloads (per album). But I don't want this user to be able to download the full size images for any album, but only from a spesific album.
With aother words: Group:User:Album
You would need to create a group "VIPAlbum1" and grant access to those that can view fullsize images from Album1...
Repeat for each album...
However, unless you are using some form of access restrictions on webserver - or a plugin like Mask URL http://forum.coppermine-gallery.net/index.php/topic,78168.0.html (http://forum.coppermine-gallery.net/index.php/topic,78168.0.html) that hides the true file names and paths - it is quite easy for a knowledgeable CPG user to guess the path to the fullsize image and access it outside of CPG...
Thanx gcm
I do have over 400 albums and 1.6 mil pics, so protecting them is vital.
Quote from: gmc on March 20, 2016, 02:56:12 PM
However, unless you are using some form of access restrictions on webserver - or a plugin like Mask URL http://forum.coppermine-gallery.net/index.php/topic,78168.0.html (http://forum.coppermine-gallery.net/index.php/topic,78168.0.html) that hides the true file names and paths - it is quite easy for a knowledgeable CPG user to guess the path to the fullsize image and access it outside of CPG...
Quote from: JohannM on March 20, 2016, 04:27:54 PM
Thanx gcm
I do have over 400 albums and 1.6 mil pics, so protecting them is vital.
Apply this: hotlinking to redirect to the page that contains the image http://forum.coppermine-gallery.net/index.php/topic,76683.0.html (http://forum.coppermine-gallery.net/index.php/topic,76683.0.html) and users can no longer view your image from google images or type in the browser your_gallery.com/albums/album_name/image_name.jpg
Thanx. I will check this out.
What I did now is I created User Groups for each album (e.g. VIP-Album1, VIP-Album2, etc.) with full access: thumbnail, intermediate and full size.
With user manager, I Choose e.g. User 1, and gave this user permission for full access via VIP-Album 1. But when User 1 login, he can still see and download all other full size images in other albums.
I can not assign this group via Album Manager" where it says "Album can be viewed by e.g. VIP-Album1, because if I do this, the whole album gets excluded for guest and normal registered users.
Maybe "paid help" or a new plugin whould solve this ?
For example: Access Rights .... 1 Column (choose user), second colum ( select album(s) ), third colum (select access level e.g. thums, intermediate, and or full size).
I think a lot of coppermine users will find this very helpfull.
Any suggestions ?
Thanx in advance.
I just replied to your related question in the fullsize access plugin thread: http://forum.coppermine-gallery.net/index.php/topic,74870.msg381248/topicseen.html#msg381248
It looks to me that what Johann is looking for is actually an override buy each user (instead of groups) that would allow full-size access to selected albums. The needed plugin would have to add a field to the user record that contains a serialized array of albums and access levels used to override what is set for their group. Or perhaps the user_profile6 field could be used.
[edit]
Or, going the other way, an added album field with some designated user overrides for their group access_level. (probably better this way)
André and ron4mac
Thanx for your inputs. It helped a lot.
Yes, I think a plugin for this would be great. Its a pitty my php knowledge is so poor, otherwise I would have done such a plugin myself.
To do this kind of plugin, I would prefer to begin with the user, since certain (one or more) albums is "assigned" to the user to be able to access full size. Log system (like in the fullzise plugin) would also be great.
Should I request somewhere (under plugin thread) for someone to look into this. Im sure a lot of coppermine users will be glad to contribute a small donation towards such a plugin.
Best Regards
JohannM
First of all we need to know which level of security you need:
1. hide the link to the full-sized pictures (easy to bypass for users who are familiar with Coppermine)
2. mask the actual URLs to your pictures files (hard to bypass, as people need to guess files names)
3. restrict access to the actual full-sized pictures (most security)
It should be quite easy to grant access to the full-sized pictures basing on a combination of the user ID and album ID. Most effort will be to create a user friendly GUI, so if you're fine to maintain this with a text editor in a PHP file, it'll be a simple mod.
André
I think the mask url idea is very good, in fact I tested the plugin, but I think a "mask url" combined with the "restricted access to full size" will be best if possable.
Since it is mostly standard for normal registered users to see both thumbs and intermediates, I think most coppermine users would prefer, or even suggest, that the full-size picture is most important, especially for those of us that sells our content for an income.
I am slightly familiar with php, and sometimes with a lot of efford I did some custom tweaks and changes to work better for the purpose of my own sites.
But for me to create a user friendly GUI and then the rest of the php code to be able to write such a plugin, awww, don't think I will know how and where to start.
As you said, it be a simple mod ... or plugin ?
Best Regards
JohannM
Quote from: JohannM on March 22, 2016, 03:22:35 PM
I think a "mask url" combined with the "restricted access to full size" will be best if possable.
I haven't tested the combination of both. Actually, if the fullsize access plugin is setup correctly, there's usually no need for the mask url plugin. Just tell us which way you want to go. Then we can create custom code. Unfortunately you haven't answered my question if it's okay for you to maintain the user-based fullsize access with a text editor.
André
As per your suggestion, I would then say as per your previous post for security the "3. restrict access to the actual full-sized pictures (most security)
" would be the best then.
Im not sure if I understand your statement"maintain the user-based fullsize access with a text editor".
If you mean I open a text base section on the "admin" page and add usernames or user id's, that would be also fine. Not a problem.
Or do I misunderstood ?
I thought of editing the file with your favorite text editor and upload it via FTP to your server.
André
O .... yes, sure. not a problem. I do have my moments ... sorry.
Yes, tahnx, I can do that.
Create a file "access.php" in plugins/fullsize_access. Each line needs to contain the following data:
<USER_ID> <ALBUM_ID>
(USER_ID and ALBUM_ID are separated by space). Example:
1 1
2 1
1 2
1 3
2 6
3 8
Now, replace the content of fullsize_check.php with this:
<?php
function fullsize_check_user() {
if (GALLERY_ADMIN_MODE) {
return true;
}
if (!USER_ID) {
return false;
}
global $CONFIG;
$superCage = Inspekt::makeSuperCage();
$pid = $superCage->get->getInt('pid');
$aid = mysql_result(cpg_db_query("SELECT aid FROM {$CONFIG['TABLE_PICTURES']} WHERE pid = $pid"), 0);
$access = file_get_contents('plugins/fullsize_access/access.php');
$access = str_replace("\r", "\n", $access);
$access = str_replace("\n\n", "\n", $access);
$lines = explode("\n", $access);
foreach ($lines as $line) {
$user_id = NULL;
$album_id = NULL;
list($user_id, $album_id) = explode(" ", trim($line));
if (USER_ID == $user_id && $aid == $album_id) {
return true;
}
}
return false;
}
?>
As you can see, I already added general access for the admin user and denied for unregistered users. If you don't like that, change it to your needs. Additionally, I removed the check for
$superCage->cookie->getInt($CONFIG['cookie_name'].'_agb')
as I wasn't asked to accept anything while testing. Of course it's possible to re-add this check, if needed. Just let me know.
Thanx André
Got it to work fine. Thanx a lot for your input. Much appreciate it.
Hope this plugin can be changed sometime to make it a bit easier. But for now, I am 100% happy.
Hi André
Just two more things.
1. If someone download a photo, I get a text "Fullsize image <051-MB1-0004.jpg> has been downloaded by user <User1234>
Users email address is : User1234@whatever.com"
Q: Can we add the users IP address to this ?
2. Can I add a domain name (e.g. boy-dols.com_051-MB1-0004.jpg with "boy-dols.com_" prefixed before the filename) to the filename that is downloaded ?
Thanx in advance.
Best
JohannM
Quote from: JohannM on April 22, 2016, 09:27:46 AM
1. If someone download a photo, I get a text "Fullsize image <051-MB1-0004.jpg> has been downloaded by user <User1234>
Users email address is : User1234@whatever.com"
Q: Can we add the users IP address to this ?
Open
fullsize_secure, find
function download_mail($filename,$uid) {
global $CONFIG;
and replace with
function download_mail($filename,$uid) {
global $CONFIG, $raw_ip;
find
"\nUsers email address is : " . $row[1];
and replace with
"\nUser's email address is : " . $row[1] . "\nUser's IP address is : " . $raw_ip;
Quote from: JohannM on April 22, 2016, 09:27:46 AM
2. Can I add a domain name (e.g. boy-dols.com_051-MB1-0004.jpg with "boy-dols.com_" prefixed before the filename) to the filename that is downloaded ?
Open
jpgdownload.php, find
header('Content-Disposition: attachment; filename=' . basename($file));
and replace with
header('Content-Disposition: attachment; filename=boy-dols.com_' . basename($file));
André
Wow, that was fast ... I will do changes and report back.
Thanx a million.
Btw, the zip download of entire album is disabled due to library shorting ... will it be a mission to change that ?
Best
JohannM
Quote from: JohannM on April 22, 2016, 10:03:03 AM
the zip download of entire album is disabled due to library shorting
Is this related to the fullsize_access plugin?
Yes.
In codebase.php line 9 :
// ZIP download feature disabled (doesn't work because of missing library)
//$thisplugin->add_action('post_breadcrumb','ziplink');
Would be nice to have this working though.
Open codebase.php, find
//$thisplugin->add_action('post_breadcrumb','ziplink');
and replace with
$thisplugin->add_action('post_breadcrumb','ziplink');
Open zipdownload_extended.php, find
$zip = new zipfile($cwd,$flags);
$zip->addfiles($files);
$zip->filedownload('pictures.zip');
and replace with
$options = array(
'inmemory' => 1,
);
$zip = new archive($cwd,$flags);
$zip->set_options($options);
$zip->add_files($files);
$zip->download_file('pictures.zip');
This adds the link and opens a download dialog for me. Unfortunately, the file name is wrong and the file doesn't contain anything. I've currently no time to have a closer look at this, so I posted what I got.
By the way, I don't think that this request is related to your initial question. Additionally, you also posted an issue in the plugin announcement thread of the Download complete album as ZIP (http://forum.coppermine-gallery.net/index.php/topic,74257.0.html) plugin. If you want to use that plugin, I suggest to fix the other plugin and drop the idea of fixing that functionality of the fullsize_access plugin.
André
I made the changes on the zip section, but I do not get a link and does not open a dialog for me. Where does this open a link for you and what does this dialogue looks like ?
Should I enable zip downloads in main config or just in the config of the plugin ?
Regards
JohannM
First of all: sorry, it wasn't you who posted the issue in the other thread: http://forum.coppermine-gallery.net/index.php/topic,74257.msg381466.html#msg381466
The plugin checks if you're allowed to download pictures. Maybe we need to adjust your custom mod to display the download link. I'll check that later.
Hi Αndré
Sorry to bother again. I need to ask you another big favour.
The mods for full access works fine, but I still have a group "VIP" which is uder group "4".
In the file "fullsize_check.php" there's a part
"
function fullsize_check_user() {
if (GALLERY_ADMIN_MODE) {
return true;
}
if (!USER_ID) {
return false;
}
etc . "
How can I script it to allow also allow full access to the usergroup "4" as it does with the part " if (GALLERY_ADMIN_MODE) {
return true; "
Im not sure how to add it.
Also, have you managed to check the plugin yet to allow the zip download function yet ?
Thanx in advance
Regards
JohannM
Quote from: JohannM on June 14, 2016, 08:25:49 PM
How can I script it to allow also allow full access to the usergroup "4" as it does with the part " if (GALLERY_ADMIN_MODE) {
return true; "
Add,
global $USER_DATA;
if (in_array(4, $USER_DATA['groups'])) {
return true;
}
below
if (GALLERY_ADMIN_MODE) {
return true;
}
Quote from: JohannM on June 14, 2016, 08:25:49 PM
have you managed to check the plugin yet to allow the zip download function yet ?
No, sorry.
Thanx a lot André
I just had a look at your other issue. In codebase.php we find this code:
function ziplink(){
global $CONFIG;
$superCage = Inspekt::makeSuperCage();
if ($CONFIG['plugin_ks_fullsize_zip'] != 0 ){
if( $superCage->get->testInt('album') and !$superCage->get->keyExists('pid') and fullsize_check_user()){
echo '<div class="tableh1"><b>';
echo '<a style="color:white; text-align:right;" href="plugins/fullsize_access/zipdownload_extended.php?album=' . $superCage->get->getInt('album') . '" >Download aller Bilder dieses Albums als ZIP Datei</a>';
echo '</b></div>';
}
if( strstr($superCage->get->getAlpha('album'),'favpics') != false and !$superCage->get->keyExists('pid') and fullsize_check_user()){
echo '<div class="tableh1"><b>';
echo '<a style="color:white" href="plugins/fullsize_access/zipdownload_extended.php?fav' . '" >Download aller Favoriten als ZIP Datei</a>';
echo '</b></div>';
}
}
}
First of all, please check if $CONFIG['plugin_ks_fullsize_zip'] is "1" (have a look at the config table in your Coppermine MySQL database). If so, with your last modification, the download button should be displayed for all admins and users of your VIP group.
Hi André
I have checked "if ($CONFIG['plugin_ks_fullsize_zip'] != 0" and change it to "if ($CONFIG['plugin_ks_fullsize_zip'] != 1", and also checked that the "plugin_ks_fullsize_zip" is set to 1, but I did not managed to get a link to "Download aller Favoriten als ZIP Datei" ....
Where is this link suppose to show ?
Regards
JohannM
André
Sorry, got the link now. I will just make it a bit more visable. Thanx.
I will test it and report.
Thanx so far.
André
Im testing and get this error.
"Fatal error: Class 'zipfile' not found in /home/boyidols/public_html/plugins/fullsize_access/zipdownload_extended.php on line 125"
Quote from: JohannM on June 17, 2016, 11:55:57 AM
"Fatal error: Class 'zipfile' not found in /home/boyidols/public_html/plugins/fullsize_access/zipdownload_extended.php on line 125"
Please have a look at my instructions in this post: http://forum.coppermine-gallery.net/index.php/topic,78547.msg381485.html#msg381485
As it probably also won't work for you, I suggest to use the "download all albums as zip file" plugin and add a check for
fullsize_check_user() at some places to restrict access.
Hi André
First of all, a very happy and prosperous 2017 for you.
Question: The cript is working fine for me now. My customers asked me now if it is possible to download a zip file contaning all the photos. Not to use other scripts, I compressed the files into a zip. Now, (as I coded it with your help ), the "DOWNLOAD FULL SIZE IMAGE" button is above the intermediate photo, but does not appear above the "zip" file. Anyway to fix this that it shows on top of zip file also ? I have VIP usergroup that allows HR downloads only.
Thanx, and hoping for a reply soon.
Best Regards
JohannM
Sorry for the late reply. Does the issue still exists? If so, please give me some more information of the current state, as I haven't re-read the whole thread. It seems you want to re-arrange links, that are inserted by different mods/plugins?
Hello André
Its all find. A late reply is better than non at all.
I will try to explain as brief as possable. You helped me with some code and mod for a certain usergroup/register user to download the full size image via a botton (link) once I granted permission to them.
The problem now is, once I compress the complete directory (e.g. with 2000 pics inside), by default coppermine anable registered members and other user groups I creaded ( 3 = VIP ) and ( 4 = SUPER VIP).
1. How can I prevent normal visitors (guests) and normal registered users to download this zip file ?
2. Is there a short way to code that I can enable/disable cetrain galeries/albums for showing the "Download Full Resolution" photos ?
Thanx in advance, looking forward to your answer/help
Greetings ... Johann
So we've 2 issues here:
1. You want to prevent certain user groups to download a zip file. Is this zip file created and provided by you, or is there a button which compresses the directory on the fly, each time a user hits the button?
2. If I remember correctly you use the fullsize_access plugin to allow access to the full-sized pictures, right? If so, we need to have a closer look at that plugin.
André
Yes, the plugin used are the "fullsize_access" plugin.
The zip file I created I do within unix (to prevent me from uploading the complete zip from all over). I compress the zip, create a custom thumb. But like I said, even registered user can download the zip as it is coppermine's default. I just want e.g. Super Vip members to be able to download the zip.
Like with this plugin, if I make a member "Super VIP", a botton apears to "Download Full Size Image" ... I want to be able to have another butten e.g. "Download All Photos within this album as Zip".
Also, is there a way (small mod) to enable/disable downloads from a spesific album (e.g. a setting in album properties) like you have when settings can be changed who can "View / See" an album ?
Thanx yet again. Wish 1.6 can come out now !
Regards
Johann
Quote from: JohannM on July 03, 2017, 10:35:01 AM
The zip file I created I do within unix (to prevent me from uploading the complete zip from all over). I compress the zip, create a custom thumb. But like I said, even registered user can download the zip as it is coppermine's default. I just want e.g. Super Vip members to be able to download the zip.
So what exactly are you doing? Do you add a link to that file somewhere in the album, or do you actually add that file to Coppermine (e.g. via batch-add)?
Quote from: JohannM on July 03, 2017, 10:35:01 AM
Also, is there a way (small mod) to enable/disable downloads from a spesific album (e.g. a setting in album properties) like you have when settings can be changed who can "View / See" an album ?
Please start a new thread, we're already dealing with too much different issues in this thread.
I do not batch add the zip file. I simple compress the images withing a folder (which is connected to an album) with unix commands.
So, basicly, if there is a zip file present, to have the ability disbale or enable it for a spesific group, and if enabled for a spesific group to have a button / link that indicates .e.g. "Donwload full Album as Zip" just as you get a button "Download Full Size Image".
Hope this make sense.
Sorry, but I don't get the status quo. Please post a link to your gallery where I can see the link to the zip file.
http://boy-idols.com/thumbnails.php?album=1
Even visitors / unregistered users can download the zip.
Point is I want to enable/disable downloads this zip file preferable with settings in album manager ... permissions to download zip according to usergroups.
You actually add the zip file to your gallery. This is what I didn't know till now. There's a solution without any code modification or use of a plugin. Just create a new album and set the album permission "Album can be viewed by" to the group you want to allow to download the zip file. Then, move all zip files to that album and unique keywords to all zip files (e.g. "zip1", "zip2", etc.). Now you need to enter the corresponding keyword to all albums you initially moved the zip files from. While writing this you should probably assign the keyword to the zip files and albums before moving them to the restricted album ;D
Example: http://boy-idols.com/thumbnails.php?album=1
- Assign "zip1" as album keyword to the album
- Assign "zip1" as keyword to the zip file (http://boy-idols.com/displayimage.php?pid=12309)
- Create a new album "album zip files" (name it however you want, it doesn't care)
- Move the zip file to the new album "album zip files"
- Now, it works the same way as before
- Restrict the permissions of the new album "album zip files"
- Now, the zip file is only displayed in album 1 to users which have access to "album zip files"
André
It can work as you described.
My problem is that only user "Piet" is purchasing Album 1 for example. Then user "Gert" is purchasing Album 2 for example. Having all the zips in one album will cause "Piet" to be able to download both zip files, as where he only paid for Album 1.
Q: Where does the script / how does the script in fullsize_access know it is a jpg file and full size ? Can't one just add the extention "zip" to it ?
Kind of complicated for me.
Quote from: JohannM on July 03, 2017, 04:13:57 PM
Q: Where does the script / how does the script in fullsize_access know it is a jpg file and full size ? Can't one just add the extention "zip" to it ?
I haven't checked the code or tested this yet in a vanilla gallery, but maybe a zip file don't need "full-size" access to enable the download.
Proposal: don't add the zip files to your gallery at all, but send the link to the zip file(s) to Piet, Gert, etc. after they purchased one or more albums. This way you don't need to mess around with code.