WPCrm readd forceLogin()
This commit is contained in:
parent
647ac8acb5
commit
61aeca5e31
1 changed files with 15 additions and 0 deletions
|
|
@ -85,6 +85,21 @@ class WPCrm
|
|||
return self::$user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually login a user
|
||||
* If self::$user is already set.
|
||||
*
|
||||
* @return \LDCCRM\WPCrmUser|null
|
||||
*/
|
||||
public static function forceLogin()
|
||||
{
|
||||
self::bootSessionIfNeeded();
|
||||
if ($user = self::getUser()) {
|
||||
$_SESSION['wpcrm'][self::$sessionKey] = json_encode($user);
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current user
|
||||
* return api response code if an error occurs
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue