Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Commit

Permalink
Added a get() function to wrap around for Auth::user(), to be used li…
Browse files Browse the repository at this point in the history
…ke Auth::type()->get(). Also added an impersonate function for logged in users, to be used like Auth::admin()->impersonate('user', 1, true)
  • Loading branch information
ollieread committed Jan 14, 2014
1 parent f033b02 commit f6ccb9b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Ollieread/Multiauth/Guard.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,14 @@ public function getRecallerName() {
return 'remember_' . $this->name . '_' . md5(get_class($this));
}

public function get() {
return $this->user();
}

public function impersonate($type, $id, $remember = false) {
if($this->check()) {
return Auth::$type()->loginUsingId($id, $remember);
}
}

}

0 comments on commit f6ccb9b

Please sign in to comment.