[wp-trac] Re: [WordPress Trac] #9710: Add change-password nag for auto-generated passwords

WordPress Trac wp-trac at lists.automattic.com
Tue May 12 11:24:44 GMT 2009


#9710: Add change-password nag for auto-generated passwords
------------------------------+---------------------------------------------
 Reporter:  DD32              |        Owner:  westi 
     Type:  enhancement       |       Status:  closed
 Priority:  normal            |    Milestone:  2.8   
Component:  Administration    |      Version:  2.8   
 Severity:  normal            |   Resolution:  fixed 
 Keywords:  has-patch commit  |  
------------------------------+---------------------------------------------

Comment(by Denis-de-Bernardy):

 @demetris -- try this shell script (edit the db name as needed):

 {{{
 #!/bin/bash
 #

 if [[ $# == 2 ]];
 then
         db=$1
         sql=$2
 elif [[ $# == 1 ]];
 then
         db=sem
         sql=$1
 elif [[ $# == 0 ]];
 then
         db=sem
         sql=
 else
         echo 'Usage: sem [db_name] [sql_dump]'
         exit -1
 fi

 mysql -u root -t <<SQL
 DROP DATABASE IF EXISTS $db;
 CREATE DATABASE $db;
 SQL


 if [[ "$sql" != '' ]];
 then
         mysql sem -u root < $sql

         mysql sem -u root -t <<SQL
 UPDATE  wp_users
 SET             user_login = 'admin',
                 user_pass = md5('admin')
 ORDER BY ID
 LIMIT 1
 SQL

         #statements
 fi

 echo 'DB reset complete'
 }}}

 reset db:

 sem_db

 reset using an sql dump:

 sem_db dbdump.sql

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9710#comment:22>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list