Yii Framework Forum: How To Disable Method In Url And Rediret To Another Line In Certain Condition - Yii Framework Forum

Jump to content

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

How To Disable Method In Url And Rediret To Another Line In Certain Condition Rate Topic: -----

#1 User is offline   jasonban 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 11-May 12

Posted 11 April 2013 - 12:24 AM

Hello yii friends

I am trying disable some specific methods when I enter to the certain condtion and redirect to required page in yii. for let us say

i have the following code:-

if ($model->login($data)) // pass the data to login function and store in database and session
{
$role = new User();

$userRole = $role->GetRolesForUser(Yii::app()->user->name); // check the roles for users.
$userRole_list = $userRole->GetRolesForUserResult->string;

if ($this->actionCheckRole($userRole_list) == TRUE) // if role exist for user rediret to index page.
{
$session = new CHttpSession;
$session->open();
// $session['login'] = $login_result;
$session['sessionkey'] = $session_key;
$session['loggeduser'] = 1;
$session->close();
$session_key = $session['sessionkey'];
header('Location: ' . $setsso_url . '?sso=' . $session_key . '&return=' . Yii::app()->getBaseUrl(true) . '/site/index');
exit;
}
else
{

// when i enter here than i want disable some specific method and rediret to another link
$this->redirect(array('setting/ssopermission', 'name' => $_POST['LoginForm']['username']));
}
}

how can i achieve such condition..

thanks in advance
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