• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

/identify and internet explorer problem

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
15 posts • Page 1 of 1

Postby xanander » Wed Aug 23, 2006 4:15 pm

Hi again! :)

I've almost been able to get a fully working install now... today I tested the chat with two of my moderators and discovered a problem. When they typed /identify + password, their screen went blank. They had to rejoin the room to be able to see anything... I was able to see what they wrote, but they couldn't.

I haven't discovered this on my own because I use firefox, and everything works perfectly there. While they were on I tried logging on with IE myself, and experienced exactly the same problem.

I also tried the /rehash command but that also made the screen go blank and a new login is required... I was able to use the /rejoin command a few times, but none of the others were.

/privmsg + nick works fine, by the way.

I tips about what I can do to ensure that people with IE can be moderators and use the /identify command?
xanander
Member
 
Posts: 17
Joined: Mon Aug 21, 2006 8:35 pm
Top

Postby phpfreechat » Wed Aug 23, 2006 4:55 pm

Woow this is a big bug :)

Could you fill up the sourceforge bug report form ? I don't have any idea why it occurs so put it on sourceforge and I will not forgot it.

Thanks.

http://sourceforge.net/tracker/?group_i ... tid=809601
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby xanander » Wed Aug 23, 2006 5:26 pm

I have filled out the bug report now, and included my IE version just in case.

One question... is there a workaround for this? For example, maybe it is possible to give someone moderator rights without having to use the identify command... so that they are moderators if they manage to log in with a certain nick for example.

I would even be interested if it was possible to hard code it somewhere... the reason is that almost everyone on my site use internet explorer, it's still mainly us coders that use firefox :) ...and having moderators is sort of mandatory watching over a crowd like the one I have.

PS. the same problem occurs in IE if someone tries to change their nick if the nick_frozen param is used... i.e. if they try to enter a new nick in the javascript popup.

I have manually disabled the popup though, so I have no problems with this one any longer.
xanander
Member
 
Posts: 17
Joined: Mon Aug 21, 2006 8:35 pm
Top

Postby phpfreechat » Wed Aug 23, 2006 6:19 pm

xanander wrote:One question... is there a workaround for this? For example, maybe it is possible to give someone moderator rights without having to use the identify command... so that they are moderators if they manage to log in with a certain nick for example.

Yes, you can just set to true the isadmin parameter, ex :
Code: Select all
if (your_check_admin_function())
{
  $params["isadmin"] = true;
}
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby xanander » Fri Aug 25, 2006 6:37 pm

Thanks a lot! This solved the problem - I just pick the moderators out of my own db. The idea you presented here also enabled me to create a ban class that allows my moderators to ban anyone from 1 minute and upwards.
xanander
Member
 
Posts: 17
Joined: Mon Aug 21, 2006 8:35 pm
Top

Postby phpfreechat » Fri Aug 25, 2006 8:03 pm

Great, feel free to post your modified ban class on the contribution forum, it will certainly help a lot of other pfc users.

regards,
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby phpfreechat » Sat Aug 26, 2006 1:07 pm

The initial bug in fixed in the 706 subversion revision.
I found a workaround by moving the info message into the red error box.

Thanks you for the report.

Here is a patch for those who are hurry:
Code: Select all
Modified: trunk/src/client/pfcclient.js
===================================================================
--- trunk/src/client/pfcclient.js       2006-08-26 09:31:12 UTC (rev 705)
+++ trunk/src/client/pfcclient.js       2006-08-26 12:01:52 UTC (rev 706)
@@ -601,28 +601,26 @@

  displayMsg: function( cmd, msg )
  {
+    this.setError(msg);
+
+    // @todo find a better crossbrowser way to display messages
+/*
    // get the current selected tab container
    var tabid     = this.gui.getTabId();
    var container = this.gui.getChatContentFromTabId(tabid);

+    // to fix IE6 display bug
+    // http://sourceforge.net/tracker/index.php?func=detail&aid=1545403&group_id=158880&atid=809601
    div = document.createElement('div');
-    div.style.padding = "2px 5px 2px 5px";
-
-    pre = document.createElement('pre');
-    pre.setAttribute('class', 'pfc_info pfc_info_'+cmd);
-    pre.setAttribute('className', 'pfc_info pfc_info_'+cmd); // for IE6
-    //    Element.addClassName(pre, 'pfc_info');
-    //    Element.addClassName(pre, 'pfc_info_'+cmd);
-    pre.style.border  = "1px solid #555";
-    pre.style.padding = "5px";
-    pre.innerHTML = msg;
-    div.appendChild(pre);
-
+    // div.style.padding = "2px 5px 2px 5px"; // this will clear the screen in IE6
+    div.innerHTML = '<div class="pfc_info pfc_info_'+cmd+'" style="margin:5px">'+msg+'</div>';
+
    // finaly append this to the message list
    container.appendChild(div);
    this.gui.scrollDown(tabid, div);
+*/
  },
-
+
  handleComingRequest: function( cmds )
  {
    var msg_html = $H();

Modified: trunk/src/client/pfcgui.js
===================================================================
--- trunk/src/client/pfcgui.js  2006-08-26 09:31:12 UTC (rev 705)
+++ trunk/src/client/pfcgui.js  2006-08-26 12:01:52 UTC (rev 706)
@@ -561,16 +561,16 @@
      clist.appendChild(img);
    }

+    // error box : <p id="pfc_errors">
+    var errorbox = document.createElement('div');
+    errorbox.setAttribute('id', 'pfc_errors');
+    inputcontainer.appendChild(errorbox);
+
    // smiley box :  <div id="pfc_smileys">
    var smileybox = document.createElement('div');
    smileybox.setAttribute('id', 'pfc_smileys');
    inputcontainer.appendChild(smileybox);
    this.loadSmileyBox();
-
-    // error box : <p id="pfc_errors">
-    var errorbox = document.createElement('div');
-    errorbox.setAttribute('id', 'pfc_errors');
-    contentexp.appendChild(errorbox);
  }

 };

Modified: trunk/themes/default/style.css
===================================================================
--- trunk/themes/default/style.css      2006-08-26 09:31:12 UTC (rev 705)
+++ trunk/themes/default/style.css      2006-08-26 12:01:52 UTC (rev 706)
@@ -217,16 +217,13 @@

 div#pfc_errors {
  display: none;
-  margin-top: 5px;
-  padding: 2px;
-  height: 18px;
-
+  padding: 5px;
  border: 1px solid #555;
-  color: #FC4A1F;
-  background-color: #FFBA76;
-  text-align: center;
+  color: #EC4B0F;
+  background-color: #FFBB77;
  font-style: italic;
-  font-weight: bold;
+  font-family: monospace;
+  font-size: 90%;
 }

 /* commands */
@@ -243,12 +240,19 @@
 }

 /* commands info */
-pre.pfc_info {
+.pfc_info {
  color: #888;
+
+  /* to fix IE6 display bug */
+  /* http://sourceforge.net/tracker/index.php?func=detail&aid=1545403&group_id=158880&atid=809601 */
+  font-family: sans-serif; /* do NOT setup monospace font or it will not work in IE6 */
+
  font-style: italic;
  background-color: #EEE;
+  font-size: 80%;
 }

+
 div#pfc_colorlist {
  display: none;
 }
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby xanander » Sat Aug 26, 2006 6:09 pm

Excellent that you have found a solution! As for my ban class, I'm afraid it won't be much help to other users since it is a ban inside my own system (i.e. I haven't modified the pfc ban class).

What I have done is set up a ban system where my moderators can administer bans on any of my users for any lenght of time. This is possible, because access to the chat room is only possible after they have logged in on the site.

When they so later try to access the chat room, the chat.php file which initiates the chat room, checks whether there are any bans on this particular person trying to access the room. If there's no ban, he can enter it - if not he gets a message detailing when he can access it again.

This also works if the person that is being banned already is in the chat room. The reason this works is because of the "Error in XML response" issue discussed in a separate thread. Since chat.php is called repeatedly by each user, I can consequently use this XML error to both show the banned message and cut off the banned person's access to the room (since chat.php now produces whitespace, or in my case, an error message). The result is that he times out becuase of inactivity.
Last edited by xanander on Sat Aug 26, 2006 6:11 pm, edited 1 time in total.
xanander
Member
 
Posts: 17
Joined: Mon Aug 21, 2006 8:35 pm
Top

Postby cebronx » Mon Aug 28, 2006 8:45 pm

kerphi wrote:
xanander wrote:One question... is there a workaround for this? For example, maybe it is possible to give someone moderator rights without having to use the identify command... so that they are moderators if they manage to log in with a certain nick for example.

Yes, you can just set to true the isadmin parameter, ex :
Code: Select all
if (your_check_admin_function())
{
  $params["isadmin"] = true;
}


This code how exactly would you implemented. Take my code for example where would it go
Code: Select all
require_once "phpchat/src/phpfreechat.class.php"; // adjust to your own path
   $params = array();
    $params["serverid"] = md5(__FILE__); // used to identify the chat
   $params["channels"]       = array("CEBronx.ORG");
   $params["language"]      = "es_ES";
   $params["title"]          = "Capilla Evangelica del Bronx, Parker Street.";
   $params["nick"]           = $user;  // setup the intitial nickname
   $params["prefix"]         = "myprefix_";
   $params["frozen_nick"]    = true;     // do not allow to change the nickname
   $params["shownotice"]     = 3;        // 0 = nothing, 1 = just nickname changes, 2 = connect/quit, 3 = nick + connect/quit
   $params["max_nick_len"]   = 20;       // nickname length could not be longer than 10 caracteres
   $params["max_text_len"]   = 300;      // a message cannot be longer than 50 caracteres
   $params["refresh_delay"]  = 2000;     // chat refresh speed is 2 secondes (10000ms)
   $params["max_msg"]        = 15;       // max message in the history is 15 (message seen when reloading the chat)
   $params["height"]         = "230px";  // height of chat area is 230px
   $params["width"]          = "800px";  // width of chat area is 800px
    $chat = new phpFreeChat($params);

Thanks for the help.
Luis
cebronx
Member
 
Posts: 32
Joined: Mon Aug 28, 2006 3:22 am
Location: Bronx, NY
  • Website
Top

Postby phpfreechat » Mon Aug 28, 2006 8:58 pm

Humm in facte the real question is : are you able to know who is admin on your server ?
How do you identify admins and none admins ? by their nickname ?
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby cebronx » Mon Aug 28, 2006 9:01 pm

this is my users tables
Username
Password
Email
Description

The description determines if a user is an admin. Does this help? if you can help me understand how that piece of code works Im sure i will think of something. Thanks for the help.
Last edited by cebronx on Mon Aug 28, 2006 9:01 pm, edited 1 time in total.
Luis
cebronx
Member
 
Posts: 32
Joined: Mon Aug 28, 2006 3:22 am
Location: Bronx, NY
  • Website
Top

Postby phpfreechat » Mon Aug 28, 2006 9:03 pm

Hummm what does go in the "Description" field ?
A charactere string ?
ex: "admin" or "user" ?
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby cebronx » Mon Aug 28, 2006 9:04 pm

Yes, administrador for administrators and usurio for users.
Luis
cebronx
Member
 
Posts: 32
Joined: Mon Aug 28, 2006 3:22 am
Location: Bronx, NY
  • Website
Top

Postby phpfreechat » Mon Aug 28, 2006 9:08 pm

so suppose the Description field of the current user is stored in the $desc variable, just add this line :
Code: Select all
if ($desc == "administrators") $params["isadmin"] = true;

So the user who have "administrators" in the Description field will be automaticaly admin of the chat.
Admin means : allow to run /kick, /ban, /rehash commands.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby cebronx » Mon Aug 28, 2006 9:29 pm

Stephane, what kind I say but THANK YOU!!! Great!! great code. It probably would have taken me hours to figure that out. Just added it and it works great. Thats why it took me a little long to responnd back TOO HAPPY TESTING IT OUT. Thanks again. and until my next question.... :D
Luis
cebronx
Member
 
Posts: 32
Joined: Mon Aug 28, 2006 3:22 am
Location: Bronx, NY
  • Website
Top


Post a reply
15 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 15 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub