Actually you only need one table with the following fields:
username or email
password
group
+ additional fields that might be useful for your application
After login (with AuthComponent) you can check to which group the user
belongs. Depending on the group you can redirect the user to the corre
>
> I think HybridAuth is better in response data provided.
>
The only difference I can see is that HybridAuth does automatically login
using AuthComponent and Opauth does not. But actually this can be done in a
few lines of code. Opauth has the advantage that it is a nice plugin that
fits nic
Have a look at Opauth. It's a nice plugin working really well.
https://github.com/uzyn/cakephp-opauth
--
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, se
The Cookbook describes it very well. Have a look at rounting:
http://book.cakephp.org/2.0/en/development/routing.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
You're right, that someone could change the value using Firebug. To
prevent this you should use Cakes Security Component. If you use the
Security Component and the Form Helper to create your forms, Cake will
automagically add a hidden field containing a hash of your fields and
the values of hidden
As your app seems to be very easy, you could create the database as
Paul already described and then bake the rest (controllers, models,
views).
http://book.cakephp.org/view/1522/Code-Generation-with-Bake
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check
There is more than one way to create Excel sheets.
1. You can use a class like PHPExcel. You get a native Excel file.
2. You can save a simple HTML table as xls. Excel is able to read the
table.
3. You can create a CSV file. Excel is able to import the file.
Depending on your customers wishes, th
What about not using php_excel and writing Office XML using a simple
helper? That's the way I do it and it's working quite well. Of course
the helper has only a few features, but for simple exports that's ok.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their Ca
Hi Achilleas,
you are right that CodeSniffer validates your code to make sure that
it follows certain conventions. It is possible to define a validation
set that reflects CakePHPs conventions. If your code doesn't follow
these conventions CodeSniffer gives you a warning and you have the
possibilit
I use this plugin with NetBeans, too. Which coding standard you want
to use is just a matter of taste. In every case you have to make the
standard follow Cake conventions and this is my problem. Is there
really no one who uses CodeSniffer in a Cake project?
Check out the new CakePHP Questions site
Hi all
is there anybody out there who uses PHP CodeSniffer with his Cake app?
I tried PHP CodeSniffer for the first time and used the build in
coding standards to sniff my code. Actually I get warnings because of
Cake conventions.
Method name "PostsController::admin_edit" is not on camel caps for
Actually it's quite easy. Have a look at the cookbook:
http://book.cakephp.org/view/192/options-options
Hope that helps,
Markus
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 t
I think the memory usage is normal, as my app has the same usage.
Markus
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 g
I got the same error while creating an Excel file with many rows and
columns. So I guess the error is related to processing to much data.
You can either increase the memory limit or decrease the amount of
data to process.
Hope that helps.
Markus
Check out the new CakePHP Questions site http://cak
The problem with this approach is that Excel tries to parse certain
values. Just to mention one example: "1-10" will be converted to "01.
Oct".
I prefer the following approach from the bakery:
http://bakery.cakephp.org/articles/view/excel-xls-helper
Markus
Check out the new CakePHP Questions site
I use Cake alot in more or less big projects and personally I don't
see a problem with the future of CakePHP.
The only thing that will happen in case the Cake development is
stopped is that there will be no new releases / features. Well that's
a pitty, but if you can live with the current release
Is there realy no automagic in Cake that converts empty date fields to
NULL?
--
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-...@googlegroups.com.
To unsubscribe from this group, send email to
cake-php+unsub
Hi all,
In my form I have a date field. I use the form helper to generate a
year, month and day field for the date.
$form->input('date_field', array('type' => 'date');
Now I was asked to change the field, so that the users can enter the
date into a text field using -mm-dd as format.
$form->
http://api.cakephp.org/class/form-helper#method-FormHelpererror
Maybe this helps...
--~--~-~--~~~---~--~~
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 u
That's what I thought.
--~--~-~--~~~---~--~~
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..
In the beforeFilter event of your controller you have to use
$this->Auth->allow('action_of_your_form');
http://book.cakephp.org/view/563/Setting-Auth-Component-Variables
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Group
I'm currently reworking one of my early Cake applications and I want
to follow the "fat models - skinny controllers" principle. What I
don't understand is how to paginate a fat model. Is it true, that I
have to use pagination in the controller? Or is there another way?
Thanks,
Markus
--~--~--
You should also have a look at CounterCache:
http://book.cakephp.org/view/816/counterCache-Cache-your-count
Hope that helps.
Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this g
You could also have a look at Cakes media views:
http://book.cakephp.org/view/489/Media-Views
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroup
In my opinion using a model for breadcrumbs is bloated. Why don't you
just set the breadcrumbs in the view manually? The HTML helper has two
functions addCrumb and getCrumbs, which makes basic breadcrumbs really
simple.
--~--~-~--~~~---~--~~
You received this messag
I want to build a forum with CakePHP. The forum actually consists of
many forums. Each forum hasMany threads. A thread hasMany replies.
Forums, threads and replies are stored in separate tables. All
assossiations are setup correctly.
How can I sort threads and replies by date, so that the newest
There are at least 2 articles in the bakery that describe how to
create a real Excel file (no csv):
http://bakery.cakephp.org/articles/view/generate-excel-spreadsheets-from-your-database
http://bakery.cakephp.org/articles/view/excel-xls-helper
Personally I use the second one and it works quite g
Or the Cake way: http://book.cakephp.org/view/666/diff
$missing_numbers = Set::diff($the:array, $the_complete_array);
On 4 Aug., 11:36, Fran Iglesias wrote:
> You could try
>
> $missing_numbers = array_diff($the_array, $the_complete_array);
>
> El 04/08/2009, a las 9:57, liaogz82 escribió:
>
You should write a behavior. I guess that's the way to go. :-)
--~--~-~--~~~---~--~~
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 g
That's what I though about. But are there any unforseen problems with
this approach?
--~--~-~--~~~---~--~~
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 u
Is it recommended to set recursive = -1 application wide and only set
it to a higher value when it is really needed?
Are there any unforseen problems?
Thanks,
Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"C
and don't call $this->Model->save()
;-)
--~--~-~--~~~---~--~~
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
c
Have a look at NeutrinoCMS. It is based on CakePHP and has a web
installer included.
http://dsi.vozibrale.com/articles/view/neutrinocms-0-1-beta-has-been-released
Happy baking,
Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Did you set up the relationship between User and Profile properly?
There is no need to use "var uses" in your Profile controller, when
the relatioship is setup correct.
Markus
On 25 Jun., 10:31, Paulos23 wrote:
> Hello people,
> i am having an issue about profile id.I am using 2 models, User a
The problem was related to an encoding problem. Netbeans saved the
files as utf-8, but I wanted ISO 8859-1 to be used on my page. After
saving the files as ISO 8859-1 everything is ok now.
But I wonder if there is a way to get the umlauts encoded as
htmlentity (ü = ü) Is this not possible?
Thanks
Thanks for the help. I guess it's a problem with the encoding, because
either "Löschen" nor "Löschen" work. :-(
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cak
Hi, how can I use a German Umlaut in form->end('Löschen')?
--~--~-~--~~~---~--~~
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
This is the link to the corresponding chapter in the cookbook Adam
mentions:
http://book.cakephp.org/view/544/Prefix-Routing
Hope that helps,
Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To
Hi all,
I've a problem with associated models and form->dateTime.
I have the following models: User belongsTo Group hasOne Detail.
Now I want to edit User, Group and Profile in one form. User and Group
work without any problem, but there is a problem with the field
foundation_date of the Detail
Are you sure, that the connection settings are ok and the MS SQL
server is running?
You also have to change the security salt as the first message says.
But I gues that this is not related to your SQL server problem.
--~--~-~--~~~---~--~~
You received this message b
I would save the files using the user id as part of the filename e.g.
user_12.jpg
--~--~-~--~~~---~--~~
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 unsu
Well, my problem is not directly related to CakePHP, but as it's about
database design maybe I'll get some good answers.
On my page I have news, downloads and users. These three can be
commented. Additionally I have a shoutbox and a guestbook. The
comments, shoutbox and guestbook have all the sam
Are you sure that your problem is related to the PATH_SEPARATOR? I
guess they use the constant PATH_SEPARATOR to make it work on Windows
and Linux without having to worry about that.
I also develop on Windows using XAMPP and my production server is on
Linux. I never had that kind of problems.
--~-
I use admin routing to build an administration interface that has a
minimalistic design and is quite straight forward to the need to
administer the main page (write news, edit user profiles etc.)
So if you don't require this kind of admin interface than there is no
need to use admin routing at all
echo $form->input(
'password',
array(
'type' => 'password',
'value' => ''
)
);
Hope that helps,
Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this grou
Why do you call save when validation in the controller fails?
Save validates your data using the validation rules in your model. If
you want to do some extra validate in your controller, you should make
sure, that you don't call save when the extra validation fails.
Did you setup validation rules
You should have a look at the models section of the Cookbook:
http://book.cakephp.org/view/66/Models
This should be the most interesting part for you:
http://book.cakephp.org/view/78/Associations-Linking-Models-Together
--~--~-~--~~~---~--~~
You received this messag
Have a look at the Cake based Neutrino CMS:
http://dsi.vozibrale.com/articles/view/neutrinocms-0-1-beta-has-been-released
It uses a component to get these kind of data. I use this approach all
the time and it works like a charme.
Markus
--~--~-~--~~~---~--~~
You re
You should have a look at PHPExcel. It's a very good class for
creating Excel sheets on the fly.
http://www.codeplex.com/PHPExcel
Hope that helps.
Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" grou
As far as I can see from the source, the sluggable behavior increments
a number at the end of the slug in the case the slug is already in
use.
Pls. check the beforeSave event of the sluggable behavior.
Markus
--~--~-~--~~~---~--~~
You received this message because
Hi Dave,
I've never used the postal code validation rule, but I guess you have
to use a cutom validation rule to validate postal code from different
countries.
Why don't you ask the user for the country, the town and the postal
code? In that case you won't have to try different formats.
Hope tha
You can use a component to fetch sidebar data from the database.
Have a look at NeutrinoCMS, a cake based CMS:
http://dsi.vozibrale.com/downloads/categories/view/neutrinocms
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gr
Using the RequestHandler you could automatically switch the layout
based on the extension (in your case csv). In the layout file you
could generate the CSV content, which should be quiete easy.
--~--~-~--~~~---~--~~
You received this message because you are subscrib
How do you delete the user? You have to set the cascade parameter of
the del funtion to true. Otherwise related blog posts won't be
deleted.
http://book.cakephp.org/view/516/Deleting-Data
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Cake deletes expired entries from the session table automatically.
Therefore using the session table to track users could lead to wrong
figures.
Multiple records for the same IP address are ok. Try to open your site
with Firefox and IE at the same time. There will be 2 records for your
IP address
If you are using the Auth Component, this is a simple task:
http://book.cakephp.org/view/248/AuthComponent-Variables
Hope that helps.
Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to
Yes, it is possible to use validation without a table. Simply define
$useTable = false in your model and define the validation rules as if
there was a table. You can then use cakes form helper without any
problems.
This is how you can force validation in your controller (part of my
contact page):
I haven't tried it, but maybe this can help:
http://bakery.cakephp.org/articles/view/overriding-specific-html-tags-before-using-helper-methods
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post
Miles, that's bad news. But how can I solve my problem? Is there any
workaround?
--~--~-~--~~~---~--~~
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 unsu
Hi all,
I have 3 models: Company, Site and Country. All relations are set
properly.
Company hasMany Site
Company belongsTo Country
Site belongsTo Country
Using the Containable Behavior find queries and pagination works well,
except one thing: I can't get conditions to work that are related to
t
Take a look at the MultivalidateableBehavior in the bakery. That's
what I used to solve your kind of problems.
http://bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-validation-rulesets-per-model
--~--~-~--~~~---~--~~
You received this message b
http://book.cakephp.org/view/198/options-error
This should answer your question. :-)
--~--~-~--~~~---~--~~
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
Instead of changing a value in core.php you could switch the database
depending on the current DOCUMENT_ROOT or SERVER_NAME or some other
server variable that fits for the distinction between development
server and production server.
That's the way I do it and it works very well for me.
--~--~---
Brian, your solution seems to be ok, but there is one problem:
Let's assume the selectbox contains the 3 items de, nl and dk.
Selecting one of the items would pass the validation.
But aa, ab, ac, ad, ae and so on would also pass the validation
without being valid.
So what is the way to go? I gue
Did you already delete the cached files? I guess this should solve
your problem.
--~--~-~--~~~---~--~~
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 unsub
As far as I know the SecurityComponent checks for hidden fields.
But you could try it out using Firebug. ;-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-p
On your website you will most likely have parts that are displayed on
every page and other parts that change.
$content_for_layout contains the part that changes. :-)
Hope that helps.
Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed
LunarDraco, thanks for the explanation! Now it's clear why Janne wants
to separate the information.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@google
Why do you want to separate login information from other information
about the user?
I cant't think of a good reason to do this.
Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this
Hi Dave,
you could select the element to show based on the controller and / or
action that is currently used.
$this->params['controller'] and $this->params['action'] should help
you in your view.
Markus
--~--~-~--~~~---~--~~
You received this message because you
Hi everyone,
I'm searching for a way to validate selectboxes. I'm using the
SecurityComponent and Cake 1.2.
Let's assume I want to write an article. The article belongs to one
category and the categories are stored in my database and therefore
dynamic.
So I have a selectbox on my form for the c
I have a view were I show a news and it's related comments.
There is also a form in the view where the user can enter a new
comment.
I want to save the new comment in the news controller comment action,
because I don't want to use a comments controller.
Everything works well except the fact that
Hi Günther,
just in case you haven't already solved this problem, the following
link to the bakery should lead you into the right direction:
http://bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-validation-rulesets-per-model
Regards,
Markus
On 22 Sep., 14:25, Günther The
Hi guys,
after spending some more time I solved my problem with authError and
loginError messages of the Auth component only displaying in the
default language.
Just in case somebody has the same problem I post the solution. :-)
This is my app_controller.php file where only the L10n part and the
Hi,
there is no need to use the afterDelete event, because the delete
function of the model class gives a return value. Depending on the
return value you can set the flash message.
Pls. have a look at the API:
http://api.cakephp.org/class_model.html#680f1a7876f7be4d87308d4df3252e77
I hope this
Hi guys,
I'm currently localizing my application in English and German.
Everything works as expected. Except the authError and loginError
messages of the Auth component. I'm trying to set these messages in
the app_controller beforeFilter event. But the messages are always
shown in German (default
There is an article in the bakery about ACL. Maybe this is something
you are searching for?
http://bakery.cakephp.org/articles/view/acl-management-plugin
Hope this helps...
Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goo
Why don't you use jQuery or any other JavaScript framework that
supports tabs?
I know they only work when JavaScript is enabled, but is there another
reason for you?
Happy baking,
Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Instead of granting access to the guest group, you could define public
actions for each controller.
function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('index', 'view');
}
would be the way to go.
Happy baking,
Markus
--~--~-~--~~~---~
I think it is not right to be redirected to the referer page and
display the error message on the referer page. This is not what I
would expect when I try to access a certan page.
At first I wanted to be redirected to the login page, because I though
it is the right behavior to give the user the c
That's what I already did. When I'm not logged in and want to enter an
access controlled controller, I'm redirected to $loginAction.
But how is it possible to be redirected to $loginAction, when I'm
already logged in, but not allowed to access a controller?
--~--~-~--~~~---
Hello group,
I'm using Auth and ACL in Cake 1.2. It took quite a long time to get
it to work, but now everything is working, except one thing:
When I'm logged in and try to access a controller I don't have access
to, I'm redirected to the url I came from and get the message that I'm
not allowed
On Jan 17, 1:47 am, Luke <[EMAIL PROTECTED]> wrote:
> like 3 different menu.ctp files (menu-admin.ctp, menu-manager.ctp, and
> menu-default.ctp) ?
Yes, thats what AD7six meant. :-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
On Jan 16, 5:51 am, Baz <[EMAIL PROTECTED]> wrote:
> Oooohh, that's something I forgot to put in my tutorial!
>
> The session messages for Auth aren't written to Message.flash, it's to
> Message.auth...
>
Baz,
I was searching for the reason that no auth errors are displayed for a
long time!
Than
dardosordi, that is exactly the solution to my problem!
Thank you!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from
I don't want to use the badword model in my controller. I want to use
it in a behavior. Are there any possibilities?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send emai
I'm trying to write a badword behavior for my guestbook, where a
guestbook entry has to be verified when one or more badwords are
detected inside the guestbook entry. My badwords are stored in a
database. The problem is how to query the badwords, when the current
model is the guestbook?
Is the on
I've got it!
This is now part of my 'Comments' model.
var $belongsTo = array('Author' =>
array('className' => 'User',
'conditions' => '',
'order' => '',
'foreignKey
4 21:46:23
[modified] => 2007-09-04 21:46:23
[Author] => Array
(
[id] => 1
[nickname] => Braindead
[hash] => *
[user_id] => 1
[content] => The first test
[created] => 2007-09-04 21:46:23
[modified] => 2007-09-04 21:46:23
[Author] => Array
(
[id] =>
Thanks for the link. After searching the Bakery I found the tutorial
for the component:
http://bakery.cakephp.org/articles/view/confcomponent-db-based-configuration-tutorial
Brain
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
I'm currently also using a seperate file to store the configuration.
But I would prefer to store it in my database.
Where is the best place to query the database for the settings? When
the bootstrap.php is executed, the models are not yet available. Do I
have to use beforeFilter in every controll
You can set the title of the page inside the page. Just enter $this-
>pageTitle = '' on top of the page.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cak
> I can add another attribute to the Posts table, "url_title" for
> example, and then, when i add a Post, fill it with the title with
> white spaces string replaced to '-'.
>
> I was looking for a clean solution to string replace the white spaces,
> directly from $html-link() call.
Felix Geisend
> There is already a Enhancement ticket in the trac for this
> athttps://trac.cakephp.org/ticket/2405(along with a few other dateTime
> enhancements).
>
> If you want it now you can apply the patch in the ticket.
Thanks for the link. The first attachment already includes a patch for
my problem.
On Jul 20, 1:02 am, Geoff Ford <[EMAIL PROTECTED]> wrote:
> It is possible, you misread what speccy was saying. Use what you have
> and add a dateFormat key in the options array
I tried to add the dateFormat key yesterday before posting my question
and I tried it 2 minutes ago. Both times the se
I want to use $form->input with the type set to 'date'. The advantage
is, that it generates the select fields AND a label for the fields.
$form->dateTime does not generate the label.
My problem is, that I want to change the dateFormat to DMY. But I
think this is not possible, because the dateForm
I'm using Cake 1.2 and want to display some selects for date input.
This is my code:
input('User.birthday', array('type' => 'date',
'label' => 'Birthday', 'empty' => true, 'minYear' => date('Y')-60,
'maxYear' => date('Y')-15)); ?>
Is it possible to tell Cake to display the fields in DMY order in
Thanks for the answers. I never thought about putting this kind of
logic into the model. But Chris' recommendation with "Fat Models and
Skinny Controllers" makes sense to me. So I think I will take this
way. :-)
--~--~-~--~~~---~--~~
You received this message beca
Hi,
I'm new to MVC development and at the moment I'm quiet unsure about V
and C.
Let's assume I have a list of users in which I want to display an
avatar next to each user. If the user has no avatar I want to display
the default one. Both, the user avatar and the default avatar, are
stored in th
1 - 100 of 102 matches
Mail list logo