Share : CakeStrap - Ajax Template (CRUD, Search)

2013-04-01 Thread Sutikno
i was integrated :
- CakePHP + Bootstrap + JQuery (CakeStrap)
- Table : Categories
-* id int primary key auto inc
-* name varchar

check this :
http://www.itoey.com/hexa.zip

note: Indonesian Language

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: 3.0: a peek into CakePHP's future

2013-04-01 Thread Nematullah Atef
Dear,

thanks for sending,

i would like to be part of your team if you can give me chance.

best wishes
Nematullah Atef


On Mon, Apr 1, 2013 at 5:42 PM, André Luis  wrote:

> Nothing else at this subject? I am anxious for this version of Cake
>
> Em quinta-feira, 5 de julho de 2012 23h36min03s UTC-3, José Lorenzo
> escreveu:
>>
>> Since its creation, more than 7 years ago, CakePHP has grown with a life
>> of its own. Its main goal has always been to empower developers with tools
>> that are both easy to learn and use, leverage great libraries requiring low
>> documentation and low dependencies too. We've had several big releases
>> along these years and an ever growing community. Being one of the most
>> popular frameworks out there and probably the first one (!) we have also
>> gotten a lot of criticism from the developer community in general. We have,
>> though, accepted it and learnt from our mistakes to keep building the best
>> PHP framework there is.
>>
>> CakePHP is known for having a very slow pace of adopting new stuff and it
>> has served very well to its community. Back when we were doing version 2.0
>> we decided to hold on version 5.2 of PHP for multiple reasons and despite
>> it didn't let us innovate as much as we wished to, it was an excellent
>> choice given the general environment regarding hosting solutions and
>> general adoption of PHP 5.3. A look back into the past reminded us that we
>> were big innovators in PHP, bringing features to developers that few dreamt
>> possible to do in this language. Now, it's time to look ahead in future and
>> decide on staying in our comfort zone or take back our leading position as
>> innovators.
>>
>> So it is with great excitement that we announce we are putting our our
>> efforts in bringing you the next major release of CakePHP. Version 3.0 will
>> leverage the new features in PHP 5.4 and will include an important change
>> in our models and database system. CakePHP 3.0 will not be ready less than
>> 6 or 8 months and we reckon that, given the rise of cheap cloud hosting
>> solutions and upcoming release of new operating system versions, there is
>> no better time to jump on the most current stable version of PHP.
>>
>> As you may already know, PHP 5.4 offers awesome features that would
>> introduce useful new concepts and interesting solutions to old problems.
>> Closure binding, traits, multibyte support are tools we see of great
>> usefulness for properly implemented advanced framework features we've had
>> in mind for a long time. Also new syntax sugar added to the language will
>> make it more pleasant to write both small and complex applications with the
>> framework and a always welcomed free performance increase.
>>
>> We have a young but already well defined road map for what we want to
>> accomplish in next release and you are invited to contribute and suggest
>> what's next:
>>
>>- Drop support for 5.2.x and support 5.4+ only
>>- Add proper namespaces for all classes. This will make it easier to
>>reuse classes outside CakePHP and to use external libraries and finally no
>>chances of collisions between your app classes and core ones.
>>- Use traits were possible and makes sense
>>- Improve bootstrapping process to allow more developer control and
>>better performance
>>- Model layer rewrite:
>>   - Models to return objects from queries
>>   - Datamapper-like paradigm
>>   - Richer query API
>>   - Support for any database type
>>   - Support for more database drivers both PDO and native
>>- Improve Router:
>>   - Make it faster
>>   - Remove named parameters
>>   - Add support for named routes
>>   - Smarter router prefixes
>>   - Shorter url syntax
>>
>> As you may imagine most of the time will be spent or rewriting the model
>> layer, but it will also be one of the most powerful features CakePHP 3.0
>> will have. It's new architecture based on PHP 5.4 capabilities will offer
>> an easier and more powerful set of tools to build web applications in no
>> time.
>>
>> If you are already as excited as we are this all this new stuff coming,
>> you definitely should meet us on next CakeFest  we'll
>> be talking about the future of CakePHP and hacking our way through to bring
>> you a dev release as soon as possible. Wouldn't it be lovely to attend to
>> awesome talks, workshops and also be part of the group deciding initial
>> architecture for next major version of the framework? Make sure you book
>> your tickets before we run out of them!
>>
>> We're always looking for different people having a vision on software
>> development, are you interested in helping out? There is no better time to
>> start sending patches and become one of the core team!
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to a topic in the
> Go

RE: html helper - image outside of webroot/img dir

2013-04-01 Thread Advantage+
No problem. Hope it helped. No expert but seems pretty straight forward so
glad I could help in any way.

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Robert Gravel
Sent: Monday, April 01, 2013 11:08 PM
To: cake-php@googlegroups.com
Subject: Re: html helper - image outside of webroot/img dir

 

Thanks. Got it

On Monday, April 1, 2013 9:27:12 PM UTC-4, advantage+ wrote:

Check CKEditor config settings for the folder to save files to and point it
to img/uploads or what not and refer as $this->Html->image('uploads/' .
$file) something along those lines. But if it's a CK image from the editor
package itself  just reference it as the correct path/filename

 

From: cake...@googlegroups.com 
[mailto:cake...@googlegroups.com  ] On Behalf Of Robert Gravel
Sent: Monday, April 01, 2013 10:42 PM
To: cake...@googlegroups.com  
Subject: html helper - image outside of webroot/img dir

 

Hi,
I need to display an image outside the webroot/img  dir for cake 1.3.
Specifically I have to link to an image in the ckeditor which is at
webroot/js/ckeditor...

When I use $this->Html->image() it gives me a reference at webroot/img by
default. Is there a solution that is portable between localhost   and server

Thanks
Rob G

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cake-php+u...@googlegroups.com  .
To post to this group, send email to cake...@googlegroups.com 
.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: html helper - image outside of webroot/img dir

2013-04-01 Thread Robert Gravel
Thanks. Got it

On Monday, April 1, 2013 9:27:12 PM UTC-4, advantage+ wrote:
>
> Check CKEditor config settings for the folder to save files to and point 
> it to img/uploads or what not and refer as $this->Html->image('uploads/' . 
> $file) something along those lines. But if it’s a CK image from the editor 
> package itself  just reference it as the correct path/filename
>
>  
>
> *From:* cake...@googlegroups.com  [mailto:
> cake...@googlegroups.com ] *On Behalf Of *Robert Gravel
> *Sent:* Monday, April 01, 2013 10:42 PM
> *To:* cake...@googlegroups.com 
> *Subject:* html helper - image outside of webroot/img dir
>
>  
>
> Hi,
> I need to display an image outside the webroot/img  dir for cake 1.3. 
> Specifically I have to link to an image in the ckeditor which is at 
> webroot/js/ckeditor...
>
> When I use $this->Html->image() it gives me a reference at webroot/img by 
> default. Is there a solution that is portable between localhost   and server
>
> Thanks
> Rob G
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+u...@googlegroups.com .
> To post to this group, send email to cake...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Img / Images folder

2013-04-01 Thread Advantage+
Not sure if this is a top priority but I do front end / back end and using
Photoshop it saves all sliced images to "images" folder so it is a pain in
the ass having to go into the folder, pull them and drop them in "img" to
reference them.

 

I tried changing the "img" folder but the only successful way was to
actually edit the Cake libs which is pretty much a no no,  and define() in
bootstrap resulted in errors. 

What is the best way to override "img" folder to actually use "images"?

 

Thanks,

 

Dave

 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




RE: html helper - image outside of webroot/img dir

2013-04-01 Thread Advantage+
Check CKEditor config settings for the folder to save files to and point it
to img/uploads or what not and refer as $this->Html->image('uploads/' .
$file) something along those lines. But if it's a CK image from the editor
package itself  just reference it as the correct path/filename

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Robert Gravel
Sent: Monday, April 01, 2013 10:42 PM
To: cake-php@googlegroups.com
Subject: html helper - image outside of webroot/img dir

 

Hi,
I need to display an image outside the webroot/img  dir for cake 1.3.
Specifically I have to link to an image in the ckeditor which is at
webroot/js/ckeditor...

When I use $this->Html->image() it gives me a reference at webroot/img by
default. Is there a solution that is portable between localhost   and server

Thanks
Rob G

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




html helper - image outside of webroot/img dir

2013-04-01 Thread Robert Gravel
Hi,
I need to display an image outside the webroot/img  dir for cake 1.3. 
Specifically I have to link to an image in the ckeditor which is at 
webroot/js/ckeditor...

When I use $this->Html->image() it gives me a reference at webroot/img by 
default. Is there a solution that is portable between localhost   and server

Thanks
Rob G

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: password protect entire site

2013-04-01 Thread cyboman
Thanks for all the replies. I still don't see a working htaccess hack here. 
Auth would work but it's already configured for the admin section, I'm not 
sure how to easily roll that out for the entire site and then remove it. 
Doesn't seem very straight forward where a htaccess password protect would.
It looks like cakephp needs apache configured rather specifically.

On Monday, March 18, 2013 7:23:43 PM UTC-4, cricket wrote:
>
> On Sun, Mar 17, 2013 at 6:29 PM, Eduardo Moreira 
> > 
> wrote: 
> > Why dont you use the cake Auth component? 
>
> Using Apache's authentication while it's being worked on means that 
> nobody sees _any_ part of the site. And Cake's authentication may not 
> be configured properly. 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Auth Component Issues

2013-04-01 Thread Ramon José Silva
Hi guys.

Well, I trying to use the CakePHP on my own project, but I have a problem 
with the Auth Component.

I'm not using the password hash yet and not using the UsersController and 
User Model, but I using Admin Model, AdminController and an Ajax, passing 
the form data to the controller login method, but I can't login in my 
system, the Auth always return false. I read the Docs trying to find 
something that's help me, and saw in the Auth part that I can personalized 
my form fields and tables to passing the data and everything works fine, 
but it not work for me.

If I use:

$this->data = array() and passing all data that I receive with Ajax to my 
Auth login, the login works fine, but not check if the User are subscribed 
on my DB. In the Docs have something about that, but with I try to login 
with the e-mail address and password that I registered, the Auth always 
return false even my User really exists in my DB.

This is my AdminController: http://pastebin.com/AvQQf6iw, 

This is my App Controller: http://pastebin.com/B5XBwR5g, 

This is my Ajax: http://pastebin.com/kQV7taWQ

Now, if I use in my login method this line: 

$query = $this->Admin->find('first', array('conditions' => 
array('admin_email' => $this->data['admin_email'], 'admin_pass' => 
$this->data['admin_pass'])));

if($query == true){
  echo 'true'; 
} else {
  echo 'Wrong User/Password';
}

I really find the user.

Can anyone help me with this?

Thanks Guys for the help anyway.



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Registration - Teacher & Students - Multiple Auth?

2013-04-01 Thread Nathan Pierce
Hey y'all, I got a question. 

I've got the registration form for my site putting stuff in the database, 
but I'm wondering if someone has any suggestions on how I can achieve some 
features.

1. I'm going to have a table for teachers and students. They will have two 
separate login forms on the site, one more simple than the other. I'm 
focusing on students right now, since it's using the UsersController, etc. 
I'm just wondering if someone has any suggestion on using cakephp and 
having two separate auth systems. Is there some documentation somewhere 
about this? I want two separate tables in the database, I don't want all 
users in one giant ass database table and then having roles, etc.

2. I need a way to identify student login sessions from teachers sessions 
so I can do some if logic and send them to the proper dashboard/etc. I'm 
new to cake, so I'm wondering if there is a best method someone can suggest 
to me. I'm trying to keep things standard to cake, which will be 
impossible, but I'm still trying. I'm guessing I need to assign a role to 
the user when they signup and then just use that. Right? Or should I use 
another system to do this and have them all in one database? I'd really 
like them split up..

Thanks for your time!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




CakePhP BreadCrumnbs problem

2013-04-01 Thread Franklin Piercing
What I did 

Hi, i´m working on a website where i have a view where i have a list of 
mattresses, on every item i have a link to a view/item_id. where i can see 
the specifications of the item. at the top of the view i will like to put a 
breadcrumb that looks something like Mattresses > item name. i can make it 
by adding the crumbs at the begining of the "view" view file, something 
like:
$this->Html->addCrumb('Mattresses',array('controller'=>'Mattresses','action'=>'index));
 
$this->Html->addCrumb('item 
Name',array('controller'=>'Mattresses','action'=>'view/itemId)); echo 
$this->Html->getCrumbs(' > ');

it works fine. Now, i have a View with a list of different Foam type, and 
just like the mattresses, i have a breadcrumb to see the speciffications of 
each Foam type and get something like foams/view/foam_id. inside this view 
i have a list of mattresses that are made with this kind of Foam. I will 
like to put a link on each mattress model so the user can go directly to 
the mattress specifications view (mattresses/view/item_id). now, i´ll like 
to have a breadcrumb in this file that looks something like this:

Foams > Foam Name > Mattress Name

so the user can navigate easily through the site. but i don´t know how can 
i achieve this. i don´t know if there is a way to have an stack of pages 
visited previously by the user.

i tred adding addcrumb on the foam view file but it does not works.
any idea?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Fatal error: Maximum execution time of 30 seconds exceeded

2013-04-01 Thread Ganapathi Raman
Hi,

  very interesting..! .. I got the same error, when i am new to the PHP..I
find that solution
It's nothing...Configure your php.ini file...change maximum execution time
30 seconds to 1 seconds.no need to worry..






On Wed, Mar 27, 2013 at 8:07 PM, Elias Munshya  wrote:

> i agree with
>
> On Thursday, August 6, 2009 6:44:37 AM UTC+2, Arif wrote:
>>
>> Thank you for your solution.
>> I have solved my problem according to ur suggestion(Given Function
>> name memory_limit).
>>
>> On Aug 2, 4:28 am, joshua  wrote:
>> > In my opinion you can give a bigger number to memorry_limit in php.ini.
>> >
>> > On 8/2/09, arif hossen  wrote:
>> >
>> >
>> >
>> > > --
>> > > Dear All,
>> > > Please help me ,
>> > > How i can solve below this problem in cakephp ,I want to unlimited
>> execution
>> > > time.
>> >
>> > > *Fatal error*: Maximum execution time of 30 seconds exceeded in *
>> > > D:\wamp\www\auctionsite\cake\**libs\folder.php* on line *445*
>> >
>> > > Regards,
>> > > Mohammad Arif Hossen
>> > > Web Developer
>> > > United Group International(UGIBD)
>> > >www.ugibd.net
>> > > Mobile no:  +88 01714355911
>> > > Mobile no:  +88 01922110308
>> >
>> > --
>> > Thanks
>> > Joshua
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to render a CSS/JS files with a version parameter?

2013-04-01 Thread Fabrício Muniz
Hello guys,
I need help to solve the following problem:

using:
echo $ this-> Html-> css (array ('forms', 'tables', 'menu'));

is rendered:




However, in cases, I will need to sequence the css and js files to make a 
versioning and avoid a possible cache in case of changes. I need outputs 
like:




How would I do this via html helper?

*I'm trainig my english

Many thks,
Fabrício

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Registration Question - Two Different Users (Not using User table)

2013-04-01 Thread Nathan Pierce
Hey everyone. If this has been answered before, I didn't find it on the 
forums. Please link me if it was.

I'm a newbie with Cake. I've gone through and understand the MVC setup and 
how it works. However, before I spend another countless hours I was 
wondering if someone could point me into the right direction or provide 
examples.

I'm using the newest release of CakePHP (2.3).
I have a site with a registration page at domain.com/register.

> Router::connect('/register', array('controller' => 'students', 'action' => 
> 'index')); 


 This page has a simple form with 

echo $this->Form->create('Student', array('action' => 'register'));
> echo $this->Form->input('Full Name');
> echo $this->Form->input('Email');
> echo $this->Form->input('Password');
> echo $this->Form->end('Register');
> ?>


*I then have StudentsController :*

function index() {
> $this->set('title_for_layout', 'Register');
> $this->layout = 'students';
> $this->Student->recursive = 0;
> $this->set('students', $this->paginate());
> }

function register() {
> if ($this->request->is('post')) {
> $this->Student->create();
> if ($this->Student->save($this->request->data)) {
>  $this->Session->setFlash(__('The user has been saved'));
> $this->redirect(array('action' => 'index'));
>  } else {
> $this->Session->setFlash(__('The user could not be saved. Please, try 
> again.'));
> }
> }
> }


*and Student (model) :*

App::uses('AuthComponent', 'Controller/Component');
>
> class Student extends AppModel {
> public $primaryKey = 'id';
> public $validate = array(
> 
> 'full_name' => array(
> 'rule' => 'alphaNumeric',
> 'message' => 'We need your name!',
> 'required' => true
> ),
> 'email' => array(
> 'rule' => 'email',
> 'message' => 'A valid email is required',
> 'required' => true
> ),
> 'password' => array(
> 'password_one' => array(
> 'rule' => array('minLength', '8'),
> 'message' => 'Password is required (duh). Minimum of 8 
> characters.',
> 'required' => true
>
>)
>
>
> ); //END VALIDATE
>
> }
>
>
>

 It's still messy too so ignore any errors (which don't affect what I'm 
trying to achieve) please. If I post the form, I get sent to /users/login. 
I'd like to be sent to /students/register since my router does it to 
/students/index. Then under register I want to handle all of the adding the 
user stuff (see "function register() {" in the code above).

What I'm trying to do is have the form register a user to the *students*table 
in my database. I will have to have another form on the site to 
register *teachers* and I want to keep them in separate databases. Problem 
is, all of the auth stuff is sent to UserController, which I don't want to 
use. I want to pass all Student login form stuff to the StudentController 
and all Teacher to the TeacherController.

In short, how do I achieve this? How do I force cakephp to use something 
other than the UserController to handle everything? If you need further 
clarification, please ask.

Thank you in advance!


 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: CakeDC Search Plugin - How to search 2 fields in DB using only 1 form field?

2013-04-01 Thread chapus
The correct approach as outlined in the readme is to use the array syntax:

 'field' => array('User.name', 'User.email', 'Profile.name',
'Profile.phone')


Now it works, I don't know why I didn't see that. Thank you.



--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/CakeDC-Search-Plugin-How-to-search-2-fields-in-DB-using-only-1-form-field-tp5164502p5714325.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Problem with nested AND / OR Condition

2013-04-01 Thread Carsten Wawer
Hey Folks

maybe I'm just at a loss, but how do I create a SQL command like this with 
cakePHP?

SELECT *
> FROM table
> WHERE id = 1 OR (column1='test1' AND id=2) OR (column1='test2' AND id=3)



Please do not ask about the meaning, I have simplified a more complex 
command to make the problem clear.

The Condition would have to actually something like this:


$options = array(
> 'conditions' => array(
> 'OR' => array(
> 'id' => 1,
> 'AND' => array(
> 'column1' => 'test1',
> 'id' => 2
> ),
> 'AND' => array(
> 'column1' => 'test2',
> 'id' => 3
> )
> )
> )
> );


But the second 'AND' overrwrites the first one.

Can someone give me a hint? I would be grateful! ;-)

Greetings!
Carsten

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Login function doesn't work on client server

2013-04-01 Thread Fernando Queiroz
Yesterday I finally finished my first project.

But when I test the admin login page I noticed that was no working, I put 
login and password correct and just back to the same page. After about 5 
min the login page simply  goes blank.  Every time I enter the login page 
goes blank.

What might be happening?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cake Gallery

2013-04-01 Thread Robert Gravel
Thanks


On Sat, Mar 30, 2013 at 11:50 PM, Chris  wrote:

> this is how I upload images and create thumbs in any sizes without any
> plugin,... of course you have to modify to your own needs,... don't forget
> to create subdirectories in webroot/photos/ original,... thumbs,... etc,...
> and chmod to 777
>
> function upload in photos_controller:
>
>
>   function upload()
>   {
> $this->authorize();
>
> $user = $this->User->findById($this->user['id']);
>
>
> if(!($user && ($user['User']['photos_limit'] == 0 ||
> $user['User']['photos'] < $user['User']['photos_limit'])))
> {
> exit('You reached your upload limit');
> }
> else
> {
>   $fileParts = $_FILES['Filedata']['name'];
>   $secret = $this->generateRandomString(20);
>   $name = str_replace(array('.jpg', '.jpeg', '.JPG', '.JPEG', '.png',
> '.PNG'), '', $fileParts);
>
>   if($this->Photo->save(array('Photo' => array('name' => $name,
> 'user_id' => $this->user['id'], 'secret' => $secret, 'hidden' => 0,
> 'privacy' => array_search($_GET['privacy'],
> Configure::read('Site.privacy'))
>   {
> $this->User->query('UPDATE fociki_users' .
> ' SET photos = photos + 1' .
> ', last_public_photo = (SELECT created FROM fociki_photos WHERE
> user_id = ' . $this->user['id'] . ' AND fociki_photos.privacy <= ' .
> array_search('public', Configure::read('Site.privacy')) .' ORDER BY created
> DESC LIMIT 1)' .
> ', last_friend_photo = (SELECT created FROM fociki_photos WHERE
> user_id = ' . $this->user['id'] . ' AND fociki_photos.privacy <= ' .
> array_search('friend', Configure::read('Site.privacy')) .' ORDER BY created
> DESC LIMIT 1)' .
> ' WHERE id = ' . $this->user['id']);
>
>
> $original_file = $this->Photo->getOriginalFile($this->Photo->id,
> $secret, true);
> $original_file_path = $original_file->pwd();
> $tempFile   = $_FILES['Filedata']['tmp_name'];
>
> move_uploaded_file($tempFile, $original_file_path);
>
> exec('/usr/bin/convert -geometry 400x350 ' . $original_file_path .
> ' ' . $this->Photo->getMediumFile($this->Photo->id, $secret)->pwd() .' >
> /dev/null 2>&1 &');
>
> exec('/usr/bin/convert -geometry 145x145 ' . $original_file_path .
> ' ' . $this->Photo->getSmallFile($this->Photo->id, $secret)->pwd() .' >
> /dev/null 2>&1 &');
>
> exec('/usr/bin/convert -thumbnail x150 -resize "150x<" -resize 50%
> -gravity center -crop 75x75+0+0 +repage ' . $original_file_path . ' ' .
> $this->Photo->getSquareFile($this->Photo->id, $secret)->pwd() .' >
> /dev/null 2>&1 &');
> exec('/usr/bin/convert -thumbnail x96 -resize "96x<" -resize 50%
> -gravity center -crop 48x48+0+0 +repage ' . $original_file_path . ' ' .
> $this->Photo->getBuddyFile($this->Photo->id, $secret)->pwd() .' > /dev/null
> 2>&1 &');
>
> exec('/usr/bin/convert -geometry 500x450 ' . $original_file_path .
> ' ' . $this->Photo->getLargeFile($this->Photo->id, $secret)->pwd() .' >
> /dev/null 2>&1 &');
>
>   }
>
>   echo 'OK';
>   die();
>
>   }
>   }
>
>
> and here is the Model photo.php
>
>  class Photo extends AppModel {
>   var $name = 'Photo';
>
> var $validate = array(
>  'user_id' => array(
>   'rule' => 'notEmpty'
>  ),
>  'name' => array(
>   'rule' => 'notEmpty'
>  ),
>  );
>
>   var $belongsTo = 'User';
>
>   var $hasMany = array(
> 'PhotoTag' => array('order' => array('tag' => 'ASC')),
> 'PhotoNote' => array('order' => array('created' => 'ASC')),
>   );
>
>
>
>   function getOriginalFile($id, $secret, $create = null, $chmod = null)
>   {
> return new File(WWW_ROOT . 'photos' . DS . 'original' . DS . $id . '-'
> . $secret . '.jpg', $create, $chmod);
>   }
>
>   function getLargeFile($id, $secret, $create = null, $chmod = null)
>   {
> return new File(WWW_ROOT . 'photos' . DS . 'large' . DS . $id . '-' .
> $secret . '.jpg', $create, $chmod);
>   }
>
>   function getMediumFile($id, $secret, $create = null, $chmod = null)
>   {
> return new File(WWW_ROOT . 'photos' . DS . 'medium' . DS . $id . '-' .
> $secret . '.jpg', $create, $chmod);
>   }
>
>   function getSmallFile($id, $secret, $create = null, $chmod = null)
>   {
> return new File(WWW_ROOT . 'photos' . DS . 'small' . DS . $id . '-' .
> $secret . '.jpg', $create, $chmod);
>   }
>
>   function getThumbFile($id, $secret, $create = null, $chmod = null)
>   {
> return new File(WWW_ROOT . 'photos' . DS . 'thumb' . DS . $id . '-' .
> $secret . '.jpg', $create, $chmod);
>   }
>
>   function getSquareFile($id, $secret, $create = null, $chmod = null)
>   {
> return new File(WWW_ROOT . 'photos' . DS . 'square' . DS . $id . '-' .
> $secret . '.jpg', $create, $chmod);
>   }
>
>   function getBannerFile($id, $secret, $create = null, $chmod = null)
>   {
> return new File(WWW_ROOT . 'photos' . DS . 'banner' . DS . $id . '-' .
> $secret . '.jpg', $create, $chmod);
>   }
>
>   function getBuddyFile($id, $secret, $create = null

Re: 3.0: a peek into CakePHP's future

2013-04-01 Thread André Luis
Nothing else at this subject? I am anxious for this version of Cake

Em quinta-feira, 5 de julho de 2012 23h36min03s UTC-3, José Lorenzo 
escreveu:
>
> Since its creation, more than 7 years ago, CakePHP has grown with a life 
> of its own. Its main goal has always been to empower developers with tools 
> that are both easy to learn and use, leverage great libraries requiring low 
> documentation and low dependencies too. We've had several big releases 
> along these years and an ever growing community. Being one of the most 
> popular frameworks out there and probably the first one (!) we have also 
> gotten a lot of criticism from the developer community in general. We have, 
> though, accepted it and learnt from our mistakes to keep building the best 
> PHP framework there is.
>
> CakePHP is known for having a very slow pace of adopting new stuff and it 
> has served very well to its community. Back when we were doing version 2.0 
> we decided to hold on version 5.2 of PHP for multiple reasons and despite 
> it didn't let us innovate as much as we wished to, it was an excellent 
> choice given the general environment regarding hosting solutions and 
> general adoption of PHP 5.3. A look back into the past reminded us that we 
> were big innovators in PHP, bringing features to developers that few dreamt 
> possible to do in this language. Now, it's time to look ahead in future and 
> decide on staying in our comfort zone or take back our leading position as 
> innovators.
>
> So it is with great excitement that we announce we are putting our our 
> efforts in bringing you the next major release of CakePHP. Version 3.0 will 
> leverage the new features in PHP 5.4 and will include an important change 
> in our models and database system. CakePHP 3.0 will not be ready less than 
> 6 or 8 months and we reckon that, given the rise of cheap cloud hosting 
> solutions and upcoming release of new operating system versions, there is 
> no better time to jump on the most current stable version of PHP.
>
> As you may already know, PHP 5.4 offers awesome features that would 
> introduce useful new concepts and interesting solutions to old problems. 
> Closure binding, traits, multibyte support are tools we see of great 
> usefulness for properly implemented advanced framework features we've had 
> in mind for a long time. Also new syntax sugar added to the language will 
> make it more pleasant to write both small and complex applications with the 
> framework and a always welcomed free performance increase.
>
> We have a young but already well defined road map for what we want to 
> accomplish in next release and you are invited to contribute and suggest 
> what's next:
>
>- Drop support for 5.2.x and support 5.4+ only
>- Add proper namespaces for all classes. This will make it easier to 
>reuse classes outside CakePHP and to use external libraries and finally no 
>chances of collisions between your app classes and core ones.
>- Use traits were possible and makes sense
>- Improve bootstrapping process to allow more developer control and 
>better performance
>- Model layer rewrite:
>   - Models to return objects from queries
>   - Datamapper-like paradigm
>   - Richer query API
>   - Support for any database type
>   - Support for more database drivers both PDO and native
>- Improve Router:
>   - Make it faster
>   - Remove named parameters
>   - Add support for named routes
>   - Smarter router prefixes
>   - Shorter url syntax
>
> As you may imagine most of the time will be spent or rewriting the model 
> layer, but it will also be one of the most powerful features CakePHP 3.0 
> will have. It's new architecture based on PHP 5.4 capabilities will offer 
> an easier and more powerful set of tools to build web applications in no 
> time.
>
> If you are already as excited as we are this all this new stuff coming, 
> you definitely should meet us on next CakeFest  we'll 
> be talking about the future of CakePHP and hacking our way through to bring 
> you a dev release as soon as possible. Wouldn't it be lovely to attend to 
> awesome talks, workshops and also be part of the group deciding initial 
> architecture for next major version of the framework? Make sure you book 
> your tickets before we run out of them!
>
> We're always looking for different people having a vision on software 
> development, are you interested in helping out? There is no better time to 
> start sending patches and become one of the core team!
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group