Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 16. Apr 2024, 19:15

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 113 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8  Next
Author Message
 Post subject:
PostPosted: 13. Nov 2006, 13:49 
Offline

Joined: 17. Oct 2006, 14:37
Posts: 69
Do you mean this file:
i_frames/i_privatelogin.php


Top
 Profile  
 
 Post subject:
PostPosted: 13. Nov 2006, 13:59 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
si - there you can simply add a log statement when the password is checked

logout is not eays trackable because how to you track the closing of the browser ;).

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 13. Nov 2006, 14:07 
Offline

Joined: 17. Oct 2006, 14:37
Posts: 69
But what kind of code do I need inside i_privatelogin.php.
Not just
debug(....);
I think?
S


Top
 Profile  
 
 Post subject:
PostPosted: 13. Nov 2006, 14:08 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Just think :)

debug() is the function you can use.

e.g.
debug("login");

prints login to the logfile with da datestamp ...

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 13. Nov 2006, 14:53 
Offline

Joined: 17. Oct 2006, 14:37
Posts: 69
1)
That works very good but I got two login-timestamp. It looks like this:

11.13.2006 13:49:26 - login
11.13.2006 13:49:30 - login

Is it a way to just got one logindate?

2)
How do I do if I want the IP-adress as well together with the timestamp.

S


Top
 Profile  
 
 Post subject:
PostPosted: 13. Nov 2006, 15:18 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
pick the rigth palace only shows it once ;).

2. Read the php docu!

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 13. Nov 2006, 16:44 
Offline

Joined: 17. Oct 2006, 14:37
Posts: 69
Please, tell me were to put the debug("login");
I try in begining, in the middle and in the end.
Can you make a mark in your code were to put the
debug-code.
S

<?php
/*************************
Copyright (c) 2004-2006 TinyWebGallery
written by Michael Dempfle

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
TWG version: 1.5.3
$Date: 2006/10/08 00:00 $
**********************************************/
define( '_VALID_TWG', '42' );
require "../config.php";
include "../inc/mysession.inc.php";
include_once "../inc/filefunctions.inc.php";
include "i_parserequest.inc.php";
$relativepath = "../";
include "../inc/checkprivate.inc.php";

$passwort = false;

if (isset($_GET['twg_passwort'])) {
$passwort = urlencode(replaceInput($_GET['twg_passwort']));
if ($encrypt_passwords) {
if (function_exists("sha1") && $use_sha1_for_password) {
$passwort = sha1($passwort);
} else {
$passwort = sha2($passwort);
}
}
if (in_array($passwort,$passwd)) {
$_SESSION["privategallogin"] = $passwort;
}
}

$logout = false;
if (isset($_GET['twg_logout'])) {
session_unregister("privategallogin");
$logout = true;
}

include "i_header.inc.php";
?>

<body onload="makeFocus('twg_passwort')">
<form action="<?php print $_SERVER['PHP_SELF']; ?>" method="get">
<table summary='' style="width: 100%; height:100%" cellpadding='0' cellspacing='0'><tr><td class="closebutton">
<img name="imageField" onClick="closeiframe()" alt='' align="right" src="../buttons/close.gif" width="12" height="12" border="0" />
</td></tr><tr><td>
<input name="twg_album" type="hidden" value="<?php echo encodespace($twg_album); ?>"/>
<input name="twg_lang" type="hidden" value="<?php echo $default_language; ?>"/>
<?php echo $hiddenvals; ?>
<?php


// we do the autoskipthumbs!
$basedir = "../" . $basedir;
$imagelist = get_image_list($twg_album);
if ($auto_skip_thumbnail_page && $twg_smallnav == 'FALSE') {
if (count($imagelist) <= $numberofpics) {
$skip_thumbnail_page = true;
}
}
$skip = "";
if ($skip_thumbnail_page) {
$skip="&twg_show=x";
}
// the weired setTimeout is needed for Opera 9 - seems to be a bug there!
$closescript = "<script>window.setTimeout(\"closeiframe(); if (reload) { parent.location='" . urldecode($twg_root) ."' + location.search.substring(0,location.search.indexOf('twg_passwort')-1) +'" . $skip . "'; }\",100);</script>";
if ($logout) {
echo $closescript;
} else if ($passwort == false) {
echo sprintf($lang_privatelogin_php_password, getDirectoryName($basedir . "/" . $twg_album, $twg_album));
} else if (!in_array($passwort,$passwd)) {
echo $lang_privatelogin_php_wrong_password;
} else {
echo $closescript;
}

?>
<br/><img alt='' src='../buttons/1x1.gif' height='4' /><br/><input id="twg_passwort" name="twg_passwort" type="password" size="20"/>
&nbsp;
<input type="submit" name="Submit" value="<?php echo $lang_privatelogin_php_login ?>" />
</td></tr></table>
</form>

<?php include "i_bottom.inc.php"; ?>
</body>
</html>


Top
 Profile  
 
 Post subject:
PostPosted: 13. Nov 2006, 16:53 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
you shoud try to understand this code a little bit - it's really quite easy ;).

put it

} else {

<-- here

echo $closescript;
}


this is the last $claosescript from the check ;).

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 13. Nov 2006, 17:23 
Offline

Joined: 17. Oct 2006, 14:37
Posts: 69
Thanks Michael.
I understand if you get tired of me :-)
Thanks again.
S


Top
 Profile  
 
 Post subject:
PostPosted: 14. Nov 2006, 17:42 
Offline

Joined: 17. Oct 2006, 14:37
Posts: 69
Dear Michael

You wrote:
2. Read the php docu!

What php docu?

Best regards
Stefan


Top
 Profile  
 
 Post subject:
PostPosted: 14. Nov 2006, 17:44 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
http://de3.php.net/download-docs.php


Top
 Profile  
 
 Post subject:
PostPosted: 23. Nov 2006, 16:34 
Offline

Joined: 17. Oct 2006, 14:37
Posts: 69
Please Michael
That document contains 10 000 pages :(
Please help me. I need how to get the IP-adress
when someone logg in to a password protected area. So the
script writes to the debugfile.

Best regards.
Stefan


Top
 Profile  
 
 Post subject:
PostPosted: 23. Nov 2006, 16:52 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
you should download the help file of you language - then you can search in the file ;).

to log this to the debug file of TWG use e.g.

debug($_SERVER["REMOTE_ADDR"] . " logged in ...");

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 28. Nov 2006, 17:08 
Offline

Joined: 17. Oct 2006, 14:37
Posts: 69
Thanks Michael
That works. Love you :)
Stefan


Top
 Profile  
 
 Post subject:
PostPosted: 29. Nov 2006, 10:31 
Offline

Joined: 17. Oct 2006, 14:37
Posts: 69
Michael
I download the php-doc and I found your code.
This works great:

'REMOTE_ADDR'
The IP address from which the user is viewing the current page.


Then I try to get the hostadress instead. I simply change 'REMOTE_ADDR'
to 'REMOTE_HOST'. But I just get the IP-adress.

'REMOTE_HOST'
The Host name from which the user is viewing the current page. The reverse dns lookup is based off the REMOTE_ADDR of the user.


Then I read this:
Returns the host name of the Internet host specified by ip_address or a string containing the unmodified ip_address on failure.

That is what happend. Then I try this:
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

echo $hostname;


How do I get the remote_host to the debugfile.

This time Iam rwally try :)

Stefan


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 113 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
powered by phpbb | Datenschutz/ Privacy policy