Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 819 Vote(s) - 3.43 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Joomla and WHMCS Auto Login

#1
I was integrating auto login system with joomla and WHMCS.

What i want is single login for both joomla and WHMCS.When i logged in joomla, automatically i need my WHMCS system should be logged in and vice verse. I have gone through the WHMCS API, it has AuthAuto login with 'dologin.php' file. But it need redirect to my WHMCS after i login to my joomla, which i don't need.

Even i used 'validatelogin' action in my api call . Also i have hooked 'ClientLogin' and send me a email. When i login through joomla this hook is being called . But my WHMCS when i refresh i am not being logged in.


$url = "http://myjoomlasiteurl/includes/api.php";
$username = "xxxxxx";
$password = "xxxxxxxxxx";
$postfields= array();
$postfields["username"] = $username;
$postfields["password"] = md5($password);
$postfields["accesskey"] = "xxxxx";

$postfields["action"] = "validatelogin";
$postfields["email"] = "[email protected]";
$postfields["password2"] = "xxxxx";


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
if (($result= curl_exec($ch)) !== false) {
$data= format_result($result);

$_SESSION['uid'] = $data['userid'];
$_SESSION['upw'] = $data['passwordhash'];

}
curl_close($ch);

In my WHMCS hook. i have written codes as :



function hook_client_logint($vars) {

ob_start();
var_dump($_SESSION);
$content= ob_get_contents();
@mail('myemailid,'User Login',$content);
ob_end_clean();
# Here i ma getting email after i logged in to my Joomla site.
session variable 'uid' and 'upw' are being set.

}

add_hook("ClientLogin",1,"hook_client_login");
Reply

#2
Don't use redirect for login, just make the visit through `CURL`, get the page check the HTTP Response to be `200`.

You need 2 Joomla plugins (`authenticate,user`)

You need a hook 3 actions:

- addClient
- Create Joomla user
- ClientLogin - make call to login the Joomla user
- ClientLogout - make call to logout the Joomla user
- ClientChangePassword - make call to update the password to Joomla User

to make the Call to Joomla via `CURL` actually can not be done easily because of token.

But you can create a component-view and there you can submit a POST request with the info, in this case email and password

This may help
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through