- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我在 https 中访问了该网站,我有 2 个问题,该网站已重定向,但它是 301 重定向吗?我没有在 .htaccess 文件中写任何东西,为什么网站会在 https 中重定向?我害怕重复的内容。
我的问题是电子邮件不再有效......这是代码:
public function initialize()
{
parent::initialize();
$this->loadComponent('Security', ['blackHoleCallback' => 'forceSSL']);
$this->loadComponent('RequestHandler');
$this->loadComponent('Flash');
$this->loadComponent('Auth', [
'authenticate' => [
'Form' => [
'fields' => [
'username' => 'email',
'password' => 'password'
],
'finder' => 'auth'
]
],
'loginAction' => ['controller' => 'Users', 'action' => 'login', 'prefix' => 'manager'],
'loginRedirect' => ['controller' => 'Pages', 'action' => 'index', 'prefix' => 'manager'],
'logoutRedirect' => ['controller' => 'Users', 'action' => 'login', 'prefix' => 'manager'],
// 'authorize' => 'Controller'
]);
}
public function forceSSL()
{
return $this->redirect('https://' . env('SERVER_NAME') . $this->request->here);
}
public function beforeFilter(Event $event)
{
parent::beforeFilter($event);
$this->Security->requireSecure();
$this->checkManager();
$this->set('settings', Configure::read('Settings'));
}
谢谢
最佳答案
解决方法如下:
public function initialize()
{
parent::initialize();
$this->loadComponent('Security', ['blackHoleCallback' => 'forceSSL']);
}
public function forceSSL()
{
return $this->redirect('https://' . env('SERVER_NAME') . $this->request->here);
}
public function beforeFilter(Event $event)
{
parent::beforeFilter($event);
$this->Security->requireSecure();
$this->Security->config('unlockedActions', ['contact']);
}
和:
在 Controller.php 中更改状态
公共(public)函数重定向($url, $status = 302)
变成:
公共(public)函数重定向($url, $status = 301)
关于SSL蛋糕PHP表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49199161/
如何使这个 Cakephp 查询能够计算不同的值? $matches = $this->Product->find('count', array( 'condi
如何使这个 Cakephp 查询计数不同? $matches = $this->Product->find('count', array( 'condition
如何使这个 Cakephp 查询计数不同? $matches = $this->Product->find('count', array( 'condition
重复 What is a PHP Framework?and many more 到目前为止,我一直在使用 PHP 进行小的调整,主要是使用 WordPress。什么是 PHP 框架?为什么我需要它们
我正在为我的项目使用 CakePHP...为了加快我的代码速度,我只想获得一些与我的实际对象相关的模型类型: $result = $this->Category->find(
我们正在尝试找出蛋糕中哪一 block 的平均值最高。 蛋糕上有数字 [1, 3, 4, 2, 2] 第 [3, 4] block 的平均结果为 3.5 得出最高平均值的切片就是我们的答案 最佳答案
我以前用过几次 CakePHP,但这是我第一次尝试 Bake。在我的 Mac 上,我运行 CakePHP 1.3、PHP5.3.3 和 MySQL。我已经创建了我的数据库表并且应用程序连接到数据库。
我目前正在构建一个与 teamcity 交互的 Cake 构建脚本,我想提供进度消息。我可以很容易地报告任务名称,但我无法找出构建脚本中的进度。像(“执行 5 个任务中的第 1 个”)那样思考。 有什
如何在 cakephp 网站上设置 iPad/iPhone 书签图标?我使用的是正确的文件名 - apple-touch-icon.png - 我尝试将其上传到/webroot 和/webroot 上
在 AppController 中: public $helpers=array("Session","Html","Form"); public $components = array( '
我正在 Cake PHP 1.2 网站上测试我们网站的数据库从 Sql Server 到 MySQL 的转换,现在我在 Cake 存储模型信息的方式上遇到了错误。在创建我的“emp”(员工,不是我的命
我的模型相关如下: Post BELONGS_TO Parent Parent HAS_MANY ParentAdmin 现在,如果满足帖子的属性值,我希望找到所有帖子的所有父级管理员。等效的 sql
我想用从 Excel 工作表中提取的“平面”数据填充我的数据库。所有记录都以数组形式提供(类似于 $request->data),但它们的主键设置了必须保留的值。 我的代码: $imported =
我知道已经有一个类似的问题here ,但我认为我的问题完全不同,值得创建一个新帖子。 我使用 CAKE 0.21.1.0。 作为 TeamCity 上的一个构建步骤,我正在执行 build.ps1,它
我正在使用 CakePHP 2.4.7 并且我正在尝试在远程主机上执行 CakePHP shell。 我以 root 身份连接到服务器,然后执行 $ [path_to_my_foler]/app/Co
我的模型定义如下: columnType('data', 'json'); return $schema; } } 保存到数据库和检索数据时正确应用 JSON 格式
我在 CakePHP 1.3 中编写了一个具有返回值的 shell 方法。 我希望能够从 Controller 中访问该方法,以便将其返回值传递到 View 中。 我不确定如何从 Controller
我正在尝试运行我的蛋糕 shell 脚本,但输出如下所示: -bash-3.2$ ../cake/console/cake audit ../cake/console/cake: line 30:/r
我在 cake php 3 中有三个表: - 图片表 - 图片有图片表 - 图片类型表 一个图像有多个子图像。我已经与一个链接在一起belongsToMany 协会。 $this->belongsTo
我是一名优秀的程序员,十分优秀!