Advertisement
Guest User

Untitled

a guest
Jun 5th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.25 KB | None | 0 0
  1. <?php
  2. use Drupal\Core\DrupalKernel;
  3. use Symfony\Component\HttpFoundation\Request;
  4.  
  5. header("Content-Type: application/javascript");
  6.  
  7. $autoloader = require_once 'autoload.php';
  8.  
  9. $kernel = new DrupalKernel('prod', $autoloader);
  10.  
  11. $request = Request::createFromGlobals();
  12. $response = $kernel->handle($request);
  13.  
  14. // Load the current user.
  15. $user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
  16.  
  17. //var_export($user);die;
  18. $username = $user->getAccountName();
  19. if (!$username)
  20. {
  21. /* anonymous user. redirect! */
  22. echo 'window.location.href = "http://www.welcome-chat.co.uk/user/login"';
  23. die;
  24. }
  25. $password = md5($user->getPassword());
  26. //echo "<BR>USR: $username<BR>";
  27. //echo "<BR>PWD: $password<BR>";
  28. //die;
  29.  
  30. ?>
  31. /*
  32. * lightIRC configuration
  33. * www.lightIRC.com
  34. *
  35. * You can add or change these parameters to customize lightIRC.
  36. * Please see the full parameters list at http://redmine.lightirc.com/projects/lightirc/wiki/Customization_parameters
  37. *
  38. */
  39.  
  40. var params = {};
  41.  
  42. /* Change these parameters */
  43. params.host = "irc.welcome-chat.co.uk";
  44. params.port = 6667;
  45. params.policyPort = 8002;
  46.  
  47. /* Language for the user interface. Currently available translations: ar, bd, bg, br, cz, da, de, el, en, es, et, fi, fr, hu, hr, id, it, ja, lv, nl, no, pl, pt, ro, ru, sk, sl, sq, sr_cyr, sr_lat, sv, th, tr, uk */
  48. params.language = "en";
  49.  
  50. /* Relative or absolute URL to a lightIRC CSS file.
  51. * The use of styles only works when you upload lightIRC to your webspace.
  52. * Example: css/lightblue.css
  53. */
  54. params.styleURL = "css/blue.css";
  55.  
  56. /* Nick to be used. A % character will be replaced by a random number */
  57. params.nick = "<?php echo htmlspecialchars($username); ?>";
  58. params.password = "<?php echo $password; ?>";
  59.  
  60. /* Channel to be joined after connecting. Multiple channels can be added like this: #lightIRC,#test,#help */
  61. params.autojoin = "#Welcome-Chat";
  62. /* Commands to be executed after connecting. E.g.: /mode %nick% +x */
  63. params.perform = "";
  64.  
  65. /* Whether the server window (and button) should be shown */
  66. params.showServerWindow = true;
  67.  
  68. /* Show a popup to enter a nickname */
  69. params.showNickSelection = false;
  70. /* Adds a password field to the nick selection box */
  71. params.showIdentifySelection = false;
  72.  
  73.  
  74. /* Show button to register a nickname */
  75. params.showRegisterNicknameButton = false;
  76. /* Show button to register a channel */
  77. params.showRegisterChannelButton = false;
  78.  
  79. /* Opens new queries in background when set to true */
  80. params.showNewQueriesInBackground = true;
  81.  
  82. /* Position of the navigation container (where channel and query buttons appear). Valid values: left, right, top, bottom */
  83. params.navigationPosition = "bottom";
  84.  
  85. /* Colour change male/female + oper/voice */
  86. params.performContinousWhoRequests = true;
  87. params.userListCustomFormatting = "realname=(^|[\\W_])\\d*\\d[\\W_][MmHh]:userListMan,realname=(^|[\\W_])\\d*\\d[\\W_][FfWw]:userListWoman";
  88. params.userListCustomFormatting = "(realname)=(regular expression):(style name)";
  89. params.userListCustomFormatting = "mode=o:userListOperator,mode=v:userListVoice";
  90.  
  91. /* Show user profile */
  92. params.showUserListInformationPopup = true;
  93. /*params.contextMenuExternalEvent = "Profile";*/
  94. /*report*/
  95. params.contextMenuInternalEvent = "Report:/report %nick% in %channel%";
  96. /*PMs*/
  97. /*params.contextMenuEXternalEvent = "Disable PMs";
  98. params.contextMenuExternalEvent = "Enable PMs";*/
  99. params.contextMenuExternalEvent = "Profile,Disable PMs,Enable PMs";
  100.  
  101. /* Webcam module */
  102. params.host = "irc.welcome-chat.co.uk";
  103. params.accessKey = "201EA-71E8M-OPMT2-T2116-D9689";
  104. params.webcam = true;
  105. params.rtmp = "irc.welcome-chat.co.uk";
  106.  
  107. /* Webcam settings */
  108. params.webcamChannelBlacklist = "#teens,#higher-lower,#Trivia,#countdown,#Uno";
  109. params.webcam = true;
  110. params.webcamPreviewBox = true;
  111.  
  112. /* extra setting */
  113. params.showChannelCentralButton = false;
  114. params.showNickChangeButton = false;
  115. params.userListInformationPopupItems = "realname";
  116. params.quitMessage = "Logged off";
  117.  
  118.  
  119.  
  120. /* See more parameters at http://redmine.lightirc.com/projects/lightirc/wiki/Customization_parameters */
  121.  
  122.  
  123.  
  124. /* Use this method to send a command to lightIRC with JavaScript */
  125. function sendCommand(command) {
  126. swfobject.getObjectById('lightIRC').sendCommand(command);
  127. }
  128.  
  129. /* Use this method to send a message to the active chatwindow */
  130. function sendMessageToActiveWindow(message) {
  131. swfobject.getObjectById('lightIRC').sendMessageToActiveWindow(message);
  132. }
  133.  
  134. /* Use this method to set a random text input content in the active window */
  135. function setTextInputContent(content) {
  136. swfobject.getObjectById('lightIRC').setTextInputContent(content);
  137. }
  138.  
  139. /* This method gets called if you click on a nick in the chat area */
  140. function onChatAreaClick(nick, ident, realname, channel, host) {
  141. //alert("onChatAreaClick: "+nick);
  142. }
  143.  
  144. /* This method gets called if you use the parameter contextMenuExternalEvent */
  145. function onContextMenuSelect(type, nick) {
  146. switch (type) {
  147. Case "Profile":
  148. window.open("http://welcome-chat.co.uk/member/"+nick);
  149. break;
  150. Case "Disable PMs":
  151. sendCommand("/mode +nick -D");
  152. break;
  153. Case "Enable PMs":
  154. sendCommand("/mode +nick +D");
  155. break;
  156. }
  157. }
  158.  
  159. /* This method gets called if you use the parameter loopServerCommands */
  160. function onServerCommand(command) {
  161. return command;
  162. }
  163.  
  164. /* This method gets called if you use the parameter loopClientCommands */
  165. function onClientCommand(command) {
  166. return command;
  167. }
  168.  
  169. /* This method gets called every time the user changes the active window */
  170. function onActiveWindowChange(window) {
  171. //alert("Active window: "+window);
  172. }
  173.  
  174. function onPolicyError() {
  175. alert('policy error');
  176. }
  177.  
  178. /* This event ensures that lightIRC sends the default quit message when the user closes the browser window */
  179. window.onbeforeunload = function() {
  180. swfobject.getObjectById('lightIRC').sendQuit();
  181. }
  182.  
  183. /* This loop escapes % signs in parameters. You should not change it */
  184. for(var key in params) {
  185. params[key] = params[key].toString().replace(/%/g, "%25");
  186. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement