EditTag: disallow users to disown their own tags
This commit is contained in:
		
							parent
							
								
									ad816f10a3
								
							
						
					
					
						commit
						27f69b0a74
					
				| @ -63,10 +63,7 @@ class EditTag extends HTMLController | ||||
| 		elseif (!$id_tag) | ||||
| 			$after_form = '<button name="submit_and_new" class="btn">Save and add another</button>'; | ||||
| 
 | ||||
| 		$form = new Form([ | ||||
| 			'request_url' => BASEURL . '/edittag/?' . ($id_tag ? 'id=' . $id_tag : 'add'), | ||||
| 			'content_below' => $after_form, | ||||
| 			'fields' => [ | ||||
| 		$fields = [ | ||||
| 			'kind' => [ | ||||
| 				'type' => 'select', | ||||
| 				'label' => 'Kind of tag', | ||||
| @ -99,7 +96,18 @@ class EditTag extends HTMLController | ||||
| 				'maxlength' => 255, | ||||
| 				'is_optional' => true, | ||||
| 			], | ||||
| 			], | ||||
| 		]; | ||||
| 
 | ||||
| 		if (!$user->isAdmin()) | ||||
| 		{ | ||||
| 			unset($fields['kind']); | ||||
| 			unset($fields['id_user_owner']); | ||||
| 		} | ||||
| 
 | ||||
| 		$form = new Form([ | ||||
| 			'request_url' => BASEURL . '/edittag/?' . ($id_tag ? 'id=' . $id_tag : 'add'), | ||||
| 			'content_below' => $after_form, | ||||
| 			'fields' => $fields, | ||||
| 		]); | ||||
| 
 | ||||
| 		// Create the form, add in default values.
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user