Back to top

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
documentation:rack:reference:sessions [2019/04/05 18:17] – [Functions] Martijn Luinstradocumentation:rack:reference:sessions [2023/08/31 23:19] (current) Martijn Luinstra
Line 3: Line 3:
 The file ''include/sessions.php'' contains functions to enable interaction with the Cover API. The file ''include/sessions.php'' contains functions to enable interaction with the Cover API.
  
-Most interactions are based on cookies and therefore need an active local instance of the Cover website. If a local instance should be used, it can be configured by setting the Rack configuration options  <php>COVER_API_URL</php><php>COVER_COOKIE_NAME</php><php>COVER_LOGIN_URL</php> and <php>COVER_LOGOUT_URL</php>.+Most interactions are based on cookies and therefore need an active local instance of the Cover website. If a local instance should be used, it can be configured by setting the Rack configuration options  ''%%COVER_API_URL%%''''%%COVER_COOKIE_NAME%%''''%%COVER_LOGIN_URL%%'' and ''%%COVER_LOGOUT_URL%%''.
  
 ===== Functions ===== ===== Functions =====
  
-<php>get_cover_session()</php>\\ +''%%get_cover_session()%%''\\ 
-Returns a PHP object with the information about the user that is logged in on the Cover website. Returns <php>null</php> is user is not logged in on the Cover website.+Returns a PHP object with the information about the user that is logged in on the Cover website. Returns ''%%null%%'' is user is not logged in on the Cover website.
  
-<php>cover_session_logged_in()</php>\\ +''%%cover_session_logged_in()%%''\\ 
-Returns <php>true</php> if a user is logged in on the Cover website. Returns <php>false</php> otherwise.+Returns ''%%true%%'' if a user is logged in on the Cover website. Returns ''%%false%%'' otherwise.
  
-<php>cover_login_url($next_url=null)</php>\\+''%%cover_login_url($next_url=null)%%''\\
 Returns a string with the login url of the Cover website and optionally injects the URL the user should be redirected to after logging in. Returns a string with the login url of the Cover website and optionally injects the URL the user should be redirected to after logging in.
  
-<php>cover_logout_url($next_url=null)</php>\\ +''%%cover_logout_url($next_url=null)%%''\\ 
-Analogous to <php>cover_login_url</php>.+Analogous to ''%%cover_login_url%%''.
  
-<php>cover_session_get_committees()</php>\\ +''%%cover_session_get_committees()%%''\\ 
-Returns an associative array of <php>'committee_login' => 'committee_name'</php> pairs of the committees the user is in, or an empty array if no user is logged in.+Returns an associative array of ''%%'committee_login' => 'committee_name'%%'' pairs of the committees the user is in, or an empty array if no user is logged in.
  
-<php>cover_session_in_committee($committee_login)</php>\\ +''%%cover_session_in_committee($committee_login)%%''\\ 
-Returns <php>true</php> if the logged in user is a member of the committee. Returns <php>false</php> otherwise or if not user is logged in. An array of multiple committee logins can be provided to check if the user is a member of one of these committees.+Returns ''%%true%%'' if the logged in user is a member of the committee. Returns ''%%false%%'' otherwise or if not user is logged in. An array of multiple committee logins can be provided to check if the user is a member of one of these committees.
  
-<php>cover_get_json($method, array $data = array(), $use_session = true)</php>\\ +''%%cover_get_json($method, array $data = array(), $use_session = true)%%''\\ 
-Issues a ''GET'' request to a  <php>$method</php> of the Cover API.+Issues a ''GET'' request to a  ''%%$method%%'' of the Cover API.

documentation/rack/reference/sessions.1554481027.txt.gz · Last modified: 2022/04/03 16:00 (external edit)