/** * @param string $event */ private function registerFileHook($event) { $method = $event; if (substr($event, 0, 5) == 'post_') { $method = substr($event, 5); // remove post } \OC_HOOK::connect('OC_Filesystem', $event, 'OCA\\ocUsageCharts\\Hooks\\FileHooks', $method); }
* 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/>. * */ /* ### CONFIG ### ----------------------------------------------------- */ /* Allow that users can delete own posts, admin can delete all */ define('USER_CONVERSATIONS_CAN_DELETE', true); /* Allow messages to a single user */ define('UC_SINGLE_USER_MSG', true); /* FILE ATACHMENTS This is a beta feature with some known bugs. It could changed in a future release without backward compatibility! */ define('USER_CONVERSATIONS_ATTACHMENTS', true); /* end of configration ------------------------------ */ // register model-file OC::$CLASSPATH['OC_Conversations'] = 'conversations/lib/conversations.php'; // add update script to change the app-icon even when app is not active, TODO: find app-not-active function...! OCP\Util::addscript('conversations', 'updateCheck'); // register HOOK change user group OC_HOOK::connect('OC_User', 'post_addToGroup', 'OC_Conversations', 'changeUserGroup'); OC_HOOK::connect('OC_User', 'post_removeFromGroup', 'OC_Conversations', 'changeUserGroup'); $l = OC_L10N::get('conversations'); OCP\App::addNavigationEntry(array('id' => 'conversations', 'order' => 5, 'href' => OCP\Util::linkTo('conversations', 'index.php'), 'icon' => OCP\Util::imagePath('conversations', 'conversations.png'), 'name' => $l->t('Conversation')));
<?php $l = new OC_L10N('calendar'); OC::$CLASSPATH['OC_Calendar_Calendar'] = 'apps/calendar/lib/calendar.php'; OC::$CLASSPATH['OC_Calendar_Object'] = 'apps/calendar/lib/object.php'; OC::$CLASSPATH['OC_Calendar_Hooks'] = 'apps/calendar/lib/hooks.php'; OC::$CLASSPATH['OC_Connector_Sabre_CalDAV'] = 'apps/calendar/lib/connector_sabre.php'; OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Calendar_Hooks', 'deleteUser'); OC_Util::addScript('calendar', 'loader'); OC_App::register(array('order' => 10, 'id' => 'calendar', 'name' => 'Calendar')); OC_App::addNavigationEntry(array('id' => 'calendar_index', 'order' => 10, 'href' => OC_Helper::linkTo('calendar', 'index.php'), 'icon' => OC_Helper::imagePath('calendar', 'icon.png'), 'name' => $l->t('Calendar'))); OC_App::registerPersonal('calendar', 'settings');
<?php OC::$CLASSPATH['OC_Contacts_Addressbook'] = 'apps/contacts/lib/addressbook.php'; OC::$CLASSPATH['OC_Contacts_VCard'] = 'apps/contacts/lib/vcard.php'; OC::$CLASSPATH['OC_Contacts_Hooks'] = 'apps/contacts/lib/hooks.php'; OC::$CLASSPATH['OC_Connector_Sabre_CardDAV'] = 'apps/contacts/lib/connector_sabre.php'; OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Contacts_Hooks', 'deleteUser'); OC_App::register(array('order' => 10, 'id' => 'contacts', 'name' => 'Contacts')); OC_App::addNavigationEntry(array('id' => 'contacts_index', 'order' => 10, 'href' => OC_Helper::linkTo('contacts', 'index.php'), 'icon' => OC_Helper::imagePath('settings', 'users.svg'), 'name' => 'Contacts')); OC_APP::registerPersonal('contacts', 'settings');
public static function init() { // register autoloader spl_autoload_register(array('OC', 'autoload')); // set some stuff //ob_start(); error_reporting(E_ALL | E_STRICT); date_default_timezone_set('Europe/Berlin'); ini_set('arg_separator.output', '&'); // calculate the documentroot OC::$DOCUMENTROOT = realpath($_SERVER['DOCUMENT_ROOT']); OC::$SERVERROOT = str_replace("\\", '/', substr(__FILE__, 0, -13)); OC::$SUBURI = substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen(OC::$SERVERROOT)); $scriptName = $_SERVER["SCRIPT_NAME"]; if (substr($scriptName, -1) == '/') { $scriptName .= 'index.php'; } OC::$WEBROOT = substr($scriptName, 0, strlen($scriptName) - strlen(OC::$SUBURI)); if (OC::$WEBROOT != '' and OC::$WEBROOT[0] !== '/') { OC::$WEBROOT = '/' . OC::$WEBROOT; } // set the right include path set_include_path(OC::$SERVERROOT . '/lib' . PATH_SEPARATOR . OC::$SERVERROOT . '/config' . PATH_SEPARATOR . OC::$SERVERROOT . '/3rdparty' . PATH_SEPARATOR . get_include_path() . PATH_SEPARATOR . OC::$SERVERROOT); // redirect to https site if configured if (OC_Config::getValue("forcessl", false)) { ini_set("session.cookie_secure", "on"); if (!isset($_SERVER['HTTPS']) or $_SERVER['HTTPS'] != 'on') { $url = "https://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; header("Location: {$url}"); exit; } } ini_set('session.cookie_httponly', '1;'); session_start(); // Add the stuff we need always OC_Util::addScript("jquery-1.6.4.min"); OC_Util::addScript("jquery-ui-1.8.14.custom.min"); OC_Util::addScript("jquery-showpassword"); OC_Util::addScript("jquery.infieldlabel.min"); OC_Util::addScript("jquery-tipsy"); OC_Util::addScript("js"); //OC_Util::addScript( "multiselect" ); OC_Util::addScript('search', 'result'); OC_Util::addStyle("styles"); OC_Util::addStyle("multiselect"); OC_Util::addStyle("jquery-ui-1.8.14.custom"); OC_Util::addStyle("jquery-tipsy"); $errors = OC_Util::checkServer(); if (count($errors) > 0) { OC_Template::printGuestPage('', 'error', array('errors' => $errors)); exit; } // TODO: we should get rid of this one, too // WARNING: to make everything even more confusing, // DATADIRECTORY is a var that changes and DATADIRECTORY_ROOT // stays the same, but is set by "datadirectory". // Any questions? OC::$CONFIG_DATADIRECTORY = OC_Config::getValue("datadirectory", OC::$SERVERROOT . "/data"); // User and Groups if (!OC_Config::getValue("installed", false)) { $_SESSION['user_id'] = ''; } OC_User::useBackend(OC_Config::getValue("userbackend", "database")); OC_Group::setBackend(OC_Config::getValue("groupbackend", "database")); // Load Apps // This includes plugins for users and filesystems as well global $RUNTIME_NOAPPS; if (!$RUNTIME_NOAPPS) { OC_App::loadApps(); } // Was in required file ... put it here OC_Filesystem::registerStorageType('local', 'OC_Filestorage_Local', array('datadir' => 'string')); // Set up file system unless forbidden global $RUNTIME_NOSETUPFS; if (!$RUNTIME_NOSETUPFS) { OC_Util::setupFS(); } // Last part: connect some hooks OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Connector_Sabre_Principal', 'addPrincipal'); OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Connector_Sabre_Principal', 'deletePrincipal'); }
<?php /** * ownCloud - MailNotify Plugin * * @author Jascha Burmeister * @contributors Bastien Ho, Felix Baltruschat * @copyright 2012 Jascha Burmeister burmeister@wortbildton.de * * 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. * * */ OC::$CLASSPATH['OC_MailNotify_Mailing'] = 'mailnotify/lib/mailing.php'; OC::$CLASSPATH['OC_MailNotify_Hooks'] = 'mailnotify/lib/hooks.php'; OC_HOOK::connect('OC_Filesystem', 'post_create', 'OC_MailNotify_Hooks', 'notify'); OCP\Util::addScript('mailnotify', 'filelist_hook');