4 define(
'USER_LOGIN_SUCCESS', 1);
5 define(
'USER_LOGIN_FAIL', 2);
6 define(
'USER_LOGOUT', 3);
112 if ($this->
getParent()->isEnabledPrivateSales()) {
115 $sClass = $this->
getParent()->getClassName();
118 if (!$oUser && !in_array($sClass, $this->_aAllowedClasses)) {
122 if ($oUser && !$oUser->isTermsAccepted() && !in_array($sClass, $this->_aAllowedClasses)) {
144 if ($oUser->inGroup(
'oxidblocked')) {
145 $sUrl =
$myConfig->getShopHomeURL() .
'cl=content&tpl=user_blocked.tpl';
150 if ($oUser->isLoadedFromCookie() && !
$myConfig->getConfigParam(
'blPerfNoBasketSaving')) {
152 if ($oBasket = $this->
getSession()->getBasket()) {
154 $oBasket->onUpdate();
184 $oUser =
oxNew(
'oxuser');
185 $oUser->login($sUser, $sPassword, $sCookie);
189 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay($oEx,
false,
true,
'',
false);
223 $oSession->regenerateSessionId();
229 if ($oUser->inGroup(
'oxidblocked')) {
230 $sUrl =
$myConfig->getShopHomeURL() .
'cl=content&tpl=user_blocked.tpl';
235 if ($oBasket = $oSession->getBasket()) {
236 $oBasket->onUpdate();
251 if ($this->
getParent()->isEnabledPrivateSales() && $blAgb !== null && ($oUser = $this->
getUser())) {
253 $oUser->acceptTerms();
258 if (!$this->
isAdmin() && !$this->
getConfig()->getConfigParam(
'blPerfNoBasketSaving')) {
261 if ($oBasket = $this->
getSession()->getBasket()) {
281 if ($oUser = $this->
getUser()) {
283 if ($oUser->updateFbId()) {
303 if (($oBasket = $this->
getSession()->getBasket())) {
304 $oBasket->resetUserInfo();
305 $oBasket->onUpdate();
320 $oUser =
oxNew(
'oxuser');
322 if ($oUser->logout()) {
330 if ($this->
getParent()->isEnabledPrivateSales()) {
354 if ($blUserRegistered ===
true) {
357 return $blUserRegistered;
374 return 'account_user';
400 $blActiveLogin = $this->
getParent()->isEnabledPrivateSales();
404 if ($blActiveLogin && !$oConfig->getRequestParameter(
'ord_agb') && $oConfig->getConfigParam(
'blConfirmAGB')) {
405 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'READ_AND_CONFIRM_TERMS',
false,
true);
411 $sUser = $oConfig->getRequestParameter(
'lgn_usr');
414 $sPassword = $oConfig->getRequestParameter(
'lgn_pwd',
true);
417 $sPassword2 = $oConfig->getRequestParameter(
'lgn_pwd2',
true);
419 $aInvAdress = $oConfig->getRequestParameter(
'invadr',
true);
423 $oUser =
oxNew(
'oxuser');
427 $oUser->checkValues($sUser, $sPassword, $sPassword2, $aInvAdress, $aDelAdress);
429 $iActState = $blActiveLogin ? 0 : 1;
433 $oUser->setPassword($sPassword);
437 $iSubscriptionStatus = $oUser->getNewsSubscription()->getOptInStatus();
439 $oUser->createUser();
440 $oUser->load($oUser->getId());
441 $oUser->changeUserData($oUser->oxuser__oxusername->value, $sPassword, $sPassword, $aInvAdress, $aDelAdress);
443 if ($blActiveLogin) {
445 $oUser->acceptTerms();
450 if ($this->
getConfig()->getConfigParam(
'blInvitationsEnabled') && $sUserId && $sRecEmail) {
452 $oUser->setCreditPointsForRegistrant($sUserId, $sRecEmail);
457 if ($blOptin && $iSubscriptionStatus == 1) {
461 $oUser->getNewsSubscription()->setOptInStatus(1);
462 $oUser->addToGroup(
'oxidnewsletter');
463 $this->_blNewsSubscriptionStatus = 1;
465 $blOrderOptInEmailParam = $this->
getConfig()->getConfigParam(
'blOrderOptInEmail');
466 $this->_blNewsSubscriptionStatus = $oUser->setNewsSubscription($blOptin, $blOrderOptInEmailParam);
469 $oUser->addToGroup(
'oxidnotyetordered');
486 if (!$blActiveLogin) {
503 $oxEMail =
oxNew(
'oxemail');
504 if ($blActiveLogin) {
505 $oxEMail->sendRegisterConfirmEmail($oUser);
507 $oxEMail->sendRegisterEmail($oUser);
512 $this->_blIsNewUser =
true;
514 $sAction =
'payment?new_user=1&success=1';
515 if ($this->_blNewsSubscriptionStatus !== null && !$this->_blNewsSubscriptionStatus) {
516 $sAction =
'payment?new_user=1&success=1&newslettererror=4';
530 if ($this->createuser() !=
false && $this->_blIsNewUser) {
531 if ($this->_blNewsSubscriptionStatus === null || $this->_blNewsSubscriptionStatus) {
532 return 'register?success=1';
534 return 'register?success=1&newslettererror=4';
547 if ($this->
getConfig()->getConfigParam(
'blInvitationsEnabled')) {
561 if (!isset($blShow)) {
562 $blShow = $oSession->getVariable(
'blshowshipaddress');
565 $oSession->setVariable(
'blshowshipaddress', $blShow);
583 if (!$this->
getSession()->checkSessionChallenge()) {
599 $sUserName = $oUser->oxuser__oxusername->value;
600 $sPassword = $sPassword2 = $oUser->oxuser__oxpassword->value;
603 $oUser->changeUserData($sUserName, $sPassword, $sPassword2, $aInvAdress, $aDelAdress);
606 $blOptin = $oUser->getNewsSubscription()->getOptInStatus();
609 $sBillingUsername = $aInvAdress[
'oxuser__oxusername'];
610 $blForceCheckOptIn = ($sBillingUsername !== null && $sBillingUsername !== $sUserName);
611 $blEmailParam = $this->
getConfig()->getConfigParam(
'blOrderOptInEmail');
612 $this->_blNewsSubscriptionStatus = $oUser->setNewsSubscription($blOptin, $blEmailParam, $blForceCheckOptIn);
622 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay($oEx,
false,
true,
'input_not_all_fields');
642 if ($oBasket = $this->
getSession()->getBasket()) {
643 $oBasket->onUpdate();
661 $aDeladr = ($blShowShipAddressParameter || $blShowShipAddressVariable) ? $sDeliveryAddressParameter : array();
662 $aDelAdress = $aDeladr;
664 if (is_array($aDeladr)) {
666 if (isset($aDeladr[
'oxaddress__oxsal'])) {
667 unset($aDeladr[
'oxaddress__oxsal']);
669 if (!count($aDeladr) || implode(
'', $aDeladr) ==
'') {
671 $aDelAdress = array();
687 $sLogoutLink = $oConfig->isSsl() ? $oConfig->getShopSecureHomeUrl() : $oConfig->getShopHomeUrl();
688 $sLogoutLink .=
'cl=' . $oConfig->getRequestParameter(
'cl') . $this->
getParent()->getDynUrlParams();
689 if ($sParam = $oConfig->getRequestParameter(
'anid')) {
690 $sLogoutLink .=
'&anid=' . $sParam;
692 if ($sParam = $oConfig->getRequestParameter(
'cnid')) {
693 $sLogoutLink .=
'&cnid=' . $sParam;
695 if ($sParam = $oConfig->getRequestParameter(
'mnid')) {
696 $sLogoutLink .=
'&mnid=' . $sParam;
698 if ($sParam = $oConfig->getRequestParameter(
'tpl')) {
699 $sLogoutLink .=
'&tpl=' . $sParam;
701 if ($sParam = $oConfig->getRequestParameter(
'oxloadid')) {
702 $sLogoutLink .=
'&oxloadid=' . $sParam;
704 if ($sParam = $oConfig->getRequestParameter(
'recommid')) {
705 $sLogoutLink .=
'&recommid=' . $sParam;
708 return $sLogoutLink .
'&fnc=logout';
718 $this->_iLoginStatus = $iStatus;