public function newprofileAction() { $this->_helper->layout->disableLayout(); if ($this->session->isNewUser !== true && $this->session->userid !== -1) { $this->_helper->viewRenderer->setNoRender(); header("Location: " . "https://" . $_SERVER['HTTP_HOST']); return; } $profiles = array(SamlAuth::initNewUserProfile($this->session)); $this->view->profiles = $profiles; $this->view->session = $this->session; //Add helper data for possible editing of a new profile //Create position types list $ptypes = new Default_Model_PositionTypes(); $ptypes->filter->orderBy('ord'); $positiontypes = array('ids' => array(), 'vals' => array()); for ($i = 0; $i < count($ptypes->items); $i += 1) { $ptype = $ptypes->items[$i]; array_push($positiontypes["ids"], stripslashes($ptype->id)); array_push($positiontypes["vals"], stripslashes($ptype->description)); } $this->view->positionTypes = json_encode($positiontypes); //Create countries list $cntrs = new Default_Model_Countries(); $cntrs->filter->orderBy('name'); $countries = array('ids' => array(), 'vals' => array()); for ($i = 0; $i < count($cntrs->items); $i += 1) { $country = $cntrs->items[$i]; array_push($countries['ids'], $country->id); array_push($countries['vals'], $country->name); } $this->view->countries = json_encode($countries); //Create contacttype list $ctypes = new Default_Model_ContactTypes(); $ctypes->filter->orderBy('description'); $contactTypes = array('ids' => array(), 'vals' => array()); for ($i = 0; $i < count($ctypes->items); $i += 1) { $ctype = $ctypes->items[$i]; array_push($contactTypes['ids'], $ctype->id); array_push($contactTypes['vals'], $ctype->description); } $this->view->contactTypes = json_encode($contactTypes); }