Ejemplo n.º 1
0
    echo "Added Right {$right_id} to Area {$area_id}<br/>";
}
listGroups();
$res = $perm->grantGroupRight($group_id, $right_id);
if (PEAR::isError($res)) {
    echo "<pre>";
    print_r($res);
    echo "</pre>";
} else {
    echo "Granted Right {$right_id} to Group {$group_id}<br/>";
}
$user_rights = $perm->getRights(array('where_user_id' => $perm->getAuthUserId($user_id)));
echo "<pre>UserRights:";
print_r($user_rights);
echo "</pre>";
listRights();
if ($res = $LU->tryLogin('franz_josef', 'dummypass')) {
    echo $LU->getProperty('handle') . " logged in<br/>";
} else {
    echo "<pre>LU Result";
    print_r($res);
    echo "</pre>";
}
/* $options can contain
 * 'prefix'      => 'prefix_goes_here',
 * 'area'        => 'specific area id to grab rights from',
 * 'application' => 'specific application id to grab rights from'
 * 'naming'      => 1 for PREFIX_RIGHTNAME  <- DEFAULT
 *                  2 for PREFIX_AREANAME_RIGHTNAME
 *                  3 for PREFIX_APPLICATIONNAME_AREANAME_RIGHTNAME
 * 'filename'    => if $mode is file you must give the full path for the
Ejemplo n.º 2
0
Functions::checkRights(__FILE__, $action, Functions::get('token'));
switch ($action) {
    case 'fields_info':
        $data = infoFields();
        break;
    case 'new':
        $data = addRight();
        break;
    case 'update':
        $data = updateRight(Functions::get('id'));
        break;
    case 'info':
        $data = infoRight(Functions::get('id'));
        break;
    case 'delete':
        $data = deleteRight(Functions::get('id'));
        break;
    case 'search':
        $data = searchRight(Functions::get('actionId'), Functions::get('statusId'));
        break;
    case 'list':
        $data = listRights();
        break;
    case 'list_easy':
        $data = listRightsEasy();
        break;
    default:
        Functions::setResponse(400);
}
/* </controller> */
loadview('json', $data);