Make WordPress Core

Changeset 3814


Ignore:
Timestamp:
05/31/2006 06:03:55 AM (20 years ago)
Author:
ryan
Message:

Backup plugin fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-content/plugins/wp-db-backup.php

    r3447 r3814  
    3737
    3838    function wpdbBackup() {
    39                
    4039        add_action('wp_cron_daily', array(&$this, 'wp_cron_daily'));
    4140
     
    4443   
    4544        if (isset($_POST['do_backup'])) {
     45            if ( !current_user_can('import') ) die(__('You are not allowed to perform backups.'));
    4646            switch($_POST['do_backup']) {
    4747            case 'backup':
     
    5353            }
    5454        } elseif (isset($_GET['fragment'] )) {
     55            if ( !current_user_can('import') ) die(__('You are not allowed to perform backups.'));
    5556            add_action('init', array(&$this, 'init'));
    5657        } elseif (isset($_GET['backup'] )) {
     58            if ( !current_user_can('import') ) die(__('You are not allowed to perform backups.'));
    5759            add_action('init', array(&$this, 'init'));
    5860        } else {
     61            if ( !current_user_can('import') ) die(__('You are not allowed to perform backups.'));
    5962            add_action('admin_menu', array(&$this, 'admin_menu'));
    6063        }
     
    6265   
    6366    function init() {
    64         global $user_level;
    65         get_currentuserinfo();
    66 
    67         if ($user_level < 9) die(__('Need higher user level.'));
     67        if ( !current_user_can('import') ) die(__('You are not allowed to perform backups.'));
    6868
    6969        if (isset($_GET['backup'])) {
     
    308308        $core_tables = $_POST['core_tables'];
    309309        $this->backup_file = $this->db_backup($core_tables, $also_backup);
    310         if (FALSE !== $backup_file) {
     310        if (FALSE !== $this->backup_file) {
    311311            if ('smtp' == $_POST['deliver']) {
    312312                $this->deliver_backup ($this->backup_file, $_POST['deliver'], $_POST['backup_recipient']);
Note: See TracChangeset for help on using the changeset viewer.