mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-18 13:24:37 -04:00
Long term cookie: purge old tokens
https://github.com/marienfressinaud/FreshRSS/issues/465
This commit is contained in:
@@ -322,7 +322,12 @@ class FreshRSS_index_Controller extends Minz_ActionController {
|
||||
}
|
||||
|
||||
private static function purgeTokens() {
|
||||
//TODO: Delete old token files
|
||||
$oldest = time() - 2629744; //1 month //TODO: Use a configuration instead
|
||||
foreach (new DirectoryIterator(DATA_PATH . '/tokens/') as $fileInfo) {
|
||||
if ($fileInfo->getExtension() === 'txt' && $fileInfo->getMTime() < $oldest) {
|
||||
@unlink($fileInfo->getPathname());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function formLoginAction () {
|
||||
|
||||
Reference in New Issue
Block a user