| 47 |
'#maxlength' => 15, |
'#maxlength' => 15, |
| 48 |
'#description' => t("Enter width of the iframe. Optimum is 550px"), |
'#description' => t("Enter width of the iframe. Optimum is 550px"), |
| 49 |
); |
); |
| 50 |
drupal_get_form('rcmail',$form); |
return $form; |
| 51 |
} |
} |
| 52 |
|
|
| 53 |
function rcmail_perm() { |
function rcmail_perm() { |
| 70 |
if ($category == 'account' && user_access('use rcmail')) { |
if ($category == 'account' && user_access('use rcmail')) { |
| 71 |
//$user_status = $edit['rcmail_status'] != NULL ? $edit['rcmail_status'] : ($user->rcmail_status != NULL ? $user->rcmail_status : variable_get('rcmail_default_state', 0)); |
//$user_status = $edit['rcmail_status'] != NULL ? $edit['rcmail_status'] : ($user->rcmail_status != NULL ? $user->rcmail_status : variable_get('rcmail_default_state', 0)); |
| 72 |
|
|
| 73 |
$dec=$edit['rcmail_password']; |
$dec=_decrypt($edit['rcmail_password']); |
| 74 |
|
|
| 75 |
$form['rcmail_settings'] = array( |
$form['rcmail_settings'] = array( |
| 76 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 93 |
'#default_value' => $dec, |
'#default_value' => $dec, |
| 94 |
'#size' => 20, |
'#size' => 20, |
| 95 |
'#maxlength' => 20, |
'#maxlength' => 20, |
| 96 |
|
'#required' => TRUE, |
| 97 |
'#description' => t('Enter your the password of your IMAP account.'), |
'#description' => t('Enter your the password of your IMAP account.'), |
| 98 |
); |
); |
| 99 |
|
|
| 111 |
} //eof if |
} //eof if |
| 112 |
|
|
| 113 |
case 'update': |
case 'update': |
| 114 |
global $form_values; |
$edit['rcmail_password'] = _encrypt($edit['rcmail_password']); |
|
$dec=$form_values['rcmail_password']; |
|
|
//$enc='foo'._encrypt($dec); |
|
|
return $edit['rcmail_password'] = $dec; |
|
| 115 |
} //eof switch $type |
} //eof switch $type |
| 116 |
} |
} |
| 117 |
|
|
| 134 |
*/ |
*/ |
| 135 |
function rcmail_page(){ |
function rcmail_page(){ |
| 136 |
global $user; |
global $user; |
| 137 |
$content='<iframe width="850" height="550" src="./modules/rcmail/roundcubemail/index.php?do=login">foo</iframe>'; |
$height = variable_get("rcmail_iframe_height", "550"); |
| 138 |
|
$width = variable_get("rcmail_iframe_width", "850"); |
| 139 |
|
$content='<iframe width="' . $width . '" height="' . $height . '" src="./sites/all/modules/rcmail/roundcubemail/index.php?do=login&_framed=1">Ups, your browser does not support ifames.</iframe>'; |
| 140 |
print theme('page', $content); |
print theme('page', $content); |
| 141 |
} |
} |
| 142 |
|
|
| 150 |
*/ |
*/ |
| 151 |
function _decrypt($enc) { |
function _decrypt($enc) { |
| 152 |
$key='zugbz766fhgfv'; |
$key='zugbz766fhgfv'; |
| 153 |
|
$enc = base64_decode($enc); |
| 154 |
$iv_size = mcrypt_get_iv_size(MCRYPT_XTEA, MCRYPT_MODE_ECB); |
$iv_size = mcrypt_get_iv_size(MCRYPT_XTEA, MCRYPT_MODE_ECB); |
| 155 |
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); |
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); |
| 156 |
$dec = mcrypt_decrypt(MCRYPT_XTEA, $key, $enc, MCRYPT_MODE_ECB, $iv); |
$dec = mcrypt_decrypt(MCRYPT_XTEA, $key, $enc, MCRYPT_MODE_ECB, $iv); |
| 170 |
$iv_size = mcrypt_get_iv_size(MCRYPT_XTEA, MCRYPT_MODE_ECB); |
$iv_size = mcrypt_get_iv_size(MCRYPT_XTEA, MCRYPT_MODE_ECB); |
| 171 |
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); |
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); |
| 172 |
$enc = mcrypt_encrypt(MCRYPT_XTEA, $key, $dec, MCRYPT_MODE_ECB, $iv); |
$enc = mcrypt_encrypt(MCRYPT_XTEA, $key, $dec, MCRYPT_MODE_ECB, $iv); |
| 173 |
return $key; |
$enc = base64_encode($enc); |
| 174 |
|
return $enc; |
| 175 |
} |
} |
| 176 |
|
|
| 177 |
function _testfunc(){ |
|
|
echo "foo"; |
|
|
} |
|
|
|
|
| 178 |
?> |
?> |