Page 1 of 1

[solved] Frontend Users FEU redirection settings not working

Posted: Tue Oct 15, 2013 10:04 am
by paulbaker
Hi ;D

In Users & Groups -> Frontend User Management -> Settings -> Builtin Authentication tab at the bottom there is a section of settings to enable redirection of the user after events e.g. once logged in.

It says at the top of this section:
Along with other pre-existing smarty variables and plugins, the {$username} and {$group} variables are availabie. (The {$group} variable matches the first group to which the user belongs.).
I used this successfully on a 1.11.4 site. In the "PageID/Alias to jump to after login *:" box I added:

Code: Select all

welcome-{$group}
It worked well, e.g. when a person logged in who was a member of members group, they got redirected to the page alias welcome-members (which still exists).

Then I updated from 1.11.4; did all the module updates, then core, then re-did module updates.

Now when you login it no longer redirects properly but a message is shown:
couldn't get pageid for welcome-
This suggests {$group} is not being understood correctly.

The user is logged in correctly though - you can click back to the home page and see all the hidden pages.

Have checked bug tracker, no sign of this.

Anybody?

Thanks :P

Current system info:

----------------------------------------------
Cms Version: 1.11.9
Installed Modules:
CMSMailer: 5.2.2
FileManager: 1.4.3
MenuManager: 1.8.6
ModuleManager: 1.5.5
News: 2.13
Printing: 1.1.2
Search: 1.7.11
ThemeManager: 1.1.8
TinyMCE: 2.9.12
CGExtensions: 1.37.2
FrontEndUsers: 1.21.18
CustomContent: 1.9
SelfRegistration: 1.8.1
CGSimpleSmarty: 1.7
jQuery: 1.2.0
JQueryTools: 1.2.5
Statistics: 1.1.3
avplayer: 1.3.2
CGCalendar: 1.10.4
CMSPrinting: 1.0.5
MicroTiny: 1.2.5

Config Information:
php_memory_limit:
process_whole_template:
max_upload_size: 32000000
url_rewriting:
page_extension:
query_var: page
image_manipulation_prog: GD
auto_alias_content: true
locale:
default_encoding: utf-8
admin_encoding: utf-8
set_names: true

Php Information:
phpversion: 5.3.24
md5_function: On (True)
gd_version: 2
tempnam_function: On (True)
magic_quotes_runtime: Off (False)
E_STRICT: 0
E_DEPRECATED: 0
memory_limit: 128M
max_execution_time: 120
output_buffering: 4096
safe_mode: Off (False)
file_uploads: On (True)
post_max_size: 8M
upload_max_filesize: 32M
session_save_path: /tmp (1777)
session_use_cookies: On (True)
xml_function: On (True)
xmlreader_class: On (True)

Server Information:
Server Api: cgi-fcgi
Server Db Type: MySQL (mysql)
Server Db Version: 5.1.70
Server Db Grants: Could not find a suitable "GRANT ALL" permission. This may mean you could have problems installing or removing modules. Or even adding and deleting items, including pages
Server Time Diff: No filesystem time difference found

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

Re: Frontend Users FEU redirection settings not working

Posted: Wed Nov 13, 2013 12:08 am
by paulbaker
I am still looking for a solution to this. :'(

Today I updated the site's modules via Module Manager:
CGCalendar 1.10.4 -> 1.12
CGExtensions 1.37.2 -> 1.37.3
FrontEndUsers 1.21.18 -> 1.22
News 2.13 -> 2.14.1

Cleared cache.

Still the same behaviour.

Nothing relevant in the admin log or PHP error logs.

Switched on debug but it doesn't help because the debug info is not shown on the page that crashes - the output is stopped. This is the complete HTML of the page that crashes (login), note there is no HEAD:

Code: Select all

</__body>

<div id="wrap">

<div id="tophead">
Welcome to ABC
</div>

<div id="header">
<a href="/" title="ABC"><img src="uploads/images/SiteImages/ABCsmall.gif"></a>
<h1><a href="/">ABC</a></h1>
<h2>blah</h2>
</div>

<div id="content">

<div id="right">
<h3>Login</h3>
<p>Authorised ABC users can login here to view the ABC HQ Intranet. Only authorised users are allowed to access this area.</p>
<p>If you do not have access and believe you should have, please <a href="http://www.example.com/index.php?page=register">register yourself</a>.</p>
<p>Login with your email address and password:</p>
<p>couldn't get pageid for welcome-
- you can see the error message at the bottom.

And here is the beginning of the template that produces that page:

Code: Select all

{process_pagedata}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{sitename} - {title}</title>	
{metadata}
{cms_stylesheet}

</head>
</__body>

{* Check if we are allowed to look at this page! *}
{if $ccuser->loggedin() AND !$ccuser->memberof('members') AND !$ccuser->memberof('members-hr') AND $position >= 2}
{* Not yet approved *}
  {redirect_page page='no-access-yet'}
{/if}
{if !$ccuser->loggedin() AND $position >= 2}
  {redirect_page page='login'}
{/if}

<div id="wrap">

<div id="tophead">
{if $ccuser->loggedin()}
Welcome {$customcontent_loginname}
{else}
Welcome to ABC
{/if}
</div>

<div id="header">
<a href="/" title="ABC"><img src="uploads/images/SiteImages/ABCsmall.gif"></a>
<h1><a href="/">ABC</a></h1>
<h2>blah</h2>
</div>

<div id="content">

<div id="right">
<h3>{title}</h3>
{content}
..........
The "Welcome to ABC" text is shown from this code:

Code: Select all

{if $ccuser->loggedin()}
Welcome {$customcontent_loginname}
{else}
Welcome to ABC
{/if}
suggesting the user has not logged in. But when you click to the home page you can see the user is logged in OK.

I would be grateful for any pointers. I don't think I am doing anything wrong - I believe I am seeing a bug so adding a bug report would be my next step.

Re: Frontend Users FEU redirection settings not working

Posted: Wed Nov 13, 2013 1:31 am
by calguy1000
Hi Paul.

Thanks to the complete and extensive information you provided I was able to reproduce this problem.

I have fixed this in svn... will release in the next few days.

Re: Frontend Users FEU redirection settings not working

Posted: Wed Nov 13, 2013 2:08 am
by paulbaker
Superb ;D

Thank you very much Calguy, I will look out for it.

O0

Re: Frontend Users FEU redirection settings not working

Posted: Tue Jan 21, 2014 9:24 pm
by paulbaker
Just an update on this. I upgraded FrontEndUsers from 1.22 -> 1.22.3 and now it's working as expected - the error is gone.

Thanks again Calguy! ;)