X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=register.php;h=a6f42c65df865aaf49ea2abf84961c1e2f915ee3;hb=ae962a96fdba3fcc14b60d48f0db48bb7f3b243e;hp=53627d9128d6a711defcbdb643af4a91cfe1bd3e;hpb=6d473e9cd5119848b6267d671226bdba9ee69fe3;p=tt-rss.git diff --git a/register.php b/register.php index 53627d91..a6f42c65 100644 --- a/register.php +++ b/register.php @@ -8,18 +8,18 @@ get_include_path()); require_once 'classes/ttrssmailer.php'; - + require_once "autoload.php"; require_once "functions.php"; require_once "sessions.php"; require_once "sanity_check.php"; require_once "config.php"; require_once "db.php"; - $action = $_REQUEST["action"]; + startup_gettext(); - $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); + $action = $_REQUEST["action"]; - if (!init_connection($link)) return; + if (!init_plugins()) return; if ($_REQUEST["format"] == "feed") { header("Content-Type: text/xml"); @@ -32,7 +32,7 @@ "; if (ENABLE_REGISTRATION) { - $result = db_query($link, "SELECT COUNT(*) AS cu FROM ttrss_users"); + $result = db_query( "SELECT COUNT(*) AS cu FROM ttrss_users"); $num_users = db_fetch_result($result, 0, "cu"); $num_users = REG_MAX_USERS - $num_users; @@ -60,10 +60,10 @@ /* Remove users which didn't login after receiving their registration information */ if (DB_TYPE == "pgsql") { - db_query($link, "DELETE FROM ttrss_users WHERE last_login IS NULL + db_query( "DELETE FROM ttrss_users WHERE last_login IS NULL AND created < NOW() - INTERVAL '1 day' AND access_level = 0"); } else { - db_query($link, "DELETE FROM ttrss_users WHERE last_login IS NULL + db_query( "DELETE FROM ttrss_users WHERE last_login IS NULL AND created < DATE_SUB(NOW(), INTERVAL 1 DAY) AND access_level = 0"); } @@ -74,9 +74,9 @@ if ($action == "check") { header("Content-Type: application/xml"); - $login = trim(db_escape_string($link, $_REQUEST['login'])); + $login = trim(db_escape_string( $_REQUEST['login'])); - $result = db_query($link, "SELECT id FROM ttrss_users WHERE + $result = db_query( "SELECT id FROM ttrss_users WHERE LOWER(login) = LOWER('$login')"); $is_registered = db_num_rows($result) > 0; @@ -95,10 +95,11 @@ Create new account - - - - + + + + +