|
@@ 67-71 (lines=5) @@
|
| 64 |
|
$maxid = $this->processProvider->executeSudoCommand("dscl . list /Users UniqueID | awk '{print $2}' | sort -ug | tail -1"); |
| 65 |
|
$maxid = $maxid + 1; |
| 66 |
|
$this->processProvider->executeSudoCommand('dscl . create /Users/' . $userName); |
| 67 |
|
if (file_exists("/usr/local/bin/bash")){ |
| 68 |
|
$this->processProvider->executeSudoCommand('dscl . create /Users/' . $userName . ' UserShell /usr/local/bin/bash'); |
| 69 |
|
} else { |
| 70 |
|
$this->processProvider->executeSudoCommand('dscl . create /Users/' . $userName . ' UserShell /bin/bash'); |
| 71 |
|
} |
| 72 |
|
$this->processProvider->executeSudoCommand('dscl . create /Users/' . $userName . ' NFSHomeDirectory ' . $this->app["config"]["projects"]["path"] . "/" . $userName); |
| 73 |
|
$this->processProvider->executeSudoCommand('dscl . create /Users/' . $userName . ' PrimaryGroupID 20'); |
| 74 |
|
$this->processProvider->executeSudoCommand('dscl . create /Users/' . $userName . ' UniqueID ' . $maxid); |
|
@@ 177-182 (lines=6) @@
|
| 174 |
|
public function removeUser($userName, $groupName) |
| 175 |
|
{ |
| 176 |
|
if ($this->isUser($userName)) { |
| 177 |
|
if (PHP_OS == "Darwin") { |
| 178 |
|
$this->processProvider->executeSudoCommand('dscl . delete /Users/' . $userName); |
| 179 |
|
$this->processProvider->executeSudoCommand('dscl . delete /Groups/' . $groupName); |
| 180 |
|
} else { |
| 181 |
|
$this->processProvider->executeSudoCommand('userdel ' . $userName); |
| 182 |
|
} |
| 183 |
|
} |
| 184 |
|
} |
| 185 |
|
} |