mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 09:43:03 +00:00
Overhaul ability to edit own account
* Restructure account.php to remove redundant code. * Remove own_account_details(). * Rework logic check to default to no access to account edit form. * Make default account action viewing account info. Signed-off-by: canyonknight <canyonknight@gmail.com> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
d6f89f97c0
commit
e84eb4ae54
3 changed files with 11 additions and 44 deletions
|
@ -719,24 +719,6 @@ function account_details($uid, $username, $dbh=NULL) {
|
|||
return $row;
|
||||
}
|
||||
|
||||
function own_account_details($sid, $dbh=NULL) {
|
||||
if(!$dbh) {
|
||||
$dbh = db_connect();
|
||||
}
|
||||
$q = "SELECT Users.*, AccountTypes.AccountType ";
|
||||
$q.= "FROM Users, AccountTypes, Sessions ";
|
||||
$q.= "WHERE AccountTypes.ID = Users.AccountTypeID ";
|
||||
$q.= "AND Users.ID = Sessions.UsersID ";
|
||||
$q.= "AND Sessions.SessionID = " . $dbh->quote($sid);
|
||||
$result = $dbh->query($q);
|
||||
|
||||
if ($result) {
|
||||
$row = $result->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
function tu_voted($voteid, $uid, $dbh=NULL) {
|
||||
if (!$dbh) {
|
||||
$dbh = db_connect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue