Skip to content
This repository has been archived by the owner on Feb 4, 2019. It is now read-only.

Commit

Permalink
merged with project
Browse files Browse the repository at this point in the history
  • Loading branch information
Hussam Hebbo committed Jun 7, 2016
2 parents c348bf2 + 3871861 commit 09e11bd
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 9 deletions.
4 changes: 4 additions & 0 deletions assets/Yves/demoshop/js/ui/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ module.exports = {
}
});

$('form.checkout-form').on('submit', function(event) {
$('button[name="summaryForm[checkout.step.place.order]"]').attr('disabled', 'disabled');
})

$('input[name="checkout[id_shipment_method]"]').on('change', function() {
$shipmentButton.attr('disabled', $('input[name="checkout[id_shipment_method]"]:checked').length != 1);
});
Expand Down
1 change: 1 addition & 0 deletions config/Shared/config_default-development_DE.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

$config[ApplicationConstants::JENKINS_BASE_URL] = 'http://localhost:10007/';
$config[MailConstants::MAILCATCHER_GUI] = 'http://' . $config[ApplicationConstants::HOST_ZED_GUI] . ':1080';
$config[ApplicationConstants::YVES_TRUSTED_HOSTS] = [$yvesHost, $zedHost];

/* RabbitMQ */
$config[ApplicationConstants::ZED_RABBITMQ_HOST] = 'localhost';
Expand Down
2 changes: 2 additions & 0 deletions config/Shared/config_default-development_US.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
= $config[ApplicationConstants::HOST_SSL_ZED_API]
= 'https://' . $zedHost;

$config[ApplicationConstants::YVES_TRUSTED_HOSTS] = [$yvesHost, $zedHost];

$config[ApplicationConstants::CLOUD_CDN_STATIC_MEDIA_HTTP] = 'http://static.com.spryker.dev';
$config[ApplicationConstants::CLOUD_CDN_STATIC_MEDIA_HTTPS] = 'https://static.com.spryker.dev';

Expand Down
2 changes: 2 additions & 0 deletions config/Shared/config_default.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
= $config[ApplicationConstants::HOST_SSL_ZED_API]
= 'zed.spryker.dev';

$config[ApplicationConstants::YVES_TRUSTED_HOSTS] = [];

$config[ApplicationConstants::LOG_LEVEL] = Monolog\Logger::INFO;

$config[ApplicationConstants::TRANSFER_USERNAME] = 'yves';
Expand Down
97 changes: 97 additions & 0 deletions src/Orm/Propel/DE/Migration_pgsql/PropelMigration_1465294472.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php

/**
* Data object containing the SQL and PHP code to migrate the database
* up to version 1465294472.
* Generated on 2016-06-07 10:14:32 by vagrant
*/
class PropelMigration_1465294472
{
public $comment = '';

public function preUp($manager)
{
// add the pre-migration code here
}

public function postUp($manager)
{
// add the post-migration code here
}

public function preDown($manager)
{
// add the pre-migration code here
}

public function postDown($manager)
{
// add the post-migration code here
}

/**
* Get the SQL statements for the Up migration
*
* @return array list of the SQL strings to execute for the Up migration
* the keys being the datasources
*/
public function getUpSQL()
{
return array (
'zed' => '
ALTER TABLE "spy_customer" DROP CONSTRAINT "spy_customer-default_billing_address";
ALTER TABLE "spy_customer" DROP CONSTRAINT "spy_customer-default_shipping_address";
ALTER TABLE "spy_customer" ADD CONSTRAINT "spy_customer-default_billing_address"
FOREIGN KEY ("default_billing_address")
REFERENCES "spy_customer_address" ("id_customer_address")
ON DELETE SET NULL;
ALTER TABLE "spy_customer" ADD CONSTRAINT "spy_customer-default_shipping_address"
FOREIGN KEY ("default_shipping_address")
REFERENCES "spy_customer_address" ("id_customer_address")
ON DELETE SET NULL;
ALTER TABLE "spy_customer_address" DROP CONSTRAINT "spy_customer_address-fk_customer";
ALTER TABLE "spy_customer_address" ADD CONSTRAINT "spy_customer_address-fk_customer"
FOREIGN KEY ("fk_customer")
REFERENCES "spy_customer" ("id_customer")
ON DELETE CASCADE;
',
);
}

/**
* Get the SQL statements for the Down migration
*
* @return array list of the SQL strings to execute for the Down migration
* the keys being the datasources
*/
public function getDownSQL()
{
return array (
'zed' => '
ALTER TABLE "spy_customer" DROP CONSTRAINT "spy_customer-default_billing_address";
ALTER TABLE "spy_customer" DROP CONSTRAINT "spy_customer-default_shipping_address";
ALTER TABLE "spy_customer" ADD CONSTRAINT "spy_customer-default_billing_address"
FOREIGN KEY ("default_billing_address")
REFERENCES "spy_customer_address" ("id_customer_address");
ALTER TABLE "spy_customer" ADD CONSTRAINT "spy_customer-default_shipping_address"
FOREIGN KEY ("default_shipping_address")
REFERENCES "spy_customer_address" ("id_customer_address");
ALTER TABLE "spy_customer_address" DROP CONSTRAINT "spy_customer_address-fk_customer";
ALTER TABLE "spy_customer_address" ADD CONSTRAINT "spy_customer_address-fk_customer"
FOREIGN KEY ("fk_customer")
REFERENCES "spy_customer" ("id_customer");
',
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function register(Application $app)
$this->setControllerResolver();
$this->setProfilerCacheDirectory();
$this->setTrustedProxies();
$this->setTrustedHosts();
$this->setLocale();
$this->setLogLevel();
$this->setProtocolCheck();
Expand Down Expand Up @@ -114,6 +115,15 @@ protected function setTrustedProxies()
Request::setTrustedProxies($proxies);
}

/**
* @return void
*/
protected function setTrustedHosts()
{
$trustedHosts = Config::get(ApplicationConstants::YVES_TRUSTED_HOSTS);
Request::setTrustedHosts($trustedHosts);
}

/**
* @return void
*/
Expand Down
4 changes: 4 additions & 0 deletions src/Pyz/Yves/Application/YvesBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ protected function registerServiceProviders()
$this->application->register(new FlashMessengerServiceProvider());
$this->application->register(new WebProfilerServiceProvider());
$this->application->register(new AutoloaderCacheServiceProvider());

if (Config::get(ApplicationConstants::ENABLE_WEB_PROFILER, false)) {
$this->application->register(new WebProfilerServiceProvider());
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Pyz/Yves/Customer/Form/LoginForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ protected function addPasswordField(FormBuilderInterface $builder)
'label' => 'customer.login.password',
'constraints' => new NotBlank(),
'mapped' => false,
'attr' => ['autocomplete' => 'off']
]);

return $this;
Expand Down
8 changes: 2 additions & 6 deletions src/Pyz/Yves/Customer/Form/PasswordForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,11 @@ protected function addNewPasswordField(FormBuilderInterface $builder)
'required' => true,
'first_options' => [
'label' => 'customer.password.request.new_password',
'attr' => [
'autocomplete' => 'off',
],
'attr' => ['autocomplete' => 'off'],
],
'second_options' => [
'label' => 'customer.password.confirm.new_password',
'attr' => [
'autocomplete' => 'off',
],
'attr' => ['autocomplete' => 'off'],
],
]);

Expand Down
2 changes: 2 additions & 0 deletions src/Pyz/Yves/Customer/Form/RegisterForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ protected function addPasswordField(FormBuilderInterface $builder)
'required' => true,
'first_options' => [
'label' => 'forms.password',
'attr' => ['autocomplete' => 'off']
],
'second_options' => [
'label' => 'forms.confirm-password',
'attr' => ['autocomplete' => 'off']
],
'constraints' => [
new NotBlank(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
class EventJournalServiceProvider extends AbstractServiceProvider
{

const COOKIE_HASH_ALGORITHM = 'sha256';

/**
* @var \Spryker\Client\EventJournal\EventJournalClientInterface
*/
Expand Down Expand Up @@ -142,7 +144,7 @@ private function setTrackingCookie(Application $app, $cookieName, $validFor)
// An unsafe value might have been set in browser by JS or XSS, it should be replaced with a safe one.
if (empty($_COOKIE[$cookieName]) || !$this->isTrackingValueSafe($_COOKIE[$cookieName])) {
// uniqid is based on current timestamp, a server ID should be used to prevent 2 servers generating the same ID for 2 simultaneous requests.
$_COOKIE[$cookieName] = sha1(uniqid(System::getHostname(), true));
$_COOKIE[$cookieName] = hash(static::COOKIE_HASH_ALGORITHM, uniqid(System::getHostname(), true));
}
$dt = new \DateTime();
$app['cookies'][] = new Cookie(
Expand Down
12 changes: 10 additions & 2 deletions src/Pyz/Zed/Application/ApplicationDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

namespace Pyz\Zed\Application;

use Pyz\Yves\Application\Plugin\Provider\WebProfilerServiceProvider;
use Pyz\Yves\NewRelic\Plugin\Provider\NewRelicServiceProvider;
use Silex\Provider\HttpFragmentServiceProvider;
use Silex\Provider\ServiceControllerServiceProvider;
use Silex\Provider\SessionServiceProvider;
use Silex\Provider\TwigServiceProvider;
use Silex\Provider\WebProfilerServiceProvider;
use Spryker\Shared\Application\ApplicationConstants;
use Spryker\Shared\Config\Config;
use Spryker\Zed\Acl\Communication\Plugin\Bootstrap\AclBootstrapProvider;
use Spryker\Zed\Application\ApplicationDependencyProvider as SprykerApplicationDependencyProvider;
use Spryker\Zed\Application\Communication\Plugin\ServiceProvider\DateFormatterServiceProvider;
Expand Down Expand Up @@ -90,7 +92,13 @@ protected function getServiceProvider(Container $container)
new WebProfilerServiceProvider()
];

return array_merge($providers, $coreProviders);
if (Config::get(ApplicationConstants::ENABLE_WEB_PROFILER, false)) {
$providers[] = new WebProfilerServiceProvider();
}

$providers = array_merge($providers, $coreProviders);

return $providers;
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Pyz/Zed/Auth/AuthConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class AuthConfig extends SprykerAuthConfig
public function getIgnorable()
{
$this->addIgnorable('system', 'heartbeat', 'index');
$this->addIgnorable('_profiler', 'wdt', '*');

return parent::getIgnorable();
}
Expand Down

0 comments on commit 09e11bd

Please sign in to comment.