Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Do not allow an instance to be switched to development mode using the…
Browse files Browse the repository at this point in the history
… GUI

Change in the config file if you really need to do so.
  • Loading branch information
Jamie Snape committed Nov 13, 2014
1 parent f4603d7 commit 41c1e50
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 28 deletions.
1 change: 0 additions & 1 deletion core/controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public function indexAction()
$configForm = $this->Form->Admin->createConfigForm();
$formArray = $this->getFormAsArray($configForm);
$formArray['description']->setValue($config->global->application->description);
$formArray['environment']->setValue($config->global->environment);
$formArray['lang']->setValue($config->global->application->lang);
$formArray['name']->setValue($config->global->application->name);
$formArray['timezone']->setValue($config->global->default->timezone);
Expand Down
1 change: 0 additions & 1 deletion core/controllers/InstallController.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ public function step3Action()
$form = $this->Form->Install->createConfigForm();
$formArray = $this->getFormAsArray($form);
$formArray['description']->setValue($config->global->application->description);
$formArray['environment']->setValue($config->global->environment);
$formArray['lang']->setValue($config->global->application->lang);
$formArray['name']->setValue($config->global->application->name);
$formArray['timezone']->setValue($config->global->default->timezone);
Expand Down
4 changes: 0 additions & 4 deletions core/controllers/forms/AdminForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ public function createConfigForm()
)
);

$environment = new Zend_Form_Element_Select('environment');
$environment->addMultiOptions(array('production' => 'Production', 'development' => 'Development'));

$name = new Zend_Form_Element_Text('name');
$name->setRequired(true)->addValidator('NotEmpty', true);

Expand All @@ -70,7 +67,6 @@ public function createConfigForm()
$dynamichelp,
$description,
$timezone,
$environment,
$gravatar,
$lang,
$name,
Expand Down
5 changes: 1 addition & 4 deletions core/controllers/forms/InstallForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ public function createConfigForm()
)
);

$environment = new Zend_Form_Element_Select('environment');
$environment->addMultiOptions(array('production' => 'Production', 'development' => 'Development'));

$description = new Zend_Form_Element_Textarea('description');

$name = new Zend_Form_Element_Text('name');
Expand All @@ -124,7 +121,7 @@ public function createConfigForm()
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Create configuration');

$form->addElements(array($description, $timezone, $environment, $lang, $name, $submit));
$form->addElements(array($description, $timezone, $lang, $name, $submit));

return $form;
}
Expand Down
6 changes: 0 additions & 6 deletions core/public/js/install/install.step3.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ $(document).ready(function () {
helpText['name'] = '<h4>Name</h4>Please select the name of your installation of MIDAS';
helpText['description'] = '<h4>Description</h4>Provide a description for search engines.';
helpText['lang'] = '<h4>Language</h4>Please select the default language. Currently, English and French are available.';
helpText['env'] = '<h4>Environment</h4>Development is slower, but it will show you all the information needed to debug the application<br/><br/>Production is faster, but it hides the errors.';
helpText['time'] = '<h4>Timezone</h4>Please select the timezone of your server.';
helpText['assetstore'] = '<h4>Default Assetstore</h4>Please select a default assetstore. An assestore is the location where the uploaded files are stored.';

Expand All @@ -26,11 +25,6 @@ $(document).ready(function () {
}, function () {
$('.installHelp').html(defaultTest);
});
$('.installEnvironment').hover(function () {
$('.installHelp').html(helpText['env']);
}, function () {
$('.installHelp').html(defaultTest);
});
$('.installTimezone').hover(function () {
$('.installHelp').html(helpText['time']);
}, function () {
Expand Down
10 changes: 3 additions & 7 deletions core/views/admin/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/jquery/jquery.clu
{$this->configForm['name']}
</div>
<div qtip='Provide a description for search engines.' class='description'>
<label for='name'>Description</label>
<label for='description'>Description</label>
{$this->configForm['description']}
</div>
<div class='httpProxy'>
Expand All @@ -77,20 +77,16 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/jquery/jquery.clu
<label for='lang'>Language</label>
{$this->configForm['lang']}
</div>
<div qtip='Development is slower, but will display debug information.<br/><br/>Production is faster, but hides the errors.<br/><br/>Do not select development for web-accessible instances under any circumstances.' class='installEnvironment'>
<label for='environment'>Environment</label>
{$this->configForm['environment']}
</div>
<div class='installTimezone'>
<label for='environment'>Time zone</label>
<label for='timezone'>Time zone</label>
{$this->configForm['timezone']}
</div>
<div qtip='If you enable this feature, Midas will show the users how to use the system.' class='installDynamichelp'>
<label for='dynamichelp'>Dynamic help</label>
{$this->configForm['dynamichelp']}
</div>
<div qtip='If you enable this feature, user registration will not be allowed.' class='closeRegistration'>
<label for='closeRegistration'>Close registration</label>
<label for='closeregistration'>Close registration</label>
{$this->configForm['closeregistration']}
</div>
<div qtip='If enabled, users will automatically have an icon if they have created one on gravatar.com'>
Expand Down
6 changes: 1 addition & 5 deletions core/views/install/step3.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/install/install.s
<label for='lang'>Language</label>
{$this->form['lang']}
</div>
<div class='installEnvironment'>
<label for='environment'>Environment</label>
{$this->form['environment']}
</div>
<div class='installTimezone'>
<label for='environment'>Time zone</label>
<label for='timezone'>Time zone</label>
{$this->form['timezone']}
</div>
";
Expand Down

0 comments on commit 41c1e50

Please sign in to comment.