Skip to content
GitLab
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
4ad3923c
Commit
4ad3923c
authored
May 23, 2013
by
Côme Bernigaud
Committed by
Benoit Mortier
May 23, 2013
Browse files
Fixes:
#2407
Migrate class_user to simple-plugin
parent
fbdf5af4
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
include/class_config.inc
View file @
4ad3923c
...
...
@@ -417,7 +417,7 @@ class config {
$this
->
current
[
'SAMBAMACHINEACCOUNTRDN'
]
=
"ou=computers,ou=systems"
;
}
if
(
!
isset
(
$this
->
current
[
'ACCOUNTPRIMARYATTRIBUTE'
]))
{
$this
->
current
[
'ACCOUNTPRIMARYATTRIBUTE'
]
=
"
cn
"
;
$this
->
current
[
'ACCOUNTPRIMARYATTRIBUTE'
]
=
"
uid
"
;
}
if
(
!
isset
(
$this
->
current
[
'MINID'
]))
{
$this
->
current
[
'MINID'
]
=
100
;
...
...
plugins/admin/users/tabs_user.inc
View file @
4ad3923c
...
...
@@ -26,14 +26,14 @@ class usertabs extends tabs
/* Template adaption variables
*/
var
$uid
=
""
;
var
$givenName
=
""
;
var
$sn
=
""
;
var
$uid
=
''
;
var
$givenName
=
''
;
var
$sn
=
''
;
function
usertabs
(
$config
,
$data
,
$dn
,
$cat
=
""
,
$copied_object
=
NULL
)
function
usertabs
(
$config
,
$data
,
$dn
,
$cat
=
''
,
$copied_object
=
NULL
)
{
parent
::
tabs
(
$config
,
$data
,
$dn
,
'users'
,
$copied_object
);
$this
->
base
=
$this
->
by_object
[
'user'
]
->
base
;
$this
->
base
=
$this
->
getBaseObject
()
->
base
;
$this
->
uid
=
&
$this
->
by_object
[
'user'
]
->
uid
;
$this
->
givenName
=
&
$this
->
by_object
[
'user'
]
->
givenName
;
...
...
@@ -49,31 +49,29 @@ class usertabs extends tabs
/* Update reference, transfer variables */
$baseobject
=
$this
->
getBaseObject
();
foreach
(
$this
->
by_object
as
$name
=>
$obj
)
{
foreach
(
$this
->
by_object
as
$name
=>
&
$obj
)
{
/* Don't touch base object */
if
(
$name
!=
'user'
)
{
$obj
->
parent
=
&
$this
;
$obj
->
uid
=
$baseobject
->
uid
;
$obj
->
givenName
=
$baseobject
->
uid
;
$obj
->
sn
=
$baseobject
->
uid
;
$obj
->
givenName
=
$baseobject
->
givenName
;
$obj
->
sn
=
$baseobject
->
sn
;
}
/* Copy mail if needed */
if
(
$name
==
"
gofaxAccount
"
)
{
if
(
$name
==
'
gofaxAccount
'
)
{
if
(
isset
(
$this
->
by_object
[
'mailAccount'
])
&&
$this
->
by_object
[
'mailAccount'
]
->
is_account
)
{
$obj
->
mail
=
$this
->
by_object
[
'mailAccount'
]
->
mail
;
}
}
$this
->
by_object
[
$name
]
=
$obj
;
/* Update parent in base object */
$this
->
by_object
[
'user'
]
->
parent
=
&
$this
;
}
unset
(
$obj
);
/*
Move facsimile / phone number if nessecary
*/
if
(
$this
->
las
t
=
=
"user"
&&
isset
(
$this
->
by_object
[
'gofaxAccount'
]))
{
/*
Update parent in base object
*/
$baseobject
->
paren
t
=
&
$this
;
/* Move facsimile / phone number if nessecary */
if
(
$this
->
last
==
'user'
&&
isset
(
$this
->
by_object
[
'gofaxAccount'
]))
{
/* Move number to fax plugin */
$this
->
by_object
[
'gofaxAccount'
]
->
facsimileTelephoneNumber
=
$this
->
by_object
[
'user'
]
->
facsimileTelephoneNumber
;
...
...
@@ -82,20 +80,20 @@ class usertabs extends tabs
if
(
isset
(
$this
->
by_object
[
'phoneAccount'
])
&&
!
$this
->
by_object
[
'phoneAccount'
]
->
is_account
)
{
$this
->
by_object
[
'phoneAccount'
]
->
phoneNumbers
=
array
();
if
(
$this
->
by_object
[
'user'
]
->
telephoneNumber
!=
""
)
{
if
(
$this
->
by_object
[
'user'
]
->
telephoneNumber
!=
''
)
{
$this
->
by_object
[
'phoneAccount'
]
->
phoneNumbers
[
$this
->
by_object
[
'user'
]
->
telephoneNumber
]
=
$this
->
by_object
[
'user'
]
->
telephoneNumber
;
}
}
}
/* Move number from fax plugin */
if
(
$this
->
last
==
"
gofaxAccount
"
)
{
if
(
$this
->
last
==
'
gofaxAccount
'
)
{
$this
->
by_object
[
'user'
]
->
facsimileTelephoneNumber
=
$this
->
by_object
[
'gofaxAccount'
]
->
facsimileTelephoneNumber
;
}
/* Move number from fax plugin */
if
(
$this
->
last
==
"
phoneAccount
"
&&
$this
->
by_object
[
'phoneAccount'
]
->
is_account
)
{
if
(
$this
->
last
==
'
phoneAccount
'
&&
$this
->
by_object
[
'phoneAccount'
]
->
is_account
)
{
reset
(
$this
->
by_object
[
'phoneAccount'
]
->
phoneNumbers
);
$number
=
key
(
$this
->
by_object
[
'phoneAccount'
]
->
phoneNumbers
);
...
...
@@ -113,26 +111,25 @@ class usertabs extends tabs
{
/* Check for new 'dn', in order to propagate the
'dn' to all plugins */
$baseobject
=
$this
->
by_object
[
'user'
];
$baseobject
->
update_new_dn
();
if
(
$this
->
dn
!=
'new'
)
{
$new_dn
=
$baseobject
->
new_dn
;
if
(
$this
->
dn
!=
$new_dn
)
{
$baseobject
=
$this
->
getBaseObject
();
$new_dn
=
$baseobject
->
compute_dn
();
@
DEBUG
(
DEBUG_TRACE
,
__LINE__
,
__FUNCTION__
,
__FILE__
,
$new_dn
,
'Saving'
);
/* Move ? */
if
(
$this
->
dn
!=
$new_dn
)
{
/* Write entry on new 'dn' */
if
(
$this
->
dn
!=
'new'
)
{
/* Udpate acls */
$baseobject
->
update_acls
(
$this
->
dn
,
$new_dn
);
$baseobject
->
move
(
$this
->
dn
,
$new_dn
);
$this
->
by_object
[
'user'
]
=
$baseobject
;
/* Did we change ourselves? Update ui object. */
change_ui_dn
(
$this
->
dn
,
$new_dn
);
}
/* Happen to use the new one */
$this
->
dn
=
$new_dn
;
}
$this
->
dn
=
$baseobject
->
new_dn
;
return
parent
::
save
();
}
...
...
plugins/personal/generic/class_user.inc
View file @
4ad3923c
This diff is collapsed.
Click to expand it.
Côme Chilliet
@cchilliet
mentioned in issue
#808 (closed)
·
Sep 02, 2017
mentioned in issue
#808 (closed)
mentioned in issue #808
Toggle commit list
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!
Cancel
Please
register
or
sign in
to comment