/gist:dd06beb9b9833ab8563c Secret
Created
March 7, 2014 18:41
Star
You must be signed in to star a gist
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 | |
| $di->set('current_user', function() use ($di) { | |
| $session = $di->get('session'); | |
| $segment = $session->segment; | |
| if($segment->AUTHENTICATED) { | |
| $slave = $di->get('slave'); | |
| $g = new Application\Model\User\Gateway(new Application\Model\User\Storage($slave)); | |
| return $g->loadUser($segment->user_id); | |
| } | |
| return false; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment