Example #1
0
<?php

/* Author: Gowtham */
session_start();
include 'db_login.php';
include 'inc.php';
$_SESSION['adminLevel'] = $_GET['adminLevel'];
$_SESSION['uid'] = $_GET['uid'];
$comment = $_GET['comment'];
$rORw = $_GET['rORw'];
if ($rORw and $comment) {
    $mems = authField($comment, $rORw);
    echo '<div>';
    for ($i = 0; $i <= $mems['r']['index']; $i++) {
        echo 'Readers: ';
        echo '<br/><tab/>Users: ' . implode(',', $mems['r']['users'][$i]);
        echo '<br/><tab/>rows: ' . implode(',', $mems['r']['rows'][$i]);
        echo '<br/><tab/>Objects: ' . implode(',', $mems['r']['objects'][$i]);
        echo '<br/><tab/>GID: ' . $mems['r']['gid'][$i];
        echo '<br/><tab/>AL: ' . $mems['r']['aL'][$i];
    }
    for ($i = 0; $i <= $mems['w']['index']; $i++) {
        echo 'Writers: ';
        echo '<br/><tab/>Users: ' . implode(',', $mems['w']['users'][$i]);
        echo '<br/><tab/>rows: ' . implode(',', $mems['w']['rows'][$i]);
        echo '<br/><tab/>Objects: ' . implode(',', $mems['w']['objects'][$i]);
        echo '<br/><tab/>GID: ' . $mems['w']['gid'][$i];
        echo '<br/><tab/>AL: ' . $mems['w']['aL'][$i];
    }
    echo '<br/>authRows: ' . implode(',', $mems[$rORw]['authRows']);
    echo '</div>';
Example #2
0
                     }
                 }
                 if ($rInd[$j] == $mems['w']['authRows'][$l]) {
                     $mems['w']['ptable'][$Field[$i]][$rInd[$j]] = TRUE;
                     $mems['w']['ptable']['index'][$rInd[$j]] = TRUE;
                     $l++;
                 }
             }
         }
     }
     $authorizeTransit = TRUE;
 }
 if (!$fc) {
     for ($i = 1; $i < $colCount; $i++) {
         if ($Comment[$i] != '') {
             $ms[$i] = authField($Comment[$i]);
             $sar = $ms[$i]['w']['authRows'][0] == "*" ? array("*") : array_unique(array_merge($ms[$i]['r']['authRows'], $ms[$i]['w']['authRows']));
             sort($sar);
             $ms[$i]['r']['authRows'] = $sar;
             $k = 0;
             $l = 0;
             if (count($ms[$i]['r']['authRows']) > 0) {
                 if ($ms[$i]['r']['authRows'][0] == '*') {
                     for ($j = 0; $j < $rowCount; $j++) {
                         $mems['r']['ptable'][$Field[$i]][$rInd[$j]] = TRUE;
                         $mems['r']['ptable']['index'][$rInd[$j]] = TRUE;
                         $mems['r']['ptable'][$Field[$priCol]][$rInd[$j]] = TRUE;
                         if ($k > $rc) {
                             $rc = $k;
                         }
                         $k++;