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();
372 $oUser =
oxNew(
'oxuser' );
374 if ( $oUser->logout() ) {
382 if ( $this->
getParent()->isEnabledPrivateSales() ) {
406 if ( $blUserRegistered ===
true ) {
409 return $blUserRegistered;
426 return 'account_user';
453 $blActiveLogin = $this->
getParent()->isEnabledPrivateSales();
458 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'READ_AND_CONFIRM_TERMS',
false,
true );
476 $oUser =
oxNew(
'oxuser' );
480 $oUser->checkValues( $sUser, $sPassword, $sPassword2, $aInvAdress, $aDelAdress );
482 $iActState = $blActiveLogin ? 0 : 1;
486 $oUser->setPassword( $sPassword );
490 $iSubscriptionStatus = $oUser->getNewsSubscription()->getOptInStatus();
492 $oUser->createUser();
493 $oUser->load($oUser->getId());
494 $oUser->changeUserData( $oUser->oxuser__oxusername->value, $sPassword, $sPassword, $aInvAdress, $aDelAdress );
496 if ( $blActiveLogin ) {
498 $oUser->acceptTerms();
503 if ( $this->
getConfig()->getConfigParam(
'blInvitationsEnabled' ) && $sUserId && $sRecEmail ) {
505 $oUser->setCreditPointsForRegistrant( $sUserId, $sRecEmail );
510 if ( $blOptin && $iSubscriptionStatus == 1 ) {
512 $oUser->getNewsSubscription()->setOptInStatus(1);
513 $oUser->addToGroup(
'oxidnewsletter' );
514 $this->_blNewsSubscriptionStatus = 1;
516 $this->_blNewsSubscriptionStatus = $oUser->setNewsSubscription( $blOptin, $this->
getConfig()->getConfigParam(
'blOrderOptInEmail' ) );
519 $oUser->addToGroup(
'oxidnotyetordered' );
524 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay( $oEx,
false,
true );
527 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay( $oEx,
false,
true );
530 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay( $oEx,
false,
true );
541 $this->_blIsNewUser =
true;
543 $sAction =
'payment?new_user=1&success=1';
544 if ($this->_blNewsSubscriptionStatus !== null && !$this->_blNewsSubscriptionStatus) {
545 $sAction =
'payment?new_user=1&success=1&newslettererror=4';
559 if ( $this->createuser()!=
false && $this->_blIsNewUser ) {
560 if ( $this->_blNewsSubscriptionStatus === null || $this->_blNewsSubscriptionStatus ) {
561 return 'register?success=1';
563 return 'register?success=1&newslettererror=4';
586 if (!$this->
getSession()->checkSessionChallenge()) {
602 $sUserName = $oUser->oxuser__oxusername->value;
603 $sPassword = $sPassword2 = $oUser->oxuser__oxpassword->value;
606 $oUser->changeUserData( $sUserName, $sPassword, $sPassword2, $aInvAdress, $aDelAdress );
609 $blOptin = $oUser->getNewsSubscription()->getOptInStatus();
612 $blForceCheckOptIn = ( $aInvAdress[
'oxuser__oxusername'] !== null && $aInvAdress[
'oxuser__oxusername'] !== $sUserName );
613 $this->_blNewsSubscriptionStatus = $oUser->setNewsSubscription( $blOptin, $this->
getConfig()->getConfigParam(
'blOrderOptInEmail' ), $blForceCheckOptIn );
622 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay($oEx,
false,
true,
'input_not_all_fields');
634 if ( $sOrderRemark ) {
640 if ( $oBasket = $this->
getSession()->getBasket() ) {
641 $oBasket->onUpdate();
657 if ( is_array( $aDeladr ) ) {
659 if ( isset( $aDeladr[
'oxaddress__oxsal'] ) ) {
660 unset( $aDeladr[
'oxaddress__oxsal'] );
662 if ( !count( $aDeladr ) || implode(
'', $aDeladr ) ==
'' ) {
664 $aDelAdress = array();
679 $sLogoutLink = $oConfig->isSsl()? $oConfig->getShopSecureHomeUrl() : $oConfig->getShopHomeUrl();
680 $sLogoutLink .=
'cl='.$oConfig->getRequestParameter(
'cl').$this->getParent()->getDynUrlParams();
681 if ( $sParam = $oConfig->getRequestParameter(
'anid') ) {
682 $sLogoutLink .=
'&anid='.$sParam;
684 if ( $sParam = $oConfig->getRequestParameter(
'cnid') ) {
685 $sLogoutLink .=
'&cnid='.$sParam;
687 if ( $sParam = $oConfig->getRequestParameter(
'mnid') ) {
688 $sLogoutLink .=
'&mnid='.$sParam;
690 if ( $sParam = $oConfig->getRequestParameter(
'tpl') ) {
691 $sLogoutLink .=
'&tpl='.$sParam;
693 if ( $sParam = $oConfig->getRequestParameter(
'oxloadid') ) {
694 $sLogoutLink .=
'&oxloadid='.$sParam;
696 if ( $sParam = $oConfig->getRequestParameter(
'recommid') ) {
697 $sLogoutLink .=
'&recommid='.$sParam;
699 return $sLogoutLink.
'&fnc=logout';
711 $this->_iLoginStatus = $iStatus;
763 if ( !$blActiveLogin ) {
772 if ( $sOrderRemark ) {
789 $oxEMail =
oxNew(
'oxemail' );
790 if ( $blActiveLogin ) {
791 $oxEMail->sendRegisterConfirmEmail( $oUser );
793 $oxEMail->sendRegisterEmail( $oUser );