Thanks Amit. I have tried your suggestion.
I used:
$this-Auth-Session-write($this-Auth-sessionKey . '.id', $this-
User-getLastInsertID());
but it just became worse.
$this-Auth-user('id') doesn't return anything if I do that.
On Sep 24, 1:39 pm, Amit Badkas [EMAIL PROTECTED] wrote:
2008/9/24
i’m trying to just create a “selected” option
basically i just want the “Yes” option to be the default
Hi slimcady,
There are two approaches I can think of:
1) Set $showEmpty to false to automatically make the first option be
selected (removes the empty option).
2) Build an array of the
Thanks for the tip! In the previous, non-Cake version of the app, I
did that exactly, so it shouldn't be too too tough to get it up and
running again. I was kinda avoiding SQL b/c it seemed like the Cake
way should be to push it through the Cake layer let CakePHP make it
automagically happen.
El 24/09/2008, a las 7:28, mario escribió:
Do anyone of you have an idea on how to automatically login
after signing-up using Auth Component?
This seems a task for $this-Auth-login()
http://api.cakephp.org/1.2/class_auth_component.html#5c2562e36d1fb6f8b93a15fb23604abc
--
Fran Iglesias
Thanks for the info guys...really appreciate it
@RichardAtHome.whoops i forgot to mention the model
inbetweentypo...thnx for pointing tht out
Forrestgump
On Sep 23, 2:54 pm, techiguy [EMAIL PROTECTED] wrote:
hi forrestgump,
using $this-find() in controller doesn't voilate the MVC
hi guys,
if we have written queries directly in to the controller (users) will
this voilates the MVC architecture??
i have written in my users_controller.php like this
$this-set('users',$this-User-query(select * from users));
or if i use like this
$this-User-query(insert into users(id,name)
That would be one option.
Here is my signup code:
function signup()
{
if (!empty($this-data)) {
if(isset($this-data['User']['password2']))
{
$password2hashed = $this-Auth-password($this-
El 24/09/2008, a las 9:02, mario escribió:
This time, it failed to login the user. It seems like there is some
problem in terms of hashing my password.
Not sure, but you may try to login the User, with the non-hashed
password.
--
Fran Iglesias
[EMAIL PROTECTED]
Yup. I see the point.
So in this case,
$this-Auth-login($this-data); // login user
I'm trying to pass the data from my form to be used for login.
As what I know, cakephp automatically hashes the password field of the
model 'user'.
So using $this-data in $this-Auth-login() might have some
El 24/09/2008, a las 9:31, mario escribió:
So in this case,
$this-Auth-login($this-data); // login user
I think you have the plain version of the password in password2 field.
You could do some like:
if ($this-User-save($this-data)) {
$this-data['User']['password'] =
I was wondering if cake1.19 does does this mysql_escape automagically?
--~--~-~--~~~---~--~~
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
Ok, I completely removed Cake, and replaced it with a clean install. I
still can't get any reaction for any addresses except /cake and /cake/
app. Shouldn't for example /cake/foo/bar call action bar() of
controller foo()? I get just a 404 Not Found, so this apparently isn't
going to Cake's
Turns out mod_rewrite isn't loaded by default. D'oh...
Btw, Windows Visva seems to maintain two sets of the files under
Program Files. Even after deleting Cake and re-extracting it, editors
still open the old files, and saving them will go to the same limbo...
Notepad and Wordpad open the files
On Wed, Sep 24, 2008 at 12:14 PM, techiguy [EMAIL PROTECTED] wrote:
$this-User-query(insert into users(id,name) values ($id,$name));
IMO - The ideal way would be to first figure out if you can get by
with using the standard model functions and avoid writing a query.
However if you do need to
Hello Fran,
I got it now working. Thanks for the big help!
Actually, $this-Auth-login($this-data); // login user
is already correct. I just missed to call the line to
redirect the user to the designated page.
Now it looks like this:
if ($this-User-save($this-data)) {
$login =
@leberle : Nevermind. Just like me, confused about horizontal and verticall
in begining.
@mark :
Thanks Mark!, Extendable behaviour is good stuff.
Nice reference ..
On 9/23/08, mark_story [EMAIL PROTECTED] wrote:
As for an already built solution to EAV in cake take a look at
Hello,
Iam trying to figure out a way for a model to :
1)test the existence of a table.
2)if the table doesnt exist i wish the model to create the table.
can someone help?
Forrestgump
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
This is my current code:
class AppController extends Controller {
var $components = array('Auth');
function beforeFilter() {
$this-Auth-authorize = 'controller';
$this-Auth-allow('*');
$this-Auth-deny('admin', 'accnt', 'faq'); // does not work
}
function
S'ok, I created 'fake' functions in the user controller, then added
the views to the users views, then take the Authentication process
from the app_controller to the users_controller..
On Wed, Sep 24, 2008 at 10:54 AM, gabriel [EMAIL PROTECTED] wrote:
This is my current code:
class
Hope this helps:
http://groups.google.com/group/cake-php/browse_thread/thread/b3233665ad126fa7/79b31d15345cdfd1?lnk=gstq=to+model+or+not+to+model#79b31d15345cdfd1
On Sep 24, 2:17 pm, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
On Wed, Sep 24, 2008 at 12:14 PM, techiguy [EMAIL PROTECTED] wrote:
First of all people: what Rule? It's not made of rules, it's a pattern
to follow - but follow as you want.
Second, no, it doesn't break the Rule it only makes your code uglier
and hard to read - see above - but the thing is,
why to use a hand made query when you can easily/prettier/readablier
use
I dont think i asked anything bout using queries..i just wanted to
know wht would be the best practice..but thnx for the info...will
avoid $this-Model-query()
On Sep 24, 4:32 pm, Rafael Bandeira aka rafaelbandeira3
[EMAIL PROTECTED] wrote:
First of all people: what Rule? It's not made
$this-Auth-deny('admin', 'accnt', 'faq'); // does not work
This doesn't work because the 'action' for all views in the pages
controller is 'display' not 'admin', 'accnt'
$this-Auth-deny(display) would work, but it would deny ALL views
handled by the pages controller.
Your workaround is a
Ohk...sry rafael...i did not read the entire thread
On Sep 24, 5:17 pm, forrestgump [EMAIL PROTECTED] wrote:
I dont think i asked anything bout using queries..i just wanted to
know wht would be the best practice..but thnx for the info...will
avoid $this-Model-query()
On Sep 24, 4:32
On Wed, Sep 24, 2008 at 1:32 PM, Rafael Bandeira aka rafaelbandeira3
[EMAIL PROTECTED] wrote:
First of all people: what Rule?
Rule of thumb perhaps? :)
--
Misanthropy unleashed:
http://dsi.vozibrale.com/
--~--~-~--~~~---~--~~
You received this message
Hi,
If this for a change of password or user registration, you will have a
confirm password field, this wont be sha1 by the auth conponent, so do
all the validation on this,
then encrypt it and compare to the password.
On 24 Sep, 00:05, rocket [EMAIL PROTECTED] wrote:
So I have validation code
If this is a once only import (populate initial db), I'd stick to
using mysql's data import command line tool and move onto something
more fun.
If it's something that needs to be run repeatedly e.g. a user uploads
a file that needs to be imported then write a custom method in the
Model that uses
ta
On Wed, Sep 24, 2008 at 1:17 PM, RichardAtHome [EMAIL PROTECTED] wrote:
$this-Auth-deny('admin', 'accnt', 'faq'); // does not work
This doesn't work because the 'action' for all views in the pages
controller is 'display' not 'admin', 'accnt'
$this-Auth-deny(display) would work, but
Hi dudes,
I've a problem with Set::extract when using multiple filters. Lets say
i have an array $my_posts which contains a bunch of nested newspost-
arrays, and now i want all posts from an author named pete which are
not hidden:
$result = Set::extract('/Posts[author=pete and hidden=0]/.',
I am also having this problem. I can't make it login.
Tried several versions, with both passwords (hashed, no hashed), but
nothing.
Currently i have this:
$this-Auth-login(array('User'=array('email'=$this-data['User']
['email'], 'password'=$this-data['User']['password2'])))
but it is not
I'm trying to get my computer set up for development on a cake
application someone else has developed. She's working on an OS X
laptop, as am I. Everything works great on her computer, and on our
production server (Ubuntu), but I can't for the life of me get it
working on my machine.
When I go
Hi,
I'm not sure if this is a bug, or I'm just blind... I've developed
some apps in cakePHP already, but I can't find the reason for this
problem.
I have a Gallery and a User Model. When fetching a Gallery, the
User array is empty (It should contain the fields specified in the
Thanks
RequestAction is good instead of $uses = array('module1', 'module2',
'module3', 'module4',
'module5');, is it your mean?
On Sep 23, 11:59 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
This kind of portal-page is one place where I have put requestAction
to good use. In combination with
I'm doing a Member, Attendance project for church with the following
schema below:
And I'm able to save from both end member, and attendance, but the how
do I deal with attendances_members.offering on the link table.
I'm able to show it in the view and save, but if I edit attendance,
the link
I realize I'm coming to the party a little late, but I just wanted to
take the opportunity to ask….
On Sep 23, 2008, at 11:37 PM, mark_story wrote:
As for an already built solution to EAV in cake take a look at
If you use the model functions for CRUD: Yes it does. See
DboSource::create, which will put all data through value(), which does
the escaping in a way which is appropriate to the database you use.
If you use use model::query for your statements, you'll have to use
the Sanitize class to clean
Solved:
$result = Set::extract('/Posts[author=pete][hidden=0]/.',
:)
note: this is not XPath conform...
On Sep 24, 1:31 pm, leberle [EMAIL PROTECTED] wrote:
Hi dudes,
I've a problem with Set::extract when using multiple filters. Lets say
i have an array $my_posts which contains a bunch of
I'm trying to use the Multiple Display Field behavior as described
here:
http://bakery.cakephp.org/articles/view/multiple-display-field-3
I run into two problems when using this:
1. Cake generates two error messages whenever I load a page that uses
this behavior:
SQL Error: 1064: You have an
Hi,
Try this:
1) define an alias to localhost into /etc/hosts file, e.g. dev-cake
2) define a virtual host into apache-dir/conf/extra/httpd-
vhosts.conf
VirtualHost *:80
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /home/cakephp/sandbox/
ServerName dev-cake
$this-Auth-login unfortunately doesn't use email as one of it's
fields
in logging in. it instead uses username and password as its
default fields.
You can see it at the implementation of the login function of Auth.
http://api.cakephp.org/1.2/auth_8php-source.html#l00568
it uses
Meitar,
I've used drupal quite a bit in the past, and I don't think there is
really anything that it does as far as content management that cannot
be done with CakePHP. If you were to use EAV (expandable) and table
inheritance you can easily build a data structure much like drupal.
With an api
I'm not familiar with that behavior, but I can offer you another
solution, which will work just fine if you need to combine two
fields...
http://teknoid.wordpress.com/2008/09/04/findlist-with-three-or-combined-fields/
On Sep 24, 9:03 am, Kanten [EMAIL PROTECTED] wrote:
I'm trying to use the
Mike, I think it's not how much data is Cake intended to deal with
is how much data your app is intended to deal with,
thousands of records is not something that should be dealed by php,
the database does it much faster and safer.
Having lots of data in database doesn't mean you have to deal with
Well that seems simpler, but I do like the thought of having this as a
behavior.
/Anders
On Sep 24, 4:29 pm, teknoid [EMAIL PROTECTED] wrote:
I'm not familiar with that behavior, but I can offer you another
solution, which will work just fine if you need to combine two
fields...
Rule of thumb perhaps? :)
If you really mean it: Let's say rule of thumb isn't exactly a rule.
Now, if you were being ironic: Yay right, that's the kind of rule that
can be applied to a pattern!
--~--~-~--~~~---~--~~
You received this message because you are
Hi Lance,
hahaha, that is an excellent solution! thank you, that works great,
building the array before the item...
one of these days i'll get the hang of programming...
=]
On Sep 23, 11:09 pm, Lance Willett [EMAIL PROTECTED] wrote:
i’m trying to just create a “selected” option
When localizing an application, is there a way to deal with variables
that require a certain order in the locale without creating a
conditional statement?
For example:
French: __(objectif, true) . . $year;
English: $year . . __(objectif, true);
Hi,
El 24/09/2008, a las 17:38, lemp escribió:
French: __(objectif, true) . . $year;
English: $year . . __(objectif, true);
The __() function supports the sprintf format, so
French: sprintf(__(objectif %s, true));
English: sprintf(__(%s objectif, true));
--
Fran Iglesias
Just cache $this-params['paging'] after initialize paginator
then read it
that's all!!
for example:
if(empty($query)){
$query = $this-paginate('Model');
$this-myCache-cacheQuery('paginator_'.$p,$this-
Just cache $this-params['paging'] after initialize paginator
then read it
that's all !!!
here is my code!!
if(empty($query)){
$query = $this-paginate('yourModel');
Hi at all!
I'm using i18n and i'm trying to search results with a form. But
cakephp creates a wrong query. I get the error below:
SQL Error: 1054: Unknown column 'Category.names' in 'where clause'
The query is:
SELECT `Category`.*, `I18n__name`.`content`, `Category`.`id` FROM
`categorys` AS
Thanks for the response - the idea of 'minimizing data that PHP
processes' as a design pattern for PHP web apps is an insight that I
had totally missed, and appreciate your pointing it out. It also
helps to explain why there isn't a whole lot on the internet about
perf tuning/profiling CakePHP
Good Evening,
I'm new to cake, and have reached a dead end with a hasMany, belongTo
problem, and wondered if you guys could help.
This problem has 2 models, Event and EventType.
An Event belongs to an Event Type, for example a soccer match event
would be of the sports event type.
My models
Well, again, it's not a matter of can or can't, the thing is, there's
no why... even wanting a full featured view, with whole lots of data
of all sorts of associations and purposes, what you have to keep in
mind is, why? : where does it fits in your app design? and if you
ever planned it or just
Hello guys,
I'm having a strange behavior from cakePHP, which i'll try to explain. I
have the following scenario:
- I have two environments: one is my local machine (actually, two machines
for developing), where i actually do the development, and the second one is
the server where i send the
tried to set your source code files encoding to UTF-8? The default of
many IDEs is to set them as ISO-8859-1, wich messes up with accented
chars, make sure you are rendering your content in UTF-8 too. But
anyway, I would like to point that it's not a good idea, accented
chars are generally a pain
Are your foreign keys named correctly?
What does your SQL debug tell you about the query?
On Sep 24, 1:06 pm, James Pearson [EMAIL PROTECTED] wrote:
Good Evening,
I'm new to cake, and have reached a dead end with a hasMany, belongTo
problem, and wondered if you guys could help.
This
Thanks Fran,
it do work nicely.
One small point I just bump on: if you use numbered arguments, be sure
to quote your string in single quotes to prevent PHP from escaping it
(i.e. trying to replace the varaible $s to its value), as in:
sprintf(__('Results for Q%1$s %2$s', true), $quarter,
Actually, there is no accented chars in the source code. Those chars come
from the database, some records have fields with accented chars.The problem
happens when cake fill the html fields with those values. For example:
The code:
echo $form-hidden('Model.field');
will generate something like
Thanks for the advice!
The 'Just Build It' thing is good, and pretty much how I arrived at
the point that Im currently at. Since I'm doing this as a side-thing
(I mostly teach, and I'm doing this app on my own time), I'm worried
about being slammed by my app not scaling well, and me having to
I am getting a weird issue with my $javascript in my default.ctp:
I have this in the header of the default.ctp:
?
if ($javascript) {
e($javascript-link('swfobject'));
}
?
I have Javascript in my helper of the HomePages controller. In fact
when I go to:
Is anyone aware of some decent cakephp web hosting? (google doesn't
reveal much)... Not just some hosting that allows you to setup
cakephp, which most php hosts do.
What I mean is that you upload your app, and the rest is handled for
you... No need to setup cake core, etc.
As additional options
Well, just updating the info, i've just checked that in my local linux
computer the problem also happens.
So, looks like it's related to the way Linux handle those chars.
Any ideas?
Regards,
Luiz Poleto
2008/9/24 Luiz Poleto [EMAIL PROTECTED]
Actually, there is no accented chars in the source
I know that AppController::beforeFiler() is a better place to put the
Auth Component configuration to share the same configuration between
all controllers and have all protected by Auth.
On Sep 23, 2:52 pm, Golam Kibria [EMAIL PROTECTED] wrote:
hello i have tried authcomponent but i dont know
Are you trying to add a new but existing pair of (attendance, member)
to the join Table? The data in the join table must be unique, and
there is a key in the association array for the purpose of having the
pair of the 2 foreign keys unique in the table (like a composite key).
Maybe you are trying
Ok.
I've just found out what the problem was:
- My database and its tables where setup to charset = utf-8.
- my html tag was setup to ISO-8859-1.
when we did the insert in the database, i guess the fields were passed to
the server as iso-8859-1 encoding, and saved this way in the database.
nobody to give a suggestion ?
On Sep 24, 2:47 pm, forrestgump [EMAIL PROTECTED] wrote:
Hello,
Iam trying to figure out a way for a model to :
1)testtheexistenceof atable.
2)if thetabledoesnt exist i wish the model to create thetable.
can someone help?
Forrestgump
67 matches
Mail list logo