[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/setup/steps/ -> ezstep_email_settings.php (source)

   1  <?php
   2  //
   3  // Definition of eZStepEmailSettings class
   4  //
   5  // Created on: <12-Aug-2003 10:39:13 kk>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*! \file ezstep_email_settings.php
  30  */
  31  
  32  include_once ( 'kernel/setup/steps/ezstep_installer.php');
  33  include_once ( 'kernel/common/i18n.php' );
  34  
  35  /*!
  36    \class eZStepEmailSettings ezstep_email_settings.php
  37    \brief The class eZStepEmailSettings does
  38  
  39  */
  40  
  41  class eZStepEmailSettings extends eZStepInstaller
  42  {
  43      /*!
  44       Constructor
  45       \reimp
  46      */
  47      function eZStepEmailSettings(&$tpl, &$http, &$ini, &$persistenceList )
  48      {
  49          $this->eZStepInstaller( $tpl, $http, $ini, $persistenceList,
  50                                  'email_settings', 'Email settings' );
  51      }
  52  
  53      /*!
  54       \reimp
  55       */
  56      function processPostData()
  57      {
  58          if ( $this->Http->hasPostVariable( 'eZSetupEmailTransport' ) )
  59          {
  60              $this->PersistenceList['email_info']['type'] = $this->Http->postVariable( 'eZSetupEmailTransport' );
  61              $this->PersistenceList['email_info']['result'] = false;
  62              if ( $this->PersistenceList['email_info']['type'] == 2 )
  63              {
  64                  $this->PersistenceList['email_info']['server'] = $this->Http->postVariable( 'eZSetupSMTPServer' );
  65                  $this->PersistenceList['email_info']['user'] = $this->Http->postVariable( 'eZSetupSMTPUser' );
  66                  $this->PersistenceList['email_info']['password'] = $this->Http->postVariable( 'eZSetupSMTPPassword' );
  67              }
  68          }
  69  
  70          return true;
  71      }
  72  
  73      /*!
  74       \reimp
  75       */
  76      function init()
  77      {
  78          if ( $this->hasKickstartData() )
  79          {
  80              $data = $this->kickstartData();
  81              $this->PersistenceList['email_info']['result'] = false;
  82              $this->PersistenceList['email_info']['type'] = 1;
  83  
  84              $systemType = eZSys::filesystemType();
  85              if ( $systemType == 'win32' )
  86                  $data['Type'] = 'smtp';
  87  
  88              if ( $data['Type'] == 'smtp' )
  89              {
  90                  $this->PersistenceList['email_info']['type'] = 2;
  91                  $this->PersistenceList['email_info']['server'] = $data['Server'];
  92                  $this->PersistenceList['email_info']['user'] = $data['User'];
  93                  $this->PersistenceList['email_info']['password'] = $data['Password'];
  94              }
  95              return $this->kickstartContinueNextStep();
  96          }
  97          return false; // Always display email settings
  98      }
  99  
 100      /*!
 101       \reimp
 102       */
 103      function &display()
 104      {
 105          $emailInfo = array( 'type' => 1,
 106                              'server' => false,
 107                              'user' => false,
 108                              'password' => false,
 109                              'result' => false );
 110          if ( isset( $this->PersistenceList['email_info'] ) )
 111              $emailInfo = array_merge( $emailInfo, $this->PersistenceList['email_info'] );
 112          if ( $emailInfo['server'] and
 113               $this->Ini->variable( 'MailSettings', 'TransportServer' ) )
 114              $emailInfo['server'] = $this->Ini->variable( 'MailSettings', 'TransportServer' );
 115          if ( $emailInfo['user'] and
 116               $this->Ini->variable( 'MailSettings', 'TransportUser' ) )
 117              $emailInfo['user'] = $this->Ini->variable( 'MailSettings', 'TransportUser' );
 118          if ( $emailInfo['password'] and
 119               $this->Ini->variable( 'MailSettings', 'TransportPassword' ) )
 120              $emailInfo['password'] = $this->Ini->variable( 'MailSettings', 'TransportPassword' );
 121  
 122          $this->Tpl->setVariable( 'email_info', $emailInfo );
 123  
 124          $systemType = eZSys::filesystemType();
 125          $this->Tpl->setVariable( 'system', array( 'type' => $systemType ) );
 126  
 127          $result = array();
 128          // Display template
 129          $result['content'] = $this->Tpl->fetch( "design:setup/init/email_settings.tpl" );
 130          $result['path'] = array( array( 'text' => ezi18n( 'design/standard/setup/init',
 131                                                            'Email settings' ),
 132                                          'url' => false ) );
 133          return $result;
 134  
 135      }
 136  }
 137  
 138  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7