function shipworks()
{
    // using output buffering to get around headers that magento is setting after we've started output
    ob_start();
    header("Content-Type: text/xml;charset=utf-8");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    // HTTP/1.1
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    // HTTP/1.0
    header("Pragma: no-cache");
    // Open the XML output and root
    writeXmlDeclaration();
    writeStartTag("ShipWorks", array("moduleVersion" => SHIPWORKS_MODULE_VERSION, "schemaVersion" => SHIPWORKS_SCHEMA_VERSION));
    // If the admin module is installed, we make use of it
    if (checkAdminLogin()) {
        $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
        switch (strtolower($action)) {
            case 'getmodule':
                Action_GetModule();
                break;
            case 'getstore':
                Action_GetStore();
                break;
            case 'getcount':
                Action_GetCount();
                break;
            case 'getorders':
                Action_GetOrders();
                break;
            case 'getstatuscodes':
                Action_GetStatusCodes();
                break;
            case 'updateorder':
                Action_UpdateOrder();
                break;
            case 'updatestatus':
                Action_UpdateStatus();
                break;
            case 'updateshipment':
                Action_UpdateShipment();
                break;
            default:
                outputError(20, "'{$action}' is not supported.");
        }
    }
    // Close the output
    writeCloseTag("ShipWorks");
    // end output
    ob_end_flush();
}
示例#2
0
} else {
    // If the admin module is installed, we make use of it
    if (checkAdminLogin()) {
        $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
        switch (strtolower($action)) {
            case 'getmodule':
                Action_GetModule();
                break;
            case 'getstore':
                Action_GetStore();
                break;
            case 'getcount':
                Action_GetCount();
                break;
            case 'getorders':
                Action_GetOrders();
                break;
            case 'getstatuscodes':
                Action_GetStatusCodes();
                break;
            case 'updateorder':
                Action_UpdateOrder();
                break;
            default:
                outputError(20, "'{$action}' is not supported.");
        }
    }
}
// Close the output
writeCloseTag("ShipWorks");
// Check to see if admin functions exist.  And if so, determine if the user