From 8e1bf60de7ab1e15a3e008699616b54b8291f416 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 15:57:29 +0000 Subject: [PATCH 1/3] Initial plan From 1fd30ff3cd8a89e0c909199eadb2de1966b7df03 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 15:59:51 +0000 Subject: [PATCH 2/3] Add OAuth provider customization with $authProvider variable Co-authored-by: marpisco <162377105+marpisco@users.noreply.github.com> --- login/index.php | 33 ++++++++++++++++++++------------- src/config.sample.php | 5 +++++ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/login/index.php b/login/index.php index aee574e..1e80536 100644 --- a/login/index.php +++ b/login/index.php @@ -551,20 +551,27 @@ echo "

Iniciar Sessão no ClassLink

"; echo "

Para aceder à plataforma, deve autenticar-se com a sua conta institucional.

"; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "Login com Microsoft"; + if (isset($authProvider) && $authProvider === 'Microsoft') { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + 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 ""; - echo ""; + if (isset($authProvider) && $authProvider === 'Microsoft') { + echo ""; + } echo ""; echo ""; echo "
"; diff --git a/src/config.sample.php b/src/config.sample.php index 1e116c3..0dfcdd4 100644 --- a/src/config.sample.php +++ b/src/config.sample.php @@ -39,4 +39,9 @@ 'clientSecret' => 'clientsecret', // CHANGE THIS and keep it secret 'redirectUri' => 'https://' . $_SERVER['HTTP_HOST'] . '/login' ]); + + // OAuth Provider Name + // Set to 'Microsoft' to display Microsoft logo and text on login button + // Set to any other value (e.g., 'Google', 'Authentik', etc.) to display generic text + $authProvider = 'Microsoft'; ?> \ No newline at end of file From 16e4b79a610dff98da93019ad9b1d27b72908511 Mon Sep 17 00:00:00 2001 From: Marco Pisco Date: Wed, 21 Jan 2026 16:36:23 +0000 Subject: [PATCH 3/3] =?UTF-8?q?Atualizar=20coment=C3=A1rios=20do=20ficheir?= =?UTF-8?q?o=20config.sample.php,=20incluindo=20os=20do=20fornecedor=20(co?= =?UTF-8?q?mo=20=C3=A9=20esperado,=20desta=20PR).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.sample.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/config.sample.php b/src/config.sample.php index 0dfcdd4..ea4ec22 100644 --- a/src/config.sample.php +++ b/src/config.sample.php @@ -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 + $authProvider = 'Microsoft'; $provider = new GenericProvider([ 'urlAuthorize' => 'https://authentik.devenv.marcopisco.com/application/o/authorize/', 'urlAccessToken' => 'https://authentik.devenv.marcopisco.com/application/o/token/', @@ -39,9 +38,4 @@ 'clientSecret' => 'clientsecret', // CHANGE THIS and keep it secret 'redirectUri' => 'https://' . $_SERVER['HTTP_HOST'] . '/login' ]); - - // OAuth Provider Name - // Set to 'Microsoft' to display Microsoft logo and text on login button - // Set to any other value (e.g., 'Google', 'Authentik', etc.) to display generic text - $authProvider = 'Microsoft'; ?> \ No newline at end of file