<?php
QUnit_Global::includeClass('Affiliate_Scripts_Views_AffiliateSignup');

class Affiliate_Scripts_Views_AffiliateSignupStandard extends Affiliate_Scripts_Views_AffiliateSignup
{

    //------------------------------------------------------------------------
    
    function Affiliate_Scripts_Views_AffiliateSignupStandard() {
        parent::Affiliate_Scripts_Views_AffiliateSignup();
    }
    
    //------------------------------------------------------------------------
    
    function process() {
        QUnit_Global::includeClass('QUnit_Countries');
        QUnit_Global::includeClass('QCore_Bl_Accounts');
        QUnit_Global::includeClass('QUnit_Messager');
        QUnit_Global::includeClass('QCore_Settings');
        QUnit_Global::includeClass('Affiliate_Scripts_Bl_SignupUserNew');
        
        $_POST['parentuserid'] = $_REQUEST['parentuserid'] = $_REQUEST['parentaffiliateid'];

		$settings = $this->getSettings();		
		// old signup form style
        //if ($settings['Aff_signup_automatic_form'] != '1')
        //	return $this->processStandard();
        
        if(!($this->accountId = $GLOBALS['Auth']->getAccountID()) && !($this->accountId = $_POST['aid'])) {
            QUnit_Messager::setErrorMessage(L_G_ACCOUNTNOTKNOWN);
        }
        
        if($_POST['commited'] == 'yes')
        {
            $signup = QUnit_Global::newObj('Affiliate_Scripts_Bl_SignupUserNew');
            if($signup->processSignup() == false) {
            } else {
                QUnit_Messager::setOkMessage(L_G_SUCCESS);
                $signup->redirect($signup->settings['Aff_affpostsignupurl']);
            }
        
        } else {
            if ($_REQUEST['pid'] == '') {
                $_REQUEST['pid'] = $this->checkCookie();
            }
        }
        
        $this->addTemplate();
    }

    //------------------------------------------------------------------------
       
    function addTemplate() {
    }
    
}
?>
