Esempio n. 1
0
 /**
  * Gets a meta value from website.
  *
  * @param string $meta : the meta name to get
  * @return string The website meta value
  * @access public
  */
 function getMetaFromWebsite($meta)
 {
     if ($this->_checkWebsite()) {
         return $this->_website->getMeta($meta);
     } else {
         return false;
     }
 }
Esempio n. 2
0
define("MESSAGE_PAGE_FIELD_SUB_DOMAINS", 1603);
define("MESSAGE_PAGE_FIELD_SUB_DOMAINS_DESC", 1604);
define("MESSAGE_PAGE_CODENAMES", 1683);
define("MESSAGE_PAGE_FIELD_CODENAME", 1675);
define("MESSAGE_PAGE_TREEH1", 1049);
define("MESSAGE_PAGE_FIELD_403_PAGE", 1719);
define("MESSAGE_PAGE_FIELD_404_PAGE", 1718);
define("MESSAGE_PAGE_FIELD_REDIRECT_ALT_DOMAINS", 1741);
define("MESSAGE_PAGE_FIELD_REDIRECT_ALT_DOMAINS_DESC", 1742);
define("MESSAGE_PAGE_ERROR_CODENAME", 1747);
//RIGHTS CHECK
if (!$cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_REGENERATEPAGES)) {
    Header("Location: " . PATH_ADMIN_SPECIAL_ENTRY_WR . "?cms_message_id=" . MESSAGE_CLEARANCE_INSUFFICIENT . "&" . session_name() . "=" . session_id());
    exit;
}
$website = new CMS_website($_GET["website"]);
$grand_root = CMS_tree::getRoot();
//website root page change
if ($_GET["cms_action"] == "set_root" && $_GET["website_root"]) {
    $page = CMS_tree::getPageByID($_GET["website_root"]);
    //must check that the page ain't the root of another website already
    $all_websites = CMS_websitesCatalog::getAll();
    foreach ($all_websites as $aWebsite) {
        $current_root = $aWebsite->getRoot();
        if ($current_root->getID() == $page->getID() && $aWebsite->getID() != $website->getID()) {
            Header("Location: websites.php?cms_message_id=" . MESSAGE_PAGE_ROOT_ALREADY_USED . "&" . session_name() . "=" . session_id());
            exit;
        }
    }
    if (!$website->setRoot($page)) {
        Header("Location: websites.php?cms_message_id=" . MESSAGE_PAGE_ROOT_SET_ERROR . "&" . session_name() . "=" . session_id());
Esempio n. 3
0
 /**
  * Returns all the websites, sorted by label.
  * Static function.
  *
  * @param string $orderby, order of the websites returned in : label (default) or id
  * @return array(CMS_website)
  * @access public
  */
 static function getAll($orderby = 'label')
 {
     static $websites;
     if (!isset($websites[$orderby])) {
         $sql = "\n\t\t\t\tselect\n\t\t\t\t\tid_web\n\t\t\t\tfrom\n\t\t\t\t\twebsites\n\t\t\t\torder by\n\t\t\t\t\t" . sensitiveIO::sanitizeSQLString($orderby) . "_web\n\t\t\t";
         $q = new CMS_query($sql);
         $websites[$orderby] = array();
         while ($id = $q->getValue("id_web")) {
             $ws = new CMS_website($id);
             if (!$ws->hasError()) {
                 $websites[$orderby][$ws->getID()] = $ws;
             }
         }
     }
     return $websites[$orderby];
 }