Browse Source

Fix to preserve backward compatibility for apps creating static links containing the request token (currently the contacts app and maybe some 3rd party implementations)

tags/v4.5.0RC2
Christian Reiner 11 years ago
parent
commit
71454b1bca
2 changed files with 10 additions and 2 deletions
  1. 2
    2
      core/templates/layout.user.php
  2. 8
    0
      lib/template.php

+ 2
- 2
core/templates/layout.user.php View File

@@ -11,8 +11,8 @@
var oc_webroot = '<?php echo OC::$WEBROOT; ?>';
var oc_appswebroots = <?php echo $_['apps_paths'] ?>;
var oc_current_user = '<?php echo OC_User::getUser() ?>';
var oc_requesttoken = '<?php echo OC_Util::callRegister(); ?>';
var oc_requestlifespan = '<?php echo OC_Util::$callLifespan; ?>';
var oc_requesttoken = '<?php echo $_['requesttoken']; ?>';
var oc_requestlifespan = '<?php echo $_['requestlifespan']; ?>';
</script>
<?php foreach($_['jsfiles'] as $jsfile): ?>
<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>

+ 8
- 0
lib/template.php View File

@@ -155,6 +155,10 @@ class OC_Template{
$this->renderas = $renderas;
$this->application = $app;
$this->vars = array();
if($renderas == 'user') {
$this->vars['requesttoken'] = OC_Util::callRegister();
$this->vars['requestlifespan'] = OC_Util::$callLifespan;
}
$parts = explode('/', $app); // fix translation when app is something like core/lostpassword
$this->l10n = OC_L10N::get($parts[0]);
header('X-Frame-Options: Sameorigin');
@@ -369,6 +373,10 @@ class OC_Template{

if( $this->renderas ) {
$page = new OC_TemplateLayout($this->renderas);
if($this->renderas == 'user') {
$page->assign('requesttoken', $this->vars['requesttoken']);
$page->assign('requestlifespan', $this->vars['requestlifespan']);
}

// Add custom headers
$page->assign('headers',$this->headers, false);

Loading…
Cancel
Save