Wednesday, December 1, 2010

Re: Login from external service

On Tue, Nov 30, 2010 at 12:15 AM, Alex Schlieck <alex.schlieck@gmail.com> wrote:
>
> Url:
> localhost/server/users/login/username:name/password:pass

That looks like all sorts of insecure.

> Controller:
> <?php
> class UsersController extends AppController
> {
>        var $name = 'User';
>
>
>        function beforeFilter()
>        {
>                $this->Auth->allow('*');
>
>                if(isSet($this->passedArgs['username']))
>                {
>                        $this->data['User']['username'] = $this->passedArgs['username'];
>                }
>                if(isSet($this->passedArgs['password']))
>                {
>                        $this->data['User']['password'] = $this->passedArgs['password'];
>                }
>        }

I think beforeFilter() is too late for the way that Auth handles
submitted passwords. It's been quite awhile since I dove into the guts
of Auth, though, so I could be wrong. The upshot of it is that Auth
picks it up well at the beginning of the request, then hashes it.

Have a look at its startup() method.

http://api.cakephp.org/class/auth-component


> View:
> <h1>Log in</h1>
> <?=$form->create('User',array('action'=>'login'));?>
> <?=$form->input('username');?>
> <?=$form->input('password', array('type'=>'password'));?>
> <?=$form->end('login');?>

Why do you have a login form view if you're trying to pass the
credentials in the URL? Mind, I have no idea what Qooxdoo is, so
perhaps this all makes perfect sense.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: download file

On Wed, Dec 1, 2010 at 5:57 AM, Miqdad Ali <mr.miqdad.ali@gmail.com> wrote:
thank you 4 ur help

but,i don't know which type of file user will upload , so i want to download file which user uploaded my be pdf ,doc or any image

Have a look at MediaView
http://book.cakephp.org/view/1094/Media-Views

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Migrating from CakePHP 1.1 - Yikes?!

On Wed, Dec 1, 2010 at 3:18 AM, Walther <waltherlalk@gmail.com> wrote:
> Going from 1.1 to 1.2 is a bit tricky, but 1.2 to 1.3 is trivial.
>
> For 1.1 to 1.2, just follow this guide:
> http://book.cakephp.org/view/411/Migrating-from-CakePHP-1-1-to-1-2
>
> Then once it is running stable under 1.2, follow:
> http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3
>
> It is certainly worth upgrading.

I second Walther's advice. Doing it in 2 stages might be a little
easier. Just lay out a detailed list of steps for yourself to follow
at each stage. And try not to focus too much on all of the things
you'll inevitably encounter that you see could be improved but that
have little to do with the migration itself. If it'll sidetrack you
too much make a note of it and get back to it after the migration is
complete. I mention this because I'm notorious for becoming wildly
sidetracked, especially when it comes to older code. :-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Problem with Math Captcha component @ 1.3.6

On Tue, Nov 30, 2010 at 7:07 PM, Salines <nikola.paradzik@gmail.com> wrote:
> I focused on this function:
>
> function validate($data) {
>        if ($data == $this->Session->read('MathCaptcha.answer')){
>        return true;
>        }
>    }
>
> $data exists
> $this->Session->read('MathCaptcha.answer')  exists
>
>
> Why this function does not return 'true' when called from controller
> with the following code
>
> if ($this->MathCaptcha->validate($this->data['Contact']
> ['security_code'])) {
> ------
> }
>
> $this->data['Contact']['security_code'] exists

They may exist, but are they equivalent? Try:

function validate($data)
{
debug($data);
debug($this->Session->read('MathCaptcha.answer'));

if ($data == $this->Session->read('MathCaptcha.answer')){
return true;
}
}

As an aside, I recommend you swap the two validations in your code.
Validate Contact first, then the captcha. The reason is that, if
Contact doesn't validate there's no point in the captcha validating
because it will have to be filled in again anyway.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: download file

You may use mime_content_type to get the filetype of a file, this is now depreciated for later versions of PHP in which it is best to use Fileinfo.

mime_content_type: http://uk.php.net/manual/en/function.mime-content-type.php

Fileinfo: http://uk.php.net/manual/en/ref.fileinfo.php

Hope this helps

On 1 December 2010 10:57, Miqdad Ali <mr.miqdad.ali@gmail.com> wrote:
thank you 4 ur help

but,i don't know which type of file user will upload , so i want to download file which user uploaded my be pdf ,doc or any image

--------------------------------------------------------------------
Miqdad Ali
http://www.miqdadali.co.cc




On Tue, Nov 30, 2010 at 2:37 PM, Stephen <stephen@ninjacodermonkey.co.uk> wrote:
If you mean you want to your users to be prompted with a download window use readfile, otherwise I don't think I understand the question.

Here's something I did for pdf files.

http://pastie.org/private/igu2zad2lasz4vjowvdya



On 29 November 2010 06:42, Miqdad Ali <mr.miqdad.ali@gmail.com> wrote:
friends,
I want code for downloading image files in cakephp
--------------------------------------------------------------------
Miqdad Ali
http://www.miqdadali.co.cc


Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en



--
Kind Regards
 Stephen
 www.ninjacodermonkey.co.uk


Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en



--
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk


Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: ratings, like and dislike buttons...

What are your requirements with regard to:
- tracking which user used the Like and the Dislike buttons?
- tracking when the Like or Dislike event took place?
- statistics on the Like and Dislike event over time (total, within
last 3 months, last week, location, etc)?

I would register the Like and Dislike event in a separate table,
possibly together with the foreign key to the user who did it.
Something like:

fociki_blogs -> hasMany -> like_indications <- belongsTo <- users
users -> hasMany -> like_indications <- belongsTo <- fociki_blogs

The rest is up to you :) Enjoy,
John

On 1 Dec., 15:49, "chris...@yahoo.com" <chris...@yahoo.com> wrote:
> hii All,... please help,... I need to create like and dislike buttons
> for users to use in my social network BLOG section, something like in
> a facebook. Please advise,... should I take it to a new table or add
> fields in existing one,... this is what I have so far...
>
> CREATE TABLE `fociki_blogs` (
>   `id` int(11) unsigned NOT NULL auto_increment,
>   `user_id` int(11),
>   `category_id` int(11),
>   `title` varchar(255) NOT NULL default '',
>   `topic` text NOT NULL,
>   `last_comment` datetime default NULL,
>   `comments` int(11) NOT NULL default '0',
>   `privacy` int(1) unsigned NOT NULL default '0',
>   `created` datetime NOT NULL default '0000-00-00 00:00:00',
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
>
> THANKS !

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Using or not using PHP framework

Your programming will be more clean and easily for editing if u use framework

yes, in cakephp are .ctp files for views, which means "cake template"

in finally...i will say that cakephp will really help u if u work on a large project...
--
Tilen Majerle


2010/12/1 Raj <rajkumar.w93@gmail.com>
What changes will my web application finally have if I use a cakephp
framework rather than not using it?
Can I later on change my application without the framework? Does the
file types & formats of my application application remain the same
whther or not I chose to use framework?

I think the file type does gets changed..normally its .php but with
cakephp its something else

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en