Re: git clone: Permission denied

2009-08-13 Thread BeanDog

That worked like a charm!  I'm brand new to Git, so some of the stuff
with remote repositories is still pretty new to me.  Let me explain
how I'm expecting to manage my CakePHP project's repository, and let
me know if I'm completely off the deep end!

First, I'll create my central repository for my project as a bare
clone from CakePHP:
  git clone --bare d...@code.cakephp.org:cakephp.git myproject

Then I'll create my own working copy by cloning that:
  git clone myu...@myserver:myproject.git

I do a bunch of work in my local copy, then commit and push back to my
own central repo:
  git commit -a
  git push

To get all the changes other devs have committed to my own central
repo, I pull:
  git pull
  (OR: git fetch; git merge origin/master)

To merge the latest changes from CakePHP's repo into my own central
repo, I fetch directly into my own central repo from Cake's:
  git fetch d...@code.cakephp.org:cakephp.git

Does all that look right?


Ben Dilts

On Aug 13, 3:23 am, majna majna...@gmail.com wrote:
 check out thishttp://thechaw.com/wiki/guides/setup

 On Aug 13, 1:21 am, BeanDog bean...@gmail.com wrote:



  The new CakePHP code site,http://code.cakephp.org/source, says to use
  git clone d...@code.cakephp.org:cakephp.git to get a copy of the code
  (I assume that's the latest 1.2 stable code).  However, when I try to
  do that, I get the following error:

  Permission denied (publickey).
  fatal: The remote end hung up unexpectedly

  Am I doing something wrong?  Is this not the best public place to git
  the source code for CakePHP?  I was hoping switching to git would make
  keeping the CakePHP core in my project up to date much easier.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



git clone: Permission denied

2009-08-12 Thread BeanDog

The new CakePHP code site, http://code.cakephp.org/source, says to use
git clone d...@code.cakephp.org:cakephp.git to get a copy of the code
(I assume that's the latest 1.2 stable code).  However, when I try to
do that, I get the following error:

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Am I doing something wrong?  Is this not the best public place to git
the source code for CakePHP?  I was hoping switching to git would make
keeping the CakePHP core in my project up to date much easier.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Encoding pluses in URL - Is my patch OK?

2009-08-11 Thread BeanDog

Due to the way Apache's mod_rewrite mismanages query string encoding,
$_GET['url'] isn't what I'd hope it would be when there are pluses
encoded (%2B) in the URL.

It looks like replacing line 614 of dispatcher.php with the following
works on my apache config:

if(isset($_SERVER['REDIRECT_URL']))
$url = $_SERVER['REDIRECT_URL']; //Will have correct special-char
encoding.
else
$url = $_GET['url'];

Is there some reason I'm not aware of that I should _not_ do this?


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



Auth component - enforcing password strength and password confirmation entry

2008-09-26 Thread BeanDog

I've figured out a pretty clean way to make a user registration form
that validates a password confirmation and password strength, without
extending the Auth component or any other trickery.

I wanted some feedback.  First, should I be using value='' on the
password and password2 form elements?  If I don't it seems to fill in
those boxes with the hash and plaintext password (respectively).
Second, how do my validation functions look?  They're my first attempt
at custom validation.  They seem to work OK.

Here's my register view:

h1Register/h1
?php
echo $form-create('User', array('action' = 'register'));
echo $form-input('username');
echo $form-input('password', array('value'=''));
echo $form-input('password2', array('label'='Repeat Password',
'type'='password', 'value'=''));

echo $form-input('first_name');
echo $form-input('last_name');
echo $form-input('email');

echo $form-end('Register');
?



Here's my user model:

?php
App::import(array('Security'));

class User extends AppModel {
var $validate = array(
'email' = 'email',
'first_name' = array(
'rule' = array('minLength', 1)
),
'last_name' = array(
'rule' = array('minLength', 1)
),
'username' = array(
'rule' = array('minLength', 4)
),
'password' = array(
'rule' = array('CheckPassword'),
'message' = 'At least 6 characters'
),
'password2' = array(
'rule' = array('CheckPasswordMatch'),
'message' = 'Passwords did not match'
)
);

function CheckPassword($data) {
if(!isset($this-data['User']['password2']))
return true; //Only confirm password strength if we're 
collecting a
new password (i.e. password2 is set).
return strlen($this-data['User']['password2']) = 6;
}
function CheckPasswordMatch($data) {
return $this-data['User']['password'] == Security::hash($this-
data['User']['password2'], null, true);
}
}
?



And my user controller:

?php
class UsersController extends AppController {
var $components = array('Auth');

function beforeFilter() {
$this-Auth-allow('register');
}

/**
 *  The AuthComponent provides the needed functionality
 *  for login, so you can leave this function blank.
 */
function login() {
}

function logout() {
$this-redirect($this-Auth-logout());
}


function register() {
if($this-data) {
if ($this-User-save($this-data)) {
$this-flash('Your account has been created.', 
'/users/login');
}
}
}
}
?

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