1 user.module | user_is_login_path($path = NULL) |
Determines whether a path is one related to the user login process.
Typical paths include "user/login", "user/password", and "user/register", but other paths can be added by contrib modules via hook_user_login_paths().
Parameters
$path: A Backdrop path. If empty, the current path will be used.
Return value
bool: TRUE if the path is administrative, FALSE otherwise.
See also
File
- core/
modules/ user/ user.module, line 1382 - Enables the user registration and login system.
Code
function user_is_login_path($path = NULL) {
if ($path === NULL) {
$path = current_path();
}
// Keep a static cache per path lookup (usually for the current path).
$path_map = &backdrop_static(__FUNCTION__);
if (!isset($path_map['login'][$path])) {
$patterns = user_get_user_login_paths();
$path_map['login'][$path] = backdrop_match_path($path, implode("\n", $patterns['login']));
$path_map['non_login'][$path] = backdrop_match_path($path, implode("\n", $patterns['non_login']));
}
return $path_map['login'][$path] && !$path_map['non_login'][$path];
}