Skip to content

Commit

Permalink
Import Magento Release 1.5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSaferite committed May 4, 2011
1 parent 22c7660 commit af7311d
Show file tree
Hide file tree
Showing 565 changed files with 23,576 additions and 7,396 deletions.
8 changes: 8 additions & 0 deletions .htaccess
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@
Order allow,deny
Allow from all

###########################################
## Deny access to release notes to prevent disclosure of the installed Magento version

<Files RELEASE_NOTES.txt>
order allow,deny
deny from all
</Files>

############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags
Expand Down
Empty file modified .htaccess.sample
100755 → 100644
Empty file.
710 changes: 710 additions & 0 deletions RELEASE_NOTES.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public static function getVersionInfo()
return array(
'major' => '1',
'minor' => '5',
'revision' => '0',
'patch' => '1',
'revision' => '1',
'patch' => '0',
'stability' => '',
'number' => '',
);
Expand Down
26 changes: 21 additions & 5 deletions app/code/community/Phoenix/Moneybookers/Model/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,19 @@ protected function _validateEventData($fullCheck = true)

// check order ID
if (empty($params['transaction_id'])
|| ($fullCheck == false && $this->_getCheckout()->getMoneybookersRealOrderId() != $params['transaction_id']))
{
|| ($fullCheck == false && $this->_getCheckout()->getMoneybookersRealOrderId() != $params['transaction_id'])
) {
Mage::throwException('Missing or invalid order ID.');
}
// load order for further validation
$this->_order = Mage::getModel('sales/order')->loadByIncrementId($params['transaction_id']);
if (!$this->_order->getId())
if (!$this->_order->getId()) {
Mage::throwException('Order not found.');
}

if (0 !== strpos($this->_order->getPayment()->getMethodInstance()->getCode(), 'moneybookers_')) {
Mage::throwException('Unknown payment method.');
}

// make additional validation
if ($fullCheck) {
Expand All @@ -229,9 +234,20 @@ protected function _validateEventData($fullCheck = true)
$md5String = '';
foreach ($checkParams as $key) {
if ($key == 'merchant_id') {
$md5String .= Mage::getStoreConfig(Phoenix_Moneybookers_Helper_Data::XML_PATH_CUSTOMER_ID, $this->_order->getStoreId());
$md5String .= Mage::getStoreConfig(Phoenix_Moneybookers_Helper_Data::XML_PATH_CUSTOMER_ID,
$this->_order->getStoreId()
);
} elseif ($key == 'secret') {
$md5String .= strtoupper(md5(Mage::getStoreConfig(Phoenix_Moneybookers_Helper_Data::XML_PATH_SECRET_KEY, $this->_order->getStoreId())));
$secretKey = Mage::getStoreConfig(
Phoenix_Moneybookers_Helper_Data::XML_PATH_SECRET_KEY,
$this->_order->getStoreId()
);

if (empty($secretKey)) {
Mage::throwException('Secret key is empty.');
}

$md5String .= strtoupper(md5($secretKey));
} elseif (isset($params[$key])) {
$md5String .= $params[$key];
}
Expand Down
3 changes: 2 additions & 1 deletion app/code/community/Phoenix/Moneybookers/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@
<active>0</active>
<model>moneybookers/obt</model>
<title>Onlineüberweisung (empfohlen)</title>
<allowspecific>0</allowspecific>
<allowspecific>1</allowspecific>
<specificcountry>GB,DE</specificcountry>
</moneybookers_obt>
</payment>
<moneybookers>
Expand Down
20 changes: 10 additions & 10 deletions app/code/community/Phoenix/Moneybookers/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,42 +35,42 @@
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<moneybookers_email translate="label,comment">
<label>Email Address of Your Moneybookers Account</label>
<comment><![CDATA[To have access to the international payment network of Moneybookers please register <a href="http://www.moneybookers.com/partners/magento/" target="_blank">here</a> for a free account if you don’t have one yet.]]></comment>
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</moneybookers_email>
<customer_id translate="label">
<label>Customer ID</label>
<frontend_type>text</frontend_type>
<sort_order>2</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</customer_id>
<secret_key translate="label,comment">
<label>Secret Word</label>
<comment>Pre-shared secret key to secure the transaction. After activation Moneybookers will give you access to a new section in your Moneybookers account called "Merchant tools". Please choose a secret word (do not use your password for this) and provide it in your Moneybookers admin area and above.</comment>
<frontend_type>text</frontend_type>
<sort_order>3</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</secret_key>
<activationstatus>
<comment></comment>
<frontend_type>text</frontend_type>
<sort_order>4</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</activationstatus>
</fields>
</settings>
Expand Down
23 changes: 17 additions & 6 deletions app/code/core/Mage/Admin/Model/Mysql4/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ public function getRoles(Mage_Core_Model_Abstract $user)
$table = $this->getTable('admin/role');
$read = $this->_getReadAdapter();
$select = $read->select()->from($table, array())
->joinLeft(array('ar' => $table), "(ar.role_id = `{$table}`.parent_id and ar.role_type = 'G')", array('role_id'))
->joinLeft(array('ar' => $table),
"(ar.role_id = `{$table}`.parent_id and ar.role_type = 'G')",
array('role_id'))
->where("`{$table}`.user_id = {$user->getId()}");

return (($roles = $read->fetchCol($select)) ? $roles : array());
Expand Down Expand Up @@ -253,7 +255,8 @@ public function deleteFromRole(Mage_Core_Model_Abstract $user)
return $this;
}
$dbh = $this->_getWriteAdapter();
$condition = "`{$this->getTable('admin/role')}`.user_id = ".$dbh->quote($user->getUserId())." AND `{$this->getTable('admin/role')}`.parent_id = ".$dbh->quote($user->getRoleId());
$condition = "`{$this->getTable('admin/role')}`.user_id = " . $dbh->quote($user->getUserId())
. " AND `{$this->getTable('admin/role')}`.parent_id = " . $dbh->quote($user->getRoleId());
$dbh->delete($this->getTable('admin/role'), $condition);
return $this;
}
Expand All @@ -274,10 +277,18 @@ public function roleUserExists(Mage_Core_Model_Abstract $user)
public function userExists(Mage_Core_Model_Abstract $user)
{
$usersTable = $this->getTable('admin/user');
$select = $this->_getReadAdapter()->select();
$select->from($usersTable);
$select->where("({$usersTable}.username = '{$user->getUsername()}' OR {$usersTable}.email = '{$user->getEmail()}') AND {$usersTable}.user_id != '{$user->getId()}'");
return $this->_getReadAdapter()->fetchRow($select);
$db = $this->_getReadAdapter();

$select = $db->select()
->from(array('u' => $usersTable))
->where('u.user_id != ?', (int) $user->getId())
->where('u.username = :username OR u.email = :email')
;
$row = $db->fetchRow($select, array(
':username' => $user->getUsername(),
':email' => $user->getUsername(),
));
return $row;
}

public function saveExtra($object, $data)
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Admin/Model/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function login($username, $password, $request = null)
$user = Mage::getModel('admin/user');
$user->login($username, $password);
if ($user->getId()) {
$this->renewSession();

if (Mage::getSingleton('adminhtml/url')->useSecretKey()) {
Mage::getSingleton('adminhtml/url')->renewSecretUrls();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ protected function _prepareForm()
continue;
}
$attributeCode = $attribute->getAttributeCode();
$attribute->setAttributeCode('simple_product_' . $attributeCode);
$element = $fieldset->addField(
'simple_product_' . $attributeCode,
$inputType,
Expand Down
46 changes: 45 additions & 1 deletion app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,46 @@ public function initForm()
// $customer->setWebsiteId(Mage::app()->getStore(true)->getWebsiteId());
// }

$customerStoreId = null;
if ($customer->getId()) {
$customerStoreId = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore()->getId();
}

$prefixElement = $form->getElement('prefix');
if ($prefixElement) {
$prefixOptions = $this->helper('customer')->getNamePrefixOptions($customerStoreId);
if (!empty($prefixOptions)) {
$fieldset->removeField($prefixElement->getId());
$prefixField = $fieldset->addField($prefixElement->getId(),
'select',
$prefixElement->getData(),
$form->getElement('group_id')->getId()
);
$prefixField->setValues($prefixOptions);
if ($customer->getId()) {
$prefixField->addElementValues($customer->getPrefix());
}

}
}

$suffixElement = $form->getElement('suffix');
if ($suffixElement) {
$suffixOptions = $this->helper('customer')->getNameSuffixOptions($customerStoreId);
if (!empty($suffixOptions)) {
$fieldset->removeField($suffixElement->getId());
$suffixField = $fieldset->addField($suffixElement->getId(),
'select',
$suffixElement->getData(),
$form->getElement('lastname')->getId()
);
$suffixField->setValues($suffixOptions);
if ($customer->getId()) {
$suffixField->addElementValues($customer->getSuffix());
}
}
}

if ($customer->getId()) {
if (!$customer->isReadonly()) {
// add password management fieldset
Expand Down Expand Up @@ -156,12 +196,16 @@ public function initForm()

$prefix = $form->getHtmlIdPrefix();
if ($sendEmail) {
$_disableStoreField = '';
if (!$isSingleMode) {
$_disableStoreField = "$('{$prefix}sendemail_store_id').disabled=(''==this.value || '0'==this.value);";
}
$sendEmail->setAfterElementHtml(
'<script type="text/javascript">'
. "
$('{$prefix}website_id').disableSendemail = function() {
$('{$prefix}sendemail').disabled = ('' == this.value || '0' == this.value);".
($isSingleMode ? "" : "$('{$prefix}sendemail_store_id').disabled = ('' == this.value || '0' == this.value);")
$_disableStoreField
."}.bind($('{$prefix}website_id'));
Event.observe('{$prefix}website_id', 'change', $('{$prefix}website_id').disableSendemail);
$('{$prefix}website_id').disableSendemail();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,39 @@ public function initForm()
}
}

$customerStoreId = null;
if ($customer->getId()) {
$customerStoreId = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore()->getId();
}

$prefixElement = $form->getElement('prefix');
if ($prefixElement) {
$prefixOptions = $this->helper('customer')->getNamePrefixOptions($customerStoreId);
if (!empty($prefixOptions)) {
$fieldset->removeField($prefixElement->getId());
$prefixField = $fieldset->addField($prefixElement->getId(),
'select',
$prefixElement->getData(),
'^'
);
$prefixField->setValues($prefixOptions);
}
}

$suffixElement = $form->getElement('suffix');
if ($suffixElement) {
$suffixOptions = $this->helper('customer')->getNameSuffixOptions($customerStoreId);
if (!empty($suffixOptions)) {
$fieldset->removeField($suffixElement->getId());
$suffixField = $fieldset->addField($suffixElement->getId(),
'select',
$suffixElement->getData(),
$form->getElement('lastname')->getId()
);
$suffixField->setValues($suffixOptions);
}
}

$addressCollection = $customer->getAddresses();
$this->assign('customer', $customer);
$this->assign('addressCollection', $addressCollection);
Expand Down Expand Up @@ -196,9 +229,39 @@ public function getDefaultCountriesJson() {
$websites = Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm(false, true);
$result = array();
foreach ($websites as $website) {
$result[$website['value']] = Mage::app()->getWebsite($website['value'])->getConfig(Mage_Core_Helper_Data::XML_PATH_DEFAULT_COUNTRY);
$result[$website['value']] = Mage::app()->getWebsite($website['value'])->getConfig(
Mage_Core_Helper_Data::XML_PATH_DEFAULT_COUNTRY
);
}

return Mage::helper('core')->jsonEncode($result);
}

/**
* Add specified values to name prefix element values
*
* @param string|int|array $values
* @return Mage_Adminhtml_Block_Customer_Edit_Tab_Addresses
*/
public function addValuesToNamePrefixElement($values)
{
if ($this->getForm() && $this->getForm()->getElement('prefix')) {
$this->getForm()->getElement('prefix')->addElementValues($values);
}
return $this;
}

/**
* Add specified values to name suffix element values
*
* @param string|int|array $values
* @return Mage_Adminhtml_Block_Customer_Edit_Tab_Addresses
*/
public function addValuesToNameSuffixElement($values)
{
if ($this->getForm() && $this->getForm()->getElement('suffix')) {
$this->getForm()->getElement('suffix')->addElementValues($values);
}
return $this;
}
}
Loading

0 comments on commit af7311d

Please sign in to comment.