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
Binary file added src/Images/church-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
328 changes: 276 additions & 52 deletions src/session/templates/begin-session.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,298 @@
use ChurchCRM\dto\SystemConfig;
use ChurchCRM\dto\SystemURLs;

$sPageTitle = gettext('Login');
$sPageTitle = 'Login';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need this for localization

Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$sPageTitle was changed from a translated string to a hard-coded literal. This makes the page title non-localizable; please keep using gettext('Login') (consistent with other session templates).

Suggested change
$sPageTitle = 'Login';
$sPageTitle = gettext('Login');

Copilot uses AI. Check for mistakes.
require SystemURLs::getDocumentRoot() . '/Include/HeaderNotLoggedIn.php';

?>

<!-- /.login-box-body -->
<div class="login-box">
<!-- /.login-logo -->
<div class="card card-outline card-primary">
<div class="card-header text-center">
<a href="<?= SystemURLs::getRootPath() ?>" class="h1"><img src="<?= SystemURLs::getRootPath() ?>/Images/logo-churchcrm-350.jpg" alt="ChurchCRM" style="max-width:330px; height:auto;" /></a>
</div>
<div class="card-body">
<p class="login-box-msg"> <b><?= ChurchMetaData::getChurchName() ?></b><br />
<?= gettext('Please Login') ?>
</p>
<style>
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital@0;1&family=Inter:wght@400;500;600;700&display=swap');

body.login-page {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all css should move from inline CSS to webpack

background: url('/Images/church-bg.png') no-repeat center center fixed;
background-size: cover;
Comment on lines +15 to +17
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS background image uses an absolute path (/Images/...) which will break when ChurchCRM is installed in a subdirectory. Use SystemURLs::getRootPath() (or the provided sRootPath) to build the image URL.

Copilot uses AI. Check for mistakes.
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
body.login-page::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.35);
}
.login-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.03);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
border-radius: 28px;
}
.login-box {
width: 440px;
position: relative;
z-index: 10;
}
.login-card {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(25px);
-webkit-backdrop-filter: blur(25px);
border-radius: 28px;
border: 1px solid rgba(212, 175, 55, 0.25);
padding: 45px 40px;
box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.login-title-church {
font-family: 'Inter', sans-serif;
font-size: 28px;
font-weight: 700;
color: #1a3a5c;
letter-spacing: 3px;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.login-title-icon {
color: #d4af37;
font-size: 24px;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.login-title-crm {
font-family: 'Inter', sans-serif;
font-size: 28px;
font-weight: 700;
color: #d4af37;
letter-spacing: 3px;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.login-subtitle {
font-family: 'Playfair Display', serif;
font-size: 20px;
color: #1a3a5c;
margin: 10px 0 5px 0;
font-style: italic;
}
.login-subtitle-2 {
font-family: 'Inter', sans-serif;
font-size: 12px;
color: #1a3a5c;
margin: 0 0 30px 0;
text-transform: uppercase;
letter-spacing: 4px;
font-weight: 600;
}
.login-input-group {
position: relative;
margin-bottom: 18px;
}
.login-input {
width: 100%;
padding: 15px 50px 15px 20px;
border: 2px solid rgba(212, 175, 55, 0.6);
border-radius: 12px;
font-size: 14px;
color: #ffffff;
background: rgba(255, 255, 255, 0.05);
box-sizing: border-box;
transition: all 0.3s ease;
font-family: 'Inter', sans-serif;
font-weight: 500;
}
.login-input::placeholder {
color: rgba(255, 255, 255, 0.7);
}
.login-input:focus {
outline: none;
border-color: #d4af37;
background: rgba(255, 255, 255, 0.1);
box-shadow: 0 0 25px rgba(212, 175, 55, 0.15);
}
.login-input-group .input-icon {
position: absolute;
right: 18px;
top: 50%;
transform: translateY(-50%);
color: #d4af37;
font-size: 16px;
}
.login-btn {
width: 100%;
padding: 15px;
background: linear-gradient(135deg, #1a3a5c 0%, #0d2840 100%);
color: #d4af37;
border: 2px solid #d4af37;
border-radius: 50px;
font-size: 14px;
font-weight: 700;
cursor: pointer;
margin-top: 12px;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
font-family: 'Inter', sans-serif;
letter-spacing: 1px;
text-transform: uppercase;
}
.login-btn i {
font-size: 14px;
}
.login-btn:hover {
background: linear-gradient(135deg, #d4af37 0%, #c5a028 100%);
color: #1a3a5c;
border-color: #d4af37;
box-shadow: 0 8px 30px rgba(212, 175, 55, 0.35);
transform: translateY(-2px);
}
.login-forgot {
text-align: center;
margin-top: 20px;
}
.login-forgot a {
color: #1a3a5c;
text-decoration: none;
font-size: 13px;
font-family: 'Inter', sans-serif;
font-weight: 500;
transition: all 0.3s ease;
}
.login-forgot a:hover {
color: #d4af37;
text-decoration: underline;
}
.login-divider {
display: flex;
align-items: center;
margin: 25px 0;
}
.login-divider::before,
.login-divider::after {
content: '';
flex: 1;
height: 1px;
background: rgba(212, 175, 55, 0.35);
}
.login-divider span {
padding: 0 15px;
color: #1a3a5c;
font-size: 11px;
font-family: 'Inter', sans-serif;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 2px;
}
.login-register {
text-align: center;
}
.login-register p {
color: #1a3a5c;
font-size: 13px;
margin: 0 0 14px 0;
font-family: 'Inter', sans-serif;
font-weight: 500;
}
.login-register-btn {
width: 100%;
padding: 13px;
background: transparent;
color: #d4af37;
border: 2px solid #d4af37;
border-radius: 50px;
font-size: 13px;
font-weight: 700;
cursor: pointer;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
font-family: 'Inter', sans-serif;
text-transform: uppercase;
letter-spacing: 1px;
text-decoration: none;
}
.login-register-btn i {
font-size: 14px;
}
.login-register-btn:hover {
background: rgba(212, 175, 55, 0.1);
box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25);
transform: translateY(-2px);
}
.login-error {
background: rgba(220, 38, 38, 0.9);
border: 1px solid rgba(254, 202, 202, 0.4);
color: #ffffff;
padding: 12px 16px;
border-radius: 8px;
margin-bottom: 18px;
font-size: 13px;
font-family: 'Inter', sans-serif;
font-weight: 500;
}
</style>

<div class="login-box">
<div class="login-card">
<div class="login-overlay"></div>

<div style="position: relative; z-index: 2;">
<h1 class="login-title-church">CHURCH <i class="fa-solid fa-cross login-title-icon"></i> <span class="login-title-crm">CRM</span></h1>
<p class="login-subtitle">Main St. Cathedral</p>
<p class="login-subtitle-2">Secure Login</p>
Comment on lines +255 to +257
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The login header/subtitle is hard-coded (including a specific church name). This should use ChurchMetaData::getChurchName() and wrap user-facing text in gettext() so it works for different deployments and locales.

Copilot uses AI. Check for mistakes.

<?php
if (isset($_GET['Timeout'])) {
$loginPageMsg = gettext('Your previous session timed out. Please login again.');
echo '<div class="login-error">Your previous session timed out. Please login again.</div>';
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timeout message is now hard-coded and no longer localized. Please use gettext() (and keep wording consistent with the previous translated message) so this notice is translatable.

Suggested change
echo '<div class="login-error">Your previous session timed out. Please login again.</div>';
echo '<div class="login-error">' . gettext('Your previous session timed out. Please login again.') . '</div>';

Copilot uses AI. Check for mistakes.
}

// output warning and error messages
if (isset($sErrorText)) {
echo '<div class="alert alert-danger">' . $sErrorText . '</div>';
}
if (isset($loginPageMsg)) {
echo '<div class="alert alert-warning">' . $loginPageMsg . '</div>';
echo '<div class="login-error">' . $sErrorText . '</div>';
}
?>
<form class="form-signin" role="form" method="post" name="LoginForm" action="<?= $localAuthNextStepURL ?>">
<div class="input-group mb-3">
<input type="text" id="UserBox" name="User" class="form-control" placeholder="<?= gettext('Email/Username') ?>" value="<?= $prefilledUserName ?>" required autofocus>
<div class="input-group-append">
<div class="input-group-text">
<span class="fa-solid fa-envelope"></span>
</div>
</div>
<form role="form" method="post" name="LoginForm" action="<?= $localAuthNextStepURL ?>">
<div class="login-input-group">
<input type="text" id="UserBox" name="User" class="login-input" value="<?= $prefilledUserName ?>" placeholder="Email/Username" required autofocus>
<span class="input-icon"><i class="fa-solid fa-envelope"></i></span>
</div>
<div class="input-group mb-3">
<input type="password" id="PasswordBox" name="Password" class="form-control" placeholder="<?= gettext('Password') ?>" required autofocus>
</div>
<div class="row">
<div class="col-12">
<button type="submit" class="btn btn-primary btn-block">Sign In</button>
</div>
<!-- /.col -->
<div class="login-input-group">
<input type="password" id="PasswordBox" name="Password" class="login-input" placeholder="Password" required>
<span class="input-icon"><i class="fa-solid fa-lock"></i></span>
</div>
<button type="submit" class="login-btn">
<i class="fa-solid fa-cross"></i>
Sign In
</button>
Comment on lines +269 to +279
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several user-facing strings in the form (placeholders, button label) are no longer wrapped in gettext(), so they won’t be translated. Please restore gettext() usage for these strings to match other session templates.

Copilot uses AI. Check for mistakes.
</form>

<!-- /.social-auth-links -->
<?php if (SystemConfig::getBooleanValue('bEnableLostPassword')) { ?>
<p class="mb-1">
<a href="<?= $forgotPasswordURL ?>"><?= gettext("I forgot my password") ?></a>
</p>
<?php }
if (SystemConfig::getBooleanValue('bEnableSelfRegistration')) { ?>
<div class="mt-3 pt-2 border-top">
<p class="text-muted small mb-2"><?= gettext('New to') ?> <?= ChurchMetaData::getChurchName() ?>?</p>
<a href="<?= SystemURLs::getRootPath() ?>/external/register/" class="btn btn-outline-primary btn-block"><?= gettext('Register a New Family'); ?></a>
</div>
<?php } ?>
<div class="login-forgot">
<a href="<?= $forgotPasswordURL ?>">I forgot my password</a>
</div>

<div class="login-divider">
<span>OR</span>
</div>

<div class="login-register">
<p>New to Main St. Cathedral?</p>
<a href="<?= SystemURLs::getRootPath() ?>/external/register/" class="login-register-btn">
<i class="fa-solid fa-user-check"></i>
Register a New Family
</a>
</div>
Comment on lines +281 to +295
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Lost Password and Self Registration links are now shown unconditionally. This ignores the existing SystemConfig flags (bEnableLostPassword / bEnableSelfRegistration) and can expose broken links (404 / “not available”). Please gate these sections behind the same config checks as before.

Copilot uses AI. Check for mistakes.
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.login-box -->
</div>

<?php
require SystemURLs::getDocumentRoot() . '/Include/FooterNotLoggedIn.php';