Fix for r47482: put the RELEASE-NOTES entry in the "bug fixes" section and not the...
[mediawiki.git] / maintenance / ourusers.php
bloba7a3132baeb91a620c71bbbafa50e01b8d78fa1d
1 <?php
2 /**
3 * Wikimedia specific
5 * This script generates SQL used to update MySQL users on a hardcoded
6 * list of hosts. It takes care of setting the wikiuser for every
7 * database as well as setting up wikiadmin.
9 * @todo document
10 * @file
11 * @ingroup Maintenance
14 /** */
15 $wikiuser_pass = `wikiuser_pass`;
16 $wikiadmin_pass = `wikiadmin_pass`;
17 $nagios_pass = `nagios_sql_pass`;
19 $hosts = array(
20 'localhost',
21 '10.0.%',
22 '66.230.200.%',
23 '208.80.152.%',
26 $databases = array(
27 '%wik%',
28 'centralauth',
31 print "/*!40100 set old_passwords=1 */;\n";
32 print "/*!40100 set global old_passwords=1 */;\n";
34 foreach( $hosts as $host ) {
35 print "--\n-- $host\n--\n";
36 print "\n-- wikiuser\n\n";
37 print "GRANT REPLICATION CLIENT,PROCESS ON *.* TO 'wikiuser'@'$host' IDENTIFIED BY '$wikiuser_pass';\n";
38 print "GRANT ALL PRIVILEGES ON `boardvote%`.* TO 'wikiuser'@'$host' IDENTIFIED BY '$wikiuser_pass';\n";
39 foreach( $databases as $db ) {
40 print "GRANT SELECT, INSERT, UPDATE, DELETE ON `$db`.* TO 'wikiuser'@'$host' IDENTIFIED BY '$wikiuser_pass';\n";
43 print "\n-- wikiadmin\n\n";
44 print "GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'wikiadmin'@'$host' IDENTIFIED BY '$wikiadmin_pass';\n";
45 print "GRANT ALL PRIVILEGES ON `boardvote%`.* TO wikiadmin@'$host' IDENTIFIED BY '$wikiadmin_pass';\n";
46 foreach ( $databases as $db ) {
47 print "GRANT ALL PRIVILEGES ON `$db`.* TO wikiadmin@'$host' IDENTIFIED BY '$wikiadmin_pass';\n";
49 print "\n-- nagios\n\n";
50 print "GRANT REPLICATION CLIENT ON *.* TO 'nagios'@'$host' IDENTIFIED BY '$nagios_pass';\n";
52 print "\n";