diff options
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 12 |
1 files changed, 12 insertions, 0 deletions
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')); +} |
