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
41e5003f
Kaydet (Commit)
41e5003f
authored
Ock 14, 2019
tarafından
mertcelen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Ldap Search reworked.
üst
94a5aac8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
45 deletions
+64
-45
PermissionManager.php
app/Http/Middleware/PermissionManager.php
+1
-2
User.php
app/User.php
+1
-1
folder.blade.php
resources/views/__system__/folder.blade.php
+3
-2
index_linux.blade.php
...urces/views/extensions/kullanıcılar/index_linux.blade.php
+27
-16
index_windows.blade.php
...ces/views/extensions/kullanıcılar/index_windows.blade.php
+27
-20
index.blade.php
resources/views/scripts/index.blade.php
+5
-4
No files found.
app/Http/Middleware/PermissionManager.php
Dosyayı görüntüle @
41e5003f
...
...
@@ -29,7 +29,7 @@ class PermissionManager
// Loop through every validations
foreach
(
PermissionManager
::
$verify
as
$target
){
if
(
!
$this
->
check
(
$target
)){
return
respond
(
'
Liman:
Bu işlem için yetkiniz bulunmamaktadır.'
,
403
);
return
respond
(
'Bu işlem için yetkiniz bulunmamaktadır.'
,
403
);
}
}
// Process request if everything is ok.
...
...
@@ -52,7 +52,6 @@ class PermissionManager
if
(
$value
==
null
){
return
true
;
}
echo
$value
;
if
(
!
in_array
(
$value
,
request
(
'permissions'
)
->
__get
(
$target
))){
return
false
;
}
...
...
app/User.php
Dosyayı görüntüle @
41e5003f
...
...
@@ -47,6 +47,6 @@ class User extends Authenticatable
if
(
$this
->
permissions
->
__get
(
$target
)
==
null
){
return
$this
->
isAdmin
();
}
return
array_search
(
$id
,
$this
->
permissions
->
__get
(
$target
));
return
in_array
(
$id
,
$this
->
permissions
->
__get
(
$target
));
}
}
resources/views/__system__/folder.blade.php
Dosyayı görüntüle @
41e5003f
@
foreach
(
$files
as
$key
=>
$file
)
@
if
(
is_array
(
$file
))
{
name
:
'{{$key}}'
,
children
:
[
@
include
(
'__system__.folder'
,[
"files"
=>
$file
])]
},
{
"text"
:
"
{
{$key}
}
"
,
"children"
:
[
@
include
(
'__system__.folder'
,[
"files"
=>
$file
])]
},
@
else
{
name
:
'{{$file}}'
,
children
:
[]
},
{
"text"
:
"
{
{$file}
}
"
},
@
endif
@
endforeach
\ No newline at end of file
resources/views/extensions/kullanıcılar/index_linux.blade.php
Dosyayı görüntüle @
41e5003f
...
...
@@ -40,14 +40,16 @@
unset
(
$t
);
$mert
=
array_merge_recursive
(
$mert
,
$res
);
}
hello_world
();
?>
<script
src=
"{{asset('/js/treeview.min.js')}}"
></script>
<link
rel=
"stylesheet"
href=
"{{asset('/css/tree.css')}}"
>
<script
src=
"//cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"
></script>
<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>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col"
>
<div
id=
"tree"
></div>
<div
id=
"
ldap_
tree"
></div>
</div>
<div
class=
"col pt-3"
>
<table
class=
"table"
>
...
...
@@ -77,18 +79,28 @@
</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"
],
'core'
:
{
'data'
:
[
@
include
(
"__system__.folder"
,[
"files"
=>
$mert
])
]
}
});
}
asd
();
</script>
<script>
let
tree
=
new
TreeView
([
@
include
(
"__system__.folder"
,[
"files"
=>
$mert
])
],
'tree'
);
tree
.
on
(
'select'
,
function
(
e
){
let
cn
=
e
.
data
.
name
;
document
.
getElementById
(
"uid"
).
innerText
=
user_details
[
cn
][
"uid"
];
document
.
getElementById
(
"uidnumber"
).
innerText
=
user_details
[
cn
][
"uidnumber"
];
document
.
getElementById
(
"homedirectory"
).
innerText
=
user_details
[
cn
][
"homedirectory"
];
document
.
getElementById
(
"gidnumber"
).
innerText
=
user_details
[
cn
][
"gidnumber"
];
document
.
getElementById
(
"cn"
).
innerText
=
user_details
[
cn
][
"cn"
];
$
(
"#s"
).
submit
(
function
(
e
)
{
e
.
preventDefault
();
$
(
"#ldap_tree"
).
jstree
(
true
).
search
(
$
(
"#q"
).
val
());
});
let
user_details
=
<?php
echo
json_encode
(
$user_details
)
?>
;
</script>
\ No newline at end of file
resources/views/extensions/kullanıcılar/index_windows.blade.php
Dosyayı görüntüle @
41e5003f
<?php
$ldap_connection
=
ldap_connect
(
$server
->
ip_address
);
ldap_set_option
(
$ldap_connection
,
LDAP_OPT_PROTOCOL_VERSION
,
3
);
ldap_set_option
(
$ldap_connection
,
LDAP_OPT_REFERRALS
,
0
);
$query
=
"openssl s_client -connect "
.
$server
->
ip_address
.
":"
.
$server
->
control_port
.
" 2>/dev/null </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'"
;
$cert
=
shell_exec
(
$query
);
ldap_set_option
(
$ldap_connection
,
LDAP_OPT_X_TLS_CACERTFILE
,
$cert
);
ldap_set_option
(
$ldap_connection
,
LDAP_OPT_X_TLS_REQUIRE_CERT
,
LDAP_OPT_X_TLS_HARD
);
$pass
=
"SambaPardus01"
;
try
{
$result
=
ldap_bind
(
$ldap_connection
,
"
administrator@win.
lab"
,
$pass
);
$result
=
ldap_bind
(
$ldap_connection
,
"
cn=administrator,cn=Users,dc=win,dc=
lab"
,
$pass
);
}
catch
(
Exception
$e
){
dd
(
$e
->
getMessage
());
}
$search
=
ldap_search
(
$ldap_connection
,
"dc=win,dc=lab"
,
"(objectclass=person)"
);
$users
=
ldap_get_entries
(
$ldap_connection
,
$search
);
$mert
=
[];
...
...
@@ -46,15 +52,15 @@ for($i = 0 ; $i < $users["count"] ; $i++){
}
$user_details
[
$k
][
"cn"
]
=
$attributes
[
0
][
"cn"
][
0
];
$user_details
[
$k
][
"name"
]
=
$attributes
[
0
][
"name"
][
0
];
$user_details
[
$k
][
"sn"
]
=
$attributes
[
0
][
"sn"
][
0
];
$user_details
[
$k
][
"givenName"
]
=
$attributes
[
0
][
"givenName"
][
0
];
$user_details
[
$k
][
"samaccountname"
]
=
$attributes
[
0
][
"samaccountname"
][
0
];
$user_details
[
$k
][
"whenCreated"
]
=
$attributes
[
0
][
"whenCreated"
][
0
];
$user_details
[
$k
][
"whenChanged"
]
=
$attributes
[
0
][
"whenChanged"
][
0
];
$user_details
[
$k
][
"pwdLastSet"
]
=
$attributes
[
0
][
"pwdLastSet"
][
0
];
$user_details
[
$k
][
"lastLogon"
]
=
$attributes
[
0
][
"lastLogon"
][
0
];
$user_details
[
$k
][
"lastLogoff"
]
=
$attributes
[
0
][
"lastLogoff"
][
0
];
$user_details
[
$k
][
"accountExpires"
]
=
$attributes
[
0
][
"accountExpires"
][
0
];
//
$user_details[$k]["sn"] = $attributes[0]["sn"][0];
//
$user_details[$k]["givenName"] = $attributes[0]["givenName"][0];
//
$user_details[$k]["samaccountname"] = $attributes[0]["samaccountname"][0];
//
$user_details[$k]["whenCreated"] = $attributes[0]["whenCreated"][0];
//
$user_details[$k]["whenChanged"] = $attributes[0]["whenChanged"][0];
//
$user_details[$k]["pwdLastSet"] = $attributes[0]["pwdLastSet"][0];
//
$user_details[$k]["lastLogon"] = $attributes[0]["lastLogon"][0];
//
$user_details[$k]["lastLogoff"] = $attributes[0]["lastLogoff"][0];
//
$user_details[$k]["accountExpires"] = $attributes[0]["accountExpires"][0];
}
$t
=
&
$t
[
$k
];
...
...
@@ -131,16 +137,16 @@ for($i = 0 ; $i < $users["count"] ; $i++){
tree
.
on
(
'select'
,
function
(
e
){
let
cn
=
e
.
data
.
name
;
document
.
getElementById
(
"cn"
).
innerText
=
user_details
[
cn
][
"cn"
];
document
.
getElementById
(
"whencreated"
).
innerText
=
user_details
[
cn
][
"whencreated"
];
document
.
getElementById
(
"whenchanged"
).
innerText
=
user_details
[
cn
][
"whenchanged"
];
//
document.getElementById("whencreated").innerText = user_details[cn]["whencreated"];
//
document.getElementById("whenchanged").innerText = user_details[cn]["whenchanged"];
document
.
getElementById
(
"name"
).
innerText
=
user_details
[
cn
][
"name"
];
document
.
getElementById
(
"sn"
).
innerText
=
user_details
[
cn
][
"sn"
];
document
.
getElementById
(
"givenName"
).
innerText
=
user_details
[
cn
][
"givenName"
];
document
.
getElementById
(
"samaccountname"
).
innerText
=
user_details
[
cn
][
"samaccountname"
];
document
.
getElementById
(
"pwdLastSet"
).
innerText
=
user_details
[
cn
][
"pwdLastSet"
];
document
.
getElementById
(
"lastLogon"
).
innerText
=
user_details
[
cn
][
"lastLogon"
];
document
.
getElementById
(
"lastLogoff"
).
innerText
=
user_details
[
cn
][
"lastLogoff"
];
document
.
getElementById
(
"accountExpires"
).
innerText
=
user_details
[
cn
][
"accountExpires"
];
//
document.getElementById("sn").innerText = user_details[cn]["sn"];
//
document.getElementById("givenName").innerText = user_details[cn]["givenName"];
//
document.getElementById("samaccountname").innerText = user_details[cn]["samaccountname"];
//
document.getElementById("pwdLastSet").innerText = user_details[cn]["pwdLastSet"];
//
document.getElementById("lastLogon").innerText = user_details[cn]["lastLogon"];
//
document.getElementById("lastLogoff").innerText = user_details[cn]["lastLogoff"];
//
document.getElementById("accountExpires").innerText = user_details[cn]["accountExpires"];
});
let
user_details
=
<?php
echo
json_encode
(
$user_details
)
?>
;
</script>
\ No newline at end of file
resources/views/scripts/index.blade.php
Dosyayı görüntüle @
41e5003f
...
...
@@ -4,9 +4,9 @@
@
include
(
'title'
,[
"title"
=>
"Betikler"
])
<
button
type
=
"button"
class
="
btn
btn
-
success
" onclick="
window
.
location
.
href
=
'{{route('
script_add
')}}'
">
{{
__("
Betik
Oluştur
")
}}
</button>
{{
--<
button
type
=
"button"
class
="
btn
btn
-
success
" onclick="
window
.
location
.
href
=
'{{route('
script_add
')}}'
">--}}
{{
--{{ __("
Betik
Oluştur
") }}--
}}
{
{--</button>--}
}
@include('modal-button',[
"
class
"
=>
"
btn
-
primary
",
...
...
@@ -32,7 +32,8 @@
</thead>
<tbody>
@foreach (
$scripts
as
$script
)
<tr class="
highlight
" onclick="
window
.
location
.
href
=
'{{route('
script_one
',$script->_id)}}'
">
{{--<tr class="
highlight
" onclick="
window
.
location
.
href
=
'{{route('
script_one
',$script->_id)}}'
">--}}
<tr class="">
<td>
{
{$script->name}
}
</td>
</tr>
@endforeach
...
...
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