News:

Wondering if this will always be free?  See why free is better.

Main Menu

[WIP/BETA] EU cookie law

Started by emanuele, April 21, 2012, 04:30:56 PM

Previous topic - Next topic

fma965

#180
Quote from: emanuele on June 17, 2012, 11:33:59 AM
Unless you give us some hints on what you have installed I have no ideas. :P

oh yeah :D


1. Tapatalk SMF 2.0 RC4/RC5/Final Plugin 3.0.2 
3. SA Twitter 0.6 REV 30 
4. EU cookie law 0.1.2 
5. SimplePortal 2.3.5 
6. SA GPlus 0.3 REV 9 
7. SA Facebook 2.0 RC4 Rev58 
8. Menu Editor Lite 1.0.5 
9. Pretty URLs 1.0 


Thats all :) it did however seem to start when i installed EU cookie law.

also
htaccess file

# PRETTYURLS MOD BEGINS
# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: June 16, 2012, 12:34

RewriteEngine on
RewriteBase /

# Rules for: actions
RewriteRule ^(activate|admin|ads|announce|attachapprove|buddy|calendar|clock)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(collapse|coppa|credits|deletemsg|display|dlattach|editpoll|editpoll2)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(emailuser|findmember|forum|portal|groups|help|helpadmin|httpBL)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(im|jseditor|jsmodify|jsoption|lock|lockvoting|login|login2)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(logout|markasread|mergetopics|mlist|moderate|modifycat|modifykarma|movetopic)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(movetopic2|notify|notifyboard|openidreturn|pm|post|post2|printpage)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(profile|quotefast|quickmod|quickmod2|recent|register|register2|reminder)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(removepoll|removetopic2|reporttm|requestmembers|restoretopic|search|search2|sendtopic)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(smstats|suggest|spellcheck|splittopics|stats|sticky|theme|trackip)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(about:mozilla|about:unknown|unread|unreadreplies|verificationcode|viewprofile|vote|viewquery)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(viewsmfile|who|\.xml|xmlhttp)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(projects|p2map|fcbrowser|youtube)/?$ ./index.php?pretty;page=$1 [L,QSA]
# Rules for: boards
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]

# Rules for: topics
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1;topic=$2.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ ./index.php?pretty;board=$1;topic=$2.$3 [L,QSA]

# PRETTYURLS MOD ENDS


and url
http://forgottencoders.co.uk

and of course the version is 2.0.2

thanks

EDIT: how do i change the z-index on the ecl notice? i cant find it in style.css or the index template.

emanuele

Honestly no idea...
Try switch off pretty urls and see if it is fixed.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

fma965

Quote from: emanuele on June 17, 2012, 12:18:32 PM
Honestly no idea...
Try switch off pretty urls and see if it is fixed.

ok will try that then. thanks.

what about changing the z-index?

fma965

#183
ok yep so its defo prettyurls. any ideas how to fix it though? also once i accept cookies (need to manually remove the ; from the url) it then works fine so i guess its conflicting with this mod for some reason. any ideas on a fix?

ok so apparently just disablind prettyurls and re-enabling it seems to have fixed it. just my final issue now.

Where is the css for this saved?

EDIT: Found it (sources\Subs-EclWarning.php)


<style>
#ecl_notification
{
color: #f96f00;
background-color: white;
border-bottom: solid 3px #f96f00;
text-align: center;
font-size: 12pt;
padding: 8px;
width: 100%;
line-height: 25px;
position: fixed;
top: 0;
left: 0;
padding-left: 0;
padding-right: 0;
}
</style>

emanuele

In the middle of Subs-EclWarning.php :)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

fma965

#185
Quote from: emanuele on June 17, 2012, 01:34:16 PM
In the middle of Subs-EclWarning.php :)

yep as stated above found it :D.

heres what i have done



EDIT: ok now i am more confused. the action; bug thing has just came back :( no idea why. still think it is prettyurls though

It is however only doing it when cookies have not been accepted. once they are accepted it all works fine. except for having to manually type the cookie acceptance url in the address bar.

emanuele

Okay, try this:
Code (find) Select
$context['ecl_accept_cookies'] = $scripturl . '?' . http_build_query(array_merge($_GET, array('cookieaccept' => '1')));

Code (replace with) Select
$context['ecl_accept_cookies'] = $scripturl . '?' . http_build_query(array_merge($_GET, array('cookieaccept' => '1')),null, ';');

The line is at the end of the file.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

fma965

#187
Quote from: emanuele on June 17, 2012, 02:58:41 PM
Okay, try this:
Code (find) Select
$context['ecl_accept_cookies'] = $scripturl . '?' . http_build_query(array_merge($_GET, array('cookieaccept' => '1')));

Code (replace with) Select
$context['ecl_accept_cookies'] = $scripturl . '?' . http_build_query(array_merge($_GET, array('cookieaccept' => '1')),null, ';');

The line is at the end of the file.

i so hope this works :D i have tried everything i can think of from code edits, settings, htaccess and nothing worked. just came on here to say i give up  :( but then read your latest post :)

-------------------------------------------------------

DAM it didnt work :( this is the url i am getting http://forgottencoders.co.uk/index.php?cookieaccept;=1 and when clicked it goes to a blank page (im guessing a 404 page?) just to confirm shouldn't the url be http://forgottencoders.co.uk/index.php?cookieaccept=1 (without the ;)? oh and also the same happens for index.php?action;=login and index.php?action;=login2 and more.

emanuele

Since it is happening with all the URLs I'd suggest you to ask in the pretty URL topic support...the author should know better what the problem could be. ;)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

fma965

Quote from: emanuele on June 17, 2012, 04:24:43 PM
Since it is happening with all the URLs I'd suggest you to ask in the pretty URL topic support...the author should know better what the problem could be. ;)
um ok thanks. that thread has 335 pages  :o

nend

I was thinking of a easier solution, well here is my idea hope you like it.


<?php
ob_start
('callback');
setcookie('test', '123', time()+3600);
echo
'123';
ob_end_flush();
function
callback($buffer) {
header_remove('Set-Cookie');
return $buffer;
}
?>


Just a simple test script which removes the cookie from the header before sending. Instead of invading all mods and locations in SMF where a cookie is set it might just be simpler just removing all the headers that were set. What do you think?

Arantor

I think I already tried doing that before and finding that it didn't always work to remove the PHPSESSID cookie.
Holder of controversial views, all of which my own.


nend

It looks like you have to call it the number of cookies that are set. So if two cookies are set I must call the function twice. Figured it would be recursive. Well updated with compatibility for older PHP.

<?php
ob_start
('callback');
setcookie('test', '123', time()+3600);
echo
'123';
ob_end_flush();
function
callback($buffer) {
if (function_exists('header_remove')) {
header_remove('Set-Cookie');
} else {
header('Set-Cookie:');
}
return $buffer;
}
?>

Arantor

Did you try using it to remove the PHPSESSID cookie, though?

That's the only cookie set until logging in and it doesn't behave the same way!
Holder of controversial views, all of which my own.


nend

Quote from: Arantor on June 20, 2012, 01:49:00 PM
Did you try using it to remove the PHPSESSID cookie, though?

That's the only cookie set until logging in and it doesn't behave the same way!
Just tried and both methods remove the PHPSESSID cookie, header and header_remove.

Arantor

Odd, I couldn't get either to remove the PHPSESSID when I tried it ages ago.
Holder of controversial views, all of which my own.


nend

You know they are always changing how things work in PHP, I have version 5.3.6.

In any matter the functions are not recursive meaning they will only remove one cookie per call. So we must make it recursive to remove all the cookies. What do you think about headers_list function to do this?

Arantor

*shrug* Whatever works, I guess.
Holder of controversial views, all of which my own.


nend

Here this one should be recursive. Tested and works on my machine, hopefully works on more.

<?php
ob_start
('callback');
session_start();
$_SESSION['test'] = '123';
setcookie('test', '123', time()+3600);
echo
'123';
ob_end_flush();
function
callback($buffer) {
if (function_exists('header_remove')) {
foreach(headers_list() as $header) {if(strstr($header, 'Set-Cookie:')) {header_remove('Set-Cookie');}}
} else {
foreach(headers_list() as $header) {if(strstr($header, 'Set-Cookie:')) {header('Set-Cookie:');}}
}
return $buffer;
}
?>

emanuele

That's cool! :D

Anyway edits are necessary anyway because SMF (and most likely mods) assumes that session data are present in several places and so unless we want to live with an error log full of errors we need to check where the session is checked without taking care of assessing if present or not...I'm wondering if all these errors should be considered bugs...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Advertisement: