当前位置: 首页>>代码示例>>PHP>>正文


PHP User::checkLoggedIn方法代码示例

本文整理汇总了PHP中OCP\User::checkLoggedIn方法的典型用法代码示例。如果您正苦于以下问题:PHP User::checkLoggedIn方法的具体用法?PHP User::checkLoggedIn怎么用?PHP User::checkLoggedIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OCP\User的用法示例。


在下文中一共展示了User::checkLoggedIn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: servePreview

 /**
  * @brief offer preview for download
  *
  * if no preview exists for this file, send icon instead
  * 
  * @param string $path full path to file
  * @param string type type of preview requested
  */
 public static function servePreview($path, $type)
 {
     \OCP\User::checkLoggedIn();
     \OC::$server->getSession()->close();
     $i = \OC\Files\Filesystem::getFileInfo($path, false);
     /* check for predefined cover, if found replace $path with that of cover file */
     $meta = Meta::get($i['fileid']);
     if ($meta['cover']) {
         $path = pathinfo($path)['dirname'] . '/' . $meta['cover'];
         $i = \OC\Files\Filesystem::getFileInfo($path, false);
     }
     if (\OC::$server->getPreviewManager()->isMimeSupported($i['mimetype'])) {
         $preview = new \OC\Preview(\OC_User::getUser(), 'files');
         $preview->setFile($path);
         switch ($type) {
             case 'cover':
                 $preview->setMaxX(Config::getApp('cover-x', '200'));
                 $preview->setMaxY(Config::getApp('cover-y', '200'));
                 break;
             case 'thumbnail':
                 $preview->setMaxX(Config::getApp('thumb-x', '36'));
                 $preview->setMaxY(Config::getApp('thumb-y', '36'));
                 break;
         }
         $preview->showPreview();
     } else {
         // no preview, serve icon instead
         $scheme = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http';
         header("Location: " . $scheme . "://" . $_SERVER['HTTP_HOST'] . \OC_Helper::mimetypeIcon($i->getMimeType()));
         /* Note: relative URL should be enough (RFC7231) but some OPDS clients
          * (especially those in dedicated book readers) might not support them
          * 
          * header("Location: " . \OC_Helper::mimetypeIcon($i->getMimeType()));
          */
     }
 }
开发者ID:RavenB,项目名称:owncloud-apps,代码行数:44,代码来源:feed.php

示例2:

<?php

\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('fc_mail_attachments');
\OCP\Util::addscript('fc_mail_attachments', 'utils');
\OCP\Util::addscript('fc_mail_attachments', 'account');
//OCP\Util::addstyle('fc_mail_attachments', 'style');
$user = OCP\User::getUser();
$tmpl = new OCP\Template('fc_mail_attachments', 'settings');
$query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*fc_mail_attachments` WHERE user = ?');
$results = $query->execute(array($user))->fetchAll();
if (sizeof($results)) {
    $conf = $results[0];
    $tmpl->assign('dir', $conf['dir']);
    $tmpl->assign('mail_host', $conf['mail_host']);
    $tmpl->assign('mail_port', $conf['mail_port']);
    $tmpl->assign('mail_security', $conf['mail_security']);
    $tmpl->assign('mail_user', $conf['mail_user']);
}
return $tmpl->fetchPage();
开发者ID:shiruken1,项目名称:owncloud_mail_attachments,代码行数:20,代码来源:settings.php

示例3: initController

 public static function initController()
 {
     \OCP\User::checkLoggedIn();
     \OCP\App::checkAppEnabled('contacts');
     \OCP\App::checkAppEnabled(self::APP_ID);
 }
开发者ID:seanbradley28,项目名称:gsync,代码行数:6,代码来源:app.php


注:本文中的OCP\User::checkLoggedIn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。