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] 2   Go Down

Author Topic: page for only registered users. What is the correct path?  (Read 8861 times)

0 Members and 1 Guest are viewing this topic.

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
page for only registered users. What is the correct path?
« on: October 23, 2008, 10:08:44 pm »

Code: [Select]
<?php
define
('IN_COPPERMINE'true);
$d getcwd();
chdir('path/to/coppermine');
require(
'include/init.inc.php'); 
chdir($d);
if (!
USER_IDcpg_die(ERROR$lang_errors['access_denied'], __FILE____LINE__);
?


if my gallery is www.maranimage.it, and the page for only registered users is in the folder called member (root), the path my gallery is this?

httpdocs/


Logged

Fabricio Ferrero

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 1996
  • From San Juan, Argentina, to the World!
    • http://fabricioferrero.com/
Re: page for only registered users. What is the correct path?
« Reply #1 on: October 24, 2008, 02:01:55 am »

The full path doesn't deal with the domain, it deppend on the server configuration. In most cases should be httpdocs/ indeed. The way to check is by FTP or the files manager of your webhost.

Try with "httpdocs/" you would not cause any harm if not the right path.  ;)
Logged
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: page for only registered users. What is the correct path?
« Reply #2 on: October 24, 2008, 08:06:26 am »

The full path doesn't deal with the domain, it deppend on the server configuration. In most cases should be httpdocs/ indeed. The way to check is by FTP or the files manager of your webhost.

Try with "httpdocs/" you would not cause any harm if not the right path.  ;)

i have try with:

chdir('/var/www/vhosts/maranimage.it/httpdocs');
require('/var/www/vhosts/maranimage.it/httpdocs/include/init.inc.php');

but show only text not any image!
Logged

Fabricio Ferrero

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 1996
  • From San Juan, Argentina, to the World!
    • http://fabricioferrero.com/
Re: page for only registered users. What is the correct path?
« Reply #3 on: October 24, 2008, 10:28:35 am »

I think this should work:

Code: [Select]
<?php
define
('IN_COPPERMINE'true);
$d getcwd();
chdir('httpdocs/www');
require(
'include/init.inc.php'); 
chdir($d);
if (!
USER_IDcpg_die(ERROR$lang_errors['access_denied'], __FILE____LINE__);
?

Do not modify "require('include/init.inc.php');" line, it's not needed. The one you have to test it's the above line.
Logged
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: page for only registered users. What is the correct path?
« Reply #4 on: October 24, 2008, 05:49:42 pm »

<?php
define('IN_COPPERMINE', true);
$d = getcwd();
chdir('httpdocs/www');
require('include/init.inc.php');
chdir($d);
if (!USER_ID) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
?>
<html>
<head>
<title>ghghgh</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
text sample
</body>
</html>
<?php
pagefooter();
?>


and this is the page ..

Coppermine Photo Gallery seems not to be installed correctly, or you are running coppermine for the first time. You'll be redirected to the installer. If your browser doesn't support redirect, click here.
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: page for only registered users. What is the correct path?
« Reply #5 on: October 24, 2008, 09:44:09 pm »

This path I see the page where it says that I do not have permits, but the images do not see that link and did not see the red x

Code: [Select]
<?php
define
('IN_COPPERMINE'true);
$d getcwd();
chdir('/var/www/vhosts/maranimage.it/httpdocs');
require(
'include/init.inc.php'); 
chdir($d);
if (!
USER_IDcpg_die(ERROR$lang_errors['access_denied'], __FILE____LINE__);
?>

look: http://www.maranimage.it/pp/
Logged

Nibbler

  • Guest
Re: page for only registered users. What is the correct path?
« Reply #6 on: October 25, 2008, 12:54:12 am »

Add a HTML base tag into your theme's template.html that points to your Coppermine directory. Make sure you put it in the head section before the stylesheet.
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: page for only registered users. What is the correct path?
« Reply #7 on: October 25, 2008, 11:30:30 am »

Add a HTML base tag into your theme's template.html that points to your Coppermine directory. Make sure you put it in the head section before the stylesheet.

my gallery is in the root and can be seen well. This is the page within another folder (which I have always created in the root whit name pp) that should be lit only to registered users. I inserted the code suggested but perhaps not the correct path.
I have another page which I introduced into the root and not inside a folder with the following code:
Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');
pageheader('Hello member');
if (!
USER_ID) {
    
cpg_die(ERROR$lang_errors['access_denied'], __FILE____LINE__);
}
?>

<html>
<head>
<title>Documento senza titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
[b]TEXT SAMPLE[/b]
</body>
</html>
<?php
pagefooter
();
?>


and working properly

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: page for only registered users. What is the correct path?
« Reply #8 on: October 25, 2008, 12:20:34 pm »

Why are you trying to do such complicated things? Why does the extra page for registered users need to reside outside of coppermine's root folder? Can't you just move that page into coppermine's root folder and everything will be dandy? You won't have to jump through loops to accomplish what you're after.
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: page for only registered users. What is the correct path?
« Reply #9 on: October 25, 2008, 12:41:23 pm »

Why are you trying to do such complicated things? Why does the extra page for registered users need to reside outside of coppermine's root folder? Can't you just move that page into coppermine's root folder and everything will be dandy? You won't have to jump through loops to accomplish what you're after.

because I read that a user has requested this and you can do it. Everything is born from the fact that I work some things like the plug-in captcha, the plugin photo_shop is not displayed and distorts the look and feel. Because from what I understand we should pay to resolve ... I try alternative routes. ;)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: page for only registered users. What is the correct path?
« Reply #10 on: October 25, 2008, 06:47:38 pm »

We're not asking you to pay anything. Who said that you have to pay? I just suggested to put your members-only page into coppermine's root folder instead of putting it someplace else. This will keep you out of harms way with all the include stuff (as you can safely forget about it) and the modifications to your theme that you would need as a result.
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: page for only registered users. What is the correct path?
« Reply #11 on: October 25, 2008, 08:00:05 pm »

We're not asking you to pay anything. Who said that you have to pay? I just suggested to put your members-only page into coppermine's root folder instead of putting it someplace else. This will keep you out of harms way with all the include stuff (as you can safely forget about it) and the modifications to your theme that you would need as a result.


I was referring in general.
What I do advice I put into practice with an 'other page by entering another code.
Now I need to plug it into a folder in the root. I thought it was easy and if you do not find another solution.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: page for only registered users. What is the correct path?
« Reply #12 on: October 25, 2008, 08:25:00 pm »

It's not my task to find another solution for you. Both options (putting your custom stuff into a sub-folder or keeping it within coppermine's root folder) have drawbacks. It's entirely up to you to decide for one option and apply it. We're not involved and frankly: I don't care which option you pick. After all, you're trying to come up with a custom hack, so I suggest reviewing your attitude.
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: page for only registered users. What is the correct path?
« Reply #13 on: October 25, 2008, 09:57:06 pm »

I resolved.
If necessary can be closed.
Thank you
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: page for only registered users. What is the correct path?
« Reply #14 on: October 25, 2008, 10:10:41 pm »

I would like to have clarity. This custom hack are prohibited ?
thanks
Logged

Fabricio Ferrero

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 1996
  • From San Juan, Argentina, to the World!
    • http://fabricioferrero.com/
Re: page for only registered users. What is the correct path?
« Reply #15 on: October 26, 2008, 01:59:45 am »

Not at all. Thanks for coming back and mark as 'solved' topic.
Logged
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: page for only registered users. What is the correct path?
« Reply #16 on: October 26, 2008, 10:07:47 am »

How could we possibly stop you applying custom hacks - it's your site after all? Of course you can apply that sort of hack as you see fit - you just can't expect to be spoon-fed, i.e. you can't expect that we provide instructions for each and every hack that you need. We're not your coding slaves.
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: page for only registered users. What is the correct path?
« Reply #17 on: October 26, 2008, 11:48:30 am »

How could we possibly stop you applying custom hacks - it's your site after all? Of course you can apply that sort of hack as you see fit - you just can't expect to be spoon-fed, i.e. you can't expect that we provide instructions for each and every hack that you need. We're not your coding slaves.

This I do not think so. If you think I am sorry
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: page for only registered users. What is the correct path?
« Reply #18 on: October 26, 2008, 12:19:52 pm »

So you're convinced that we actually are your coding slaves ::)?
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: page for only registered users. What is the correct path?
« Reply #19 on: October 26, 2008, 01:21:47 pm »

So you're convinced that we actually are your coding slaves ::)?

You are free to think anything.
Please do not make me move from stupid.  ;)
I have asked for help because I am not capable. If this can help thank those who help me. If the aid is not possible there are no problems and I thank the same. I hope to have been clear.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.034 seconds with 19 queries.