- fixes missing () from num_rows in authenticate user function - removes passwordhash library in favor of built in PHP password_hash and password_verify functions - uppercase all class filenames - add new CLI error templates, move HTML error templates - update mimes file to latest version - update routes to latest version
		
			
				
	
	
		
			68 行
		
	
	
		
			无行尾
		
	
	
		
			1.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			68 行
		
	
	
		
			无行尾
		
	
	
		
			1.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 | |
| 
 | |
| class Backup extends CI_Controller {
 | |
| 
 | |
| 	/* User Facing Links to Backup URLs */
 | |
| 	public function index()
 | |
| 	{
 | |
| 
 | |
| 		$data['page_title'] = "Backup";
 | |
| 
 | |
| 		$this->load->view('layout/header', $data);
 | |
| 		$this->load->view('backup/main');
 | |
| 		$this->load->view('layout/footer');
 | |
| 	}
 | |
| 
 | |
| 	/* Gets all QSOs and Dumps them to logbook.adi */
 | |
| 	public function adif(){ 
 | |
| 		$this->load->helper('file');
 | |
| 		// Set memory limit to unlimited to allow heavy usage
 | |
| 		ini_set('memory_limit', '-1');
 | |
| 		
 | |
| 		$this->load->model('adif_data');
 | |
| 
 | |
| 		$data['qsos'] = $this->adif_data->export_all();
 | |
| 
 | |
| 		if ( ! write_file('backup/logbook.adi', $this->load->view('backup/exportall', $data, true)))
 | |
| 		{
 | |
| 		     $data['status'] = false;
 | |
| 		}
 | |
| 		else
 | |
| 		{
 | |
| 		      $data['status'] = true;
 | |
| 		}
 | |
| 
 | |
| 		$data['page_title'] = "ADIF - Backup";
 | |
| 
 | |
| 		$this->load->view('layout/header', $data);
 | |
| 		$this->load->view('backup/adif_view');
 | |
| 		$this->load->view('layout/footer');
 | |
| 
 | |
| 	}
 | |
| 
 | |
| 	/* Export the notes to XML */
 | |
| 	public function notes() {
 | |
| 		$this->load->helper('file');
 | |
| 		$this->load->model('note');
 | |
| 
 | |
| 		$data['list_note'] = $this->note->list_all();
 | |
| 
 | |
| 		if ( ! write_file('backup/notes.xml', $this->load->view('backup/notes', $data, true)))
 | |
| 		{
 | |
| 		     $data['status'] = false;
 | |
| 		}
 | |
| 		else
 | |
| 		{
 | |
| 		      $data['status'] = true;
 | |
| 		}
 | |
| 
 | |
| 		$data['page_title'] = "Notes - Backup";
 | |
| 
 | |
| 		$this->load->view('layout/header', $data);
 | |
| 		$this->load->view('backup/notes_view');
 | |
| 		$this->load->view('layout/footer');
 | |
| 
 | |
| 	}
 | |
| }
 | |
| 
 | |
| /* End of file Backup.php */ |