From 82ea2b3c02b74d7a98b3434f7b10dfc4b87c64d9 Mon Sep 17 00:00:00 2001 From: Justin Date: Fri, 21 Aug 2015 17:08:43 -0400 Subject: [PATCH 1/3] use wfShellExec? addshore just look at this @addshore I also added a space after the . at the end of the lines separating args.. hopefully this would work? not sure just wanted to sow you --- SpecialCreateWiki.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/SpecialCreateWiki.php b/SpecialCreateWiki.php index 3a0c0f9..2a49384 100644 --- a/SpecialCreateWiki.php +++ b/SpecialCreateWiki.php @@ -195,20 +195,35 @@ public function handleInput() { $cloudFlareStatus = $this->addCloudFlareRecord( $DBname ); $postCreationStatus->merge( $cloudFlareStatus ); } - + $shcreateaccount = + wfShellExec( + "/usr/bin/php $IP/extensions/CentralAuth/maintenance/createLocalAccount.php " . + ' --wiki ' . + wfEscapeShellArg( $DBname ) . + wfEscapeShellArg( $founder ) + ); + /* $shcreateaccount = exec( - "/usr/bin/php $IP/extensions/CentralAuth/maintenance/createLocalAccount.php " . + "/usr/bin/php $IP/extensions/CentralAuth/maintenance/createLocalAccount.php " . wfEscapeShellArg( $founder ) . ' --wiki ' . wfEscapeShellArg( $DBname ) ); + */ if ( !strpos( $shcreateaccount, 'created' ) ) { $postCreationStatus->merge( Status::newFatal( $this->msg( 'createwiki-error-usernotcreated' ) ) ); } - + $shpromoteaccount = + wfShellExec( + "/usr/bin/php $IP/maintenance/createAndPromote.php " . + wfEscapeShellArg( $founder ) . + ' --bureaucrat --sysop --force --wiki ' . + wfEscapeShellArg( $DBname ) + ); + /* $shpromoteaccount = exec( "/usr/bin/php $IP/maintenance/createAndPromote.php " . @@ -216,6 +231,7 @@ public function handleInput() { ' --bureaucrat --sysop --force --wiki ' . wfEscapeShellArg( $DBname ) ); + */ if ( !strpos( $shpromoteaccount, 'done.' ) ) { $postCreationStatus->merge( Status::newFatal( $this->msg( 'createwiki-error-usernotpromoted' ) ) From c64a5d8aaaab112291e0786a17885ad4f9c0b185 Mon Sep 17 00:00:00 2001 From: Justin Date: Sat, 22 Aug 2015 09:48:49 -0400 Subject: [PATCH 2/3] remove commented code --- SpecialCreateWiki.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/SpecialCreateWiki.php b/SpecialCreateWiki.php index 2a49384..ae32b4a 100644 --- a/SpecialCreateWiki.php +++ b/SpecialCreateWiki.php @@ -202,15 +202,6 @@ public function handleInput() { wfEscapeShellArg( $DBname ) . wfEscapeShellArg( $founder ) ); - /* - $shcreateaccount = - exec( - "/usr/bin/php $IP/extensions/CentralAuth/maintenance/createLocalAccount.php " . - wfEscapeShellArg( $founder ) . - ' --wiki ' . - wfEscapeShellArg( $DBname ) - ); - */ if ( !strpos( $shcreateaccount, 'created' ) ) { $postCreationStatus->merge( Status::newFatal( $this->msg( 'createwiki-error-usernotcreated' ) ) @@ -223,15 +214,6 @@ public function handleInput() { ' --bureaucrat --sysop --force --wiki ' . wfEscapeShellArg( $DBname ) ); - /* - $shpromoteaccount = - exec( - "/usr/bin/php $IP/maintenance/createAndPromote.php " . - wfEscapeShellArg( $founder ) . - ' --bureaucrat --sysop --force --wiki ' . - wfEscapeShellArg( $DBname ) - ); - */ if ( !strpos( $shpromoteaccount, 'done.' ) ) { $postCreationStatus->merge( Status::newFatal( $this->msg( 'createwiki-error-usernotpromoted' ) ) From 30ec7898402192a2622533b22eaf13b616be330d Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 24 Aug 2015 11:54:40 -0400 Subject: [PATCH 3/3] remove spaces --- SpecialCreateWiki.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SpecialCreateWiki.php b/SpecialCreateWiki.php index ae32b4a..2ce5aac 100644 --- a/SpecialCreateWiki.php +++ b/SpecialCreateWiki.php @@ -197,9 +197,9 @@ public function handleInput() { } $shcreateaccount = wfShellExec( - "/usr/bin/php $IP/extensions/CentralAuth/maintenance/createLocalAccount.php " . - ' --wiki ' . - wfEscapeShellArg( $DBname ) . + "/usr/bin/php $IP/extensions/CentralAuth/maintenance/createLocalAccount.php " . + ' --wiki ' . + wfEscapeShellArg( $DBname ) . wfEscapeShellArg( $founder ) ); if ( !strpos( $shcreateaccount, 'created' ) ) { @@ -209,9 +209,9 @@ public function handleInput() { } $shpromoteaccount = wfShellExec( - "/usr/bin/php $IP/maintenance/createAndPromote.php " . - wfEscapeShellArg( $founder ) . - ' --bureaucrat --sysop --force --wiki ' . + "/usr/bin/php $IP/maintenance/createAndPromote.php " . + wfEscapeShellArg( $founder ) . + ' --bureaucrat --sysop --force --wiki ' . wfEscapeShellArg( $DBname ) ); if ( !strpos( $shpromoteaccount, 'done.' ) ) {