Skip to content

Commit

Permalink
Move Simplecrypt to legacy and make it autoloadable.
Browse files Browse the repository at this point in the history
  • Loading branch information
realityking committed Apr 14, 2012
1 parent 78677f9 commit 5a2752c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions libraries/import.legacy.php
Expand Up @@ -61,5 +61,6 @@ class_exists('JLoader') or die;
JLoader::register('JDatabaseQuerySQLAzure', JPATH_PLATFORM . '/joomla/database/query/sqlazure.php');
JLoader::register('JDatabaseQuerySQLSrv', JPATH_PLATFORM . '/joomla/database/query/sqlsrv.php');
JLoader::register('JToolBar', JPATH_PLATFORM . '/legacy/toolbar/toolbar.php');
JLoader::register('JSimpleCrypt', JPATH_PLATFORM . '/legacy/simplecrypt/simplecrypt.php');
JLoader::register('JTree', JPATH_PLATFORM . '/legacy/base/tree.php');
JLoader::register('JNode', JPATH_PLATFORM . '/legacy/base/node.php');
2 changes: 0 additions & 2 deletions libraries/legacy/application/application.php
Expand Up @@ -668,8 +668,6 @@ public function login($credentials, $options = array())
// Set the remember me cookie if enabled.
if (isset($options['remember']) && $options['remember'])
{
jimport('joomla.utilities.simplecrypt');

// Create the encryption key, apply extra hardening using the user agent string.
$key = self::getHash(@$_SERVER['HTTP_USER_AGENT']);

Expand Down
@@ -1,7 +1,7 @@
<?php
/**
* @package Joomla.Platform
* @subpackage Utilities
* @subpackage Simplecrypt
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
Expand All @@ -13,11 +13,11 @@
* JSimpleCrypt is a very simple encryption algorithm for encrypting/decrypting strings
*
* @package Joomla.Platform
* @subpackage Utilities
* @subpackage Simplecrypt
* @since 11.1
* @deprecated 12.3
* @deprecated 12.3 Use JCrypt instead.
*/
class JSimpleCrypt
class JSimplecrypt
{
/**
* Encryption/Decryption Key
Expand Down
@@ -1,20 +1,20 @@
<?php
/**
* @package Joomla.UnitTest
* @subpackage Utilities
* @subpackage Simplecrypt
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

require_once JPATH_PLATFORM.'/joomla/utilities/simplecrypt.php';
require_once JPATH_PLATFORM.'/legacy/simplecrypt/simplecrypt.php';

/**
* Test class for JSimpleCrypt.
* Generated by PHPUnit on 2009-10-26 at 22:30:43.
*
* @package Joomla.UnitTest
* @subpackage Utilities
* @package Joomla.UnitTest
* @subpackage Simplecrypt
*/
class JSimpleCryptTest extends TestCase
{
Expand Down Expand Up @@ -94,6 +94,7 @@ function casesEncryption()
*
* @return void
* @dataProvider casesEncryption
* @covers JSimpleCrypt::decrypt
*/
public function testDecrypt( $expected, $key, $text )
{
Expand Down Expand Up @@ -122,6 +123,7 @@ public function testDecrypt( $expected, $key, $text )
*
* @return void
* @dataProvider casesEncryption
* @covers JSimpleCrypt::encrypt
*/
public function testEncrypt( $text, $key, $expected )
{
Expand Down

0 comments on commit 5a2752c

Please sign in to comment.