Skip to content

Instantly share code, notes, and snippets.

@cebe
Created August 27, 2015 16:11
Show Gist options
  • Save cebe/a23558718f6bdfec67df to your computer and use it in GitHub Desktop.
Save cebe/a23558718f6bdfec67df to your computer and use it in GitHub Desktop.
Yii 1.1 login as someone else
public function actionSuto()
{
$identity = UserIdentity::unauthenticatedById($_GET['id']);
if ($identity) {
Yii::app()->user->login($identity, 0);
}
$this->redirect(array('/site/index'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment