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
d2321465
Kaydet (Commit)
d2321465
authored
Ock 16, 2019
tarafından
mertcelen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
-Extension Functions Api added.
-Add user modal and function added to Ldap User Extension.
üst
5ead2f2e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
133 additions
and
26 deletions
+133
-26
MainController.php
app/Http/Controllers/Extension/MainController.php
+3
-0
OneController.php
app/Http/Controllers/Extension/OneController.php
+10
-4
_routes.php
app/Http/Controllers/Extension/_routes.php
+2
-2
Server.php
app/Http/Middleware/Server.php
+10
-2
inputs.blade.php
resources/views/__system__/inputs.blade.php
+35
-8
functions.php
resources/views/extensions/kullanıcılar/functions.php
+16
-0
index_linux.blade.php
...urces/views/extensions/kullanıcılar/index_linux.blade.php
+57
-10
No files found.
app/Http/Controllers/Extension/MainController.php
Dosyayı görüntüle @
d2321465
...
...
@@ -32,6 +32,9 @@ class MainController extends Controller
"city"
=>
$cities
[
0
]
]));
}
if
(
$cities
==
null
){
return
respond
(
'Bu özelliği kullanabileceğiniz hiçbir sunucunuz yok.'
);
}
return
view
(
'feature.index'
,
[
"cities"
=>
implode
(
','
,
$cities
)
]);
...
...
app/Http/Controllers/Extension/OneController.php
Dosyayı görüntüle @
d2321465
...
...
@@ -16,7 +16,6 @@ class OneController extends Controller
// First, check requested server has key.
$server
=
\request
(
'server'
);
if
(
$server
->
key
==
null
){
// Redirect user if requested server is not serverless.
...
...
@@ -96,10 +95,17 @@ class OneController extends Controller
}
public
function
runFunction
(){
$extension
=
Extension
::
where
(
'_id'
,
request
(
'extension_id'
))
->
first
();
$extension
=
Extension
::
where
(
'_id'
,
request
(
)
->
route
(
'extension_id'
))
->
first
();
require
(
base_path
(
'resources/views/extensions/'
.
strtolower
(
$extension
->
name
)
.
'/functions.php'
));
call_user_func
(
'hello_world'
);
if
(
function_exists
(
request
(
'function_name'
))){
if
(
call_user_func
(
request
(
'function_name'
),
request
(
'server'
),
"SambaPardus01"
,
"cn=admin,dc=ldap,dc=lab"
)){
return
respond
(
"Kullanıcı başarıyla eklendi"
,
200
);
}
else
{
return
respond
(
"Kullanıcı eklenemedi, lütfen yöneticinizle iletişime geçiniz"
,
201
);
}
}
else
{
return
respond
(
"İşlev bulunamadı, lütfen yöneticinizle iletişime geçiniz."
,
404
);
}
}
}
app/Http/Controllers/Extension/_routes.php
Dosyayı görüntüle @
d2321465
...
...
@@ -41,4 +41,4 @@ Route::post('/eklentiler/betikler/ekle', 'Extension\SettingsController@addScript
Route
::
post
(
'/eklentiler/betikler/sil'
,
'Extension\SettingsController@removeScriptFromView'
)
->
name
(
'extension_page_script_remove'
);
// Extension Function Api
Route
::
get
(
'/eklenti/{extension_id}/{function_name}'
,
'Extension\OneController@runFunction'
)
->
name
(
'extension_function_api'
);
\ No newline at end of file
Route
::
post
(
'/eklenti/{extension_id}/{function_name}'
,
'Extension\OneController@runFunction'
)
->
name
(
'extension_function_api'
)
->
middleware
(
'server'
);
\ No newline at end of file
app/Http/Middleware/Server.php
Dosyayı görüntüle @
d2321465
...
...
@@ -21,16 +21,24 @@ class Server
if
(
$server
==
null
)
{
return
respond
(
"Sunucu bulunamadı."
,
404
);
}
//Now that everything is checked, add server variable to request to easy access and prevent more database queries.
$request
->
request
->
add
([
'server'
=>
$server
]);
//Check if ssh port is active on server.
if
(
!
$server
->
isAlive
())
{
return
respond
(
"Sunucuyla bağlantı kurulamadı."
,
503
);
}
// Check if server is serverless, which means no validation required.
if
(
$server
->
serverless
){
return
$next
(
$request
);
}
//Check if SSH key is valid or even exist for user.
if
(
!
$server
->
integrity
())
{
return
respond
(
"SSH: Sunucuya erişmek için izniniz yok."
,
403
);
}
//Now that everything is checked, add server variable to request to easy access and prevent more database queries.
$request
->
request
->
add
([
'server'
=>
$server
]);
}
else
{
return
respond
(
"Server bilgisi verilmedi."
,
404
);
}
...
...
resources/views/__system__/inputs.blade.php
Dosyayı görüntüle @
d2321465
...
...
@@ -9,19 +9,46 @@
</select><br>
@else
@if(explode("
:
",
$input
)[1] == "
hidden
")
<input type="
{{
explode
(
":"
,
$input
)[
1
]}}
" name="
{{
explode
(
":"
,
$input
)[
0
]}}
" placeholder="
{{
__
(
$name
)}}
"
class="
form
-
control
@
if
(
isset
(
$random
,
$id
)){{
$random
}}
{{
$id
}}
@
endif
" required value="
{{
explode
(
":"
,
$name
)[
1
]}}
">@if(explode("
:
",
$input
)[1] != "
hidden
")<br>@endif
@if(explode("
:
",
$input
)[1] == "
checkbox
")
<div class="
form
-
check
">
<input class="
form
-
check
-
input
" type="
checkbox
" name="
{{
explode
(
":"
,
$input
)[
0
]}}
">
<label class="
form
-
check
-
label
h5
">
{
{$name}
}
</label>
</div><br>
@else
<input type="
{{
explode
(
":"
,
$input
)[
1
]}}
" name="
{{
explode
(
":"
,
$input
)[
0
]}}
" placeholder="
{{
__
(
$name
)}}
"
class="
form
-
control
@
if
(
isset
(
$random
,
$id
)){{
$random
}}
{{
$id
}}
@
endif
" required value="
{{
explode
(
":"
,
$name
)[
1
]}}
">@if(explode("
:
",
$input
)[1] != "
hidden
")<br>@endif
@endif
@elseif(isset(
$disabled
))
<h5 class="
@
if
(
isset
(
$random
,
$id
)){{
$random
}}
{{
$id
}}
@
endif
" style="
padding
-
top
:
15
px
;
">
{
{__(explode(":",$name)[0])}
}
</h5>
<input type="
{{
explode
(
":"
,
$input
)[
1
]}}
" name="
{{
explode
(
":"
,
$input
)[
0
]}}
" placeholder="
{{
__
(
$name
)}}
"
class="
form
-
control
@
if
(
isset
(
$random
,
$id
)){{
$random
}}
{{
$id
}}
@
endif
" required disabled hidden style="
margin
-
top
:
15
px
">
@if(explode("
:
",
$input
)[1] == "
checkbox
")
<div class="
form
-
check
">
<input class="
form
-
check
-
input
" type="
checkbox
" name="
{{
explode
(
":"
,
$input
)[
0
]}}
">
<label class="
form
-
check
-
label
h5
">
{
{$name}
}
</label>
</div><br>
@else
<h5 class="
@
if
(
isset
(
$random
,
$id
)){{
$random
}}
{{
$id
}}
@
endif
" style="
padding
-
top
:
15
px
;
">
{
{__(explode(":",$name)[0])}
}
</h5>
<input type="
{{
explode
(
":"
,
$input
)[
1
]}}
" name="
{{
explode
(
":"
,
$input
)[
0
]}}
" placeholder="
{{
__
(
$name
)}}
"
class="
form
-
control
@
if
(
isset
(
$random
,
$id
)){{
$random
}}
{{
$id
}}
@
endif
" required disabled hidden style="
margin
-
top
:
15
px
">
@endif
@elseif(explode("
:
",
$input
)[1] == "
textarea
")
<textarea name="
{{
explode
(
":"
,
$input
)[
0
]}}
"
class="
form
-
control
" required></textarea><br>
@else
<h5>
{
{__($name)}
}
</h5>
<input type="
{{
explode
(
":"
,
$input
)[
1
]}}
" name="
{{
explode
(
":"
,
$input
)[
0
]}}
" placeholder="
{{
__
(
$name
)}}
"
class="
form
-
control
@
if
(
isset
(
$random
,
$id
)){{
$random
}}
{{
$id
}}
@
endif
" required>@if(explode("
:
",
$input
)[1] != "
hidden
")<br>@endif
@if(explode("
:
",
$input
)[1] == "
checkbox
")
<div class="
form
-
check
">
<input class="
form
-
check
-
input
" type="
checkbox
" name="
{{
explode
(
":"
,
$input
)[
0
]}}
">
<label class="
form
-
check
-
label
h5
">
{
{$name}
}
</label>
</div><br>
@else
<h5>
{
{__($name)}
}
</h5>
<input type="
{{
explode
(
":"
,
$input
)[
1
]}}
" name="
{{
explode
(
":"
,
$input
)[
0
]}}
" placeholder="
{{
__
(
$name
)}}
"
class="
form
-
control
@
if
(
isset
(
$random
,
$id
)){{
$random
}}
{{
$id
}}
@
endif
" required>@if(explode("
:
",
$input
)[1] != "
hidden
")<br>@endif
@endif
@endif
@endif
@endforeach
...
...
resources/views/extensions/kullanıcılar/functions.php
Dosyayı görüntüle @
d2321465
...
...
@@ -35,4 +35,19 @@ function _search($connection, $dn ,$filter, $extra){
$mert
=
array_merge_recursive
(
$mert
,
$res
);
}
return
$mert
;
}
function
addUser
(
$server
,
$password
,
$rdn
){
$user
[
"firstname"
]
=
request
(
"firstname"
);
$user
[
"surname"
]
=
request
(
"surname"
);
$user
[
"fullname"
]
=
request
(
"fullname"
);
$user
[
"username"
]
=
request
(
"username"
);
$user
[
"password"
]
=
request
(
"password"
);
$user
[
"forcechangepass"
]
=
(
request
()
->
exists
(
'forcechangepass'
))
?
"true"
:
"false"
;
$user
[
"neverexpired"
]
=
(
request
()
->
exists
(
'neverexpired'
))
?
"true"
:
"false"
;
$user
[
"lockaccount"
]
=
(
request
()
->
exists
(
'lockaccount'
))
?
"true"
:
"false"
;
$user
[
"objectclass"
]
=
"posixAccount"
;
$user
[
"cantchangepass"
]
=
(
request
()
->
exists
(
'cantchangepass'
))
?
"true"
:
"false"
;
$ldap_connection
=
_init
(
$server
->
ip_address
,
$server
->
port
,
$password
,
$rdn
);
ldap_add
(
$ldap_connection
,
request
(
'tree_path'
),
$user
);
}
\ No newline at end of file
resources/views/extensions/kullanıcılar/index_linux.blade.php
Dosyayı görüntüle @
d2321465
...
...
@@ -8,9 +8,16 @@
<link
rel=
"stylesheet"
href=
"//cdnjs.cloudflare.com/ajax/libs/jstree/3.3.7/themes/default/style.min.css"
/>
<script
src=
"//cdnjs.cloudflare.com/ajax/libs/jstree/3.3.7/jstree.min.js"
></script>
@include('modal-button',[
"class" => "btn-primary",
"target_id" => "add_user",
"text" => "Kullanıcı Ekle"
])
<br><br>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col"
>
<input
type=
"search"
onchange=
"search()"
id=
"q"
/><br><br>
<div
id=
"ldap_tree"
></div>
</div>
<div
class=
"col pt-3"
>
...
...
@@ -41,19 +48,36 @@
</div>
</div>
</div>
<form
id=
"s"
>
<input
type=
"search"
id=
"q"
/>
<button
type=
"submit"
>
Search
</button>
</form>
<script>
function
asd
(){
$
(
'#ldap_tree'
).
jstree
({
"plugins"
:
[
"search"
],
"plugins"
:
[
"contextmenu"
,
"search"
],
'core'
:
{
'data'
:
[
@
include
(
"__system__.folder"
,[
"files"
=>
$results
])
]
},
'contextmenu'
:
{
"items"
:
items
=
{
addUser
:
{
label
:
"{{__("
Kullan
ı
c
ı
Ekle
")}}"
,
action
:
function
(
obj
)
{
console
.
log
(
obj
);
},
icon
:
"fa fa-cog"
},
deleteUser
:
{
label
:
"{{__("
Kullan
ı
c
ı
y
ı
Sil
")}}"
,
action
:
function
(
obj
)
{
console
.
log
(
obj
);
},
icon
:
"fa fa-trash"
}
}
}
});
}
...
...
@@ -61,8 +85,31 @@
</script>
<script>
$
(
"#s"
).
submit
(
function
(
e
)
{
e
.
preventDefault
();
function
search
(){
$
(
"#ldap_tree"
).
jstree
(
true
).
search
(
$
(
"#q"
).
val
());
});
</script>
\ No newline at end of file
}
</script>
@include('modal',[
"id"=>"add_user",
"title" => "Kullanıcı Ekle",
"url" => route('extension_function_api',[
"extension_id" => $extension->_id,
"function_name" => "addUser"
]),
"next" => "reload",
"inputs" => [
"İsim" => "firstname:text",
"Soyisim" => "surname:text",
"Tüm İsim" => "fullname:text",
"Kullanıcı Adı" => "username:text",
"Parola" => "password:password",
"İlk oturum açılışında değişime zorla" => "forcechangepass:checkbox",
"Parola süresi asla bitmesin" => "neverexpired:checkbox",
"Hesabı kilitle" => "lockaccount:checkbox",
"Kullanıcı parolasını değiştiremez" => "cantchangepass:checkbox",
"LDAP PATH" => "tree_path:text",
"Sunucu Id:$server->_id" => "server_id:hidden"
],
"submit_text" => "Yetkilendir"
])
\ No newline at end of file
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