28 require_once(
'variables.inc');
32 require_once(
'functions_debug.inc');
33 require_once(
'accept-to-gettext.inc');
46 global $class_mapping, $BASE_DIR, $config;
48 if ($class_mapping === NULL) {
49 if (isset($config) && is_object($config) &&
50 $config->get_cfg_value(
'displayerrors') ==
'TRUE') {
51 list($trace, ) = html_trace();
55 echo sprintf(_(
"Fatal error: no class locations defined - please run '%s' to fix this"),
"<b>fusiondirectory-configuration-manager --update-cache</b>");
60 if (strpos($class_name,
'Smarty_') === 0) {
64 if (strpos($class_name,
'FusionDirectory\\') === 0) {
65 $class_name = preg_replace(
'/^.+\\\\([^\\\\]+)$/',
'\\1',
"$class_name");
68 if (isset($class_mapping[
"$class_name"])) {
69 require_once($BASE_DIR.
'/'.$class_mapping[
"$class_name"]);
71 logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $class_name,
'Could not load');
72 if (isset($config) && is_object($config) &&
73 $config->get_cfg_value(
'displayerrors') ==
'TRUE') {
74 list($trace, ) = html_trace();
78 echo sprintf(_(
"Fatal error: cannot instantiate class '%s' - try running '%s' to fix this"), $class_name,
"<b>fusiondirectory-configuration-manager --update-cache</b>");
82 spl_autoload_register(
'fusiondirectory_autoload');
94 global $class_mapping;
95 return isset($class_mapping[$name]);
110 global $class_mapping, $BASE_DIR;
112 if (!isset($class_mapping[$plugin])) {
115 return is_readable($BASE_DIR.
'/'.$class_mapping[$plugin]);
141 function DEBUG ($level, $line, $function, $file, $data, $info =
'')
151 return sprintf(
htmlescape(_(
'%s 2002-%d %sThe FusionDirectory team, %s%s')),
'©', date(
'Y'),
'<a href="http://www.fusiondirectory.org">',
FD_VERSION,
'</a>');
176 global $config, $BASE_DIR;
177 $default_theme =
'breezy';
180 if (isset($config)) {
181 $theme = $config->get_cfg_value(
'theme', $default_theme);
183 $theme = $default_theme;
187 if ($filename ==
'') {
188 return "themes/$theme/";
195 $nf = preg_replace(
'!^'.$BASE_DIR.
'/!',
'', preg_replace(
'/^\.\.\//',
'', $path));
197 $nf = preg_replace(
'!^'.$BASE_DIR.
'/!',
'', $path);
200 "$BASE_DIR/ihtml/themes/$theme/$nf/$filename",
201 "$BASE_DIR/ihtml/themes/$default_theme/$nf/$filename",
202 "$BASE_DIR/ihtml/themes/default/$nf/$filename",
207 "themes/$theme/$filename",
208 "$BASE_DIR/ihtml/themes/$theme/$filename",
209 "themes/$default_theme/$filename",
210 "$BASE_DIR/ihtml/themes/$default_theme/$filename",
211 "themes/default/$filename",
212 "$BASE_DIR/ihtml/themes/default/$filename",
217 foreach ($paths as $path) {
218 if (file_exists($path)) {
241 return array_values(array_udiff($haystack, $needles,
'array_cmp_recursive'));
260 return array_values(array_udiff($haystack, $needles,
'strcasecmp'));
277 return array_values(array_unique(array_merge($ar1, $ar2)));
293 $username =
'[unauthenticated]';
297 if ($ui->uid !=
'') {
298 $username =
'['.$ui->uid.
']';
300 $username =
'[unknown]';
304 syslog(LOG_INFO,
"FusionDirectory $username: $message");
354 $base = $config->current[
'BASE'];
359 $dn = preg_replace(
'/'.preg_quote($base,
'/').
"$/i",
'', $dn);
365 foreach (explode(
',', $dn) as $rdn) {
366 $dep = preg_replace(
"/^[^=]+=/",
'', $rdn).
'/'.$dep;
370 return trim($dep,
'/');
396 'fusiondirectoryRDN' =>
'ou=fusiondirectory,',
397 'lockRDN' =>
'ou=locks,',
398 'recoveryTokenRDN' =>
'ou=recovery,',
399 'reminderTokenRDN' =>
'ou=reminder,',
400 'roleRDN' =>
'ou=roles,',
401 'ogroupRDN' =>
'ou=groups,',
402 'applicationRDN' =>
'ou=apps,',
403 'systemRDN' =>
'ou=systems,',
404 'serverRDN' =>
'ou=servers,ou=systems,',
405 'terminalRDN' =>
'ou=terminals,ou=systems,',
406 'workstationRDN' =>
'ou=workstations,ou=systems,',
407 'printerRDN' =>
'ou=printers,ou=systems,',
408 'phoneRDN' =>
'ou=phones,ou=systems,',
409 'componentRDN' =>
'ou=netdevices,ou=systems,',
410 'mobilePhoneRDN' =>
'ou=mobile,ou=systems,',
412 'inventoryRDN' =>
'ou=inventory,',
414 'ipmiRDN' =>
'ou=ipmi,',
416 'faxBlocklistRDN' =>
'ou=gofax,ou=systems,',
417 'aclRoleRDN' =>
'ou=aclroles,',
418 'phoneMacroRDN' =>
'ou=macros,ou=asterisk,ou=configs,ou=systems,',
419 'phoneConferenceRDN' =>
'ou=conferences,ou=asterisk,ou=configs,ou=systems,',
421 'faiBaseRDN' =>
'ou=fai,ou=configs,ou=systems,',
422 'faiScriptRDN' =>
'ou=scripts,',
423 'faiHookRDN' =>
'ou=hooks,',
424 'faiTemplateRDN' =>
'ou=templates,',
425 'faiVariableRDN' =>
'ou=variables,',
426 'faiProfileRDN' =>
'ou=profiles,',
427 'faiPackageRDN' =>
'ou=packages,',
428 'faiPartitionRDN' =>
'ou=disk,',
430 'debconfRDN' =>
'ou=debconf,',
432 'supannStructuresRDN' =>
'ou=structures,',
434 'sudoRDN' =>
'ou=sudoers,',
436 'netgroupRDN' =>
'ou=netgroup,',
438 'deviceRDN' =>
'ou=devices,',
440 'aliasRDN' =>
'ou=alias,',
442 'dsaRDN' =>
'ou=dsa,',
444 'mimetypeRDN' =>
'ou=mime,' 448 if ($config->get_cfg_value($name,
'_not_set_') !=
'_not_set_') {
449 $ou = $config->get_cfg_value($name);
450 } elseif (isset($map[$name])) {
457 if (!preg_match(
'/^[^=]+=[^=]+/', $ou)) {
463 if (preg_match(
'/'.preg_quote($config->current[
'BASE'],
'/').
'$/', $ou)) {
466 if (preg_match(
'/,$/', $ou)) {
505 $base = preg_replace($pattern,
'', $dn);
508 $departmentInfo = $config->getDepartmentInfo();
509 if (!isset($departmentInfo[$base])) {
510 $base = $config->current[
'BASE'];
530 if (isset($config)) {
531 return ($config->get_cfg_value(
'strictNamingRules') ==
'TRUE');
552 if (is_array($value)) {
554 foreach ($value as $line) {
555 $ret .= $line.
"<br>\n";
598 foreach ($REWRITE as $key => $val) {
599 $s = str_replace($key, $val, $s);
620 if (
get_ou(
'groupRDN') !=
'') {
621 $dn = preg_replace(
'/,'.
get_ou(
'groupRDN').
'/i',
',', $dn);
624 $dn = preg_replace(
"/,$ou/i",
',', $dn);
627 return preg_replace(
'/^[^,]+,/i',
'', $dn);
642 $cmd = preg_replace(
"/ .*$/",
'', $cmdline);
645 if (!file_exists($cmd)) {
650 if (!is_executable($cmd)) {
667 if (!preg_match(
'/^([0-9]+\.){3}[0-9]+$/', $netmask)) {
668 $num = (int)($netmask);
671 for ($byte = 0; $byte < 4; $byte++) {
674 for ($i = 7; $i >= 0; $i--) {
680 $netmask .= $result.
".";
683 return preg_replace(
'/\.$/',
'', $netmask);
716 $nm = explode(
'.', $netmask, 4);
719 for ($n = 0; $n < 4; $n++) {
722 for ($i = 0; $i < 8; $i++) {
723 if ($start == (
int)($nm[$n])) {
748 $value = strtolower(trim($value));
750 if (!is_numeric(substr($value, -1))) {
751 switch (substr($value, -1)) {
765 return $mult * (int)substr($value, 0, -1);
794 return sprintf($format[0],
'0');
796 $base = log($bytes) / log(1024);
798 return sprintf($format[floor($base)], round(1024 ** ($base - floor($base)), $precision));
816 return preg_grep(
'/^'.preg_quote($value,
'/').
'$/i', $items);
828 return strip_tags(str_replace(
'\0',
'', $string));
844 $dir = opendir($path);
845 while ($entry = readdir($dir)) {
846 if (is_file($path.
"/".$entry) || ((!$followLinks) && is_link($path.
"/".$entry))) {
847 unlink($path.
"/".$entry);
848 } elseif (is_dir($path.
"/".$entry) && ($entry !=
'.') && ($entry !=
'..')) {
875 if (is_dir($path) && is_readable($path)) {
879 $dir = opendir($path);
883 while ($fp = readdir($dir)) {
893 $ret = array_reverse($ret);
907 if (is_dir($directory) && is_readable($directory)) {
909 $revision_file = $directory.
"/REVISION";
912 if (file_exists($revision_file)) {
918 if (($file ==
'.') || ($file ==
'..')) {
921 if (is_file($directory.
'/'.$file) && !unlink($directory.
'/'.$file)) {
924 _(
'File "%s" could not be deleted. Try "fusiondirectory-configuration-manager --check-directories" to fix permissions.'),
936 if (!file_exists($revision_file)) {
958 if (is_dir(dirname($revision_file)) && is_writable(dirname($revision_file))) {
959 $fh = fopenWithErrorHandling($revision_file,
'w');
962 htmlescape(_(
'Cannot write to revision file:')).
'<br/>'.
965 array_map(
'htmlescape', $fh)
971 if (fwrite($fh, $revision)) {
1001 if (file_exists($revision_file) && is_readable($revision_file)) {
1003 $fh = fopenWithErrorHandling($revision_file,
'r');
1004 if (is_array($fh)) {
1006 htmlescape(_(
'Cannot read revision file:')).
'<br/>'.
1009 array_map(
'htmlescape', $fh)
1015 if ($revision == fread($fh, filesize($revision_file))) {
1047 $tmp = array_change_key_case($items, CASE_LOWER);
1048 $ikey = strtolower($ikey);
1049 if (isset($tmp[$ikey])) {
1069 if (count($src) != count($dst)) {
1073 return (count(array_diff($src, $dst)) != 0);
1101 if (is_array($src)) {
1102 if (!is_array($dst)) {
1105 if (count($src) != count($dst)) {
1106 return count($src) - count($dst);
1108 foreach ($src as $key => $value) {
1109 if (!isset($dst[$key])) {
1118 return strcmp($src, $dst);
1129 trigger_error(
'deprecated, use ldap_escape_f');
1130 return addcslashes($input,
'*()\\/');
1143 $ldapObj =
new LDAP($cfg[
'admin'], $cfg[
'password'], $cfg[
'connection'], FALSE, $cfg[
'tls']);
1145 $objectclasses = $ldap->get_objectclasses(TRUE);
1146 if (count($objectclasses) == 0) {
1148 $warning->display();
1156 'SCHEMA_FILE' =>
'',
1157 'CLASSES_REQUIRED' => [],
1159 'IS_MUST_HAVE' => FALSE,
1167 $checks[
'core-fd'] = $def_check;
1169 $checks[
'core-fd'][
'SCHEMA_FILE'] =
'core-fd.schema';
1170 $checks[
'core-fd'][
'CLASSES_REQUIRED'] = [
'fdLockEntry'];
1171 $checks[
'core-fd'][
'IS_MUST_HAVE'] = TRUE;
1172 $checks[
'core-fd'][
'INFO'] = _(
'Main FusionDirectory schema');
1175 $checks[
'core-fd-conf'] = $def_check;
1177 $checks[
'core-fd-conf'][
'SCHEMA_FILE'] =
'core-fd-conf.schema';
1178 $checks[
'core-fd-conf'][
'CLASSES_REQUIRED'] = [
'fusionDirectoryConf'];
1179 $checks[
'core-fd-conf'][
'IS_MUST_HAVE'] = TRUE;
1180 $checks[
'core-fd-conf'][
'INFO'] = _(
'Schema used to store FusionDirectory configuration');
1183 $checks[
'ldapns'] = $def_check;
1185 $checks[
'ldapns'][
'SCHEMA_FILE'] =
'ldapns.schema';
1186 $checks[
'ldapns'][
'CLASSES_REQUIRED'] = [
'hostObject'];
1187 $checks[
'ldapns'][
'IS_MUST_HAVE'] = FALSE;
1188 $checks[
'ldapns'][
'INFO'] = _(
'Used to store trust mode information in users or groups.');
1191 $checks[
'template-fd'] = $def_check;
1193 $checks[
'template-fd'][
'SCHEMA_FILE'] =
'template-fd.schema';
1194 $checks[
'template-fd'][
'CLASSES_REQUIRED'] = [
'fdTemplate'];
1195 $checks[
'template-fd'][
'IS_MUST_HAVE'] = FALSE;
1196 $checks[
'template-fd'][
'INFO'] = _(
'Used to store templates.');
1200 $checks[
'nis'] = $def_check;
1202 $checks[
'nis'][
'SCHEMA_FILE'] =
'nis.schema';
1203 $checks[
'nis'][
'CLASSES_REQUIRED'] = [
'posixAccount'];
1204 $checks[
'nis'][
'IS_MUST_HAVE'] = FALSE;
1205 $checks[
'nis'][
'INFO'] = _(
'Used to store POSIX information.');
1208 foreach ($checks as $name => $value) {
1209 foreach ($value[
'CLASSES_REQUIRED'] as $class) {
1210 if (!isset($objectclasses[$class])) {
1211 $checks[$name][
'STATUS'] = FALSE;
1212 if ($value[
'IS_MUST_HAVE']) {
1213 $checks[$name][
'MSG'] = sprintf(_(
'Missing required object class "%s"!'), $class);
1215 $checks[$name][
'MSG'] = sprintf(_(
'Missing optional object class "%s"!'), $class);
1218 $checks[$name][
'STATUS'] = TRUE;
1219 $checks[$name][
'MSG'] = sprintf(_(
'Class(es) available'));
1224 $checks[
'posixGroup'] = $def_check;
1226 $checks[
'posixGroup'][
'SCHEMA_FILE'] =
'nis.schema';
1227 $checks[
'posixGroup'][
'CLASSES_REQUIRED'] = [
'posixGroup'];
1228 $checks[
'posixGroup'][
'STATUS'] = TRUE;
1229 $checks[
'posixGroup'][
'MSG'] =
'';
1230 $checks[
'posixGroup'][
'INFO'] =
'';
1232 if (isset($objectclasses[
'posixGroup'])) {
1233 $checks[
'posixGroup'][
'IS_MUST_HAVE'] = TRUE;
1236 if (
class_available(
'mixedGroup') && isset($objectclasses[
'posixGroup'][
'STRUCTURAL'])) {
1237 $checks[
'posixGroup'][
'STATUS'] = FALSE;
1238 $checks[
'posixGroup'][
'MSG'] = _(
'You have installed the mixed groups plugin, but your schema configuration does not support this.');
1239 $checks[
'posixGroup'][
'INFO'] = _(
'In order to use mixed groups the objectClass "posixGroup" must be AUXILIARY');
1240 } elseif (!
class_available(
'mixedGroup') && !isset($objectclasses[
'posixGroup'][
'STRUCTURAL'])) {
1241 $checks[
'posixGroup'][
'STATUS'] = FALSE;
1242 $checks[
'posixGroup'][
'MSG'] = _(
'Your schema is configured to support mixed groups, but this plugin is not present.');
1243 $checks[
'posixGroup'][
'INFO'] = _(
'The objectClass "posixGroup" must be STRUCTURAL');
1263 if (!isset($_POST[$name])) {
1264 trigger_error(
"Requested POST value (".$name.
") does not exists, you should add a check to prevent this message.");
1276 global $class_mapping;
1277 if (isset($class_mapping) && is_array($class_mapping)) {
1278 foreach (array_keys($class_mapping) as $class) {
1279 if (preg_match(
"/^".$cls.
"$/i", $class)) {
1305 $userTab = $userTabs->getBaseObject();
1306 $userTab->userPassword = [
1310 $userTab->userPassword,
1311 $userTab->attributesAccess[
'userPassword']->isLocked()
1313 $userTabs->update();
1314 $error = $userTabs->save();
1315 if (!empty($error)) {
1337 if (empty($dn) || !is_object($config)) {
1342 $attr = $config->get_cfg_value(
'modificationDetectionAttribute');
1344 $ldap = $config->get_ldap_link();
1345 $ldap->cat($dn, [$attr]);
1346 $attrs = $ldap->fetch();
1347 if (isset($attrs[$attr][0])) {
1348 return $attrs[$attr][0];
1365 header(
"Expires: Mon, 26 Jul 1997 05:00:00 GMT");
1366 header(
"Last-Modified: ".gmdate(
"D, d M Y H:i:s").
" GMT");
1367 header(
"Cache-Control: no-cache");
1368 header(
"Pragma: no-cache");
1369 header(
"Cache-Control: post-check=0, pre-check=0");
1370 header(
"Content-type: ".$type);
1373 if (preg_match(
"/\//", $name)) {
1374 $name = basename($name);
1378 header(
'Content-Disposition: attachment; filename="'.$name.
'"');
1396 if (is_string($str)) {
1397 return htmlspecialchars($str, ENT_QUOTES);
1398 } elseif (is_array($str)) {
1399 foreach ($str as $name => $value) {
1411 $randno = rand(0, 63);
1414 return chr($randno + 46);
1415 } elseif ($randno < 38) {
1417 return chr($randno + 53);
1420 return chr($randno + 59);
1434 $input = pack(
'H*', $input);
1435 if (substr($input, 0, 8) !=
'Salted__') {
1438 $salt = substr($input, 8, 8);
1439 $input = substr($input, 16);
1442 $iv_len = openssl_cipher_iv_length(
'aes-256-cbc');
1446 while (strlen($data) < $key_len + $iv_len) {
1447 $d = md5($d . $password . $salt, TRUE);
1450 $key = substr($data, 0, $key_len);
1451 $iv = substr($data, $key_len, $iv_len);
1453 return openssl_decrypt($input,
'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv);
1469 $net = ip2long($net);
1470 $mask = ip2long($mask);
1473 return (($ip & $mask) == $net);
1481 $hex = unpack(
'H*hex', inet_pton($ip));
1482 return substr(preg_replace(
'/([A-f0-9]{4})/',
"$1:", $hex[
'hex']), 0, -1);
1486 function mark ($needle, $haystack)
1490 while (preg_match(
'/^(.*)('.preg_quote($needle).
')(.*)$/i', $haystack, $matches)) {
1491 $result .= $matches[1].
'<span class="mark">'.$matches[2].
'</span>';
1492 $haystack = $matches[3];
1495 return $result.$haystack;
1498 function reset_errors ()
1503 function load_all_classes ()
1505 global $BASE_DIR, $class_list, $class_mapping;
1507 $class_list = get_declared_classes();
1508 foreach ($class_mapping as $class => $path) {
1509 if (!in_array($class, $class_list)) {
1510 if (is_readable(
"$BASE_DIR/$path")) {
1511 require_once(
"$BASE_DIR/$path");
1515 htmlescape(_(
'Cannot locate file "%s" - please run "%s" to fix this')),
1517 '<b>fusiondirectory-configuration-manager --update-cache</b>' 1525 function ldap_escape_f ($str, $ignore =
'')
1527 return ldap_escape($str, $ignore, LDAP_ESCAPE_FILTER);
1530 function ldap_escape_dn ($str, $ignore =
'')
1532 return ldap_escape($str, $ignore, LDAP_ESCAPE_DN);
1535 function mail_utf8 ($to, $from_user, $from_email, $subject, $message, $replyto_user = NULL, $replyto_email = NULL, $type =
'plain')
1537 $subject =
"=?UTF-8?B?".base64_encode($subject).
"?=";
1539 if ($replyto_user === NULL) {
1540 $replyto_user = $from_user;
1543 if ($replyto_email === NULL) {
1544 $replyto_email = $from_email;
1548 $from_user =
"=?UTF-8?B?".base64_encode($from_user).
"?=";
1549 $headers =
"From: $from_user <$from_email>\r\n";
1551 $headers =
"From: <$from_email>\r\n";
1554 if ($replyto_email) {
1555 if ($replyto_user) {
1556 $replyto_user =
"=?UTF-8?B?".base64_encode($replyto_user).
"?=";
1557 $headers .=
"Reply-To: $replyto_user <$replyto_email>\r\n";
1559 $headers .=
"Reply-To: <$replyto_email>\r\n";
1563 $headers .=
"MIME-Version: 1.0" .
"\r\n" .
1564 "Content-type: text/$type; charset=UTF-8" .
"\r\n";
1566 $additional_parameters =
"-f".$from_email;
1568 return mail($to, $subject, $message, $headers, $additional_parameters);
1572 function fopenWithErrorHandling (...$args)
1576 function (
int $errno,
string $errstr,
string $errfile,
int $errline, array $errcontext) use (&$errors):
bool 1578 $errors[] = $errstr;
1583 $fh = @fopen(...$args);
1584 restore_error_handler();
1585 if ($fh !== FALSE) {
1592 if (!function_exists(
'mb_substr_replace')) {
1594 function mb_substr_replace (
string $string,
string $replacement, $start, $length = NULL, $encoding = NULL)
1596 if ($encoding === NULL) {
1597 $encoding = mb_internal_encoding();
1599 if ($length === NULL) {
1600 return mb_substr($string, 0, $start, $encoding).
1603 return mb_substr($string, 0, $start, $encoding).
1605 mb_substr($string, $start + $length, NULL, $encoding);
const CACHE_DIR
Global cache dir.
cred_decrypt($input, $password)
Decrypt a string with RIJNDAEL_128.
get_random_char()
Returns a random char.
const FD_VERSION
FusionDirectory Version.
rmdirRecursive($path, $followLinks=FALSE)
Recursively delete a path in the file system.
htmlescape(string $str)
Escape string for HTML output.
const CLASS_CACHE
name of the class.cache file
in_array_ics($value, array $items)
Check if a value exists in an array (case-insensitive)
getEntryCSN(string $dn)
Get the Change Sequence Number of a certain DN.
normalize_netmask($netmask)
Put netmask in n.n.n.n format.
array_differs_recursive($src, $dst)
get_ou($name)
Get the OU of a certain RDN.
compare_revision($revision_file, $revision)
Compare the revision file.
get_template_path($filename='', $plugin=FALSE, $path='')
Return themed path for specified base file.
static get($name)
Accessor of a session var.
scan_directory($path, $sort_desc=FALSE)
Get directory content information.
send_binary_content($data, $name, $type="application/octet-stream")
Initialize a file download with given content, name and data type.
& get_userinfo()
Return the current userinfo object.
fusiondirectory_log($message)
Generate a system log info.
fusiondirectory_autoload($class_name)
Does autoloading for classes used in FusionDirectory.
get_correct_class_name($cls)
Return class name in correct case.
static set($name, $value)
Set a value in a session.
get_base_from_people($dn)
Return a base from a given user DN.
array_cmp_recursive($src, $dst)
check_schema(array $cfg)
Check if LDAP schema matches the requirements.
& get_smarty()
Get global smarty object.
copynotice()
Return HTML safe copyright notice.
isIpInNet($ip, $net, $mask)
Test if an ip is the network range.
netmask_to_bits($netmask)
Return the number of set bits in the netmask.
static open(string $dn, string $type)
Create the tab object for the given dn.
static debug(int $level, int $line, string $function, string $file, $data, string $info='')
Debug output method.
Parent class for all exceptions thrown in FusionDirectory.
array_differs(array $src, array $dst)
to_string($value)
Return a string/HTML representation of an array.
dn2base($dn, $ou=NULL)
Return the base of a given DN.
change_password($dn, $password, $hash="")
Change the password of a given DN.
This class contains all ldap function needed to make ldap operations easy.
create_revision($revision_file, $revision)
Create the revision file.
Fatal error class. Does not extend FusionDirectoryError.
rewrite($s)
Function to rewrite some problematic characters.
xmlentities($str)
Encode special string characters.
validate($string)
Removes malicious characters from a (POST) string.
strict_uid_mode()
Check if strict naming rules are configured.
array_key_ics($ikey, array $items)
Lookup a key in an array case-insensitive.
get_people_ou()
Get the OU for users.
check_command($cmdline)
Check if a given command exists and is executable.
get_post($name)
Returns contents of the given POST variable and check magic quotes settings.
expandIPv6($ip)
Expands an IP v6.
clean_smarty_compile_dir($directory)
Clean the smarty compile dir.
normalizeLdap($input)
Escape all LDAP filter relevant characters.
array_merge_unique(array $ar1, array $ar2)
Parent class for all errors in FusionDirectory.
convert_department_dn($dn, $base=NULL)
Convert a department DN to a sub-directory style list.
to_byte($value)
Convert various data sizes to bytes.
plugin_available($plugin)
Check if plugin is available.
array_remove_entries_ics(array $needles, array $haystack)
array_remove_entries(array $needles, array $haystack)
DEBUG($level, $line, $function, $file, $data, $info='')
Debug level action.
humanReadableSize($bytes, $precision=2)
Convert a size in bytes to a human readable version.
class_available($name)
Checks if a class is available.