Please find below instructions on how to integrate AjaxChat in UserCake
(usercake.com: "it's one of the simplest and most secure user management systems on the internet.").
Assuming that Usercake is installed in the root directory of your site and AjaxChat is in the "/chat" subdir:
1- Modify the file lib/custom.php (you need to add the php file for the login)
require_once("../models/config.php");
//Eventually Prevent the user visiting the logged in page if he/she is not logged in, comment the following if you don't need it
Please find below instructions on how to integrate AjaxChat in UserCake
(usercake.com: "it's one of the simplest and most secure user management systems on the internet.").
Assuming that Usercake is installed in the root directory of your site and AjaxChat is in the "/chat" subdir:
1- Modify the file
lib/custom.php (you need to add the php file for the login)
require_once("../models/config.php");
//Eventually Prevent the user visiting the logged in page if he/she is not logged in, comment the following if you don't need it
if(!isUserLoggedIn()) { header("Location: ../login.php"); die(); }
2- Modify the file
lib/class/CustomAJAXChat.php (for login method)
function getValidLoginUserData() {
global $loggedInUser;
// Check if we have a valid registered user:
/*customisation for UserCake Version: 1.4
http://usercake.com
assuming that chat directory is inside the userCake setup directory
*/
if(isUserLoggedIn()) {
$userData = array();
$userData = $loggedInUser->user_id;
$userData = $this->trimUserName($loggedInUser->display_username);
if($loggedInUser->group_id==2)
$userData = AJAX_CHAT_ADMIN;
elseif($loggedInUser->group_id==3) //this must be added to userCake groups
$userData = AJAX_CHAT_MODERATOR;
else
$userData = AJAX_CHAT_USER;
return $userData;
return null;
} else {
// Guest users:
return $this->getGuestUser();
}
}
Thank you for sharing!
My pleasure. I hope it will be useful to someone (For sure it will be useful for me when I'll forget how to do that :-P )
You now how to do it without usercake but only cakephp auth system ?
No, sorry, I'm not familiar with cakephp :-(