Changeset 11747

Show
Ignore:
Timestamp:
08/27/07 17:56:49 (1 year ago)
Author:
piotras
Message:

Generate random password for midgard_config.
Write logs with midgard_setup_log

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midgard/data/midgard_setup_cli.php

    r11724 r11747  
    2020        $this->midgard_config->database = 'midgard'; 
    2121        $this->midgard_config->dbuser = 'midgard'; 
    22         /* we can replace it with random password */ 
    23         $this->midgard_config->dbpass = 'midgard'
     22        $password = substr(md5(rand()), 0, 10); 
     23        $this->midgard_config->dbpass = &$password
    2424        $this->midgard_config->host = 'localhost'; 
    2525 
    26         midgard_setup_log::write(_("Initialize new ").__CLASS__); 
     26            midgard_setup_log::write(_("Initialize new ").__CLASS__); 
    2727    } 
    2828 
     
    9696    }     
    9797 
    98     public function get_databse_update() 
     98    public function get_database_update() 
    9999    { 
    100100        $value = parent::get_boolean(_("Update Midgard database?")); 
     
    121121    public function save_config($name = NULL, $user = FALSE) 
    122122    { 
     123        midgard_setup_log::write(_("Saving configuration:").$name); 
    123124 
    124     if(!is_object($this->midgard_config)) { 
    125                
    126                parent::error(_("midgard_config not associated")); 
    127                return FALSE; 
    128        
     125        if(!is_object($this->midgard_config))  
     126        {              
     127            parent::error(_("midgard_config not associated")); 
     128            return FALSE; 
     129       
    129130 
    130     if($name == NULL) 
    131         $name = "midgard"; 
    132  
    133        $this->midgard_config->save_file($name, $user); 
     131        if($name == NULL) 
     132            $name = "midgard"; 
     133             
     134        $this->midgard_config->save_file($name, $user); 
    134135    } 
    135136}