Ejemplo n.º 1
0
 /**
  * Register settings templates
  */
 public function registerSettings()
 {
     $container = $this->getContainer();
     $backendService = $container->query('OCA\\Files_External\\Service\\BackendService');
     \OCP\App::registerAdmin('files_external', 'settings');
     \OCP\App::registerPersonal('files_external', 'personal');
 }
Ejemplo n.º 2
0
 /**
  * Tells ownCloud to include a template in the personal overview
  * @param string $mainPath the path to the main php file without the php
  * suffix, relative to your apps directory! not the template directory
  * @param string $appName the name of the app, defaults to the current one
  */
 public function registerPersonal($mainPath, $appName = null)
 {
     if ($appName === null) {
         $appName = $this->appName;
     }
     \OCP\App::registerPersonal($appName, $mainPath);
 }
Ejemplo n.º 3
0
 public static function init()
 {
     \OC::$CLASSPATH['OCA_Gsync\\Contact'] = self::APP_ID . '/lib/contact.php';
     \OC::$CLASSPATH['OCA_Gsync\\Request'] = self::APP_ID . '/lib/request.php';
     \OC::$CLASSPATH['OCA_Gsync\\Adapter'] = self::APP_ID . '/lib/adapter.php';
     \OCP\App::registerPersonal(self::APP_ID, 'settings');
     self::$l10n = \OC_L10N::get('core');
 }
Ejemplo n.º 4
0
 * 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/>.
 *
 */
namespace OCA\Documents\AppInfo;

use OCA\Documents\Filter\Office;
use OCA\Documents\Config;
$app = new Application();
$c = $app->getContainer();
\OCP\App::registerAdmin('documents', 'admin');
\OCP\App::registerPersonal('documents', 'personal');
$navigationEntry = function () use($c) {
    return ['id' => 'documents_index', 'order' => 2, 'href' => $c->query('ServerContainer')->getURLGenerator()->linkToRoute('documents.document.index'), 'icon' => $c->query('ServerContainer')->getURLGenerator()->imagePath('documents', 'documents.svg'), 'name' => $c->query('L10N')->t('Documents')];
};
$c->getServer()->getNavigationManager()->add($navigationEntry);
//Script for registering file actions
$request = \OC::$server->getRequest();
if (isset($request->server['REQUEST_URI'])) {
    $url = $request->server['REQUEST_URI'];
    if (preg_match('%index.php/apps/files(/.*)?%', $url)) {
        \OCP\Util::addScript('documents', 'viewer/viewer');
    }
}
if ($c->query('AppConfig')->isConverterEnabled()) {
    $docFilter = new Office(['read' => ['target' => 'application/vnd.oasis.opendocument.text', 'format' => 'odt:writer8', 'extension' => 'odt'], 'write' => ['target' => 'application/msword', 'format' => 'doc', 'extension' => 'doc']]);
    $docxFilter = new Office(['read' => ['target' => 'application/vnd.oasis.opendocument.text', 'format' => 'odt:writer8', 'extension' => 'odt'], 'write' => ['target' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'format' => 'docx', 'extension' => 'docx']]);
Ejemplo n.º 5
0
 /**
  * Register personal settings for notifications and emails
  */
 public function registerPersonalPage()
 {
     \OCP\App::registerPersonal($this->getContainer()->getAppName(), 'personal');
 }
Ejemplo n.º 6
0
<?php

/**
 * ownCloud - ocDownloader
 *
 * This file is licensed under the Creative Commons BY-SA License version 3 or
 * later. See the COPYING file.
 *
 * @author Xavier Beurois <www.sgc-univ.net>
 * @copyright Xavier Beurois 2015
 */
namespace OCA\ocDownloader\AppInfo;

$l = \OC::$server->getL10N('ocdownloader');
$g = \OC::$server->getURLGenerator();
\OCP\App::addNavigationEntry(['id' => 'ocdownloader', 'order' => 10, 'href' => $g->linkToRoute('ocdownloader.Index.Add'), 'icon' => $g->imagePath('ocdownloader', 'ocdownloader.svg'), 'name' => 'ocDownloader']);
\OCP\App::registerAdmin('ocdownloader', 'settings/admin');
\OCP\App::registerPersonal('ocdownloader', 'settings/personal');
Ejemplo n.º 7
0
<?php

namespace OCA\PasswordPolicy\AppInfo;

use OCP\AppFramework\App;
use OCA\PasswordPolicy\Hooks\PasswordPolicyHooks;
use OCA\PasswordPolicy\Appinfo;
use OCA\PasswordPolicy\Appinfo\Application;
\OCP\App::registerAdmin('passwordpolicy', 'admin');
\OCP\App::registerPersonal('passwordpolicy', 'personal');
//\OCP\Util::connectHook('OC_User', 'pre_setPassword', 'OCA\PasswordPolicy\Hooks\PasswordPolicyHooks', 'pre_setPassword');
$app = new Application();
$app->getContainer()->query('PasswordPolicyHooks')->register();
Ejemplo n.º 8
0
Archivo: app.php Proyecto: kenwi/core
$l = \OC::$server->getL10N('files_sharing');
\OC::$CLASSPATH['OC_Share_Backend_File'] = 'files_sharing/lib/share/file.php';
\OC::$CLASSPATH['OC_Share_Backend_Folder'] = 'files_sharing/lib/share/folder.php';
\OC::$CLASSPATH['OC\\Files\\Storage\\Shared'] = 'files_sharing/lib/sharedstorage.php';
\OC::$CLASSPATH['OC\\Files\\Cache\\SharedScanner'] = 'files_sharing/lib/scanner.php';
\OC::$CLASSPATH['OC\\Files\\Cache\\Shared_Cache'] = 'files_sharing/lib/cache.php';
\OC::$CLASSPATH['OC\\Files\\Cache\\Shared_Permissions'] = 'files_sharing/lib/permissions.php';
\OC::$CLASSPATH['OC\\Files\\Cache\\Shared_Updater'] = 'files_sharing/lib/updater.php';
\OC::$CLASSPATH['OC\\Files\\Cache\\Shared_Watcher'] = 'files_sharing/lib/watcher.php';
\OC::$CLASSPATH['OCA\\Files\\Share\\Maintainer'] = 'files_sharing/lib/maintainer.php';
\OC::$CLASSPATH['OCA\\Files\\Share\\Proxy'] = 'files_sharing/lib/proxy.php';
$application = new Application();
$application->registerMountProviders();
\OCP\App::registerAdmin('files_sharing', 'settings-admin');
\OCP\App::registerPersonal('files_sharing', 'settings-personal');
\OCA\Files_Sharing\Helper::registerHooks();
\OCP\Share::registerBackend('file', 'OC_Share_Backend_File');
\OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file');
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener('OCA\\Files::loadAdditionalScripts', function () {
    \OCP\Util::addScript('files_sharing', 'share');
    \OCP\Util::addScript('files_sharing', 'sharetabview');
    if (\OC::$server->getConfig()->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'yes') {
        \OCP\Util::addScript('files_sharing', 'external');
    }
    \OCP\Util::addStyle('files_sharing', 'sharetabview');
});
// \OCP\Util::addStyle('files_sharing', 'sharetabview');
\OC::$server->getActivityManager()->registerExtension(function () {
    return new \OCA\Files_Sharing\Activity(\OC::$server->query('L10NFactory'), \OC::$server->getURLGenerator(), \OC::$server->getActivityManager());
Ejemplo n.º 9
0
 public function registerSettings()
 {
     // Register settings scripts
     App::registerAdmin('encryption', 'settings/settings-admin');
     App::registerPersonal('encryption', 'settings/settings-personal');
 }
Ejemplo n.º 10
0
<?php

use OCP\AppFramework\App;
$app = new App('passwords');
$container = $app->getContainer();
$l = \OCP\Util::getL10N('passwords');
\OCP\App::registerAdmin('passwords', 'templates/admin.settings');
\OCP\App::registerPersonal('passwords', 'templates/personal.settings');
$urlGenerator = $container->query('OCP\\IURLGenerator');
$l10n = $container->query('OCP\\IL10N');
\OCP\App::addNavigationEntry(array('id' => 'passwords', 'order' => 9999, 'href' => $urlGenerator->linkToRoute('passwords.page.index'), 'icon' => $urlGenerator->imagePath('passwords', 'app.svg'), 'name' => $l10n->t('Passwords')));
Ejemplo n.º 11
0
<?php

$l = OC_L10N::get('files_opds');
\OCP\App::registerPersonal('files_opds', 'personal');
\OCP\App::registerAdmin('files_opds', 'admin');
/* register preview provider */
\OC::$server->getPreviewManager()->registerProvider('/application\\/epub\\+zip/', function () {
    return new OCA\Files_Opds\EpubPreview();
});
Ejemplo n.º 12
0
 * 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/>.
 *
 */
namespace OCA\User_Servervars2\AppInfo;

$app = new ConfigApp();
$c = $app->getContainer();
$appName = 'user_servervars2';
if (!\OCP\App::isEnabled($appName)) {
    return;
}
//To put a template into admin menu
\OCP\App::registerAdmin('user_servervars2', 'settings/admin');
\OCP\App::registerPersonal('user_servervars2', 'settings/user');
$login = array('href' => $app->getAppConfig()->getValue('user_servervars2', 'sso_url'), 'name' => $app->getAppConfig()->getValue('user_servervars2', 'button_name', 'Use Your ID Provider'));
\OC_App::registerLogIn($login);
$app->getUserManager()->registerBackend($c->query('UserBackend'));
//$app->getGroupManager()->addBackend( new \OC_Group_Database() );
$c->query('ServerVarsHooks')->register($app->getUserSession());
$authStatus = $c->isLoggedIn();
// - trigger authentication -
// http://localhost/core/index.php?XDEBUG_SESSION_START=sublime.xdebug&app=usv2&debug=1
//-- TRIGGERS --
$interceptor = $c->query('Interceptor');
$interceptor->run();
Ejemplo n.º 13
0
 * ownCloud - sipgate
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Raphael Pigulla <*****@*****.**>
 * @copyright Raphael Pigulla 2015
 */
namespace OCA\Sipgate\AppInfo;

use OCP\AppFramework\App;
require __DIR__ . '/../vendor/autoload.php';
$app = new App('sipgate');
$container = $app->getContainer();
/** @var \OCP\IUserSession $userSession */
$userSession = $container->query('OCP\\IUserSession');
if ($userSession->getUser()) {
    $appSettings = $container->query('OCA\\Sipgate\\Service\\AppSettings');
    $appSettings->addUserId($userSession->getUser()->getUID());
}
\OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OCA\\Sipgate\\Hooks\\UserHooks', 'postDeleteUser');
\OCP\App::registerPersonal($container->getAppName(), 'settings/settings-personal');
$container->getServer()->getJobList()->add('OCA\\Sipgate\\Cron\\FetchHistory');
$container->getServer()->getJobList()->add('OCA\\Sipgate\\Cron\\FetchItemizedEntries');
$container->getServer()->getJobList()->add('OCA\\Sipgate\\Cron\\FetchPhoneBook');
$container->getServer()->getJobList()->add('OCA\\Sipgate\\Cron\\PurgeHistory');
$container->query('OCP\\INavigationManager')->add(function () use($container) {
    $urlGenerator = $container->query('OCP\\IURLGenerator');
    $l10n = $container->query('OCP\\IL10N');
    return ['id' => 'sipgate', 'order' => 10, 'href' => $urlGenerator->linkToRoute('sipgate.page.index'), 'icon' => $urlGenerator->imagePath('sipgate', 'app.svg'), 'name' => $l10n->t('Sipgate')];
});
Ejemplo n.º 14
0
<?php

//$job = new \OCA\fc_mail_attachments\Job();
//OC::$CLASSPATH['OC_FCMA_Job'] = $job;
\OCP\App::registerPersonal('fc_mail_attachments', 'settings');
\OCP\BackgroundJob::addRegularTask('\\OCA\\fc_mail_attachments\\Job', 'run');
Ejemplo n.º 15
0
<?php

/**
 * ownCloud
 *
 * @author Michal Jaskurzynski
 * @copyright 2012 Michal Jaskurzynski mjaskurzynski@gmail.com
 *
 */
OC::$CLASSPATH['OCA\\mozilla_sync\\InputData'] = 'mozilla_sync/lib/inputdata.php';
OC::$CLASSPATH['OCA\\mozilla_sync\\OutputData'] = 'mozilla_sync/lib/outputdata.php';
OC::$CLASSPATH['OCA\\mozilla_sync\\User'] = '******';
OC::$CLASSPATH['OCA\\mozilla_sync\\UrlParser'] = 'mozilla_sync/lib/urlparser.php';
OC::$CLASSPATH['OCA\\mozilla_sync\\Utils'] = 'mozilla_sync/lib/utils.php';
OC::$CLASSPATH['OCA\\mozilla_sync\\Storage'] = 'mozilla_sync/lib/storage.php';
OC::$CLASSPATH['OCA\\mozilla_sync\\Service'] = 'mozilla_sync/lib/service.php';
OC::$CLASSPATH['OCA\\mozilla_sync\\StorageService'] = 'mozilla_sync/lib/storageservice.php';
OC::$CLASSPATH['OCA\\mozilla_sync\\UserService'] = 'mozilla_sync/lib/userservice.php';
// Register Mozilla Sync for personal page
\OCP\App::registerPersonal('mozilla_sync', 'settings');
// Register Mozilla Sync for the admin page
\OCP\App::registerAdmin('mozilla_sync', 'admin');
/* vim: set ts=4 sw=4 tw=80 noet : */
Ejemplo n.º 16
0
$c = $app->getContainer();
// It is not necessary to activate Shibboleth backend
// for these URLs. The list comes from here:
// https://doc.owncloud.com/server/8.2/admin_manual/enterprise_user_management/user_auth_shibboleth.html#apache-configuration
$nonShibUrls = '^/' . '(status.php' . '|remote.php' . '|index.php/s/' . '|public.php' . '|cron.php' . '|core/img/' . '|index.php/apps/files_sharing/ajax/publicpreview.php$' . '|index.php/apps/files/ajax/upload.php$' . '|apps/files/templates/fileexists.html$' . '|index.php/apps/files/ajax/mimeicon.php$' . '|apps/gallery/templates/slideshow.html$' . '|index.php/apps/gallery/ajax/getimages.php' . '|index.php/apps/gallery/ajax/thumbnail.php' . '|index.php/apps/gallery/ajax/image.php' . '|.*\\.css$' . '|.*\\.js$' . '|.*\\.woff$' . '|index.php/settings/personal/changepassword' . '|ocs' . ')';
$nonShibRegex = '/' . str_replace('/', '\\/', $nonShibUrls) . '/i';
$request = $c->query('Request');
$requestUri = $request->getRequestUri();
if (!\OC::$CLI && !preg_match($nonShibRegex, $requestUri)) {
    // Register itself as User Backend
    $c->query('UserManager')->registerBackend($c->query('UserBackend'));
    // Register Hooks
    $c->query('UserHooks')->register();
    $c->query('UserHooks')->registerPostSetPassword();
    // Prepare login URL with possible redirect URL
    $urlGen = $c->query('URLGenerator');
    $urlParams = $request->getParams();
    if (array_key_exists('redirect_url', $urlParams)) {
        $loginRoute = $urlGen->linkToRoute('user_shib.session.login', array('redirect_url' => $urlParams['redirect_url'], 'requesttoken' => \OCP\Util::callRegister()));
    } else {
        $loginRoute = $urlGen->linkToRoute('user_shib.session.login', array('requesttoken' => \OCP\Util::callRegister()));
    }
    // Templates registration
    // TODO: Couldn't find an \OCP way for achieving this
    \OC_App::registerLogIn(array('name' => 'Shibboleth Login', 'href' => $loginRoute));
    \OCP\App::registerAdmin($c->query('AppName'), 'admin');
    \OCP\App::registerPersonal($c->query('AppName'), 'personal');
} elseif ($requestUri === '/index.php/settings/personal/changepassword') {
    // Register only Non-Shib Hook for password setting
    $c->query('UserHooks')->registerPostSetPassword();
}
Ejemplo n.º 17
0
 *
 * 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/>.
 *
 */
namespace OCA\Activity\AppInfo;

$app = new Application();
$c = $app->getContainer();
// add an navigation entry
$navigationEntry = function () use($c) {
    return ['id' => $c->getAppName(), 'order' => 1, 'name' => $c->query('ActivityL10N')->t('Activity'), 'href' => $c->getServer()->getURLGenerator()->linkToRoute('activity.Activities.showList'), 'icon' => $c->getServer()->getURLGenerator()->imagePath('activity', 'activity.svg')];
};
$c->getServer()->getNavigationManager()->add($navigationEntry);
// register the hooks for filesystem operations. All other events from other apps has to be send via the public api
\OCA\Activity\FilesHooksStatic::register();
\OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OCA\\Activity\\Hooks', 'deleteUser');
\OCA\Activity\Consumer::register($c->getServer()->getActivityManager(), $c);
// Personal settings for notifications and emails
\OCP\App::registerPersonal($c->getAppName(), 'personal');
Ejemplo n.º 18
0
 /**
  * register personal and admin settings page
  */
 public function registerSettings()
 {
     \OCP\App::registerAdmin('federatedfilesharing', 'settings-admin');
     \OCP\App::registerPersonal('federatedfilesharing', 'settings-personal');
 }
Ejemplo n.º 19
0
\OCP\Util::connectHook('OCP\\Share', 'post_unshare', 'OCA\\Music\\Hooks\\Share', 'itemUnshared');
// TODO: disabled because it can delay the share a lot
/*
\OCP\Util::connectHook(
	'OCP\Share', 'post_shared',
	'OCA\Music\Hooks\Share', 'itemShared'
);
*/
/**
 * register search provider
 */
\OC_Search::registerProvider('OCA\\Music\\Utility\\Search');
/**
 * register settings
 */
\OCP\App::registerPersonal($c->query('AppName'), 'settings/user');
/**
 * load styles and scripts
 */
$appName = $c->query('AppName');
if (version_compare(implode('.', \OCP\Util::getVersion()), '7.8', '<=')) {
    // fileactions
    $c->query('API')->addScript('public/fileactions', $appName);
    // file player for public sharing page
    $c->query('API')->addScript('public/musicFilePlayer', $appName);
} else {
    // fileactions
    \OCP\Util::addScript($appName, 'public/fileactions');
    // file player for public sharing page
    \OCP\Util::addScript($appName, 'public/musicFilePlayer');
}
Ejemplo n.º 20
0
<?php

$l = new OC_L10N('ocDashboard');
\OCP\App::registerPersonal('ocDashboard', 'settings');
\OCP\App::addNavigationEntry(array('id' => 'ocDashboard', 'order' => 0, 'href' => \OCP\Util::linkToRoute('ocDashboard_index'), 'icon' => \OCP\Util::imagePath('ocDashboard', 'icon.svg'), 'name' => 'Dashboard'));