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
efc9aee7
authored
2010-11-24 20:41:50 +0000
by
Chris Boden
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update to address user creation on non-multisite blog. refs #784
1 parent
7cbea250
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
com/Auth/Auth.php
com/Auth/Auth.php
View file @
efc9aee
...
...
@@ -169,7 +169,7 @@ function register($username, $email, $password, $meta = Array()) {
* @see wpmu_activate_signup
*/
function
activate
(
$key
,
$password_validation
=
null
)
{
global
$wpdb
,
$current_blog
;
global
$wpdb
;
$signup
=
$wpdb
->
get_row
(
$wpdb
->
prepare
(
"SELECT * FROM
{
$wpdb
->
signups
}
WHERE activation_key = %s"
,
$key
));
if
(
empty
(
$signup
))
{
...
...
@@ -200,14 +200,21 @@ function activate($key, $password_validation = null) {
$wpdb
->
update
(
$wpdb
->
signups
,
Array
(
'active'
=>
1
,
'activated'
=>
current_time
(
'mysql'
,
true
)),
Array
(
'activation_key'
=>
$key
));
// $user_site = get_site_option('dashboard_blog', $current_site->blog_id);
if
(
function_exists
(
'add_user_to_blog'
))
{
global
$current_blog
;
add_user_to_blog
(
$current_blog
->
blog_id
,
$id
,
get_site_option
(
'default_user_role'
,
'subscriber'
));
}
else
{
$user
=
new
WP_User
(
$id
);
$user
->
add_role
(
get_site_option
(
'default_role'
,
'subscriber'
));
}
// If use these, fix variables, they're wrong
//add_new_user_to_blog( $id, $user_email, $meta );
//do_action(ACTION_ACTIVATE, $id, $password, $meta);
// If more than the password was sent in meta, have it generate user_meta for each key=>val pair
foreach
(
$meta
as
$key
=>
$val
)
{
foreach
(
$meta
as
$key
=>
$val
)
{
update_user_meta
(
$id
,
$key
,
$val
);
}
...
...
Please
register
or
sign in
to post a comment