use controller after login

currently just used to run the postLogin hook
This commit is contained in:
Uwe Steinmann 2013-07-23 17:33:40 +02:00
parent 3401024e2d
commit 2d08f870c7
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,35 @@
<?php
/**
* Implementation of Login controller
*
* @category DMS
* @package SeedDMS
* @license GPL 2
* @version @version@
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2010-2013 Uwe Steinmann
* @version Release: @package_version@
*/
/**
* Class which does the busines logic when logging in
*
* @category DMS
* @package SeedDMS
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2010-2013 Uwe Steinmann
* @version Release: @package_version@
*/
class SeedDMS_Controller_Login extends SeedDMS_Controller_Common {
public function run() {
$dms = $this->params['dms'];
$user = $this->params['user'];
$settings = $this->params['settings'];
$session = $this->params['session'];
if($this->callHook('postLogin')) {
$session->setSplashMsg(array('type'=>'success', 'msg'=>'Hallo, du bist als "'.$user->getFullname().'" eingeloggt'));
}
}
}

View File

@ -24,7 +24,9 @@ include("../inc/inc.Language.php");
include("../inc/inc.ClassSession.php");
include("../inc/inc.DBInit.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.ClassController.php");
include("../inc/inc.ClassEmail.php");
include("../inc/inc.Extension.php");
include $settings->_rootDir . "languages/" . $settings->_language . "/lang.inc";
@ -40,6 +42,9 @@ function _printMessage($heading, $message) {
return;
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$controller = Controller::factory($tmp[1]);
if (isset($_REQUEST["sesstheme"]) && strlen($_REQUEST["sesstheme"])>0 && is_numeric(array_search($_REQUEST["sesstheme"],UI::getStyles())) ) {
$theme = $_REQUEST["sesstheme"];
}
@ -293,6 +298,10 @@ else if (isset($_GET["referuri"]) && strlen($_GET["referuri"])>0) {
$referuri = urldecode($_GET["referuri"]);
}
$controller->setParam('user', $user);
$controller->setParam('session', $session);
$controller->run();
add_log_line();
if (isset($referuri) && strlen($referuri)>0) {