Set client setting
public setSetting ( string $name, mixed $value ) : Scalr_Account | ||
$name | string | |
$value | mixed | |
Результат | Scalr_Account |
/** * Return account's hash. It's used for reseting keepSession on a whole account * * @param int $userId * @return string */ protected static function getAccountHash($userId) { $db = \Scalr::getDb(); $hash = $db->GetOne("\n SELECT `value`\n FROM client_settings\n JOIN account_users ON account_users.account_id = client_settings.clientid\n WHERE `key` = ? AND account_users.id = ?\n LIMIT 1\n ", array(Scalr_Account::SETTING_AUTH_HASH, $userId)); if (!$hash) { $accountId = $db->GetOne('SELECT account_id FROM account_users WHERE id = ? LIMIT 1', array($userId)); if ($accountId) { $hash = CryptoTool::sault(); $acc = new Scalr_Account(); $acc->loadById($accountId); $acc->setSetting(Scalr_Account::SETTING_AUTH_HASH, $hash); } } return $hash; }