Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117513984
D5595.1774851874.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D5595.1774851874.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 30, 6:24 AM (3 d, 12 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18779469
Default Alt Text
D5595.1774851874.diff (2 KB)
Attached To
Mode
D5595: LDAP commands
Attached
Detach File
Event Timeline