Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
4e6b4b26
Commit
4e6b4b26
authored
12 years ago
by
Bart Visscher
Browse files
Options
Downloads
Patches
Plain Diff
remoteStorage: split auth allow template
parent
34c076e2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/remoteStorage/auth.php
+9
-51
9 additions, 51 deletions
apps/remoteStorage/auth.php
apps/remoteStorage/templates/auth.php
+28
-0
28 additions, 0 deletions
apps/remoteStorage/templates/auth.php
with
37 additions
and
51 deletions
apps/remoteStorage/auth.php
+
9
−
51
View file @
4e6b4b26
...
@@ -60,57 +60,15 @@ if($userId && $appUrl && $categories) {
...
@@ -60,57 +60,15 @@ if($userId && $appUrl && $categories) {
header
(
'Location: '
.
$_GET
[
'redirect_uri'
]
.
'#access_token='
.
$existingToken
.
'&token_type=bearer'
);
header
(
'Location: '
.
$_GET
[
'redirect_uri'
]
.
'#access_token='
.
$existingToken
.
'&token_type=bearer'
);
}
else
{
}
else
{
//params ok, logged in ok, but need to click Allow still:
//params ok, logged in ok, but need to click Allow still:
?>
$appUrlParts
=
explode
(
'/'
,
$_GET
[
'redirect_uri'
]);
<!DOCTYPE html>
$host
=
$appUrlParts
[
2
];
<html>
$categories
=
explode
(
','
,
$_GET
[
'scope'
]);
<head>
OCP\Util
::
addStyle
(
''
,
'auth'
);
<title>
ownCloud
</title>
OCP\Template
::
printGuestPage
(
'remoteStorage'
,
'auth'
,
array
(
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
'host'
=>
$host
,
<link
rel=
"shortcut icon"
href=
"../../../core/img/favicon.png"
/><link
rel=
"apple-touch-icon-precomposed"
href=
"../../../core/img/favicon-touch.png"
/>
'categories'
=>
$categories
,
<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"
/>
}
//end 'need to click Allow still'
</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
&
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>
–
web services under your control
</p></footer>
</body>
</html>
<?php
}
//end 'need to click Allow still'
}
else
{
//login not ok
}
else
{
//login not ok
if
(
$currUser
)
{
if
(
$currUser
)
{
die
(
'You are logged in as '
.
$currUser
.
' instead of '
.
htmlentities
(
$userId
));
die
(
'You are logged in as '
.
$currUser
.
' instead of '
.
htmlentities
(
$userId
));
...
...
This diff is collapsed.
Click to expand it.
apps/remoteStorage/templates/auth.php
0 → 100644
+
28
−
0
View file @
4e6b4b26
<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
&
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>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment