forked from flashii/eeprom
Removed unused authentication methods.
This commit is contained in:
parent
da3562544f
commit
61997c5a13
3 changed files with 1 additions and 38 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
public/data/*
|
||||
public/thumb/*
|
||||
config.ini
|
||||
/.debug
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
namespace EEPROM\Auth;
|
||||
|
||||
class OAuthAuth implements AuthInterface {
|
||||
public function getName(): string { return 'OAuth'; }
|
||||
|
||||
public function verifyToken(string $token): int {
|
||||
return -1;
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
<?php
|
||||
namespace EEPROM\Auth;
|
||||
|
||||
class SockChatAuth extends MisuzuAuth {
|
||||
public function getName(): string { return 'SockChat'; }
|
||||
|
||||
public function verifyToken(string $token): int {
|
||||
if(strpos($token, '_') === false)
|
||||
return -1;
|
||||
|
||||
$tokenParts = explode('_', $token, 2);
|
||||
$userId = intval($tokenParts[0] ?? 0);
|
||||
$chatToken = strval($tokenParts[1] ?? '');
|
||||
|
||||
$getUserId = $this->getDatabase()->prepare('
|
||||
SELECT `user_id`
|
||||
FROM `msz_user_chat_tokens`
|
||||
WHERE `user_id` = :user
|
||||
AND `token_string` = :token
|
||||
AND `token_created` > NOW() - INTERVAL 1 WEEK
|
||||
');
|
||||
$getUserId->bindValue('user', $userId);
|
||||
$getUserId->bindValue('token', $chatToken);
|
||||
$getUserId->execute();
|
||||
|
||||
return (int)$getUserId->fetchColumn();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue