00001 <?php
00002
00003 class EFire_Downloader extends oxAdminView
00004 {
00010 protected $_sThisTemplate = "efire_downloader.tpl";
00011
00012 public function render()
00013 {
00014 $this->_aViewData['sEfiUsername'] = htmlspecialchars($this->getConfig()->getConfigParam('sEfiUsername'));
00015 $this->_aViewData['sEfiPassword'] = htmlspecialchars($this->getConfig()->getConfigParam('sEfiPassword'));
00016
00017 return parent::render();
00018 }
00019
00025 public function getAdminList()
00026 {
00027 $oUserList = oxNew( "oxUserList" );
00028 $oUser = $oUserList->getBaseObject();
00029
00030 $sQ = "select ".$oUser->getSelectFields()." from oxuser ";
00031 $sQ .= "where oxuser.oxrights != 'user' ";
00032
00033 $oUserList->selectString( $sQ );
00034 return $oUserList;
00035 }
00036
00042 public function getConnector()
00043 {
00044 $oConfig = $this->getConfig();
00045
00046 $sEtUsername = $this->getConfig()->getParameter("etUsername");
00047 $sEtPassword = $this->getConfig()->getParameter("etPassword");
00048
00049 $oConnector = oxNew("oxefidownloader");
00050
00051 $sShopVersion = $this->getConfig()->getEdition() . " " . $this->getConfig()->getVersion();
00052
00053 $blSaveCredentials = $this->getConfig()->getParameter('blSaveCredentials');
00054
00055 try {
00056 $oConnector->downloadConnector($sEtUsername, $sEtPassword, $sShopVersion, $blSaveCredentials);
00057 $this->_aViewData['message'] = oxLang::getInstance()->translateString('EFIRE_DOWNLOADER_SUCCESS');
00058 } catch (Exception $e) {
00059 oxUtilsView::getInstance()->addErrorToDisplay(sprintf(oxLang::getInstance()->translateString('EFIRE_DOWNLOADER_ERROR'), $e->getMessage()));
00060 }
00061 }
00062 }