• 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

Chat admins, moderators etc...

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

Post a reply
9 posts • Page 1 of 1

Postby curioustoknow » Wed Jun 24, 2009 5:49 pm

is this option available? I would like to set some users as moderators and some as admins to be able to ban people that ruin up the chat room.

thanks
curioustoknow
New member
 
Posts: 9
Joined: Wed Jun 24, 2009 5:48 pm
Top

Postby kp4e » Wed Jun 24, 2009 6:07 pm

i dont think there is
kp4e
Member
 
Posts: 13
Joined: Tue Jun 23, 2009 5:56 pm
  • Website
Top

Postby curioustoknow » Wed Jun 24, 2009 6:08 pm

then, how can someone monitor the chat room?
curioustoknow
New member
 
Posts: 9
Joined: Wed Jun 24, 2009 5:48 pm
Top

Postby OldWolf » Thu Jun 25, 2009 2:33 am

Yes there is... it's called an op. Admin can authenticate using a password, and then create "ops" by giving them operator status.

Here's how to set up admin:
http://www.phpfreechat.net/admin
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby curioustoknow » Thu Jun 25, 2009 6:40 pm

what file I need to use to change the settings? jpfchat.php ?
curioustoknow
New member
 
Posts: 9
Joined: Wed Jun 24, 2009 5:48 pm
Top

Postby Kelly » Thu Jun 25, 2009 9:10 pm

The first thing you have to do is set yourself up as an Admin so you can authenticate/login as an Admin. You do this by editing your index.php file as instructed in the link provided by OldWolf.

Once you have joined your chat as an Admin (by joining your chat with your Admin name and password as specified in the index.php file), you can give operator status to any user by using the chat command /op or take that status away using /deop See a full list of chat commands [url=http://www.phpfreechat.net/commands[/url]BE AWARE: Making someone an Op is the same as making them an Admin in terms of their power. They can do anything you can do and can take over your chat and lock you out of it - so make sure you fully trust anyone you want to make an Op. (of course, if they do this, you only have to log in to your server and edit the index.php file to change things back, but it's better to avoid this and only Op or Admin those you trust completely).

Lastly, if I'm not mistaken, using the /op command only gives them Op status while they're logged in. Once they time out or log out, they will have to be re-opped. You or another Admin must be in the chat when your Op enters in order to provide the Op status.

To make someone a permanent Op (i.e. an Admin), so that they can be an Admin whether you are there or not, edit your index.php file the same way you did to set your self up with Admin status initially - again by following the instructions in the link provided by OldWolf.

Do yourself a huge favor and read all of the documentation files on the left side of the page, and read through the various posts here in the forum to learn more about setting up your chat before you do anything else with it.
Kelly
Member
 
Posts: 20
Joined: Thu May 07, 2009 4:59 am
Top

Postby curioustoknow » Fri Jun 26, 2009 2:04 am

Hello there,

thank you for your posts, my php file is kinda different than the parameters that need to be changed, Sorry I did not find a way to attach the file so here it is below:
Code: Select all
<?php

/**

 * jPFChat - A joomla chatroom component

 * NOTE: This component uses the phpFreeChat script.    We did NOT write phpFreeChat.

 *       Please see phpfreechat.net if you have questions or issues about the chat script itself.

 * @version $Id: jPFChat.php

 * @author Vizimetrics, Inc (Tim Milo)

 * @link http://www.jPFChat.com

 * @copyright (C) 2008 ViziMetrics, Inc - All rights reserved.

 * @license GNU/GPL License

 */



(defined( '_VALID_MOS' ) or defined ( '_JEXEC' )) or die ( 'Restricted Access' );



if (defined ( '_JEXEC' )) {

        global $mainframe;

        $database =&JFactory::getDBO();

        JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/'.$option.'/tables');

//        $Upath = "http://".$_SERVER['SERVER_NAME'].str_replace("//","/",JURI::base(true)."/");

        $Upath = str_replace("//","/",JURI::base(true)."/");

        $Fpath = JPATH_SITE;

        $user =  &JFactory::getUser();

} else {

        global $database, $my, $mosConfig_live_site, $mosConfig_absolute_path;

        $Upath = $mosConfig_live_site."/";

        $Fpath = $mosConfig_absolute_path;

        $user =  $mainframe->getUser();

}

$name           = $user->name;

$uname          = $user->username;

$user_level     = $user->gid;



$database->setQuery("SELECT * FROM #__jpfchat");

$rows = $database->loadObjectList();



// set up the chat operating parameters

$skip_proxies = array();

foreach ($rows as $row) {

    if ($row->name == 'name_or_uname') {

         $displayChoice = $row->value;

    } elseif ($row->name == 'display_PoweredBy') {

         $show_PoweredBy = ($row->value==1 ? true : false);

    } elseif ($row->name == 'allowed_level') {

         $allowed_level = $row->value;

    } elseif ($row->name == 'mysql_file') {

         $jPFCparams['container_type'] = $row->value;

    } elseif ($row->name == 'admin_password') {

         $admin_password = $row->value;

    } elseif ($row->name == 'channels') {

         $jPFCparams['channels']  = explode(",", $row->value);

    } elseif ($row->name == 'shownotice') {

         $jPFCparams['shownotice'] = (int)$row->value;

   } elseif ($row->name == 'noLog') {   

       if ($row->value=='0') $skip_proxies[]  = 'log';

    } elseif ($row->name == 'noFlood0') {

         if ($row->value=='0') $skip_proxies[]  = 'noflood';

    } elseif ($row->name == 'noFlood1') {

         $jPFCparams['proxies_cfg']['noflood']['charlimit'] = (int)$row->value;

    } elseif ($row->name == 'noFlood2') {

         $jPFCparams['proxies_cfg']['noflood']['msglimit'] = (int)$row->value;

    } elseif ($row->name == 'noFlood3') {

         $jPFCparams['proxies_cfg']['noflood']['delay'] = (int)$row->value;

    } elseif ($row->name == 'censor0') {

         if ($row->value=='0') $skip_proxies[]  = 'censor';

    } elseif ($row->name == 'censor1') {

         $jPFCparams['proxies_cfg']['censor']['words'] = explode(",",str_replace(" ","",$row->value));

    } elseif ($row->name == 'censor2') {

         $jPFCparams['proxies_cfg']['censor']['replaceby'] = $row->value;

   } elseif ($row->name == 'redirectPage') {

       $redirectPage = $row->value;

   } else {

         if ($row->type == 'B') {

                if ($row->value == '1') $jPFCparams[$row->name] = true;

                if ($row->value == '0') $jPFCparams[$row->name] = false;

         } elseif (($row->type == 'N')&&(is_intval($row->value))) {

                    $jPFCparams[$row->name] = (int)$row->value;

         } else {

                $jPFCparams[$row->name] = $row->value;

         }

    }

}

$jPFCparams['skip_proxies'] = $skip_proxies;



// get the joomla username.  Decide if admin priviledges will be granted within jPFChat.

$jPFCparams['nick'] = '';

$pos = strpos($jPFCparams['isadmin'], $uname);   

$jPFCparams['isadmin'] = false;

if (strlen($uname)>=1) {

   //set isadmin to false to handle all non-authorized users

   if ( $pos !== false) $jPFCparams['isadmin'] = true;

   $jPFCparams['nick'] = (($displayChoice == "Name") ? $name : $uname );

}

$jPFCparams['admins']= array($uname => $admin_password);



if ($jPFCparams['container_type'] == "Mysql") {

    // get all the db info from the joomla configuration.php file so we can access it directly from phpFreeChat

    require_once ($Fpath."/configuration.php");

    $jPFCparams["container_cfg_mysql_port"] = 3306;

   if (defined ( '_JEXEC' )) {

      $conf = new JConfig;

      $jPFCparams['container_cfg_mysql_host']    = $conf->host;

      $jPFCparams['container_cfg_mysql_database'] = $conf->db;

      $jPFCparams['container_cfg_mysql_username'] = $conf->user;

      $jPFCparams['container_cfg_mysql_password'] = $conf->password;

      $jPFCparams['container_cfg_mysql_table']    = $conf->dbprefix."jpfchatx";

   } else {

      $jPFCparams['container_cfg_mysql_host']    = $mosConfig_host;

      $jPFCparams['container_cfg_mysql_database'] = $mosConfig_db;

      $jPFCparams['container_cfg_mysql_username'] = $mosConfig_user;

      $jPFCparams['container_cfg_mysql_password'] = $mosConfig_password;

      $jPFCparams['container_cfg_mysql_table']    = $mosConfig_dbprefix."jpfchatx";

   }

}



// set the jPFChat paths for proper operation in Joomla

$jPFCparams['data_private_path']  = $Fpath."/components/com_jpfchat/pfc/data/private";

$jPFCparams['data_public_path']   = $Fpath."/components/com_jpfchat/pfc/data/public";

$jPFCparams['client_script_path'] = $Fpath."/components/com_jpfchat/jpfchat.php";

$jPFCparams['server_script_path'] = $Fpath."/components/com_jpfchat/jpfchat.php";

$jPFCparams['data_public_url']    = $Upath."components/com_jpfchat/pfc/data/public";

$jPFCparams['mootoolsjs_url']     = $Upath."components/com_jpfchat/pfc/data/public/js/mootools.js";



if (empty($jPFCparams['server_script_url']))  {

   if (defined ( '_JEXEC' )) {

      $jPFCparams['server_script_url'] =  JRoute::_("index.php?option=com_jpfchat");

    } else {

      $jPFCparams['server_script_url'] =  sefRelToAbs("index.php?option=com_jpfchat");

   }

}



$jPFCparams['dyn_params'] = array('server_script_url','data_public_url','mootoolsjs_url');



// set userlevel preferences      

if ((int)$user_level >= (int)$allowed_level) {

   require_once $Fpath."/components/com_jpfchat/pfc/src/phpfreechat.class.php";

   $chat = new phpFreeChat($jPFCparams);

   //Add in a fix to make jPFChat compatible with IE8 by forcing IE7 compatibility mode.

   if (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 8")) {header("X-UA-Compatible: IE=7");}

   $chat->printChat();



} else {

    if (isset($redirectPage)) {   

        if (defined ( '_JEXEC' ))  {

            $mainframe->redirect( $redirectPage );

        } else {

            mosRedirect( $redirectPage );

        }      

    } else {

       echo "<p align='center'><font size=2 face=tahoma>You are not authorized to view this resource!</font></p>";

   }

}

//*** NOTE: YOU MAY NOT REMOVE OR COMMENT OUT THE FOLLOWING LINE WITHOUT EXPRESS WRITTEN CONSENT FROM VIZIMETRICS, INC REPRESENTATIVES!

if ($show_PoweredBy) echo "<br /><p align='center'><font size=2 face=tahoma>Powered by <a href='http://www.jpfchat.com'><font size=2 face=tahoma>jPFChat</font></a> for Joomla!</font></p>";

//************************************************************************************************************



function is_intval($a) {

   return ((string)$a === (string)(int)$a);

}

?>

OldWolf: Please use code tags
Last edited by curioustoknow on Fri Jun 26, 2009 2:05 am, edited 1 time in total.
curioustoknow
New member
 
Posts: 9
Joined: Wed Jun 24, 2009 5:48 pm
Top

Postby OldWolf » Fri Jun 26, 2009 7:50 am

Well, it's not our code, so I can't really support it... but it looks like your system grants admin automatically if you're logged in as an admin on teh site. If not, you should be able to use /identify "password" where "password" is replaced with "your password".
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby hazefm » Tue Aug 18, 2009 2:39 am

Oldwolf:
I'm trying to figure out away to make a command I'm writing just for ops, is there a piece code that I can use to make sure that the chatter that issues the command is an operator?

I noticed that some of the commands already do this, but when looking through the code of the commands, I didn't notice anything that would filter the user's permissions.
hazefm
Member
 
Posts: 13
Joined: Tue Aug 18, 2009 2:35 am
Top


Post a reply
9 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 19 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