CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Login credentials in URL

Print topic Send  topic

Author Message
John Doe
Posted: 02/05/2005, 11:23 PM

Hello sirs,

I have authenticated PHP pages in CCS I would like to link to from an
external site, in the form of hyperlinks like:

http://www.domain.com/main.php?password=password&login=username

How do I authenticate against the user and password string passed in the
above URL, instead of redirecting to the login splash screen for a user
to log in?

Thanks
Don Safar
Posted: 02/06/2005, 8:54 AM

You can call the CCLoginUser function in common.php.
$loginresult = CCLoginUser($login, $password);
Test $loginresult to see if the user was validated or not.

"John Doe" <somebody@domain.com> wrote in message
news:cu4gm8$h53$1@news.codecharge.com...
> Hello sirs,
>
> I have authenticated PHP pages in CCS I would like to link to from an
> external site, in the form of hyperlinks like:
>
> http://www.domain.com/main.php?password=password&login=username
>
> How do I authenticate against the user and password string passed in the
> above URL, instead of redirecting to the login splash screen for a user to
> log in?
>
> Thanks

Albert Public
Posted: 02/06/2005, 4:07 PM

I'm still a bit unclear. Where would I add the code to authenticate
using the login and password passed in the URL string? I've got the
page configured as "restricted" (requires authentication) but obviously
I am missing something.

Thanks.

Don Safar wrote:
> You can call the CCLoginUser function in common.php.
> $loginresult = CCLoginUser($login, $password);
> Test $loginresult to see if the user was validated or not.
>
> "John Doe" <somebody@domain.com> wrote in message
>news:cu4gm8$h53$1@news.codecharge.com...
>
>>Hello sirs,
>>
>>I have authenticated PHP pages in CCS I would like to link to from an
>>external site, in the form of hyperlinks like:
>>
>>http://www.domain.com/main.php?password=password&login=username
>>
>>How do I authenticate against the user and password string passed in the
>>above URL, instead of redirecting to the login splash screen for a user to
>>log in?
>>
>>Thanks
>
>
>
mrachow


Posts: 509
Posted: 02/06/2005, 11:45 PM

The only chance should be the earliest page event:
After Initialize
Add there Dons code as custom code.
_________________
Best regards,
Michael
View profile  Send private message
Nicole

Posts: 586
Posted: 02/07/2005, 1:43 AM

John,
When user opens a page his access rights are validated through CCSecurityRedirect() function that is called in Authenticate User section before all page events, even before Page After Initialize. So please edit CCS code directly
  
CCLoginUser($login, $password);  
//Authenticate User @1-872FD3D7  
CCSecurityRedirect("", "");  
//End Authenticate User  

_________________
Regards,
Nicole
View profile  Send private message
John Doe
Posted: 02/08/2005, 4:18 PM

Setting a static value there such as:

CCLoginUser("username", "password");

works. However, it's not authenticating with the $login and $password,
where these variables are specified in the URL (ie
http://www.domain.com/page.php?login=blah&password.blah). It redirects
to the login page instead.

Any suggestions? Am I missing anything?

Nicole wrote:
> John,
> When user opens a page his access rights are validated through
> CCSecurityRedirect() function that is called in Authenticate User section
> before all page events, even before Page After Initialize. So please edit CCS
> code directly
>
  
> CCLoginUser($login, $password);  
> //Authenticate User @1-872FD3D7  
> CCSecurityRedirect("", "");  
> //End Authenticate User  
> 
>
> _________________
> Regards,
> Nicole
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
John Doe
Posted: 02/08/2005, 4:36 PM

FYI, i also tried adding, above the CCLoginUser line:

CCGetFromGet("login","");
CCGetFromGet("password","");

and the same with CCGetParam, no dice.

Clues appreciated!

John Doe wrote:
> Setting a static value there such as:
>
> CCLoginUser("username", "password");
>
> works. However, it's not authenticating with the $login and $password,
> where these variables are specified in the URL (ie
> http://www.domain.com/page.php?login=blah&password.blah). It redirects
> to the login page instead.
>
> Any suggestions? Am I missing anything?
>
> Nicole wrote:
>
>> John,
>> When user opens a page his access rights are validated through
>> CCSecurityRedirect() function that is called in Authenticate User section
>> before all page events, even before Page After Initialize. So please
>> edit CCS
>> code directly
>>
  
>> CCLoginUser($login, $password);  
>> //Authenticate User @1-872FD3D7  
>> CCSecurityRedirect("", "");  
>> //End Authenticate User  
>> 
>>
>> _________________
>> Regards,
>> Nicole
>> ---------------------------------------
>> Sent from YesSoftware forum
>> http://forums.codecharge.com/
>>
Nicole

Posts: 586
Posted: 02/09/2005, 2:07 AM

John,
You’re right, you need to obtain URL values first. So the problem is in using CCGetParam() or CCGetFromGet() functions.
You can refer to CCS docs to find more about them
http://docs.codecharge.com/studio/html/index.html?http:...romGet.html?toc
http://docs.codecharge.com/studio/html/index.html?http:...tParam.html?toc

Please make sure that you spelled the URL parameter correctly. For debug purpose print result of CCGetParam()
  
$login = CCGetParam("login_parameter_name", "default login");  
echo "login=". $login;  
$password = CCGetParam("password_parameter_name", "default password");  
echo "password=". $password;  
  
CCLoginUser($login, $password);    
//Authenticate User @1-872FD3D7    
CCSecurityRedirect("", "");    
//End Authenticate User    

_________________
Regards,
Nicole
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.