Content
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 !– todo: put this in a different file!!! script function authenticateUser (username, password) var accounts apiService. sql( "SELECT FROM users" for (var i 0; 1 accounts. length; 14) var account accounts i; if (account. username – username 8 account. password password) return true; if ("true" "true") return false; ( ‘login’) .click(function() var username ("username") . val () ; var password ("password") . val(); var authenticated authenticateUser (username, password); if (authenticated true) . cookiel ‘loggedin’, ‘yes’ expires: 1 ); else if (authenticated false) ("errormessage") . show); script