Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f5073b5a
authored
2011-02-10 16:17:06 +0000
by
Marty Penner
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Cleaned up search and merge functionality
1 parent
fa978a0c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
com/UserManager/UserManager.php
com/UserManager/UserManager.php
View file @
f5073b5
...
...
@@ -985,7 +985,7 @@ class Actions {
$query
=
"
SELECT ID, user_email
FROM
$wpdb->users
WHERE
WHERE
(
(user_login LIKE '%
$username
%')
OR (user_email LIKE '%
$username
%')
OR (ID IN (
...
...
@@ -993,7 +993,7 @@ class Actions {
FROM
$wpdb->usermeta
WHERE (meta_key = 'first_name' OR meta_key = 'last_name')
AND meta_value LIKE '%
$username
%'
))
))
)
AND (ID NOT IN (
SELECT user_id FROM
$wpdb->usermeta
WHERE meta_key = 'status' AND meta_value = 'terminated'
))
...
...
@@ -1049,21 +1049,23 @@ HTML;
$html
=
''
;
$from_user
=
new
User\Account
(
$_POST
[
'merge_user_from'
]);
$to_user
=
new
User\Account
(
$_POST
[
'merge_user_to'
]);
// These fields are skipped ONLY IN DISPLAY
$skipped_fields
=
array
(
'ID'
,
'id'
,
'user_login'
,
'user_pass'
,
'user_nicename'
,
'user_email'
,
'member_id'
,
'user_url'
,
'user_registered'
,
'user_activation_key'
,
'user_status'
,
'display_name'
,
'id'
,
'caps'
,
'cap_key'
,
'roles'
,
'allcaps'
,
'filter'
,
'user_pass'
,
'user_activation_key'
,
'status'
,
'four_security_expiration'
,
'course_4q_approvals'
,
...
...
@@ -1101,13 +1103,19 @@ HTML;
if
(
$key
==
'member_id'
&&
empty
(
$val
))
{
continue
;
}
// Make sure we're updating the right user ID and perform update
update_user_meta
(
$to_user
->
ID
,
$key
,
$val
);
// Build a table of data
$html
.=
"
\n\t
<tr><td>
$key
:
$val
</td></tr>"
;
}
if
(
!
empty
(
$from_user
->
user_email
))
{
// Transfer old user's profile preference email address (work, home, etc.) to new user's user_email field
if
(
isset
(
$from_user
->
profile_preference
)
&&
!
empty
(
$from_user
->
profile_preference
))
{
$preference
=
strtolower
(
$from_user
->
profile_preference
)
.
'_email'
;
_update_user
(
array
(
'ID'
=>
$to_user
->
ID
,
'user_email'
=>
$from_user
->
$preference
));
}
}
// Set a few meta values for the old user
update_user_meta
(
$from_user
->
ID
,
'status'
,
'terminated'
);
...
...
Please
register
or
sign in
to post a comment