shim.php 1.0 KB

1234567891011121314151617181920212223242526272829303132
  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. }
  17. if($user_info['is_guest'] || is_not_banned()){
  18. $nick = "Guest";
  19. $signature = "";
  20. }else{
  21. $nick = $user_info['name'];
  22. $signature = base64_url_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256,$encriptKeyToUse,$nick,MCRYPT_MODE_ECB));
  23. }
  24. ob_end_clean();
  25. if(isset($_GET['txt'])){
  26. echo $signature."\n".$nick;
  27. }elseif(isset($_GET['textmode']))}{
  28. header('Location: http://omnomirc.www.omnimaga.org/textmode.php?login&nick='.urlencode($nick).'&sig='.urlencode($signature));
  29. }else{
  30. echo "signCallback('$signature','$nick');";
  31. }
  32. ?>