本文整理汇总了PHP中OC_Mount_Config::getPersonalBackends方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Mount_Config::getPersonalBackends方法的具体用法?PHP OC_Mount_Config::getPersonalBackends怎么用?PHP OC_Mount_Config::getPersonalBackends使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Mount_Config
的用法示例。
在下文中一共展示了OC_Mount_Config::getPersonalBackends方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isCertificateImportAllowed
/**
* check if certificate import is allowed
*
* @return bool
*/
protected function isCertificateImportAllowed()
{
$externalStorageEnabled = $this->appManager->isEnabledForUser('files_external');
if ($externalStorageEnabled) {
$backends = \OC_Mount_Config::getPersonalBackends();
if (!empty($backends)) {
return true;
}
}
return false;
}
示例2: validate
/**
* Validate storage config
*
* @param StorageConfig $storage storage config
*
* @return DataResponse|null returns response in case of validation error
*/
protected function validate(StorageConfig $storage)
{
$result = parent::validate($storage);
if ($result != null) {
return $result;
}
// Verify that the mount point applies for the current user
// Prevent non-admin users from mounting local storage and other disabled backends
$allowedBackends = \OC_Mount_Config::getPersonalBackends();
if (!isset($allowedBackends[$storage->getBackendClass()])) {
return new DataResponse(array('message' => (string) $this->l10n->t('Invalid storage backend "%s"', array($storage->getBackendClass()))), Http::STATUS_UNPROCESSABLE_ENTITY);
}
return null;
}
示例3: ksort
} else {
$languages[] = $ln;
}
}
ksort($commonlanguages);
// sort now by displayed language not the iso-code
usort($languages, function ($a, $b) {
return strcmp($a['name'], $b['name']);
});
//links to clients
$clients = array('desktop' => $config->getSystemValue('customclient_desktop', $defaults->getSyncClientUrl()), 'android' => $config->getSystemValue('customclient_android', $defaults->getAndroidClientUrl()), 'ios' => $config->getSystemValue('customclient_ios', $defaults->getiOSClientUrl()));
// only show root certificate import if external storages are enabled
$enableCertImport = false;
$externalStorageEnabled = \OC::$server->getAppManager()->isEnabledForUser('files_external');
if ($externalStorageEnabled) {
$backends = OC_Mount_Config::getPersonalBackends();
if (!empty($backends)) {
$enableCertImport = true;
}
}
// Return template
$tmpl = new OC_Template('settings', 'personal', 'user');
$tmpl->assign('usage', OC_Helper::humanFileSize($storageInfo['used']));
$tmpl->assign('total_space', OC_Helper::humanFileSize($storageInfo['total']));
$tmpl->assign('usage_relative', $storageInfo['relative']);
$tmpl->assign('clients', $clients);
$tmpl->assign('email', $email);
$tmpl->assign('languages', $languages);
$tmpl->assign('commonlanguages', $commonlanguages);
$tmpl->assign('activelanguage', $userLang);
$tmpl->assign('passwordChangeSupported', OC_User::canUserChangePassword(OC_User::getUser()));