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: login disappears in gallery.  (Read 5858 times)

0 Members and 1 Guest are viewing this topic.

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
login disappears in gallery.
« on: October 07, 2005, 02:36:22 am »

i installed coppermine

on the site it display the login information on the left
well, in the galley, it hides the login panel.

any idea why?
the following is the code for the login panel.
Code: [Select]
  <?
  //**********************************************
  //Access selector for logging in and logging out
//**********************************************
if($access == 1)
{ ?>
              <td><form action="<? echo $ihost; ?>login.php" method="post">
                  <table border="0" cellpadding="0" cellspacing="0" width="144">
                    <tbody>
                      <tr>
                        <td height="14"><img src="<? echo $ihost; ?>images/spacer.gif" height="14" width="1"></td>
                      </tr>
                      <tr>
                        <td class="normal_s" align="right"><font color="#ffffff">User
                            ID</font><img src="<? echo $ihost; ?>images/spacer.gif" height="1" width="11">
                          <input name="username" type="text" class="normal_s" id="username" value="" size="14">
                        </td>
                      </tr>
                      <tr>
                        <td height="2"><br></td>
                      </tr>
                      <tr>
                        <td class="normal_s" align="right"><font color="#ffffff">Password</font><img src="<? echo $ihost; ?>images/spacer.gif" height="1" width="3">
                          <input name="password" type="password" class="normal_s" id="password" value="" size="14">
                        </td>
                      </tr>
                      <tr>
                        <td height="9"><br></td>
                      </tr>
                      <tr>
                        <td class="normal_s" align="right"><a href="<? echo $ihost; ?>reg.php"><img src="<? echo $ihost; ?>images/nav/registration2.gif" border="0" height="18" width="80"></a>
                          <INPUT TYPE="image" NAME="submit" src="<? echo $ihost; ?>images/Login.gif" width="58" height="18" border="0" alt="Submit">
                        </td>
                      </tr>
                      <tr>
                        <td height="3"><br></td>
                      </tr>
                      <tr>
                        <td class="normal_forgot"><a href="<? echo $ihost; ?>/misc/forgotpassword.php"><span class="normal_sWhite">Forgot
                              your Password? </span></a></td>
                      </tr>
                      <tr>
                        <td height="18"><br></td>
                      </tr>
                    </tbody>
                  </table>
                </form></td>
              <? }

else if($access == 2 || $access ==3 || $access ==4)
{ ?>
              <td><a href="<? echo $ihost; ?>logout.php"><span class="clsLink_white_wl">logout</span></a></td>
              <? }

else { ?>
              <? }
?>
            </tr>
            <tr>
              <td height="9"><br></td>
            </tr>
            <?
« Last Edit: October 14, 2005, 09:13:02 am by lavashark.com »
Logged

Nibbler

  • Guest
Re: login disappears in gallery.
« Reply #1 on: October 07, 2005, 03:03:58 am »

Where is $access defined ?
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: login disappears in gallery.
« Reply #2 on: October 07, 2005, 03:22:06 am »

Code: [Select]
<?
session_start();
header("Cache-control: private");

include ($shost."includes/dbInfo.php");
$database = "users";

if(!array_key_exists('username', $_SESSION))  {
$access = 1;
}
else {
$username = $_SESSION['username'];
$query = "SELECT * FROM $database WHERE username = '$username'";
$result = mysql_query($query);
$access = mysql_result($result, 0, "access");
}

if($access < $security) {
?> <META HTTP-EQUIV="Refresh" CONTENT="2;URL=<? echo $ihost; ?>pleaselogin.php"> <?
exit();
}

?>
<?php

"login = access2, 3, or 4"
"nologin = access 1"
Logged

Nibbler

  • Guest
Re: login disappears in gallery.
« Reply #3 on: October 07, 2005, 03:26:45 am »

Can you not use Coppermine's USER_ID to check if the user is logged in or not ? Sessions might not work properly around Coppermine.
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: login disappears in gallery.
« Reply #4 on: October 07, 2005, 03:29:48 am »

theme.php upon request.
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: login disappears in gallery.
« Reply #5 on: October 07, 2005, 03:31:08 am »

once again...
Logged

Nibbler

  • Guest
Re: login disappears in gallery.
« Reply #6 on: October 07, 2005, 03:39:32 am »

Include your galleryheader.php using a local or absolute server path instead of an URL.
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: login disappears in gallery.
« Reply #7 on: October 07, 2005, 03:43:40 am »

hmm. thanks nibbler.
the following is galleryheader.php
"Include your galleryheader.php using a local or absolute server path instead of an URL" Is that what you want?

Code: [Select]
<?
session_start();
header("Cache-control: private");

include (/includes/dbInfo.php");
$database = "users";

if(!array_key_exists('username', $_SESSION))  {
$access = 1;
}
else {
$username = $_SESSION['username'];
$query = "SELECT * FROM $database WHERE username = '$username'";
$result = mysql_query($query);
$access = mysql_result($result, 0, "access");
}

if($access < $security) {
?> <META HTTP-EQUIV="Refresh" CONTENT="2;URL=<? echo $ihost; ?>pleaselogin.php"> <?
exit();
}

?>

<html>
<head>
<title><? echo $title ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="/stfusa.css">
</head>

<body background="<? echo $ihost; ?>images/bg.gif" text="#333333" link="#990000" vlink="#990000" alink="#990000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="770" border="0" cellpadding="0" cellspacing="0" class="bodyborder">
  <tr>
    <td colspan="2" valign="baseline"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="770" height="148">
      <param name="movie" value="/flash/header.swf">
      <param name="quality" value="high">
      <embed src="/flash/header.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="770" height="148"></embed>
    </object></td>
  </tr>
  <tr>
    <td width="25%" valign="top" bgcolor="#32195B"><div align="center">
      <?php include(/includes/categories.php") ?>
    </div></td>
    <td width="75%" valign="top">
<?php

$starttime 
explode(' 'microtime());
$starttime $starttime[1] + $starttime[0];

?>
« Last Edit: October 14, 2005, 09:14:20 am by lavashark.com »
Logged

Nibbler

  • Guest
Re: login disappears in gallery.
« Reply #8 on: October 07, 2005, 03:52:38 am »

In the theme.php (which appears to have been stripped somehow...) you have

Code: [Select]
  if(empty($custom_header)){

     include('httpwww.stfusa.comincludesgalleryheader.php');

     static $custom_header = ob_get_contents();

     ob_clean();

    }   

When you use an url like that it is the server that is requesting the header and so it is the server that you are attempting to validate using sessions not the end user. Change that to a path eg ../includes/galleryheader.php
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: login disappears in gallery.
« Reply #9 on: October 07, 2005, 04:07:06 am »

its fine on my site, must have been something wrong when i copied it over.

anyway, i tried in theme.php to change it to: ../includes/galleryheader.php
it doesnt seem to have added the login info.
« Last Edit: October 14, 2005, 09:14:49 am by lavashark.com »
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: login disappears in gallery.
« Reply #10 on: October 08, 2005, 06:18:27 pm »

Nibbler, this might help.
galleryheader.php is simply a copy of the header used on the other pages on my site. The other pages use "TemplateTop.php"
In other words, if we need to, we can change galleryheader.php to accomodate the gallery without taking any hits on the rest of the site.
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: login disappears in gallery.
« Reply #11 on: October 09, 2005, 07:19:33 am »

Nibbler are you still around?
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: login disappears in gallery.
« Reply #12 on: October 11, 2005, 07:38:08 am »

I don't feel welcomed on this board anymore.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: login disappears in gallery.
« Reply #13 on: October 11, 2005, 08:04:19 am »

I don't feel welcomed on this board anymore.
we believe in helping users to help themselves. Most users who ask basic questions in the first place learn a lot and are able to fix most issues they have. When you heavily modify your gallery, it gets increasingly harder for supporters to actually help you, as we can't tell how much your code differs from the core code. If something you're up to accomplish doesn't work at all, then undo your changes. Some features just may not be there for you. The issues you're having can hardly be replicated, so basically the reason for nobody replying to your question is that nobody has an answer. Would it be helpful for you if all supporters posted something like "I don't know"? Probably not. You can't expect us to post "let me have access to your files, I'll code this for you" - we can't, and we won't do this for everyone. I suggest you just try harder and give us something to chew on - read http://forum.coppermine-gallery.net/index.php?topic=22469.0 and the page I refered to on this thread.

Joachim
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: login disappears in gallery.
« Reply #14 on: October 11, 2005, 10:46:21 pm »

i guess im just learning to slow.
Logged
Pages: [1]   Go Up
 

Page created in 0.03 seconds with 20 queries.