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
fusiondirectory
fusiondirectory-plugins
Commits
a44509a5
Verified
Commit
a44509a5
authored
6 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
feat(audit,posix) Moved DateAttributes subclasses to core
issue #5927
parent
cf39628e
dev
6104-mail-methods-refactor
6231-give-the-ability-to-the-webservice-to-notice-if-an-attribute-is-monovalued-or-multivalued
6237-add-requiredattrs-array-to-the-webservice-informations
6245-adapt-the-ci-to-the-reorganisation-of-the-dev-tools-and-fixing-the-trigger-downstream-pipelines
6250-supann-configuration-backend-requires-account-life-cycle-section
6280-plugins-update-plugins-to-take-into-consideration-the-new-directory-of-core-structure
6310-tasks-reminder-error-in-the-schema-duplicate-attribute-id
6311-put-the-version-1-5-in-all-yaml-for-fusiondirectory-1-5
6322-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen-2
6332-zimbra-allows-update-of-data-for-unknown-domain-name-for-specific-individual-aliases
6337-webservice-issue-with-archiving-post-request-not-responding-but-successfully-archiving-user
6341-supann-extract-resources-states-sub-states-from-backend-configuration-to-their-own-objects
master
fusiondirectory-1.5
fusiondirectory-1.4
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
audit/admin/audit/class_auditEvent.inc
+0
-15
audit/admin/audit/class_auditEvent.inc
posix/personal/posix/class_posixAccount.inc
+2
-45
posix/personal/posix/class_posixAccount.inc
with
2 additions
and
60 deletions
+2
-60
audit/admin/audit/class_auditEvent.inc
+
0
−
15
View file @
a44509a5
...
@@ -19,21 +19,6 @@
...
@@ -19,21 +19,6 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
*/
class
GeneralizedTimeDisplayAttribute
extends
GeneralizedTimeDateAttribute
{
function
getValue
()
{
return
$this
->
computeLdapValue
();
}
function
renderFormInput
()
{
$date
=
$this
->
getDateValue
();
$date
->
setTimezone
(
timezone
::
getDefaultTimeZone
());
return
htmlentities
(
$date
->
format
(
'Y-m-d, H:i:s'
),
ENT_COMPAT
,
'UTF-8'
);
}
}
class
auditEvent
extends
simplePlugin
class
auditEvent
extends
simplePlugin
{
{
public
$base
;
public
$base
;
...
...
This diff is collapsed.
Click to expand it.
posix/personal/posix/class_posixAccount.inc
+
2
−
45
View file @
a44509a5
<?php
<?php
/*
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003 Cajus Pollmeier
Copyright (C) 2003 Cajus Pollmeier
Copyright (C) 2011-201
6
FusionDirectory
Copyright (C) 2011-201
9
FusionDirectory
This program is free software; you can redistribute it and/or modify
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
it under the terms of the GNU General Public License as published by
...
@@ -30,50 +31,6 @@
...
@@ -30,50 +31,6 @@
does syntax checking and displays the formulars required.
does syntax checking and displays the formulars required.
*/
*/
class
EpochDaysDateAttribute
extends
DateAttribute
{
/* 24 * 60 * 60 = 86400 */
public
static
$secondsPerDay
=
86400
;
function
__construct
(
$label
,
$description
,
$ldapName
,
$required
,
$defaultValue
=
'now'
,
$defaultDate
=
NULL
,
$acl
=
''
)
{
parent
::
__construct
(
$label
,
$description
,
$ldapName
,
$required
,
''
,
$defaultValue
,
$defaultDate
,
$acl
);
}
protected
function
ldapToDate
(
$ldapValue
)
{
$date
=
DateTime
::
createFromFormat
(
'U'
,
$ldapValue
*
static
::
$secondsPerDay
,
timezone
::
utc
());
if
(
$date
!==
FALSE
)
{
return
$date
;
}
else
{
trigger_error
(
'LDAP value for '
.
$this
->
getLdapName
()
.
' was not in the right date format.'
);
return
new
DateTime
(
$ldapValue
,
timezone
::
utc
());
}
}
protected
function
dateToLdap
(
DateTime
$dateValue
)
{
return
floor
(
$dateValue
->
format
(
'U'
)
/
static
::
$secondsPerDay
);
}
function
getEpochDays
()
{
if
(
empty
(
$this
->
value
))
{
return
0
;
}
else
{
try
{
return
$this
->
dateToLdap
(
$this
->
getDateValue
());
}
catch
(
Exception
$e
)
{
if
(
is_object
(
$this
->
plugin
)
&&
$this
->
plugin
->
is_template
)
{
return
$this
->
value
;
}
else
{
throw
$e
;
}
}
}
}
}
class
posixAccount
extends
simplePlugin
class
posixAccount
extends
simplePlugin
{
{
var
$displayHeader
=
TRUE
;
var
$displayHeader
=
TRUE
;
...
...
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