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
3ba59e98
Commit
3ba59e98
authored
8 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
Small fixes for sonarqube
parent
c3acf503
dev
6342-update-the-locales-for-1-5
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
6388-clear-the-tokens-storage-issues-into-the-fusiondirectory-configuration-backend
core-php8
master
fusiondirectory-1.5
fusiondirectory-1.4
fusiondirectory-1.3.1
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
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
contrib/smarty/plugins/function.msgPool.php
+15
-15
contrib/smarty/plugins/function.msgPool.php
include/password-methods/class_password-methods-sha.inc
+5
-11
include/password-methods/class_password-methods-sha.inc
include/password-methods/class_password-methods-ssha.inc
+14
-20
include/password-methods/class_password-methods-ssha.inc
include/simpleplugin/class_simplePlugin.inc
+6
-15
include/simpleplugin/class_simplePlugin.inc
with
40 additions
and
61 deletions
+40
-61
contrib/smarty/plugins/function.msgPool.php
+
15
−
15
View file @
3ba59e98
...
@@ -20,20 +20,20 @@
...
@@ -20,20 +20,20 @@
*/
*/
function
smarty_function_msgPool
(
$params
,
&
$smarty
)
function
smarty_function_msgPool
(
$params
,
&
$smarty
)
{
{
if
(
class_available
(
"
msgPool
"
)
&&
isset
(
$params
[
'type'
])){
if
(
class_available
(
'
msgPool
'
)
&&
isset
(
$params
[
'type'
]))
{
$parameter
=
array
();
$parameter
=
array
();
foreach
(
$params
as
$para
=>
$value
){
foreach
(
$params
as
$para
=>
$value
)
{
if
(
!
preg_match
(
"
/^type$/i
"
,
$para
)){
if
(
!
preg_match
(
'
/^type$/i
'
,
$para
))
{
$parameter
[
$para
]
=
$value
;
$parameter
[
$para
]
=
$value
;
}
}
}
}
if
(
is_callable
(
"
msgPool::
"
.
$params
[
'type'
])){
if
(
is_callable
(
'
msgPool::
'
.
$params
[
'type'
]))
{
echo
call_user_func_array
(
array
(
"
msgPool
"
,
$params
[
'type'
]),
$parameter
);
echo
call_user_func_array
(
array
(
'
msgPool
'
,
$params
[
'type'
]),
$parameter
);
}
else
{
}
else
{
trigger_error
(
"
Unknown msgPool function
"
.
$params
[
'type'
]);
trigger_error
(
'
Unknown msgPool function
'
.
$params
[
'type'
]);
}
}
}
else
{
}
else
{
trigger_error
(
"
Unknown class msgPool.
"
);
trigger_error
(
'
Unknown class msgPool.
'
);
}
}
}
}
?>
?>
This diff is collapsed.
Click to expand it.
include/password-methods/class_password-methods-sha.inc
+
5
−
11
View file @
3ba59e98
...
@@ -45,13 +45,7 @@ class passwordMethodsha extends passwordMethod
...
@@ -45,13 +45,7 @@ class passwordMethodsha extends passwordMethod
*/
*/
function
is_available
()
function
is_available
()
{
{
if
(
function_exists
(
'sha1'
))
{
return
(
function_exists
(
'sha1'
)
||
function_exists
(
'mhash'
));
return
TRUE
;
}
elseif
(
function_exists
(
'mhash'
))
{
return
TRUE
;
}
else
{
return
FALSE
;
}
}
}
/*!
/*!
...
@@ -62,11 +56,11 @@ class passwordMethodsha extends passwordMethod
...
@@ -62,11 +56,11 @@ class passwordMethodsha extends passwordMethod
function
generate_hash
(
$password
)
function
generate_hash
(
$password
)
{
{
if
(
function_exists
(
'sha1'
))
{
if
(
function_exists
(
'sha1'
))
{
$hash
=
"
{
SHA
}
"
.
base64_encode
(
pack
(
"
H*
"
,
sha1
(
$password
)));
$hash
=
'
{SHA}
'
.
base64_encode
(
pack
(
'
H*
'
,
sha1
(
$password
)));
}
elseif
(
function_exists
(
'mhash'
))
{
}
elseif
(
function_exists
(
'mhash'
))
{
$hash
=
"
{
SHA
}
"
.
base64_encode
(
mHash
(
MHASH_SHA1
,
$password
));
$hash
=
'
{SHA}
'
.
base64_encode
(
mHash
(
MHASH_SHA1
,
$password
));
}
else
{
}
else
{
msg_dialog
::
display
(
_
(
"
Configuration error
"
),
msgPool
::
missingext
(
"
mhash
"
),
ERROR_DIALOG
);
msg_dialog
::
display
(
_
(
'
Configuration error
'
),
msgPool
::
missingext
(
'
mhash
'
),
ERROR_DIALOG
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -78,7 +72,7 @@ class passwordMethodsha extends passwordMethod
...
@@ -78,7 +72,7 @@ class passwordMethodsha extends passwordMethod
*/
*/
static
function
get_hash_name
()
static
function
get_hash_name
()
{
{
return
"
sha
"
;
return
'
sha
'
;
}
}
}
}
?>
?>
This diff is collapsed.
Click to expand it.
include/password-methods/class_password-methods-ssha.inc
+
14
−
20
View file @
3ba59e98
...
@@ -45,13 +45,7 @@ class passwordMethodssha extends passwordMethod
...
@@ -45,13 +45,7 @@ class passwordMethodssha extends passwordMethod
*/
*/
function
is_available
()
function
is_available
()
{
{
if
(
function_exists
(
"sha1"
))
{
return
(
function_exists
(
'sha1'
)
||
function_exists
(
'mhash'
));
return
TRUE
;
}
elseif
(
function_exists
(
"mhash"
))
{
return
TRUE
;
}
else
{
return
FALSE
;
}
}
}
/*!
/*!
...
@@ -61,16 +55,16 @@ class passwordMethodssha extends passwordMethod
...
@@ -61,16 +55,16 @@ class passwordMethodssha extends passwordMethod
*/
*/
function
generate_hash
(
$pwd
)
function
generate_hash
(
$pwd
)
{
{
if
(
function_exists
(
"
sha1
"
))
{
if
(
function_exists
(
'
sha1
'
))
{
$salt
=
substr
(
pack
(
"
h*
"
,
md5
(
mt_rand
())),
0
,
8
);
$salt
=
substr
(
pack
(
'
h*
'
,
md5
(
mt_rand
())),
0
,
8
);
$salt
=
substr
(
pack
(
"
H*
"
,
sha1
(
$salt
.
$pwd
)),
0
,
4
);
$salt
=
substr
(
pack
(
'
H*
'
,
sha1
(
$salt
.
$pwd
)),
0
,
4
);
$pwd
=
"
{
SSHA
}
"
.
base64_encode
(
pack
(
"
H*
"
,
sha1
(
$pwd
.
$salt
))
.
$salt
);
$pwd
=
'
{SSHA}
'
.
base64_encode
(
pack
(
'
H*
'
,
sha1
(
$pwd
.
$salt
))
.
$salt
);
return
$pwd
;
return
$pwd
;
}
elseif
(
function_exists
(
"
mhash
"
))
{
}
elseif
(
function_exists
(
'
mhash
'
))
{
$salt
=
mhash_keygen_s2k
(
MHASH_SHA1
,
$pwd
,
substr
(
pack
(
"
h*
"
,
md5
(
mt_rand
())),
0
,
8
),
4
);
$salt
=
mhash_keygen_s2k
(
MHASH_SHA1
,
$pwd
,
substr
(
pack
(
'
h*
'
,
md5
(
mt_rand
())),
0
,
8
),
4
);
$pwd
=
"
{
SSHA
}
"
.
base64_encode
(
mhash
(
MHASH_SHA1
,
$pwd
.
$salt
)
.
$salt
);
$pwd
=
'
{SSHA}
'
.
base64_encode
(
mhash
(
MHASH_SHA1
,
$pwd
.
$salt
)
.
$salt
);
}
else
{
}
else
{
msg_dialog
::
display
(
_
(
"
Configuration error
"
),
msgPool
::
missingext
(
"
mhash
"
),
ERROR_DIALOG
);
msg_dialog
::
display
(
_
(
'
Configuration error
'
),
msgPool
::
missingext
(
'
mhash
'
),
ERROR_DIALOG
);
return
FALSE
;
return
FALSE
;
}
}
return
$pwd
;
return
$pwd
;
...
@@ -81,12 +75,12 @@ class passwordMethodssha extends passwordMethod
...
@@ -81,12 +75,12 @@ class passwordMethodssha extends passwordMethod
$hash
=
base64_decode
(
substr
(
$hash
,
6
));
$hash
=
base64_decode
(
substr
(
$hash
,
6
));
$salt
=
substr
(
$hash
,
20
);
$salt
=
substr
(
$hash
,
20
);
$hash
=
substr
(
$hash
,
0
,
20
);
$hash
=
substr
(
$hash
,
0
,
20
);
if
(
function_exists
(
"
sha1
"
))
{
if
(
function_exists
(
'
sha1
'
))
{
$nhash
=
pack
(
"
H*
"
,
sha1
(
$pwd
.
$salt
));
$nhash
=
pack
(
'
H*
'
,
sha1
(
$pwd
.
$salt
));
}
elseif
(
function_exists
(
"
mhash
"
))
{
}
elseif
(
function_exists
(
'
mhash
'
))
{
$nhash
=
mhash
(
MHASH_SHA1
,
$pwd
.
$salt
);
$nhash
=
mhash
(
MHASH_SHA1
,
$pwd
.
$salt
);
}
else
{
}
else
{
msg_dialog
::
display
(
_
(
"
Configuration error
"
),
msgPool
::
missingext
(
"
mhash
"
),
ERROR_DIALOG
);
msg_dialog
::
display
(
_
(
'
Configuration error
'
),
msgPool
::
missingext
(
'
mhash
'
),
ERROR_DIALOG
);
return
FALSE
;
return
FALSE
;
}
}
return
(
$nhash
==
$hash
);
return
(
$nhash
==
$hash
);
...
@@ -97,7 +91,7 @@ class passwordMethodssha extends passwordMethod
...
@@ -97,7 +91,7 @@ class passwordMethodssha extends passwordMethod
*/
*/
static
function
get_hash_name
()
static
function
get_hash_name
()
{
{
return
"
ssha
"
;
return
'
ssha
'
;
}
}
}
}
?>
?>
This diff is collapsed.
Click to expand it.
include/simpleplugin/class_simplePlugin.inc
+
6
−
15
View file @
3ba59e98
...
@@ -920,21 +920,12 @@ class simplePlugin extends plugin
...
@@ -920,21 +920,12 @@ class simplePlugin extends plugin
$infos
=
pluglist
::
pluginInfos
(
$tabclass
);
$infos
=
pluglist
::
pluginInfos
(
$tabclass
);
foreach
(
$infos
[
'plForeignRefs'
]
as
$field
=>
$refs
)
{
foreach
(
$infos
[
'plForeignRefs'
]
as
$field
=>
$refs
)
{
if
(
preg_match
(
'/^handle_/'
,
$mode
))
{
if
(
preg_match
(
'/^handle_/'
,
$mode
))
{
if
(
$newdn
!==
NULL
)
{
if
((
$newdn
!==
NULL
)
&&
(
$field
!=
'dn'
)
&&
(
$mode
==
'handle_move'
))
{
// Move action
// Move action, ignore other fields than dn
if
((
$field
!=
'dn'
)
&&
(
$mode
==
'handle_move'
))
{
continue
;
// We only change dn
}
elseif
((
$newdn
===
NULL
)
&&
(
$olddn
===
NULL
)
&&
((
$field
==
'dn'
)
||
(
!
$this
->
attributeHaveChanged
(
$field
))))
{
continue
;
// Edit action, ignore dn changes or attributes which did not change
}
continue
;
}
elseif
(
$olddn
===
NULL
)
{
// Edit action
if
(
$field
==
'dn'
)
{
// dn did not change
continue
;
}
elseif
(
!
$this
->
attributeHaveChanged
(
$field
))
{
// only look at changed attributes
continue
;
}
}
}
// else = delete action, all fields are concerned, nothing to do here
// else = delete action, all fields are concerned, nothing to do here
}
}
...
...
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