Jump to content

Manual talk:Edit.php

Add topic
From mediawiki.org
Latest comment: 5 years ago by Ciencia Al Poder in topic Created user accounts

AUTO CREATE PAGE using php shell_exec

[edit]

AUTO CREATE PAGE[edit]

[edit]
To create automatically an new page use the following in an shell in an QNAP 459

This will create an new page called Page_I_want_to_create

/mnt/ext/opt/apache/bin/php /share/Web/VHost_qbox4u/conf/tech/mwk/maintenance/edit.php -s "Quick edit" -m Page_I_want_to_create < /share/Web/tst/aa.txt

Using PHP
The PHP interface : /mnt/ext/opt/apache/bin/php
The Mediawiki interface :/share/Web/VHost_qbox4u/conf/tech/mwk/maintenance/edit.php
My text to inject into the new page : /share/Web/tst/boilerpage.txt
 
 $cmd = '/mnt/ext/opt/apache/bin/php /share/Web/VHost_qbox4u/conf/tech/mwk/maintenance/edit.php -s "Quick edit" -m Page_I_want_to_create < /share/Web/tst/boilerpage.txt';
 $html_body 	.= "execute:$cmd<br>";
 $html_body 	.= shell_exec($cmd);
 // exchange the \n for <br>
 $html_body 	= nl2br($html_body); 1.175.57.106 (talk) 01:25, 8 September 2016 (UTC)Reply

Warning: Missing argument 12 for accessLogEditAction()

[edit]
*****LocalSettings.php****
define( 'NS_SPAG',  3002 );
define( 'NS_SPAG_TALK',  3003 );
$wgExtraNamespaces[NS_SPAG] = 'School';
$wgExtraNamespaces[NS_SPAG+1] = 'School_talk';
*** script****
[/share/Web/VHost_qbox4u/conf/abc/mwk/maintenance] /mnt/ext/opt/apache/bin/php /share/Web/VHost_qbox4u/conf/abc/mwk/maintenance/edit.php -s "Quick edit" -m School:Bp2 < /share/Web/tst/boilerpage_01.txt
Saving...
Warning: Missing argument 12 for accessLogEditAction() in /share/MD0_DATA/Web/VHost_qbox4u/conf/abc/mwk/extensions/UMEduWiki/AccessLog/AccessLog.php on line 104
done
[/share/Web/VHost_qbox4u/conf/abc/mwk/maintenance]
*** Check existance***
https://qbox4u.com:8081/conf/abc/mwk/index.php?title=Special%3APrefixIndex&prefix=&namespace=3002
<Special pages> <All pages with prefix><Namespace:School>
Page not available in listing 1.175.57.106 (talk) 01:54, 9 September 2016 (UTC)Reply
This looks like a problem with UMEduWiki extension. Try disabling it, get an updated version of it or open a bug report to the maintainer of that extension (which doesn't seem to be listed here on mediawiki.org) Ciencia Al Poder (talk) 09:37, 9 September 2016 (UTC)Reply

Only make edit if user and page have correct rights and permissions

[edit]

Is there a way to make edits to the wiki from the command line that are attributed to specific users but will only make the edits if the user has the correct editing permissions?

I'd like to use this script, but I don't want to override any page locks or user account restrictions in doing so. Jer Hughes (talk) 15:44, 19 February 2020 (UTC)Reply

This script doesn't check for such restrictions. Looks like you'll have to tell your users to edit the pages directly or use a bot Ciencia Al Poder (talk) 10:41, 20 February 2020 (UTC)Reply

Created user accounts

[edit]

"If the specified user does not exist, it will be created."

Is there a default password used for these created accounts? By default, could a person utilize these accounts for logging into the wiki? If I don't want these accounts to be abused, would I need to add them to $wgReservedUsernames? Jer Hughes (talk) 16:26, 19 February 2020 (UTC)Reply

The user created is initialized with a "not set" password, which means nobody can log in with that user account. Ciencia Al Poder (talk) 10:43, 20 February 2020 (UTC)Reply