From eec99048c2b2609ea2512d3f0086468887eaf86a Mon Sep 17 00:00:00 2001 From: jerome mouneyrac Date: Wed, 13 Jan 2010 10:05:49 +0000 Subject: [PATCH] webservice MDL-20805 move token constant to moodlelib --- lib/moodlelib.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index c3e08a193e..0f32a0c5d8 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -342,6 +342,22 @@ define('MOD_ARCHETYPE_RESOURCE', 1); /** Assignemnt module archetype */ define('MOD_ARCHETYPE_ASSIGNMENT', 2); +/** + * Security token used for allowing access + * from external application such as web services. + * Scripts do not use any session, performance is relatively + * low because we need to load access info in each request. + * Scrits are executed in parallel. + */ +define('EXTERNAL_TOKEN_PERMANENT', 0); + +/** + * Security token used for allowing access + * of embedded applications, the code is executed in the + * active user session. Token is invalidated after user logs out. + * Scripts are executed serially - normal session locking is used. + */ +define('EXTERNAL_TOKEN_EMBEDDED', 1); /// PARAMETER HANDLING //////////////////////////////////////////////////// -- 2.39.5