Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions login/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,20 +551,27 @@
echo "<h1>Iniciar Sessão no ClassLink</h1>";
echo "<p class=\"small\">Para aceder à plataforma, deve autenticar-se com a sua conta institucional.</p>";
echo "<a href=\"/login?redirecttoflow=1\" class=\"login-btn\">";
echo "<svg class=\"ms-logo\" width=\"21\" height=\"21\" viewBox=\"0 0 21 21\" xmlns=\"http://www.w3.org/2000/svg\" style=\"vertical-align: middle; margin-right: 8px;\">";
echo "<rect class=\"ms-rect1\" x=\"1\" y=\"1\" width=\"9\" height=\"9\" fill=\"white\"/>";
echo "<rect class=\"ms-rect2\" x=\"11\" y=\"1\" width=\"9\" height=\"9\" fill=\"white\"/>";
echo "<rect class=\"ms-rect3\" x=\"1\" y=\"11\" width=\"9\" height=\"9\" fill=\"white\"/>";
echo "<rect class=\"ms-rect4\" x=\"11\" y=\"11\" width=\"9\" height=\"9\" fill=\"white\"/>";
echo "</svg>";
echo "Login com Microsoft";
if (isset($authProvider) && $authProvider === 'Microsoft') {
echo "<svg class=\"ms-logo\" width=\"21\" height=\"21\" viewBox=\"0 0 21 21\" xmlns=\"http://www.w3.org/2000/svg\" style=\"vertical-align: middle; margin-right: 8px;\">";
echo "<rect class=\"ms-rect1\" x=\"1\" y=\"1\" width=\"9\" height=\"9\" fill=\"white\"/>";
echo "<rect class=\"ms-rect2\" x=\"11\" y=\"1\" width=\"9\" height=\"9\" fill=\"white\"/>";
echo "<rect class=\"ms-rect3\" x=\"1\" y=\"11\" width=\"9\" height=\"9\" fill=\"white\"/>";
echo "<rect class=\"ms-rect4\" x=\"11\" y=\"11\" width=\"9\" height=\"9\" fill=\"white\"/>";
echo "</svg>";
echo "Iniciar Sessão com Microsoft";
} else {
$providerName = isset($authProvider) ? htmlspecialchars($authProvider, ENT_QUOTES, 'UTF-8') : 'OAuth';
echo "Iniciar Sessão com Fornecedor de Identidade " . $providerName;
}
echo "</a>";
echo "<style>";
echo ".login-btn:hover .ms-rect1 { fill: #f25022; }";
echo ".login-btn:hover .ms-rect2 { fill: #7fba00; }";
echo ".login-btn:hover .ms-rect3 { fill: #00a4ef; }";
echo ".login-btn:hover .ms-rect4 { fill: #ffb900; }";
echo "</style></a>";
if (isset($authProvider) && $authProvider === 'Microsoft') {
echo "<style>";
echo ".login-btn:hover .ms-rect1 { fill: #f25022; }";
echo ".login-btn:hover .ms-rect2 { fill: #7fba00; }";
echo ".login-btn:hover .ms-rect3 { fill: #00a4ef; }";
echo ".login-btn:hover .ms-rect4 { fill: #ffb900; }";
echo "</style>";
}
Comment on lines +567 to +574

This comment was marked as resolved.

echo "</div>";
echo "";
echo "<div class=\"notice\">";
Expand Down
11 changes: 5 additions & 6 deletions src/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@
'password' => ''
);

// Database configuration (MySQL/MariaDB)
// SECURITY: Use strong passwords and restrict database user permissions
// Configuração da DB
$db = array(
'tipo' => 'mysql',
'tipo' => 'mysql', // deixar assim
'servidor' => 'localhost',
'user' => 'reservasalas',
'password' => 'salaspass', // CHANGE THIS to a strong password
'password' => 'salaspass', // USAR SEMPRE PASSWORDS FORTES
'db' => 'reservasalas',
'porta' => 3306
);

// OAuth 2.0 configuration
// SECURITY: Keep clientId and clientSecret confidential
// Configuração do fornecedor OAuth2

This comment was marked as resolved.

$authProvider = 'Microsoft';
$provider = new GenericProvider([
'urlAuthorize' => 'https://authentik.devenv.marcopisco.com/application/o/authorize/',
'urlAccessToken' => 'https://authentik.devenv.marcopisco.com/application/o/token/',
Expand Down