shim.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. error_reporting(E_ALL);
  3. ini_set('display_errors', '1');
  4. $encriptKeyToUse = "key from Config.php (created while installation)";
  5. define("IN_MYBB", 1);
  6. define("NO_ONLINE", 1);
  7. require_once "./global.php";
  8. ob_start();
  9. if(!isset($_GET['op'])){
  10. if(isset($_GET['txt'])){
  11. header('Content-type: text/plain');
  12. }elseif(!isset($_GET['textmode'])){
  13. header('Content-type: text/javascript');
  14. }
  15. if($mybb->user['username']=="" || $mybb->user['isbannedgroup']){
  16. $nick = "Guest";
  17. $signature = "";
  18. }else{
  19. $nick = $mybb->user['username'];
  20. $signature = strtr(base64_encode((mcrypt_encrypt(MCRYPT_RIJNDAEL_256,$encriptKeyToUse,$nick,MCRYPT_MODE_ECB))),'+/=','-_,');
  21. }
  22. }
  23. ob_end_clean();
  24. if(isset($_GET['op'])){
  25. header('Content-type: text/plain');
  26. $id = $_GET['u'];
  27. $user = get_user((int) $id);
  28. if (base64_decode(strtr(($_GET['nick'],'-_,','+/='))==$user['username']){
  29. echo $user['usergroup'];
  30. }
  31. }else{
  32. if(isset($_GET['txt'])){
  33. echo $signature."\n".$nick."\n".$mybb->user['uid'];
  34. }elseif(isset($_GET['textmode'])){
  35. header('Location: http://chat.forum.acr.victorz.ca/textmode.php?login&nick='.urlencode($nick).'&sig='.urlencode($signature).'&id='.$mybb->user['uid']);
  36. }else{
  37. echo "signCallback('$signature','$nick','".$mybb->user['uid']."');";
  38. }
  39. }
  40. ?>