00001 <?php
00005 require oxConfig::getInstance()->getConfigParam( 'sCoreDir' ) . "/phpmailer/class.phpmailer.php";
00006
00007
00013 class oxEmail extends PHPMailer
00014 {
00020 public $SMTP_PORT = 25;
00021
00027 protected $_sForgotPwdTemplate = "email/html/forgotpwd.tpl";
00028
00034 protected $_sForgotPwdTemplatePlain = "email/plain/forgotpwd.tpl";
00035
00041 protected $_sNewsletterOptInTemplate = "email/html/newsletteroptin.tpl";
00042
00048 protected $_sNewsletterOptInTemplatePlain = "email/plain/newsletteroptin.tpl";
00049
00055 protected $_sSuggestTemplate = "email/html/suggest.tpl";
00056
00062 protected $_sSuggestTemplatePlain = "email/plain/suggest.tpl";
00063
00069 protected $_sInviteTemplate = "email/html/invite.tpl";
00070
00076 protected $_sInviteTemplatePlain = "email/plain/invite.tpl";
00077
00083 protected $_sSenedNowTemplate = "email/html/sendednow.tpl";
00084
00090 protected $_sSenedNowTemplatePlain = "email/plain/sendednow.tpl";
00091
00097 protected $_sWishListTemplate = "email/html/wishlist.tpl";
00098
00104 protected $_sWishListTemplatePlain = "email/plain/wishlist.tpl";
00105
00111 protected $_sRegisterTemplate = "email/html/register.tpl";
00112
00118 protected $_sRegisterTemplatePlain = "email/plain/register.tpl";
00119
00125 protected $_sReminderMailTemplate = "email/html/owner_reminder.tpl";
00126
00132 protected $_sOrderUserTemplate = "email/html/order_cust.tpl";
00133
00139 protected $_sOrderUserPlainTemplate = "email/plain/order_cust.tpl";
00140
00146 protected $_sOrderOwnerTemplate = "email/html/order_owner.tpl";
00147
00153 protected $_sOrderOwnerPlainTemplate = "email/plain/order_owner.tpl";
00154
00155
00156
00162 protected $_sOrderUserSubjectTemplate = "email/html/order_cust_subj.tpl";
00163
00169 protected $_sOrderOwnerSubjectTemplate = "email/html/order_owner_subj.tpl";
00170
00176 protected $_sOwnerPricealarmTemplate = "email/html/pricealarm_owner.tpl";
00177
00183 protected $_sPricealamrCustomerTemplate = "email_pricealarm_customer.tpl";
00184
00190 protected $_aShops = array();
00191
00197 protected $_blInlineImgEmail = null;
00198
00204 protected $_aRecipients = array();
00205
00211 protected $_aReplies = array();
00212
00218 protected $_aAttachments = array();
00219
00225 protected $_oSmarty = null;
00226
00232 protected $_aViewData = array();
00233
00239 protected $_oShop = null;
00240
00246 protected $_sCharSet = null;
00247
00251 public function __construct()
00252 {
00253
00254 parent::__construct( true );
00255
00256 $myConfig = $this->getConfig();
00257
00258 $this->_setMailerPluginDir();
00259 $this->setSmtp();
00260
00261 $this->setUseInlineImages( $myConfig->getConfigParam('blInlineImgEmail') );
00262 $this->setMailWordWrap( 100 );
00263
00264 $this->isHtml( true );
00265 $this->setLanguage( "en", $myConfig->getConfigParam( 'sShopDir' )."/core/phpmailer/language/");
00266
00267 $this->_getSmarty();
00268 }
00269
00281 public function __call( $sMethod, $aArgs )
00282 {
00283 if ( defined( 'OXID_PHP_UNIT' ) ) {
00284 if ( substr( $sMethod, 0, 4) == "UNIT" ) {
00285 $sMethod = str_replace( "UNIT", "_", $sMethod );
00286 }
00287 if ( method_exists( $this, $sMethod)) {
00288 return call_user_func_array( array( & $this, $sMethod ), $aArgs );
00289 }
00290 }
00291
00292 throw new oxSystemComponentException( "Function '$sMethod' does not exist or is not accessible! (" . get_class($this) . ")".PHP_EOL);
00293 }
00294
00300 public function getConfig()
00301 {
00302 if ( $this->_oConfig == null ) {
00303 $this->_oConfig = oxConfig::getInstance();
00304 }
00305
00306 return $this->_oConfig;
00307 }
00308
00316 public function setConfig( $oConfig )
00317 {
00318 $this->_oConfig = $oConfig;
00319 }
00320
00321
00327 protected function _getSmarty()
00328 {
00329 if ( $this->_oSmarty === null ) {
00330 $this->_oSmarty = oxUtilsView::getInstance()->getSmarty();
00331 }
00332
00333
00334 $this->_oSmarty->assign( "oEmailView", $this );
00335
00336 return $this->_oSmarty;
00337 }
00338
00346 public function send()
00347 {
00348
00349 if ( count( $this->getRecipient() ) < 1 ) {
00350 return false;
00351 }
00352
00353 $myConfig = $this->getConfig();
00354 $this->setCharSet();
00355
00356 if ( $this->_getUseInlineImages() ) {
00357 $this->_includeImages( $myConfig->getImageDir(), $myConfig->getImageUrl( false, false ), $myConfig->getPictureUrl(null, false),
00358 $myConfig->getImageDir(), $myConfig->getPictureDir(false));
00359 }
00360
00361 $this->_makeOutputProcessing();
00362
00363
00364 if ( $this->getMailer() == 'smtp' ) {
00365 $blRet = $this->_sendMail();
00366
00367
00368 if ( !$blRet ) {
00369
00370 $this->_sendMailErrorMsg();
00371
00372
00373 $this->setMailer( 'mail' );
00374 $blRet = $this->_sendMail();
00375 }
00376 } else {
00377
00378 $this->setMailer( 'mail' );
00379 $blRet = $this->_sendMail();
00380 }
00381
00382 if ( !$blRet ) {
00383
00384 $this->_sendMailErrorMsg();
00385 }
00386
00387 return $blRet;
00388 }
00389
00398 protected function _setSmtpProtocol($sUrl)
00399 {
00400 $sProtocol = '';
00401 $sSmtpHost = $sUrl;
00402 $aMatch = array();
00403 if ( getStr()->preg_match('@^([0-9a-z]+://)?(.*)$@i', $sUrl, $aMatch ) ) {
00404 if ($aMatch[1]) {
00405 if (($aMatch[1] == 'ssl://') || ($aMatch[1] == 'tls://')) {
00406 $this->set( "SMTPSecure", substr($aMatch[1], 0, 3) );
00407 } else {
00408 $sProtocol = $aMatch[1];
00409 }
00410 }
00411 $sSmtpHost = $aMatch[2];
00412 }
00413
00414 return $sProtocol.$sSmtpHost;
00415 }
00416
00424 public function setSmtp( $oShop = null )
00425 {
00426 $myConfig = $this->getConfig();
00427 $oShop = ( $oShop ) ? $oShop : $this->_getShop();
00428
00429 $sSmtpUrl = $this->_setSmtpProtocol($oShop->oxshops__oxsmtp->value);
00430
00431 if ( !$this->_isValidSmtpHost( $sSmtpUrl ) ) {
00432 $this->setMailer( "mail" );
00433 return;
00434 }
00435
00436 $this->setHost( $sSmtpUrl );
00437 $this->setMailer( "smtp" );
00438
00439 if ( $oShop->oxshops__oxsmtpuser->value ) {
00440 $this->_setSmtpAuthInfo( $oShop->oxshops__oxsmtpuser->value, $oShop->oxshops__oxsmtppwd->value );
00441 }
00442
00443 if ( $myConfig->getConfigParam( 'iDebug' ) == 6 ) {
00444 $this->_setSmtpDebug( true );
00445 }
00446 }
00447
00455 protected function _isValidSmtpHost( $sSmtpHost )
00456 {
00457 $blIsSmtp = false;
00458 if ( $sSmtpHost ) {
00459 $sSmtpPort = $this->SMTP_PORT;
00460 $aMatch = array();
00461 if ( getStr()->preg_match('@^(.*?)(:([0-9]+))?$@i', $sSmtpHost, $aMatch)) {
00462 $sSmtpHost = $aMatch[1];
00463 $sSmtpPort = (int)$aMatch[3];
00464 if (!$sSmtpPort) {
00465 $sSmtpPort = $this->SMTP_PORT;
00466 }
00467 }
00468 if ( $blIsSmtp = (bool) ( $rHandle = @fsockopen( $sSmtpHost, $sSmtpPort, $iErrNo, $sErrStr, 30 )) ) {
00469
00470 fclose( $rHandle );
00471 }
00472 }
00473
00474 return $blIsSmtp;
00475 }
00476
00486 public function sendOrderEmailToUser( $oOrder, $sSubject = null )
00487 {
00488 $myConfig = $this->getConfig();
00489
00490
00491 $oOrder = $this->_addUserInfoOrderEMail( $oOrder );
00492
00493 $oShop = $this->_getShop();
00494 $this->_setMailParams( $oShop );
00495
00496 $oUser = $oOrder->getOrderUser();
00497 $this->setUser( $oUser );
00498
00499
00500 $oSmarty = $this->_getSmarty();
00501 $this->setViewData( "order", $oOrder);
00502
00503
00504 $this->_processViewArray();
00505
00506 $this->setBody( $oSmarty->fetch( $this->_sOrderUserTemplate ) );
00507 $this->setAltBody( $oSmarty->fetch( $this->_sOrderUserPlainTemplate ) );
00508
00509
00510 if ( $sSubject === null ) {
00511 if ( $oSmarty->template_exists( $this->_sOrderUserSubjectTemplate) ) {
00512 $sSubject = $oSmarty->fetch( $this->_sOrderUserSubjectTemplate );
00513 } else {
00514 $sSubject = $oShop->oxshops__oxordersubject->getRawValue()." (#".$oOrder->oxorder__oxordernr->value.")";
00515 }
00516 }
00517
00518 $this->setSubject( $sSubject );
00519
00520 $sFullName = $oUser->oxuser__oxfname->getRawValue() . " " . $oUser->oxuser__oxlname->getRawValue();
00521
00522 $this->setRecipient( $oUser->oxuser__oxusername->value, $sFullName );
00523 $this->setReplyTo( $oShop->oxshops__oxorderemail->value, $oShop->oxshops__oxname->getRawValue() );
00524
00525 $blSuccess = $this->send();
00526
00527 return $blSuccess;
00528 }
00529
00539 public function sendOrderEmailToOwner( $oOrder, $sSubject = null )
00540 {
00541 $myConfig = $this->getConfig();
00542
00543 $oShop = $this->_getShop();
00544
00545
00546 $this->_clearMailer();
00547
00548
00549 $oOrder = $this->_addUserInfoOrderEMail( $oOrder );
00550
00551 $oUser = $oOrder->getOrderUser();
00552 $this->setUser( $oUser );
00553
00554
00555 $sFullName = $oUser->oxuser__oxfname->getRawValue() . " " . $oUser->oxuser__oxlname->getRawValue();
00556 $this->setFrom( $oUser->oxuser__oxusername->value, $sFullName );
00557
00558 $oLang = oxLang::getInstance();
00559 $iOrderLang = $oLang->getObjectTplLanguage();
00560
00561
00562
00563 if ( $oShop->getLanguage() != $iOrderLang ) {
00564 $oShop = $this->_getShop( $iOrderLang );
00565 }
00566
00567 $this->setSmtp( $oShop );
00568
00569
00570 $oSmarty = $this->_getSmarty();
00571 $this->setViewData( "order", $oOrder );
00572
00573
00574 $this->_processViewArray();
00575
00576 $this->setBody( $oSmarty->fetch( $myConfig->getTemplatePath( $this->_sOrderOwnerTemplate, false ) ) );
00577 $this->setAltBody( $oSmarty->fetch( $myConfig->getTemplatePath( $this->_sOrderOwnerPlainTemplate, false ) ) );
00578
00579
00580
00581 if ( $sSubject === null ) {
00582 if ( $oSmarty->template_exists( $this->_sOrderOwnerSubjectTemplate) ) {
00583 $sSubject = $oSmarty->fetch( $this->_sOrderOwnerSubjectTemplate );
00584 } else {
00585 $sSubject = $oShop->oxshops__oxordersubject->getRawValue()." (#".$oOrder->oxorder__oxordernr->value.")";
00586 }
00587 }
00588
00589 $this->setSubject( $sSubject );
00590 $this->setRecipient( $oShop->oxshops__oxowneremail->value, $oLang->translateString("order") );
00591
00592 if ( $oUser->oxuser__oxusername->value != "admin" )
00593 $this->setReplyTo( $oUser->oxuser__oxusername->value, $sFullName );
00594
00595 $blSuccess = $this->send();
00596
00597
00598 $oRemark = oxNew( "oxremark" );
00599 $oRemark->oxremark__oxtext = new oxField($this->getAltBody(), oxField::T_RAW);
00600 $oRemark->oxremark__oxparentid = new oxField($oUser->getId(), oxField::T_RAW);
00601 $oRemark->oxremark__oxtype = new oxField("o", oxField::T_RAW);
00602 $oRemark->save();
00603
00604
00605 if ( $myConfig->getConfigParam( 'iDebug' ) == 6) {
00606 oxUtils::getInstance()->showMessageAndExit( "" );
00607 }
00608
00609 return $blSuccess;
00610 }
00611
00621 public function sendRegisterConfirmEmail( $oUser, $sSubject = null )
00622 {
00623
00624
00625 $this->setViewData( "contentident", "oxregisteraltemail" );
00626 $this->setViewData( "contentplainident", "oxregisterplainaltemail" );
00627
00628
00629 return $this->sendRegisterEmail( $oUser, $sSubject );
00630 }
00631
00641 public function sendRegisterEmail( $oUser, $sSubject = null )
00642 {
00643
00644 $oUser = $this->_addUserRegisterEmail( $oUser );
00645
00646
00647 $oShop = $this->_getShop();
00648
00649
00650 $this->_setMailParams( $oShop );
00651
00652
00653 $oSmarty = $this->_getSmarty();
00654 $this->setUser( $oUser );
00655
00656
00657 $this->_processViewArray();
00658
00659 $this->setBody( $oSmarty->fetch( $this->_sRegisterTemplate ) );
00660 $this->setAltBody( $oSmarty->fetch( $this->_sRegisterTemplatePlain ) );
00661
00662 $this->setSubject( ( $sSubject !== null ) ? $sSubject : $oShop->oxshops__oxregistersubject->getRawValue() );
00663
00664 $sFullName = $oUser->oxuser__oxfname->getRawValue() . " " . $oUser->oxuser__oxlname->getRawValue();
00665
00666 $this->setRecipient( $oUser->oxuser__oxusername->value, $sFullName );
00667 $this->setReplyTo( $oShop->oxshops__oxorderemail->value, $oShop->oxshops__oxname->getRawValue() );
00668
00669 return $this->send();
00670 }
00671
00681 public function sendForgotPwdEmail( $sEmailAddress, $sSubject = null )
00682 {
00683 $myConfig = $this->getConfig();
00684 $oDb = oxDb::getDb();
00685
00686
00687 $oShop = $this->_getShop();
00688
00689
00690 $oShop = $this->_addForgotPwdEmail( $oShop );
00691
00692
00693 $this->_setMailParams( $oShop );
00694
00695
00696 $sWhere = "oxuser.oxactive = 1 and oxuser.oxusername = ".$oDb->quote( $sEmailAddress )." and oxuser.oxpassword != ''";
00697 $sOrder = "";
00698 if ( $myConfig->getConfigParam( 'blMallUsers' )) {
00699 $sOrder = "order by oxshopid = '".$oShop->getId()."' desc";
00700 } else {
00701 $sWhere .= " and oxshopid = '".$oShop->getId()."'";
00702 }
00703
00704 $sSelect = "select oxid from oxuser where $sWhere $sOrder";
00705 if ( ( $sOxId = $oDb->getOne( $sSelect ) ) ) {
00706
00707 $oUser = oxNew( 'oxuser' );
00708 if ( $oUser->load($sOxId) ) {
00709
00710 $oSmarty = $this->_getSmarty();
00711 $this->setUser( $oUser );
00712
00713
00714 $this->_processViewArray();
00715
00716 $this->setBody( $oSmarty->fetch( $this->_sForgotPwdTemplate ) );
00717
00718 $this->setAltBody( $oSmarty->fetch( $this->_sForgotPwdTemplatePlain ) );
00719
00720
00721 $this->setSubject( ( $sSubject !== null ) ? $sSubject : $oShop->oxshops__oxforgotpwdsubject->getRawValue() );
00722
00723 $sFullName = $oUser->oxuser__oxfname->getRawValue() . " " . $oUser->oxuser__oxlname->getRawValue();
00724
00725 $this->setRecipient( $sEmailAddress, $sFullName );
00726 $this->setReplyTo( $oShop->oxshops__oxorderemail->value, $oShop->oxshops__oxname->getRawValue() );
00727
00728 return $this->send();
00729 }
00730 }
00731
00732 return false;
00733 }
00734
00745 public function sendContactMail( $sEmailAddress = null, $sSubject = null, $sMessage = null )
00746 {
00747
00748
00749 $oShop = $this->_getShop();
00750
00751
00752 $this->_setMailParams( $oShop );
00753
00754 $this->setBody( $sMessage );
00755 $this->setSubject( $sSubject );
00756
00757 $this->setRecipient( $oShop->oxshops__oxinfoemail->value, "" );
00758 $this->setFrom( $sEmailAddress, "" );
00759 $this->setReplyTo( $sEmailAddress, "" );
00760
00761 return $this->send();
00762 }
00763
00773 public function sendNewsletterDbOptInMail( $oUser, $sSubject = null )
00774 {
00775 $oLang = oxLang::getInstance();
00776
00777
00778 $oUser = $this->_addNewsletterDbOptInMail( $oUser );
00779
00780
00781 $oShop = $this->_getShop();
00782
00783
00784 $this->_setMailParams( $oShop );
00785
00786
00787 $oSmarty = $this->_getSmarty();
00788 $this->setViewData( "subscribeLink", $this->_getNewsSubsLink($oUser->oxuser__oxid->value) );
00789 $this->setUser( $oUser );
00790
00791
00792 $this->_processViewArray();
00793
00794 $this->setBody( $oSmarty->fetch( $this->_sNewsletterOptInTemplate ) );
00795 $this->setAltBody( $oSmarty->fetch( $this->_sNewsletterOptInTemplatePlain ) );
00796 $this->setSubject( ( $sSubject !== null ) ? $sSubject : oxLang::getInstance()->translateString("EMAIL_NEWSLETTERDBOPTINMAIL_SUBJECT") . " " . $oShop->oxshops__oxname->getRawValue() );
00797
00798 $sFullName = $oUser->oxuser__oxfname->getRawValue() . " " . $oUser->oxuser__oxlname->getRawValue();
00799
00800 $this->setRecipient( $oUser->oxuser__oxusername->value, $sFullName );
00801 $this->setFrom( $oShop->oxshops__oxinfoemail->value, $oShop->oxshops__oxname->getRawValue() );
00802 $this->setReplyTo( $oShop->oxshops__oxinfoemail->value, $oShop->oxshops__oxname->getRawValue() );
00803
00804 return $this->send();
00805 }
00806
00814 protected function _getNewsSubsLink( $sId )
00815 {
00816 $myConfig = $this->getConfig();
00817 $iActShopLang = $myConfig->getActiveShop()->getLanguage();
00818
00819 $sUrl = $myConfig->getShopHomeURL().'cl=newsletter&fnc=addme&uid='.$sId;
00820 $sUrl.= ( $iActShopLang ) ? '&lang='.$iActShopLang : "";
00821 return $sUrl;
00822 }
00823
00834 public function sendNewsletterMail( $oNewsLetter, $oUser, $sSubject = null )
00835 {
00836
00837 $oShop = $this->_getShop();
00838
00839
00840 $this->_setMailParams( $oShop );
00841
00842 $sBody = $oNewsLetter->getHtmlText();
00843
00844 if ( !empty($sBody) ) {
00845 $this->setBody( $sBody );
00846 $this->setAltBody( $oNewsLetter->getPlainText() );
00847 } else {
00848 $this->isHtml( false );
00849 $this->setBody( $oNewsLetter->getPlainText() );
00850 }
00851
00852 $this->setSubject( ( $sSubject !== null ) ? $sSubject : $oNewsLetter->oxnewsletter__oxtitle->getRawValue() );
00853
00854 $sFullName = $oUser->oxuser__oxfname->getRawValue() . " " . $oUser->oxuser__oxlname->getRawValue();
00855 $this->setRecipient( $oUser->oxuser__oxusername->value, $sFullName );
00856 $this->setReplyTo( $oShop->oxshops__oxorderemail->value, $oShop->oxshops__oxname->getRawValue() );
00857
00858 return $this->send();
00859 }
00860
00870 public function sendSuggestMail( $oParams, $oProduct )
00871 {
00872 $myConfig = $this->getConfig();
00873
00874
00875 $iCurrLang = $myConfig->getActiveShop()->getLanguage();
00876
00877
00878 $oShop = $this->_getShop( $iCurrLang );
00879
00880
00881 if ( $oProduct->getLanguage() != $iCurrLang ) {
00882 $oProduct->setLanguage( $iCurrLang );
00883 $oProduct->load( $oProduct->getId() );
00884 }
00885
00886
00887 $this->setFrom( $oParams->send_email, $oParams->send_name );
00888 $this->setSMTP();
00889
00890
00891 $oSmarty = $this->_getSmarty();
00892 $this->setViewData( "product", $oProduct );
00893 $this->setUser( $oParams );
00894
00895 $sArticleUrl = $oProduct->getLink();
00896
00897
00898 if ( $myConfig->getActiveView()->isActive('Invitations') && $oActiveUser = $oShop->getUser() ) {
00899 $sArticleUrl = oxUtilsUrl::getInstance()->appendParamSeparator( $sArticleUrl );
00900 $sArticleUrl .= "su=" . $oActiveUser->getId();
00901 }
00902
00903 $this->setViewData( "sArticleUrl", $sArticleUrl );
00904
00905
00906 $this->_processViewArray();
00907
00908 $this->setBody( $oSmarty->fetch( $this->_sSuggestTemplate ) );
00909 $this->setAltBody( $oSmarty->fetch( $this->_sSuggestTemplatePlain ) );
00910 $this->setSubject( $oParams->send_subject );
00911
00912 $this->setRecipient( $oParams->rec_email, $oParams->rec_name );
00913 $this->setReplyTo( $oParams->send_email, $oParams->send_name );
00914
00915 return $this->send();
00916 }
00917
00926 public function sendInviteMail( $oParams )
00927 {
00928 $myConfig = $this->getConfig();
00929
00930
00931 $iCurrLang = $myConfig->getActiveShop()->getLanguage();
00932
00933
00934 $oShop = $this->_getShop( $iCurrLang );
00935
00936
00937 $this->setFrom( $oParams->send_email, $oParams->send_name );
00938 $this->setSMTP();
00939
00940
00941 $oSmarty = oxUtilsView::getInstance()->getSmarty();
00942 $this->setUser( $oParams );
00943
00944 $sHomeUrl = $this->getViewConfig()->getHomeLink();
00945
00946
00947 if ( $myConfig->getActiveView()->isActive('Invitations') && $oActiveUser = $oShop->getUser() ) {
00948 $sHomeUrl = oxUtilsUrl::getInstance()->appendParamSeparator( $sHomeUrl );
00949 $sHomeUrl .= "su=" . $oActiveUser->getId();
00950 }
00951
00952 $this->setViewData( "sHomeUrl", $sHomeUrl );
00953
00954
00955 $this->_processViewArray();
00956
00957 $this->setBody( $oSmarty->fetch( $this->_sInviteTemplate ) );
00958
00959 $this->setAltBody( $oSmarty->fetch( $this->_sInviteTemplatePlain ) );
00960 $this->setSubject( $oParams->send_subject );
00961
00962 if ( is_array($oParams->rec_email) && count($oParams->rec_email) > 0 ) {
00963 foreach ( $oParams->rec_email as $sEmail ) {
00964 if ( !empty( $sEmail ) ) {
00965 $this->setRecipient( $sEmail );
00966 $this->setReplyTo( $oParams->send_email, $oParams->send_name );
00967 $this->send();
00968 $this->clearAllRecipients();
00969 }
00970 }
00971
00972 return true;
00973 }
00974
00975 return false;
00976 }
00977
00987 public function sendSendedNowMail( $oOrder, $sSubject = null )
00988 {
00989 $myConfig = $this->getConfig();
00990
00991 $iOrderLang = (int) ( isset( $oOrder->oxorder__oxlang->value ) ? $oOrder->oxorder__oxlang->value : 0 );
00992
00993
00994 $oShop = $this->_getShop( $iOrderLang );
00995
00996
00997 $this->_setMailParams( $oShop );
00998
00999
01000 $oLang = oxLang::getInstance();
01001 $oSmarty = $this->_getSmarty();
01002 $this->setViewData( "order", $oOrder );
01003 $this->setViewData( "shopTemplateDir", $myConfig->getTemplateDir(false) );
01004
01005
01006 $oUser = oxNew( 'oxuser' );
01007 $this->setViewData( "reviewuserhash", $oUser->getReviewUserHash($oOrder->oxorder__oxuserid->value) );
01008
01009
01010 $this->_processViewArray();
01011
01012
01013 $aStore['INCLUDE_ANY'] = $oSmarty->security_settings['INCLUDE_ANY'];
01014
01015 $iOldTplLang = $oLang->getTplLanguage();
01016 $iOldBaseLang = $oLang->getTplLanguage();
01017 $oLang->setTplLanguage( $iOrderLang );
01018 $oLang->setBaseLanguage( $iOrderLang );
01019
01020 $oSmarty->security_settings['INCLUDE_ANY'] = true;
01021
01022 $myConfig->setAdminMode( false );
01023 $this->setBody( $oSmarty->fetch( $this->_sSenedNowTemplate ) );
01024 $this->setAltBody( $oSmarty->fetch( $this->_sSenedNowTemplatePlain ) );
01025 $myConfig->setAdminMode( true );
01026 $oLang->setTplLanguage( $iOldTplLang );
01027 $oLang->setBaseLanguage( $iOldBaseLang );
01028
01029 $oSmarty->security_settings['INCLUDE_ANY'] = $aStore['INCLUDE_ANY'] ;
01030
01031
01032 $this->setSubject( ( $sSubject !== null ) ? $sSubject : $oShop->oxshops__oxsendednowsubject->getRawValue() );
01033
01034 $sFullName = $oOrder->oxorder__oxbillfname->getRawValue() . " " . $oOrder->oxorder__oxbilllname->getRawValue();
01035
01036 $this->setRecipient( $oOrder->oxorder__oxbillemail->value, $sFullName );
01037 $this->setReplyTo( $oShop->oxshops__oxorderemail->value, $oShop->oxshops__oxname->getRawValue() );
01038
01039 return $this->send();
01040 }
01041
01056 public function sendBackupMail( $aAttFiles, $sAttPath, $sEmailAddress, $sSubject, $sMessage, &$aStatus, &$aError )
01057 {
01058
01059 $oShop = $this->_getShop();
01060
01061
01062 $this->_setMailParams( $oShop );
01063
01064 $this->setBody( $sMessage );
01065 $this->setSubject( $sSubject );
01066
01067 $this->setRecipient( $oShop->oxshops__oxinfoemail->value, "" );
01068 $sEmailAddress = $sEmailAddress ? $sEmailAddress : $oShop->oxshops__oxowneremail->value;
01069
01070 $this->setFrom( $sEmailAddress, "" );
01071 $this->setReplyTo( $sEmailAddress, "" );
01072
01073
01074 $blAttashSucc = true;
01075 $sAttPath = oxUtilsFile::getInstance()->normalizeDir($sAttPath);
01076 foreach ( $aAttFiles as $iNum => $sAttFile ) {
01077 if ( file_exists($sAttPath . $sAttFile) && is_file($sAttPath . $sAttFile) ) {
01078 $blAttashSucc = $this->addAttachment( $sAttPath, $sAttFile );
01079 } else {
01080 $blAttashSucc = false;
01081 $aError[] = array( 5, $sAttFile );
01082 }
01083 }
01084
01085 if ( !$blAttashSucc ) {
01086 $aError[] = array( 4, "" );
01087 $this->clearAttachments();
01088 return false;
01089 }
01090
01091 $aStatus[] = 3;
01092 $blSend = $this->send();
01093 $this->clearAttachments();
01094
01095 return $blSend;
01096 }
01097
01108 public function sendEmail( $sTo, $sSubject, $sBody )
01109 {
01110
01111 $this->_setMailParams();
01112
01113 if ( is_array($sTo) ) {
01114 foreach ($sTo as $sAddress) {
01115 $this->setRecipient( $sAddress, "" );
01116 $this->setReplyTo( $sAddress, "" );
01117 }
01118 } else {
01119 $this->setRecipient( $sTo, "" );
01120 $this->setReplyTo( $sTo, "" );
01121 }
01122
01123
01124 $this->isHtml( false );
01125
01126 $this->setSubject( $sSubject );
01127 $this->setBody( $sBody );
01128
01129 return $this->send();
01130 }
01131
01140 public function sendStockReminder( $aBasketContents, $sSubject = null )
01141 {
01142 $blSend = false;
01143
01144 $oArticleList = oxNew( "oxarticlelist" );
01145 $oArticleList->loadStockRemindProducts( $aBasketContents );
01146
01147
01148 if ( $oArticleList->count() ) {
01149 $oShop = $this->_getShop();
01150
01151
01152 $this->_setMailParams( $oShop );
01153 $oLang = oxLang::getInstance();
01154
01155 $oSmarty = $this->_getSmarty();
01156 $this->setViewData( "articles", $oArticleList );
01157
01158
01159 $this->_processViewArray();
01160
01161 $this->setRecipient( $oShop->oxshops__oxowneremail->value, $oShop->oxshops__oxname->getRawValue() );
01162 $this->setFrom( $oShop->oxshops__oxowneremail->value, $oShop->oxshops__oxname->getRawValue() );
01163 $this->setBody( $oSmarty->fetch( $this->getConfig()->getTemplatePath( $this->_sReminderMailTemplate, false ) ) );
01164 $this->setAltBody( "" );
01165 $this->setSubject( ( $sSubject !== null ) ? $sSubject : $oLang->translateString( 'EMAIL_STOCKREMINDER_SUBJECT' ) );
01166
01167 $blSend = $this->send();
01168 }
01169
01170 return $blSend;
01171 }
01172
01181 public function sendWishlistMail( $oParams )
01182 {
01183 $myConfig = $this->getConfig();
01184
01185 $this->_clearMailer();
01186
01187
01188 $oShop = $this->_getShop();
01189
01190
01191 $this->setFrom( $oParams->send_email, $oParams->send_name );
01192 $this->setSMTP();
01193
01194
01195 $oSmarty = $this->_getSmarty();
01196 $this->setUser( $oParams );
01197
01198
01199 $this->_processViewArray();
01200
01201 $this->setBody( $oSmarty->fetch( $this->_sWishListTemplate ) );
01202 $this->setAltBody( $oSmarty->fetch( $this->_sWishListTemplatePlain ) );
01203 $this->setSubject( $oParams->send_subject );
01204
01205 $this->setRecipient( $oParams->rec_email, $oParams->rec_name );
01206 $this->setReplyTo( $oParams->send_email, $oParams->send_name );
01207
01208 return $this->send();
01209 }
01210
01221 public function sendPriceAlarmNotification( $aParams, $oAlarm, $sSubject = null )
01222 {
01223 $this->_clearMailer();
01224 $oShop = $this->_getShop();
01225
01226
01227 $this->_setMailParams( $oShop );
01228
01229 $iAlarmLang = $oAlarm->oxpricealarm__oxlang->value;
01230
01231 $oArticle = oxNew( "oxarticle" );
01232 $oArticle->setSkipAbPrice( true );
01233 $oArticle->loadInLang( $iAlarmLang, $aParams['aid'] );
01234 $oLang = oxLang::getInstance();
01235
01236
01237 $oSmarty = $this->_getSmarty();
01238 $this->setViewData( "product", $oArticle );
01239 $this->setViewData( "email", $aParams['email']);
01240 $this->setViewData( "bidprice", $oLang->formatCurrency( $oAlarm->oxpricealarm__oxprice->value, $oCur ) );
01241
01242
01243 $this->_processViewArray();
01244
01245 $this->setRecipient( $oShop->oxshops__oxorderemail->value, $oShop->oxshops__oxname->getRawValue() );
01246 $this->setSubject( ( $sSubject !== null ) ? $sSubject : $oLang->translateString( 'EMAIL_PRICEALARM_OWNER_SUBJECT', $iAlarmLang ) . " " . $oArticle->oxarticles__oxtitle->getRawValue() );
01247 $this->setBody( $oSmarty->fetch( $this->_sOwnerPricealarmTemplate ) );
01248 $this->setFrom( $aParams['email'], "" );
01249 $this->setReplyTo( $aParams['email'], "" );
01250
01251 return $this->send();
01252 }
01253
01265 public function sendPricealarmToCustomer( $sRecipient, $oAlarm, $sBody = null, $sReturnMailBody = null )
01266 {
01267 $this->_clearMailer();
01268
01269 $oShop = $this->_getShop();
01270
01271 if ( $oShop->getId() != $oAlarm->oxpricealarm__oxshopid->value) {
01272 $oShop = oxNew( "oxshop" );
01273 $oShop->load( $oAlarm->oxpricealarm__oxshopid->value);
01274 $this->setShop( $oShop );
01275 }
01276
01277
01278 $this->_setMailParams( $oShop );
01279
01280
01281 $oSmarty = $this->_getSmarty();
01282
01283 $this->setViewData( "product", $oAlarm->getArticle() );
01284 $this->setViewData( "oPriceAlarm", $oAlarm );
01285 $this->setViewData( "bidprice", $oAlarm->getFProposedPrice() );
01286 $this->setViewData( "currency", $oAlarm->getPriceAlarmCurrency() );
01287
01288
01289 $this->_processViewArray();
01290
01291 $this->setRecipient( $sRecipient, $sRecipient );
01292 $this->setSubject( $oShop->oxshops__oxname->value );
01293
01294 if ( $sBody === null ) {
01295 $sBody = $oSmarty->fetch( $this->_sPricealamrCustomerTemplate );
01296 }
01297
01298 $this->setBody( $sBody );
01299
01300 $this->addAddress( $sRecipient, $sRecipient );
01301 $this->setReplyTo( $oShop->oxshops__oxorderemail->value, $oShop->oxshops__oxname->getRawValue() );
01302
01303 if ( $sReturnMailBody ) {
01304 return $this->getBody();
01305 } else {
01306 return $this->send();
01307 }
01308 }
01309
01321 protected function _includeImages($sImageDir = null, $sImageDirNoSSL = null, $sDynImageDir = null, $sAbsImageDir = null, $sAbsDynImageDir = null)
01322 {
01323 $sBody = $this->getBody();
01324 if (preg_match_all('/<\s*img\s+[^>]*?src[\s]*=[\s]*[\'"]?([^[\'">]]+|.*?)?[\'">]/i', $sBody, $matches, PREG_SET_ORDER)) {
01325
01326 $oFileUtils = oxUtilsFile::getInstance();
01327 $blReSetBody = false;
01328
01329
01330 $sDynImageDir = $oFileUtils->normalizeDir( $sDynImageDir );
01331 $sImageDir = $oFileUtils->normalizeDir( $sImageDir );
01332 $sImageDirNoSSL = $oFileUtils->normalizeDir( $sImageDirNoSSL );
01333
01334 if (is_array($matches) && count($matches)) {
01335 $aImageCache = array();
01336 $myUtils = oxUtils::getInstance();
01337 $myUtilsObject = oxUtilsObject::getInstance();
01338 $oImgGenerator = oxNew( "oxDynImgGenerator" );
01339
01340 foreach ($matches as $aImage) {
01341
01342 $image = $aImage[1];
01343 $sFileName = '';
01344 if ( strpos( $image, $sDynImageDir ) === 0 ) {
01345 $sFileName = $oFileUtils->normalizeDir( $sAbsDynImageDir ) . str_replace( $sDynImageDir, '', $image );
01346 } elseif ( strpos( $image, $sImageDir ) === 0 ) {
01347 $sFileName = $oFileUtils->normalizeDir( $sAbsImageDir ) . str_replace( $sImageDir, '', $image );
01348 } elseif ( strpos( $image, $sImageDirNoSSL ) === 0 ) {
01349 $sFileName = $oFileUtils->normalizeDir( $sAbsImageDir ) . str_replace( $sImageDirNoSSL, '', $image );
01350 }
01351
01352 if ( $sFileName && !@is_readable( $sFileName ) ) {
01353 $sFileName = $oImgGenerator->getImagePath( $sFileName );
01354 }
01355
01356 if ( $sFileName ) {
01357 $sCId = '';
01358 if ( isset( $aImageCache[$sFileName] ) && $aImageCache[$sFileName] ) {
01359 $sCId = $aImageCache[$sFileName];
01360 } else {
01361 $sCId = $myUtilsObject->generateUID();
01362 $sMIME = $myUtils->oxMimeContentType($sFileName);
01363 if ($sMIME == 'image/jpeg' || $sMIME == 'image/gif' || $sMIME == 'image/png') {
01364 if ( $this->addEmbeddedImage( $sFileName, $sCId, "image", "base64", $sMIME ) ) {
01365 $aImageCache[$sFileName] = $sCId;
01366 } else {
01367 $sCId = '';
01368 }
01369 }
01370 }
01371 if ( $sCId && $sCId == $aImageCache[$sFileName] ) {
01372 if ( $sReplTag = str_replace( $image, 'cid:'.$sCId, $aImage[0] ) ) {
01373 $sBody = str_replace($aImage[0], $sReplTag, $sBody );
01374 $blReSetBody = true;
01375 }
01376 }
01377 }
01378 }
01379 }
01380
01381 if ( $blReSetBody ) {
01382 $this->setBody( $sBody );
01383 }
01384 }
01385 }
01386
01394 public function setSubject( $sSubject = null )
01395 {
01396
01397 $sSubject = str_replace(array('&', '"', ''', '<', '>'), array('&', '"', "'", '<', '>' ), $sSubject);
01398
01399 $this->set( "Subject", $sSubject );
01400 }
01401
01407 public function getSubject()
01408 {
01409 return $this->Subject;
01410 }
01411
01421 public function setBody( $sBody = null, $blClearSid = true )
01422 {
01423 if ( $blClearSid ) {
01424 $sBody = getStr()->preg_replace('/((\?|&(amp;)?)(force_)?(admin_)?)sid=[A-Z0-9\.]+/i', '\1sid=x&shp=' . $this->getConfig()->getShopId(), $sBody);
01425 }
01426
01427 $this->set( "Body", $sBody );
01428 }
01429
01435 public function getBody()
01436 {
01437 return $this->Body;
01438 }
01439
01449 public function setAltBody( $sAltBody = null, $blClearSid = true )
01450 {
01451 if ( $blClearSid ) {
01452 $sAltBody = getStr()->preg_replace('/((\?|&(amp;)?)(force_)?(admin_)?)sid=[A-Z0-9\.]+/i', '\1sid=x&shp=' . $this->getConfig()->getShopId(), $sAltBody);
01453 }
01454
01455
01456 $sAltBody = str_replace(array('&', '"', ''', '<', '>'), array('&', '"', "'", '<', '>' ), $sAltBody);
01457
01458 $this->set( "AltBody", $sAltBody );
01459 }
01460
01466 public function getAltBody()
01467 {
01468 return $this->AltBody;
01469 }
01470
01479 public function setRecipient( $sAddress = null, $sName = null )
01480 {
01481 try {
01482 parent::AddAddress( $sAddress, $sName );
01483
01484
01485 $this->_aRecipients[] = array( $sAddress, $sName );
01486 } catch( Exception $oEx ) {
01487 }
01488 }
01489
01497 public function getRecipient()
01498 {
01499 return $this->_aRecipients;
01500 }
01501
01508 public function clearAllRecipients()
01509 {
01510 $this->_aRecipients = array();
01511 parent::clearAllRecipients();
01512 }
01513
01525 public function setReplyTo( $sEmail = null, $sName = null )
01526 {
01527 if ( !oxUtils::getInstance()->isValidEmail( $sEmail ) ) {
01528 $sEmail = $this->_getShop()->oxshops__oxorderemail->value;
01529 }
01530
01531 $this->_aReplies[] = array( $sEmail, $sName );
01532
01533 try {
01534 parent::addReplyTo( $sEmail, $sName );
01535 } catch( Exception $oEx ) {
01536 }
01537 }
01538
01544 public function getReplyTo()
01545 {
01546 return $this->_aReplies;
01547 }
01548
01554 public function clearReplyTos()
01555 {
01556 $this->_aReplies = array();
01557 parent::clearReplyTos();
01558 }
01559
01568 public function setFrom( $sFromAdress, $sFromName = null )
01569 {
01570
01571
01572
01573 $sFromAdress = substr($sFromAdress, 0, 150);
01574 $sFromName = substr($sFromName, 0, 150);
01575
01576 try {
01577 parent::setFrom( $sFromAdress, $sFromName );
01578 } catch( Exception $oEx ) {
01579 }
01580 }
01581
01587 public function getFrom()
01588 {
01589 return $this->From;
01590 }
01591
01597 public function getFromName()
01598 {
01599 return $this->FromName;
01600 }
01601
01610 public function setCharSet( $sCharSet = null )
01611 {
01612 if ( $sCharSet ) {
01613 $this->_sCharSet = $sCharSet;
01614 } else {
01615 $this->_sCharSet = oxLang::getInstance()->translateString( "charset" );
01616 }
01617 $this->set( "CharSet", $this->_sCharSet );
01618 }
01619
01627 public function setMailer( $sMailer = null )
01628 {
01629 $this->set( "Mailer", $sMailer );
01630 }
01631
01637 public function getMailer()
01638 {
01639 return $this->Mailer;
01640 }
01641
01649 public function setHost( $sHost = null )
01650 {
01651 $this->set( "Host", $sHost );
01652 }
01653
01659 public function getErrorInfo()
01660 {
01661 return $this->ErrorInfo;
01662 }
01663
01672 public function setMailWordWrap( $iWordWrap = null )
01673 {
01674 $this->set( "WordWrap", $iWordWrap );
01675 }
01676
01684 public function setUseInlineImages( $blUseImages = null )
01685 {
01686 $this->_blInlineImgEmail = $blUseImages;
01687 }
01688
01699 public function addAttachment( $sAttPath, $sAttFile = '', $sEncoding = 'base64', $sType = 'application/octet-stream' )
01700 {
01701 $sFullPath = $sAttPath . $sAttFile;
01702
01703 $this->_aAttachments[] = array( $sFullPath, $sAttFile, $sEncoding, $sType );
01704 $blResult = false;
01705
01706 try {
01707 $blResult = parent::addAttachment( $sFullPath, $sAttFile, $sEncoding, $sType );
01708 } catch( Exception $oEx ) {
01709 }
01710
01711 return $blResult;
01712 }
01713
01725 public function addEmbeddedImage( $sFullPath, $sCid, $sAttFile = '', $sEncoding = 'base64', $sType = 'application/octet-stream' )
01726 {
01727 $this->_aAttachments[] = array( $sFullPath, basename($sFullPath), $sAttFile, $sEncoding, $sType, false, 'inline', $sCid );
01728 return parent::addEmbeddedImage( $sFullPath, $sCid, $sAttFile, $sEncoding, $sType );
01729 }
01730
01736 public function getAttachments()
01737 {
01738 return $this->_aAttachments;
01739 }
01740
01746 public function clearAttachments()
01747 {
01748 $this->_aAttachments = array();
01749 return parent::clearAttachments();
01750 }
01751
01761 public function headerLine($sName, $sValue)
01762 {
01763 if (stripos($sName, 'X-') !== false) {
01764 return;
01765 }
01766 return parent::headerLine($sName, $sValue);
01767 }
01768
01774 protected function _getUseInlineImages()
01775 {
01776 return $this->_blInlineImgEmail;
01777 }
01778
01784 protected function _sendMailErrorMsg()
01785 {
01786
01787 $sToAdress = "";
01788 $sToName = "";
01789
01790 $aRecipients = $this->getRecipient();
01791
01792 $sOwnerMessage = "Error sending eMail(". $this->getSubject().") to: \n\n";
01793
01794 foreach ( $aRecipients as $aEMail ) {
01795 $sOwnerMessage .= $aEMail[0];
01796 $sOwnerMessage .= ( !empty($aEMail[1]) ) ? ' (' . $aEMail[1] . ')' : '';
01797 $sOwnerMessage .= " \n ";
01798 }
01799 $sOwnerMessage .= "\n\nError : " . $this->getErrorInfo();
01800
01801
01802 $oShop = $this->_getShop();
01803
01804 $blRet = @mail( $oShop->oxshops__oxorderemail->value, "eMail problem in shop!", $sOwnerMessage);
01805
01806 return $blRet;
01807 }
01808
01818 protected function _addUserInfoOrderEMail( $oOrder )
01819 {
01820 return $oOrder;
01821 }
01822
01832 protected function _addUserRegisterEmail( $oUser )
01833 {
01834 return $oUser;
01835 }
01836
01846 protected function _addForgotPwdEmail( $oShop )
01847 {
01848 return $oShop;
01849 }
01850
01860 protected function _addNewsletterDbOptInMail( $oUser )
01861 {
01862 return $oUser;
01863 }
01864
01870 protected function _clearMailer()
01871 {
01872 $this->clearAllRecipients();
01873 $this->clearReplyTos();
01874 $this->clearAttachments();
01875
01876
01877 $this->error_count = 0;
01878 $this->ErrorInfo = '';
01879 }
01880
01888 protected function _setMailParams( $oShop = null )
01889 {
01890 $this->_clearMailer();
01891
01892 if ( !$oShop ) {
01893 $oShop = $this->_getShop();
01894 }
01895
01896 $this->setFrom( $oShop->oxshops__oxorderemail->value, $oShop->oxshops__oxname->getRawValue() );
01897 $this->setSmtp( $oShop );
01898 }
01899
01909 protected function _getShop( $iLangId = null, $iShopId = null )
01910 {
01911
01912 if ( isset( $this->_oShop ) ) {
01913 return $this->_oShop;
01914 }
01915
01916 $myConfig = $this->getConfig();
01917
01918 if ( $iLangId === null ) {
01919 $oShop = $myConfig->getActiveShop();
01920 } else {
01921 $oShop = oxNew( 'oxshop' );
01922 $oShop->loadInLang( $iLangId, $myConfig->getShopId() );
01923 }
01924
01925 return $this->_oShop = $oShop;
01926 }
01927
01936 protected function _setSmtpAuthInfo( $sUserName = null, $sUserPassword = null )
01937 {
01938 $this->set( "SMTPAuth", true );
01939 $this->set( "Username", $sUserName );
01940 $this->set( "Password", $sUserPassword );
01941 }
01942
01950 protected function _setSmtpDebug( $blDebug = null )
01951 {
01952 $this->set( "SMTPDebug", $blDebug );
01953 }
01954
01960 protected function _setMailerPluginDir()
01961 {
01962 $this->set( "PluginDir", getShopBasePath() . "core/phpmailer/" );
01963 }
01964
01971 protected function _makeOutputProcessing()
01972 {
01973 $oOutput = oxNew( "oxoutput" );
01974 $this->setBody( $oOutput->process($this->getBody(), "oxemail") );
01975 $this->setAltBody( $oOutput->process($this->getAltBody(), "oxemail") );
01976 $oOutput->processEmail( $this );
01977 }
01978
01984 protected function _sendMail()
01985 {
01986 $blResult = false;
01987 try {
01988 $blResult = parent::send();
01989 } catch( Exception $oEx ) {
01990 }
01991
01992 return $blResult;
01993 }
01994
01995
02001 protected function _processViewArray()
02002 {
02003 $oSmarty = $this->_getSmarty();
02004 $oOutputProcessor = oxNew( "oxoutput" );
02005
02006
02007 foreach ( $this->_aViewData as $sKey => $sValue ) {
02008 $oSmarty->assign( $sKey, $sValue );
02009 }
02010
02011
02012 $aNewSmartyArray = $oOutputProcessor->processViewArray( $oSmarty->get_template_vars(), "oxemail" );
02013
02014 foreach ( $aNewSmartyArray as $key => $val ) {
02015 $oSmarty->assign( $key, $val );
02016 }
02017 }
02018
02024 public function getCharset()
02025 {
02026 if ( !$this->_sCharSet ) {
02027 return oxLang::getInstance()->translateString("charset");
02028 } else {
02029 return $this->CharSet;
02030 }
02031 }
02032
02038 public function getShop()
02039 {
02040 return $this->_getShop();
02041 }
02042
02050 public function setShop( $oShop )
02051 {
02052 $this->_oShop = $oShop;
02053 }
02054
02060 public function getViewConfig()
02061 {
02062 return $this->getConfig()->getActiveView()->getViewConfig();
02063 }
02064
02070 public function getView()
02071 {
02072 return $this->getConfig()->getActiveView();
02073 }
02074
02080 public function getCurrency()
02081 {
02082 $oConfig = oxConfig::getInstance();
02083
02084 return $oConfig->getActShopCurrencyObject();
02085 }
02086
02095 public function setViewData( $sKey, $sValue )
02096 {
02097 $this->_aViewData[$sKey] = $sValue;
02098 }
02099
02105 public function getViewData()
02106 {
02107 return $this->_aViewData;
02108 }
02109
02117 public function getViewDataItem( $sKey )
02118 {
02119 if ( isset($this->_aViewData[$sKey]) ) {
02120 return $this->_aViewData;
02121 }
02122 }
02123
02131 public function setUser( $oUser)
02132 {
02133 $this->_aViewData["oUser"] = $oUser;
02134 }
02135
02141 public function getUser()
02142 {
02143 return $this->_aViewData["oUser"];
02144 }
02145
02146 }