webservice MDL-20805 move token constant to moodlelib
authorjerome mouneyrac <jerome@moodle.com>
Wed, 13 Jan 2010 10:05:49 +0000 (10:05 +0000)
committerjerome mouneyrac <jerome@moodle.com>
Wed, 13 Jan 2010 10:05:49 +0000 (10:05 +0000)
lib/moodlelib.php

index c3e08a193ec41dfff61e6bd6bc7f8f194c725fe9..0f32a0c5d8adc494e5f60efae213da25df496dc5 100644 (file)
@@ -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 ////////////////////////////////////////////////////