1 <?php
2
3 /**
4 * Class file.
5 *
6 * @author Tobias Munk <schmunk@usrbin.de>
7 * @link http://www.phundament.com/
8 * @copyright Copyright © 2005-2011 diemeisterei GmbH
9 * @license http://www.phundament.com/license/
10 */
11
12 /**
13 * Set the current page as the return url if it gets initialized
14 *
15 * Commponent must be initialized (called) in a controller.
16 * <pre>
17 * Yii::app()->returnUrl;
18 * </pre>
19 *
20 * @author Tobias Munk <schmunk@usrbin.de>
21 * @package p3extensions.components
22 * @since 3.0.3
23 */
24 class P3ReturnUrl extends CApplicationComponent
25 {
26
27 public function init()
28 {
29 parent::init();
30
31 // TODO
32 $urlManager = Yii::createComponent('P3LangUrlManager');
33
34 $loginUrl = $urlManager->createUrl(Yii::app()->user->loginUrl[0]);
35 $requestUrl = Yii::app()->request->url;
36
37 if ($requestUrl != $loginUrl) {
38 Yii::app()->user->returnUrl = Yii::app()->request->url;
39 }
40 }
41
42 }
43
44 ?>
45