Yii Framework Forum: Login Antes De Ir Al Index - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Login Antes De Ir Al Index que el usuario haga su login antes de ir al index Rate Topic: -----

#1 User is offline   JOSE ANTHONY 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 25-January 13

Posted 25 January 2013 - 02:41 PM

Hola

Soy nuevo en yii
Necesito hacer q por defecto cuando se habra mi aplicacion aparezca el formulario de login antes de ir al index. Quien me puede ayudar?
0

#2 User is offline   Gustavo Gonçalves 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 02-October 12
  • Location:Belo Horizonte, MG - Brasil

Posted 28 January 2013 - 08:14 AM

Olá Jose,

Faça isso aqui na página /protected/views/site/index.php

<?php 
	if (Yii::app()->user->isGuest)
		$this->redirect(array('site/login'));
?>

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users