function passbuilder_template($template)
{
    $url = new UrlParams();
    $current_role = Helper::getRole();
    $urlParams = $url->getQueryArray();
    if (array_key_exists('pass-builder', $urlParams)) {
        if (is_user_logged_in()) {
            if ($current_role != '') {
                // form submit handle here
                if ($_POST['formAction']) {
                    $handler = new FormHandler($_POST['formAction']);
                    $handler->handleSubmit();
                }
                if ($_GET['action']) {
                    $handler = new ActionHandler($_GET['action']);
                    $handler->fireAction();
                }
                return dirname(__FILE__) . '/templates/page-pass-template.php';
            } else {
                return dirname(__FILE__) . '/templates/page-permission-exceptions.php';
            }
        } else {
            $loginUrl = ICL_LANGUAGE_CODE == 'en' ? get_site_url() . '/log-in/' : get_site_url() . '/da/log-in-2/';
            wp_redirect($loginUrl);
        }
    }
    return $template;
}
示例#2
0
$selcal = new SelectMenu($lang->get("calendar_select", "Select Calendar"), "calsel", "pgn_cal_calendars", "NAME", "CALID", "1");
$filtermenu = new StdMenu("");
$filtermenu->addMenuEntry($lang->get("calendars_edit", "Edit Calendar"), "edit.php", "", "CALENDAR_EDIT");
$filtermenu->addMenuEntry($lang->get("calendars_define", "Define Calendars"), "calendars.php", "", "CALENDAR_CREATE");
$filtermenu->addMenuEntry($lang->get("calendars_cat_define", "Define Categories"), "categories.php", "", "CALENDAR_CREATE");
$deleteHandler = new ActionHandler("DELETE");
$deleteHandler->addDbAction("DELETE FROM pgn_cal_calendars WHERE CALID = {$oid}");
$deleteHandler->addDbAction("DELETE FROM pgn_cal_appointments WHERE CALID = {$oid}");
$deleteHandler->addDbAction("DELETE FROM pgn_cal_categories WHERE CALID = {$oid}");
$oid = value("oid", "NUMERIC");
if ($selcal->selected != "0" && $selcal->selected != "-1") {
    if ($oid == "0" && $page_action != "INSERT") {
        $form = new MenuForm($lang->get("sel_event", "Select Event or Appointment"), array($lang->get("startdate", "Startdate"), $lang->get("starttime", "Starttime"), $lang->get("title", "Title")), "pgn_cal_appointment", "APID", array("STARTDATE", "STARTTIME", "TITLE"), "CALID=" . $selcal->selected);
        $form->newAction = "plugin/calendar/edit.php?sid={$sid}&go=create";
    } else {
        $deleteHandler = new ActionHandler("DELETE");
        $deleteHandler->addDbAction("DELETE FROM pgn_cal_appointment WHERE APID = {$oid}");
        $addtext = ": " . getDBCell("pgn_cal_appointment", "TITLE", "APID = " . $oid);
        $form = new stdEDForm($lang->get("cal_edit", "Edit Appointment") . $addtext);
        $form->addHeaderLink(crHeaderLink('Back', "plugin/calendar/edit.php?sid={$sid}"));
        $cond = $form->setExPK("pgn_cal_appointment", "APID");
        $form->add(new TextInput($lang->get("title"), "pgn_cal_appointment", "TITLE", $cond, "type:text,width:300,size:64", "MANDATORY"));
        $form->add(new RichEditInput($lang->get("description"), "pgn_cal_appointment", "DESCRIPTION", $cond, "type:rich,width:350,size:6", ""));
        $form->add(new DateInput($lang->get("startdate"), "pgn_cal_appointment", "STARTDATE", $cond, "param:form1", "MANDATORY"));
        $form->add(new TimeInput($lang->get("starttime"), "pgn_cal_appointment", "STARTTIME", $cond));
        $form->add(new DateInput($lang->get("endate"), "pgn_cal_appointment", "ENDDATE", $cond, "param:form1", "MANDATORY"));
        $form->add(new TimeInput($lang->get("endtime"), "pgn_cal_appointment", "ENDTIME", $cond));
        $form->add(new SelectOneInput($lang->get("category"), "pgn_cal_appointment", "CATID", "pgn_cal_categories", "NAME", "CATID", "CALID = " . $selcal->selected, $cond));
        $form->add(new NonDisplayedValueOnInsert("pgn_cal_appointment", "CALID", $cond, $selcal->selected, "NUMBER"));
        $form->add(new SubTitle("st", $lang->get("Report", "Veranstaltungsbericht"), 3));
        $form->add(new RichEditInput($lang->get("report"), "pgn_cal_appointment", "REPORT", $cond, "type:rich,width:350,size:6", ""));
	 **********************************************************************/
	require_once "../../config.inc.php";

	$auth = new auth("COMPOUND_GROUPS");
	$page = new page("Compound Groups");

	$filter = new Filter("compound_groups", "CGID");
	$filter->addRule($lang->get("name"), "NAME", "NAME");
	$filter->setAdditionalCondition("VERSION = 0");
	$filter->icon = "li_cggroup.gif";
	
	$filter->type_name = $lang->get("cp_group");
	$filtermenu = new Filtermenu($lang->get("cp_group"), $filter);
	$filtermenu->tipp = $lang->get("help_compgrp", "Compound group is a group of clusters. Clusters templates may have an own layout. This enables you to build your homepage out of blocks, e.g. News-Article, Poll, Image-Gallery all on one page and on demand.");
	
	$deleteHandler = new ActionHandler("DELETE");
	$deleteHandler->addDbAction("DELETE FROM compound_groups where CGID=$oid AND CGID > 999");
	$deleteHandler->addDbAction("DELETE FROM compound_group_members where CGID=$oid");

	$form = new stdEDForm($lang->get("ed_cpgroup", "Edit Compound Group"));
	$cond = $form->setPK("compound_groups", "CGID");
	
	if ($oid != "" && $page_action != "DELETE") {		
		$form->buttonbar->add("todo", $lang->get("launch"), "submit", "");	
		$form->headerlink = crHeaderLink($lang->get("ed_cpgroup"), "modules/compoundgroup/compound_group_members.php?sid=$sid&oid=$oid&go=update");
	}
	$form->add(new TextInput($lang->get("group_name"), "compound_groups", "NAME", $cond, "type:text,width:200,size:32", "MANDATORY&UNIQUE"));
	$form->add(new TextInput($lang->get("group_description", "Description"), "compound_groups", "DESCRIPTION", $cond, "type:textarea,width:340,size:2", ""));
	$form->add(new Hidden("todo", ""));
	
    $values = array();
示例#4
0
<?
/**********************************************************************
 * @module Application
 **********************************************************************/

 require_once "../../config.inc.php";
 $auth= new auth("CUSTOMERCAREADMIN");
 $page= new page ("Tickets Category Administration");

 $filter = new Filter("tickets_categories", "id");
 $filter->addRule("Category", "name", "name");

 $menu = new Filtermenu("Edit Categories", $filter);
 include "menudef.inc.php";
  
 $deleteHandler = new ActionHandler("DELETE");
 $deleteHandler->addDbAction("DELETE FROM tickets_categories where id=$oid");
 
 $form = new stdEDForm("Edit Ticket Categories", "");
 $cond = $form->setPK("tickets_categories", "id");
 $form->add(new TextInput("Name", "tickets_categories", "name", $cond, "type:text,width:200,size:32", "MANDATORY&UNIQUE"));
 $form->add(new TextInput("POP-Server", "tickets_categories", "pophost", $cond, "type:text,width:200,size:32", "MANDATORY"));
 $form->add(new TextInput("POP-Username", "tickets_categories", "popuser", $cond, "type:text,width:200,size:32", "MANDATORY"));
 $form->add(new TextInput("POP-Password", "tickets_categories", "poppass", $cond, "type:text,width:200,size:32", "MANDATORY"));
 $form->add(new TextInput("Reply-To-Address", "tickets_categories", "replyto", $cond, "type:text,width:200,size:32", "MANDATORY"));

 $form->add(new TextInput("Notify From", "tickets_categories", "notify_from", $cond, "type:text,width:200,size:64", ""));
 $form->add(new TextInput("Notify To", "tickets_categories", "notify_to", $cond, "type:text,width:200,size:64", ""));
 $form->add(new TextInput("Notify Subject", "tickets_categories", "notify_subject", $cond, "type:text,width:200,size:64", ""));
 $form->add(new TextInput("Notify ReplyTo", "tickets_categories", "notify_replyto", $cond, "type:text,width:200,size:64", ""));
 $form->add(new TextInput("Notify Body", "tickets_categories", "notify_body", $cond, "type:textarea,width:350,size:6", ""));
	$page = new page("Role Administration");

	$filter = new Filter("roles", "ROLE_ID");
	$filter->addRule($lang->get("role_name"), "ROLE_NAME", "ROLE_NAME");
	$filter->setAdditionalCondition("UPPER(ROLE_NAME) <> 'ADMINISTRATOR'");
	$filter->prevent_sysvar_disp = false;
	$filter->icon = "li_role.gif";
	$filter->type_name = "Roles";

	$filtermenu = new Filtermenu($lang->get("role_filtermenu"), $filter);
	$filtermenu->addMenuEntry($lang->get("user_link"), "user_general.php");
	$filtermenu->addMenuEntry($lang->get("group_link"), "group_general.php");
	$filtermenu->addMenuEntry($lang->get("role_link"), "role_general.php");
	$filtermenu->tipp = "";
	//$filtermenu->addLink("test", "test.php");
	$deleteHandler = new ActionHandler("DELETE");
	$deleteHandler->addDbAction("DELETE FROM roles where role_id=$oid AND role_id>999");
	$deleteHandler->addDbAction("DELETE FROM user_permissions where role_id=$oid AND role_id > 999");
	$deleteHandler->addDbAction("DELETE FROM role_sys_functions where role_id=$oid AND role_id > 999");

	if ($oid == 0) {
		$addtext = "";
	} else {
		$addtext = ": " . getDBCell("roles", "ROLE_NAME", "ROLE_ID = " . $oid);
	}

	$form = new stdEDForm($lang->get("role_head"). $addtext, "i_role.gif");
	$cond = $form->setExPK("roles", "ROLE_ID");
	$cond .= " AND UPPER(ROLE_NAME) <> 'ADMINISTRATOR'";

	if ($oid != "") {
 /**
  * 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");
 }
	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);
	   while ($query->getrow()) {
	     syncCluster($query->field("CLID"));	
	 *	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))  {
                if($file != "." && $file != "..")
                {
示例#9
0
}
if ($action == "createarticle") {
    $go = "CREATE";
    $page_action = "INSERT";
    $form = new stdEDForm($lang->get("create_article", "Create new Article in channel") . " " . getDBCell("channels", "NAME", "CHID = " . $chid), "");
    $cond = $form->setPK("channel_articles", "ARTICLE_ID");
    $oname = new TextInput($lang->get("name"), "channel_articles", "TITLE", $cond, "type:text,width:300,size:64", "MANDATORY");
    $form->add($oname);
    $form->add(new SelectOneInput($lang->get("template"), "channel_articles", "CLT_ID", "cluster_templates, channel_cluster_templates", "NAME", "channel_cluster_templates.CLT_ID AS CLT", "cluster_templates.CLT_ID = channel_cluster_templates.CLT_ID AND channel_cluster_templates.CHID = {$chid} ORDER BY POSITION ASC", $cond, "TYPE:DROPDOWN", "MANDATORY"));
    $form->add(new SelectOneInput($lang->get("category"), "channel_articles", "CH_CAT_ID", "channel_categories", "NAME", "CH_CAT_ID", "CHID = {$chid}", $cond, "type:dropdown", "MANDATORY"));
    $form->add(new PositionInput($lang->get("position", "Position"), "channel_articles", "POSITION", $cond, "CHID={$chid} AND VERSION=0", "size:4,width:50"));
    $form->add(new Hidden("action", "createarticle"));
    $form->add(new NonDisplayedValueOnInsert("channel_articles", "CHID", $cond, $chid, "NUMBER"));
    $form->add(new NonDisplayedValueOnInsert("channel_articles", "ARTICLE_DATE", $cond, "NOW()", "NUMBER"));
    $form->forbidDelete(true);
    $handler = new ActionHandler("INSERT");
    $handler->addFncAction("createClusterNodeForArticle");
    $form->registerActionHandler($handler);
    $page->add($form);
    $page->drawAndForward("modules/channels/edit.php?sid={$sid}&oid=<oid>&go=update");
} else {
    // Flag for configuration of cluster-panel...
    $clt = getDBCell("channel_articles", "CLT_ID", "ARTICLE_ID = {$oid}");
    $isArticle = true;
    $page_action = "UPDATE";
    $clid = syncArticleVariation($oid, $variation);
    syncCluster($clid);
    $view = initValue("view", doc() . "view", 1);
    $title = getDBCell("channel_articles", "TITLE", "ARTICLE_ID = {$clnid}");
    $form = new PanelForm($lang->get("edit_article", "Edit Article") . " " . $title, "", 'articlesform');
    $form->quickpanel = true;
示例#10
0
     if ($userinfo['datum_anmeldung']) {
         $numberOfRegisteredDays = round(($website->getNowAsTimestamp() - $userinfo['datum_anmeldung']) / (3600 * 24));
         BadgesDataService::awardBadgeIfApplicable($website, $db, $userId, 'membership_since_x_days', $numberOfRegisteredDays);
     }
     $_SESSION['badgechecked'] = 1;
 }
 // get page ID and parse it by router
 $pageId = $website->getRequestParameter(PARAM_PAGE);
 $pageId = PageIdRouter::getTargetPageId($website, $i18n, $pageId);
 $website->setPageId($pageId);
 $validationMessages = null;
 // handle action
 $actionId = $website->getRequestParameter(PARAM_ACTION);
 if ($actionId !== NULL) {
     try {
         $targetId = ActionHandler::handleAction($website, $db, $i18n, $actionId);
         if ($targetId != null) {
             $pageId = $targetId;
         }
     } catch (ValidationException $ve) {
         $validationMessages = $ve->getMessages();
         $website->addFrontMessage(new FrontMessage(MESSAGE_TYPE_ERROR, $i18n->getMessage('validation_error_box_title'), $i18n->getMessage('validation_error_box_message')));
     } catch (Exception $e) {
         $website->addFrontMessage(new FrontMessage(MESSAGE_TYPE_ERROR, $i18n->getMessage('errorpage_title'), $e->getMessage()));
     }
 }
 $website->setPageId($pageId);
 // get and set navigation items
 $navItems = NavigationBuilder::getNavigationItems($website, $i18n, $page, $pageId);
 $parameters['navItems'] = $navItems;
 // get and set breadcrumb
示例#11
0
 *    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";
require_once "ingredient_editor.php";
require_once "tag_selector.php";
$auth = new auth("ADMINISTRATOR");
$page = new Page("Edit Recipe");
$form = new stdEDForm($lang->get("edrecipe", "Edit Recipe"));
$cond = $form->setPK("pgn_recipes", "ID");
$form->addHeaderLink(crHeaderLink($lang->get("back"), "plugin/recipe/overview.php?sid=" . $sid));
$form->add(new TextInput($lang->get("name", "NAME"), "pgn_recipes", "NAME", $cond, "type:text,size:64,width:200", "MANDATORY"));
if ($page_action == "UPDATE") {
    $values = createNameValueArrayEx("pgn_recipes_tags", "TAG", "TAG_ID", "1", "ORDER BY TAG ASC");
    $form->add(new TagEditor("Tags", "pgn_recipes_tag_relation", "REC_ID", $oid, "TAG_ID", $values));
}
$form->add(new SubTitle("st", $lang->get("ingredients", "Ingredients"), 2));
$form->add(new IngredientEditor("pgn_recipes", $cond));
$form->add(new SubTitle("st", $lang->get("preparation", "Preparation"), 2));
$form->add(new TextInput($lang->get("preparation", "Preparation"), "pgn_recipes", "PREPARATION", $cond, "type:textarea,size:6,width:300", ""));
$form->add(new TextInput($lang->get("description", "Description"), "pgn_recipes", "DESCRIPTION", $cond, "type:textarea,size:6,width:300", ""));
$deleteHandler = new ActionHandler("DELETE");
$deleteHandler->addDbAction("DELETE FROM pgn_recipes WHERE ID={$oid} ");
$deleteHandler->addDbAction("DELETE FROM pgn_recipes_tag_relation WHERE REC_ID={$oid} ");
$form->registerActionHandler($deleteHandler);
$page->add($form);
$page->draw();
示例#12
0
if ($auth->checkAccessToFunction("CHANNEL_LAUNCH")) {
    $form->buttonbar->add("action", $lang->get("launch"));
    $form->add(new Hidden("action", ""));
    if (value("action") == $lang->get("launch")) {
        launchChannel($oid);
        if ($errors == "") {
            $form->addToTopText($lang->get("chnlaunched", "The channel was launched successfully."));
            $form->topicon = "ii_success.gif";
        } else {
            $form->addToTopText($lang->get("chnlaunchederr", "An error occured while launching the channel."));
            $form->topicon = "ii_error.gif";
        }
        $page_action = "UPDATE";
        $go = "update";
        $processing = "no";
        $page_state = "start";
    }
}
$form->add(new TextInput($lang->get("name"), "channels", "NAME", $cond, "type:text,width:200,size:64", "MANDATORY&UNIQUE"));
if ($page_action != "INSERT") {
    $updateHandler = new ActionHandler("UPDATE");
    $updateHandler->addFNCAction("syncSPMVariations");
    $form->registerActionHandler($updateHandler);
    $members = createNameValueArrayEx("cluster_templates", "NAME", "CLT_ID", "CLT_TYPE_ID=1 AND DELETED=0 AND VERSION=0");
    $form->add(new SelectMultiple2Input($lang->get("spm_variations"), "sitepage_variations", "VARIATION_ID", "SPM_ID=" . $oid, "variations", "NAME", "VARIATION_ID", "DELETED=0"));
    $form->add(new SelectMultipleInputPos($lang->get("clt_select", "Select cluster templates"), $members, "channel_cluster_templates", "CLT_ID", "CHID", $cond, "cluster_templates", "CLT_ID", "NAME", "standardlight", 2));
}
$page->addMenu($filtermenu);
$page->add($form);
$page->drawAndForward("modules/channels/channels.php?sid={$sid}&oid=<oid>&go=update");
echo $errors;
示例#13
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;
?>
	 
	}
	//// 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);
	$page->draw();
	echo $errors;

	function destroyTree() {
		global $destroyexecuted, $form, $db;
示例#15
0
	 *	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("ADMINISTRATOR|QUOTER");
	$page = new page("Quote of the day");

	$filter = new Filter("pgn_quote", "QUOTE_ID");
	$filter->addRule("Title", "TITLE", "TITLE");
	$filter->addRule("Quote", "QUOTE", "TITLE");

	$filtermenu = new Filtermenu("Browse Quotes", $filter);

	$deleteHandler = new ActionHandler("DELETE");
	$deleteHandler->addDbAction("DELETE FROM pgn_quote where QUOTE_ID=$oid");

	$form = new stdEDForm("Edit Quote", "");
	$cond = $form->setPK("pgn_quote", "QUOTE_ID");
	$form->add(new TextInput("Title", "pgn_quote", "TITLE", $cond, "type:text,width:300,size:64", "MANDATORY&UNIQUE"));
	$form->add(new TextInput("Quote", "pgn_quote", "QUOTE", $cond, "type:textarea,width:300,size:3", ""));

	$form->registerActionHandler($deleteHandler);

	$page->addMenu($filtermenu);
	$page->add($form);
	$page->draw();
?>
	$filter->icon = "li_user.gif";
	$filter->type_name = "Users";

	$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");
示例#17
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++) {
	$auth = new auth("USER_MANAGEMENT");
	$page = new page("User Administration");
	$page->setJS("md5");
	
	$filter = new Filter("auth_user", "user_id");
	$filter->addRule($lang->get("email"), "email", "email");

	$filter->icon = "li_user.gif";
	$filter->type_name = "Users";

	$filtermenu = new Filtermenu($lang->get("user_filtermenu"), $filter);
	$filtermenu->addMenuEntry($lang->get("user_link"), "user_general.php", "user_premissions.php");
	
	
	$deleteHandler = new ActionHandler("DELETE");
	$deleteHandler->addDbAction("DELETE FROM auth_user where user_id=$oid and user_id > 999");
	
	$form = new stdEDForm($lang->get("user_head"), "i_myprofile.gif");
	$form->submitButtonAction = "if (document.form1.auth_user_password_1.value != '') document.form1.auth_user_password_1.value = document.form1.auth_user_password_2.value = hex_md5(document.form1.auth_user_password_1.value);";

	$cond = $form->setPK("auth_user", "user_id");
	
	$form->add(new TextInput($lang->get("email"), "auth_user", "email", $cond, "type:text,width:300,size:64", "MANDATORY&UNIQUE"));
	$form->add(new TextInput($lang->get("password"), "auth_user", "password", $cond, "type:text,width:200,size:40", "MANDATORY"));
	$form->add(new CheckboxInput($lang->get("user_active"), "auth_user", "active", $cond, "1", "0"));
	$form->add(new TextInput($lang->get("confirmcode", "Confirm-Code"), "auth_user", "confirm", $cond, "type:text,width:300,size:40", "MANDATORY&UNIQUE"));
	// Control Information
	$form->add(new NonDisplayedValueOnInsert("auth_user", "registration_date", $cond, "NOW()", "TIMESTAMP"));
	$form->registerActionHandler($deleteHandler);	
示例#19
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();
    }
}
示例#20
0
<?php

require_once "../../config.inc.php";
$auth = new auth("CALENDAR_CREATE");
$page = new Page("Edit Calendars");
$selcal = new SelectMenu($lang->get("calendar_select", "Select Calendar"), "calsel", "pgn_cal_calendars", "NAME", "CALID", "1");
$filter = new Filter("pgn_cal_calendars", "CALID");
$filter->addRule($lang->get("cal_name", "Calendar Name"), "NAME", "NAME");
$filter->type_name = $lang->get("calendars", "Calendars");
$filtermenu = new Filtermenu("", $filter);
$filtermenu->addMenuEntry($lang->get("calendars_edit", "Edit Calendar"), "edit.php", "", "CALENDAR_EDIT");
$filtermenu->addMenuEntry($lang->get("calendars_define", "Define Calendars"), "calendars.php", "", "CALENDAR_CREATE");
$filtermenu->addMenuEntry($lang->get("calendars_cat_define", "Define Categories"), "categories.php", "", "CALENDAR_CREATE");
$filtermenu->tipp = $lang->get("calendars_tipp", "You can create several calendars here. Each calendar will have its own events and dates.");
$deleteHandler = new ActionHandler("DELETE");
$deleteHandler->addDbAction("DELETE FROM pgn_cal_calendars WHERE CALID = {$oid}");
$deleteHandler->addDbAction("DELETE FROM pgn_cal_appointment WHERE CALID = {$oid}");
$deleteHandler->addDbAction("DELETE FROM pgn_cal_categories WHERE CALID = {$oid}");
if ($oid == 0) {
    $addtext = "";
} else {
    $addtext = ": " . getDBCell("pgn_cal_calendars", "NAME", "CALID = " . $oid);
}
$form = new stdEDForm($lang->get("calendar", "Calendar") . $addtext);
$cond = $form->setExPK("pgn_cal_calendars", "CALID");
$form->add(new TextInput($lang->get("name"), "pgn_cal_calendars", "NAME", $cond, "type:text,width:200,size:64", "MANDATORY&UNIQUE"));
$form->registerActionHandler($deleteHandler);
$page->addMenu($filtermenu);
$page->add($form);
$page->draw();
示例#21
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");
		}
示例#22
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();
示例#23
0
	$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");
	$metaHandler->addFNCAction("purgeMeta");
	$form->addCheck("meta", $lang->get("purge_meta"), $metaHandler);

	$cltHandler = new ActionHandler("clt");
	$cltHandler->addFNCAction("purgeClusterTemplates");
	$form->addCheck("clt", $lang->get("purge_clt"), $cltHandler);

	$spmHandler = new ActionHandler("spm");
	$spmHandler->addFNCAction("purgeSitepages");
	$form->addCheck("spm", $lang->get("purge_pages"), $spmHandler);
	
	$page->add($form);
	$page->draw();
	$db->close();
?>
			$catname = new TextInput($lang->get("r_foldername"), "categories", "CATEGORY_NAME", $cond, "type:text,width:200,size:32", "MANDATORY&UNIQUE");
			$catname->setFilter("PARENT_CATEGORY_ID = $pnode");
			$form->add($catname);
			$form->add(new Hidden("action", $lang->get("new_folder")));
			$form->add(new Hidden("pnode", $pnode));
			$form->add(new NonDisplayedValueOnInsert("categories", "PARENT_CATEGORY_ID", $cond, $pnode, "NUMBER"));
			$form->add(new NonDisplayedValueOnInsert("categories", "DELETED", $cond, 0, "NUMBER"));
			$form->forbidDelete(true);
			$page->add($form);
			$handled = true;
			$forward = doc();
		} else if ($action == $lang->get("del_folder") && $auth->checkAccessToFunction("DELETE_FOLDER") && $pnode != "0") {
			if (!isset($go))
				$go = "start";

			$delhandler = new ActionHandler("deletefolder");
			
			// removed comment-out from following line because deleting folders didn't work anymore.
			$oid = $pnode;

			if ($go != $lang->get("Cancel")) {
				$amount = 0;

				$sql1 = "SELECT COUNT(CATEGORY_ID) AS ANZ FROM content WHERE CATEGORY_ID = $oid AND DELETED=0";
				$sql2 = "SELECT COUNT(CATEGORY_ID) AS ANZ FROM cluster_templates WHERE CATEGORY_ID = $oid AND DELETED=0";
				$sql3 = "SELECT COUNT(CATEGORY_ID) AS ANZ FROM categories WHERE PARENT_CATEGORY_ID = $oid AND DELETED=0";

				$query = new query($db, $sql1);
				$query->getrow();
				$amount += $query->field("ANZ");
				$query = new query($db, $sql2);
示例#25
0
	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');
	  for ($i=0; $i<count($spms); $i++) {
		for ($j=0; $j<count($variations); $j++) {
        			}
        		}
		}
		
		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);
示例#27
0
	 *	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");

	}

?>
    }
} catch (ServiceException $e) {
    Logger::exception($e);
    if ($output_type == "xml") {
        header('Content-Type: text/xml');
        print "<error>";
        $ec = new ReflectionClass("Error");
        $constants = $ec->getConstants();
        $constants = array_flip($constants);
        $code = $constants[$e->getCode()];
        $message = $e->getMessage();
        if (!$message) {
            $message = $code;
        }
        print "<code>{$code}</code>";
        print "<message>{$message}</message>";
        print "</error>";
    }
} catch (Exception $e) {
    Logger::exception($e);
    if ($output_type == "xml") {
        header('Content-Type: text/xml');
        print "<error>";
        print "<code>UNEXPECTED_ERROR</code>";
        print "<message>" . $e->getMessage() . "</message>";
        print "</error>";
    } else {
        $_REQUEST['error_message'] = $e->getMessage();
        $obj = ActionHandler::handleAction("ErrorPage");
    }
}
		/**
		  * 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");
		}
示例#30
-2
	 *	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();		
?>