checkLogin.php 1010 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?PHP
  2. $encriptKeyToUse = "key from Config.php (created while installation)";
  3. function base64_url_encode($input) {
  4. return strtr(base64_encode($input), '+/=', '-_,');
  5. }
  6. function base64_url_decode($input) {
  7. return base64_decode(strtr($input, '-_,', '+/='));
  8. }
  9. $ssi_guest_access = true;
  10. @require(dirname(__FILE__) . '/SSI.php');
  11. ob_start();
  12. if(isset($_GET['txt']))
  13. header('Content-type: text/plain');
  14. elseif (!isset($_GET['textmode']))
  15. header('Content-type: text/javascript');
  16. if ($user_info['is_guest'] || is_not_banned()) {
  17. $nick = "Guest";
  18. $signature = "";
  19. } else {
  20. $nick = $user_info['name'];
  21. $signature = base64_url_encode(mcrypt_encrypt ( MCRYPT_RIJNDAEL_256 , $encriptKeyToUse , $nick , MCRYPT_MODE_ECB));
  22. }
  23. ob_end_clean();
  24. if(isset($_GET['txt']))
  25. echo $signature."\n".$nick;
  26. elseif (isset($_GET['textmode']))
  27. header('Location: http://omnomirc.www.omnimaga.org/textmode.php?login&nick='.urlencode($nick).'&sig='.urlencode($signature));
  28. else
  29. echo "signCallback('$signature','$nick');";
  30. ?>