Re: CakeDC users plugin

2011-03-24 Thread Zaky Katalan-Ezra
I doesn't.
I downloaded  
Sample-Comments-Applicationand
used it as a reference

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-24 Thread Ryan Schmidt

On Mar 24, 2011, at 02:17, Zaky Katalan-Ezra wrote:

> Did you put this in app_controller?

Nope, but I'll try it, thanks. Where in the users plugin documentation does it 
say to do this?

> public function beforeFilter() { 
> $this->Auth->authorize = 'controller'; 
> $this->Auth->fields = array('username' => 'email', 'password' => 
> 'passwd'); 
> $this->Auth->loginAction = array('plugin' => 'users', 'controller' => 
> 'users', 'action' => 'login', 'admin' => false); 
> $this->Auth->loginRedirect = '/'; 
> $this->Auth->logoutRedirect = '/'; 
> $this->Auth->authError = __('Sorry, but you need to login to access 
> this location.', true); 
> $this->Auth->loginError = __('Invalid e-mail / password combination.  
> Please try again', true); 
> $this->Auth->autoRedirect = true; 
> $this->Auth->userModel = 'User'; 
> $this->Auth->userScope = array( 
> 'User.active' => 1); 
>  
> if ($this->Auth->user()) { 
> $this->set('userData', $this->Auth->user()); 
> $this->set('isAuthorized', ($this->Auth->user('id') != '')); 
> } 
>  
> }
> 
> 

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-24 Thread Zaky Katalan-Ezra
Did you put this in app_controller?

public function beforeFilter() {
$this->Auth->authorize = 'controller';
$this->Auth->fields = array('username' => 'email', 'password' =>
'passwd');
$this->Auth->loginAction = array('plugin' => 'users', 'controller'
=> 'users', 'action' => 'login', 'admin' => false);
$this->Auth->loginRedirect = '/';
$this->Auth->logoutRedirect = '/';
$this->Auth->authError = __('Sorry, but you need to login to access
this location.', true);
$this->Auth->loginError = __('Invalid e-mail / password
combination.  Please try again', true);
$this->Auth->autoRedirect = true;
$this->Auth->userModel = 'User';
$this->Auth->userScope = array(
'User.active' => 1);

if ($this->Auth->user()) {
$this->set('userData', $this->Auth->user());
$this->set('isAuthorized', ($this->Auth->user('id') != ''));
}

}

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-23 Thread Sam Sherlock
I think connecting the admin login to the non admin login will work

Router::connect('/admin/users/login', array('plugin' => 'users', 'prefix' =>
null, controller' => 'users', 'action' => 'login'));



On 23 March 2011 18:39, Ryan Schmidt  wrote:

>
> On Mar 23, 2011, at 10:16, Sam Sherlock wrote:
>
> > http://localhost/sample/admin/users/users/
> > is the one
> >
> > this works fine for me as far as I recall
>
> When I access
>
> http://localhost/admin/users/users
>
> It redirects to
>
> http://localhost/admin/users/login
>
> and says
>
> Error: LoginController could not be found.
>
> I don't have a login controller; the users plugin readme doesn't say I need
> to make one.
>
>
>
> --
> 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 help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-23 Thread Ryan Schmidt

On Mar 23, 2011, at 10:16, Sam Sherlock wrote:

> http://localhost/sample/admin/users/users/
> is the one
> 
> this works fine for me as far as I recall

When I access

http://localhost/admin/users/users

It redirects to

http://localhost/admin/users/login

and says

Error: LoginController could not be found.

I don't have a login controller; the users plugin readme doesn't say I need to 
make one.



-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-23 Thread Zaky Katalan-Ezra
In a dozen other projects yes but not in this one.

Thank you

On Wed, Mar 23, 2011 at 7:44 PM, Sam Sherlock wrote:

> have you got
> line 88 (ish) -  Configure::write('Routing.prefixes', array('admin'));
> of app/config/core.php
>
> http://book.cakephp.org/view/950/Prefix-Routing
>  - S
>
>
>
>
> On 23 March 2011 17:33, Zaky Katalan-Ezra  wrote:
>
>> I get this message:
>> Missing Controller
>>
>> *Error: * *AdminController* could not be found.
>>
>> *Error: * Create the class *AdminController* below in file:
>> app/controllers/admin_controller.php
>>
>> > class AdminController extends AppController {
>>
>>  var $name = 'Admin';
>> }
>> ?>
>>
>>
>>
>


-- 
Regards,
Zaky Katalan-Ezra
QA Administrator
www.IGeneriX.com
Sites.IGeneriX.com
054-7762312

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-23 Thread Sam Sherlock
have you got
line 88 (ish) -  Configure::write('Routing.prefixes', array('admin'));
of app/config/core.php

http://book.cakephp.org/view/950/Prefix-Routing
 - S



On 23 March 2011 17:33, Zaky Katalan-Ezra  wrote:

> I get this message:
> Missing Controller
>
> *Error: * *AdminController* could not be found.
>
> *Error: * Create the class *AdminController* below in file:
> app/controllers/admin_controller.php
>
>  class AdminController extends AppController {
>
>   var $name = 'Admin';
> }
> ?>
>
>
>

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-23 Thread Zaky Katalan-Ezra
I get this message:
Missing Controller

*Error: * *AdminController* could not be found.

*Error: * Create the class *AdminController* below in file:
app/controllers/admin_controller.php



-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-23 Thread Sam Sherlock
http://localhost/sample/admin/users/users/
is the one

this works fine for me as far as I recall



On 23 March 2011 04:28, Zaky Katalan-Ezra  wrote:

> Also in the users index view the edit and view buttons next to each users
> pass the user id when view is looking for slug parameter and edit need no
> parameter at all.
> Looks like a sloppy work.
> But still great plug-in with a bit of work it should be great.
>
> I set my user is_admin=1 but after login I didn't redirected to admin
> prefix.
> I also didn't success in typing the admin prefix in the url.
>
> My non admin url for index  view is http://localhost/sample/users/users/
> where do I add the admin prefix?
> I tried http://localhost/sample/admin/users/users/ and
> http://localhost/sample/users/admin/users/
> without success.
>
> On Wed, Mar 23, 2011 at 12:42 AM, Sam Sherlock wrote:
>
>> nope only migrations and schema
>>
>> https://github.com/CakeDC/users/tree/master/config/
>>
>> and to me it would make more sense if register mapped to add
>>
>>
>> On 22 March 2011 22:35, gremlin  wrote:
>>
>>> Just a guess - is there a routes file in the plugin that you didn't
>>> copy over to your config/routes.php? A route mapped from /users/add
>>> to /users/register would make sense for this sort of error.
>>>
>>>
>>> On Mar 22, 10:15 am, Ryan Schmidt  wrote:
>>> > Perhaps I should be asking: is there a tutorial somewhere that will
>>> show me how to use the users plugin -- starting from creating a new empty
>>> CakePHP app ending with a working example? The readme says it's simple to
>>> use, but I am not finding it so, and I don't seem to be the only one having
>>> trouble:
>>> >
>>> > http://www.webmastertalkforums.com/cakephp/18874-there-demo-app-anywh.
>>> ..
>>>
>>> --
>>> 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 help
>>> others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>>> at http://groups.google.com/group/cake-php
>>>
>>
>>  --
>> 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 help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
>
>
> --
> Regards,
> Zaky Katalan-Ezra
> QA Administrator
> www.IGeneriX.com
> Sites.IGeneriX.com
> 054-7762312
>

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-22 Thread Zaky Katalan-Ezra
Also in the users index view the edit and view buttons next to each users
pass the user id when view is looking for slug parameter and edit need no
parameter at all.
Looks like a sloppy work.
But still great plug-in with a bit of work it should be great.

I set my user is_admin=1 but after login I didn't redirected to admin
prefix.
I also didn't success in typing the admin prefix in the url.

My non admin url for index  view is http://localhost/sample/users/users/
where do I add the admin prefix?
I tried http://localhost/sample/admin/users/users/ and
http://localhost/sample/users/admin/users/
without success.

On Wed, Mar 23, 2011 at 12:42 AM, Sam Sherlock wrote:

> nope only migrations and schema
>
> https://github.com/CakeDC/users/tree/master/config/
>
> and to me it would make more sense if register mapped to add
>
>
> On 22 March 2011 22:35, gremlin  wrote:
>
>> Just a guess - is there a routes file in the plugin that you didn't
>> copy over to your config/routes.php? A route mapped from /users/add
>> to /users/register would make sense for this sort of error.
>>
>>
>> On Mar 22, 10:15 am, Ryan Schmidt  wrote:
>> > Perhaps I should be asking: is there a tutorial somewhere that will show
>> me how to use the users plugin -- starting from creating a new empty CakePHP
>> app ending with a working example? The readme says it's simple to use, but I
>> am not finding it so, and I don't seem to be the only one having trouble:
>> >
>> > http://www.webmastertalkforums.com/cakephp/18874-there-demo-app-anywh.
>> ..
>>
>> --
>> 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 help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
>  --
> 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 help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>



-- 
Regards,
Zaky Katalan-Ezra
QA Administrator
www.IGeneriX.com
Sites.IGeneriX.com
054-7762312

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-22 Thread Sam Sherlock
nope only migrations and schema

https://github.com/CakeDC/users/tree/master/config/

and to me it would make more sense if register mapped to add

On 22 March 2011 22:35, gremlin  wrote:

> Just a guess - is there a routes file in the plugin that you didn't
> copy over to your config/routes.php? A route mapped from /users/add
> to /users/register would make sense for this sort of error.
>
>
> On Mar 22, 10:15 am, Ryan Schmidt  wrote:
> > Perhaps I should be asking: is there a tutorial somewhere that will show
> me how to use the users plugin -- starting from creating a new empty CakePHP
> app ending with a working example? The readme says it's simple to use, but I
> am not finding it so, and I don't seem to be the only one having trouble:
> >
> > http://www.webmastertalkforums.com/cakephp/18874-there-demo-app-anywh...
>
> --
> 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 help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-22 Thread gremlin
Just a guess - is there a routes file in the plugin that you didn't
copy over to your config/routes.php? A route mapped from /users/add
to /users/register would make sense for this sort of error.


On Mar 22, 10:15 am, Ryan Schmidt  wrote:
> Perhaps I should be asking: is there a tutorial somewhere that will show me 
> how to use the users plugin -- starting from creating a new empty CakePHP app 
> ending with a working example? The readme says it's simple to use, but I am 
> not finding it so, and I don't seem to be the only one having trouble:
>
> http://www.webmastertalkforums.com/cakephp/18874-there-demo-app-anywh...

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-22 Thread Sam Sherlock
A few other things strike me as odd with the users plugin (I can't recall
what they are just now; not currently at my machine)

If there's not supposed to be an add action, then why does
> plugins/users/views/details/
> add.ctp echo $this->Html->link(__d('users', 'New User', true),
> array('controller'=> 'users', 'action'=>'add')) ?
>

thats a good question - might just be that it should be renamed.

http://www.webmastertalkforums.com/cakephp/18874-there-demo-app-anywhere-uses-cakedc-users-plugin.html


not that I have seen - why the poster asked there rather than here is beyond
me though.
I thought that perhaps the issues were particular to me - but maybe not

a sample application for users plugin would be ace

I guess the thing that makes it no simple is the advanced things you can do
with it;
It did take some effort getting setup (I am extending the plugins mvc within
my app)



On 22 March 2011 17:15, Ryan Schmidt  wrote:

> Perhaps I should be asking: is there a tutorial somewhere that will show me
> how to use the users plugin -- starting from creating a new empty CakePHP
> app ending with a working example? The readme says it's simple to use, but I
> am not finding it so, and I don't seem to be the only one having trouble:
>
>
> http://www.webmastertalkforums.com/cakephp/18874-there-demo-app-anywhere-uses-cakedc-users-plugin.html
>
>
> --
> 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 help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-22 Thread Ryan Schmidt
Perhaps I should be asking: is there a tutorial somewhere that will show me how 
to use the users plugin -- starting from creating a new empty CakePHP app 
ending with a working example? The readme says it's simple to use, but I am not 
finding it so, and I don't seem to be the only one having trouble:

http://www.webmastertalkforums.com/cakephp/18874-there-demo-app-anywhere-uses-cakedc-users-plugin.html


-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-22 Thread Ryan Schmidt
On Mar 22, 2011, at 11:54, Sam Sherlock wrote:
> On 22 March 2011 16:42, Ryan Schmidt wrote:
>> Accessing www.example.com/users shows me the plugin's list of users page, 
>> empty. There's a New User button which, when clicked, loads 
>> www.example.com/users/users/add, which says:
>> 
>> Error: The action add is not defined in controller UsersController
>> 
>> Error: Create UsersController::add() in file: 
>> app/controllers/users_controller.php.
>> 
> 
> the CakeDC plugin uses register

If there's not supposed to be an add action, then why does 
plugins/users/views/details/add.ctp echo $this->Html->link(__d('users', 'New 
User', true), array('controller'=> 'users', 'action'=>'add')) ?



-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC users plugin

2011-03-22 Thread Sam Sherlock
the CakeDC plugin uses register

you could make the route users/add connect to the register action of the
plugin

 - S



On 22 March 2011 16:42, Ryan Schmidt  wrote:

> I'm trying to add the CakeDC users plugin to my site. I've been postponing
> adding user login functionality, knowing I'd want to use this plugin.
>
> I've put the latest versions of the users, search and utils plugins into
> the plugins folder. I moved aside my existing users table, user model, users
> view, and users controller, which didn't have much in them. I let the plugin
> create its own users and details tables, using the schema shell.
>
> Accessing www.example.com/users shows me the plugin's list of users page,
> empty. There's a New User button which, when clicked, loads
> www.example.com/users/users/add, which says:
>
> Error: The action add is not defined in controller UsersController
>
> Error: Create UsersController::add() in file:
> app/controllers/users_controller.php.
>
> I'm not understanding why this isn't just working.
>
>
>
> --
> 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 help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakeDC users plugin

2011-03-22 Thread Ryan Schmidt
I'm trying to add the CakeDC users plugin to my site. I've been postponing 
adding user login functionality, knowing I'd want to use this plugin.

I've put the latest versions of the users, search and utils plugins into the 
plugins folder. I moved aside my existing users table, user model, users view, 
and users controller, which didn't have much in them. I let the plugin create 
its own users and details tables, using the schema shell.

Accessing www.example.com/users shows me the plugin's list of users page, 
empty. There's a New User button which, when clicked, loads 
www.example.com/users/users/add, which says:

Error: The action add is not defined in controller UsersController

Error: Create UsersController::add() in file: 
app/controllers/users_controller.php.

I'm not understanding why this isn't just working.



-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC Users Plugin - redirect based on role?

2011-03-04 Thread Sam Bernard
In the beforeFilter of your AppController you could set 
$this->Auth->autoRedirect = false

And then just manually fill in your login action

function login(){
if(!empty($this->data['User']) && $this->Auth->login($this->data))
if($this->Session->read('Auth.redirect')){ //if you got redirected to login 
by trying to access a protected function- it will redirect there instead of 
dashboard 
$this->redirect($this->Session->read('Auth.redirect'));
} else {
//check your group here and redirect based on that
}
}

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC Users Plugin - redirect based on role?

2011-03-04 Thread designv...@gmail.com
Scratch that.

While that seemed like a solution it doesn't make use of the admin
route...

Anyone else got any ideas?

d//t

On Mar 4, 9:55 pm, "designv...@gmail.com" 
wrote:
> I LIKEY!
>
> Cheers, that will do it just fine!
>
> d//t
>
> On Mar 4, 9:19 pm, Sam Bernard  wrote:
>
> > One simple way is just to have a generic "dashboard" action that chooses
> > what to display based on user role. You'll want to make sure to manually
> > call $this->render() in your _dashboard actions.
>
> > function dashboard(){
> > $this->autoRender = false;
>
> > if($this->Auth->user('role') == 'admin')
> > $this->_adminDashboard();} else {
>
> > $this->_userDashboard();
>
> > }
> > }

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC Users Plugin - redirect based on role?

2011-03-04 Thread designv...@gmail.com
I LIKEY!

Cheers, that will do it just fine!

d//t

On Mar 4, 9:19 pm, Sam Bernard  wrote:
> One simple way is just to have a generic "dashboard" action that chooses
> what to display based on user role. You'll want to make sure to manually
> call $this->render() in your _dashboard actions.
>
> function dashboard(){
> $this->autoRender = false;
>
> if($this->Auth->user('role') == 'admin')
> $this->_adminDashboard();} else {
>
> $this->_userDashboard();
>
> }
> }

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC Users Plugin - redirect based on role?

2011-03-04 Thread Sam Bernard
One simple way is just to have a generic "dashboard" action that chooses 
what to display based on user role. You'll want to make sure to manually 
call $this->render() in your _dashboard actions.

function dashboard(){
$this->autoRender = false;

if($this->Auth->user('role') == 'admin')
$this->_adminDashboard();
} else {
$this->_userDashboard();
}

}

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakeDC Users Plugin - redirect based on role?

2011-03-04 Thread designv...@gmail.com
Hi there,

I have the CakeDC USers Plugin working fine and dandy, but I want to
have separate 'users' and 'admins' dashboards...

Anyone know how to modify the loginRedirect based on the user role?

Cheers!

d//t

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC Users plugin - routes issue

2011-02-17 Thread cricket
On Thu, Feb 17, 2011 at 7:02 AM, designv...@gmail.com
 wrote:
> Hi there there,
>
> I have integrated the CakeDC Users plugin fine and it all works out of
> the box, however I want to uses some neater routes for the
> login,register,dashboard actions but adding the following route:
>
> Router::connect('/login', array('plugin' => 'users','controller' =>
> 'users', 'action' => 'login'));
>
> Causes the login to break and I just get a white screen?

A blank screen generally means a fatal error somewhere. Have you
looked at the server's log? Also, try setting debug to 2.

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakeDC Users plugin - routes issue

2011-02-17 Thread designv...@gmail.com
Hi there there,

I have integrated the CakeDC Users plugin fine and it all works out of
the box, however I want to uses some neater routes for the
login,register,dashboard actions but adding the following route:

Router::connect('/login', array('plugin' => 'users','controller' =>
'users', 'action' => 'login'));

Causes the login to break and I just get a white screen?

Has anyone got any suggestions? Has anyone successfully achieved this?

TIA,

d//t

-- 
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 help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakeDC/users plugin

2011-01-04 Thread john lyles
I can't get the CakeDC/users plugin (available here: 
https://github.com/CakeDC/users)
to work. Maybe somebody knows why this is happening and can help me
figure it out. I'll try to explain it as clearly as possible.

My application consists of a 'Blog' model, 'BlogsController',
'PagesController'. Very simple. I have installed the following
plugins, all from CakeDC: categories, migrations, search, tags, users,
utils.

The users plugin has a User model and a Detail model

'Blog' belongsTo 'Categories.Category'. Later I will add an
association with 'Users.User', I just haven't gotten around to it
yet.

All the views work.

I'm using the following components: 'Auth' is set in the
app_controller. And 'Session', 'Email', 'Cookie', and 'Search.Prg' are
set in the UsersController. I am not using any components in the
BlogsController or PagesController yet, these decisions I will make
after I can get the users plugin to work.

I'm using the following helpers: 'Html', 'Form', 'Session', 'Time',
'Text', 'Utils.Gravatar'

I have a beforeFilter method set up in UsersController so that the
following actions are allowed: $this->Auth->allow('register', 'reset',
'verify', 'logout', 'login', 'index', 'view', 'reset_password'); Also
if action is registered then Auth is not enabled.

all the tables for all the plugins were built using migrations

I can register no problem. I get the flash message that the user was
added and that I will be receiving a confirmation email. I have the
email delivery set to debug so the verification link comes on screen.
When I plug in the verification link I get the flash message that the
email was validated and I get redirected to the login page.

When I try to login, I get the error message for failed
authentication. I know this because I set the 'loginError' to tell me
this.

Ok, so when I look in the users table, my user is there, active is set
to 1, email_authenticated is 1, tos is 1, passwd is there (40
characters), email address, username, slug, created, modified, all
that stuff is correct.

the details table returns empty set.

On the view page $this->element('sql_dump'); show the following:

Nr  Query   Error   AffectedNum. rows   Took (ms)
1   DESCRIBE `users`17  17  4
2   DESCRIBE `details`  10  10  4

that's all it shows. I have a feeling this is the problem...

the Debug level is set to 2, and outputs to a log file
I have my php.ini set to print all error, notices, deprecations, etc
to a log file
no clues from the logs

In the login action I set some variables to see what they contain
using Debugger::dump().

The results were:
$this->Auth->user() is NULL
$this->data['$this->modelClass'] returns an array of all the info I
entered in the login form: email,.passwd, remember_me. It also
includes 'return_to' which is empty, and 'password' which is NULL
$this->data; returns array( 'User' => array() );

I sincerely thank anyone who made it this far and/or can offer any
suggestion to help.

Jon Lyles






Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en