Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Guests and Favorites  (Read 3461 times)

0 Members and 1 Guest are viewing this topic.

gregik

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Guests and Favorites
« on: August 24, 2004, 10:16:20 am »

Hello!

How can I restrict guests to add files to Favorites?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Guests and Favorites
« Reply #1 on: August 24, 2004, 10:25:49 am »

those are client-sided favorites, nothing is done to your page. If you want to stop them from downloading the favorites as zip, edit zipdownload.php, find
Code: [Select]
if ($CONFIG['enable_zipdownload'] != 1) {
//someone has entered the url manually, while the admin has disabled zipdownload
pageheader($lang_error);
starttable('-2', $lang_error);
print <<<EOT
<tr>
        <td align="center" class="tableb">
      {$lang_errors['perm_denied']}
      </td>
</tr>
EOT;
endtable();
pagefooter();
ob_end_flush();
} else {
and replace it with something like this (not tested though):
Code: [Select]
if ($CONFIG['enable_zipdownload'] != 1) {
//someone has entered the url manually, while the admin has disabled zipdownload
pageheader($lang_error);
starttable('-2', $lang_error);
print <<<EOT
<tr>
        <td align="center" class="tableb">
      {$lang_errors['perm_denied']}
      </td>
</tr>
EOT;
endtable();
pagefooter();
ob_end_flush();
} elseif (!$USER){
//a guest tries to download, send him away
pageheader($lang_error);
starttable('-2', $lang_error);
print <<<EOT
<tr>
        <td align="center" class="tableb">
      You don't have permission to download your favorites as zip file. If you were registered and logged in, you would be able to do so. Why don't you <a href="register.php">register now</a>?
      </td>
</tr>
EOT;
endtable();
pagefooter();
ob_end_flush();
} else {

GauGau
Logged

gregik

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Guests and Favorites
« Reply #2 on: August 24, 2004, 10:57:25 am »

Thanks!  :)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Guests and Favorites
« Reply #3 on: August 24, 2004, 10:59:05 am »

issue solved then? Did the code I posted work for you?

GauGau
Logged

gregik

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Guests and Favorites
« Reply #4 on: August 24, 2004, 11:11:05 am »

nope ... it does not work

I removed all cookies and still it downloads zip file
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 19 queries.