本文整理汇总了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);
}
}
示例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) {
示例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;
}
示例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();
}
示例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;
}