summaryrefslogtreecommitdiffstats
path: root/web/lib/aur.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib/aur.inc.php')
-rw-r--r--web/lib/aur.inc.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php
index 7d65913..9015ae8 100644
--- a/web/lib/aur.inc.php
+++ b/web/lib/aur.inc.php
@@ -467,6 +467,21 @@ function uid_from_username($username) {
}
/**
+ * Determine the user's ID in the database using a username or email address
+ *
+ * @param string $username The username or email address of an account
+ *
+ * @return string Return user ID if exists, otherwise null
+ */
+function uid_from_loginname($loginname) {
+ $uid = uid_from_username($loginname);
+ if (!$uid) {
+ $uid = uid_from_email($loginname);
+ }
+ return $uid;
+}
+
+/**
* Determine the user's ID in the database using an e-mail address
*
* @param string $email An e-mail address in foo@example.com format