Enable image uploads in mediawiki at startup

Signed-off-by: Hemanth Kumar Veeranki <hemanthveeranki@gmail.com>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
Hemanth Kumar Veeranki authored and Joseph Nuthalapati committed 2018-06-18 20:47:58 +05:30
1 parent a33e295ae2
commit 85dd471c35
2 files changed
+16 -1

No files matched your search

+15
View File
@@ -88,6 +88,7 @@ def subcommand_setup(_):
_disable_public_registrations()
_disable_anonymous_editing()
_change_logo()
_enable_file_uploads()
def _disable_public_registrations():
@@ -119,6 +120,20 @@ def _change_logo():
file_handle.write(line)
def _enable_file_uploads():
"""Enable file uploads in mediawiki"""
with open(CONF_FILE, 'r') as conf_file:
lines = conf_file.readlines()
with open(CONF_FILE, 'w') as conf_file:
for line in lines:
if line.startswith("$wgEnableUploads"):
words = line.split()
words[-1] = 'true;'
conf_file.write(" ".join(words) + '\n')
else:
conf_file.write(line)
def subcommand_change_password(arguments):
"""Change the password for a given user"""
new_password = ''.join(sys.stdin)