Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/install/upgrades.php
Show First 20 Lines • Show All 2332 Lines • ▼ Show 20 Line(s) | |||||
$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); | ||||
} | } | ||||
} | } | ||||
} | |||||
No newline at end of file | /** | ||||
* Update to 5.2.2-B1 | |||||
* | |||||
* @param string $mode when called mode {before, after) | |||||
*/ | |||||
public function Upgrade_5_2_2_B1($mode) | |||||
{ | |||||
if ( $mode != 'after' ) { | |||||
return; | |||||
} | |||||
$this->deleteThumbnails(); | |||||
} | |||||
/** | |||||
* Deletes folders, containing thumbnails recursively. | |||||
* | |||||
* @param string $folder Folder. | |||||
* | |||||
* @return void | |||||
*/ | |||||
protected function deleteThumbnails($folder = WRITEABLE) | |||||
{ | |||||
foreach ( glob($folder . '/*', GLOB_ONLYDIR) as $sub_folder ) { | |||||
if ( $sub_folder === WRITEABLE . '/cache' ) { | |||||
continue; | |||||
} | |||||
if ( basename($sub_folder) === 'resized' ) { | |||||
$files = glob($sub_folder . '/*'); | |||||
array_map('unlink', $files); | |||||
rmdir($sub_folder); | |||||
} | |||||
else { | |||||
$this->deleteThumbnails($sub_folder); | |||||
} | |||||
} | |||||
} | |||||
} |