problem with check_login function

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
free_programmer
New Member
New Member
Posts: 2
Joined: Tue Oct 19, 2010 12:07 pm

problem with check_login function

Post by free_programmer »

Hello
this is my first post here,I use CMSMS since 2008.
I upgraded the website from version 1.2.3 to 1.8.1 and it went smoothly except for a small issue which is:
I have an external page for job where I use check_login() function to make sure the user already loged in,but it keeps redirect to the login page,when I enabled the debug to see the output it works (I can run the page ) and the debug output say:
Debug display of 'End of include':(0.086686) - (8497144)
Debug: (0.087416) - (8474200)

Session found.  Moving on...

It used to work perfectly before upgrading,I don't know what is the problem?
the full code for the page is attached,any hint is welcome :)
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

NaN

Re: problem with check_login function

Post by NaN »

Function check_login() without any params will always redirect to the login page if user is not logged in.
You need to pass true (boolean) to prevent redirecting.
But this means, that your script will also be processed if the user is not logged in.
free_programmer
New Member
New Member
Posts: 2
Joined: Tue Oct 19, 2010 12:07 pm

Re: problem with check_login function

Post by free_programmer »

thank you but in my case even when the user already loged in its redirect to the log in,the check_login() is returning true!!  ??? I can't pass true to the function , bc this will allow unauthorised users to see the script.

I don't what changed since 1.2.3 for this function
gdur
Forum Members
Forum Members
Posts: 142
Joined: Sun Jan 10, 2010 10:59 am

Re: problem with check_login function

Post by gdur »

Hi,

It's not clear but I guess this is about FEU.
This might help you:
{if $ccuser->loggedin()} (this can be refined with {|$ccuser->memberof ('name of group')})
place here the link to the external page
{else}
{redirect to='login'} (where redirect is a Smarty tag and login the alias of the login page).
{/if}

Keep in mind though that this only provides would be security. If the real url is known this can be easily bypassed.
Post Reply

Return to “CMSMS Core”