getUsersLoginWithSiteAccess() public method

public getUsersLoginWithSiteAccess ( $idSite, $access )
Example #1
0
 public function getUsersWithSiteAccess($idSite, $access)
 {
     Piwik::checkUserHasAdminAccess($idSite);
     $this->checkAccessType($access);
     $logins = $this->model->getUsersLoginWithSiteAccess($idSite, $access);
     if (empty($logins)) {
         return array();
     }
     $logins = implode(',', $logins);
     return $this->getUsers($logins);
 }
Example #2
0
 /**
  * Hooks when a website tracker cache is flushed (website/user updated, cache deleted, or empty cache)
  * Will record in the tracker config file the list of Admin token_auth for this website. This
  * will be used when the Tracking API is used with setIp(), setForceDateTime(), setVisitorId(), etc.
  *
  * @param $attributes
  * @param $idSite
  * @return void
  */
 public function recordAdminUsersInCache(&$attributes, $idSite)
 {
     // add the 'hosts' entry in the website array
     $model = new Model();
     $logins = $model->getUsersLoginWithSiteAccess($idSite, 'admin');
     if (empty($logins)) {
         return;
     }
     $users = $model->getUsers($logins);
     $tokens = array();
     foreach ($users as $user) {
         $tokens[] = $user['token_auth'];
     }
     $attributes['admin_token_auth'] = $tokens;
 }