예제 #1
0
		/**
		  * Create a new Record with the given $this->fkid in the database.
		  * Initialize with standard values!
		  */
		function createRecord() {
			$createHandler = new ActionHandler("CREATE");

			$createHandler->addDBAction("INSERT INTO $this->management_table ($this->pk_name, FILENAME, ALT, WIDTH, HEIGHT, COPYRIGHT) VALUES ($this->fkid, '', '', 0,0,'')");
			$createHandler->process("CREATE");
		}
예제 #2
0
	$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");
	$contentHandler->addFNCAction("purgeContent");
	$form->addCheck("content", $lang->get("purge_content"), $contentHandler);

	$clusterHandler = new ActionHandler("cluster");
	$clusterHandler->addFNCAction("purgeCluster");
	$form->addCheck("cluster", $lang->get("purge_cluster"), $clusterHandler);

	$metaHandler = new ActionHandler("meta");
				$amount += $query->field("ANZ");
				$query = new query($db, $sql2);
				$query->getrow();
				$amount += $query->field("ANZ");
				$query = new query($db, $sql3);
				$query->getrow();
				$amount += $query->field("ANZ");

				if ($amount == 0) {
					if (value("decision") == $lang->get("yes")) {
						// set new folder-id.
						$parentId = getDBCell("categories", "PARENT_CATEGORY_ID", "CATEGORY_ID = " . $oid);
						pushVar("pnode", $parentId);
						
						// delete folder.
						$delhandler->addDBAction("DELETE FROM categories WHERE CATEGORY_ID = $oid");
						$delhandler->process("deletefolder");
						// set new id.
						$oid = $pnode = $parentId;
					} else if (value("decision") != $lang->get("no")) {
						$title = getDBCell("categories", "CATEGORY_NAME", "CATEGORY_ID = " . $oid);

						$form = new YesNoForm($lang->get("r_deletefolder"). " $title", $lang->get("folder_delmes", "Do you really want to delete this folder?"));
						$form->add(new Hidden("action", $lang->get("del_folder")));
						$form->add(new Hidden("pnode", $pnode));
						$page->add($form);
						$handled = true;
					}
				} else {
					$title = getDBCell("categories", "CATEGORY_NAME", "CATEGORY_ID = $oid");
예제 #4
0
/**
 * Uninstalls a Plugin
 * @param integer GUID of the plugin to uninstall.
 */
function uninstallPlugin($oid)
{
    global $db;
    // module uninstall handler
    includePGNSource($oid);
    $modRef = createPGNRef($oid, 0);
    if ($modRef != null) {
        $modRef->registration();
        $modRef->_uninstaller();
        // content deletion
        $delHandler = new ActionHandler("DELETE");
        $sql = "SELECT CID FROM content WHERE MODULE_ID = {$oid}";
        $query = new query($db, $sql);
        while ($query->getrow()) {
            $cid = $query->field("CID");
            $delHandler->addDBAction("DELETE FROM meta WHERE CID = {$cid}");
            $delHandler->addDBAction("UPDATE cluster_template_items SET FKID=0 WHERE FKID={$cid}");
            $delHandler->addDBAction("DELETE FROM content_variations WHERE CID = {$cid}");
            $delHandler->addDBAction("DELETE FROM content WHERE CID = {$cid}");
        }
        // meta-templates deletion.
        $mtid = getDBCell("modules", "MT_ID", "MODULE_ID = {$oid}");
        if ($mtid != 0) {
            $delHandler->addDBAction("DELETE FROM meta_template_items WHERE MT_ID = {$mtid}");
            $delHandler->addDBAction("DELETE FROM meta_templates WHERE MT_ID = {$mtid}");
        }
        $delHandler->addDBAction("DELETE FROM modules WHERE MODULE_ID = {$oid}");
        $delHandler->process("DELETE");
        $delHandler = new ActionHandler("DELETE");
        // cluster deletion.
        $delHandler->addDBAction("UPDATE cluster_template_items SET FKID = 0 WHERE FKID = {$oid} AND CLTITYPE_ID=2");
        $cltis = createDBCArray("cluster_template_items", "CLTI_ID", "CLTITYPE_ID = 2 AND FKID = {$oid}");
        for ($i = 0; $i < count($cltis); $i++) {
            $id = $cltis[$i];
            $delHandler->addDBAction("DELETE FROM cluster_content WHERE CLTI_ID = {$id}");
        }
        $delHandler->process("DELETE");
        writeDataTypeArray();
    }
}
		
		if ($action == $lang->get("cl_launch") && $aclf->checkAccessToFunction("B_EXPIRE_LAUNCH")) {
			launchCluster($clnid, 10, $variation);	
		} else if ($action == $lang->get("cl_expire") && $aclf->checkAccessToFunction("B_EXPIRE_LAUNCH")) {
			expireCluster($clnid, $variation);
		}
		
		if ($action == $lang->get("CL_DEL") && $aclf->checkAccessToFunction("DELETE_CL")) {
			//if (!isset($go)) $go = "start";
			if ($go == "0" || $go == "")
				$go = "start";

			$delhandler = new ActionHandler("deleteobject");

			if (value("decision") == $lang->get("yes")) {
				$delhandler->addDBAction("UPDATE cluster_node SET DELETED = 1 WHERE CLNID = $oid");

				$delhandler->addDBAction("UPDATE cluster_content SET FKID=0 WHERE FKID = $oid");
				$delhandler->addDBAction("UPDATE cluster_template_items SET FKID=0 WHERE FKID = $oid");
				
				$delhandler->process("deleteobject");
				$handled = true;
			} else if (value("decision") != $lang->get("no")) {
				$title = getDBCell("cluster_node", "NAME", "CLNID = $oid");
				$form = new YesNoForm($lang->get("cl_del"). " $title", $lang->get("cl_delmes", "Do you really want to delete this cluster-instance?"));
				$form->add(new Hidden("action", $lang->get("CL_DEL")));
				$form->add(new Hidden("oid", $oid));
				$page->add($form);
				$handled = true;				
			}
		} else if (($action == $lang->get("cl_new")) && $aclf->checkAccessToFunction("NEW_INSTANCE")) {
예제 #6
0
 *	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_once "../../config.inc.php";
$auth = new auth("NEWSLETTERADM");
$page = new page("Newsletter configuration");
include "logic/menudef.inc.php";
$filter = new Filter("mailinglist", "MAILINGLIST_ID");
$filter->addRule($lang->get("name"), "NAME", "NAME");
$filter->type_name = $lang->get("newsletter", "Newsletter");
$filtermenu = new Filtermenu($lang->get("newsletter"), $filter);
$deleteHandler = new ActionHandler("Delete");
$deleteHandler->addDBAction("Delete from mailinglist Where MAILINGLIST_ID = <oid>");
$form = new StdEDForm($lang->get("edit_newsletter", "Edit newsletter"));
$cond = $form->setPK("mailinglist", "MAILINGLIST_ID");
$form->add(new TextInput($lang->get("name"), "mailinglist", "NAME", $cond, "type:text,width:300,size:128", "MANDATORY&UNIQUE"));
$form->add(new TextInput($lang->get("description"), "mailinglist", "DESCRIPTION", $cond, "type:textarea,width:300,size:8"));
$form->add(new TextInput($lang->get("from_name", 'Sender Name'), "mailinglist", "FROM_NAME", $cond, "type:text,width:300,size:128", "MANDATORY"));
$form->add(new TextInput($lang->get("from_email", 'Sender EMail'), "mailinglist", "FROM_EMAIL", $cond, "type:text,width:300,size:128", "MANDATORY"));
$form->registerActionHandler($deleteHandler);
$page->addMenu($filtermenu);
$page->add($form);
$page->draw();
echo $errors;
?>
	 
예제 #7
0
 /**
  * Create a new Record with the given $this->fkid in the database.
  * Initialize with standard values!
  */
 function createRecord()
 {
     $createHandler = new ActionHandler("CREATE");
     $createHandler->addDBAction("INSERT INTO {$this->management_table} ({$this->pk_name}) VALUES ({$this->fkid})");
     $createHandler->process("CREATE");
 }
예제 #8
0
	$filtermenu = new Filtermenu($lang->get("user_filtermenu"), $filter);
	$filtermenu->addMenuEntry($lang->get("user_link"), "user_general.php", "user_premissions.php");
	$filtermenu->addMenuEntry($lang->get("group_link"), "group_general.php");
	$filtermenu->addMenuEntry($lang->get("role_link"), "role_general.php");    
 
	
	$deleteHandler = new ActionHandler("DELETE");
	$deleteHandler->addDbAction("DELETE FROM users where user_id=$oid and user_id > 999");
	$deleteHandler->addDbAction("DELETE FROM temp_vars where user_id=$oid and user_id > 999");
	$deleteHandler->addDbAction("DELETE FROM user_session where user_id=$oid and user_id > 999");
	$deleteHandler->addDbAction("DELETE FROM user_permissions where user_id=$oid and user_id > 999");

	$insertHandler = new ActionHandler("INSERT");
	$insertHandler->addDbAction("INSERT INTO user_session (USER_ID) VALUES (<oid>)");
	$insertHandler->addDbAction("INSERT INTO temp_vars (NAME, USER_ID, VALUE) VALUES ('variation', <oid>, 1)");
	$insertHandler->addDBAction("INSERT INTO temp_vars (NAME, USER_ID, VALUE) VALUES ('mid', <oid>, 0)");

	if ($oid == 0) {
		$addtext = "";
	} else {
		$addtext = ": " . getDBCell("users", "USER_NAME", "USER_ID = " . $oid);
	}

	$form = new stdEDForm($lang->get("user_head"). $addtext, "i_myprofile.gif");
	$form->submitButtonAction = "if (document.form1.users_PASSWORD_1.value != '') document.form1.users_PASSWORD_1.value = document.form1.users_PASSWORD_2.value = hex_md5(document.form1.users_PASSWORD_1.value);";

	$cond = $form->setPK("users", "USER_ID");

	if ($oid != "") {
		$form->headerlink = crHeaderLink($lang->get("user_permission", "Edit user permissions"), "modules/user/user_permissions.php?sid=$sid&go=update&oid=$oid");
	}
예제 #9
0
	/**
	 * Creates a new sitepage.
	 * @param integer ID of the Menu-Entry
	 * @param integer Position, where sitepage is to be inserted.
	 * @return integer SPID, that was created when inserting the sitepage.
	 */
	function createSitepage($menu, $position) {
		global $db;

		$spm = getDBCell("sitemap", "SPM_ID", "MENU_ID = $menu");

		if (!is_numeric($position) || $position == "")
			$position = 1;

		if ($position < 1)
			$position = 1;

		// get number of positions...
		$sql = "SELECT COUNT(SPID) AS ANZ FROM sitepage WHERE DELETED=0 AND MENU_ID = $menu";

		$query = new query($db, $sql);
		$query->getrow();
		$maxpos = $query->field("ANZ");

		// correct positioning...
		if ($position > $maxpos)
			$position = $maxpos + 1;

		$uhandler = new ActionHandler("POSITIONS");
		$uhandler->addDBAction("UPDATE sitepage SET POSITION = (POSITION+1) WHERE MENU_ID = $menu AND POSITION >= $position");
		$uhandler->process("POSITIONS");

		$nextId = nextGUID();
		$sql = "INSERT INTO sitepage (SPID, SPM_ID, MENU_ID, POSITION, DELETED) VALUES ($nextId, $spm, $menu, $position, 0)";

		$query = new query($db, $sql);

		return $nextId;
	}
			} 			
			$form->add(new IDWrapper("templ", new TextInput($lang->get("template", "Template"), "cluster_templates", "TEMPLATE", $cond, "type:textarea,width:400,size:20") ,"embedded", $show,2));	

			$form->add(new CheckboxTxtInput($lang->get('is_shop_cat_class','Enable for Use as Shop Category Template'), 'cluster_templates', 'IS_SHOP_CATEGORY', $cond));
			$form->add(new CheckboxTxtInput($lang->get('is_shop_cat_product','Enable for Use as Shop Product Template'), 'cluster_templates', 'IS_SHOP_PRODUCT', $cond));
			
			$form->add(new Hidden("action", "objectprop"));
			$form->forbidDelete(true);
			$page->add($form);
		// delete the object
		} else if ($action == $lang->get("delete") && $aclf->checkAccessToFunction("DELETE_CL_TEMP") && value("decision") != $lang->get("no")) {
				if (!isset($go))
					$go = "start";				
				if (value("decision") == $lang->get("yes")) {			
					$delhandler = new ActionHandler("deleteobject");
					$delhandler->addDBAction("UPDATE cluster_templates SET DELETED = 1 WHERE CLT_ID = $oid");
					$todo = createDBCArray("cluster_template_items", "CLTI_ID", "FKID = $oid");
					for ($i = 0; $i < count($todo); $i++) {
						$delhandler->addDBAction("DELETE FROM cluster_content WHERE CLTI_ID = " . $todo[$i]);
					}
					$delhandler->addDBAction("UPDATE cluster_template_items SET FKID = 0 WHERE FKID = $oid");
					$delhandler->process("deleteobject");
				} else {
					$title = getDBCell("cluster_templates", "NAME", "CLT_ID = $oid");				
					$form = new YesNoForm($lang->get("clt_delete")." $title", $lang->get("clt_delmes"));
					$form->add(new Hidden("action", $lang->get("delete")));
					$form->add(new Hidden("oid", $oid));
					$page->add($form);
				}			
		} else if (($action == "editobject" || value("decision") == $lang->get("no") ) && $aclf->checkAccessToFunction("EDIT_CL_TEMP") ) {
			// edit the object. therefore use a special form which is highly customized.
	$filter->addRule($lang->get("name"), "NAME", "NAME");
	$filter->addRule($lang->get("description"), "DESCRIPTION", "NAME");
	$filter->setAdditionalCondition("DELETED = 0 AND VERSION=0");
	$filter->icon = "li_template.gif";
	$filter->type_name = "Templates";

	$filtermenu = new Filtermenu($lang->get("spm"), $filter);
	$filtermenu->tipp = $lang->get("help_pagetemp", "In spreadsheet and database applications, a template is a blank form that shows which fields exist, their locations, and their length. In N/X, templates are the basis of every output. A template is a form in which all the cells have been defined but no data has yet been entered.");

	$insertHandler = new ActionHandler("INSERT");
	$insertHandler->addFNCAction("syncSPMVariations");
	$updateHandler = new ActionHandler("UPDATE");
	$updateHandler->addFNCAction("syncSPMVariations");

	$deleteHandler = new ActionHandler("DELETE");
	$deleteHandler->addDBAction("UPDATE sitepage_master SET DELETED=1 WHERE SPM_ID = $oid");
	$deleteHandler->addDBAction("UPDATE sitepage SET DELETED=1 WHERE SPM_ID = $oid");
	$deleteHandler->addDBAction("UPDATE sitemap SET DELETED = 1 WHERE SPM_ID = $oid");
	$deleteHandler->addDBAction("DELETE FROM sitepage_variations WHERE SPM_ID = $oid");
	if ($oid!="") {
	  $title = getDBCell("sitepage_master", "NAME", "SPM_ID = $oid");
	} else {
	  $title = "";	
	}
	$action = value("action");
	
	$form = new stdEDForm($lang->get("spm_edit")." - ".$title, "i_scheme.gif");
	$cond = $form->setPK("sitepage_master", "SPM_ID");
	if ($auth->checkAccessToFunction("B_RELAUNCH_INST")) {
	  $form->buttonbar->add("action", $lang->get("spm_rlaunch", "Refresh instances"), "submit", "", "", true, $lang->get("tt_refresh", "Refresh Instances updates the changes made to a template to cached pages."));
	}
			$form->addCheck("deleteobject", $lang->get("sp_pdelete"), $delhandler);
			$form->add(new ActionField($lang->get("delete")));
			$form->add(new Hidden("oid", $oid));
			$page->add($form);
		}
	} 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;	 		 	
예제 #13
0
	/**
	 * delete all (also live) instances of a variation.
	 * @param integer ID of the Variation
	 */
	function deleteVariation($variation) {
		global $db;

		$delHandler = new ActionHandler("del");
		$delHandler->addDBAction("DELETE FROM sitepage_names WHERE VARIATION_ID = $variation");
		$delHandler->addDBAction("DELETE FROM sitepage_variations WHERE VARIATION_ID = $variation");

		// delete clusters
		$sql = "SELECT CLID FROM cluster_variations WHERE VARIATION_ID = $variation";

		$query = new query($db, $sql);

		while ($query->getrow()) {
			deleteCluster ($query->field("CLID"));
		}

		$delHandler->addDBAction("DELETE FROM cluster_variations WHERE VARIATION_ID = $variation");

		// delete content
		$sql = "SELECT v.FK_ID, c.MODULE_ID FROM content_variations v, content c WHERE c.CID = v.CID AND v.VARIATION_ID = $variation";

		$query = new query($db, $sql);

		while ($query->getrow()) {
			deletePlugin($query->field("FK_ID"), $query->field("MODULE_ID"));
		}

		$delHandler->addDBAction("DELETE FROM content_variations WHERE VARIATION_ID = $variation");
		$delHandler->addDBAction("DELETE FROM variations WHERE VARIATION_ID = $variation");

		$delHandler->process("del");
	}
		/**
		  * Create a new Record with the given $this->fkid in the database.
		  * Initialize with standard values!
		  */
		function createRecord() {
			$createHandler = new ActionHandler("CREATE");
			$createHandler->addDBAction("INSERT INTO $this->management_table ($this->pk_name, CONTENT) VALUES ($this->fkid, '')");
			$createHandler->process("CREATE");
		}