<?php
// require login

coreFunctions::limitEmailsSentPerHour();

/* load file */
if (isset($_REQUEST['u']))
{
    $file = file::loadById($_REQUEST['u']);
    if (!$file)
    {
        // failed lookup of file
        coreFunctions::redirect(WEB_ROOT . '/account_home.' . SITE_CONFIG_PAGE_EXTENSION);
    }

    // check current user has permission to edit file
    if ($file->userId != $Auth->id)
    {
        coreFunctions::redirect(WEB_ROOT . '/account_home.' . SITE_CONFIG_PAGE_EXTENSION);
    }
}
else
{
    coreFunctions::redirect(WEB_ROOT . '/account_home.' . SITE_CONFIG_PAGE_EXTENSION);
}
$accountLocked = 0;
if(SITE_CONFIG_SECURITY_ACCOUNT_LOCK == 'yes' && coreFunctions::getUsersAccountLockStatus($Auth->id))
{
    $accountLocked = 1;
}

$isPublic = 1;
if(corefunctions::getOverallPublicStatus($Auth->id, $file->folderId, $file->id) == false)
{
    $isPublic = 0;
}
$isFolderPublic = 1;
if(coreFunctions::getUserFoldersPublicStatus($file->folderId) == false)
{
    $isFolderPublic = 0;
}

?>
<div class="col-xs-12 viewNav">
<p class="col-xs-6 nameView">
<?php echo validation::safeOutputToScreen($file->originalFilename); ?>
</p>
<div class="col-xs-6 moreTop">
<button onclick="window.open(downloadUrl)" class="btn btn-primary btn-pro"><i class="la la-download"></i> <span class="hidden-xs">Download</span></button>
</div>
</div>    
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
<div class="modal-body">

    <div class="row">
	<div class="col-sm-12 text-center">
	   <?php
        // append any plugin includes
        pluginHelper::includeAppends('account_home_file_details_tab_content.inc.php', array('file' => $file, 'Auth' => $Auth));
        ?>
	</div>
	
	</div>
</div>	
</div>
    </div>