Beispiel #1
0
	 *	along with N/X; if not, write to the Free Software
	 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
	 **********************************************************************/
	require_once "../../config.inc.php";

	require_once "purge_lib.inc.php";
	includePGNSources();
	$auth = new auth("PURGE_DATABASE");
	$page = new page("Purge");

	if (!isset($go))
		$go = "start";

	$page->tipp = $lang->get("help_purge", "Deletes unnecessary information from the database.");
	
	$form = new CommitForm($lang->get("purge"), "i_purge.gif");
	$form->addToTopText($lang->get("purge_mes"));

	$expiredHandler = new ActionHandler("expired");
	$expiredHandler->addFNCAction("purgeExpired");
	$form->addCheck("expired", $lang->get("purge_expired"), $expiredHandler);

	$folderHandler = new ActionHandler("folders");
	$folderHandler->addDBAction("DELETE FROM categories WHERE DELETED=1");
	$form->addCheck("folders", $lang->get("purge_folder"), $folderHandler);

	$variationHandler = new ActionHandler("variations");
	$variationHandler->addFNCAction("purgeVariations");
	$form->addCheck("variations", $lang->get("purge_var"), $variationHandler);

	$contentHandler = new ActionHandler("content");
Beispiel #2
0
<?php

require_once "../../config.inc.php";
require "sitemap.php";
$auth = new auth("GOOGLESITEMAP");
$page = new page("Google Sitemaps");
$variations = createDBCArray("variations", "VARIATION_ID", "1");
if (!isset($go)) {
    $go = "start";
}
$form = new CommitForm($lang->get("udgoogles", 'Update Google Sitemaps'));
$updateHandler = new ActionHandler("updategs");
$updateHandler->addFNCAction("updateSitemap");
$form->addCheck("updategs", $lang->get("startgoogles", 'Update the Google Sitemap XML to: ') . $c["host"] . $c["livedocroot"] . 'sitemap.xml', $updateHandler);
$page->add($form);
$page->draw();
$db->close();
/**
 *  Creates the new sitemap.xml
 */
function updateSitemap()
{
    global $c;
    // Create sitemap
    $map = new GoogleSiteMap();
    // Get the startnode of the live website;
    $startNode = translateState(0, 10);
    // Is there a live-website?
    if (strlen($startNode) > 0) {
        addWebsite($startNode, $map);
        $map->CloseMap();
	 *
	 *	You should have received a copy of the GNU General Public License
	 *	along with N/X; if not, write to the Free Software
	 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
	 **********************************************************************/
	require "../../config.inc.php";

	$auth = new auth("MAINTENANCE");
	$page = new page("Rebuild Cache");

	$go = value("go");

	if ($go == "0")
		$go = "start";

	$form = new CommitForm($lang->get("rb_cache", "Rebuild Cache"));
	$form->addToTopText($lang->get("mt_rb_cache_mes", "Rebuild Cache of all live pages"));
	$maintenanceHandler = new ActionHandler("generate");
	$maintenanceHandler->addFncAction("rebuildRecipeCache");
	$form->addCheck("generate", $lang->get("rb_cache", "Rebuild Cache"), $maintenanceHandler);

	$page->add($form);	
	$page->draw();
	$db->close();

	function rebuildRecipeCache() {
	  global $db;
  	  $recipes = createNameValueArrayEx("pgn_recipes", "NAME", "ID", "1");

	}
	 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
	 **********************************************************************/
	require "../../config.inc.php";

	$filtermenu = new StdMenu('Synchronize Languages');
	include "menu.php";	
	
	$auth = new auth("SYNC_CLUSTERS");
	$page = new page("Synchronize Clusters");

	$go = value("go");

	if ($go == "0")
		$go = "start";

	$form = new CommitForm($lang->get("sync_clusters"));
	$form->addToTopText($lang->get("sync_lang_desc", "Creates an instance of each content in all languages defined."));
	$maintenanceHandler = new ActionHandler("sync");
	$maintenanceHandler->addFncAction("syncLanguages");
	$form->addCheck("sync", $lang->get("sync_lang", 'Synchronize Languages')." ", $maintenanceHandler);

	$page->add($form);
	$page->addMenu($filtermenu);
	$page->draw();
	$db->close();
	
	function syncLanguages() {
	  global $db, $auth;
	  $variations = createDBCArray('variations', 'VARIATION_ID');
	  // enable languages in all templates
	  $spms = createDBCArray('sitepage_master', 'SPM_ID', 'VERSION=0');
	 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
	 **********************************************************************/
	require "../../config.inc.php";

	require "menudef.inc.php";
	$menu->tipp= $lang->get("help_synccl", "A feature used for synchronizing clusters after having modified/changed a cluster template.");
	
	$auth = new auth("SYNC_CLUSTERS");
	$page = new page("Synchronize Clusters");

	$go = value("go");

	if ($go == "0")
		$go = "start";

	$form = new CommitForm($lang->get("sync_clusters"));
	$form->addToTopText($lang->get("sync_clusters_descr", "Whe you are changing a cluster template, the clusters are not automatically synched. They are synched when you are working with them the next time. You can sync all of them here."));
	$maintenanceHandler = new ActionHandler("sync");
	$maintenanceHandler->addFncAction("syncClids");
	$form->addCheck("sync", $lang->get("sync_clusters")." ", $maintenanceHandler);

	$page->add($form);
	$page->addMenu($menu);
	$page->draw();
	$db->close();
	
	function syncClids() {
	   global $db, $form;
	   $counter = 0;
	   $sql = "SELECT cv.CLID FROM cluster_variations cv, cluster_node cn WHERE cv.DELETED=0 AND cv.CLNID=cn.CLNID AND cn.VERSION=0";	
	   $query = new query($db, $sql);
Beispiel #6
0
<?php

require "../../config.inc.php";
$filtermenu = new StdMenu('Export Translation File');
include "menu.php";
$auth = new auth("SYNC_CLUSTERS");
$page = new page("Export Translation File");
$go = value("go");
$export = "";
if ($go == "0") {
    $go = "start";
}
$form = new CommitForm('Export Translation');
$form->addToTopText('Export Translation File as CSV');
$maintenanceHandler = new ActionHandler("export");
$maintenanceHandler->addFncAction("exportLanguages");
$form->addCheck("export", "Export ", $maintenanceHandler);
$page->add($form);
$page->addMenu($filtermenu);
$page->draw();
$db->close();
if ($export != "") {
    echo '<textarea style="width:600px;height:300px;font-size:9px;">' . $export . '</textarea>';
}
function exportLanguages()
{
    global $export, $recordsets;
    $variations = createDBCArray("variations", "VARIATION_ID", '1', 'ORDER BY VARIATION_ID ASC');
    $variations2 = createDBCArray("variations", "SHORTTEXT", '1', 'ORDER BY VARIATION_ID ASC');
    $export = 'TYPE|KEY1|KEY2';
    for ($i = 0; $i < count($variations2); $i++) {
	 *
	 *	You should have received a copy of the GNU General Public License
	 *	along with N/X; if not, write to the Free Software
	 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
	 **********************************************************************/
	require "../../config.inc.php";

	$auth = new auth("MAINTENANCE");
	$page = new page("Clear TempCache");

	$go = value("go");

	if ($go == "0")
		$go = "start";

	$form = new CommitForm($lang->get("clear_cache", "Clear Cache"));
	$form->addToTopText($lang->get("mt_clear_cache", "Clear the temporory cache files."));
	$maintenanceHandler = new ActionHandler("generate");
	$maintenanceHandler->addFncAction("emptyTMPCache");
	$form->addCheck("generate", $lang->get("clear_cache", "Clear Cache"), $maintenanceHandler);

	$page->add($form);	
	$page->draw();
	$db->close();
	
	
	function emptyTMPCache() {
		global $c;
		$dir = $c["dyncachepath"];
		$files = opendir($dir);
	    while ($file = readdir ($files))  {
	$del = value("del","NUMERIC");
	//// ACL Check ////
	$aclf = aclFactory($del, "page");
	$aclf->load();
	if (! $aclf->checkAccessToFunction("B_DESTROY_TREE") || $del < 100000) {		
		header("Location: ". $c["docroot"]."modules/common/noaccess.php?sid=$sid&guid=$pnode");
	}
	//// ACL Check ////
	

	$go = value("go");

	if ($go == "0")
		$go = "start";

	$form = new CommitForm("Destroy Tree");

	$pageHandler = new ActionHandler("destroypages");
	$pageHandler->addFNCAction("destroyTree");
	$form->addCheck("destroypages", $lang->get("destroy_tree", "Destroy Tree"), $pageHandler);

	$clusterHandler = new ActionHandler("destroycluster");
	$clusterHandler->addFNCAction("destroyTree");
	$form->addCheck("destroycluster", $lang->get("destroy_exclusive_content", "Destroy exclusive content"), $clusterHandler);
	$form->backpage="modules/sitepages/sitepagebrowser.php?sid=".$sid;
	$form->add(new Hidden("del", value("del")));
	$form->add(new Hidden("sid", $sid));
	$form->add(new LinkLabel("lbl", $lang->get("back_sp", "Back to Website").">>", "modules/sitepages/sitepagebrowser.php?sid=".$sid, "_self", "informationheader", 2)); 
	$destroyexecuted = false;

	$page->add($form);
	 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
	 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	 *	GNU General Public License for more details.
	 *
	 *	You should have received a copy of the GNU General Public License
	 *	along with N/X; if not, write to the Free Software
	 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
	 **********************************************************************/
	require "../../config.inc.php";

	require "menudef.inc.php";

	$auth = new auth("MAINTENANCE");
	$page = new page("Generate DataTypes-Array");

	$go = value("go");

	if ($go == "0")
		$go = "start";

	$form = new CommitForm($lang->get("mt_generate_dta", "Generate DataTypes"));
	$form->addToTopText($lang->get("mt_generate_dta_mes", "generates DataTypes"));
	$maintenanceHandler = new ActionHandler("generate");
	$maintenanceHandler->addFncAction("writeDataTypeArray");
	$form->addCheck("generate", $lang->get("mt_generate_dta", "Generate DataTypes"), $maintenanceHandler);

	$page->add($form);
	$page->addMenu($menu);
	$page->draw();
	$db->close();
?>
	} else if ($action == $lang->get("delete_page") && $aclf->checkAccessToFunction("DELETE_SITEPAGE")) {
		if (!isset($go))
			$go = "start";

		$delhandler = new ActionHandler("deleteobject");

		if ($go != $lang->get("Cancel")) {				
			$mid = getDBCell("sitepage", "MENU_ID", "SPID = $oid");
			if (value("deleteobject") != "0") {			
				$posi = getDBCell("sitemap", "POSITION", "MENU_ID = $mid");
				$delhandler->addDBAction("UPDATE sitemap SET POSITION = (POSITION-1) WHERE POSITION > $posi AND PARENT_ID = $mid");
				$delhandler->addDBAction("UPDATE sitemap SET DELETED = 1 WHERE MENU_ID = $mid");
			}

			$title = getDBCell("sitemap", "NAME", "MENU_ID = $mid");
			$form = new CommitForm($lang->get("sp_delete"). " $title", "i_purge.gif");
			$form->addToTopText($lang->get("sp_delmes"));
			$form->addCheck("deleteobject", $lang->get("sp_delete"), $delhandler);
			$form->add(new ActionField($lang->get("delete_page")));
			$form->add(new Hidden("oid", $oid));
			$page->add($form);
		}
	} else if (value("pnode", "NUMERIC") == "0" && $oid ==0 && $auth->userName == "Administrator") {
	 	$go="UPDATE";
	 	$form = new EditForm($lang->get("node_access", "Set access for site root"), ""); 
	 	$aclPanel = new Container;	 		 	
		$aclid = "1";
		$aclType = "page";
		$title = $name[0];
		include $c["path"] . "api/userinterface/panels/acl_panel.inc.php";	
		$aclPanel->add(new Hidden("mid", $mid));
	 *	GNU General Public License for more details.
	 *
	 *	You should have received a copy of the GNU General Public License
	 *	along with N/X; if not, write to the Free Software
	 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
	 **********************************************************************/
	require "../../config.inc.php";


	$auth = new auth("ADMINISTRATOR");
	$page = new page("Rebuild Cache");

	$go = value("go");

	if ($go == "0")
		$go = "start";

	$form = new CommitForm($lang->get("mt_lw_site"));
	$form->addToTopText($lang->get("mt_lws_messages", "Do you really want to launch the whole website?"));
	$maintenanceHandler = new ActionHandler("generate");
	$maintenanceHandler->addFncAction("launchWholeSite");	
	$chllaunchHandler = new ActionHandler("launchchannels");
	$chllaunchHandler->addFncAction("launchAllChannels");
	$form->addCheck("generate", $lang->get("mt_lw_site"), $maintenanceHandler);
	$form->addCheck("launchchannels", $lang->get("mt_lwc", "Launch all articles"), $chllaunchHandler);
	

	$page->add($form);
	$page->draw();
	$db->close();		
?>