IMP_Smime::enabled PHP Method

enabled() public static method

Return whether PGP support is current enabled in IMP.
public static enabled ( ) : boolean
return boolean True if PGP support is enabled.
    public static function enabled()
    {
        global $conf, $prefs;
        return !empty($conf['openssl']['path']) && $prefs->getValue('use_smime') && Horde_Util::extensionExists('openssl');
    }

Usage Example

Exemplo n.º 1
0
Arquivo: Ui.php Projeto: horde/horde
 /**
  * Return a list of valid encrypt HTML option tags.
  *
  * @param string $default      The default encrypt option.
  * @param boolean $returnList  Whether to return a hash with options
  *                             instead of the options tag.
  *
  * @return mixed  The list of option tags. This is empty if no encryption
  *                is available.
  */
 public function encryptList($default = null, $returnList = false)
 {
     global $injector, $prefs;
     if (is_null($default)) {
         $default = $prefs->getValue('default_encrypt');
     }
     $enc_opts = array();
     $output = '';
     if (IMP_Pgp::enabled()) {
         $enc_opts += $injector->getInstance('IMP_Pgp')->encryptList();
     }
     if (IMP_Smime::enabled()) {
         $enc_opts += $injector->getInstance('IMP_Smime')->encryptList();
     }
     if (!empty($enc_opts)) {
         $enc_opts = array_merge(array(IMP::ENCRYPT_NONE => _("None")), $enc_opts);
     }
     if ($returnList) {
         return $enc_opts;
     }
     foreach ($enc_opts as $key => $val) {
         $output .= '<option value="' . $key . '"' . ($default == $key ? ' selected="selected"' : '') . '>' . $val . "</option>\n";
     }
     return $output;
 }
All Usage Examples Of IMP_Smime::enabled