aboutsummaryrefslogtreecommitdiff
path: root/actions/make_translation_editor.php
blob: 5a5640c66e15fc5898cff6169d0ae4c0c6c9c432 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php 
	
	admin_gatekeeper();
	
	$result = false;
	
	$user = get_input("user");
	$role = "translation_editor";
	
	$user = get_entity($user);
	if($user instanceof ElggUser){
		if(create_metadata($user->guid, $role, true, "integer", $user->guid, ACCESS_PUBLIC)){
			$result = true;	
		}
	}

	if(!$result){
		register_error(elgg_echo("translation_editor:action:make_translation_editor:error"));
	} else {
		system_message(elgg_echo("translation_editor:action:make_translation_editor:success"));
	}
	
	forward(REFERER);