cakephp-1.2

Cakephp sharing auth between two applications

て烟熏妆下的殇ゞ 提交于 2020-01-24 16:39:05
问题 Is there an easy way to share login information between two cakephp apps on the same domain? Basically, MainApp has a full fledged user management suite, and I just want SecondaryApp to know if a visitor is logged in or not. 回答1: Make sure both applications are configured to handle the session the same way. In other words, we want both apps to read from the same cookie and we need both apps to look in the same location for that cookie. //app\config\core.php for both apps Configure::write(

Why is the CakePHP authentication component not hashing my password?

徘徊边缘 提交于 2020-01-11 12:15:14
问题 I'm using CakePHP 1.2 with Auth and ACL components. In my user register action, the password is coming in unhashed. Specifically, this expression: if ($this->data['User']['password'] != $this->Auth->password($this->data['User']['confirm_password'])) This is evaluating to true, even when I submit identical values for password and confirm_password . I know that password is unhashed because when I remove the call to Auth->password , the expression evaluates to false. I expected the Auth module

CakePHP Auth Component Using 2 Tables

倾然丶 夕夏残阳落幕 提交于 2020-01-10 01:35:27
问题 CakePHP Version 1.2.5 I would like a single user to have multiple email addresses. I would like a single user to have a single password. I would like users to log in using any of their multiple email addresses and their single password. I have created a users table with an id and a password field. I have created a user_email_addresses table with an id field a user_id field and an email_address field. Question: How do I modify the auth component minimally to look for the "username" in this

How to Limit the paginate in cakephp

a 夏天 提交于 2019-12-30 17:31:31
问题 How to Limit the paginate in cakephp ? Assume that i have 400 records. I need to get only 25 records from 50th record to 75th record and need to display 5 records per page. How i can do this in paginate ? Sample Code: $this->paginate = array( 'contain'=>array('User'), 'recursive' => 2, 'order' => array('Profile.winning' => 'DESC'), 'limit' =>5 ); 回答1: You can set conditions for the pagination. function listRecords() { $this->paginate = array( 'conditions' => array('Model.id >=' => 50, 'Model

Set the default value of drop-down list with the last value chosen

…衆ロ難τιáo~ 提交于 2019-12-24 08:24:23
问题 I'm using cakephp 1.2, and I have a search form which has also this menu: Classificazione  <select style="margin-top: 5px;" name="classificazione"> <option value="art0"></option> <option value="C">Articoli</option> <option value="D">Documentazione</option> <option value="A">Libri</option> <option value="G">Materiali</option> <option value="B">Riviste</option> <default value="A"> </select><br /> In the next page I want to set the default value of this menu with what the user has chosen before.

Why can't CakePHP bake connect to MySQL running under EasyPHP on Windows Vista Ultimate?

拜拜、爱过 提交于 2019-12-24 08:06:16
问题 I CakePHP (cake_1.2.2.8120) and EasyPHP (3.0) installed on Windows Vista Ultimate. I followed the "baking" tutorials online, successfully set the database connection with the "cake bake" command from the CLI. I baked the controller for my "Users" table using the "php cake.php bake controller Users" command - worked fine. However, when I tried baking the view similarly, I got this message: Fatal error: Call to undefined function mysql_connect() in C:\Web\EasyPHP \www\cake\cake\libs\model

CakePHP 2.1 Measuring Page Execution Time

China☆狼群 提交于 2019-12-24 00:54:29
问题 How can I Measure the Page Execution Time in CakePHP 2.1? In 1.3 it was rendered in the code when in debug mode. 回答1: You could use DebugKit Plugin to find out execution time. Or you can edit index.php in app/ and add: // top of file $starTime = microtime(true); // bottom of file echo '<!-- Exec time: ', microtime(true) - $startTime, ' -->'; That time will be in microseconds so you could convert it to ms if you want, but DebugKit gives you a lot more information. 回答2: Note that the time

How do you log php errors with CakePHP when debug is 0?

安稳与你 提交于 2019-12-21 20:22:28
问题 I would like to log PHP errors on a CakePHP site that has debug = 0. However, even if I turn on the error log, like this: error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED log_errors = On it doesn't log errors. The problem is that even for a parse error that should cause the CakePHP environment to not load completely (I think), it still blocks the error from being logged. If I set debug to 3, it logs to the file without issue. I am using CakePHP 1.2. I know this is apparently made easier in

CakePHP Auth component redirect issue

会有一股神秘感。 提交于 2019-12-19 07:52:08
问题 I am having trouble getting the Auth component do the redirects I want in a CakePHP 1.2.6 app. I have a login form that appears on all pages and I want to keep the user on the page he logs in on. For example, if he is viewing another user's profile, I want to keep him there after logging in, not redirect him to the $this->Auth->loginRedirect action. Also, another thing about my app is that I have no "authenticated access only" pages, every page is accessible to everyone, but if you're logged

CakePHP: Setting up ACL allow/deny not working (tables not being updated)?

孤人 提交于 2019-12-13 20:38:05
问题 I am trying to set up my ACL with the following action in my UsersController: class UsersController extends AppController { var $name = 'Users'; var $helpers = array('Html', 'Form'); function beforeFilter() { parent::beforeFilter(); $this->Auth->allow('*'); } function install() { $group =& $this->User->Group; //Allow admins to everything $group->id = 1; $this->Acl->allow($group, 'controllers'); //allow users $group->id = 2; $this->Acl->deny($group, 'controllers'); $this->Acl->allow($group,