Files
sysPass/ajax/ajax_getFiles.php
nuxsmin 2b87c81d70 Modified php short open tags for environments that have disabled them.
Visual improvements on search bar.
Filter icon is not shown if not using it.
If browser language does not have translation, or language not set, or is not a spanish variant, english is used.
Show maximum allowed file size for upload on edit account.
2013-11-15 00:26:44 +01:00

72 lines
2.5 KiB
PHP

<?php
/**
* sysPass
*
* @author nuxsmin
* @link http://syspass.org
* @copyright 2012 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/>.
*
*/
define('APP_ROOT', '..');
include_once (APP_ROOT."/inc/init.php");
SP_Util::checkReferer('GET');
if ( ! SP_Init::isLoggedIn() ) {
return;
}
if ( SP_Config::getValue('filesenabled') == 0 ){
echo _('Gestión de archivos deshabilitada');
return FALSE;
}
$sk = SP_Common::parseParams('g', 'sk', FALSE);
if (!$sk || !SP_Common::checkSessionKey($sk)) {
SP_Common::printXML(_('CONSULTA INVÁLIDA'));
}
$accountId = SP_Common::parseParams('g', 'id', 0);
$deleteEnabled = SP_Common::parseParams('g', 'del', 0);
$files = SP_Files::getFileList($accountId, $deleteEnabled);
if ( ! is_array($files) || count($files) === 0 ){
return;
}
?>
<form action="ajax/ajax_files.php" method="post" name="files_form" id="files_form">
<select name="fileId" size="4" class="files" id="files">
<?php foreach ($files as $file): ?>
<option value='<?php echo $file['id']; ?>'><?php echo $file['name'] ?> (<?php echo $file['size']; ?> KB)</option>
<?php endforeach;?>
</select>
<input name="t" type="hidden" id="t" value="<?php echo time(); ?>" />
<input name="sk" type="hidden" id="sk" value="<?php echo SP_Common::getSessionKey(); ?>" />
<input name="action" type="hidden" id="action" value="download" />
</form>
<div class="actionFiles">
<img src="imgs/download.png" title="<?php echo _('Descargar archivo'); ?>" id="btnDownload" class="inputImg" alt="download" OnClick="downFile();" />
<img src="imgs/view.png" title="<?php echo _('Ver archivo'); ?>" id="btnView" class="inputImg" alt="View" OnClick="downFile(1);" />
<?php if ( $deleteEnabled === 1 ): ?>
<img src="imgs/delete.png" title="<?php echo _('Eliminar archivo'); ?>" id="btnDelete" class="inputImg" alt="Delete" OnClick="delFile(<?php echo $accountId; ?>);" />
<?php endif; ?>
</div>