Took some functionality from php-login, made some major canges in whole project