Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Commits
26ca361b
Commit
26ca361b
authored
4 years ago
by
Davide Aprea
Browse files
Options
Downloads
Patches
Plain Diff
removed redirect to start page when sending key
parent
95845942
No related branches found
No related tags found
3 merge requests
!1895
Development
,
!1758
Development
,
!1750
Resolve "minor adjustments for key page"
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Http/Controllers/KeyController.php
+28
-5
28 additions, 5 deletions
app/Http/Controllers/KeyController.php
resources/views/key.blade.php
+4
-4
4 additions, 4 deletions
resources/views/key.blade.php
with
32 additions
and
9 deletions
app/Http/Controllers/KeyController.php
+
28
−
5
View file @
26ca361b
...
@@ -12,9 +12,20 @@ class KeyController extends Controller
...
@@ -12,9 +12,20 @@ class KeyController extends Controller
{
{
$redirUrl
=
$request
->
input
(
'redirUrl'
,
""
);
$redirUrl
=
$request
->
input
(
'redirUrl'
,
""
);
return
view
(
'key'
)
$cookie
=
Cookie
::
get
(
'key'
);
->
with
(
'title'
,
trans
(
'titles.key'
));
$key
=
$request
->
input
(
'key'
,
''
);
if
(
empty
(
$key
)
&&
empty
(
$cookie
)){
$key
=
'enter_key_here'
;
}
elseif
(
empty
(
$key
)
&&
!
empty
(
$cookie
)){
$key
=
$cookie
;
}
elseif
(
!
empty
(
$key
)){
$key
=
$request
->
input
(
'key'
);
}
return
view
(
'key'
)
->
with
(
'title'
,
trans
(
'titles.key'
))
->
with
(
'cookie'
,
$key
);
}
}
public
function
setKey
(
Request
$request
)
public
function
setKey
(
Request
$request
)
...
@@ -29,12 +40,24 @@ class KeyController extends Controller
...
@@ -29,12 +40,24 @@ class KeyController extends Controller
$host
=
$request
->
header
(
"Host"
,
""
);
$host
=
$request
->
header
(
"Host"
,
""
);
}
}
Cookie
::
queue
(
'key'
,
$key
,
525600
,
'/'
,
null
,
false
,
false
);
$cookie
=
Cookie
::
get
(
'key'
);
return
redirect
(
$redirUrl
);
if
(
empty
(
$key
)
&&
empty
(
$cookie
)){
$key
=
'enter_key_here'
;
}
elseif
(
empty
(
$key
)
&&
!
empty
(
$cookie
)){
$key
=
$cookie
;
}
elseif
(
!
empty
(
$key
)){
$key
=
$request
->
input
(
'key'
);
}
return
view
(
'key'
)
->
with
(
'title'
,
trans
(
'titles.key'
))
->
with
(
'cookie'
,
$key
);
}
else
{
}
else
{
return
view
(
'key'
)
return
view
(
'key'
)
->
with
(
'title'
,
trans
(
'titles.key'
))
->
with
(
'title'
,
trans
(
'titles.key'
))
->
with
(
'keyValid'
,
false
);
->
with
(
'keyValid'
,
false
)
->
with
(
'cookie'
,
'enter_key_here'
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
resources/views/key.blade.php
+
4
−
4
View file @
26ca361b
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<
li
>
<
li
>
@
lang
(
'key.li1'
)
@
lang
(
'key.li1'
)
<
div
class
=
"copyLink"
>
<
div
class
=
"copyLink"
>
<
input
id
=
"loadSettings"
class
=
"loadSettings"
type
=
"text"
value
=
"{{route('loadSettings', ["
key
" =>
empty(Cookie::get('key')) ? "
enter_key_here
" : Cookie::get('key')
])}}"
>
<
input
id
=
"loadSettings"
class
=
"loadSettings"
type
=
"text"
value
=
"{{route('loadSettings', ["
key
" =>
$cookie
])}}"
>
<
button
class
=
"js-only btn btn-default"
onclick
=
"var copyText = document.getElementById('loadSettings');copyText.select();copyText.setSelectionRange(0, 99999);document.execCommand('copy');"
>@
lang
(
'settings.copy'
)
</
button
>
<
button
class
=
"js-only btn btn-default"
onclick
=
"var copyText = document.getElementById('loadSettings');copyText.select();copyText.setSelectionRange(0, 99999);document.execCommand('copy');"
>@
lang
(
'settings.copy'
)
</
button
>
</
div
>
</
div
>
</
li
>
</
li
>
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
<
li
>
<
li
>
@
lang
(
'key.li2'
)
@
lang
(
'key.li2'
)
<
div
class
=
"copyLink"
>
<
div
class
=
"copyLink"
>
<
input
id
=
"searchString"
class
=
"loadSettings"
type
=
"text"
value
=
"{{route("
resultpage
", ["
key
" =>
empty(Cookie::get('key')) ? "
enter_key_here
" : Cookie::get('key')
]) . "
&
eingabe
=%
s
"}}"
>
<
input
id
=
"searchString"
class
=
"loadSettings"
type
=
"text"
value
=
"{{route("
resultpage
", ["
key
" =>
$cookie
]) . "
&
eingabe
=%
s
"}}"
>
<
button
class
=
"js-only btn btn-default"
onclick
=
"var copyText = document.getElementById('searchString');copyText.select();copyText.setSelectionRange(0, 99999);document.execCommand('copy');"
>@
lang
(
'settings.copy'
)
</
button
>
<
button
class
=
"js-only btn btn-default"
onclick
=
"var copyText = document.getElementById('searchString');copyText.select();copyText.setSelectionRange(0, 99999);document.execCommand('copy');"
>@
lang
(
'settings.copy'
)
</
button
>
</
div
>
</
div
>
</
li
>
</
li
>
...
@@ -42,10 +42,10 @@
...
@@ -42,10 +42,10 @@
<
div
id
=
"form-wrapper"
>
<
div
id
=
"form-wrapper"
>
<
form
method
=
"post"
>
<
form
method
=
"post"
>
<
input
type
=
"hidden"
name
=
"redirUrl"
value
=
"{{ Request::input('redirUrl', '') }}"
/>
<
input
type
=
"hidden"
name
=
"redirUrl"
value
=
"{{ Request::input('redirUrl', '') }}"
/>
<
input
type
=
"text"
name
=
"key"
value
=
"
{
{
C
ookie
::get('key')
}
}
"
placeholder
=
"@lang('key.placeholder1')"
autofocus
>
<
input
type
=
"text"
name
=
"key"
value
=
"{{
$c
ookie
=== 'enter_key_here' ? '' :
$cookie
}}"
placeholder
=
"@lang('key.placeholder1')"
autofocus
>
<
button
type
=
"submit"
class
=
"btn btn-success"
>
OK
</
button
>
<
button
type
=
"submit"
class
=
"btn btn-success"
>
OK
</
button
>
</
form
>
</
form
>
@
if
(
C
ookie
::
get
(
'key'
)
!==
NULL
)
@
if
(
$c
ookie
!==
'enter_key_here'
)
<
form
method
=
"post"
action
=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), action('KeyController@removeKey', ['redirUrl' => url()->full()])) }}"
>
<
form
method
=
"post"
action
=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), action('KeyController@removeKey', ['redirUrl' => url()->full()])) }}"
>
<
input
type
=
"hidden"
name
=
"redirUrl"
value
=
"{{ Request::input('redirUrl', '') }}"
/>
<
input
type
=
"hidden"
name
=
"redirUrl"
value
=
"{{ Request::input('redirUrl', '') }}"
/>
<
button
type
=
"submit"
class
=
"btn btn-default"
>@
lang
(
'key.removeKey'
)
</
button
>
<
button
type
=
"submit"
class
=
"btn btn-default"
>@
lang
(
'key.removeKey'
)
</
button
>
...
...
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