Changeset View
Changeset View
Standalone View
Standalone View
core/install/upgrades.php
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | |||||
*/ | */ | ||||
function Upgrade_4_1_0($mode) | function Upgrade_4_1_0($mode) | ||||
{ | { | ||||
if ($mode == 'before') { | if ($mode == 'before') { | ||||
// don't user after, because In-Portal calls this method too | // don't user after, because In-Portal calls this method too | ||||
$this->_toolkit->SaveConfig(); | $this->_toolkit->SaveConfig(); | ||||
} | } | ||||
if ($mode == 'after') { | if ($mode == 'after') { | ||||
Lint: CodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace: Expected 1 spaces before "if" closing bracket; 0 found | |||||
Expected 1 spaces after "if" opening bracket; 0 found Lint: CodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace: Expected 1 spaces after "if" opening bracket; 0 found | |||||
/** @var kMultiLanguageHelper $ml_helper */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | ||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
$this->Application->UnitConfigReader->iterateConfigs(Array (&$this, 'updateTextFields'), $ml_helper->getLanguages()); | $this->Application->UnitConfigReader->iterateConfigs(Array (&$this, 'updateTextFields'), $ml_helper->getLanguages()); | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Moves ReplacementTags functionality from EmailMessage to Events table | * Moves ReplacementTags functionality from EmailMessage to Events table | ||||
* | * | ||||
▲ Show 20 Lines • Show All 570 Lines • ▼ Show 20 Line(s) | |||||
} | } | ||||
} | } | ||||
function _moveDatabaseFolders() | function _moveDatabaseFolders() | ||||
{ | { | ||||
// Tables: PageContent, Images | // Tables: PageContent, Images | ||||
if ($this->Conn->TableFound('PageContent', true)) { | if ($this->Conn->TableFound('PageContent', true)) { | ||||
// 1. replaces "/kernel/user_files/" references in content blocks | // 1. replaces "/kernel/user_files/" references in content blocks | ||||
/** @var kMultiLanguageHelper $ml_helper */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | ||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
$languages = $ml_helper->getLanguages(); | $languages = $ml_helper->getLanguages(); | ||||
$replace_sql = '%1$s = REPLACE(%1$s, "/kernel/user_files/", "/system/user_files/")'; | $replace_sql = '%1$s = REPLACE(%1$s, "/kernel/user_files/", "/system/user_files/")'; | ||||
$update_sqls = Array (); | $update_sqls = Array (); | ||||
foreach ($languages as $language_id) { | foreach ($languages as $language_id) { | ||||
$update_sqls[] = sprintf($replace_sql, 'l' . $language_id . '_Content'); | $update_sqls[] = sprintf($replace_sql, 'l' . $language_id . '_Content'); | ||||
▲ Show 20 Lines • Show All 168 Lines • ▼ Show 20 Line(s) | |||||
$sql = 'UPDATE ' . TABLE_PREFIX . 'Category | $sql = 'UPDATE ' . TABLE_PREFIX . 'Category | ||||
SET IsMenu = 1, ParentId = ' . $root_category . ' | SET IsMenu = 1, ParentId = ' . $root_category . ' | ||||
WHERE ParentId = 0 AND CategoryId <> ' . $root_category; | WHERE ParentId = 0 AND CategoryId <> ' . $root_category; | ||||
$this->Conn->Query($sql); | $this->Conn->Query($sql); | ||||
} | } | ||||
// make sure, that all categories have valid value for Priority field | // make sure, that all categories have valid value for Priority field | ||||
/** @var kPriorityHelper $priority_helper */ | |||||
$priority_helper = $this->Application->recallObject('PriorityHelper'); | $priority_helper = $this->Application->recallObject('PriorityHelper'); | ||||
/* @var $priority_helper kPriorityHelper */ | |||||
$event = new kEvent('c:OnListBuild'); | $event = new kEvent('c:OnListBuild'); | ||||
// update all categories, because they are all under "Content" category now | // update all categories, because they are all under "Content" category now | ||||
$sql = 'SELECT CategoryId | $sql = 'SELECT CategoryId | ||||
FROM ' . TABLE_PREFIX . 'Category'; | FROM ' . TABLE_PREFIX . 'Category'; | ||||
$categories = $this->Conn->GetCol($sql); | $categories = $this->Conn->GetCol($sql); | ||||
Show All 19 Lines | |||||
} | } | ||||
/** | /** | ||||
* Changes skin colors to match new ones (only in case, when they match default values) | * Changes skin colors to match new ones (only in case, when they match default values) | ||||
* | * | ||||
*/ | */ | ||||
function _fixSkinColors() | function _fixSkinColors() | ||||
{ | { | ||||
/** @var kDBItem $skin */ | |||||
$skin = $this->Application->recallObject('skin', null, Array ('skip_autoload' => 1)); | $skin = $this->Application->recallObject('skin', null, Array ('skip_autoload' => 1)); | ||||
PHP keywords must be lowercase; expected "array" but found "Array" Lint: Generic.PHP.LowerCaseKeyword.Found: PHP keywords must be lowercase; expected "array" but found "Array" | |||||
There must be no space between the Array keyword and the opening parenthesis Lint: CodingStandard.Array.Array.SpaceAfterKeyword: There must be no space between the Array keyword and the opening parenthesis | |||||
/* @var $skin kDBItem */ | |||||
$skin->Load(1, 'IsPrimary'); | $skin->Load(1, 'IsPrimary'); | ||||
if ($skin->isLoaded()) { | if ($skin->isLoaded()) { | ||||
$skin_options = unserialize( $skin->GetDBField('Options') ); | $skin_options = unserialize( $skin->GetDBField('Options') ); | ||||
$changes = Array ( | $changes = Array ( | ||||
// option: from -> to | // option: from -> to | ||||
'HeadBgColor' => Array ('#1961B8', '#007BF4'), | 'HeadBgColor' => Array ('#1961B8', '#007BF4'), | ||||
Show All 16 Lines | |||||
$skin_options[$option_name]['Value'] = $change_to; | $skin_options[$option_name]['Value'] = $change_to; | ||||
} | } | ||||
} | } | ||||
if ($can_change) { | if ($can_change) { | ||||
$skin->SetDBField('Options', serialize($skin_options)); | $skin->SetDBField('Options', serialize($skin_options)); | ||||
$skin->Update(); | $skin->Update(); | ||||
/** @var SkinHelper $skin_helper */ | |||||
$skin_helper = $this->Application->recallObject('SkinHelper'); | $skin_helper = $this->Application->recallObject('SkinHelper'); | ||||
/* @var $skin_helper SkinHelper */ | |||||
$skin_file = $skin_helper->getSkinPath(); | $skin_file = $skin_helper->getSkinPath(); | ||||
if (file_exists($skin_file)) { | if (file_exists($skin_file)) { | ||||
unlink($skin_file); | unlink($skin_file); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 401 Lines • ▼ Show 20 Line(s) | |||||
// in case if current default design template doesn't | // in case if current default design template doesn't | ||||
// match any of aliases, then set it to #default_design# | // match any of aliases, then set it to #default_design# | ||||
$sql = 'UPDATE ' . TABLE_PREFIX . 'ConfigurationValues | $sql = 'UPDATE ' . TABLE_PREFIX . 'ConfigurationValues | ||||
SET VariableValue = "#default_design#" | SET VariableValue = "#default_design#" | ||||
WHERE VariableName = "cms_DefaultDesign"'; | WHERE VariableName = "cms_DefaultDesign"'; | ||||
$this->Conn->Query($sql); | $this->Conn->Query($sql); | ||||
} | } | ||||
// replace data in category custom fields used for category item template storage | // replace data in category custom fields used for category item template storage | ||||
Inline comments must start with a capital letter Lint: CodingStandard.Commenting.InlineComment.NotCapital: Inline comments must start with a capital letter | |||||
Inline comments must end in full-stops, exclamation marks, or question marks Lint: CodingStandard.Commenting.InlineComment.InvalidEndChar: Inline comments must end in full-stops, exclamation marks, or question marks | |||||
/** @var kRewriteUrlProcessor $rewrite_processor */ | |||||
$rewrite_processor = $this->Application->recallObject('kRewriteUrlProcessor'); | $rewrite_processor = $this->Application->recallObject('kRewriteUrlProcessor'); | ||||
/* @var $rewrite_processor kRewriteUrlProcessor */ | |||||
foreach ($this->Application->ModuleInfo as $module_name => $module_info) { | foreach ($this->Application->ModuleInfo as $module_name => $module_info) { | ||||
$custom_field_id = $rewrite_processor->getItemTemplateCustomField($module_info['Var']); | $custom_field_id = $rewrite_processor->getItemTemplateCustomField($module_info['Var']); | ||||
if (!$custom_field_id) { | if (!$custom_field_id) { | ||||
continue; | continue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | |||||
'Type' => 0, // category-based permission, | 'Type' => 0, // category-based permission, | ||||
'CatId' => $home_category, | 'CatId' => $home_category, | ||||
); | ); | ||||
$this->Conn->doInsert($fields_hash, TABLE_PREFIX . 'Permissions'); | $this->Conn->doInsert($fields_hash, TABLE_PREFIX . 'Permissions'); | ||||
} | } | ||||
} | } | ||||
/** @var kPermCacheUpdater $updater */ | |||||
$updater = $this->Application->makeClass('kPermCacheUpdater'); | $updater = $this->Application->makeClass('kPermCacheUpdater'); | ||||
/* @var $updater kPermCacheUpdater */ | |||||
$updater->OneStepRun(); | $updater->OneStepRun(); | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Update to 5.1.0-B1; Makes email message fields multilingual | * Update to 5.1.0-B1; Makes email message fields multilingual | ||||
* | * | ||||
Show All 27 Lines | |||||
ADD Recipients TEXT AFTER CustomRecipient, | ADD Recipients TEXT AFTER CustomRecipient, | ||||
ADD INDEX (AllowChangingSender), | ADD INDEX (AllowChangingSender), | ||||
ADD INDEX (CustomSender), | ADD INDEX (CustomSender), | ||||
ADD INDEX (SenderAddressType), | ADD INDEX (SenderAddressType), | ||||
ADD INDEX (AllowChangingRecipient), | ADD INDEX (AllowChangingRecipient), | ||||
ADD INDEX (CustomRecipient)'; | ADD INDEX (CustomRecipient)'; | ||||
$this->Conn->Query($sql); | $this->Conn->Query($sql); | ||||
// create multilingual fields for phrases and email events | // create multilingual fields for phrases and email events | ||||
Inline comments must start with a capital letter Lint: CodingStandard.Commenting.InlineComment.NotCapital: Inline comments must start with a capital letter | |||||
Inline comments must end in full-stops, exclamation marks, or question marks Lint: CodingStandard.Commenting.InlineComment.InvalidEndChar: Inline comments must end in full-stops, exclamation marks, or question marks | |||||
/** @var kMultiLanguageHelper $ml_helper */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | ||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
$ml_helper->createFields('phrases'); | $ml_helper->createFields('phrases'); | ||||
$ml_helper->createFields('email-template'); | $ml_helper->createFields('email-template'); | ||||
$languages = $ml_helper->getLanguages(); | $languages = $ml_helper->getLanguages(); | ||||
if ($this->Conn->TableFound(TABLE_PREFIX . 'EmailMessage', true)) { | if ($this->Conn->TableFound(TABLE_PREFIX . 'EmailMessage', true)) { | ||||
Expected 1 spaces after "if" opening bracket; 0 found Lint: CodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace: Expected 1 spaces after "if" opening bracket; 0 found | |||||
Expected 1 spaces before "if" closing bracket; 0 found Lint: CodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace: Expected 1 spaces before "if" closing bracket; 0 found | |||||
/** @var kEmailTemplateHelper $email_template_helper */ | |||||
$email_template_helper = $this->Application->recallObject('kEmailTemplateHelper'); | $email_template_helper = $this->Application->recallObject('kEmailTemplateHelper'); | ||||
/* @var $email_template_helper kEmailTemplateHelper */ | |||||
foreach ($languages as $language_id) { | foreach ($languages as $language_id) { | ||||
$sql = 'SELECT EmailMessageId, Template, EventId | $sql = 'SELECT EmailMessageId, Template, EventId | ||||
FROM ' . TABLE_PREFIX . 'EmailMessage | FROM ' . TABLE_PREFIX . 'EmailMessage | ||||
WHERE LanguageId = ' . $language_id; | WHERE LanguageId = ' . $language_id; | ||||
$translations = $this->Conn->Query($sql, 'EventId'); | $translations = $this->Conn->Query($sql, 'EventId'); | ||||
foreach ($translations as $event_id => $translation_data) { | foreach ($translations as $event_id => $translation_data) { | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Line(s) | |||||
CHANGE DestAbbr IsoCode CHAR(3) NOT NULL DEFAULT \'\', | CHANGE DestAbbr IsoCode CHAR(3) NOT NULL DEFAULT \'\', | ||||
CHANGE DestAbbr2 ShortIsoCode CHAR(2) NULL DEFAULT NULL, | CHANGE DestAbbr2 ShortIsoCode CHAR(2) NULL DEFAULT NULL, | ||||
DROP INDEX DestType, | DROP INDEX DestType, | ||||
DROP INDEX DestParentId, | DROP INDEX DestParentId, | ||||
ADD INDEX (`Type`), | ADD INDEX (`Type`), | ||||
ADD INDEX (StateCountryId)'; | ADD INDEX (StateCountryId)'; | ||||
$this->Conn->Query($sql); | $this->Conn->Query($sql); | ||||
/** @var kMultiLanguageHelper $ml_helper */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | ||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
$ml_helper->createFields('country-state'); | $ml_helper->createFields('country-state'); | ||||
$languages = $ml_helper->getLanguages(); | $languages = $ml_helper->getLanguages(); | ||||
foreach ($languages as $language_id) { | foreach ($languages as $language_id) { | ||||
$sub_select = ' SELECT l' . $language_id . '_Translation | $sub_select = ' SELECT l' . $language_id . '_Translation | ||||
FROM ' . TABLE_PREFIX . 'Phrase | FROM ' . TABLE_PREFIX . 'Phrase | ||||
WHERE Phrase = DestName'; | WHERE Phrase = DestName'; | ||||
Show All 13 Lines | |||||
} | } | ||||
/** | /** | ||||
* Makes configuration values dropdowns use "||" as separator | * Makes configuration values dropdowns use "||" as separator | ||||
* | * | ||||
*/ | */ | ||||
function _replaceConfigurationValueSeparator() | function _replaceConfigurationValueSeparator() | ||||
{ | { | ||||
/** @var InpCustomFieldsHelper $custom_field_helper */ | |||||
$custom_field_helper = $this->Application->recallObject('InpCustomFieldsHelper'); | $custom_field_helper = $this->Application->recallObject('InpCustomFieldsHelper'); | ||||
/* @var $custom_field_helper InpCustomFieldsHelper */ | |||||
$sql = 'SELECT ValueList, VariableName | $sql = 'SELECT ValueList, VariableName | ||||
FROM ' . TABLE_PREFIX . 'ConfigurationAdmin | FROM ' . TABLE_PREFIX . 'ConfigurationAdmin | ||||
WHERE ValueList LIKE "%,%"'; | WHERE ValueList LIKE "%,%"'; | ||||
$variables = $this->Conn->GetCol($sql, 'VariableName'); | $variables = $this->Conn->GetCol($sql, 'VariableName'); | ||||
foreach ($variables as $variable_name => $value_list) { | foreach ($variables as $variable_name => $value_list) { | ||||
$ret = Array (); | $ret = Array (); | ||||
Show All 22 Lines | |||||
*/ | */ | ||||
function _transformEmailRecipients() | function _transformEmailRecipients() | ||||
{ | { | ||||
$sql = 'SELECT FromUserId, Type, EventId | $sql = 'SELECT FromUserId, Type, EventId | ||||
FROM ' . TABLE_PREFIX . 'Events | FROM ' . TABLE_PREFIX . 'Events | ||||
WHERE FromUserId IS NOT NULL AND (FromUserId <> ' . USER_ROOT . ')'; | WHERE FromUserId IS NOT NULL AND (FromUserId <> ' . USER_ROOT . ')'; | ||||
$events = $this->Conn->Query($sql, 'EventId'); | $events = $this->Conn->Query($sql, 'EventId'); | ||||
/** @var MInputHelper $minput_helper */ | |||||
$minput_helper = $this->Application->recallObject('MInputHelper'); | $minput_helper = $this->Application->recallObject('MInputHelper'); | ||||
/* @var $minput_helper MInputHelper */ | |||||
foreach ($events as $event_id => $event_data) { | foreach ($events as $event_id => $event_data) { | ||||
$sql = 'SELECT Login | $sql = 'SELECT Login | ||||
FROM ' . TABLE_PREFIX . 'PortalUser | FROM ' . TABLE_PREFIX . 'PortalUser | ||||
WHERE PortalUserId = ' . $event_data['FromUserId']; | WHERE PortalUserId = ' . $event_data['FromUserId']; | ||||
$username = $this->Conn->GetOne($sql); | $username = $this->Conn->GetOne($sql); | ||||
if (!$username) { | if (!$username) { | ||||
▲ Show 20 Lines • Show All 242 Lines • ▼ Show 20 Line(s) | |||||
* @return void | * @return void | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
public function moveTranslation($source_prefix, $target_prefix, $db_column) | public function moveTranslation($source_prefix, $target_prefix, $db_column) | ||||
{ | { | ||||
$source_phrases = $this->getPhrasesByMask($source_prefix . '%'); | $source_phrases = $this->getPhrasesByMask($source_prefix . '%'); | ||||
$target_phrases = $this->getPhrasesByMask($target_prefix . '%'); | $target_phrases = $this->getPhrasesByMask($target_prefix . '%'); | ||||
/** @var kMultiLanguageHelper $ml_helper */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | ||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
$delete_ids = Array (); | $delete_ids = Array (); | ||||
$ml_helper->createFields('phrases'); | $ml_helper->createFields('phrases'); | ||||
$languages = $ml_helper->getLanguages(); | $languages = $ml_helper->getLanguages(); | ||||
$phrase_table = $this->Application->getUnitOption('phrases', 'TableName'); | $phrase_table = $this->Application->getUnitOption('phrases', 'TableName'); | ||||
foreach ($source_phrases as $phrase_key => $phrase_info) { | foreach ($source_phrases as $phrase_key => $phrase_info) { | ||||
$target_phrase_key = $target_prefix . substr($phrase_key, strlen($source_prefix)); | $target_phrase_key = $target_prefix . substr($phrase_key, strlen($source_prefix)); | ||||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | |||||
$id_field = 'EventId'; | $id_field = 'EventId'; | ||||
} | } | ||||
if ( !isset($fields['l1_Body']) ) { | if ( !isset($fields['l1_Body']) ) { | ||||
// column dropped - nothing to convert anymore | // column dropped - nothing to convert anymore | ||||
return; | return; | ||||
} | } | ||||
/** @var kMultiLanguageHelper $ml_helper */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | ||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
$languages = $ml_helper->getLanguages(); | $languages = $ml_helper->getLanguages(); | ||||
$ml_helper->createFields('email-template'); | $ml_helper->createFields('email-template'); | ||||
$sql = 'SELECT * | $sql = 'SELECT * | ||||
FROM ' . $table_name; | FROM ' . $table_name; | ||||
$email_events = $this->Conn->Query($sql); | $email_events = $this->Conn->Query($sql); | ||||
Show All 25 Lines | |||||
$this->Conn->Query('ALTER TABLE ' . $table_name . ' ' . implode(', ', $drops)); | $this->Conn->Query('ALTER TABLE ' . $table_name . ' ' . implode(', ', $drops)); | ||||
} | } | ||||
/** | /** | ||||
* Transforms COMMON.FOOTER e-mail event into new field in Languages table | * Transforms COMMON.FOOTER e-mail event into new field in Languages table | ||||
*/ | */ | ||||
private function _migrateCommonFooter() | private function _migrateCommonFooter() | ||||
{ | { | ||||
/** @var kMultiLanguageHelper $ml_helper */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | ||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
$languages = $ml_helper->getLanguages(); | $languages = $ml_helper->getLanguages(); | ||||
$event_table = $this->Application->getUnitOption('email-template', 'TableName'); | $event_table = $this->Application->getUnitOption('email-template', 'TableName'); | ||||
$sql = 'SELECT * | $sql = 'SELECT * | ||||
FROM ' . $event_table . ' | FROM ' . $event_table . ' | ||||
WHERE Event = "COMMON.FOOTER"'; | WHERE Event = "COMMON.FOOTER"'; | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
* @param string $mode when called mode {before, after) | * @param string $mode when called mode {before, after) | ||||
*/ | */ | ||||
public function Upgrade_5_2_0_RC1($mode) | public function Upgrade_5_2_0_RC1($mode) | ||||
{ | { | ||||
if ( $mode != 'before' ) { | if ( $mode != 'before' ) { | ||||
return; | return; | ||||
} | } | ||||
/** @var kMultiLanguageHelper $ml_helper */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | ||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
// make some promo block fields translatable | // make some promo block fields translatable | ||||
$ml_helper->createFields('promo-block'); | $ml_helper->createFields('promo-block'); | ||||
$table_name = $this->Application->getUnitOption('promo-block', 'TableName'); | $table_name = $this->Application->getUnitOption('promo-block', 'TableName'); | ||||
$table_structure = $this->Conn->Query('DESCRIBE ' . $table_name, 'Field'); | $table_structure = $this->Conn->Query('DESCRIBE ' . $table_name, 'Field'); | ||||
if ( isset($table_structure['Title']) ) { | if ( isset($table_structure['Title']) ) { | ||||
▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Line(s) | |||||
if ( !count($user_passwords) ) { | if ( !count($user_passwords) ) { | ||||
// no users at all or existing users have converted passwords already | // no users at all or existing users have converted passwords already | ||||
return; | return; | ||||
} | } | ||||
kUtil::setResourceLimit(); | kUtil::setResourceLimit(); | ||||
/** @var kPasswordFormatter $password_formatter */ | |||||
$password_formatter = $this->Application->recallObject('kPasswordFormatter'); | $password_formatter = $this->Application->recallObject('kPasswordFormatter'); | ||||
/* @var $password_formatter kPasswordFormatter */ | |||||
foreach ($user_passwords as $user_id => $user_password) { | foreach ($user_passwords as $user_id => $user_password) { | ||||
$fields_hash = Array ( | $fields_hash = Array ( | ||||
'Password' => $password_formatter->hashPassword($user_password, '', PasswordHashingMethod::MD5_AND_PHPPASS), | 'Password' => $password_formatter->hashPassword($user_password, '', PasswordHashingMethod::MD5_AND_PHPPASS), | ||||
'PasswordHashingMethod' => PasswordHashingMethod::MD5_AND_PHPPASS, | 'PasswordHashingMethod' => PasswordHashingMethod::MD5_AND_PHPPASS, | ||||
); | ); | ||||
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'Users', 'PortalUserId = ' . $user_id); | $this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'Users', 'PortalUserId = ' . $user_id); | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |
Expected 1 spaces before "if" closing bracket; 0 found