Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
2beefac9
Commit
2beefac9
authored
Sep 10, 2014
by
Côme Bernigaud
Committed by
Benoit Mortier
Sep 11, 2014
Browse files
Improving new template system to use it for users
parent
40925a9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
ihtml/themes/default/simple-remove.tpl
View file @
2beefac9
<div
style=
"padding:5px;"
>
<div
style=
"font-size:18px;"
>
<img
alt=
""
src=
"geticon.php?context=status&icon=dialog-warning&size=32"
class=
"center"
/>
{
t
}
Warning
{/
t
}
<img
alt=
""
src=
"geticon.php?context=status&icon=dialog-warning&size=32"
class=
"center"
/>
{
t
}
Warning
: you are about to delete the following objects
{/
t
}
</div>
<p>
<ul>
...
...
include/simpleplugin/class_simpleManagement.inc
View file @
2beefac9
...
...
@@ -215,6 +215,24 @@ class simpleManagement extends management
'filter'
=>
ldapFilter
::
parse
(
$i
[
'filter'
]),
'nameAttr'
=>
$i
[
'nameAttr'
],
);
if
(
!
$this
->
skipTemplates
)
{
$this
->
headpage
->
objectTypes
[
'template_'
.
$object
]
=
array
(
'label'
=>
sprintf
(
_
(
'%s template'
),
$i
[
'name'
]),
'category'
=>
$i
[
'aclCategory'
],
'class'
=>
'fdTemplate'
,
'image'
=>
$i
[
'icon'
],
//FIXME
'filter'
=>
new
ldapFilter
(
'&'
,
array
(
new
ldapFilterLeaf
(
'objectClass'
,
'='
,
'fdTemplate'
),
fdTemplateFilter
(
ldapFilter
::
parse
(
$i
[
'filter'
])),
)
),
'nameAttr'
=>
$i
[
'nameAttr'
],
);
}
$this
->
headpage
->
categories
[]
=
$i
[
'aclCategory'
];
if
(
$this
->
autoActions
)
{
$this
->
registerAction
(
'new_'
.
$object
,
'newEntry'
);
...
...
@@ -431,6 +449,9 @@ class simpleManagement extends management
// Single edit - we only got one object dn.
if
(
count
(
$target
)
==
1
)
{
$type
=
$this
->
getType
(
$target
[
0
]);
if
(
preg_match
(
'/^template_/'
,
$type
)
&&
!
$this
->
skipTemplates
)
{
$type
=
preg_replace
(
'/^template_/'
,
''
,
$type
);
}
$this
->
is_new
=
FALSE
;
$this
->
is_single_edit
=
TRUE
;
...
...
@@ -469,9 +490,11 @@ class simpleManagement extends management
@
DEBUG
(
DEBUG_TRACE
,
__LINE__
,
__FUNCTION__
,
__FILE__
,
$target
,
"Entry removal requested!"
);
// Check permissons for each target
$tInfo
=
$this
->
config
->
data
[
'OBJECTS'
];
foreach
(
$target
as
$dn
)
{
$type
=
$this
->
getType
(
$dn
);
if
(
preg_match
(
'/^template_/'
,
$type
)
&&
!
$this
->
skipTemplates
)
{
$type
=
preg_replace
(
'/^template_/'
,
''
,
$type
);
}
try
{
$info
=
objects
::
infos
(
$type
);
$acl
=
$this
->
ui
->
get_permissions
(
$dn
,
$info
[
'aclCategory'
]
.
'/'
.
$info
[
'mainTab'
]);
...
...
@@ -500,6 +523,9 @@ class simpleManagement extends management
$objects
=
array
();
foreach
(
$this
->
dns
as
$dn
)
{
$type
=
$this
->
getType
(
$dn
);
if
(
preg_match
(
'/^template_/'
,
$type
)
&&
!
$this
->
skipTemplates
)
{
$type
=
preg_replace
(
'/^template_/'
,
''
,
$type
);
}
$info
=
objects
::
infos
(
$type
);
$entry
=
$this
->
getHeadpage
()
->
getEntry
(
$dn
);
$objects
[]
=
array
(
...
...
@@ -524,20 +550,13 @@ class simpleManagement extends management
{
@
DEBUG
(
DEBUG_TRACE
,
__LINE__
,
__FUNCTION__
,
__FILE__
,
$target
,
"Entry removal confirmed!"
);
$targets
=
array
();
foreach
(
$this
->
dns
as
$dn
)
{
$type
=
$this
->
getType
(
$dn
);
if
(
empty
(
$type
))
{
continue
;
}
$targets
[
$type
][]
=
$dn
;
}
$tInfo
=
$this
->
config
->
data
[
'OBJECTS'
];
foreach
(
$this
->
dns
as
$dn
)
{
$type
=
$this
->
getType
(
$dn
);
if
(
empty
(
$type
))
{
continue
;
if
(
preg_match
(
'/^template_/'
,
$type
)
&&
!
$this
->
skipTemplates
)
{
$type
=
preg_replace
(
'/^template_/'
,
''
,
$type
);
}
$infos
=
objects
::
infos
(
$type
);
// Check permissions, are we allowed to remove this object?
...
...
Write
Preview
Supports
Markdown
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