Example #1
0
function reset() {
	for (i = 0; i < $('#permform').raw().elements.length; i++) {
		element = $('#permform').raw().elements[i];
		if (element.id.substr(0,8) == 'default_') {
			$('#' + element.id.substr(8)).raw().checked = element.checked;
		}
	}
}
</script>
<h2><?php 
echo format_username($UserID, $Username);
?>
 > Permissions</h2>
<div class="linkbox">
	[<a href="#" onclick="reset();return false;">Defaults</a>]
</div>
<div class="box pad">
	Before using permissions, please understand that it allows you to both add and remove access to specific features. If you think that to add access to a feature, you need to uncheck everything else, <strong>YOU ARE WRONG</strong>. The checkmarks on the left, which are grayed out, are the standard permissions granted by their class, any changes you make to the right side will overwrite this. It's not complicated, and if you screw up, click the defaults link at the top. It will reset the user to their respective features granted by class, then you can check or uncheck the one or two things you want to change. <strong>DO NOT UNCHECK EVERYTHING.</strong> If you need further clarification, ask A9 before using this tool.
</div>
<form name="permform" id="permform" method="post" action="">
<input type="hidden" name="action" value="permissions" />
<input type="hidden" name="id" value="<?php 
echo $_REQUEST['userid'];
?>
" />
<?
permissions_form();
?>
</form>
<? show_footer(); ?>
Example #2
0
    $busa = BoincUserSubmitApp::lookup("user_id={$user->id} and app_id={$app_id}");
    if (!$busa || !$busa->manage) {
        error_page("no access");
    }
}
$action = get_str("action", true);
switch ($action) {
    case "":
        main_page($app);
        break;
    case "app_version_form":
        app_version_form($app);
        break;
    case "app_version_action":
        app_version_action($app);
        break;
    case "permissions_form":
        permissions_form($app);
        break;
    case "permissions_action":
        permissions_action($app);
        break;
    case "batches_form":
        batches_form($app);
        break;
    case "batches_action":
        batches_action($app);
        break;
    default:
        error_page("unknown action {$action}");
}