Fix leftover reference to RUNTIME in Profile.php
parent
f87fa5d5bb
commit
8e20909f23
|
@ -229,13 +229,11 @@ class Profile extends \Mcp\RequestHandler
|
||||||
|
|
||||||
private function setNamePart(string $part, string $value, string $otherPart, string $otherValue): bool
|
private function setNamePart(string $part, string $value, string $otherPart, string $otherValue): bool
|
||||||
{
|
{
|
||||||
global $RUNTIME;
|
$query = $this->app->db()->prepare('SELECT 1 FROM UserAccounts WHERE '.$part.' = ? AND '.$otherPart.' = ?');
|
||||||
|
|
||||||
$query = $RUNTIME['PDO']->prepare('SELECT 1 FROM UserAccounts WHERE '.$part.' = ? AND '.$otherPart.' = ?');
|
|
||||||
$query->execute(array($value, $otherValue));
|
$query->execute(array($value, $otherValue));
|
||||||
|
|
||||||
if ($query->rowCount() == 0) {
|
if ($query->rowCount() == 0) {
|
||||||
$statement = $RUNTIME['PDO']->prepare('UPDATE UserAccounts SET '.$part.' = ? WHERE PrincipalID = ?');
|
$statement = $this->app->db()->prepare('UPDATE UserAccounts SET '.$part.' = ? WHERE PrincipalID = ?');
|
||||||
$statement->execute(array($value, $_SESSION['UUID']));
|
$statement->execute(array($value, $_SESSION['UUID']));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue