Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #80 from SnowCommerceBrand/magento-1.9
Browse files Browse the repository at this point in the history
Updated to Magento 1.9.4.3
  • Loading branch information
Flyingmana authored Oct 19, 2019
2 parents e6078ab + 99b772f commit af2c70f
Show file tree
Hide file tree
Showing 221 changed files with 3,605 additions and 787 deletions.
10 changes: 10 additions & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
==== 1.9.4.3 ====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
] NOTE: Current Release Notes are maintained at: [
] [
] http://devdocs.magento.com/guides/m1x/ce19-ee114/ce1.9_release-notes.html [
] [
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

==== 1.9.4.2 ====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public static function getVersionInfo()
'major' => '1',
'minor' => '9',
'revision' => '4',
'patch' => '2',
'patch' => '3',
'stability' => '',
'number' => '',
);
Expand Down
47 changes: 38 additions & 9 deletions app/code/core/Mage/Admin/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,25 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract

/**
* Minimum length of admin password
* @deprecated Use getMinAdminPasswordLength() method instead
*/
const MIN_PASSWORD_LENGTH = 7;
const MIN_PASSWORD_LENGTH = 14;

/**
* Configuration path for minimum length of admin password
*/
const XML_PATH_MIN_ADMIN_PASSWORD_LENGTH = 'admin/security/min_admin_password_length';

/**
* Length of salt
*/
const HASH_SALT_LENGTH = 32;

/**
* Empty hash salt
*/
const HASH_SALT_EMPTY = null;

/**
* Model event prefix
*
Expand Down Expand Up @@ -459,7 +470,7 @@ public function hasAssigned2Role($user)
*/
protected function _getEncodedPassword($password)
{
return $this->_getHelper('core')->getHash($password, self::HASH_SALT_LENGTH);
return $this->_getHelper('core')->getHashPassword($password, self::HASH_SALT_LENGTH);
}

/**
Expand Down Expand Up @@ -569,17 +580,23 @@ public function validate()
}

if ($this->hasNewPassword()) {
if (Mage::helper('core/string')->strlen($this->getNewPassword()) < self::MIN_PASSWORD_LENGTH) {
$errors[] = Mage::helper('adminhtml')->__('Password must be at least of %d characters.', self::MIN_PASSWORD_LENGTH);
$password = $this->getNewPassword();
} elseif ($this->hasPassword()) {
$password = $this->getPassword();
}
if (isset($password)) {
$minAdminPasswordLength = $this->getMinAdminPasswordLength();
if (Mage::helper('core/string')->strlen($password) < $minAdminPasswordLength) {
$errors[] = Mage::helper('adminhtml')
->__('Password must be at least of %d characters.', $minAdminPasswordLength);
}

if (!preg_match('/[a-z]/iu', $this->getNewPassword())
|| !preg_match('/[0-9]/u', $this->getNewPassword())
) {
$errors[] = Mage::helper('adminhtml')->__('Password must include both numeric and alphabetic characters.');
if (!preg_match('/[a-z]/iu', $password) || !preg_match('/[0-9]/u', $password)) {
$errors[] = Mage::helper('adminhtml')
->__('Password must include both numeric and alphabetic characters.');
}

if ($this->hasPasswordConfirmation() && $this->getNewPassword() != $this->getPasswordConfirmation()) {
if ($this->hasPasswordConfirmation() && $password != $this->getPasswordConfirmation()) {
$errors[] = Mage::helper('adminhtml')->__('Password confirmation must be same as password.');
}

Expand Down Expand Up @@ -745,4 +762,16 @@ public function getUserCreateAdditionalEmail()
$emails = str_replace(' ', '', Mage::getStoreConfig(self::XML_PATH_ADDITIONAL_EMAILS));
return explode(',', $emails);
}

/**
* Retrieve minimum length of admin password
*
* @return int
*/
public function getMinAdminPasswordLength()
{
$minLength = (int)Mage::getStoreConfig(self::XML_PATH_MIN_ADMIN_PASSWORD_LENGTH);
$absoluteMinLength = Mage_Core_Model_App::ABSOLUTE_MIN_PASSWORD_LENGTH;
return ($minLength < $absoluteMinLength) ? $absoluteMinLength : $minLength;
}
}
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<config>
<modules>
<Mage_Admin>
<version>1.6.1.2</version>
<version>1.6.1.3</version>
</Mage_Admin>
</modules>
<global>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magento.com for more information.
*
* @category Mage
* @package Mage_Admin
* @copyright Copyright (c) 2006-2019 Magento, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/** @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();

//Increase password field length
$installer->getConnection()->changeColumn(
$installer->getTable('admin/user'),
'password',
'password',
array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 255,
'comment' => 'User Password',
)
);

$installer->endSetup();
13 changes: 9 additions & 4 deletions app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,16 @@ protected function _prepareForm()
)
);

$minPasswordLength = Mage::getModel('customer/customer')->getMinPasswordLength();
if ($model->getUserId()) {
$fieldset->addField('password', 'password', array(
'name' => 'new_api_key',
'label' => Mage::helper('adminhtml')->__('New API Key'),
'id' => 'new_pass',
'title' => Mage::helper('adminhtml')->__('New API Key'),
'class' => 'input-text validate-password',
'class' => 'input-text validate-password min-pass-length-' . $minPasswordLength,
'note' => Mage::helper('adminhtml')
->__('API Key must be at least of %d characters.', $minPasswordLength),
));

$fieldset->addField('confirmation', 'password', array(
Expand All @@ -113,15 +116,17 @@ protected function _prepareForm()
));
}
else {
$fieldset->addField('password', 'password', array(
$fieldset->addField('password', 'password', array(
'name' => 'api_key',
'label' => Mage::helper('adminhtml')->__('API Key'),
'id' => 'customer_pass',
'title' => Mage::helper('adminhtml')->__('API Key'),
'class' => 'input-text required-entry validate-password',
'class' => 'input-text required-entry validate-password min-pass-length-' . $minPasswordLength,
'required' => true,
'note' => Mage::helper('adminhtml')
->__('API Key must be at least of %d characters.', $minPasswordLength),
));
$fieldset->addField('confirmation', 'password', array(
$fieldset->addField('confirmation', 'password', array(
'name' => 'api_key_confirmation',
'label' => Mage::helper('adminhtml')->__('API Key Confirmation'),
'id' => 'confirmation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ protected function _prepareLayout()
'class' => 'save'
)));

$deleteConfirmMessage = $this->jsQuoteEscape(Mage::helper('catalog')
->__('All products of this set will be deleted! Are you sure you want to delete this attribute set?'));
$deleteUrl = $this->getUrlSecure('*/*/delete', array('id' => $setId));
$this->setChild('delete_button',
$this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
'label' => Mage::helper('catalog')->__('Delete Attribute Set'),
'onclick' => 'deleteConfirm(\''. $this->jsQuoteEscape(Mage::helper('catalog')->__('All products of this set will be deleted! Are you sure you want to delete this attribute set?')) . '\', \'' . $this->getUrl('*/*/delete', array('id' => $setId)) . '\')',
'onclick' => 'deleteConfirm(\'' . $deleteConfirmMessage . '\', \'' . $deleteUrl . '\')',
'class' => 'delete'
)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ public function render(Varien_Data_Form_Element_Abstract $element)
{
$html = '<tr>';
$html .= '<td class="label">' . $element->getLabelHtml() . '</td>';
$html .= '<td class="value">' . $element->getElementHtml() . '</td>';
$html .= '<td class="value">' . $element->getElementHtml();
if ($element->getNote()) {
$html .= '<p class="note"><span>' . $element->getNote() . '</span></p>';
}
$html .= '</td>';
$html .= '</tr>' . "\n";
$html .= '<tr>';
$html .= '<td class="label"><label>&nbsp;</label></td>';
Expand Down
11 changes: 8 additions & 3 deletions app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ function(v, elem){
}
}

$minPasswordLength = Mage::getModel('customer/customer')->getMinPasswordLength();
if ($customer->getId()) {
if (!$customer->isReadonly()) {
// Add password management fieldset
Expand All @@ -175,7 +176,9 @@ function(v, elem){
array(
'label' => Mage::helper('customer')->__('New Password'),
'name' => 'new_password',
'class' => 'validate-new-password'
'class' => 'validate-new-password min-pass-length-' . $minPasswordLength,
'note' => Mage::helper('adminhtml')
->__('Password must be at least of %d characters.', $minPasswordLength),
)
);
$field->setRenderer($this->getLayout()->createBlock('adminhtml/customer_edit_renderer_newpass'));
Expand Down Expand Up @@ -224,9 +227,11 @@ function(v, elem){
$field = $newFieldset->addField('password', 'text',
array(
'label' => Mage::helper('customer')->__('Password'),
'class' => 'input-text required-entry validate-password',
'class' => 'input-text required-entry validate-password min-pass-length-' . $minPasswordLength,
'name' => 'password',
'required' => true
'required' => true,
'note' => Mage::helper('adminhtml')
->__('Password must be at least of %d characters.', $minPasswordLength),
)
);
$field->setRenderer($this->getLayout()->createBlock('adminhtml/customer_edit_renderer_newpass'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ protected function _toHtml()
$templateProcessed = "<pre>" . htmlspecialchars($templateProcessed) . "</pre>";
}

$templateProcessed = Mage::getSingleton('core/input_filter_maliciousCode')
->linkFilter($templateProcessed);

Varien_Profiler::stop("newsletter_queue_proccessing");

return $templateProcessed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function isTextType()
*/
public function getDeleteUrl()
{
return $this->getUrl('*/*/delete', array('id' => $this->getRequest()->getParam('id')));
return $this->getUrlSecure('*/*/delete', array('id' => $this->getRequest()->getParam('id')));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ protected function _toHtml()
$templateProcessed = "<pre>" . htmlspecialchars($templateProcessed) . "</pre>";
}

$templateProcessed = Mage::getSingleton('core/input_filter_maliciousCode')
->linkFilter($templateProcessed);

Varien_Profiler::stop("newsletter_template_proccessing");

return $templateProcessed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,17 @@ protected function _prepareForm()
)
);

$minPasswordLength = Mage::getModel('customer/customer')->getMinPasswordLength();
if ($user->getUserId()) {
$fieldset->addField('password', 'password',
array(
'name' => 'new_password',
'label' => Mage::helper('adminhtml')->__('New Password'),
'id' => 'new_pass',
'title' => Mage::helper('adminhtml')->__('New Password'),
'class' => 'input-text validate-password',
'class' => 'input-text validate-password min-pass-length-' . $minPasswordLength,
'note' => Mage::helper('adminhtml')
->__('Password must be at least of %d characters.', $minPasswordLength),
)
);

Expand All @@ -112,8 +115,10 @@ protected function _prepareForm()
'label' => Mage::helper('adminhtml')->__('Password'),
'id' => 'customer_pass',
'title' => Mage::helper('adminhtml')->__('Password'),
'class' => 'input-text required-entry validate-password',
'class' => 'input-text required-entry validate-password min-pass-length-' . $minPasswordLength,
'required' => true,
'note' => Mage::helper('adminhtml')
->__('Password must be at least of %d characters.', $minPasswordLength),
)
);
$fieldset->addField('confirmation', 'password',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,16 @@ protected function _prepareForm()
'required' => true,
));

$minAdminPasswordLength = Mage::getModel('admin/user')->getMinAdminPasswordLength();
if ($model->getUserId()) {
$fieldset->addField('password', 'password', array(
'name' => 'new_password',
'label' => Mage::helper('adminhtml')->__('New Password'),
'id' => 'new_pass',
'title' => Mage::helper('adminhtml')->__('New Password'),
'class' => 'input-text validate-admin-password',
'class' => 'input-text validate-admin-password min-admin-pass-length-' . $minAdminPasswordLength,
'note' => Mage::helper('adminhtml')
->__('Password must be at least of %d characters.', $minAdminPasswordLength),
));

$fieldset->addField('confirmation', 'password', array(
Expand All @@ -114,15 +117,18 @@ protected function _prepareForm()
));
}
else {
$fieldset->addField('password', 'password', array(
$fieldset->addField('password', 'password', array(
'name' => 'password',
'label' => Mage::helper('adminhtml')->__('Password'),
'id' => 'customer_pass',
'title' => Mage::helper('adminhtml')->__('Password'),
'class' => 'input-text required-entry validate-admin-password',
'class' => 'input-text required-entry validate-admin-password min-admin-pass-length-'
. $minAdminPasswordLength,
'required' => true,
'note' => Mage::helper('adminhtml')
->__('Password must be at least of %d characters.', $minAdminPasswordLength),
));
$fieldset->addField('confirmation', 'password', array(
$fieldset->addField('confirmation', 'password', array(
'name' => 'password_confirmation',
'label' => Mage::helper('adminhtml')->__('Password Confirmation'),
'id' => 'confirmation',
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function getEmailUrl()

public function getCancelUrl()
{
return $this->getUrl('*/*/cancel');
return $this->getUrlSecure('*/*/cancel');
}

public function getInvoiceUrl()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,14 @@ protected function _prepareForm()
)
);

$minAdminPasswordLength = Mage::getModel('admin/user')->getMinAdminPasswordLength();
$fieldset->addField('password', 'password', array(
'name' => 'new_password',
'label' => Mage::helper('adminhtml')->__('New Password'),
'title' => Mage::helper('adminhtml')->__('New Password'),
'class' => 'input-text validate-admin-password',
'class' => 'input-text validate-admin-password min-admin-pass-length-' . $minAdminPasswordLength,
'note' => Mage::helper('adminhtml')
->__('Password must be at least of %d characters.', $minAdminPasswordLength),
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public function isTextType()
*/
public function getDeleteUrl()
{
return $this->getUrl('*/*/delete', array('_current' => true));
return $this->getUrlSecure('*/*/delete', array('_current' => true));
}

/**
Expand Down
Loading

0 comments on commit af2c70f

Please sign in to comment.