-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add proxy step to ezpublish install #65
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{* DO NOT EDIT THIS FILE! Use an override template instead. *} | ||
{*?template charset=latin1?*} | ||
<div align="center"> | ||
<h1>{"Proxy settings"|i18n("design/standard/setup/init")}</h1> | ||
</div> | ||
|
||
<p> | ||
{"This section is used to configure how eZ Publish connects to the Internet. This step is only needed if the server where eZ Publish will be installed needs to use a proxy to connect to Internet, otherwise you can ignore this step."|i18n("design/standard/setup/init")} | ||
</p> | ||
|
||
<p> | ||
<form method="post" action="{$script}"> | ||
<fieldset> | ||
<legend>{"Proxy"|i18n("design/standard/setup/init")}:</legend> | ||
<table cellspacing="3" cellpadding="0" border="0"> | ||
<tr> | ||
<td></td><td class="normal"><label for="eZSetupPROXYServer" class="textfield">{"Server name: "|i18n("design/standard/setup/init")}</label></td> | ||
<td class="normal"><input type="text" size="25" id="eZSetupPROXYServer" name="eZSetupPROXYServer" value="{$proxy_info.server|wash}"></td> | ||
</tr> | ||
<tr> | ||
<td></td><td class="normal"><label for="eZSetupPROXYUser" class="textfield">{"Username (optional): "|i18n("design/standard/setup/init")}</label></td> | ||
<td class="normal"><input type="text" size="25" id="eZSetupPROXYUser" name="eZSetupPROXYUser" value="{$proxy_info.user|wash}"></td> | ||
</tr> | ||
<tr> | ||
<td></td><td class="normal"><label for="eZSetupPROXYPassword" class="textfield">{"Password (optional): "|i18n("design/standard/setup/init")}</label></td> | ||
<td class="normal"><input type="password" size="25" id="eZSetupPROXYPassword" name="eZSetupPROXYPassword" value="{$proxy_info.password|wash}"></td> | ||
</tr> | ||
</table> | ||
</fieldset> | ||
{include uri='design:setup/init/navigation.tpl'} | ||
{include uri='design:setup/persistence.tpl'} | ||
</form> | ||
|
||
</p> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{* DO NOT EDIT THIS FILE! Use an override template instead. *} | ||
{"The eZ Publish system can use proxy server to connect to Internet."|i18n("design/standard/setup/init")} | ||
<p></p> | ||
{"That is the help chapter about proxy."|i18n("design/standard/setup/init")} | ||
<p></p> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{* DO NOT EDIT THIS FILE! Use an override template instead. *} | ||
{* DO NOT EDIT THIS FILE! Use an override template instead. *} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like your editor is configured to insert the BOM at the beginning of files (you use UltraEdit perhaps ?), this is not needed for UTF8 and it may even be dangerous in PHP, so please configure your editor to not do that. |
||
{*?template charset=latin1?*} | ||
|
||
<table border="0" cellspacing="3" cellpadding="0"> | ||
|
@@ -55,6 +55,23 @@ | |
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td> | ||
{if count($summary_proxy_info)} | ||
<div class="setup_summary_ok"> | ||
{else} | ||
<div class="setup_summary_empty"> | ||
{/if} | ||
|
||
{"Proxy"|i18n("design/standard/setup")}:</td> | ||
|
||
<td> | ||
{if count($summary_proxy_info)} | ||
<div class="setup_summary_ok">{$summary_proxy_info}</div> | ||
{/if} | ||
</td> | ||
</tr> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space at the end of the line |
||
|
||
<tr> | ||
<td> | ||
{if count($database)} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,8 @@ function summary() | |
} | ||
|
||
// Database selected | ||
if ( isset( $persistenceList['database_info'] ) ) { | ||
if ( isset( $persistenceList['database_info'] ) ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. space at the end of the line |
||
{ | ||
$database = $databaseMap[$persistenceList['database_info']['type']]['name']; | ||
$this->Tpl->setVariable( 'database', $database ); | ||
} | ||
|
@@ -88,7 +89,8 @@ function summary() | |
} | ||
|
||
// Languages selected | ||
if ( isset( $persistenceList['regional_info'] ) ) { | ||
if ( isset( $persistenceList['regional_info'] ) ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. space at the end of the line |
||
{ | ||
$languages = $persistenceList['regional_info']['languages']; | ||
$this->Tpl->setVariable( 'languages', $languages ); | ||
} | ||
|
@@ -100,7 +102,8 @@ function summary() | |
// Email settings | ||
$this->Tpl->setVariable( 'summary_email_info', '' ); | ||
|
||
if ( isset( $persistenceList['email_info'] ) ) { | ||
if ( isset( $persistenceList['email_info'] ) ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. space at the end of the line |
||
{ | ||
if ( $persistenceList['email_info']['type'] == 1 ) | ||
{ | ||
$this->Tpl->setVariable( 'summary_email_info', 'sendmail' ); | ||
|
@@ -111,6 +114,19 @@ function summary() | |
} | ||
} | ||
|
||
// Proxy settings | ||
$this->Tpl->setVariable( 'summary_proxy_info', '' ); | ||
|
||
if ( isset( $persistenceList['proxy_info'] ) ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. space at the end of the line |
||
{ | ||
if ( $persistenceList['proxy_info']['server'] <> "" ) | ||
{ | ||
$this->Tpl->setVariable( 'summary_proxy_info', $persistenceList['proxy_info']['server'] ); | ||
}else{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CS issue There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CS ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes :
should be
|
||
$this->Tpl->setVariable( 'summary_proxy_info', '-' ); | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. space at the end of the line (the same for the following line) |
||
|
||
// Templates chosen | ||
$chosenSitePackage = false; | ||
if ( isset( $this->PersistenceList['chosen_site_package']['0'] ) ) | ||
|
@@ -127,4 +143,4 @@ function summary() | |
public $PersistenceList; | ||
} | ||
|
||
?> | ||
?> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
/** | ||
* File containing the eZStepProxySettings class. | ||
* | ||
* @copyright Copyright (C) 1999-2011 eZ Systems AS. All rights reserved. | ||
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 | ||
* @version 2011.5 | ||
* @package kernel | ||
*/ | ||
|
||
/*! | ||
\class eZStepProxySettings ezstep_proxy_settings.php | ||
\brief The class eZStepProxySettings does | ||
|
||
*/ | ||
|
||
class eZStepProxySettings extends eZStepInstaller | ||
{ | ||
/*! | ||
Constructor | ||
*/ | ||
function eZStepProxySettings( $tpl, $http, $ini, &$persistenceList ) | ||
{ | ||
$this->eZStepInstaller( $tpl, $http, $ini, $persistenceList, | ||
'proxy_settings', 'Proxy settings' ); | ||
} | ||
|
||
function processPostData() | ||
{ | ||
if ( $this->Http->hasPostVariable( 'eZSetupPROXYServer' ) ) | ||
{ | ||
$this->PersistenceList['proxy_info']['server'] = $this->Http->postVariable( 'eZSetupPROXYServer' ); | ||
$this->PersistenceList['proxy_info']['user'] = $this->Http->postVariable( 'eZSetupPROXYUser' ); | ||
$this->PersistenceList['proxy_info']['password'] = $this->Http->postVariable( 'eZSetupPROXYPassword' ); | ||
$siteINI = eZINI::instance( 'site.ini.append', 'settings/override', null, null, false, true ); | ||
$siteINI->setVariable( 'ProxySettings', 'ProxyServer', $this->PersistenceList['proxy_info']['server'] ); | ||
$siteINI->setVariable( 'ProxySettings', 'User', $this->PersistenceList['proxy_info']['user'] ); | ||
$siteINI->setVariable( 'ProxySettings', 'Password', $this->PersistenceList['proxy_info']['password'] ); | ||
$siteINI->save( 'site.ini.append', '.php', false, false ); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
function init() | ||
{ | ||
if ( $this->hasKickstartData() ) | ||
{ | ||
$data = $this->kickstartData(); | ||
$this->PersistenceList['proxy_info']['server'] = $data['Server']; | ||
$this->PersistenceList['proxy_info']['user'] = $data['User']; | ||
$this->PersistenceList['proxy_info']['password'] = $data['Password']; | ||
eZSetupMergePersistenceList( $this->PersistenceList, $persistenceData ); | ||
return $this->kickstartContinueNextStep(); | ||
} | ||
return false; // Always display proxy settings | ||
} | ||
|
||
function display() | ||
{ | ||
$proxyInfo = array( 'server' => false, | ||
'user' => false, | ||
'password' => false ); | ||
if ( isset( $this->PersistenceList['proxy_info'] ) ) | ||
$proxyInfo = array_merge( $proxyInfo, $this->PersistenceList['proxy_info'] ); | ||
if ( $proxyInfo['server'] and | ||
$this->Ini->variable( 'ProxySettings', 'ProxyServer' ) ) | ||
$proxyInfo['server'] = $this->Ini->variable( 'ProxySettings', 'ProxyServer' ); | ||
if ( $proxyInfo['user'] and | ||
$this->Ini->variable( 'ProxySettings', 'TransportUser' ) ) | ||
$proxyInfo['user'] = $this->Ini->variable( 'ProxySettings', 'User' ); | ||
if ( $proxyInfo['password'] and | ||
$this->Ini->variable( 'ProxySettings', 'TransportPassword' ) ) | ||
$proxyInfo['password'] = $this->Ini->variable( 'ProxySettings', 'Password' ); | ||
$this->Tpl->setVariable( 'proxy_info', $proxyInfo ); | ||
$this->Tpl->setVariable( 'setup_previous_step', 'EmailSettings' ); | ||
$this->Tpl->setVariable( 'setup_next_step', 'DatabaseCreate' ); | ||
|
||
$result = array(); | ||
// Display template | ||
$result['content'] = $this->Tpl->fetch( "design:setup/init/proxy_settings.tpl" ); | ||
$result['path'] = array( array( 'text' => ezpI18n::tr( 'design/standard/setup/init', | ||
'proxy settings' ), | ||
'url' => false ) ); | ||
return $result; | ||
|
||
} | ||
} | ||
|
||
?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be marked as optional
And, the default value of all fields is empty, this means that if you go back in the installer steps, the form will be empty (see for instance the mail settings template for instance)