예제 #1
0
function Reload_Chart($name)
{
    if (!$name) {
        if (isset($_SESSION['webcharts'])) {
            return true;
        } else {
            HeaderRedirect("webreport");
        }
    }
    $arr = getChartArray($name);
    if (!count($arr)) {
        HeaderRedirect("webreport");
    }
    if (!$arr["table_type"]) {
        if ($arr["db_based"]) {
            $arr["table_type"] = "db";
        } else {
            $arr["table_type"] = "project";
        }
    }
    $_SESSION['webcharts'] = $arr;
    $_SESSION["webobject"]["table_type"] = $_SESSION['webcharts']["table_type"];
    $_SESSION["webobject"]["name"] = $_SESSION['webcharts']['settings']['name'];
}
예제 #2
0
 /**
  * Check whether the user is allowed to see the page
  */
 protected function readRecord()
 {
     if ($this->getCurrentRecordInternal()) {
         return true;
     }
     if ($this->mode == VIEW_SIMPLE) {
         HeaderRedirect($this->pSet->getShortTableName(), "list", "a=return");
         exit;
     }
     //	nothing to show.
     //	TODO: add some report or message
     exit;
     return false;
 }
예제 #3
0
 /**
  *	POST-REDIRECT-GET 
  *	Redirect after saving the data to avoid saving again on refresh.
  */
 protected function prgRedirect()
 {
     if (!$this->insertedSuccessfully || $this->mode != ADD_SIMPLE || !no_output_done()) {
         return false;
     }
     // saving message
     $_SESSION["message_add"] = $this->message ? $this->message : "";
     // redirect
     HeaderRedirect($this->pSet->getShortTableName(), $this->pageType);
     // turned on output buffering, so we need to stop script
     return true;
 }
예제 #4
0
 /**
  * PRG rule, to avoid POSTDATA resend
  * call after save
  */
 function rulePRG()
 {
     if (no_output_done() && postvalue("a") == "save") {
         // redirect, add a=return param for saving SESSION
         HeaderRedirect($this->shortTableName, $this->getPageType(), "a=return");
         // turned on output buffering, so we need to stop script
         exit;
     }
 }
예제 #5
0
<?php

@ini_set("display_errors", "1");
@ini_set("display_startup_errors", "1");
require_once "include/dbcommon.php";
if (!isLogged()) {
    HeaderRedirect("login");
    return;
}
if ($_SESSION["MyURL"] == "" || !isLoggedAsGuest()) {
    Security::saveRedirectURL();
}
$layout = new TLayout("menu", "CityBlueWave", "MobileBlueWave");
$layout->version = 2;
$layout->blocks["top"] = array();
$layout->containers["menu"] = array();
$layout->container_properties["menu"] = array();
$layout->containers["menu"][] = array("name" => "login_menu", "block" => "loggedas_block", "substyle" => 1);
$layout->containers["menu"][] = array("name" => "vmenu", "block" => "menu_block", "substyle" => 1);
$layout->skins["menu"] = "menu";
$layout->blocks["top"][] = "menu";
$page_layouts["menu"] = $layout;
$layout->skinsparams = array();
$layout->skinsparams["empty"] = array("button" => "button1");
$layout->skinsparams["menu"] = array("button" => "button1");
$layout->skinsparams["hmenu"] = array("button" => "button1");
$layout->skinsparams["undermenu"] = array("button" => "button1");
$layout->skinsparams["fields"] = array("button" => "button1");
$layout->skinsparams["form"] = array("button" => "button1");
$layout->skinsparams["1"] = array("button" => "button1");
$layout->skinsparams["2"] = array("button" => "button1");
require_once "include/dbcommon.php";
add_nocache_headers();
require_once "include/CompanyMaster_variables.php";
require_once "classes/searchcontrol.php";
require_once "classes/advancedsearchcontrol.php";
require_once "classes/panelsearchcontrol.php";
require_once "classes/searchclause.php";
if (!isLogged()) {
    Security::saveRedirectURL();
    redirectToLogin();
}
$cname = postvalue("cname");
$rname = postvalue("rname");
$accessGranted = CheckTablePermissions($strTableName, "S");
if (!$accessGranted) {
    HeaderRedirect("menu");
}
$layout = new TLayout("search5", "CityBlueWave", "MobileBlueWave");
$layout->version = 2;
$layout->blocks["top"] = array();
$layout->containers["fields"] = array();
$layout->container_properties["fields"] = array();
$layout->containers["fields"][] = array("name" => "srchheader", "block" => "searchheader", "substyle" => 2);
$layout->containers["fields"][] = array("name" => "srchconditions", "block" => "conditions_block", "substyle" => 1);
$layout->containers["fields"][] = array("name" => "srchfields", "block" => "", "substyle" => 1);
$layout->containers["fields"][] = array("name" => "srchbuttons", "block" => "searchbuttons", "substyle" => 2);
$layout->skins["fields"] = "fields";
$layout->blocks["top"][] = "fields";
$page_layouts["CompanyMaster_search"] = $layout;
$layout->skinsparams = array();
$layout->skinsparams["empty"] = array("button" => "button1");
예제 #7
0
	/**
	 * PRG rule, to avoid POSTDATA resend
	 */
	function rulePRG() 
	{		
		if(no_output_done() && count($this->selectedRecs) && !strlen($this->deleteMessage)) 
		{	
			// redirect, add a=return param for saving SESSION
			HeaderRedirect($this->shortTableName, $this->getPageType(), "a=return");
			// turned on output buffering, so we need to stop script
			exit();
		}
	}
function SecurityRedirect($inlineedit)
{
	if($inlineedit == EDIT_INLINE)
	{
		echo printJSON(array("success" => false, "message" => "The record is not editable"));
		return;
	}
	
	$_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];
	HeaderRedirect("menu", "message=expired");	
}
예제 #9
0
 function display($tpl = null)
 {
     $this->Application = JFactory::getApplication();
     // Access the Component-wide default parameters, already overridden with those for the menu item (if applicable):
     //$this->cparams = $this->Application->getParams('com_foxcontact');
     // Can't use getParams('com_foxcontact') because JRegistry::merge converts StdClass properties to arrays
     $this->cparams = $this->Application->getMenu()->getActive()->params;
     // Set Meta Description
     if ($description = $this->cparams->get('menu-meta_description')) {
         $this->document->setDescription($description);
     }
     // Set Meta Keywords
     if ($keywords = $this->cparams->get('menu-meta_keywords')) {
         $this->document->setMetadata('keywords', $keywords);
     }
     // Set robots (index, follow)
     if ($robots = $this->cparams->get('robots')) {
         $this->document->setMetadata('robots', $robots);
     }
     $foxDocument = FoxDocument::getInstance();
     // User interface stylesheet
     $foxDocument->addResource(array("root" => "media", "filename" => "foxcontact", "type" => "css"));
     // User selected stylesheet
     $stylesheet = $this->cparams->get("css", "bootstrap.css");
     // Removes the extension part from the file name
     $stylesheet = preg_replace("/\\.[^.\\s]{3,4}\$/", "", $stylesheet);
     $foxDocument->addResource(array("root" => "components", "filename" => $stylesheet, "type" => "css"));
     $this->MessageBoard = new FoxMessageBoard();
     $this->Submitter = new FSubmitter($this->cparams, $this->MessageBoard);
     $this->FieldsBuilder = new FieldsBuilder($this->cparams, $this->MessageBoard);
     $this->AjaxUploader = new FAjaxUploader($this->cparams, $this->MessageBoard);
     $this->FoxCaptcha = new FCaptcha($this->cparams, $this->MessageBoard);
     $this->JMessenger = new FJMessenger($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->DatabaseDispatcher = new DatabaseDispatcher($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->Antispam = new FAntispam($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->Newsletter = new FNewsletter($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->AcyMailing = new FAcyMailing($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->JNews = new FJNewsSubscriber($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->AdminMailer = new FAdminMailer($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->SubmitterMailer = new FSubmitterMailer($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->FormText .= $this->FieldsBuilder->Show();
     $this->FormText .= $this->AjaxUploader->Show();
     $this->FormText .= $this->AcyMailing->Show();
     $this->FormText .= $this->JNews->Show();
     $this->FormText .= $this->FoxCaptcha->Show();
     $this->FormText .= $this->Antispam->Show();
     $this->FormText .= $this->Submitter->Show();
     switch (0) {
         case $this->Submitter->IsValid():
             break;
         case $this->FieldsBuilder->IsValid():
             break;
         case $this->AjaxUploader->IsValid():
             break;
         case $this->FoxCaptcha->IsValid():
             break;
         case $this->Antispam->IsValid():
             break;
         case $this->JMessenger->Process():
             break;
         case $this->DatabaseDispatcher->Process():
             break;
         case $this->Newsletter->Process():
             break;
         case $this->AcyMailing->Process():
             break;
         case $this->JNews->Process():
             break;
         case $this->AdminMailer->Process():
             break;
         case $this->SubmitterMailer->Process():
             break;
         default:
             // None of the previous checks are failed
             // Avoid to show the Form and the button again
             $this->FormText = "";
             // Reset the solution of the captcha in the session after read, avoiding further (ab)uses of the same valid session
             $jsession = JFactory::getSession();
             $namespace = "foxcontact_component_" . $this->Application->cid;
             $jsession->clear("captcha_answer", $namespace);
             HeaderRedirect($this->cparams);
     }
     // Display the view
     parent::display($tpl);
 }
예제 #10
0
 /**
  *	POST-REDIRECT-GET 
  *	Redirect after saving the data to avoid saving again on refresh.
  */
 protected function prgRedirect()
 {
     if (!$this->updatedSuccessfully || $this->mode != EDIT_SIMPLE || !no_output_done()) {
         return false;
     }
     $_SESSION["message_edit"] = $this->message . "";
     $keyParams = array();
     foreach ($this->keyFields as $i => $k) {
         $keyParams[] = "editid" . ($i + 1) . "=" . rawurldecode($this->keys[$k]);
     }
     HeaderRedirect($this->pSet->getShortTableName(), $this->getPageType(), implode("&", $keyParams));
     exit;
     return true;
 }
/**
 *	Redirects to login.
 *  Displays Session expired message if the page was opened from within the project directory.
 *
 */
function redirectToLogin()
{
	
	$expired = "";
	$url = "http://";
	if( $_SERVER["HTTPS"] && $_SERVER["HTTPS"] != "off")
		$url = "https://";
	$url .= $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI'];


	if( isset($_SERVER['HTTP_REFERER']) )
	{
		if( getDirectoryFromURI( $_SERVER['HTTP_REFERER'] ) == getDirectoryFromURI( $url ) 
			&& getFilenameFromURI( $_SERVER['HTTP_REFERER'] ) != "index.htm" 
			&& $_SERVER['HTTP_REFERER'] != getDirectoryFromURI( $url ))
			$expired = "message=expired";
	}
	HeaderRedirect("login", "", $expired);
	exit();
}
예제 #12
0
 public static function processListPageSecurity($table)
 {
     //	user has necessary permissions
     if (Security::checkPagePermissions($table, "S")) {
         return true;
     }
     $mode = ListPage::readListModeFromRequest();
     //	check special permissions like lookup mode
     if ($mode == LIST_LOOKUP && ListPage::checkLookupPermissions($table)) {
         return true;
     }
     //	page can not be displayed. Redirect or return error
     //	return error if the page is requested by AJAX
     if ($mode != LIST_SIMPLE) {
         Security::sendPermissionError();
         return false;
     }
     // The user is logged in but lacks necessary permissions
     // redirect to List page or Menu.
     if (isLogged() && !isLoggedAsGuest()) {
         HeaderRedirect("menu");
         return false;
     }
     //	Not logged in
     // 	redirect to Login
     //	Current URL is already saved in session
     redirectToLogin();
     return false;
 }
예제 #13
0
 function display($tpl = null)
 {
     $this->Application = JFactory::getApplication();
     // The following code will access the Component-wide default parameters,
     // already overridden with those for the menu item (if applicable):
     $this->cparams = $this->Application->getParams('com_foxcontact');
     $this->Submitter = new FSubmitter($this->cparams, $this->messages);
     $this->FieldsBuilder = new FieldsBuilder($this->cparams, $this->messages);
     $this->AjaxUploader = new FAjaxUploader($this->cparams, $this->messages);
     $this->Uploader = new FUploader($this->cparams, $this->messages);
     $this->FoxCaptcha = new FCaptcha($this->cparams, $this->messages);
     $this->JMessenger = new FJMessenger($this->cparams, $this->messages, $this->FieldsBuilder);
     $this->Antispam = new FAntispam($this->cparams, $this->messages, $this->FieldsBuilder);
     $this->AdminMailer = new FAdminMailer($this->cparams, $this->messages, $this->FieldsBuilder);
     $this->SubmitterMailer = new FSubmitterMailer($this->cparams, $this->messages, $this->FieldsBuilder);
     // Build $FormText
     $this->FormText .= $this->FieldsBuilder->Show();
     $this->FormText .= $this->AjaxUploader->Show();
     $this->FormText .= $this->FoxCaptcha->Show();
     $this->FormText .= $this->Antispam->Show();
     // Usually we want the submit button at the bottom
     $this->FormText .= $this->Submitter->Show();
     switch (0) {
         case $this->Submitter->IsValid():
             break;
         case $this->FieldsBuilder->IsValid():
             break;
         case $this->AjaxUploader->IsValid():
             break;
         case $this->Uploader->IsValid():
             break;
         case $this->FoxCaptcha->IsValid():
             break;
         case $this->Antispam->IsValid():
             break;
             // Spam check passed or disabled
         // Spam check passed or disabled
         case $this->JMessenger->Process():
             break;
         case $this->AdminMailer->Process():
             break;
         case $this->SubmitterMailer->Process():
             break;
         default:
             // None of the previous checks are failed
             // Avoid to show the Form and the button again
             $this->FormText = "";
             // Reset captcha solution in the session after read it, avoiding that a f****d lamer
             // abuse of the *same session* without request the captcha again, to send tons of email
             $jsession = JFactory::getSession();
             $fsession = new FSession($jsession->getId(), $this->Application->cid, $this->Application->mid);
             $fsession->PurgeValue("captcha_answer");
             HeaderRedirect($this->cparams);
     }
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // Display the view
     parent::display($tpl);
 }
예제 #14
0
	static function reloginAndLogoutProcess($permission)
	{
		global $strTableName;
				
		include_once(getabspath('classes/loginpage.php'));
		$loginXt = new Xtempl();
		
		$loginParams = array("pageType" => PAGE_LOGIN);
		$loginParams['xt'] = &$loginXt;
		$loginParams["tName"]= NOT_TABLE_BASED_TNAME;
		$loginParams['needSearchClauseObj'] = false;
		$loginPageObject = new LoginPage($loginParams); 
		$loginPageObject->init();

		// login automatically, if username and password are in cookies.
		if( !isLogged() || isLoggedAsGuest() ) 
		{
			$username = $_COOKIE["username"];
			$password = $_COOKIE["password"];
			if( $username != "" && $password != "" ) 
			{
				$loginPageObject->LogIn($username, $password);
			}
		}
		
		$url = $_SERVER["SCRIPT_NAME"].(!empty($_SERVER["QUERY_STRING"]) ? "?".$_SERVER["QUERY_STRING"] : '');
		if (!postvalue("onFly")) 
		{
			$_SESSION["MyURL"] = $url;
		}
		
		if (postvalue("a")=="logout") 
		{
			$_SESSION["MyURL"] = $_SERVER["SCRIPT_NAME"];
			if (!CheckTablePermissions($strTableName, $permission) || !isLogged()) 
			{
				HeaderRedirect("login", "", "");
				exit();
			}
			if (isLogged() && !isLoggedAsGuest()) 
			{
				$loginPageObject->LogoutAndRedirect($url);
			}
		}
	}
예제 #15
0
<?php

@ini_set("display_errors", "1");
@ini_set("display_startup_errors", "1");
require_once "include/dbcommon.php";
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT");
require_once "classes/charts.php";
require_once getabspath("include/xml.php");
require_once getabspath("classes/searchclause.php");
if (!isLogged()) {
    Security::saveRedirectURL();
    HeaderRedirect("login", "", "message=expired");
    return;
}
$xml = new xml();
$chrt_strXML = "";
if (checkTableName(postvalue("chartname"), titCHART)) {
    include_once "include/" . postvalue("chartname") . "_variables.php";
    $chrt_strXML = GetChartXML(postvalue("chartname"));
    $chrt_array = $xml->xml_to_array($chrt_strXML);
    $_SESSION["webobject"]["table_type"] = "project";
    $_SESSION["object_sql"] = "";
}
$webchart = false;
if (!$chrt_strXML) {
    $sessPrefix = "webchart" . postvalue('cname');
    $chrt_strXML = LoadSelectedChart(postvalue('cname'));
    $webchart = true;
    $chrt_array = $xml->xml_to_array($chrt_strXML);
    if (is_wr_project()) {
        include_once "include/" . $chrt_array['settings']['short_table_name'] . "_variables.php";
예제 #16
0
/**
 *	Redirects to login.
 *  Displays Session expired message if the page was opened from within the project directory.
 *
 */
function redirectToLogin()
{
    $expired = "";
    $url = "http://";
    if ($_SERVER["HTTPS"] && $_SERVER["HTTPS"] != "off") {
        $url = "https://";
    }
    $url .= $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI'];
    global $logoutPerformed;
    if (!$logoutPerformed && isset($_SERVER['HTTP_REFERER'])) {
        if (getDirectoryFromURI($_SERVER['HTTP_REFERER']) == getDirectoryFromURI($url) && getFilenameFromURI($_SERVER['HTTP_REFERER']) != "index.htm" && $_SERVER['HTTP_REFERER'] != getDirectoryFromURI($url)) {
            $expired = "&message=expired";
        }
    }
    HeaderRedirect("login", "", "return=true" . $expired);
    exit;
}
if($pageObject->isShowDetailTables && !isMobile())
{
	$ids = $id;
	$pageObject->jsSettings['tableSettings'][$strTableName]['dpParams'] = array();
}

//	Before Process event
if($eventObj->exists("BeforeProcessView"))
	$eventObj->BeforeProcessView($conn, $pageObject);
	
//	read current values from the database
$data = $pageObject->getCurrentRecordInternal();

if (!sizeof($data)) 
{
	HeaderRedirect("webreport_users", "list", "a=return");
	exit();
}

$out = "";
$fieldsArr = array();
$arr = array();
$arr['fName'] = "id";
$arr['viewFormat'] = $pageObject->pSet->getViewFormat("id");
$fieldsArr[] = $arr;
$arr = array();
$arr['fName'] = "username";
$arr['viewFormat'] = $pageObject->pSet->getViewFormat("username");
$fieldsArr[] = $arr;
$arr = array();
$arr['fName'] = "password";
예제 #18
0
    case $fcaptcha->IsValid():
        break;
    case $antispam->IsValid():
        break;
        // Spam check passed or disabled
    // Spam check passed or disabled
    case $jMessenger->Process():
        break;
    case $DatabaseDispatcher->Process():
        break;
    case $newsletter->Process():
        break;
    case $acymailing->Process():
        break;
    case $jnews->Process():
        break;
    case $adminMailer->Process():
        break;
    case $submitterMailer->Process():
        break;
    default:
        // None of the previous checks are failed
        // Avoid to show the Form and the button again
        $form_text = "";
        // Reset the solution of the captcha in the session after read, avoiding further (ab)uses of the same valid session
        $jsession = JFactory::getSession();
        $namespace = "foxcontact_module_" . $module->id;
        $jsession->clear("captcha_answer", $namespace);
        HeaderRedirect($params);
}
require JModuleHelper::getLayoutPath($app->scope, $params->get('layout', 'default'));
예제 #19
0
 public static function redirectToList($table)
 {
     $settings = new ProjectSettings($table);
     if ($settings->hasListPage()) {
         HeaderRedirect($settings->getShortTableName(), "list", "a=return");
         exit;
     }
     //	no List page
     HeaderRedirect("menu");
     exit;
 }
	{
		$message = $usermessage;
		$status = "DECLINED";
		$readavalues = true;
	}
}
if($message)
	$message = "<div class='".$mesClass."'>".$message."</div>";

// PRG rule, to avoid POSTDATA resend
if (no_output_done() && $inlineadd==ADD_SIMPLE && $IsSaved)
{
	// saving message
	$_SESSION["message_add"] = ($message ? $message : "");
	// redirect
	HeaderRedirect("webreport_users", $pageObject->getPageType());
	// turned on output buffering, so we need to stop script
	exit();
}

if($inlineadd==ADD_MASTER && $IsSaved)
	$_SESSION["message_add"] = ($message ? $message : "");
	
// for PRG rule, to avoid POSTDATA resend. Saving mess in session
if($inlineadd==ADD_SIMPLE && isset($_SESSION["message_add"]))
{
	$message = $_SESSION["message_add"];
	unset($_SESSION["message_add"]);
}

$defvalues=array();