Translate Behavior Question ! ?

2009-09-01 Thread DatacenterHellas

Hello all :)

I use the Translate Behavior normaly but I'm not sure if the way I'm
using it is the correct, that's why I need your help !

Tha way I use it is this

var $actsAs = array(
'Translate'=>array(
'name'=>'nameTranslated'
)
);

Where name is the field name that I like to translate.

After every saving into the I18n I get one record like this

idlocale   model foreign_key  field
content
1 gre   MenuGroup 1 name
My greek content
2 gre   MenuGroup 2 name
My another greek content

Now If I change my language to english and I add some records into my
table the i18n get again the new records like that

idlocale   model foreign_key  field
content
1 gre   MenuGroup 1 name
My greek content
2 gre   MenuGroup 2 name
My another greek content
3 gre   MenuGroup 3 name
My english content
4 gre   MenuGroup 4 name
My another english content

Is that correct ? ? ?

Or Am I doing something wrong ? ? ?

May the foreign key must point to the i18n id column of the the greek
records ? ? ?

I mean something like that :

idlocale   model foreign_key  field
content
1 <- gre   MenuGroup 1 name My
greek content
2 <- gre   MenuGroup 2 name My
another greek content
3 gre   MenuGroup 1 <- name My
english content
4 gre   MenuGroup 2 <- name My
another english content

And if this is the normal how to fix this think ? ? ?

Kind regards

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



HABTM pagination issue

2009-09-01 Thread double07

Hi All,

I'm having an issue with using HABTM with pagination...

My app has a users and roles table - users HABTM roles, roles have
many users.

In my users index controller I'm trying to limit the pagination
results so that only users with certain roles are displayed.

At the moment I have:
$this->User->recursive = 1;
$this->set('users', $this->paginate('User', array('Roles.name' =>
'Administrator')));

This gives me this error:
Warning (512): SQL Error: 1054: Unknown column 'Roles.name' in 'where
clause' [CORE\cake\libs\model\datasources\dbo_source.php, line 525]

When I do pretty much the same this with a 'find all' it seems to work
ok:
$this->set('data', $this->User->Role->find('all', array
('conditions'=>array('Role.name'=>'Administrator';

Where am I going wrong here?

TIA
--~--~-~--~~~---~--~~
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: Regex validation problem.

2009-09-01 Thread Dr. Loboto

The best human name validation - not empty one.

On Sep 1, 9:29 pm, Bryan Paddock  wrote:
> Ah in the end I removed the validation completely... realized that putting
> such restrictions on names is not the best idea (eg unicode chinese/jap
> names etc)
>
>
>
> On Mon, Aug 31, 2009 at 5:14 PM, Dr. Loboto  wrote:
>
> > Your function does all right - alphanumeric values only as you did
> > nothing with it.
>
> > '/^[a-zA-Z0-9_-]+$/'
--~--~-~--~~~---~--~~
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: Radio with WRONG LABEL ID

2009-09-01 Thread delocalizer

You can specify 'id' directly in input method like this:
$form->input('User.SecurityAccess.'.$aco_id, array(
'id'=>"UserSecurityAccess$aco_id",
)
);
But the reason the problem is happening in the first place the syntax
of your input fieldname, with $aco_id at the end... try this instead:
$form->input('User.'.$aco_id.'.SecurityAccess, array(
...)
);


On Sep 2, 6:28 am, ProgDario  wrote:
> You're right brian, two radios for every group, so the two radios
> shown have different ids but another group has the same id.
>
> Any ideas to correct this?
>
> Thanks!!
>
> On 28 Ago, 17:12, brian  wrote:
>
> > I think the problem is not so much the value of the labels' "for"
> > attribute (NOT the id, which it doesn't have) but the id of the radio
> > elements. There are several groups of these, so there are several
> > radio buttons with the same id.
>
> > On Thu, Aug 27, 2009 at 10:25 PM, delocalizer 
> > wrote:
>
> > > Do you mean the name is the same? Because it is supposed to be - both
> > > buttons provide a value to the same field.
> > > What is the symptom of your problem?
>
> > > On Aug 27, 9:19 pm, "lacenaepro...@gmail.com"
> > >  wrote:
> > >> HI,
>
> > >> I can't resolve a strange problem. This is my code:
>
> > >> echo $form->input('User.SecurityAccess.'.$aco_id,
> > >>                   array
> > >>                   (
> > >>                     'div' => false,
> > >>                     'label' => false,
> > >>                     'type' => 'radio',
> > >>                     'legend' => false,
> > >>                     'default' => $selected,
> > >>                     'options' => array('allow' => " {$allow}",
> > >> 'deny' => " {$deny}")
> > >>                   )
> > >>             );
>
> > >> I try to create a set of radio groups, every group has 2 raàdio
> > >> buttons. I want taht every radio group has different id in their
> > >> label, so the user can click directly on the label, BUT CAKE SEEMS TO
> > >> PUT the same id in the code. This is the resulting code:
>
> > >>  > >> id="GroupSecurityAccessAllow" value="allow"  />
> > >>  Allow
>
> > >>  > >> id="GroupSecurityAccessDeny" value="deny" checked="checked"  />
> > >>  Deny
>
> > >> The other pairs of radio buttons has the SAME LABEL ID.
>
> > >> ANY IDEAS?
>
> > >> Tnx!! AS?
>
> > >> Tnx!!- Nascondi testo citato
>
> > - Mostra testo citato -
>
>
--~--~-~--~~~---~--~~
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 not escape Javascript in html helper link

2009-09-01 Thread Dr. Loboto

Use SINGLE QUOTES when need quotes in tag attributes. It is the basics
of HTML.

link(
$html->image('an_image.jpg'),
'/image/a_link.php?test',
array(
'class' => 'image',
'escape' => false,
'onClick' => "pageTracker._trackEvent('category',
'action', 'label');"
),
false,
false
);
?>

On Sep 2, 12:15 am, Kana  wrote:
> How to not escape Javascript in html helper link without having to use
> Javascript outside $html->link?
>
> I try to achieve:
> - the quotes in the onClick event, either single or double quotes
>
>  onClick="pageTracker._trackEvent("category", "action", "label");">
>         
> 
>
> But the result I get when viewing pagesource is:
> - note the escaped quotes
> - I tried single and double quotes
>
>  onClick="pageTracker._trackEvent("category",
> "action", "label");">
>         
> 
>
> I use the following code:
>
>  echo $html->link(
>         $html->image('an_image.jpg'),
>         '/image/a_link.php?test',
>         array('class' => 'image', 'escape' => false, 'onClick' =>
> 'pageTracker._trackEvent("category", "action", "label");'),
>         false,
>         false
> );
> ?>
>
> There must be a way to onClick Javascript working in link? I Googled
> but couldn't find any topic on this.
--~--~-~--~~~---~--~~
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: app::import case sensitive

2009-09-01 Thread Dr. Loboto

Sensitive, sensitive - as all other Cake functions.

"$a === $b" is strict equality, true only when type and content of
arguments are same. 
http://www.php.net/manual/en/language.operators.comparison.php

On Sep 2, 12:49 am, abc  wrote:
> Is app::import case sensitive or insenitive in its arguments,
> App::import('Model',) is same as App::import('model',.)
>
> From the source code it feels like case sensitive (i do not know what
> three equal operator does ===)
>
> Extract from configure.php
>  function __overload($type, $name) {
>                 if (($type === 'Model' || $type === 'Helper') &&
> strtolower($name) != 'schema') {
>                         Overloadable::overload($name);
>                 }
>         }
--~--~-~--~~~---~--~~
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: File Uploads: What security-issues I have to take care of?

2009-09-01 Thread David Persson

A few things to keep in mind are:

* Don't just validate against the MIME type submitted by the client,
verify the MIME type by inspecting the uploaded file directly.
* Image transformations help to prevent some exploits (i.e. by
stripping comment metadata).
* Uploaded files shouldn't be directly accessible either only serve
i.e. transformed images (see above) or obscure by using UUIDs.

- David


On 1 Sep., 07:21, the_woodsman  wrote:
> RE The media view - I try and avoid this unless it's a real security
> requirement, as it means every request for a simple image requires
> CakePHP to handle it, vastly increasing the load on yoru servers, and
> the latency for that file.
>
> An alternative is to save each file based on a UUID, or similar - this
> means you can serve the image files directly, but it's basically
> impossible to guess another user's image UUIDs, meaning it's still
> very secure.
>
> (That's my understanding - I'd be interested if anyone disagrees?)
>
> On Aug 31, 7:55 pm, Miles J  wrote:
>
> > Regarding the mimetype, it allows all mimetypes listed in the config
> > folder. If you want to restrict the type, use the file validation
> > behavior.
>
> > For the second part of your question. You would do a normal controller
> > action setup like /files/download/1 and then use the media view and
> > your own logic to determine the file.
>
> >http://book.cakephp.org/view/489/Media-Views
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@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: Learning cakePHP debugging

2009-09-01 Thread abc

Use the var_dump of php,
ob_start();
 var_dump($activeuser);
$dump_string = ob_get_clean();

Now dump the string,

On Sep 1, 12:06 pm, McScreech  wrote:
> Hello,
>
> I am learning to trace through my code to debug results that I don't
> understand.
> I have the following setup (in part):
> (And apologies for running on in my attempt to describe the
> situation.)
>
> in app_controller.php:
>         var $uses = array('User');
>         var $components = array('Acl', 'Auth', 'Session');
>
>         function beforeFilter() {
>                 // Configure AuthComponent
>                 $this->Auth->autoRedirect = false;
>                 $this->Auth->authorize = 'actions';
>                 $this->Auth->loginAction = array('controller' => 'users', 
> 'action'
> => 'login');
>                 $this->Auth->allowedActions = array('display', 'login', 
> 'logout');
>
>                 // Remember user who is logged in
>                 $activeUser = 
> $this->User->find(array($this->Auth->user('id')));
>                 $this->set('activeUser', $activeUser);
>         } // end beforeFilter()
>         . . .
>
> in users_controller.php:
>         function login() {
>                 if( $this->Auth->user() ) {
>                         $this->redirect( array('controller' => 'pages', 
> 'action' =>
> 'start') );
>                 }
>         } // end login()
>         . . .
>
> I have introductory content in home.ctp with a link to login.ctp which
> on success redirects to start.ctp. This 'start' page is where I am
> trying to setup different menus depending on the users access
> privileges.
>
> In start.ctp:
>         // Debugging info begin
>         $oldDebug = Configure::read('debug');
>         Configure::write('debug', 3);
>         Debugger::dump(isset($activeUser));
>         Debugger::dump($activeUser);
>         Debugger::dump($activeUser['User']);
>         Debugger::dump($activeUser['Group']);
>         Configure::write('debug', $oldDebug);
>         // Debugging info end
>
>         if(isset($activeUser)) {
>                 switch ($activeUser['Group']['id']):
>                     case 1: // user is in administrator group
>                         echo $this->element('adm_menu');
>                         break;
>                     case 2: // moderator group
>                         echo $this->element('mod_menu');
>                         break;
>                     case 3: // user group
>                         echo $this->element('usr_menu');
>                         break;
>                     default: // guest group
>                         echo $this->element('gst_menu');
>                 endswitch;
>         }
>         . . .
>
> The dump calls output:
>         Debugger::dump(isset($activeUser));
>                 true
>
>         Debugger::dump($activeUser);
>                 array(
>                         "User" => array(),
>                         "Group" => array()
>                 )
>
>         Debugger::dump($activeUser['User']);
>                 array(
>                         "id" => "1",
>                         "username" => "xxx",
>                         "first" => "xxx",
>                         "last" => "xxx",
>                         "password" => "xxx",
>                         "group_id" => "1",
>                         "created" => "2009-08-27 14:51:52",
>                         "modified" => "2009-08-27 14:51:52"
>                 )
>
>         Debugger::dump($activeUser['Group']);
>                 array(
>                         "id" => "1",
>                         "name" => "Administrator",
>                         "created" => "2009-08-27 14:50:33",
>                         "modified" => "2009-08-27 14:50:33"
>                 )
>
> All acceptable, however my question is: How can I dump the full
> contents of $activeUser with sub components in a way that I do not
> have to call the 'User' and 'Group' arrays separately? Or extended to
> work on a variable where I don't have to know it's full structure.
>
> Many thanx in advance, McS
--~--~-~--~~~---~--~~
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: Welcome Page not finding CSS/Images

2009-09-01 Thread ajoberstar

.htaccess files are present.  And like I mentioned in my original post
I copied the files I had locally (that are not working) to bluehost
and they work there.  I have removed the hash in front of the
loadmodule statement as well.  So as far as I can tell mod_rewrite is
enabled, but the cake welcome page still does not work.

On Sep 1, 5:07 am, Kornelije Sajler  wrote:
> It is usually in apache/conf/httpd.confprobably you have comment on it
> #LoadModule rewrite_module modules/mod_rewrite.so
> remove hash # to look like this
> LoadModule rewrite_module modules/mod_rewrite.so
> and restart server
>
> and now you have rewrite enabled!
>
> Hope it helps,
>
> Kornelije Sajler
>
>
>
> On Tue, Sep 1, 2009 at 11:47, jeff  wrote:
> > HEY JUST CHECK IN UR SERVER SETTINGS WETHER THE MODE REWRITE IS ENALED OR
> > NOT...
>
> > YOU CAN FIND IT UNDER PHP SETTINGS OR SOMETHING LIKE THAT.
>
> > ENABLE IT .
>
> > On Mon, Aug 31, 2009 at 11:16 PM, fatnic...@googlemail.com <
> > fatnic...@googlemail.com> wrote:
>
> >> Did you make sure you copied over ALL of the files from the Cake
> >> download? Even the hidden ones? Sounds like the .htaccess file is
> >> missing.
>
> >> On Sep 1, 2:04 am, ajoberstar  wrote:
> >> > I did an install of CakePHP on my local device (Windows XP) with an
> >> > Apache server.  I did the install to the letter as far as I can tell
> >> > (removed comment in front of mod_rewrite's load module statement), but
> >> > I'm getting a welcome page with no layout. And it seems like the whole
> >> > page isn't even showing up.
>
> >> > The thing that bugs me the most is that I uploaded the same exact
> >> > files up to my bluehost account and got the right welcome page.  So
> >> > it's got to be something with my server setup but I can't figure it
> >> > out.  Any help would be much appreciated.
>
> >> > This is all that showed up in the page source:
>
> >> > Release Notes for CakePHP 1.2.4.8284.
> >> > https://trac.cakephp.org/wiki/changelog/1.2.x.x";>Read the
> >> > changelog 
> >> > 
> >> >         Your tmp directory is
> >> writable. >> > p>
> >> > 
> >> >         The FileEngine is being
> >> used
> >> > for caching. To change the config edit APP/config/core.php  >> > p>
> >> > 
> >> >         Your database configuration file is
> >> > present.
>
> > --
> > --
> > (¨`•.•´¨) I may be busy,
> > `•.¸(¨`•.•´¨)  but I assure you,
> > (¨`•.•´¨)¸.•´ you are always in my heart
> > `•.¸.•´
>
> > With Lots of Love.
>
> > THANKS AND REGARDS
>
> > Jeffery Jacob
--~--~-~--~~~---~--~~
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: Problem with hasMany

2009-09-01 Thread logislack

If i only use die(debug($this->{$model}));  I got the dump of object.
If i only use die(debug($this->alias)); I got the Grupos_de_contenido

It means what the error occurs is not in the first time what
getColumnType function is called. Then the die(debug($this->
{$model})); is killing the application before what the error occurs.

function getColumnType($column) {
$db =& ConnectionManager::getDataSource($this->useDbConfig);
$cols = $this->schema();
$model = null;

$column = str_replace(array($db->startQuote, $db->endQuote), '',
$column);

if (strpos($column, '.')) {
list($model, $column) = explode('.', $column);
}
if ($model != $this->alias && !empty($model) && isset($this->
{$model})) { // Line 948
return $this->{$model}->getColumnType($column);
}


I Added the lines:
 if(!isset($model) || empty($model))
   { die('Is $this->{$model} = "'. $model . '" on
' . $this->alias); }

to know what values are in the variables ($this->alias, $this->
($model)) when the error occurs. I got:
Is $this->{$model} = "" on Contenido

Only I create a new not empty condition for $model, before try $this->
{$model} and all works fine.

Thanks again.

On Sep 1, 11:25 am, brian  wrote:
> I don't suggest that you modify the core files like that. It will lead
> to problems down the road when you want to upgrade. The hint to put
> the debug statements in there was just that--for debugging. It would
> be better to track down precisely what the problem is in your own
> code. The thing is, I'm having some trouble understanding what it is
> you did.
>
>                if(!isset($this->alias) || empty($this->alias))
>                        { die('Es $this->alias'); }
>                if(!isset($model) || empty($model))
>                        { die('Is $this->{$model} = "'. $model . '" on
> ' . $this->alias); }
>
> Is $this->{$model} = "" on Contenido
>
> So, $model is empty. But, die(debug($this->{$model})); gives you a
> nice bunch of information. So, I'm confused. Maybe I'm not the best
> person to investigate this.
>
> One thing: Grupos_de_contenido should *maybe* be GruposDeContenido.
> I've no idea if it's related.
>
> On Tue, Sep 1, 2009 at 11:48 AM, logislack wrote:
>
> > Hi brian
>
> > I solved the problem:
>
> >                if ($model != $this->alias && !empty($model) && isset($this->
> > {$model})) { // Line 948
> >                        return $this->{$model}->getColumnType($column);
> >                }
>
> > instead:
> >                if ($model != $this->alias && isset($this->{$model})) {  // 
> > Line 948
> >                        return $this->{$model}->getColumnType($column);
> >                }
>
> > This in order to avoid running $this->{$ model} if $model is empty
>
> > Thanks again!
>
> > On Aug 31, 7:24 pm, brian  wrote:
> >> The only things that look odd are 'Prioridad' (should be lowercase?)
> >> and 'order'=>'ORDER BY RAND()'. I think that should be just
> >> 'order'=>'RAND()', but I could be wrong.
>
> >> Looking at line 21 of 8166, there are 2 properties that it may be
> >> failing on. I'd add these lines just above 921:
>
> >> die(debug($this->alias));
> >> die(debug($this->{$model}));
>
> >> Run it once, then comment the 1st line. See if that shows anything helpful.
>
> >> On Mon, Aug 31, 2009 at 4:18 PM, logislack wrote:
>
> >> > I have a problem with a hasMany relationship. Locally everything works
> >> > fine, but when I upload files to the server I get the following error
>
> >> > Fatal error: Cannot access empty property in /sitiotmp/www2/nuevositio/
> >> > cake/libs/model/model.php on line 921
>
> >> > I'm using cake 1.2.3.8166
>
> >> > My models with de problem:
>
> >> >  >> > class Grupos_de_contenido extends AppModel{
> >> >   var $name = 'Grupos_de_contenido';
> >> >   var $primaryKey = 'id';
> >> >   var $displayField = 'nombre';
>
> >> >   var $hasMany = array('Contenido'=> array('className'=>'Contenido',
>
> >> > 'foreignKey'=>'id_grupo_contenido',
>
> >> > 'order'=>'Contenido.Prioridad DESC, Contenido.titulo ASC',
>
> >> > 'conditions'=>'Contenido.publicado = true'
> >> >                                           ));
> >> > }
> >> > ?>
> >> > -
> >> >  >> >   class Encuesta extends AppModel {
> >> >       var $name = 'Encuesta';
> >> >       var $tableName = 'encuestas';
>
> >> >       var $hasMany = array('Respuesta'=>array
> >> > ('className'=>'Respuesta', 'foreignKey'=>'id_encuesta'));
>
> >> >       function obtenerEncuesta($id = null) {
> >> >           $cond = array();
> >> >           if(!is_null($id))
> >> >               $cond = array('Encuesta.id' => $id);
>
> >> >           return $this->find('first', array('contidions'=>$cond,
> >> > 'order'=>'ORDER BY RAND()'));
> >> >       }
> >> >   }
> >> > ?>
>
> >> > help?
> >> > Thanks!
--~--~-~--~~-

Re: Radio with WRONG LABEL ID

2009-09-01 Thread ProgDario

You're right brian, two radios for every group, so the two radios
shown have different ids but another group has the same id.

Any ideas to correct this?


Thanks!!


On 28 Ago, 17:12, brian  wrote:
> I think the problem is not so much the value of the labels' "for"
> attribute (NOT the id, which it doesn't have) but the id of the radio
> elements. There are several groups of these, so there are several
> radio buttons with the same id.
>
>
>
> On Thu, Aug 27, 2009 at 10:25 PM, delocalizer 
> wrote:
>
> > Do you mean the name is the same? Because it is supposed to be - both
> > buttons provide a value to the same field.
> > What is the symptom of your problem?
>
> > On Aug 27, 9:19 pm, "lacenaepro...@gmail.com"
> >  wrote:
> >> HI,
>
> >> I can't resolve a strange problem. This is my code:
>
> >> echo $form->input('User.SecurityAccess.'.$aco_id,
> >>                   array
> >>                   (
> >>                     'div' => false,
> >>                     'label' => false,
> >>                     'type' => 'radio',
> >>                     'legend' => false,
> >>                     'default' => $selected,
> >>                     'options' => array('allow' => " {$allow}",
> >> 'deny' => " {$deny}")
> >>                   )
> >>             );
>
> >> I try to create a set of radio groups, every group has 2 raàdio
> >> buttons. I want taht every radio group has different id in their
> >> label, so the user can click directly on the label, BUT CAKE SEEMS TO
> >> PUT the same id in the code. This is the resulting code:
>
> >>  >> id="GroupSecurityAccessAllow" value="allow"  />
> >>  Allow
>
> >>  >> id="GroupSecurityAccessDeny" value="deny" checked="checked"  />
> >>  Deny
>
> >> The other pairs of radio buttons has the SAME LABEL ID.
>
> >> ANY IDEAS?
>
> >> Tnx!! AS?
>
> >> Tnx!!- Nascondi testo citato
>
> - Mostra testo citato -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



accodion is not working

2009-09-01 Thread leafchild

Reference site: http://stickmanlabs.com/accordion/

I used this accordion for couple of sites and working fine however I
have problem setting it up with CakePHP environment.

my code:

   
 title 1 
 aaa 
 title 2 
 bbb 
 title 3 
 ccc 



Issue:
1) when I access the site first time all accordions are looks like all
opened already but not supposed to be that way.
   I set only first top one is opened when user access the site first
time.
  Looks like in style code is correct:
==

 title 1 
 aaa 
 title 2 
 bbb 
 title 3 
 ccc 

==
but second accordion and title3 is overwrite each other

2) when I click top accordion(title1) - it colosed( looks like working
ok) but if I click again there is no response
===

 title 1 
 aaa 
 title 2 
 bbb 
 title 3 
 ccc 

===
no matter how many time I click title1, there is no response.

so i click title 2 (second accordion) and open fine, and click again
to close but same thing's haapend with title1.
no response from "title2"

3) I click "title1"(top accordion) then it's opened but there is no
contents display(looks like empty)
  

 title 1 
 aaa 
 title 2 
 bbb 
 title 3 
 ccc 

 
looking at code, even top one is active content font is 0px that's why
it doesn't show anything.
If I use firebug to rewrite code (set font-size to 10px) then content
is displayed.


Fist I used lated version of javascript(prototype.js,  effects.js,
accordion.js) then I switched to old version to see make any different
but
I still see the same issue.

How can I fix this wired css setting?

or

If there is another accordion working fine with CakePHP??





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



Learning cakePHP debugging

2009-09-01 Thread McScreech

Hello,

I am learning to trace through my code to debug results that I don't
understand.
I have the following setup (in part):
(And apologies for running on in my attempt to describe the
situation.)

in app_controller.php:
var $uses = array('User');
var $components = array('Acl', 'Auth', 'Session');

function beforeFilter() {
// Configure AuthComponent
$this->Auth->autoRedirect = false;
$this->Auth->authorize = 'actions';
$this->Auth->loginAction = array('controller' => 'users', 
'action'
=> 'login');
$this->Auth->allowedActions = array('display', 'login', 
'logout');

// Remember user who is logged in
$activeUser = $this->User->find(array($this->Auth->user('id')));
$this->set('activeUser', $activeUser);
} // end beforeFilter()
. . .

in users_controller.php:
function login() {
if( $this->Auth->user() ) {
$this->redirect( array('controller' => 'pages', 
'action' =>
'start') );
}
} // end login()
. . .

I have introductory content in home.ctp with a link to login.ctp which
on success redirects to start.ctp. This 'start' page is where I am
trying to setup different menus depending on the users access
privileges.

In start.ctp:
// Debugging info begin
$oldDebug = Configure::read('debug');
Configure::write('debug', 3);
Debugger::dump(isset($activeUser));
Debugger::dump($activeUser);
Debugger::dump($activeUser['User']);
Debugger::dump($activeUser['Group']);
Configure::write('debug', $oldDebug);
// Debugging info end

if(isset($activeUser)) {
switch ($activeUser['Group']['id']):
case 1: // user is in administrator group
echo $this->element('adm_menu');
break;
case 2: // moderator group
echo $this->element('mod_menu');
break;
case 3: // user group
echo $this->element('usr_menu');
break;
default: // guest group
echo $this->element('gst_menu');
endswitch;
}
. . .

The dump calls output:
Debugger::dump(isset($activeUser));
true

Debugger::dump($activeUser);
array(
"User" => array(),
"Group" => array()
)

Debugger::dump($activeUser['User']);
array(
"id" => "1",
"username" => "xxx",
"first" => "xxx",
"last" => "xxx",
"password" => "xxx",
"group_id" => "1",
"created" => "2009-08-27 14:51:52",
"modified" => "2009-08-27 14:51:52"
)

Debugger::dump($activeUser['Group']);
array(
"id" => "1",
"name" => "Administrator",
"created" => "2009-08-27 14:50:33",
"modified" => "2009-08-27 14:50:33"
)


All acceptable, however my question is: How can I dump the full
contents of $activeUser with sub components in a way that I do not
have to call the 'User' and 'Group' arrays separately? Or extended to
work on a variable where I don't have to know it's full structure.

Many thanx in advance, McS

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



admin application

2009-09-01 Thread Henrik Gemal

I need to write an admin application where user can only see their own
stuff and admins can see all the stuff.

But I am a bit confused which way I need to look. Should I look into
using ACLs or ?

Think of a book site where users can only see and edit the books they
posted and admins can see and edit all books. ACL's seems complicated.

Any recommendations?

I've been using Cake now for a year but have never used ACLs yet.
--~--~-~--~~~---~--~~
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: Array of input text

2009-09-01 Thread nMac
Here's what I've done in the view:


data['Blogurl']['url']); $i++){
echo $form->input("Blogurl.url.$i", array('label' => 'URL'));
}

?>



input('BlogurlUrl', array('name' =>
'data[Blogurl][url][]','id' => '', 'label' => 'URL'));?>




In controller, I had to validate manually each URL since the saveAll()
method won't work because of the non-conventional field names.



May be there's a better solution to deal with this problem if you know
exactly how many URLs you're expecting to receive; but in this case user may
add many URLs as he desires.


Of course guys *don't do this at home; and ensure you're under an adult
supervision if you want to do it;* and always remember to use Cake
conventions and methods (that's why we are using a framework).


Thanks guys for your help and cooperation!




Nicolás Andrade
*n...@nicoandra.com.ar*
 Blog  | CV  |
Flickr  |
Del.icio.us|
LastFM 



On Tue, Sep 1, 2009 at 9:21 AM, WebbedIT  wrote:

>
> eh?  why refuse to name the fields using CakePHP's conventions ...
> effectively stopping you from using the perfectly good saveAll()
> method to save both your Blog and multiple BlogUrl data with full
> validation all in one call?  Are you confident that you can write a
> better function than the one already in the core?
> >
>

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



app::import case sensitive

2009-09-01 Thread abc

Is app::import case sensitive or insenitive in its arguments,
App::import('Model',) is same as App::import('model',.)

>From the source code it feels like case sensitive (i do not know what
three equal operator does ===)

Extract from configure.php
 function __overload($type, $name) {
if (($type === 'Model' || $type === 'Helper') &&
strtolower($name) != 'schema') {
Overloadable::overload($name);
}
}

--~--~-~--~~~---~--~~
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 not escape Javascript in html helper link

2009-09-01 Thread Kana

How to not escape Javascript in html helper link without having to use
Javascript outside $html->link?

I try to achieve:
- the quotes in the onClick event, either single or double quotes







But the result I get when viewing pagesource is:
- note the escaped quotes
- I tried single and double quotes







I use the following code:

link(
$html->image('an_image.jpg'),
'/image/a_link.php?test',
array('class' => 'image', 'escape' => false, 'onClick' =>
'pageTracker._trackEvent("category", "action", "label");'),
false,
false
);
?>

There must be a way to onClick Javascript working in link? I Googled
but couldn't find any topic on this.

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



relationship question

2009-09-01 Thread Larking

Hi,

I am not quite sure how to search for how to tackle this problem so
aplogies - perhaps someone could send me in the direction of a
relevant post?

I have a model:
-pages

I want another model to hold the links between pages so would have

-links

with fields:

-id, page_from_id, page_to_id

where both page_from_id and page_to_id is an id in the pages table.

Can you tell me what type of model relationship I need for this please
as at the moment it looks for page_from and page_to models which don't
exist.

Thanks

James

--~--~-~--~~~---~--~~
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: File Uploads: What security-issues I have to take care of?

2009-09-01 Thread Miles J

@woodsman - No I agree with you.

I was simply showing him the media view because you he wanted to
supply downloads/files to users.

On Sep 1, 4:21 am, the_woodsman  wrote:
> RE The media view - I try and avoid this unless it's a real security
> requirement, as it means every request for a simple image requires
> CakePHP to handle it, vastly increasing the load on yoru servers, and
> the latency for that file.
>
> An alternative is to save each file based on a UUID, or similar - this
> means you can serve the image files directly, but it's basically
> impossible to guess another user's image UUIDs, meaning it's still
> very secure.
>
> (That's my understanding - I'd be interested if anyone disagrees?)
>
> On Aug 31, 7:55 pm, Miles J  wrote:
>
> > Regarding the mimetype, it allows all mimetypes listed in the config
> > folder. If you want to restrict the type, use the file validation
> > behavior.
>
> > For the second part of your question. You would do a normal controller
> > action setup like /files/download/1 and then use the media view and
> > your own logic to determine the file.
>
> >http://book.cakephp.org/view/489/Media-Views
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@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: Problem with hasMany

2009-09-01 Thread brian

I don't suggest that you modify the core files like that. It will lead
to problems down the road when you want to upgrade. The hint to put
the debug statements in there was just that--for debugging. It would
be better to track down precisely what the problem is in your own
code. The thing is, I'm having some trouble understanding what it is
you did.

   if(!isset($this->alias) || empty($this->alias))
   { die('Es $this->alias'); }
   if(!isset($model) || empty($model))
   { die('Is $this->{$model} = "'. $model . '" on
' . $this->alias); }

Is $this->{$model} = "" on Contenido

So, $model is empty. But, die(debug($this->{$model})); gives you a
nice bunch of information. So, I'm confused. Maybe I'm not the best
person to investigate this.

One thing: Grupos_de_contenido should *maybe* be GruposDeContenido.
I've no idea if it's related.

On Tue, Sep 1, 2009 at 11:48 AM, logislack wrote:
>
> Hi brian
>
> I solved the problem:
>
>                if ($model != $this->alias && !empty($model) && isset($this->
> {$model})) { // Line 948
>                        return $this->{$model}->getColumnType($column);
>                }
>
> instead:
>                if ($model != $this->alias && isset($this->{$model})) {  // 
> Line 948
>                        return $this->{$model}->getColumnType($column);
>                }
>
> This in order to avoid running $this->{$ model} if $model is empty
>
> Thanks again!
>
> On Aug 31, 7:24 pm, brian  wrote:
>> The only things that look odd are 'Prioridad' (should be lowercase?)
>> and 'order'=>'ORDER BY RAND()'. I think that should be just
>> 'order'=>'RAND()', but I could be wrong.
>>
>> Looking at line 21 of 8166, there are 2 properties that it may be
>> failing on. I'd add these lines just above 921:
>>
>> die(debug($this->alias));
>> die(debug($this->{$model}));
>>
>> Run it once, then comment the 1st line. See if that shows anything helpful.
>>
>> On Mon, Aug 31, 2009 at 4:18 PM, logislack wrote:
>>
>> > I have a problem with a hasMany relationship. Locally everything works
>> > fine, but when I upload files to the server I get the following error
>>
>> > Fatal error: Cannot access empty property in /sitiotmp/www2/nuevositio/
>> > cake/libs/model/model.php on line 921
>>
>> > I'm using cake 1.2.3.8166
>>
>> > My models with de problem:
>>
>> > > > class Grupos_de_contenido extends AppModel{
>> >   var $name = 'Grupos_de_contenido';
>> >   var $primaryKey = 'id';
>> >   var $displayField = 'nombre';
>>
>> >   var $hasMany = array('Contenido'=> array('className'=>'Contenido',
>>
>> > 'foreignKey'=>'id_grupo_contenido',
>>
>> > 'order'=>'Contenido.Prioridad DESC, Contenido.titulo ASC',
>>
>> > 'conditions'=>'Contenido.publicado = true'
>> >                                           ));
>> > }
>> > ?>
>> > -
>> > > >   class Encuesta extends AppModel {
>> >       var $name = 'Encuesta';
>> >       var $tableName = 'encuestas';
>>
>> >       var $hasMany = array('Respuesta'=>array
>> > ('className'=>'Respuesta', 'foreignKey'=>'id_encuesta'));
>>
>> >       function obtenerEncuesta($id = null) {
>> >           $cond = array();
>> >           if(!is_null($id))
>> >               $cond = array('Encuesta.id' => $id);
>>
>> >           return $this->find('first', array('contidions'=>$cond,
>> > 'order'=>'ORDER BY RAND()'));
>> >       }
>> >   }
>> > ?>
>>
>> > help?
>> > 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: Problem getting associations to work

2009-09-01 Thread mdrisser

Hahaha, I KNEW it was something simple that I was missing, and that
was it. Thanks brian!
--~--~-~--~~~---~--~~
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 stop html->link helper adding line breaks

2009-09-01 Thread brian

Glad to help. But how is it a problem? Is that causing display issues
somehow? It shouldn't, AFAIK.

On Tue, Sep 1, 2009 at 8:17 AM, WebbedIT wrote:
>
> brian, you are a class act ... of course I used that little helper,
> doh!  Will just have to remove that helper when I put the site into
> production I suppose.
>
> Thanks for pointing out what should have been obvious :)
> >
>

--~--~-~--~~~---~--~~
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: Problem with hasMany

2009-09-01 Thread logislack

Hi brian

I solved the problem:

if ($model != $this->alias && !empty($model) && isset($this->
{$model})) { // Line 948
return $this->{$model}->getColumnType($column);
}

instead:
if ($model != $this->alias && isset($this->{$model})) {  // 
Line 948
return $this->{$model}->getColumnType($column);
}

This in order to avoid running $this->{$ model} if $model is empty

Thanks again!

On Aug 31, 7:24 pm, brian  wrote:
> The only things that look odd are 'Prioridad' (should be lowercase?)
> and 'order'=>'ORDER BY RAND()'. I think that should be just
> 'order'=>'RAND()', but I could be wrong.
>
> Looking at line 21 of 8166, there are 2 properties that it may be
> failing on. I'd add these lines just above 921:
>
> die(debug($this->alias));
> die(debug($this->{$model}));
>
> Run it once, then comment the 1st line. See if that shows anything helpful.
>
> On Mon, Aug 31, 2009 at 4:18 PM, logislack wrote:
>
> > I have a problem with a hasMany relationship. Locally everything works
> > fine, but when I upload files to the server I get the following error
>
> > Fatal error: Cannot access empty property in /sitiotmp/www2/nuevositio/
> > cake/libs/model/model.php on line 921
>
> > I'm using cake 1.2.3.8166
>
> > My models with de problem:
>
> >  > class Grupos_de_contenido extends AppModel{
> >   var $name = 'Grupos_de_contenido';
> >   var $primaryKey = 'id';
> >   var $displayField = 'nombre';
>
> >   var $hasMany = array('Contenido'=> array('className'=>'Contenido',
>
> > 'foreignKey'=>'id_grupo_contenido',
>
> > 'order'=>'Contenido.Prioridad DESC, Contenido.titulo ASC',
>
> > 'conditions'=>'Contenido.publicado = true'
> >                                           ));
> > }
> > ?>
> > -
> >  >   class Encuesta extends AppModel {
> >       var $name = 'Encuesta';
> >       var $tableName = 'encuestas';
>
> >       var $hasMany = array('Respuesta'=>array
> > ('className'=>'Respuesta', 'foreignKey'=>'id_encuesta'));
>
> >       function obtenerEncuesta($id = null) {
> >           $cond = array();
> >           if(!is_null($id))
> >               $cond = array('Encuesta.id' => $id);
>
> >           return $this->find('first', array('contidions'=>$cond,
> > 'order'=>'ORDER BY RAND()'));
> >       }
> >   }
> > ?>
>
> > help?
> > 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: Welcome Page not finding CSS/Images

2009-09-01 Thread 3rdBear

+1 on checking to ensure that your ".htaccess" file is present.

On Sep 1, 2:16 am, "fatnic...@googlemail.com"
 wrote:
> Did you make sure you copied over ALL of the files from the Cake
> download? Even the hidden ones? Sounds like the .htaccess file is
> missing.
>
> On Sep 1, 2:04 am, ajoberstar  wrote:
>
> > I did an install of CakePHP on my local device (Windows XP) with an
> > Apache server.  I did the install to the letter as far as I can tell
> > (removed comment in front of mod_rewrite's load module statement), but
> > I'm getting a welcome page with no layout. And it seems like the whole
> > page isn't even showing up.
>
> > The thing that bugs me the most is that I uploaded the same exact
> > files up to my bluehost account and got the right welcome page.  So
> > it's got to be something with my server setup but I can't figure it
> > out.  Any help would be much appreciated.
>
> > This is all that showed up in the page source:
>
> > Release Notes for CakePHP 1.2.4.8284.
> > https://trac.cakephp.org/wiki/changelog/1.2.x.x";>Read the
> > changelog 
> > 
> >         Your tmp directory is 
> > writable. > p>
> > 
> >         The FileEngine is being used
> > for caching. To change the config edit APP/config/core.php  > p>
> > 
> >         Your database configuration file is
> > present.
--~--~-~--~~~---~--~~
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: Regex validation problem.

2009-09-01 Thread Bryan Paddock
Ah in the end I removed the validation completely... realized that putting
such restrictions on names is not the best idea (eg unicode chinese/jap
names etc)
On Mon, Aug 31, 2009 at 5:14 PM, Dr. Loboto  wrote:

>
> Your function does all right - alphanumeric values only as you did
> nothing with it.
>
> '/^[a-zA-Z0-9_-]+$/'
> >
>

--~--~-~--~~~---~--~~
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: Problem with hasMany

2009-09-01 Thread logislack

hi brian, thanks for reply

I made the changes you mentioned in the models and now the error is
the same but in another line:
Fatal error: Can not access empty property in / sitiotmp/www2/
nuevositio/cake/libs/model/model.php on line 948

I added lines before the 948 and got the "DUMP 1"

After this i add these lines:
if(!isset($this->alias) || empty($this->alias))
{ die('Es $this->alias'); }
if(!isset($model) || empty($model))
{ die('Is $this->{$model} = "'. $model . '" on ' . 
$this->alias); }


I got this response:

Is $this->{$model} = "" on Contenido


see something important?
thanks again.



/*/
DUMP 1
/**die(debug($this->alias)); **/

Grupos_de_contenido

 /die(debug($this->{$model}));/

Contenido Object
(
[name] => Contenido
[primaryKey] => id
[displayField] => titulo
[belongsTo] => Array
(
[Grupos_de_contenido] => Array
(
[className] => Grupos_de_contenido
[foreignKey] => id_grupo_contenido
[conditions] =>
[fields] =>
[order] =>
[counterCache] =>
)

)

[hasOne] => Array
(
[Pagina] => Array
(
[className] => Pagina
[foreignKey] => id_contenido
[conditions] =>
[fields] =>
[order] =>
[dependent] =>
)

)

[useDbConfig] => default
[useTable] => contenidos
[id] =>
[data] => Array
(
)

[table] => contenidos
[_schema] => Array
(
[id] => Array
(
[type] => integer
[null] =>
[default] =>
[length] => 11
[key] => primary
)

[id_grupo_contenido] => Array
(
[type] => integer
[null] => 1
[default] =>
[length] => 11
)

[id_contenido_padre] => Array
(
[type] => integer
[null] => 1
[default] =>
[length] => 11
)

[id_pagina] => Array
(
[type] => integer
[null] => 1
[default] =>
[length] => 11
)

[solo_enlace] => Array
(
[type] => boolean
[null] =>
[default] =>
[length] => 1
)

[titulo] => Array
(
[type] => string
[null] => 1
[default] =>
[length] => 255
)

[imagen] => Array
(
[type] => string
[null] => 1
[default] =>
[length] => 255
)

[url] => Array
(
[type] => string
[null] => 1
[default] =>
[length] => 255
)

[prioridad] => Array
(
[type] => integer
[null] => 1
[default] =>
[length] => 11
)

[publicado] => Array
(
[type] => boolean
[null] => 1
[default] =>
[length] => 1
)

)

[validate] => Array
(
)

[validationErrors] => Array
(
)

[tablePrefix] =>
[alias] => Contenido
[tableToModel] => Array
(
[contenidos] => Contenido
[grupos_de_contenidos] => Grupos_de_contenido
[paginas] => Pagina
)

[logTransactions] =>
[transactional] =>
[cacheQueries] =>
[hasMany] => Array
(
)

[hasAndBelongsToMany] => Array
(
)

[actsAs] =>
[Behaviors] => BehaviorCollection Object
(
[modelName] => Contenido
[_attached] => Array
(
)

[_disabled] => Array
(
)

[__methods] => Array
(
)

[__mappedMethods] => Array
(
)

[_log] =>
)

[whitelist] => Array
(
)

[cacheSources] => 1
[findQuer

Re: Array of input text

2009-09-01 Thread WebbedIT

eh?  why refuse to name the fields using CakePHP's conventions ...
effectively stopping you from using the perfectly good saveAll()
method to save both your Blog and multiple BlogUrl data with full
validation all in one call?  Are you confident that you can write a
better function than the one already in the core?
--~--~-~--~~~---~--~~
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 stop html->link helper adding line breaks

2009-09-01 Thread WebbedIT

brian, you are a class act ... of course I used that little helper,
doh!  Will just have to remove that helper when I put the site into
production I suppose.

Thanks for pointing out what should have been obvious :)
--~--~-~--~~~---~--~~
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: File Uploads: What security-issues I have to take care of?

2009-09-01 Thread the_woodsman

RE The media view - I try and avoid this unless it's a real security
requirement, as it means every request for a simple image requires
CakePHP to handle it, vastly increasing the load on yoru servers, and
the latency for that file.

An alternative is to save each file based on a UUID, or similar - this
means you can serve the image files directly, but it's basically
impossible to guess another user's image UUIDs, meaning it's still
very secure.

(That's my understanding - I'd be interested if anyone disagrees?)


On Aug 31, 7:55 pm, Miles J  wrote:
> Regarding the mimetype, it allows all mimetypes listed in the config
> folder. If you want to restrict the type, use the file validation
> behavior.
>
> For the second part of your question. You would do a normal controller
> action setup like /files/download/1 and then use the media view and
> your own logic to determine the file.
>
> http://book.cakephp.org/view/489/Media-Views
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@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: Welcome Page not finding CSS/Images

2009-09-01 Thread Kornelije Sajler
It is usually in apache/conf/httpd.confprobably you have comment on it
#LoadModule rewrite_module modules/mod_rewrite.so
remove hash # to look like this
LoadModule rewrite_module modules/mod_rewrite.so
and restart server

and now you have rewrite enabled!

Hope it helps,

Kornelije Sajler

On Tue, Sep 1, 2009 at 11:47, jeff  wrote:

> HEY JUST CHECK IN UR SERVER SETTINGS WETHER THE MODE REWRITE IS ENALED OR
> NOT...
>
> YOU CAN FIND IT UNDER PHP SETTINGS OR SOMETHING LIKE THAT.
>
> ENABLE IT .
>
> On Mon, Aug 31, 2009 at 11:16 PM, fatnic...@googlemail.com <
> fatnic...@googlemail.com> wrote:
>
>>
>> Did you make sure you copied over ALL of the files from the Cake
>> download? Even the hidden ones? Sounds like the .htaccess file is
>> missing.
>>
>> On Sep 1, 2:04 am, ajoberstar  wrote:
>> > I did an install of CakePHP on my local device (Windows XP) with an
>> > Apache server.  I did the install to the letter as far as I can tell
>> > (removed comment in front of mod_rewrite's load module statement), but
>> > I'm getting a welcome page with no layout. And it seems like the whole
>> > page isn't even showing up.
>> >
>> > The thing that bugs me the most is that I uploaded the same exact
>> > files up to my bluehost account and got the right welcome page.  So
>> > it's got to be something with my server setup but I can't figure it
>> > out.  Any help would be much appreciated.
>> >
>> > This is all that showed up in the page source:
>> >
>> > Release Notes for CakePHP 1.2.4.8284.
>> > https://trac.cakephp.org/wiki/changelog/1.2.x.x";>Read the
>> > changelog 
>> > 
>> > Your tmp directory is
>> writable.> > p>
>> > 
>> > The FileEngine is being
>> used
>> > for caching. To change the config edit APP/config/core.php > > p>
>> > 
>> > Your database configuration file is
>> > present.
>>
>>
>>
>
>
> --
> --
> (¨`•.•´¨) I may be busy,
> `•.¸(¨`•.•´¨)  but I assure you,
> (¨`•.•´¨)¸.•´ you are always in my heart
> `•.¸.•´
>
>
> With Lots of Love.
>
> THANKS AND REGARDS
>
> Jeffery Jacob
>
>
> >
>

--~--~-~--~~~---~--~~
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: Welcome Page not finding CSS/Images

2009-09-01 Thread jeff
HEY JUST CHECK IN UR SERVER SETTINGS WETHER THE MODE REWRITE IS ENALED OR
NOT...

YOU CAN FIND IT UNDER PHP SETTINGS OR SOMETHING LIKE THAT.

ENABLE IT .

On Mon, Aug 31, 2009 at 11:16 PM, fatnic...@googlemail.com <
fatnic...@googlemail.com> wrote:

>
> Did you make sure you copied over ALL of the files from the Cake
> download? Even the hidden ones? Sounds like the .htaccess file is
> missing.
>
> On Sep 1, 2:04 am, ajoberstar  wrote:
> > I did an install of CakePHP on my local device (Windows XP) with an
> > Apache server.  I did the install to the letter as far as I can tell
> > (removed comment in front of mod_rewrite's load module statement), but
> > I'm getting a welcome page with no layout. And it seems like the whole
> > page isn't even showing up.
> >
> > The thing that bugs me the most is that I uploaded the same exact
> > files up to my bluehost account and got the right welcome page.  So
> > it's got to be something with my server setup but I can't figure it
> > out.  Any help would be much appreciated.
> >
> > This is all that showed up in the page source:
> >
> > Release Notes for CakePHP 1.2.4.8284.
> > https://trac.cakephp.org/wiki/changelog/1.2.x.x";>Read the
> > changelog 
> > 
> > Your tmp directory is
> writable. > p>
> > 
> > The FileEngine is being
> used
> > for caching. To change the config edit APP/config/core.php  > p>
> > 
> > Your database configuration file is
> > present.
>
> >
>


-- 
-- 
(¨`•.•´¨) I may be busy,
`•.¸(¨`•.•´¨)  but I assure you,
(¨`•.•´¨)¸.•´ you are always in my heart
`•.¸.•´


With Lots of Love.

THANKS AND REGARDS

Jeffery Jacob

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



Extend the cache when it has already expired

2009-09-01 Thread powtac

Hi,
I read a feed into a cache. I do have a specific Cache::config() for
this cache var. When the cache var expires I try to fill it again. But
sometimes this "filling" fails. Therefore I want to extend the cache
lifetime with additional 5 minutes before I fill it again, but when
the cache has already expired. So when the "filling" fails 5 minutes
later there will be the next try.
How can I achieve this?
Simon

PS: I played around with Cache::settings() to get the current settings
but this is engine depended, and I have a specific Cache::config().
--~--~-~--~~~---~--~~
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 question

2009-09-01 Thread John Andersen

Hi Dave,

If the field being validated is located in a table, wherein the users
id also is, then you can create a unique index on the combination
(field + user_id) for the table, thus having the database taking care
of the validation.

Enjoy,
   John

On Aug 31, 8:13 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> I need to add a custom validation rule but cant quite figure out how to do
> it.
>
> The field being validated has to be unique specific to the user. So User1
> can use 'foo' , User2 can use 'foo' but each user cannot use 'foo' twice.
>
> What would be the best way to handle something like this?
>
> Dave
--~--~-~--~~~---~--~~
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: Welcome Page not finding CSS/Images

2009-09-01 Thread fatnic...@googlemail.com

Did you make sure you copied over ALL of the files from the Cake
download? Even the hidden ones? Sounds like the .htaccess file is
missing.

On Sep 1, 2:04 am, ajoberstar  wrote:
> I did an install of CakePHP on my local device (Windows XP) with an
> Apache server.  I did the install to the letter as far as I can tell
> (removed comment in front of mod_rewrite's load module statement), but
> I'm getting a welcome page with no layout. And it seems like the whole
> page isn't even showing up.
>
> The thing that bugs me the most is that I uploaded the same exact
> files up to my bluehost account and got the right welcome page.  So
> it's got to be something with my server setup but I can't figure it
> out.  Any help would be much appreciated.
>
> This is all that showed up in the page source:
>
> Release Notes for CakePHP 1.2.4.8284.
> https://trac.cakephp.org/wiki/changelog/1.2.x.x";>Read the
> changelog 
> 
>         Your tmp directory is writable. p>
> 
>         The FileEngine is being used
> for caching. To change the config edit APP/config/core.php  p>
> 
>         Your database configuration file is
> present.

--~--~-~--~~~---~--~~
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: Custom query pagination

2009-09-01 Thread Dr. Loboto

In this case just use plain SQL in paginate() and paginateCount().

On Aug 31, 9:52 pm, Dean C  wrote:
> Hi folks,
>
> I can't use a View for the union query as it requires parameters. Even
> if I take away the fulltext, and then do a fulltext search on the
> view, MySQL can't then delegate the indexes across the union within
> the view, so it doesn't work. Any more ideas or sample pieces of code
> would be appreciated :)
>
> Dean
>
> On Aug 28, 9:09 am, "Dr. Loboto"  wrote:
>
>
>
> > If you can do view for your union query you will be able to work with
> > it as with normal table.
>
> > On Aug 28, 5:58 am, Dean C  wrote:
>
> > > Hi folks,
>
> > > Before I begin, yes I've read this 
> > > page:http://book.cakephp.org/view/249/Custom-Query-Pagination
>
> > > I've also read many of the other pages on Google but I'm still stuck!
>
> > > First of all if I may introduce you to my 
> > > query:http://bin.cakephp.org/view/1064020598
>
> > > It's a union query that allows me to search across two tables and
> > > return the results, ordered by relevance. To put it simply I want to
> > > paginate these results, but I haven't a clue how to do it. I tried,
> > > and failed, over-riding the paginate and paginateCount methods in my
> > > model, but I shan't even begin to post my long list of errors.
>
> > > Where should I start?
>
> > > Thanks!
>
> > > Dean
--~--~-~--~~~---~--~~
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 question

2009-09-01 Thread Dr. Loboto

http://book.cakephp.org/view/152/Adding-your-own-Validation-Methods

On Sep 1, 12:13 am, "Dave Maharaj :: WidePixels.com"
 wrote:
> I need to add a custom validation rule but cant quite figure out how to do
> it.
>
> The field being validated has to be unique specific to the user. So User1
> can use 'foo' , User2 can use 'foo' but each user cannot use 'foo' twice.
>
> What would be the best way to handle something like this?
>
> Dave
--~--~-~--~~~---~--~~
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 + PHP5.3 = ?

2009-09-01 Thread Martin Westin

@Joel
Do you have any insight into the reason for keeping Cake1.2 on PHP
5.2?

At the moment the latest stable CakePHP will not run on the latest
stable PHP. Since this just sound odd I imagine there was a
discussion, reasons weighed for and against, tests done and all that.

I ask since my current course of action has been to patch Cake on my
laptop so it will suppress the "deprecated" warnings. It looks like
everything runs ok but if you know of some real problems
(incompatibilities) that stopped you from going to 5.3, I'd love to
hear about it.


I must also agree with d. The roadmap ahead looks very good and work
seems to progress really fast.
Unfortunately a lot of the time I am working on a released application
and need to stay on 1.2 to be compatible with the production-server.

Oh, and another thing. Should the requirements on the Cookbook be
altered? It shows nothing about the whole 5.2, 5.3 thing.
/Martin


On Aug 31, 11:57 pm, jperras  wrote:
> Coffee, and very understanding girlfriends/boyfriends/husbands/
> wives ;-).
>
> On Aug 31, 12:08 pm, d  wrote:
>
>
>
> > how do you guys find the time? seriously. you people are awesome.
>
> > On Aug 31, 7:19 am, jperras  wrote:
>
> > > Alright guys, it seems like you're all a bit confused.
>
> > > If you only read one line of this entire post, read this: CakePHP 1.3 !
> > > = Cake3
>
> > > Now, while this may seem obvious to many, you guys have made the same
> > > mistake that I've seen a few times on the #cakephp channel. The first
> > > is a branch in the cakephp 1.x project, and the last is a completely
> > > different beast altogether.
>
> > > CakePHP 1.2 supports PHP4 and PHP5.2, inclusively. PHP 5.3 introduced
> > > a few changes to the error handler flags, which we have accounted for
> > > in CakePHP 1.3-dev and will be accounting for in all subsequent
> > > releases.
>
> > > The reason we are not including PHP 5.3 compatibility in CakePHP 1.2.x
> > > is that we want people to move forward to CakePHP 1.3 & up when they
> > > become stable. If you're willing to update the php *language* to a new
> > > point release and not willing to update your application to a new
> > > framework point release, I think you have a slight disconnect. If you
> > > want, you could always apply the patches that we have committed to 1.3-
> > > dev to a local git branch, and continue on your merry way by merging
> > > in upstream changes from 1.2.x into your local branch.
>
> > > CakePHP 1.2.x and 1.3.x are in *the same project*, 
> > > athttp://code.cakephp.org/cakephp
> > > . 1.2 and 1.3-dev are simply different branches.
>
> > > CakePHP 2.0, a *different project*, is *also* being worked on, which
> > > will be PHP 5.2 and up *only*, meaning we're dropping support for
> > > PHP4. Seehttp://code.cakephp.org/cakephp2tofollowalong the
> > > development of this project. The goal of this release is to be a
> > > nearly transparent upgrade for anyone running CakePHP 1.3 stable
> > > (whenever that is released), meaning that the two should be pretty
> > > much 100% API compatible.
>
> > > Finally Cake3 is a *different project*, found 
> > > athttp://code.cakephp.org/cake3.
> > > This is an experimental project which is a complete rewrite of the
> > > CakePHP framework from the ground up, and will *only* support PHP 5.3
> > > and up.
>
> > > I hope this clears up some of the confusion.
> > > -jperras.
>
> > > On Aug 30, 2:45 pm, Miles J  wrote:
>
> > > > Yeah im pretty positive it wont be interchangeable. It uses a whole
> > > > new model setup and also uses namespaces.
>
> > > > The most you can do is interchange between 1.3/2.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: how to add css to individual view.

2009-09-01 Thread ruchika

thanx a lot!!

On Aug 28, 8:07 pm, brian  wrote:
> You can put something like this in your view:
>
> echo $html->css('the_filename_without_extension', 'stylesheet',
> array('media'=>'screen'), false);
>
> http://api.cakephp.org/class/html-helper#method-HtmlHelpercss
>
>
>
> On Fri, Aug 28, 2009 at 8:44 AM,ruchikabatra wrote:
> > hi
> > I am a beginner.i want to add css to the individual view i have
> > created.please help me how to do that.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
-~--~~~~--~~--~--~---