Example #1
0
function process_post()
{
    /* We switch according to the $_POST[action] variable, which is a hidden
     * submit formfield in each <form>. see html/add*.txt for more information.
     */
    switch ("{$_POST['action']}") {
        /*
         * Add new user. We wont touch that here. Let auth() handle that.
         */
        case "newuser":
            addNewUser();
            break;
            /*
             * Update to the about box in profiles.
             */
        /*
         * Update to the about box in profiles.
         */
        case "modprofile":
            modProfile();
            break;
            /*
             * Change password. We wont touch that here. Let auth() handle that.
             */
        /*
         * Change password. We wont touch that here. Let auth() handle that.
         */
        case "changepw":
            changePassword();
            break;
            /*
             * Change email.
             */
        /*
         * Change email.
         */
        case "changeemail":
            changeEmail();
            break;
            /*
             * Change can view preferences.
             */
        /*
         * Change can view preferences.
         */
        case "changecanpage":
            changeCanPrefs();
            break;
            /*
             * Update API Key
             */
        /*
         * Update API Key
         */
        case "update_api":
            global $MySelf;
            $api = new api($MySelf->getID());
            if ($_POST[deleteKey]) {
                // Delete api Key
                $api->deleteApiKey();
                makeNotice("Your API key has been delete from the database.", "notice", "API Key wipe success", "index.php?action=preferences");
            } else {
                // Update api key
                $api->setApiKey($_POST[apiID], $_POST[apiKey]);
                makeNotice("Your new API key has been stored.", "notice", "API Key update success", "index.php?action=preferences");
            }
            break;
            /*
             * Add a Rank
             */
        /*
         * Add a Rank
         */
        case "addnewrank":
            addRank();
            break;
            /*
             * Edit the ranks
             */
        /*
         * Edit the ranks
         */
        case "editranks":
            editRanks();
            break;
            /*
             * Change opt-in status.
             */
        /*
         * Change opt-in status.
         */
        case "optIn":
            toggleOptIn();
            break;
            /*
             * Change See Inoffical Runs Setting (sir)
             */
        /*
         * Change See Inoffical Runs Setting (sir)
         */
        case "sirchange":
            sirchange();
            break;
            /*
             * Submiting a template change form
             */
        /*
         * Submiting a template change form
         */
        case "editTemplate":
            editTemplate();
            break;
            /*
             * Change ore value.
             */
        /*
         * Change ore value.
         */
        case "changeore":
            changeOreValue();
            break;
            /*
             * Change ship value.
             */
        /*
         * Change ship value.
         */
        case "changeship":
            changeShipValue();
            break;
            /*
             * Delete pending payout request
             */
        /*
         * Delete pending payout request
         */
        case "deleteRequest":
            deletePayoutRequest();
            break;
            /*
             * Modify online time.
             */
        /*
         * Modify online time.
         */
        case "modonlinetime":
            modOnlineTime();
            break;
            /*
             * Modify site settings.
             */
        /*
         * Modify site settings.
         */
        case "configuration":
            modConfiguration();
            break;
            /*
             * Add an event to the DB
             */
        /*
         * Add an event to the DB
         */
        case "addevent":
            addEventToDB();
            break;
            /*
             * Request payout.
             */
        /*
         * Request payout.
         */
        case "requestPayout":
            requestPayout();
            break;
            /*
             * Transfer Money
             */
        /*
         * Transfer Money
         */
        case "transferMoney":
            transferMoney();
            break;
            /*
             * Do the payouts
             */
        /*
         * Do the payouts
         */
        case "payout":
            doPayout();
            break;
            /*
             * Create a new can in the Database.
             */
        /*
         * Create a new can in the Database.
         */
        case "addcan":
            addCanToDatabase();
            break;
            /*
             * Admin request to change a user.
             */
        /*
         * Admin request to change a user.
         */
        case "edituser":
            editUser();
            break;
            /*
             * AddRun
             * This adds a new run to the database.
             */
        /*
         * AddRun
         * This adds a new run to the database.
         */
        case "addrun":
            addRun();
            break;
            /*
             * Analog to AddRun, just for Hauls.
             */
        /*
         * Analog to AddRun, just for Hauls.
         */
        case "addhaul":
            addHaul();
            break;
            /*
             * Create a new transaction.
             */
        /*
         * Create a new transaction.
         */
        case "transaction":
            createTransaction();
            break;
            /*
             * Lotto stuff
             */
        /*
         * Lotto stuff
         */
        case "editLottoTickets":
            lotto_editCreditsInDB();
            break;
        case "createDrawing":
            lotto_createDrawing();
            break;
        case "lottoBuyCredits":
            lotto_buyTickets();
            break;
    }
}
Example #2
0
            break;
        case $_GET['delete']:
            $form->success("Deleted successfully");
            break;
    }
}
// Templates
if ($_GET['action'] == "list_templates") {
    displayAllTemplates();
} elseif ($_GET['action'] == "showTemplate") {
    displayTemplate();
} elseif ($_GET['action'] == "editTemplate") {
    if (isset($_POST['updateTemplate'])) {
        updateTemplate();
    } else {
        editTemplate();
    }
} elseif ($_GET['action'] == "addTemplate") {
    if (isset($_POST['insertTemplate'])) {
        insertTemplate();
    } else {
        addTemplate();
    }
} elseif ($_GET['action'] == "deleteTemplate") {
    deleteTemplate();
} elseif ($_GET['action'] == "list_checks") {
    displayAllChecks();
} elseif ($_GET['action'] == "showCheck") {
    displayCheck();
} elseif ($_GET['action'] == "editCheck") {
    if (isset($_POST['updateCheck'])) {
Example #3
0
function process_get()
{
    global $page;
    global $MySelf;
    $ajax = 0;
    switch ($_GET['action']) {
        // Maintenance!
        case "maintenance":
            $page = maintenance();
            break;
            // a specific run is requested.
        // a specific run is requested.
        case "show":
            $page = listRun();
            $ajax = 20;
            break;
            // a profile is requested.
        // a profile is requested.
        case "profile":
            $page = profile();
            break;
            // a profile change is requested.
        // a profile change is requested.
        case "modprofile":
            $page = modProfile();
            break;
            // Admin request to delete an api key (NOT user deleting own!)
        // Admin request to delete an api key (NOT user deleting own!)
        case "delapi":
            $page = deleteAPIKey();
            break;
            // Quick toggle of login capabilities.
        // Quick toggle of login capabilities.
        case "toggleLogin":
            $page = toggleLogin();
            break;
            // Quick confirm an account.
        // Quick confirm an account.
        case "quickconfirm":
            $page = quickConfirm();
            break;
            // Change of eMail requested
        // Change of eMail requested
        case "changeemail":
            $page = makeEmailChangeForm();
            break;
            // Show corp hierarchy
        // Show corp hierarchy
        case "hierarchy":
            $page = showHierarchy();
            break;
            // Browser solar Systems
        // Browser solar Systems
        case "browse":
            $page = browser();
            break;
            // User wants to delete a run.
        // User wants to delete a run.
        case "deleterun":
            deleteRun();
            break;
            // User wants to see the preferences page.
        // User wants to see the preferences page.
        case "preferences":
            $page = makePreferences();
            break;
            // A banker wants to see the transaction log for a user.
        // A banker wants to see the transaction log for a user.
        case "showTransactions":
            $page = showTransactions();
            break;
            // User wants to manage his cans.
        // User wants to manage his cans.
        case "cans":
            $page = makeCanPage();
            break;
            // Print out fancy global statistics
        // Print out fancy global statistics
        case "globstats":
            $page = globalStatistics();
            break;
            // User wants to re-validate his email.
        // User wants to re-validate his email.
        case "revalidate":
            validate();
            break;
            // User wants to pop a can.
        // User wants to pop a can.
        case "popcan":
            $page = popCan();
            break;
            // Kick a user.
        // Kick a user.
        case "kickban":
            $page = kick();
            break;
            // User wants to toggle the empty/full setting of a can.
        // User wants to toggle the empty/full setting of a can.
        case "togglecan":
            $page = toggleCan();
            break;
            // close a run.
        // close a run.
        case "endrun":
            endrun();
            break;
            // Show ore values
        // Show ore values
        case "showorevalue":
            $page = showOreValue();
            break;
            // Show ship values
        // Show ship values
        case "showshipvalue":
            $page = showShipValue();
            break;
            // Show Corp Hierarchy
        // Show Corp Hierarchy
        case "hier":
            $page = showHierarchy();
            break;
            // manage payouts
        // manage payouts
        case "payout":
            $page = payout();
            break;
            // set/view the online time
        // set/view the online time
        case "onlinetime":
            $page = onlineTime();
            break;
            // Mods a template
        // Mods a template
        case "edittemplate":
            $page = editTemplate();
            break;
            // Some Admin wants to change the ore values.
        // Some Admin wants to change the ore values.
        case "changeow":
            $page = makeOreWorth();
            break;
            // Some Admin wants to change the ore values.
        // Some Admin wants to change the ore values.
        case "changesv":
            $page = makeShipValue();
            break;
            // Password change request. We wont touch that.
        // Password change request. We wont touch that.
        case "changepw":
            $page = makePWChangeForm();
            break;
            // User wants to join the selected run.
        // User wants to join the selected run.
        case "joinrun":
            $page = joinRun();
            break;
            // User wants to part the selected run.
        // User wants to part the selected run.
        case "partrun":
            $page = leaveRun();
            break;
            // Password change request. We wont touch that.
        // Password change request. We wont touch that.
        case "lostpass":
            $page = makeLostPassForm();
            break;
            // Lotto: Create group
        // Lotto: Create group
        case "lotto_createGroup":
            $page = lotto_createGroup();
            break;
            // add ore from a haul to an open run.
        // add ore from a haul to an open run.
        case "addhaul":
            $page = addHaulPage();
            break;
            // Edit site configuration
        // Edit site configuration
        case "configuration":
            $page = configuration();
            break;
            // Add an event.
        // Add an event.
        case "addevent":
            $page = addEvent();
            break;
            // Show all events.
        // Show all events.
        case "showevents":
            $page = showEvents();
            break;
            // Join an Event
        // Join an Event
        case "joinevent":
            $page = joinEvent();
            break;
            // Show an event.
        // Show an event.
        case "showevent":
            $page = showEvent();
            break;
            // lists all ore runs.
        // lists all ore runs.
        case "list":
            $page = listRuns();
            $ajax = 60;
            break;
            // Manage wallet
        // Manage wallet
        case "manageWallet":
            $page = manageWallet();
            break;
            // Show current ranks
        // Show current ranks
        case "showranks":
            $page = showRanks();
            break;
            // delete a rank
        // delete a rank
        case "deleterank":
            $page = delRank();
            break;
            // delete an event from the database.
        // delete an event from the database.
        case "deleteevent":
            $page = deleteEvent();
            break;
            // lists all users.
        // lists all users.
        case "editusers":
            $page = listUsers();
            break;
            // lists one user.
        // lists one user.
        case "edituser":
            $page = listUser();
            break;
            // prints the form for a new run.
        // prints the form for a new run.
        case "newrun":
            $page = makeNewOreRunPage();
            break;
            // add a new user.
        // add a new user.
        case "newuser":
            $page = makeAddUserForm();
            break;
            // Toggle the charity flag.
        // Toggle the charity flag.
        case "toggleCharity":
            toggleCharity();
            break;
            /* Locking unlocking */
        /* Locking unlocking */
        case "lockrun":
            toggleLock();
            break;
            // prints the main welcome page.
        // prints the main welcome page.
        default:
            $page = makeWelcome();
            break;
            /* LOTTO STUFF */
        /* LOTTO STUFF */
        case "editLotto":
            $page = lotto_editLottery();
            break;
        case "lotto":
            $page = lotto_playLotto();
            break;
        case "claimTicket":
            lotto_claimTicket();
            break;
        case "drawLotto":
            lotto_draw();
            break;
        case "buycredits":
            $page = lotto_buyTickets();
            break;
        case "style":
            $page = style();
            break;
        case "getItemList":
            $page = getItemList();
            break;
        case "switch":
            $MySelf = null;
            $_SESSION['MySelf'] = null;
            unset($_SERVER[QUERY_STRING]);
            makeLoginPage($SUPPLIED_USERNAME);
            break;
    }
    if ($ajax > 1) {
        $ajaxHtml = "<script>window.setTimeout(function(){\$.ajax({";
        if (isset($_REQUEST['ajax'])) {
            $ajaxHtml .= "url: '?" . $_SERVER['QUERY_STRING'] . "',";
        } else {
            $ajaxHtml .= "url: '?" . $_SERVER['QUERY_STRING'] . "&ajax',";
        }
        $ajaxHtml .= "success: function(data) {\$('#content').html(data);}";
        $ajaxHtml .= "});},(" . $ajax * 1000 . "));</script>";
        $page .= $ajaxHtml;
    }
    if (isset($_REQUEST['ajax'])) {
        $html = new html();
        $page = $html->clean($page);
        print $page;
    } else {
        // Clean & Print the page.
        $html = new html();
        $html->addBody($page);
        print $html->flush();
    }
}