Index: trunk/phase3/AdminSettings.sample |
— | — | @@ -1,32 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * This file should be copied to AdminSettings.php, and modified |
5 | | - * to reflect local settings. It is required for the maintenance |
6 | | - * scripts which run on the command line, as an extra security |
7 | | - * measure to allow using a separate user account with higher |
8 | | - * privileges to do maintenance work. |
9 | | - * |
10 | | - * Developers: Do not check AdminSettings.php into Subversion |
11 | | - */ |
12 | | - |
13 | | -/* |
14 | | - * This data is used by all database maintenance scripts |
15 | | - * (see directory maintenance/). The SQL user MUST BE |
16 | | - * MANUALLY CREATED or set to an existing user with |
17 | | - * necessary permissions. |
18 | | - * |
19 | | - * This is not to be confused with sysop accounts for the |
20 | | - * wiki. |
21 | | - * |
22 | | - * NOTE: for PostgreSQL this should be set to the same user and |
23 | | - * password as the web user, that is, the same as $wgDBuser and |
24 | | - * $wgDBpassword in LocalSettings.php. This is necessary to |
25 | | - * ensure that the owner for new tables is set correctly. |
26 | | - */ |
27 | | -$wgDBadminuser = 'wikiadmin'; |
28 | | -$wgDBadminpassword = 'adminpass'; |
29 | | - |
30 | | -/* |
31 | | - * Whether to enable the profileinfo.php script. |
32 | | - */ |
33 | | -$wgEnableProfileInfo = false; |
Index: trunk/phase3/maintenance/fuzz-tester.php |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | } |
140 | 140 | // --------- End --------- |
141 | 141 | |
142 | | - Also add/change this in AdminSettings.php: |
| 142 | + Also add/change this in LocalSettings.php: |
143 | 143 | // --------- Start --------- |
144 | 144 | $wgEnableProfileInfo = true; |
145 | 145 | $wgDBserver = "localhost"; // replace with DB server hostname |
Index: trunk/phase3/maintenance/README |
— | — | @@ -10,8 +10,8 @@ |
11 | 11 | |
12 | 12 | Certain scripts will require elevated access to the database. In order to |
13 | 13 | provide this, first create a MySQL user with "all" permissions on the wiki |
14 | | -database, and then place their username and password in an AdminSettings.php |
15 | | -file in the directory above. See AdminSettings.sample for specifics on this. |
| 14 | +database, and then set $wgDBadminuser and $wgDBadminpassword in your |
| 15 | +LocalSettings.php |
16 | 16 | |
17 | 17 | === Brief explanation of files === |
18 | 18 | |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | Immediately complete all jobs in the job queue |
96 | 96 | |
97 | 97 | stats.php |
98 | | - Show all statistics stored in memcached |
| 98 | + Show all statistics stored in the cache |
99 | 99 | |
100 | 100 | undelete.php |
101 | 101 | Undelete all revisions of a page |
Index: trunk/phase3/maintenance/commandLine.inc |
— | — | @@ -171,8 +171,8 @@ |
172 | 172 | #require_once( $IP.'/includes/ProfilerStub.php' ); |
173 | 173 | require( $IP.'/includes/Defines.php' ); |
174 | 174 | require( $IP.'/CommonSettings.php' ); |
175 | | - if ( !$wgUseNormalUser ) { |
176 | | - require( $IP.'/AdminSettings.php' ); |
| 175 | + if ( !$wgUseNormalUser && is_readable( "$IP/AdminSettings.php" ) ) { |
| 176 | + require( "$IP/AdminSettings.php" ); |
177 | 177 | } |
178 | 178 | } else { |
179 | 179 | $wgWikiFarm = false; |
Index: trunk/phase3/UPGRADE |
— | — | @@ -42,8 +42,7 @@ |
43 | 43 | repository, via a checkout or export operation. |
44 | 44 | |
45 | 45 | Replace the existing MediaWiki files with the new. You should preserve the |
46 | | -LocalSettings.php file, AdminSettings.php file (if present), and the |
47 | | -"extensions" and "images" directories. |
| 46 | +LocalSettings.php file and the "extensions" and "images" directories. |
48 | 47 | |
49 | 48 | Depending upon your configuration, you may also need to preserve additional |
50 | 49 | directories, including a custom upload directory ($wgUploadDirectory), |
— | — | @@ -51,8 +50,8 @@ |
52 | 51 | |
53 | 52 | === Perform the database upgrade === |
54 | 53 | |
55 | | -You will need an AdminSettings.php file set up in the correct format; see |
56 | | -AdminSettings.sample in the wiki root for more information and examples. |
| 54 | +You will need to have $wgDBadminuser and $wgDBadminpass set in your |
| 55 | +LocalSettings.php, see there for more info. |
57 | 56 | |
58 | 57 | From the command line, browse to the "maintenance" directory and run the |
59 | 58 | update.php script to check and update the schema. This will insert missing |
— | — | @@ -172,10 +171,10 @@ |
173 | 172 | === Web installer === |
174 | 173 | |
175 | 174 | You can use the web-based installer wizard if you first remove the |
176 | | -LocalSettings.php (and AdminSettings.php, if any) files; be sure to |
177 | | -give the installer the same information as you did on the original |
178 | | -install (language/encoding, database name, password, etc). This will |
179 | | -also generate a fresh LocalSettings.php, which you may need to customize. |
| 175 | +LocalSettings.php file; be sure to give the installer the same |
| 176 | +information as you did on the original install (language/encoding, |
| 177 | +database name, password, etc). This will also generate a fresh |
| 178 | +LocalSettings.php, which you may need to customize. |
180 | 179 | |
181 | 180 | You may change some settings during the install, but be very careful! |
182 | 181 | Changing the encoding in particular will generally leave you with a |
— | — | @@ -185,8 +184,8 @@ |
186 | 185 | |
187 | 186 | Additionally, as of 1.4.0 you can run an in-place upgrade script from |
188 | 187 | the command line, keeping your existing LocalSettings.php. This requires |
189 | | -that you create an AdminSettings.php giving an appropriate database user |
190 | | -and password with privileges to modify the database structure. |
| 188 | +that you set $wgDBadminuser and $wgDBadminpassword with an appropriate |
| 189 | +database user and password with privileges to modify the database structure. |
191 | 190 | |
192 | 191 | Once the new files are in place, go into the maintenance subdirectory and |
193 | 192 | run the script: |
Index: trunk/phase3/docs/scripts.txt |
— | — | @@ -35,10 +35,9 @@ |
36 | 36 | to force the profiler to save the informations in the database and apply the |
37 | 37 | maintenance/archives/patch-profiling.sql patch to the database. |
38 | 38 | |
39 | | - To enable the profileinfo.php itself, you'll need to create the |
40 | | - AdminSettings.php file (see AdminSettings.sample for more information) and |
41 | | - set $wgEnableProfileInfo to true in that file. See also |
42 | | - http://www.mediawiki.org/wiki/How_to_debug#Profiling. |
| 39 | + To enable the profileinfo.php itself, you'll need to set $wgDBadminuser |
| 40 | + and $wgDBadminpassword in your LocalSettings.php, as well as $wgEnableProfileInfo |
| 41 | + See also http://www.mediawiki.org/wiki/How_to_debug#Profiling. |
43 | 42 | |
44 | 43 | redirect.php |
45 | 44 | Script that only redirect to the article passed in the wpDropdown parameter |
Index: trunk/phase3/profileinfo.php |
— | — | @@ -4,7 +4,6 @@ |
5 | 5 | $wgEnableProfileInfo = $wgProfileToDatabase = false; |
6 | 6 | |
7 | 7 | require_once( './includes/WebStart.php' ); |
8 | | -@include_once( './AdminSettings.php' ); |
9 | 8 | |
10 | 9 | ?> |
11 | 10 | <!-- |
Index: trunk/phase3/t/Search.inc |
— | — | @@ -7,11 +7,10 @@ |
8 | 8 | require 'includes/Defines.php'; |
9 | 9 | require 'includes/ProfilerStub.php'; |
10 | 10 | require 'LocalSettings.php'; |
11 | | -require 'AdminSettings.php'; |
12 | 11 | require 'includes/Setup.php'; |
13 | 12 | |
14 | 13 | function buildTestDatabase( $tables ) { |
15 | | - global $wgDBprefix, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname, $wgDBtype; |
| 14 | + global $wgDBprefix, $wgDBserver, $wgDBname, $wgDBtype; |
16 | 15 | $oldPrefix = $wgDBprefix; |
17 | 16 | $wgDBprefix = 'parsertest'; |
18 | 17 | |
Index: trunk/phase3/config/index.php |
— | — | @@ -633,6 +633,7 @@ |
634 | 634 | $conf->RootUser = importPost( "RootUser", "root" ); |
635 | 635 | $conf->RootPW = importPost( "RootPW", "" ); |
636 | 636 | $useRoot = importCheck( 'useroot', false ); |
| 637 | + $conf->populateadmin = importCheck( 'populateadmin', false ); |
637 | 638 | $conf->LanguageCode = importPost( "LanguageCode", "en" ); |
638 | 639 | ## MySQL specific: |
639 | 640 | $conf->DBprefix = importPost( "DBprefix" ); |
— | — | @@ -1000,7 +1001,7 @@ |
1001 | 1002 | if ($wgDatabase->isOpen()) { |
1002 | 1003 | $wgDBOracleDefTS = $conf->DBdefTS_ora; |
1003 | 1004 | $wgDBOracleTempTS = $conf->DBtempTS_ora; |
1004 | | - dbsource( "../maintenance/ora/user.sql", $wgDatabase ); |
| 1005 | + $wgDatabase->sourceFile( "../maintenance/ora/user.sql" ); |
1005 | 1006 | } else { |
1006 | 1007 | echo "<li>Invalid database superuser, please supply a valid superuser account.</li>"; |
1007 | 1008 | echo "<li>ERR: ".print_r(oci_error(), true)."</li>"; |
— | — | @@ -1173,7 +1174,7 @@ |
1174 | 1175 | print " <b class='error'>If the next step fails, see <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'>http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b>"; |
1175 | 1176 | } |
1176 | 1177 | print "</li>\n"; |
1177 | | - dbsource( "../maintenance/users.sql", $wgDatabase ); |
| 1178 | + $wgDatabase->sourceFile( "../maintenance/users.sql" ); |
1178 | 1179 | } |
1179 | 1180 | } |
1180 | 1181 | } |
— | — | @@ -1207,8 +1208,8 @@ |
1208 | 1209 | # FIXME: Check for errors |
1209 | 1210 | print "<li>Creating tables..."; |
1210 | 1211 | if ($conf->DBtype == 'mysql') { |
1211 | | - dbsource( "../maintenance/tables.sql", $wgDatabase ); |
1212 | | - dbsource( "../maintenance/interwiki.sql", $wgDatabase ); |
| 1212 | + $wgDatabase->sourceFile( "../maintenance/tables.sql" ); |
| 1213 | + $wgDatabase->sourceFile( "../maintenance/interwiki.sql" ); |
1213 | 1214 | } elseif (is_callable(array($wgDatabase, 'setup_database'))) { |
1214 | 1215 | $wgDatabase->setup_database(); |
1215 | 1216 | } |
— | — | @@ -1241,7 +1242,7 @@ |
1242 | 1243 | } else { |
1243 | 1244 | # Yes, so run the grants |
1244 | 1245 | echo( "<li>" . htmlspecialchars( "Granting user permissions to $wgDBuser on $wgDBname..." ) ); |
1245 | | - dbsource( "../maintenance/users.sql", $wgDatabase ); |
| 1246 | + $wgDatabase->sourceFile( "../maintenance/users.sql" ); |
1246 | 1247 | echo( "success.</li>\n" ); |
1247 | 1248 | } |
1248 | 1249 | } |
— | — | @@ -1547,6 +1548,8 @@ |
1548 | 1549 | <label class="column">Superuser account:</label> |
1549 | 1550 | <input type="checkbox" name="useroot" id="useroot" <?php if( $useRoot ) { ?>checked="checked" <?php } ?> /> |
1550 | 1551 | <label for="useroot">Use superuser account</label> |
| 1552 | + <input type="checkbox" name="populateadmin" id="populateadmin" <?php if( $conf->populateadmin ) { ?>checked="checked" <?php } ?> /> |
| 1553 | + <label for="populateadmin">Set as admin user for maintenance</label> |
1551 | 1554 | </div> |
1552 | 1555 | <div class="config-input"><?php aField( $conf, "RootUser", "Superuser name:", "text" ); ?></div> |
1553 | 1556 | <div class="config-input"><?php aField( $conf, "RootPW", "Superuser password:", "password" ); ?></div> |
— | — | @@ -1812,6 +1815,11 @@ |
1813 | 1816 | # Needs literal string interpolation for the current style path |
1814 | 1817 | $slconf['RightsIcon'] = $conf->RightsIcon; |
1815 | 1818 | } |
| 1819 | + |
| 1820 | + if( $conf->populateadmin ) { |
| 1821 | + $slconf['DBadminuser'] = $conf->RootUser; |
| 1822 | + $slconf['DBadminpassword'] = $conf->RootPW; |
| 1823 | + } |
1816 | 1824 | |
1817 | 1825 | if( $conf->DBtype == 'mysql' ) { |
1818 | 1826 | $dbsettings = |
— | — | @@ -1919,6 +1927,10 @@ |
1920 | 1928 | |
1921 | 1929 | {$dbsettings} |
1922 | 1930 | |
| 1931 | +## Database admin settings, used for maintenance scripts |
| 1932 | +\$wgDBadminuser = \"{$slconf['DBadminuser']}\"; |
| 1933 | +\$wgDBadminpassword = \"{$slconf['DBadminpassword']}\"; |
| 1934 | + |
1923 | 1935 | ## Shared memory settings |
1924 | 1936 | \$wgMainCacheType = $cacheType; |
1925 | 1937 | \$wgMemCachedServers = $mcservers; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -37,7 +37,6 @@ |
38 | 38 | this. Was used when mwEmbed was going to be an extension. |
39 | 39 | * $wgDebugJavaScript if we want to enable fresh debug javascript |
40 | 40 | * $wgPhpCliPath Path to php-cli for spinning up background php processes |
41 | | - |
42 | 41 | * (bug 18222) $wgMinimalPasswordLength default is now 1 |
43 | 42 | * $wgSessionHandler can be used to configure session.save_handler |
44 | 43 | * $wgLocalFileRepo/$wgForeignFileRepos now have a 'fileMode' parameter to |
— | — | @@ -151,7 +150,10 @@ |
152 | 151 | thumbnails to be stored in a separate location to the source images. |
153 | 152 | * If config/ directory is not executable, the command to make it executable |
154 | 153 | now asks the user to cd to the correct directory |
155 | | -* Add experimental new external authentication framework, ExternalAuth. |
| 154 | +* Add experimental new external authentication framework, ExternalAuth |
| 155 | +* (bug 14201) Set $wgDBadminuser/$wgDBadminpassword during setup |
| 156 | +* (bug 18768) Remove AdminSettings requirements. Maintenance environment |
| 157 | + will still load it if it exists, but it's not required for anything |
156 | 158 | |
157 | 159 | === Bug fixes in 1.16 === |
158 | 160 | |