Ejemplo n.º 1
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/>.
*
*/
if (OCP\App::isEnabled('user_saml')) {
    $ocVersion = implode('.', OCP\Util::getVersion());
    if (version_compare($ocVersion, '5.0', '<')) {
        if (!function_exists('p')) {
            function p($string)
            {
                print OC_Util::sanitizeHTML($string);
            }
        }
    }
    require_once 'user_saml/user_saml.php';
    OCP\App::registerAdmin('user_saml', 'settings');
    // register user backend
    OC_User::useBackend('SAML');
    OC::$CLASSPATH['OC_USER_SAML_Hooks'] = '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');
Ejemplo n.º 2
0
	OCP\Util::addScript ( 'ojsxc', 'eof' );
	OCP\Util::addScript ( 'ojsxc', 'jsxc/lib/otr/build/dep/eventemitter' );
	OCP\Util::addScript ( 'ojsxc', 'jsxc/lib/otr/build/otr' );
	OCP\Util::addScript ( 'ojsxc', 'jsxc/jsxc.lib' );
	OCP\Util::addScript ( 'ojsxc', 'jsxc/jsxc.lib.webrtc' );
	// OCP\Util::addScript ( 'ojsxc', 'lib/jsxc.lib.muc' );
} else {
	OCP\Util::addScript ( 'ojsxc', 'jsxc/lib/jquery.colorbox-min' );
	OCP\Util::addScript ( 'ojsxc', 'jsxc/lib/jquery.slimscroll' );
	OCP\Util::addScript ( 'ojsxc', 'jsxc/lib/jquery.fullscreen' );
	OCP\Util::addScript ( 'ojsxc', 'jsxc/lib/jsxc.dep.min' );
	OCP\Util::addScript ( 'ojsxc', 'jsxc/jsxc.min' );
}

OCP\Util::addScript ( 'ojsxc', 'ojsxc' );

// ############# CSS #############
OCP\Util::addStyle ( 'ojsxc', 'jquery.mCustomScrollbar' );
OCP\Util::addStyle ( 'ojsxc', 'jquery.colorbox' );
OCP\Util::addStyle ( 'ojsxc', '../js/jsxc/jsxc' );
OCP\Util::addStyle ( 'ojsxc', '../js/jsxc/jsxc.webrtc' );
OCP\Util::addStyle ( 'ojsxc', 'jsxc.oc' );
OCP\Util::addStyle ( 'ojsxc', 'muc' );

$version = OCP\Util::getVersion();

if($version[0] <= 6)
	OCP\Util::addStyle ( 'ojsxc', 'jsxc.oc.lte6' );

?>
Ejemplo n.º 3
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 Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
// Check if we are a user
OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('roundcube');
OCP\Util::addStyle('roundcube', 'userSettings');
OCP\Util::addScript('roundcube', 'userSettings');
// fill template
$params = array();
$tmpl = new OCP\Template('roundcube', 'userSettings');
foreach ($params as $param) {
    $value = OCP\Config::getAppValue('roundcube', $param, '');
    $tmpl->assign($param, $value);
}
// workaround to detect OC version
$ocVersion = @reset(OCP\Util::getVersion());
$tmpl->assign('ocVersion', $ocVersion);
return $tmpl->fetchPage();
Ejemplo n.º 4
0
	private static function getInternalFileAttachment($attachment) {
		$path = urldecode($attachment['path']);
		$path = substr($path, strpos($path, "/")+1 ); //remove root folder "files/"	
		$userId = OC_User::getUser();
		
		if ( $attachment['owner'] == $userId ) {
			// file-owner can use own path
			$path = \OC\Files\Filesystem::getPath($attachment['fileid']);
		} else {			
			$item_shared = OCP\Share::getItemSharedWithBySource('file', $attachment['fileid']);
			if ( $item_shared != false ) { // if item is direct shared use shared-file target
				$path = $item_shared['file_target'];
			} else {
				// else search shared parent folder
				$path = "/" . self::getInheritedSharedPath( urldecode($attachment['path']), $userId, $attachment['owner'] );
			}

			$ocVersion = OCP\Util::getVersion();
			if ( $ocVersion[0] < 7 ) {
				$path = "/Shared" . $path;
			}
		}
		$view = new \OC\Files\View('/' . $userId . '/files');
		$fileinfo = $view->getFileInfo($path);

		$download_url = OCP\Util::linkToRoute('download', array('file' => $path));		

		// File not found		
		if ( \OC\Files\Filesystem::is_file( $path ) == false ) {
			$fileinfo['name'] = "File not found.";
			$download_url = "#";
		}
		
		$result = array(
			"type" => $attachment['type'],
			"mimetype"	=> $fileinfo['mimetype'],
			"name"		=> $fileinfo['name'],
			"path"		=> $path,
			"download_url"	=> $download_url
		);
		return $result;
	}
Ejemplo n.º 5
0
 * @author Christian Reiner
 */
?>

<html>
	<head>
		<link rel="stylesheet" href="<?php 
p(OCP\Util::linkTo('imprint', 'css/content.css'));
?>
" type="text/css" media="screen" />
		<link rel="stylesheet" href="<?php 
p(OCP\Util::linkTo('imprint', 'css/imprint.css'));
?>
" type="text/css" media="screen" />
		<?php 
if (5 > @reset(OCP\Util::getVersion())) {
    ?>
			<link rel="stylesheet" href="<?php 
    p(OCP\Util::linkTo('imprint', 'css/imprint-oc4.css'));
    ?>
" type="text/css" media="screen" />
		<?php 
}
?>
	</head>
	<body id="imprint-content">
<?php 
print_unescaped($_['processed-content']);
?>
	</body>
</html>
Ejemplo n.º 6
0
            OCP\Util::addScript('imprint', 'imprint_header_right');
            break;
        default:
            // don't show a link!
            break;
    }
    // switch
} else {
    // if logged in
    // user logged in, we have more positions to place the link:
    switch (OCP\Config::getAppValue('imprint', 'position', 'standalone')) {
        case 'header-left':
            OCP\Util::addScript('imprint', 'imprint_header_left');
            break;
        case 'header-right':
            OCP\Util::addScript('imprint', 'imprint_header_right');
            break;
        case 'navigation-top':
            OCP\Util::addScript('imprint', 'imprint_navigation_top');
            break;
        case 'navigation-bottom':
            OCP\Util::addScript('imprint', 'imprint_navigation_bottom');
            break;
        default:
        case 'standalone':
            // no js required, we add the imprint as a normal app to the navigation
            OCP\App::addNavigationEntry(array('id' => 'imprint', 'order' => 99999, 'href' => OCP\Util::linkTo('imprint', 'index.php'), 'icon' => 5 <= @reset(OCP\Util::getVersion()) ? OCP\Util::imagePath('imprint', 'imprint-light.svg') : OCP\Util::imagePath('imprint', 'imprint-dusky.svg'), 'name' => $l->t("Legal notice")));
    }
    // switch
}
// if logged in
Ejemplo n.º 7
0
<?php

\OCP\Util::addScript('ownnote', 'script');
\OCP\Util::addScript('ownnote', 'tinymce/tinymce.min');
\OCP\Util::addStyle('ownnote', 'style');
$disableAnnouncement = \OCP\Config::getAppValue('ownnote', 'disableAnnouncement', '');
$l = OCP\Util::getL10N('ownnote');
$ocVersionArray = OCP\Util::getVersion();
$ocVersion = "";
$oci = 0;
$ocl = sizeof($ocVersionArray);
foreach ($ocVersionArray as $v) {
    $ocVersion .= $v;
    $oci++;
    if ($oci < $ocl) {
        $ocVersion .= ".";
    }
}
?>
<div id="app">
	<div id="app-navigation">
		<ul id="grouplist">
		</ul>
	</div>
	<div id="app-content">
		<div id="ownnote"></div>
	</div>
	<input type=hidden name="disableAnnouncement" id="disableAnnouncement" value="<?php 
echo $disableAnnouncement;
?>
">
Ejemplo n.º 8
0
	/**
	* @method OC_Shorty_Tools::versionCompare
	* @brief Compares a given version (string notation) with the running ownCloud version
	* @return integer the major version number
	* @access public
	* @author Christian Reiner
	* @description
	* The major version of the OC framework is relevant for a few compatibility issues.
	* It has to be checked against often when for example rendering templates, to add or suppres version dependant options.
	*/
	static function versionCompare ($operator,$cpVersion)
	{
		$ocVersion = implode('.',OCP\Util::getVersion());
		return (version_compare($ocVersion,$cpVersion,$operator));
	} // function versionCompare