public function getShortFooter() { $baseUrl = "<a href=\"" . $this->getBaseUrl() . "\" target=\"_blank\">" . $this->getEntity() . "</a>"; $slogan = $this->getSlogan(); // === GTU $cguUrl = ''; if (OC_APP::isEnabled('gtu')) { $cguUrl = \OCP\Config::getAppvalue('gtu', 'url', ''); } if (empty($cguUrl)) { $cguUrl = \OCP\Config::getSystemvalue('custom_termsofserviceurl', ''); } $cgu = ''; if (!empty($cguUrl)) { $cgu = '<a href="' . $cguUrl . '" target="_blank">CGU</a>'; } // === Help $helpUrl = ''; if (empty($helpUrl)) { $helpUrl = $this->getHelpUrl(); } $help = ''; if (!empty($helpUrl)) { $help = '<a href="' . $helpUrl . '" target="_blank">Aide</a>'; } // === contact $contact = ' – ' . '<a href="http://ods.cnrs.fr/contacts.html" target="_blank">Contacts</a>'; // ========================= $footer = $baseUrl . ' – ' . $slogan . ' – ' . $cgu . ' – ' . $help . $contact; return $footer; }
public static function init() { //Allow config page \OC::$CLASSPATH['OCA_Updater\\Backup'] = self::APP_PATH . 'lib/backup.php'; \OC::$CLASSPATH['OCA_Updater\\Downloader'] = self::APP_PATH . 'lib/downloader.php'; \OC::$CLASSPATH['OCA_Updater\\Updater'] = self::APP_PATH . 'lib/updater.php'; \OC_APP::registerAdmin(self::APP_ID, 'admin'); }
/** * Get the files to load the routes from * * @return string[] */ public function getRoutingFiles() { if (!isset($this->routingFiles)) { $this->routingFiles = array(); foreach (\OC_APP::getEnabledApps() as $app) { $file = \OC_App::getAppPath($app) . '/appinfo/routes.php'; if (file_exists($file)) { $this->routingFiles[$app] = $file; } } } return $this->routingFiles; }
public function checkPassword($uid, $password) { if (!$this->db_conn) { $this->connectdb(); } if (!$this->db_conn) { return false; } $query = 'SELECT user_login, user_pass FROM ' . self::$params['wordpress_db_prefix'] . 'users WHERE user_login = "******"', '""', $uid) . '"'; $query .= ' AND user_status = 0'; $result = $this->wp_instance->db->query($query); if ($result && mysqli_num_rows($result) > 0) { $row = mysqli_fetch_assoc($result); $hash = $row['user_pass']; $normalize_path = str_replace('\\', '/', OC_APP::getAppPath('user_wordpress')); $path_array = explode('/', $normalize_path); array_pop($path_array); $app_folder = array_pop($path_array); OC::$CLASSPATH['OC_wordpress'] = $app_folder . '/lib/wordpress.class.php'; require_once $app_folder . '/user_wordpress/class-phpass.php'; $wp_hasher = new WPPasswordHash(8, TRUE); $check = $wp_hasher->CheckPassword($password, $hash); if ($check === true) { // Make sure the user is in the wordpress_global_group if (self::$params['wordpress_global_group'] != '') { if (!OC_Group::groupExists(self::$params['wordpress_global_group'])) { OC_Group::createGroup(self::$params['wordpress_global_group']); } $UserblogsIds = $this->wp_instance->getUserblogsIds($uid); if (empty($UserblogsIds)) { // remove from group if current user has no access to Wordpress blog/site with the same role name. OC_Group::removefromGroup($uid, self::$params['wordpress_global_group']); } else { OC_Group::addToGroup($uid, self::$params['wordpress_global_group']); } } $this->setUserInfos($uid); return $row['user_login']; } } return false; }
<?php /** * ownCloud - media plugin * * @author Robin Appelman * @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/ * */ $l = new OC_L10N('media'); require_once 'apps/media/lib_media.php'; OC_Util::addScript('media', 'loader'); OC_APP::registerPersonal('media', 'settings'); OC_App::register(array('order' => 3, 'id' => 'media', 'name' => 'Media')); OC_App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo('media', 'index.php'), 'icon' => OC_Helper::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music')));
function testDeleteHooksForSharedFiles() { self::logoutHelper(); self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER1); \OC_User::setUserId(self::TEST_ENCRYPTION_HOOKS_USER1); // remember files_trashbin state $stateFilesTrashbin = \OC_App::isEnabled('files_trashbin'); // we want to tests with app files_trashbin disabled \OC_App::disable('files_trashbin'); // make sure that the trash bin is disabled $this->assertFalse(\OC_APP::isEnabled('files_trashbin')); $this->user1View->file_put_contents($this->filename, $this->data); // check if all keys are generated $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey')); $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->filename . '/fileKey')); // get the file info from previous created file $fileInfo = $this->user1View->getFileInfo($this->filename); // check if we have a valid file info $this->assertTrue($fileInfo instanceof \OC\Files\FileInfo); // share the file with user2 \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_HOOKS_USER2, \OCP\Constants::PERMISSION_ALL); // check if new share key exists $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey')); self::logoutHelper(); self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER2); \OC_User::setUserId(self::TEST_ENCRYPTION_HOOKS_USER2); // user2 update the shared file $this->user2View->file_put_contents($this->filename, $this->data); // keys should be stored at user1s dir, not in user2s $this->assertFalse($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keys/' . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey')); $this->assertFalse($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keys/' . $this->filename . '/fileKey')); // delete the Shared file from user1 in data/user2/files/Shared $result = $this->user2View->unlink($this->filename); $this->assertTrue($result); // share key for user2 from user1s home should be gone, all other keys should still exists $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey')); $this->assertFalse($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->filename . '/' . self::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey')); $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keys/' . $this->filename . '/fileKey')); // cleanup self::logoutHelper(); self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER1); \OC_User::setUserId(self::TEST_ENCRYPTION_HOOKS_USER1); if ($stateFilesTrashbin) { \OC_App::enable('files_trashbin'); } else { \OC_App::disable('files_trashbin'); } }
<p class="center"> <?php print_unescaped($l->t('If you want to support the project <a href="https://owncloud.org/contribute" target="_blank">join development</a> or <a href="https://owncloud.org/promote" target="_blank">spread the word</a>!')); ?> </p> <?php } ?> <?php if (OC_APP::isEnabled('firstrunwizard')) { ?> <p class="center"><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again')); ?> </a></p> <?php } ?> </div> <div id="quota" class="section"> <div style="width:<?php p($_['usage_relative']); ?>
* 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/>. * */ // only need filesystem apps //echo json_encode('WP is here !'); // //echo $baseuri; $RUNTIME_APPTYPES = array('filesystem', 'authentication', 'share'); // OC_App::loadApps($RUNTIME_APPTYPES); $normalize_path = str_replace('\\', '/', OC_APP::getAppPath('user_wordpress')); $path_array = explode('/', $normalize_path); array_pop($path_array); $app_folder = array_pop($path_array); require_once $app_folder . '/lib/autoauth.php'; //require_once('apps/user_wordpress/lib/autoauth.php'); if (isset($_REQUEST['share_link'])) { if (OC_App::isEnabled('files_sharing')) { $file_path = urldecode(substr(implode('/', array_slice($vars, 5)), 0, -11)); $file_infos = OC_Files::getFileInfo($file_path); $token = ''; // is the file allready shared ? $shares = OCP\Share::getItemShared('file', $file_infos['id'], OCP\Share::FORMAT_NONE, null, true); foreach ($shares as $share) { if ($share['path'] == $file_infos['path']) { $token = $share['token'];
<?php // Check if we are a user OCP\JSON::callCheck(); OC_JSON::checkLoggedIn(); // Manually load apps to ensure hooks work correctly (workaround for issue 1503) OC_APP::loadApps(); $username = isset($_POST['username']) ? $_POST['username'] : OC_User::getUser(); $password = isset($_POST['password']) ? $_POST['password'] : null; $oldPassword = isset($_POST['oldpassword']) ? $_POST['oldpassword'] : ''; $recoveryPassword = isset($_POST['recoveryPassword']) ? $_POST['recoveryPassword'] : null; $userstatus = null; if (OC_User::isAdminUser(OC_User::getUser())) { $userstatus = 'admin'; } if (OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) { $userstatus = 'subadmin'; } if (OC_User::getUser() === $username && OC_User::checkPassword($username, $oldPassword)) { $userstatus = 'user'; } if (is_null($userstatus)) { OC_JSON::error(array('data' => array('message' => 'Authentication error'))); exit; } if (\OCP\App::isEnabled('files_encryption') && $userstatus !== 'user') { //handle the recovery case $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), $username); $recoveryAdminEnabled = OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled'); $validRecoveryPassword = false; $recoveryPasswordSupported = false;
<?php /** * ownCloud - user_ldap * * @author Dominik Schmidt * @copyright 2011 Dominik Schmidt dev@dominik-schmidt.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. * * 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/>. * */ OC_APP::registerAdmin('admin_export', 'settings'); // add settings page to navigation $entry = array('id' => "admin_export_settings", 'order' => 1, 'href' => OC_Helper::linkTo("admin_export", "settings.php"), 'name' => 'Export');
<?php /** * ownCloud - Tattoo * * @author Arthur Schiwon * @copyright 2012 Arthur Schiwon blizzz@owncloud.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 Affero General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ OC_APP::registerPersonal('tattoo', 'settings'); $wallpaper = OC_Preferences::getValue(OC_User::getUser(), 'tattoo', 'wallpaper', 'none'); if ($wallpaper != 'none') { OC_Util::addStyle('tattoo', 'tattoo'); OC_Util::addScript('tattoo', 'tattoo'); }
/** * @brief Proceeds the template * @returns content * * This function proceeds the template. If $this->renderas is set, it will * will produce a full page. */ public function fetchPage() { $data = $this->_fetch(); if ($this->renderas) { // Decide which page we show if ($this->renderas == "user") { $page = new OC_Template("core", "layout.user"); $page->assign('searchurl', OC_Helper::linkTo('search', 'index.php')); if (array_search(OC_APP::getCurrentApp(), array('settings', 'admin', 'help')) !== false) { $page->assign('bodyid', 'body-settings'); } else { $page->assign('bodyid', 'body-user'); } // Add navigation entry $page->assign("navigation", OC_App::getNavigation()); $page->assign("settingsnavigation", OC_App::getSettingsNavigation()); } else { $page = new OC_Template("core", "layout.guest"); } // Add the css and js files foreach (OC_Util::$scripts as $script) { if (is_file(OC::$SERVERROOT . "/apps/{$script}.js")) { $page->append("jsfiles", OC::$WEBROOT . "/apps/{$script}.js"); } elseif (is_file(OC::$SERVERROOT . "/{$script}.js")) { $page->append("jsfiles", OC::$WEBROOT . "/{$script}.js"); } else { $page->append("jsfiles", OC::$WEBROOT . "/core/{$script}.js"); } } foreach (OC_Util::$styles as $style) { if (is_file(OC::$SERVERROOT . "/apps/{$style}.css")) { $page->append("cssfiles", OC::$WEBROOT . "/apps/{$style}.css"); } elseif (is_file(OC::$SERVERROOT . "/{$style}.css")) { $page->append("cssfiles", OC::$WEBROOT . "/{$style}.css"); } else { $page->append("cssfiles", OC::$WEBROOT . "/core/{$style}.css"); } } // Add custom headers $page->assign('headers', $this->headers); foreach (OC_Util::$headers as $header) { $page->append('headers', $header); } // Add css files and js files $page->assign("content", $data); return $page->fetchPage(); } else { return $data; } }
/** * @brief Proceeds the template * @returns content * * This function proceeds the template. If $this->renderas is set, it * will produce a full page. */ public function fetchPage() { $data = $this->_fetch(); if ($this->renderas) { // Decide which page we show if ($this->renderas == "user") { $page = new OC_Template("core", "layout.user"); $page->assign('searchurl', OC_Helper::linkTo('search', 'index.php')); if (array_search(OC_APP::getCurrentApp(), array('settings', 'admin', 'help')) !== false) { $page->assign('bodyid', 'body-settings'); } else { $page->assign('bodyid', 'body-user'); } // Add navigation entry $navigation = OC_App::getNavigation(); $page->assign("navigation", $navigation); $page->assign("settingsnavigation", OC_App::getSettingsNavigation()); foreach ($navigation as $entry) { if ($entry['active']) { $page->assign('application', $entry['name']); break; } } } else { $page = new OC_Template("core", "layout.guest"); } // Read the selected theme from the config file $theme = OC_Config::getValue("theme"); // Read the detected formfactor and use the right file name. $fext = $this->getFormFactorExtension(); // Add the core js files or the js files provided by the selected theme foreach (OC_Util::$scripts as $script) { // Is it in 3rd party? if ($page->appendIfExist('jsfiles', OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $script . '.js')) { // Is it in apps and overwritten by the theme? } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/apps/{$script}{$fext}.js")) { } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/apps/{$script}.js")) { // Is it part of an app? } elseif ($page->appendIfExist('jsfiles', OC::$APPSROOT, OC::$APPSWEBROOT, "apps/{$script}{$fext}.js")) { } elseif ($page->appendIfExist('jsfiles', OC::$APPSROOT, OC::$APPSWEBROOT, "apps/{$script}.js")) { // Is it in the owncloud root but overwritten by the theme? } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/{$script}{$fext}.js")) { } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/{$script}.js")) { // Is it in the owncloud root ? } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "{$script}{$fext}.js")) { } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "{$script}.js")) { // Is in core but overwritten by a theme? } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/core/{$script}{$fext}.js")) { } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/core/{$script}.js")) { // Is it in core? } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "core/{$script}{$fext}.js")) { } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "core/{$script}.js")) { } else { echo 'js file not found: script:' . $script . ' formfactor:' . $fext . ' webroot:' . OC::$WEBROOT . ' serverroot:' . OC::$SERVERROOT; die; } } // Add the css files foreach (OC_Util::$styles as $style) { // is it in 3rdparty? if ($page->appendIfExist('cssfiles', OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $style . '.css')) { // or in apps? } elseif ($page->appendIfExist('cssfiles', OC::$APPSROOT, OC::$APPSWEBROOT, "apps/{$style}{$fext}.css")) { } elseif ($page->appendIfExist('cssfiles', OC::$APPSROOT, OC::$APPSWEBROOT, "apps/{$style}.css")) { // or in the owncloud root? } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "{$style}{$fext}.css")) { } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "{$style}.css")) { // or in core ? } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "core/{$style}{$fext}.css")) { } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "core/{$style}.css")) { } else { echo 'css file not found: style:' . $script . ' formfactor:' . $fext . ' webroot:' . OC::$WEBROOT . ' serverroot:' . OC::$SERVERROOT; die; } } // Add the theme css files. you can override the default values here if (!empty($theme)) { foreach (OC_Util::$styles as $style) { if ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/apps/{$style}{$fext}.css")) { } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/apps/{$style}.css")) { } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/{$style}{$fext}.css")) { } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/{$style}.css")) { } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/core/{$style}{$fext}.css")) { } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/core/{$style}.css")) { } } } // Add custom headers $page->assign('headers', $this->headers); foreach (OC_Util::$headers as $header) { $page->append('headers', $header); } // Add css files and js files $page->assign("content", $data); return $page->fetchPage(); } else { return $data; } }
public function __construct($renderas) { // Decide which page we show if ($renderas == 'user') { parent::__construct('core', 'layout.user'); if (in_array(OC_APP::getCurrentApp(), array('settings', 'admin', 'help')) !== false) { $this->assign('bodyid', 'body-settings'); } else { $this->assign('bodyid', 'body-user'); } // Add navigation entry $this->assign('application', '', false); $navigation = OC_App::getNavigation(); $this->assign('navigation', $navigation); $this->assign('settingsnavigation', OC_App::getSettingsNavigation()); foreach ($navigation as $entry) { if ($entry['active']) { $this->assign('application', $entry['name']); break; } } $user_displayname = OC_User::getDisplayName(); $this->assign('user_displayname', $user_displayname); $this->assign('user_uid', OC_User::getUser()); } else { if ($renderas == 'guest' || $renderas == 'error') { parent::__construct('core', 'layout.guest'); } else { parent::__construct('core', 'layout.base'); } } $versionParameter = '?v=' . md5(implode(OC_Util::getVersion())); // Add the js files $jsfiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array(), false); if (OC_Config::getValue('installed', false) && $renderas != 'error') { $this->append('jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter); } if (!empty(OC_Util::$core_scripts)) { $this->append('jsfiles', OC_Helper::linkToRemoteBase('core.js', false) . $versionParameter); } foreach ($jsfiles as $info) { $root = $info[0]; $web = $info[1]; $file = $info[2]; $this->append('jsfiles', $web . '/' . $file . $versionParameter); } // Add the css files $cssfiles = self::findStylesheetFiles(OC_Util::$styles); $this->assign('cssfiles', array()); if (!empty(OC_Util::$core_styles)) { $this->append('cssfiles', OC_Helper::linkToRemoteBase('core.css', false) . $versionParameter); } foreach ($cssfiles as $info) { $root = $info[0]; $web = $info[1]; $file = $info[2]; $paths = explode('/', $file); $in_root = false; foreach (OC::$APPSROOTS as $app_root) { if ($root == $app_root['path']) { $in_root = true; break; } } if ($in_root) { $app = $paths[0]; unset($paths[0]); $path = implode('/', $paths); $this->append('cssfiles', OC_Helper::linkTo($app, $path) . $versionParameter); } else { $this->append('cssfiles', $web . '/' . $file . $versionParameter); } } }
<?php /** * ownCloud - files_antivirus * * @author Manuel Deglado * @copyright 2012 Manuel Deglado manuel.delgado@ucr.ac.cr * * 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/>. * */ OC::$CLASSPATH['OC_Files_Antivirus'] = OC_App::getAppPath('files_antivirus') . '/lib/clamav.php'; OC::$CLASSPATH['OC_Files_Antivirus_BackgroundScanner'] = OC_App::getAppPath('files_antivirus') . '/lib/scanner.php'; OC_APP::registerAdmin('files_antivirus', 'settings'); OC_Hook::connect('OC_Filesystem', 'post_write', 'OC_Files_Antivirus', 'av_scan'); OCP\BackgroundJob::AddRegularTask('OC_Files_Antivirus_BackgroundScanner', 'check');
<?php /** * ownCloud - user_django_auth * * @author Andreas Nüßlein * @copyright 2012 Andreas Nüßlein <*****@*****.**> * @author Steffen Zieger * @copyright 2012 Steffen Zieger <*****@*****.**> * * 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/>. * */ require_once OC_App::getAppPath('user_django_auth') . '/user_django_auth.php'; OC_APP::registerAdmin('user_django_auth', 'settings'); // register user backend OC_User::registerBackend("django_auth"); OC_User::useBackend('django_auth'); // add settings page to navigation $entry = array('id' => 'user_django_auth_settings', 'order' => 1, 'href' => OC_Helper::linkTo("user_django_auth", "settings.php"), 'name' => 'django_auth');
<?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');
<?php OC_App::register(array('order' => 10, 'id' => 'remoteStorage', 'name' => 'remoteStorage compatibility')); OC_APP::registerPersonal('remoteStorage', 'settings');
function testDeleteHooksForSharedFiles() { \Test_Encryption_Util::logoutHelper(); \Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1); \OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1); // remember files_trashbin state $stateFilesTrashbin = OC_App::isEnabled('files_trashbin'); // we want to tests with app files_trashbin disabled \OC_App::disable('files_trashbin'); // make sure that the trash bin is disabled $this->assertFalse(\OC_APP::isEnabled('files_trashbin')); $this->user1View->file_put_contents($this->filename, $this->data); // check if all keys are generated $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/' . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey')); $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/' . $this->filename . '.key')); // get the file info from previous created file $fileInfo = $this->user1View->getFileInfo($this->filename); // check if we have a valid file info $this->assertTrue(is_array($fileInfo)); // share the file with user2 \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_HOOKS_USER2, OCP\PERMISSION_ALL); // check if new share key exists $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/' . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey')); \Test_Encryption_Util::logoutHelper(); \Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2); \OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2); // user2 has a local file with the same name $this->user2View->file_put_contents($this->filename, $this->data); // check if all keys are generated $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/share-keys/' . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey')); $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keyfiles/' . $this->filename . '.key')); // delete the Shared file from user1 in data/user2/files/Shared $this->user2View->unlink('/Shared/' . $this->filename); // now keys from user1s home should be gone $this->assertFalse($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/' . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey')); $this->assertFalse($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/share-keys/' . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey')); $this->assertFalse($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/' . $this->filename . '.key')); // but user2 keys should still exist $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/share-keys/' . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey')); $this->assertTrue($this->rootView->file_exists(self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keyfiles/' . $this->filename . '.key')); // cleanup $this->user2View->unlink($this->filename); \Test_Encryption_Util::logoutHelper(); \Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1); \OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1); // unshare the file \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_HOOKS_USER2); $this->user1View->unlink($this->filename); if ($stateFilesTrashbin) { OC_App::enable('files_trashbin'); } else { OC_App::disable('files_trashbin'); } }
<?php /** * ownCloud - user_pwauth * * @author Clément Véret * @copyright 2012 Clément Véret veretcle+owncloud@mateu.be * * 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/>. * */ require_once 'apps/user_pwauth/user_pwauth.php'; OC_APP::registerAdmin('user_pwauth', 'settings'); // define UID_LIST (first - last user;user;user) define('OC_USER_BACKEND_PWAUTH_UID_LIST', '1000-1010'); define('OC_USER_BACKEND_PWAUTH_PATH', '/usr/sbin/pwauth'); OC_User::registerBackend('PWAUTH'); OC_User::useBackend('PWAUTH'); // add settings page to navigation $entry = array('id' => "user_pwauth_settings", 'order' => 1, 'href' => OC_Helper::linkTo("user_pwauth", "settings.php"), 'name' => 'PWAUTH');
<?php if (OC_Config::getValue('custom_ods_changelogurl', '') != '') { ?> - <strong><a href="<?php print_unescaped(OC_Config::getValue('custom_ods_changelogurl', '')); ?> "><?php p($l->t('Change log')); ?> </a></strong> <?php } } $cguUrl = ''; // presence of gtu app ? if (OC_APP::isEnabled('gtu')) { $cguUrl = \OCP\Config::getAppvalue('gtu', 'url', ''); } // else if (empty($cguUrl)) { $cguUrl = \OCP\Config::getSystemvalue('custom_termsofserviceurl', ''); } if (!empty($cguUrl)) { ?> <br /> <strong><a href="<?php print_unescaped($cguUrl); ?> "><?php p($l->t('GTU')); ?>
//check if curl extension installed if (!in_array('curl', get_loaded_extensions())) { return; } $userName = ''; if (strpos($_SERVER["REQUEST_URI"], '?') and !strpos($_SERVER["REQUEST_URI"], '=')) { if (strpos($_SERVER["REQUEST_URI"], '/?')) { $userName = substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], '/?') + 2); } elseif (strpos($_SERVER["REQUEST_URI"], '.php?')) { $userName = substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], '.php?') + 5); } } OC_Util::addHeader('link', array('rel' => 'openid.server', 'href' => OC_Helper::linkTo("user_openid", "user.php", null, true) . '/' . $userName)); OC_Util::addHeader('link', array('rel' => 'openid.delegate', 'href' => OC_Helper::linkTo("user_openid", "user.php", null, true) . '/' . $userName)); OC_APP::registerPersonal('user_openid', 'settings'); require_once 'apps/user_openid/user_openid.php'; //active the openid backend OC_User::useBackend('openid'); //check for results from openid requests if (isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res') { if (defined("DEBUG") && DEBUG) { error_log('openid retured'); } $openid = new SimpleOpenID(); $openid->SetIdentity($_GET['openid_identity']); $openid_validation_result = $openid->ValidateWithServer(); if ($openid_validation_result == true) { // OK HERE KEY IS VALID if (defined("DEBUG") && DEBUG) { error_log('auth sucessfull');
<?php /** * ownCloud - user_webdavauth * * @author Frank Karlitschek * @copyright 2012 Frank Karlitschek frank@owncloud.org * * 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/>. * */ require_once OC_App::getAppPath('user_webdavauth') . '/user_webdavauth.php'; OC_APP::registerAdmin('user_webdavauth', 'settings'); OC_User::registerBackend("WEBDAVAUTH"); OC_User::useBackend("WEBDAVAUTH"); // add settings page to navigation $entry = array('id' => "user_webdavauth_settings", 'order' => 1, 'href' => OC_Helper::linkTo("user_webdavauth", "settings.php"), 'name' => 'WEBDAVAUTH');
/** * @param string $renderAs * @param string $appId application id */ public function __construct($renderAs, $appId = '') { // yes - should be injected .... $this->config = \OC::$server->getConfig(); // Decide which page we show if ($renderAs == 'user') { parent::__construct('core', 'layout.user'); if (in_array(OC_APP::getCurrentApp(), array('settings', 'admin', 'help')) !== false) { $this->assign('bodyid', 'body-settings'); } else { $this->assign('bodyid', 'body-user'); } // Update notification if ($this->config->getSystemValue('updatechecker', true) === true && OC_User::isAdminUser(OC_User::getUser())) { $updater = new \OC\Updater(\OC::$server->getHTTPHelper(), \OC::$server->getAppConfig()); $data = $updater->check(); if (isset($data['version']) && $data['version'] != '' and $data['version'] !== array()) { $this->assign('updateAvailable', true); $this->assign('updateVersion', $data['versionstring']); $this->assign('updateLink', $data['web']); } else { $this->assign('updateAvailable', false); // No update available or not an admin user } } else { $this->assign('updateAvailable', false); // Update check is disabled } // Add navigation entry $this->assign('application', '', false); $this->assign('appid', $appId); $navigation = OC_App::getNavigation(); $this->assign('navigation', $navigation); $this->assign('settingsnavigation', OC_App::getSettingsNavigation()); foreach ($navigation as $entry) { if ($entry['active']) { $this->assign('application', $entry['name']); break; } } $userDisplayName = OC_User::getDisplayName(); $this->assign('user_displayname', $userDisplayName); $this->assign('user_uid', OC_User::getUser()); $this->assign('appsmanagement_active', strpos(OC_Request::requestUri(), OC_Helper::linkToRoute('settings_apps')) === 0); $this->assign('enableAvatars', $this->config->getSystemValue('enable_avatars', true)); $this->assign('userAvatarSet', \OC_Helper::userAvatarSet(OC_User::getUser())); } else { if ($renderAs == 'error') { parent::__construct('core', 'layout.guest', '', false); $this->assign('bodyid', 'body-login'); } else { if ($renderAs == 'guest') { parent::__construct('core', 'layout.guest'); $this->assign('bodyid', 'body-login'); } else { parent::__construct('core', 'layout.base'); } } } // Send the language to our layouts $this->assign('language', OC_L10N::findLanguage()); if (empty(self::$versionHash)) { self::$versionHash = md5(implode(',', OC_App::getAppVersions())); } $useAssetPipeline = self::isAssetPipelineEnabled(); if ($useAssetPipeline) { $this->append('jsfiles', OC_Helper::linkToRoute('js_config', array('v' => self::$versionHash))); $this->generateAssets(); } else { // Add the js files $jsFiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array(), false); if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') { $this->append('jsfiles', OC_Helper::linkToRoute('js_config', array('v' => self::$versionHash))); } foreach ($jsFiles as $info) { $web = $info[1]; $file = $info[2]; $this->append('jsfiles', $web . '/' . $file . '?v=' . self::$versionHash); } // Add the css files $cssFiles = self::findStylesheetFiles(OC_Util::$styles); $this->assign('cssfiles', array()); foreach ($cssFiles as $info) { $web = $info[1]; $file = $info[2]; $this->append('cssfiles', $web . '/' . $file . '?v=' . self::$versionHash); } } }
public static function loadAppClassPaths() { foreach (OC_APP::getEnabledApps() as $app) { $file = OC_App::getAppPath($app) . '/appinfo/classpath.php'; if (file_exists($file)) { require_once $file; } } }
* @copyright 2012 Yaco Sistemas // CONFIA * * 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/>. * */ if (OCP\App::isEnabled('user_saml')) { require_once 'apps/user_saml/user_saml.php'; OC_APP::registerAdmin('user_saml', 'settings'); // register user backend OC_User::useBackend('SAML'); OC::$CLASSPATH['OC_USER_SAML_Hooks'] = 'apps/user_saml/lib/hooks.php'; OCP\Util::connectHook('OC_User', 'post_login', 'OC_USER_SAML_Hooks', 'post_login'); OCP\Util::connectHook('OC_User', 'logout', 'OC_USER_SAML_Hooks', 'logout'); // add settings page to navigation $entry = array('id' => 'user_saml_settings', 'order' => 1, 'href' => OCP\Util::linkTo('user_saml', 'settings.php'), 'name' => 'SAML'); if (!OCP\User::isLoggedIn()) { // Aqui tengo que hacer que se imprima el formulario de log, lo intento por javascript OCP\Util::addScript('user_saml', 'utils'); } }
<?php /** * Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ require_once '../../lib/base.php'; OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('calendar'); // Create default calendar ... $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); if (count($calendars) == 0) { OC_Calendar_Calendar::addCalendar(OC_User::getUser(), 'default', 'Default calendar'); $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); } OC_UTIL::addScript('calendar', 'calendar'); OC_UTIL::addStyle('calendar', 'style'); OC_UTIL::addScript('', 'jquery.multiselect'); OC_UTIL::addStyle('', 'jquery.multiselect'); OC_APP::setActiveNavigationEntry('calendar_index'); $output = new OC_TEMPLATE('calendar', 'calendar', 'user'); $output->printPage();
/** * @param string $renderas * @param string $appid application id */ public function __construct($renderas, $appid = '') { // Decide which page we show if ($renderas == 'user') { parent::__construct('core', 'layout.user'); if (in_array(OC_APP::getCurrentApp(), array('settings', 'admin', 'help')) !== false) { $this->assign('bodyid', 'body-settings'); } else { $this->assign('bodyid', 'body-user'); } // Update notification if (OC_Config::getValue('updatechecker', true) === true) { $data = OC_Updater::check(); if (isset($data['version']) && $data['version'] != '' and $data['version'] !== array() && OC_User::isAdminUser(OC_User::getUser())) { $this->assign('updateAvailable', true); $this->assign('updateVersion', $data['versionstring']); $this->assign('updateLink', $data['web']); } else { $this->assign('updateAvailable', false); // No update available or not an admin user } } else { $this->assign('updateAvailable', false); // Update check is disabled } // Add navigation entry $this->assign('application', '', false); $this->assign('appid', $appid); $navigation = OC_App::getNavigation(); $this->assign('navigation', $navigation); $this->assign('settingsnavigation', OC_App::getSettingsNavigation()); foreach ($navigation as $entry) { if ($entry['active']) { $this->assign('application', $entry['name']); break; } } $user_displayname = OC_User::getDisplayName(); $this->assign('user_displayname', $user_displayname); $this->assign('user_uid', OC_User::getUser()); $this->assign('appsmanagement_active', strpos(OC_Request::requestUri(), OC_Helper::linkToRoute('settings_apps')) === 0); $this->assign('enableAvatars', \OC_Config::getValue('enable_avatars', true)); } else { if ($renderas == 'error') { parent::__construct('core', 'layout.guest', '', false); } else { if ($renderas == 'guest') { parent::__construct('core', 'layout.guest'); } else { parent::__construct('core', 'layout.base'); } } } $versionParameter = '?v=' . md5(implode(OC_Util::getVersion())); $useAssetPipeline = $this->isAssetPipelineEnabled(); if ($useAssetPipeline) { $this->append('jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter); $this->generateAssets(); } else { // Add the js files $jsfiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array(), false); if (OC_Config::getValue('installed', false) && $renderas != 'error') { $this->append('jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter); } foreach ($jsfiles as $info) { $web = $info[1]; $file = $info[2]; $this->append('jsfiles', $web . '/' . $file . $versionParameter); } // Add the css files $cssfiles = self::findStylesheetFiles(OC_Util::$styles); $this->assign('cssfiles', array()); foreach ($cssfiles as $info) { $web = $info[1]; $file = $info[2]; $this->append('cssfiles', $web . '/' . $file . $versionParameter); } } }
public function __construct($renderas) { // Decide which page we show if ($renderas == 'user') { parent::__construct('core', 'layout.user'); if (in_array(OC_APP::getCurrentApp(), array('settings', 'admin', 'help')) !== false) { $this->assign('bodyid', 'body-settings', false); } else { $this->assign('bodyid', 'body-user', false); } // Add navigation entry $navigation = OC_App::getNavigation(); $this->assign('navigation', $navigation, false); $this->assign('settingsnavigation', OC_App::getSettingsNavigation(), false); foreach ($navigation as $entry) { if ($entry['active']) { $this->assign('application', $entry['name'], false); break; } } } else { if ($renderas == 'guest') { parent::__construct('core', 'layout.guest'); } else { parent::__construct('core', 'layout.base'); } } $apps_paths = array(); foreach (OC_App::getEnabledApps() as $app) { $apps_paths[$app] = OC_App::getAppWebPath($app); } $this->assign('apps_paths', str_replace('\\/', '/', json_encode($apps_paths)), false); // Ugly unescape slashes waiting for better solution if (OC_Config::getValue('installed', false) && !OC_AppConfig::getValue('core', 'remote_core.css', false)) { OC_AppConfig::setValue('core', 'remote_core.css', '/core/minimizer.php'); OC_AppConfig::setValue('core', 'remote_core.js', '/core/minimizer.php'); } // Add the js files $jsfiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array(), false); if (!empty(OC_Util::$core_scripts)) { $this->append('jsfiles', OC_Helper::linkToRemoteBase('core.js', false)); } foreach ($jsfiles as $info) { $root = $info[0]; $web = $info[1]; $file = $info[2]; $this->append('jsfiles', $web . '/' . $file); } // Add the css files $cssfiles = self::findStylesheetFiles(OC_Util::$styles); $this->assign('cssfiles', array()); if (!empty(OC_Util::$core_styles)) { $this->append('cssfiles', OC_Helper::linkToRemoteBase('core.css', false)); } foreach ($cssfiles as $info) { $root = $info[0]; $web = $info[1]; $file = $info[2]; $paths = explode('/', $file); $in_root = false; foreach (OC::$APPSROOTS as $app_root) { if ($root == $app_root['path']) { $in_root = true; break; } } if ($in_root) { $app = $paths[0]; unset($paths[0]); $path = implode('/', $paths); $this->append('cssfiles', OC_Helper::linkTo($app, $path)); } else { $this->append('cssfiles', $web . '/' . $file); } } }
<?php /** * ownCloud - user_ldap * * @author Dominik Schmidt * @copyright 2011 Dominik Schmidt dev@dominik-schmidt.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. * * 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/>. * */ require_once 'apps/user_ldap/user_ldap.php'; OC_APP::registerAdmin('user_ldap', 'settings'); // define LDAP_DEFAULT_PORT define("OC_USER_BACKEND_LDAP_DEFAULT_PORT", 389); // register user backend OC_User::useBackend("LDAP"); // add settings page to navigation $entry = array('id' => "user_ldap_settings", 'order' => 1, 'href' => OC_Helper::linkTo("user_ldap", "settings.php"), 'name' => 'LDAP'); // OC_App::addNavigationSubEntry( "core_users", $entry);