cakephp-2.0

User sessions and two CakePHP applications running in the same machine

坚强是说给别人听的谎言 提交于 2019-12-07 12:32:17
问题 I have 2 CakePHP applications running on the same machine. Both of them need a previous registration to have access to them and the first thing users see is the login form. I have realized that when I do login in one of them, then, I can access to the other web application without being asked for my credentials to login. (which is not correct) In my Controllers of both applications I have this to deny access without a previous login. public function beforeFilter(){ parent::beforeFilter();

Password Confirm Validation CakePHP

陌路散爱 提交于 2019-12-07 12:23:07
问题 I have searched far and wide, tried every trick in the book, but I still can't get my CakePHP application to perform simple Password Confirm validation. I've tried creating a custom validation rule like this: 'passwordequal' => array('rule' => 'checkpasswords' , 'message' => 'Passwords Do Not Match') Then defined 'checkpasswords' like this: public function checkpasswords(){ if(strcmp($this->data['User']['new_password'],$this->data['User']['confirm_password']) == 0 ) { return true; } return

How to bake cakephp 2.0 application on windows with wamp

我们两清 提交于 2019-12-07 11:10:41
问题 I want to bake cake php project on Windows system. I'm using wamp server for PHP mysql. I've gone through the video casting on the cakephp site. And did set up the environment setup. After giving command "cake" as per the demo,Finally I got a message saying 'php' is not recognized as internal or external command. operable program or batch file. Please help me in baking cake php 2.0 project in Windows system. 回答1: You need to put the path to the php.exe into your system variables. Right-click

Paginator (Migration from Cake 1.3 to 2.0)

南楼画角 提交于 2019-12-07 09:48:27
I am struggling with the paginator in Cakephp 2.0. While I am trying to migrate my application to 2.0 I cant find any solution to jump directly to the last page. In 1.3 it was quiet to do that from outside like this: echo $this->Html->link(__('Flights'), array('controller' => 'flights', 'action' => 'index','page' => 'last')); but this little trick putting 'page:last' in does not work anymore in 2.0. Of course there is a Paginator function called last, but this would only help if I would be already inside the app. My Problem is to access from an outside link directly the last page of the

Authorization adapter was not found in cakePHP

ぃ、小莉子 提交于 2019-12-07 06:36:44
问题 I'm trying to move my code from local to server when i try to login into the application Here is my AppController class AppController extends Controller{ /* Determines what logged-in users access to */ var $components = array('Auth','Session'); public function isAuthorized($user){ return true; } public function beforeFilter(){ $userdetails = array(); $this->Auth->autoRedirect = false; $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login'); $this->Auth->loginRedirect =

CakePHP Cache::clear does not work

假如想象 提交于 2019-12-07 06:19:57
问题 I have a Cache Configuration in my bootstrap.php file as Cache::config('long', array( 'engine' => 'File', 'duration' => '+1 week', 'probability'=> 100, 'mask' => 0666, 'path' => CACHE . 'long' . DS, )); and i am trying to clear cache when a setting is edited. Below is my admin_edit function public function admin_edit($id = null) { if (!$this->Setting->exists($id)) { throw new NotFoundException(__('Invalid setting')); } if ($this->request->is('post') || $this->request->is('put')) { if ($this-

Cakephp Authcomponent session expire after using SSL unforce method

自古美人都是妖i 提交于 2019-12-07 05:09:59
问题 Using SSL for 5 pages while during registration https://www.mysite.com/step1 https://www.mysite.com/step2 https://www.mysite.com/step3 - Auth component login https://www.mysite.com/step4 https://www.mysite.com/step5 After step 3 I am creating a Session of the user using Auth Component ( automatically make the user logged in by Auth component). But after step5 It will redirect to the following page http://www.mysite.com/welcome I am using SSL component unforced method to change HTTPS to HTTP .

Show all model validation errors on top of the page in cakePHP

我只是一个虾纸丫 提交于 2019-12-07 03:15:04
问题 I am new to CakePHP. When I am using Model Field Validations then it is showing error message infront of each required form field. I want to show it in a div at the top of the form. How I can implement it. Thanks in advance. Here is my Code: Model: <?php class User extends AppModel { public $validate = array( 'username' => array( 'required' => array( 'rule' => array('notEmpty'), 'message' => 'A username is required' ), array( 'rule' => array('minLength', 8), 'message' => 'Username must be at

CakePHP and Facebook with Security Component turned on

倖福魔咒の 提交于 2019-12-06 21:39:31
I want the Security Component turned on. BUT when you load a CakePHP app inside a Facebook tab, FB posts $_REQUEST['signed_request'] to my form - the problem with this is that the Security Component "reacts" to this "post" and gives me validation errors, black-hole, etc. How do I go around this? I could not find anything on the documentation to go around this problem. What I wanted was to somehow run the Security Component "manually" so that it only "reacts" when I actually submit my form and not when Facebook posts the $_REQUEST['signed_request'] to my form. UPDATE: <?php App::uses('CakeEmail

Password Hashing for SSO between Wordpress and CakePHP

匆匆过客 提交于 2019-12-06 15:56:38
We have a Wordpress site which we are going to gradually rebuild using the cakePHP framework. We will replace different parts of the Wordpress site incrementally, so we need to implement some sort of single sign on to allow authorization across both frameworks during the time while both frameworks are running side by side. We have a pretty good strategy for how to do this. In short, we will duplicate all user rows in two different tables: one table for Wordpress ( wp_users ) and a different table for Cake ( users ). [More details outlined here (in case you're interested).] This means when we