Re: Auth problem, login not working.

2009-02-10 Thread Dcahrakos

oops, sorry, was in a rush to leave for work didnt have time to post
it.

The login function is empty, which according to the docs on the auth
component, thats the way its supposed to be since auth does it all.

my config for auth in the AppController is:

var $components = array('Auth');

function beforeFilter() {

$this->Auth->loginAction = array('controller' => 'users',
'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'members',
'action' => 'home');
$this->Auth->loginError = "Incorrect Password!";
$this->Auth->authError = "Sorry, you cannot access this page.";

}

On Feb 10, 2:49 pm, Miles J  wrote:
> Can we see your login action() and all the config for auth.
>
> On Feb 10, 1:29 pm, Dcahrakos  wrote:
>
> > Hi,
>
> > I am using the Auth component for registration and login, registration
> > is working perfectly, but login doesnt seem to be doing anything at
> > all,
>
> > I have Auth loaded in the AppController since I will be using it site
> > wide, however when I try to log in I just return to the login page
> > because the page it is supposed to redirect me to requires you to be
> > logged in.
>
> > The only message I get from auth is the message I set "Sorry you
> > cannot access this page"
>
> > my login.ctp is just a simple login form with a username and password
> > field,  and my Users controller has an empty login function at the
> > moment.
>
> > from what i've read everything should work, however it is not...
>
> > am I missing something here? do I need to add code to the login
> > function of the controller? or add anything to the user model?
>
> > Thanks.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: How to do Data Sanitization in CakePHP 1.2.9?

2009-02-10 Thread Yogesh

Hi,
I want to avoid the script tag so that no one do the hack or insert
the records using script tag.
I don't know what it should be called exactly, but in my database some
times records get inserted automatically and continuously about 100 to
150 records, these are seems to be inserted using some script and all
the records are like some javascript code or some links. and if Model
does this automatically how can these records get inserted. or I am
understanding the Data sanitization meaning in wrong way.


On Feb 10, 2:20 pm, Miles J  wrote:
> The model automatically sanitizesdatawhen inserting and selecting
> queries.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: switching databases on dev and production

2009-02-10 Thread cds

I saw this somewhere so I won't claim credit, but this how I do it.
You just have to change one value in core.php after implementing this
system. Since Configure::read is usable from views too, you can set
paths for javascripts like lightbox or other application elements
without hunting for changes after each commit.

Don't define $default in database.php and put the following at the
bottom of database.php:
function __construct() {
switch(Configure::read('WebApp.mode')) {
case "mamp":
$this->default = $this->mamp;
$this->test = $this->test_mamp;
break;
case "devel":
case "linode":
$this->default = $this->devel;
$this->test = $this->test_devel;
break;
default:
case "production":
$this->default = $this->production;
$this->test = $this->test_production;
break;
} // end switch
} // end construct()


Next, in core.php add the following:
Configure::write('WebApp.mode', 'devel'); # 'devel', 'production',
'linode', 'mamp'
if(Configure::read('WebApp.mode') == 'production') { Configure::write
('debug', 0); }

On Feb 10, 11:22 pm, travisbeck  wrote:
> that's what i had planned on doing.  I just hoped there was a cleaner
> way. thanks for the help though.
>
> On Feb 10, 10:12 pm, Adam Royle  wrote:
>
> > I use svn:ignore on app/config/database.php, and only commit a generic
> > database.php.default file (that contains no usernames/passwords). Each
> > time I checkout the code (dev, staging,production) I rename
> > the .default file to database.php and make my edits on the server. So
> > ultimately no passwords are stored in version control. The downside to
> > this approach is that if you need to change the database.php.default
> > file (adding another db source, etc) you then need to manually add the
> > changes into each deployment area.
>
> > I'm sure there's a better way, but this works for me.
>
> > Cheers,
> > Adam
>
> > On Feb 11, 12:38 pm, travisbeck  wrote:
>
> > > i see that you can add multiple database defnitions for
> > > development,production, and test in the database.php file.
>
> > > how do you get your application to switch between the different
> > > environments?  Our app is in version control and i'd very much like to
> > > not have to constantly worry about the database config everytime a
> > > change gets commited.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: switching databases on dev and production

2009-02-10 Thread travisbeck

that's what i had planned on doing.  I just hoped there was a cleaner
way. thanks for the help though.

On Feb 10, 10:12 pm, Adam Royle  wrote:
> I use svn:ignore on app/config/database.php, and only commit a generic
> database.php.default file (that contains no usernames/passwords). Each
> time I checkout the code (dev, staging,production) I rename
> the .default file to database.php and make my edits on the server. So
> ultimately no passwords are stored in version control. The downside to
> this approach is that if you need to change the database.php.default
> file (adding another db source, etc) you then need to manually add the
> changes into each deployment area.
>
> I'm sure there's a better way, but this works for me.
>
> Cheers,
> Adam
>
> On Feb 11, 12:38 pm, travisbeck  wrote:
>
> > i see that you can add multiple database defnitions for
> > development,production, and test in the database.php file.
>
> > how do you get your application to switch between the different
> > environments?  Our app is in version control and i'd very much like to
> > not have to constantly worry about the database config everytime a
> > change gets commited.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Render XML

2009-02-10 Thread mscdex

mscdex wrote:
>$post = $this->Post->getNormalViewData();

Sorry, that should be: $post = $this->Post->getNormalViewData($id);

You get the idea ;-)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Render XML

2009-02-10 Thread czarcrab

Many ways to do it; I am explaining the one I use.  I retrieve XML
based on extension.  So my URL looks like http://localhost/entries/index.xml

Here are my steps:

1. Add an XML directory under you views, for eg. in my case

app\views\entries\xml

2. Create an index.ctp with the following code

serialize($entries);
?>

3. Make sure you have the following line in Routes.php

Router::parseExtensions();

4. Add RequestHandler component to your Controller

var $components = array(’RequestHandler’);

5. [optionally] I also modify the index function in my controller to
the following

function index() {
$this->Entry->cacheSources = false;
$this->Entry->recursive = 0;
if ($this->params['url']['ext'] == 'html') {
$this->set('entries', $this->paginate());
} else {
Configure::write('debug',0);
$this->set('entries', $this->Entry->find('all'));
}
}

To understand how all of this works, refer to
http://www.pagebakers.nl/2007/06/05/using-json-in-cakephp-12/


On Feb 10, 11:38 pm, Alfredo Quiroga-Villamil 
wrote:
> This should be simple, yet for some reason can't find how to do it.
>
> I need to render XML.
>
> What is the correct way to accomplish this?
>
> Thanks in advance,
>
> Alfredo
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Render XML

2009-02-10 Thread mscdex

Alfredo Quiroga-Villamil wrote:
> This should be simple, yet for some reason can't find how to do it.
>
> I need to render XML.
>
> What is the correct way to accomplish this?

I use XML in my Cake application and here is what I've done:

In my routes.php, I added the line:
Router::parseExtensions('xml');

and included the "RequestHandler" component in my appropriate
controller(s).

Doing that allowed me to have simple urls like "/posts/view/10.xml" or
even "/posts.xml". When this extension is used, CakePHP sets a flag
indicating XML is being requested. You then can do something like this
in your controller action(s):

function view($id = null) {
if ($this->RequestHandler->isXml())
   $post = $this->Post->getForXML($id));
else
   $post = $this->Post->getNormalViewData();
$this->set(compact('post'));
}

Or you can just use the same query as you use for normal views. For my
application, my XML views do not need anywhere near the amount of
information I need for my normal views. Therefore, I have a separate
function that utilizes a query that only pulls in what's absolutely
needed for XML output.

Then all you need to do is create an "xml" subdirectory within your
controller view directory and create the necessary action named ctp
files for your XML output. For the view action example, the "blog/
views/posts/xml/view.ctp" file might be as simple as this (if the
controller is set up to use the XML helper):


serialize($post); ?>


or you can output the format of the XML your own way if serialize()
doesn't do what you want.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Render XML

2009-02-10 Thread Alfredo Quiroga-Villamil

I am actually originating an ajax request to load up a chart that will
be xml based.

I just did the usual:

$this->layout = 'ajax';

and passed my xml to the view. I got things working, however I would
still be interested in finding out how to handle xml responses in case
I ever need it in the future and if this is even the most recommended
approach for this kind of situations.

Thanks in advance,

Alfredo

On Tue, Feb 10, 2009 at 11:38 PM, Alfredo Quiroga-Villamil
 wrote:
> This should be simple, yet for some reason can't find how to do it.
>
> I need to render XML.
>
> What is the correct way to accomplish this?
>
> Thanks in advance,
>
> Alfredo
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Bug? Order isn't respected when doing a cascade delete

2009-02-10 Thread nebbian

Hi,

I have the following models:



class Competition extends AppModel {

var $name = 'Competition';
var $useTable = 'Competition';
var $primaryKey = 'CompetitionID';

var $recursive = 2;

var $hasMany = array(
'CompetitionAnswers' => array(
'className' => 
'CompetitionAnswer',
'foreignKey' => 
'CompetitionID',
'conditions' => 
'',
'fields' => '',
'order' => 
array('CompetitionAnswers.CompetitionID DESC',

'CompetitionAnswers.CompetitionAnswerOrder ASC'),
'dependent' => 
true
)
);


class CompetitionAnswer extends AppModel {

var $name = 'CompetitionAnswer';
var $useTable = 'CompetitionAnswer';
var $primaryKey = 'CompetitionAnswerID';

var $recursive = 2;

var $displayField = 'CompetitionAnswerText';


var $order = array(

'CompetitionAnswer.CompetitionID DESC',

'CompetitionAnswer.CompetitionAnswerOrder ASC'
);

var $belongsTo = array(
'CompetitionID' => array(
'className' => 
'Competition',
'foreignKey' => 
'CompetitionID',
'conditions' => 
'',
'fields' => '',
'order' => ''
)
);



Everything works fine, until I try a cascade delete:
if ($this->Competition->del($id)) { ...

When I get the following error:

SQL Error: 1109: Unknown table 'CompetitionAnswer' in order clause
[CORE/cake/libs/model/datasources/dbo_source.php, line 512]

"SELECT `CompetitionAnswers`.`CompetitionAnswerID` FROM
`CompetitionAnswer` AS `CompetitionAnswers`   WHERE
`CompetitionAnswers`.`CompetitionID` = 21   ORDER BY
`CompetitionAnswer`.`CompetitionID` DESC[...]"


It appears as if this is not loading the order field that I specified
in my HasMany clause, instead it is loading the default order field
for my class, but still calling the table the same way that was
specified in the HasMany clause.

I can't get rid of the table specification in the order clause,
because then I get an ambiguous table name error.


Is this a bug in Cake?  It sure looks like it to me.  It only happens
on a cascade delete, not any other form of database access.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Render XML

2009-02-10 Thread Alfredo Quiroga-Villamil

This should be simple, yet for some reason can't find how to do it.

I need to render XML.

What is the correct way to accomplish this?

Thanks in advance,

Alfredo

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: switching databases on dev and production

2009-02-10 Thread Adam Royle

I use svn:ignore on app/config/database.php, and only commit a generic
database.php.default file (that contains no usernames/passwords). Each
time I checkout the code (dev, staging, production) I rename
the .default file to database.php and make my edits on the server. So
ultimately no passwords are stored in version control. The downside to
this approach is that if you need to change the database.php.default
file (adding another db source, etc) you then need to manually add the
changes into each deployment area.

I'm sure there's a better way, but this works for me.

Cheers,
Adam

On Feb 11, 12:38 pm, travisbeck  wrote:
> i see that you can add multiple database defnitions for
> development,production, and test in the database.php file.
>
> how do you get your application to switch between the different
> environments?  Our app is in version control and i'd very much like to
> not have to constantly worry about the database config everytime a
> change gets commited.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[noob] switching databases on dev and production

2009-02-10 Thread travisbeck

i see that you can add multiple database defnitions for
development,production, and test in the database.php file.

how do you get your application to switch between the different
environments?  Our app is in version control and i'd very much like to
not have to constantly worry about the database config everytime a
change gets commited.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: International validation messages in a contact form

2009-02-10 Thread ohcibi

> Also, I thought it would be worth mentioning that if you don't want to
> specify the error messages in the view, you can also set them in your
> beforeValidate() function.


thx for this hint, i like it more that way

but my problem was at another place.. i should had pasted this one:

if ($this->Contact->validates($this->data))

of course it should be

$this->Contact->set($this->data);
if ($this->Contact->validates())


thx for your help anyway...

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: validating email_confirm field

2009-02-10 Thread foldiman

Thanks, your advice led me to the solution.

With the full debug on, I could see that before the INSERT query was
executed, a SELECT COUNT(*) AS `count` FROM `users` AS `User` WHERE
`User`.`email_confirm` = 'm...@email.com' was throwing an error. This
was because I had a 'unique' validation rule set on the email_confirm
field.

I removed the rule from the field and used your unset suggestion and
the column is no longer included in the INSERT statement. So now it
works...

Thanks!

On Feb 10, 7:04 pm, mscdex  wrote:
> foldiman wrote:
> > Cake wants an 'email_confirm' column in the Users table. This is key
> > to what I'm trying to understand. I don't have a 'password_confirm'
> > column EITHER. But for some reason, Cake does not mind. Is there a
> > built in exception for a field called 'password_confirm'?
>
> Maybe you could unset the 'email_confirm' key in $this->data in the
> beforeSave() callback so it won't try to save to a non-existing column.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Mod Rewrite problem

2009-02-10 Thread thankyou

Wonderful, thank you

On Feb 9, 10:31 am, Webweave  wrote:
> Here's a good writeup from the 
> bakery:http://bakery.cakephp.org/articles/view/mod-rewrite-on-godaddy-shared...
>
> On Feb 9, 5:53 am, thankyou  wrote:
>
> > I'm not very familiar with modrewrite -- do I just add the text
> > "RewriteBase" to the .htaccess file?
>
> > On Feb 9, 12:17 am, Webweave  wrote:
>
> > > You need to add the RewriteBase to the .htaccess files in the folder
> > > where you blog is.
>
> > > Assuming that blog.mywebsite.com is set up to serve the files from
> > > the /blog folder, you just need to make sure you have the .htaccess
> > > files as described 
> > > here:http://book.cakephp.org/view/37/Apache-and-mod_rewrite
>
> > > On Feb 8, 8:17 am, thankyou  wrote:
>
> > > > Hello,
> > > > I have the .htaccess file setup so that it makes cakephp work fine at
> > > > mywebsite.com.
> > > > The problem is that I also want to add a blog to the website at the
> > > > folder /blog,
> > > > so I can make blog.mywebsite.com work.  The folder is in /blog.
>
> > > > My .htaccess file info is below, what do I need to do to make the
> > > > blog.mywebsite.com work?
>
> > > > 
> > > >    RewriteEngine on
>
> > > >    RewriteCond    $1 !^favicon.ico
> > > >    RewriteCond    $1 !^sitemap.xml
>
> > > >    RewriteRule    ([^/]*)(.*) app/webroot/$1$2 [L]
> > > > 
>
> > > > Thank you.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Auth error when integrate with ACL in CakePHP 1.2.1.8004

2009-02-10 Thread yodi

Thanks, Gwoo, it works fine right now!

On Tue, 2009-02-10 at 08:46 -0800, Gwoo wrote:
> Actually you should probably use Auth->allow('logout') in your users
> controller.
> Also, if you want to add to the actionMap then use Auth::mapActions();
> > 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: validating email_confirm field

2009-02-10 Thread mscdex

foldiman wrote:
> Cake wants an 'email_confirm' column in the Users table. This is key
> to what I'm trying to understand. I don't have a 'password_confirm'
> column EITHER. But for some reason, Cake does not mind. Is there a
> built in exception for a field called 'password_confirm'?

Maybe you could unset the 'email_confirm' key in $this->data in the
beforeSave() callback so it won't try to save to a non-existing column.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: How long run the sql statement?

2009-02-10 Thread Sidney

You can get a lot of performance info from almost all the main DB
engines (commands vary) that can help identify where new indexes would
improve things.

Otherwise I guess you have to look into cake internals to figure out
how it gets this data for debug level 2 and massage it to fit your
needs.

On Feb 9, 10:02 pm, amarradi  wrote:
> Thanks a lot. I know this configuration, but is there any other way to
> get the process time? So i can customize is easier... I don't need the
> sql statement, only the time for running

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: validating email_confirm field

2009-02-10 Thread foldiman

Ok. Thanks. But this only works if I specify exactly which columns to
save in my controller using:

$user = $this->User->save($this->data, true, array('email',
'password', 'password_confirm', 'first_name', 'last_name')

Notice I left out 'email_confirm' in the list even though that field
appears in the view. I would rather use this:

$user = $this->User->save($this->data)

However, SQL throws the following error:

SQL Error: 1054: Unknown column 'User.email_confirm' in 'where clause'

Cake wants an 'email_confirm' column in the Users table. This is key
to what I'm trying to understand. I don't have a 'password_confirm'
column EITHER. But for some reason, Cake does not mind. Is there a
built in exception for a field called 'password_confirm'?

On Feb 10, 4:55 pm, Miles J  wrote:
> If you are trying to match dynamic data, it wont work because Cakes
> default validation is for static data. Heres a method I use to match
> dynamic:
>
> Place this in your appmodel.
>
>         /**
>          * Validates two inputs against each other
>          * @param array $data
>          * @param string $confirmField
>          * @return boolean
>          */
>         function validateMatch($data, $confirmField) {
>                 $data = array_values($data);
>                 $var1 = $data[0];
>                 $var2 = (isset($this->data[$this->name][$confirmField])) ? 
> $this-
>
> >data[$this->name][$confirmField] : '';
>
>                 return ($var1 === $var2);
>         }
>
> And then the validation rule:
>
> 'rule' => array('validateMatch', 'NAMEOFCONFIRMFIELD'),
> 'message' => 'They do not match'
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Router, NamedParameters & Urls...

2009-02-10 Thread CraigFisher

Indeed - and the URL looks like it will be fine; with lots of %3Fs and
%2As. Unfortunately after a lot of digging around, I've discovered
a 'feature' in Apache mod_rewrite due to the way that cake uses it's
pretty URLs.

It means that the URL is already **unencoded** by the time it reaches
the Cake Router/Dispatcher -- which promptly throws it's arms in the
air and passes-out when it sees: "/controller/action/param1:abc/
param2:http://www.domain.com/path";

There is a solution using Apache RewriteMaps - however, they are only
available in httpd.conf, not .htaccess, so not a generally useful
tool.

I have found *a* solution though. I'm using base64_encode() to convert
the URL param to a string of uuencoded numbers/letters  -- and that
works well!

Thanks for taking the time to answer folks -- I hope my investigations
are useful to someone else...

-C

On Feb 10, 5:50 pm, mscdex  wrote:
> dr. Hannibal Lecter wrote:
> > URL encoded query strings perhaps?
>
> I second this, PHP makes this easy:http://us2.php.net/urlencode
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: validating email_confirm field

2009-02-10 Thread Miles J

If you are trying to match dynamic data, it wont work because Cakes
default validation is for static data. Heres a method I use to match
dynamic:

Place this in your appmodel.

/**
 * Validates two inputs against each other
 * @param array $data
 * @param string $confirmField
 * @return boolean
 */
function validateMatch($data, $confirmField) {
$data = array_values($data);
$var1 = $data[0];
$var2 = (isset($this->data[$this->name][$confirmField])) ? 
$this-
>data[$this->name][$confirmField] : '';

return ($var1 === $var2);
}

And then the validation rule:

'rule' => array('validateMatch', 'NAMEOFCONFIRMFIELD'),
'message' => 'They do not match'
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: ClassRegistry::init vs loadModel

2009-02-10 Thread Miles J

I wrote a post about this a few days ago.

http://www.milesj.me/blog/read/16/loading-models-specific-to-certain-actions
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Auth problem, login not working.

2009-02-10 Thread Miles J

Can we see your login action() and all the config for auth.

On Feb 10, 1:29 pm, Dcahrakos  wrote:
> Hi,
>
> I am using the Auth component for registration and login, registration
> is working perfectly, but login doesnt seem to be doing anything at
> all,
>
> I have Auth loaded in the AppController since I will be using it site
> wide, however when I try to log in I just return to the login page
> because the page it is supposed to redirect me to requires you to be
> logged in.
>
> The only message I get from auth is the message I set "Sorry you
> cannot access this page"
>
> my login.ctp is just a simple login form with a username and password
> field,  and my Users controller has an empty login function at the
> moment.
>
> from what i've read everything should work, however it is not...
>
> am I missing something here? do I need to add code to the login
> function of the controller? or add anything to the user model?
>
> Thanks.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Auth problem, login not working.

2009-02-10 Thread Dcahrakos

Hi,

I am using the Auth component for registration and login, registration
is working perfectly, but login doesnt seem to be doing anything at
all,

I have Auth loaded in the AppController since I will be using it site
wide, however when I try to log in I just return to the login page
because the page it is supposed to redirect me to requires you to be
logged in.

The only message I get from auth is the message I set "Sorry you
cannot access this page"

my login.ctp is just a simple login form with a username and password
field,  and my Users controller has an empty login function at the
moment.

from what i've read everything should work, however it is not...

am I missing something here? do I need to add code to the login
function of the controller? or add anything to the user model?

Thanks.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: validating email_confirm field

2009-02-10 Thread foldiman

Ok. Here's the relevant code in the view file 'users/add.ctp'

echo $form->create('User', array('action' => 'add'));
echo $form->input('first_name', array('label' => '*First name',
'before' => '', 'between' => '', 'after' => '',
'error' => array('wrap' => 'span', 'class' => 'errorMsg'), 'maxlength'
=> '255'));
echo $form->input('last_name', array('label' => '*Last name', 'before'
=> '', 'between' => '', 'after' => '', 'error' =>
array('wrap' => 'span', 'class' => 'errorMsg'), 'maxlength' =>
'255'));
echo $form->input('email', array('label' => '*Email', 'before' =>
'', 'between' => '', 'after' => '', 'error' => array
('wrap' => 'span', 'class' => 'errorMsg'), 'maxlength' => '255'));
echo $form->input('email_confirm', array('label' => '*Confirm email',
'before' => '', 'between' => '', 'after' => '',
'error' => array('wrap' => 'span', 'class' => 'errorMsg'), 'maxlength'
=> '255'));
echo $form->input('password', array('before' => '', 'between' =>
'', 'after' => '', 'error' => array('wrap' => 'span',
'class' => 'errorMsg')));
echo $form->input('password_confirm', array('label' => 'Re-enter
password', 'type' => 'password', 'before' => '', 'between' =>
'', 'after' => '', 'error' => array('wrap' => 'span',
'class' => 'errorMsg')));

..here's the code from the controller

function add() {
$this->layout = 'register';
$this->pageTitle = 'Register';

if (!empty($this->data)) {
if ($user = $this->User->save($this->data)) {
$this->Session->setFlash(__('Thanks for 
registering. Now please
log in.', true));
$this->redirect(array('action' => 'login'));
} else {
$this->Session->setFlash(__('Your account could 
not be created.
Please review the errors below and try again.', true));
}
}
}

... and here's the User model...


 array(

'match' => array(
'rule' => array('confirmEmail','email'),
'message' => 'Your email and email confirmation 
do not
match.',
),

'between' => array(
'rule' => array('between', 1, 255),
'message' => 'Username must be between 1 and 255
characters in length.',
),

'validemail' => array(
'rule' => 'email',
'message' => 'You must supply a valid email
address.',
),

'unique' => array(
'rule' => 'isUnique',
'message' => 'This email address has already 
been
registered.',
),

'notEmpty' => array(
'rule'=> 'notEmpty',
'message' => 'You must supply a valid email 
address.',
)),


'email_confirm' => array(

'validemail' => array(
'rule' => 'email',
'message' => 'You must supply a valid email
address.',
),

'between' => array(
'rule' => array('between', 1, 255),
'message' => 'Username must be between 1 and 255
characters in length.',
),

'unique' => array(
'rule' => 'isUnique',
'message' => 'This email address has already 
been
registered.',
),

'notEmpty' => array(
'rule'=> 'notEmpty',
'message' => 'You must supply a valid email 
address.',
)),


'password' => array(

'match' => array(
'rule' => array('confirmPassword','password'),
'message' => 'Your password and password 
confirmation do
not match.'
),

'alphaNumeric' => array(
'rule' => 'alphaNumeric',
'message' => 'Password can only include 
alpha-numeric
characters.'
),

'between' => array(
'rule' => array('between', 4, 12),
'message' => 'Password must be between 4 and 12
characters in length.'
),

'notEmpty' => array(
'rule'=> 'notEmpty',
'message' => 'You must supply a password.'
)),

'passwor

Re: save() function not working plz help

2009-02-10 Thread khurram shizad
Thanks to google groups and respectable mradosta too.you have solved my
problem
Thanks to regards

On Tue, Feb 10, 2009 at 11:54 AM, mradosta  wrote:

>
> Try in 3 adding a dot (.)
>
> Bad
> echo $form->input('Author name');
>
> Good
> echo $form->input('Author.name');
>
> On 10 feb, 17:17, khurram  wrote:
> > i have table 'authors' with two columns.The 1st one column is 'id'
> > auto incremented.the 2nd one is 'name'.
> >
> > 1.this is the model
> >  >class Author extends AppModel {
> >var $name = 'Author';
> > }
> > ?>
> >
> > 2.this is the controller
> >
> >  >
> >   class AuthorsController extends AppController {
> >   var $name = 'Authors';
> >   var $helpers = array('Html','Form');
> >
> >   function index() {
> >   $this->set('auth', $this->Author->find('all'));
> >}
> >
> >function add() {
> > if (!empty($this->data)) {
> >
> >  $this->Author->create();
> >
> > if ($this->Author->save($this->data)) {
> >   $this->Session->setFlash('The author has been saved');
> >   $this->redirect(array('action'=>'index'), null, true);
> >} else {
> >   $this->Session->setFlash('Author not saved. Try again.');
> >  }
> >
> >}
> >  }
> >
> > }
> >
> > ?>
> >
> > 3.and this is the add.ctp
> >
> > create('Author');?>
> >
> >   Add New Author
> >>  echo $form->input('Author name');
> >?>
> >
> > end('Add');?>
> >
> > now my problem is that when i click on Add button then it show the
> > message "The author has been saved".but actually it does not save and
> > not even in the database table,no record is inserted.
> > kindly help me i am working on the final project of master of computer
> > science.
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: getting information from all your plugins

2009-02-10 Thread Matt Curry

I haven't tested this at all, but...

$adminLinks = array();
if ($plugins = Configure::listObjects('plugin')) {
  foreach ($plugins as $key => $value) {
$classObj = ClassRegistry::init($value);
//or $classObj = ClassRegistry::init(Inflector::camelize($value));
$adminLinks = array_merge($adminLinks, $classObj->adminLinks);
  }
}

That should give you a starting point.

-Matt
http://www.pseudocoder.com



On Feb 10, 3:05 pm, Evert  wrote:
> nobody?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: getting information from all your plugins

2009-02-10 Thread Evert

nobody?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: save() function not working plz help

2009-02-10 Thread mradosta

Try in 3 adding a dot (.)

Bad
echo $form->input('Author name');

Good
echo $form->input('Author.name');

On 10 feb, 17:17, khurram  wrote:
> i have table 'authors' with two columns.The 1st one column is 'id'
> auto incremented.the 2nd one is 'name'.
>
> 1.this is the model
>     class Author extends AppModel {
>        var $name = 'Author';
>     }
> ?>
>
> 2.this is the controller
>
> 
>   class AuthorsController extends AppController {
>       var $name = 'Authors';
>       var $helpers = array('Html','Form');
>
>       function index() {
>           $this->set('auth', $this->Author->find('all'));
>        }
>
>        function add() {
>     if (!empty($this->data)) {
>
>          $this->Author->create();
>
>         if ($this->Author->save($this->data)) {
>           $this->Session->setFlash('The author has been saved');
>           $this->redirect(array('action'=>'index'), null, true);
>        } else {
>           $this->Session->setFlash('Author not saved. Try again.');
>          }
>
>    }
>  }
>
> }
>
> ?>
>
> 3.and this is the add.ctp
>
> create('Author');?>
>        
>           Add New Author
>                         echo $form->input('Author name');
>            ?>
>        
>     end('Add');?>
>
> now my problem is that when i click on Add button then it show the
> message "The author has been saved".but actually it does not save and
> not even in the database table,no record is inserted.
> kindly help me i am working on the final project of master of computer
> science.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



save() function not working plz help

2009-02-10 Thread khurram

i have table 'authors' with two columns.The 1st one column is 'id'
auto incremented.the 2nd one is 'name'.

1.this is the model


2.this is the controller

set('auth', $this->Author->find('all'));
   }

   function add() {
if (!empty($this->data)) {

 $this->Author->create();

if ($this->Author->save($this->data)) {
  $this->Session->setFlash('The author has been saved');
  $this->redirect(array('action'=>'index'), null, true);
   } else {
  $this->Session->setFlash('Author not saved. Try again.');
 }

   }
 }

}
?>

3.and this is the add.ctp

create('Author');?>
   
  Add New Author
  input('Author name');
   ?>
   
end('Add');?>



now my problem is that when i click on Add button then it show the
message "The author has been saved".but actually it does not save and
not even in the database table,no record is inserted.
kindly help me i am working on the final project of master of computer
science.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Credit Card Expiration Date Validation

2009-02-10 Thread JoshSchramm

Hey all,

I cant seem to find anything online to explain this so i'm hoping you
all can help a bit.

I am validating credit card information and right now i'm working on
ensuring the user enters an expiration date.
For this i have to fields one for month and one for year both using
$form->input('type'='date')

When they post the data looks like
[ExpirationMonth] { [month]=>XX }, [ExpirationYear] { [year]=>}

On the back end I'm trying to validate this and it doesnt want to
work. My validate array looks like this.

'ExpirationMonth.month'=>array(
'numeric'=>array(
'rule'=>'numeric',
'allowEmpty'=>false,
'required'=>true,
'message'=>'ExpirationMonthInvalid'
),
'between'=>array(
'rule'=>array('between', 1, 12),
'allowEmpty'=>false,
'required'=>true,
'message'=>'ExpirationMonthInvalid'
),
),
'ExpirationYear.year'=>array(
'notEmpty'=>array(
'rule'=>'notEmpty',
'allowEmpty'=>false,
'required'=>true,
'message'=>'ExpirationYearInvalid'
),
'numeric'=>array(
'rule'=>'numeric',
'allowEmpty'=>false,
'required'=>true,
'message'=>'ExpirationYearInvalid'
)
)

no matter what i do i don't get an error message back.

To clarify a bit more i have a 'empty'=>'Choose Month (or year)' in
the drop downs so I'm just trying to make sure the user selected
something other than that option.

Any ideas?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: using ajax helper to reload an element

2009-02-10 Thread brian

not sure this is the best way to do this

function refreshSearchElement()
{
  $this->layout = false;
  // get your new param ...
  $this->set('new_param', $new_param);
}

refresh_search_element.ctp:

echo $this->element('search_element_1', array('the_param', $new_param));


On Mon, Feb 9, 2009 at 11:24 PM, Corey Crawford
 wrote:
>
> Hello everyone,
>
> I'm new to CakePHP (like everyone else on here, it seems), and so I'm
> having trouble utilizing the ajax helper to refresh a div containing
> an element.
>
> Right now I have my default (home) controller setup to show a view
> which utilizes an element to pull in a truncated version of a search
> result.
>
> So you have:
>
> home controller (no logic here yet) -> home view -> search element1
>
> I'm trying to figure out a way to refresh the div the element is
> within by calling the element with a different parameter (to apply a
> filter, for example). In my home controller I have a
> refreshSearchElement() method that tries to return the output of the
> element, which my ajax observeField calls when a drop down menu is
> changed.
>
> Apparently that doesn't work, because I get 'Call to undefined method
> HomeController::element()' when I call $this->element
> ('search_element_1'). I guess that only works in views?
>
> Is there a way to pull in an element's contents inside a Controller
> (and preferably utilize any caching)? Or can anyone recommend
> different method to approach this?
>
> Thanks!
>
> --
> Corey Crawford
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Problems with combining COUNT(*) and GROUP BY

2009-02-10 Thread seedifferently

Thanks, the Teknoid link's afterFind method worked beautifully!



On Feb 10, 12:07 am, Miles J  wrote:
> What kalt said wont work, here you go.
>
> http://groups.google.com/group/cake-php/browse_thread/thread/f823cc7f...
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Logging system for CAKEPHP

2009-02-10 Thread mscdex

marco.rizze...@gmail.com wrote:
> Now I must create a logging system in order to register all possible
> errors (PHP execution error or MySQL error etc. )

If you are wanting to log to a file, you can edit your php.ini and
change the following two values:

error_log = /var/log/php.log
display_errors = Off

Substitute "/var/log/php.log" with a path of your choosing
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: International validation messages in a contact form

2009-02-10 Thread Gonzalo Servat
On Mon, Feb 9, 2009 at 9:33 PM, ohcibi  wrote:

>
> Hi everybody,
>
> i have set up a Contact-Model like this:
> http://paste.pocoo.org/show/103359/
> (according to http://snook.ca/archives/cakephp/contact_form_cakephp/).
> i want to provide international validation messages so i output the
> form-fields like this: http://paste.pocoo.org/show/103365/ .. however
> the error-messages are still some default-ones... does anybody know
> why this could be?
>

Just like Gwoo said, here is an example that might work (untested code):

var $validate = array(
   'name' => array(
  'minlength' => array(
   'rule' => array('minLength', 1)
  )
   ),
   'email' => array(
  'minlength' => array(
   'rule' => array('minLength', 1),
   'last' => true
  ),
  'valid' => array(
   'rule' => 'email'
  )
   ),
   'message' => array(
   'minlength' => array(
   'rule' => array('minLength', 1)
   )
   )
);

.. and your view:

echo $form->input('Contact.name',array(
   'error' => array(
  'minlength' => __('Please enter your name',true)
)));
echo $form->input('Contact.email',array(
   'error' => array(
  'minlength' => __('Please enter your Email address',true),
  'valid' => __('Please enter a valid Email address',true)
)));
echo $form->input('Contact.message',array(
   'error' => array(
  'minlength' => __('Please don\'t send blank messages',true)
)));


Also, I thought it would be worth mentioning that if you don't want to
specify the error messages in the view, you can also set them in your
beforeValidate() function.

- Gonzalo

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Router, NamedParameters & Urls...

2009-02-10 Thread mscdex

dr. Hannibal Lecter wrote:
> URL encoded query strings perhaps?

I second this, PHP makes this easy: http://us2.php.net/urlencode
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Logging system for CAKEPHP

2009-02-10 Thread marco.rizze...@gmail.com

Another thing ... not all MySql's errors are detected with the method
Error inside AppModel 

On Feb 10, 6:24 pm, "marco.rizze...@gmail.com"
 wrote:
> Hi
> I have a production ( debug=0 ) system with CAKEPHP.
> Now I must create a logging system in order to register all possible
> errors (PHP execution error or MySQL error etc. )
> I have read some post about this but I don't understand completely how
> do it?
> For example for MySql error I can use the method error inside AppModel
> ( but I would get also the query that are caused the error ...how can
> I get it?)
> But for the PHP errors and notices what can I use?
> Many Thanks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Router, NamedParameters & Urls...

2009-02-10 Thread dr. Hannibal Lecter

URL encoded query strings perhaps?

On Feb 10, 6:30 pm, CraigFisher  wrote:
> What's the best way of using named parameters to pass URLs into a
> controller...  The router groks because it picks up the : and / as
> separators.  Obviously I can perform some sort of specific code/decode
> in the code but I feel there must be a 'proper' way of doing it.
>
> I've tried using rawurlencode to switch the punctuation to %xx etc -
> but despite that the Router picks them up as / and :
>
> Anyone got any clues? hints? suggestions?  I can't be the only one
> wanting to pass URLs as parameters...
>
> -C
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: MooTools Ajax Pagination

2009-02-10 Thread Arak Tai'Roth

Don't get me wrong, there's nothing wrong with it. I was just
personally hoping for something that was integrated more tightly into
CakePHP, that's all.

Also, I'm pretty new to using AJAX, and most definitely MooTools, so I
was hoping for more of a starting point.

On Feb 10, 10:07 am, grigri  wrote:
> What more do you want? That looks like a very neat starting point form
> ajax pagination with mootools (I use mootools as my js framework of
> choice; don't do a huge amount of ajax though).
>
> Why doesn't this seem like "the best option"? What's wrong with it?
>
> On Feb 10, 3:34 pm, "Arak Tai'Roth"  wrote:
>
> > Is there anything else out there? This is definitely an option, but it
> > doesn't seem like the best option to me.
>
> > On Feb 9, 6:59 pm, "Websta*" 
> > wrote:
>
> > > Here is the code of a really basic mootools JS object that can pretty
> > > much be dropped in for paging a standard cake index view
>
> > >http://pastebin.com/d43137c
>
> > > All you have to do is wrap your view code in a div and specify that id
> > > as your pagingDivId
>
> > > This is extremely basic and doesnt make allowance for request failure
> > > events etc - just the basics.
>
> > > HTH,
>
> > > Paul.
>
> > > On Feb 10, 11:45 am, "Arak Tai'Roth"  wrote:
>
> > > > The project that I am currently working on is constrained by the fact
> > > > that I have to use MooTools for a few things we are using. I also
> > > > don't really want to use Prototype as the load times in certain cases
> > > > aren't exactly friendly.
>
> > > > So I was wondering if there is anywhere I can learn how to implement
> > > > AJAX Pagination with MooTools, I know there is a tutorial in the
> > > > bakery for JQuery, I was hoping for something similar using MooTools.
> > > > Or if someone can give me some examples here.
>
> > > > Any help is appreciated, thank you.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Logging system for CAKEPHP

2009-02-10 Thread marco.rizze...@gmail.com

Another thing for MYSQL I would get also the "warning"  how can do
it?

On Feb 10, 6:24 pm, "marco.rizze...@gmail.com"
 wrote:
> Hi
> I have a production ( debug=0 ) system with CAKEPHP.
> Now I must create a logging system in order to register all possible
> errors (PHP execution error or MySQL error etc. )
> I have read some post about this but I don't understand completely how
> do it?
> For example for MySql error I can use the method error inside AppModel
> ( but I would get also the query that are caused the error ...how can
> I get it?)
> But for the PHP errors and notices what can I use?
> Many Thanks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Router, NamedParameters & Urls...

2009-02-10 Thread CraigFisher

What's the best way of using named parameters to pass URLs into a
controller...  The router groks because it picks up the : and / as
separators.  Obviously I can perform some sort of specific code/decode
in the code but I feel there must be a 'proper' way of doing it.

I've tried using rawurlencode to switch the punctuation to %xx etc -
but despite that the Router picks them up as / and :

Anyone got any clues? hints? suggestions?  I can't be the only one
wanting to pass URLs as parameters...

-C
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Logging system for CAKEPHP

2009-02-10 Thread marco.rizze...@gmail.com

Hi
I have a production ( debug=0 ) system with CAKEPHP.
Now I must create a logging system in order to register all possible
errors (PHP execution error or MySQL error etc. )
I have read some post about this but I don't understand completely how
do it?
For example for MySql error I can use the method error inside AppModel
( but I would get also the query that are caused the error ...how can
I get it?)
But for the PHP errors and notices what can I use?
Many Thanks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: validating email_confirm field

2009-02-10 Thread Gwoo

http://api.cakephp.org/class/validation#method-ValidationequalTo

Also, we have no idea why you get the error because we cannot see the
code.
http://bin.cakephp.org
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: International validation messages in a contact form

2009-02-10 Thread Gwoo

Supply your validation rules.
It looks to me that you are trying to key the error messages off of
the "rule", which would be incorrect.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Auth error when integrate with ACL in CakePHP 1.2.1.8004

2009-02-10 Thread Gwoo

Actually you should probably use Auth->allow('logout') in your users
controller.
Also, if you want to add to the actionMap then use Auth::mapActions();
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: ClassRegistry::init vs loadModel

2009-02-10 Thread Gwoo

Yes the old loadModel() function from basics was deprecated.
However the loadModel() method in Controller is still used.
http://api.cakephp.org/class/controller#method-ControllerloadModel
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Fatal error: App::require() - Trying to run through the Example Blog App

2009-02-10 Thread Gwoo

"Permission denied"
Check the permissions.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



validating email_confirm field

2009-02-10 Thread foldiman

I'm trying to build a form that includes both a password_confirm field
as well as a email_confirm field. The password_confirm field behaves
as expected when using a confirmPassword() function in the model that
compares the two fields, 'password' and 'password_confirm'.

However, there's a problem when trying to do the same thing with the
'email_confirm' field. Cake is looking for a User.email_confirm column
that does not exist.

Why does Cake not throw an error with 'password_confirm'? What's a
good strategy to avoid an error that does not involve creating an
extra column in the User table?

Thanks.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: CAKEPHP variable in querystring

2009-02-10 Thread cyk0tik

ah ok thanks :)

On Feb 10, 4:33 pm, grigri  wrote:
> Cake isn't doing this, your PHP setup is.
>
> CAKEPHP is the name of the session cookie. In most setups, session
> handling is done by an http cookie sent through the headers. When
> either the server admin or the intended site visitors wear tinfoil
> hats, the 'url rewriting' functionality is used, which adds the
> session cookie as a GET parameter to all links and form targets, which
> is what you're seeing here.
>
> If you have access to the box's config, you need to edit php.ini and
> set `session.use_cookies` to 1. If you don't then ask your hosting
> provider to do so. If they can't, get a better host.
>
> hth
> grigri
>
> On Feb 10, 8:45 am, cyk0tik  wrote:
>
> > Hi,
>
> > Cake seems to be adding on an encrypted string to all my links in my
> > app..
>
> > eg. instead ofhttp://www.website.com/index.php, I 
> > gethttp://www.website.com/index.php?CAKEPHP=446fd3WEgh543fnz
>
> > Can anyone tell me why it's doing this?
>
> > Thanks

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Fatal error: App::require() - Trying to run through the Example Blog App

2009-02-10 Thread ross.de...@gmail.com

Hi All,
I'm new to the world of Cake, and am trying to work my way through
the Example Blog Application.
My set up went well, and all my boxes are green, so the database
connection is fine and my tmp folder is writable.
However, after creating my first Controller, Model and View as per the
example, I can't view the app and receive the following error.

Warning (2): App::require(/var/www/cake/app/controllers/
posts_controller.php) [function.require]: failed to open stream:
Permission denied [CORE/cake/libs/configure.php, line 972]

Code | Context

$file   =   "/var/www/cake/app/controllers/posts_controller.php"

App::__load() - [internal], line ??
App::__load() - CORE/cake/libs/configure.php, line 972
App::__find() - CORE/cake/libs/configure.php, line 949
App::import() - CORE/cake/libs/configure.php, line 876
Dispatcher::__loadController() - CORE/cake/dispatcher.php, line 498
Dispatcher::__getController() - CORE/cake/dispatcher.php, line 451
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 135
[main] - APP/webroot/index.php, line 88


Fatal error: App::require() [function.require]: Failed opening
required '/var/www/cake/app/controllers/
posts_controller.php' (include_path='/var/www/cake:/var/www/cake/
app/:.:/usr/share/php:/usr/share/pear') in /var/www/cake/cake/libs/
configure.php on line 972

Can anyone shed any light on this?
Many thanks,
Ross

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: MooTools Ajax Pagination

2009-02-10 Thread grigri

What more do you want? That looks like a very neat starting point form
ajax pagination with mootools (I use mootools as my js framework of
choice; don't do a huge amount of ajax though).

Why doesn't this seem like "the best option"? What's wrong with it?

On Feb 10, 3:34 pm, "Arak Tai'Roth"  wrote:
> Is there anything else out there? This is definitely an option, but it
> doesn't seem like the best option to me.
>
> On Feb 9, 6:59 pm, "Websta*" 
> wrote:
>
> > Here is the code of a really basic mootools JS object that can pretty
> > much be dropped in for paging a standard cake index view
>
> >http://pastebin.com/d43137c
>
> > All you have to do is wrap your view code in a div and specify that id
> > as your pagingDivId
>
> > This is extremely basic and doesnt make allowance for request failure
> > events etc - just the basics.
>
> > HTH,
>
> > Paul.
>
> > On Feb 10, 11:45 am, "Arak Tai'Roth"  wrote:
>
> > > The project that I am currently working on is constrained by the fact
> > > that I have to use MooTools for a few things we are using. I also
> > > don't really want to use Prototype as the load times in certain cases
> > > aren't exactly friendly.
>
> > > So I was wondering if there is anywhere I can learn how to implement
> > > AJAX Pagination with MooTools, I know there is a tutorial in the
> > > bakery for JQuery, I was hoping for something similar using MooTools.
> > > Or if someone can give me some examples here.
>
> > > Any help is appreciated, thank you.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



css problem

2009-02-10 Thread monirr444


How to put Two css in Defalut Layout whithout reflecting with each other 
i have this jquery plugin its media viewer i want the users to play the
youtube videos of my site in my own website in Iframe whenver i put the css
and javascrpt it reflect with each other any help will be appreciated

this my code in my views that i want to link with html 

   link('Watch the video',
$recipe['Recipe']['youtube']);
}
?>


with this html code 


http://www.youtube.com/v/wbzLpteC8ng&autoplay=1 YouTube 
-- 
View this message in context: 
http://n2.nabble.com/css-problem-tp2303123p2303123.html
Sent from the CakePHP mailing list archive at Nabble.com.

.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: MooTools Ajax Pagination

2009-02-10 Thread Arak Tai'Roth

Is there anything else out there? This is definitely an option, but it
doesn't seem like the best option to me.

On Feb 9, 6:59 pm, "Websta*" 
wrote:
> Here is the code of a really basic mootools JS object that can pretty
> much be dropped in for paging a standard cake index view
>
> http://pastebin.com/d43137c
>
> All you have to do is wrap your view code in a div and specify that id
> as your pagingDivId
>
> This is extremely basic and doesnt make allowance for request failure
> events etc - just the basics.
>
> HTH,
>
> Paul.
>
> On Feb 10, 11:45 am, "Arak Tai'Roth"  wrote:
>
> > The project that I am currently working on is constrained by the fact
> > that I have to use MooTools for a few things we are using. I also
> > don't really want to use Prototype as the load times in certain cases
> > aren't exactly friendly.
>
> > So I was wondering if there is anywhere I can learn how to implement
> > AJAX Pagination with MooTools, I know there is a tutorial in the
> > bakery for JQuery, I was hoping for something similar using MooTools.
> > Or if someone can give me some examples here.
>
> > Any help is appreciated, thank you.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Model.save() works OK but cannot manage to get Model.savaAll() to work (rollback)

2009-02-10 Thread mradosta

I guess the relation is "user hasMany user_datail".

Please, send us the array you're tryng to save.



On 9 feb, 16:59, Aktarus  wrote:
> Hello,
>
> I am starting with CakePHP, the latest version.
> I have created 2 tables: 'users' and 'user_details' - they are
> obviously related ;)
>
> I am creating a record using Model.save(), it works OK.
> I am trying to do the same with saveAll(), expecting that my user
> **and** his details will be saved in the same transaction but I get a
> rollback immediatly after the user record is created :-(
>
> I am using MySQL innodb.
>
> I don't seem to get any more details as to why I get a rollback before
> the user details are stored - I am stuck.
> I was expecting to get a SQL error displayed in case some "NOT NULL"
> constraint or other SQL constraint was not met - I checked my code
> many time.
>
> Thanks for your help.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: How can I perform "normal" PHP code within the cake directory ?

2009-02-10 Thread hasentopf

So simple!

A BIG: thank-you!!!

:-)

On 10 Feb., 15:39, grigri  wrote:
> Just move the file/files into app/webroot. From there you can call
> them normally.
>
> hth
> grigri
>
> On Feb 10, 1:07 pm, hasentopf  wrote:
>
> > Dear cake-users.
>
> > I found no answer so far for my question, maybe you know a solution:
>
> > I converted a web project completely to CakePHP.
>
> > I would like to leave only one module (a calendar for a apartment
> > rental) in the old state, because the transformation to Cake would be
> > too expensive.
>
> > My question: How can I perform "normal" PHP code within the cake-
> > directory without a "Missing Controller" error message?
>
> > Any ideas?
>
> > Best Regards
> > Mathias
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: How can I perform "normal" PHP code within the cake directory ?

2009-02-10 Thread grigri

Just move the file/files into app/webroot. From there you can call
them normally.

hth
grigri

On Feb 10, 1:07 pm, hasentopf  wrote:
> Dear cake-users.
>
> I found no answer so far for my question, maybe you know a solution:
>
> I converted a web project completely to CakePHP.
>
> I would like to leave only one module (a calendar for a apartment
> rental) in the old state, because the transformation to Cake would be
> too expensive.
>
> My question: How can I perform "normal" PHP code within the cake-
> directory without a "Missing Controller" error message?
>
> Any ideas?
>
> Best Regards
> Mathias
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: CAKEPHP variable in querystring

2009-02-10 Thread grigri

Cake isn't doing this, your PHP setup is.

CAKEPHP is the name of the session cookie. In most setups, session
handling is done by an http cookie sent through the headers. When
either the server admin or the intended site visitors wear tinfoil
hats, the 'url rewriting' functionality is used, which adds the
session cookie as a GET parameter to all links and form targets, which
is what you're seeing here.

If you have access to the box's config, you need to edit php.ini and
set `session.use_cookies` to 1. If you don't then ask your hosting
provider to do so. If they can't, get a better host.

hth
grigri

On Feb 10, 8:45 am, cyk0tik  wrote:
> Hi,
>
> Cake seems to be adding on an encrypted string to all my links in my
> app..
>
> eg. instead ofhttp://www.website.com/index.php, I 
> gethttp://www.website.com/index.php?CAKEPHP=446fd3WEgh543fnz
>
> Can anyone tell me why it's doing this?
>
> Thanks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Firefox Search Engine Plug-In

2009-02-10 Thread WebbedIT

Well put LunarDraco!

I've been working with Cake for on and off 4-5 months now and only
seem to be scratching the surface.  Without the likes of those you
listed above and grigri, teknoid etc. I would have had to be carted
off to the funny farm and given some nice relaxants!

I hasten to add though, that had I gone about things in a logical
manner and done a lot more reading and built a good few smaller apps
before jumping into the massive one that I embarked on then my
learning curve may not have been as steep as it has been.  For example
I am only today reading through all of Teknoids CakePHP blog archive
from May 2008 to present .. some golden nuggets in there presented in
an easy to understand manner!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Firefox Search Engine Plug-In

2009-02-10 Thread LunarDraco

>From my point of view anything I write to benefit the community can be
lifted at will.
I contribute to help not to gain fame or money. If I want money I'll
keep it to myself and sell it to those who are willing to pay for it.

I really appreciate the active community surrounding cake and those
who have spent so much of their time writing articles and examples to
help those of us who are striving to solve problems in our paying
jobs.

I'm always looking for opportunities where I can escape my paying job
long enough to contribute something back to the community that has
given my job a level of enjoyment that I really appreciate. Most of
the time Mark Story, AD7six,  phpnut, gwoo or others have already come
up with a solution that often times is more elegant than what I had in
mind to write. I guess I'm still learning.

Congrats to all those who do contribute in anyway they can. I
appreciate it very much.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Firefox Search Engine Plug-In

2009-02-10 Thread Hernan

No problem. As I've said to Marcelo in private, I'm glad this plug-in
soap opera had a happy ending. And it seems we both did (more or less)
the same thing at the same time.
Great minds think alike, you know the saying... :)

On Feb 10, 10:49 am, Marcelo Andrade  wrote:
> On Tue, Feb 10, 2009 at 6:46 AM, WebbedIT  wrote:
>
> > How did he expect Hernan to search for it and find it if not added to
> > Mozilla Plugins site and not pasted to the bin, not that it would seem
> > logical to search the bin for such a thing?!?
> On Tue, Feb 10, 2009 at 6:38 AM, AD7six  wrote:
> > > (..)
> > Is it just me, or is that paste from Feb 9th (and probably put up
> > after Hernan's announcement to the list).
>
> Well...  In reality I've quite posted before see the Herman's annoucement,
> based on a previous article about OpenSearch plugins for FF.
>
> But it really seems to be just a coincidence. :-P
>
> To Herman and all, my appologizes for the off-topic messages.
>
> [1]http://tinyurl.com/bhpekt
> [2]http://tinyurl.com/c7hppu
> [3]http://tinyurl.com/bdq4m8
>
> --
> MARCELO DE F. ANDRADE (aka "eleKtron")
> Belem, PA, Amazonia, Brazil
> Linux User #221105
>
> [...@pará ~]# linkshttp://pa.slackwarebrasil.org/
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: How can I perform "normal" PHP code within the cake directory ?

2009-02-10 Thread hasentopf

How about a special .htaccess file in this subdirectory, which bans
cake out???


On 11 Feb., 05:29, yodi  wrote:
> Maybe you can use vendor.
>
> For example, like this 
> :http://www.exuber.net/2008/05/06/cakephp-captcha-and-user-registration/
>
> On Tue, 2009-02-10 at 05:07 -0800, hasentopf wrote:
> > Dear cake-users.
>
> > I found no answer so far for my question, maybe you know a solution:
>
> > I converted a web project completely to CakePHP.
>
> > I would like to leave only one module (a calendar for a apartment
> > rental) in the old state, because the transformation to Cake would be
> > too expensive.
>
> > My question: How can I perform "normal" PHP code within the cake-
> > directory without a "Missing Controller" error message?
>
> > Any ideas?
>
> > Best Regards
> > Mathias
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: How can I perform "normal" PHP code within the cake directory ?

2009-02-10 Thread yodi

Maybe you can use vendor.

For example, like this :
http://www.exuber.net/2008/05/06/cakephp-captcha-and-user-registration/


On Tue, 2009-02-10 at 05:07 -0800, hasentopf wrote:
> Dear cake-users.
> 
> I found no answer so far for my question, maybe you know a solution:
> 
> I converted a web project completely to CakePHP.
> 
> I would like to leave only one module (a calendar for a apartment
> rental) in the old state, because the transformation to Cake would be
> too expensive.
> 
> My question: How can I perform "normal" PHP code within the cake-
> directory without a "Missing Controller" error message?
> 
> Any ideas?
> 
> Best Regards
> Mathias
> 
> > 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How can I perform "normal" PHP code within the cake directory ?

2009-02-10 Thread hasentopf

Dear cake-users.

I found no answer so far for my question, maybe you know a solution:

I converted a web project completely to CakePHP.

I would like to leave only one module (a calendar for a apartment
rental) in the old state, because the transformation to Cake would be
too expensive.

My question: How can I perform "normal" PHP code within the cake-
directory without a "Missing Controller" error message?

Any ideas?

Best Regards
Mathias

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: nice new API layout

2009-02-10 Thread Marcelo Andrade

On Tue, Feb 10, 2009 at 8:09 AM, AD7six  wrote:
>
> On Feb 9, 6:36 pm, Marcelo Andrade  wrote:
>> On Tue, Jan 27, 2009 at 6:02 PM, brian  wrote:
>> > (..)
>>
>> Just announcing: I created a small API search plugin for Firefox 3.
>> Maybe it could be usefull for someone... :-P
>>
>> http://bin.cakephp.org/saved/42469
>>
>> Best regards.
>
> Is this what prompted you to post "Credits?" in Hernan's thread?

My bad.  Our announcements were near, but they're totally
independent.  This is just for the API and Herman's is for the
cookbook.

--
MARCELO DE F. ANDRADE (aka "eleKtron")
Belem, PA, Amazonia, Brazil
Linux User #221105

[...@pará ~]# links http://pa.slackwarebrasil.org/

For Libby's backstory be told on Lost
http://www.petitiononline.com/libby423/petition.html

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Firefox Search Engine Plug-In

2009-02-10 Thread Marcelo Andrade

On Tue, Feb 10, 2009 at 6:46 AM, WebbedIT  wrote:
>
> How did he expect Hernan to search for it and find it if not added to
> Mozilla Plugins site and not pasted to the bin, not that it would seem
> logical to search the bin for such a thing?!?


On Tue, Feb 10, 2009 at 6:38 AM, AD7six  wrote:
> > (..)
> Is it just me, or is that paste from Feb 9th (and probably put up
> after Hernan's announcement to the list).


Well...  In reality I've quite posted before see the Herman's annoucement,
based on a previous article about OpenSearch plugins for FF.

But it really seems to be just a coincidence. :-P

To Herman and all, my appologizes for the off-topic messages.

[1] http://tinyurl.com/bhpekt
[2] http://tinyurl.com/c7hppu
[3] http://tinyurl.com/bdq4m8

--
MARCELO DE F. ANDRADE (aka "eleKtron")
Belem, PA, Amazonia, Brazil
Linux User #221105

[...@pará ~]# links http://pa.slackwarebrasil.org/

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



logout not authorized to access

2009-02-10 Thread yisn

I followed the "Simple Acl controlled Application" in the Cookbook of
CakePHP, and got the message "You are not authorized to access that
location" when try to logout. I logged in as a user who is not allowed
to access the UsersController actions.

Do i need to grant the access to "logout" function for this user to
fix this problem? But the "login" function does not need to be
granted, does the "auth" component not grant access to "logout"
function itself?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: ClassRegistry::init vs loadModel

2009-02-10 Thread gmwebs

Gwoo, I apologise if I have missed any posts on this in the past,
but...

I thought that loadModel() was deprecated? I remember going through
all my code and changing it to App::import based on the warning
message "loadModel is deprecated see App::import
('Model', 'ModelName');"?

Has this (or the preferred method) changed?

Again, sorry if I am just being dumb!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: nice new API layout

2009-02-10 Thread AD7six



On Feb 9, 6:36 pm, Marcelo Andrade  wrote:
> On Tue, Jan 27, 2009 at 6:02 PM, brian  wrote:
> > (..)
>
> Just announcing: I created a small API search plugin for Firefox 3.
> Maybe it could be usefull for someone... :-P
>
> http://bin.cakephp.org/saved/42469
>
> Best regards.

Is this what prompted you to post "Credits?" in Hernan's thread?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: nice new API layout

2009-02-10 Thread yodi

Nice dude!!! 

Thanks, it's help me

On Mon, 2009-02-09 at 14:36 -0300, Marcelo Andrade wrote:
> On Tue, Jan 27, 2009 at 6:02 PM, brian  wrote:
> > (..)
> 
> Just announcing: I created a small API search plugin for Firefox 3.
> Maybe it could be usefull for someone... :-P
> 
> http://bin.cakephp.org/saved/42469
> 
> Best regards.
> 
> --
> MARCELO DE F. ANDRADE (aka "eleKtron")
> Belem, PA, Amazonia, Brazil
> Linux User #221105
> 
> [...@pará ~]# links http://pa.slackwarebrasil.org/
> 
> > 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[ask] Auth error when integrate with ACL in CakePHP 1.2.1.8004

2009-02-10 Thread yodi

Hello everybody,

for a weeks, i struggle learning about ACL. Then, i have something weird
in my app. I'm using $this->Auth->authorize = 'crud'; in my
app_controller.php.

Every i'm trying to logout, this is happend :

Auth::startup() - Attempted access of un-mapped action "logout" in
controller "users" [CORE/cake/libs/controller/components/auth.php, line
471]

But, when i add $this->Auth->actionMap['logout'] = 'read'; 
in my app_controller, everything works!

It's weird when Auth logout must set in actionMap.

can help me? 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Firefox Search Engine Plug-In

2009-02-10 Thread WebbedIT

# Copyright (c) 2009 Marcelo de Freitas Andrade 

Copyright info suggest he's only just created it/added his license
info.

How did he expect Hernan to search for it and find it if not added to
Mozilla Plugins site and not pasted to the bin, not that it would seem
logical to search the bin for such a thing?!?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Firefox Search Engine Plug-In

2009-02-10 Thread AD7six



On Feb 9, 11:12 pm, Marcelo Andrade  wrote:
> On Mon, Feb 9, 2009 at 12:04 PM, Hernan  wrote:
>
> > Hi there,
> > This is my first CakePHP post by the way. I'm kind of new to CakePHP
> > but I already love it.
>
> > I've created a search engine plug-in to search the 1.2 docs.
> > You can download it here:
> >https://addons.mozilla.org/en-US/firefox/search?q=cake&cat=4%2C0
>
> > You'll have to register if you want to use it. This is because of
> > their secutiry policy to new plug-ins.
> > To make it public I'd need other people to review it so if try it and
> > you like it, please review it so I can make it available to general
> > public.
>
> > Any feedback or help with it would be greatly appreciated!
> > Also, the code is available if anyone wants it. It's just an XML with
> > a base64 encoded icon.
>
> Credits?
>
> http://bin.cakephp.org/saved/42469

Is it just me, or is that paste from Feb 9th (and probably put up
after Hernan's announcement to the list).
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Validation rule with or

2009-02-10 Thread WebbedIT

I do not believe there are any built-in validation rules to do this so
you need to specify your own custom validation method such as:

function __validateFieldDependancy($data, $field1, $field2) {
  // return false if ThisModelName.field1 and ThisModelName.field2 are
empty
  return empty($this->data[$this->name][$field1']) && empty($this->data
[$this->name][$field2]) ? false : true;
}

This would go in your model and would be called by the following
validation rule:

var $validate = array(
  'field_name' => array(
'rule' => array('__validateFieldDependancy', 'fieldName1',
'fieldName2'),
'message' => 'Your error message'
  )
)

Not sure if it is neccessary to make this method private (named
starting with double underscores) but thought it was more secure to do
so.

There is probably a better way to test both fields are empty ... happy
for people to better educate me on this as I'm self-taught with PHP.

If you are going to use this type of validation rule regularly across
multiple models it may be worth aking it available to all models by
placing it in /app/app_model.php

Hope this helps,

Paul (WebbedIT)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Firefox Search Engine Plug-In

2009-02-10 Thread BeroFX

Ooops, sorry, thought you were talking about me :-) My 5 star rating
is still up :-)

On Feb 10, 10:25 am, BeroFX  wrote:
> @Herman:
>
> Man, I'm really sorry. I'm the guy that rated you, but I chose 5
> stars, not 1 (!?!?).
> I have no idea why Mozilla entered it as one :-(
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



CAKEPHP variable in querystring

2009-02-10 Thread cyk0tik

Hi,

Cake seems to be adding on an encrypted string to all my links in my
app..

eg. instead of http://www.website.com/index.php, I get
http://www.website.com/index.php?CAKEPHP=446fd3WEgh543fnz

Can anyone tell me why it's doing this?

Thanks

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Firefox Search Engine Plug-In

2009-02-10 Thread BeroFX

@Herman:

Man, I'm really sorry. I'm the guy that rated you, but I chose 5
stars, not 1 (!?!?).
I have no idea why Mozilla entered it as one :-(
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: How to do Data Sanitization in CakePHP 1.2.9?

2009-02-10 Thread Miles J

The model automatically sanitizes data when inserting and selecting
queries.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Firefox Search Engine Plug-In

2009-02-10 Thread WebbedIT

Have to agree with Hernan on this one ... you could have given the guy
the benefit of the doubt before jumping to the conclusion that he was
passing your work off as his.  All it would have took was for you to
expand on your "Credits?" post and make the guy aware you had
previously created a similar plugin.

If you think about it, this would be the last place in the world he
would publish notice of the plugin if he had ripped yours off, you
were always going to spot it!

Is it possible to retract your 1 star review?  Having that review up
there for everyone to see is unfair when the guy truly thought he was
offering something new to the community, which he has, as his searches
a different site to yours.

Maybe you guys could work together and make the plugin search the API
and Book ... I'm sure the aim is to make sure the best plugins are
shared with the community rather than achieving kudos for releasing
something alone ... this sort of behaviour does not appear to fit with
the ethos of open-source development.

Thanks to both of you for taking the time to release things though ..
it's more than I do at present :o)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How to do Data Sanitization in CakePHP 1.2.9?

2009-02-10 Thread Yogesh

Hi  All
Can any one please tell how I can do the data sanitization for the
users submitted data?
and which is better place to write it, is it in Controller or in
Model?

I don't know anything about reagarding data sanitization.
I need it from start to end means which helper or libraries i need  to
include for this
Please help me out !!

Thanks in advance



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



unable to handle MIME type: text/html ; fpdf

2009-02-10 Thread mbaste2

we get message :
unable to handle MIME type: text/html

when we view the saved pdf document.

we use fpdf, cakePHP, MySQL to output table to a pdf report.  cakePHP
seems to insist on that mime type instead of application/pdf?  we
don't understand what is causing this?

also, we think because our code is not cake-ified yet?  code is
below.  suggestions most welcome. still struggling with cakePHP but
beginning to like it.

thanks,
ige

test2.php
Cell($w[$i],5,$header[$i],1,0,'C');
$this->Ln();
//Data
foreach($data as $row)
{
for($i=0;$iCell($w[0],4,$row[$i],'LR');
//$this->Cell($w[1],6,$row[1],'LR');
//$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');
//$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');
$this->Ln();
}
//Closure line
$this->Cell(array_sum($w),0,'','T');
}
}

$pdf=new PDF();
//Column titles
$header=array
('Code','Rname','Xname','Zname','Ydesc','Wdesc','Udesc','Tdesc','Sdesc','Street','Brgy','line1','mobile','fax','gps
lat','gps long','Ydesc','head','designation','contact','designation');
//Data loading
$data=$pdf->LoadData();
$pdf->SetFont('Arial','',14);
$pdf->AddPage('L');
$pdf->ImprovedTable($header,$data);$pdf->AddPage('L');
$pdf->Output();
?>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Problems with combining COUNT(*) and GROUP BY

2009-02-10 Thread mscdex

seedifferently wrote:
> How can I get the $array[0][count] up there in the $array[QuestionsTag]
> ['count'] where it belongs? Why is it out there by itself under an
> index of 0?

The results of any DB function in your fields array will be placed
into a zero index because CakePHP has no way of knowing what model to
associate with the return value of a DB function.

To move just the 'count' portion to the place where you indicated, you
could do:
$array['QuestionsTag']['count'] = $array[0]['count'];
unset($array[0]['count']);

To move all elements in index zero to the place where you indicated,
you could do:
$array['QuestionsTag'] += $array[0];
unset($array[0]);
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Problems with combining COUNT(*) and GROUP BY

2009-02-10 Thread Miles J

What kalt said wont work, here you go.

http://groups.google.com/group/cake-php/browse_thread/thread/f823cc7f168cd619/cb71fbc24f187e78?lnk=gst&q=select+within+a+query#cb71fbc24f187e78
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Problems with combining COUNT(*) and GROUP BY

2009-02-10 Thread Kalt

You can try that :

array('fields'=>array('*', '(COUNT (*)) AS QuestionsTag.count')

On 10 fév, 08:41, seedifferently  wrote:
> Dear group,
>
> I've got a questions_tags table that has a column for the tag_id and
> question_id. I want to do a proper CakePHP model find('all') query to
> pull the tag_id's with the related COUNT for each time a tag_id is
> used.
>
> So far I can do this:
>
> $this->QuestionsTag->find('all', array('fields'=>array('*', '(COUNT
> (*)) AS count'), 'group'=>'tag_id'));
>
> However, the output is this:
>
> Array
>         (
>             [QuestionsTag] => Array
>                 (
>                     [tag_id] => 3
>                     [question_id] => 1
>                     [created] => -00-00 00:00:00
>                     [updated] => -00-00 00:00:00
>                 )
>
>             [Tag] => Array
>                 (
>                     [id] => 3
>                     [title] => testtag
>                     [created] => -00-00 00:00:00
>                     [updated] => 2009-02-09 16:26:15
>                 )
>
>             [0] => Array
>                 (
>                     [count] => 2
>                 )
>
>         )
>
> How can I get the $array[0][count] up there in the $array[QuestionsTag]
> ['count'] where it belongs? Why is it out there by itself under an
> index of 0?
>
> Thanks,
> Seth
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---