plugins/SpecialAdmin.php
changeset 1081 745200a9cc2a
parent 1067 4058c844ee38
child 1094 121cf3bbd16e
equal deleted inserted replaced
1080:6358f769ecb1 1081:745200a9cc2a
    10 }
    10 }
    11 **!*/
    11 **!*/
    12 
    12 
    13 /*
    13 /*
    14  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
    14  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
    15  * Version 1.1.6 (Caoineag beta 1)
    15  * Copyright (C) 2006-2009 Dan Fuhry
    16  * Copyright (C) 2006-2008 Dan Fuhry
       
    17  *
    16  *
    18  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
    17  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
    19  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    18  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    20  *
    19  *
    21  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    20  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
  1480     // Do the actual export
  1479     // Do the actual export
  1481     $aesext = ( defined('SQL_BACKUP_CRYPT') ) ? '.tea' : '';
  1480     $aesext = ( defined('SQL_BACKUP_CRYPT') ) ? '.tea' : '';
  1482     $filename = 'enano_backup_' . enano_date('ymd') . '.sql' . $aesext;
  1481     $filename = 'enano_backup_' . enano_date('ymd') . '.sql' . $aesext;
  1483     ob_start();
  1482     ob_start();
  1484     // Spew some headers
  1483     // Spew some headers
  1485     $headdate = enano_date('F d, Y \a\t h:i a');
  1484     $headdate = enano_date(ED_DATE | ED_TIME);
  1486     echo <<<HEADER
  1485     echo <<<HEADER
  1487 -- Enano CMS SQL backup
  1486 -- Enano CMS SQL backup
  1488 -- Generated on {$headdate} by {$session->username}
  1487 -- Generated on {$headdate} by {$session->username}
  1489 
  1488 
  1490 HEADER;
  1489 HEADER;
  1492     $base = ( isset($_POST['do_system_tables']) ) ? $system_table_list : Array();
  1491     $base = ( isset($_POST['do_system_tables']) ) ? $system_table_list : Array();
  1493     $add  = ( isset($_POST['additional_tables'])) ? $_POST['additional_tables'] : Array();
  1492     $add  = ( isset($_POST['additional_tables'])) ? $_POST['additional_tables'] : Array();
  1494     $tables = array_merge($base, $add);
  1493     $tables = array_merge($base, $add);
  1495     
  1494     
  1496     // Log it!
  1495     // Log it!
  1497     $e = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'db_backup\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($session->username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', \'' . $db->escape(implode(', ', $tables)) . '\')');
  1496     $e = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'db_backup\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($session->username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', \'' . $db->escape(implode(', ', $tables)) . '\')');
  1498     if ( !$e )
  1497     if ( !$e )
  1499       $db->_die();
  1498       $db->_die();
  1500     
  1499     
  1501     foreach($tables as $i => $t)
  1500     foreach($tables as $i => $t)
  1502     {
  1501     {