Private GIT

Skip to content
Snippets Groups Projects
Commit 6d453bde authored by David Boucher's avatar David Boucher
Browse files

feat(centAcl): Servicegroups and meta work now.

parent 1dc641d0
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,25 @@
*
*/
/**
* bitfieldIsOn: Returns a boolean telling if the bit at position $idx
* is on or off.
* @param $field the bitfield given as a string
* @param $idx the position to check
*
* @returns a boolean
*/
function bitfieldIsOn($field, $idx) {
$pos = $idx % 8;
$row = ($idx - $pos) / 8;
if ($row < strlen($field)) {
if (ord($field[$row]) & (128 >> $pos)) {
return true;
}
}
return false;
}
/*
* Init functions
*/
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment