The php part defines for which group this rule will be applied. In my case for the group «Lehrpersonen» (teachers). After the echo statement, everything is pure css. Some of the fields are completely hidden others read only. Consider, that this is not a secure method to prevent editing forms, it's still possible to see the content in the html source. It's more a usability hack then a secure method, but for my project it's good enough.
Code: Select all
<?php
$mi = getMemberInfo();
if ($mi['group'] == 'Lehrpersonen') {
echo "
<style type='text/css'>
.form-group.device-d_label {
pointer-events: none;
}
.form-group.device-d_oldlabel {
display: none;
}
.form-group.device-d_model {
pointer-events: none;
}
.form-group.device-d_state {
pointer-events: none;
display: none;
}
.form-group.device-d_room {
pointer-events: none;
}
.form-group.device-d_rollout {
pointer-events: none;
display: none;
}
.form-group.device-d_os {
pointer-events: none;
display: none;
}
.form-group.device-d_biossrn {
display: none;
}
.form-group.device-d_hash {
display: none;
}
</style>";
}
This is what members of the group "Lehrpersonen" see.