You are here

function photos_access_request_album_password in Album Photos 8.4

Same name and namespace in other branches
  1. 8.5 photos_access/photos_access.module \photos_access_request_album_password()
  2. 6.0.x photos_access/photos_access.module \photos_access_request_album_password()

Album password check.

2 calls to photos_access_request_album_password()
photos_access_node_access in photos_access/photos_access.module
Implements hook_ENTITY_TYPE_access().
_photos_access in ./photos.module
Photos access checks for different operations.

File

photos_access/photos_access.module, line 348
Implementation of photos_access.module.

Code

function photos_access_request_album_password() {
  $args = \Drupal::moduleHandler()
    ->invokeAll('photos_access');
  if (is_array($args)) {
    $current_path = \Drupal::service('path.current')
      ->getPath();
    $path_args = explode('/', $current_path);
    foreach ($args as $arg) {
      if ($arg && isset($path_args[2])) {
        if ($path_args[2]) {
          if ($path_args[2] == 'album') {
            $t = _photos_access_pass_type($path_args[3]);
          }
          else {
            $t = _photos_access_pass_type($path_args[2]);
          }
        }
        if (isset($t['view'])) {
          if ($t['view']->viewid == 3) {
            photos_access_pass_validate($t);
          }
        }
      }
    }
  }
}