General > Support

Can I use my application user as Visitor?

(1/1)

gupadilha:
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:
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

gupadilha:
It is a Java (J2EE) application, not php!
 ;)

Navigation

[0] Message Index

Go to full version