示例#1
0
 private function installCert($authKey)
 {
     $ua = Output::getUserAgent();
     $script = $this->ca->getCertDeploymentScript($authKey, $ua);
     switch ($ua) {
         case "chrome":
         case "opera":
         case "mozilla":
         case "safari":
             include 'file_download.php';
             download_certificate($script, "install.crt");
             break;
         default:
             $script .= "<noscript><b>" . $this->translateTag('l10n_noscript_notice', 'download') . "</b></noscript>";
             $this->tpl->assign("script", $script);
             break;
     }
 }
示例#2
0
 public function process()
 {
     if (CS::getSessionKey('hasAcceptedAUP') !== true) {
         Framework::error_output($this->translateTag('l10n_err_aupagreement', 'processcsr'));
         return;
     }
     $user_cert_enabled = $this->person->testEntitlementAttribute(Config::get_config('entitlement_user'));
     $this->tpl->assign('user_cert_enabled', $user_cert_enabled);
     $this->tpl->assign('finalDN', $this->ca->getFullDN());
     $this->tpl->assign('dn', $this->ca->getBrowserFriendlyDN());
     if ((int) Config::get_config('ca_mode') == CA_COMODO) {
         $this->tpl->assign('dn', $this->ca->getBrowserFriendlyDN(true));
     }
     $this->tpl->assign('default_keysize', Config::get_config('default_key_length'));
     $this->tpl->assign('min_keysize', Config::get_config('min_key_length'));
     $ua = Output::getUserAgent();
     switch ($ua) {
         case "msie_post_vista":
             $this->tpl->assign('content', $this->tpl->fetch('browser_csr/vista7.tpl'));
             break;
         case "msie_pre_vista":
             $this->tpl->assign('content', $this->tpl->fetch('browser_csr/xp2003.tpl'));
             break;
         case "chrome":
         case "safari":
         case "opera":
         case "mozilla":
             $this->tpl->assign('content', $this->tpl->fetch('browser_csr/keygen.tpl'));
             break;
         case "other":
             $this->tpl->assign('content', $this->tpl->fetch('browser_csr/unsupported.tpl'));
             break;
         default:
             $this->tpl->assign('content', $this->tpl->fetch('browser_csr/unsupported.tpl'));
             break;
     }
 }