Compare commits

..

No commits in common. "7b635a4f0054359bec4eb371c68edd472d7e3f2c" and "3bf65aea4d1104fb07d24b2355f66fde53ba7581" have entirely different histories.

8 changed files with 8 additions and 94 deletions

View file

@ -1 +0,0 @@
sess_*

View file

@ -102,12 +102,8 @@ i18n:
# Session
#
session:
# Session timeout due to inactivity (in seconds)
timeout: 1800
# Session max duration (in seconds, default : 12h)
max_duration: 43200
# Directory path where to store PHP sessions data (optional, default: use system default)
directory_path: "${data_directory}/sessions"
timeout: 1800 # Session timeout dur to inactivity (in seconds)
max_duration: 43200 # Session max duration (in seconds, default : 12h)
#
# Database configuration
@ -147,7 +143,7 @@ db:
#
auth:
# Enabled authentication
enabled: true
enabled: false
# Methods to authenticate users
methods:
@ -157,15 +153,12 @@ auth:
# User backends
backends:
- db
- ldap
#
# Login form
#
login_form:
# Include application navbar (default: true)
include_navbar: true
# Display link for other authentication methods
# Note: method as key and label as value
display_other_methods:
@ -226,30 +219,6 @@ auth:
# CAS Fake authenticated user
#fake_authenticated_user: 'myusername'
#
# Database user backend
#
db:
# DSN (required)
dsn: "${db.dsn}"
# Username (optional but could be required with some PDO drivers)
user: "${db.user}"
# Password (optional)
password: "${db.password}"
# PDO options (optional)
options: "${db.options}"
# Users table name (optional, default: users)
users_table: "users"
# Username field name (optional, default: username)
username_field: "username"
# Password field name (optional, default: password)
password_field: "password"
# Exposed users table fields in resulting EesyPHP\Auth\User object
# (optional, defailt: name, mail)
exposed_fields:
- "name"
- "mail"
#
# LDAP user backend
#

View file

@ -102,12 +102,8 @@ i18n:
# Session
#
session:
# Session timeout due to inactivity (in seconds)
timeout: 1800
# Session max duration (in seconds, default : 12h)
max_duration: 43200
# Directory path where to store PHP sessions data (optional, default: use system default)
directory_path: "${data_directory}/sessions"
timeout: 1800 # Session timeout dur to inactivity (in seconds)
max_duration: 43200 # Session max duration (in seconds, default : 12h)
#
# Database configuration
@ -163,9 +159,6 @@ auth:
# Login form
#
login_form:
# Include application navbar (default: true)
include_navbar: true
# Display link for other authentication methods
# Note: method as key and label as value
display_other_methods:
@ -226,30 +219,6 @@ auth:
# CAS Fake authenticated user
#fake_authenticated_user: 'myusername'
#
# Database user backend
#
db:
# DSN (required)
dsn: "${db.dsn}"
# Username (optional but could be required with some PDO drivers)
user: "${db.user}"
# Password (optional)
password: "${db.password}"
# PDO options (optional)
options: "${db.options}"
# Users table name (optional, default: users)
#users_table: "users"
# Username field name (optional, default: username)
#username_field: "username"
# Password field name (optional, default: password)
#password_field: "password"
# Exposed users table fields in resulting EesyPHP\Auth\User object
# (optional, defailt: name, mail)
#exposed_fields:
# - "name"
# - "mail"
#
# LDAP user backend
#

View file

@ -1 +0,0 @@
sess_*

View file

@ -84,10 +84,6 @@ class Db extends Backend {
)
);
self :: $dsn = App::get('auth.db.dsn', null, 'string');
if (!self :: $dsn) {
Log :: warning('No database DSN configured, can not initialize this authentication backend');
return false;
}
self :: $user = App::get('auth.db.user', null, 'string');
self :: $password = App::get('auth.db.password', null, 'string');
self :: $options = App::get('auth.db.options', null, 'array');
@ -95,7 +91,7 @@ class Db extends Backend {
self :: $username_field = App::get('auth.db.username_field', null, 'string');
self :: $password_field = App::get('auth.db.password_field', null, 'string');
self :: $exposed_fields = App::get('auth.db.exposed_fields', null, 'array');
return true;
return boolval(self :: $dsn);
}
/**

View file

@ -21,7 +21,6 @@ class Form extends Method {
'auth.login_form',
array(
'display_other_methods' => array(),
'include_navbar' => true,
)
);
Url :: add_url_handler('#^login$#', array('EesyPHP\\Auth\\Form', 'handle_login'), null, false);
@ -70,7 +69,6 @@ class Form extends Method {
else
Tpl :: assign('next', (isset($_REQUEST['next'])?urldecode($_REQUEST['next']):''));
Tpl :: assign('display_other_methods', $display_other_methods);
Tpl :: assign('include_navbar', App::get('auth.login_form.include_navbar', null, 'bool'));
Tpl :: display('login.tpl', I18n::_('Sign in'));
}

View file

@ -30,7 +30,6 @@ class Session {
array(
'max_duration' => 43200, // 12h
'timeout' => null,
'directory_path' => null,
)
);
@ -39,16 +38,6 @@ class Session {
Config :: ini_set('session.gc_maxlifetime', strval(self :: $max_duration));
Config :: ini_set('session.cookie_lifetime', strval(self :: $max_duration));
// Set custom session directory (if configured)
$directory_path = App::get('session.directory_path', null, 'string');
if ($directory_path) {
Log :: trace('Set session directory path as "%s"', $directory_path);
if (!session_save_path($directory_path)) {
Log :: warning('Fail to set session directory path as "%s"', $directory_path);
}
}
Log :: debug('Use session directory "%s"', session_save_path());
// Start session
session_start();

View file

@ -1,14 +1,9 @@
{extends file='Tpl:empty.tpl'}
{if !$include_navbar}
{block name="navbar"}{/block}
{/if}
{block name="pagetitle"}{/block}
{block name="main"}
{block name="content"}
<main class="form-signin w-100 m-auto text-center">
<form action="login" method="POST">
{if !$include_navbar}
<img class="mb-4" src="{static_url path="images/logo.svg"}" alt="" width="100">
{/if}
<h1 class="h3 mb-3 fw-normal">{t domain=$CORE_TEXT_DOMAIN}Sign in{/t}</h1>
{include file='Tpl:errors.tpl'}