Skip to content

Commit

Permalink
Username and origin ID matching check on app sharing.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Jul 25, 2024
1 parent a15acae commit 1a7e1c5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions controller/apps.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,17 @@ public static function shareApp($originId, $username, $password, $appKey, $appId
}

global $db_conn;
$res = mysqli_query(
$db_conn,
"SELECT * FROM accounts WHERE id=".$originId." AND username=\"".$username."\""
);

if(mysqli_num_rows($res) != 1) {
Response::failedMessage("Account must be the same with the application owner.");
return;
}
freeDBQuery($res);

$res = mysqli_query(
$db_conn,
"SELECT * FROM accounts WHERE id=".$originId." AND email=\"".$email."\""
Expand Down

0 comments on commit 1a7e1c5

Please sign in to comment.