Commit graph

52 commits

Author SHA1 Message Date
Benjamin Renard 59ecc0d7fa Add authz proxy authorization support
Add useAuthzProxyControl parameter to combine with useUserCredentials to 
also using authz proxy authorization.
2021-08-26 20:16:22 +02:00
Benjamin Renard 9907e08f18 Code cleaning 2021-08-25 18:02:37 +02:00
Benjamin Renard a3aa857c78 Improve/fix LSdefaut / LSsession / LSerror / LSdebug / LSinfosBox 2021-08-25 16:50:29 +02:00
Benjamin Renard 3c6ce596d9 LSsession::getLSuserObject(): improve errors logging 2021-07-07 16:27:35 +02:00
Benjamin Renard 40fdc92451 Code cleaning: fix tabs 2021-06-10 18:45:00 +02:00
Benjamin Renard bf28a6ea94 LSaddon::supann: rework on nomenclatures loading & add support of supannCodePopulation, supannEmpProfil & supannExtProfil 2021-06-10 17:56:34 +02:00
Benjamin Renard 639f46d8a4 Add LSdefaut copyable feature and use it in showTechInfo 2021-04-14 15:46:36 +02:00
Benjamin Renard 2b6b8ce270 Fix project URLs and list emails addresses 2021-04-13 18:04:19 +02:00
Benjamin Renard 3d9b3c2947 LSsession::displayAjaxReturn(): Adjust HTTP returned code on unsuccessfull request 2021-03-11 17:29:20 +01:00
Benjamin Renard fb62ce2eed Fix reconnectAs() calls 2021-02-17 11:45:39 +01:00
Benjamin Renard 16373e6904 Fix content-type on Ajax return 2021-02-04 10:22:10 +01:00
Benjamin Renard 0ec390e1fe Add API feature
Some major changes have been made to handle this new feature :
- LSsession now have a flag about API mode. The displayTemplate() and
  displayAjaxReturn() methods have been adjust to correctly handle this
  mode.
- LSauth system have been adjust to handle a custom API mode :
  - LSauthMethod can support or not this mode : the $api_mode_supported
    permit to defined if supported (default, false). Currently, only
    HTTP (default in API mode) and annonymous mode support it.
  - An api_access parameter permit to configure witch type of user
    LSobject types could use the API. This flag must be set to True to
    allow a type of LSobject (default: False). In a same way, a
    web_access parameter now permit to disable Web access for some
    types of users (but this parameter is optional and its default value
    is True).
  - The HTTP method is the privileged first method for API mode. In this
    mode, if auth data aren't present in environment, it will request it
    by triggered a 403 HTTP error. Realm can be configured with new
    LSAUTHMETHOD_HTTP_API_REALM constant.
- The LStemplate system handle API mode to correctly react on errors: it
  return a JSON answer instead of HTML page. Error pages also now return
  adjusted HTTP code (404 or 500).
- The LSurl system have been adjust to handle API mode :
  - On declaring handlers, we could now specify if it's an API view with
    new $api_mode paremeter of add_handler() method
  - The LSurlRequest object have a new attribute to check if it's an API
    request
  - The error_404() method handle the API mode to return JSON answer.
    Furthermore, if no handlers matched with the requested URL, API mode
    is automatically enabled if the requested URL starts with 'api/'.
- LSform implement it own API mode flag and a new submited flag that
  be toggle via the new setSubmited() method. Some major changes also
  occured on LSformElement classes to specifically handle API
  input/output for each types of attributes:
  - a new getApiValue() method permit to retrieve the API value of the
    attribute (on show API view)
  - the getPostData() method now have to correctly handle API input for
    the attribute (on create/modify API views). A programmatic way have
    been adopted for each types of attributes.
- The LSimport and LScli create/modify commands also evolved to enable
  API mode of the LSform. This permit to take advantage of the new
  capability of LSform/LSformElement to handle input values with a
  programmatic way.
- New routes have been add to handle API views. All this new routes
  start with 'api/1.0/' and use the same URL schema as the web UI. The
  API currently permit to search/show/add/modify/remove LSobjects and
  manages their relations.
2021-02-03 14:40:28 +01:00
Benjamin Renard 305d7447ff LSsession: Fix relationCanAccess() method and add debuging infos 2021-02-03 12:44:38 +01:00
Benjamin Renard 2544687b27 LSsession::checkAccess(): fix checking read right 2021-02-02 20:28:02 +01:00
Benjamin Renard 089693ea0e Fix/improve LSsession_13 errors (unconfigured/unknown custom action function) 2020-12-16 17:42:55 +01:00
Benjamin Renard ab922356c0 LSsession :: loadLSprofilesLSobjects(): fix a PHP warning 2020-12-14 19:37:13 +01:00
Benjamin Renard 3c75ef482e Remove historic read right on all attributes of the hard-coded "admin" LSprofile 2020-12-01 16:40:21 +01:00
Benjamin Renard f7231229f5 LSsession: fix errors in changeAuthUser() and add logging messages 2020-11-30 16:13:36 +01:00
Benjamin Renard 8b996885d1 LSsession: improve loadLSaddons() method 2020-11-17 17:56:04 +01:00
Benjamin Renard 9db67eb2ba LSsession: improve error messages 2020-09-03 18:31:53 +02:00
Benjamin Renard bbaa0a99df Auto declare simple PHP class for simple LSObject type
On LSsession::loadLSobject(), if PHP class file is not found, a simple 
one will be declare.
2020-09-03 16:00:51 +02:00
Benjamin Renard 406b017023 Add method LSldapObject::isValidTypeName() and use it in LSsession::loadLSobject() 2020-09-03 15:40:59 +02:00
Benjamin Renard a8e2ecc343 Translate LSerror message at formating/diplaying time
It's permit to be sure to translate message in the right user language, 
even if its context isn't loaded at error emission time.
2020-08-25 17:31:50 +02:00
Benjamin Renard 8a1eefc5e3 LSsession::loadLSprofiles(): restructuring code and improve comments and logging 2020-08-24 17:56:42 +02:00
Benjamin Renard f223827157 LSsession::includeFile(): improve logging 2020-08-17 20:04:21 +02:00
Benjamin Renard 5fcf3bbf9c LSsession: add trace messages in whoami() and canAccess methods 2020-08-07 18:19:24 +02:00
Benjamin Renard 1f1a4e16fa LSsession: add log_exception() method 2020-08-07 18:17:02 +02:00
Benjamin Renard f234709722 LSlog: add TRACE log level 2020-08-07 18:05:50 +02:00
Benjamin Renard 42e6437966 LSsession: fix usage of self :: $topDn instead of self :: getTopDn() 2020-08-07 17:40:40 +02:00
Benjamin Renard d5d88d2601 LSsession : fix handling subDn in recoverPassword feature 2020-08-06 17:01:51 +02:00
Benjamin Renard 3dbfe18afb LSsession: add setSubDn() method 2020-08-06 16:43:35 +02:00
Benjamin Renard 712d18b09f LSsession: fix/improve methods & doc about global preference parameters 2020-08-06 13:48:43 +02:00
Benjamin Renard 626e0d854c Fix subDn form style 2020-08-06 13:20:49 +02:00
Benjamin Renard 559f9d9475 Add autocompleter for CLI command search 2020-06-15 10:40:48 +02:00
Benjamin Renard ac1626fe22 LSsession: fix some error messages 2020-06-04 19:05:23 +02:00
Benjamin Renard 1b98dbfe80 Fix helpInfo feature by LSsession::addHelpInfos to LStemplate
LSsession :: addHelpInfos() is now deprecated in favor of LStemplate :: 
addHelpInfo().
2020-06-04 19:04:48 +02:00
Benjamin Renard 81c8a486d9 Move "Connect as" label translation to template 2020-05-28 16:59:28 +02:00
Benjamin Renard 3fbd9e8073 Move custom JS & CSS handling methods from LSsession to LStemplates
The following method are now offer by LStemplate:
 - addJSscript()
 - addLibJSscript()
 - addJSconfigParam()
 - addCssFile()
 - addLibCssFile()
Old methods are always provided by LSsession, but an deprecated error 
message wil be displayed to alert on it.
2020-05-28 16:56:36 +02:00
Benjamin Renard d68b15bac3 Add default LSprofiles with the name of authenticable object types
Consquently adjust LSaccessRigthsMatrixView addon and make some 
representative change in LSexample for demo
2020-05-25 11:09:32 +02:00
Benjamin Renard 9bb52296b7 LSsession :: loadLSaddon: keep trace of already loaded addon to avoid loading more than once 2020-05-14 10:53:41 +02:00
Benjamin Renard db710efb87 LSsession: Fix PHP < 7 syntax error 2020-05-12 20:20:11 +02:00
Benjamin Renard a6f07faca0 LSauth: Add possibility to configure more than one LSobject type as user 2020-05-12 19:23:24 +02:00
Benjamin Renard ca7a6e821e LSsession : use LSlog_logger 2020-05-08 15:51:21 +02:00
Benjamin Renard de73ffdd60 Rework on template files to use blocks 2020-05-07 12:16:12 +02:00
Benjamin Renard cd8908391d Improve login and recover password templates 2020-05-07 11:36:25 +02:00
Benjamin Renard e87270112e LSsession :: loadLSaddon(): don't if config file is not found 2020-05-07 11:34:30 +02:00
Benjamin Renard 7153356a24 LSsession :: loadLSclass(): respect $warn parameter on includeFile() call 2020-05-07 11:19:36 +02:00
Benjamin Renard 16aa789b21 LSsession :: includeFile: add $warn parameter to control warning if file not found 2020-05-07 11:16:09 +02:00
Benjamin Renard 91ea37f841 Remove references to old index.php page 2020-05-07 09:56:28 +02:00
Benjamin Renard 6ba8f2732c LSsession : fix getTmpFileURL when tmp directory is a symbolic link 2020-05-06 21:23:07 +02:00