Advertisement
Guest User

Untitled

a guest
Jul 24th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1.  
  2. // Create local account for founder (hack)
  3. $out = exec( "php5 $IP/extensions/CentralAuth/maintenance/createLocalAccount.php " . escapeshellarg( $founderName ) . ' --wiki ' . escapeshellarg( $DBname ) );
  4. if ( !strpos( $out, 'created' ) ) {
  5. wfDebugLog( 'CreateWiki', 'Failed to create local account for founder.' );
  6. return wfMessage( 'createwiki-error-usernotcreated' )->plain();
  7. }
  8. require_once( "$IP/includes/UserRightsProxy.php" );
  9. // Grant founder sysop and bureaucrat rights
  10. $founderUser = UserRightsProxy::newFromName( $DBname, $founderName );
  11. $newGroups = array( 'sysop', 'bureaucrat' );
  12. array_map( array( $founderUser, 'addGroup' ), $newGroups );
  13. $founderUser->invalidateCache();
  14. $form->getOutput()->addWikiMsg( 'createwiki-success', $DBname );
  15. wfDebugLog( 'CreateWiki', 'Successfully created ' . $DBname . ' with a founder of ' . $founderName );
  16. return true;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement