oxcmp_user.php

Go to the documentation of this file.
00001 <?php
00002 
00003 // defining login/logout states
00004 define( 'USER_LOGIN_SUCCESS', 1 );
00005 define( 'USER_LOGIN_FAIL', 2 );
00006 define( 'USER_LOGOUT', 3 );
00007 
00013 class oxcmp_user extends oxView
00014 {
00019     protected $_blIsNewUser    = false;
00020 
00025     protected $_blIsComponent = true;
00026 
00031     protected $_blNewsSubscriptionStatus = null;
00032 
00040     protected $_iLoginStatus = null;
00041 
00047     protected $_sTermsVer = null;
00048 
00054     protected $_aAllowedClasses = array(
00055                                         'register',
00056                                         'forgotpwd',
00057                                         'content',
00058                                         'account',
00059                                         );
00060 
00066     protected $_aRawBillingFields = array( 'oxuser__oxcompany', 'oxuser__oxaddinfo', 'oxuser__oxfname',
00067                                            'oxuser__oxlname', 'oxuser__oxstreet', 'oxuser__oxstreetnr',
00068                                            'oxuser__oxcity', 'oxuser__oxfon', 'oxuser__oxfax',
00069                                            'oxuser__oxmobfon', 'oxuser__oxprivfon' );
00070 
00076     protected $_aRawShippingFields = array( 'oxaddress__oxcompany', 'oxaddress__oxaddinfo', 'oxaddress__oxfname',
00077                                             'oxaddress__oxlname', 'oxaddress__oxcity', 'oxaddress__oxstreet',
00078                                             'oxaddress__oxstreetnr', 'oxaddress__oxzip', 'oxaddress__oxfon',
00079                                             'oxaddress__oxfax' );
00089     public function init()
00090     {
00091         // load session user
00092         $this->_loadSessionUser();
00093 
00094         if ( $this->getConfig()->getConfigParam( 'blInvitationsEnabled' ) ) {
00095             // get invitor ID
00096             $this->getInvitor();
00097         }
00098 
00099         parent::init();
00100     }
00101 
00114     public function render()
00115     {
00116         // checks if private sales allows further tasks
00117         $this->_checkPsState();
00118 
00119         parent::render();
00120 
00121         // dyn_group feature: if you specify a groupid in URL the user
00122         // will automatically be added to this group later
00123         if ( $sDynGoup = oxConfig::getParameter( 'dgr' ) ) {
00124             oxSession::setVar( 'dgr', $sDynGoup );
00125         }
00126 
00127         $oParentView = $this->getParent();
00128         if ( $aInvAdress = oxConfig::getParameter( 'invadr') ) {
00129             $oParentView->addTplParam( 'invadr', $aInvAdress );
00130         }
00131 
00132         if ( ( $aDelAdress = oxConfig::getParameter( 'deladr') ) && !oxConfig::getParameter( 'reloadaddress' ) ) {
00133                $oParentView->addTplParam( 'deladr', $aDelAdress );
00134         }
00135 
00136         if ( $sUser = oxConfig::getParameter( 'lgn_usr' ) ) {
00137             $oParentView->addTplParam( 'lgn_usr', $sUser );
00138         }
00139 
00140         return $this->getUser();
00141     }
00142 
00153     protected function _checkPsState()
00154     {
00155         $oConfig = $this->getConfig();
00156         if ( $this->getParent()->isEnabledPrivateSales() ) {
00157             // load session user
00158             $oUser  = $this->getUser();
00159             $sClass = $this->getParent()->getClassName();
00160 
00161             // no session user
00162             if ( !$oUser && !in_array( $sClass, $this->_aAllowedClasses ) ) {
00163                 oxUtils::getInstance()->redirect( $oConfig->getShopHomeURL() . 'cl=account', false );
00164             }
00165 
00166             if ( $oUser && !$oUser->isTermsAccepted() &&
00167                  $oConfig->getConfigParam( 'blConfirmAGB' ) &&
00168                  !in_array( $sClass, $this->_aAllowedClasses ) ) {
00169                 oxUtils::getInstance()->redirect( $oConfig->getShopHomeURL() . 'cl=account&term=1', false );
00170             }
00171         }
00172     }
00173 
00179     protected function _loadSessionUser()
00180     {
00181         $myConfig = $this->getConfig();
00182         $oUser = $this->getUser();
00183 
00184         // no session user
00185         if ( !$oUser ) {
00186             return;
00187         }
00188 
00189         // this user is blocked, deny him
00190         if ( $oUser->inGroup( 'oxidblocked' ) ) {
00191             oxUtils::getInstance()->redirect( $myConfig->getShopHomeURL() . 'cl=content&tpl=user_blocked.tpl' );
00192         }
00193 
00194         // TODO: move this to a proper place
00195         if ( $oUser->isLoadedFromCookie() ) {
00196 
00197             // #1678 R
00198             if ( !$myConfig->getConfigParam( 'blPerfNoBasketSaving' ) ) {
00199                 $myConfig->setGlobalParameter( 'blUserChanged', 1 );
00200             }
00201 
00202             if ( $oBasket = $this->getSession()->getBasket() ) {
00203                 $oBasket->onUpdate();
00204             }
00205         }
00206     }
00207 
00221     public function login()
00222     {
00223         $sUser     = oxConfig::getParameter( 'lgn_usr' );
00224         $sPassword = oxConfig::getParameter( 'lgn_pwd' );
00225         $sCookie   = oxConfig::getParameter( 'lgn_cook' );
00226         $sOpenId   = oxConfig::getParameter( 'lgn_openid' );
00227         //$blFbLogin = oxConfig::getParameter( 'fblogin' );
00228 
00229         $this->setLoginStatus( USER_LOGIN_FAIL );
00230 
00231         // trying to login user
00232         try {
00233             $oUser = oxNew( 'oxuser' );
00234             if ( $this->getViewConfig()->getShowOpenIdLogin() && $sOpenId ) {
00235                 $iOldErrorReproting = error_reporting();
00236                 error_reporting($iOldErrorReproting & ~E_STRICT);
00237                 $oOpenId = oxNew( "oxOpenID" );
00238                 $oOpenId->authenticateOid( $sOpenId, $this->_getReturnUrl() );
00239                 error_reporting($iOldErrorReproting);
00240             } else {
00241                 $oUser->login( $sUser, $sPassword, $sCookie );
00242             }
00243             $this->setLoginStatus( USER_LOGIN_SUCCESS );
00244         } catch ( oxUserException $oEx ) {
00245             // for login component send excpetion text to a custom component (if defined)
00246             oxUtilsView::getInstance()->addErrorToDisplay( $oEx, false, true );
00247             return 'user';
00248         } catch( oxCookieException $oEx ){
00249             oxUtilsView::getInstance()->addErrorToDisplay( $oEx );
00250             return 'user';
00251         }
00252         // finalizing ..
00253         return $this->_afterLogin( $oUser );
00254     }
00255 
00273     protected function _afterLogin( $oUser )
00274     {
00275         $myConfig = $this->getConfig();
00276 
00277         // this user is blocked, deny him
00278         if ( $oUser->inGroup( 'oxidblocked' ) ) {
00279             oxUtils::getInstance()->redirect( $myConfig->getShopHomeURL().'cl=content&tpl=user_blocked.tpl' );
00280         }
00281 
00282         // adding to dyn group
00283         $oUser->addDynGroup(oxSession::getVar( 'dgr' ), $myConfig->getConfigParam( 'aDeniedDynGroups' ));
00284 
00285         // recalc basket
00286         if ( $oBasket = $this->getSession()->getBasket() ) {
00287             $oBasket->onUpdate();
00288         }
00289 
00290         // #1678 R
00291         if ( !$myConfig->getConfigParam( 'blPerfNoBasketSaving' ) ) {
00292             $myConfig->setGlobalParameter( 'blUserChanged', 1);
00293         }
00294 
00295 
00296         return 'payment';
00297     }
00298 
00305     public function login_noredirect()
00306     {
00307         $blAgb = oxConfig::getParameter( 'ord_agb' );
00308         $oConfig = $this->getConfig();
00309         if ( $this->getParent()->isEnabledPrivateSales() && $blAgb !== null &&
00310              $oConfig->getConfigParam( 'blConfirmAGB' ) && ( $oUser = $this->getUser() ) ) {
00311             if ( $blAgb ) {
00312                 $oUser->acceptTerms();
00313             }
00314         } else {
00315             $this->login();
00316         }
00317     }
00318 
00325     public function login_updateFbId()
00326     {
00327         $this->login();
00328 
00329         if ( $oUser = $this->getUser() ) {
00330             //updating user Facebook ID
00331             if ( $oUser->updateFbId() ) {
00332                 oxSession::setVar( '_blFbUserIdUpdated', true );
00333             }
00334         }
00335     }
00336 
00345     protected function _afterLogout()
00346     {
00347         oxSession::deleteVar( 'paymentid' );
00348         oxSession::deleteVar( 'sShipSet' );
00349         oxSession::deleteVar( 'deladrid' );
00350         oxSession::deleteVar( 'dynvalue' );
00351 
00352         // resetting & recalc basket
00353         if ( ( $oBasket = $this->getSession()->getBasket() ) ) {
00354             $oBasket->resetUserInfo();
00355             $oBasket->onUpdate();
00356         }
00357     }
00358 
00367     public function logout()
00368     {
00369         $myConfig  = $this->getConfig();
00370         $oUser = oxNew( 'oxuser' );
00371 
00372         if ( $oUser->logout() ) {
00373 
00374             $this->setLoginStatus( USER_LOGOUT );
00375 
00376             // finalizing ..
00377             $this->_afterLogout();
00378 
00379 
00380             if ( $this->getParent()->isEnabledPrivateSales() ) {
00381                 return 'account';
00382             }
00383 
00384             // redirecting if user logs out in SSL mode
00385             if ( oxConfig::getParameter('redirect') && $myConfig->getConfigParam( 'sSSLShopURL' ) ) {
00386 
00387                 oxUtils::getInstance()->redirect( $this->_getLogoutLink());
00388             }
00389         }
00390     }
00391 
00401     public function changeUser( )
00402     {
00403         // checking if "open address area" button was clicked
00404         // or reloading form when delivery address was selected
00405         if ( $this->_setupDelAddress() ) {
00406             return;
00407         }
00408 
00409         $blUserRegistered = $this->_changeUser_noRedirect( );
00410 
00411         if ( $blUserRegistered === true ) {
00412             return 'payment';
00413         } else {
00414             return $blUserRegistered;
00415         }
00416     }
00417 
00423     public function changeuser_testvalues()
00424     {
00425         // skip updating user info if this is just form reload
00426         // on selecting delivery address
00427 
00428         $this->_changeUser_noRedirect();
00429     }
00430 
00452     public function createUser()
00453     {
00454         // checking if "open address area" button was clicked
00455         if ( $blSetup = $this->_setupDelAddress() ) {
00456             return;
00457         }
00458 
00459         $blActiveLogin = $this->getParent()->isEnabledPrivateSales();
00460 
00461         $myConfig = $this->getConfig();
00462         if ( $blActiveLogin && !oxConfig::getParameter( 'ord_agb' ) && $myConfig->getConfigParam( 'blConfirmAGB' ) ) {
00463             oxUtilsView::getInstance()->addErrorToDisplay( 'ORDER_READANDCONFIRMTERMS', false, true );
00464             return;
00465         }
00466 
00467         $myUtils  = oxUtils::getInstance();
00468 
00469         // collecting values to check
00470         $sUser = oxConfig::getParameter( 'lgn_usr' );
00471 
00472         // first pass
00473         $sPassword = oxConfig::getParameter( 'lgn_pwd' );
00474 
00475         // second pass
00476         $sPassword2 = oxConfig::getParameter( 'lgn_pwd2' );
00477 
00478         $aInvAdress = oxConfig::getParameter( 'invadr', $this->_aRawBillingFields );
00479         $aDelAdress = $this->_getDelAddressData();
00480 
00481         $oUser = oxNew( 'oxuser' );
00482 
00483         try {
00484 
00485             $oUser->checkValues( $sUser, $sPassword, $sPassword2, $aInvAdress, $aDelAdress );
00486 
00487             $iActState = $blActiveLogin ? 0 : 1;
00488 
00489             // setting values
00490             $oUser->oxuser__oxusername = new oxField($sUser, oxField::T_RAW);
00491             $oUser->setPassword( $sPassword );
00492             $oUser->oxuser__oxactive   = new oxField( $iActState, oxField::T_RAW);
00493 
00494             $oUser->createUser();
00495             $oUser->load( $oUser->getId() );
00496             $oUser->changeUserData( $oUser->oxuser__oxusername->value, $sPassword, $sPassword, $aInvAdress, $aDelAdress );
00497 
00498             if ( $blActiveLogin ) {
00499                 // accepting terms..
00500                 $oUser->acceptTerms();
00501             }
00502 
00503             if ( $this->getConfig()->getConfigParam( 'blInvitationsEnabled' ) && $sUserId = oxConfig::getParameter( "su" ) ) {
00504                 // setting registration credit points..
00505                 $oUser->setCreditPointsForRegistrant( $sUserId );
00506             }
00507 
00508             // assigning to newsletter
00509             $blOptin = oxConfig::getParameter( 'blnewssubscribed' );
00510             $this->_blNewsSubscriptionStatus = $oUser->setNewsSubscription( $blOptin, $this->getConfig()->getConfigParam( 'blOrderOptInEmail' ) );
00511 
00512             $oUser->addToGroup( 'oxidnotyetordered' );
00513             $oUser->addDynGroup( oxSession::getVar( 'dgr' ), $myConfig->getConfigParam( 'aDeniedDynGroups' ) );
00514             $oUser->logout();
00515 
00516         } catch ( oxUserException $oEx ) {
00517             oxUtilsView::getInstance()->addErrorToDisplay( $oEx, false, true );
00518             return false;
00519         } catch( oxInputException $oEx ){
00520             oxUtilsView::getInstance()->addErrorToDisplay( $oEx, false, true );
00521             return false;
00522         } catch( oxConnectionException $oEx ){
00523             oxUtilsView::getInstance()->addErrorToDisplay( $oEx, false, true );
00524             return false;
00525         }
00526 
00527         if ( !$blActiveLogin ) {
00528             if ( !$sPassword ) {
00529                 oxSession::setVar( 'usr', $oUser->getId() );
00530                 $this->_afterLogin( $oUser );
00531             } elseif ( $this->login() == 'user' ) {
00532                 return false;
00533             }
00534 
00535             // order remark
00536             //V #427: order remark for new users
00537             $sOrderRemark = oxConfig::getParameter( 'order_remark', true );
00538             if ( $sOrderRemark ) {
00539                 oxSession::setVar( 'ordrem', $sOrderRemark );
00540             }
00541         }
00542 
00543         // send register eMail
00544         //TODO: move into user
00545         if ( (int) oxConfig::getParameter( 'option' ) == 3 ) {
00546             $oxEMail = oxNew( 'oxemail' );
00547             if ( $blActiveLogin ) {
00548                 $oxEMail->sendRegisterConfirmEmail( $oUser );
00549             } else {
00550                 $oxEMail->sendRegisterEmail( $oUser );
00551             }
00552         }
00553 
00554         // new registered
00555         $this->_blIsNewUser = true;
00556 
00557         return 'payment';
00558     }
00559 
00565     public function registerUser()
00566     {
00567         // checking if "open address area" button was clicked
00568         if ( $blSetup = $this->_setupDelAddress() ) {
00569             return;
00570         }
00571 
00572         // registered new user ?
00573         if ( $this->createuser()!= false && $this->_blIsNewUser ) {
00574             if ( $this->_blNewsSubscriptionStatus === null || $this->_blNewsSubscriptionStatus ) {
00575                 return 'register?success=1';
00576             } else {
00577                 return 'register?success=1&newslettererror=4';
00578             }
00579         } else {
00580             // problems with registration ...
00581             $this->logout();
00582         }
00583     }
00584 
00598     protected function _changeUser_noRedirect( )
00599     {
00600         if (!$this->getSession()->checkSessionChallenge()) {
00601             return;
00602         }
00603 
00604         // no user ?
00605         $oUser = $this->getUser();
00606         if ( !$oUser ) {
00607             return;
00608         }
00609 
00610         // collecting values to check
00611         $aDelAdress = $this->_getDelAddressData();
00612 
00613         // if user company name, user name and additional info has special chars
00614         $aInvAdress = oxConfig::getParameter( 'invadr', $this->_aRawBillingFields );
00615 
00616         $sUserName  = $oUser->oxuser__oxusername->value;
00617         $sPassword  = $sPassword2 = $oUser->oxuser__oxpassword->value;
00618 
00619         try { // testing user input
00620             $oUser->changeUserData( $sUserName, $sPassword, $sPassword2, $aInvAdress, $aDelAdress );
00621             // assigning to newsletter
00622             if (($blOptin = oxConfig::getParameter( 'blnewssubscribed' )) === null) {
00623                 $blOptin = $oUser->getNewsSubscription()->getOptInStatus();
00624             }
00625             $this->_blNewsSubscriptionStatus = $oUser->setNewsSubscription( $blOptin, $this->getConfig()->getConfigParam( 'blOrderOptInEmail' ) );
00626 
00627         } catch ( oxUserException $oEx ) { // errors in input
00628             // marking error code
00629             //TODO
00630             oxUtilsView::getInstance()->addErrorToDisplay($oEx, false, true);
00631             return;
00632         } catch(oxInputException $oEx) {
00633             oxUtilsView::getInstance()->addErrorToDisplay($oEx, false, true);
00634             return;
00635         } catch(oxConnectionException $oEx){
00636              //connection to external resource broken, change message and pass to the view
00637             oxUtilsView::getInstance()->addErrorToDisplay($oEx, false, true);
00638             return;
00639         }
00640 
00641 
00642         // order remark
00643         $sOrderRemark = oxConfig::getParameter( 'order_remark', true );
00644         if ( $sOrderRemark ) {
00645             oxSession::setVar( 'ordrem', $sOrderRemark );
00646         }
00647 
00648         if ( $oBasket = $this->getSession()->getBasket() ) {
00649             $oBasket->onUpdate();
00650         }
00651         return true;
00652     }
00653 
00660     protected function _getDelAddressData()
00661     {
00662         // if user company name, user name and additional info has special chars
00663         $aDelAdress = $aDeladr = oxConfig::getParameter( 'deladr', $this->_aRawShippingFields );
00664 
00665         if ( is_array( $aDeladr ) ) {
00666             // checking if data is filled
00667             if ( isset( $aDeladr['oxaddress__oxsal'] ) ) {
00668                 unset( $aDeladr['oxaddress__oxsal'] );
00669             }
00670             if ( !count( $aDeladr ) || implode( '', $aDeladr ) == '' ) {
00671                 // resetting to avoid empty records
00672                 $aDelAdress = array();
00673             }
00674         }
00675         return $aDelAdress;
00676     }
00677 
00683     protected function _getLogoutLink()
00684     {
00685         $myConfig = $this->getConfig();
00686         $sLogoutLink = $myConfig->getShopSecureHomeUrl();
00687         if ( $myConfig->isSsl() ) {
00688             $sLogoutLink = $myConfig->getShopHomeUrl();
00689         }
00690         $sLogoutLink .= 'cl='.oxConfig::getParameter('cl').$this->getParent()->getDynUrlParams();
00691         if ( $sParam = oxConfig::getParameter('anid') ) {
00692             $sLogoutLink .= '&amp;anid='.$sParam;
00693         }
00694         if ( $sParam = oxConfig::getParameter('cnid') ) {
00695             $sLogoutLink .= '&amp;cnid='.$sParam;
00696         }
00697         if ( $sParam = oxConfig::getParameter('mnid') ) {
00698             $sLogoutLink .= '&amp;mnid='.$sParam;
00699         }
00700         if ( $sParam = oxConfig::getParameter('tpl') ) {
00701             $sLogoutLink .= '&amp;tpl='.$sParam;
00702         }
00703         return $sLogoutLink.'&amp;fnc=logout';
00704     }
00705 
00715     protected function _setupDelAddress()
00716     {
00717         $blShowIt = false;
00718         $blShowShipAddress = $blSessShowAddress = (int) oxSession::getVar( 'blshowshipaddress' );
00719 
00720         // user clicked on button to hide
00721         if ( $blHideAddress = oxConfig::getParameter( 'blhideshipaddress' ) ) {
00722             $blShowShipAddress = 0;
00723             $blShowIt = true;
00724         } else {
00725 
00726             $blShowAddress = oxConfig::getParameter( 'blshowshipaddress' )? 1 : 0;
00727             // user clicked on button to show
00728             if ( $blShowAddress != $blSessShowAddress ) {
00729                 $blShowShipAddress = 1;
00730                 $blShowIt = true;
00731             }
00732         }
00733 
00734         oxSession::setVar( 'blshowshipaddress', $blShowShipAddress );
00735         if ($this->getParent()) {
00736             $this->getParent()->addTplParam( 'blshowshipaddress', $blShowShipAddress );
00737         }
00738 
00739         return $blShowIt;
00740     }
00741 
00748     public function loginOid()
00749     {
00750         if (!$this->getViewConfig()->getShowOpenIdLogin()) {
00751             return;
00752         }
00753         $this->setLoginStatus( USER_LOGIN_FAIL );
00754 
00755         $iOldErrorReproting = error_reporting();
00756         //for 3rd part library disabling our E_STRICT error reporting
00757         error_reporting($iOldErrorReproting & ~E_STRICT);
00758         try {
00759             $oOpenId = $this->getOpenId();
00760             $aData = $oOpenId->getOidResponse( $this->_getReturnUrl() );
00761         } catch ( oxUserException $oEx ) {
00762             // for login component send excpetion text to a custom component (if defined)
00763             oxUtilsView::getInstance()->addErrorToDisplay( $oEx, false, true );
00764         }
00765         error_reporting($iOldErrorReproting);
00766         if ( count( $aData ) < 1 ) {
00767             oxUtils::getInstance()->redirect($this->getConfig()->getShopHomeURL().'cl=register');
00768         }
00769         if ( $aData['email'] ) {
00770             $oUser = oxNew( 'oxuser' );
00771             $oUser->oxuser__oxusername = new oxField($aData['email'], oxField::T_RAW);
00772 
00773             // if such user does not exist - creating it
00774             if ( !$oUser->exists() ) {
00775                 $oUser->oxuser__oxpassword = new oxField($oUser->getOpenIdPassword(), oxField::T_RAW);
00776                 $oUser->oxuser__oxactive   = new oxField(1, oxField::T_RAW);
00777                 $oUser->oxuser__oxrights   = new oxField('user', oxField::T_RAW);
00778                 $oUser->oxuser__oxshopid   = new oxField($this->getConfig()->getShopId(), oxField::T_RAW);
00779                 list ($sFName, $sLName)    = explode(' ', $aData['fullname']);
00780                 $oUser->oxuser__oxfname    = new oxField($sFName, oxField::T_RAW);
00781                 $oUser->oxuser__oxlname    = new oxField($sLName, oxField::T_RAW);
00782 
00783                 $oUser->oxuser__oxsal      = new oxField($this->_getUserTitle($aData['gender']), oxField::T_RAW);
00784                 $oUser->oxuser__oxisopenid = new oxField(1, oxField::T_RAW);
00785                 if ( $sCountryId = $oUser->getUserCountryId( $aData['country'] ) ) {
00786                     $oUser->oxuser__oxcountryid = new oxField( $sCountryId, oxField::T_RAW );
00787                 }
00788                 if ( $aData['postcode'] ) {
00789                     $oUser->oxuser__oxzip = new oxField( $aData['postcode'], oxField::T_RAW );
00790                 }
00791                 $oUser->save();
00792             } else {
00793                 $oUser->load( $oUser->getId() );
00794                 //if existing user loggins first time with openid
00795                 if ( $oUser->oxuser__oxisopenid->value == 0 ) {
00796                     if ( !$oUser->oxuser__oxpassword->value ) {
00797                         $oUser->oxuser__oxisopenid = new oxField(1, oxField::T_RAW);
00798                         $oUser->oxuser__oxpassword = new oxField($oUser->getOpenIdPassword(), oxField::T_RAW);
00799                     } else {
00800                         $oUser->oxuser__oxisopenid = new oxField(2, oxField::T_RAW);
00801                     }
00802                     $oUser->save();
00803                 }
00804             }
00805 
00806             try {
00807                 $oUser->openIdLogin( $oUser->oxuser__oxusername->value );
00808                 $this->setLoginStatus( USER_LOGIN_SUCCESS );
00809             } catch ( oxUserException $oEx ) {
00810                 // for login component send excpetion text to a custom component (if defined)
00811                 oxUtilsView::getInstance()->addErrorToDisplay( $oEx, false, true );
00812             }
00813 
00814             // finalizing ..
00815             $this->_afterLogin( $oUser );
00816             $this->getParent()->setFncName( null );
00817             oxUtils::getInstance()->redirect($this->getParent()->getLink());
00818         }
00819     }
00820 
00828     protected function _getUserTitle( $sGender )
00829     {
00830         if ( $sGender == "F" ) {
00831             return 'MRS';
00832         } else {
00833             return 'MR';
00834         }
00835     }
00836 
00842     protected function _getReturnUrl()
00843     {
00844         $this->getParent()->setFncName( 'loginOid' );
00845         $sReturnUrl = str_replace( '&amp;', '&', $this->getParent()->getLink() );
00846         if ( !strpos( $sReturnUrl, 'loginOid' ) ) {
00847             if ( strpos( $sReturnUrl, '?' ) ) {
00848                 $sReturnUrl = $sReturnUrl . "&fnc=loginOid";
00849             } else {
00850                 $sReturnUrl = $sReturnUrl . "?fnc=loginOid";
00851             }
00852         }
00853         return $sReturnUrl;
00854     }
00855 
00863     public function setLoginStatus( $iStatus )
00864     {
00865         $this->_iLoginStatus = $iStatus;
00866     }
00867 
00876     public function getLoginStatus()
00877     {
00878         return $this->_iLoginStatus;
00879     }
00880 
00886     public function getOpenId()
00887     {
00888         return oxNew( "oxOpenID" );
00889     }
00890 
00896     public function getInvitor()
00897     {
00898         $sSu = oxSession::getVar( 'su' );
00899         if ( !$sSu && ( $sSuNew = oxConfig::getParameter( 'su' ) ) ) {
00900             oxSession::setVar( 'su', $sSuNew );
00901         }
00902     }
00903 }