Added data officer role to tests

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2019-07-28 11:56:40 +02:00
parent 3dce95e2d3
commit bb790d62a9
2 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,7 @@ setup() {
destroy_containers destroy_containers
launch_containers launch_containers
create_rules "piler1" create_rules "piler1"
add_data_officer "piler1"
} }
start_telegraf() { start_telegraf() {
@ -44,3 +45,8 @@ create_rules() {
docker exec "$container" /etc/init.d/rc.piler reload 2>/dev/null docker exec "$container" /etc/init.d/rc.piler reload 2>/dev/null
} }
add_data_officer() {
local container="$1"
echo 'echo "insert into user (uid, username, realname, password, domain, dn, isadmin) values(2, \"dataofficer\", \"Data officer\", \"\$6\$rX285LfP$ZxhlacbzKuCcqkaizzBu8SAiYb6.f8K4Us08nUHwSpWMQkNhw4o2rmfKXoTfaM4rnBHUYVK1N4IfBsqN8CAtS/\", \"local\", \"*\", 4)"| mysql --defaults-file=/etc/piler/.my.cnf piler' | docker exec -i "$container" sh
}

View File

@ -139,7 +139,7 @@
<option value="0"<?php if(isset($user['isadmin']) && $user['isadmin'] == 0){ ?> selected="selected"<?php } ?>><?php print $text_user_regular; ?></option> <option value="0"<?php if(isset($user['isadmin']) && $user['isadmin'] == 0){ ?> selected="selected"<?php } ?>><?php print $text_user_regular; ?></option>
<?php if(Registry::get('admin_user') == 1) { ?><option value="1"<?php if(isset($user['isadmin']) && $user['isadmin'] == 1){ ?> selected="selected"<?php } ?>><?php print $text_user_masteradmin; ?></option><?php } ?> <?php if(Registry::get('admin_user') == 1) { ?><option value="1"<?php if(isset($user['isadmin']) && $user['isadmin'] == 1){ ?> selected="selected"<?php } ?>><?php print $text_user_masteradmin; ?></option><?php } ?>
<option value="2"<?php if(isset($user['isadmin']) && $user['isadmin'] == 2){ ?> selected="selected"<?php } ?>><?php print $text_user_auditor; ?></option> <option value="2"<?php if(isset($user['isadmin']) && $user['isadmin'] == 2){ ?> selected="selected"<?php } ?>><?php print $text_user_auditor; ?></option>
<option value="4"<?php if(isset($user['isadmin']) && $user['isadmin'] == 2){ ?> selected="selected"<?php } ?>><?php print $text_user_data_officer; ?></option> <option value="4"<?php if(isset($user['isadmin']) && $user['isadmin'] == 4){ ?> selected="selected"<?php } ?>><?php print $text_user_data_officer; ?></option>
</select> </select>
</div> </div>
</div> </div>