Example #1
0
 function Page_Init()
 {
     global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
     global $tbl_user_level;
     // Security
     $Security = new cAdvancedSecurity();
     if (!$Security->IsLoggedIn()) {
         $Security->AutoLogin();
     }
     if (!$Security->IsLoggedIn()) {
         $Security->SaveLastUrl();
         $this->Page_Terminate("login.php");
     }
     $Security->TablePermission_Loading();
     $Security->LoadCurrentUserLevel($this->TableName);
     $Security->TablePermission_Loaded();
     if (!$Security->CanAdmin()) {
         $Security->SaveLastUrl();
         $this->Page_Terminate("login.php");
     }
     // Create form object
     $objForm = new cFormObj();
     // Global Page Loading event (in userfn*.php)
     Page_Loading();
     // Page Load event
     $this->Page_Load();
 }
 function Page_Init()
 {
     global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
     global $tbl_user_level_permissions;
     // Security
     $Security = new cAdvancedSecurity();
     if (!$Security->IsLoggedIn()) {
         $Security->AutoLogin();
     }
     if (!$Security->IsLoggedIn()) {
         $Security->SaveLastUrl();
         $this->Page_Terminate("login.php");
     }
     $Security->TablePermission_Loading();
     $Security->LoadCurrentUserLevel($this->TableName);
     $Security->TablePermission_Loaded();
     if (!$Security->CanAdmin()) {
         $Security->SaveLastUrl();
         $this->Page_Terminate("login.php");
     }
     // Get export parameters
     if (@$_GET["export"] != "") {
         $tbl_user_level_permissions->Export = $_GET["export"];
     } elseif (ew_IsHttpPost()) {
         if (@$_POST["exporttype"] != "") {
             $tbl_user_level_permissions->Export = $_POST["exporttype"];
         }
     } else {
         $tbl_user_level_permissions->setExportReturnUrl(ew_CurrentUrl());
     }
     $gsExport = $tbl_user_level_permissions->Export;
     // Get export parameter, used in header
     $gsExportFile = $tbl_user_level_permissions->TableVar;
     // Get export file, used in header
     // Global Page Loading event (in userfn*.php)
     Page_Loading();
     // Page Load event
     $this->Page_Load();
 }
 function Page_Init()
 {
     global $gsExport, $gsCustomExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
     // User profile
     $UserProfile = new cUserProfile();
     // Security
     $Security = new cAdvancedSecurity();
     if (!$Security->IsLoggedIn()) {
         $Security->AutoLogin();
     }
     if ($Security->IsLoggedIn()) {
         $Security->TablePermission_Loading();
     }
     $Security->LoadCurrentUserLevel($this->ProjectID . $this->TableName);
     if ($Security->IsLoggedIn()) {
         $Security->TablePermission_Loaded();
     }
     if (!$Security->CanAdmin()) {
         $Security->SaveLastUrl();
         $this->Page_Terminate(ew_GetUrl("login.php"));
     }
     if ($Security->IsLoggedIn()) {
         $Security->UserID_Loading();
         $Security->LoadUserID();
         $Security->UserID_Loaded();
     }
     // Create form object
     $objForm = new cFormObj();
     $this->CurrentAction = @$_GET["a"] != "" ? $_GET["a"] : @$_POST["a_list"];
     // Set up current action
     // Global Page Loading event (in userfn*.php)
     Page_Loading();
     // Page Load event
     $this->Page_Load();
     // Check token
     if (!$this->ValidPost()) {
         echo $Language->Phrase("InvalidPostRequest");
         $this->Page_Terminate();
         exit;
     }
     // Process auto fill
     if (@$_POST["ajax"] == "autofill") {
         $results = $this->GetAutoFill(@$_POST["name"], @$_POST["q"]);
         if ($results) {
             // Clean output buffer
             if (!EW_DEBUG_ENABLED && ob_get_length()) {
                 ob_end_clean();
             }
             echo $results;
             $this->Page_Terminate();
             exit;
         }
     }
     // Create Token
     $this->CreateToken();
 }
 function Page_Init()
 {
     global $gsExport, $gsCustomExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
     // User profile
     $UserProfile = new cUserProfile();
     // Security
     $Security = new cAdvancedSecurity();
     if (!$Security->IsLoggedIn()) {
         $Security->AutoLogin();
     }
     if ($Security->IsLoggedIn()) {
         $Security->TablePermission_Loading();
     }
     $Security->LoadCurrentUserLevel($this->ProjectID . $this->TableName);
     if ($Security->IsLoggedIn()) {
         $Security->TablePermission_Loaded();
     }
     if (!$Security->CanAdmin()) {
         $Security->SaveLastUrl();
         $this->Page_Terminate(ew_GetUrl("login.php"));
     }
     if ($Security->IsLoggedIn()) {
         $Security->UserID_Loading();
         $Security->LoadUserID();
         $Security->UserID_Loaded();
     }
     // Get export parameters
     $custom = "";
     if (@$_GET["export"] != "") {
         $this->Export = $_GET["export"];
         $custom = @$_GET["custom"];
     } elseif (@$_POST["export"] != "") {
         $this->Export = $_POST["export"];
         $custom = @$_POST["custom"];
     } elseif (ew_IsHttpPost()) {
         if (@$_POST["exporttype"] != "") {
             $this->Export = $_POST["exporttype"];
         }
         $custom = @$_POST["custom"];
     } else {
         $this->setExportReturnUrl(ew_CurrentUrl());
     }
     $gsExportFile = $this->TableVar;
     // Get export file, used in header
     // Get custom export parameters
     if ($this->Export != "" && $custom != "") {
         $this->CustomExport = $this->Export;
         $this->Export = "print";
     }
     $gsCustomExport = $this->CustomExport;
     $gsExport = $this->Export;
     // Get export parameter, used in header
     // Update Export URLs
     if (defined("EW_USE_PHPEXCEL")) {
         $this->ExportExcelCustom = FALSE;
     }
     if ($this->ExportExcelCustom) {
         $this->ExportExcelUrl .= "&custom=1";
     }
     if (defined("EW_USE_PHPWORD")) {
         $this->ExportWordCustom = FALSE;
     }
     if ($this->ExportWordCustom) {
         $this->ExportWordUrl .= "&custom=1";
     }
     if ($this->ExportPdfCustom) {
         $this->ExportPdfUrl .= "&custom=1";
     }
     $this->CurrentAction = @$_GET["a"] != "" ? $_GET["a"] : @$_POST["a_list"];
     // Set up current action
     // Get grid add count
     $gridaddcnt = @$_GET[EW_TABLE_GRID_ADD_ROW_COUNT];
     if (is_numeric($gridaddcnt) && $gridaddcnt > 0) {
         $this->GridAddRowCount = $gridaddcnt;
     }
     // Set up list options
     $this->SetupListOptions();
     // Setup export options
     $this->SetupExportOptions();
     // Global Page Loading event (in userfn*.php)
     Page_Loading();
     // Page Load event
     $this->Page_Load();
     // Check token
     if (!$this->ValidPost()) {
         echo $Language->Phrase("InvalidPostRequest");
         $this->Page_Terminate();
         exit;
     }
     // Process auto fill
     if (@$_POST["ajax"] == "autofill") {
         $results = $this->GetAutoFill(@$_POST["name"], @$_POST["q"]);
         if ($results) {
             // Clean output buffer
             if (!EW_DEBUG_ENABLED && ob_get_length()) {
                 ob_end_clean();
             }
             echo $results;
             $this->Page_Terminate();
             exit;
         }
     }
     // Create Token
     $this->CreateToken();
     // Setup other options
     $this->SetupOtherOptions();
     // Set up custom action (compatible with old version)
     foreach ($this->CustomActions as $name => $action) {
         $this->ListActions->Add($name, $action);
     }
     // Show checkbox column if multiple action
     foreach ($this->ListActions->Items as $listaction) {
         if ($listaction->Select == EW_ACTION_MULTIPLE && $listaction->Allow) {
             $this->ListOptions->Items["checkbox"]->Visible = TRUE;
             break;
         }
     }
 }
Example #5
0
 function Page_Init()
 {
     global $gsExport, $gsCustomExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
     // User profile
     $UserProfile = new cUserProfile();
     // Security
     $Security = new cAdvancedSecurity();
     if (!$Security->IsLoggedIn()) {
         $Security->AutoLogin();
     }
     if ($Security->IsLoggedIn()) {
         $Security->TablePermission_Loading();
     }
     $Security->LoadCurrentUserLevel(CurrentProjectID() . 'user_levels');
     if ($Security->IsLoggedIn()) {
         $Security->TablePermission_Loaded();
     }
     if (!$Security->CanAdmin()) {
         $Security->SaveLastUrl();
         $this->Page_Terminate(ew_GetUrl("login.php"));
     }
     if ($Security->IsLoggedIn()) {
         $Security->UserID_Loading();
         $Security->LoadUserID();
         $Security->UserID_Loaded();
     }
     $this->CurrentAction = @$_GET["a"] != "" ? $_GET["a"] : @$_POST["a_list"];
     // Set up current action
     // Global Page Loading event (in userfn*.php)
     Page_Loading();
     // Page Load event
     $this->Page_Load();
     // Check token
     if (!$this->ValidPost()) {
         echo $Language->Phrase("InvalidPostRequest");
         $this->Page_Terminate();
         exit;
     }
     // Create Token
     $this->CreateToken();
 }
 function Page_Init()
 {
     global $gsExport, $gsCustomExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
     // User profile
     $UserProfile = new cUserProfile();
     // Security
     $Security = new cAdvancedSecurity();
     if (!$Security->IsLoggedIn()) {
         $Security->AutoLogin();
     }
     if ($Security->IsLoggedIn()) {
         $Security->TablePermission_Loading();
     }
     $Security->LoadCurrentUserLevel($this->ProjectID . $this->TableName);
     if ($Security->IsLoggedIn()) {
         $Security->TablePermission_Loaded();
     }
     if (!$Security->CanAdmin()) {
         $Security->SaveLastUrl();
         $this->Page_Terminate(ew_GetUrl("login.php"));
     }
     if ($Security->IsLoggedIn()) {
         $Security->UserID_Loading();
         $Security->LoadUserID();
         $Security->UserID_Loaded();
     }
     // Get export parameters
     $custom = "";
     if (@$_GET["export"] != "") {
         $this->Export = $_GET["export"];
         $custom = @$_GET["custom"];
     } elseif (@$_POST["export"] != "") {
         $this->Export = $_POST["export"];
         $custom = @$_POST["custom"];
     } elseif (ew_IsHttpPost()) {
         if (@$_POST["exporttype"] != "") {
             $this->Export = $_POST["exporttype"];
         }
         $custom = @$_POST["custom"];
     } else {
         $this->setExportReturnUrl(ew_CurrentUrl());
     }
     $gsExportFile = $this->TableVar;
     // Get export file, used in header
     if (@$_GET["TABLE_NAME"] != "") {
         if ($gsExportFile != "") {
             $gsExportFile .= "_";
         }
         $gsExportFile .= ew_StripSlashes($_GET["TABLE_NAME"]);
     }
     if (@$_GET["USER_LEVEL_ID"] != "") {
         if ($gsExportFile != "") {
             $gsExportFile .= "_";
         }
         $gsExportFile .= ew_StripSlashes($_GET["USER_LEVEL_ID"]);
     }
     // Get custom export parameters
     if ($this->Export != "" && $custom != "") {
         $this->CustomExport = $this->Export;
         $this->Export = "print";
     }
     $gsCustomExport = $this->CustomExport;
     $gsExport = $this->Export;
     // Get export parameter, used in header
     // Update Export URLs
     if (defined("EW_USE_PHPEXCEL")) {
         $this->ExportExcelCustom = FALSE;
     }
     if ($this->ExportExcelCustom) {
         $this->ExportExcelUrl .= "&custom=1";
     }
     if (defined("EW_USE_PHPWORD")) {
         $this->ExportWordCustom = FALSE;
     }
     if ($this->ExportWordCustom) {
         $this->ExportWordUrl .= "&custom=1";
     }
     if ($this->ExportPdfCustom) {
         $this->ExportPdfUrl .= "&custom=1";
     }
     $this->CurrentAction = @$_GET["a"] != "" ? $_GET["a"] : @$_POST["a_list"];
     // Set up current action
     // Setup export options
     $this->SetupExportOptions();
     // Global Page Loading event (in userfn*.php)
     Page_Loading();
     // Page Load event
     $this->Page_Load();
     // Check token
     if (!$this->ValidPost()) {
         echo $Language->Phrase("InvalidPostRequest");
         $this->Page_Terminate();
         exit;
     }
     // Create Token
     $this->CreateToken();
 }