Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webprofile-jwg2024
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
webprofile-jwg2024
Commits
5226c756
Commit
5226c756
authored
May 16, 2020
by
Aan Choesni Herlingga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updater
parent
4164b4c1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
195 additions
and
0 deletions
+195
-0
app/Helpers/InseoHelper.php
+29
-0
app/Http/Controllers/Webprofile/Backend/UpdateController.php
+45
-0
resources/views/webprofile/backend/update/index.blade.php
+57
-0
resources/views/webprofile/backend/update/result.blade.php
+61
-0
routes/webprofile/backend.php
+3
-0
No files found.
app/Helpers/InseoHelper.php
View file @
5226c756
...
...
@@ -38,4 +38,33 @@ class InseoHelper
return
$full
;
}
public
static
function
inseoencrypt
(
$str
,
$kunci
=
'asd'
)
{
$hasil
=
''
;
for
(
$i
=
0
;
$i
<
strlen
(
$str
);
++
$i
)
{
$karakter
=
substr
(
$str
,
$i
,
1
);
$kuncikarakter
=
substr
(
$kunci
,
(
$i
%
strlen
(
$kunci
))
-
1
,
1
);
$karakter
=
chr
(
ord
(
$karakter
)
+
ord
(
$kuncikarakter
));
$hasil
.=
$karakter
;
}
return
urlencode
(
base64_encode
(
$hasil
));
}
public
static
function
inseodecrypt
(
$str
,
$kunci
=
'asd'
)
{
$str
=
base64_decode
(
urldecode
(
$str
));
$hasil
=
''
;
for
(
$i
=
0
;
$i
<
strlen
(
$str
);
++
$i
)
{
$karakter
=
substr
(
$str
,
$i
,
1
);
$kuncikarakter
=
substr
(
$kunci
,
(
$i
%
strlen
(
$kunci
))
-
1
,
1
);
$karakter
=
chr
(
ord
(
$karakter
)
-
ord
(
$kuncikarakter
));
$hasil
.=
$karakter
;
}
return
$hasil
;
}
}
app/Http/Controllers/Webprofile/Backend/UpdateController.php
0 → 100644
View file @
5226c756
<?php
namespace
App\Http\Controllers\Webprofile\Backend
;
use
App\Helpers\InseoHelper
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\Request
;
class
UpdateController
extends
Controller
{
public
function
index
()
{
return
view
(
'webprofile.backend.update.index'
);
}
public
function
update
(
Request
$request
)
{
$username
=
env
(
'GIT_USERNAME'
,
'lorem'
);
$password
=
InseoHelper
::
inseodecrypt
(
env
(
'GIT_PASSWORD'
,
'lorem'
),
env
(
'ENCRYPT_KEY'
,
'lorem'
));
$repository
=
env
(
'GIT_REPOSITORY'
,
'lorem'
);
$command
=
'git pull http://'
.
$username
.
':'
.
$password
.
'@'
.
$repository
.
' master'
;
$data
=
$request
->
tokenkey
;
$line
=
'Token Tidak Valid'
;
if
(
$data
==
env
(
'TOKEN_KEY'
,
'lorem'
))
{
$line
=
null
;
$result
=
array
();
exec
(
$command
,
$result
);
foreach
(
$result
as
$line
)
{
$line
.
"
\n
"
;
}
if
(
$line
==
null
)
{
$line
=
'Whoops something when wrong!! Check your username and password'
;
}
}
$data
=
[
'data'
=>
$line
,
];
return
view
(
'webprofile.backend.update.result'
,
$data
);
}
}
resources/views/webprofile/backend/update/index.blade.php
0 → 100644
View file @
5226c756
@
extends
(
'webprofile.backend.layouts.master'
)
@
section
(
'assets'
)
<
link
rel
=
"stylesheet"
href
=
"{!! asset('backend/js/datatables.net-bs/css/dataTables.bootstrap.min.css') !!}"
>
<
meta
name
=
"csrf-token"
content
=
"{{ csrf_token() }}"
>
@
endsection
@
section
(
'title'
)
Update
Engine
Website
@
stop
@
section
(
'breadcrumbs'
)
<
li
><
a
href
=
"{{ url('dashboard') }}"
>@
lang
(
'label.dashboard'
)
</
a
></
li
>
<
li
class
="
active
">@lang('feature.slider')</li>
@stop
@section('content')
<!-- page start-->
<div class="
row
">
<div class="
col
-
lg
-
12
">
<!-- START DEFAULT DATATABLE -->
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">
<h3 class="
panel
-
title
">Update Engine Website</h3>
<ul class="
panel
-
controls
">
<li><a href="
#" class="panel-collapse"><span class="fa fa-angle-down"></span></a></li>
</
ul
>
</
div
>
<
div
class
="
panel
-
body
">
{!! Form::open(['url' => route('update.now'), 'method' => 'POST', 'id' => 'update', 'class' => 'form-horizontal']) !!}
{!! csrf_field() !!}
{{ Form::hidden('tokenkey', '1p12p23t35147u51n62373s854970') }}
<button type="
submit
" class="
btn
btn
-
info
" style="
margin
:
0
cm
0
px
0
cm
10
px
;
">Update</button>
{!! Form::close() !!}
</div>
</div>
<!-- END DEFAULT DATATABLE -->
</div>
</div>
<!-- page end-->
@stop
@section('script')
<script src="
{
!!
asset
(
'backend/js/datatables.net/js/jquery.dataTables.min.js'
)
!!
}
"></script>
<script src="
{
!!
asset
(
'backend/js/datatables.net-bs/js/dataTables.bootstrap.min.js'
)
!!
}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/dataTables.buttons.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.bootstrap4.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.colVis.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.html5.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.print.min.js'
)
}}
"></script>
<script>
var url = "
{{
route
(
'sliders.index'
)
}}
";
</script>
{{ Html::script('js/master/slider.js') }}
@stop
resources/views/webprofile/backend/update/result.blade.php
0 → 100644
View file @
5226c756
@
extends
(
'webprofile.backend.layouts.master'
)
@
section
(
'assets'
)
<
link
rel
=
"stylesheet"
href
=
"{!! asset('backend/js/datatables.net-bs/css/dataTables.bootstrap.min.css') !!}"
>
<
meta
name
=
"csrf-token"
content
=
"{{ csrf_token() }}"
>
@
endsection
@
section
(
'title'
)
Update
Engine
Website
@
stop
@
section
(
'breadcrumbs'
)
<
li
><
a
href
=
"{{ url('dashboard') }}"
>@
lang
(
'label.dashboard'
)
</
a
></
li
>
<
li
class
="
active
">@lang('feature.slider')</li>
@stop
@section('content')
<!-- page start-->
<div class="
row
">
<div class="
col
-
lg
-
12
">
<!-- START DEFAULT DATATABLE -->
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">
<h3 class="
panel
-
title
">Update Engine Website</h3>
<ul class="
panel
-
controls
">
<li><a href="
#" class="panel-collapse"><span class="fa fa-angle-down"></span></a></li>
</
ul
>
</
div
>
<
div
class
="
panel
-
body
">
{!! Form::open(['url' => route('update.now'), 'method' => 'POST', 'id' => 'update', 'class' => 'form-horizontal']) !!}
{!! csrf_field() !!}
{{ Form::hidden('tokenkey', '1p12p23t35147u51n62373s854970') }}
<button type="
submit
" class="
btn
btn
-
info
" style="
margin
:
0
cm
0
px
0
cm
10
px
;
">Update</button>
{!! Form::close() !!}
<div style="
padding
-
left
:
10
px
;
padding
-
top
:
15
px
;
">
{{
$data
}}
</div>
</div>
</div>
<!-- END DEFAULT DATATABLE -->
</div>
</div>
<!-- page end-->
@stop
@section('script')
<script src="
{
!!
asset
(
'backend/js/datatables.net/js/jquery.dataTables.min.js'
)
!!
}
"></script>
<script src="
{
!!
asset
(
'backend/js/datatables.net-bs/js/dataTables.bootstrap.min.js'
)
!!
}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/dataTables.buttons.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.bootstrap4.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.colVis.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.html5.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.print.min.js'
)
}}
"></script>
<script>
var url = "
{{
route
(
'sliders.index'
)
}}
";
</script>
{{ Html::script('js/master/slider.js') }}
@stop
routes/webprofile/backend.php
View file @
5226c756
...
...
@@ -7,6 +7,9 @@ Route::group(['middleware' => 'auth'], function () {
Route
::
patch
(
'users_status/{id}'
,
'UserController@status'
)
->
name
(
'user.status'
);
});
Route
::
get
(
'update'
,
'Webprofile\Backend\UpdateController@index'
)
->
name
(
'update'
);
Route
::
post
(
'update'
,
'Webprofile\Backend\UpdateController@update'
)
->
name
(
'update.now'
);
});
Route
::
group
([
'middleware'
=>
'role:admin|editor'
],
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment