- Timestamp:
- 09/26/09 22:56:53 (3 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
common/security.php (modified) (1 diff)
-
www/controllers/task.php (modified) (2 diffs)
-
www/views/task_edit.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/security.php
r1036 r1053 142 142 case 'task-change-open': 143 143 case 'textblock-change-security': 144 case 'task-edit-owner': 144 145 case 'task-tag': 145 146 case 'round-tag': -
trunk/www/controllers/task.php
r997 r1053 66 66 // Tag data 67 67 $values['tags'] = request('tags', tag_build_list("task", $task_id)); 68 68 69 // Task owner 70 if (identity_can('task-edit-owner', $task)) { 71 if ($task["user_id"]) { 72 $user = user_get_by_id($task["user_id"]); 73 log_assert($user, "Task has invalid user_id"); 74 $username = $user["username"]; 75 } else { 76 $username = ""; 77 } 78 $values["user"] = request("user", $username); 79 } 80 69 81 // Validate the monkey. 70 82 if (request_is_post()) { … … 73 85 foreach ($fields as $field) { 74 86 $new_task[$field] = $values[$field]; 87 } 88 89 if (identity_can('task-edit-owner', $task)) { 90 if ($values["user"] == "") { 91 $new_task["user_id"] = 0; 92 } else { 93 $user = user_get_by_username($values["user"]); 94 if (!$user) { 95 $errors["user"] = "Utilizator inexistent"; 96 } else { 97 $new_task["user_id"] = $user["id"]; 98 } 99 } 75 100 } 76 101 -
trunk/www/views/task_edit.php
r996 r1053 21 21 'page_name' => array( 22 22 'name' => "Pagina cu enuntul", 23 'description' => "Aceasta este pagina la care este trimis utilizatorul ". 24 "cand da click pe o problema", 23 'description' => "Aceasta este pagina la care este trimis ". 24 "utilizatorul cand da click pe o problema", 25 'type' => 'string', 26 ), 27 'user' => array( 28 'name' => "Utilizatorul care adauga problema", 29 'description' => "Utilizatorul care are drepturi de editare ". 30 "asupra problemei. Poate fi lasat gol.", 25 31 'type' => 'string', 26 32 ), … … 111 117 <?= view_form_field_li($form_fields['title'], 'title') ?> 112 118 <?= view_form_field_li($form_fields['page_name'], 'page_name') ?> 119 <?php if (identity_can('task-edit-owner', $task)) { ?> 120 <?= view_form_field_li($form_fields['user'], 'user') ?> 121 <?php } ?> 113 122 <?= view_form_field_li($form_fields['author'], 'author') ?> 114 123 <?= view_form_field_li($form_fields['source'], 'source') ?> 115 <?php if (identity_can('task-change-security', $task)) { ?> 124 <?php if (identity_can('task-change-security', $task)) { ?> 116 125 <?= view_form_field_li($form_fields['hidden'], 'hidden') ?> 117 126 <?php } ?> … … 125 134 // FIXME: Field should be generated from task_get_types() 126 135 ?> 127 <?php if (identity_can('task-change-open', $task)) { ?> 136 <?php if (identity_can('task-change-open', $task)) { ?> 128 137 <fieldset> 129 138 <legend>Acces la surse si teste</legend>
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)