Permalink
Browse files

Merge pull request #223 from halkyon/deprecation_fixes

Deprecation fixes
  • Loading branch information...
2 parents f01982a + 53bf61c commit 2b245899b21c50e2bb1878023fbbcbf09e2174fa @sminnee sminnee committed Mar 9, 2012
Showing with 6 additions and 70 deletions.
  1. +0 −10 filesystem/File.php
  2. +4 −12 model/DataExtension.php
  3. +1 −2 security/PasswordEncryptor.php
  4. +1 −46 security/Security.php
View
@@ -627,16 +627,6 @@ function getURL() {
}
/**
- * Return the last 50 characters of the URL.
- *
- * @deprecated 2.4
- */
- function getLinkedURL() {
- Deprecation::notice('2.4', 'Use getTreeTitle() instead.');
- return "$this->Name";
- }
-
- /**
* Returns an absolute filesystem path to the file.
* Use {@link getRelativePath()} to get the same path relative to the webroot.
*
@@ -47,25 +47,17 @@ public static function load_extra_statics($class, $extension) {
if(preg_match('/^([^(]*)/', $extension, $matches)) {
$extensionClass = $matches[1];
} else {
- user_error("Bad extenion '$extension' - can't find classname", E_USER_WARNING);
+ user_error("Bad extension '$extension' - can't find classname", E_USER_WARNING);
return;
}
- // @deprecated 2.4 - use extraStatics() now, not extraDBFields()
- if(method_exists($extensionClass, 'extraDBFields')) {
- Deprecation::notice('2.4', 'DataExtension::extraDBFields() is deprecated. Please use extraStatics() instead.');
- $extraStaticsMethod = 'extraDBFields';
- } else {
- $extraStaticsMethod = 'extraStatics';
- }
-
// If the extension has been manually applied to a subclass, we should ignore that.
if(Object::has_extension(get_parent_class($class), $extensionClass)) return;
// If there aren't any extraStatics we shouldn't try to load them.
- if (!method_exists($extensionClass, $extraStaticsMethod) ) return;
-
- $statics = call_user_func(array(singleton($extensionClass), $extraStaticsMethod), $class, $extension);
+ if(!method_exists($extensionClass, 'extraStatics')) return;
+
+ $statics = call_user_func(array(singleton($extensionClass), 'extraStatics'), $class, $extension);
if($statics) {
foreach($statics as $name => $newVal) {
@@ -81,7 +81,6 @@ static function create_for_algorithm($algorithm) {
/**
* Return a string value stored in the {@link Member->Salt} property.
- * Note: Only used when {@link Security::$useSalt} is TRUE.
*
* @uses RandomGenerator
*
@@ -237,4 +236,4 @@ function salt($password, $member = null) {
* @package sapphire
* @subpackage security
*/
-class PasswordEncryptor_NotFoundException extends Exception {}
+class PasswordEncryptor_NotFoundException extends Exception {}
View
@@ -45,14 +45,6 @@ class Security extends Controller {
protected static $strictPathChecking = false;
/**
- * Should passwords be stored encrypted?
- * @deprecated 2.4 Please use 'none' as the default $encryptionAlgorithm instead
- *
- * @var bool
- */
- protected static $encryptPasswords = true;
-
- /**
* The password encryption algorithm to use by default.
* This is an arbitrary code registered through {@link PasswordEncryptor}.
*
@@ -61,14 +53,6 @@ class Security extends Controller {
protected static $encryptionAlgorithm = 'sha1_v2.4';
/**
- * Should a salt be used for the password encryption?
- * @deprecated 2.4 Please use a custom {@link PasswordEncryptor} instead
- *
- * @var bool
- */
- protected static $useSalt = true;
-
- /**
* Showing "Remember me"-checkbox
* on loginform, and saving encrypted credentials to a cookie.
*
@@ -734,35 +718,6 @@ public static function getStrictPathChecking() {
/**
- * Set if passwords should be encrypted or not
- *
- * @deprecated 2.4 Use PasswordEncryptor_None instead.
- *
- * @param bool $encrypt Set to TRUE if you want that all (new) passwords
- * will be stored encrypted, FALSE if you want to
- * store the passwords in clear text.
- */
- public static function encrypt_passwords($encrypt) {
- Deprecation::notice('2.4', 'Use PasswordEncryptor_None instead.');
- self::$encryptPasswords = (bool)$encrypt;
- }
-
-
- /**
- * Get a list of all available encryption algorithms.
- * Note: These are arbitrary codes, and not callable methods.
- *
- * @deprecated 2.4 Use PasswordEncryptor::get_encryptors()
- *
- * @return array Returns an array of strings containing all supported encryption algorithms.
- */
- public static function get_encryption_algorithms() {
- Deprecation::notice('2.4', 'Use PasswordEncryptor::get_encryptors() instead.');
- return array_keys(PasswordEncryptor::get_encryptors());
- }
-
-
- /**
* Set the password encryption algorithm
*
* @param string $algorithm One of the available password encryption
@@ -816,7 +771,7 @@ static function encrypt_password($password, $salt = null, $algorithm = null, $me
// if the password is empty, don't encrypt
strlen(trim($password)) == 0
// if no algorithm is provided and no default is set, don't encrypt
- || (!$algorithm && self::$encryptPasswords == false)
+ || (!$algorithm)
) {
$algorithm = 'none';
} else {

0 comments on commit 2b24589

Please sign in to comment.