| 574 | | $this->layout = 'admin'; |
| 575 | | |
| 576 | | $conditions = array("User.id"=>$this->Auth->user('id')); |
| 577 | | |
| 578 | | $this->User->unbindModel(array('hasMany' => array('Confirm'))); |
| 579 | | |
| 580 | | $this->User->bindModel( |
| 581 | | array('hasMany' => array( |
| 582 | | 'Image' => array( |
| 583 | | 'className' => 'Image' |
| 584 | | ) |
| 585 | | ) |
| 586 | | ) |
| 587 | | ); |
| 588 | | |
| 589 | | $this->set('data', $this->User->find($conditions)); |
| | 574 | |
| | 575 | $output_file = sprintf($DB_NAME."_%s.db", date("Ymd-hi")); |
| | 576 | $DB_EXPORT_PATH =''; |
| | 577 | system("pg_dump -u ".$DB_NAME." < ".AUTH_USER_FILE_PATH." > ".DB_EXPORT_PATH.$output_file); |
| | 578 | $this->autoRender = false; |
| | 579 | Configure::write('debug', 0); |
| | 580 | header("Content-disposition: attachment; filename=".$output_file); |
| | 581 | header("Content-type: application/octet-stream; name=".$output_file); |
| | 582 | $result = file_get_contents(DB_EXPORT_PATH.$output_file); |
| | 583 | print($result); |
| | 584 | return true; |