From 75617f53b535ad96475c097fd5b11c2826040f53 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Sun, 13 May 2012 12:03:55 -0400
Subject: [PATCH] Remove unused mcrypt helper function -> use class.mcrypt.php
 instead

---
 include/class.misc.php | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/include/class.misc.php b/include/class.misc.php
index 2d8e3e6b5..409e4bac6 100644
--- a/include/class.misc.php
+++ b/include/class.misc.php
@@ -29,27 +29,6 @@ class Misc {
         return mt_rand($start,$end);
     }
 
-    function encrypt($text, $salt) {
-
-        //if mcrypt extension is not installed--simply return unencryted text and log a warning.
-        if(!function_exists('mcrypt_encrypt') || !function_exists('mcrypt_decrypt')) {
-            $msg='Cryptography extension mcrypt is not enabled or installed. IMAP/POP passwords are being stored as plain text in database.';
-            Sys::log(LOG_WARN,'mcrypt missing',$msg);
-            return $text;
-        }
-
-        return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256,$salt, $text, MCRYPT_MODE_ECB,
-                         mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
-    }
-
-    function decrypt($text, $salt) {
-        if(!function_exists('mcrypt_encrypt') || !function_exists('mcrypt_decrypt'))
-            return $text;
-
-        return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt, base64_decode($text), MCRYPT_MODE_ECB,
-                        mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));
-    }
-
     /* misc date helpers...this will go away once we move to php 5 */ 
     function db2gmtime($var){
         global $cfg;
-- 
GitLab