login problems xh

Questions about how to install and problems installing - please read the documentation first!
flukey92
Posts: 89
Joined: Thu Aug 11, 2011 9:39 am
Location: Bedford, UK
Contact:

login problems xh

Post by flukey92 » Mon Aug 22, 2011 2:38 pm

Hi everyone, ive typed it up twice then my browsers timed out or something so ill keep it quick and short;

basically i have a current installation of cmsimple_xh which through to major modding with little knowledge i helped it with assisted suicide. now it doesnt like me very much and wont log me in. at first it would only let me login without any subdomain ie. "domain.com" and if i logged in via"www.domain.com" it would come up with this error. now it is regardless of what domain subdomain directoy, my installation is corrupt !

so i have created a new installation of xh in a seperate directory;
standard xh installation
+my content.htm and pagedata file
+my template
+my plugins
+enconfig.php language file from original installation
standard cms.php

end result is i cant log in, well i can, but i cant progress onto any other page without being "logged out" i quoted the term because there is no backup created it just simply cant remember me logging in :S

i am going to try once again and do it step by step
see where i get from there, will update if i find what is causing the error

-flukey
RJS Electronics Ltd - LED Push Switches, LCD Programmable Keys, Anti Vandal Push Buttons, Relays, Custom Cable Assemblies
Visit my Web Hosting / Design website here - www.flukedesigns.co.uk

cmb
Posts: 13342
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: login problems xh

Post by cmb » Mon Aug 22, 2011 2:49 pm

Hello Flukey,
flukey92 wrote: end result is i cant log in, well i can, but i cant progress onto any other page without being "logged out" i quoted the term because there is no backup created it just simply cant remember me logging in
I can force the same behaviour with my otherwise working installation, if I don't accept Cookies in my browser. So you should check this setting.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

flukey92
Posts: 89
Joined: Thu Aug 11, 2011 9:39 am
Location: Bedford, UK
Contact:

Re: login problems xh

Post by flukey92 » Mon Aug 22, 2011 2:53 pm

Hello Christoph

unfortunately i think this is server/installation side not client side, i may be wrong who knows, i have checked my cookie settings also, but i am getting this issue on 3 differenct computers now on 2 different browsers for each computer (ie + ff on each pc)

KR

Flukey
RJS Electronics Ltd - LED Push Switches, LCD Programmable Keys, Anti Vandal Push Buttons, Relays, Custom Cable Assemblies
Visit my Web Hosting / Design website here - www.flukedesigns.co.uk

cmb
Posts: 13342
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: login problems xh

Post by cmb » Mon Aug 22, 2011 3:57 pm

Hello Flukey,

then the problem might be, that the server doesn't send the required cookies. I was able to reproduce the behaviour by adding the line

Code: Select all

Header unset Set-Cookie
to my .htaccess

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Martin
Posts: 346
Joined: Thu Oct 23, 2008 11:57 am
Contact:

Re: login problems xh

Post by Martin » Mon Aug 22, 2011 6:13 pm

Hello Flukey,

one thing is for sure: If you are getting logged out again immediately after your log-in, CMSimple was not able to set a cookie. If this is not blocked by your browser settings, things get difficult:
php.net wrote:If output exists prior to calling this function, setcookie() will fail ...
So if there is any output - this might be an empty line outside the <?php ?>-tags in one of your included files, an error message, a BOM - before CMSimple's log-in procedure, it won't work.

Do you remember, what you have added to your installation before this happened? You should check those files ...

Do you have a link? Or is it still about your electronics website? (I had a look at it and could not find a prior output - but if you look at the source, you'll see that the program crashes before reaching the end: Something seems to be wrong with your newsbox or tagcloud ....


KR

Martin

flukey92
Posts: 89
Joined: Thu Aug 11, 2011 9:39 am
Location: Bedford, UK
Contact:

Re: login problems xh

Post by flukey92 » Fri Aug 26, 2011 8:26 am

Hi Martin + Christoph,
Martin wrote:Something seems to be wrong with your newsbox or tagcloud ....
Below is the code i use in the template to output my "Tag Cloud"

Code: Select all

<?php echo 'Tag Cloud: <br />', $cf['meta']['keywords']?>
Also this is the text that i have entered in my meta tags keywords;

Code: Select all

<a href=/?Rotary_%2F_Slide_%2F_Toggle_Switches>Toggle, Slide, Paddle Switches</a>, <a href=/?Switches_LED_Illuminated>LED Illuminated Switches</a>, <a href=/?Dipswitches>Dipswitches</a>, <a href=/?Door_Entry_Switches>Anti Vandal Switches</a>, <a href=/?Custom_Cable_Assemblies>Custom Cable Assemblies</a>, <a href=/?LCD_Switches>LCD Switches</a>, <a href=/?Encoders>Encoders</a>, <a href=/?Relays>Relays</a>
the code that is output in the meta area are is

Code: Select all

<meta name="keywords" content="Toggle, Slide, Paddle Switches, LED Illuminated Switches, Dipswitches, Anti Vandal Switches, Custom Cable Assemblies, LCD Switches, Encoders, Relays" />
to strip the tags from the content so that i do not have invalid output in the meta tag section of the html output the below code is changed in the "cms.php" file

Code: Select all

function meta($n) {
	global $cf;
	if ($cf['meta'][$n] != '')return tag('meta name="'.$n.'" content="'.$cf['meta'][$n].'"')."\n";
}
to

Code: Select all

function meta($n) {
    global $cf;
    if ($cf['meta'][$n] != '') {
        if ($n == 'keywords') {
            $meta = strip_tags($cf['meta']['keywords']);
        } else {
            $meta = $cf['meta'][$n];
        }
        return tag('meta name="'.$n.'" content="'.$meta.'"')."\n";
    }
}
courtesy of CMB

and yes the link to the website for future reference is RJS Electronics Ltd

Would just like to say thankyou to anyone who has taken the time to help me :)

-flukey
RJS Electronics Ltd - LED Push Switches, LCD Programmable Keys, Anti Vandal Push Buttons, Relays, Custom Cable Assemblies
Visit my Web Hosting / Design website here - www.flukedesigns.co.uk

flukey92
Posts: 89
Joined: Thu Aug 11, 2011 9:39 am
Location: Bedford, UK
Contact:

Re: login problems xh

Post by flukey92 » Fri Aug 26, 2011 8:28 am

in addition to my previous post, below is something that Christoph has suggested which works perfectly as a workaround but does not solve the problem, thought i would post it here just incase anyone else comes across the same problem and we still havent solved it;
cmb wrote:removed
i have removed the content for security reasons however please pm either myself or cmb for a temporary workaround


grr... just checked my website on internet explorer and found out since i restored it from a backup this is how it is now displayed

IE9
[ external image ]

FF6
[ external image ]

does anyone have any tips on how to remove the spacing at the top and between the header and the content so it is displayed the same as it is in firefox?

-flukey
Last edited by flukey92 on Fri Aug 26, 2011 9:09 am, edited 1 time in total.
RJS Electronics Ltd - LED Push Switches, LCD Programmable Keys, Anti Vandal Push Buttons, Relays, Custom Cable Assemblies
Visit my Web Hosting / Design website here - www.flukedesigns.co.uk

Holger
Site Admin
Posts: 3212
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany
Contact:

Re: login problems xh

Post by Holger » Fri Aug 26, 2011 9:02 am

That
flukey92 wrote:the spacing at the top and between the header and the content
seems to be the reason for your login-problems.

As Martin wrote:
Martin wrote:one thing is for sure: If you are getting logged out again immediately after your log-in, CMSimple was not able to set a cookie. If this is not blocked by your browser settings, things get difficult:
php.net wrote:If output exists prior to calling this function, setcookie() will fail ...

So if there is any output - this might be an empty line outside the <?php ?>-tags in one of your included files, an error message, a BOM - before CMSimple's log-in procedure, it won't work.
BTW:

You have included jQuery twice:
in the head

Code: Select all

<script type="text/javascript" src="./plugins/jquery/lib/jquery/jquery-1.6.1.min.js"></script>
and in the body

Code: Select all

<body bgcolor="#619ACF" background="./templates/rjstemp1/images/great-bk.jpg" style="background-repeat: repeat-x" onload="">
<script type="text/javascript" src="jquery-1.2.2.pack.js"></script>
<script type="text/javascript" src="htmltooltip.js">
You should only use the jQuery-plugin.

KR
Holger

flukey92
Posts: 89
Joined: Thu Aug 11, 2011 9:39 am
Location: Bedford, UK
Contact:

Re: login problems xh

Post by flukey92 » Fri Aug 26, 2011 9:13 am

Hi holger thankyou for the recommendations,

i have removed the spacing by changing the top part of my template:
from

Code: Select all

<?php
/*
© 2011 RJS Electronics Ltd
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<?php echo head();?>
<meta name="google" content="notranslate" />
<meta http-equiv="content-type" content="text/html;charset=utf-8"/> 
</head>
to

Code: Select all

<?php 
if ($cf['xhtml']['endtags'] == 'true') {
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n".
'<html xmlns="http://www.w3.org/1999/xhtml">'."\n";
} else {
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'."\n".'<html>'."\n";} 
?>
<head>
<?php echo head();?>
</head>
this still hasnt solved the problem!

i will change it so that i only call the jquery plugin as suggested,

many thanks

-flukey
RJS Electronics Ltd - LED Push Switches, LCD Programmable Keys, Anti Vandal Push Buttons, Relays, Custom Cable Assemblies
Visit my Web Hosting / Design website here - www.flukedesigns.co.uk

cmb
Posts: 13342
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: login problems xh

Post by cmb » Fri Aug 26, 2011 9:25 am

Hello Flukey, Holger, Martin,
Martin wrote:So if there is any output - this might be an empty line outside the <?php ?>-tags in one of your included files, an error message, a BOM - before CMSimple's log-in procedure, it won't work.
That's absolutely right. But as the template is included after the login procedure, it can't be the reason that the cookies are not sent. But the problem might be caused by the language or config files.

@flukey: you should check for a BOM in en.php, enconfig.php and config.php. All files needed by CMSimple_XH must be UTF-8 encoded without BOM!

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply