forked from vergnet/site-accueil-insa
Merge remote-tracking branch 'refs/remotes/origin/master'
This commit is contained in:
commit
9df5c1c865
1 changed files with 4 additions and 23 deletions
27
photos.php
27
photos.php
|
@ -33,7 +33,7 @@ function getActivePath()
|
||||||
function GetActiveFolder($path)
|
function GetActiveFolder($path)
|
||||||
{
|
{
|
||||||
$dir = explode(DIRECTORY_SEPARATOR, $path);
|
$dir = explode(DIRECTORY_SEPARATOR, $path);
|
||||||
return $dir[sizeof($dir) - 1]; // Last item after /
|
return ".".DIRECTORY_SEPARATOR.$dir[sizeof($dir) - 1]; // Last item after /
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -251,25 +251,9 @@ function generatePath($path)
|
||||||
//CAS
|
//CAS
|
||||||
require_once("phpCAS-1.3.6/CAS.php");
|
require_once("phpCAS-1.3.6/CAS.php");
|
||||||
|
|
||||||
// Initialize phpCAS
|
|
||||||
phpCAS::client(CAS_VERSION_2_0, "cas.insa-toulouse.fr", 443, 'cas', true);
|
phpCAS::client(CAS_VERSION_2_0, "cas.insa-toulouse.fr", 443, 'cas', true);
|
||||||
|
|
||||||
// For production use set the CA certificate that is the issuer of the cert
|
|
||||||
// on the CAS server and uncomment the line below
|
|
||||||
// phpCAS::setCasServerCACert($cas_server_ca_cert_path);
|
|
||||||
|
|
||||||
// For quick testing you can disable SSL validation of the CAS server.
|
|
||||||
// THIS SETTING IS NOT RECOMMENDED FOR PRODUCTION.
|
|
||||||
// VALIDATING THE CAS SERVER IS CRUCIAL TO THE SECURITY OF THE CAS PROTOCOL!
|
|
||||||
phpCAS::setNoCasServerValidation();
|
phpCAS::setNoCasServerValidation();
|
||||||
|
|
||||||
// force CAS authentication
|
|
||||||
phpCAS::forceAuthentication();
|
phpCAS::forceAuthentication();
|
||||||
|
|
||||||
// at this step, the user has been authenticated by the CAS server
|
|
||||||
// and the user's login name can be read with phpCAS::getUser().
|
|
||||||
|
|
||||||
// logout if desired
|
|
||||||
if (isset($_REQUEST['logout'])) {
|
if (isset($_REQUEST['logout'])) {
|
||||||
phpCAS::logout();
|
phpCAS::logout();
|
||||||
}
|
}
|
||||||
|
@ -313,12 +297,10 @@ if (isset($_REQUEST['logout'])) {
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php if (isAlbumAvailable(getActivePath())): ?>
|
<?php if (isAlbumAvailable(getActivePath())): ?>
|
||||||
<a download=""
|
<a download="" href="photos_folders/photos<?php echo getActivePath().DIRECTORY_SEPARATOR.GetActiveFolder(getActivePath()); ?>.zip" id="downloadAlbum">
|
||||||
href="photos_folders/photos<?php echo getActivePath() . DIRECTORY_SEPARATOR . GetActiveFolder(getActivePath()) ?>.zip"
|
<span id="downloadText">Télécharger</span>
|
||||||
id="downloadAlbum">
|
|
||||||
<span id="downloadText"><i class="fas fa-download"></i>Télécharger</span>
|
|
||||||
<span id="albumPhotoCount"><?php echo getPhotoCount(photoRoot . getActivePath()) ?> photos</span>
|
<span id="albumPhotoCount"><?php echo getPhotoCount(photoRoot . getActivePath()) ?> photos</span>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (getPhotoCount(photoRoot . getActivePath()) > 0): ?>
|
<?php if (getPhotoCount(photoRoot . getActivePath()) > 0): ?>
|
||||||
<div class="photos">
|
<div class="photos">
|
||||||
|
@ -331,7 +313,6 @@ if (isset($_REQUEST['logout'])) {
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$infopage = ["", "Photos", ob_get_clean(), "", "photos"]; //relativepath, pagetitle, pagecontent, pagescript, pagename | cf structure/template.php ligne 2 à 6
|
$infopage = ["", "Photos", ob_get_clean(), "", "photos"]; //relativepath, pagetitle, pagecontent, pagescript, pagename | cf structure/template.php ligne 2 à 6
|
||||||
include("structure/template.php");
|
include("structure/template.php");
|
||||||
|
|
Loading…
Reference in a new issue