efire_downloader.php

Go to the documentation of this file.
00001 <?php
00002 
00003 
00007 class EFire_Downloader extends Efire
00008 {
00014     protected $_sThisTemplate = "efire_downloader.tpl";
00015 
00021     public function render()
00022     {
00023         $oStr = getStr();
00024         $myConfig = $this->getConfig();
00025 
00026         $this->_aViewData['sEfiUsername'] = $oStr->htmlspecialchars( $myConfig->getConfigParam( 'sEfiUsername' ) );
00027         $this->_aViewData['sEfiPassword'] = $oStr->htmlspecialchars( $myConfig->getConfigParam( 'sEfiPassword' ) );
00028 
00029         return parent::render();
00030     }
00031 
00037     public function getAdminList()
00038     {
00039         $oUserList = oxNew( "oxUserList" );
00040         $oUser = $oUserList->getBaseObject();
00041 
00042         $sQ  = "select ".$oUser->getSelectFields()." from oxuser ";
00043         $sQ .= "where oxuser.oxrights != 'user' ";
00044 
00045         $oUserList->selectString( $sQ );
00046         return $oUserList;
00047     }
00048 
00054     public function getConnector()
00055     {
00056         $oConfig = $this->getConfig();
00057 
00058         $sEtUsername = $this->getConfig()->getParameter("etUsername");
00059         $sEtPassword = $this->getConfig()->getParameter("etPassword");
00060 
00061         $sShopVersion = $this->getConfig()->getEdition() . " " . $this->getConfig()->getVersion();
00062         $blSaveCredentials = $this->getConfig()->getParameter('blSaveCredentials');
00063 
00064         try {
00065             $oConnector = oxNew("oxefidownloader");
00066             $oConnector->downloadConnector( $sEtUsername, $sEtPassword, $sShopVersion, $blSaveCredentials );
00067             $this->_aViewData['message'] = oxRegistry::getLang()->translateString('EFIRE_DOWNLOADER_SUCCESS' );
00068         } catch ( Exception $e ) {
00069             oxRegistry::get("oxUtilsView")->addErrorToDisplay( sprintf( oxRegistry::getLang()->translateString('EFIRE_DOWNLOADER_ERROR' ), $e->getMessage() ) );
00070         }
00071     }
00072 }