Applying new rs_xxx() functions everywhere. MDL-8134
This commit is contained in:
+6
-7
@@ -766,8 +766,8 @@ function load_user_capability($capability='', $context = NULL, $userid='') {
|
||||
}
|
||||
|
||||
if ($rs && $rs->RecordCount() > 0) {
|
||||
while (!$rs->EOF) {
|
||||
$array = $rs->fields;
|
||||
while ($caprec = rs_fetch_next_record($rs)) {
|
||||
$array = (array)$caprec;
|
||||
$temprecord = new object;
|
||||
|
||||
foreach ($array as $key=>$val) {
|
||||
@@ -777,10 +777,9 @@ function load_user_capability($capability='', $context = NULL, $userid='') {
|
||||
$temprecord->{$key} = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$capabilities[] = $temprecord;
|
||||
$rs->MoveNext();
|
||||
}
|
||||
rs_close($rs);
|
||||
}
|
||||
// SQL for overrides
|
||||
// this is take out because we have no way of making sure c1 is indeed related to c2 (parent)
|
||||
@@ -815,8 +814,8 @@ function load_user_capability($capability='', $context = NULL, $userid='') {
|
||||
}
|
||||
|
||||
if ($rs && $rs->RecordCount() > 0) {
|
||||
while (!$rs->EOF) {
|
||||
$array = $rs->fields;
|
||||
while ($caprec = rs_fetch_next_record($rs)) {
|
||||
$array = (array)$caprec;
|
||||
$temprecord = new object;
|
||||
|
||||
foreach ($array as $key=>$val) {
|
||||
@@ -831,8 +830,8 @@ function load_user_capability($capability='', $context = NULL, $userid='') {
|
||||
if (is_parent_context($temprecord->id1, $temprecord->id2)) {
|
||||
$capabilities[] = $temprecord;
|
||||
} // only write if relevant
|
||||
$rs->MoveNext();
|
||||
}
|
||||
rs_close($rs);
|
||||
}
|
||||
|
||||
// this step sorts capabilities according to the contextlevel
|
||||
|
||||
Reference in New Issue
Block a user