Re: Where to start?

2012-04-08 Thread INTERNET DATA CENTRE
i have done that part already .i even copy pasted the code but web browser dosent show anything i tried to give different paths e,g including index,php in browser adress like localhost/cakeblog/index.php/posts/hello_world On 4/8/12, kdubya wrote: > Start with the Blog tutorial. Follow it step-by-

Re: Auth->userScope is getting ignored

2012-04-08 Thread Vitor Pacheco
try this: $this->Auth->authenticate = array( AuthComponent::ALL => array( 'userModel' => 'User', 'fields' => array( 'username' => 'test', 'password' => 'test', ), 'scope' => array( 'User.usr_active' => 1, ) ), 'Form' ); http://book.cakephp.org/2.0/en/core-libraries/components/authentication.h

Re: Where to start?

2012-04-08 Thread kdubya
Start with the Blog tutorial. Follow it step-by-step. http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/blog.html On Sunday, April 8, 2012 8:02:47 AM UTC-4, masoodi wrote: > > Dear friends , > >I am new to cake . I have installed it .Now after installation what > shall be our fi

Where to start?

2012-04-08 Thread masoodi
Dear friends , I am new to cake . I have installed it .Now after installation what shall be our first action.i mean to say what have we to do after installation.It shows me a blank screen when i try to see my blog. My database name is cakeBlogs and table name Posts. what shall i do now to

Insert into postgres table with postgis extension

2012-04-08 Thread Everton Inocencio
I'm using CakePHP 2.1.1 and PostgreSql 9.1. And I'm trying to use the save() method of my Model, but one column need to use a DB function to convert a value to insert. Ex: *Array(* *'Ponto' => Array(* * 'id' => '',* * 'title' => ' default title ',* * 'ponto' => "ST_GeomFromText('POINT(1 1)',

Re: AutoLoginComponent Question

2012-04-08 Thread euromark
as you said - there is a lot of magic going on. so besides the login() statement there is nothing else but you can put these in your app controller - they will tell you more: protected function _autoLogin() { $this->log('SUCCESS - ' . $this->Session->read('Auth.User.id'), 'autologin'); if (Co

Re: AutoLoginComponent Question

2012-04-08 Thread heohni
well, I can see the checkbox, because of if (Configure::read('AutoLogin.active')) { echo $this->Form->input('auto_login', array('type'=>'checkbox', 'label'=>__('Remember on this computer'))); } 'requirePrompt' => true // no changes made here But I belive that the point is the redirection part. I

Re: AutoLoginComponent Question

2012-04-08 Thread euromark
my guess: you either didnt set requirePrompt to false OR you didnt provide the checkbox in the login form. this way it will also skip the cookie creation Am Sonntag, 8. April 2012 11:07:29 UTC+2 schrieb heohni: > > Hi, I tried to setup this AutoLoginComponent Component from > http://www.dereur

Re: AutoLoginComponent Question

2012-04-08 Thread euromark
you need to debug beforeRedirect() in there thats where the cookie is stored and only if you are currently in the login action: "case $this->settings['loginAction']:" initialize() and the rest of the code is for reading the cookie and if necessary to log in the user Am Sonntag, 8. April 2012 1

Re: AutoLoginComponent Question

2012-04-08 Thread heohni
But then I wonder how I do that? I mean, there is a lot of magic going on, my login looks like this: public function login() { if ($this->Auth->login()) { ... What do I have to do that the cookie creation happens before the login happens? Mark, I am so thankful that you are helping me, ev

Re: AutoLoginComponent Question

2012-04-08 Thread euromark
of course it will If $user is not empty - and you already have a logged in user the cookie willl only be created upon login just before the redirect Am Sonntag, 8. April 2012 13:20:15 UTC+2 schrieb heohni: > > Because it runs still into the if , do the return; and the script stops at > this poi

Re: AutoLoginComponent Question

2012-04-08 Thread heohni
Because it runs still into the if , do the return; and the script stops at this point for me. That is my problem :-) This way the cookie will never be created. Am Sonntag, 8. April 2012 13:07:06 UTC+2 schrieb euromark: > > so where is your problem? > looking at your debug statement, everything is

Re: AutoLoginComponent Question

2012-04-08 Thread euromark
so where is your problem? looking at your debug statement, everything is all right ! <=> NOT so !true === false and it will only run into the skip if it would be true (and active would be false) here Am Sonntag, 8. April 2012 12:51:11 UTC+2 schrieb heohni: > > If I do a debug($this->settings);

Re: AutoLoginComponent Question

2012-04-08 Thread euromark
I pushed an updated file but your problem must be in your code somewhere this setting can never ever become "false" if you don't overwrite it manually. try to debug $this->settings itself (does it still contain all the keys?) Am Sonntag, 8. April 2012 12:46:44 UTC+2 schrieb heohni: > > No, >

Re: AutoLoginComponent Question

2012-04-08 Thread heohni
If I do a debug($this->settings); I get array( 'password' => '*', 'active' => true, 'model' => 'User', 'username' => 'username', 'plugin' => '', 'controller' => 'users', 'loginAction' => 'login', 'logoutAction' => 'logout',

Re: AutoLoginComponent Question

2012-04-08 Thread heohni
No, $config['AutoLogin'] = array( 'active' => true, and protected $_defaults = array( 'active' => true, Am Sonntag, 8. April 2012 11:07:29 UTC+2 schrieb heohni: > > Hi, I tried to setup this AutoLoginComponent Component from > http://www.dereuromark.de/2012/02/02/more-persistent-sessions-in-

Re: Session unstable?

2012-04-08 Thread Dave
I get reports from users of being logged out randomly, using 1.3 branch, cake sessions and auth component. Based on the logic I've set in core.php, the session should last for days, but sometimes it is 10 minutes, sometimes an hour. It's very hard to pin point why though. On Apr 7, 4:36 am, heohni

Re: AutoLoginComponent Question

2012-04-08 Thread euromark
yes, it is active by default: https://github.com/dereuromark/cake-auto_login/blob/master/Controller/Component/AutoLoginComponent.php#L49 so you might have overwritten it somewhere in your configs Am Sonntag, 8. April 2012 12:07:22 UTC+2 schrieb euromark: > > Well, you can dynamically activate/

Re: AutoLoginComponent Question

2012-04-08 Thread euromark
Well, you can dynamically activate/deactivate it via Configure::write(). Put this in your configs: $config['AutoLogin'] = array( 'active' => 1 ); I was under the impression that the default value was 1. But I will look into that. Am Sonntag, 8. April 2012 11:07:29 UTC+2 schrieb heohni: > > H

Auth userScope ?

2012-04-08 Thread heohni
Hi, I wonder why this is giving me this error public function beforeFilter() { parent::beforeFilter(); $this->Auth->authenticate = array( AuthComponent::ALL => array('userModel' => 'User'), 'scope' => array('User.usr_active' => '1') } returns me Authentication adapter "scope" was not found.

Re: Auth->userScope is getting ignored

2012-04-08 Thread heohni
Update: even if add this for testing $this->Auth->fields = array('username' => 'test', 'password' => 'test' ); This is also ignored... -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and he

Re: Auth->userScope is getting ignored

2012-04-08 Thread heohni
Update: I found no the way with debug kit how to see the statement. And as I guessed, the userScope is not taking place: WHERE `User`.`username` = 'xx' AND `User`.`password` = 'xx' LIMIT 1 I added public function beforeFilter() { parent::beforeFilter(); $this->Auth->userModel = 'User'; $this-

AutoLoginComponent Question

2012-04-08 Thread heohni
Hi, I tried to setup this AutoLoginComponent Component from http://www.dereuromark.de/2012/02/02/more-persistent-sessions-in-cake2-x/ But while debugging the script as nothing happend eg no cookie was created I found out that on a initial setup I never pass the initialize function There is thi

Undefined property error message?

2012-04-08 Thread heohni
Hi, sometimes and only sometimes I get this error: Undefined property: View::$Bookmark [*CORE\Cake\View\View.php*, line *804*] *Fatal error*: Call to a member function countBookmarks() on a non-object in *D:\SVN-Homes\PHP\trunk\project\View\Layouts\default.ctp* on line *59* * * default line 59

Auth->userScope is getting ignored

2012-04-08 Thread heohni
Hi, I want to allow only active users to login and I used for this: public function beforeFilter() { parent::beforeFilter(); $this->Auth->userScope = array('User.usr_active' => '1'); } public function login() { if ($this->Auth->login()) { ... But I can still login with inactive use

Re: $this->Auth->user VERY slow

2012-04-08 Thread heohni
Hi, how can you see the speed this request needs? Am Donnerstag, 5. April 2012 17:00:49 UTC+2 schrieb Dan Moseley: > > Hi, > I have been experiencing extremely long run times for some calls to $this-> > Auth->user('id'). > > Most requests spend 0 time in this method, but seemingly random requests

Re: sending emails question

2012-04-08 Thread heohni
Yes, ok. Thanks! I wasn't never really aware of looking into the core files *shame* Am Samstag, 7. April 2012 18:37:15 UTC+2 schrieb heohni: > > Hi, > > I having a newsletter registration where I want to send an email to the > user and to the admin. > For now I only send to user this way: > // se