From 8ffa896e68d05403cd65bd7b1ca3d4657347c10a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 28 Dec 2013 01:01:31 +0100 Subject: Liste d'utilisateurs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126 --- lib/lib_rss.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 160a65bbf..c7698b5c5 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -176,3 +176,15 @@ function uSecString() { function invalidateHttpCache() { file_put_contents(DATA_PATH . '/touch.txt', uTimeString()); } + +function usernameFromPath($userPath) { + if (preg_match('%/([a-z0-9]{1,16})_user\.php$%', $userPath, $matches)) { + return $matches[1]; + } else { + return ''; + } +} + +function listUsers() { + return array_map('usernameFromPath', glob(DATA_PATH . '/*_user.php')); +} -- cgit v1.2.3