本文整理汇总了PHP中OC_JSON::checkAppEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_JSON::checkAppEnabled方法的具体用法?PHP OC_JSON::checkAppEnabled怎么用?PHP OC_JSON::checkAppEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_JSON
的用法示例。
在下文中一共展示了OC_JSON::checkAppEnabled方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkAppEnabled
/**
* @brief Check if the App is enabled and send JSON error message instead
* @param string $app The app to check
*/
public static function checkAppEnabled($app)
{
return \OC_JSON::checkAppEnabled($app);
}
示例2: OC_L10N
<?php
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once '../../../lib/base.php';
$l10n = new OC_L10N('calendar');
if (!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
OC_JSON::checkAppEnabled('calendar');
$calendar = array('id' => 'new', 'displayname' => '', 'calendarcolor' => '');
$tmpl = new OC_Template('calendar', 'part.editcalendar');
$tmpl->assign('new', true);
$tmpl->assign('calendar', $calendar);
$tmpl->printPage();
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:19,代码来源:owncloud_apps_calendar_ajax_newcalendar.php
示例3: array
*
* 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 Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
//no apps or filesystem
$RUNTIME_NOSETUPFS = true;
require_once '../../../lib/base.php';
// Check if we are a user
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('bookmarks');
$CONFIG_DBTYPE = OC_Config::getValue("dbtype", "sqlite");
if ($CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3') {
$_ut = "strftime('%s','now')";
} else {
$_ut = "UNIX_TIMESTAMP()";
}
//FIXME: Detect when user adds a known URL
$query = OC_DB::prepare("\n\tINSERT INTO *PREFIX*bookmarks\n\t(url, title, user_id, public, added, lastmodified)\n\tVALUES (?, ?, ?, 0, {$_ut}, {$_ut})\n\t");
$params = array(htmlspecialchars_decode($_GET["url"]), htmlspecialchars_decode($_GET["title"]), OC_User::getUser());
$query->execute($params);
$b_id = OC_DB::insertid();
if ($b_id !== false) {
$query = OC_DB::prepare("\n\t\tINSERT INTO *PREFIX*bookmarks_tags\n\t\t(bookmark_id, tag)\n\t\tVALUES (?, ?)\n\t\t");
$tags = explode(' ', urldecode($_GET["tags"]));
foreach ($tags as $tag) {
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_apps_bookmarks_ajax_addBookmark.php
示例4:
<?php
/**
* ownCloud - Internal Bookmarks plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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 Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
require_once '../../../lib/base.php';
OC_JSON::checkAppEnabled('internal_bookmarks');
$c = $_POST['c'];
$k = OC_IntBks::getItemByTarget($c);
if (count($k) > 0) {
OC_JSON::encodedPrint($k);
}
示例5: OC_L10N
* 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/>.
*
*/
// Init owncloud
require_once '../../../lib/base.php';
$id = $_GET['id'];
$l10n = new OC_L10N('contacts');
// Check if we are a user
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('contacts');
$card = OC_Contacts_VCard::find($id);
if ($card === false) {
OC_JSON::error(array('data' => array('message' => $l10n->t('Contact could not be found.'))));
exit;
}
$addressbook = OC_Contacts_Addressbook::find($card['addressbookid']);
if ($addressbook === false || $addressbook['userid'] != OC_USER::getUser()) {
OC_JSON::error(array('data' => array('message' => $l10n->t('This is not your contact.'))));
exit;
}
$vcard = OC_Contacts_VCard::parse($card['carddata']);
// Check if the card is valid
if (is_null($vcard)) {
OC_JSON::error(array('data' => array('message' => $l10n->t('vCard could not be read.'))));
exit;
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_apps_contacts_ajax_getdetails.php
示例6: dirname
<?php
$RUNTIME_NOAPPS = true;
require_once '../../../lib/base.php';
OC_JSON::checkAppEnabled('files_sharing');
require_once '../lib_share.php';
$userDirectory = "/" . OC_User::getUser() . "/files";
$source = $userDirectory . $_GET['source'];
$path = $source;
if ($users = OC_Share::getMySharedItem($source)) {
for ($i = 0; $i < count($users); $i++) {
if ($users[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
$users[$i]['token'] = OC_Share::getTokenFromSource($source);
}
}
}
$source = dirname($source);
while ($source != "" && $source != "/" && $source != "." && $source != $userDirectory) {
if ($values = OC_Share::getMySharedItem($source)) {
$values = array_values($values);
$parentUsers = array();
for ($i = 0; $i < count($values); $i++) {
if ($values[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
$values[$i]['token'] = OC_Share::getTokenFromSource($source) . "&path=" . substr($path, strlen($source));
}
$parentUsers[basename($source) . "-" . $i] = $values[$i];
}
$users = array_merge($users, $parentUsers);
}
$source = dirname($source);
}
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_apps_files_sharing_ajax_getitem.php
示例7: array
<?php
// Init owncloud
require_once '../../lib/base.php';
$l = OC_L10N::get('settings');
OC_JSON::checkLoggedIn();
OCP\JSON::callCheck();
OC_JSON::checkAppEnabled('user_openid');
// Get data
if (isset($_POST['identity'])) {
$identity = $_POST['identity'];
OC_Preferences::setValue(OC_User::getUser(), 'user_openid', 'identity', $identity);
OC_JSON::success(array("data" => array("message" => $l->t("OpenID Changed"))));
} else {
OC_JSON::error(array("data" => array("message" => $l->t("Invalid request"))));
}
示例8: array
* ownCloud - Compress plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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 Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
require_once '../../../lib/base.php';
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('compress');
require_once '../config/config.php';
$k = array();
if (in_array('zip', get_loaded_extensions())) {
$k[] = '<option value="zip">Zip</option>';
}
if (file_exists($_CompressConf['tar_bin_path']) && file_exists($_CompressConf['gzip_bin_path'])) {
$k[] = '<option value="gzip">Gzip</option>';
}
OC_JSON::encodedPrint($k);
示例9:
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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 Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
require_once '../../../lib/base.php';
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('storage_charts');
$l = new OC_L10N('storage_charts', OC_L10N::findLanguage(array('en', 'fr')));
// Update and save the new configuration
if (is_numeric($_POST['s']) && in_array($_POST['k'], array('hu_size', 'hu_size_hus'))) {
OC_DLStCharts::setUConfValue($_POST['k'], $_POST['s']);
if (strcmp($_POST['k'], 'hu_size') == 0) {
OC_JSON::encodedPrint(array('r' => OC_DLStChartsLoader::loadChart('clines_usse', $l)));
} else {
OC_JSON::encodedPrint(array('r' => OC_DLStChartsLoader::loadChart('chisto_us', $l)));
}
}
示例10: header
* @copyright 2010 Robin Appelman icewind1991@gmail.com
*
* 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 Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
header('Content-type: text/html; charset=UTF-8');
//no apps or filesystem
$RUNTIME_NOAPPS = true;
$RUNTIME_NOSETUPFS = true;
require_once '../../../lib/base.php';
OC_JSON::checkAppEnabled('media');
if (defined("DEBUG") && DEBUG) {
error_log($_GET['autoupdate']);
}
$autoUpdate = (isset($_GET['autoupdate']) and $_GET['autoupdate'] == 'true');
if (defined("DEBUG") && DEBUG) {
error_log((int) $autoUpdate);
}
OC_Preferences::setValue(OC_User::getUser(), 'media', 'autoupdate', (int) $autoUpdate);
OC_JSON::success(array('data' => $autoUpdate));
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_apps_media_ajax_autoupdate.php
示例11: bailOut
* See the COPYING-README file.
*/
function bailOut($msg)
{
OC_JSON::error(array('data' => array('message' => $msg)));
OC_Log::write('core', 'ajax/vcategories/add.php: ' . $msg, OC_Log::DEBUG);
exit;
}
function debug($msg)
{
OC_Log::write('core', 'ajax/vcategories/add.php: ' . $msg, OC_Log::DEBUG);
}
require_once '../../../lib/base.php';
OC_JSON::checkLoggedIn();
$category = isset($_GET['category']) ? strip_tags($_GET['category']) : null;
$app = isset($_GET['app']) ? $_GET['app'] : null;
if (is_null($app)) {
bailOut(OC_Contacts_App::$l10n->t('Application name not provided.'));
}
OC_JSON::checkAppEnabled($app);
if (is_null($category)) {
bailOut(OC_Contacts_App::$l10n->t('No category to add?'));
}
debug(print_r($category, true));
$categories = new OC_VCategories($app);
if ($categories->hasCategory($category)) {
bailOut(OC_Contacts_App::$l10n->t('This category already exists: ' . $category));
} else {
$categories->add($category, true);
}
OC_JSON::success(array('data' => array('categories' => $categories->categories())));
示例12: switch
<?php
if (!isset($_)) {
//also provide standalone error page
require_once __DIR__ . '/../../../lib/base.php';
require_once __DIR__ . '/../lib/crypt.php';
OC_JSON::checkAppEnabled('files_encryption');
OC_App::loadApp('files_encryption');
$l = \OC::$server->getL10N('files_encryption');
if (isset($_GET['errorCode'])) {
$errorCode = $_GET['errorCode'];
switch ($errorCode) {
case \OCA\Files_Encryption\Crypt::ENCRYPTION_NOT_INITIALIZED_ERROR:
$errorMsg = $l->t('Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app.');
break;
case \OCA\Files_Encryption\Crypt::ENCRYPTION_PRIVATE_KEY_NOT_VALID_ERROR:
$theme = new OC_Defaults();
$errorMsg = $l->t('Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files.', array($theme->getName()));
break;
case \OCA\Files_Encryption\Crypt::ENCRYPTION_NO_SHARE_KEY_FOUND:
$errorMsg = $l->t('Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.');
break;
default:
$errorMsg = $l->t("Unknown error. Please check your system settings or contact your administrator");
break;
}
} else {
$errorCode = \OCA\Files_Encryption\Crypt::ENCRYPTION_UNKNOWN_ERROR;
$errorMsg = $l->t("Unknown error. Please check your system settings or contact your administrator");
}
if (isset($_GET['p']) && $_GET['p'] === '1') {
示例13: strtolower
* 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 Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
require_once '../../../../lib/base.php';
OC_JSON::checkAppEnabled('ocdownloader');
OC_JSON::checkLoggedIn();
if (!OC_Filesystem::is_dir('/Downloads')) {
OC_Filesystem::mkdir('/Downloads');
}
$pr = $_POST['pr'];
switch ($pr) {
case 'web':
$k = OC_ocDownloaderFile::getHttpFile($_POST['url']);
break;
default:
if (preg_match('/^pr_([0-9]{1,4})$/', $pr, $m)) {
$pr_name = OC_ocDownloader::getProvider($m[1]);
$user_info = OC_ocDownloader::getUserProviderInfo($m[1]);
$pr_name = strtolower($pr_name['pr_name']);
if (file_exists(OC::$SERVERROOT . '/apps/ocdownloader/providers/' . $pr_name . '.php')) {