CB Login using CURL

9 years 5 months ago #250023 by hasanda
CB Login using CURL was created by hasanda
Hi All,
First, thank you for the Dev Team for this nice component.

I'm trying to create a php script to login to my joomla site.

[code]

$ch = curl_init();
$curlConfig = array(
CURLOPT_URL => "mysite.com/index.php/register/login",
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => array(
'username' => 'TS002',
'passwd' => 'TS002',
)
);
curl_setopt_array($ch, $curlConfig);
$result = curl_exec($ch);

// Get logged in cookie and pass it to the browser
preg_match('/^Set-Cookie: (.*?);/m', $result, $m);
$cookie = explode('=', $m[1]);
setcookie($cookie[0], $cookie[1]);


header("location: mysite.com/index.php");

[code]

can someone please help me to fire the CB Loging module using CURL

Thank you.
Fernando

Please Log in to join the conversation.

9 years 5 months ago #250032 by nant
Replied by nant on topic CB Login using CURL
What version of Joomla?
What version of CB?

What exactly are you trying to do?

Please Log in to join the conversation.

9 years 5 months ago #250195 by hasanda
Replied by hasanda on topic CB Login using CURL
Hi Nant,
info you required,
Cb Version 1.9
Joomla! 3.0.3 Stable

What im trying to do is :
make php script, that can trigger(login process) the CB loging module in the home page. so the users who run the script do not have to enter the user name and password.

eg : www.myjoomlasite.com/phpscripttocblogin.php?user=foo&passw=bar
if pass the script
goto :
www.myjoomlasite.com/index.php

Thank you
Fernando

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.218 seconds

Facebook Twitter LinkedIn