diff --git a/backend.php b/backend.php index 5511668cf..9dd4c6f55 100644 --- a/backend.php +++ b/backend.php @@ -161,11 +161,6 @@ module_pref_filters($link); break; // pref-filters - case "pref_users": - require_once "modules/pref-users.php"; - module_pref_users($link); - break; // prefs-users - case "pref_instances": require_once "modules/pref-instances.php"; module_pref_instances($link); diff --git a/classes/pref_users.php b/classes/pref_users.php new file mode 100644 index 000000000..5f762b50e --- /dev/null +++ b/classes/pref_users.php @@ -0,0 +1,483 @@ +"; + + $uid = sprintf("%d", $_REQUEST["id"]); + + print "
".__('Registered')." | $created |
".__('Last logged in')." | $last_login |
".__('Subscribed feeds count')." | $num_feeds |
+ | ".__('Login')." | +".__('Access Level')." | +".__('Registered')." | +".__('Last login')." |
"; + + $onclick = "onclick='editUser($uid, event)' title='".__('Click to edit')."'"; + + print " | " . $line["login"] . " | "; + + if (!$line["email"]) $line["email"] = " "; + + print "" . $access_level_names[$line["access_level"]] . " | "; + print "" . $line["created"] . " | "; + print "" . $line["last_login"] . " | "; + + print "
"; + if (!$user_search) { + print_warning(__('No users defined.')); + } else { + print_warning(__('No matching users found.')); + } + print "
"; + + } + + print "".__('Registered')." | $created |
".__('Last logged in')." | $last_login |
".__('Subscribed feeds count')." | $num_feeds |
$status_msg"; - - if ($user_search) { - - $user_search = split(" ", $user_search); - $tokens = array(); - - foreach ($user_search as $token) { - $token = trim($token); - array_push($tokens, "(UPPER(login) LIKE UPPER('%$token%'))"); - } - - $user_search_query = "(" . join($tokens, " AND ") . ") AND "; - - } else { - $user_search_query = ""; - } - - $result = db_query($link, "SELECT - id,login,access_level,email, - ".SUBSTRING_FOR_DATE."(last_login,1,16) as last_login, - ".SUBSTRING_FOR_DATE."(created,1,16) as created - FROM - ttrss_users - WHERE - $user_search_query - id > 0 - ORDER BY $sort"); - - if (db_num_rows($result) > 0) { - - print "
- | ".__('Login')." | -".__('Access Level')." | -".__('Registered')." | -".__('Last login')." |
"; - - $onclick = "onclick='editUser($uid, event)' title='".__('Click to edit')."'"; - - print " | " . $line["login"] . " | "; - - if (!$line["email"]) $line["email"] = " "; - - print "" . $access_level_names[$line["access_level"]] . " | "; - print "" . $line["created"] . " | "; - print "" . $line["last_login"] . " | "; - - print "
"; - if (!$user_search) { - print_warning(__('No users defined.')); - } else { - print_warning(__('No matching users found.')); - } - print "
"; - - } - - print "