當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Helper::isPublicAccess方法代碼示例

本文整理匯總了PHP中OCA\Encryption\Helper::isPublicAccess方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helper::isPublicAccess方法的具體用法?PHP Helper::isPublicAccess怎麽用?PHP Helper::isPublicAccess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OCA\Encryption\Helper的用法示例。


在下文中一共展示了Helper::isPublicAccess方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPrivateKey

 /**
  * @brief Gets user or public share private key from session
  * @returns string $privateKey The user's plaintext private key
  *
  */
 public function getPrivateKey()
 {
     // return the public share private key if this is a public access
     if (\OCA\Encryption\Helper::isPublicAccess()) {
         return $this->getPublicSharePrivateKey();
     } else {
         if (!is_null(\OC::$session->get('privateKey'))) {
             return \OC::$session->get('privateKey');
         } else {
             return false;
         }
     }
 }
開發者ID:hjimmy,項目名稱:owncloud,代碼行數:18,代碼來源:session.php

示例2: __construct

 /**
  * @param \OC\Files\View $view
  * @param string $userId
  * @param bool $client
  */
 public function __construct($view, $userId, $client = false)
 {
     $this->view = $view;
     $this->client = $client;
     $this->userId = $userId;
     $appConfig = \OC::$server->getAppConfig();
     $this->publicShareKeyId = $appConfig->getValue('files_encryption', 'publicShareKeyId');
     $this->recoveryKeyId = $appConfig->getValue('files_encryption', 'recoveryKeyId');
     $this->userDir = '/' . $this->userId;
     $this->fileFolderName = 'files';
     $this->userFilesDir = '/' . $userId . '/' . $this->fileFolderName;
     // TODO: Does this need to be user configurable?
     $this->publicKeyDir = '/' . 'public-keys';
     $this->encryptionDir = '/' . $this->userId . '/' . 'files_encryption';
     $this->keyfilesPath = $this->encryptionDir . '/' . 'keyfiles';
     $this->shareKeysPath = $this->encryptionDir . '/' . 'share-keys';
     $this->publicKeyPath = $this->publicKeyDir . '/' . $this->userId . '.public.key';
     // e.g. data/public-keys/admin.public.key
     $this->privateKeyPath = $this->encryptionDir . '/' . $this->userId . '.private.key';
     // e.g. data/admin/admin.private.key
     // make sure that the owners home is mounted
     \OC\Files\Filesystem::initMountPoints($userId);
     if (\OCA\Encryption\Helper::isPublicAccess()) {
         $this->keyId = $this->publicShareKeyId;
         $this->isPublic = true;
     } else {
         $this->keyId = $this->userId;
         $this->isPublic = false;
     }
 }
開發者ID:Combustible,項目名稱:core,代碼行數:35,代碼來源:util.php

示例3: getPrivateKey

 /**
  * @brief Gets user or public share private key from session
  * @returns string $privateKey The user's plaintext private key
  *
  */
 public function getPrivateKey()
 {
     // return the public share private key if this is a public access
     if (\OCA\Encryption\Helper::isPublicAccess()) {
         return $this->getPublicSharePrivateKey();
     } else {
         if (isset($_SESSION['privateKey']) && !empty($_SESSION['privateKey'])) {
             return $_SESSION['privateKey'];
         } else {
             return false;
         }
     }
 }
開發者ID:CDN-Sparks,項目名稱:owncloud,代碼行數:18,代碼來源:session.php

示例4: __construct

 /**
  * @param \OC_FilesystemView $view
  * @param $userId
  * @param bool $client
  */
 public function __construct(\OC_FilesystemView $view, $userId, $client = false)
 {
     $this->view = $view;
     $this->userId = $userId;
     $this->client = $client;
     $this->isPublic = false;
     $this->publicShareKeyId = \OC_Appconfig::getValue('files_encryption', 'publicShareKeyId');
     $this->recoveryKeyId = \OC_Appconfig::getValue('files_encryption', 'recoveryKeyId');
     // if we are anonymous/public
     if (\OCA\Encryption\Helper::isPublicAccess()) {
         $this->userId = $this->publicShareKeyId;
         // only handle for files_sharing app
         if (isset($GLOBALS['app']) && $GLOBALS['app'] === 'files_sharing') {
             $this->userDir = '/' . $GLOBALS['fileOwner'];
             $this->fileFolderName = 'files';
             $this->userFilesDir = '/' . $GLOBALS['fileOwner'] . '/' . $this->fileFolderName;
             // TODO: Does this need to be user configurable?
             $this->publicKeyDir = '/' . 'public-keys';
             $this->encryptionDir = '/' . $GLOBALS['fileOwner'] . '/' . 'files_encryption';
             $this->keyfilesPath = $this->encryptionDir . '/' . 'keyfiles';
             $this->shareKeysPath = $this->encryptionDir . '/' . 'share-keys';
             $this->publicKeyPath = $this->publicKeyDir . '/' . $this->userId . '.public.key';
             // e.g. data/public-keys/admin.public.key
             $this->privateKeyPath = '/owncloud_private_key/' . $this->userId . '.private.key';
             // e.g. data/admin/admin.private.key
             $this->isPublic = true;
         }
     } else {
         $this->userDir = '/' . $this->userId;
         $this->fileFolderName = 'files';
         $this->userFilesDir = '/' . $this->userId . '/' . $this->fileFolderName;
         // TODO: Does this need to be user configurable?
         $this->publicKeyDir = '/' . 'public-keys';
         $this->encryptionDir = '/' . $this->userId . '/' . 'files_encryption';
         $this->keyfilesPath = $this->encryptionDir . '/' . 'keyfiles';
         $this->shareKeysPath = $this->encryptionDir . '/' . 'share-keys';
         $this->publicKeyPath = $this->publicKeyDir . '/' . $this->userId . '.public.key';
         // e.g. data/public-keys/admin.public.key
         $this->privateKeyPath = $this->encryptionDir . '/' . $this->userId . '.private.key';
         // e.g. data/admin/admin.private.key
     }
 }
開發者ID:CDN-Sparks,項目名稱:owncloud,代碼行數:47,代碼來源:util.php


注:本文中的OCA\Encryption\Helper::isPublicAccess方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。