コード例 #1
0
 /**
  * Creates and returns an Buildable Alternation element.
  * 
  * @access  public
  * @return Hoathis\Regex\Visitor\Buildable
  */
 public function createAlternation()
 {
     $class = new Svg();
     $class->setVerticalLayout();
     $class->addPaths();
     $class->setMargin(self::BIG_MARGIN);
     $class->setHeight(-self::BIG_MARGIN);
     return $class;
 }
コード例 #2
0
ファイル: Account.php プロジェクト: paragonie/airship
 /**
  * Returns the user's QR code.
  * @route my/account/2-factor/qr-code
  *
  */
 public function twoFactorSetupQRCode()
 {
     if (!$this->isLoggedIn()) {
         \Airship\redirect($this->airship_cabin_prefix);
     }
     $gauth = $this->twoFactorPreamble();
     $user = $this->acct->getUserAccount($this->getActiveUserId());
     if (\extension_loaded('gd')) {
         \header('Content-Type: image/png');
         $writer = null;
     } else {
         $renderer = new Svg();
         $renderer->setHeight(384);
         $renderer->setWidth(384);
         $writer = new QRCodeWriter($renderer);
         $this->airship_lens_object->sendStandardHeaders('image/svg+xml');
     }
     $gauth->makeQRCode($writer, 'php://output', $user['username'] . '@' . $_SERVER['HTTP_HOST'], $this->config('two-factor.issuer') ?? '', $this->config('two-factor.label') ?? '');
 }