Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
civicrm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
plugins
civicrm
Commits
8a33cd58
Commit
8a33cd58
authored
9 years ago
by
Kevin Cristiano
Browse files
Options
Downloads
Patches
Plain Diff
PRERELEASE-CRM-17968 -- load users for joomla and WP jitendrapurohit
parent
7dc239aa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
civicrm/CRM/Utils/System/WordPress.php
+12
-3
12 additions, 3 deletions
civicrm/CRM/Utils/System/WordPress.php
civicrm/bin/cli.class.php
+1
-1
1 addition, 1 deletion
civicrm/bin/cli.class.php
with
13 additions
and
4 deletions
civicrm/CRM/Utils/System/WordPress.php
+
12
−
3
View file @
8a33cd58
...
...
@@ -326,13 +326,22 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
}
/**
* FIXME: Do something
*
* @param \obj $user
* @param \string $user
*
* @return bool
*/
public
function
loadUser
(
$user
)
{
$userdata
=
get_user_by
(
'login'
,
$user
);
if
(
!
$userdata
->
data
->
ID
)
{
return
FALSE
;
}
$uid
=
$userdata
->
data
->
ID
;
wp_set_current_user
(
$uid
);
$contactID
=
CRM_Core_BAO_UFMatch
::
getContactId
(
$uid
);
// lets store contact id and user id in session
$session
=
CRM_Core_Session
::
singleton
();
$session
->
set
(
'ufID'
,
$uid
);
$session
->
set
(
'userID'
,
$contactID
);
return
TRUE
;
}
...
...
This diff is collapsed.
Click to expand it.
civicrm/bin/cli.class.php
+
1
−
1
View file @
8a33cd58
...
...
@@ -269,7 +269,7 @@ class civicrm_cli {
$this
->
_log
(
ts
(
"Failed to login as %1. Wrong username or password."
,
array
(
'1'
=>
$this
->
_user
)));
return
FALSE
;
}
if
(
!
$cms
->
loadUser
(
$this
->
_user
))
{
if
(
(
$this
->
_config
->
userFramework
==
'Joomla'
&&
!
$cms
->
loadUser
(
$this
->
_user
,
$this
->
_password
))
||
!
$cms
->
loadUser
(
$this
->
_user
))
{
$this
->
_log
(
ts
(
"Failed to login as %1"
,
array
(
'1'
=>
$this
->
_user
)));
return
FALSE
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment