WordPress.org

Make WordPress Core

Changeset 3815


Ignore:
Timestamp:
05/31/06 06:06:15 (12 years ago)
Author:
ryan
Message:

Backup plugin fixes.

File:
1 edited

Legend:

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

    r3657 r3815  
    3939 
    4040    function wpdbBackup() { 
    41  
    4241        add_action('wp_cron_daily', array(&$this, 'wp_cron_daily')); 
    4342 
     
    4645 
    4746        if (isset($_POST['do_backup'])) { 
     47            if ( !current_user_can('import') ) die(__('You are not allowed to perform backups.')); 
    4848            switch($_POST['do_backup']) { 
    4949            case 'backup': 
     
    5555            } 
    5656        } elseif (isset($_GET['fragment'] )) { 
     57            if ( !current_user_can('import') ) die(__('You are not allowed to perform backups.')); 
    5758            add_action('init', array(&$this, 'init')); 
    5859        } elseif (isset($_GET['backup'] )) { 
     60            if ( !current_user_can('import') ) die(__('You are not allowed to perform backups.')); 
    5961            add_action('init', array(&$this, 'init')); 
    6062        } else { 
     63            if ( !current_user_can('import') ) die(__('You are not allowed to perform backups.')); 
    6164            add_action('admin_menu', array(&$this, 'admin_menu')); 
    6265        } 
     
    6467 
    6568    function init() { 
    66         global $user_level; 
    67         get_currentuserinfo(); 
    68  
    69         if ($user_level < 9) die(__('Need higher user level.')); 
     69        if ( !current_user_can('import') ) die(__('You are not allowed to perform backups.')); 
    7070 
    7171        if (isset($_GET['backup'])) { 
     
    310310        $core_tables = $_POST['core_tables']; 
    311311        $this->backup_file = $this->db_backup($core_tables, $also_backup); 
    312         if (FALSE !== $backup_file) { 
     312        if (FALSE !== $this->backup_file) { 
    313313            if ('smtp' == $_POST['deliver']) { 
    314314                $this->deliver_backup ($this->backup_file, $_POST['deliver'], $_POST['backup_recipient']); 
Note: See TracChangeset for help on using the changeset viewer.