t
direction to be desc instead of asc.
On May 8, 12:35 am, Tim W <[EMAIL PROTECTED]> wrote:
> Thanks Marcin.
>
> I don't think i've been entirely clear. I can easily set the sort
> order programmatically, but when the user first clicks on a link to
> sort a column i
Here's an updated function to support the good Dr Lecter's idea of
resetting the cookie each time the user logs in. I'm fairly sure it
works...
function loginFromCookie() {
$cookie = $this->Cookie->read('Auth.User');
if (!is_null($cookie)) {
if ($this->Auth->login($cookie)) {
//
-for-cakephp
>
> Basically the same functionality as yours (+ the extra "continuous
> remembering"), but I don't have a working example with all the views
> etc.
>
> HTH someone too ;-)
>
> On May 13, 12:42 pm, Tim W <[EMAIL PROTECTED]> wrote:
>
&g
Cake 1.2 Auth is still pretty badly documented, but between a half
dozen articles I managed to get it all working. None tell the full
story though, and I don't fully understand it, but I have working code
I thought i'd share. I may post a bakery article if I get time. For
now this should help some
ssage-
> From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tim W
> Sent: 10. maj 2008 16:03
> To: CakePHP
> Subject: Accessing views from Cake - problem with array nesting
>
> Hi all,
>
> I've just spent a hour or so tracking down an issue befor
[id] => 11
[added_by_user_id] => 1
Once it's written out like this the problem and solution becomes
obvious(my excuse is it's 2am) - change $image['ModelName'] to
$image[0]
Hope this helps someone out, and maybe someone will work out a patch
one day.
Cheers
Tim
On
Hi all,
I've just spent a hour or so tracking down an issue before realising
it was caused by pointing cake at a view instead of a database table.
In general views work with Cake, but in some seemingly random cases
they fail.
The problem i've run into was identified and a patch suggested in this
<[EMAIL PROTECTED]> wrote:
> 'order' => 'Model.column DESC'
>
>
>
> On Wed, May 7, 2008 at 11:26 AM, Tim W <[EMAIL PROTECTED]> wrote:
>
> > Thanks for the suggestion, but unfortunately it didn't work for me.
>
> > SQL Error: 10
>
> http://www.kende.com
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
>
> Of Tim W
> Sent: Tuesday, May 06, 2008 9:26 AM
> To: CakePHP
> Subject: Making Paginator first sort direction DESC
>
> Hi all,
>
> Pa
Hi all,
Paginator's great, like the rest of Cake, but there's one little thing
I haven't been able to work out. By default when you click on a column
to sort it will sort ASC (ascending), but i'd like the first sort to
be DESC (descending). The options suggest this might be possible, but
I haven'
7;This must be blank or a positive decimal number'
> )
> );
>
> You could use a different regular expression to allow negative
> numbers, enforce limits on the fraction digits, or allow scientific
> notation as well.
>
> For example, if you wanted a positive number with maxi
echo '';
// Sample code to invalidate one field and make validation fail
$this->invalidate('field_Name', 'messageKey'); // messageKey can
be the error message or the key to the error message in the messages
array (see 1.2 validation documentation)
re
Hi all,
Say I have a check box and a text field on a form. If the check box is
checked the form has to have a number in it. If the check box isn't
checked then it must be empty. Does anyone know how to do this
validation in 1.2? I could write a custom validation method but I
can't work out how to
t wrote my own since it was
trivial and quicker. I'm still interested to hear a better way to do
this, if one exists :)
Tim
On Mar 28, 8:56 pm, Tim W <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have some data that's optional, but if it's filled in it must be a
> dec
Hi all,
I have some data that's optional, but if it's filled in it must be a
decimal. Is there an easy way to do this with 1.2 validation? My
current though is that I might create a custom validation rule, and
from their if the field isn't blank then send it through to the built
in validation cod
Hi all,
I have an issue with rendering getting itself into an infinite loop.
I've stepped through the code I can see what's going on, but I don't
want to mess with the core given I don't have a good overview of how
it all fits together. I can consistently reproduce this problem by
doing one thing
I just tried it and it works perfectly, thank you Grigri. And wow,
quick replies! :)
On Feb 15, 11:51 pm, grigri <[EMAIL PROTECTED]> wrote:
> Just set $this->Auth->userScope = array('User.state_id' => WHATEVER);
> in your controller's beforeFilter callback.
&g
That sound easy, i'll give it ago, thanks Grigri :)
On Feb 15, 11:51 pm, grigri <[EMAIL PROTECTED]> wrote:
> Just set $this->Auth->userScope = array('User.state_id' => WHATEVER);
> in your controller's beforeFilter callback.
>
> On Feb 15, 10:43 am
uot;Dardo Sordi Bogado" <[EMAIL PROTECTED]>
wrote:
> Use AuthComponent::$userScope = array() // accepts conditions in the
> same way that Model::findAll()
>
> On Fri, Feb 15, 2008 at 8:43 AM, Tim W <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > My use
Hi all,
My user table/model has a state_id field. I'd like to configure Auth
so that it only lets people login is the state is a certain value. Is
there an easy way to do this?
Two lines in auth.php suggest it should be possible
38: $conditions = $this->userScope; // (previously $conditions is
Thanks Samuel, I didn't think to check if there was a create type
method, cheers :)
On Feb 7, 3:00 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> I usually use $this->ModelName->create();
>
> On Feb 6, 2008 5:50 PM, Tim W <[EMAIL PROTECTED]> wrote:
&g
Hi all,
I've got a piece of code that does an insert, then and update of the
previous row inserted, then the code loops around and does the same
thing again for a different data set. I've found an issue that the
second time around the loop the AppModel is retaining the ID of the
previous insert a
doesnt change anything. Anyway, how is the
> loginRedirect handled usually? Is it, like I assume, $this-
>
> >redirect($this->Auth->loginRedirect()) within my login method?
>
> Arne
>
> On 5 Feb., 22:52, Tim W <[EMAIL PROTECTED]> wrote:
>
> > The only thin
ems',
> $this->Session->read('profiles_menuitems'));
>
> $this->set('is_admin', $this->isAdmin());
>
> $this->prepareSubmenu();
> }
> else
> {
>
Can you post the exact source code that generates the section in
question, as well as the code generated by Cake? In your web browser
you'll have to choose "view source" and copy and paste it out.
On Feb 6, 10:26 am, redcom <[EMAIL PROTECTED]> wrote:
> hello
> i have the following problem.
> i ha
Can you post your AppController beforeFilter method?
On Feb 6, 9:55 am, Arne-Kolja Bachstein <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I've got a slight problem with my Auth component atm. It always
> redirects me to a specific but really weird URL when successfully
> logging in. The URL is the
Hi all,
Is it possible to have a controller that doesn't map directly to a
model or database table? I want an admin section for my website where
I can edit users and other models, it'll hook into existing models
rather than having its own.
Thanks
Tim
--~--~-~--~~~---
Do you have sample vode for those Andy? I've also been banging my head
against 1.2 Auth for about 3 days and i'm tempted to rip it out and
write my own - which I expect to take about 2 hours.
On Feb 5, 11:08 pm, AD7six <[EMAIL PROTECTED]> wrote:
> > 2. When refresh a exprired auth page , it'll ju
Thanks Amit. I think i've cracked auth in 1.2 and the "remember me"
cookie issue. I'll go try and work out ACL now, if I can i'll put a
fully working sample project up somewhere.
On Feb 5, 12:59 am, "Amit Badkas" <[EMAIL PROTECTED]> wrote:
> On
Hi all,
Thanks mostly to the tutorial linked below I have basic auth working
in my project. I can create a user in the database (that took a while
to figure out), have users view public content without logging in, and
make users log in before they go to a page that's for registered only.
So far I
hat keys are sent to the
> model.
>
> Adam
>
> On Feb 2, 6:55 am, Tim Wild <[EMAIL PROTECTED]> wrote:
>
> > Does anyone have an idea about this? Or do I stop usingHABTMand do it
> > with a plain old database call?
>
> > Tim W wrote:
> > > Hi all,
Hi all,
I have a HABTM relationship that's working, but I want to tell it not
to delete and create new rows in the many to many table - I only want
it to treat that table as read only. Using the following unbindModel
command doesn't seem to affect it.
$this->Lens->unbindModel(array('hasAndBelong
Hi all,
I'm doing a save of a model, it has an association and the key is
being used in a join during the update, so that field isn't being
saved. I need to disable the join for the save so I can update the
field. Can anyone tell me how to do this?
I think I can do this using the unbindModel() m
Hi all,
Is this the best way to create a calculated field in a model object?
It works perfectly, but having to merge an array doesn't seem ideal,
and it's not OO at all.
function afterFind($results)
{
for ($i=0; $i < count($results); $i++) {
$lens = $results[$i]['Lens'];
34 matches
Mail list logo