40 public static function run()
42 $limit = Option::get(
"socialservices",
"encrypt_tokens_step_limit", 500);
43 $lastEncryptedUserId = Option::get(
"socialservices",
"last_encrypted_user_id", 0);
44 $users = UserTable::getList([
45 'order' => [
'ID' =>
'ASC'],
47 'ID',
'OATOKEN',
'OASECRET',
'REFRESH_TOKEN'
49 'filter' => [
'>ID' => $lastEncryptedUserId],
53 while ($user = $users->fetch())
57 UserTable::update($user[
'ID'], [
58 'OATOKEN' => $user[
'OATOKEN'],
59 'OASECRET' => $user[
'OASECRET'],
60 'REFRESH_TOKEN' => $user[
'REFRESH_TOKEN'],
63 $lastEncryptedUserId = $user[
'ID'];
65 Option::set(
"socialservices",
"last_encrypted_user_id", $lastEncryptedUserId);
66 return ($found >= $limit);