Changeset 1854c45 in github for program/include/rcube_config.php


Ignore:
Timestamp:
May 7, 2008 5:38:44 AM (5 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
4f9c833
Parents:
eb774cc
Message:

More code cleanup + oop-ization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_config.php

    r197601e r1854c45  
    149149  } 
    150150   
     151   
     152  /** 
     153   * Return a 24 byte key for the DES encryption 
     154   * 
     155   * @return string DES encryption key 
     156   */ 
     157  public function get_des_key() 
     158  { 
     159    $key = !empty($this->prop['des_key']) ? $this->prop['des_key'] : 'rcmail?24BitPwDkeyF**ECB'; 
     160    $len = strlen($key); 
     161 
     162    // make sure the key is exactly 24 chars long 
     163    if ($len<24) 
     164      $key .= str_repeat('_', 24-$len); 
     165    else if ($len>24) 
     166      substr($key, 0, 24); 
     167 
     168    return $key; 
     169  } 
     170   
     171   
    151172} 
    152173 
Note: See TracChangeset for help on using the changeset viewer.