-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.php
29 lines (25 loc) · 1.09 KB
/
upload.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
<?php
if (!empty($_SERVER['SCRIPT_FILENAME']) AND 'upload.php' == basename($_SERVER['SCRIPT_FILENAME'])) {
die ('Please do not load this page directly.');
}
global $user_ID;
if( $user_ID ) {
if( current_user_can('level_10') ) {
$import_options = bfa_file_get_contents($_FILES['userfile']['tmp_name']);
// Since 3.5.2, use JSON
if ( json_decode($import_options) != NULL AND strpos($import_options, 'use_bfa_seo') !== FALSE ) {
update_option('bfa_ata4', json_decode($import_options, TRUE));
echo "<strong><span style='color:green'>Successfully imported. Reloading admin area in 2 seconds... </span><code>" .
basename($_FILES['userfile']['name']) . "</code></strong><br />";
// Probably not a valid settings file:
} else {
echo "<strong><span style='color:red'>Sorry, but </span><code>" .
basename($_FILES['userfile']['name']) . "</code> <span style='color:red'>doesn't appear
to be a valid Atahualpa Settings File.</span></strong>";
}
} else {
die("<span style='color:green'>Only admins can import settings</span>");
}
}
die();
?>