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
Commits
1d9b3a3f
Verified
Commit
1d9b3a3f
authored
6 months ago
by
dockx thibault
Browse files
Options
Download
Patches
Plain Diff
(CORE) - simplePlugin refactor
refactor
parent
8761a6cd
dev
6344-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen
6365-core-locking-mechanism-is-not-changing-the-mail-ressource-it-does-lock-the-mail-account
6365-core-when-lock-mechanism-is-trigger-the-user-should-not-be-editable-if-not-unlock
6378-orcid-test-method-is-wrong-and-break-orcid-saving
core-php8
master
fusiondirectory-1.5
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/simpleplugin/class_simplePlugin.inc
+5
-48
include/simpleplugin/class_simplePlugin.inc
with
5 additions
and
48 deletions
+5
-48
include/simpleplugin/class_simplePlugin.inc
+
5
−
48
View file @
1d9b3a3f
...
@@ -50,9 +50,9 @@ class simplePlugin implements SimpleTab
...
@@ -50,9 +50,9 @@ class simplePlugin implements SimpleTab
\sa simplePlugin::is_this_account()
\sa simplePlugin::is_this_account()
*/
*/
public
$is_account
=
FALSE
;
public
$is_account
=
FALSE
;
public
$initially_was_account
=
FALSE
;
public
$initially_was_account
=
FALSE
;
protected
$ignore_account
=
FALSE
;
protected
$ignore_account
=
FALSE
;
public
$acl_category
=
''
;
public
$acl_category
=
''
;
...
@@ -1511,53 +1511,10 @@ class simplePlugin implements SimpleTab
...
@@ -1511,53 +1511,10 @@ class simplePlugin implements SimpleTab
private
function
getModifiedAttributesValues
():
array
private
function
getModifiedAttributesValues
():
array
{
{
// // Initialize variables
// Initialize result array
// $result = [];
// $differentValues = [];
//
// // Grab the common attributes name between before and after modification, resulting in only modified attributes.
// $commonKeys = array_intersect_key($this->attrs, $this->beforeLdapChangeAttributes);
//
// // Create for each common key a separation between old and new value
// foreach ($commonKeys as $key => $value) {
// if ($this->attrs[$key] !== $this->beforeLdapChangeAttributes[$key]) {
// $differentValues[$key] = [
// 'new' => $this->attrs[$key],
// 'old' => $this->beforeLdapChangeAttributes[$key]
// ];
// }
// }
//
// // Iterate through each main key (e.g., 'supannRessourceEtat', 'anotherKey')
// foreach ($differentValues as $key => $values) {
// // Ensure both 'new' and 'old' arrays are present under the current key
// if (isset($values['new']) && isset($values['old'])) {
//
// // Get the 'new' and 'old' values
// $newValues = $values['new'];
// $oldValues = $values['old'];
//
// // Create an associative array for old values for easier lookup
// $oldValuesAssoc = array_flip($oldValues);
// // Initialize an empty array for this specific key's differences (key being values now).
// $result[$key] = [];
//
// // Iterate through new values and check for differences
// foreach ($newValues as $newValue) {
// if (!isset($oldValuesAssoc[$newValue])) {
// $result[$key][] = $newValue; // Add differing values to result
// }
// }
// }
// }
//
// return $result;
// Initialize result array
$result
=
[];
$result
=
[];
// Find common keys between
current
attributes and
before-change
attributes
// Find common keys between
old
attributes and
modified
attributes
.
$commonKeys
=
array_intersect_key
(
$this
->
attrs
,
$this
->
beforeLdapChangeAttributes
);
$commonKeys
=
array_intersect_key
(
$this
->
attrs
,
$this
->
beforeLdapChangeAttributes
);
// Iterate over each common key
// Iterate over each common key
...
...
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