ソースを参照

documentation

euromark 12 年 前
コミット
a33eac9274
2 ファイル変更15 行追加16 行削除
  1. 7 11
      Console/Command/ResetShell.php
  2. 8 5
      View/Helper/CommonHelper.php

+ 7 - 11
Console/Command/ResetShell.php

@@ -1,6 +1,6 @@
 <?php
 
-# enhancement for plugin user model
+// Enhancement for plugin user model
 if (!defined('CLASS_USER')) {
 	define('CLASS_USER', 'User');
 }
@@ -27,12 +27,12 @@ class ResetShell extends AppShell {
 	}
 
 	/**
-	 * Reset all emails - e.g. your admin email (for local development)
+	 * Resets all emails - e.g. to your admin email (for local development).
 	 *
 	 * @return void
 	 */
 	public function email() {
-		$this->out('email:');
+		$this->out('Email:');
 		App::uses('Validation', 'Utility');
 		while (empty($email) || !Validation::email($email)) {
 			$email = $this->in(__('New email address (must have a valid form at least)'));
@@ -53,7 +53,7 @@ class ResetShell extends AppShell {
 	}
 
 	/**
-	 * Reset all pwds to a simply pwd (for local development)
+	 * Resets all pwds to a simple pwd (for local development).
 	 *
 	 * @return void
 	 */
@@ -80,7 +80,7 @@ class ResetShell extends AppShell {
 			$pwToHash = $this->in(__('Password to Hash (2 characters at least)'));
 		}
 		$this->hr();
-		$this->out('pwd:');
+		$this->out('Password:');
 		$this->out($pwToHash);
 
 		if ($authType = Configure::read('Passwordable.authType')) {
@@ -93,7 +93,7 @@ class ResetShell extends AppShell {
 			$pw = $this->Auth->password($pwToHash);
 		}
 		$this->hr();
-		$this->out('hash:');
+		$this->out('Hash:');
 		$this->out($pw);
 
 		$this->hr();
@@ -104,11 +104,7 @@ class ResetShell extends AppShell {
 			return $this->error(CLASS_USER . ' model doesnt have a password field!');
 		}
 
-		if (method_exists($this->User, 'escapeValue')) {
-			$newPwd = $this->User->escapeValue($pw);
-		} else {
-			$newPwd = '\'' . $pw . '\'';
-		}
+		$newPwd = '\'' . $pw . '\'';
 		$this->User->recursive = -1;
 		$this->User->updateAll(array('password' => $newPwd), array('password !=' => $pw));
 		$count = $this->User->getAffectedRows();

+ 8 - 5
View/Helper/CommonHelper.php

@@ -13,7 +13,7 @@ class CommonHelper extends AppHelper {
 	);
 
 	/**
-	 * Convenience function for clean ROBOTS allowance
+	 * Convenience method for clean ROBOTS allowance
 	 *
 	 * @param string $type - private/public
 	 * @return string HTML
@@ -37,7 +37,8 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
-	 * Convenience function for clean meta name tags
+	 * Convenience method for clean meta name tags
+	 *
 	 * @param string $name: author, date, generator, revisit-after, language
 	 * @param MIXED $content: if array, it will be seperated by commas
 	 * @return string htmlMarkup
@@ -55,6 +56,8 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
+	 * Convenience method for meta description
+	 *
 	 * @param string $content
 	 * @param string $language (iso2: de, en-us, ...)
 	 * @param array $additionalOptions
@@ -109,7 +112,7 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
-	 * Convenience function for "alternate" SEO links
+	 * Convenience method for "alternate" SEO links
 	 *
 	 * @param mixed $url
 	 * @param mixed $lang (lang(iso2) or array of langs)
@@ -141,7 +144,7 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
-	 * Convenience function for META Tags
+	 * Convenience method for META Tags
 	 *
 	 * @param string $type
 	 * @param string $content
@@ -163,7 +166,7 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
-	 * Convenience function for META Tags
+	 * Convenience method for META Tags
 	 *
 	 * @param string $type
 	 * @param string $content