This repository has been archived by the owner on Apr 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmove-wordpress.php
72 lines (66 loc) · 2.7 KB
/
move-wordpress.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php /*
Copyright (C) 2011 Southwest Cyberport http://www.swcp.com/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
# Change the filesystem path and/or URL for a Wordpress site
require_once('move-wordpress.inc.php');
print_page_header();
$vars = get_form_vars(array('mysql','url', 'path', 'options'));
$backup_alert = ' onsubmit="return confirm(\'I hope you backed up the database. Proceed?\');"';
if ($_POST) {
$backup_alert = '';
$validation_errors = false;
$vars = $_POST;
// Do simple sanity checks
if ($vars['validate_form']) {
$validation_errors = validate($vars);
}
if ($validation_errors) {
$vars = array_merge($vars, $validation_errors); ?>
<span class="errormsg"><h4>Please fix errors below</h4></span> <?php
} else {
if (debug()) { echo print_r($vars); }
update_db($vars);
}
} ?>
<form action="move-wordpress.php" name="wp-db-form" id="wp-db-form" method="post"<?php echo $backup_alert;?>>
<div class="formsubsection">
<h4>Required Mysql info</h4>
<?php print_form_section('mysql', $vars); ?>
</div>
<div class="formsubsection">
<h4>Enter URL values to change, e.g., <code>http://www.example.com/blog</code></h4>
Leave both fields blank to update only the filesystem path.<br />
<?php print_form_section('url',$vars); ?>
</div>
<div class="formsubsection">
<h4>Enter filesystem path to change, e.g., <code>/home/foobar/public_html/example.com</code></h4>
Leave both fields blank to update only the URL.<br />
<?php print_form_section('path', $vars); ?>
</div><br />
<div class="formsubsection" id="move-wp-options">
<h4>Options</h4>
<?php print_form_section('options', $vars); ?>
</div><br /> <?php
if ($_POST) { ?>
<label><input type="submit" value="Submit and revalidate"
onclick="document.getElementById('validate_form').value = 1; return true;" />
</label>
<label><input type="submit" value="I know what I'm doing. Submit without revalidating"
onclick="document.getElementById('validate_form').value = 0; return true;" />
</label> <?php
} else { ?>
<label><input type="submit" value="Submit" /></label> <?php
} ?>
</form>
</div>
</body>
</html>