Commit Graph

27 Commits

Author SHA1 Message Date
Harald Bamberger 2fc0827d49 revert erroneously merged pull request 2024-09-25 11:22:59 +02:00
Christian Paminger f66c3466ed Extend HTTP-Basic-Auth for Demo-Mode and easier testing 2024-09-25 05:40:04 +02:00
Paolo d4450e1ae1 Removed check of the tbl_benutzer.aktiv field in the AuthLib 2023-07-05 15:07:05 +02:00
Paolo e1a6a899f6 - Renamed libraries/LDAPLib.php to libraries/AuthLDAPLib.php
- Removed constants LDAP_NO_USER_DN and LDAP_TOO_MANY_USER_DN from config/constants.php
- Added config entry timeout to config/ldap.php
- Changed private method libraries/AuthLib->_checkLDAPAuthentication
to use libraries/AuthLDAPLib->checkUsernamePassword
- Changed AuthLDAPLib to have only one public method called checkUsernamePassword that makes use of the other private methods to check if a username and password are valid on many LDAP servers
2021-06-21 17:03:40 +02:00
Andreas Österreicher 3600f18cd0 Merge branch 'feature-5131/FilterWidget/TableWidget_reloadDataset_true_by_default' 2020-01-15 08:05:54 +01:00
Andreas Österreicher 03903ec51b Usernames are always lowered and trimmed after Login 2020-01-08 17:06:14 +01:00
Paolo 4e6fc7c607 - Create new function getError in helper hlp_return_object_helper that should just returns retval
- Replace all show_error(getData( with show_error(getError(
- Replace all error($...->retval) with error(getError($...))
- Replace all ->outputJsonError(getData( with ->outputJsonError(getError(
- Replace all show_error($...->retval with show_error(getError($...
- Replace all outputJsonError($...->retval with outputJsonError(getError$...
- Replace all return error($...->retval) with return $...
2019-12-18 18:35:19 +01:00
Paolo 1a298c7e46 AuthLib->_createAuthObjByPerson now checks that the benutzer is active, and no more the person 2019-12-18 12:43:39 +01:00
Andreas Österreicher a20e8da298 Fixed Error Handling in AuthLib 2019-12-18 07:49:49 +01:00
Andreas Österreicher b6b3870e94 Trimmed Username after HTTP Basic Auth in Codeigniter 2019-12-17 09:04:27 +01:00
Paolo 477ebe7cc7 - core/Auth_Controller does NOT load anymore hlp_authentication helper
- Added function getAuthPersonId to hlp_authentication helper
- Added function isLogged to hlp_common helper
- hlp_authentication helper functions getAuthPersonId and getAuthUID make use of isLogged function
- AuthLib loads hlp_authentication helper after a successful login or if a user is already logged
- FilterLib does NOT load anymore hlp_authentication helper
- FilterLib does NOT use anymore BenutzerModel and getAuthUID, but retrieves user data directly using the person_id from getAuthPersonId
2019-06-21 13:16:14 +02:00
Paolo 783910b84c Changed the way to set the header if the user is not authorized 2019-04-30 13:12:12 +02:00
Paolo f65f3daceb - Added private property $_requiredPermissions to APIv1_Controller
- Removed method _isAllowed from APIv1_Controller
- Added public method _remap to APIv1_Controller
- PermissionLib loading moved from constructor to _remap in APIv1_Controller
- Changed method basicAuthentication in AuthLib, now calls loginLDAP
2019-04-25 17:02:43 +02:00
Andreas Österreicher b63809abfd Fixed Errorhandling when switching between Users to display correct Errormessages 2019-04-12 15:27:17 +02:00
Paolo 9eaa0b66d7 - Changed AuthLib->loginASByPersonId: now if to the given person_id is linked a uid, then permissions are checked using the uid 2019-03-22 11:54:25 +01:00
Paolo f92e32d8f0 - Added new public method getLandingPage to AuthLib.php
- AuthLib->redirectToLandingPage now calls getLandingPage
- Added new controller system/Login.php to perform login operations
- Added new view system/login/usernamePassword.php to login with username and password
- Added css/Login.css, images/logo-300x160.png and js/Login.js to be used by usernamePassword.php
2019-03-21 17:00:08 +01:00
Paolo 400a1adfde - Added new entry permission_loginas_personids_blacklist in config file permission.php
- Renamed method loginAS to loginASByUID in AuthLib.php
- Added new public method loginASByPersonId to AuthLib.php
- Renamed method connect to anonymousConnect in LDAPLib
- Method LDAPLib->connectUsernamePassword now checks both username and password if they are empty strings
- Added new constant LOGINAS_PERSONIDS_BLACKLIST to PermissionLib
- Renamed method isEntitledLoginAS to isEntitledLoginASByUID in PermissionLib
- Added new public method isEntitledLoginASByPersonId to PermissionLib
- Added new private method _inLAPersonIdsBlacklist to PermissionLib
2019-03-21 15:36:22 +01:00
Paolo 4c2b1731a7 - Added configuration entry authentication_logout_page in auth.php
- Fixed function cleanSessionElement in hlp_session_helper
- Added constants AUTHENTICATION_LOGOUT_PAGE and SESSION_LANDING_PAGE to AuthLib
- Fixed method loginLDAP in AuthLib
- Added public method redirectToLandingPage to AuthLib
- Renamed method _storeAuthObj to _storeSessionAuthObj in AuthLib
- Added private method _storeSessionLandingPage to AuthLib
- Added private method _redirectTemporarily to AuthLib
2019-03-14 13:31:07 +01:00
Paolo 04b1ec327a - Added new config file permission.php
- It contains the following entries:
	- List of permissions that are allowed to perform loginAs
	- List of permissions that cannot be gained with loginAs
	- List of users whose identity cannot be obtained with loginAs
- Removed config entries authentication_loginas_perms and authentication_loginas_blacklist from config file auth.php
- Added constants to PermissionLib: LOGINAS_ALLOWED, LOGINAS_BLACKLIST and LOGINAS_USERS_BLACKLIST
- PermissionLib loads the config file permission.php
- Added public method isEntitledLoginAS to PermissionLib
- Added private methods _inLAUsersBlacklist, _hasLANotAllowedPermissions and _hasLAPermissions to PermissionLib
- Added public method loginAS to AuthLib
- Fixed logout method in AuthLib
- Fixed loginLDAP method in AuthLib
2019-03-13 18:07:15 +01:00
Paolo 53a0b60ba8 - Removed method getCheckUserAuth form api/v1/CheckUserAuth
- Changed LDAP_Model to a library: LDAPLib
- Removed controller system/Login

AuthLib:
- Added new private method _createAuthObjByPerson
- Moved config load from constructor to _authenticate
- Moved Person_Model load from constructor to _createAuthObjByPerson
- Removed method checkUserAuthByCode
- Removed method checkUserAuthByCodeEmail
- Adapted code to use LDAPLib
2019-03-13 11:57:36 +01:00
Paolo fd9a2266ec Added new public method loginLDAP to AuthLib 2019-03-13 10:24:19 +01:00
Paolo d1b4024b76 - Added new constants LDAP_NO_USER_DN and LDAP_TOO_MANY_USER_DN in constants.php
- LDAP_Model->getUserDN now returns errors with more information
- Login redirection is performed with HTTP code 302 instead of 301
- Fixed _checkHBALDAPAuthentication behavior
- AuthLib errors have more information
2019-03-12 16:14:58 +01:00
Paolo 13db712fa7 - Changed authentication_login to AUTH_LDAP in auth.php
- Fixed paths in array authentication_login_pages in ayth.php
- Added new constants AUTHENTICATION_LOGIN and AUTHENTICATION_LOGIN_PAGES to AuthLib
- Added private method _redirectToLogin to AuthLib
- Better comments
2019-03-12 14:00:56 +01:00
Paolo aefd210273 - Added new configuration file auth.php for authentication
- Added new configuration file ldap.php for LDAP connection
- Added new controller system/Login to manage logins
- Added new controller system/Logout to manage logout
- Added new core model LDAP_Model to manage LDAP connections
- Added new constants in config/constants for authentication
- Added new function getCode to hlp_message_helper
- Now core/Auth_Controller loads the AuthLib as first step
- Now PermissionLib does NOT load anymore the AuthLib
- Removed old logic from PermissionLib
- Now function getAuthUID (hlp_authentication_helper) does not load anymore the AuthLib
- Now REST_Controller loads hlp_message_helper and hlp_common_helper
- core/APIv1_Controller does NOT load anymore hlp_message_helper and hlp_common_helper
- Added new constants to AuthLib
- AuthLib constructor now accept a parameter to enable the authentication immediatly (default)
- AuthLib loads configuration file auth.php and Person_model by default
- Added public methods getAuthObj and logout to AuthLib
- Renamed CheckUserAuthByUsernamePassword to checkUserAuthByUsernamePassword, CheckUserAuthByCode to checkUserAuthByCode and CheckUserAuthByCodeEmail to checkUserAuthByCodeEmail in AuthLib
- Added private methods _createAuthObj, _isLogged, _showInvalidAuthentication, _showError, _checkBTAuthentication, _checkHBALDAPAuthentication, _checkLDAPAuthentication, _checkForeignAuthentication, _storeAuthObj and _authenticate to AuthLib
2019-03-12 11:33:01 +01:00
Paolo 2f0048c0c3 - Removed load->helper->('message') from the remaining libraries
- Removed AuthLib from the autoload config file
2018-06-27 11:35:58 +02:00
Paolo ba13f1147b Method _getFinalUserBasicDataByPersonID of AuthLib now returns only the person_id 2017-09-27 12:22:34 +02:00
Paolo ff233e3f16 Added AuthLib 2017-09-25 17:16:52 +02:00