login disappears in gallery. login disappears in gallery.
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

login disappears in gallery.

Started by willstein, October 07, 2005, 02:36:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

willstein

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.
  <?
  //**********************************************
  //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>
            <?

Nibbler


willstein

<?
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"

Nibbler

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.

willstein

theme.php upon request.

willstein

once again...

Nibbler

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

willstein

#7
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?

<?
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];

?>

Nibbler

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


  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

willstein

#9
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.

willstein

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.

willstein


willstein

I don't feel welcomed on this board anymore.

Joachim Müller

Quote from: lavashark.com on October 11, 2005, 07:38:08 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

willstein

i guess im just learning to slow.