Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
L
Liman MYS - Çekirdek
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
liman
Liman MYS - Çekirdek
Commits
5c2d7d4d
Kaydet (Commit)
5c2d7d4d
authored
Haz 26, 2020
tarafından
Baran Sekin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Completed oauth2 mechanism
üst
f492ff5c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
42 deletions
+80
-42
MainController.php
app/Http/Controllers/Settings/MainController.php
+50
-35
Helpers.php
app/Http/Helpers.php
+3
-2
Kernel.php
app/Http/Kernel.php
+2
-0
redirect.blade.php
resources/views/l/redirect.blade.php
+19
-0
index.blade.php
resources/views/settings/index.blade.php
+1
-1
api.php
routes/api.php
+5
-4
No files found.
app/Http/Controllers/Settings/MainController.php
Dosyayı görüntüle @
5c2d7d4d
...
...
@@ -116,16 +116,16 @@ class MainController extends Controller
$data
=
[
[
"id"
=>
"view_logs"
,
"name"
=>
"Sunucu Günlük Kayıtlarını Görüntüleme"
"name"
=>
"Sunucu Günlük Kayıtlarını Görüntüleme"
,
],
[
"id"
=>
"add_server"
,
"name"
=>
"Sunucu Ekleme"
"name"
=>
"Sunucu Ekleme"
,
],
[
"id"
=>
"server_services"
,
"name"
=>
"Sunucu Servislerini Görüntüleme"
]
"name"
=>
"Sunucu Servislerini Görüntüleme"
,
]
,
];
$title
=
[
"*hidden*"
,
"İsim"
];
$display
=
[
"id:id"
,
"name"
];
...
...
@@ -134,7 +134,7 @@ class MainController extends Controller
abort
(
504
,
"Tip Bulunamadı"
);
}
return
view
(
'l.table'
,
[
"value"
=>
(
object
)
$data
,
"value"
=>
(
object
)
$data
,
"title"
=>
$title
,
"display"
=>
$display
,
]);
...
...
@@ -159,20 +159,25 @@ class MainController extends Controller
$flag
=
false
;
$ids
=
json_decode
(
request
(
'ids'
),
true
);
if
(
$ids
==
[])
{
return
respond
(
"Lütfen bir seçim yapın"
,
201
);
if
(
$ids
==
[])
{
return
respond
(
"Lütfen bir seçim yapın"
,
201
);
}
foreach
(
$ids
as
$id
)
{
$flag
=
Permission
::
revoke
(
request
(
'user_id'
),
request
(
'type'
),
"id"
,
$id
);
$flag
=
Permission
::
revoke
(
request
(
'user_id'
),
request
(
'type'
),
"id"
,
$id
);
}
array_push
(
$arr
,
$id
);
$arr
[
"type"
]
=
request
(
'type'
);
$arr
[
"target_user_id"
]
=
request
(
'user_id'
);
system_log
(
7
,
"PERMISSION_REVOKE"
,
$arr
);
if
(
$flag
)
{
if
(
$flag
)
{
return
respond
(
__
(
"Başarılı"
),
200
);
}
else
{
}
else
{
return
respond
(
__
(
"Yetki(ler) silinemedi"
),
201
);
}
}
...
...
@@ -374,8 +379,8 @@ class MainController extends Controller
public
function
addServerGroup
()
{
if
(
!
request
(
'name'
)
||
strlen
(
request
(
'name'
))
<
1
)
{
return
respond
(
"Lütfen bir grup ismi girin."
,
201
);
if
(
!
request
(
'name'
)
||
strlen
(
request
(
'name'
))
<
1
)
{
return
respond
(
"Lütfen bir grup ismi girin."
,
201
);
}
if
(
ServerGroup
::
where
(
'name'
,
request
(
'name'
))
->
exists
())
{
return
respond
(
"Bu isimle zaten bir grup var."
,
201
);
...
...
@@ -473,22 +478,26 @@ input(type=\"imtcp\" port=\"514\")";
public
function
connectMarket
()
{
$client
=
new
Client
([
'verify'
=>
false
]);
$client
=
new
Client
([
'verify'
=>
false
]);
$params
=
[
"code"
=>
request
(
'code'
),
"grant_type"
=>
"authorization_code"
,
"redirect_uri "
=>
route
(
'home'
)
,
"client_id"
=>
env
(
'MARKET_CLIENT_ID'
),
"client_secret"
=>
env
(
'MARKET_CLIENT_SECRET'
)
"code"
=>
request
(
'code'
),
"grant_type"
=>
"authorization_code"
,
"redirect_uri"
=>
env
(
'APP_URL'
)
.
'/api/market/bagla'
,
"client_id"
=>
env
(
'MARKET_CLIENT_ID'
),
"client_secret"
=>
env
(
'MARKET_CLIENT_SECRET'
),
];
$res
=
$client
->
request
(
'POST'
,
'https://'
.
env
(
'MARKET_URL'
)
.
'/connect/token'
,
[
"form_params"
=>
$params
]
);
dd
(
"hey jude!"
);
$json
=
json_decode
((
string
)
$res
->
getBody
());
setEnv
([
"MARKET_ACCESS_TOKEN"
=>
$json
->
access_token
,
"MARKET_REFRESH_TOKEN"
=>
$json
->
refresh_token
,
]);
return
redirect
(
route
(
'settings'
)
.
"#limanMarket"
);
}
public
function
getLogSystem
()
...
...
@@ -527,26 +536,32 @@ input(type=\"imtcp\" port=\"514\")";
public
function
restrictedMode
()
{
$flag
=
setenv
([
"LIMAN_RESTRICTED"
=>
request
(
'LIMAN_RESTRICTED'
)
?
'true'
:
'false'
,
"LIMAN_RESTRICTED"
=>
request
(
'LIMAN_RESTRICTED'
)
?
'true'
:
'false'
,
"LIMAN_RESTRICTED_SERVER"
=>
request
(
'LIMAN_RESTRICTED_SERVER'
),
"LIMAN_RESTRICTED_EXTENSION"
=>
request
(
'LIMAN_RESTRICTED_EXTENSION'
)
"LIMAN_RESTRICTED_EXTENSION"
=>
request
(
'LIMAN_RESTRICTED_EXTENSION'
),
]);
if
(
$flag
)
{
if
(
$flag
)
{
return
respond
(
"Kısıtlı mod ayarları başarıyla güncellendi!"
);
}
else
{
return
respond
(
"Kısıtlı mod ayarları güncellenemedi!"
,
201
);
}
else
{
return
respond
(
"Kısıtlı mod ayarları güncellenemedi!"
,
201
);
}
}
public
function
getDNSServers
()
{
$data
=
`grep nameserver /etc/resolv.conf | grep -v "#"`
;
$arr
=
explode
(
"
\n
"
,
$data
);
$arr
=
explode
(
"
\n
"
,
$data
);
$clean
=
[];
foreach
(
$arr
as
$ip
){
if
(
$ip
==
""
){
continue
;}
$foo
=
explode
(
" "
,
trim
(
$ip
));
array_push
(
$clean
,
$foo
[
1
]);
foreach
(
$arr
as
$ip
)
{
if
(
$ip
==
""
)
{
continue
;
}
$foo
=
explode
(
" "
,
trim
(
$ip
));
array_push
(
$clean
,
$foo
[
1
]);
}
return
respond
(
$clean
);
}
...
...
@@ -557,8 +572,8 @@ input(type=\"imtcp\" port=\"514\")";
$str
=
"
options rotate timeout:3
"
;
foreach
([
request
(
'dns1'
),
request
(
'dns2'
),
request
(
'dns3'
)]
as
$ip
)
{
if
(
$ip
==
null
)
{
foreach
([
request
(
'dns1'
),
request
(
'dns2'
),
request
(
'dns3'
)]
as
$ip
)
{
if
(
$ip
==
null
)
{
continue
;
}
$str
.=
"nameserver
$ip
...
...
@@ -567,11 +582,11 @@ options rotate timeout:3
$str
=
trim
(
$str
);
$output
=
`echo "$str" | sudo tee /etc/resolv.conf`
;
$compare
=
trim
(
`cat /etc/resolv.conf`
)
==
$str
?
true
:
false
;
if
(
$compare
)
{
if
(
$compare
)
{
`sudo chattr +i /etc/resolv.conf`
;
return
respond
(
"DNS Ayarları güncellendi!"
);
}
else
{
return
respond
(
"DNS Ayarları güncellenemedi!"
,
201
);
}
else
{
return
respond
(
"DNS Ayarları güncellenemedi!"
,
201
);
}
}
}
app/Http/Helpers.php
Dosyayı görüntüle @
5c2d7d4d
...
...
@@ -159,7 +159,7 @@ if (!function_exists('settingsModuleButtons')) {
$foo
=
substr
(
$file
,
15
);
$name
=
substr
(
$foo
,
0
,
strpos
(
$foo
,
"/"
));
$hrefName
=
$name
;
if
(
is_numeric
(
$name
[
0
]))
{
if
(
is_numeric
(
$name
[
0
]))
{
$hrefName
=
"l-"
.
$name
;
}
...
...
@@ -720,6 +720,7 @@ if (!function_exists('setEnv')) {
if
(
!
file_put_contents
(
$envFile
,
$str
))
{
return
false
;
}
Artisan
::
call
(
'cache:clear'
);
return
true
;
}
}
...
...
@@ -846,7 +847,7 @@ if (!function_exists('setBaseDn')) {
if
(
!
function_exists
(
'checkPort'
))
{
function
checkPort
(
$ip
,
$port
)
{
if
(
$port
==
-
1
)
{
if
(
$port
==
-
1
)
{
return
true
;
}
$fp
=
@
fsockopen
(
$ip
,
$port
,
$errno
,
$errstr
,
0.1
);
...
...
app/Http/Kernel.php
Dosyayı görüntüle @
5c2d7d4d
...
...
@@ -28,6 +28,8 @@ class Kernel extends HttpKernel
\App\Http\Middleware\ForcePasswordChange
::
class
,
\App\Http\Middleware\RestrictedMode
::
class
,
],
'api'
=>
[
'throttle:60,1'
,
'bindings'
],
];
protected
$routeMiddleware
=
[
...
...
resources/views/l/redirect.blade.php
0 → 100644
Dosyayı görüntüle @
5c2d7d4d
<!doctype html>
<html
lang=
""
>
<head>
<title>
{{ __('Yönlendiriliyor...') }}
</title>
<script>
window
.
setTimeout
(
function
()
{
window
.
location
=
"{{ $url }}"
;
},
1000
);
</script>
<noscript>
<meta
http-equiv=
"refresh"
content=
"1;url={{ $url }}"
/>
</noscript>
</head>
<body>
Yönlendiriliyorsunuz,
eğer otomatik yönlendirilmezseniz lütfen
<a
href=
"{{ $url }}"
>
buraya
</a>
tıklayın.
</body>
</html>
\ No newline at end of file
resources/views/settings/index.blade.php
Dosyayı görüntüle @
5c2d7d4d
...
...
@@ -122,7 +122,7 @@
@if(env('MARKET_CODE'))
Var
@else
<a
href=
"https://{{env('MARKET_URL')}}/connect/authorize?response_type=code&scope=offline_access+user_api&redirect_uri={{urlencode(env('APP_URL') . '/market/bagla')}}&client_id={{env('MARKET_CLIENT_ID')}}"
>
Tikla
</a>
<a
href=
"https://{{env('MARKET_URL')}}/connect/authorize?response_type=code&scope=offline_access+user_api&redirect_uri={{urlencode(env('APP_URL') . '/
api/
market/bagla')}}&client_id={{env('MARKET_CLIENT_ID')}}"
>
Tikla
</a>
@endif
</div>
...
...
routes/api.php
Dosyayı görüntüle @
5c2d7d4d
...
...
@@ -2,6 +2,8 @@
use
Illuminate\Http\Request
;
Route
::
get
(
'/market/bagla'
,
function
(){
return
redirect
(
route
(
'connect_market'
,[
"code"
=>
request
(
'code'
)]));
});
\ No newline at end of file
Route
::
get
(
'/market/bagla'
,
function
()
{
return
view
(
'redirect'
,
[
'url'
=>
route
(
'connect_market'
,
[
"code"
=>
request
(
'code'
)]),
]);
});
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