*/
class User
{
+ /**
+ * @brief Returns the user id of a given profile url
+ *
+ * @param string $profile
+ *
+ * @return integer user id
+ */
+ public static function getIdForURL($url)
+ {
+ $self = DBA::selectFirst('contact', ['uid'], ['nurl' => normalise_link($url), 'self' => true]);
+ if (!DBA::isResult($self)) {
+ return false;
+ } else {
+ return $self['uid'];
+ }
+ }
+
/**
* @brief Get owner data by user id
*
$spubkey = $sres['pubkey'];
$insert_result = DBA::insert('user', [
- 'guid' => System::createGUID(32),
+ 'guid' => System::createUUID(),
'username' => $username,
'password' => $new_password_encoded,
'email' => $email,