Files
sysPass/inc/tpl/backup.php
nuxsmin 0f172ed1d8 - Closes #26. Enable users password reset by email and forced by an admin.
- Improved email handling by using phpmailer class. All emails are sent in HTML format and security and authentication are available.
- Improved javascript code by code refactoring.
- Client IP address is logged in event log.
- Translation fixes.
- Minor bugfixes.
- Needs database upgrade (read wiki if unsure).
2014-02-24 01:51:23 +01:00

82 lines
2.9 KiB
PHP

<?php
/**
* sysPass
*
* @author nuxsmin
* @link http://syspass.org
* @copyright 2012-2014 Rubén Domínguez nuxsmin@syspass.org
*
* This file is part of sysPass.
*
* sysPass is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* sysPass is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR a PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sysPass. If not, see <http://www.gnu.org/licenses/>.
*
*/
defined('APP_ROOT') || die(_('No es posible acceder directamente a este archivo'));
$action = $data['action'];
$activeTab = $data['activeTab'];
SP_ACL::checkUserAccess($action) || SP_Html::showCommonError('unavailable');
$siteName = SP_Html::getAppInfo('appname');
$backupDir = SP_Init::$SERVERROOT.'/backup';
$backupPath = SP_Init::$WEBROOT.'/backup';
$backupFile = array('absolute' => $backupDir.'/'.$siteName.'.tgz', 'relative' => $backupPath.'/'.$siteName.'.tgz' );
$backupDbFile = array('absolute' => $backupDir.'/'.$siteName.'_db.sql', 'relative' => $backupPath.'/'.$siteName.'_db.sql' );
$lastBackupTime = ( file_exists($backupFile['absolute']) ) ? _('Último backup').": ".date("F d Y H:i:s.", filemtime($backupFile['absolute'])) : _('No se encontraron backups');
?>
<table class="data round">
<tr>
<td class="descField">
<?php echo _('Resultado'); ?>
</td>
<td class="valField">
<?php echo $lastBackupTime; ?>
</td>
</tr>
<tr>
<td class="descField">
<?php echo _('Descargar Actual'); ?>
</td>
<td class="valField">
<?php if ( file_exists($backupFile['absolute']) && file_exists($backupDbFile['absolute']) ): ?>
<a href="<?php echo $backupDbFile['relative']; ?>">Backup BBDD</a>
-
<a href="<?php echo $backupFile['relative']; ?>">Backup <?php echo $siteName; ?></a>
<?php else: ?>
<?php echo _('No hay backups para descargar'); ?>
<?php endif; ?>
</td>
</tr>
</table>
<form method="post" name="frmBackup" id="frmBackup">
<input type="hidden" name="activeTab" value="<?php echo $activeTab ?>" />
<input type="hidden" name="backup" value="1" />
<input type="hidden" name="isAjax" value="1" />
<input type="hidden" name="action" value="backup" />
<input type="hidden" name="sk" value="<?php echo SP_Common::getSessionKey(true); ?>">
</form>
<div class="action">
<ul>
<li>
<img src="imgs/backup.png" title="<?php echo _('Realizar Backup'); ?>" class="inputImg" OnClick="configMgmt('backup');" />
</li>
</ul>
</div>