Move identity deletion into OpenSim function
parent
c5871a626b
commit
d6ca2e6e00
|
@ -267,6 +267,23 @@
|
|||
}
|
||||
}
|
||||
|
||||
public function deleteIdentity($uuid, $identId): bool
|
||||
{
|
||||
global $RUNTIME;
|
||||
|
||||
$statementValidate = $RUNTIME['PDO']->prepare('SELECT 1 FROM UserIdentitys WHERE PrincipalID = ? AND IdentityID = ?');
|
||||
$statementValidate->execute([$uuid, $identId]);
|
||||
|
||||
if($statementValidate->fetch()) {
|
||||
$statementDelete = $RUNTIME['PDO']->prepare('DELETE FROM UserAccounts WHERE PrincipalID = ?');
|
||||
$statementDelete->execute([$identId]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function gen_uuid()
|
||||
{
|
||||
return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
|
||||
|
|
|
@ -89,13 +89,8 @@
|
|||
));
|
||||
|
||||
if ($validator->isValid($_POST)) {
|
||||
$statementValidate = $RUNTIME['PDO']->prepare('SELECT 1 FROM UserIdentitys WHERE PrincipalID = ? AND IdentityID = ?');
|
||||
$statementValidate->execute([$_SESSION['UUID'], $_POST['uuid']]);
|
||||
|
||||
if($statementValidate->fetch()) {
|
||||
$statementDelete = $RUNTIME['PDO']->prepare('DELETE FROM UserAccounts WHERE PrincipalID = ?');
|
||||
$statementDelete->execute([$_POST['uuid']]);
|
||||
}
|
||||
include_once 'app/OpenSim.php';
|
||||
(new OpenSim())->deleteIdentity($_SESSION['UUID'], $_POST['uuid']);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue