Phonegap login system