Example #1
0
function intAssignSelectedPermVals(&$smarty)
{
    if (isInRequest("selected")) {
        $has_perm = hasPerm($_REQUEST["selected"], $_REQUEST["admin_username"]);
        $smarty->assign("selected", $_REQUEST["selected"]);
        $smarty->assign("has_selected_perm", $has_perm);
        $smarty->assign("selected_value", requestVal("value"));
        if ($has_perm) {
            $perm_val_req = new AdminPermValue($_REQUEST["selected"], $_REQUEST["admin_username"]);
            list($success, $cur_val) = $perm_val_req->send();
            if ($success) {
                $smarty->assign("cur_val", $cur_val);
            } else {
                $smarty->assign("cur_val", "ERR");
                smartySetPageErr($smarty, $cur_val->getErrorMsgs());
            }
        }
    } else {
        $smarty->assign("selected", "");
    }
}