ACL - How to list all grants by ACO and action

2009-03-22 Thread Smelly_Eddie

I understand using ACL to grant, revoke, check, etc on a specific ACO.

My curiosity is how to list all IDs of a particular model I have
access to.

So it there is a user named Fee (ARO). And I grant Fee access to read
the following items (ACOs) Ship, Paper, Milly.


Is there a simple means in the Items Controller Index to return all
items fee has access to? THis way when Fee vies the index he only sees
Ship, Paper and Milly.

I took a look in the API but didn't really see what I was looking for.




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



Some ACL Advice Please - Multiple Group Membership

2009-03-15 Thread Smelly_Eddie

So I have finally broken down in my stubborn ways and agreed to accept
Cake's Acl component. After walking through the manual I believe it
will  make it into all my future sites.

The trouble I am having is to add it to one of my old sites.  I am not
looking for technical advice so much as conceptual.

The example in the Manual uses some or JRR Tolkeins characters to
explain, and that's very well. It applies to real world examples of
people belonging to groups and inheriting properties form those
groups.

** What if people belong to multiple groups?


If your familiar with the Manual's example, how would you make Gandalf
a Warrior, A hobbit, and A visitor, etc.

--

So I guess I need some background on how the Acl component actual does
the queries and logic.

Please take the following example to understand my question.

A large park has many families enjoying picnics.  Each family has a
few members with exclusive access to their picnic baskets. - No
problem

My Family
|- Myself
|- My Brother
L My Sister

Jones Family
|- Timmy
|- Tommy
L Tina (*My Fiancé)



But my fiancé's family is also in the park, and I think she should
have access to my family's picnic basket, and she would like to grant
me access to her family's.


My Family
|- Myself
|- My Brother
|- My Sister
L Tina Jones

Jones Family
|- Timmy
|- Tommy
|- Tina (*My Fiancé)
L Myself

This could be expanded to the point that one person 'belongs' to many
families, and should get the inherent permissions of all those
families.
---

So now the dilemma.. I am sure it is the wrong way to go to add
duplicate ACO's like above. But instead I will have to add explicit
Aco_aro records for myself and tina.

Alternately would it be possible to make the Families ACOs.  So I can
just say that I have access to Tina's family, and she has access to
mine. From that My Family has access to our picnic basket, and by
inheritance so does Tina.

 Can something be an ACO and ARO? Or am I just missing something
really obvious.  I am just wanting to keep things simple as possible.











--~--~-~--~~~---~--~~
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: Validate rule: multiple (CookBook -> 4.1.4.17 Multiple)

2009-02-19 Thread Smelly_Eddie

WebbedIT

I not sure if you have considered using your own validation method for
all checkbox fields.

You can use some simple logic to assess if one of the boxes is check,
and return errors accordingly.

Validation multiple fields with the OR conditon
http://edwardawebb.com/programming/php-programming/cakephp/validating-optional-fields-cakephp-dreaded-scenario

On Feb 18, 9:17 am, WebbedIT  wrote:
> The question I guess I now need answered is why doesn't
> Modell::saveAll validate HABTM data before saving it?
>
> By digging into the core I found that Model::saveAll does not have a
> switch case for hasAndBelongsToMany, but by my limited logical
> reasoning that would mean the data would not get saved either, yet it
> does.
>
> I amended lines #1511 to #1525 to the following which results in my
> HABTM model getting validated as required and my data is being saved
> as expected, but I don't fully follow the code so there's a high
> chance this is not a sensible solution:
>
>   if (isset($associations[$association])) {
>     switch ($associations[$association]) {
>       case 'belongsTo':
>       case 'hasAndBelongsToMany': // added
>         if ($this->__save($this->{$association}, $values, $options)) {
>           $data[$this->alias][$this->{$associations[$association]}
> [$association]['foreignKey']] = $this->{$association}->id; // edited
>         } else {
>           $validationErrors[$association] = 
> $this->{$association}->validationErrors;
>
>           $validates = false;
>         }
>         if (!$options['atomic']) {
>           $return[$association][] = $validates;
>         }
>       break;
>     }
>   }
--~--~-~--~~~---~--~~
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: Alternative Routing for RSS

2009-02-12 Thread Smelly_Eddie

Maestro, I think this article may help you,

Add RSS Feeds to your CakePHP Models;
http://edwardawebb.com/programming/php-programming/cakephp/add-rss-feed-cakephp-models

On Feb 12, 6:32 am, Martin Westin  wrote:
> I am not really an expert on routing, but i'd say that you need to
> specify ext => rss like this:
>
> Router::connect('/presses/rss', array('controller' => 'presses',
>                                      'action' => 'rss_feed',
>                                      'ext' => 'rss'
>                                 ) );
>
> Side note:
> Since your action is called rss_feed I assume that you don't really
> have a "standard" view for it, right? You only really need to mess
> with parse extensions when you want the same action to render in more
> than one way. For example if /presses/index lists all presses and /
> presses/index.rss lists them in an rss feed. Same controller different
> views.
>
> On Feb 12, 3:12 am, maestro777  wrote:
>
> > I'm trying to create an alternative routing for my RSS feed. In my
> > Route config,  I have the following:
>
> > Router::connect('/presses/rss', array('controller' => 'presses',
> >                                      'action' => 'rss_feed',
> >                                      'url' => array('ext' => 'rss')
> >                                 ) );
>
> > I have a  rss_feed action created in the Presses controller.
>
> > I could get to the feed without problem using the url :
> >          http://localhost/mysite/presses/rss_feed.rss
>
> > But when I tried using the alternative route I have an error:
>
> >      Error:  The view for PressesController::rss_feed() was not found.
>
> > Apparently it was looking for the view at ..\mysite\app\views\presses
> > \rss_feed.ctp instead of mysite\app\views\presses\rss\rss_feed.ctp
>
> > I'd appreciate very much if someone should help shed some light on
> > what I am not doing right. I have spent hours trying to figure this
> > thing out without success.
>
> > 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
-~--~~~~--~~--~--~---



Re: Linking three tables?

2009-02-12 Thread Smelly_Eddie

two suggestions with links were posted, please read those.

On Feb 11, 12:37 pm, jtc2  wrote:
> Did you ever find a solution to this? I have a similar situation.
> Looks like your fourth table structure would be correct and I guess
> the table name could be whatever you want it to be though from what
> I've seen in cake conventions and practices (so far), it would be
> something like "employees_employers_ratings" though I'm not sure this
> is best.
>
> Anyone else have any suggestions???
--~--~-~--~~~---~--~~
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: Skipping Validation on Date Fields

2009-02-12 Thread Smelly_Eddie

Hmm

I thought if you left out the field entirely that was the
straightforward fix.

$validate should only mention fields you want to validate

On Feb 11, 5:41 am, overture  wrote:
> I am having issues with validation on date fields.  I need to ignore
> validation for a date field, however, I have tried everything and
> can't find a solution.  I have changed the validation on the model
> to:-
>
> 'actual_start_date' => array(
>   'rule'=>'date',
>   'required' => false,
>   'allowEmpty' => true)
>
> I have also tried omitting this code altogether, but it still doesn't
> work.
>
> Does anyone have any ideas what I'm doing wrong?
--~--~-~--~~~---~--~~
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-11 Thread Smelly_Eddie

I finished a quick mockout of the code for my article. I am still
adding the finishing touches, but you can get the idea.

The one main change I hope to make by the time this gets read is to
handle all the logic upfront, and only once, instead of for each
field.

So here it is.. Validating dependent fields in CakePHP... THe dreaded
OR rule
http://edwardawebb.com/programming/php-programming/cakephp/validating-optional-fields-cakephp-dreaded-scenario

On Feb 11, 11:07 am, WebbedIT  wrote:
> Sounds like a more elegant approach than mine .. look forward to the
> article :)
--~--~-~--~~~---~--~~
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-11 Thread Smelly_Eddie

Henrik:

Seems like a pretty common need doesn't it.  The solution is pretty
simple.

You call the same validation rule for every related field.

$validate=
array(
'field1'=>array('rule'=>'dependentFields'),
'field2'=>array('rule'=>'dependentFields')
)


Then the method

function dependenFields()
{
$return=false;

logic based on fields to do the comparison etc.

// if dependencies pass
$return=true;


//otherwise unique errors
$return="You provided your Company Name, but forgot Phone"

}

and those messages ()if your logic is right) will show only under the
failing boxes.

I will post the full details in an article on my site which is not
quite complete (and I am at work right now :/).  Check back tonight
perhaps.
}

On Feb 10, 4:35 am, WebbedIT  wrote:
> 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: help plz

2009-02-04 Thread Smelly_Eddie

read the manual.

http://book.cakephp.org/

On Feb 3, 12:41 pm, monirr  wrote:
> ok here is my problem i'm new to cake and i bulid every thing ok so i have
> categories and recipes categories has many   recipes , recipes belongs to
> categories  i wanna access recipes by categories
> this for my public website
> what code should i put in order to access it by link and shows the recipes
> in that categories
>
> this is my categories table strucature
> Id
> Name
> Area
> Slug =>this one i made it so it can act as slug
> Active
>
> this my categories "index"
>
> aoptions(array('url' => $this->passedArgs)); ?>
> 
> 
>
> 
>  $i = 0;
> foreach ($categories as $category):
>         $class = null;
>         if ($i++ % 2 == 0) {
>                 $class = ' class="altrow"';
>         }
> ?>
>         >
>
> link(''.$category['Category']['name'].'','/categories/view/'.$category['Category']
>         ['slug'],null,null,false);?>
>
> 
> 
> 
>         prev('<< '.__('previous', true), array(), null,
> array('class'=>'disabled'));?>
>  |      numbers();?>
>         next(__('next', true).' >>', array(), null,
> array('class'=>'disabled'));?>
> 
>
> and this is my "view"
>
> 
>
>                               
>                              
>
> link(''.$category['Category']['name'].'','/recipes/view/'.$category['Category']
>         ['slug'],null,null,false);?>
>
>                                                 
>                 
>
>                  
>
>         
>
>         
>
> 
>   $("#tabpanel > ul").tabs();
> 
>
> and one more thing
> when i click on categories lets say "new" it takes me to the view u know
> then i can see the link
> --
> View this message in 
> context:http://www.nabble.com/help-plz-tp21814971p21814971.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: odd database problem

2009-02-04 Thread Smelly_Eddie

Are you using different prefixes for the tables?

How are you sure you can connect to the DB?

Have you tried turning on debugging?

On Feb 4, 4:24 am, hellfish  wrote:
> I've already done that, several times.
>
> On top of this, the logs show no errors at all.
>
> On Feb 3, 7:21 pm, Braindead  wrote:
>
> > Did you already delete the cached files? I guess this should solve
> > your problem.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To 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: Running bake on a remote server using console

2009-02-02 Thread Smelly_Eddie

First off you would need shell access to your remote server, and can't
call it locally.

If your using CYgwin the commands should be identical, only the paths
will change. But you will need putty or similar if your running
windows locally.

Second, why don't you just replicate your local files and DB to the
remote server?




On Feb 2, 12:30 am, bakerLeo  wrote:
>  I started learning cakePHP just recently and I just completed my
> first project. However, I need some help now that I've started
> deploying it on my remote server. So far I've only worked at home on a
> windows machine. I am not familiar with console commands and have only
> so far used cygwin to run cake's bake commands and schema create db
> command to create ACL tables. However I'm not sure how I would do this
> for my remote server although I'm sure there is a way. I hope someone
> could help me out.
>
> $alias cake="php c:/htdocs/cakesample/cake/console/cake.php"
>
> How would I go about changing this path to point to my remote server?
>
> 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
-~--~~~~--~~--~--~---



Re: Vote for add Cakephp into Netbeans

2009-01-30 Thread Smelly_Eddie

I don't see the big thrill here...

It already supports php I would assume. Which should provide all you
need for debugging cake since it is properly structured classes,
methods etc. It is just a super-sized php application.

So it would seem the only perk is interface design, which I tend to
avoid in IDEs since they usually add alot of extraneous code.

Just my opinion though.



On Jan 29, 11:45 am, Webweave  wrote:
> C'mon people, there are only 84 votes out there - If NetBeans adds
> Cake support I'm guessing not only would it do the cool IDE stuff it
> does now, but we'd be able to debug, and some level of front end for
> baking (like ModelBaker)
>
> On Jan 28, 9:11 am, matt  wrote:
>
> > Great idea! Netbeans is an awesome IDE. I noticed some people went
> > ahead and left comments without actually casting a vote. Make sure to
> > click the "Vote for this issue" link at the bottom of the issue's
> > summary.
>
> > On Jan 27, 9:27 pm, "Diego Caro A."  wrote:
>
> > > Please, vote for cakephp in Netbeans's Framework Support 
> > > inhttp://www.netbeans.org/issues/show_bug.cgi?id=140918
>
> > > Register and vote, please :).
>
> > > --
> > > Diego Caro A.
> > > Estudiante Ing. Civil Informática
>
> > > diegocaro |http://diego.bloog.cl
>
> > > "No tengo talentos especiales, pero sí soy
> > >  profundamente curioso", Albert Einstein.
--~--~-~--~~~---~--~~
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: XAMPP for linux

2009-01-29 Thread Smelly_Eddie

WHy would you install XamPP?

Your taking already running a perfectly decent LAMP box!

XAMPP would never match the tuned performacne you;ll get using the
included binaries.

On Jan 29, 10:59 am, yusuf widi  wrote:
> xampp for linux can be find on apachefriend.com
> but you know that ubuntu cd have already contains php, apache and mysql?
>
> On Thu, Jan 29, 2009 at 8:44 PM, leo  wrote:
>
> > try the xampp or ubuntu websites
>
> > On Jan 29, 12:18 pm, Sergi Pasoev  wrote:
> > > Hi!
>
> > > Plese, tell me where to download XAMPP for Ubuntu AMD 64.
>
> --http://www.wmonou.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: access helper from behavior

2009-01-28 Thread Smelly_Eddie

Helpers are used for the presentation layer. And are ideally only
accessed from the views.

If you want to manipulate data in the behavior than the functionality
should be in a behavior. Why is that not the case, since it sounds
like you only use the tidy functionality before saving, and not before
presentation?

On Jan 27, 9:10 pm, brian  wrote:
> I'm writing a helper that wraps a bunch of libTidy functionality and
> will need to use this from a within a behavior's beforeSave(). I
> thought models could load helpers but see now that this isn't so. Is
> this new? I guess I've never done that before but I was so sure that
> this was the case. Is there some way to call a helper from a behavior?
>
> I could change this helper to be a component, and call it like
> $Model->controller->Tidy->whatever(), but that would mean that all of
> the view usage would then have to go through the controller's
> component. Rock, meet hard place.
>
> btw, I want to call Tidy from the behavior because I really would
> prefer to avoid having to do it in the controller in this specific
> instance. The field that holds the content which will require Tidy
> maintenance may not exist in some circumstances and the behavior takes
> care of deciding what needs to be done on beforeSave(). I want to
> leave the controller completely out of the loop on this as it will
> cause a lot of bloat, given add(), edit(), admin_add(), etc.
--~--~-~--~~~---~--~~
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 Upload Limit?

2009-01-27 Thread Smelly_Eddie

seems like  a waste of a vps

Three people told you to check the php settings.

edit your php.ini to read

upload_max_filesize 16M

or whatever you want the max to be.

You'll also need to adjust


 max_execution_time<- max time the parser will deal with a script

max_input_time   <- max time a script may deal with POST, GET or file
uploads.

since larger uploads will take longer than 30 seconds typically.


On Jan 26, 5:05 pm, Lamonte  wrote:
> yeah I own a vps
>
>
>
> On Mon, Jan 26, 2009 at 3:23 PM, Jon Bennett  wrote:
>
> > > upload_max_filesize2M2M
>
> > there's ya problem then! can't upload a 9mb file if the limit is set
> > at 2M. Do you have permission to change it? if not, looks like a
> > switch of host is required.
>
> > j
>
> > --
>
> > jon bennett
> > w:http://www.jben.net/
> > iChat (AIM): jbendotnet Skype: jon-bennett
>
> --
> For all your Programming and Technology Information Visitwww.BinaryCrunch.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: Auth Component not hashing password

2009-01-27 Thread Smelly_Eddie

Why not validate before hashing the password?  The article below
outlines how to handle validation and comparing two password fields.
Also handles things like unique username and email addresses.

http://edwardawebb.com/programming/php-programming/cakephp/complex-validation-cakephp-12

On Jan 26, 11:52 am, Ivan  wrote:
> Is there any way to get the Auth component to hash the "confirm
> password" input as well? I think that if the password's being hashed
> for security reasons, then it's inconsistent not to be able to set the
> option of hashing some other password type input. (I know it can
> always be hashed with $this->Auth->password(), but I wonder if it
> could be set to have it done "automagically", in cakephp terms).
--~--~-~--~~~---~--~~
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: simple and complete file upload behaviour

2009-01-26 Thread Smelly_Eddie

Daniel Hofstetter has a great article on uploading files to a
database.

If the size of your files is limited(pdfs, docs, etc) this can be a
practical approach because managing them is quite easy.
http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/


I wrote a complementary article thaty outlines the MVC way to serve
the files back out, whether in-line or as dowloads.
http://edwardawebb.com/programming/php-programming/cakephp/serving-files-cakephp



On Jan 25, 4:59 am, fain182  wrote:
> someone knows if there is a file upload behaviour, that manage adding,
> editing and deleting of files in a simple way?
> 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: File Upload Limit?

2009-01-25 Thread Smelly_Eddie

  What exactly is 'dont work out well'?

By default Apache does not limit size, and you would see a 403 or 413
error if that was at fault, but by default does cap script execution
to 300 seconds.

To expand on Jon's comment;
MOre likely is PHP configuration.

To check the limits on php use phpinfo() in a script and check the
output for these values

upload_max_filesize<- max file size

 max_execution_time<- max time the parser will deal with a script

max_input_time   <- max time a script may deal with POST, GET or file
uploads.

post_max_size  <- Sets max size of post data allowed. This setting
also affects file upload.



On Jan 25, 1:51 am, Jon Bennett  wrote:
> > It allows me to upload smaller pdf files with no problem, but huge pdf's
> > dont work out well.  Could this be a server issue or what?  What could I do
> > to try debugging this issue?
>
> What browser/OS are they using? I've had big issues with Safari on OSX
> with uploads timing out and just failing, it's a known bug. In my
> experience anything > 100kb will fail,very annoying, wasted a _long_
> time trying to make my server work! FireFox etc all fine though.
>
> http://www.google.co.uk/search?q=safari%20large%20uploads%20bug
>
> Failing that, check your php config allow uploads at that size and
> have a time limit that won't cut off midway through.
>
> Cheers,
>
> Jon
>
> --
>
> jon bennett
> w:http://www.jben.net/
> iChat (AIM): jbendotnet Skype: jon-bennett
--~--~-~--~~~---~--~~
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: best component to manage login/registration in 1.2?

2009-01-25 Thread Smelly_Eddie

Willie:

I can offer my help with the lost passwords bit. I wrote a simple
ticket system that allows users to enter there email, and receive a
password reset token for 1 use.

http://edwardawebb.com/programming/php-programming/cakephp/reset-lost-passwords-cakephp


You could reuse the basic concept for email confirmations as well.
So if someone registers you generate a ticket, and send it to the
email they included.  They follow the link in the email 'punch' the
ticket and their account can be activated.

You can use a simple boolean field to track active/non-active
accounts.



On Jan 24, 10:22 pm, Miles J  wrote:
> The Auth component takes care of login/logout, session and security
> control, etc.
>
> You would have to manually build the registration and other pages, but
> its relatively simple.
>
> On Jan 24, 1:52 pm, WillieBHines  wrote:
>
> > Many applications I build require a way for users to register, log in,
> > find forgotten passwords -- and often have their initial registration
> > validated via email.
>
> > Any existing solutions out there? I've read mentions of things like
> > obAuth -- is that the way to go?
>
> > 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: Create html files dynamically

2009-01-23 Thread Smelly_Eddie

Sumesh

Would you like us to code the app for your client, or did you have a
specific problem you needed a push with?

Are you referring to the routing, or page content?

Why are you charging clients to learn new software?



On Jan 22, 12:25 am, Sumesh G  wrote:
> hi
>
> i am new in cakephp, please help me to solve this problem
>
> my client wants to create html pages dynamically from the content they
> submitted through admin section
>
> For example;-
>  if they add a job through admin section like ;- Software division  -
> Application programming -php
>
> we have to create an html file as software/ Application programming/
> php/ jobId.html
>
> 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: Clarification about HABTM models

2009-01-23 Thread Smelly_Eddie

Is it being ignored, or is the following methods that generate the
view just creating a new page so the echo statement is never seen?

Try adding a exit; or die(); statement to be sure.

On Jan 22, 10:43 am, Ernesto  wrote:
> Hello
>
> i'm having some troubles with an HABTM relationship.
>
> the following code isn't my real app, just a simplified version.
>
> my app has 3 models
> - Customer
> - Phone_Number
> - Customer_PhoneNumber
>
> in "Customer" model i defined the HABTM relationship:
>
> class Customer extends AppModel {
>
>         var $hasAndBelongsToMany = array(
>                 "PhoneNumbers" => array(
>                         "className" => "PhoneNumber",
>                         "with" => "Customer_PhoneNumber",
>                         "foreignKey" => "customer_id",
>                         "associationForeignKey" => "phonenumber_id"
>                 )
>         );
>
> }
>
> and in "Customer_Order" model i'm using the afterFind method:
>
> class PhoneNumber extends AppModel {
>
>         //uncomment the following string to generate an error, demonstrating
> that the model is called
>         //var $useTable = "sometable";
>
>         function afterFind($results, $primary = false) {
>                 echo "Hello!! i'm the afterFind method";
>                 print_r($results);
>                 return $results;
>         }
>
> }
>
> Relationship is working correctly (data is loaded, and no errors are
> returned) but...
>
> the afterFind() function in Customer_PhoneNumber seems to be ignored.
--~--~-~--~~~---~--~~
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: validate 'minLength' for 'password' field

2009-01-22 Thread Smelly_Eddie

Adam

I created an article for full Validation of User Models.

It includes the methods to validate username , email,  require special
characters, length and matching passwords passwords. It also takes
care to ensure that emails and usernames are unique.

It also has some logic to ignore these fields on login pages, which is
another common question I see around here.

http://edwardawebb.com/programming/php-programming/cakephp/complex-validation-cakephp-12

hth - Eddie


On Jan 21, 4:14 pm, aranworld  wrote:
> Yes, you can do this.
>
> In my User model, I have a series of validation rules for a field
> called "new_passwd".
>
> After this field is validated for things like minimum length I then
> have it hashed into the string that gets stored in the database.
>
> Here is a bakery article that can show how to do some validation on a
> field that does not reflect a database column:
>
> http://bakery.cakephp.org/articles/view/using-equalto-validation-to-c...
>
> On Jan 21, 8:21 am, adam  wrote:
>
> > New question:
>
> > Can you add validate data in your model that is absent from your
> > database?  So if I try to solve this problem by creating a form field
> > called password_confirm, would I be able to validate it in my model
> > even though there isn't a corresponding spot in the database?
>
> > On Jan 21, 10:08 am, adam  wrote:
>
> > > I just searched the group, so nevermind this post.
>
> > > On Jan 21, 9:49 am, adam  wrote:
>
> > > > Could someone explain to me how to validate a 'password' field for
> > > > 'minLength'?  I'm presuming that it is hashing the password before
> > > > validating 'minLength'.  There must be some means to get around this.
>
> > > > Thanks in advance,
> > > > Adam
--~--~-~--~~~---~--~~
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 force www. to always be in my domain name?

2009-01-21 Thread Smelly_Eddie

In my opinion you should be doing just the opposite.

WWW was used when computers needed the sub.domain to be aware of what
type of content they were about to receive.

Since web-pages today are becoming RIA and browsers are so robust the
need is deprecated, and I and may others argue that www should be
deprecated to.

Users that visit any of my domains using the www prefix will be
rerouted to the top domain, without the prefix.  Google allows
webmasters to specify this as well so it will only crawl and show my
pages as top-domain.org.





An interesting site that takes my side;
http://no-www.org/

On Jan 21, 2:30 am, Jon Bennett  wrote:
> Hi Parris,
>
> >  > 
> >  >    RewriteEngine on
> >  >         RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
> >  >         RewriteCond %{HTTPS}s ^on(s)|off
> >  >         RewriteRule ^(.*)$ http%1://www.domain.com/$1[R=301,QSA,L]
>
> >  >         RewriteRule    ^$ app/webroot/    [L]
> >  >         RewriteRule    (.*) app/webroot/$1 [L]
> >  > 
>
> I need to accomplish something similar, I don't need to worry about
> SSL, but I do have 3 domains, so far I have:
>
> RewriteCond %{HTTP_HOST} !^www.domain1.co.uk$[NC]
> RewriteCond %{HTTP_HOST} !^www.domain2.co.uk$[NC]
> RewriteRule ^(.*)$http://www.maindomain.co.uk/$1[R=301,QSA,L]
>
> RewriteRule    ^$ app/webroot/    [L]
> RewriteRule    (.*) app/webroot/$1 [L]
>
> but this isn't doing anything, except the normal cake rewrite, any ideas?
>
> Cheers,
>
> Jon
>
> --
>
> jon bennett
> w:http://www.jben.net/
> iChat (AIM): jbendotnet Skype: jon-bennett
--~--~-~--~~~---~--~~
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: 'default' option of checkbox does not work :(

2009-01-19 Thread Smelly_Eddie

checked => 1

On Jan 19, 1:05 am, kizuki  wrote:
> After looking deeply at the source code in helper.php and form.php, I
> understood that the form helper is not designed to accept the
> 'default' value for checkboxes and radio buttons. (I also understood
> that my code change 2 above was not correct.)
>
> When I pass 'default' value to $form->input() method, it can only set
> the default value to the  tag, not for the value of the field.
> For the inputs which type is something like "text", it sets the
> "value" of the field, but for those which type is "checkbox" and
> "radio", the "default" value sets the value that is passed when it's
> checked, not the value of the field.
>
> I still think that the form helper should support default value for
> checkboxes and radio buttons, but it seems that it requires quite a
> few code changes. :(
>
> Looks like we have to write a code to switch the default "checked"
> state by ourselves for now.
>
> Kizuki
--~--~-~--~~~---~--~~
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 problems

2009-01-15 Thread Smelly_Eddie

Try adding
 RewriteBase /

just after
RewriteEngine On

in your htaccess files.

When I was on godaddy i found this to be a requirement to get things
working.

On Jan 14, 4:14 pm, neridaj  wrote:
> Hello,
>
> I've edited my httpd.conf file as instructed and can't get mod_rewrite
> working. Any suggestions?
>
> /etc/httpd/httpd.conf:
>
> LoadModule rewrite_module     libexec/httpd/mod_rewrite.so
>
> DocumentRoot "/Library/WebServer/Documents"
>
> 
>
> #
> # This may also be "None", "All", or any combination of "Indexes",
> # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
> #
> # Note that "MultiViews" must be named *explicitly* --- "Options All"
> # doesn't give it to you.
> #
>     Options Indexes FollowSymLinks MultiViews
>
> #
> # This controls which options the .htaccess files in directories can
> # override. Can also be "All", or any combination of "Options",
> "FileInfo",
> # "AuthConfig", and "Limit"
> #
>     AllowOverride All
>
> #
> # Controls who can get stuff from this server.
> #
>     Order allow,deny
>     Allow from all
> 
>
> Thanks,
>
> Jason
--~--~-~--~~~---~--~~
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: Bake scripts without shell access

2009-01-15 Thread Smelly_Eddie

Check out dreamhost. Shared hosting keep costs down and you get full
shell access.

But yes, I would recommend baking locally and uploading.

You can even limit the edits you need to make by customizing your
database config file a bit.

http://edwardawebb.com/programming/php-programming/cakephp/automatically-choose-database-connections-cakephp

Also if you have the domain url pointing to webroot you shouldn't need
to edit .htaccess unless your webhost is doing something obscure.

On Jan 15, 9:39 am, mark_story  wrote:
> Most non-shared hosting companies do provide a shell.  You can
> sometimes get a Java client with applications like cPanel or Plesk as
> well.  If you are just running bake and such most people will run that
> locally.  If you write shells that you need to run remotely like
> maintenance scripts etc.  Then you might want to consider moving to
> different host.
>
> -Mark
>
> On Jan 14, 2:06 pm, Bob Albert  wrote:
>
> > I'm new to this group and CakePHP so please excuse these questions if  
> > they've been covered on the list. I have been working through David  
> > Golding's "Beginning CakePHP" book from Apress. I just got through the  
> > chapter were he describes the Bake scripts.
>
> > My question is how others use this in the real world given that most  
> > hosting companies don't allow shell access. Do most use these scripts  
> > in a dev environment such as a local box to build out the application  
> > and then just move the files to the prod environment when done, thus  
> > shell is not needed cuz all the bake scripts are done in Dev?
>
> > Also it looks like there might be some tools for Bake that one can  
> > install on these hosting companies that allow you to use Bake scripts  
> > via the browser like webbaker?
>
> > Thanks,
> > Bob
--~--~-~--~~~---~--~~
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: Where to validate multiple fields?

2009-01-15 Thread Smelly_Eddie

You can create a custom function and use it in the $validate
parameter.

Have a look at this article to get an idea of how that would work in
your case. (The compare passwords option)

http://edwardawebb.com/programming/php-programming/cakephp/complex-validation-cakephp-12

On Jan 14, 11:44 am, fly2279  wrote:
> I am creating an app that's similar to a punch clock in the way that
> it functions. The user enters a start and stop datetime and I need to
> do some validations. I need to check that there is not a previously
> entered "time block" in the database that conflicts with the data
> being entered. No two time blocks may overlap and I have additional
> rules also regarding how much time there needs to be in between two
> blocks.
>
> I considered running a custom validation function on the 'start' field
> but I need to make sure that there is no time block overlapping the
> time period from 'start' to 'end'. I'm not sure how to go about this.
>
> Since it needs to check two fields (start and end) against the
> database should I run a function in beforeValidate() instead of in
> validate? Then should I validate the normal stuff such as date/time/
> alphanumeric etc. in the validate portion of the model? What's the
> "best practice" way of doing it?
>
> Here is a picture of what I'm trying to do.http://kenfrey.net/block.png
--~--~-~--~~~---~--~~
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: swiftmailer wont send

2009-01-14 Thread Smelly_Eddie

WOW

Knock it off.

Posting duplicate threads and repeated messages will not get you help
any faster.


On Jan 13, 3:22 am, ksalling  wrote:
> I am using this:
>
> $this->Swiftmailer->smtpType = 'tls';
> $this->Swiftmailer->smtpHost = 'smtp.gmail.com';
> $this->Swiftmailer->smtpPort = 465;
> $this->Swiftmailer->smtpUsername = 'u...@riverstarcincy.com';
> $this->Swiftmailer->smtpPassword = 'pass';
> $this->SwiftMailer->from = 't...@test.com';
> $this->SwiftMailer->fromName = 'Riverstar';
> $this->SwiftMailer->to = array('u...@riverstarcincy.com'=>'Kyle',
>                                         'u...@gmail.com'=>'kyle');
> $this->SwiftMailer->layout = 'test';
>
> if (!$this->SwiftMailer->send('register', 'Test')) {
>         $this->log('Error sending mail', LOG_ERROR);
>
> }
>
> dont know why this works on my local machine and not the webserver. If
> it sends to the riverstarcincy.com address through the smtp on my
> machine then it stands to reason it should do the same on my webserver
> right?
>
> -K
>
> On Jan 13, 1:58 am, brian  wrote:
>
> > Does the sendFrom header happen to contain "x...@riverstarcincy.com"? I
> > ask because gMail doesn't display mails from myself to, for instance,
> > this group. It's the source of some n00b frustration--myself
> > included--in that one's first message (likely written in a cold sweat)
> > doesn't appear to make it up.
>
> > Anyway, I'm wondering if google's just trying to be "efficient". Have
> > a look at your gApps POP/IMAP settings.
>
> > On Tue, Jan 13, 2009 at 1:26 AM, ksalling  wrote:
>
> > > I am running swiftmailer for php5 and the updated swiftmailer
> > > component for cake. I am running this on my local  machine using xampp
> > > and everything works fine sending out an email to two recipients.
> > > x...@gmail.com and x...@riverstarcincy.com when I upload the controllers
> > > etc up to the web serverwww.riverstarcincy.comitsends fine to the
> > > x...@gmail.com but will not send to x...@riverstarcincy.com it does not
> > > give any error messages with cake in debug mode nor does it leave
> > > anything in the cake logs located in the tmp folder. My
> > > riverstarcincy.com mail is being hosted by Google apps and I am using
> > > the associated smtp server through Google to send this mail. I do not
> > > understand why the smtp is sending the mail when I am on my local
> > > machine and not when I have the page located on the riverstarcincy.com
> > > server. Please help I have been at this problem for a day and cannot
> > > figure it out.
>
> > > 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: quick table functions

2009-01-14 Thread Smelly_Eddie

I think in the same amount of time you could have searched the cake
manual on any one of those keywords and found your answer.

Don't be lazy.

On Jan 13, 7:38 am, forrestgump  wrote:
> Hey,
> Does anyone know how to sort a table based on any collumn a user has
> selected and also paginate that table. I did it once before, im in a
> bit of a hurry so i cant look right now.
>
> Thanks,
> Forrestgump
--~--~-~--~~~---~--~~
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 display image in your view from database

2009-01-13 Thread Smelly_Eddie

I wrote a straight forward article on retrieveing images from a db for
inline use and as downloads.

http://edwardawebb.com/programming/php-programming/cakephp/serving-files-cakephp

I think youll find it answers your questions.  please comment if you
have any feedback (positive or negative)

On Jan 12, 10:00 am, Martin Westin  wrote:
> Hi mona,
> It is not too hard to display "dynamic" images, protected images or in
> your case database-stored images.
>
> You need two parts for this puzzle.
>
> 1: Your controller needs a new method called "image" or something like
> it.
> This method will pretty much be a copy of your view method.
> This method (it's view) needs to output a binary image.
> You gan get fancy with MediaView and things like that but start by
> setting some headers and just ehoing out the image data.
>
> You shouldn't need all these but these are the headers I send for
> dynamic images... seems to work the best in all browsers with all
> these.
> header("Pragma: public");
> header("Expires: 0");
> header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
> header("Cache-Control: public", false);
> header("Content-Type: $filetype");
> header("Accept-Ranges: bytes");
> header("Content-Disposition: inline;");
> header("Content-Transfer-Encoding: binary");
> header("Content-Length: " .$filesize);
>
> 2: Your current view needs to point to the method above for the
> relevant image tag. Some browsers seem to almost require an extension
> on an image so you may want to add it in the view and parse it out in
> the controller even if you don't use "parseExtensions".
>
> http://app.site/entries/image/23http://app.site/entries/image/23.jpg
>
> or if you get really fancy and use 
> parseExtensionshttp://app.site/entries/view/23.jpg
>
> On Jan 12, 3:14 pm, mona  wrote:
>
> > i m storing images in database and i wan't to display images in my
> > view how to do this in cake php
>
> > my controller code is
> >  > class EntriesController extends AppController
> >  {
> >         var $name = 'Entries';
> >     var $helpers = array('Html','Form','Javascript','Ajax');
> >         //var $uses=array('Entry','User');
> >     var $components = array('RequestHandler');
> >         function index(){
> >         //$count = $this->Entry->find('all', array('fields' => array('(max
> > (Entry.counter)) as max_counter')));
> >     $query=mysql_query("select max(counter) from entries");
> >     $row=mysql_fetch_array($query);
> >         $count=$row[0];
> >         $this->set('count',$count);
> >         $name=$this->Session->read('User');
> >         $query1=mysql_query("select id from users where username='$name'");
> >     $row1=mysql_fetch_array($query1);
> >         $user_id=$row1[0];
> >         $this->set('user_id',$user_id);
> >         $this->Entry->recursive = 1;
> >         $this->set('entries', $this->Entry->findAll(null, null, array
> > ('Section.id' => 'ASC','Submenu.submenu' => 'ASC')));
> >     }
>
> >          function view($id = null){
> >          if (!$id){
> >          $this->Session->setFlash('Invalid id for Entry.');
> >          $this->redirect('/entries/index');
> >          }
> >          $this->set('entry', $this->Entry->read(null, $id));
> >          }
>
> >     function add(){
> >     $this->set('sections', $this->Entry->Section->find('list',array
> > ('fields'=>'Section.section','Section.id')));
> >         if (!empty($this->data) &&
> >              is_uploaded_file($this->data['Entry']['File']
> > ['tmp_name']))
> >                 {
> >                 $fileData = fread(fopen($this->data['Entry']['File']
> > ['tmp_name'], "r"),
> >                                      $this->data['Entry']['File']
> > ['size']);
> >             $this->data['Entry']['name'] = $this->data['Entry']['File']
> > ['name'];
> >             $this->data['Entry']['type'] = $this->data['Entry']['File']
> > ['type'];
> >             $this->data['Entry']['size'] = $this->data['Entry']['File']
> > ['size'];
> >             $this->data['Entry']['data'] = $fileData;
> >                                 if ($this->Entry->save($this->data)){
> >                                 $id=mysql_insert_id();
> >                                 $query=mysql_query("select max(counter) 
> > from entries");
> >                                 $row=mysql_fetch_array($query);
> >                                 $co=$row[0]+1;
> >                                 $q=mysql_query("update entries set 
> > counter=$co where id=$id");
> >                                 $this->Session->setFlash('The Entry has 
> > been saved');
> >                                 $this->redirect('/entries/index');
> >                 }
> >         else{
> >         $this->Session->setFlash('Please correct errors below.');
> >         $this->redirect('/entries/add');
> >         }
> >     }
> >         }
>
> > }?>
>
> > images are storing in database but how to display it i don't know
> > my view code
> >  > style="background-color:#ee;">
> > Welcome re

Re: HABTM retrieving help

2009-01-04 Thread Smelly_Eddie

You would read the Cake Manual section on pagination which answers all
your questions.
http://book.cakephp.org/view/164/pagination

On Jan 3, 10:30 pm, gearvOsh  wrote:
> Heres my tables and relations:
>
> Team
> Team->belongsTo: Country, State
> Team->hasAndBelongsToMany: User (the players on a team, table =
> teams_players)
>
> Team:
> CREATE TABLE IF NOT EXISTS `teams` (
>   `id` int(10) NOT NULL auto_increment,
>   `status` enum('approved','pending') NOT NULL default 'pending',
>   `name` varchar(50) NOT NULL,
>   `tag` varchar(10) NOT NULL,
>   `urlName` varchar(30) NOT NULL,
>   `website` varchar(50) NOT NULL,
>   `irc` varchar(20) NOT NULL,
>   `about` varchar(255) NOT NULL,
>   `servers` varchar(100) NOT NULL,
>   `logo` varchar(100) NOT NULL,
>   `createDate` int(10) unsigned NOT NULL default '0',
>   `state_id` int(10) unsigned NOT NULL default '0',
>   `country_id` int(10) unsigned NOT NULL default '0',
>   `created` datetime default NULL,
>   `modified` datetime default NULL,
>   PRIMARY KEY  (`id`),
>   KEY `state_id` (`state_id`),
>   KEY `country_id` (`country_id`)
> )
>
> TeamsPlayer
> CREATE TABLE IF NOT EXISTS `teams_players` (
>   `id` int(11) NOT NULL auto_increment,
>   `team_id` int(10) unsigned NOT NULL,
>   `user_id` int(10) unsigned NOT NULL,
>   `role` enum('leader','captain','member') NOT NULL default 'member',
>   `status` enum('approved','pending') NOT NULL default 'pending',
>   `joinDate` int(10) NOT NULL,
>   PRIMARY KEY  (`id`),
>   KEY `team_id` (`team_id`),
>   KEY `user_id` (`user_id`)
> )
>
> Ok if I do a basic Team->find() all the data is returned correctly.
>
> Now the problem im running into is how do I grab all teams that I am
> part of, and paginate it at the same time? Since the user_id values is
> in TeamsPlayer, im getting confused on this. Any help would be
> appreciated.
--~--~-~--~~~---~--~~
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: setting up cake bake console

2009-01-04 Thread Smelly_Eddie

Call the script from the parent directory of the Cake App and don't
specify app name.

eg in cake  # ./cake/console/cake bake

On Jan 4, 3:59 am, gemmes  wrote:
> Hi All,
>
> Im trying to bake some apps from the console.
> Can someone please help me solve the problems Im having?
>
> I ran this in Mac OS X Terminal: cake bake mynewapp
>
> Errors:
> 1. App: myusername Wrong too. believe it should show mynewapp not
> myusername, same for path
> 2. Will be copied to: /Users/myusername/mynewapp This is wrong should
> be copied to /Users/myusername/Sites/mynewapp
> 3. Error: /Users/myusername/config/ not found  I dont know why I
> receive this error
> 4. Localhost says: Your database configuration file is NOT present.
> Rename config/database.php.default to config/database.php I bake
> console should handle this, not going to handcode the file.
>
> The output(selected):
>
> Welcome to CakePHP v1.2.0.7962 Console
> App : myusername                         // I believe this should be
> mynewapp not OS myusername
> Path: /Users/myusername              // same here
>
> Bake Project
> Skel Directory: /Users/myusername/Sites/_cake/cake/console/libs/
> templates/skel
> Will be copied to: /Users/myusername/mynewapp
>
> Look okay? (y/n/q)
> [y] > n
> What is the full path for this app including the app directory name?
> Example: /Users/myusername/mynewapp/myapp
> [/Users/myusername/mynewapp/myapp] > /Users/myusername/Sites/mynewapp
> Bake Project
> Skel Directory: /Users/sg/Sites/_cake/cake/console/libs/templates/skel
> Will be copied to: /Users/myusername/Sites/mynewapp
> ---
> Look okay? (y/n/q)
> [y] > y
>
> Creating file /Users/myusername/Sites/invoicr/views/pages/home.ctp
> Wrote /Users/myusername/Sites/invoicr/views/pages/home.ctp
> Welcome page created
> Random hash key created for 'Security.salt'
> CAKE_CORE_INCLUDE_PATH set to /Users/myusername/Sites/_cake in webroot/
> index.php
> CAKE_CORE_INCLUDE_PATH set to /Users/myusername/Sites/_cake in webroot/
> test.php
> Remember to check these value after moving to production server
>
> Your database configuration was not found. Take a moment to create
> one.
> ---
> The following database configuration will be created:
> ---
> Name:         default
> Driver:       mysql
> Persistent:   false
> Host:         localhost
> User:         mynewapp
> Pass:         ***
> Database:     mynewapp
> ---
> Look okay? (y/n)
> [y] > y
> Do you wish to add another database configuration?
> [n] >
> Error: /Users/myusername/config/ not found    // I dont know why I
> receive this error?
> sg:~ sg$
>
> pls help
>
> gemmes
--~--~-~--~~~---~--~~
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 content from another content type into a "static" page

2009-01-04 Thread Smelly_Eddie

Rick:

I think you want to look into elements.

You can create an action in your articles  controller like
"loadArticleSnippet($id)"

You can then call that action from an element that is coded into your
homepage.

http://book.cakephp.org/view/97/Elements

On Jan 4, 5:54 am, Rick Hurst  wrote:
> Hi All,
>
> A newbie question, which i'm sure is incredibly simple!
>
> I've downloaded 1.2 and taken a simple static web site and ported it
> to cake, by using the provided PagesController and a view for each
> static page. I've also created a new Model "Articles", for which i've
> set up a model, view and controller and can populate content using
> scaffolding.
>
> I want to include snippets of content from a couple of articles on my
> homepage - this doesn't currently have a controller, it's just static
> content in /app/views/pages/home.ctp. I'd like to keep the rest of the
> static content in home.ctp
>
> How do I go about loading a couple of specific articles, so I can
> render article content in /app/views/pages/home.ctp?
--~--~-~--~~~---~--~~
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 errors for the wrong form

2009-01-04 Thread Smelly_Eddie

Maria:

You can simply limit validation to only occur if fields are present.

For example, a register page might have two password fields to
compare, while a login will only have one.

A register page might have email, or address while a login will not.

The article below explains how to perform such validation and is based
on a User model. it also includes tips on how to validate user names
and passwords for better security.

http://edwardawebb.com/programming/php-programming/cakephp/complex-validation-cakephp-12

On Jan 3, 7:29 am, "mariacheu...@gmail.com" 
wrote:
> They are both different forms, the register form is from a view and
> the login is part of a sidebar element. Both forms have different
> names too.
>
> Thanks for your reply!
>
> On Jan 3, 6:21 pm, Nature Lover  wrote:
>
> > Hi!
>
> > Are the forms for both login and register differ.
> > or you have included the login element within the registration form?
>
> > thanks!
>
> > On Jan 1, 9:33 am, "mariacheu...@gmail.com" 
> > wrote:
>
> > > Hi all,
> > > Apologies if this has been addressed before, but I've searched and
> > > can't find a thing.
>
> > > I have a register page, with a login element in the sidebar. The login
> > > element is on every page in the sidebar. When I try register with
> > > invalid data, the correct validation errors show for the register
> > > form. However, the errors are also showing on the login form, even
> > > though that hasn't been submitted. The login form is using jQuery Ajax
> > > to submit.
>
> > > Any ideas anyone?
>
> > > 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: without "default" Database Configuration: Fatal error: ConnectionManager::getDataSource - Non-existent data source default

2009-01-03 Thread Smelly_Eddie

Sounds like you want to use multiple configurations based on the
location of the app (live versus dev)

There are a few ways to solve this. I wrote an article outlining my
preferred method.

You should read through the user comments as they add some helpful
insight, including how to use this method while still allowing the
bake commands to work.

http://edwardawebb.com/programming/php-programming/cakephp/automatically-choose-database-connections-cakephp

On Jan 2, 11:48 am, james revillini  wrote:
> I'm debating whether or not this is a bug.  What do you think:
>
> If I use the bake script and create a database conf called "local",
> then run it again and create one called "live", then start trying to
> build models, it will fail with this error message:
>
> Fatal error: ConnectionManager::getDataSource - Non-existent data
> source default in C:\tmp\1.2.x.x\cake\libs\model
> \connection_manager.php on line 109
>
> The exact step of model building that it will fail on is right after
> you answer the question about adding validation criteria for the model
> fields.  I'm guessing cake is hard coded to use "default" somewhere,
> but I think it's a bug since it did ask me which db config to use and
> I told it to use the "local" one at the outset of running the bake
> script.
>
> Incidentally, the work around is to create a db config for default,
> and make sure it points to the database that has the correct structure
> for your bake.  Another option is to turn it into a drinking game,
> where you need to chug every time you get a fatal error, and
> eventually the situation will smooth itself out.
>
> Thanks,
> Jim
--~--~-~--~~~---~--~~
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: Migrating PHP website from Windows to Linux or between Linux distributions

2009-01-02 Thread Smelly_Eddie

Aus

The platform shouldnt matter in terms of design so Long as your not
using any proprietary formats like frontpage extensions or asp.

If you application is PHP, HTML and CSS then your only concern should
be the browsers your visitors will use.


If your not using Mysql, what backend are you using for CakePHP?  If
your using something else than there will be some minor configuration
changes but Cake's DBO layer should handle the difference among
various databases.

On Jan 2, 5:55 am, Aus  wrote:
> Thanks alot, very informative,
>
> to be more specific, if i want  to do the webdesign with dreamweaver
> and do some coding also on my windows box,
> from your explaination, it should be possible to migrate the website
> to the LAMPS box later, if the libraries are ok, right?
>
> my consern is about graphics and design, is it ok to send over
> platfroms?
> thanks alot!
>
> On Jan 2, 10:50 am, WebbedIT  wrote:
>
> > This should not be an issue at all, just keep an eye out for case
> > sensitive filenames when swtiching between *nix and windows.  Most
> > developers use local environments and benefit from faster development
> > times by not having to upload files to test edits every time.
>
> > I run my own hosting company so develop live on my servers using
> > temporary dev domains, but used to develop locally and I am thinking
> > about setting up a local web server as I have a few lying around.
>
> > Are you likely to be working on one or multiple projects?  If just one
> > then I would suggest you try and setup your local environment to match
> > your production environment as closely as possible.
>
> > If you are working on multiple projects and the production sites will
> > be uploaded to various client hosting environments, this is never
> > going to be possible, just try to work with as standard a
> > configuration as possible (i.e. dont rely on libraries that clients
> > may not have available with their hosting solutions).
--~--~-~--~~~---~--~~
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: Conditional find on recursive belongsTo association

2009-01-01 Thread Smelly_Eddie

Hit it form the middle model.

IE paginate on the person model and you can view orgs and staff, thus
allowing you to view staff by org.

If that doesnt work for you then you might have other issues.

On Dec 31 2008, 5:16 am, WebbedIT  wrote:
> Bump ... really need some help with 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: form action url

2008-12-31 Thread Smelly_Eddie

$form->create('User', array
('controller'=>'users','action'=>'login'));

On Dec 30, 1:23 pm, jejk  wrote:
> I guess it s  a trouble with $base in dispatcher.php but I don't see
> how to tune that.
--~--~-~--~~~---~--~~
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: Email component — problems sending to same domain

2008-12-31 Thread Smelly_Eddie

smtp should be the default. It is the de facto standard for internet
transfer of email (simple mail transfer protocol)

mail is a 'nix based system of mails that are usually handled
internally or within a lan.   I don't think that switching to mail
would help as the email would never reach your mail client. it would
just sit in the mail file waiting for you to login to the server.

This sounds like something you'll need to adress the host on.

Just curious what host are you using?



On Dec 30, 11:08 am, RyOnLife  wrote:
> Hello, I am using the Email component and have the 'to' address set like
> this:
>
> $this->Email->to = 'm...@mydomain.com';
>
> If mydomain.com is a domain hosted on my server, the email never arrives,
> but it works just fine when I change to:
>
> $this->Email->to = 'm...@gmail.com';
>
> I assume this is a server setup issue—and not a Cake one—so I plan to talk
> to my host. Looking at the email.php component in the Cake core, seems that
> $this->delivery can either be 'smtp' or 'mail'. Is smtp the default? If the
> delivery method is 'mail', what mail sending service does that refer to?
>
> Thanks!
> --
> View this message in 
> context:http://n2.nabble.com/Email-component-%E2%80%94%C2%A0problems-sending-...
> 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: Is it possible to use helper in model?

2008-12-31 Thread Smelly_Eddie

Your missing the purpose of helpers.

They are meant to manipulate data as it is presented to users within a
view. (show nice dates, currency, trees, etc.)

Within a model you should just handle the data in its current form and
validate against that.

What would you use the number helper for in validation?



On Dec 30, 5:01 am, Hipnotik  wrote:
> Hi
> Is it possible to use helper (in example number helper) in model?
> I would like to use it in example in beforeValidate method.
>
> 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: Freelancer seeking CakePHP jobs

2008-12-28 Thread Smelly_Eddie

Please do not post employment related posts.  This group is for
support and information sharing, not to get you a job.

There are numerous sites dedicated to Web Dev jobs and such.



On Dec 27, 3:09 pm, "3lancer.eu"  wrote:
> Hi,
>
> I am seeking (remote) employment in CakePHP, preferably around 25
> hours a week. I can offer several years of PHP expertise + reliable
> and up-to-date knowlegde of CakePHP. I will be very glad to send over
> my Resume/CV.
>
> My porfolio can be found at:http://3lancer.eu
>
> Regards,
> Piotr
--~--~-~--~~~---~--~~
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 uploading in cake php

2008-12-28 Thread Smelly_Eddie

Google

"upload files with CakePHP"

On Dec 27, 8:59 am, mona  wrote:
> Hello mike
> sorry for distutbing you once again. I am sending you my file
> uploading problem please i need your help if you help me it will be
> great help for me
> this is my add view code please consider it
> New Entry
> create('Entry',array('action' => 'add','type' =>
> 'file'));?>
> 
>     input('Section', array('options' => array
> ('Announcements','The Venue','About Melbourne')),array('error' =>
> 'false','value' => array(1,2,3) )); ?>
> 
> 
>         input('Submenu', array('options' => array
> (1,2,3,4,5)),array('error' => false,'label' => 'Submenu')); ?>
> 
> 
> input('Listitem',array('label' => 'Listitem'),array
> ('error' => false));?>
> 
> 
> input('Detail',array('label' => 'Detail'),array
> ('error' => false));?>
> 
> 
> file('File'); ?>
> 
> 
>         submit('Add');?>
> 
> 
> 
> link('Home', '/entries/index')?>
> 
>
> from this form i wan't to upload file when I click on submit button
> where to write file upload code please correct my code
> this is my controller  code
>  class EntriesController extends AppController {
>
>         var $name = 'Entries';
>         var $helpers = array('Html','Form');
>
>         function index()
>         {
>
>                 $this->Entry->recursive = 1;
>                 $this->set('entries', $this->Entry->findAll());
>
>         }
>         function view($id = null)
>         {
>                 if (!$id)
>                  {
>                         $this->Session->setFlash('Invalid id for Entry.');
>                         $this->redirect('/entries/index');
>                   }
>                 $this->set('entry', $this->Entry->read(null, $id));
>
>         }
>
>         function add()
>         {
>                 if (empty($this->data))
>                  {
>                         $this->render();
>                  }
>                  else
>                  {
>                         //$this->cleanUpFields();
>
>                         if ($this->Entry->save($this->data))
>                                 {
>
>                                         $this->Session->setFlash('The Entry 
> has been saved');
>                                         $this->redirect('/entries/index');
>                                 }
>                         else
>                                  {
>                                         $this->Session->setFlash('Please 
> correct errors below.');
>                                 }
>                  }
>         }
>         function edit($id = null)
>          {
>                 if (empty($this->data))
>                  {
>                         if (!$id)
>                          {
>                                 $this->Session->setFlash('Invalid id for 
> Entry');
>                                 $this->redirect('/entries/index');
>                         }
>                         $this->data = $this->Entry->read(null, $id);
>                 } else
>                 {
>                         //$this->cleanUpFields();
>                         if ($this->Entry->save($this->data))
>                                  {
>                                         $this->Session->setFlash('The Entry 
> has been saved');
>                                         $this->redirect('/entries/index');
>                                  }
>                    else
>                                 {
>                                         $this->Session->setFlash('Please 
> correct errors below.');
>                                 }
>                 }
>         }
> function delete($id = null) {
>                 if (!$id) {
>                         $this->Session->setFlash('Invalid id for Entry');
>                         $this->redirect('/entries/index');
>                 }
>                 if ($this->Entry->del($id)) {
>                         $this->Session->setFlash('Record deleted 
> successfully');
>                         $this->redirect('/entries/index');
>                 }
>         }
>
> }
>
> ?>
> how to upload files from this code
--~--~-~--~~~---~--~~
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 related to dropdown box

2008-12-28 Thread Smelly_Eddie

You need to read up on the manual.



On Dec 27, 7:14 am, mona  wrote:
> It can't solve my problem i m sending you my code can you tell me
> where i m making mistake plz correct it if it is possible
> this i my entries controller  and i want data in drop down box in add
> and edit pages from table name section
>  class EntriesController extends AppController {
>
>         var $name = 'Entries';
>         var $helpers = array('Html','Form');
>
>         function index()
>         {
>
>                 $this->Entry->recursive = 1;
>                 $this->set('entries', $this->Entry->findAll());
>
>         }
>         function view($id = null)
>         {
>                 if (!$id)
>                  {
>                         $this->Session->setFlash('Invalid id for Entry.');
>                         $this->redirect('/entries/index');
>                   }
>                 $this->set('entry', $this->Entry->read(null, $id));
>
>         }
>
>         function add()
>         {
>                 if (empty($this->data))
>                  {
>                         $this->render();
>                  }
>                  else
>                  {
>                         //$this->cleanUpFields();
>
>                         if ($this->Entry->save($this->data))
>                                 {
>
>                                         $this->Session->setFlash('The Entry 
> has been saved');
>                                         $this->redirect('/entries/index');
>                                 }
>                         else
>                                  {
>                                         $this->Session->setFlash('Please 
> correct errors below.');
>                                 }
>                  }
>         }
>         function edit($id = null)
>          {
>                 if (empty($this->data))
>                  {
>                         if (!$id)
>                          {
>                                 $this->Session->setFlash('Invalid id for 
> Entry');
>                                 $this->redirect('/entries/index');
>                         }
>                         $this->data = $this->Entry->read(null, $id);
>                 } else
>                 {
>                         //$this->cleanUpFields();
>                         if ($this->Entry->save($this->data))
>                                  {
>                                         $this->Session->setFlash('The Entry 
> has been saved');
>                                         $this->redirect('/entries/index');
>                                  }
>                    else
>                                 {
>                                         $this->Session->setFlash('Please 
> correct errors below.');
>                                 }
>                 }
>         }
> function delete($id = null) {
>                 if (!$id) {
>                         $this->Session->setFlash('Invalid id for Entry');
>                         $this->redirect('/entries/index');
>                 }
>                 if ($this->Entry->del($id)) {
>                         $this->Session->setFlash('Record deleted 
> successfully');
>                         $this->redirect('/entries/index');
>                 }
>         }
>
> }
>
> ?>
> my model of entries is
>  class Entry extends AppModel {
>
>         var $name = 'Entry';
>         var $belongsTo=array('Section'=>array(
>         'className'=>'Section'
>         ),
>         'Submenu'=>array('className'=>'Submenu')
>         );
>
> }
>
> ?>
> and my add view is here i want drop down box and fetch data from
> section table in Section field i m using cake php 1.2
> New Entry
> create('Entry',array('action' => 'add','type' =>
> 'file'));?>
> 
>     input('Section', array('options' => array
> ('Announcements','The Venue','About Melbourne')),array('error' =>
> 'false','value' => array(1,2,3) )); ?>
> 
> 
>         input('Submenu', array('options' => array
> (1,2,3,4,5)),array('error' => false)); ?>
> 
> 
> input('Listitem',array('label' => 'Listitem'),array
> ('error' => false));?>
> 
> 
> input('Detail',array('label' => 'Detail'),array
> ('error' => false));?>
> 
> 
> 
>         submit('Add');?>
> 
> 
> 
> link('Home', '/entries/index')?>
> 
>
> and my edit view is
> Edit Entry
> create('Entry',array('action' => 'edit'));?>
> 
> /* here instead of text box i wan't data in dropdown box */
> input('Section.section',array('label'
> =>'Section','size'=>'30'
> ,'type'=>'text'));?>
> 
> 
> input('Submenu.submenu',array('label'
> =>'Submenu','size'=>'30'
> ,'type'=>'text'));?>
> 
> 
> input('Entry.Listitem',array('label'
> =>'Listitem','size'=>'30'
> ,'type'=>'text'));?>
> 
> 
>         input('Entry.Detail',array('label'
> =>'Detail','size'=>'30'
> ));?>
>
> 
> hidden('entry/id')?>
> 
>         submit('Save');?>
> 
> 
> 
> link('Delete','/entries/delete/' . $form->value
> ('Entry/id'), null, 'Are you sure you want to delete: id ' . 
> $form->value('E

Re: custom SQL query - all values IN() bust be AND

2008-12-24 Thread Smelly_Eddie

dev if thats the case than my last post should asswer your questions.

On Dec 24, 3:35 am, dev  wrote:
> I will give an example:
>
> Advert hasMany Option
> I need to find Adverts, where its Options are 3 and 4 values. When
> using IN, it will return results with 3, or, 4, or both 3 and 4. But i
> want only with both values.
>
> Like:
> [0] => Array
>         (
>             [Advert] => Array
>                 (
>                     [id] => 2
>                     [code] => 54
>                     [created] => 2008-12-19 11:17:30
>                 )
>
>             [Option] => Array
>                 (
>                     [0] => Array
>                         (
>                             [id] => 1
>                             [advert_id] => 2
>                             [option] => 3
>                         )
>                     [1] => Array
>                         (
>                             [id] => 2
>                             [advert_id] => 2
>                             [option] => 4
>                         )
>
>                 )
>
>         )
>
> On Dec 24, 12:35 am, Smelly_Eddie  wrote:
>
> > How can the same field have multiple values?
> > -it can be = '3'
> > -it can be= '4''
>
> > Otherwise maybe your are just concatenating multiple variables into
> > one, e.g.;
> > -it can be='3,4'
> > which probably should be evaluated for best practices..
>
> > You would not use IN in such a case.
>
> > If the are always ordered numerically you might use;
> > AND options.option like '%3,4%'
> > (assuming there are higher or lower values (2,..,5))
>
> > If they are not always order and could be 4,3 or 4,5,3 then you might
> > try;
> > AND options.option like '%3%' AND options.option like '%4%
>
> > On Dec 22, 11:21 am, dev  wrote:
>
> > > i'm building custom SQl query and need a little help.
>
> > > query:
> > > select distinct adverts.id, adverts.code from adverts left join images
> > > on (images.advert_id = adverts.id) left join options on
> > > (options.advert_id = adverts.id) where (SELECT count(1) FROM images
> > > WHERE adverts.id = images.advert_id) > 0 AND options.option IN (3, 4);
>
> > > but i want to get all Advert records, where options.option has all
> > > these values (3,4). When i'm using IN(), these values are with OR
> > > operator, how to set AND?
--~--~-~--~~~---~--~~
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 SQL query - all values IN() bust be AND

2008-12-23 Thread Smelly_Eddie

How can the same field have multiple values?
-it can be = '3'
-it can be= '4''

Otherwise maybe your are just concatenating multiple variables into
one, e.g.;
-it can be='3,4'
which probably should be evaluated for best practices..

You would not use IN in such a case.

If the are always ordered numerically you might use;
AND options.option like '%3,4%'
(assuming there are higher or lower values (2,..,5))

If they are not always order and could be 4,3 or 4,5,3 then you might
try;
AND options.option like '%3%' AND options.option like '%4%



On Dec 22, 11:21 am, dev  wrote:
> i'm building custom SQl query and need a little help.
>
> query:
> select distinct adverts.id, adverts.code from adverts left join images
> on (images.advert_id = adverts.id) left join options on
> (options.advert_id = adverts.id) where (SELECT count(1) FROM images
> WHERE adverts.id = images.advert_id) > 0 AND options.option IN (3, 4);
>
> but i want to get all Advert records, where options.option has all
> these values (3,4). When i'm using IN(), these values are with OR
> operator, how to set AND?
--~--~-~--~~~---~--~~
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: passing parameter formed by javascript function

2008-12-23 Thread Smelly_Eddie

I'm not sure I follow. I get the impression your trying to use
javascript **within** your php code.

PHP is a server side language. This means that it does ALL of its
processing before the user see anything. (Except for special cases
where output is a stream or iterative)

JavaScript is a client side language. This means it runs only after
ALL the output from the server has been received.


What that all means is that $html->link has completed and passed the
resulting text to your browser long before any JS on that page
executesSo you can't do that.  Not to mention that the PHP code
also runs before a user checks any boxes(or sees them for that
matter)...

You can only write javascript to act on the html code of the page (or
the resulting http://mysite.com/cake_generated/links).

So to hack this you might just let PHP output a unique keyword to be
replaced later("CONCAT_URL"). THan you can use some javascript to act
on the innerHTML of the containing class and use a string replace to
input your variable (replace "CONCAT_URL" with "" + var1 + var2.)

Someone else might have a better solution, but I go back to my main
point. You can't use javascript within PHP.



On Dec 22, 8:12 am, Chizo  wrote:
> hi, i need a litle help. I need to pass a paremeter to an action, that
> parameter contains a string with the concatenation of the value of the
> selected checkbox that i have in list (the index.ctp list).
> I have a javascript function that returns that value. How can  i pass
> that returned value to the action via $html->link? in the second array
> of the link i need to put the javascript returned value... but how can
> i do that?
>
> link('Borrar seleccion', array
> ('action'=>'delete'),null, sprintf(__('Are you sure you want to
> delete?', true),' ')); ?>
>
> pd: i´m not using ajax, and the best way to do this is via post or
> get??
>
> Thanks
> Lucas
--~--~-~--~~~---~--~~
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: Deep belongsTo

2008-12-22 Thread Smelly_Eddie

I think you may want to check out the 'finder query'  and adjust it
for each of your test and command models.

On Dec 21, 5:05 pm, Ralle  wrote:
> I think CakePHP has a really clever way to do this, so instead of
> reinventing the wheel, i'd ask you guys. I've used the search feature
> and read through the api.
> I have the folowing models
>
> Project
> Suite belongsTo Project
> Test belongsTo Suite
> Command belongsTo Test
>
> At the login screen of the app you chose the project and the
> project_id is stored in the session variable.
> After that i want all models that in any way has a relation the
> Project to only return data from that project.
> Say i wanted to list all Tests, it should add something like this to
> the sql "WHERE test.suite_id = suite.id AND suite.project_id=34"
> For commands this would be "WHERE commands.test_id = test.id AND
> tests.suite_id = suite.id AND suites.project_id=34"
>
> I tried adding a beforeFind function to the project model
> function beforeFind($queryData){
> $queryData['conditions']['project_id'] = $_SESSION['project_id'];
> return $queryData;}
>
> Didn't work as the function wasn't being called when another model
> called the project object, eg. Command or Test
>
> Cheers, Ralle
--~--~-~--~~~---~--~~
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 use the controller flash() method and what's the expected behaviour and output?

2008-12-19 Thread Smelly_Eddie

Fabio

I may not entirely understand, if so I appoligize.

If you want to know why using Configure::write('debug', 0);  in the /
views/posts/add.ctp for the redirect then I offer my explanation.

Heres your scenario  (as I understand it);

Controller calls flash layout passing it a url,delay and message ->
Flash layout displays. If debug == 0 it will redirect in the time
specified. to the url specified.  ->
the redirect lands on add.ctp where you set debug = 0.

If that is indeed the case than I think you can see the problem.
The code in add.ctp comes into play only AFTER the would be redirect.

You could illustrate this by logging the display of the flash layout
and debug the display of add.ctp.

So I would recommend using Configure::write('debug', 0);  in the
actual controller just before calling flash...

Or you might just do as I did and override the default flash layout
with your own, and remove the whole check for debug. I never
understood why the page is frozen for debug to begin anyhow.


On Dec 18, 4:16 pm, Fabio M  wrote:
> Wait. Changing the debug value in the core configuration make the
> flash messages work.
> Contrarily the change I tried to do in the add.ctp view was not holded
> outside that context. So the question is: why?
>
> Thank you, Fabio
--~--~-~--~~~---~--~~
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: Error Messages Not Displaying in View or in Validations Array

2008-12-19 Thread Smelly_Eddie
Just a guess but it looks like your sending the form data to a
different page...

Validation was intended to display on the same model in a circular
manner. i.e. empty user/add form is shown -> data submitted to user/
add action -> user/add validates data -> form is repeated if invalid
OR redirect user to secondary page.




On Dec 18, 3:51 pm, Tony  wrote:
> For some reason I can't get my error messages for validations to work.
> I tried outputting the validations by doing:
> pr($this->validationErrors);
>
> But all I get is an empty array. What do you guys see that I'm doing
> wrong?
>
> Thanks,
> Tony
>
> Here's my model:
> 
> class User extends AppModel {
>
>         var $name = 'User';
>
>     // This model is a self-join
>         var $belongsTo  =       array(
>                                                                 
> 'ParentMember' => array(
>                                                                               
>                           'className' => 'User',
>                                                                               
>                           'foreignKey' => 'parent_id'),
>                                                 );
>
>         var $hasMany    =       array(
>                                                                 'ChildMember' 
> => array(
>                                                                               
>                           'className' => 'User',
>                                                                               
>                           'foreignKey' => 'parent_id'),
>                                                 );
>
>    // Place the validation rules here:
>
>    var  $validate = array(
>                         'first_name' => array(
>                                 'rule' => 'alphaNumeric',
>                                 'required' => true,
>                                 'message' => 'Name is required. Please enter 
> your first name.',
>                                 'last' => true
>                         ),
>                         'email' => array(
>                                 'rule' => array('email', true),
>                                 'required' => true,
>                                 'message' => 'Email is required. Please enter 
> your email
> address.',
>                                 'last' => true
>                         ),
>                         'phone' => array(
>                                 'rule' => array('phone', null, 'us'),
>                                 'message' => 'Phone number is not valid. 
> Please enter valid phone
> number.',
>                                 'last' => true
>                         )
>    );
>
> }
>
> 
>
> Here's my controller with the method action it's being submitted to:
> 
> function thank_you()
>     {
>                 $member = $this->Session->read('teamMember');
>                 $this->set('pageTitle', 'Before you leave TriVita Cooperative
> Marketing\'s website');
>         $this->set('bigTitle', 'BEFORE YOU LEAVEA SPECIAL THANK
> YOU FROM ME...');
>                 $this->set('member', $member);
>
>         if( !empty($this->data) )
>         {
>
>             $this->User->create();
>
>             if( $this->User->save($this->data) )
>             {
>
>                 $tony = $this->User->findByAffiliateNumber
> ('11167706');
>
>                                 $prospect = 
> $this->User->findById($this->User->id);
>
>                 $this->set('prospectName', $prospect['User']
> ['first_name']);
>                 $this->set('tonyEmail', $tony);
>
>                                 if( $prospect['User']['email'] != '' || 
> $prospect['User']
> ['email'] != null )
>                                 {
>                                         $this->_sendThankYouEmail($prospect, 
> $member);
>                                 }
>                                 /*
>                                 if( $member['User']['affiliate_number'] != 
> '11167706')
>                                 {
>                                         
> $this->_sendMemberNotificationEmail($prospect, $member, $tony);
>                                 }
>                                 */
>                                 
> $this->_sendMemberNotificationEmail($prospect, $member, $tony);
>                                 $this->_sendTonyEmail($prospect, $member, 
> $tony);
>
>             }
>             else
>             {
>                 $this->redirect(array('action' => 'index'),null,true);
>             }
>         }
>         else
>         {
>                         // we're at this place because a form was not filled 
> in
>             $this->redirect(array('action' => 'index'),null,true);
>         }
>         }
> 
>
> Here's my view form:
> 
> echo $form->create('User', array('url' => '/businesses/thank_you'));
>                 

Re: self referential many to many relationships

2008-12-19 Thread Smelly_Eddie

http://book.cakephp.org/view/78/Associations-Linking-Models-Together

On Dec 18, 2:46 pm, overture  wrote:
> If I have a 'users' table which represents a set of employees and I
> want to assign a given employee mutiple supervisora (who are obviously
> also in the 'users' table) then I have a situation where there is a
> self referential relationship.  Not only that it is also many to
> many.
>
> How do I achieve this relationship in a model?
>
> Thanks!
> Phil
--~--~-~--~~~---~--~~
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 works locally, but not on server

2008-12-18 Thread Smelly_Eddie

I believe this is based on the version of PHP your machines are
running. (4 vs 5)

I also think there is a submitted ticket for the issue but I have the
time to search.

Google  alphanumeric issue in Cakephp and Im sure you'll find the
details.




On Dec 17, 3:00 pm, RyOnLife  wrote:
> This one has me completely stumped!
>
> The validation rule I've pasted below works fine on my local machine, but
> when I test a user registration on my server, it kicks the "Letters and
> numbers only" error message, even if the input is valid.
>
> Both local and server are running Cake 1.2.0.7692 RC3 and PHP 5.2.6.
>
>     'username' => array(
>       'alphanumeric' => array(
>         'rule' => 'alphaNumeric',
>         'message' => 'Letters and numbers only',
>       ),
>       'unique' => array(
>         'rule' => 'isUnique',
>         'message' => 'This username is taken'
>       ),
>       'between' => array(
>         'rule' => array('between', 3, 15),
>         'message' => 'Between 3-15 characters',
>         'required' => true,
>         'allowEmpty' => false        
>       )      
>     )
>
> Any ideas? Thanks.
> --
> View this message in 
> context:http://n2.nabble.com/validation-rule-works-locally%2C-but-not-on-serv...
> 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: what is the best way to restrict actions to different profiles from the same model User?

2008-12-18 Thread Smelly_Eddie

I think your missing the point of ACLs

You should have a record of user ID's that may add new users.

On Dec 17, 10:39 am, persivo_cunha  wrote:
> Hi,
>
> Im my DB, i have one table called 'user' with a field called profile,
> and only the profile 'admin' can add a new user. Is wrong i put one if
> in the add action that execute only if the profile is 'admin'?
>
> I am using AuthComponent.
>
> 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: New to CakePHP

2008-12-17 Thread Smelly_Eddie

WallyJ

I would guess.

Basically your main config is saying "dont let any sub directory's
htaccess files do anything, I'm the boss!"
So when mod_rewrite is inactive, there is no issue. But when you
activate mod_rewrite you create a conflict which results in the access
forbidden.


You'll need to edit httpd.conf for the directory this occurs on.

You'll likely see something like


AllowOverride None


Change the None to All.
which changes its stance to "I'm still the boss but I don't like to
micro-manage, so let htaccess files do their thing."



On Dec 16, 9:39 pm, WallyJ  wrote:
> I tried this and when I UNcommented the rewrite line, I received "Access
> Forbidden" from the localhost that was working fine before. If I comment the
> line back, it works fine.
>
> Ideas?
>
> Thanks!
>
> WallyJ
>
>
>
> imran k wrote:
>
> > Thanks guys... it worked. I did exactly what both of you said. thanks
> > a lot.
>
> > On Oct 13, 5:16 am, qwanta  wrote:
> >> Also, don't forget to restart apache after making the httpd.conf
> >> changes.
>
> >> On Oct 12, 2:16 pm, imran k  wrote:
>
> >> > Hi everyone! I am Imran k and very new to CakePHP. I have downloaded
> >> > cake_1.2.0.7692-rc3  and installed on XAMPP server but the 'welcome
> >> > screen' appears without any graphics or colors.
>
> >> > I tried editing the httpd.conf file but it didn't made any difference.
> >> > The screen is still with no color, no styles, no layout, and no font
> >> > changes appear—it’s just black text on a white background.
>
> >> > Can anybody please help?
>
> --
> View this message in 
> context:http://n2.nabble.com/New-to-CakePHP-tp1323156p1666164.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: Looking for good Cake PHP developer in S.Florida

2008-12-17 Thread Smelly_Eddie

Please don't post job offers.

Try LinkedIn or your local wanted ads. :)

On Dec 16, 11:58 am, matt  wrote:
> I'm looking for a high quality Cake PHP developer for a three-month,
> full-time commitment which could very likely be extended to a
> permanent position.
>
> We are a two year-old mobile marketing/technology company located in
> the Fort Lauderdale area (close to Miami).  If you're interested,
> please send resumes to resumesataugmemobiledotcom
--~--~-~--~~~---~--~~
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 internship / job

2008-12-17 Thread Smelly_Eddie

I would try your school's job posting board or a professional
networking site like LinkedIn.

I doubt you'll find help here since users prefer to keep this group
dedicated to programming issues and not job offers. (As it should be)



On Dec 16, 9:14 am, Pascal Messana  wrote:
> Hi!
>
> I am a student in a french "engineer" school (INSA of Lyon), I will
> have my diploma next year. (equivalent to a B.S. in Computer Science).
>
> I am looking for an internship or a job related to CakePHP.
> It would be during 4 or 5 months, between May and September 2009.
>
> I have already developped several websites using CakePHP (during a
> previous internship and for my personal projects).
>
> Do you know a company which could be interested in having a cake
> developper during the next summer ?
>
> 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: Wizard Component 1.2 and admin routing

2008-12-17 Thread Smelly_Eddie

This would probably be a question better left for the page you
included :)

On Dec 16, 7:11 am, Alexandru Ciobanu  wrote:
> Hi,
>
> I'm trying to use jared's Wizard component with admin routing but can't
> seem to figure it 
> out.http://bakery.cakephp.org/articles/view/wizard-component-1-2-1
> Anyone done 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: Best Practice needed: How to deal with 'hasMany' Associations in an add-View

2008-12-16 Thread Smelly_Eddie

I'm not sure I understand.

Are you attempting to save duplicate data to both A and B.  Or do you
wish to save unique data to A and B but from the same form.



On Dec 15, 3:20 pm, volka  wrote:
> Hi there,
> I hope someone is going to share his best practice(s) with me :-)
>
> I have a model A which has a 'hasMany' association with model B. model
> B 'belongsTo' model A.
>
> Now when adding A's to my database I'd like to add B's at the same
> time and in one
> , as well.
>
> In A->add(), I would copy B->add()...
>
> What do you think? Is that reasonable?
> Or would you do it different?
>
> Thanks and kind regards,
> volka
--~--~-~--~~~---~--~~
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: Seperate Public/Admin Apps with Shared Models & Webroot?

2008-12-10 Thread Smelly_Eddie

I have to agree with Adam on this point.

The whole concept of admin routing is to provide radically different
interaction capabilities and layouts separated by end users and
administrators.

Duplicating code in two separate apps is poor practice. Think about
scalability and enhancements. Why maintain twice as much code as you
need to?

As for security,  I don't understand what advantage 2 apps give you..
especially since they will most likely share the same host and file
system anyhow. If anything it just means more work to test and
eliminate security issues that may result from the code.



On Dec 10, 11:08 am, Adam Royle <[EMAIL PROTECTED]> wrote:
> What security reasons are you talking about in particular?? It doesn't
> make sense to break it into two separate apps when they share
> everything.
>
> On Dec 10, 1:11 am, Marieta Nastase <[EMAIL PROTECTED]> wrote:
>
> > I have the same problem!!
>
> > What is the best way to deal with this?
>
> > In my opinion, 2 separate applications is the best solution, for
> > security reasons. But the webroot is the problem(files uploaded are
> > needed both in backend and frontend app).
>
> > Marieta
>
> > On Nov 7, 10:50 am, Kappa <[EMAIL PROTECTED]> wrote:
>
> > > I agree with you, but at the same time i think that having separate
> > > webroot for admin and public app is quite hard, because often the
> > > admin
> > > app is used not oly to insert "written" data but also to upload
> > > images,
> > > videos,files and so on.. and i suppose that all those data have to be
> > > put
> > > inside a "common" webroot.
>
> > > Am I right?
>
> > > Andrea
>
> > > PS: i think that the Admin/Public implementation on the CakePHP
> > > framework
> > > is one of the trivial things, because there is not "THE WAY" to do
> > > it,
> > > but everybody find himself creating its own way. I hope that in Cake
> > > 1.3
> > > or 1.4 the Cake team will develop a standard way for doing it.
>
> > > On Nov 7, 1:54 am,AdamRoyle<[EMAIL PROTECTED]> wrote:
>
> > > > If you're sharing the same webroot and models, controllers,
> > > > components, etc, what is the purpose of have two separate apps?
>
> > > > You can just use admin routes for this.
>
> > > > Cheers,
> > > >Adam
>
> > > > On Nov 7, 5:55 am, WildFoxMedia <[EMAIL PROTECTED]> wrote:
>
> > > > > I saw an article on the bakery that described a method for creating 2
> > > > > seperate applications that could share Models, Controllers, 
> > > > > COmponents, etc.
> > > > > I followed that tutorial and had everything setup how I wanted, 
> > > > > except for
> > > > > the webroot. Is it possible to share the webroots across these 2 apps?
>
> > > > > I thought about removing everything from the webroot for each app 
> > > > > except for
> > > > > the index.php for that sake of bootstrapping and actually dispatching 
> > > > > the
> > > > > request - but moving the rest of the files to a shared webroot in a 
> > > > > similar
> > > > > fashion to the models, etc. My question is this
>
> > > > > Is it easy, or even possible to change system paths for Forms, JS, 
> > > > > CSS, etc.
> > > > > to reference a new shared webroot, or at worst, make the public app 
> > > > > have all
> > > > > webroot files and the manager leach its files?
> > > > > --
> > > > > View this message in 
> > > > > context:http://www.nabble.com/Seperate-Public-Admin-Apps-with-Shared-Models--...
> > > > > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Data Validation error message fails on $this->redirect

2008-12-06 Thread Smelly_Eddie

Why are you using two actions to begin with?

It seems like your inviting issues using such a manner.

Have you considered sending all the data to the same action, and on
successful validation redirect to the next action?  Seems like a
cleaner way to go about things.


On Dec 6, 1:20 am, Renesistemic <[EMAIL PROTECTED]> wrote:
> I've had no luck locating any resource online for resolving my issue
> (which I feel is fairly easy), and thought I'd post it on here to see
> if anyone has input.
>
> I'm trying to use the built-in data validation for submitting a form.
> The originating action, say, "manage_posts", displays the form to the
> user and lets them modify data for that post. When they submit, it
> sends the data to "activate_post".
>
> In the "activate_post" action, I call the if($this->Datavalue->set
> ($this->data) && $this->Datavalue->validates) function to test the
> data, and if that test fails I redirect back to "manage_posts"...
>
> The actual validation process seems to be functioning. It accepts
> valid data and redirects on invalid data. However, when it redirects
> to the previous action, it doesn't actually display the error message
> for that HTML element
>
> In the original form, I am in fact calling $this->Form->error
> ($datavalue, $error_msg) after generating the HTML element with $this-
>
> >Form->input().
>
> Likewise, I have other actions throughout my application that use data
> validation and work correctly. However, they don't redirect to another
> action on failing validation. An example would be an action to
> "add_posts"... When the user submits data, it submits to itself,
> tests, and upon validation renders the same action/view.
>
> It seems that I'm only experiencing these problems when I redirect on
> the failure of a data validation. Any thoughts?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Behavior can create new records but fails to update.

2008-12-04 Thread Smelly_Eddie

Got it!

I discovered that loading the existing values to overwrite was causing
the issue. If I just set the ID and only had the 2 fields I change it
worked.

That points to...
Validation!

By turning off the validation I am able to save all fields after
loading.

This works but I dont know the name of the user I am banning. :(

//set their id
$model->id=$userID;  //notice we never load the existing values
//overwrite their password
$data['User']['password']='ThisUserViolatedTerms'.date('dmY');
//save new password effectively blocking them out.
//also save boolena field to lock
$data['User']['isBanned']= 1;
$model->save($data);

~~Solution~~   ignore validation

$data=$model->read(null,$userID); // here we can load all the
values.
debug($data);
//overwrite their password
$data['User']['password']='ThisUserViolatedTerms'.date('dmY');
//save new password effectively blocking them out.
//also save boolena field to lock
$data['User']['isBanned']= 1;
//$model->data=$violator;
$model->save($data,false);  // the second argument ignores
validation




On Dec 4, 8:29 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> Thanks, but unfortunately the results are the same. No update query is
> run.
>
>                 $model->id=$userID;
>                 $data=$model->read();
>                 debug($data);
>                 //overwrite their password
>                 $data['User']['password']='ThisUserViolatedTerms'.date('dmY');
>                 //save new password effectively blocking them out.
>                 //also save boolena field to lock
>                 $data['User']['isBanned']= 1;
>                 //$model->data=$violator;
>                 $model->save($data);
>
> On Dec 4, 7:57 pm, ridwan arifandi <[EMAIL PROTECTED]> wrote:
>
> > try
>
> > $model->id = $foo['User']['id']
> > $data = $model->Read();
>
> > $data['User']['...'] = ;
>
> > then save
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Behavior can create new records but fails to update.

2008-12-04 Thread Smelly_Eddie

Thanks, but unfortunately the results are the same. No update query is
run.

$model->id=$userID;
$data=$model->read();
debug($data);
//overwrite their password
$data['User']['password']='ThisUserViolatedTerms'.date('dmY');
//save new password effectively blocking them out.
//also save boolena field to lock
$data['User']['isBanned']= 1;
//$model->data=$violator;
$model->save($data);

On Dec 4, 7:57 pm, ridwan arifandi <[EMAIL PROTECTED]> wrote:
> try
>
> $model->id = $foo['User']['id']
> $data = $model->Read();
>
> $data['User']['...'] = ;
>
> then save
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Behavior can create new records but fails to update.

2008-12-04 Thread Smelly_Eddie

I have been going straight with this one for a few hours now and I'm
stumped.

Usually from a controller you can just call $this->Model->read, and
then $this->Model->save to update any values changed inbetween.

When I try the same from my Behavior  it fails to update the record.
If I eliminate the read and just make up some valued it will however
write a new record.
When it writes a new record I can see the insert statement in my sql
log.  Otherwise I see no update statement. Further the save operation
returns empty.



Heres what I have

function banuser(&$model,$userID,$action='unspecific action'){
//get their info
$foo=$model->findById($userID);
$model->data=$model->read(null, $userID);
debug($model->data); //data was retrieved successfully
//overwrite their password
$model->data['User']['password']='ThisUserViolatedTerms'.date
('dmY');
//save new password effectively blocking them out.
//also save boolena field to lock
$model->data['User']['isBanned']=1;

$pass=$model->save($model->data);
debug($pass);

Any ideas would be great

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Change database and host from the Controller

2008-12-04 Thread Smelly_Eddie

Assuming your database.php has the $default connection set, you can
just replace the details on the fly

DATABASE_CONFIG::default = array();

At least I think that would word since its all static.  You might need
to import first though I dont think so.

On Dec 3, 3:09 pm, Henrik Gemal <[EMAIL PROTECTED]> wrote:
> I need to change the host and the database from the controller.
>
> The controller will read some config vars in the local database and
> the then needs to connect to the host and database specified in the
> config vars. These config vars changes all the time.
>
> So how do I dynamically change the database connection from within the
> controller?
>
> The database schema will be the same for all hosts and databases.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: save extra filed 'entity' in HABTM join tabel

2008-12-03 Thread Smelly_Eddie

I believe the with attribute will conflict with 'join_table' because
the model specified by 'wiht' already knows what table it wants to
use.

You should use one or the other.

I have successfully added additional fields in a HABTM using
'with' ..without issue

>     var $hasAndBelongsToMany = array(
>                 'Tag' => array('className' => 'Tag',
>                 'joinTable' => 'entities_tags',
>                 'foreignKey' => 'entity_id',
>                 'associationForeignKey' => 'tag_id',
>                 'with' => 'EntitiesTag',
>                  'unique' => true,
>                 'conditions' => 'EntitiesTag.entity = 1',
>                ),
>          );
>
> }
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PHP generated JavaScript

2008-12-03 Thread Smelly_Eddie





On Dec 3, 4:16 am, Henrik Gemal <[EMAIL PROTECTED]> wrote:
> I need to include a JavaScript URL on my page. The JavaScript needs to
> be generated by PHP.
> How do I do that?
> The PHP needs to read from the database to generate the JavaScript
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Current datetime in model

2008-12-03 Thread Smelly_Eddie

how about

$currentTime = date('Y-m-d h:i:s');  //check the format for the date
command, I may be off.

Then use $currentTime in your query

On Dec 2, 8:47 am, Alexey Grunichev <[EMAIL PROTECTED]> wrote:
> Does cake contain any functionality to pass as parametr in condition
> function current time?
> I need a query such as:
> Select * from ... where exp_datetime < NOW()
> If I passexp_datetime < NOW() in condition it won't work in MSSQL (it
> used GETDATE())
> I need a cross-db solution.
>
> I can use application time, but app and db could be located at
> different physical servers in different time zones and in this way I
> should replace all used default timestamps functionality in db.
>
> So, I wonder to know, does cake contain functionality to pass as
> current time function as condition in Model?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validation

2008-11-24 Thread Smelly_Eddie

Are you asking how to write a custom validation function?

You can specify a custom function in place of one of Cake's provided
rules.

http://edwardawebb.com/programming/php-programming/cakephp/complex-validation-cakephp-12

On Nov 24, 8:44 am, sun <[EMAIL PROTECTED]> wrote:
> hello sir,
>                I am mistaken first i am using built in validation in
> my program now custom validation should applied  then previous
> conditions should apply.. in this case  how to solve the previous
> issue?
>
>   by
>  sundar
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Multiple views

2008-11-24 Thread Smelly_Eddie

First you need to create an element that contains the HTML code to
display your data.

Store it in views/elements/.ctp

In that code(the element) you can make a call to any controller action
to get the needed data.

$this->requestAction('/controller/action')   (I think)


Then you would add the code that calls the element to your main page;

$this->element('');




On Nov 23, 9:04 am, Walther <[EMAIL PROTECTED]> wrote:
> I'm using version 1.2RC3
>
> On the front-page of my application I want to be able to display
> numerous other views. For example I may want to display a view of my
> pages controller (for example a welcome message), and a view from my
> calendar controller.
>
> How would I do 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do I use "find" to retreive data from multiple tables

2008-11-23 Thread Smelly_Eddie

This is a simple relationship, I think your missing something.

$this->find('list', array('fields'=>array
('Site.id','Site.title'),'conditions'=>array('SiteUser.id=1'))

THis will require the recursive attribute to be 0 or higher I think.

On Nov 23, 12:03 am, pkclarke <[EMAIL PROTECTED]> wrote:
> I have the following tables:
>
> sites
>  - id
>  - title
>
> site_users
>  - id
>  - site_id
>  - user_id
>
> How do I construct a "find()" to retrieve equivalent of the following
> query:
>
> SELECT a.id, a.title FROM sites a, site_users b WHERE a.id = b.site_id
> AND b.user_id = 1;
>
> I tried "find('list', array('fields'=>array('SiteUser.site_id',
> 'SiteUser.Site.title')))" but nothing is that easy ;-)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: several database settings

2008-11-23 Thread Smelly_Eddie

Right.

Making multiple connections work with he shell is easy though, Just
assume the absence of HTTP_HOST means your consoling.

http://edwardawebb.com/programming/php-programming/cakephp/automatically-choose-database-connections-cakephp

On Nov 22, 8:26 pm, francky06l <[EMAIL PROTECTED]> wrote:
> That will not work for shell ... but maybe you do not need
> Cheers
>
> On Nov 22, 12:06 am, "Ricardo Valfreixo" <[EMAIL PROTECTED]> wrote:
>
> > Ok, I ask and also reply..
>
> > directly on the app/config/database.php
>
> > something like:
>
> > classe DATABASE_CONFIG
> > {
> >     var $default = NULL;
>
> >     var $dev = array(
> >         //your dev settings
> >     );
> >     var $prod = array(
> >         //your prod settings
> >     );
>
> >     function __construct()
> >     {
> >         if(isset($_SERVER['SERVER_NAME'])
> >         {
> >             if($_SERVER['SERVER_NAME'] == )
> >             {
> >                 $this->default = $this->prod;
> >             }
> >             else
> >             {
> >                 $this->default = $this->dev;
> >             }
> >         }
> >     }
>
> > }
>
> > et voilá
>
> > @teknoid
>
> > This way I don't need to worry about overwriting all the files. I can simply
> > delete all and reupload the entire source.
>
> > Zen
>
> > On Fri, Nov 21, 2008 at 10:45 PM, Ricardo Valfreixo <[EMAIL 
> > PROTECTED]>wrote:
>
> > > Hello once more. I'm a real pain, I know..
>
> > > I have two database settings. one $default and one $production. How can I
> > > make the code sensitive to the url? I have the php magic system variables
> > > which I can use, But were, in the code, should I put the "selector"?
>
> > > Thank you
>
> > > Zen
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: isHashed Custom Validation

2008-11-21 Thread Smelly_Eddie

Maybe I am missing something, but why not just Hash as part of
validation, then you'll know it is not hashed until after the compare?

http://edwardawebb.com/programming/php-programming/cakephp/complex-validation-cakephp-12

On Nov 20, 12:24 pm, bingo <[EMAIL PROTECTED]> wrote:
> Hi bakers,
>
> I am trying to write a custom validation function that checks if a
> string is already hashed or not. I want to make sure that password
> filed are hashed and if not then hash them. Further, I can see it
> being useful in many other cases. Pertaining to custom validation, I
> have two questions
>
> 1. Where should I put validation function that are generic and not
> particular to any model. Is app_model is the right place ? I just
> don't want to put too many things in app_model and was thinking making
> another file that holds custom validation functions.
>
> 2. Can someone help me completing this function. I got the start but
> not being able to complete it
>
> /
>      * Checks if a string is already hashed
>      * Parameters
>      * String $string - input String
>      * mixed $salt - either string or boolean
>      * Returns:
>      *  boolean - true if string is hashed
>      *          - false if string is not hased
>      */
>     function isHashed($string, $salt = false)
>     {
>       //Check if salt value has to be used - copied from Security.php
>       if ($salt)
>       {
>             if (is_string($salt)) {
>                 $string = $salt . $string;
>             } else {
>                 $string = Configure::read('Security.salt') . $string;
>             }
>       }
>
>       //Check if string is already hashed
>       $security =& Security::getInstance();
>       if($secuirty->hashType == 'md5')
>             if(preg_match("/[A-Fa-f0-9]{32}/i", $string)) return true;
>       return false;
>
>     }
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to set DB config settings automatically based on $_SERVER['HTTP_HOST']?

2008-11-21 Thread Smelly_Eddie

You might be interested in using a case statement to streamline
things.

You should also be sure to check for HTTP_HOST first, since baking
from the console wont have such a variable.

http://edwardawebb.com/programming/php-programming/cakephp/automatically-choose-database-connections-cakephp



On Nov 19, 8:27 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I have a local test server and a live site that I would like to use
> the same exact codebase on. To automatically switch the config
> settings in core.php I do something like this:
>
> if($_SERVER['HTTP_HOST'] == 'account.local') {
>         // Local
>         define('PATH_TO_WEBROOT',               'path/to/local/webroot/');
>         define('ENABLE_EMAIL',                  false);} else {
>
>         // Live
>         define('PATH_TO_WEBROOT',               
> '/path/on/live/servers/webroot/');
>         define('ENABLE_EMAIL',                  true);
>
> }
>
> However, how do I do a similar thing with the DB settings? I'd like to
> do something like this, but I don't know where to call it:
>
> if($_SERVER['HTTP_HOST'] == 'account.local')
>         $useDbConfig = 'test';
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Named parameters VS $_GET

2008-11-20 Thread Smelly_Eddie

I think there is a little more to it than that.

Most search engines ignore anything after ? (query string)

This can be useful or detrimental depending on your situation.

If you are passing around trivial data like session ids or something
that doesn't physically alter the page, I would stick with query
strings. This prevents engines like Google from seeing 'duplicate'
content which lowers your page rank.

If you used
/posts/view/trivial:875783
Google would see each different number as a unique page, but notice
the exact same content.

If you use
/posts/view/?trivial=894894
Google will treat all as the base url -> /posts/view/, and only index
it as 1 page.




So if your passing in a search word, you might want to use named
variables since a search for cats should be very different that a
search for dogs.

If you passing in encrypted data or something that has no direct
impact on the pages content, you might instead choose query strings.



Hope that helps,
EW


On Nov 19, 4:55 am, Rafael Bandeira aka rafaelbandeira3
<[EMAIL PROTECTED]> wrote:
> Query strings are evil for seo. That's why.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Configuring Cake with openSUSE 11

2008-11-17 Thread Smelly_Eddie

Read the code you posted again unbund

there IS an allowOverride option...though its not set to None, insteaD
it is specifying what is allowed.
Setting it to All, as Alexandru suggested, might help.

Otherwise check the apache config to make sure your loading the
rewrite module.

PS I am running SuSE 11 with apache 2 php5 and mysql5...no issues with
mod_rewrite.



On Nov 17, 3:04 pm, undbund <[EMAIL PROTECTED]> wrote:
> Hello Alexandru,
>
> I have tried making the changes you had suggested but I have a slight
> problem. Here is code from:
> /etc/apache2/mod_userdir.conf
>
> As you can see, there is not AllowOverride directive.
>
>        
>
>                 AllowOverride FileInfo AuthConfig Limit Indexes
>                 Options MultiViews Indexes SymLinksIfOwnerMatch
> IncludesNoExec
>
>                 
>                         Order allow,deny
>                         Allow from all
>                 
>
>                 
>                         Order deny,allow
>                         Deny from all
>                 
>
>         
>
> Can you tell me where should I add the AllowOverride directive.
>
> Thanks for all your help,
> undbund
>
> On Nov 17, 5:23 am, Alexandru Ciobanu <[EMAIL PROTECTED]> wrote:
>
> > undbundwrote:
> > > Hi guys,
>
> > > I was trying to configure Cake with openSUSE 11 but I could not make
> > > mod rewrite work. I can access the Cake folder in the document root
> > > (http://localhost/~undbund/cake) but the CSS is not coming on the web
> > > page correctly. I tried to enable mod rewrite using the following
> > > tutorialhttp://www.experts-exchange.com/Software/Server_Software/Web_Servers/...
> > > but it did not work out. There is no one single conf file but many and
> > > is all controlled by httpd.conf with many includes in this file.
>
> > Most likely your httpd.conf has AllowOverride set to None; SuSE apache
> > comes this way, IIRC.
> > Look for something like this:
>
> > 
> >     AllowOverride FileInfo ... etc ..etc
> >     more directives here...
> > 
>
> > Set de AllowOverride directive to 'All' (no quotes).
> > That should do the trick.
>
> > You should see the apache manual 
> > (http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride) to know
> > what your allowing to override. :-)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help needed for inline WISIWYG editor...

2008-11-13 Thread Smelly_Eddie

TinyMCE is what you need.

Minimal code to turn any text area into rich editors.

PAsses data normally as post (or whatever method your existing form
uses)

On Nov 13, 8:04 am, "Aneesh S" <[EMAIL PROTECTED]> wrote:
> I had tried Yahoo's rich text editor, but i could not get the data via
> post... Any help in that matter would be great...
>
> Thanks for the hint kyle.davis
>
> On 11/13/08, validkeys <[EMAIL PROTECTED]> wrote:
>
>
>
> > in some WYSIWYG editors, there is a setting for handling post. If you
> > don';t set that variable, you can submit the form but you won't see
> > the values in _POST
>
> > On Nov 13, 7:01 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
> >> Hi,
>
> >>    I need to build an inline wysiswig editor for the project i'm
> >> working on. I have tried some editors, but im not being able to
> >> extract the typed text using post.  Is such a facility built-in in
> >> cake ? Can any one help me out in this Thanks in advance
>
> --
> Aneesh S
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: acess url only from email

2008-11-13 Thread Smelly_Eddie

Marcus.

If the user shares the original link though, they will always hit the
first page and be given the localsite as the referrer before moving
on.

What is to prevent the user form passing around the original link that
includes the hash?

Unless it is a one time hash, which Wofka already said he did not want
to do.

On Nov 12, 12:17 pm, Marcus Silva <[EMAIL PROTECTED]> wrote:
> You did not understand it, did you?
>
> The referer will always be your own domain if the hash in the email
> validated, since you will be redirecting the user to that page.
>
> Consider this:
>
> A user register for a website and get a confirmation link.  The link
> in the email points to:
>
> http://www.yourdomain.com/confimation/email_hash
>
> After the email hash has been validated you send the user to another
> page on your site.
>
> In that other page you check if the referer is (yourself)  your own
> domain (http://www.yourdomain.com/confimation/email_hash).
>
> Just make sure you do not link to that page from anywhere in your
> site.
>
> If you know a better solution then use it and share with others as
> well.
>
> Maybe you will get it now.
>
> On Nov 12, 4:40 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > That still does not prevent a user from sharing the original url in
> > the email. Anyone that visits the first page could see the second.
>
> > It seems like this is a  moot point if you use authentication or email
> > tickets, which would be a much more sound approach.
>
> > Any solution you may come up with will not be secure since there is no
> > unique way to identify the source as an email. Some web based email
> > will show the referrer as the provider (gmail, yahoo) but client based
> > applications (thunderbird or outlook) will have a blank referrer.
>
> > -EW
>
> > On Nov 11, 4:16 pm, Marcus Silva <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I am not sure if I got your question right, but if I did you might be
> > > ok doing the following:
>
> > > Create an email hash key like Jon Bennett suggested, when the user
> > > comes back to your site take
>
> > > make the user go to a url on your site where you can check the hashed
> > > value, then send the user to another page, in that page check if the
> > > referer ($this->refefer()) was the page the user visited originally
> > > via the email link, only send the user to this page is the hash key
> > > validates.
>
> > > That should work
>
> > > Hope it helps
>
> > > Cheers
>
> > > Marcus
>
> > > Another way
>
> > > On Nov 11, 8:38 pm, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
>
> > > > > Yes i thought about this approach. But problem is that i need to make
> > > > > access only through email, without restrictions in visit count.
>
> > > > In that case don't check for a key's count, jsut allow it. Still use a
> > > > key though, ideally random per email sent out, something like:
>
> > > > $key = substr(md5($user['User']['name'].$user['User']['email']), 0, 20);
>
> > > > Only a really keen individual will bother trying to guess your hash
> > > > key, so only valid urls will work.
>
> > > > I don't see how you can stop people from passing the urls around
> > > > though if they can be used more than once. You can spoof the referrer,
> > > > so I really don't know how you could police it effectively.
>
> > > > hth
>
> > > > jon
>
> > > > --
>
> > > > jon bennett
> > > > w:http://www.jben.net/
> > > > iChat (AIM): jbendotnet Skype: jon-bennett
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Advice for building a simple CMS

2008-11-12 Thread Smelly_Eddie

I think I must be missing your question...Why not just add an order
field to the content table instead of the page name?

On Nov 12, 4:39 am, Atomic Guava <[EMAIL PROTECTED]> wrote:
> I'm currently developing a CMS which aims to have the following base
> functionality:
> a) Auth component with admin routing setup
> b) Dynamic 'Pages' controller to load pages from the database rather
> than flat files
> c) A HTML helper to output navigation at a given level of the
> hierachy / breadcrumb nav in my views
> d) support for multiple websites
>
> Basically, I've coded a + b + d above and come up with a nice clean
> design, but now I've run into an issue.
>
> Previously when I've built CMS style apps, I've used the Tree
> behaviour with much success. However, It's possible that the CMS might
> power more than one site, which screws with the moveUp() and moveDown
> () methods for the tree behaviour.
>
> So I'm a bit lost now and was wondering:
> what is the best way to achieve unlimited, nested, dynamic, CMS-
> powered pages with the ability to change the order?
>
> I've read up on find all threaded in this group and in the book, which
> seems to give me the ability to create the nested page hierarchy I
> require, but what about reordering this data? I could cheat and order
> by page title, but to be honest, there will always be a client who
> won't want this :)
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: acess url only from email

2008-11-12 Thread Smelly_Eddie

That still does not prevent a user from sharing the original url in
the email. Anyone that visits the first page could see the second.

It seems like this is a  moot point if you use authentication or email
tickets, which would be a much more sound approach.

Any solution you may come up with will not be secure since there is no
unique way to identify the source as an email. Some web based email
will show the referrer as the provider (gmail, yahoo) but client based
applications (thunderbird or outlook) will have a blank referrer.

-EW

On Nov 11, 4:16 pm, Marcus Silva <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am not sure if I got your question right, but if I did you might be
> ok doing the following:
>
> Create an email hash key like Jon Bennett suggested, when the user
> comes back to your site take
>
> make the user go to a url on your site where you can check the hashed
> value, then send the user to another page, in that page check if the
> referer ($this->refefer()) was the page the user visited originally
> via the email link, only send the user to this page is the hash key
> validates.
>
> That should work
>
> Hope it helps
>
> Cheers
>
> Marcus
>
> Another way
>
> On Nov 11, 8:38 pm, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
>
> > > Yes i thought about this approach. But problem is that i need to make
> > > access only through email, without restrictions in visit count.
>
> > In that case don't check for a key's count, jsut allow it. Still use a
> > key though, ideally random per email sent out, something like:
>
> > $key = substr(md5($user['User']['name'].$user['User']['email']), 0, 20);
>
> > Only a really keen individual will bother trying to guess your hash
> > key, so only valid urls will work.
>
> > I don't see how you can stop people from passing the urls around
> > though if they can be used more than once. You can spoof the referrer,
> > so I really don't know how you could police it effectively.
>
> > hth
>
> > jon
>
> > --
>
> > jon bennett
> > w:http://www.jben.net/
> > iChat (AIM): jbendotnet Skype: jon-bennett
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using maven for deployment

2008-11-06 Thread Smelly_Eddie

Bob:

Have you made nay progress on this.  Thinking about it got me very
excited.

I am very new to Maven itself, but I have begun looking into creating
pom files for CakePHP.

I don't want to reinvent the wheel though if your already moving
forward.

Eddie

On Oct 10, 10:12 am, Bob Mattax <[EMAIL PROTECTED]> wrote:
> Has anyone experimented with usingmavento bundle their website, and
> accumulate dependencies?
>
> I'm being asked to do so for our website, as all our other projects
> are integrated into this deployment strategy.
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: File Download Problem

2008-10-29 Thread Smelly_Eddie

Da-Omiete Iboroma

I'm not sure why your email didn't make it to the board, but I'll try
to answer.


The file /etc/my.cnf and /etc/my.ini are interchangeable I believe.
Just depends on the naming convention in use.

The critical thing is to include the 'group'  [mysqld]  and to restart
mysql

/etc/init.d/mysql restart

If your hosting with a service provider (i.e. not running your own
server), you may need to check with them on just where such  a setting
would go, and if it would even be respected.  And then it would just
be a matter of time before the mysql server is restarted t see the
changes.

On a side note.  Uploading files approaching half a gigabyte into
mysql tables sounds like a disaster waiting to happen. Although in
theory the max packet may be up to 1gig, the effect on performance
would be crippling, if your server does not time-out just trying to
move the data around.


HTH,

Eddie

>Thanks but please where can I find /etc/my.cnf? I only have my.ini and 
>my-huge.ini, my-medium.ini, my-small.ini

>And I have increased max_allowed_packet=512M.  And it is still not working.

>Thanks

>Damelinks
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: File Download Problem

2008-10-26 Thread Smelly_Eddie

I just discovered that the default value on mysql server is 1MB. You
can increase the value by adding the following lines to /etc/my.cnf.

[mysqld]
max_allowed_packet=8M

On Oct 23, 1:49 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> I know your uploading to MySQL, but it might be the php engine that
> iss cutting you off.
> Check max_upload_size in php.ini, it might be set to 1 MB.
>
> My site's db only uses a Medium blob, and as you can see I have a 1.3
> MB file, among others.
> 1       [BLOB - 23.7 KiB]
> 1       [BLOB - 715 B]
> 1       [BLOB - 13.7 KiB]
> 1       [BLOB - 255.0 KiB]
> 1       [BLOB - 1.3 MiB]
> 1       [BLOB - 756.8 KiB]
>
> And here is the sql i used to create the table. I made no other
> special settings. you'll notice it is a binary table though
>
> CREATE TABLE `digbiz_project_files` (
>   `id` int(11) NOT NULL auto_increment,
>   `project_id` int(11) NOT NULL,
>   `user_id` bigint(20) NOT NULL,
>   `name` varchar(75) collate utf8_bin NOT NULL,
>   `type` varchar(255) collate utf8_bin NOT NULL,
>   `size` int(11) NOT NULL,
>   `data` mediumblob NOT NULL,
>   `created` datetime default NULL,
>   `modified` datetime default NULL,
>   PRIMARY KEY  (`id`),
>   KEY `project_id` (`project_id`),
>   KEY `user_id` (`user_id`)
> ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_bin
> AUTO_INCREMENT=9 ;
>
> How did you come up with the 999kb limit? Are you sure it is not
> related to the time (php timing out etc)
>
> How do you move the file from the temporary uploaded location to the
> db?
>
> Regards,
>
> Eddie
>
> On Oct 22, 5:38 am, "Da-Omiete Iboroma" <[EMAIL PROTECTED]> wrote:
>
> > Thanks but I  am using just that.  But it cannotuploadany file that
> > is more than 999kb.
>
> > Is there any configuration that I will do to phpmyadmin so that it can
> >uploadfiles that are more than 999kb?
>
> > Thanks
>
> > On 10/21/08, Thanga Durai <[EMAIL PROTECTED]> wrote:
>
> > > If you are using blob data type make it as longblob.
>
> > > Thangadurai.
>
> > > On Tue, Oct 21, 2008 at 4:57 PM, AD7six <[EMAIL PROTECTED]> wrote:
>
> > >> On Oct 20, 3:41 pm, "Da-Omiete Iboroma" <[EMAIL PROTECTED]> wrote:
> > >> > Please I am having problem downloading pdf (Acrobat reader) files that
> > >> > I uploaded in mysql database.
>
> > >> > The file downloads but it does not embed the pdf file in the browser.
>
> > >> > Instead, it opens the pdf file and make the current page blank
>
> > >> > Below is the file download code.  Pls help me
>
> > >> >  > >> >  $db_name = "database_name";
> > >> > $table_name = "books_table";
> > >> > $connection = mysql_connect("localhost", "username", "password") or
> > >> > die("couldn't connect.");
>
> > >> As this has nothing to do with using CakePHP, thread closed.
>
> > >> Cheers,
>
> > >> AD- Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Resetting Lost Passwords

2008-10-25 Thread Smelly_Eddie

Thanks Martin.
Looks like the same concept, I noticed some things that made me
curios.

In implementation did you include the functionality within a users
component or a separate one dedicated to tickets?  Do you have a
different method to let logged in users change their credentials?

I am going to work on pulling more functionality out into the actual
component, and the same for the botcheck, which I have already begun.
I have such a poor patience to draw things before I get coding, and
mostly end up refactoring afterwards.


Regards,

EW

On Oct 24, 5:40 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> You got some nice functionality there. I think it could be reorganised
> a bit. At least from how I see a ticket system. I went with a slightly
> different approach a few years ago when I needed similar
> functionality. It is the same basic functionality but the code has a
> different organisation from your 
> code.http://bakery.cakephp.org/articles/view/ticket-component-resetting-us...
>
> -The component deals only with ticket management and is the only place
> where tickets are created and managed.
> -Generally components should not have their own models I hear but in
> this situation it is totally valid, I think.
> -The controller uses the component to create and check and use
> tickets, for password resets in this case.
> -Another controller uses the same ticket component to keep sessions
> alive and "pseudo authenticate" requests from embedded plugins.
>
> I still use it and like it. Maybe you see some detail or two you like.
> /Martin
>
> On Oct 24, 10:51 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > Allowing users the ability to change passwords is a no brainer.
>
> > But what do you do if a user losses their password?  Several months
> > ago I wrote a very simple component that works in conjunction with my
> > user model to issue tickets to user emails.
>
> > The ticket can be retrieved via email and allows users to enter a new
> > password.
>
> > The tickets are valid for 24 hours, carry a unique code that aligns to
> > that users email.  It is the bet way I could think to solve this
> > issue.
>
> > If you want to check it out and share advice, please do.
>
> >http://edwardawebb.com/programming/php-programming/cakephp/reset-lost...
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Resetting Lost Passwords

2008-10-24 Thread Smelly_Eddie

Allowing users the ability to change passwords is a no brainer.

But what do you do if a user losses their password?  Several months
ago I wrote a very simple component that works in conjunction with my
user model to issue tickets to user emails.

The ticket can be retrieved via email and allows users to enter a new
password.

The tickets are valid for 24 hours, carry a unique code that aligns to
that users email.  It is the bet way I could think to solve this
issue.

If you want to check it out and share advice, please do.

http://edwardawebb.com/programming/php-programming/cakephp/reset-lost-passwords-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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Hosting

2008-10-24 Thread Smelly_Eddie

Avoid GoDaddy like the plague.

Cheap yes,
but  support, service or features, NO.


For example, they have locked down access to mysqldump, take days or
weeks to respond to issue tickets that are never resolved to
satisfaction, and eventually just get ignored.

They share too many slices on each server and performance reflects
that. Unless you want to host a 10 user site, Godaddy is not the way
to go.



On Oct 24, 3:11 pm, Mathew <[EMAIL PROTECTED]> wrote:
> http://www.lunarpages.com
>
> http://www.godaddy.com
>
> Those are good.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Adding/removing HABTM associations with existing model records

2008-10-23 Thread Smelly_Eddie

Perceptes, unless I am misunderstanding you, this is very easy to
solve.

Make sure your models have the right relationships.
Create an edit action and view for the group model.
In that edit view, for the groups model, add a multiple select list
using the permissions model.
You of course need to set a variable in the controller, but HABTM is
documented quite well in the manual.
Then view the page, and select or unselect the appropriate
permissions.
The relationship table will be updated accordingly.

This is CakePHP 101, and like I mentioned, is all in the manual.
http://book.cakephp.org/view/312/Models
'
EW

On Oct 23, 5:56 am, Perceptes <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have an issue that I would've thought is very common but after much
> searching around I cannot find information on it.  I am trying to
> figure out how to add and remove associations between two model
> records in a HABTM relationship where the model records already exist
> and aren't changing.  All the information I can find only talks about
> saving new model records with related data but not how to simply
> change associations between existing records.
>
> Example:
>
> Group <-- HABTM --> Permission
>
> Let's say I have a Group record with id = 1 and a Permission record
> with id = 5.
>
> How do I add a record with (group_id = 1, permission_id = 5) to the
> groups_permissions table from within PermissionsController?
>
> I've tried doing this in a few ways but even if I don't get an error
> when the script runs, records are not actually added/removed from the
> database table.  Do you have to tell Cake to add/remove associations
> like this manually or are you supposed to do it by somehow updating
> the parent model record and having Cake make the changes
> automatically?  I'm really lost on this conceptually.
>
> I have found this question asked in a couple other places but it is
> never answered.  Here is another thread that seems to be asking the
> same question:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/9dff77d7...
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CMS solutions

2008-10-23 Thread Smelly_Eddie

Burn

On Oct 23, 2:53 pm, gravyface <[EMAIL PROTECTED]> wrote:
> FarshadBinNasoordeen wrote:
> > I am new to PHP and i am looking forward to upgrade my site into a cms
> > system currently its not a cms system if i wanna add a new menu to my
> > site i have to add that menu to each and evry page this makes me sick
> > some times So recently i heard about JOOMLA an open source CMS
> > solution a superb CMS Solution but i din use it cuz i wanna put my own
> > web design but Joomla doesnt support that and the templates are costly
> > I am planning to develop my own CMS solution or a JOOMLA template
>
> > SO i need some advice+help regarding
> > 1.> How to Devland a CMS using PHP+MySQL?
> > 2.> HOW to develop Joomla templates?
>
> > Please specify the any tutorial links if u have
>
> First of all, you're submitting to the wrong group.  Secondly, you've
> been misinformed about "...my own web design but Joomla doesnt support
> that" because you can certainly create your own templates in Joomla.
>
> Try Googling for "joomla template tutorial".  I realise that English is
> not your first language so you perhaps your first trip to Google should
> be to translate "lazy" into your native tongue.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP create url's Rails way - rHelper

2008-10-23 Thread Smelly_Eddie

Nookie:

What are you using to compare performance?

On Oct 22, 7:15 pm, Nookie <[EMAIL PROTECTED]> wrote:
> I've just create new helper to create urls faster then just using
> Router::url().
> You can check it here ->http://bin.cakephp.org/view/490647179
> I'll would like to know what you think about it and i'm waiting for
> suggestions.
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: File Download Problem

2008-10-23 Thread Smelly_Eddie

I know your uploading to MySQL, but it might be the php engine that
iss cutting you off.
Check max_upload_size in php.ini, it might be set to 1 MB.

My site's db only uses a Medium blob, and as you can see I have a 1.3
MB file, among others.
1   [BLOB - 23.7 KiB]
1   [BLOB - 715 B]
1   [BLOB - 13.7 KiB]
1   [BLOB - 255.0 KiB]
1   [BLOB - 1.3 MiB]
1   [BLOB - 756.8 KiB]

And here is the sql i used to create the table. I made no other
special settings. you'll notice it is a binary table though

CREATE TABLE `digbiz_project_files` (
  `id` int(11) NOT NULL auto_increment,
  `project_id` int(11) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `name` varchar(75) collate utf8_bin NOT NULL,
  `type` varchar(255) collate utf8_bin NOT NULL,
  `size` int(11) NOT NULL,
  `data` mediumblob NOT NULL,
  `created` datetime default NULL,
  `modified` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `project_id` (`project_id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_bin
AUTO_INCREMENT=9 ;

How did you come up with the 999kb limit? Are you sure it is not
related to the time (php timing out etc)

How do you move the file from the temporary uploaded location to the
db?

Regards,

Eddie

On Oct 22, 5:38 am, "Da-Omiete Iboroma" <[EMAIL PROTECTED]> wrote:
> Thanks but I  am using just that.  But it cannot upload any file that
> is more than 999kb.
>
> Is there any configuration that I will do to phpmyadmin so that it can
> upload files that are more than 999kb?
>
> Thanks
>
> On 10/21/08, Thanga Durai <[EMAIL PROTECTED]> wrote:
>
>
>
> > If you are using blob data type make it as longblob.
>
> > Thangadurai.
>
> > On Tue, Oct 21, 2008 at 4:57 PM, AD7six <[EMAIL PROTECTED]> wrote:
>
> >> On Oct 20, 3:41 pm, "Da-Omiete Iboroma" <[EMAIL PROTECTED]> wrote:
> >> > Please I am having problem downloading pdf (Acrobat reader) files that
> >> > I uploaded in mysql database.
>
> >> > The file downloads but it does not embed the pdf file in the browser.
>
> >> > Instead, it opens the pdf file and make the current page blank
>
> >> > Below is the file download code.  Pls help me
>
> >> >  >> >  $db_name = "database_name";
> >> > $table_name = "books_table";
> >> > $connection = mysql_connect("localhost", "username", "password") or
> >> > die("couldn't connect.");
>
> >> As this has nothing to do with using CakePHP, thread closed.
>
> >> Cheers,
>
> >> AD- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Creating a Settings / preferences Component

2008-10-19 Thread Smelly_Eddie

Better yet.

What area should I add code to load Persistent Global variables across
all my pages.

That way i can just load all my settings at first visit, and skip all
this trouble.

__SITE_SETTINGS['BotcheckMinMax'];
__SITE_SETTINGS['SiteName'];
__SITE_SETTINGS['Tagline'];
etc..

I;m thinking I'll call the model from the *app_controller*, and pass
the settings back as an array to set as a global variable.




On Oct 18, 7:36 pm, Pablo Viojo <[EMAIL PROTECTED]> wrote:
> Sent from my iPhone
>
> On 18-10-2008, at 17:07, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I am having some trouble with the proper way to go about modeling
> > this. I would love suggestions.
>
> > I have a simple database with an id, key and value fields.   I made an
> > administrative model, controller and views to add and manage the table
> > of options.
>
> > I have some functions in the model that return values based on the
> > criteria, and I can call this from any controller easily.
> > $minMax= $this->Setting->getBotcheckMinMax();
>
> > I need a clean way to let models access the data within this table.
> > And I don't want to use relationships because the records really
> > relate specifically to any model, but may be used by any.
>
> > I tried importing via;
> > App::import('Model'.'Setting')
>
> $Setting = new Setting();
> $Setting->getMinMax()
>
>
>
> > Setting::getMinMax()
>
> > But it died trying to connect to the table once the settings method
> > was called.
>
> > It would be nice to build a component that could be access by the
> > model.  I just don't want to bulk up every controller that wants to
> > use some settings. It would be nicer to keep that in the models.
>
> > Regards,
> > Eddie
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Creating a Settings / preferences Component

2008-10-19 Thread Smelly_Eddie

No i have an instance of my model. and It works fine. Pablo was right
about my mistake there.

I am more concerned with the principle of having to call a model form
a model. I want to know how to create a component that can access
multiple models.



On Oct 19, 11:27 am, David Persson <[EMAIL PROTECTED]> wrote:
> You can get an instance of your Setting model by using the
> ClassRegistry:
>
> $Setting =& ClassRegistry::init('Setting');
> $Setting->getMinMax();
>
> Or did I misunderstand you?
>
> -David
>
> On 19 Okt., 17:15, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > Thanks Pablo.
>
> > Helps when you instantiate huh?
>
> > But still is there a more CakePHp way to do this then calling models
> > from within models.  Seems like there should be a cleaner way.
>
> > EW
>
> > On Oct 18, 7:36 pm, Pablo Viojo <[EMAIL PROTECTED]> wrote:
>
> > > Sent from my iPhone
>
> > > On 18-10-2008, at 17:07, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > > > I am having some trouble with the proper way to go about modeling
> > > > this. I would love suggestions.
>
> > > > I have a simple database with an id, key and value fields.   I made an
> > > > administrative model, controller and views to add and manage the table
> > > > of options.
>
> > > > I have some functions in the model that return values based on the
> > > > criteria, and I can call this from any controller easily.
> > > > $minMax= $this->Setting->getBotcheckMinMax();
>
> > > > I need a clean way to let models access the data within this table.
> > > > And I don't want to use relationships because the records really
> > > > relate specifically to any model, but may be used by any.
>
> > > > I tried importing via;
> > > > App::import('Model'.'Setting')
>
> > > $Setting = new Setting();
> > > $Setting->getMinMax()
>
> > > > Setting::getMinMax()
>
> > > > But it died trying to connect to the table once the settings method
> > > > was called.
>
> > > > It would be nice to build a component that could be access by the
> > > > model.  I just don't want to bulk up every controller that wants to
> > > > use some settings. It would be nicer to keep that in the models.
>
> > > > Regards,
> > > > Eddie
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Creating a Settings / preferences Component

2008-10-19 Thread Smelly_Eddie

Thanks Pablo.

Helps when you instantiate huh?

But still is there a more CakePHp way to do this then calling models
from within models.  Seems like there should be a cleaner way.

EW

On Oct 18, 7:36 pm, Pablo Viojo <[EMAIL PROTECTED]> wrote:
> Sent from my iPhone
>
> On 18-10-2008, at 17:07, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I am having some trouble with the proper way to go about modeling
> > this. I would love suggestions.
>
> > I have a simple database with an id, key and value fields.   I made an
> > administrative model, controller and views to add and manage the table
> > of options.
>
> > I have some functions in the model that return values based on the
> > criteria, and I can call this from any controller easily.
> > $minMax= $this->Setting->getBotcheckMinMax();
>
> > I need a clean way to let models access the data within this table.
> > And I don't want to use relationships because the records really
> > relate specifically to any model, but may be used by any.
>
> > I tried importing via;
> > App::import('Model'.'Setting')
>
> $Setting = new Setting();
> $Setting->getMinMax()
>
>
>
> > Setting::getMinMax()
>
> > But it died trying to connect to the table once the settings method
> > was called.
>
> > It would be nice to build a component that could be access by the
> > model.  I just don't want to bulk up every controller that wants to
> > use some settings. It would be nicer to keep that in the models.
>
> > Regards,
> > Eddie
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Creating a Settings / preferences Component

2008-10-18 Thread Smelly_Eddie

I am having some trouble with the proper way to go about modeling
this. I would love suggestions.

I have a simple database with an id, key and value fields.   I made an
administrative model, controller and views to add and manage the table
of options.

I have some functions in the model that return values based on the
criteria, and I can call this from any controller easily.
$minMax= $this->Setting->getBotcheckMinMax();

I need a clean way to let models access the data within this table.
And I don't want to use relationships because the records really
relate specifically to any model, but may be used by any.

I tried importing via;
App::import('Model'.'Setting');
Setting::getMinMax()

But it died trying to connect to the table once the settings method
was called.

It would be nice to build a component that could be access by the
model.  I just don't want to bulk up every controller that wants to
use some settings. It would be nicer to keep that in the models.

Regards,
Eddie
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation using controller

2008-10-14 Thread Smelly_Eddie

bookme try reading up on the cakephp manual or api regarding
validation. All your questions are answered very sufficiently there.

On Oct 13, 2:17 pm, bookme <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am using Integrate CakePHP with Kcaptcha from bakery.
>
> Finding problem at the time of captcha validation from controller.
>
> I found below code
> $this->User->validate = array('captchaText' => array('Mycaptcha' =>
> array('method' => 'validateCaptcha', 'message' => 'your error
> message')));
>
> I tried to find out definition for this method but could not succeeded
>
> Can any one tell me what's Mycaptcha here and where should I write
> code for validateCaptcha function.
>
> I put this code at three different places but could not succeed, User
> model , captcha component or a helper validation.php
>
> Please tell me what 's Mycaptcha and where should i put code of
> validateCaptcha function.
>
> Or can somebody tell me how to set error message from controller ?
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: access session.userid in model?

2008-10-14 Thread Smelly_Eddie

Here's the short,
It is possible to retrieve any value from Session, so long as you
store it there first.

A simple search in this mail group or on the web would have revealed
this thread already discussing this topic in detail;
http://groups.google.com/group/cake-php/browse_thread/thread/8911d61137f80eb5/56bc09a3210ebe79?hl=en&lnk=st&q=%22Checking+user+session+in+model%22#56bc09a3210ebe79

Please search before posting :)

On Oct 13, 4:17 pm, rocket <[EMAIL PROTECTED]> wrote:
> im on cake 1.1 and was wondering if it is possible to access the
> session.(user.id) in the 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Hosting A Cake App On GoDaddy!

2008-10-13 Thread Smelly_Eddie

I'm running godaddy hosting for all my domains, several cakephp apps.

What issues are you having?

If it is redirect issues than I know the fix.

in the files .htaccess in cake/, cake/app/, and cake/app/webroot/ i
think.

You need to edit them to add the magic words,

RewriteBase /

Add this before any rewrite rules, e.g.


   RewriteEngine on
RewriteBase /
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]


And this will prevent the need to add / in all the rules. :)

After you upload all three with the changes give it about 20 minutes
to be 'picked up.'

I am pretty sure that was the only major change I had to make.

Good luck!

BTW I highly do not recommend their hosting plans, cheap domains
though.

On Oct 13, 6:43 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> If GoDaddy is anything like anything like 1and1 mod_rewrite may work with a
> minor change
>
> seehttp://www.klevo.sk/cakephp/cakephp-and-some-web-hosts/
>
> I have found that 1and1 uk requires adding a few / (in the following example
> my app is installed in a directory named v6)
>
> AddType x-mapp-php5 .php
> 
>     RewriteEngine on
>     RewriteRule /v6$ /v6/ [L]
>     RewriteRule    ^$    /v6/webroot/    [L]
>     RewriteRule    (.*) /v6/webroot/$1    [L]
> 
>
> this works on business pro accounts (not below)
>
> that might help - S
>
> 2008/10/13 mehodgson <[EMAIL PROTECTED]>
>
>
>
> > I tried setting one up on go daddy once, but ran into a lot of
> > issues.  The main one being it is not possible to use MOD_REWRITE, so
> > you have to use the cakephp url rewriting alternative.  I was able to
> > get things working once I did that, but not having the clean urls
> > possible with MOD_REWRITE is a big disadvantage with go daddy.
>
> > On Oct 13, 6:08 am, AceStudio <[EMAIL PROTECTED]> wrote:
> > > A client of mine purchased a web hosting package on GoDaddy but after
> > > i uploaded the application on it... it wasn't working. i have been
> > > racking my head on how to make it work but all to no avail.
>
> > > I need to know who has successfully hosted on a GoDaddy server, so the
> > > person could tell me how he tweaked the server.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: captcha validation from controller

2008-10-13 Thread Smelly_Eddie

I find CAPTCHA images to be a hassle on the sites I visit and don't
subject my users to the same.

You may want to try scrapping that approach and instead using logic
questions.

For instance, ask users if the sky is blue, if snowmen melt under
extreme heat, or whether a brick or a feather is heavier.

The question can use variables passed by the controller, or an actual
model full of different questions to be loaded randomly.

You can than validate that field like any other.

An example is http://digbiz.baungenjar.com/users/register where I ask
a simple math question to new users.  Although i must recommend NOT
using math problems, intelligent bots can solve these problems.
(http://www.google.com/search?q=eight+minus+three) Since that site is
just a POC for a client I haven't bothered to change it.

Just thought I would suggest another approach :)

On Oct 12, 2:11 pm, bookme <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am using Integrate CakePHP with Kcaptcha from bakery.
>
> Finding problem at the time of captcha validation from controller.
>
> I found below code
> $this->User->validate = array('captchaText' => array('Mycaptcha' =>
> array('method' => 'validateCaptcha', 'message' => 'your error
> message')));
>
> I tried to find out definition for this method but could not succeeded
>
> Can any one tell me what's Mycaptcha here and where should I write
> code for validateCaptcha function.
>
> I put this code at three different places but could not succeed, User
> model , captcha component or a helper validation.php
>
> Please tell me what 's Mycaptcha and where should i put code of
> validateCaptcha function.
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to Create Subdomains on your localhost - host multiple projects at once

2008-10-10 Thread Smelly_Eddie

I was so excited when i figured this out, and I'm sorry if it is a 'no-
duh' scenario for some of you.  But for me this was huge.

You can host multiple CakePHP projects on your local machine, giving
each their own sub-domains. Before I would literally change the
document root setting in apache every time I wanted to work on a
different project. Now I have them all running live, without using sub-
directories that CakePHP doesn't play well with.

Its great.
** project1.localhost
** project2.localhost
etc.

They don't even have to be under your declared document root, any
directory can be setup as a sub-domain.

Anyway its very easy and I wrote it all up nice and neat like,

http://edwardawebb.com/web-development/create-subdomains-apache-easy

I hope that helps some of 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to validate password length

2008-09-28 Thread Smelly_Eddie

Mario:

I wrote some code that not only checks for a min. length, but also
requires a 'strong' password.

This means i make users use at least 1 non-word character and a
digit.   (ex. pas5_word). And I make them enter it twice!

I use unique error messages to warn when they dont match, and when it
is an invalid pattern. Helps eliminate user frustration.

I would love to hear your thoughts on it, and i hope it at least gets
you started if it doesn't meet your needs.

http://edwardawebb.com/programming/php-programming/cakephp/heavy-duty-password-validation-cakephp


Best Regards,



On Sep 27, 7:18 am, mario <[EMAIL PROTECTED]> wrote:
> i already have a 'password2' in my form for password confirmation.
> Can you please give me an example of what you are referring about?
>
> Thanks.^_^
>
> On Sep 27, 3:50 am, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
>
> > >  >  I want to validate the length of my password using the cakephp model's
> > >  >  validation. However, since the password is being hashed before it is
> > >  >  saved on the database, my length validation criteria becomes void. We
> > >  >  all know that a hashed password contains many characters.
>
> > > I would make a copy of 'password' before it gets to the Auth
> > >  component, and add a rule for that instead.
>
> > hmm, might have been a little hasty there, as you won't have a field
> > in your form for 'password_plain' and therefore won't ever see the
> > error message. How about adding an extra field to your form of
> > 'password_confirm', then adding the rule to that. If the confirmation
> > fails you'll then see the error message (and you can check they are
> > the same).
>
> > hth
>
> > jon
>
> > --
>
> > jon bennett
> > w:http://www.jben.net/
> > iChat (AIM): jbendotnet Skype: jon-bennett
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



CakePHP Group on LinkedIn

2008-09-11 Thread Smelly_Eddie

Just a news update!

The LinkedIn group is on the verge of 200 members. I am very happy to
see users support the framework.

If you would like to join and show your support by increasing
CakePHP's visibility;
http://www.linkedin.com/e/gis/82040

You can also show support to CakePHP monetarily -> http://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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: problem with user input -

2008-07-25 Thread Smelly_Eddie

Not sure what your trying to do...

Are you trying to validate user input before saving new records?

Are you trying to format existing records in an edit?

Are you just trying to strip html tags from the post?

On Jul 25, 3:49 am, Web Test <[EMAIL PROTECTED]> wrote:
> i have a company adding form which contain 2 fields one for company
> name and other for the type .In the company name text box i tied to
> enter this 
>
> This creates a text box in the company listing instead of  displaying
> the entered text.
> How can we apply the htmlentiies () function with posted data?
>
> Can we use the sanitize helper ?
>
> When i tired to use the following code,but it generate a error that
> Undefined class name 'sanitize'
>
> App::import('Sanitize');
> class MyClass extends App Controller
> {
>
>   function  myfunction()
> {
>   *$company_name =  Sanitize::addslashes($this->data['Company']
> ['name']);
>
> }
>
> }
>
> can any one please tell me how can we validate such malicious
> inputs ?
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



  1   2   >