/[drupal]/contributions/modules/rcmail/rcmail.module
ViewVC logotype

Diff of /contributions/modules/rcmail/rcmail.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2, Tue May 23 14:18:12 2006 UTC revision 1.2.2.1, Sat Mar 24 12:59:17 2007 UTC
# Line 47  $form["rcmail_iframe_height"] = array( Line 47  $form["rcmail_iframe_height"] = array(
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() {
# Line 70  function rcmail_user($type, &$edit, &$us Line 70  function rcmail_user($type, &$edit, &$us
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',
# Line 93  $form['rcmail_settings']['rcmail_passwor Line 93  $form['rcmail_settings']['rcmail_passwor
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    
# Line 110  $form['rcmail_settings']['rcmail_passwor Line 111  $form['rcmail_settings']['rcmail_passwor
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    
# Line 136  function rcmail_menu() { Line 134  function rcmail_menu() {
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    
# Line 150  function rcmail_page(){ Line 150  function rcmail_page(){
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);
# Line 169  function _encrypt($dec) { Line 170  function _encrypt($dec) {
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  ?>  ?>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.2.2.1

  ViewVC Help
Powered by ViewVC 1.1.2