Skip to content

Commit

Permalink
Updated the exportPhotos script
Browse files Browse the repository at this point in the history
It has been many years since we've used this script.  It had not been updated to work with the last rewrite of the system.

Updates #52
  • Loading branch information
inghamn committed Oct 25, 2024
1 parent 1917ed6 commit c1d5379
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scripts/extractPhotos.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?php
/**
* @copyright 2014 City of Bloomington, Indiana
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
* @author Cliff Ingham <[email protected]>
* @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);
}
}

0 comments on commit c1d5379

Please sign in to comment.