Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use Drupal\Core\DrupalKernel;
- use Symfony\Component\HttpFoundation\Request;
- header("Content-Type: application/javascript");
- $autoloader = require_once 'autoload.php';
- $kernel = new DrupalKernel('prod', $autoloader);
- $request = Request::createFromGlobals();
- $response = $kernel->handle($request);
- // Load the current user.
- $user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
- //var_export($user);die;
- $username = $user->getAccountName();
- if (!$username)
- {
- /* anonymous user. redirect! */
- echo 'window.location.href = "http://www.welcome-chat.co.uk/user/login"';
- die;
- }
- $password = md5($user->getPassword());
- //echo "<BR>USR: $username<BR>";
- //echo "<BR>PWD: $password<BR>";
- //die;
- ?>
- /*
- * lightIRC configuration
- * www.lightIRC.com
- *
- * You can add or change these parameters to customize lightIRC.
- * Please see the full parameters list at http://redmine.lightirc.com/projects/lightirc/wiki/Customization_parameters
- *
- */
- var params = {};
- /* Change these parameters */
- params.host = "irc.welcome-chat.co.uk";
- params.port = 6667;
- params.policyPort = 8002;
- /* 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 */
- params.language = "en";
- /* Relative or absolute URL to a lightIRC CSS file.
- * The use of styles only works when you upload lightIRC to your webspace.
- * Example: css/lightblue.css
- */
- params.styleURL = "css/blue.css";
- /* Nick to be used. A % character will be replaced by a random number */
- params.nick = "<?php echo htmlspecialchars($username); ?>";
- params.password = "<?php echo $password; ?>";
- /* Channel to be joined after connecting. Multiple channels can be added like this: #lightIRC,#test,#help */
- params.autojoin = "#Welcome-Chat";
- /* Commands to be executed after connecting. E.g.: /mode %nick% +x */
- params.perform = "";
- /* Whether the server window (and button) should be shown */
- params.showServerWindow = true;
- /* Show a popup to enter a nickname */
- params.showNickSelection = false;
- /* Adds a password field to the nick selection box */
- params.showIdentifySelection = false;
- /* Show button to register a nickname */
- params.showRegisterNicknameButton = false;
- /* Show button to register a channel */
- params.showRegisterChannelButton = false;
- /* Opens new queries in background when set to true */
- params.showNewQueriesInBackground = true;
- /* Position of the navigation container (where channel and query buttons appear). Valid values: left, right, top, bottom */
- params.navigationPosition = "bottom";
- /* Colour change male/female + oper/voice */
- params.performContinousWhoRequests = true;
- params.userListCustomFormatting = "realname=(^|[\\W_])\\d*\\d[\\W_][MmHh]:userListMan,realname=(^|[\\W_])\\d*\\d[\\W_][FfWw]:userListWoman";
- params.userListCustomFormatting = "(realname)=(regular expression):(style name)";
- params.userListCustomFormatting = "mode=o:userListOperator,mode=v:userListVoice";
- /* Show user profile */
- params.showUserListInformationPopup = true;
- /*params.contextMenuExternalEvent = "Profile";*/
- /*report*/
- params.contextMenuInternalEvent = "Report:/report %nick% in %channel%";
- /*PMs*/
- /*params.contextMenuEXternalEvent = "Disable PMs";
- params.contextMenuExternalEvent = "Enable PMs";*/
- params.contextMenuExternalEvent = "Profile,Disable PMs,Enable PMs";
- /* Webcam module */
- params.host = "irc.welcome-chat.co.uk";
- params.accessKey = "201EA-71E8M-OPMT2-T2116-D9689";
- params.webcam = true;
- params.rtmp = "irc.welcome-chat.co.uk";
- /* Webcam settings */
- params.webcamChannelBlacklist = "#teens,#higher-lower,#Trivia,#countdown,#Uno";
- params.webcam = true;
- params.webcamPreviewBox = true;
- /* extra setting */
- params.showChannelCentralButton = false;
- params.showNickChangeButton = false;
- params.userListInformationPopupItems = "realname";
- params.quitMessage = "Logged off";
- /* See more parameters at http://redmine.lightirc.com/projects/lightirc/wiki/Customization_parameters */
- /* Use this method to send a command to lightIRC with JavaScript */
- function sendCommand(command) {
- swfobject.getObjectById('lightIRC').sendCommand(command);
- }
- /* Use this method to send a message to the active chatwindow */
- function sendMessageToActiveWindow(message) {
- swfobject.getObjectById('lightIRC').sendMessageToActiveWindow(message);
- }
- /* Use this method to set a random text input content in the active window */
- function setTextInputContent(content) {
- swfobject.getObjectById('lightIRC').setTextInputContent(content);
- }
- /* This method gets called if you click on a nick in the chat area */
- function onChatAreaClick(nick, ident, realname, channel, host) {
- //alert("onChatAreaClick: "+nick);
- }
- /* This method gets called if you use the parameter contextMenuExternalEvent */
- function onContextMenuSelect(type, nick) {
- switch (type) {
- Case "Profile":
- window.open("http://welcome-chat.co.uk/member/"+nick);
- break;
- Case "Disable PMs":
- sendCommand("/mode +nick -D");
- break;
- Case "Enable PMs":
- sendCommand("/mode +nick +D");
- break;
- }
- }
- /* This method gets called if you use the parameter loopServerCommands */
- function onServerCommand(command) {
- return command;
- }
- /* This method gets called if you use the parameter loopClientCommands */
- function onClientCommand(command) {
- return command;
- }
- /* This method gets called every time the user changes the active window */
- function onActiveWindowChange(window) {
- //alert("Active window: "+window);
- }
- function onPolicyError() {
- alert('policy error');
- }
- /* This event ensures that lightIRC sends the default quit message when the user closes the browser window */
- window.onbeforeunload = function() {
- swfobject.getObjectById('lightIRC').sendQuit();
- }
- /* This loop escapes % signs in parameters. You should not change it */
- for(var key in params) {
- params[key] = params[key].toString().replace(/%/g, "%25");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement