8 * @author Cake <cake_67@users.sourceforge.jp>
9 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
10 * @link http://trpgtools-onweb.sourceforge.jp/
17 * The parent component
19 App::import('Component', 'Auth');
21 class MemberAuthComponent extends AuthComponent {
24 * The name of the model that represents users which will be authenticated. Defaults to 'User'.
29 var $userModel = 'Member';
33 function initialize(&$controller)
35 parent::initialize($controller);
38 if (isset($controller->params["prefix"]) && $controller->params["prefix"] == Configure::read('Routing.admin')) {
39 $this->isAdmin = true;
42 // 管理画面はUsers、一般ユーザはMembersで認証
43 if ($this->isAdmin === true) {
44 $this->userModel = 'User';
45 $this->loginAction = Router::normalize(array('controller' => 'users', 'action' => 'login'));
48 Configure::write('Session.cookie', 'CAKEPHPMEMBERSAUTH');
51 $this->loginRedirect = $controller->params["url"]["url"];
52 if ("/".$this->loginRedirect == Router::normalize(Configure::read('Routing.loginPath'))) {
53 $this->loginRedirect = Router::normalize(Configure::read('Routing.basePath'));
54 if (Configure::read('mobile')) {
55 $this->loginRedirect .= "m/";