4 define(
'USER_LOGIN_SUCCESS', 1 );
5 define(
'USER_LOGIN_FAIL', 2 );
6 define(
'USER_LOGOUT', 3 );
78 $this->_blActiveLogin = $blActiveLogin;
104 if (!isset($blShow)) {
112 if ( $this->
getConfig()->getConfigParam(
'blInvitationsEnabled' ) ) {
159 if ( $this->
getParent()->isEnabledPrivateSales() ) {
162 $sClass = $this->
getParent()->getClassName();
165 if ( !$oUser && !in_array( $sClass, $this->_aAllowedClasses ) ) {
169 if ( $oUser && !$oUser->isTermsAccepted() && !in_array( $sClass, $this->_aAllowedClasses ) ) {
170 oxRegistry::getUtils()->redirect( $oConfig->getShopHomeURL() .
'cl=account&term=1',
false, 302 );
191 if ( $oUser->inGroup(
'oxidblocked' ) ) {
196 if ( $oUser->isLoadedFromCookie() && !
$myConfig->getConfigParam(
'blPerfNoBasketSaving' )) {
198 if ( $oBasket = $this->
getSession()->getBasket() ) {
200 $oBasket->onUpdate();
229 $oUser =
oxNew(
'oxuser' );
230 $oUser->login( $sUser, $sPassword, $sCookie );
234 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay( $oEx,
false,
true,
'',
false );
267 $oSession->regenerateSessionId();
273 if ( $oUser->inGroup(
'oxidblocked' ) ) {
281 if ( $oBasket = $oSession->getBasket() ) {
282 $oBasket->onUpdate();
299 if ( $this->
getParent()->isEnabledPrivateSales() && $blAgb !== null && ( $oUser = $this->
getUser() ) ) {
301 $oUser->acceptTerms();
306 if ( !$this->
isAdmin() && !$this->
getConfig()->getConfigParam(
'blPerfNoBasketSaving' )) {
309 if ( $oBasket = $this->
getSession()->getBasket() ) {
331 if ( $oUser = $this->
getUser() ) {
333 if ( $oUser->updateFbId() ) {
355 if ( ( $oBasket = $this->
getSession()->getBasket() ) ) {
356 $oBasket->resetUserInfo();
357 $oBasket->onUpdate();
374 $oUser =
oxNew(
'oxuser' );
376 if ( $oUser->logout() ) {
384 if ( $this->
getParent()->isEnabledPrivateSales() ) {
408 if ( $blUserRegistered ===
true ) {
411 return $blUserRegistered;
428 return 'account_user';
455 $blActiveLogin = $this->
getParent()->isEnabledPrivateSales();
460 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'READ_AND_CONFIRM_TERMS',
false,
true );
478 $oUser =
oxNew(
'oxuser' );
482 $oUser->checkValues( $sUser, $sPassword, $sPassword2, $aInvAdress, $aDelAdress );
484 $iActState = $blActiveLogin ? 0 : 1;
488 $oUser->setPassword( $sPassword );
492 $iSubscriptionStatus = $oUser->getNewsSubscription()->getOptInStatus();
494 $oUser->createUser();
495 $oUser->load($oUser->getId());
496 $oUser->changeUserData( $oUser->oxuser__oxusername->value, $sPassword, $sPassword, $aInvAdress, $aDelAdress );
498 if ( $blActiveLogin ) {
500 $oUser->acceptTerms();
505 if ( $this->
getConfig()->getConfigParam(
'blInvitationsEnabled' ) && $sUserId && $sRecEmail ) {
507 $oUser->setCreditPointsForRegistrant( $sUserId, $sRecEmail );
512 if ( $blOptin && $iSubscriptionStatus == 1 ) {
514 $oUser->getNewsSubscription()->setOptInStatus(1);
515 $oUser->addToGroup(
'oxidnewsletter' );
516 $this->_blNewsSubscriptionStatus = 1;
518 $this->_blNewsSubscriptionStatus = $oUser->setNewsSubscription( $blOptin, $this->
getConfig()->getConfigParam(
'blOrderOptInEmail' ) );
521 $oUser->addToGroup(
'oxidnotyetordered' );
526 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay( $oEx,
false,
true );
529 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay( $oEx,
false,
true );
532 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay( $oEx,
false,
true );
543 $this->_blIsNewUser =
true;
545 $sAction =
'payment?new_user=1&success=1';
546 if ($this->_blNewsSubscriptionStatus !== null && !$this->_blNewsSubscriptionStatus) {
547 $sAction =
'payment?new_user=1&success=1&newslettererror=4';
561 if ( $this->createuser()!=
false && $this->_blIsNewUser ) {
562 if ( $this->_blNewsSubscriptionStatus === null || $this->_blNewsSubscriptionStatus ) {
563 return 'register?success=1';
565 return 'register?success=1&newslettererror=4';
588 if (!$this->
getSession()->checkSessionChallenge()) {
604 $sUserName = $oUser->oxuser__oxusername->value;
605 $sPassword = $sPassword2 = $oUser->oxuser__oxpassword->value;
608 $oUser->changeUserData( $sUserName, $sPassword, $sPassword2, $aInvAdress, $aDelAdress );
611 $blOptin = $oUser->getNewsSubscription()->getOptInStatus();
614 $blForceCheckOptIn = ( $aInvAdress[
'oxuser__oxusername'] !== null && $aInvAdress[
'oxuser__oxusername'] !== $sUserName );
615 $this->_blNewsSubscriptionStatus = $oUser->setNewsSubscription( $blOptin, $this->
getConfig()->getConfigParam(
'blOrderOptInEmail' ), $blForceCheckOptIn );
624 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay($oEx,
false,
true,
'input_not_all_fields');
636 if ( $sOrderRemark ) {
642 if ( $oBasket = $this->
getSession()->getBasket() ) {
643 $oBasket->onUpdate();
659 if ( is_array( $aDeladr ) ) {
661 if ( isset( $aDeladr[
'oxaddress__oxsal'] ) ) {
662 unset( $aDeladr[
'oxaddress__oxsal'] );
664 if ( !count( $aDeladr ) || implode(
'', $aDeladr ) ==
'' ) {
666 $aDelAdress = array();
681 $sLogoutLink = $oConfig->isSsl()? $oConfig->getShopSecureHomeUrl() : $oConfig->getShopHomeUrl();
682 $sLogoutLink .=
'cl='.$oConfig->getRequestParameter(
'cl').$this->getParent()->getDynUrlParams();
683 if ( $sParam = $oConfig->getRequestParameter(
'anid') ) {
684 $sLogoutLink .=
'&anid='.$sParam;
686 if ( $sParam = $oConfig->getRequestParameter(
'cnid') ) {
687 $sLogoutLink .=
'&cnid='.$sParam;
689 if ( $sParam = $oConfig->getRequestParameter(
'mnid') ) {
690 $sLogoutLink .=
'&mnid='.$sParam;
692 if ( $sParam = $oConfig->getRequestParameter(
'tpl') ) {
693 $sLogoutLink .=
'&tpl='.$sParam;
695 if ( $sParam = $oConfig->getRequestParameter(
'oxloadid') ) {
696 $sLogoutLink .=
'&oxloadid='.$sParam;
698 if ( $sParam = $oConfig->getRequestParameter(
'recommid') ) {
699 $sLogoutLink .=
'&recommid='.$sParam;
701 return $sLogoutLink.
'&fnc=logout';
713 $this->_iLoginStatus = $iStatus;
765 if ( !$blActiveLogin ) {
774 if ( $sOrderRemark ) {
791 $oxEMail =
oxNew(
'oxemail' );
792 if ( $blActiveLogin ) {
793 $oxEMail->sendRegisterConfirmEmail( $oUser );
795 $oxEMail->sendRegisterEmail( $oUser );