1
0
This repository has been archived on 2021-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
gallery3-contrib/modules/user_homes/helpers/user_homes_event.php

41 lines
982 B
PHP
Raw Normal View History

2009-07-24 23:11:02 +00:00
<?php defined("SYSPATH") or die("No direct script access.");
class user_homes_event_Core
{
/**
* called when a user logs in. This will setup the session with the
* user home if it exists on the database. This means when the page
* is refreshed after logging in the direction can occur.
*/
static function user_login($user)
{
if ($user->home)
{
$session = Session::instance();
$session->set("redirect_home",$user->home);
}
}
/**
* called after a log in occurs and when the first gallery is loaded.
* if the home variable exists on the session then a redirect will
* occur to that home and the variable removed from the session to
*/
static function gallery_ready()
{
$session = Session::instance();
$home = $session->get("redirect_home");
if ($home)
{
// remove from session to ensure redirect does not
// occur again
$session->set("redirect_home",null);
url::redirect("albums/$home");
}
}
}