Created
May 29, 2014 12:28
-
-
Save leviwheatcroft/70d72c2f2b3ae4e0ea4b to your computer and use it in GitHub Desktop.
Single Sign On for modx external authentication super handy if you're authenticating with some other project and just need to assign privileges to a session.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//require 'modx/assets/kint/Kint.class.php'; | |
require_once __DIR__ . '/modx/config.core.php'; | |
require_once MODX_CORE_PATH.'model/modx/modx.class.php'; | |
$modx = new modX(); | |
$modx->initialize('web'); | |
$modx->getService('error','error.modError', '', ''); | |
$user = $modx->getObject('modUser', array('username' => 'levi')); | |
$user->addSessionContext('mgr'); | |
//dd($user->get('username')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment