summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-07 19:31:19 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-07 20:43:00 +0200
commit4e6b4b265b5ef29739175189c5c49dffea9457d8 (patch)
tree237687bbc9df27122e4b6e0a69eabb0698786406 /apps
parent34c076e2a88c43b02c4177e77cf1068ab6d9d9f8 (diff)
downloadnextcloud-server-4e6b4b265b5ef29739175189c5c49dffea9457d8.tar.gz
nextcloud-server-4e6b4b265b5ef29739175189c5c49dffea9457d8.zip
remoteStorage: split auth allow template
Diffstat (limited to 'apps')
-rw-r--r--apps/remoteStorage/auth.php60
-rw-r--r--apps/remoteStorage/templates/auth.php28
2 files changed, 37 insertions, 51 deletions
diff --git a/apps/remoteStorage/auth.php b/apps/remoteStorage/auth.php
index 99e2272d3ab..ad6382eac71 100644
--- a/apps/remoteStorage/auth.php
+++ b/apps/remoteStorage/auth.php
@@ -60,57 +60,15 @@ if($userId && $appUrl && $categories) {
header('Location: '.$_GET['redirect_uri'].'#access_token='.$existingToken.'&token_type=bearer');
} else {
//params ok, logged in ok, but need to click Allow still:
-?>
-<!DOCTYPE html>
-<html>
- <head>
- <title>ownCloud</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="shortcut icon" href="../../../core/img/favicon.png" /><link rel="apple-touch-icon-precomposed" href="../../../core/img/favicon-touch.png" />
- <link rel="stylesheet" href="../../../core/css/styles.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../../../core/css/auth.css" type="text/css" media="screen" />
- </head>
- <body id="body-login">
- <div id="login">
- <header>
- <div id="header">
- <img src="../../../core/img/logo.png" alt="ownCloud" />
- </div>
- </header>
- <section id="main">
- <div id="oauth">
- <h2><img src="../../../core/img/remoteStorage-big.png" alt="remoteStorage" /></h2>
- <p><strong><?php $appUrlParts = explode('/', $_GET['redirect_uri']); echo htmlentities($appUrlParts[2]); ?></strong>
- requests read &amp; write access to your
- <?php
- $categories = explode(',', htmlentities($_GET['scope']));
- if(!count($categories)) {
- echo htmlentities($_GET['scope']);
- } else {
- echo '<em>'.$categories[0].'</em>';
- if(count($categories)==2) {
- echo ' and <em>'.$categories[1].'</em>';
- } else if(count($categories)>2) {
- for($i=1; $i<count($categories)-1; $i++) {
- echo ', <em>'.$categories[$i].'</em>';
- }
- echo ', and <em>'.$categories[$i].'</em>';
- }
- }
- ?>.
- </p>
- <form accept-charset="UTF-8" method="post">
- <input id="allow-auth" name="allow" type="submit" value="Allow" />
- <input id="deny-auth" name="deny" type="submit" value="Deny" />
- </form>
- </div>
- </section>
- </div>
- <footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> &ndash; web services under your control</p></footer>
- </body>
-</html>
-<?php
- }//end 'need to click Allow still'
+ $appUrlParts = explode('/', $_GET['redirect_uri']);
+ $host = $appUrlParts[2];
+ $categories = explode(',', $_GET['scope']);
+ OCP\Util::addStyle('', 'auth');
+ OCP\Template::printGuestPage('remoteStorage', 'auth', array(
+ 'host' => $host,
+ 'categories' => $categories,
+ ));
+ }//end 'need to click Allow still'
} else {//login not ok
if($currUser) {
die('You are logged in as '.$currUser.' instead of '.htmlentities($userId));
diff --git a/apps/remoteStorage/templates/auth.php b/apps/remoteStorage/templates/auth.php
new file mode 100644
index 00000000000..6a7054eabb0
--- /dev/null
+++ b/apps/remoteStorage/templates/auth.php
@@ -0,0 +1,28 @@
+ <section id="main">
+ <div id="oauth">
+ <h2><img src="<?php echo image_path('', 'remoteStorage-big.png'); ?>" alt="remoteStorage" /></h2>
+ <p><strong><?php echo $_['host'] ?></strong>
+ requests read &amp; write access to your
+ <?php
+ $categories = $_['categories'];
+ if(!count($categories)) {
+ echo $categories[0];
+ } else {
+ echo '<em>'.$categories[0].'</em>';
+ if(count($categories)==2) {
+ echo ' and <em>'.$categories[1].'</em>';
+ } else if(count($categories)>2) {
+ for($i=1; $i<count($categories)-1; $i++) {
+ echo ', <em>'.$categories[$i].'</em>';
+ }
+ echo ', and <em>'.$categories[$i].'</em>';
+ }
+ }
+ ?>.
+ </p>
+ <form accept-charset="UTF-8" method="post">
+ <input id="allow-auth" name="allow" type="submit" value="Allow" />
+ <input id="deny-auth" name="deny" type="submit" value="Deny" />
+ </form>
+ </div>
+ </section>