CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Implementing CCS project in Joomla

Print topic Send  topic

Author Message
ruhtra


Posts: 30
Posted: 04/08/2010, 11:12 PM

I have found following instructions to implement CCS application into Joomla using Wrapper class. I switched from ASP, and I'm not experienced with PHP, so perhaps some body can help me out, as this procedure doesn't work for me. I'm either missing something or it is not complete. Some of the instructions are really not clear. I quoted parts that I need more details and would appreciate any help. BTW - when I disabled page restrictions in CCS I get the same error



PROBLEM 1

You make a file in your joomla-templatey directory which should be:

your_joomla_template/html/com_wrapper/wrapper/default.php to override the core-wrapper-component.

-------------
the folder structure (at least in Joomla v1.5.15 is diferent from the one presented, so the question is: shall I create a folder and copy DEFAULT.PHP file from ../components/com_wrapper into main Joomla template folder ?



PROBLEM 2

I created the folders (exactly as described above), but when I'm trying to get to the wrapper application (through the menu) I get an error like:

Fatal error: Class 'maliniak_Lcon' not found in C:\xampp\htdocs\maliniak_us\store_manager\Common.php on line 1989

------------------------
when I looked up a code in COMON.PHP the error line shows:

$conn = new clsDBjoomla(); // CCS-db-connection which is the joomla-db


so,... what is wrong with that line (or perhaps the error is parsed from another place)...?




Thank you for your time - Arthur








===================================================================================
HERE IS A WHOLE PROCEDURE --->

Step 1:

I assume a ready-to-use installation of Joomla 1.5.6 an a new ccs-project. Both can be in different folders on the server as the CCS-project is only referenced in the iframe of Joomla. In the settings of the CCS-project you define the Joomla-db as project-db as the Joomla-usertable (normally 'jos_users') is taken as usertable of ccs for authentification. There are according fields in the user-table of Joomla (you can download screenshots here: http://www.pixmess.at/CCS_goes_Joomla.zip) :

UserTable = jos_users
UserID-Feld = id
Login-Field = username
Passwort-Field = password (is not in use for this approach)
Usergroup = gid

The gid-field in jos_users is important, as now there is an unique identifier for every usergroup in joomla. Set the usergroups in the ccs-settings accordingly to the joomla-usergroups:

25 = Super Administrator
24 = Administrator
23 = Manager
21 = Publisher
20 = Editor
19 = Author
18 = Registered

Now set the CCS Sessionvariable in Advanced Security Settings - but match it to Joomla (jos...):

User ID Variable = josUserID
User Login Variable = josUserLogin
Group ID Variable = josGroupID


Now step 2:
CCS has to recognize which usergroup ist logged in to Joomla. Therefore the necessary values from session-table of joomla must be read and translated to to the CCS Sessionvariables. The followings lines will do this. I add them at the end of common.php, so all CCS-pages are secured.


######################################################## Begin


global $Login;

$conn = new clsDBjoomla(); // CCS-db-connection which is the joomla-db

$sessioncookie = CCGetFromGet("sessioncookie", ""); // Get sessionvariable of Joomla-Session over the URL which passes the Joomla-Wrapper to the iframe

//Get the values out of the jos-session-table:

$session_user_id = CCDLookUp("userid","jos_session","session_id='$sessioncookie'", $conn);
$session_username = CCDLookUp("username","jos_session","session_id=' $sessioncookie'", $conn);
$session_usertype = CCDLookUp("usertype","jos_session","session_id='$sessioncookie'", $conn);
$session_usergid = CCDLookUp("gid","jos_session","session_id='$sessioncookie'", $conn);

// If there es no user logged in to Joomla, CCS-Sessionvariable are destroyed if there are some left:

if($session_usertype == "") {

CCSetSession("josGroupID", "");
CCSetSession("josUserID", "");
CCSetSession("josUserLogin", "");
}

// otherwise the current user is logged in and the Joomla-values are assigned to the CCS-sessionvariables:

else {

CCSetSession("josUserID", $session_user_id);
CCSetSession("josUserLogin", $session_username);
CCSetSession("josGroupID", $session_usergid);




//that's it!

################################################################## End



Step 3:
There is only the last step left to pass the specific session-variable of Joomla to the iframe to send it to the script above.

The new concept of "Template Overrides" in Joomla 1.5.x makes it easy and there is no hack in the Joomla-core necessary. I assume knowledge about this concept, otherwise there is lot of information on the joomla-websites. You make a file in your joomla-templatey directory which should be:

your_joomla_template/html/com_wrapper/wrapper/default.php to override the core-wrapper-component.

At the beginning of the source-code - right after the default "no direct access"- lines copy this:

#################




$session =& JFactory::getSession();
$sid = $session->getId();

###################

This passes the current joomla-sessionvariable to the variable $id through joomlaspecific functions. $id must now be added to the url, which calls the iframe in Joomla-framework - to be found a litte bit below:


src="<?php echo $this->wrapper->url; ?>"

is modified to:

src="<?php echo $this->wrapper->url."?sessioncookie=$sid"; ?>"
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.