<?php

/************************************************************************
*
* TO CUSTOMIZE THE SIGNUP DON'T MODIFY THIS FILE,
* MODIFY INSTEAD THE FOLLOWING FILES:
*
* /modules/admin/views/Signup_0_ShowPackages.php
* /modules/admin/views/Signup_1_DomainNameForm.php
* /modules/admin/views/Signup_2_OrderForm.php
* /modules/admin/views/Signup_3_Validation.php
* /modules/admin/views/Signup_3b_PhoneVerification.php
* /modules/admin/views/Signup_4_CreateAccounts.php
* /modules/admin/views/Signup_5_ProcessBilling.php
* /modules/admin/views/Signup_6_Finish.php
* 
*
*************************************************************************/

// We will need this to determine certain validation routines for server plugins' validateCredentials() method.
define('NE_SIGNUP', true);

if (!isset($_REQUEST['step'])) {
    $_REQUEST['step'] = 0;
}

// paypal doesn't seem to decide on how to return to the merchant
if (    isset($_SERVER['REQUEST_URI'])
        && (    strpos($_SERVER['REQUEST_URI'], 'Access+Your+Subscription') !== false
                || strpos($_SERVER['REQUEST_URI'], 'Return+To+Merchant') !== false
                || strpos($_SERVER['REQUEST_URI'], 'merchant_return_link') !== false))
{
    $_REQUEST['step'] = 6;
    $_REQUEST['pass'] = 1;
}

switch ($_REQUEST['step'])
{
    case 0:
        if ((isset($_REQUEST['clienttype']) && $_REQUEST['clienttype'] > 0)
            || (isset($_REQUEST['package']) && $_REQUEST['package'] > 0))
        {
             $_GET['view'] = 'Signup_1_DomainNameForm';
        } else {
             $_GET['view'] = 'Signup_0_ShowPackages';
        }
        break;
    case 1:
        $_GET['view'] = 'Signup_1_DomainNameForm';
        break;
    case 2:
        $_GET['view'] = 'Signup_2_OrderForm';
        break;
    case 3:
        $_GET['view'] = 'Signup_3_Validation';
        break;
    case 4:
        $_GET['view'] = 'Signup_4_CreateAccounts';
        break;
    case 5:
        $_GET['view'] = 'Signup_5_ProcessBilling';
        break;
    case 6:
        $_GET['view'] = 'Signup_6_Finish';
        break;
    case 7:
        $_GET['view'] = 'Signup_3b_PhoneVerification';
        break;
}

$_GET['fuse'] = 'admin';

require 'newedge/front.php';
?>
