- Timestamp:
- 12/27/09 01:24:58 (2 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
common/security.php (modified) (2 diffs)
-
common/textblock.php (modified) (1 diff)
-
www/views/textblock_header.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 ?> -
trunk/www/views/textblock_header.php
r955 r1097 10 10 <div id="wikiOps"> 11 11 <ul> 12 <?php if (($task_id = textblock_security_is_task($textblock['security'])) && identity_can('task-edit', $task = task_get($task_id))) { ?> 13 <li><?= format_link_access(url_task_edit($task['id']), 'Editeaza parametrii', 'p') ?></li> 14 <?php } ?> 15 <?php if ($task_id && identity_can('task-tag', $task)) { ?> 16 <li><?= format_link_access(url_task_edit_tags($task['id']), 'Editeaza tag-uri', 't') ?></li> 17 <?php } ?> 12 18 <?php if (identity_can('textblock-edit', $textblock)) { ?> 13 <li><?= format_link_access(url_textblock_edit($textblock['name']), 'Editeaza', 'e') ?></li>19 <li><?= format_link_access(url_textblock_edit($textblock['name']), ($task_id) ? 'Editeaza enunt' :'Editeaza', 'e') ?></li> 14 20 <?php } ?> 15 21 <?php if (identity_can('textblock-history', $textblock)) { ?>
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)