OXID eShop CE  4.8.11
 All Classes Files Functions Variables Pages
efire_downloader.php
Go to the documentation of this file.
1 <?php
2 
3 
7 class EFire_Downloader extends Efire
8 {
14  protected $_sThisTemplate = "efire_downloader.tpl";
15 
21  public function render()
22  {
23  $oStr = getStr();
24  $myConfig = $this->getConfig();
25 
26  $this->_aViewData['sEfiUsername'] = $oStr->htmlspecialchars( $myConfig->getConfigParam( 'sEfiUsername' ) );
27  $this->_aViewData['sEfiPassword'] = $oStr->htmlspecialchars( $myConfig->getConfigParam( 'sEfiPassword' ) );
28 
29  return parent::render();
30  }
31 
37  public function getAdminList()
38  {
39  $oUserList = oxNew( "oxUserList" );
40  $oUser = $oUserList->getBaseObject();
41 
42  $sQ = "select ".$oUser->getSelectFields()." from oxuser ";
43  $sQ .= "where oxuser.oxrights != 'user' ";
44 
45  $oUserList->selectString( $sQ );
46  return $oUserList;
47  }
48 
54  public function getConnector()
55  {
56  $oConfig = $this->getConfig();
57 
58  $sEtUsername = $this->getConfig()->getParameter("etUsername");
59  $sEtPassword = $this->getConfig()->getParameter("etPassword");
60 
61  $sShopVersion = $this->getConfig()->getEdition() . " " . $this->getConfig()->getVersion();
62  $blSaveCredentials = $this->getConfig()->getParameter('blSaveCredentials');
63 
64  try {
65  $oConnector = oxNew("oxefidownloader");
66  $oConnector->downloadConnector( $sEtUsername, $sEtPassword, $sShopVersion, $blSaveCredentials );
67  $this->_aViewData['message'] = oxRegistry::getLang()->translateString('EFIRE_DOWNLOADER_SUCCESS' );
68  } catch ( Exception $e ) {
69  oxRegistry::get("oxUtilsView")->addErrorToDisplay( sprintf( oxRegistry::getLang()->translateString('EFIRE_DOWNLOADER_ERROR' ), $e->getMessage() ) );
70  }
71  }
72 }