From: Andrew Dolgov Date: Mon, 7 Nov 2011 13:06:18 +0000 (+0400) Subject: implement basic feed output for register.php X-Git-Tag: 1.5.7~43 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=870a70e109ac9e80a88047044530de53d0404ec7;p=tt-rss.git implement basic feed output for register.php --- diff --git a/register.php b/register.php index 144189f7..3198095a 100644 --- a/register.php +++ b/register.php @@ -16,6 +16,42 @@ init_connection($link); + if ($_REQUEST["format"] == "feed") { + header("Content-Type: text/xml"); + + print ''; + print " + ".htmlspecialchars(SELF_URL_PATH . "/register.php")." + Tiny Tiny RSS registration slots + + "; + + if (ENABLE_REGISTRATION) { + $result = db_query($link, "SELECT COUNT(*) AS cu FROM ttrss_users"); + $num_users = db_fetch_result($result, 0, "cu"); + + $num_users -= REG_MAX_USERS; + if ($num_users < 0) $num_users = 0; + $reg_suffix = "enabled"; + } else { + $num_users = 0; + $reg_suffix = "disabled"; + } + + print " + ".htmlspecialchars(SELF_URL_PATH)."/register.php?$num_users"." + "; + + print "$num_users slots are currently available, registration $reg_suffix"; + print "$num_users slots are currently available, registration $reg_suffix"; + + print ""; + + print ""; + + return; + } + /* Remove users which didn't login after receiving their registration information */ if (DB_TYPE == "pgsql") {