diff --git a/.gitignore b/.gitignore
index e1e8e8882..43bc74e0e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,6 +44,7 @@ data/conf/rspamd/local.d/*
data/conf/rspamd/override.d/*
data/conf/sogo/custom-theme.js
data/conf/sogo/plist_ldap
+data/conf/sogo/plist_ldap.sh
data/conf/sogo/sieve.creds
data/conf/sogo/sogo-full.svg
data/gitea/
diff --git a/data/Dockerfiles/sogo/bootstrap-sogo.sh b/data/Dockerfiles/sogo/bootstrap-sogo.sh
index 3eb591186..8913fd2c8 100755
--- a/data/Dockerfiles/sogo/bootstrap-sogo.sh
+++ b/data/Dockerfiles/sogo/bootstrap-sogo.sh
@@ -107,7 +107,7 @@ while read -r line gal
" >> /var/lib/sogo/GNUstep/Defaults/sogod.plist
# Generate alternative LDAP authentication dict, when SQL authentication fails
# This will nevertheless read attributes from LDAP
- line=${line} envsubst < /etc/sogo/plist_ldap >> /var/lib/sogo/GNUstep/Defaults/sogod.plist
+ /etc/sogo/plist_ldap.sh ${line} ${gal} >> /var/lib/sogo/GNUstep/Defaults/sogod.plist
echo "
" >> /var/lib/sogo/GNUstep/Defaults/sogod.plist
done < <(mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT domain, CASE gal WHEN '1' THEN 'YES' ELSE 'NO' END AS gal FROM domain;" -B -N)
diff --git a/data/conf/phpfpm/crons/keycloak-sync.php b/data/conf/phpfpm/crons/keycloak-sync.php
index da26ca5be..0525f9572 100644
--- a/data/conf/phpfpm/crons/keycloak-sync.php
+++ b/data/conf/phpfpm/crons/keycloak-sync.php
@@ -18,7 +18,7 @@ try {
$pdo = new PDO($dsn, $database_user, $database_pass, $opt);
}
catch (PDOException $e) {
- logMsg("danger", $e->getMessage());
+ logMsg("err", $e->getMessage());
session_destroy();
exit;
}
@@ -68,11 +68,12 @@ $_SESSION['acl']['ratelimit'] = "1";
$_SESSION['acl']['sogo_access'] = "1";
$_SESSION['acl']['protocol_access'] = "1";
$_SESSION['acl']['mailbox_relayhost'] = "1";
+$_SESSION['acl']['unlimited_quota'] = "1";
// Init Keycloak Provider
$iam_provider = identity_provider('init');
$iam_settings = identity_provider('get');
-if (intval($iam_settings['periodic_sync']) != 1 && $iam_settings['import_users'] != 1) {
+if ($iam_settings['authsource'] != "keycloak" || (intval($iam_settings['periodic_sync']) != 1 && intval($iam_settings['import_users']) != 1)) {
session_destroy();
exit;
}
@@ -127,18 +128,18 @@ while (true) {
curl_close($ch);
if ($code != 200){
- logMsg("danger", "Recieved HTTP {$code}");
+ logMsg("err", "Recieved HTTP {$code}");
session_destroy();
exit;
}
try {
$response = json_decode($response, true);
} catch (Exception $e) {
- logMsg("danger", $e->getMessage());
+ logMsg("err", $e->getMessage());
break;
}
if (!is_array($response)){
- logMsg("danger", "Recieved malformed response from keycloak api");
+ logMsg("err", "Recieved malformed response from keycloak api");
break;
}
if (count($response) == 0) {
@@ -181,7 +182,7 @@ while (true) {
}
}
if (!$mbox_template){
- logMsg("warning", "No matching mapper found for mailbox_template");
+ logMsg("warning", "No matching attribute mapping found for user " . $user['email']);
continue;
}
@@ -191,14 +192,16 @@ while (true) {
mailbox('add', 'mailbox_from_template', array(
'domain' => explode('@', $user['email'])[1],
'local_part' => explode('@', $user['email'])[0],
+ 'name' => $user['firstName'] . " " . $user['lastName'],
'authsource' => 'keycloak',
'template' => $mbox_template
));
- } else if ($row) {
+ } else if ($row && intval($iam_settings['periodic_sync']) == 1) {
// mailbox user does exist, sync attribtues...
logMsg("info", "Syncing attributes for user " . $user['email']);
mailbox('edit', 'mailbox_from_template', array(
'username' => $user['email'],
+ 'name' => $user['firstName'] . " " . $user['lastName'],
'template' => $mbox_template
));
} else {
diff --git a/data/conf/phpfpm/crons/ldap-sync.php b/data/conf/phpfpm/crons/ldap-sync.php
new file mode 100644
index 000000000..5686bdacc
--- /dev/null
+++ b/data/conf/phpfpm/crons/ldap-sync.php
@@ -0,0 +1,176 @@
+ PDO::ERRMODE_EXCEPTION,
+ PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
+ PDO::ATTR_EMULATE_PREPARES => false,
+];
+try {
+ $pdo = new PDO($dsn, $database_user, $database_pass, $opt);
+}
+catch (PDOException $e) {
+ logMsg("err", $e->getMessage());
+ session_destroy();
+ exit;
+}
+
+// Init Redis
+$redis = new Redis();
+try {
+ if (!empty(getenv('REDIS_SLAVEOF_IP'))) {
+ $redis->connect(getenv('REDIS_SLAVEOF_IP'), getenv('REDIS_SLAVEOF_PORT'));
+ }
+ else {
+ $redis->connect('redis-mailcow', 6379);
+ }
+}
+catch (Exception $e) {
+ echo "Exiting: " . $e->getMessage();
+ session_destroy();
+ exit;
+}
+
+function logMsg($priority, $message, $task = "LDAP Sync") {
+ global $redis;
+
+ $finalMsg = array(
+ "time" => time(),
+ "priority" => $priority,
+ "task" => $task,
+ "message" => $message
+ );
+ $redis->lPush('CRON_LOG', json_encode($finalMsg));
+}
+
+// Load core functions first
+require_once __DIR__ . '/../web/inc/functions.inc.php';
+require_once __DIR__ . '/../web/inc/functions.auth.inc.php';
+require_once __DIR__ . '/../web/inc/sessions.inc.php';
+require_once __DIR__ . '/../web/inc/functions.mailbox.inc.php';
+require_once __DIR__ . '/../web/inc/functions.ratelimit.inc.php';
+require_once __DIR__ . '/../web/inc/functions.acl.inc.php';
+
+$_SESSION['mailcow_cc_username'] = "admin";
+$_SESSION['mailcow_cc_role'] = "admin";
+$_SESSION['acl']['tls_policy'] = "1";
+$_SESSION['acl']['quarantine_notification'] = "1";
+$_SESSION['acl']['quarantine_category'] = "1";
+$_SESSION['acl']['ratelimit'] = "1";
+$_SESSION['acl']['sogo_access'] = "1";
+$_SESSION['acl']['protocol_access'] = "1";
+$_SESSION['acl']['mailbox_relayhost'] = "1";
+$_SESSION['acl']['unlimited_quota'] = "1";
+
+// Init Provider
+$iam_provider = identity_provider('init');
+$iam_settings = identity_provider('get');
+if ($iam_settings['authsource'] != "ldap" || (intval($iam_settings['periodic_sync']) != 1 && intval($iam_settings['import_users']) != 1)) {
+ session_destroy();
+ exit;
+}
+
+// Set pagination variables
+$start = 0;
+$max = 25;
+
+// lock sync if already running
+$lock_file = '/tmp/iam-sync.lock';
+if (file_exists($lock_file)) {
+ $lock_file_parts = explode("\n", file_get_contents($lock_file));
+ $pid = $lock_file_parts[0];
+ if (count($lock_file_parts) > 1){
+ $last_execution = $lock_file_parts[1];
+ $elapsed_time = (time() - $last_execution) / 60;
+ if ($elapsed_time < intval($iam_settings['sync_interval'])) {
+ logMsg("warning", "Sync not ready (".number_format((float)$elapsed_time, 2, '.', '')."min / ".$iam_settings['sync_interval']."min)");
+ session_destroy();
+ exit;
+ }
+ }
+
+ if (posix_kill($pid, 0)) {
+ logMsg("warning", "Sync is already running");
+ session_destroy();
+ exit;
+ } else {
+ unlink($lock_file);
+ }
+}
+$lock_file_handle = fopen($lock_file, 'w');
+fwrite($lock_file_handle, getmypid());
+fclose($lock_file_handle);
+
+// Get ldap users
+$response = $iam_provider->query()
+ ->where($iam_settings['username_field'], "*")
+ ->where($iam_settings['attribute_field'], "*")
+ ->select([$iam_settings['username_field'], $iam_settings['attribute_field'], 'displayname'])
+ ->paginate($max);
+
+// Process the users
+foreach ($response as $user) {
+ $mailcow_template = $user[$iam_settings['attribute_field']][0];
+
+ // try get mailbox user
+ $stmt = $pdo->prepare("SELECT `mailbox`.* FROM `mailbox`
+ INNER JOIN domain on mailbox.domain = domain.domain
+ WHERE `kind` NOT REGEXP 'location|thing|group'
+ AND `domain`.`active`='1'
+ AND `username` = :user");
+ $stmt->execute(array(':user' => $user[$iam_settings['username_field']][0]));
+ $row = $stmt->fetch(PDO::FETCH_ASSOC);
+
+ // check if matching attribute mapping exists
+ $mbox_template = null;
+ foreach ($iam_settings['mappers'] as $index => $mapper){
+ if ($mapper == $mailcow_template) {
+ $mbox_template = $iam_settings['templates'][$index];
+ break;
+ }
+ }
+ if (!$mbox_template){
+ logMsg("warning", "No matching attribute mapping found for user " . $user[$iam_settings['username_field']][0]);
+ continue;
+ }
+
+ if (!$row && intval($iam_settings['import_users']) == 1){
+ // mailbox user does not exist, create...
+ logMsg("info", "Creating user " . $user[$iam_settings['username_field']][0]);
+ mailbox('add', 'mailbox_from_template', array(
+ 'domain' => explode('@', $user[$iam_settings['username_field']][0])[1],
+ 'local_part' => explode('@', $user[$iam_settings['username_field']][0])[0],
+ 'name' => $user['displayname'][0],
+ 'authsource' => 'ldap',
+ 'template' => $mbox_template
+ ));
+ } else if ($row && intval($iam_settings['periodic_sync']) == 1) {
+ // mailbox user does exist, sync attribtues...
+ logMsg("info", "Syncing attributes for user " . $user[$iam_settings['username_field']][0]);
+ mailbox('edit', 'mailbox_from_template', array(
+ 'username' => $user[$iam_settings['username_field']][0],
+ 'name' => $user['displayname'][0],
+ 'template' => $mbox_template
+ ));
+ } else {
+ // skip mailbox user
+ logMsg("info", "Skipping user " . $user[$iam_settings['username_field']][0]);
+ }
+
+ sleep(0.025);
+}
+
+logMsg("info", "DONE!");
+// add last execution time to lock file
+$lock_file_handle = fopen($lock_file, 'w');
+fwrite($lock_file_handle, getmypid() . "\n" . time());
+fclose($lock_file_handle);
+session_destroy();
diff --git a/data/conf/sogo/custom-sogo.js b/data/conf/sogo/custom-sogo.js
index 9ee6daba1..44afa2998 100644
--- a/data/conf/sogo/custom-sogo.js
+++ b/data/conf/sogo/custom-sogo.js
@@ -1,3 +1,49 @@
+// redirect to mailcow login form
+document.addEventListener('DOMContentLoaded', function () {
+ var loginForm = document.forms.namedItem("loginForm");
+ if (loginForm) {
+ window.location.href = '/';
+ }
+
+ angularReady = false;
+ // Wait for the Angular components to be initialized
+ function waitForAngularComponents(callback) {
+ const targetNode = document.body;
+
+ const observer = new MutationObserver(function(mutations) {
+ mutations.forEach(function(mutation) {
+ if (mutation.addedNodes.length > 0) {
+ const toolbarElement = document.body.querySelector('md-toolbar');
+ if (toolbarElement) {
+ observer.disconnect();
+ callback();
+ }
+ }
+ });
+ });
+
+ const config = { childList: true, subtree: true };
+ observer.observe(targetNode, config);
+ }
+
+ // Usage
+ waitForAngularComponents(function() {
+ if (!angularReady){
+ angularReady = true;
+
+ const toolbarElement = document.body.querySelector('.md-toolbar-tools.sg-toolbar-group-last.layout-align-end-center.layout-row');
+
+ var htmlCode = '' +
+ '
-
+
@@ -45,7 +45,7 @@
⏲ **Up and Running Fast**
-Connect to your LDAP servers and start running queries at lightning speed.
+Connect to your LDAP servers and start running queries in a matter of minutes.
💡 **Fluent Filter Builder**
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Events/Event.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Events/Event.php
index 83716b422..7c1bb3c87 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Events/Event.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Events/Event.php
@@ -30,9 +30,9 @@ abstract class Event
/**
* Constructor.
*
- * @param LdapInterface $connection
- * @param string $username
- * @param string $password
+ * @param LdapInterface $connection
+ * @param string $username
+ * @param string $password
*/
public function __construct(LdapInterface $connection, $username, $password)
{
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php
index d41af1569..c00989ae6 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php
@@ -38,8 +38,8 @@ class Guard
/**
* Constructor.
*
- * @param LdapInterface $connection
- * @param DomainConfiguration $configuration
+ * @param LdapInterface $connection
+ * @param DomainConfiguration $configuration
*/
public function __construct(LdapInterface $connection, DomainConfiguration $configuration)
{
@@ -50,10 +50,9 @@ class Guard
/**
* Attempt binding a user to the LDAP server.
*
- * @param string $username
- * @param string $password
- * @param bool $stayBound
- *
+ * @param string $username
+ * @param string $password
+ * @param bool $stayBound
* @return bool
*
* @throws UsernameRequiredException
@@ -90,8 +89,8 @@ class Guard
/**
* Attempt binding a user to the LDAP server. Supports anonymous binding.
*
- * @param string|null $username
- * @param string|null $password
+ * @param string|null $username
+ * @param string|null $password
*
* @throws BindException
* @throws \LdapRecord\ConnectionException
@@ -148,8 +147,7 @@ class Guard
/**
* Set the event dispatcher instance.
*
- * @param DispatcherInterface $dispatcher
- *
+ * @param DispatcherInterface $dispatcher
* @return void
*/
public function setDispatcher(DispatcherInterface $dispatcher)
@@ -160,9 +158,8 @@ class Guard
/**
* Fire the attempting event.
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return void
*/
protected function fireAttemptingEvent($username, $password)
@@ -175,9 +172,8 @@ class Guard
/**
* Fire the passed event.
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return void
*/
protected function firePassedEvent($username, $password)
@@ -190,9 +186,8 @@ class Guard
/**
* Fire the failed event.
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return void
*/
protected function fireFailedEvent($username, $password)
@@ -205,9 +200,8 @@ class Guard
/**
* Fire the binding event.
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return void
*/
protected function fireBindingEvent($username, $password)
@@ -220,9 +214,8 @@ class Guard
/**
* Fire the bound event.
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return void
*/
protected function fireBoundEvent($username, $password)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php
index d1124bfc9..f71f63d87 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php
@@ -58,7 +58,7 @@ class DomainConfiguration
/**
* Constructor.
*
- * @param array $options
+ * @param array $options
*
* @throws ConfigurationException When an option value given is an invalid type.
*/
@@ -74,9 +74,8 @@ class DomainConfiguration
/**
* Extend the configuration with a custom option, or override an existing.
*
- * @param string $option
- * @param mixed $default
- *
+ * @param string $option
+ * @param mixed $default
* @return void
*/
public static function extend($option, $default = null)
@@ -107,8 +106,8 @@ class DomainConfiguration
/**
* Set a configuration option.
*
- * @param string $key
- * @param mixed $value
+ * @param string $key
+ * @param mixed $value
*
* @throws ConfigurationException When an option value given is an invalid type.
*/
@@ -122,8 +121,7 @@ class DomainConfiguration
/**
* Returns the value for the specified configuration options.
*
- * @param string $key
- *
+ * @param string $key
* @return mixed
*
* @throws ConfigurationException When the option specified does not exist.
@@ -140,8 +138,7 @@ class DomainConfiguration
/**
* Checks if a configuration option exists.
*
- * @param string $key
- *
+ * @param string $key
* @return bool
*/
public function has($key)
@@ -152,9 +149,8 @@ class DomainConfiguration
/**
* Validate the configuration option.
*
- * @param string $key
- * @param mixed $value
- *
+ * @param string $key
+ * @param mixed $value
* @return bool
*
* @throws ConfigurationException When an option value given is an invalid type.
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php
index de2f13f56..d107314d5 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php
@@ -30,8 +30,8 @@ abstract class Validator
/**
* Constructor.
*
- * @param string $key
- * @param mixed $value
+ * @param string $key
+ * @param mixed $value
*/
public function __construct($key, $value)
{
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php
index d429aa462..6e55cffc9 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php
@@ -88,8 +88,8 @@ class Connection
/**
* Constructor.
*
- * @param array $config
- * @param LdapInterface|null $ldap
+ * @param array|DomainConfiguration $config
+ * @param LdapInterface|null $ldap
*/
public function __construct($config = [], LdapInterface $ldap = null)
{
@@ -109,15 +109,18 @@ class Connection
/**
* Set the connection configuration.
*
- * @param array $config
- *
+ * @param array|DomainConfiguration $config
* @return $this
*
* @throws Configuration\ConfigurationException
*/
public function setConfiguration($config = [])
{
- $this->configuration = new DomainConfiguration($config);
+ if (! $config instanceof DomainConfiguration) {
+ $config = new DomainConfiguration($config);
+ }
+
+ $this->configuration = $config;
$this->hosts = $this->configuration->get('hosts');
@@ -129,8 +132,7 @@ class Connection
/**
* Set the LDAP connection.
*
- * @param LdapInterface $ldap
- *
+ * @param LdapInterface $ldap
* @return $this
*/
public function setLdapConnection(LdapInterface $ldap)
@@ -143,8 +145,7 @@ class Connection
/**
* Set the event dispatcher.
*
- * @param DispatcherInterface $dispatcher
- *
+ * @param DispatcherInterface $dispatcher
* @return $this
*/
public function setDispatcher(DispatcherInterface $dispatcher)
@@ -192,8 +193,7 @@ class Connection
/**
* Set the cache store.
*
- * @param CacheInterface $store
- *
+ * @param CacheInterface $store
* @return $this
*/
public function setCache(CacheInterface $store)
@@ -238,9 +238,8 @@ class Connection
*
* If no username or password is specified, then the configured credentials are used.
*
- * @param string|null $username
- * @param string|null $password
- *
+ * @param string|null $username
+ * @param string|null $password
* @return Connection
*
* @throws Auth\BindException
@@ -298,6 +297,16 @@ class Connection
$this->initialize();
}
+ /**
+ * Clone the connection.
+ *
+ * @return static
+ */
+ public function replicate()
+ {
+ return new static($this->configuration, new $this->ldap);
+ }
+
/**
* Disconnect from the LDAP server.
*
@@ -311,8 +320,7 @@ class Connection
/**
* Dispatch an event.
*
- * @param object $event
- *
+ * @param object $event
* @return void
*/
public function dispatch($event)
@@ -335,8 +343,7 @@ class Connection
/**
* Perform the operation on the LDAP connection.
*
- * @param Closure $operation
- *
+ * @param Closure $operation
* @return mixed
*/
public function run(Closure $operation)
@@ -359,11 +366,27 @@ class Connection
}
}
+ /**
+ * Perform the operation on an isolated LDAP connection.
+ *
+ * @param Closure $operation
+ * @return mixed
+ */
+ public function isolate(Closure $operation)
+ {
+ $connection = $this->replicate();
+
+ try {
+ return $operation($connection);
+ } finally {
+ $connection->disconnect();
+ }
+ }
+
/**
* Attempt to get an exception for the cause of failure.
*
- * @param LdapRecordException $e
- *
+ * @param LdapRecordException $e
* @return mixed
*/
protected function getExceptionForCauseOfFailure(LdapRecordException $e)
@@ -383,8 +406,7 @@ class Connection
/**
* Run the operation callback on the current LDAP connection.
*
- * @param Closure $operation
- *
+ * @param Closure $operation
* @return mixed
*
* @throws LdapRecordException
@@ -439,9 +461,8 @@ class Connection
/**
* Attempt to retry an LDAP operation if due to a lost connection.
*
- * @param LdapRecordException $e
- * @param Closure $operation
- *
+ * @param LdapRecordException $e
+ * @param Closure $operation
* @return mixed
*
* @throws LdapRecordException
@@ -461,8 +482,7 @@ class Connection
/**
* Retry the operation on the current host.
*
- * @param Closure $operation
- *
+ * @param Closure $operation
* @return mixed
*
* @throws LdapRecordException
@@ -483,9 +503,8 @@ class Connection
/**
* Attempt the operation again on the next host.
*
- * @param LdapRecordException $e
- * @param Closure $operation
- *
+ * @param LdapRecordException $e
+ * @param Closure $operation
* @return mixed
*
* @throws LdapRecordException
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php
index 01b072b4e..0597f1f68 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php
@@ -81,9 +81,8 @@ class ConnectionManager
/**
* Forward missing method calls onto the instance.
*
- * @param string $method
- * @param mixed $args
- *
+ * @param string $method
+ * @param mixed $args
* @return mixed
*/
public function __call($method, $args)
@@ -104,9 +103,8 @@ class ConnectionManager
/**
* Add a new connection.
*
- * @param Connection $connection
- * @param string|null $name
- *
+ * @param Connection $connection
+ * @param string|null $name
* @return $this
*/
public function add(Connection $connection, $name = null)
@@ -123,8 +121,7 @@ class ConnectionManager
/**
* Remove a connection.
*
- * @param $name
- *
+ * @param $name
* @return $this
*/
public function remove($name)
@@ -147,8 +144,7 @@ class ConnectionManager
/**
* Get a connection by name or return the default.
*
- * @param string|null $name
- *
+ * @param string|null $name
* @return Connection
*
* @throws ContainerException If the given connection does not exist.
@@ -185,8 +181,7 @@ class ConnectionManager
/**
* Checks if the connection exists.
*
- * @param string $name
- *
+ * @param string $name
* @return bool
*/
public function exists($name)
@@ -197,8 +192,7 @@ class ConnectionManager
/**
* Set the default connection name.
*
- * @param string $name
- *
+ * @param string $name
* @return $this
*/
public function setDefault($name = null)
@@ -237,8 +231,7 @@ class ConnectionManager
/**
* Set the event logger to use.
*
- * @param LoggerInterface $logger
- *
+ * @param LoggerInterface $logger
* @return void
*/
public function setLogger(LoggerInterface $logger)
@@ -299,8 +292,7 @@ class ConnectionManager
/**
* Set the event dispatcher.
*
- * @param DispatcherInterface $dispatcher
- *
+ * @param DispatcherInterface $dispatcher
* @return void
*/
public function setDispatcher(DispatcherInterface $dispatcher)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Container.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Container.php
index f458951e7..0c125593d 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Container.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Container.php
@@ -48,9 +48,8 @@ class Container
/**
* Forward missing static calls onto the current instance.
*
- * @param string $method
- * @param mixed $args
- *
+ * @param string $method
+ * @param mixed $args
* @return mixed
*/
public static function __callStatic($method, $args)
@@ -71,8 +70,7 @@ class Container
/**
* Set the container instance.
*
- * @param Container|null $container
- *
+ * @param Container|null $container
* @return Container|null
*/
public static function setInstance(self $container = null)
@@ -103,9 +101,8 @@ class Container
/**
* Forward missing method calls onto the connection manager.
*
- * @param string $method
- * @param mixed $args
- *
+ * @param string $method
+ * @param mixed $args
* @return mixed
*/
public function __call($method, $args)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetailedError.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetailedError.php
index d61159ed3..fff528c98 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetailedError.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetailedError.php
@@ -28,9 +28,9 @@ class DetailedError
/**
* Constructor.
*
- * @param int $errorCode
- * @param string $errorMessage
- * @param string $diagnosticMessage
+ * @param int $errorCode
+ * @param string $errorMessage
+ * @param string $diagnosticMessage
*/
public function __construct($errorCode, $errorMessage, $diagnosticMessage)
{
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetectsErrors.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetectsErrors.php
index e8997a931..61fc4a02e 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetectsErrors.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetectsErrors.php
@@ -7,8 +7,7 @@ trait DetectsErrors
/**
* Determine if the error was caused by a lost connection.
*
- * @param string $error
- *
+ * @param string $error
* @return bool
*/
protected function causedByLostConnection($error)
@@ -19,8 +18,7 @@ trait DetectsErrors
/**
* Determine if the error was caused by lack of pagination support.
*
- * @param string $error
- *
+ * @param string $error
* @return bool
*/
protected function causedByPaginationSupport($error)
@@ -31,8 +29,7 @@ trait DetectsErrors
/**
* Determine if the error was caused by a size limit warning.
*
- * @param $error
- *
+ * @param $error
* @return bool
*/
protected function causedBySizeLimit($error)
@@ -43,8 +40,7 @@ trait DetectsErrors
/**
* Determine if the error was caused by a "No such object" warning.
*
- * @param string $error
- *
+ * @param string $error
* @return bool
*/
protected function causedByNoSuchObject($error)
@@ -55,15 +51,14 @@ trait DetectsErrors
/**
* Determine if the error contains the any of the messages.
*
- * @param string $error
- * @param string|array $messages
- *
+ * @param string $error
+ * @param string|array $messages
* @return bool
*/
protected function errorContainsMessage($error, $messages = [])
{
foreach ((array) $messages as $message) {
- if (strpos($error, $message) !== false) {
+ if (str_contains((string) $error, $message)) {
return true;
}
}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/EscapesValues.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/EscapesValues.php
index acfc020bf..ea53a2f93 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/EscapesValues.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/EscapesValues.php
@@ -9,10 +9,9 @@ trait EscapesValues
/**
* Prepare a value to be escaped.
*
- * @param string $value
- * @param string $ignore
- * @param int $flags
- *
+ * @param string $value
+ * @param string $ignore
+ * @param int $flags
* @return EscapedValue
*/
public function escape($value, $ignore = '', $flags = 0)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/ConnectionEvent.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/ConnectionEvent.php
index e9c2c352c..d2d77e2fc 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/ConnectionEvent.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/ConnectionEvent.php
@@ -16,7 +16,7 @@ abstract class ConnectionEvent
/**
* Constructor.
*
- * @param Connection $connection
+ * @param Connection $connection
*/
public function __construct(Connection $connection)
{
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Dispatcher.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Dispatcher.php
index a4ae3def0..4fedbc2ef 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Dispatcher.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Dispatcher.php
@@ -46,7 +46,7 @@ class Dispatcher implements DispatcherInterface
public function listen($events, $listener)
{
foreach ((array) $events as $event) {
- if (strpos($event, '*') !== false) {
+ if (str_contains((string) $event, '*')) {
$this->setupWildcardListen($event, $listener);
} else {
$this->listeners[$event][] = $this->makeListener($listener);
@@ -57,9 +57,8 @@ class Dispatcher implements DispatcherInterface
/**
* Setup a wildcard listener callback.
*
- * @param string $event
- * @param mixed $listener
- *
+ * @param string $event
+ * @param mixed $listener
* @return void
*/
protected function setupWildcardListen($event, $listener)
@@ -134,9 +133,8 @@ class Dispatcher implements DispatcherInterface
/**
* Parse the given event and payload and prepare them for dispatching.
*
- * @param mixed $event
- * @param mixed $payload
- *
+ * @param mixed $event
+ * @param mixed $payload
* @return array
*/
protected function parseEventAndPayload($event, $payload)
@@ -168,8 +166,7 @@ class Dispatcher implements DispatcherInterface
/**
* Get the wildcard listeners for the event.
*
- * @param string $eventName
- *
+ * @param string $eventName
* @return array
*/
protected function getWildcardListeners($eventName)
@@ -190,9 +187,8 @@ class Dispatcher implements DispatcherInterface
*
* This function is a direct excerpt from Laravel's Str::is().
*
- * @param string $wildcard
- * @param string $eventName
- *
+ * @param string $wildcard
+ * @param string $eventName
* @return bool
*/
protected function wildcardContainsEvent($wildcard, $eventName)
@@ -229,9 +225,8 @@ class Dispatcher implements DispatcherInterface
/**
* Add the listeners for the event's interfaces to the given array.
*
- * @param string $eventName
- * @param array $listeners
- *
+ * @param string $eventName
+ * @param array $listeners
* @return array
*/
protected function addInterfaceListeners($eventName, array $listeners = [])
@@ -250,9 +245,8 @@ class Dispatcher implements DispatcherInterface
/**
* Register an event listener with the dispatcher.
*
- * @param \Closure|string $listener
- * @param bool $wildcard
- *
+ * @param \Closure|string $listener
+ * @param bool $wildcard
* @return \Closure
*/
public function makeListener($listener, $wildcard = false)
@@ -273,9 +267,8 @@ class Dispatcher implements DispatcherInterface
/**
* Create a class based listener.
*
- * @param string $listener
- * @param bool $wildcard
- *
+ * @param string $listener
+ * @param bool $wildcard
* @return \Closure
*/
protected function createClassListener($listener, $wildcard = false)
@@ -295,8 +288,7 @@ class Dispatcher implements DispatcherInterface
/**
* Create the class based event callable.
*
- * @param string $listener
- *
+ * @param string $listener
* @return callable
*/
protected function createClassCallable($listener)
@@ -309,13 +301,12 @@ class Dispatcher implements DispatcherInterface
/**
* Parse the class listener into class and method.
*
- * @param string $listener
- *
+ * @param string $listener
* @return array
*/
protected function parseListenerCallback($listener)
{
- return strpos($listener, '@') !== false
+ return str_contains((string) $listener, '@')
? explode('@', $listener, 2)
: [$listener, 'handle'];
}
@@ -325,7 +316,7 @@ class Dispatcher implements DispatcherInterface
*/
public function forget($event)
{
- if (strpos($event, '*') !== false) {
+ if (str_contains((string) $event, '*')) {
unset($this->wildcards[$event]);
} else {
unset($this->listeners[$event]);
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/DispatcherInterface.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/DispatcherInterface.php
index 6b7cb10c6..590328f09 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/DispatcherInterface.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/DispatcherInterface.php
@@ -7,9 +7,8 @@ interface DispatcherInterface
/**
* Register an event listener with the dispatcher.
*
- * @param string|array $events
- * @param mixed $listener
- *
+ * @param string|array $events
+ * @param mixed $listener
* @return void
*/
public function listen($events, $listener);
@@ -17,8 +16,7 @@ interface DispatcherInterface
/**
* Determine if a given event has listeners.
*
- * @param string $eventName
- *
+ * @param string $eventName
* @return bool
*/
public function hasListeners($eventName);
@@ -26,9 +24,8 @@ interface DispatcherInterface
/**
* Fire an event until the first non-null response is returned.
*
- * @param string|object $event
- * @param mixed $payload
- *
+ * @param string|object $event
+ * @param mixed $payload
* @return array|null
*/
public function until($event, $payload = []);
@@ -36,10 +33,9 @@ interface DispatcherInterface
/**
* Fire an event and call the listeners.
*
- * @param string|object $event
- * @param mixed $payload
- * @param bool $halt
- *
+ * @param string|object $event
+ * @param mixed $payload
+ * @param bool $halt
* @return mixed
*/
public function fire($event, $payload = [], $halt = false);
@@ -47,10 +43,9 @@ interface DispatcherInterface
/**
* Fire an event and call the listeners.
*
- * @param string|object $event
- * @param mixed $payload
- * @param bool $halt
- *
+ * @param string|object $event
+ * @param mixed $payload
+ * @param bool $halt
* @return array|null
*/
public function dispatch($event, $payload = [], $halt = false);
@@ -58,8 +53,7 @@ interface DispatcherInterface
/**
* Get all of the listeners for a given event name.
*
- * @param string $eventName
- *
+ * @param string $eventName
* @return array
*/
public function getListeners($eventName);
@@ -67,8 +61,7 @@ interface DispatcherInterface
/**
* Remove a set of listeners from the dispatcher.
*
- * @param string $event
- *
+ * @param string $event
* @return void
*/
public function forget($event);
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php
index b2082e596..b8a849169 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php
@@ -21,7 +21,7 @@ class Logger
/**
* Constructor.
*
- * @param LoggerInterface|null $logger
+ * @param LoggerInterface|null $logger
*/
public function __construct(LoggerInterface $logger = null)
{
@@ -31,8 +31,7 @@ class Logger
/**
* Logs the given event.
*
- * @param mixed $event
- *
+ * @param mixed $event
* @return void
*/
public function log($event)
@@ -53,8 +52,7 @@ class Logger
/**
* Logs an authentication event.
*
- * @param AuthEvent $event
- *
+ * @param AuthEvent $event
* @return void
*/
public function auth(AuthEvent $event)
@@ -81,8 +79,7 @@ class Logger
/**
* Logs a model event.
*
- * @param ModelEvent $event
- *
+ * @param ModelEvent $event
* @return void
*/
public function model(ModelEvent $event)
@@ -106,8 +103,7 @@ class Logger
/**
* Logs a query event.
*
- * @param QueryEvent $event
- *
+ * @param QueryEvent $event
* @return void
*/
public function query(QueryEvent $event)
@@ -133,8 +129,7 @@ class Logger
/**
* Returns the operational name of the given event.
*
- * @param mixed $event
- *
+ * @param mixed $event
* @return string
*/
protected function getOperationName($event)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/NullDispatcher.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/NullDispatcher.php
index 73b1f5a8e..7683d1f80 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/NullDispatcher.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/NullDispatcher.php
@@ -14,7 +14,7 @@ class NullDispatcher implements DispatcherInterface
/**
* Constructor.
*
- * @param DispatcherInterface $dispatcher
+ * @param DispatcherInterface $dispatcher
*/
public function __construct(DispatcherInterface $dispatcher)
{
@@ -24,9 +24,8 @@ class NullDispatcher implements DispatcherInterface
/**
* Register an event listener with the dispatcher.
*
- * @param string|array $events
- * @param mixed $listener
- *
+ * @param string|array $events
+ * @param mixed $listener
* @return void
*/
public function listen($events, $listener)
@@ -37,8 +36,7 @@ class NullDispatcher implements DispatcherInterface
/**
* Determine if a given event has listeners.
*
- * @param string $eventName
- *
+ * @param string $eventName
* @return bool
*/
public function hasListeners($eventName)
@@ -49,9 +47,8 @@ class NullDispatcher implements DispatcherInterface
/**
* Fire an event until the first non-null response is returned.
*
- * @param string|object $event
- * @param mixed $payload
- *
+ * @param string|object $event
+ * @param mixed $payload
* @return null
*/
public function until($event, $payload = [])
@@ -62,10 +59,9 @@ class NullDispatcher implements DispatcherInterface
/**
* Fire an event and call the listeners.
*
- * @param string|object $event
- * @param mixed $payload
- * @param bool $halt
- *
+ * @param string|object $event
+ * @param mixed $payload
+ * @param bool $halt
* @return null
*/
public function fire($event, $payload = [], $halt = false)
@@ -76,10 +72,9 @@ class NullDispatcher implements DispatcherInterface
/**
* Fire an event and call the listeners.
*
- * @param string|object $event
- * @param mixed $payload
- * @param bool $halt
- *
+ * @param string|object $event
+ * @param mixed $payload
+ * @param bool $halt
* @return null
*/
public function dispatch($event, $payload = [], $halt = false)
@@ -90,8 +85,7 @@ class NullDispatcher implements DispatcherInterface
/**
* Get all of the listeners for a given event name.
*
- * @param string $eventName
- *
+ * @param string $eventName
* @return array
*/
public function getListeners($eventName)
@@ -102,8 +96,7 @@ class NullDispatcher implements DispatcherInterface
/**
* Remove a set of listeners from the dispatcher.
*
- * @param string $event
- *
+ * @param string $event
* @return void
*/
public function forget($event)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php
index 9af7ad751..4a2e27598 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php
@@ -148,8 +148,7 @@ trait HandlesConnection
/**
* Convert warnings to exceptions for the given operation.
*
- * @param Closure $operation
- *
+ * @param Closure $operation
* @return mixed
*
* @throws LdapRecordException
@@ -190,8 +189,7 @@ trait HandlesConnection
/**
* Determine if the failed operation should be bypassed.
*
- * @param string $method
- *
+ * @param string $method
* @return bool
*/
protected function shouldBypassFailure($method)
@@ -202,8 +200,7 @@ trait HandlesConnection
/**
* Determine if the error should be bypassed.
*
- * @param string $error
- *
+ * @param string $error
* @return bool
*/
protected function shouldBypassError($error)
@@ -226,9 +223,8 @@ trait HandlesConnection
/**
* Generates an LDAP connection string for each host given.
*
- * @param string|array $hosts
- * @param string $port
- *
+ * @param string|array $hosts
+ * @param string $port
* @return string
*/
protected function makeConnectionUris($hosts, $port)
@@ -249,9 +245,8 @@ trait HandlesConnection
/**
* Assemble the host URI strings.
*
- * @param array|string $hosts
- * @param string $port
- *
+ * @param array|string $hosts
+ * @param string $port
* @return array
*/
protected function assembleHostUris($hosts, $port)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php
index 0c3574f13..76c372040 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php
@@ -4,7 +4,6 @@ namespace LdapRecord;
use LDAP\Connection as RawLdapConnection;
-/** @psalm-suppress UndefinedClass */
class Ldap implements LdapInterface
{
use HandlesConnection, DetectsErrors;
@@ -24,8 +23,7 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-first-entry.php
*
- * @param resource $searchResults
- *
+ * @param resource $searchResults
* @return resource
*/
public function getFirstEntry($searchResults)
@@ -40,8 +38,7 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-next-entry.php
*
- * @param resource $entry
- *
+ * @param resource $entry
* @return resource
*/
public function getNextEntry($entry)
@@ -56,8 +53,7 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-get-attributes.php
*
- * @param resource $entry
- *
+ * @param resource $entry
* @return array|false
*/
public function getAttributes($entry)
@@ -72,8 +68,7 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-count-entries.php
*
- * @param resource $searchResults
- *
+ * @param resource $searchResults
* @return int
*/
public function countEntries($searchResults)
@@ -88,10 +83,9 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-compare.php
*
- * @param string $dn
- * @param string $attribute
- * @param string $value
- *
+ * @param string $dn
+ * @param string $attribute
+ * @param string $value
* @return mixed
*/
public function compare($dn, $attribute, $value)
@@ -132,9 +126,8 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-get-values-len.php
*
- * @param $entry
- * @param $attribute
- *
+ * @param $entry
+ * @param $attribute
* @return array
*/
public function getValuesLen($entry, $attribute)
@@ -167,8 +160,7 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-set-rebind-proc.php
*
- * @param callable $callback
- *
+ * @param callable $callback
* @return bool
*/
public function setRebindCallback(callable $callback)
@@ -304,7 +296,7 @@ class Ldap implements LdapInterface
public function bind($username, $password)
{
return $this->bound = $this->executeFailableOperation(function () use ($username, $password) {
- return ldap_bind($this->connection, $username, html_entity_decode($password));
+ return ldap_bind($this->connection, $username, $password ? html_entity_decode($password) : null);
});
}
@@ -462,8 +454,7 @@ class Ldap implements LdapInterface
/**
* Extract the diagnostic code from the message.
*
- * @param string $message
- *
+ * @param string $message
* @return string|bool
*/
public function extractDiagnosticCode($message)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php
index c74fe4e89..fcff57f48 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php
@@ -9,28 +9,28 @@ interface LdapInterface
*
* @var string
*/
- const PROTOCOL_SSL = 'ldaps://';
+ public const PROTOCOL_SSL = 'ldaps://';
/**
* The standard LDAP protocol string.
*
* @var string
*/
- const PROTOCOL = 'ldap://';
+ public const PROTOCOL = 'ldap://';
/**
* The LDAP SSL port number.
*
* @var string
*/
- const PORT_SSL = 636;
+ public const PORT_SSL = 636;
/**
* The standard LDAP port number.
*
* @var string
*/
- const PORT = 389;
+ public const PORT = 389;
/**
* Various useful server control OID's.
@@ -38,37 +38,36 @@ interface LdapInterface
* @see https://ldap.com/ldap-oid-reference-guide/
* @see http://msdn.microsoft.com/en-us/library/cc223359.aspx
*/
- const OID_SERVER_START_TLS = '1.3.6.1.4.1.1466.20037';
- const OID_SERVER_PAGED_RESULTS = '1.2.840.113556.1.4.319';
- const OID_SERVER_SHOW_DELETED = '1.2.840.113556.1.4.417';
- const OID_SERVER_SORT = '1.2.840.113556.1.4.473';
- const OID_SERVER_CROSSDOM_MOVE_TARGET = '1.2.840.113556.1.4.521';
- const OID_SERVER_NOTIFICATION = '1.2.840.113556.1.4.528';
- const OID_SERVER_EXTENDED_DN = '1.2.840.113556.1.4.529';
- const OID_SERVER_LAZY_COMMIT = '1.2.840.113556.1.4.619';
- const OID_SERVER_SD_FLAGS = '1.2.840.113556.1.4.801';
- const OID_SERVER_TREE_DELETE = '1.2.840.113556.1.4.805';
- const OID_SERVER_DIRSYNC = '1.2.840.113556.1.4.841';
- const OID_SERVER_VERIFY_NAME = '1.2.840.113556.1.4.1338';
- const OID_SERVER_DOMAIN_SCOPE = '1.2.840.113556.1.4.1339';
- const OID_SERVER_SEARCH_OPTIONS = '1.2.840.113556.1.4.1340';
- const OID_SERVER_PERMISSIVE_MODIFY = '1.2.840.113556.1.4.1413';
- const OID_SERVER_ASQ = '1.2.840.113556.1.4.1504';
- const OID_SERVER_FAST_BIND = '1.2.840.113556.1.4.1781';
- const OID_SERVER_CONTROL_VLVREQUEST = '2.16.840.1.113730.3.4.9';
+ public const OID_SERVER_START_TLS = '1.3.6.1.4.1.1466.20037';
+ public const OID_SERVER_PAGED_RESULTS = '1.2.840.113556.1.4.319';
+ public const OID_SERVER_SHOW_DELETED = '1.2.840.113556.1.4.417';
+ public const OID_SERVER_SORT = '1.2.840.113556.1.4.473';
+ public const OID_SERVER_CROSSDOM_MOVE_TARGET = '1.2.840.113556.1.4.521';
+ public const OID_SERVER_NOTIFICATION = '1.2.840.113556.1.4.528';
+ public const OID_SERVER_EXTENDED_DN = '1.2.840.113556.1.4.529';
+ public const OID_SERVER_LAZY_COMMIT = '1.2.840.113556.1.4.619';
+ public const OID_SERVER_SD_FLAGS = '1.2.840.113556.1.4.801';
+ public const OID_SERVER_TREE_DELETE = '1.2.840.113556.1.4.805';
+ public const OID_SERVER_DIRSYNC = '1.2.840.113556.1.4.841';
+ public const OID_SERVER_VERIFY_NAME = '1.2.840.113556.1.4.1338';
+ public const OID_SERVER_DOMAIN_SCOPE = '1.2.840.113556.1.4.1339';
+ public const OID_SERVER_SEARCH_OPTIONS = '1.2.840.113556.1.4.1340';
+ public const OID_SERVER_PERMISSIVE_MODIFY = '1.2.840.113556.1.4.1413';
+ public const OID_SERVER_ASQ = '1.2.840.113556.1.4.1504';
+ public const OID_SERVER_FAST_BIND = '1.2.840.113556.1.4.1781';
+ public const OID_SERVER_CONTROL_VLVREQUEST = '2.16.840.1.113730.3.4.9';
/**
* Query OID's.
*
* @see https://ldapwiki.com/wiki/LDAP_MATCHING_RULE_IN_CHAIN
*/
- const OID_MATCHING_RULE_IN_CHAIN = '1.2.840.113556.1.4.1941';
+ public const OID_MATCHING_RULE_IN_CHAIN = '1.2.840.113556.1.4.1941';
/**
* Set the current connection to use SSL.
*
- * @param bool $enabled
- *
+ * @param bool $enabled
* @return $this
*/
public function ssl();
@@ -83,8 +82,7 @@ interface LdapInterface
/**
* Set the current connection to use TLS.
*
- * @param bool $enabled
- *
+ * @param bool $enabled
* @return $this
*/
public function tls();
@@ -138,8 +136,7 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-get-entries.php
*
- * @param resource $searchResults
- *
+ * @param resource $searchResults
* @return array
*/
public function getEntries($searchResults);
@@ -169,9 +166,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-set-option.php
*
- * @param int $option
- * @param mixed $value
- *
+ * @param int $option
+ * @param mixed $value
* @return bool
*/
public function setOption($option, $value);
@@ -179,8 +175,7 @@ interface LdapInterface
/**
* Set options on the current connection.
*
- * @param array $options
- *
+ * @param array $options
* @return void
*/
public function setOptions(array $options = []);
@@ -190,9 +185,8 @@ interface LdapInterface
*
* @see https://www.php.net/manual/en/function.ldap-get-option.php
*
- * @param int $option
- * @param mixed $value
- *
+ * @param int $option
+ * @param mixed $value
* @return mixed
*/
public function getOption($option, &$value = null);
@@ -213,9 +207,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-start-tls.php
*
- * @param string|array $hosts
- * @param int $port
- *
+ * @param string|array $hosts
+ * @param int $port
* @return resource|false
*/
public function connect($hosts = [], $port = 389);
@@ -236,15 +229,14 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-search.php
*
- * @param string $dn
- * @param string $filter
- * @param array $fields
- * @param bool $onlyAttributes
- * @param int $size
- * @param int $time
- * @param int $deref
- * @param array $serverControls
- *
+ * @param string $dn
+ * @param string $filter
+ * @param array $fields
+ * @param bool $onlyAttributes
+ * @param int $size
+ * @param int $time
+ * @param int $deref
+ * @param array $serverControls
* @return resource
*/
public function search($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []);
@@ -254,15 +246,14 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-list.php
*
- * @param string $dn
- * @param string $filter
- * @param array $fields
- * @param bool $onlyAttributes
- * @param int $size
- * @param int $time
- * @param int $deref
- * @param array $serverControls
- *
+ * @param string $dn
+ * @param string $filter
+ * @param array $fields
+ * @param bool $onlyAttributes
+ * @param int $size
+ * @param int $time
+ * @param int $deref
+ * @param array $serverControls
* @return resource
*/
public function listing($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []);
@@ -272,15 +263,14 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-read.php
*
- * @param string $dn
- * @param string $filter
- * @param array $fields
- * @param bool $onlyAttributes
- * @param int $size
- * @param int $time
- * @param int $deref
- * @param array $serverControls
- *
+ * @param string $dn
+ * @param string $filter
+ * @param array $fields
+ * @param bool $onlyAttributes
+ * @param int $size
+ * @param int $time
+ * @param int $deref
+ * @param array $serverControls
* @return resource
*/
public function read($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []);
@@ -290,13 +280,12 @@ interface LdapInterface
*
* @see https://www.php.net/manual/en/function.ldap-parse-result.php
*
- * @param resource $result
- * @param int $errorCode
- * @param ?string $dn
- * @param ?string $errorMessage
- * @param ?array $referrals
- * @param ?array $serverControls
- *
+ * @param resource $result
+ * @param int $errorCode
+ * @param ?string $dn
+ * @param ?string $errorMessage
+ * @param ?array $referrals
+ * @param ?array $serverControls
* @return bool
*/
public function parseResult($result, &$errorCode, &$dn, &$errorMessage, &$referrals, &$serverControls = []);
@@ -307,9 +296,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-bind.php
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return bool
*
* @throws LdapRecordException
@@ -321,9 +309,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-add.php
*
- * @param string $dn
- * @param array $entry
- *
+ * @param string $dn
+ * @param array $entry
* @return bool
*
* @throws LdapRecordException
@@ -335,8 +322,7 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-delete.php
*
- * @param string $dn
- *
+ * @param string $dn
* @return bool
*
* @throws LdapRecordException
@@ -348,11 +334,10 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-rename.php
*
- * @param string $dn
- * @param string $newRdn
- * @param string $newParent
- * @param bool $deleteOldRdn
- *
+ * @param string $dn
+ * @param string $newRdn
+ * @param string $newParent
+ * @param bool $deleteOldRdn
* @return bool
*
* @throws LdapRecordException
@@ -364,9 +349,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-modify.php
*
- * @param string $dn
- * @param array $entry
- *
+ * @param string $dn
+ * @param array $entry
* @return bool
*
* @throws LdapRecordException
@@ -378,9 +362,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-modify-batch.php
*
- * @param string $dn
- * @param array $values
- *
+ * @param string $dn
+ * @param array $values
* @return bool
*
* @throws LdapRecordException
@@ -392,9 +375,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-mod-add.php
*
- * @param string $dn
- * @param array $entry
- *
+ * @param string $dn
+ * @param array $entry
* @return bool
*
* @throws LdapRecordException
@@ -406,9 +388,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-mod-replace.php
*
- * @param string $dn
- * @param array $entry
- *
+ * @param string $dn
+ * @param array $entry
* @return bool
*
* @throws LdapRecordException
@@ -420,9 +401,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-mod-del.php
*
- * @param string $dn
- * @param array $entry
- *
+ * @param string $dn
+ * @param array $entry
* @return bool
*
* @throws LdapRecordException
@@ -434,10 +414,9 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-control-paged-result.php
*
- * @param int $pageSize
- * @param bool $isCritical
- * @param string $cookie
- *
+ * @param int $pageSize
+ * @param bool $isCritical
+ * @param string $cookie
* @return bool
*/
public function controlPagedResult($pageSize = 1000, $isCritical = false, $cookie = '');
@@ -447,9 +426,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-control-paged-result-response.php
*
- * @param resource $result
- * @param string $cookie
- *
+ * @param resource $result
+ * @param string $cookie
* @return bool
*/
public function controlPagedResultResponse($result, &$cookie);
@@ -459,8 +437,7 @@ interface LdapInterface
*
* @see https://www.php.net/manual/en/function.ldap-free-result.php
*
- * @param resource $result
- *
+ * @param resource $result
* @return bool
*/
public function freeResult($result);
@@ -479,8 +456,7 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-err2str.php
*
- * @param int $number
- *
+ * @param int $number
* @return string
*/
public function err2Str($number);
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapRecordException.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapRecordException.php
index b2439bf83..0669b4c65 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapRecordException.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapRecordException.php
@@ -16,9 +16,8 @@ class LdapRecordException extends Exception
/**
* Create a new Bind Exception with a detailed connection error.
*
- * @param Exception $e
- * @param DetailedError|null $error
- *
+ * @param Exception $e
+ * @param DetailedError|null $error
* @return $this
*/
public static function withDetailedError(Exception $e, DetailedError $error = null)
@@ -29,8 +28,7 @@ class LdapRecordException extends Exception
/**
* Set the detailed error.
*
- * @param DetailedError|null $error
- *
+ * @param DetailedError|null $error
* @return $this
*/
public function setDetailedError(DetailedError $error = null)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Concerns/HasPrimaryGroup.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Concerns/HasPrimaryGroup.php
index 97fd3a1fb..b7138d30c 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Concerns/HasPrimaryGroup.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Concerns/HasPrimaryGroup.php
@@ -9,10 +9,9 @@ trait HasPrimaryGroup
/**
* Returns a new has one primary group relationship.
*
- * @param mixed $related
- * @param string $relationKey
- * @param string $foreignKey
- *
+ * @param mixed $related
+ * @param string $relationKey
+ * @param string $foreignKey
* @return HasOnePrimaryGroup
*/
public function hasOnePrimaryGroup($related, $relationKey, $foreignKey = 'primarygroupid')
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php
index 652ad563f..e1a0233cc 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php
@@ -9,6 +9,7 @@ use LdapRecord\Models\Entry as BaseEntry;
use LdapRecord\Models\Events\Updated;
use LdapRecord\Models\Types\ActiveDirectory;
use LdapRecord\Query\Model\ActiveDirectoryBuilder;
+use LdapRecord\Support\Arr;
/** @mixin ActiveDirectoryBuilder */
class Entry extends BaseEntry implements ActiveDirectory
@@ -50,20 +51,46 @@ class Entry extends BaseEntry implements ActiveDirectory
/**
* @inheritdoc
*/
- public function getConvertedSid()
+ public function getConvertedSid($sid = null)
{
try {
- return (string) new Sid($this->getObjectSid());
+ return (string) $this->newObjectSid(
+ $sid ?? $this->getObjectSid()
+ );
} catch (InvalidArgumentException $e) {
return;
}
}
+ /**
+ * @inheritdoc
+ */
+ public function getBinarySid($sid = null)
+ {
+ try {
+ return $this->newObjectSid(
+ $sid ?? $this->getObjectSid()
+ )->getBinary();
+ } catch (InvalidArgumentException $e) {
+ return;
+ }
+ }
+
+ /**
+ * Make a new object Sid instance.
+ *
+ * @param string $value
+ * @return Sid
+ */
+ protected function newObjectSid($value)
+ {
+ return new Sid($value);
+ }
+
/**
* Create a new query builder.
*
- * @param Connection $connection
- *
+ * @param Connection $connection
* @return ActiveDirectoryBuilder
*/
public function newQueryBuilder(Connection $connection)
@@ -84,8 +111,7 @@ class Entry extends BaseEntry implements ActiveDirectory
/**
* Restore a deleted object.
*
- * @param string|null $newParentDn
- *
+ * @param string|null $newParentDn
* @return bool
*
* @throws \LdapRecord\LdapRecordException
@@ -114,24 +140,6 @@ class Entry extends BaseEntry implements ActiveDirectory
$this->save(['isDeleted' => null]);
}
- /**
- * Get the RootDSE (AD schema) record from the directory.
- *
- * @param string|null $connection
- *
- * @return static
- *
- * @throws \LdapRecord\Models\ModelNotFoundException
- */
- public static function getRootDse($connection = null)
- {
- return static::on($connection ?? (new static())->getConnectionName())
- ->in(null)
- ->read()
- ->whereHas('objectclass')
- ->firstOrFail();
- }
-
/**
* Get the objects restore location.
*
@@ -143,22 +151,50 @@ class Entry extends BaseEntry implements ActiveDirectory
}
/**
- * Converts attributes for JSON serialization.
- *
- * @param array $attributes
+ * Convert the attributes for JSON serialization.
*
+ * @param array $attributes
* @return array
*/
protected function convertAttributesForJson(array $attributes = [])
{
$attributes = parent::convertAttributesForJson($attributes);
- if ($this->hasAttribute($this->sidKey)) {
- // If the model has a SID set, we need to convert it due to it being in
- // binary. Otherwise we will receive a JSON serialization exception.
- return array_replace($attributes, [
- $this->sidKey => [$this->getConvertedSid()],
- ]);
+ // If the model has a SID set, we need to convert it to its
+ // string format, due to it being in binary. Otherwise
+ // we will receive a JSON serialization exception.
+ if (isset($attributes[$this->sidKey])) {
+ $attributes[$this->sidKey] = [$this->getConvertedSid(
+ Arr::first($attributes[$this->sidKey])
+ )];
+ }
+
+ return $attributes;
+ }
+
+ /**
+ * Convert the attributes from JSON serialization.
+ *
+ * @param array $attributes
+ * @return array
+ */
+ protected function convertAttributesFromJson(array $attributes = [])
+ {
+ $attributes = parent::convertAttributesFromJson($attributes);
+
+ // Here we are converting the model's GUID and SID attributes
+ // back to their original values from serialization, so that
+ // their original value may be used and compared against.
+ if (isset($attributes[$this->guidKey])) {
+ $attributes[$this->guidKey] = [$this->getBinaryGuid(
+ Arr::first($attributes[$this->guidKey])
+ )];
+ }
+
+ if (isset($attributes[$this->sidKey])) {
+ $attributes[$this->sidKey] = [$this->getBinarySid(
+ Arr::first($attributes[$this->sidKey])
+ )];
}
return $attributes;
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Relations/HasOnePrimaryGroup.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Relations/HasOnePrimaryGroup.php
index 540ec7717..40350c97a 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Relations/HasOnePrimaryGroup.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Relations/HasOnePrimaryGroup.php
@@ -10,8 +10,7 @@ class HasOnePrimaryGroup extends HasOne
/**
* Get the foreign model by the given value.
*
- * @param string $value
- *
+ * @param string $value
* @return Model|null
*/
protected function getForeignModelByValue($value)
@@ -26,8 +25,7 @@ class HasOnePrimaryGroup extends HasOne
*
* Retrieves the last RID from the models Object SID.
*
- * @param Model $model
- *
+ * @param Model $model
* @return string
*/
protected function getForeignValueFromModel(Model $model)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/HasServerRoleAttribute.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/HasServerRoleAttribute.php
index cd08648da..76df79ca3 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/HasServerRoleAttribute.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/HasServerRoleAttribute.php
@@ -11,9 +11,8 @@ class HasServerRoleAttribute implements Scope
/**
* Includes condition of having a serverRole attribute.
*
- * @param Builder $query
- * @param Model $model
- *
+ * @param Builder $query
+ * @param Model $model
* @return void
*/
public function apply(Builder $query, Model $model)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php
index 9f2fbe4d7..dc8a4d21b 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php
@@ -12,9 +12,8 @@ class InConfigurationContext implements Scope
/**
* Refines the base dn to be inside the configuration context.
*
- * @param Builder $query
- * @param Model $model
- *
+ * @param Builder $query
+ * @param Model $model
* @return void
*
* @throws \LdapRecord\Models\ModelNotFoundException
@@ -27,8 +26,7 @@ class InConfigurationContext implements Scope
/**
* Get the LDAP server configuration naming context distinguished name.
*
- * @param Model $model
- *
+ * @param Model $model
* @return mixed
*
* @throws \LdapRecord\Models\ModelNotFoundException
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/RejectComputerObjectClass.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/RejectComputerObjectClass.php
index a616db1c0..9d00cf8fa 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/RejectComputerObjectClass.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/RejectComputerObjectClass.php
@@ -11,9 +11,8 @@ class RejectComputerObjectClass implements Scope
/**
* Prevent computer objects from being included in results.
*
- * @param Builder $query
- * @param Model $model
- *
+ * @param Builder $query
+ * @param Model $model
* @return void
*/
public function apply(Builder $query, Model $model)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php
index b735b03b2..c2ea0325d 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php
@@ -6,6 +6,7 @@ use Carbon\Carbon;
use Illuminate\Contracts\Auth\Authenticatable;
use LdapRecord\Models\ActiveDirectory\Concerns\HasPrimaryGroup;
use LdapRecord\Models\ActiveDirectory\Scopes\RejectComputerObjectClass;
+use LdapRecord\Models\Attributes\AccountControl;
use LdapRecord\Models\Concerns\CanAuthenticate;
use LdapRecord\Models\Concerns\HasPassword;
use LdapRecord\Query\Model\Builder;
@@ -71,6 +72,38 @@ class User extends Entry implements Authenticatable
static::addGlobalScope(new RejectComputerObjectClass());
}
+ /**
+ * Determine if the user's account is enabled.
+ *
+ * @return bool
+ */
+ public function isEnabled()
+ {
+ return ! $this->isDisabled();
+ }
+
+ /**
+ * Determine if the user's account is disabled.
+ *
+ * @return bool
+ */
+ public function isDisabled()
+ {
+ return $this->accountControl()->has(AccountControl::ACCOUNTDISABLE);
+ }
+
+ /**
+ * Get the user's account control.
+ *
+ * @return AccountControl
+ */
+ public function accountControl()
+ {
+ return new AccountControl(
+ $this->getFirstAttribute('userAccountControl')
+ );
+ }
+
/**
* The groups relationship.
*
@@ -110,8 +143,7 @@ class User extends Entry implements Authenticatable
/**
* Scopes the query to exchange mailbox users.
*
- * @param Builder $query
- *
+ * @param Builder $query
* @return Builder
*/
public function scopeWhereHasMailbox(Builder $query)
@@ -122,8 +154,7 @@ class User extends Entry implements Authenticatable
/**
* Scopes the query to users having a lockout value set.
*
- * @param Builder $query
- *
+ * @param Builder $query
* @return Builder
*/
public function scopeWhereHasLockout(Builder $query)
@@ -137,9 +168,8 @@ class User extends Entry implements Authenticatable
* @see https://ldapwiki.com/wiki/Active%20Directory%20Account%20Lockout
* @see https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/account-lockout-duration
*
- * @param string|int $localTimezone
- * @param int|null $durationInMinutes
- *
+ * @param string|int $localTimezone
+ * @param int|null $durationInMinutes
* @return bool
*/
public function isLockedOut($localTimezone, $durationInMinutes = null)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php
index 7e2414629..45fae214d 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php
@@ -6,49 +6,49 @@ use ReflectionClass;
class AccountControl
{
- const SCRIPT = 1;
+ public const SCRIPT = 1;
- const ACCOUNTDISABLE = 2;
+ public const ACCOUNTDISABLE = 2;
- const HOMEDIR_REQUIRED = 8;
+ public const HOMEDIR_REQUIRED = 8;
- const LOCKOUT = 16;
+ public const LOCKOUT = 16;
- const PASSWD_NOTREQD = 32;
+ public const PASSWD_NOTREQD = 32;
- const PASSWD_CANT_CHANGE = 64;
+ public const PASSWD_CANT_CHANGE = 64;
- const ENCRYPTED_TEXT_PWD_ALLOWED = 128;
+ public const ENCRYPTED_TEXT_PWD_ALLOWED = 128;
- const TEMP_DUPLICATE_ACCOUNT = 256;
+ public const TEMP_DUPLICATE_ACCOUNT = 256;
- const NORMAL_ACCOUNT = 512;
+ public const NORMAL_ACCOUNT = 512;
- const INTERDOMAIN_TRUST_ACCOUNT = 2048;
+ public const INTERDOMAIN_TRUST_ACCOUNT = 2048;
- const WORKSTATION_TRUST_ACCOUNT = 4096;
+ public const WORKSTATION_TRUST_ACCOUNT = 4096;
- const SERVER_TRUST_ACCOUNT = 8192;
+ public const SERVER_TRUST_ACCOUNT = 8192;
- const DONT_EXPIRE_PASSWORD = 65536;
+ public const DONT_EXPIRE_PASSWORD = 65536;
- const MNS_LOGON_ACCOUNT = 131072;
+ public const MNS_LOGON_ACCOUNT = 131072;
- const SMARTCARD_REQUIRED = 262144;
+ public const SMARTCARD_REQUIRED = 262144;
- const TRUSTED_FOR_DELEGATION = 524288;
+ public const TRUSTED_FOR_DELEGATION = 524288;
- const NOT_DELEGATED = 1048576;
+ public const NOT_DELEGATED = 1048576;
- const USE_DES_KEY_ONLY = 2097152;
+ public const USE_DES_KEY_ONLY = 2097152;
- const DONT_REQ_PREAUTH = 4194304;
+ public const DONT_REQ_PREAUTH = 4194304;
- const PASSWORD_EXPIRED = 8388608;
+ public const PASSWORD_EXPIRED = 8388608;
- const TRUSTED_TO_AUTH_FOR_DELEGATION = 16777216;
+ public const TRUSTED_TO_AUTH_FOR_DELEGATION = 16777216;
- const PARTIAL_SECRETS_ACCOUNT = 67108864;
+ public const PARTIAL_SECRETS_ACCOUNT = 67108864;
/**
* The account control flag values.
@@ -60,7 +60,7 @@ class AccountControl
/**
* Constructor.
*
- * @param ?int $flag
+ * @param ?int $flag
*/
public function __construct($flag = null)
{
@@ -92,8 +92,7 @@ class AccountControl
/**
* Add the flag to the account control values.
*
- * @param int $flag
- *
+ * @param int $flag
* @return $this
*/
public function add($flag)
@@ -108,8 +107,7 @@ class AccountControl
/**
* Remove the flag from the account control.
*
- * @param int $flag
- *
+ * @param int $flag
* @return $this
*/
public function remove($flag)
@@ -122,8 +120,7 @@ class AccountControl
/**
* Extract and apply the flag.
*
- * @param int $flag
- *
+ * @param int $flag
* @return void
*/
public function apply($flag)
@@ -134,8 +131,7 @@ class AccountControl
/**
* Determine if the account control contains the given UAC flag(s).
*
- * @param int $flag
- *
+ * @param int $flag
* @return bool
*/
public function has($flag)
@@ -154,8 +150,7 @@ class AccountControl
/**
* Determine if the account control does not contain the given UAC flag(s).
*
- * @param int $flag
- *
+ * @param int $flag
* @return bool
*/
public function doesntHave($flag)
@@ -441,8 +436,7 @@ class AccountControl
/**
* Set the account control values.
*
- * @param array
+ */
+class UninitializedStub extends ConstStub
+{
+ public function __construct(\ReflectionProperty $property)
+ {
+ parent::__construct('?'.($property->hasType() ? ' '.$property->getType() : ''), 'Uninitialized property');
+ }
+}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php
index 721513c5d..1cfcf4dd8 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php
@@ -1,4 +1,5 @@
'XML_DECLARATION',
];
+ /**
+ * @return array
+ */
public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, bool $isNested)
{
try {
@@ -51,7 +55,7 @@ class XmlReaderCaster
'VALIDATE' => @$reader->getParserProperty(\XMLReader::VALIDATE),
'SUBST_ENTITIES' => @$reader->getParserProperty(\XMLReader::SUBST_ENTITIES),
];
- } catch (\Error $e) {
+ } catch (\Error) {
$properties = [
'LOADDTD' => false,
'DEFAULTATTRS' => false,
@@ -81,6 +85,7 @@ class XmlReaderCaster
$info[$props]->cut = $count;
}
+ $a = Caster::filter($a, Caster::EXCLUDE_UNINITIALIZED, [], $count);
$info = Caster::filter($info, Caster::EXCLUDE_EMPTY, [], $count);
// +2 because hasValue and hasAttributes are always filtered
$stub->cut += $count + 2;
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php
index ba55fcedd..0cf42584a 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php
@@ -47,6 +47,9 @@ class XmlResourceCaster
\XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING',
];
+ /**
+ * @return array
+ */
public static function castXml($h, array $a, Stub $stub, bool $isNested)
{
$a['current_byte_index'] = xml_get_current_byte_index($h);
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php
index b835c0336..fc330bae2 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php
@@ -28,6 +28,7 @@ abstract class AbstractCloner implements ClonerInterface
'Symfony\Component\VarDumper\Caster\CutArrayStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castCutArray'],
'Symfony\Component\VarDumper\Caster\ConstStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castStub'],
'Symfony\Component\VarDumper\Caster\EnumStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castEnum'],
+ 'Symfony\Component\VarDumper\Caster\ScalarStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castScalar'],
'Fiber' => ['Symfony\Component\VarDumper\Caster\FiberCaster', 'castFiber'],
@@ -66,9 +67,6 @@ abstract class AbstractCloner implements ClonerInterface
'DOMAttr' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castAttr'],
'DOMElement' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castElement'],
'DOMText' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castText'],
- 'DOMTypeinfo' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castTypeinfo'],
- 'DOMDomError' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDomError'],
- 'DOMLocator' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLocator'],
'DOMDocumentType' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocumentType'],
'DOMNotation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNotation'],
'DOMEntity' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castEntity'],
@@ -92,10 +90,12 @@ abstract class AbstractCloner implements ClonerInterface
'Symfony\Component\HttpFoundation\Request' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castRequest'],
'Symfony\Component\Uid\Ulid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUlid'],
'Symfony\Component\Uid\Uuid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUuid'],
+ 'Symfony\Component\VarExporter\Internal\LazyObjectState' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castLazyObjectState'],
'Symfony\Component\VarDumper\Exception\ThrowingCasterException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castThrowingCasterException'],
'Symfony\Component\VarDumper\Caster\TraceStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castTraceStub'],
'Symfony\Component\VarDumper\Caster\FrameStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFrameStub'],
'Symfony\Component\VarDumper\Cloner\AbstractCloner' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
+ 'Symfony\Component\ErrorHandler\Exception\FlattenException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFlattenException'],
'Symfony\Component\ErrorHandler\Exception\SilencedErrorContext' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castSilencedErrorContext'],
'Imagine\Image\ImageInterface' => ['Symfony\Component\VarDumper\Caster\ImagineCaster', 'castImage'],
@@ -127,9 +127,11 @@ abstract class AbstractCloner implements ClonerInterface
'SplObjectStorage' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castObjectStorage'],
'SplPriorityQueue' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'],
'OuterIterator' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castOuterIterator'],
+ 'WeakMap' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castWeakMap'],
'WeakReference' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castWeakReference'],
'Redis' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'],
+ 'Relay\Relay' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'],
'RedisArray' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisArray'],
'RedisCluster' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisCluster'],
@@ -163,7 +165,6 @@ abstract class AbstractCloner implements ClonerInterface
'GdImage' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'],
':gd' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'],
- ':mysql link' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castMysqlLink'],
':pgsql large object' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLargeObject'],
':pgsql link' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLink'],
':pgsql link persistent' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLink'],
@@ -191,6 +192,9 @@ abstract class AbstractCloner implements ClonerInterface
'RdKafka\Topic' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopic'],
'RdKafka\TopicPartition' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopicPartition'],
'RdKafka\TopicConf' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopicConf'],
+
+ 'FFI\CData' => ['Symfony\Component\VarDumper\Caster\FFICaster', 'castCTypeOrCData'],
+ 'FFI\CType' => ['Symfony\Component\VarDumper\Caster\FFICaster', 'castCTypeOrCData'],
];
protected $maxItems = 2500;
@@ -215,12 +219,9 @@ abstract class AbstractCloner implements ClonerInterface
*
* @see addCasters
*/
- public function __construct(array $casters = null)
+ public function __construct(?array $casters = null)
{
- if (null === $casters) {
- $casters = static::$defaultCasters;
- }
- $this->addCasters($casters);
+ $this->addCasters($casters ?? static::$defaultCasters);
}
/**
@@ -232,6 +233,8 @@ abstract class AbstractCloner implements ClonerInterface
* see e.g. static::$defaultCasters.
*
* @param callable[] $casters A map of casters
+ *
+ * @return void
*/
public function addCasters(array $casters)
{
@@ -242,6 +245,8 @@ abstract class AbstractCloner implements ClonerInterface
/**
* Sets the maximum number of items to clone past the minimum depth in nested structures.
+ *
+ * @return void
*/
public function setMaxItems(int $maxItems)
{
@@ -250,6 +255,8 @@ abstract class AbstractCloner implements ClonerInterface
/**
* Sets the maximum cloned length for strings.
+ *
+ * @return void
*/
public function setMaxString(int $maxString)
{
@@ -259,6 +266,8 @@ abstract class AbstractCloner implements ClonerInterface
/**
* Sets the minimum tree depth where we are guaranteed to clone all the items. After this
* depth is reached, only setMaxItems items will be cloned.
+ *
+ * @return void
*/
public function setMinDepth(int $minDepth)
{
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php
index 6ecb883e8..16f51b0c7 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php
@@ -17,7 +17,7 @@ use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider;
/**
* @author Nicolas Grekas
*/
-class Data implements \ArrayAccess, \Countable, \IteratorAggregate
+class Data implements \ArrayAccess, \Countable, \IteratorAggregate, \Stringable
{
private array $data;
private int $position = 0;
@@ -121,6 +121,9 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
yield from $value;
}
+ /**
+ * @return mixed
+ */
public function __get(string $key)
{
if (null !== $data = $this->seek($key)) {
@@ -211,6 +214,11 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
return $data;
}
+ public function getContext(): array
+ {
+ return $this->context;
+ }
+
/**
* Seeks to a specific key in nested data structures.
*/
@@ -257,21 +265,21 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
/**
* Dumps data with a DumperInterface dumper.
+ *
+ * @return void
*/
public function dump(DumperInterface $dumper)
{
$refs = [0];
$cursor = new Cursor();
+ $cursor->hashType = -1;
+ $cursor->attr = $this->context[SourceContextProvider::class] ?? [];
+ $label = $this->context['label'] ?? '';
- if ($cursor->attr = $this->context[SourceContextProvider::class] ?? []) {
- $cursor->attr['if_links'] = true;
- $cursor->hashType = -1;
- $dumper->dumpScalar($cursor, 'default', '^');
- $cursor->attr = ['if_links' => true];
- $dumper->dumpScalar($cursor, 'default', ' ');
- $cursor->hashType = 0;
+ if ($cursor->attr || '' !== $label) {
+ $dumper->dumpScalar($cursor, 'label', $label);
}
-
+ $cursor->hashType = 0;
$this->dumpItem($dumper, $cursor, $refs, $this->data[$this->position][$this->key]);
}
@@ -280,7 +288,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
*
* @param mixed $item A Stub object or the original value being dumped
*/
- private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, mixed $item)
+ private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, mixed $item): void
{
$cursor->refIndex = 0;
$cursor->softRefTo = $cursor->softRefHandle = $cursor->softRefCount = 0;
@@ -362,6 +370,10 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
$dumper->leaveHash($cursor, $item->type, $item->class, $withChildren, $cut);
break;
+ case Stub::TYPE_SCALAR:
+ $dumper->dumpScalar($cursor, 'default', $item->attr['value']);
+ break;
+
default:
throw new \RuntimeException(sprintf('Unexpected Stub type: "%s".', $item->type));
}
@@ -402,7 +414,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
return $hashCut;
}
- private function getStub(mixed $item)
+ private function getStub(mixed $item): mixed
{
if (!$item || !\is_array($item)) {
return $item;
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php
index 61d02d240..4c5b315b6 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php
@@ -20,6 +20,8 @@ interface DumperInterface
{
/**
* Dumps a scalar value.
+ *
+ * @return void
*/
public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value);
@@ -29,6 +31,8 @@ interface DumperInterface
* @param string $str The string being dumped
* @param bool $bin Whether $str is UTF-8 or binary encoded
* @param int $cut The number of characters $str has been cut by
+ *
+ * @return void
*/
public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut);
@@ -38,6 +42,8 @@ interface DumperInterface
* @param int $type A Cursor::HASH_* const for the type of hash
* @param string|int|null $class The object class, resource type or array count
* @param bool $hasChild When the dump of the hash has child item
+ *
+ * @return void
*/
public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild);
@@ -48,6 +54,8 @@ interface DumperInterface
* @param string|int|null $class The object class, resource type or array count
* @param bool $hasChild When the dump of the hash has child item
* @param int $cut The number of items the hash has been cut by
+ *
+ * @return void
*/
public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut);
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php
index 1c5b88712..0c2a4b9d0 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php
@@ -23,6 +23,7 @@ class Stub
public const TYPE_ARRAY = 3;
public const TYPE_OBJECT = 4;
public const TYPE_RESOURCE = 5;
+ public const TYPE_SCALAR = 6;
public const STRING_BINARY = 1;
public const STRING_UTF8 = 2;
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php
index 9afcc348a..e168d0d3b 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php
@@ -16,12 +16,8 @@ namespace Symfony\Component\VarDumper\Cloner;
*/
class VarCloner extends AbstractCloner
{
- private static string $gid;
private static array $arrayCache = [];
- /**
- * {@inheritdoc}
- */
protected function doClone(mixed $var): array
{
$len = 1; // Length of $queue
@@ -44,7 +40,6 @@ class VarCloner extends AbstractCloner
$stub = null; // Stub capturing the main properties of an original item value
// or null if the original value is used directly
- $gid = self::$gid ??= md5(random_bytes(6)); // Unique string used to detect the special $GLOBALS variable
$arrayStub = new Stub();
$arrayStub->type = Stub::TYPE_ARRAY;
$fromObjCast = false;
@@ -121,53 +116,15 @@ class VarCloner extends AbstractCloner
}
$stub = $arrayStub;
- if (\PHP_VERSION_ID >= 80100) {
- $stub->class = array_is_list($v) ? Stub::ARRAY_INDEXED : Stub::ARRAY_ASSOC;
- $a = $v;
- break;
- }
-
- $stub->class = Stub::ARRAY_INDEXED;
-
- $j = -1;
- foreach ($v as $gk => $gv) {
- if ($gk !== ++$j) {
- $stub->class = Stub::ARRAY_ASSOC;
- $a = $v;
- $a[$gid] = true;
- break;
- }
- }
-
- // Copies of $GLOBALS have very strange behavior,
- // let's detect them with some black magic
- if (isset($v[$gid])) {
- unset($v[$gid]);
- $a = [];
- foreach ($v as $gk => &$gv) {
- if ($v === $gv && !isset($hardRefs[\ReflectionReference::fromArrayElement($v, $gk)->getId()])) {
- unset($v);
- $v = new Stub();
- $v->value = [$v->cut = \count($gv), Stub::TYPE_ARRAY => 0];
- $v->handle = -1;
- $gv = &$a[$gk];
- $hardRefs[\ReflectionReference::fromArrayElement($a, $gk)->getId()] = &$gv;
- $gv = $v;
- }
-
- $a[$gk] = &$gv;
- }
- unset($gv);
- } else {
- $a = $v;
- }
+ $stub->class = array_is_list($v) ? Stub::ARRAY_INDEXED : Stub::ARRAY_ASSOC;
+ $a = $v;
break;
case \is_object($v):
if (empty($objRefs[$h = spl_object_id($v)])) {
$stub = new Stub();
$stub->type = Stub::TYPE_OBJECT;
- $stub->class = \get_class($v);
+ $stub->class = $v::class;
$stub->value = $v;
$stub->handle = $h;
$a = $this->castObject($stub, 0 < $i);
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php
index e3d5f1d11..4450fe986 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php
@@ -26,7 +26,7 @@ use Symfony\Component\VarDumper\Dumper\CliDumper;
*/
class CliDescriptor implements DumpDescriptorInterface
{
- private $dumper;
+ private CliDumper $dumper;
private mixed $lastIdentifier = null;
public function __construct(CliDumper $dumper)
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php
index 1c0d80a05..98f150a5e 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php
@@ -24,7 +24,7 @@ use Symfony\Component\VarDumper\Dumper\HtmlDumper;
*/
class HtmlDescriptor implements DumpDescriptorInterface
{
- private $dumper;
+ private HtmlDumper $dumper;
private bool $initialized = false;
public function __construct(HtmlDumper $dumper)
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php b/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php
index 13dd475b5..b64a884b9 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php
@@ -38,7 +38,7 @@ use Symfony\Component\VarDumper\Server\DumpServer;
#[AsCommand(name: 'server:dump', description: 'Start a dump server that collects and displays dumps in a single place')]
class ServerDumpCommand extends Command
{
- private $server;
+ private DumpServer $server;
/** @var DumpDescriptorInterface[] */
private array $descriptors;
@@ -54,7 +54,7 @@ class ServerDumpCommand extends Command
parent::__construct();
}
- protected function configure()
+ protected function configure(): void
{
$this
->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', implode(', ', $this->getAvailableFormats())), 'cli')
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php
index 6ac380836..53165ba64 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php
@@ -26,12 +26,15 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
public const DUMP_COMMA_SEPARATOR = 4;
public const DUMP_TRAILING_COMMA = 8;
+ /** @var callable|resource|string|null */
public static $defaultOutput = 'php://output';
protected $line = '';
+ /** @var callable|null */
protected $lineDumper;
+ /** @var resource|null */
protected $outputStream;
- protected $decimalPoint; // This is locale dependent
+ protected $decimalPoint = '.';
protected $indentPad = ' ';
protected $flags;
@@ -42,12 +45,10 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
* @param string|null $charset The default character encoding to use for non-UTF8 strings
* @param int $flags A bit field of static::DUMP_* constants to fine tune dumps representation
*/
- public function __construct($output = null, string $charset = null, int $flags = 0)
+ public function __construct($output = null, ?string $charset = null, int $flags = 0)
{
$this->flags = $flags;
- $this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
- $this->decimalPoint = localeconv();
- $this->decimalPoint = $this->decimalPoint['decimal_point'];
+ $this->setCharset($charset ?: \ini_get('php.output_encoding') ?: \ini_get('default_charset') ?: 'UTF-8');
$this->setOutput($output ?: static::$defaultOutput);
if (!$output && \is_string(static::$defaultOutput)) {
static::$defaultOutput = $this->outputStream;
@@ -57,9 +58,9 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
/**
* Sets the output destination of the dumps.
*
- * @param callable|resource|string $output A line dumper callable, an opened stream or an output path
+ * @param callable|resource|string|null $output A line dumper callable, an opened stream or an output path
*
- * @return callable|resource|string The previous output destination
+ * @return callable|resource|string|null The previous output destination
*/
public function setOutput($output)
{
@@ -73,7 +74,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
$output = fopen($output, 'w');
}
$this->outputStream = $output;
- $this->lineDumper = [$this, 'echoLine'];
+ $this->lineDumper = $this->echoLine(...);
}
return $prev;
@@ -120,9 +121,6 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
*/
public function dump(Data $data, $output = null): ?string
{
- $this->decimalPoint = localeconv();
- $this->decimalPoint = $this->decimalPoint['decimal_point'];
-
if ($locale = $this->flags & (self::DUMP_COMMA_SEPARATOR | self::DUMP_TRAILING_COMMA) ? setlocale(\LC_NUMERIC, 0) : null) {
setlocale(\LC_NUMERIC, 'C');
}
@@ -160,6 +158,8 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
*
* @param int $depth The recursive depth in the dumped structure for the line being dumped,
* or -1 to signal the end-of-dump to the line dumper callable
+ *
+ * @return void
*/
protected function dumpLine(int $depth)
{
@@ -169,6 +169,8 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
/**
* Generic line dumper callback.
+ *
+ * @return void
*/
protected function echoLine(string $line, int $depth, string $indentPad)
{
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php
index f6e290ca4..af9637072 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php
@@ -22,6 +22,7 @@ use Symfony\Component\VarDumper\Cloner\Stub;
class CliDumper extends AbstractDumper
{
public static $defaultColors;
+ /** @var callable|resource|string|null */
public static $defaultOutput = 'php://stdout';
protected $colors;
@@ -51,6 +52,7 @@ class CliDumper extends AbstractDumper
"\r" => '\r',
"\033" => '\e',
];
+ protected static $unicodeCharsRx = "/[\u{00A0}\u{00AD}\u{034F}\u{061C}\u{115F}\u{1160}\u{17B4}\u{17B5}\u{180E}\u{2000}-\u{200F}\u{202F}\u{205F}\u{2060}-\u{2064}\u{206A}-\u{206F}\u{3000}\u{2800}\u{3164}\u{FEFF}\u{FFA0}\u{1D159}\u{1D173}-\u{1D17A}]/u";
protected $collapseNextHash = false;
protected $expandNextHash = false;
@@ -61,10 +63,7 @@ class CliDumper extends AbstractDumper
private bool $handlesHrefGracefully;
- /**
- * {@inheritdoc}
- */
- public function __construct($output = null, string $charset = null, int $flags = 0)
+ public function __construct($output = null, ?string $charset = null, int $flags = 0)
{
parent::__construct($output, $charset, $flags);
@@ -83,11 +82,13 @@ class CliDumper extends AbstractDumper
]);
}
- $this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
+ $this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
}
/**
* Enables/disables colored output.
+ *
+ * @return void
*/
public function setColors(bool $colors)
{
@@ -96,6 +97,8 @@ class CliDumper extends AbstractDumper
/**
* Sets the maximum number of characters per line for dumped strings.
+ *
+ * @return void
*/
public function setMaxStringWidth(int $maxStringWidth)
{
@@ -106,6 +109,8 @@ class CliDumper extends AbstractDumper
* Configures styles.
*
* @param array $styles A map of style names to style definitions
+ *
+ * @return void
*/
public function setStyles(array $styles)
{
@@ -116,6 +121,8 @@ class CliDumper extends AbstractDumper
* Configures display options.
*
* @param array $displayOptions A map of display options to customize the behavior
+ *
+ * @return void
*/
public function setDisplayOptions(array $displayOptions)
{
@@ -123,11 +130,12 @@ class CliDumper extends AbstractDumper
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value)
{
$this->dumpKey($cursor);
+ $this->collapseNextHash = $this->expandNextHash = false;
$style = 'const';
$attr = $cursor->attr;
@@ -137,6 +145,11 @@ class CliDumper extends AbstractDumper
$style = 'default';
break;
+ case 'label':
+ $this->styles += ['label' => $this->styles['default']];
+ $style = 'label';
+ break;
+
case 'integer':
$style = 'num';
@@ -153,17 +166,12 @@ class CliDumper extends AbstractDumper
$style = 'float';
}
- switch (true) {
- case \INF === $value: $value = 'INF'; break;
- case -\INF === $value: $value = '-INF'; break;
- case is_nan($value): $value = 'NAN'; break;
- default:
- $value = (string) $value;
- if (!str_contains($value, $this->decimalPoint)) {
- $value .= $this->decimalPoint.'0';
- }
- break;
- }
+ $value = match (true) {
+ \INF === $value => 'INF',
+ -\INF === $value => '-INF',
+ is_nan($value) => 'NAN',
+ default => !str_contains($value = (string) $value, $this->decimalPoint) ? $value .= $this->decimalPoint.'0' : $value,
+ };
break;
case 'NULL':
@@ -186,11 +194,12 @@ class CliDumper extends AbstractDumper
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut)
{
$this->dumpKey($cursor);
+ $this->collapseNextHash = $this->expandNextHash = false;
$attr = $cursor->attr;
if ($bin) {
@@ -198,13 +207,16 @@ class CliDumper extends AbstractDumper
}
if ('' === $str) {
$this->line .= '""';
+ if ($cut) {
+ $this->line .= '…'.$cut;
+ }
$this->endValue($cursor);
} else {
$attr += [
'length' => 0 <= $cut ? mb_strlen($str, 'UTF-8') + $cut : 0,
'binary' => $bin,
];
- $str = $bin && false !== strpos($str, "\0") ? [$str] : explode("\n", $str);
+ $str = $bin && str_contains($str, "\0") ? [$str] : explode("\n", $str);
if (isset($str[1]) && !isset($str[2]) && !isset($str[1][0])) {
unset($str[1]);
$str[0] .= "\n";
@@ -274,15 +286,14 @@ class CliDumper extends AbstractDumper
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild)
{
- if (null === $this->colors) {
- $this->colors = $this->supportsColors();
- }
+ $this->colors ??= $this->supportsColors();
$this->dumpKey($cursor);
+ $this->expandNextHash = false;
$attr = $cursor->attr;
if ($this->collapseNextHash) {
@@ -315,7 +326,7 @@ class CliDumper extends AbstractDumper
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut)
{
@@ -332,6 +343,8 @@ class CliDumper extends AbstractDumper
*
* @param bool $hasChild When the dump of the hash has child item
* @param int $cut The number of items the hash has been cut by
+ *
+ * @return void
*/
protected function dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut)
{
@@ -348,6 +361,8 @@ class CliDumper extends AbstractDumper
/**
* Dumps a key in a hash structure.
+ *
+ * @return void
*/
protected function dumpKey(Cursor $cursor)
{
@@ -437,12 +452,11 @@ class CliDumper extends AbstractDumper
*/
protected function style(string $style, string $value, array $attr = []): string
{
- if (null === $this->colors) {
- $this->colors = $this->supportsColors();
- }
+ $this->colors ??= $this->supportsColors();
$this->handlesHrefGracefully ??= 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR')
- && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100);
+ && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100)
+ && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']);
if (isset($attr['ellipsis'], $attr['ellipsis-type'])) {
$prefix = substr($value, 0, -$attr['ellipsis']);
@@ -474,7 +488,15 @@ class CliDumper extends AbstractDumper
return $s.$endCchr;
}, $value, -1, $cchrCount);
- if ($this->colors) {
+ if (!($attr['binary'] ?? false)) {
+ $value = preg_replace_callback(static::$unicodeCharsRx, function ($c) use (&$cchrCount, $startCchr, $endCchr) {
+ ++$cchrCount;
+
+ return $startCchr.'\u{'.strtoupper(dechex(mb_ord($c[0]))).'}'.$endCchr;
+ }, $value);
+ }
+
+ if ($this->colors && '' !== $value) {
if ($cchrCount && "\033" === $value[0]) {
$value = substr($value, \strlen($startCchr));
} else {
@@ -497,10 +519,15 @@ class CliDumper extends AbstractDumper
}
}
if (isset($attr['href'])) {
+ if ('label' === $style) {
+ $value .= '^';
+ }
$value = "\033]8;;{$attr['href']}\033\\{$value}\033]8;;\033\\";
}
- } elseif ($attr['if_links'] ?? false) {
- return '';
+ }
+
+ if ('label' === $style && '' !== $value) {
+ $value .= ' ';
}
return $value;
@@ -511,7 +538,7 @@ class CliDumper extends AbstractDumper
if ($this->outputStream !== static::$defaultOutput) {
return $this->hasColorSupport($this->outputStream);
}
- if (null !== static::$defaultColors) {
+ if (isset(static::$defaultColors)) {
return static::$defaultColors;
}
if (isset($_SERVER['argv'][1])) {
@@ -546,16 +573,23 @@ class CliDumper extends AbstractDumper
}
/**
- * {@inheritdoc}
+ * @return void
*/
protected function dumpLine(int $depth, bool $endOfValue = false)
{
+ if (null === $this->colors) {
+ $this->colors = $this->supportsColors();
+ }
+
if ($this->colors) {
$this->line = sprintf("\033[%sm%s\033[m", $this->styles['default'], $this->line);
}
parent::dumpLine($depth);
}
+ /**
+ * @return void
+ */
protected function endValue(Cursor $cursor)
{
if (-1 === $cursor->hashType) {
@@ -632,7 +666,7 @@ class CliDumper extends AbstractDumper
return $result;
}
- private function getSourceLink(string $file, int $line)
+ private function getSourceLink(string $file, int $line): string|false
{
if ($fmt = $this->displayOptions['fileLinkFormat']) {
return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : ($fmt->format($file, $line) ?: 'file://'.$file.'#L'.$line);
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php
index 3684a4753..69dff067b 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php
@@ -22,8 +22,8 @@ use Symfony\Component\VarDumper\Cloner\VarCloner;
*/
final class RequestContextProvider implements ContextProviderInterface
{
- private $requestStack;
- private $cloner;
+ private RequestStack $requestStack;
+ private VarCloner $cloner;
public function __construct(RequestStack $requestStack)
{
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php
index 8ef6e360e..cadddfac4 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php
@@ -11,7 +11,8 @@
namespace Symfony\Component\VarDumper\Dumper\ContextProvider;
-use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
+use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter;
+use Symfony\Component\HttpKernel\Debug\FileLinkFormatter as LegacyFileLinkFormatter;
use Symfony\Component\VarDumper\Cloner\VarCloner;
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
use Symfony\Component\VarDumper\VarDumper;
@@ -28,9 +29,9 @@ final class SourceContextProvider implements ContextProviderInterface
private int $limit;
private ?string $charset;
private ?string $projectDir;
- private $fileLinkFormatter;
+ private FileLinkFormatter|LegacyFileLinkFormatter|null $fileLinkFormatter;
- public function __construct(string $charset = null, string $projectDir = null, FileLinkFormatter $fileLinkFormatter = null, int $limit = 9)
+ public function __construct(?string $charset = null, ?string $projectDir = null, FileLinkFormatter|LegacyFileLinkFormatter|null $fileLinkFormatter = null, int $limit = 9)
{
$this->charset = $charset;
$this->projectDir = $projectDir;
@@ -44,7 +45,7 @@ final class SourceContextProvider implements ContextProviderInterface
$file = $trace[1]['file'];
$line = $trace[1]['line'];
- $name = false;
+ $name = '-' === $file || 'Standard input code' === $file ? 'Standard input code' : false;
$fileExcerpt = false;
for ($i = 2; $i < $this->limit; ++$i) {
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php
index 18ab56ebd..84cfb4259 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php
@@ -19,7 +19,7 @@ use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
*/
class ContextualizedDumper implements DataDumperInterface
{
- private $wrappedDumper;
+ private DataDumperInterface $wrappedDumper;
private array $contextProviders;
/**
@@ -31,13 +31,16 @@ class ContextualizedDumper implements DataDumperInterface
$this->contextProviders = $contextProviders;
}
+ /**
+ * @return string|null
+ */
public function dump(Data $data)
{
- $context = [];
+ $context = $data->getContext();
foreach ($this->contextProviders as $contextProvider) {
- $context[\get_class($contextProvider)] = $contextProvider->getContext();
+ $context[$contextProvider::class] = $contextProvider->getContext();
}
- $this->wrappedDumper->dump($data->withContext($context));
+ return $this->wrappedDumper->dump($data->withContext($context));
}
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php
index b173bccf3..df05b6af5 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php
@@ -20,5 +20,8 @@ use Symfony\Component\VarDumper\Cloner\Data;
*/
interface DataDumperInterface
{
+ /**
+ * @return string|null
+ */
public function dump(Data $data);
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php
index 40e97a534..ea09e6819 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php
@@ -21,6 +21,7 @@ use Symfony\Component\VarDumper\Cloner\Data;
*/
class HtmlDumper extends CliDumper
{
+ /** @var callable|resource|string|null */
public static $defaultOutput = 'php://output';
protected static $themes = [
@@ -74,19 +75,16 @@ class HtmlDumper extends CliDumper
];
private array $extraDisplayOptions = [];
- /**
- * {@inheritdoc}
- */
- public function __construct($output = null, string $charset = null, int $flags = 0)
+ public function __construct($output = null, ?string $charset = null, int $flags = 0)
{
AbstractDumper::__construct($output, $charset, $flags);
$this->dumpId = 'sf-dump-'.mt_rand();
- $this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
+ $this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
$this->styles = static::$themes['dark'] ?? self::$themes['dark'];
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function setStyles(array $styles)
{
@@ -94,6 +92,9 @@ class HtmlDumper extends CliDumper
$this->styles = $styles + $this->styles;
}
+ /**
+ * @return void
+ */
public function setTheme(string $themeName)
{
if (!isset(static::$themes[$themeName])) {
@@ -107,6 +108,8 @@ class HtmlDumper extends CliDumper
* Configures display options.
*
* @param array $displayOptions A map of display options to customize the behavior
+ *
+ * @return void
*/
public function setDisplayOptions(array $displayOptions)
{
@@ -116,6 +119,8 @@ class HtmlDumper extends CliDumper
/**
* Sets an HTML header that will be dumped once in the output stream.
+ *
+ * @return void
*/
public function setDumpHeader(?string $header)
{
@@ -124,6 +129,8 @@ class HtmlDumper extends CliDumper
/**
* Sets an HTML prefix and suffix that will encapse every single dump.
+ *
+ * @return void
*/
public function setDumpBoundaries(string $prefix, string $suffix)
{
@@ -131,9 +138,6 @@ class HtmlDumper extends CliDumper
$this->dumpSuffix = $suffix;
}
- /**
- * {@inheritdoc}
- */
public function dump(Data $data, $output = null, array $extraDisplayOptions = []): ?string
{
$this->extraDisplayOptions = $extraDisplayOptions;
@@ -145,6 +149,8 @@ class HtmlDumper extends CliDumper
/**
* Dumps the HTML header.
+ *
+ * @return string
*/
protected function getDumpHeader()
{
@@ -158,19 +164,15 @@ class HtmlDumper extends CliDumper