Re: CakePHP with directory password protection?

2008-04-18 Thread Sourabh Sharma

In app folder of cake PHp we have 3 .htaccess files one is in root,
second is in app folder and third is in webroot folder. if you are
changing one .htaccess file then you have to change other also
accordingly i think so .

Thanks & Regards
Sourabh sharma

On Apr 19, 7:16 am, "b logica" <[EMAIL PROTECTED]> wrote:
> You shouldn't use 2 blocks like that. Try this:
>
> 
>RewriteEngine On
>RewriteBase /
>RewriteRule ^/grades - [L]
>RewriteRule ^$ app/webroot/[L]
>RewriteRule (.*) app/webroot/$1 [L]
> 
>
> On Fri, Apr 18, 2008 at 4:15 PM, Jon <[EMAIL PROTECTED]> wrote:
>
> >  I have CakePHP installed, and naturally it uses mod_rewrite to make
> >  the URLs clean.  I made a modification to the htaccess file to allow
> >  me to ignore it for a certain directory.  But then within that
> >  directory, I have an htaccess that defines password protection of that
> >  directory.  Now I get a 404 error.  How can I keep password
> >  protection, but allow it to function as normal?  Here are my files:
>
> >  .htaccess in document root:
> >  
> > RewriteEngine On
> > RewriteBase /
> > RewriteCond %{REQUEST_URI} grades
> > RewriteRule ^.*$ - [L]
>
> >  
>
> >  
> >RewriteEngine on
> >RewriteRule^$ app/webroot/[L]
> >RewriteRule(.*) app/webroot/$1 [L]
> >  
>
> >  .htaccess in the directory I want to protect:
> >  AuthType Basic
> >  AuthName "Restricted Area"
> >  AuthUserFile "/home/username/.htpasswds/public_html/grades/csv/passwd"
> >  require valid-user

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Controllers without Views

2008-04-18 Thread Sourabh Sharma

yeah you can create a controller without any view, you can easy put
the view in the controller also. But that is the bad practice and then
what is the benifit of MVC structure. We can do anything of own with
cakePHP but if we follow the instruction of structure then performance
of our application is best.

Thanks & Regards
Sourabh Sharma

On Apr 19, 5:51 am, Wizardry <[EMAIL PROTECTED]> wrote:
> Is it possible to have a controller that prints a simple 'Hello World'
> without having an underlying index view?
>
> In case anyone is wondering why would I want such a thing, well I
> wanted to test the performance of the CakePHP framework and wished to
> know the differences in response time for the controller making a call
> to the view to do an action and correspondingly doing it itself.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Best practice for setting current user variable?

2008-04-18 Thread Sourabh Sharma

I don't understand the question but if you want to say that you want
to access the which user sis logged in then you have to create
afunction for log in the APP Controller file, then you can access
easily in the whole controller because we extends the very controller
to APPController.

Please explain your question so we easily provide the best solution.

Thanks & Regards
Sourabh Sharma

On Apr 19, 6:44 am, "b logica" <[EMAIL PROTECTED]> wrote:
> I store a $user array in the Session upon login and then read() it in
> whichever methods I need some bit of info (mostly the ID, of course).
>
> On Fri, Apr 18, 2008 at 7:39 PM, John R <[EMAIL PROTECTED]> wrote:
>
> >  How do you all set the current user per controller?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Which CakePHP version should I use?

2008-04-18 Thread Sourabh Sharma

Hello All,

I am working on a cakephp from the last one year in stable version but
i notice that in the latest version of cakephp ie. beta version more
have more good functionality in that. So I prefer to use that beta
version of cakephp.

Thanks
Sourabh Sharma

On Apr 18, 8:04 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> > where can i get the manual about this?
>
> http://book.cakephp.org
>
> > i also get confused with the form helper such as form->create(), how to
> > change the model n the destination where i'll post the form?
>
> $form->create('Post', array('url' => array('controller' => 'cake',
> 'action' => 'is_great')));
> $form->create('Post', array('url' => '/cake/is_great'));
>
> > i tried to generete the api reference using javadocs, some past it was so
> > helpfull but i hope i can get a better one, anyone have?
>
> > thanks,
>
> > On Fri, Mar 7, 2008 at 4:50 AM, SumanRS <[EMAIL PROTECTED]> wrote:
>
> > > > Oh I forget about:
>
> > > > * Improved models validation
> > > > * Localization and Internationalization
> > > > * New Shells
>
> > > Baking (to automatically generate models, views, controllers and
> > > more)! :)
>
> > > I would vote this as the best new feature and a really powerful one.
> > > It makes development on CakePHP so much easier...
>
> > --
> > inoex135
> > I'm a newbie who want to be a hacker
> >http://inoex135.wordpress.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug with findAllThreaded

2008-04-18 Thread Sourabh Sharma

Hello,

But I use that findAllThreaded its works fine for me. But we have to
only take care about parent id  relationship. I followed the
instruction from manual. Or may be there is difference of versions. I
am using betaversion of cakephp.

I folowed the instruction from this

http://docs.cakephp.nu/discuss/show/Model/findAllThreaded

Thanks
Sourabh Sharma

Renan Gonçalves wrote:

> Hello,
>
> I was trying the method findAllThreaded and I have found a bug!
> I have been tested this in Cake 1.2, but problaly the bug is on 1.1 too.
> There is a table called sections (model Section) with id, parent_id,
> created, modified and name.
>
> When I try to sort this data with $sections =
> $this->Section->findAllThreaded(null, null, 'Section.name ASC'); the result
> is only one Section, but there are 5.
> The only way to get all data is sorting by modified field.
>
> The problem is in:
> /**
>  * Private, recursive helper method for findAllThreaded.
>  *
>  * @param array $data Results of find operation
>  * @param string $root NULL or id for root node of operation
>  * @param integer $index last processed index of $data
>  * @return array Threaded results
>  * @access private
>  * @see Model::findAllThreaded()
>  */
> The way to fix it is dont keeping the last processed index, but the
> processeds indexes... I guess.
>
> There is a ticket invalidated by phpnut. Why?
> https://trac.cakephp.org/ticket/3924
>
> I opened the ticket with new information.
>
> --
> Renan Gon�alves - Software Engineer
> Cell Phone: +55 11 8633 6018
> MSN: [EMAIL PROTECTED]
> S�o Paulo - SP/Brazil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: single view for multiple controllers

2008-04-17 Thread Sourabh Sharma

Render is very useful if you are using a same view with different
controller

Thanks & Regards
Sourabh Sharma

On Apr 17, 11:34 am, damo <[EMAIL PROTECTED]> wrote:
> thanks for your replies.  I will probably just go with the simple
> render option as this seems ridiculously easy to do!  What would be
> the benefit of using the (slightly) more complicated elements option?
>
> I am also trying to figure out how to modify multiple records with a
> single form.  I see that there has been a ticket open and closed on
> this topic which requires patching of some of the config files.  Is
> this still the only way of achieving this?
>
> On Apr 16, 8:05 pm, TechSteve <[EMAIL PROTECTED]> wrote:
>
> > vote for this way.
>
> > Femi Taiwo's method is perfect, but for simple use, if you just have
> > these two actions to be rendered in the same view, easier way will be
> > better in my mind.
>
> > On Apr 16, 2:19 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > > function viewx() {
> > >   $this->set('students', ...);
> > >   $this->render('viewall');
>
> > > }
>
> > > On Apr 16, 6:52 am, damo <[EMAIL PROTECTED]> wrote:
>
> > > > Can't seem to figure this one out.
>
> > > > I have two controllers that I would like to use the same view for.
> > > > Here is how they are:
>
> > > > function viewall()
> > > > {
> > > > $this->set('students', $this->Student->findAll(array( 
> > > > 'Student.status' => "Active" )));
>
> > > > }
>
> > > > function viewx()
> > > > {
> > > > $this->set('students', $this->Student->findAll(array( 
> > > > 'Student.status' => "Active",
>
> > > > 'Student.state' != "X")));
> > > > }
>
> > > > What do I have to add to the 'viewx' to get it to render in the same
> > > > view as the viewall?
>
> > > > Many thanks
> > > > Damo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from 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 define a global function in bootstap.php?

2008-04-16 Thread Sourabh Sharma

But i think we have to use the vendors for 3rd party integration. for
simple functions we don't need to declare the functions in vendors
folder.

Thanks & Regards
Sourabh Sharma



On Apr 16, 5:22 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I asked something similar a while back and I believe the preferred way
> of including your own functions goes like this.
>
> Put your functions in a file in your "vendors" folder. Either one will
> do.
> Include your file in bootstrap.php using App::import('Vendor',
> 'basics');
>
> That is the most Cake-friendly way I know of.
>
> /Martin
>
> On Apr 16, 9:00 am, Sourabh Sharma <[EMAIL PROTECTED]> wrote:
>
> > If You want declare the global functions for your application then you
> > have create a file in parallel to bootstrap.php like
> > commonfunctions.php or if you want to declare the constants for your
> > application like constants.php
>
> > Then you have to include the both the files in the bootstap.php  then
> > you can use the function with out any constructor in any file of your
> > application
>
> > like if you declare a function abc() in the commonfunction and you
> > have to declare the commonfunction.php in bootstarp then you have to
> > use like this any file abc().
>
> > if you have any confusion so please mail me at
> > [EMAIL PROTECTED]
>
> > Thanks & Regards
> > Sourabh Sharma
>
> > On Apr 16, 10:43 am, Freshow <[EMAIL PROTECTED]> wrote:
>
> > > how to define a global function for all controllers in ./app/confing/
> > > bootstap.php ,and how to inplement it in controller ?
>
> > > :)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from 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 define a global function in bootstap.php?

2008-04-16 Thread Sourabh Sharma

If You want declare the global functions for your application then you
have create a file in parallel to bootstrap.php like
commonfunctions.php or if you want to declare the constants for your
application like constants.php

Then you have to include the both the files in the bootstap.php  then
you can use the function with out any constructor in any file of your
application

like if you declare a function abc() in the commonfunction and you
have to declare the commonfunction.php in bootstarp then you have to
use like this any file abc().

if you have any confusion so please mail me at
[EMAIL PROTECTED]

Thanks & Regards
Sourabh Sharma



On Apr 16, 10:43 am, Freshow <[EMAIL PROTECTED]> wrote:
> how to define a global function for all controllers in ./app/confing/
> bootstap.php ,and how to inplement it in controller ?
>
> :)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pagination

2007-04-30 Thread Sourabh Sharma

You now how to use the multiple pagination in the same page

On 30 Apr, 20:15, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 4/30/07, Sourabh Sharma <[EMAIL PROTECTED]> wrote:
>
>
>
> > I want to use the multiple pagination in the single page if any one
> > can  guide me as soon as possible
>
> WOW! another chance for me to earn my $ million - don't spoil it for me MI ;)
>
> T
>
> --
> =
> PHP for E-Biz:http://sanisoft.com
> Cheesecake-Photoblog needs you!:http://cheesecake-photoblog.org
> =


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Pagination

2007-04-30 Thread Sourabh Sharma

I want to use the multiple pagination in the single page if any one
can  guide me as soon as possible

Thanks & Regards
Sourabh Sharma


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---