|
|
@@ -26,7 +26,7 @@ require_once("api/Zm/Domain.php");
|
|
|
require_once("api/Zm/Server.php");
|
|
|
|
|
|
/**
|
|
|
- * Helper function to find values of a named key in a multidimensional arrays
|
|
|
+ * Helper function to find values of a named key in a multidimensional arrays or objects
|
|
|
*
|
|
|
* @param array $haystack mixed data
|
|
|
* @param string $needle key to search for values
|
|
|
@@ -48,48 +48,6 @@ function recursiveFindAll($haystack, $needle)
|
|
|
return $values;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * Helper function to check a password strength
|
|
|
- *
|
|
|
- * @param string $pwd password to check
|
|
|
- * @return string $message what is missing in the password (empty if it is okay)
|
|
|
- */
|
|
|
-function zimbraSingleCheckPassword($pwd)
|
|
|
-{
|
|
|
- $message = '';
|
|
|
- if (strlen($pwd) < 8) {
|
|
|
- $message .= "Das das Passwort ist zu kurz. Es werden mind. 8 Zeichen benötigt" . PHP_EOL;
|
|
|
- }
|
|
|
- if (!preg_match("#[0-9]+#", $pwd)) {
|
|
|
- $message .= "Das Passwort muss mindestens eine Zahl enthalten" . PHP_EOL;
|
|
|
- }
|
|
|
- if (!preg_match("#[A-Z]+#", $pwd)) {
|
|
|
- $message .= "Das Passwort muss mindestens einen Grossbuchstaben (A-Z) enthalten" . PHP_EOL;
|
|
|
- }
|
|
|
- if (!preg_match("#[a-z]+#", $pwd)) {
|
|
|
- $message .= "Das Passwort muss mindestens einen Kleinbuchstaben (a-z) enthalten" . PHP_EOL;
|
|
|
- }
|
|
|
- if (!preg_match("#[^\w]+#", $pwd)) {
|
|
|
- $message .= "Das Passwort muss mindestens ein Sonderzeichen (.,-:=) enthalten" . PHP_EOL;
|
|
|
- }
|
|
|
- return $message;
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * Convert raw byte value to human readable
|
|
|
- *
|
|
|
- * Helper function to convert byte in huam readable format
|
|
|
- *
|
|
|
- * @param int $bytes value in bytes
|
|
|
- * @return string value rounded and in human readable units
|
|
|
- */
|
|
|
-function bytesToHuman($bytes)
|
|
|
-{
|
|
|
- $units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
|
- for ($i = 0; $bytes > 1024; $i++) $bytes /= 1024;
|
|
|
- return round($bytes, 2) . ' ' . $units[$i];
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* Define module related meta data.
|
|
|
*
|