Author Topic: Can I use my application user as Visitor?  (Read 14710 times)

0 Members and 1 Guest are viewing this topic.

gupadilha

  • Jr. Member
  • **
  • Posts: 2
Can I use my application user as Visitor?
« on: February 13, 2009, 03:18:18 PM »
There is a way to send thru the chat button (popup url) the user logged in my application and the webim get it and use as visitor?

May be something like : "http://<HOST>/webim/client.php?locale=en&style=default&visitor=<USERID>"

Tks!

Inspirer

  • Mibew Project founder
  • Native
  • *****
  • Posts: 262
    • Mibew Messenger
Re: Can I use my application user as Visitor?
« Reply #1 on: February 13, 2009, 04:10:11 PM »
If you want just pass the default name of the visitor, look in libs/chat.php. Function visitor_from_request().
Default name is detected there.

I like this idea and will add "visitor" argument into 1.5.2.

-------

If you want to integrate webim with your PHP application, you can share the session between them:
Modify libs/chat.php.

function visitor_from_request() {
.......
   return array( 'id' => $userId, 'name' => $userName );
}


Add something like:

if(isset($_SESSION['userid'])) {
    $userId = $_SESSION['userid'];
}


Change "Settings -> general -> Visitor's identifier" to see visitor's id: "{name} {id}".
If you allow only logged in visitors to chat, disable "Settings -> Optional Services -> Allows users to change their names".

PS: Also look here
« Last Edit: August 02, 2013, 09:54:13 PM by faf »

gupadilha

  • Jr. Member
  • **
  • Posts: 2
Re: Can I use my application user as Visitor?
« Reply #2 on: February 13, 2009, 06:30:14 PM »
It is a Java (J2EE) application, not php!
 ;)