- ++$lnum;
- }
+ pdo->prepare("SELECT
+ tu.id,
+ login,access_level,email,
+ ".SUBSTRING_FOR_DATE."(last_login,1,16) as last_login,
+ ".SUBSTRING_FOR_DATE."(created,1,16) as created,
+ (SELECT COUNT(id) FROM ttrss_feeds WHERE owner_uid = tu.id) AS num_feeds
+ FROM
+ ttrss_users tu
+ WHERE
+ (:search = '' OR login LIKE :search) AND tu.id > 0
+ ORDER BY $sort");
+ $sth->execute([":search" => $user_search ? "%$user_search%" : ""]);
- print "
+ run_hooks(PluginHost::HOOK_PREFS_TAB, "prefUsers");
-
- print ""; #container
-
- }
-
- function validate_field($string, $allowed, $default = "") {
+ function validate_field($string, $allowed, $default = "") {
if (in_array($string, $allowed))
return $string;
else
return $default;
}
- // this is called after user is created to initialize default feeds, labels
- // or whatever else
- // user preferences are checked on every login, not here
- static function initialize_user($uid) {
-
- $pdo = Db::pdo();
-
- $sth = $pdo->prepare("insert into ttrss_feeds (owner_uid,title,feed_url)
- values (?, 'Tiny Tiny RSS: Forum',
- 'https://tt-rss.org/forum/rss.php')");
- $sth->execute([$uid]);
- }
-
static function logout_user() {
if (session_status() === PHP_SESSION_ACTIVE)
session_destroy();