loginlink() is flawed

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

loginlink() is flawed

Post by cmb » Tue Apr 23, 2013 8:48 pm

Hello Community,

I have noticed that loginlink() creates a lot of DC ("duplicate content") (for security_type page)[1]. IMO it is conceptually flawed the way it is now, where the login link is created by appending &login to the current page URL. Requesting the login URL sets $su to the URL of the page and $s to its numeric index. Then the plugins etc. are processed, and only shortly before the script includes the template function loginforms() is called, which writes the login form to $o and sets $s to -1. IOW: during the loading of the plugins $su as well as $s indicate that a certain page will be displayed, but that does not happen. :roll: That is potentially worse than the DC.

ISTM the clean solution would be to use "login" as first query parameter and append a second parameter, which specifies the desired page (say, ?login&selected=...). This would set $s quite early (before the plugins are loaded) to -1 (assuming there is no page with the h1 heading "login"), and the selected parameter could be easily trimmed from the <DEL>canonical</DEL> link, which would give the desired canonical link.

I suppose that this change could be easily implemented, and won't result in considerable incompatibilities with existing extensions, but I'm not sure, if it would be better to postpone it to CMSimple_XH 1.6 (if at all). Closer examination is pending.

[1] ge_canonical doesn't really help here, as the complete login link is set as canonical link. My own solution (see http://3-magi.net/?Hello&login is not better as it allows (currently it's configured this way) to suppress the &login from the canonical link, but that results in canonical links which have different content, what is worse.

Christoph
Last edited by cmb on Mon Feb 03, 2014 6:46 pm, edited 1 time in total.
Reason: <DEL>'d
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: loginlink() is flawed

Post by cmb » Mon Feb 03, 2014 6:52 pm

Well, I've totally forgotten this idea. :oops:

I suggest that we make it so for XH 1.7. The "selected" query parameter is working since XH 1.6, so half the work's already done. I'll come up with a path before voting starts.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply