[mapguide-users] MGOS 4 Beta 2 and CodeIgniter
David Bowen
dbowenrci at gmail.com
Wed Nov 12 07:39:09 PST 2025
Our application is built using the Model/View/Controller (MVC) framework
CodeIgniter and I'm attempting to update the MVC framework from v3.1.13 to
v4.6.3, but I'm encountering an issue where it seems that one of the
MapGuide functions isn’t being loaded or recognized. The issue occurs
during the log out process, where a user logs out of the application and
there's a series of steps that take place to destroy the sessions (code
below).
I'm getting the following error when I attempt to log out of the
application: Call to undefined function
App\Controllers\Login\MgUserInformation(). This function,
MgUserInformation, is successfully called when the user first logs into the
application and a session is created, so I’m unclear what’s causing the
issue.
Does anyone have familiarity with MGOS and CodeIgniter 4, or would anyone
have suggestions on how to check if MGOS functions are being properly
loaded?
We're running MGOS 4 Beta 2 and are unable to go to MGOS 4 until we've
updated the MCV framework.
Thanks,
David
function logout() {
//Log out and destroy session
$this->mgExtDir = getenv('mg_extensionsDir');
$this->webconfig_ini = getenv( 'webconfigFilePath' );
$this->mgMapID = $this->_getValueByFieldName( 'MAPNAME' );
$this->mgSessionId = $this->_getValueByFieldName( 'SESSION' );
try {
// Initialize the Web Extensions and connect to the Server using
// the Web Extensions session identifier stored in PHP session
state.
MgInitializeWebTier( $this->webconfig_ini );
$si = $this->mgSessionId;
// code fails on following line
$userInfo = new MgUserInformation( $this->mgSessionId );
$siteConnection = new MgSiteConnection();
$siteConnection->Open( $userInfo );
$siteConnection->GetSite()->DestroySession( $this->mgSessionId );
} catch ( MgException $e ) {
echo $e->GetMessage();
echo $e->GetDetails();
}
$session_dat = array( 'logged_in' => FALSE );
session()->set( $session_dat );
session()->destroy();
return redirect()->to( 'login/login' ); //Direct user back to login
screen
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20251112/a0f4914a/attachment.htm>
More information about the mapguide-users
mailing list