Ejemplo n.º 1
0
<?php

require_once "../../inc/init.php";
require_once IBSINC . "admin.php";
require_once IBSINC . "admin_face.php";
needAuthType(ADMIN_AUTH_TYPE);
$smarty = new IBSSmarty();
if (isInRequest("admin_username", "deposit", "deposit_comment")) {
    intChangeDeposit($smarty, $_REQUEST["admin_username"], $_REQUEST["deposit"], $_REQUEST["deposit_comment"]);
} else {
    if (isInRequest("admin_username")) {
        intShowChangeDepositFace($smarty, $_REQUEST["admin_username"]);
    } else {
        redirectToAdminList();
    }
}
function intChangeDeposit(&$smarty, $admin_username, $deposit, $deposit_comment)
{
    $req = new ChangeDeposit($admin_username, $deposit, $deposit_comment);
    $resp = $req->sendAndRecv();
    if ($resp->isSuccessful()) {
        $smarty->assign("change_successfull", TRUE);
    } else {
        $resp->setErrorInSmarty($smarty);
        intSetErrors($smarty, $resp->getError());
    }
    intShowChangeDepositFace($smarty, $admin_username);
}
function intShowChangeDepositFace(&$smarty, $admin_username)
{
    $smarty->assign("admin_username", $admin_username);
Ejemplo n.º 2
0
<?php

require_once "../../inc/init.php";
require_once IBSINC . "perm.php";
require_once IBSINC . "admin_face.php";
needAuthType(ADMIN_AUTH_TYPE);
if (isInRequest("admin_username", "category", "perm_name")) {
    intAddPerm();
} else {
    if (isInRequest("category", "admin_username")) {
        intShowPerms();
    } else {
        redirectToAdminList("show_perms: Invalid Request");
    }
}
function intAddPerm()
{
    $value = requestVal("value", "");
    $change_perm_req = new ChangePermission($_REQUEST["admin_username"], $_REQUEST["perm_name"], $value);
    list($success, $err) = $change_perm_req->send();
    if ($success) {
        intShowPerms(TRUE);
    } else {
        intShowPerms(FALSE, $err);
    }
}
function intShowPerms($add_success = FALSE, $err = null)
{
    $smarty = new IBSSmarty();
    intAssignValues($smarty, $add_success, $err);
    $smarty->display("admin/admins/show_perms.tpl");
Ejemplo n.º 3
0
<?php

require_once "../../inc/init.php";
require_once IBSINC . "admin_face.php";
needAuthType(ADMIN_AUTH_TYPE);
if (!isInRequest("admin_username")) {
    redirectToAdminList("show_perm_categories: no username given");
} else {
    intShowCategories();
}
function intShowCategories()
{
    $smarty = new IBSSmarty();
    $smarty->assign("admin_username", $_REQUEST["admin_username"]);
    $smarty->display("admin/admins/perm_category_select.tpl");
}
Ejemplo n.º 4
0
require_once IBSINC . "perm.php";
require_once IBSINC . "admin_face.php";
needAuthType(ADMIN_AUTH_TYPE);
if (isInRequest("admin_username", "template_name", "action")) {
    intHandleTemplateRequest($_REQUEST["admin_username"], $_REQUEST["template_name"], $_REQUEST["action"]);
} else {
    if (isInRequest("admin_username", "delete_perm", "delete_perm_val")) {
        intDelPermValue($_REQUEST["admin_username"], $_REQUEST["delete_perm"], $_REQUEST["delete_perm_val"]);
    } else {
        if (isInRequest("admin_username", "delete_perm")) {
            intDelPerm($_REQUEST["admin_username"], $_REQUEST["delete_perm"]);
        } else {
            if (isInRequest("admin_username")) {
                intShowAdminPerms($_REQUEST["admin_username"]);
            } else {
                redirectToAdminList("admin_perms_list: No username given");
            }
        }
    }
}
function intHandleTemplateRequest($admin_username, $template_name, $action)
{
    switch ($action) {
        case "save":
            intSavePermsToTemplate($admin_username, $template_name);
            break;
        case "load":
            intLoadTemplateToAdmin($admin_username, $template_name);
            break;
        case "delete":
            intDeleteTemplate($admin_username, $template_name);