Changeset 1097 for trunk/common
- Timestamp:
- 12/27/09 01:24:58 (2 years ago)
- Location:
- trunk/common
- Files:
-
- 2 edited
-
security.php (modified) (2 diffs)
-
textblock.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/security.php
r1091 r1097 211 211 212 212 // Forward security to task. 213 if ( preg_match("/^ \s* task: \s* (".IA_RE_TASK_ID.") \s* $/xi", $textsec, $matches)) {213 if (($task_id = textblock_security_is_task($textsec))) { 214 214 require_once(IA_ROOT_DIR . "common/db/task.php"); 215 $task = task_get($ matches[1]);215 $task = task_get($task_id); 216 216 if ($task === null) { 217 217 log_warn("Bad security descriptor, ask an admin."); … … 310 310 // Convert action into a grader action if the textblock is a task 311 311 // textblock and the attachment has the grader_ prefix. 312 if ( preg_match("/^ \s* task: \s* (".IA_RE_TASK_ID.") \s* $/xi", $tb["security"]) &&312 if (textblock_security_is_task($tb['security']) && 313 313 preg_match('/^grader\_/', $att_name)) { 314 314 $newaction = preg_replace('/^attach/', 'grader', $action); -
trunk/common/textblock.php
r1079 r1097 188 188 } 189 189 190 // Checks if the textblock is task and return the task_id if true or false if false 191 function textblock_security_is_task($textblock) { 192 if (preg_match("/^ \s* task: \s* (".IA_RE_TASK_ID.") \s* $/xi", $textblock, $matches)) { 193 return $matches[1]; 194 } 195 return false; 196 } 197 190 198 ?>
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)