public function load() { parent::load(); $this->load_daterangequery(); $model = new VirtualOrganization(); $vos = $model->getindex(); $logmodel = new OIMLog(); //grab current status as initial status foreach ($vos as $vo_id => $vo) { $vo = $vo[0]; $this->current[$vo_id] = array((int) $vo->active, (int) $vo->disable); } //get all logs for VOModel (don't worry.. for now VO doesn't get updated that often) $logs = $logmodel->getByModel("edu.iu.grid.oim.model.db.VOModel"); //apply update upto $end_time foreach ($logs as $log) { $timestamp = (int) $log->unix_timestamp; if ($timestamp > $this->view->end_time) { $this->update($log->xml); } } //now analyze current status foreach ($this->current as $vo_id => $cur) { $this->analyze($vo_id, $cur); } //now analyze the log between $start and $end foreach ($logs as $log) { $timestamp = (int) $log->unix_timestamp; if ($timestamp <= $this->view->end_time && $timestamp >= $this->view->start_time) { $vo_id = $this->update($log->xml); if ($vo_id != null) { //each time update occurs, re-analyze $this->analyze($vo_id, $cur); } } } //finally, construct various lists $this->view->active_once_vos = array(); $this->view->never_active_enabled_vos = array(); $this->view->never_never_vos = array(); foreach ($vos as $vo_id => $vo) { $vo = $vo[0]; if (in_array($vo_id, $this->active_vos)) { //has been active at least once $this->view->active_once_vos[$vo->id] = $vo; } else { if (in_array($vo_id, $this->enabled_vos)) { //never active, and enabled at least once $this->view->never_active_enabled_vos[$vo->id] = $vo; } else { //never active, and has never enabled $this->view->never_never_vos[$vo->id] = $vo; } } } $this->setpagetitle(self::default_title()); }
public function load() { parent::load(); $model = new VirtualOrganization(); $vos = $model->getindex(); $model = new VOMS(); $voms = $model->get(); $this->view->timestamp = $model->getTimestamp(); $this->view->voms_status = array(); foreach ($this->vo_ids as $vo_id) { $info = $vos[$vo_id][0]; //capitaliza to increase chance of VO name match (until we use OIM based vomses) $name = strtoupper($info->name); $this->view->voms_status[$vo_id] = array("info" => $info, "voms" => @$voms[$name]); } $this->setpagetitle(self::default_title()); }
public function load() { parent::load(); $model = new VirtualOrganization(); $vos = $model->getindex(); $scmodel = new SupportCenters(); $scs = $scmodel->getindex(); if (isset($_REQUEST["summary_attrs_showmember_resource"])) { $this->view->resource_ownerships = array(); $ownmodel = new VOOwnedResources(); $resource_ownerships = $ownmodel->getindex(); $rmodel = new Resource(); $rs = $rmodel->getindex(); foreach ($this->vo_ids as $vo_id) { $resource_list = array(); if (isset($resource_ownerships[$vo_id])) { foreach ($resource_ownerships[$vo_id] as $resource_ownership) { $resource = $rs[$resource_ownership->resource_id][0]; $resource_list[$resource->id] = $resource; } } $this->view->resource_ownerships[$vo_id] = $resource_list; } } if (isset($_REQUEST["summary_attrs_showfield_of_science"])) { $vofsmodel = new VOFieldOfScience(); $vofss = $vofsmodel->getindex(); $this->view->field_of_science = array(); foreach ($this->vo_ids as $vo_id) { $fs_for_vo = @$vofss[$vo_id]; if ($fs_for_vo !== null) { $ranks = array(); foreach ($fs_for_vo as $fs) { $name = $fs->name; $rank_id = $fs->rank_id; if (!isset($ranks[$rank_id])) { $ranks[$rank_id] = array(); } $ranks[$rank_id][$name] = $fs; } ksort($ranks); $this->view->field_of_science[$vo_id] = $ranks; } } } if (isset($_REQUEST["summary_attrs_showreporting_group"])) { $reportmodel = new VOReport(); $reports = $reportmodel->getindex(); $fqanmodel = new VOReportFQAN(); $fqans = $fqanmodel->getindex(); $contactmodel = new VOReportContact(); $contacts = $contactmodel->getindex(); $this->view->reports = array(); foreach ($this->vo_ids as $vo_id) { $this->view->reports[$vo_id] = array(); if (isset($reports[$vo_id])) { foreach ($reports[$vo_id] as $report) { $report->fqans = @$fqans[$report->id]; $report->contacts = @$contacts[$report->id]; $this->view->reports[$vo_id][] = $report; } } } } if (isset($_REQUEST["summary_attrs_showparent_vo"])) { $model = new VOVO(); $this->view->vovo = $model->getindex(); } if (isset($_REQUEST["summary_attrs_showcontact"])) { $this->view->contacts = array(); $cmodel = new VOContact(); $contacts = $cmodel->getindex(); //group by contact_type_id foreach ($this->vo_ids as $vo_id) { $types = array(); if (isset($contacts[$vo_id])) { foreach ($contacts[$vo_id] as $contact) { if (!isset($types[$contact->contact_type])) { $types[$contact->contact_type] = array(); } $types[$contact->contact_type][] = $contact; } $this->view->contacts[$vo_id] = $types; } } } if (isset($_REQUEST["summary_attrs_showoasis"])) { $model = new VOOasisUser(); $oasis_managers = $model->getindex($this->vo_ids); $grouped = array(); foreach ($oasis_managers as $vo_id => $managers) { if (!isset($grouped[$vo_id])) { $grouped[$vo_id] = array(); } //group by contact_id foreach ($managers as $manager) { $manager = (array) $manager; $contactid = $manager["contact_id"]; if (!isset($grouped[$vo_id][$contactid])) { $manager["dns"] = array($manager["dn"]); $grouped[$vo_id][$contactid] = $manager; } else { $grouped[$vo_id][$contactid]["dns"][] = $manager["dn"]; } } } $this->view->oasis_managers = $grouped; } $this->view->vos = array(); foreach ($this->vo_ids as $vo_id) { $vo = $vos[$vo_id][0]; //lookup support center $vo->sc = $scs[$vo->sc_id][0]; $this->view->vos[$vo_id] = $vo; //parse oasis_repo_urls if (!is_null($vo->oasis_repo_urls)) { $vo->oasis_repo_urls = explode("|", $vo->oasis_repo_urls, -1); } } $this->setpagetitle(self::default_title()); }