Example #1
0
if (!empty($_POST['bhconfig'])) {
    $newbhconfig = $_POST['bhconfig'];
    foreach ($newbhconfig as $newvar => $newval) {
        if ($newvar == "fileroot") {
            if (substr($newval, -1) == "/") {
                $newval = substr($newval, 0, -1);
            }
        }
        bh_changeconfig($newvar, $newval);
    }
    bh_loadconfig();
    bh_log($bhlang['notice:settings_saved'], "BH_NOTICE");
}
if (!empty($_GET['bhconfig'])) {
    $newbhconfig = $_GET['bhconfig'];
    foreach ($newbhconfig as $newvar => $newval) {
        if ($newvar == "fileroot") {
            if (substr($newval, -1) == "/") {
                $newval = substr($newval, 0, -1);
            }
        }
        bh_changeconfig($newvar, $newval);
    }
    bh_loadconfig();
    bh_log($bhlang['notice:settings_saved'], "BH_NOTICE");
}
$layoutobj = new bhadminlayout("settings");
$layoutobj->content1 = $bhconfig;
$layoutobj->title = $bhlang['title:settings'];
$layoutobj->display();
Example #2
0
            return;
        } else {
            $quota = round($user['quota'] * 1024 * 1024);
        }
    }
    # Update type & disabled
    update_bhdb("users", array("type" => $user['type'], "disabled" => $user['disabled'], "quota" => $quota), array("username" => $editusername));
    # If new password, update it
    if (!empty($user['pass1'])) {
        if ($user['pass1'] == $user['pass2']) {
            update_bhdb("users", array("password" => md5($user['pass1'])), array("username" => $editusername));
            bh_log($bhlang['notice:user_updated'], "BH_NOTICE");
            require "modules/users.inc.php";
        } else {
            bh_log($bhlang['error:passwords_dont_match'], "BH_ERROR");
        }
    } else {
        bh_log($bhlang['notice:user_updated'], "BH_NOTICE");
        require "modules/users.inc.php";
    }
} else {
    $userobj = new bhuser($editusername);
    $userobj->userinfo['type'] = $userobj->type;
    $userobj->userinfo['disabled'] = $userobj->disabled;
    $userobj->userinfo['quota'] = round($userobj->quota / (1024 * 1024), 2);
    $layout = new bhadminlayout("edituser");
    $layout->content1 = $editusername;
    $layout->content2 = $userobj->userinfo;
    $layout->title = $bhlang['title:editing_user_'] . $editusername;
    $layout->display();
}