Chat module

Post modules, themes or any other code you want to share with the community.

Moderator: Developers

Was the install hard ?

Poll ended at Tue Oct 05, 2004 1:44 pm

yes
1
14%
no
6
86%
 
Total votes: 7
nomadcf
Posts: 14
Joined: Tue Jul 06, 2004 10:20 pm

Chat module

Postby nomadcf » Wed Jul 07, 2004 1:44 pm

I'm made this module so that my coworkers can chat a little while there getting there mail and what not. It requires NO deamon or extra services
But it does require that your using mysql as your DB server for GO.

(I've just started rewriting justchats the code so it can use any DB, but i just started on that.);

you can get it at : http://www.nomadcf.com/downloads/group-office/chat.tgz

After DL'ing it just untar and gzip it into the modules dir. and login as adain and install it :) As long as you've already mod'ed / replaced all the footer.php's your all set !! enjoy.

IT does require you to change all your footer.php files. OR DL a premodded form :
http://www.nomadcf.com/downloads/group-office/footer.tgz
and replace all the footer.php's with this one. (don't forget to back up 1st !!!)


This will allow modules to have there Icons displayed in the footer of a theme with out have to edit the images.inc

Temp fix until i come up with a better way.

Change line 20 in all the footer.php in all your themes dir.

from :

$GO_THEME->images[$module['id']] = isset($GO_THEME->images[$module['id']]) ? $GO_THEME->images[$module['id']] : $GO_THEME->images['unknown'];

to :

if ($GO_THEME->images[$module['id']]) {
$GO_THEME->images[$module['id']];
} else {
if (!file_exists('../../../../'.$module['url'].'menu_'.$module['id'].'.png')) {
$GO_THEME->images['unknown'];
} else {
$GO_THEME->images[$module['id']] = $module['url'].'menu_'.$module['id'].'.png';
}
}
User avatar
zimba
Posts: 32
Joined: Wed May 26, 2004 2:50 pm

Postby zimba » Wed Jul 07, 2004 7:25 pm

Nice module nomadcf :)

I had one little problem with the "lush" theme :

Replace on line 19 :

Code: Select all

$GO_THEME->images[$module['id']] = isset($GO_THEME->images[$module['id']]) ? $GO_THEME->images[$module['id']] :


With

Code: Select all

if ($GO_THEME->images[$module['id']]) {
$GO_THEME->images[$module['id']];
} else {
if (!file_exists('../../'.$module['url'].'menu_'.$module['id'].'.png')) {
$GO_THEME->images['unknown'];
} else {
$GO_THEME->images[$module['id']] = $module['url'].'menu_'.$module['id'].'.png';
}:
}


Notice the ../../ is shorter
User avatar
ttimalsina
Posts: 56
Joined: Thu Apr 22, 2004 5:23 pm
Location: San Francisco, California, USA

Postby ttimalsina » Sat Jul 10, 2004 9:10 am

Thank you for the Chat Module nomadcf.

I have had it working just fine with easy installation, but today I am screwed up. I added a new skin and tried to load it, and for some reason it didn't work. I completely deleted GO and reinstalled GO as fresh. Now chat and all other modules work but EMAIL stopped working!!!!!!!

I talked to my web host and they don't have the answer either since the email module was working just fine few hours ago!!!

BTW good chat module. I am trying to implement PHP chat module. I don't know how hard it will be.

Yours is working fine as well, but if the message is too long, it does not get delevered on 56K quite often! So, we might need to come up with PHP chat system.

Thank you again for sharing it to GO Community.
:wink:
Regards,
Tim
mschering
Site Admin
Site Admin
Posts: 8154
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Great work!

Postby mschering » Sat Jul 10, 2004 9:22 am

Great work nomadcf. Nice module and not hard to install at all.

Thanks for sharing
Best regards,

Merijn Schering
Intermesh
ComSubVie
Group-Office Developer
Group-Office Developer
Posts: 214
Joined: Tue Apr 20, 2004 1:45 pm
Location: Vienna, Austria
Contact:

Postby ComSubVie » Mon Jul 26, 2004 9:04 pm

ttimalsina wrote:Yours is working fine as well, but if the message is too long, it does not get delevered on 56K quite often! So, we might need to come up with PHP chat system.

Thank you again for sharing it to GO Community.
:wink:


Plans are to implement a Module based on Jabber - so you do not need to use the GO chat but can also use an external client. And Jabber should use the GO user database for authentication (which definitly works with LDAP, I'm not sure about SQL). But don't ask for a timeframe ;-)
Guest

Postby Guest » Mon Jul 26, 2004 9:08 pm

ComSubVie,

Thank you for the update on Chat Module.

Regards,
Tim
Guest

Something wrong with code correction

Postby Guest » Thu Aug 26, 2004 3:19 pm

it's seem that code correction is wrong for me... im never able to make the chat icon appearing in theme at all... all the rest of the inatallation seem to goes well except that icon problem ...

if ($GO_THEME->images[$module['id']]) {
$GO_THEME->images[$module['id']];
} else {
if (!file_exists('../../'.$module['url'].'menu_'.$module['id'].'.png')) {
$GO_THEME->images['unknown'];
} else {
$GO_THEME->images[$module['id']] = $module['url'].'menu_'.$module['id'].'.png';
}:
}
albatroz
Posts: 21
Joined: Sun May 16, 2004 9:04 pm
Location: Peru
Contact:

Postby albatroz » Tue Oct 05, 2004 5:17 pm

Is there any possibility that we could have this flash chat module
inside the main GO installer?
s.dudkiewicz
Posts: 3
Joined: Mon Feb 06, 2012 9:37 am

Re: Chat module

Postby s.dudkiewicz » Mon Feb 06, 2012 12:18 pm

Kjmiami23
Posts: 56
Joined: Wed Feb 15, 2012 6:01 pm

Re: Chat module

Postby Kjmiami23 » Sun Feb 19, 2012 8:11 pm

Hi,

Could you reupload the chat module please, that would be amazing.

Thank you.
capecodchronicle
Posts: 2
Joined: Fri Apr 05, 2013 4:09 pm

Re: Chat module

Postby capecodchronicle » Tue Jul 09, 2013 6:32 pm

Kjmiami23 wrote:Hi,

Could you reupload the chat module please, that would be amazing.

Thank you.


I agree! I'd love to try it! :)
mcl.mmu
Posts: 3
Joined: Fri Jun 13, 2014 9:25 am

Re: Chat module

Postby mcl.mmu » Fri Jun 13, 2014 9:27 am

me to. please re-up this.
mschering
Site Admin
Site Admin
Posts: 8154
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Chat module

Postby mschering » Tue Jun 17, 2014 12:46 pm

We're working on a new chat module in 6.0.Will be ready in a month or so.
Best regards,



Merijn Schering

Intermesh
gaarch
Posts: 1
Joined: Wed Feb 26, 2014 9:17 pm

Re: Chat module

Postby gaarch » Thu Jun 19, 2014 7:49 pm

Looking forward for the chat module in version 6 :D
invicta
Posts: 1
Joined: Fri Apr 25, 2014 8:25 am

Re: Chat module

Postby invicta » Wed Sep 17, 2014 2:03 pm

Hi, I have a problem with chat module. During installation I used this official HowTo: http://groupoffice.blogspot.com/2014/05/setting-up-chat-server-with-prosody-and.html

I cannot to login to the chat. I have a login windows, where i type someuser@groupoffice-invicta.pl, password, and that's it. The login "ring" go round a round a round....

Logs /var/log/prosody/prosody.log

Code: Select all

Sep 17 15:34:37 general info    Hello and welcome to Prosody version 0.9.4
Sep 17 15:34:37 general info    Prosody is using the select backend for connection handling
Sep 17 15:34:37 portmanager     info    Activated service 's2s' on [::]:5269, [*]:5269
Sep 17 15:34:37 portmanager     info    Activated service 'c2s' on [::]:5222, [*]:5222
Sep 17 15:34:37 portmanager     info    Activated service 'legacy_ssl' on no ports
Sep 17 15:34:37 groupoffice-invicta.pl:groups   info    Groups loaded successfully
Sep 17 15:34:37 mod_posix       info    Prosody is about to detach from the console, disabling further console output
Sep 17 15:34:37 mod_posix       info    Successfully daemonized to PID 6620
Sep 17 15:34:37 portmanager     info    Activated service 'http' on [::]:5280, [*]:5280
Sep 17 15:34:37 portmanager     info    Activated service 'https' on [::]:5281, [*]:5281
Sep 17 15:41:52 mod_bosh        info    New BOSH session, assigned it sid '43d1592b-bd1b-4a31-9b58-bcac57c91ba6'


Prosody status

Code: Select all

prosodyctl status
Prosody is running with PID 6620




My /etc/prosody/prosody.cfg.lua file

Code: Select all

admins = { }
modules_enabled = {
        -- Generally required
                "roster"; -- Allow users to have a roster. Recommended ;)
                "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
                "tls"; -- Add support for secure TLS on c2s/s2s connections
                "dialback"; -- s2s dialback support
                "disco"; -- Service discovery
                "posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
        -- Not essential, but recommended
                "private"; -- Private XML storage (for room bookmarks, etc.)
                "vcard"; -- Allow users to set vCards
        -- These are commented by default as they have a performance impact
                --"privacy"; -- Support privacy lists
                --"compression"; -- Stream compression (requires the lua-zlib package installed)
        -- Nice to have
                "version"; -- Replies to server version requests
                "uptime"; -- Report how long server has been running
                "time"; -- Let others know the time here on this server
                "ping"; -- Replies to XMPP pings with pongs
                "pep"; -- Enables users to publish their mood, activity, playing music and more
"register"; -- Allow users to register on this server using a client and change passwords
        -- Admin interfaces
                "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands
                --"admin_telnet"; -- Opens telnet console interface on localhost port 5582
        -- HTTP modules
                "bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
                --"http_files"; -- Serve static files from a directory over HTTP
        -- Other specific functionality
                "groups"; -- Shared roster support
                --"announce"; -- Send announcement to all online users
                --"welcome"; -- Welcome users who register accounts
                --"watchregistrations"; -- Alert admins of registrations
                --"motd"; -- Send a message to users when they log in
                --"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
};
modules_disabled = {
        -- "offline"; -- Store offline messages
        -- "c2s"; -- Handle client connections
        -- "s2s"; -- Handle server-to-server connections
};
allow_registration = false;
ssl = {
                key = "/etc/prosody/certs/group-office.com.key";
                certificate = "/etc/prosody/certs/group-office.com.crt";
        }
c2s_require_encryption = false
s2s_secure_auth = false
pidfile = "/var/run/prosody/prosody.pid"
authentication = "external"
external_auth_command = "/usr/local/bin/GroupOfficeProsodyAuth.php"
external_auth_protocol = "generic"
cross_domain_bosh = true
log = {
        info = "/var/log/prosody/prosody.log"; -- Change 'info' to 'debug' for verbose logging
        error = "/var/log/prosody/prosody.err";
        "*syslog";
}
VirtualHost "groupoffice-invicta.pl"
        groups_file = "/home/groupoffice/chat/groups.txt";
        -- Assign this host a certificate for TLS, otherwise it would use the one
        -- set in the global section (if any).
        -- Note that old-style SSL on port 5223 only supports one certificate, and will always
        -- use the global one.
        ssl = {
                key = "/etc/prosody/certs/group-office.com.key";
                certificate = "/etc/prosody/certs/group-office.com.crt";
        }
Component "conference.groupoffice-invicta.pl" "muc"

Group File

Code: Select all

ls /home/groupoffice/chat/groups.txt
/home/groupoffice/chat/groups.txt

SSL files

Code: Select all

ls /etc/prosody/certs/group-office.com.*
/etc/prosody/certs/group-office.com.crt  /etc/prosody/certs/group-office.com.key

/usr/local/bin/GroupOfficeProsodyAuth.php File

Code: Select all

#!/usr/bin/php
<?php
/**
 * Group-Office
 *
 * Copyright Intermesh BV.
 * This file is part of Group-Office. You should have received a copy of the
 * Group-Office license along with Group-Office. See the file /LICENSE.TXT
 *
 * If you have questions write an e-mail to info@intermesh.nl
 *
 * @license AGPL/Proprietary http://www.group-office.com/LICENSE.TXT
 * @link http://www.group-office.com
 * @copyright Copyright Intermesh BV
 * @version $Id: GroupOfficeProsodyAuth.php 17690 2014-06-17 07:02:34Z mschering $
 * @author Merijn Schering
 * @package GO.base
 *
 * test:
 *
 * auth:username:groupoffice.domain.com:password
 */

// the logfile to which to write, should be writeable by the user which is running the server
$sLogFile  = "/var/log/prosody/prosody.log";

// set true to debug if needed
$bDebug  = true;

$oAuth = new exAuth($sLogFile, $bDebug);

class exAuth
{

 private $sLogFile;

 private $bDebug;

 private $rLogFile;

 private function _includeGO($server){
  //Try to detect a host based
  if(class_exists('GO')){
   return true;
  }
  if(file_exists('/var/www/htdocs/groupoffice-pro/config.php')){
   define('GO_CONFIG_FILE', '/var/www/htdocs/groupoffice-pro/config.php');
   require(GO_CONFIG_FILE);
   require_once($config['root_path'].'GO.php');
  }else
  {

   require_once('/var/www/htdocs/groupoffice-pro/GO.php');
  }
 
  $this->writeDebugLog("Config file: ".GO::config()->get_config_file()." db: ".GO::config()->db_name." ".GO::config()->debug);
 }
 
 public function __construct($sLogFile, $bDebug)
 {

  $this->sLogFile  = $sLogFile;
  $this->bDebug  = $bDebug;
 
  $this->rLogFile = fopen($this->sLogFile, "a") or die("Error opening log file: ". $this->sLogFile);

  $this->writeLog("start");

  do { 
   $sData = substr(fgets(STDIN),0,-1);
   
   if($sData){
   
    $this->writeDebugLog("received data: ". $sData);
    $aCommand = explode(":", $sData);
    if (is_array($aCommand)){
     switch ($aCommand[0]){
      case "isuser":
       if (!isset($aCommand[1])){
        $this->writeLog("invalid isuser command, no username given");
        $this->failure();
       } else {
   
        $sUser = str_replace(array("%20", "(a)"), array(" ", "@"), $aCommand[1]);
        $this->writeDebugLog("checking isuser for ". $sUser);

        $this->_includeGO($aCommand[2]);
        $user = \GO\Base\Model\User::model()->findSingleByAttribute('username', $sUser);

        if ($user){       
         $this->writeLog("valid user: ". $sUser);
         
         $this->success();

        } else {
         $this->writeLog("invalid user: ". $sUser);
         $this->failure();
        }
       
       
       }
      break;
      case "auth":
       
       if (sizeof($aCommand) != 4){
        $this->writeLog("invalid auth command, data missing");
        $this->failure();
       } else {
       

        $sUser = str_replace(array("%20", "(a)"), array(" ", "@"), $aCommand[1]);
        $sPassword = $aCommand[3];
        $this->writeDebugLog("doing auth for ". $sUser);



        $this->_includeGO($aCommand[2]);

        $user = \GO::session()->login($sUser, $sPassword, false);

     
        if ($user) {
     
         $this->writeLog("authentificated user ". $sUser ." domain ". $aCommand[2]);
         $this->success();
        } else {
     
         $this->writeLog("authentification failed for user ". $sUser ." domain ". $aCommand[2]);
         $this->failure();
        }
       
       }
      break;
      case "setpass":
       // postavljanje zaporke, onemoguceno
       $this->writeLog("setpass command disabled");
       $this->failure();
      break;
      default:
       // ako je uhvaceno ista drugo
       $this->writeLog("unknown command ". $aCommand[0]);
       $this->failure();
      break;
     }
    } else {
     $this->writeDebugLog("invalid command string");
     $this->failure();
    }
   }

   unset($aCommand);
  } while (true);
 }

 public function __destruct()
 {
  $this->writeLog("stop"); 
 }

 private function writeLog($sMessage)
 {
  if (is_resource($this->rLogFile)) {
   fwrite($this->rLogFile, date("r") ." [external_auth] ". $sMessage ."\n");
  }
 }

 private function writeDebugLog($sMessage)
 {
  if ($this->bDebug){
   $this->writeLog( date("r")." [external_auth_debug] ".$sMessage);
  }
 }
 
 
 private function success(){
  echo "1\n";
  if(class_exists('\GO')){
   \GO::unsetDbConnection();
  }

 }
 
 private function failure(){
  echo "0\n";
  if(class_exists('\GO')){
   \GO::unsetDbConnection();
  }
 }


 
}

My groupoffice website root directory

Code: Select all

ls /var/www/htdocs/groupoffice-pro
CHANGELOG.TXT  INSTALL.TXT   README       controller/  groupoffice*              imapauth.config.php  language/   robots.txt
FAQ.TXT        LICENSE.AGPL  RELEASE.TXT  favicon.ico  groupoffice-license.txt*  index.php            mime.types  rpc.php
GO.php         LICENSE.TXT   config.php   go/          groupofficecli.php*       install/             modules/    views/



Do you have idea what's wrong ? Thanks for help.

Return to “Contributed development”

Who is online

Users browsing this forum: No registered users and 1 guest