久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Cakedc.users =>總是重定向到主頁

Cakedc.users =gt; always redirect to homepage(Cakedc.users =總是重定向到主頁)
本文介紹了Cakedc.users =>總是重定向到主頁的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我在新的 Cakephp 安裝中使用插件CakeDC/Users".我有兩個(gè)控制器:PagesController.php、CardsController.php.Pages 有 1 個(gè)操作(Beta,這是主頁),Cards 有 2 個(gè)操作(索引和單項(xiàng)).

I'm using the plugins "CakeDC/Users" on a brain new Cakephp installation. I've got two controllers : PagesController.php, CardsController.php. Pages has 1 action (Beta, it's the homepage), and Cards two actions (index, and single).

這是引導(dǎo)程序中的設(shè)置:

Here is the setup in the bootstrap :

Configure::write('Users.config', ['users']);
Plugin::load('CakeDC/Users', ['routes' => true, 'bootstrap' => true]);

以及config/users.php中插件的配置:

And the configuration of the plugin in config/users.php :

return [
'Users' => [
    'Email' => [
        'validate' => false
    ]
],
'Auth' => [
    'loginAction' => [
        'plugin' => null,
        'controller' => 'Members',
        'action' => 'login',
        'prefix' => null
    ],
    'logoutAction' => [
        'plugin' => null,
        'controller' => 'Members',
        'action' => 'logout',
        'prefix' => null
    ],
    'authenticate' => [
        'all' => [
            'finder' => 'auth',
        ],
        'CakeDC/Users.ApiKey',
        'CakeDC/Users.RememberMe',
        'Form',
    ],
    'authorize' => [
        //'CakeDC/Users.Superuser',
        //'CakeDC/Users.SimpleRbac',
    ],
],

];

我只配置了一個(gè)路由:

$routes->connect('/', ['controller' => 'Pages', 'action' => 'Beta', 'home']);

這是我的 AppController.php :

And here is my AppController.php :

    public function initialize()
    {
        parent::initialize();
        $this->loadComponent('Flash');
        $this->loadComponent('CakeDC/Users.UsersAuth');
    }

主頁被允許:

$this->Auth->allow('beta');

未登錄時(shí),我只能訪問/pages/beta,沒關(guān)系.我可以用插件注冊(cè)、登錄和注銷,這邊沒問題.

When not logged in, I can only access /pages/beta, which is ok. I can register, login, and logout with the plugin, no problem on this side.

登錄后,除了主頁之外,我無法訪問任何其他頁面.如果我到達(dá)/cards/index 或/cards/single,我總是會(huì)重定向到主頁.如果我禁用了插件,頁面訪問就可以了.

Once I'm logged, I can't access any other pages than the homepage. If I got to /cards/index, or /cards/single, I'm always redirect to the homepage. If I disabled the plugin, pages access is ok.

我已經(jīng)堅(jiān)持了一段時(shí)間了,有什么幫助嗎?謝謝,最好的問候

I'm stuck on this since a while now, any help ? Thanks, Best Regards

推薦答案

沒關(guān)系,我已經(jīng)更換了:

Nevermind, I've replaced :

'authorize' => [
       //'CakeDC/Users.Superuser',
       //'CakeDC/Users.SimpleRbac',
],

作者:

'authorize' => false,

插件默認(rèn)使用授權(quán)組件,所以如果你不打算使用它,你可以設(shè)置false"以確保你沒有問題.或者你必須通過設(shè)置好的設(shè)置來設(shè)置授權(quán)的控制器和動(dòng)作.

The plugin used authorize with a component by default, so if you're not going to use it, you have the set "false" to be sure you don't have issues. Or you have to setup the authorized controllers and actions by setting up the good setup.

謝謝,

這篇關(guān)于Cakedc.users =>總是重定向到主頁的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Session is lost after an OAuth redirect(OAuth 重定向后會(huì)話丟失)
Pagination Sort in Cakephp 3.x(Cakephp 3.x 中的分頁排序)
CakePHP Shared core for multiple apps(CakePHP 多個(gè)應(yīng)用程序的共享核心)
Login [ Auth-gt;identify() ] always false on CakePHP 3(在 CakePHP 3 上登錄 [ Auth-identify() ] 始終為 false)
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)(致命錯(cuò)誤:允許的內(nèi)存大小為 134217728 字節(jié)已用盡(嘗試分配 87 字節(jié)))
主站蜘蛛池模板: 国产精品久久久久久久久久久久 | 瑟瑟免费视频 | 国产精品久久久久久久毛片 | 欧美激情一区二区三区 | 激情福利视频 | 久久视频精品在线 | 狠狠爱综合 | 99在线国产| 亚洲色图50p | 日日射影院 | 日韩av一区二区在线观看 | 国产高清精品一区二区三区 | 国产一区二区三区 | 天天久久| 成人性视频在线播放 | 99热精品国产 | 操到爽 | 国产成人精品一区二区三区网站观看 | 亚洲最色网站 | 欧美一区二区三区视频 | 久久久国产一区二区三区 | 亚洲综合字幕 | 中文字幕成人网 | 91视频久久久久 | 久久久久亚洲精品国产 | 国产一二三视频在线观看 | 久久精品91久久久久久再现 | 精品欧美色视频网站在线观看 | 91亚洲国产成人久久精品网站 | 超碰97免费在线 | 特级做a爱片免费69 精品国产鲁一鲁一区二区张丽 | 国产成人精品免费视频大全最热 | 欧美精品啪啪 | 欧美日本韩国一区二区 | h片在线免费观看 | 国产成人精品综合 | 亚洲人成人一区二区在线观看 | 日韩欧美国产一区二区三区 | 亚洲欧美成人影院 | av一区二区三区 | 久久精品91久久久久久再现 |