Kayako Logo
Developers & Code Interested in customizing your Kayako products? Discuss modifications and develop your own mods with the community.

Reply
 
LinkBack (5) Thread Tools Search this Thread Rate Thread Display Modes
  5 links from elsewhere to this Post. Click to view. (#1) Old
craigbrass Offline
Senior Member
 
Posts: 4,955
Join Date: Jun 2005
Location: Cumbria, UK

SupportSuite
Owned License
Creating a LoginShare - 23-07-2007, 05:08 PM

Ok, I decided to create a step by step guide to creating a LoginShare. This is the guide for integrating with a piece of software that uses MD5 password storage. Any reference to email can be changed to username if your system uses usernames instead.

1. Download vipercart.login.php (attached).

2. Rename the vipercart part of the file to the name of the software you are integrating with.

3. Find the following line :-
Code:
$dbLoginShare = new dbCore($_loginshare["vchostname"], $_loginshare["vcdbuser"], $_loginshare["vcdbpass"], $_loginshare["vcdbname"], "mysql", false);
and change the "vc" bits to the initials of the software you are integrating with.

4. Find the following line (2 lines down from the one in step 3) :-
Code:
$_user = $dbLoginShare->queryFetch("SELECT * FROM `". $_loginshare["vcdbprefix"] ."customers` WHERE `email` = '". $dbCore->escape($username) ."';");
and change "vc" to the initial you changed to in step 3. Also, change customers to the name of the table after the table prefix.

5. Find the following line :-
Code:
if ($_user["password"] == $userpassword && !empty($_user["password"]))
and change the "password" part of the two $_user["password"] bits to the name of the field the MD5 hashed password is in if it needs changing.

6. Find the following line :-
Code:
$userid = getLoginShareUser(LOGINAPI_VIPERCART, $_user["id"]);
and change VIPERCART to the full name of the software you are integrating with without spaces and fully capitalised.

7. Find the following line :-
Code:
$userid = insertUser(true, $_user["email"], $regpassword, $_SWIFT["tgroup"]["regusergroupid"], LOGINAPI_VIPERCART, $_user["id"], $_user["firstname"]." ".$_user["lastname"], $_SWIFT["tgroup"]["languageid"], 0, false, 1, true);
and change the parts in quotations in $_user["email"], $_user["firstname"] and $_user["lastname"] to the correct fields in the tables. Also changed VIPERCART to what you put in part 6.

8. Find the following section :-
Code:
$forms[0]["title"] = $_SWIFT["language"]["hostname"];
$forms[0]["name"] = "vchostname";
$forms[1]["title"] = $_SWIFT["language"]["dbname"];
$forms[1]["name"] = "vcdbname";
$forms[2]["title"] = $_SWIFT["language"]["dbuser"];
$forms[2]["name"] = "vcdbuser";
$forms[3]["title"] = $_SWIFT["language"]["dbpass"];
$forms[3]["name"] = "vcdbpass";
$forms[4]["title"] = "DB Table Prefix";
$forms[4]["name"] = "vcdbprefix";
and change all the vc bits to the initials of the software you are integrating the same as you did in step 4.

9. Upload the file you just created to /includes/LoginShare/.

10. Open loginshare.config.php inside that same directory.

11. From aproximatly line 21 onwards, you will see lines similar to the follow :-
Code:
define("LOGINAPI_VBULLETIN", 2);
Below the last define, copy the last line onto the next line and edit the line to the same text you did in step 6 (the LOGINAPI_VBULLETIN bit). Also, change the number to the number after it so it is unique.

12. Scroll down to where you see lines similar to the following :-
Code:
$_LOGINAPI[LOGINAPI_MODERNBILL] = array("title" => $_SWIFT["language"]["loginapi_modernbill"], "include" => "modernbill.login.php");
Copy the last line and paste it below it. Edit LOGINAPI_MODERNBILL, loginapi_modernbill (note the lower case on this one) and modernbill.login.php accordingly.

13. Open /locale/en-us/templates.php and look for :-
Code:
'loginapi_modernbill' => 'ModernBill',
and scroll to the bottom of that list. Copy the above code onto a new line at the bottom and edit the "modernbill" bit to what you set in step 12.

14. You should now be able to follow the following tutorial to configure the loginshare :-
http://www.craigbrasssystems.com/oth...hare/main.html
Attached Files
File Type: php vipercart.login.php (3.2 KB, 191 views)


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger

Last edited by craigbrass : 16-08-2007 at 09:01 AM.
   
Reply With Quote
  (#2) Old
marcan Offline
New Member
 
Posts: 9
Join Date: Apr 2007
Location: Montreal | Canada

LiveResponse
Then what ? - 14-08-2007, 08:01 PM

Thanks for this excellent tutorial ! I have created a plugin file to integrate loginshare with my CMS. Now what do I need to do ? What do I do with this file ?

Thanks for your help !
   
Reply With Quote
  (#3) Old
craigbrass Offline
Senior Member
 
Posts: 4,955
Join Date: Jun 2005
Location: Cumbria, UK

SupportSuite
Owned License
15-08-2007, 07:29 AM

How stupid am I! Forgot about the next bit! Will update the tutorial now.


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
  (#4) Old
craigbrass Offline
Senior Member
 
Posts: 4,955
Join Date: Jun 2005
Location: Cumbria, UK

SupportSuite
Owned License
15-08-2007, 07:36 AM

Updated.


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
  (#5) Old
marcan Offline
New Member
 
Posts: 9
Join Date: Apr 2007
Location: Montreal | Canada

LiveResponse
15-08-2007, 10:55 PM

Thanks for the update and the cool flash tutorial.

Now, I edited the file loginshare.config.php, and uploaded it to my server. Now, when I go in Admin CP Templates > Login Share, I see a new plugin with no title. I guess it's the one I created. I have the feeling there should be a title define somewhere for this plugin and currently it is not, which is why the plugin's title if blank.

I the loginshare.config.php, I added this line as you mentionned :

$_LOGINAPI[LOGINAPI_XOOPS] = array("title" => $_SWIFT["language"]["loginapi_xoops"], "include" => "xoops.login.php");

Could this be related to
$_SWIFT["language"]["loginapi_xoops"] ? Where is this defined ?

Thanks for your help !
   
Reply With Quote
  (#6) Old
craigbrass Offline
Senior Member
 
Posts: 4,955
Join Date: Jun 2005
Location: Cumbria, UK

SupportSuite
Owned License
16-08-2007, 08:57 AM

Oh yes, also missed that bit. Will update the thread to add more steps.


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
  (#7) Old
craigbrass Offline
Senior Member
 
Posts: 4,955
Join Date: Jun 2005
Location: Cumbria, UK

SupportSuite
Owned License
16-08-2007, 09:01 AM

Updated. See step 13.


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
  (#8) Old
marcan Offline
New Member
 
Posts: 9
Join Date: Apr 2007
Location: Montreal | Canada

LiveResponse
16-08-2007, 09:03 PM

Ok I did all of this.

Now I'm still facing a problem. Here it is :

When I login with a user present in my CMS (XOOPS), the plugin finds the user, validate that the username match the password, look for this user in its database, does not find it, tries to create it, and can't :

if ($_user["pass"] == $userpassword && !empty($_user["pass"]))

{

xoops_debug('111');

// We have a match, Seems like a valid user.. now see if he is registered..

$userid = getLoginShareUser(LOGINAPI_XOOPS, $_user["uid"]);

if (!$userid)

{

xoops_debug('222');

// Not registered, Register him

$userid = insertUser(true, $_user["email"], $regpassword, $_SWIFT["tgroup"]["regusergroupid"], LOGINAPI_XOOPS, $_user["uid"], $username, $_SWIFT["tgroup"]["languageid"], 0, false, 1, true);

In the last line paste, $userid always returns false. So I guess the user cannot be created in the SupportSuite. What am I doing wrong ?

Thanks !
   
Reply With Quote
  (#9) Old
Randles Offline
New Member
 
Posts: 8
Join Date: Aug 2007
Location: London, UK

SupportSuite
Monthly Leased License

22-08-2007, 09:59 PM

I'd love to follow your tutorial but the file loginshare.config.php is encrypted
   
Reply With Quote
  (#10) Old
Jamie Edwards Offline
Operations Manager
 
Jamie Edwards's Avatar
 
Posts: 4,316
Join Date: Jan 2006
Location: UK

SupportSuite
Owned License

22-08-2007, 10:04 PM

Quote:
Originally Posted by Randles View Post
I'd love to follow your tutorial but the file loginshare.config.php is encrypted
Please e-mail me the name of the file you want and I will send it to you.

Thanks,


Jamie Edwards (jamie.edwards ]at[ kayako.com)
----------------------------------------------------------------
---
  • New to the forum? New user's guide here.
  • Submit bug reports here.
  • Submit support tickets via the members area.
  • Submit sales queries either via live chat or via e-mail.
  • There is no official ETA on Version 4.
   
Reply With Quote
  (#11) Old
Rodney B Offline
Member
 
Posts: 41
Join Date: Sep 2007

SupportSuite
Owned License
24-09-2007, 11:36 PM

In step 4:

Quote:
and change "vc" to the initial you changed to in step 3. Also, change customers to the name of the table after the table prefix.

Does this customers table name come from kayako or the third party app?
   
Reply With Quote
  (#12) Old
Rodney B Offline
Member
 
Posts: 41
Join Date: Sep 2007

SupportSuite
Owned License
25-09-2007, 12:09 AM

Quote:
Originally Posted by Rodney B View Post
In step 4:




Does this customers table name come from kayako or the third party app?
I've figured out that this is from the third party app

My shared login still isn't working (it connects to the database, but says username/password isn't correct).

My next question is, what would I need to change above if the password isn't using MD5 storage?
   
Reply With Quote
  (#13) Old
craigbrass Offline
Senior Member
 
Posts: 4,955
Join Date: Jun 2005
Location: Cumbria, UK

SupportSuite
Owned License
25-09-2007, 08:06 AM

Well if it isn't MD5 storage then thats why it won't be working. What password algorithm is it using?


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
  (#14) Old
Rodney B Offline
Member
 
Posts: 41
Join Date: Sep 2007

SupportSuite
Owned License
25-09-2007, 05:33 PM

Quote:
Originally Posted by craigbrass View Post
Well if it isn't MD5 storage then thats why it won't be working. What password algorithm is it using?
I don't think it's using an algorithm at the moment. Is there a way to modify the viper.login.php example above to make it not use an algorithm?
   
Reply With Quote
  (#15) Old
craigbrass Offline
Senior Member
 
Posts: 4,955
Join Date: Jun 2005
Location: Cumbria, UK

SupportSuite
Owned License
25-09-2007, 05:39 PM

So you mean its just plain text passwords (ie examplepassword would be stored as examplepassword in the database)?


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://forums.kayako.com/f48/creating-loginshare-12857/
Posted By For Type Date
WHMCS and Kayako - Web Hosting Talk - The largest, most influential web hosting community on the Internet This thread Refback 05-02-2008 07:41 AM
Kayako eSupport » Support desk software (ticket, e-mail, self-help) This thread Refback 19-12-2007 10:25 AM
Kayako SupportSuite » Support desk software (ticket, e-mail, live chat, self-help) This thread Refback 16-12-2007 03:00 PM
Kayako LiveResponse » Live chat and support desk software (live chat, self-help) This thread Refback 16-12-2007 12:43 PM
Kayako eSupport » Support desk software (ticket, e-mail, self-help) This thread Refback 16-12-2007 04:54 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Creating Tables Danym SupportSuite, eSupport and LiveResponse 1 03-11-2006 11:22 AM



Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0

Kayako provides online help desk software and support solutions; enabling companies to improve their support and reduce costs.

Our three main products include: SupportSuite, eSupport and LiveResponse



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46