当前位置: 首页>>代码示例>>PHP>>正文


PHP OC_Helper::linkToRemote方法代码示例

本文整理汇总了PHP中OC_Helper::linkToRemote方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Helper::linkToRemote方法的具体用法?PHP OC_Helper::linkToRemote怎么用?PHP OC_Helper::linkToRemote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC_Helper的用法示例。


在下文中一共展示了OC_Helper::linkToRemote方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: linkToRemote

 /**
  * Creates an absolute url for remote use.
  * @param string $service id
  * @return string the url
  * @since 4.0.0
  */
 public static function linkToRemote($service)
 {
     return \OC_Helper::linkToRemote($service);
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:10,代码来源:util.php

示例2: array_merge

    // Check for autosetup:
    $autosetup_file = OC::$SERVERROOT . "/config/autoconfig.php";
    if (file_exists($autosetup_file)) {
        OC_Log::write('core', 'Autoconfig file found, setting up owncloud...', OC_Log::INFO);
        include $autosetup_file;
        $_POST['install'] = 'true';
        $_POST = array_merge($_POST, $AUTOCONFIG);
        unlink($autosetup_file);
    }
    OC_Util::addScript('setup');
    require_once 'setup.php';
    exit;
}
// Handle WebDAV
if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
    header('location: ' . OC_Helper::linkToRemote('webdav'));
    exit;
} elseif (!OC_User::isLoggedIn() && substr(OC::$REQUESTEDFILE, -3) == 'css') {
    OC_App::loadApps();
    OC::loadfile();
} elseif (OC_User::isLoggedIn()) {
    OC_App::loadApps();
    if (isset($_GET["logout"]) and $_GET["logout"]) {
        OC_User::logout();
        header("Location: " . OC::$WEBROOT . '/');
        exit;
    } else {
        if (is_null(OC::$REQUESTEDFILE)) {
            OC::loadapp();
        } else {
            OC::loadfile();
开发者ID:noci2012,项目名称:owncloud,代码行数:31,代码来源:index.php

示例3: isWebDAVWorking

 /**
  * test if webDAV is working properly
  *
  * @return bool
  * @description
  * The basic assumption is that if the server returns 401/Not Authenticated for an unauthenticated PROPFIND
  * the web server it self is setup properly.
  *
  * Why not an authenticated PROPFIND and other verbs?
  *  - We don't have the password available
  *  - We have no idea about other auth methods implemented (e.g. OAuth with Bearer header)
  *
  */
 public static function isWebDAVWorking()
 {
     if (!function_exists('curl_init')) {
         return true;
     }
     if (!\OC_Config::getValue("check_for_working_webdav", true)) {
         return true;
     }
     $settings = array('baseUri' => OC_Helper::linkToRemote('webdav'));
     $client = new \OC_DAVClient($settings);
     $client->setRequestTimeout(10);
     // for this self test we don't care if the ssl certificate is self signed and the peer cannot be verified.
     $client->setVerifyPeer(false);
     // also don't care if the host can't be verified
     $client->setVerifyHost(0);
     $return = true;
     try {
         // test PROPFIND
         $client->propfind('', array('{DAV:}resourcetype'));
     } catch (\Sabre\DAV\Exception\NotAuthenticated $e) {
         $return = true;
     } catch (\Exception $e) {
         OC_Log::write('core', 'isWebDAVWorking: NO - Reason: ' . $e->getMessage() . ' (' . get_class($e) . ')', OC_Log::WARN);
         $return = false;
     }
     return $return;
 }
开发者ID:pinoniq,项目名称:core,代码行数:40,代码来源:util.php

示例4: testLinkToRemote

 /**
  * @small
  * test linkToRemote URL construction
  */
 public function testLinkToRemote()
 {
     \OC::$WEBROOT = '';
     $result = \OC_Helper::linkToRemote('webdav');
     $this->assertEquals('http://localhost/remote.php/webdav/', $result);
     $result = \OC_Helper::linkToRemote('webdav', false);
     $this->assertEquals('http://localhost/remote.php/webdav', $result);
     \OC::$WEBROOT = '/owncloud';
     $result = \OC_Helper::linkToRemote('webdav');
     $this->assertEquals('http://localhost/owncloud/remote.php/webdav/', $result);
     $result = \OC_Helper::linkToRemote('webdav', false);
     $this->assertEquals('http://localhost/owncloud/remote.php/webdav', $result);
 }
开发者ID:reverserob,项目名称:core,代码行数:17,代码来源:helper.php

示例5: handleRequest

 /**
  * @brief Handle the request
  */
 public static function handleRequest()
 {
     // load all the classpaths from the enabled apps so they are available
     // in the routing files of each app
     OC::loadAppClassPaths();
     // Check if ownCloud is installed or in maintenance (update) mode
     if (!OC_Config::getValue('installed', false)) {
         require_once 'core/setup.php';
         exit;
     }
     $request = OC_Request::getPathInfo();
     if (substr($request, -3) !== '.js') {
         // we need these files during the upgrade
         self::checkMaintenanceMode();
         self::checkUpgrade();
     }
     if (!self::$CLI) {
         try {
             if (!OC_Config::getValue('maintenance', false)) {
                 OC_App::loadApps();
             }
             OC::getRouter()->match(OC_Request::getRawPathInfo());
             return;
         } catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) {
             //header('HTTP/1.0 404 Not Found');
         } catch (Symfony\Component\Routing\Exception\MethodNotAllowedException $e) {
             OC_Response::setStatus(405);
             return;
         }
     }
     $app = OC::$REQUESTEDAPP;
     $file = OC::$REQUESTEDFILE;
     $param = array('app' => $app, 'file' => $file);
     // Handle app css files
     if (substr($file, -3) == 'css') {
         self::loadCSSFile($param);
         return;
     }
     // Handle redirect URL for logged in users
     if (isset($_REQUEST['redirect_url']) && OC_User::isLoggedIn()) {
         $location = OC_Helper::makeURLAbsolute(urldecode($_REQUEST['redirect_url']));
         // Deny the redirect if the URL contains a @
         // This prevents unvalidated redirects like ?redirect_url=:user@domain.com
         if (strpos($location, '@') === FALSE) {
             header('Location: ' . $location);
             return;
         }
     }
     // Handle WebDAV
     if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
         header('location: ' . OC_Helper::linkToRemote('webdav'));
         return;
     }
     // Someone is logged in :
     if (OC_User::isLoggedIn()) {
         OC_App::loadApps();
         OC_User::setupBackends();
         if (isset($_GET["logout"]) and $_GET["logout"]) {
             if (isset($_COOKIE['oc_token'])) {
                 OC_Preferences::deleteKey(OC_User::getUser(), 'login_token', $_COOKIE['oc_token']);
             }
             OC_User::logout();
             header("Location: " . OC::$WEBROOT . '/');
         } else {
             if (is_null($file)) {
                 $param['file'] = 'index.php';
             }
             $file_ext = substr($param['file'], -3);
             if ($file_ext != 'php' || !self::loadAppScriptFile($param)) {
                 header('HTTP/1.0 404 Not Found');
             }
         }
         return;
     }
     // Not handled and not logged in
     self::handleLogin();
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:80,代码来源:base.php

示例6: p

}
?>
	</ul>
	<div id="app-settings">
		<div id="app-settings-header">
			<button class="settings-button" data-apps-slide-toggle="#app-settings-content">
				<span class="hidden-visually"><?php 
p($l->t('Settings'));
?>
</span>
			</button>
		</div>
		<div id="app-settings-content">
				<h2>
					<label for="webdavurl"><?php 
p($l->t('WebDAV'));
?>
</label>
				</h2>
				<input id="webdavurl" type="text" readonly="readonly" value="<?php 
p(OC_Helper::linkToRemote('webdav'));
?>
" />
				<em><?php 
print_unescaped($l->t('Use this address to <a href="%s" target="_blank">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));
?>
</em>
		</div>
	</div>
</div>
开发者ID:heldernl,项目名称:owncloud8-extended,代码行数:30,代码来源:appnavigation.php

示例7:

?>
		</select>
		<a href="https://www.transifex.net/projects/p/owncloud/team/<?php 
echo $_['languages'][0]['code'];
?>
/" target="_blank"><em><?php 
echo $l->t('Help translate');
?>
</em></a>
	</fieldset>
</form>

<p class="personalblock">
	<strong>WebDAV</strong>
	<code><?php 
echo OC_Helper::linkToRemote('webdav');
?>
</code><br />
	<em><?php 
echo $l->t('use this address to connect to your ownCloud in your file manager');
?>
</em>
</p>

<?php 
foreach ($_['forms'] as $form) {
    echo $form;
}
?>

开发者ID:noci2012,项目名称:owncloud,代码行数:29,代码来源:personal.php

示例8: __construct

 public function __construct($renderas)
 {
     // Decide which page we show
     if ($renderas == 'user') {
         parent::__construct('core', 'layout.user');
         $this->assign('searchurl', OC_Helper::linkTo('search', 'index.php'), false);
         if (array_search(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::linkToRemote('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::linkToRemote('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);
         }
     }
 }
开发者ID:noci2012,项目名称:owncloud,代码行数:78,代码来源:templatelayout.php

示例9: handleRequest

 /**
  * @brief Handle the request
  */
 public static function handleRequest()
 {
     if (!OC_Config::getValue('installed', false)) {
         // Check for autosetup:
         $autosetup_file = OC::$SERVERROOT . "/config/autoconfig.php";
         if (file_exists($autosetup_file)) {
             OC_Log::write('core', 'Autoconfig file found, setting up owncloud...', OC_Log::INFO);
             include $autosetup_file;
             $_POST['install'] = 'true';
             $_POST = array_merge($_POST, $AUTOCONFIG);
             unlink($autosetup_file);
         }
         OC_Util::addScript('setup');
         require_once 'setup.php';
         exit;
     }
     // Handle WebDAV
     if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
         header('location: ' . OC_Helper::linkToRemote('webdav'));
         return;
     }
     // Handle app css files
     if (substr(OC::$REQUESTEDFILE, -3) == 'css') {
         self::loadCSSFile();
         return;
     }
     // Someone is logged in :
     if (OC_User::isLoggedIn()) {
         OC_App::loadApps();
         OC_User::setupBackends();
         if (isset($_GET["logout"]) and $_GET["logout"]) {
             OC_User::logout();
             header("Location: " . OC::$WEBROOT . '/');
         } else {
             $app = OC::$REQUESTEDAPP;
             $file = OC::$REQUESTEDFILE;
             if (is_null($file)) {
                 $file = 'index.php';
             }
             $file_ext = substr($file, -3);
             if ($file_ext != 'php' || !self::loadAppScriptFile($app, $file)) {
                 header('HTTP/1.0 404 Not Found');
             }
         }
         return;
     }
     // Not handled and not logged in
     self::handleLogin();
 }
开发者ID:noci2012,项目名称:owncloud,代码行数:52,代码来源:base.php

示例10: p

    ?>
</em>
		</a>
		<?php 
}
?>
	</fieldset>
</form>

<fieldset class="personalblock">
	<h2><?php 
p($l->t('WebDAV'));
?>
</h2>
	<code><?php 
print_unescaped(OC_Helper::linkToRemote('webdav'));
?>
</code><br />
	<em><?php 
print_unescaped($l->t('Use this address to <a href="%s" target="_blank">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));
?>
</em>
</fieldset>

<?php 
foreach ($_['forms'] as $form) {
    print_unescaped($form);
}
?>

<?php 
开发者ID:omusico,项目名称:isle-web-framework,代码行数:31,代码来源:personal.php

示例11: isWebDAVWorking

 /**
  * we test if webDAV is working properly
  *
  * The basic assumption is that if the server returns 401/Not Authenticated for an unauthenticated PROPFIND
  * the web server it self is setup properly.
  *
  * Why not an authenticated PROFIND and other verbs?
  *  - We don't have the password available
  *  - We have no idea about other auth methods implemented (e.g. OAuth with Bearer header)
  *
  */
 public static function isWebDAVWorking()
 {
     if (!function_exists('curl_init')) {
         return true;
     }
     $settings = array('baseUri' => OC_Helper::linkToRemote('webdav'));
     // save the old timeout so that we can restore it later
     $old_timeout = ini_get("default_socket_timeout");
     // use a 5 sec timeout for the check. Should be enough for local requests.
     ini_set("default_socket_timeout", 5);
     $client = new \Sabre_DAV_Client($settings);
     // for this self test we don't care if the ssl certificate is self signed and the peer cannot be verified.
     $client->setVerifyPeer(false);
     $return = true;
     try {
         // test PROPFIND
         $client->propfind('', array('{DAV:}resourcetype'));
     } catch (\Sabre_DAV_Exception_NotAuthenticated $e) {
         $return = true;
     } catch (\Exception $e) {
         OC_Log::write('core', 'isWebDAVWorking: NO - Reason: ' . $e, OC_Log::WARN);
         $return = false;
     }
     // restore the original timeout
     ini_set("default_socket_timeout", $old_timeout);
     return $return;
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:38,代码来源:util.php

示例12: handleRequest

 /**
  * @brief Handle the request
  */
 public static function handleRequest()
 {
     if (!OC_Config::getValue('installed', false)) {
         require_once 'core/setup.php';
         exit;
     }
     // Handle WebDAV
     if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
         header('location: ' . OC_Helper::linkToRemote('webdav'));
         return;
     }
     try {
         OC_App::loadApps();
         OC::getRouter()->match(OC_Request::getPathInfo());
         return;
     } catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) {
         //header('HTTP/1.0 404 Not Found');
     } catch (Symfony\Component\Routing\Exception\MethodNotAllowedException $e) {
         OC_Response::setStatus(405);
         return;
     }
     $app = OC::$REQUESTEDAPP;
     $file = OC::$REQUESTEDFILE;
     $param = array('app' => $app, 'file' => $file);
     // Handle app css files
     if (substr($file, -3) == 'css') {
         self::loadCSSFile($param);
         return;
     }
     // Someone is logged in :
     if (OC_User::isLoggedIn()) {
         OC_App::loadApps();
         OC_User::setupBackends();
         if (isset($_GET["logout"]) and $_GET["logout"]) {
             OC_Preferences::deleteKey(OC_User::getUser(), 'login_token', $_COOKIE['oc_token']);
             OC_User::logout();
             header("Location: " . OC::$WEBROOT . '/');
         } else {
             if (is_null($file)) {
                 $param['file'] = 'index.php';
             }
             $file_ext = substr($param['file'], -3);
             if ($file_ext != 'php' || !self::loadAppScriptFile($param)) {
                 header('HTTP/1.0 404 Not Found');
             }
         }
         return;
     }
     // Not handled and not logged in
     self::handleLogin();
 }
开发者ID:ryanshoover,项目名称:core,代码行数:54,代码来源:base.php


注:本文中的OC_Helper::linkToRemote方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。