Jump to content

v4 and Kayako


Recommended Posts

  • Replies 83
  • Created
  • Last Reply

Top Posters In This Topic

Just my findings so not an official solution but the issue appears to be that the kayako integration relies on a variable defined on the page to identify who is logged in rather than taking the value from the session. Try this, open modules/support/kayako/integrate.php and change:

 

if (!empty($GLOBALS['clientsdetails']['id']))
{
require_once ("./includes/clientfunctions.php");
$GLOBALS['whmcsuser'] = getclientsdetails($GLOBALS['clientsdetails']['id']);

to

 

if (!empty($_SESSION['uid']))
{
require_once ("./includes/clientfunctions.php");
$GLOBALS['whmcsuser'] = getclientsdetails($_SESSION['uid']);

Matt

 

 

I just downloaded (again) the whmcs 4 zip file and there is no

 

modules/support folder at all

Link to comment
Share on other sites

Ok, re-uploaded the files fresh from kayako folder (which I just downloaded too) and tried Matt's method, blank page.

 

If I leave integrate untouch, except swiftpath my support ticket (kayako's) DOES show up but with the strange issue of name and email fields being frozen out, not able to type into these two fields. Therefore, no one can submit tickets.

 

This is my integrate file:

 

<?php
//=======================================
//###################################
// Kayako Infotech Ltd. - SWIFT Framework
//
// Source Copyright 2001-2007 Kayako Infotech Ltd.
// Unauthorized reproduction is not allowed
// License Number: $%LICENSE%$
// $Author: vshoor $ ($Date: 2007/11/23 08:13:48 $)
// $RCSfile: integrate.php,v $ : $Revision: 1.1 $ 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//                   www.kayako.com
//###################################
//=======================================

/**
* ###############################################
* Change the following value to the absolute path to your swift directory.
* Make sure there is a trailing slash at the very end.
* ###############################################
*/
define("SWIFTPATH", "/home/user/public_html/support/");

// ======= DO NOT CHANGE ANYTHING BELOW THIS POINT =======
define("WORKINGDIR", getcwd());
define("ISWHMCS", true);

if (!empty($GLOBALS['clientsdetails']['id']))
{
   require_once ("./includes/clientfunctions.php");
   $GLOBALS['whmcsuser'] = getclientsdetails($GLOBALS['clientsdetails']['id']);
}

chdir(SWIFTPATH);

ob_start();

require_once (SWIFTPATH."index.php");

ob_end_flush();

chdir(WORKINGDIR);
?>

Link to comment
Share on other sites

Change: WHMCS/modules/support/kayako/integrate.php to the below,

 

update: define("SWIFTPATH", "/home/Kayako_username/public_html/");

 

<?php
//=======================================
//###################################
// Kayako Infotech Ltd. - SWIFT Framework
//
// Source Copyright 2001-2007 Kayako Infotech Ltd.
// Unauthorized reproduction is not allowed
// License Number: $%LICENSE%$
// $Author: vshoor $ ($Date: 2007/11/23 08:13:48 $)
// $RCSfile: integrate.php,v $ : $Revision: 1.1 $ 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//                   www.kayako.com
//###################################
//=======================================

/**
* ###############################################
* Change the following value to the absolute path to your swift directory.
* Make sure there is a trailing slash at the very end.
* ###############################################
*/
define("SWIFTPATH", "/home/Kayako_username/public_html/");

// ======= DO NOT CHANGE ANYTHING BELOW THIS POINT =======
define("WORKINGDIR", getcwd());
define("ISWHMCS", true);

if (!empty($_SESSION['uid']))
{
require_once ("./includes/clientfunctions.php");
$GLOBALS['whmcsuser'] = getclientsdetails($_SESSION['uid']);  
}

chdir(SWIFTPATH);

ob_start();

require_once (SWIFTPATH."index.php");

ob_end_flush();

chdir(WORKINGDIR);
?>

Link to comment
Share on other sites

This is my integrate file:

 

Chad, after applying the fix look carefully at the integrate.php file - find the line that says:

 

define("SWIFTPATH", "/home/user/public_html/support/");

 

Change the path to the correct path for Kayako.. If you don't then you'll get a blank screen..

Edited by Tim|EVO
Link to comment
Share on other sites

Chad, after applying the fix look carefully at the integrate.php file - find the line that says:

 

define("SWIFTPATH", "/home/user/public_html/support/");

 

Change the path to the correct path for Kayako.. If you don't then you'll get a blank screen..

 

That is the correct path to my kayako folder, its called "support" and 'user' is just there for obvious security reasons, but I had my actual username there.

Link to comment
Share on other sites

Change: WHMCS/modules/support/kayako/integrate.php to the below,

 

update: define("SWIFTPATH", "/home/Kayako_username/public_html/");

 

<?php
//=======================================
//###################################
// Kayako Infotech Ltd. - SWIFT Framework
//
// Source Copyright 2001-2007 Kayako Infotech Ltd.
// Unauthorized reproduction is not allowed
// License Number: $%LICENSE%$
// $Author: vshoor $ ($Date: 2007/11/23 08:13:48 $)
// $RCSfile: integrate.php,v $ : $Revision: 1.1 $ 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//                   www.kayako.com
//###################################
//=======================================

/**
* ###############################################
* Change the following value to the absolute path to your swift directory.
* Make sure there is a trailing slash at the very end.
* ###############################################
*/
define("SWIFTPATH", "/home/Kayako_username/public_html/");

// ======= DO NOT CHANGE ANYTHING BELOW THIS POINT =======
define("WORKINGDIR", getcwd());
define("ISWHMCS", true);

if (!empty($_SESSION['uid']))
{
require_once ("./includes/clientfunctions.php");
$GLOBALS['whmcsuser'] = getclientsdetails($_SESSION['uid']);  
}

chdir(SWIFTPATH);

ob_start();

require_once (SWIFTPATH."index.php");

ob_end_flush();

chdir(WORKINGDIR);
?>

 

 

That works thank you

Link to comment
Share on other sites

Just a question to John from Kayako; when the fix is ready will there be an announcement on Kayako's "News and Announcements" section, and will it be rolled into the next stable version or deployed as a separate patch?

 

One would expect all three. The patch would go out for people's immediate needs, the long term fix would go out in next stable, and Jamie will notify people, which probably means at least the forums and maybe several other ways too (communications aren't my job, not really sure what the avant garde is.)

 

The patch will go out as soon as Kayako is done checking it; the new version is a bit off, because we're in the middle of making some significant upgrades to characterset translation and some other internal details, and it's really not a good time to be pushing new code out (we need to do a code review and a testing phase first.)

 

No, I won't comment on how long until a new version; I don't know, and the decision doesn't belong to me. Sorry. :)

Link to comment
Share on other sites

Matt's fix is confirmed correct, no surprises there. :) To those who have already installed Matt's fix, you're done, and there's nothing more to see here.

 

To those who haven't installed Matt's fix, you may use his steps if you find them convenient, or you may download a patch from us; they're literally the same thing. Our patch is distributed here: http://forums.kayako.com/f56/updated-integration-whmcs-v4-22372/

 

The next stable release of our product will include this fix, and should be around shortly, along with many other improvements.

 

This patch is in CVS (should be in customer CVS tomorrow after the nightly build), but CVS is the developer's repo and has much untested code in it, so we strongly recommend against using it.

 

We at Kayako appreciate Matt's quick response to this matter.

Link to comment
Share on other sites

I'm getting this strange error on the Kayako side of things now...

 

Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/WHMCSuser/public_html/includes/hookfunctions.php on line 0

Link to comment
Share on other sites

Everything works except that it opens in a page where the only way to get back is by clicking the browser back button. Also the open tickets do not show in the home page.

 

Any ideas??

 

Thank you

 

Open tickets have never shown on the front page (from memory). You'll have to code something yourself to do that.. It's fairly easy.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated