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


PHP OC_Util::checkLoggedIn方法代碼示例

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


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

示例1: delete

 public static function delete($parameters)
 {
     OC_Util::checkLoggedIn();
     $user = OC_User::getUser();
     $app = addslashes(strip_tags($parameters['app']));
     $key = addslashes(strip_tags($parameters['key']));
     if ($key === "" or $app === "") {
         return new OC_OCS_Result(null, 101);
         //key and app are NOT optional here
     }
     if (OC_Preferences::deleteKey($user, $app, $key)) {
         return new OC_OCS_Result(null, 100);
     }
 }
開發者ID:CDN-Sparks,項目名稱:owncloud,代碼行數:14,代碼來源:privatedata.php

示例2:

 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */
\OC_Util::checkLoggedIn();
\OC::$server->getSession()->close();
if (!\OC_App::isEnabled('files_trashbin')) {
    exit;
}
$file = array_key_exists('file', $_GET) ? (string) $_GET['file'] : '';
$maxX = array_key_exists('x', $_GET) ? (int) $_GET['x'] : '44';
$maxY = array_key_exists('y', $_GET) ? (int) $_GET['y'] : '44';
$scalingUp = array_key_exists('scalingup', $_GET) ? (bool) $_GET['scalingup'] : true;
if ($file === '') {
    \OC_Response::setStatus(400);
    //400 Bad Request
    \OCP\Util::writeLog('core-preview', 'No file parameter was passed', \OCP\Util::DEBUG);
    exit;
}
if ($maxX === 0 || $maxY === 0) {
開發者ID:GitHubUser4234,項目名稱:core,代碼行數:31,代碼來源:preview.php

示例3: checkSubAdminUser

 /**
  * Check if the user is a subadmin, redirects to home if not
  *
  * @return null|boolean $groups where the current user is subadmin
  */
 public static function checkSubAdminUser()
 {
     OC_Util::checkLoggedIn();
     if (!OC_SubAdmin::isSubAdmin(OC_User::getUser())) {
         header('Location: ' . OC_Helper::linkToAbsolute('', 'index.php'));
         exit;
     }
     return true;
 }
開發者ID:pinoniq,項目名稱:core,代碼行數:14,代碼來源:util.php

示例4: checkLoggedIn

 /**
  * Check if the user is logged in, redirects to home if not. With
  * redirect URL parameter to the request URI.
  */
 public static function checkLoggedIn()
 {
     \OC_Util::checkLoggedIn();
 }
開發者ID:olucao,項目名稱:owncloud-core,代碼行數:8,代碼來源:user.php

示例5: checkSubAdminUser

 /**
  * Check if the user is a subadmin, redirects to home if not
  *
  * @return null|boolean $groups where the current user is subadmin
  */
 public static function checkSubAdminUser()
 {
     OC_Util::checkLoggedIn();
     $userObject = \OC::$server->getUserSession()->getUser();
     $isSubAdmin = false;
     if ($userObject !== null) {
         $isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject);
     }
     if (!$isSubAdmin) {
         header('Location: ' . OC_Helper::linkToAbsolute('', 'index.php'));
         exit;
     }
     return true;
 }
開發者ID:reverserob,項目名稱:core,代碼行數:19,代碼來源:util.php


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