Frontend loging in phpwcms

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
pyhavaim
Posts: 9
Joined: Thu 5. Aug 2004, 23:35
Location: Estonia

Post by pyhavaim »

ups try this frontlogin[/url]
Paal
Posts: 204
Joined: Wed 6. Oct 2004, 19:54
Location: Budapest, Hungary
Contact:

Post by Paal »

pyhavaim wrote:ups try this frontlogin
Ok, this files needed custom_front_func_inc.php:

Code: Select all

Warning: main(custom/custom_front_func_inc.php): failed to open stream: No such file or directory in c:\var\www\fl\include\inc_front\content.func.inc.php on line 35

Fatal error: main(): Failed opening required 'custom/custom_front_func_inc.php' (include_path='.;c:\php4\pear') in c:\var\www\fl\include\inc_front\content.func.inc.php on line 35
Please attache this.

Tnx, Paul
pyhavaim
Posts: 9
Joined: Thu 5. Aug 2004, 23:35
Location: Estonia

Post by pyhavaim »

ups. Basically you didn't need that, it has been long time since I written this hack, but here is frontlogin 1.1
Paal
Posts: 204
Joined: Wed 6. Oct 2004, 19:54
Location: Budapest, Hungary
Contact:

Post by Paal »

pyhavaim wrote:ups. Basically you didn't need that, it has been long time since I written this hack, but here is frontlogin 1.1
Overwriten all files, and come back this (in source, after login form submit):

Code: Select all

      <form name="login_formular" method="post" action="http://localhost/fl/fl/frm_Login.php?" autocomplete="off">
        <tr><td width="389" class="title"></td></tr>

		        <tr><td><img src="http://localhost/fl/img/leer.gif" width="1" height="12"></td></tr>
        <tr><td class="v10">:</td></tr>
        <tr><td><input name="form_loginname" type="text" id="form_loginname" class="f11b" style="width:250px;" size="30" maxlength="30" value="<br />
<b>Fatal error</b>:  Call to undefined function:  html_specialchars() in <b>c:\var\www\fl\frm_login.php</b> on line <b>14</b><br />
<br /><img src="img/leer.gif width="1" height="20" alt="" /><br />
Wrong path (in action=...): <form name="login_formular" method="post" action="http://localhost/fl/fl/frm_Login.php?" autocomplete="off">

Why?

Correct path: <form name="login_formular" method="post" action="http://localhost/fl/frm_Login.php?" autocomplete="off"> (simple "fl" directori but do not double :( )

Tnx, Paul
pyhavaim
Posts: 9
Joined: Thu 5. Aug 2004, 23:35
Location: Estonia

Post by pyhavaim »

Well it seems that you have a config problem.

in include\inc_conf\conf.inc.php what are your constants in this file?

Take a look at if there is a constant like this

Code: Select all

$_SERVER['DOCUMENT_ROOT']     = '.';
Paal
Posts: 204
Joined: Wed 6. Oct 2004, 19:54
Location: Budapest, Hungary
Contact:

Post by Paal »

pyhavaim wrote:Well it seems that you have a config problem.

in include\inc_conf\conf.inc.php what are your constants in this file?

Take a look at if there is a constant like this

Code: Select all

$_SERVER['DOCUMENT_ROOT']     = '.';

Code: Select all

Warning: main(./fl/include/inc_front/content.article.inc.php): failed to open stream: No such file or directory in c:\var\www\fl\include\inc_front\content.func.inc.php on line 200

Warning: main(): Failed opening './fl/include/inc_front/content.article.inc.php' for inclusion (include_path='.;c:\php4\pear') in c:\var\www\fl\include\inc_front\content.func.inc.php on line 200
My setting (include\inc_conf\conf.inc.php):

Code: Select all

.
.
.
// site values
$phpwcms["site"]              = "http://localhost/";
$phpwcms["admin_email"]       = "pal.palocz@is-energy.hu";

// paths
$phpwcms["root"]        	= "fl";         //default: ""
.
.
.
// Try to check and uncomment the DOCUMENT_ROOT if you have problems 
// often neccessary on IIS or default MacOS X webserver settings
// Do not use backslash "" on Windows - always replace "" by "/"
$_SERVER['DOCUMENT_ROOT']     = '.';
What is the problem?

Only without $_SERVER['DOCUMENT_ROOT'] setting working the site (but the front login don't :( )

Tnx, Paul
Last edited by Paal on Thu 16. Dec 2004, 11:14, edited 1 time in total.
Paal
Posts: 204
Joined: Wed 6. Oct 2004, 19:54
Location: Budapest, Hungary
Contact:

Post by Paal »

ok, my setting (include\inc_conf\conf.inc.php):

Code: Select all

.
.
.
// site values
$phpwcms["site"]              = "http://localhost/";
$phpwcms["admin_email"]       = "pal.palocz@is-energy.hu";

// paths
$phpwcms["root"]           = "fl";         //default: ""
.
.
.
// Try to check and uncomment the DOCUMENT_ROOT if you have problems
// often neccessary on IIS or default MacOS X webserver settings
// Do not use backslash "\" on Windows - always replace "\" by "/"
//$_SERVER['DOCUMENT_ROOT']     = '.'; 
Site working, but front login:
Image
and page source:

Code: Select all

      <form name="login_formular" method="post" action="http://localhost/fl/fl/frm_Login.php?" autocomplete="off">
        <tr><td width="389" class="title"></td></tr>
		        <tr><td><img src="http://localhost/fl/img/leer.gif" width="1" height="12"></td></tr>
        <tr><td class="v10">:</td></tr>
        <tr><td><input name="form_loginname" type="text" id="form_loginname" class="f11b" style="width:250px;" size="30" maxlength="30" value="<br />
<b>Fatal error</b>:  Call to undefined function:  html_specialchars() in <b>c:\var\www\fl\frm_login.php</b> on line <b>14</b><br />
<br /><img src="img/leer.gif width="1" height="20" alt="" /><br />Bejelentkezés. Kérjük adja meg felhasználónevét és jelszavát!</p>
Any idea?

Tnx, Paul
Pappnase

Post by Pappnase »

hello paal

please call your document_root.php and look what the server root is.
then edit your conf.inc.php
Paal
Posts: 204
Joined: Wed 6. Oct 2004, 19:54
Location: Budapest, Hungary
Contact:

Post by Paal »

Pappnase wrote:hello paal

please call your document_root.php and look what the server root is.
then edit your conf.inc.php
document_root.php:

Code: Select all

<?php
/*************************************************************************************
   Copyright notice
   
   (c) 2002-2003 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
 
   This script is part of PHPWCMS. The PHPWCMS web content management system 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.
  
   The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
   A copy is found in the textfile GPL.txt and important notices to the license 
   from the author is found in LICENSE.txt distributed with these scripts.
  
   This script is distributed in the hope that it will be useful, but WITHOUT ANY 
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
   This copyright notice MUST APPEAR in all copies of the script!
*************************************************************************************/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>phpwcms DOCUMENT_ROOT test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"><style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
}
body {	background-color: #FFFFFF;}
h1 {font-size: 24px;}
h2 {font-size: 21px;}
pre {font-size: 14px;}
-->
</style></head>
<body>
<h2>phpwcms DOCUMENT_ROOT test</h2>
<p>This file has to be placed in your web root - do not <br>put it into any subdir of your webspace</p>
<?php

$doc_root = str_replace("\", '/', $_SERVER['DOCUMENT_ROOT']);

echo "<pre>";

echo '1) your default $_SERVER[\'DOCUMENT_ROOT\']: <span style="color:#009933">'.$doc_root;
echo "</span>\n";
echo '2) real DOCUMENT_ROOT based on this file : <span style="color:#CC3300">';
$path = preg_replace('/(.*)[\/|\\\].(.*)/', '$1', $_SERVER['PATH_TRANSLATED']);

echo $path;
echo "</span></pre>";

?>

If <strong>(1)</strong> and <strong>(2)</strong> not equal then add following<br>
line at the end of your <strong>conf.inc.php</strong> but before ending "?>": 
<pre style="color:#CC3300">
$_SERVER['DOCUMENT_ROOT'] = '<?php echo $path ?>';
</pre>
Check if this is corresponding with the subdir<br>
in which phpwcms is installed:
<pre style="color:#CC3300">$phpwcms['root'] = "<?php 

$subdir = str_replace($doc_root, '', $path);
if(trim($subdir)) {
	echo preg_replace('/^\/(.*)/', '$1', $subdir);
}
?>";</pre>
If so - everything is fine too, also if this is empty.<br>
Maybe some leading/ending slash "/" is there.<br>
That's no problem here, but remove leading or<br>
ending slashes. 
Do never use the backslash "\"<br>
in paths on Windows - this may fail.
<hr size="1" noshade>
<span style="font-size:11px">Copyright &copy; 2004 Oliver
Georgi, <a href="http://www.phpwcms.de">http://www.phpwcms.de</a></span>
</body>
</html>
Pappnase

Post by Pappnase »

hello

it helps nothing if you send me the source of the document_root.php
when psot the result of the document_root.php! :wink:
Paal
Posts: 204
Joined: Wed 6. Oct 2004, 19:54
Location: Budapest, Hungary
Contact:

Post by Paal »

Pappnase wrote:hello

it helps nothing if you send me the source of the document_root.php
when psot the result of the document_root.php! :wink:
Oh, man, understand now :shock: :

Code: Select all

phpwcms DOCUMENT_ROOT test

This file has to be placed in your web root - do not
put it into any subdir of your webspace

1) your default $_SERVER['DOCUMENT_ROOT']: c:/var//www
2) real DOCUMENT_ROOT based on this file : c:/var//www/fl

If (1) and (2) not equal then add following
line at the end of your conf.inc.php but before ending "?>":

$_SERVER['DOCUMENT_ROOT'] = 'c:/var//www/fl';

Check if this is corresponding with the subdir
in which phpwcms is installed:

$phpwcms['root'] = "fl";

If so - everything is fine too, also if this is empty.
Maybe some leading/ending slash "/" is there.
That's no problem here, but remove leading or
ending slashes. Do never use the backslash ""
in paths on Windows - this may fail.
kerthi
Posts: 23
Joined: Tue 14. Sep 2004, 18:22

Post by kerthi »

Ich bekomm folgende Fehler auf der Seite wo ich das Login Formular hab:

Warning: file_get_contents(http://www.christiankerth.com/phpwcms/frm_login.php): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/virtual/site15/fst/var/www/html/phpwcms/include/inc_front/front.func.inc.php on line 2236
hab ich auch scon gelöst: Tippfehler *gg*


Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site15/fst/var/www/html/phpwcms/include/inc_front/front.func.inc.php:2236) in /home/virtual/site15/fst/var/www/html/phpwcms/index.php on line 114
--> hab ich inzwischen gelöst! (hatte was mit dem vts mod zu tun)

Ein Problem hab ich allerdings noch.
Wie realisiere ich das am besten, dass nach dem Login eine Statusmeldung angezeigt wird das Formular jedoch verschwindet?
Im Moment hab ich so dass ich das LoginForm + einen Contentpart für die Meldung in eine Ebene gepakt hab die nur für eingeloggte user sichtbar is. Sobald ich mich dann einlogge is aber Form+Text sichbar und das will ich ja verhindern.


mfg kerthi[/b]
Mobius
Posts: 39
Joined: Sun 15. Aug 2004, 13:07
Location: Hungary
Contact:

Post by Mobius »

And how can I do a Logout link for logged in frontend users?
ondergang
Posts: 9
Joined: Sat 2. Oct 2004, 21:15

Post by ondergang »

Nothing i do seems to help i still getting this message by viewing frm_Login.php:

error:

:
<input name="form_loginname" type="text" id="form_loginname" class="f11b" style="width:250px;" size="30" maxlength="30" value="
Fatal error: Call to undefined function: html_specialchars() in /home/ondergang/public_html/phpwcms/frm_Login.php on line 12

Any idea whats wrong :?:
brans

Post by brans »

yes you have an old php version where html_specialchars didn't exist...
Post Reply