Skip to content
Browse files

create_user_set: If user already exists then dont create but still

associate them with the blog
  • Loading branch information...
1 parent e6cdb6f commit 7fb476a1e50c9cba9359c803c76ed966aa83a691 enzo committed
Showing with 10 additions and 8 deletions.
  1. +10 −8 plugins/MTBooter/lib/MTBooter/Data.pm
View
18 plugins/MTBooter/lib/MTBooter/Data.pm
@@ -715,8 +715,9 @@ sub findAuthor($) {
my $author = MT::Author->load( { name => $username } );
if ($author) {
-
- return 1;
+
+ #return 1;
+ return $author;
}
else {
@@ -780,14 +781,15 @@ sub create_user_set_for_blog {
my $username = $g_UserPrefix . $j;
#get random first name
my $FirstName = getFirstName();
- #create user
- if ( ! findAuthor($username) )
+
+ my $author = findAuthor($username) ;
+ if ( ! $author )
{
- my $author = create_user( $username, "$FirstName $userType" );
- #create association
- require MT::Association;
- MT::Association->link( $author => $role => $blog );
+ $author = create_user( $username, "$FirstName $userType" );
}
+ #create association
+ require MT::Association;
+ MT::Association->link( $author => $role => $blog );
}
}
else

0 comments on commit 7fb476a

Please sign in to comment.
Something went wrong with that request. Please try again.