Esempio n. 1
0
 public function wizard_siteName()
 {
     if (!isset($_SESSION['CATS']) || empty($_SESSION['CATS'])) {
         echo 'CATS has lost your session!';
         return;
     }
     /* Bail out if the user doesn't have SA permissions. */
     if ($this->_realAccessLevel < ACCESS_LEVEL_SA) {
         echo 'You do not have permission to change the site name.';
         return;
     }
     if (isset($_GET['siteName']) && !empty($_GET['siteName'])) {
         $siteName = $_GET['siteName'];
     } else {
         $siteName = '';
     }
     if ($siteName == 'default_site' || strlen($siteName) <= 0) {
         echo 'That is not a valid site name. Please choose a different one.';
         return;
     }
     $site = new Site($this->_siteID);
     $site->setName($siteName);
     $companies = new Companies($this->_siteID);
     $companyIDInternal = $companies->add('Internal Postings', '', '', '', '', '', '', '', '', '', '', '', '', 'Internal postings.', $this->_userID, $this->_userID);
     $companies->setCompanyDefault($companyIDInternal);
     $_SESSION['CATS']->setSiteName($siteName);
     echo 'Ok';
 }