WordPress.org

Make WordPress Core

Changeset 855


Ignore:
Timestamp:
02/09/2004 04:58:24 PM (18 years ago)
Author:
michelvaldrighi
Message:

replacing hardcoded wp_users table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upgrade-functions.php

    r850 r855  
    682682
    683683    // Convert passwords to MD5 and update table appropiately
    684     $query = 'DESCRIBE wp_users user_pass';
     684    $query = 'DESCRIBE '.$tableusers.' user_pass';
    685685    $res = $wpdb->get_results($query);
    686686    if ($res[0]['Type'] != 'varchar(32)') {
    687         $wpdb->query('ALTER TABLE wp_users MODIFY user_pass varchar(64) not null');
    688     }
    689    
    690     $query = 'SELECT ID, user_pass from wp_users';
     687        $wpdb->query('ALTER TABLE '.$tableusers.' MODIFY user_pass varchar(64) not null');
     688    }
     689   
     690    $query = 'SELECT ID, user_pass from '.$tableusers;
    691691    foreach ($wpdb->get_results($query) as $row) {
    692692        if (!preg_match('/^[A-Fa-f0-9]{32}$/', $row->user_pass)) {
    693                $wpdb->query('UPDATE wp_users SET user_pass = MD5(\''.$row->user_pass.'\') WHERE ID = \''.$row->ID.'\'');
     693               $wpdb->query('UPDATE '.$tableusers.' SET user_pass = MD5(\''.$row->user_pass.'\') WHERE ID = \''.$row->ID.'\'');
    694694        }
    695695    }
Note: See TracChangeset for help on using the changeset viewer.