Page MenuHomePhorge

D5595.1774827427.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D5595.1774827427.diff

diff --git a/src/app/Console/Commands/Ldap/DomainCommand.php b/src/app/Console/Commands/Ldap/DomainCommand.php
new file mode 100644
--- /dev/null
+++ b/src/app/Console/Commands/Ldap/DomainCommand.php
@@ -0,0 +1,49 @@
+<?php
+
+namespace App\Console\Commands\Ldap;
+
+use App\Console\Command;
+use App\Support\Facades\LDAP;
+
+class DomainCommand extends Command
+{
+ /**
+ * The name and signature of the console command.
+ *
+ * @var string
+ */
+ protected $signature = 'ldap:domain {action} {domain}';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = "Execute actions on the ldap backend for a domain";
+
+ /**
+ * Execute the console command.
+ *
+ * @return mixed
+ */
+ public function handle()
+ {
+ $action = $this->argument('action');
+ $domain = $this->getDomain($this->argument('domain'));
+
+ if (!$domain) {
+ $this->error("Domain not found.");
+ return 1;
+ }
+
+ if ($action == "create") {
+ LDAP::createDomain($domain);
+ }
+ if ($action == "update") {
+ LDAP::updateDomain($domain);
+ }
+ if ($action == "delete") {
+ LDAP::deleteDomain($domain);
+ }
+ }
+}
diff --git a/src/app/Console/Commands/Ldap/UserCommand.php b/src/app/Console/Commands/Ldap/UserCommand.php
new file mode 100644
--- /dev/null
+++ b/src/app/Console/Commands/Ldap/UserCommand.php
@@ -0,0 +1,49 @@
+<?php
+
+namespace App\Console\Commands\Ldap;
+
+use App\Console\Command;
+use App\Support\Facades\LDAP;
+
+class UserCommand extends Command
+{
+ /**
+ * The name and signature of the console command.
+ *
+ * @var string
+ */
+ protected $signature = 'ldap:user {action} {user}';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = "Execute actions on the ldap backend for a user";
+
+ /**
+ * Execute the console command.
+ *
+ * @return mixed
+ */
+ public function handle()
+ {
+ $action = $this->argument('action');
+ $user = $this->getUser($this->argument('user'));
+
+ if (!$user) {
+ $this->error("User not found.");
+ return 1;
+ }
+
+ if ($action == "create") {
+ LDAP::createUser($user);
+ }
+ if ($action == "update") {
+ LDAP::updateUser($user);
+ }
+ if ($action == "delete") {
+ LDAP::deleteUser($user);
+ }
+ }
+}

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 29, 11:37 PM (3 d, 12 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18779469
Default Alt Text
D5595.1774827427.diff (2 KB)

Event Timeline