diff --git a/scripts/extractPhotos.php b/scripts/extractPhotos.php index 0b27c4d..1b95615 100644 --- a/scripts/extractPhotos.php +++ b/scripts/extractPhotos.php @@ -1,21 +1,21 @@ + * @copyright 2024 City of Bloomington, Indiana + * @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE */ +declare (strict_types=1); include '../bootstrap.php'; use Application\Models\DepartmentGateway; -$gateway = new DepartmentGateway(); +$dn = 'OU=Utilities,OU=Departments,DC=cob,DC=bloomington,DC=in,DC=gov'; +$staff = DepartmentGateway::search($dn, []); +foreach ($staff as $p) { + $user = $p->username; + $data = $p->getPhoto(); + echo "$user\n"; -$people = $gateway->getPeople(); -foreach ($people as $p) { - $username = $p->username; - echo "$username\n"; - $data = $gateway->getPhoto($username); if ($data) { - file_put_contents("./users/$username.jpg", $data); + file_put_contents("./users/$user.jpg", $data); } }