3acbdf2a7fc2b9b9e5af211ec0c3c98596906ce7
bernd Webapp-Installer, erste Ver...

bernd authored 15 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

5) Written by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

10) 
11) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
12) */
bernd Webapp-Installer, erste Ver...

bernd authored 15 years ago

13) 
14) require_once('inc/debug.php');
15) 
16) require_once('webapp-installer.php');
17) 
18) 
19) function validate_data($post)
20) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

21)     DEBUG('Validating Data:');
22)     DEBUG($post);
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

23)     $fields = ['adminuser', 'adminpassword', 'adminemail', 'wikiname'];
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

24)     foreach ($fields as $field) {
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

25)         if ((!isset($post[$field])) || $post[$field] == '') {
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

26)             system_failure('Nicht alle Werte angegeben (' . $field . ')');
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

27)         }
28)     }
bernd Webapp-Installer, erste Ver...

bernd authored 15 years ago

29) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

30)     $dbdata = create_webapp_mysqldb('mediawiki', $post['wikiname']);
bernd Webapp-Installer, erste Ver...

bernd authored 15 years ago

31) 
Hanno Böck Remove some unneeded whites...

Hanno Böck authored 1 year ago

32)     $adminuser = ucfirst(chop($post['adminuser']));
bernd Bei MediaWiki-Usernames mus...

bernd authored 13 years ago

33) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

34)     $salt = random_string(8);
35)     $salthash = ':B:' . $salt . ':' . md5($salt . '-' . md5($post['adminpassword']));
Hanno remove whitespace in empty...

Hanno authored 6 years ago

36) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

37)     $data = "adminuser={$adminuser}
bernd Webapp-Installer, erste Ver...

bernd authored 15 years ago

38) adminpassword={$salthash}
39) adminemail={$post['adminemail']}
40) wikiname={$post['wikiname']}
bernd Frage Datenbank-Kürzel nich...

bernd authored 15 years ago

41) dbname={$dbdata['dbname']}
42) dbuser={$dbdata['dbuser']}
43) dbpass={$dbdata['dbpass']}";
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

44)     DEBUG($data);
45)     return $data;