Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
agallavardin
fusiondirectory-plugins
Commits
0a66d96e
Commit
0a66d96e
authored
12 years ago
by
Côme Bernigaud
Committed by
Benoit Mortier
11 years ago
Browse files
Options
Download
Patches
Plain Diff
Fixes: #2733 Some clean on debconf
parent
99c3a766
1.4-dev
1.2
1.2.3-fixes
1.3-fixes
6017-create-a-plugin-for-managing-groupofuniquename
master
fusiondirectory-1.3
fusiondirectory-1.2.3
fusiondirectory-1.2.2
fusiondirectory-1.2.1
fusiondirectory-1.2
fusiondirectory-1.1.1
fusiondirectory-1.1
fusiondirectory-1.0.20
fusiondirectory-1.0.19
fusiondirectory-1.0.18
fusiondirectory-1.0.17
fusiondirectory-1.0.16
fusiondirectory-1.0.15
fusiondirectory-1.0.14
fusiondirectory-1.0.13
fusiondirectory-1.0.12
fusiondirectory-1.0.11
fusiondirectory-1.0.10
fusiondirectory-1.0.9.3
fusiondirectory-1.0.9.2
fusiondirectory-1.0.9.1
fusiondirectory-1.0.9
fusiondirectory-1.0.8.9
fusiondirectory-1.0.8.8
fusiondirectory-1.0.8.7
fusiondirectory-1.0.8.6
fusiondirectory-1.0.8.5
fusiondirectory-1.0.8.4
fusiondirectory-1.0.8.3
fusiondirectory-1.0.8.2
fusiondirectory-1.0.8.1
fusiondirectory-1.0.8
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
debconf/admin/debconfProfile/class_debconfProfileGeneric.inc
+47
-39
debconf/admin/debconfProfile/class_debconfProfileGeneric.inc
debconf/admin/debconfProfile/class_debconfProfileManagement.inc
+8
-8
...f/admin/debconfProfile/class_debconfProfileManagement.inc
debconf/admin/debconfProfile/debconfProfile-filter.xml
+1
-0
debconf/admin/debconfProfile/debconfProfile-filter.xml
debconf/admin/debconfProfile/tabs_debconfProfiles.inc
+0
-54
debconf/admin/debconfProfile/tabs_debconfProfiles.inc
with
56 additions
and
101 deletions
+56
-101
debconf/admin/debconfProfile/class_debconfProfileGeneric.inc
+
47
−
39
View file @
0a66d96e
...
...
@@ -41,7 +41,7 @@ class DebconfEntriesAttribute extends CompositeAttribute
/* Load template */
$ldap
=
$this
->
plugin
->
config
->
get_ldap_link
();
$ou
=
$this
->
plugin
->
attributes
Info
[
'main'
][
'attrs'
]
[
'ou'
]
->
getValue
();
$ou
=
$this
->
plugin
->
attributes
Access
[
'ou'
]
->
getValue
();
$ldap
->
cd
(
"ou=templates,"
.
$this
->
plugin
->
dn
);
$ldap
->
search
(
"(objectClass=debConfDbEntry)"
);
while
(
$entry
=
$ldap
->
fetch
())
{
...
...
@@ -115,12 +115,12 @@ class DebconfImportAttribute extends FileAttribute
strpos
(
$str
,
"dn:"
);
$tmp
=
str_replace
(
"
\n
"
,
""
,
$str
);
// removing breaklines
$tmp
=
str_replace
(
" "
,
""
,
$tmp
);
// removing spaces
if
(
preg_match
(
"/dn:.*,ou=templates,ou=(
.
+),"
.
get_ou
(
"debconfRDN"
)
.
if
(
preg_match
(
"/dn:.*,ou=templates,ou=(
[^,=]
+),"
.
get_ou
(
"debconfRDN"
)
.
$this
->
plugin
->
config
->
current
[
'BASE'
]
.
"/"
,
$tmp
,
$matches
)
>
0
)
{
// searching for dn: containing the template name
$this
->
plugin
->
attributes
Info
[
'main'
][
'attrs'
]
[
'ou'
]
->
setPostValue
(
$matches
[
1
]);
$this
->
plugin
->
attributes
Info
[
'main'
][
'attrs'
]
[
'ou'
]
->
setValue
(
$matches
[
1
]);
$this
->
plugin
->
attributes
Info
[
'main'
][
'attrs'
]
[
'ou'
]
->
setDisabled
(
TRUE
);
$this
->
plugin
->
attributes
Access
[
'ou'
]
->
setPostValue
(
$matches
[
1
]);
$this
->
plugin
->
attributes
Access
[
'ou'
]
->
setValue
(
$matches
[
1
]);
$this
->
plugin
->
attributes
Access
[
'ou'
]
->
setDisabled
(
TRUE
);
while
(
!
feof
(
$handle
))
{
$str
.
=
fread
(
$handle
,
1024
);
...
...
@@ -130,6 +130,7 @@ class DebconfImportAttribute extends FileAttribute
$ldap
=
$this
->
plugin
->
config
->
get_ldap_link
();
try
{
$ldap
->
import_complete_ldif
(
$str
,
FALSE
,
FALSE
);
$this
->
plugin
->
initially_was_account
=
TRUE
;
}
catch
(
Exception
$e
)
{
msg_dialog
::
display
(
_
(
'LDAP error'
),
$e
->
getMessage
(),
ERROR_DIALOG
);
}
...
...
@@ -156,31 +157,23 @@ class debconfProfileGeneric extends simplePlugin
var
$objectclasses
=
array
(
"top"
,
"organizationalUnit"
);
public
function
__construct
(
&
$config
,
$dn
=
NULL
,
$object
=
NULL
)
{
parent
::
__construct
(
$config
,
$dn
,
$object
);
$this
->
attributesInfo
[
'main'
][
'attrs'
][
'ou'
]
->
setUnique
(
TRUE
);
if
(
count
(
$this
->
attributesInfo
[
'entries'
][
'attrs'
][
'debconfEntries'
]
->
attributes
)
==
0
)
{
unset
(
$this
->
attributesInfo
[
'entries'
]);
$this
->
attributesInfo
[
'main'
][
'attrs'
][
'ou'
]
->
setVisible
(
FALSE
);
$this
->
attributesInfo
[
'main'
][
'attrs'
][
'ou'
]
->
setDisabled
(
TRUE
);
$this
->
attributesInfo
[
'main'
][
'name'
]
=
_
(
'Import'
);
}
else
{
$this
->
attributesInfo
[
'main'
][
'attrs'
][
'import'
]
->
setVisible
(
FALSE
);
$this
->
attributesInfo
[
'main'
][
'attrs'
][
'import'
]
->
setDisabled
(
TRUE
);
}
}
function
ldap_save
(
$cleanup
=
TRUE
)
public
static
function
plInfo
()
{
parent
::
ldap_save
(
$cleanup
);
if
(
isset
(
$this
->
attributesInfo
[
'entries'
]))
{
$this
->
attributesInfo
[
'entries'
][
'attrs'
][
'debconfEntries'
]
->
saveInLdap
();
}
return
array
(
'plShortName'
=>
_
(
'Debconf profile'
),
'plDescription'
=>
_
(
'Debconf profile generic'
),
'plSelfModify'
=>
FALSE
,
'plCategory'
=>
array
(
'debconfProfile'
=>
array
(
'description'
=>
_
(
'Debconf profile'
),
'objectClass'
=>
'debConfDbEntry'
)),
'plObjectType'
=>
array
(
'debconfProfile'
=>
array
(
'name'
=>
_
(
'Debconf profile'
),
'filter'
=>
'objectClass=debConfDbEntry'
,
'ou'
=>
get_ou
(
'debconfRDN'
)
)),
'plProvidedAcls'
=>
parent
::
generatePlProvidedAcls
(
self
::
getAttributesInfo
())
);
}
// The main function : information about attributes
static
function
getAttributesInfo
()
{
return
array
(
...
...
@@ -201,19 +194,34 @@ class debconfProfileGeneric extends simplePlugin
);
}
/* Return plugin informations for acl handling */
public
static
function
plInfo
()
public
function
__construct
(
&
$config
,
$dn
=
NULL
,
$object
=
NULL
)
{
return
array
(
"plShortName"
=>
_
(
"Debconf profile"
),
"plDescription"
=>
_
(
"Debconf profile generic"
),
"plSelfModify"
=>
FALSE
,
"plCategory"
=>
array
(
"debconfProfile"
=>
array
(
"description"
=>
_
(
"Debconf profile"
),
"objectClass"
=>
"debConfDbEntry"
)),
"plObjectType"
=>
array
(
"debconfProfile"
=>
array
(
"name"
=>
_
(
"Debconf profile"
),
"filter"
=>
"objectClass=debConfDbEntry"
)),
"plProvidedAcls"
=>
parent
::
generatePlProvidedAcls
(
self
::
getAttributesInfo
())
);
parent
::
__construct
(
$config
,
$dn
,
$object
);
$this
->
attributesAccess
[
'ou'
]
->
setUnique
(
TRUE
);
if
(
count
(
$this
->
attributesAccess
[
'debconfEntries'
]
->
attributes
)
==
0
)
{
unset
(
$this
->
attributesInfo
[
'entries'
]);
$this
->
attributesAccess
[
'ou'
]
->
setVisible
(
FALSE
);
$this
->
attributesAccess
[
'ou'
]
->
setDisabled
(
TRUE
);
$this
->
attributesInfo
[
'main'
][
'name'
]
=
_
(
'Import'
);
}
else
{
$this
->
attributesAccess
[
'import'
]
->
setVisible
(
FALSE
);
$this
->
attributesAccess
[
'import'
]
->
setDisabled
(
TRUE
);
}
}
function
compute_dn
()
{
$ou
=
$this
->
attributesAccess
[
'ou'
]
->
getValue
();
return
"ou=
$ou
,"
.
get_ou
(
"debconfRDN"
)
.
$this
->
config
->
current
[
'BASE'
];
}
function
ldap_save
(
$cleanup
=
TRUE
)
{
parent
::
ldap_save
(
$cleanup
);
if
(
isset
(
$this
->
attributesInfo
[
'entries'
]))
{
$this
->
attributesInfo
[
'entries'
][
'attrs'
][
'debconfEntries'
]
->
saveInLdap
();
}
}
}
?>
This diff is collapsed.
Click to expand it.
debconf/admin/debconfProfile/class_debconfProfileManagement.inc
+
8
−
8
View file @
0a66d96e
...
...
@@ -22,7 +22,7 @@
class
debconfProfileManagement
extends
management
{
// Tab definition
protected
$tabClass
=
"
debconfprofi
le
t
abs"
;
protected
$tabClass
=
"
simp
le
T
abs"
;
protected
$tabType
=
"DEBCONFPROFILETABS"
;
protected
$aclCategory
=
"debconfProfile"
;
protected
$aclPlugin
=
"debconfProfile"
;
...
...
@@ -32,14 +32,14 @@ class debconfProfileManagement extends management
static
function
plInfo
()
{
return
array
(
"
plShortName
"
=>
_
(
"
Debconf
"
),
"
plDescription
"
=>
_
(
"
Debconf profile management
"
),
"
plIcon
"
=>
"
plugins/debconf/images/icon.png
"
,
"
plPriority
"
=>
31
,
"
plSection
"
=>
"
admin
"
,
"
pl
Category"
=>
array
(
"
debconfProfile
"
),
'
plShortName
'
=>
_
(
'
Debconf
'
),
'
plDescription
'
=>
_
(
'
Debconf profile management
'
),
'
plIcon
'
=>
'
plugins/debconf/images/icon.png
'
,
'
plPriority
'
=>
31
,
'
plSection
'
=>
'
admin
'
,
'
pl
Manages'
=>
array
(
'
debconfProfile
'
),
"
plProvidedAcls
"
=>
array
()
'
plProvidedAcls
'
=>
array
()
);
}
...
...
This diff is collapsed.
Click to expand it.
debconf/admin/debconfProfile/debconfProfile-filter.xml
+
1
−
0
View file @
0a66d96e
...
...
@@ -34,6 +34,7 @@
<frequency>
0.5
</frequency>
<characters>
3
</characters>
</autocomplete>
<scope>
one
</scope>
</element>
</filterdef>
This diff is collapsed.
Click to expand it.
debconf/admin/debconfProfile/tabs_debconfProfiles.inc
deleted
100644 → 0
+
0
−
54
View file @
99c3a766
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2011-2013 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
class
debconfprofiletabs
extends
tabs
{
var
$Release
=
""
;
function
__construct
(
$config
,
$data
,
$dn
,
$category
,
$copied_object
=
NULL
)
{
parent
::
__construct
(
$config
,
$data
,
$dn
,
$category
,
$copied_object
);
/* Add references/acls/snapshots */
$this
->
addSpecialTabs
();
}
function
save
()
{
$baseobject
=
$this
->
getBaseObject
();
$ou
=
$baseobject
->
attributesInfo
[
'main'
][
'attrs'
][
'ou'
]
->
getValue
();
$new_dn
=
"ou=
$ou
,"
.
get_ou
(
"debconfRDN"
)
.
$this
->
config
->
current
[
'BASE'
];
/* Move group? */
if
(
$this
->
dn
!=
$new_dn
)
{
/* Write entry on new 'dn' */
if
(
$this
->
dn
!=
"new"
)
{
$baseobject
->
move
(
$this
->
dn
,
$new_dn
);
}
/* Happen to use the new one */
$this
->
dn
=
$new_dn
;
}
parent
::
save
();
}
}
?>
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets