28 lines
818 B
PHP
28 lines
818 B
PHP
<?php
|
|
namespace nur\ldap\app;
|
|
|
|
class LdapGetInfosApp extends LdapApplication {
|
|
const ARGS = [
|
|
"merge" => parent::ARGS,
|
|
["-o", "--output", "args" => 1],
|
|
["-f", "--overwrite-shared", "value" => true],
|
|
["-u", "--update", "value" => true, "help" => "Mettre à jour le fichier de connexion (nécessite --config et implique --output et --overwrite-shared)"]
|
|
];
|
|
|
|
protected $output, $overwriteShared = false;
|
|
protected $update = false;
|
|
|
|
function main() {
|
|
$conn = $this->getConn();
|
|
if ($this->update) {
|
|
$config = $this->config;
|
|
if ($config === null) {
|
|
self::die("Vous devez spécifier la configuration à mettre à jour");
|
|
}
|
|
$this->output = $config;
|
|
$this->overwriteShared = true;
|
|
}
|
|
$conn->saveConfig($this->output, $this->overwriteShared);
|
|
}
|
|
}
|