本文整理汇总了PHP中OCP\App::checkAppEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP App::checkAppEnabled方法的具体用法?PHP App::checkAppEnabled怎么用?PHP App::checkAppEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\App
的用法示例。
在下文中一共展示了App::checkAppEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup
public function setup()
{
App::checkAppEnabled('files_locking');
OC_User::clearBackends();
OC_User::useBackend(new OC_User_Dummy());
// Login
OC_User::createUser('test', 'test');
$this->user = OC_User::getUser();
OC_User::setUserId('test');
$this->storage = $this->getTestStorage();
}
示例2:
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('collaboration');
OCP\App::setActiveNavigationEntry('collaboration');
OCP\Util::addScript('collaboration', 'update_task');
OCP\Util::addScript('collaboration/3rdparty', 'jquery-ui-sliderAccess');
OCP\Util::addScript('collaboration/3rdparty', 'jquery-ui-timepicker-addon');
OCP\Util::addScript('collaboration/3rdparty', 'jquery-te');
OCP\Util::addStyle('collaboration/3rdparty', 'jquery-te');
OCP\Util::addStyle('collaboration/3rdparty', 'jquery-ui-timepicker-addon');
OCP\Util::addStyle('collaboration', 'content_header');
OCP\Util::addStyle('collaboration', 'tabs');
OCP\Util::addStyle('collaboration', 'update_task');
$l = OC_L10N::get('collaboration');
$tpl = new OCP\Template('collaboration', 'update_task', 'user');
$bol = OC_Collaboration_Project::isAdmin();
if ($bol == true) {
if (isset($_POST['tid'])) {
示例3: setAdminVal
<?php
OCP\User::checkAdminUser();
\OCP\App::checkAppEnabled('shorten');
function setAdminVal()
{
if (isset($_POST['host'])) {
OCP\Config::setAppValue('shorten', 'host', $_POST['host']);
#echo "host:".$_POST['host'];
}
if (isset($_POST['api'])) {
OCP\Config::setAppValue('shorten', 'api', $_POST['api']);
#echo "api:".$_POST['api'];
}
if (isset($_POST['type'])) {
OCP\Config::setAppValue('shorten', 'type', $_POST['type']);
#echo "type:".$_POST['type'];
}
}
示例4: pieces
<?php namespace apps2_games;
/**
* @brief ownCloud Games Integration
* @site http://oc-apps2.sourceforge.net/
*
* @author Pierre Fauconnier
* @copyright 2014 Pierre Fauconnier
* @license CeCILL v2.1 - http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
*/
// Main -> fired by ownCloud via appinfo/app.php
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled(K_APP_NAME);
\OCP\App::setActiveNavigationEntry(K_APP_NAME);
//
$myJSON =<<<EOJ
[
{"id":"minesweeper"
,"js":"g/jsminesweeper/JsMinesweeper.html"
,"caption":"Mine Sweeper"
,"ico":"img/minesweeper.png"
,"title":"Minesweeper is a small naval warship designed to engage in minesweeping.<br>By using various mechanisms intended to counter the threat posed by naval mines, minesweepers keep waterways clear for shipping."
},{"id":"titactoe"
,"js":"g/tictactoe/tictactoe.html"
,"caption":"Tic-Tac-Toe"
,"ico":"img/tictactoe.png"
,"title":"Tic-tac-toe (or Noughts and crosses, Xs and Os, Terni Lapilli) is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3\u00d73 grid.<br>The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game."
},{"id":"fiveInRow"
,"js":"g/fiveInRow/fir.html"
,"caption":"Five in Row"
,"ico":"img/FiR.jpg"
,"title":"Traditionally played with Go pieces (black and white stones) on a go board with 19\u00d719 intersections.<br>User plays first, then players alternate in placing a mark of their own on an empty place. The winner is the first player to get an unbroken row of five marks horizontally, vertically, or diagonally."
示例5: isset
<?php
/**
* ownCloud - Files_Opds App
*
* @author Frank de Lange
* @copyright 2014 Frank de Lange
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
namespace OCA\Files_Opds;
\OCP\App::checkAppEnabled('files_opds');
/* Enable login through basic auth, using normal OC username/password
* This is required because opds clients do not support the normal
* OC login process
*/
if (Util::authenticateUser() === false) {
Util::changeHttpStatus(401);
exit;
}
\OCP\User::checkLoggedIn();
/* Refuse access if user disabled opds support */
if (Config::get('enable', 'false') === 'false') {
Util::changeHttpStatus(403);
exit;
}
/* id defaults to 'root' (meaning 'serve root feed') */
$id = isset($_GET['id']) ? $_GET['id'] : 'root';
/* if either pid or tid is set, serve preview image for id */
示例6: setup
public function setup()
{
\OCP\App::checkAppEnabled('files_locking');
$this->fileLock = new Lock(__DIR__ . '/data/test.txt');
}
示例7: __construct
* later. See the COPYING file.
*
* @author Ben Curtis <ownclouddev@nosolutions.com>
* @copyright Ben Curtis 2015
*/
namespace OCA\OwnNote\Controller;
use \OCP\AppFramework\ApiController;
use \OCP\AppFramework\Http\JSONResponse;
use \OCP\AppFramework\Http\Response;
use \OCP\AppFramework\Http;
use \OCP\IRequest;
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('ownnote');
$FOLDER = "Notes";
class OwnnoteApiController extends ApiController {
private $userId;
public function __construct($appName, IRequest $request){
parent::__construct($appName, $request);
}
/**
* @NoAdminRequired
示例8: header
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
\OCP\App::checkAppEnabled('activity');
$forceUserLogout = false;
if (!\OCP\User::isLoggedIn()) {
if (!isset($_GET['token']) || strlen($_GET['token']) !== 30) {
// Token missing or invalid
header('HTTP/1.0 404 Not Found');
exit;
}
$preferences = new \OC\Preferences(\OC_DB::getConnection());
$users = $preferences->getUsersForValue('activity', 'rsstoken', $_GET['token']);
if (sizeof($users) !== 1) {
// User not found
header('HTTP/1.0 404 Not Found');
exit;
}
// Token found login as that user
示例9: array
<?php
// Look up other security checks in the docs!
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('ocDashboard');
\OCP\App::setActiveNavigationEntry('ocDashboard');
OCP\Util::addscript('ocDashboard', 'ocDashboard');
OCP\Util::addscript('ocDashboard', 'ajaxService');
OCP\Util::addStyle('ocDashboard', 'ocDashboard');
$user = OCP\User::getUser();
$w = array();
OC::$CLASSPATH['ocdWidgets'] = 'ocDashboard/appinfo/widgetConfigs.php';
OC::$CLASSPATH['ocdFactory'] = 'ocDashboard/lib/factory.php';
foreach (ocdWidgets::$widgets as $widget) {
// if widget is enabled
if (OCP\Config::getUserValue($user, "ocDashboard", "ocDashboard_" . $widget['id']) == "yes") {
$w[] = ocdFactory::getWidget($widget)->getData();
}
}
//if all deactivated
if (empty($w)) {
$l = new OC_L10N('ocDashboard');
$w[0]['error'] = "You can configure this site in your personal settings.";
$w[0]['id'] = "none";
$w[0]['name'] = "";
$w[0]['status'] = "3";
$w[0]['interval'] = "0";
$w[0]['icon'] = "";
}
$tpl = new OCP\Template("ocDashboard", "main", "user");
$tpl->assign('widgets', $w);
示例10:
* oclife is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* oclife 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with oclife. If not, see <http://www.gnu.org/licenses/>.
*/
// Highlight current menu item
OCP\App::setActiveNavigationEntry('oclife');
// Include what's needed by fancytree
\OCP\Util::addStyle('oclife', 'ui.fancytree');
\OCP\Util::addScript('oclife', 'fancytree/jquery.fancytree-all');
// Following is needed by layout manager
\OCP\Util::addScript('oclife', 'layout/jquery.sizes');
\OCP\Util::addScript('oclife', 'layout/jlayout.border');
\OCP\Util::addScript('oclife', 'layout/jquery.jlayout');
\OCP\Util::addScript('oclife', 'layout/layout');
// THEN execute what needed by us...
\OCP\Util::addStyle('oclife', 'oclife');
\OCP\Util::addScript('oclife', 'oclife/oclife_tagstree');
// Look up other security checks in the docs!
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('oclife');
$tpl = new OCP\Template("oclife", "main", "user");
$tpl->printPage();
示例11: setup
protected function setup()
{
parent::setUp();
\OCP\App::checkAppEnabled('files_locking');
$this->fileLock = new Lock(__DIR__ . '/data/test.txt');
}
示例12:
<?php
/**
* ownCloud - ownpad_lite plugin
*
* @author Victor Dubiniuk
* @copyright 2012 Victor Dubiniuk victor.dubiniuk@gmail.com
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
namespace OCA\ownpad_lite;
// Check if we are a user
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled(App::APP_ID);
\OCP\Util::addStyle(App::APP_ID, 'style');
\OCP\Util::addScript(App::APP_ID, 'etherpad');
\OCP\App::setActiveNavigationEntry('ownpad_lite_index');
$tmpl = new \OCP\Template(App::APP_ID, "index", "user");
$tmpl->assign(App::CONFIG_ETHERPAD_URL, App::getServiceUrl());
$tmpl->assign(App::CONFIG_USERNAME, App::getUsername());
$tmpl->printPage();
示例13: setup
protected function setup()
{
parent::setUp();
App::checkAppEnabled('files_locking');
$this->storage = $this->getTestStorage();
}
示例14: initController
public static function initController()
{
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('contacts');
\OCP\App::checkAppEnabled(self::APP_ID);
}
示例15: PasswordPolicyService
<?php
namespace OCA\PasswordPolicy;
use OCA\PasswordPolicy\Service;
use OCA\PasswordPolicy\Service\PasswordPolicyService;
use OCP\AppFramework\App;
use OCP\IContainer;
\OCP\App::checkAppEnabled('passwordpolicy');
\OCP\User::checkAdminUser();
$tpl = new \OCP\Template("passwordpolicy", "admin");
$tpl->assign('msg', 'Password Policy Enforcement');
$ocConfig = \OC::$server->getConfig();
$service = new PasswordPolicyService($ocConfig, 'passwordpolicy');
// set defaults
if ($service->getAppValue('minlength') == '') {
$service->setAppValue('minlength', '15');
}
if ($service->getAppValue('hasmixedcase') == '') {
$service->setAppValue('hasmixedcase', 'true');
}
if ($service->getAppValue('hasnumbers') == '') {
$service->setAppValue('hasnumbers', 'true');
}
if ($service->getAppValue('hasspecialchars') == '') {
$service->setAppValue('hasspecialchars', 'true');
}
if ($service->getAppValue('specialcharslist') == '') {
$service->setAppValue('specialcharslist', '!@#$%^&*()');
}
$minlength = $service->getAppValue('minlength');