Increase rsstoken column to varchar(64) to accommodate new api key size

This commit is contained in:
DariusIII
2017-08-11 00:49:48 +02:00
parent 9bf5aab7d7
commit f672bd246e
4 changed files with 10 additions and 4 deletions
+2
View File
@@ -1,3 +1,5 @@
2017-08-11 DariusIII
* Chg: Increase rsstoken column to varchar(64) to accommodate new api key size
2017-08-10 DariusIII
* Chg: Use Hash facade for password management in Users class
* Chg: Add customized 404 page
+2 -2
View File
@@ -16,8 +16,8 @@
</last>
</scripts>
<sql>
<db>314</db>
<file>314</file>
<db>315</db>
<file>315</file>
</sql>
</versions>
</nntmux>
+3 -2
View File
@@ -4,6 +4,7 @@ namespace nntmux;
use App\Models\Settings;
use App\Models\UserRequest;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Password;
use nntmux\db\DB;
use nntmux\utility\Utility;
use App\Models\User;
@@ -494,7 +495,7 @@ class Users
*/
public function updateRssKey($uid): int
{
User::query()->where('id', $uid)->update(['rsstoken' => md5(uniqid('', true))]);
User::query()->where('id', $uid)->update(['rsstoken' => Password::getRepository()->createNewToken()]);
return self::SUCCESS;
}
@@ -814,7 +815,7 @@ class Users
$this->pdo->escapeString($email),
$role,
$this->pdo->escapeString((int)Settings::value('..storeuserips') === 1 ? $host : ''),
$this->pdo->escapeString(uniqid('', true)),
$this->pdo->escapeString(Password::getRepository()->createNewToken()),
$invites,
((int)$invitedBy === 0 ? 'NULL' : $invitedBy),
$this->pdo->escapeString($this->pdo->uuid()),
@@ -0,0 +1,3 @@
# Increase rsstoken column to varchar(64) to accommodate new api key size
ALTER TABLE users CHANGE rsstoken rsstoken VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;