X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=register.php;h=a6f42c65df865aaf49ea2abf84961c1e2f915ee3;hb=fc1f0a6847c9c9fb4f265be85a3b66a5e4eb5b12;hp=0d714c225b7accaeb968e02a99fbd76a7ec7b4c8;hpb=00daf19e3722b988fe2d5db3349f0cb51883b80c;p=tt-rss.git diff --git a/register.php b/register.php index 0d714c22..a6f42c65 100644 --- a/register.php +++ b/register.php @@ -7,19 +7,19 @@ set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . get_include_path()); - require_once 'lib/phpmailer/class.phpmailer.php'; - + 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"); @@ -27,12 +27,12 @@ print ''; print " ".htmlspecialchars(SELF_URL_PATH . "/register.php")." - <?php echo get_site_title() ?> registration slots + Tiny Tiny RSS registration slots "; 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 - - - - + + + + +