cakephp-2.7

Cakephp migration from 2.7 to 2.8 in cpanel

馋奶兔 提交于 2020-01-17 01:37:07
问题 My website is developed in cakephp 2.7 which uses php.4.4 many years ago.All working fine at that time. But right now it's not working in capnel. I have checked the issue and error logs. PDO class is not working and meanwhile database query execution is not working. So i have upgraded my php version to PHP 7.0. Another issues are coming like problem in error handler of cakephp. I searched for this issue and i concluded that cakephp 2.7 is not compatible with PHP 7.0. So i have to do migration

Updating user with or without password - CakePHP

百般思念 提交于 2020-01-11 07:53:09
问题 I try to find a good and clean way to deal with an admin panel "edit user" in cakePHP v.2.7. To be clear : I want to be able to edit my user with or without overwriting their password, but the cakePHP validator tool don't let me do what I want... I've already take a look at CakePHP: Edit Users without changing password and Updating user email and password with CakePHP but it seem really dirty : the first one don't apply the rules onUpdate the second display the hash (just no... u_u") There is

Prevent ajax calls from updating session timeout with CakePHP

泄露秘密 提交于 2019-12-24 05:46:22
问题 I'm using some long pooling in JavaScript of this kind: setInterval(demo, 3000); function demo(){ $.get(url, params, function(data){ //whatever }); } Being url a URL to a CakePHP controller action returning JSON. But I want my session to only last 20 minutes since the user last action on the screen. This is, ignoring the pooling which is taking place every 30 seconds. Otherwise the session will last forever. Any solution to this? 回答1: Please use this in app controller in beforeFilter function

HABTM form validation with CakePHP 2.x

五迷三道 提交于 2019-12-13 11:14:32
问题 I have a HABTM relation like : Post <-> Tag (a Post can have multiple Tag, and same the other way). This work with the multiple checkbox selection generated by Cakephp. But I want to have at least one Tag for every Post and throw an error if someone try to insert an orphan. I'm looking for the cleanest/most CakePHP alike way to do this. This is more or less an update of this HABTM form validation in CakePHP question, as I get the same problem on my cakephp 2.7 (last cakephp 2.x for now with

How to define FlashHelper/Component element for general authError message

…衆ロ難τιáo~ 提交于 2019-12-10 09:50:27
问题 After updating CakePHP from 2.6.2 to 2.7.2 I get an missing key error when the auth flash message is created. How can I define the element template for the default authError ? Since SessionComponent::setFlash() has been deprecated I added the FlashComponent in app/Controller/AppController.php and modified all Flash messages from this: // Controller $this->Session->setFlash('Done', 'succeed'); $this->Session->setFlash('There is an error', 'failure'); $this->Session->setFlash('Please log in',

Updating user with or without password - CakePHP

你说的曾经没有我的故事 提交于 2019-12-01 14:39:38
I try to find a good and clean way to deal with an admin panel "edit user" in cakePHP v.2.7. To be clear : I want to be able to edit my user with or without overwriting their password, but the cakePHP validator tool don't let me do what I want... I've already take a look at CakePHP: Edit Users without changing password and Updating user email and password with CakePHP but it seem really dirty : the first one don't apply the rules onUpdate the second display the hash (just no... u_u") There is no other way to do it ? (with as few line as possible) TL;DR : View // add in your view `app/View