You are here

function flickr_user_find_by_identifier in Flickr 6

Same name and namespace in other branches
  1. 5 flickr.inc \flickr_user_find_by_identifier()
  2. 7 flickr.inc \flickr_user_find_by_identifier()

Tries to match an 'identifier' onto a flickr nsid.

This function will first see whether $identifier is already a nsid (format check only, no api call). If it is not and the identifier has the format of an email, an api call will be made to check whether there is an nsid for that email. If this is not the case, the $identifier is treated as a username and an api call is made to find the nsid for that username.

If none of these succeed, the result will be false

Parameters

$identifier: identifier to find an nsid for

Return value

valid nsid or false if none can be found

6 calls to flickr_user_find_by_identifier()
flickr_admin_settings_submit in ./flickr.admin.inc
flickr_admin_settings_validate in ./flickr.admin.inc
flickr_block in block/flickr_block.module
Implements hook_block().
flickr_photos in ./flickr.module
flickr_user in ./flickr.module
Implements hook_user(). Add an extra field for the user to enter his flickr identifier.

... See full list

File

./flickr.inc, line 368

Code

function flickr_user_find_by_identifier($identifier) {
  if (flickr_is_nsid($identifier)) {

    // Identifier is an NSID.
    return $identifier;
  }
  if (valid_email_address($identifier) && ($user = flickr_user_find_by_email($identifier))) {
    return $user['nsid'];
  }
  if ($user = flickr_user_find_by_username($identifier)) {
    return $user['nsid'];
  }
  return FALSE;
}