/** * @NoAdminRequired * @NoCSRFRequired */ public function webRTC() { $params = []; $response = new TemplateResponse(Settings::APP_ID, 'webrtc', $params); // Allow to embed iframes $csp = new ContentSecurityPolicy(); //$csp->addAllowedFrameDomain('*'); $csp->addAllowedFrameDomain(implode(' ', Security::getAllowedIframeDomains())); $response->setContentSecurityPolicy($csp); return $response; }
/** * @NoAdminRequired * @NoCSRFRequired * @PublicPage */ public function webRTC() { $params = ['is_guest' => $this->userid === null]; $response = new TemplateResponse(Settings::APP_ID, 'webrtc', $params, $this->userid === null ? 'empty' : 'user'); // Allow to embed iframes $csp = new ContentSecurityPolicy(); //$csp->addAllowedFrameDomain('*'); $csp->addAllowedFrameDomain(implode(' ', Security::getAllowedIframeDomains())); $response->setContentSecurityPolicy($csp); return $response; }
public function getSignedCombo() { $info = $this->getInfo(); return Security::getSignedCombo($info['id']); }
public function getSignedCombo() { $id = $this->getUserId(); // Spreed WebRTC uses colons as a delimiter for the useridcombo. // As the user id might contain colons (if it's a cloud id), we need to // replace it with a non-valid URL character, e.g. a pipe (|). // The reverse happens in the 'displayUserid' filter of owncloud.js $id = str_replace(':', '|', $id); return Security::getSignedCombo($id); }
/** * @NoAdminRequired * @NoCSRFRequired * @PublicPage */ public function getTokenWithTemporaryPassword() { $tp = isset($_POST['tp']) ? $_POST['tp'] : null; $_response = array('success' => false); if ($tp !== null) { try { $token = Security::getSignedComboFromTemporaryPassword($tp); $_response = array_merge($_response, $token); $_response['success'] = true; } catch (\Exception $e) { $_response['error'] = $e->getCode(); } } return new DataResponse($_response); }
public static function regenerateTemporaryPasswordSigningKey() { $key = Security::getRandomHexString(256 / 4); // 256 bit Helper::setDatabaseConfigValueIfEnabled('OWNCLOUD_TEMPORARY_PASSWORD_SIGNING_KEY', $key); }
public function generateSpreedWebRTCConfig() { $_response = array('success' => false); try { $_response['config'] = Security::generateSpreedWebRTCConfig(); $_response['success'] = true; } catch (\Exception $e) { $_response['error'] = $e->getCode(); } return new DataResponse($_response); }