コード例 #1
0
ファイル: IEScript.php プロジェクト: stpq/icinga_configurator
 /**
  * Vrací všechna data uživatele
  *
  * @return array
  */
 public function getAllUserData()
 {
     $AllData = parent::getAllUserData();
     foreach ($AllData as $ADkey => $AD) {
         unset($AllData[$ADkey]['deploy']);
         unset($AllData[$ADkey]['script_type']);
         unset($AllData[$ADkey]['script_local']);
         unset($AllData[$ADkey]['script_remote']);
     }
     return $AllData;
 }
コード例 #2
0
 /**
  * Vrací všechna data uživatele
  *
  * @return array
  */
 public function getAllUserData()
 {
     $user = EaseShared::user();
     $userID = $user->getUserID();
     $allData = parent::getAllUserData();
     foreach ($allData as $adKey => $ad) {
         if ($allData[$adKey]['check_command-remote']) {
             $params = ' ' . $allData[$adKey]['check_command-remote'] . '!' . $allData[$adKey]['check_command-params'];
         } else {
             $params = ' ' . $allData[$adKey]['check_command-params'];
         }
         unset($allData[$adKey]['check_command-remote']);
         unset($allData[$adKey]['check_command-params']);
         $allData[$adKey]['check_command'] .= $params;
         unset($allData[$adKey]['tcp_port']);
         if (is_array($ad['contacts']) && count($ad['contacts'])) {
             //Projít kontakty, vyhodit nevlastněné uživatelem
             foreach ($ad['contacts'] as $ContactID => $ContactName) {
                 $contactUserID = $this->myDbLink->QueryToValue('SELECT `user_id` FROM ' . 'contact WHERE contact_id=' . $ContactID);
                 if ($userID != $contactUserID) {
                     unset($allData[$adKey]['contacts'][$ContactID]);
                 }
             }
         }
         if (is_array($ad['host_name']) && count($ad['host_name'])) {
             //Projít kontakty, vyhodit nevlastněné uživatelem
             foreach ($ad['host_name'] as $hostID => $HostName) {
                 $hostUserID = $this->myDbLink->QueryToValue('SELECT `user_id` FROM host WHERE host_id=' . $hostID);
                 if ($userID != $hostUserID) {
                     unset($allData[$adKey]['host_name'][$hostID]);
                 }
             }
         }
         if (!$this->isTemplate($allData[$adKey])) {
             if (!strlen($allData[$adKey]['display_name'])) {
                 $allData[$adKey]['display_name'] = $allData[$adKey][$this->nameColumn];
             }
             $allData[$adKey][$this->nameColumn] = $allData[$adKey][$this->nameColumn] . '-' . EaseShared::user()->getUserLogin();
             //Přejmenovat službu podle uživatele
             if (!count($allData[$adKey]['host_name'])) {
                 //Negenerovat nepoužité služby
                 unset($allData[$adKey]);
             }
         }
     }
     return $allData;
 }
コード例 #3
0
 public function getAllUserData()
 {
     $allData = parent::getAllUserData();
     foreach ($allData as $key => $dataRow) {
         $periods = $dataRow['periods'];
         if (is_array($periods) && count($periods)) {
             foreach ($periods as $TimeName => $TimeInterval) {
                 $this->useKeywords[$TimeName] = true;
             }
             unset($allData[$key]['periods']);
             if (count($periods)) {
                 $allData[$key] = array_merge($allData[$key], $periods);
             }
         }
     }
     return $allData;
 }