Compare commits

...

2 Commits

Author SHA1 Message Date
Clemens Schwaighofer
46554e6965 Update to make all class E_NOTICE safe, add page_content
- ALL classes are E_NOTICE safe as far as possible.
There might be some minor things left over which will be cleaned up in
further testing

- Added declare(strict_types=1); on all pages for trying to make all
calls strict

- Added page_content sub content to edit_page, with this some inner page
content with ACL can be set, eg for use with Ajax/JS calls with backend.
Also alias can be set so the control ajax pages can back reference to
the master page content setting. Currently only one back reference is
allowed

- Note that the PAGES array has no numeric indexes, but uses the cuid as
index
2019-09-10 11:05:30 +09:00
Clemens Schwaighofer
c8686024e2 Add .htaccess to override global php settings
This is for working on E_ALL fix for core libs before we can turn it on
global
2019-09-06 18:21:14 +09:00
48 changed files with 1481 additions and 1037 deletions

17
.htaccess Normal file
View File

@@ -0,0 +1,17 @@
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag log_errors on
php_flag ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag report_memleaks on
php_flag track_errors on
php_value docref_root 0
php_value docref_ext 0
# Turn this on to redirect log to different folder
#php_value error_log /var/www/html/developers/clemens/php/php-error/php-errors.log
# this is E_ALL reporting ON
php_value error_reporting -1
# this is E_ALL | ~E_NOTICE
#php_value error_reporting 2039
php_value log_errors_max_len 0

View File

@@ -2,12 +2,13 @@
-- DATE: 2005/07/05 -- DATE: 2005/07/05
-- DESCRIPTION: -- DESCRIPTION:
-- edit tables, this table contains all pages in the edit interface and allocates rights + values to it -- edit tables, this table contains all pages in the edit interface and allocates rights + values to it
-- TABLE: edit_table -- TABLE: edit_page
-- HISTORY: -- HISTORY:
-- DROP TABLE edit_page; -- DROP TABLE edit_page;
CREATE TABLE edit_page ( CREATE TABLE edit_page (
edit_page_id SERIAL PRIMARY KEY, edit_page_id SERIAL PRIMARY KEY,
content_alias_edit_page_id INT, -- alias for page content, if the page content is defined on a different page, ege for ajax backend pages
filename VARCHAR, filename VARCHAR,
name VARCHAR UNIQUE, name VARCHAR UNIQUE,
order_number INT NOT NULL, order_number INT NOT NULL,
@@ -15,5 +16,6 @@ CREATE TABLE edit_page (
menu SMALLINT NOT NULL DEFAULT 0, menu SMALLINT NOT NULL DEFAULT 0,
popup SMALLINT NOT NULL DEFAULT 0, popup SMALLINT NOT NULL DEFAULT 0,
popup_x SMALLINT, popup_x SMALLINT,
popup_y SMALLINT popup_y SMALLINT,
FOREIGN KEY (content_alias_edit_page_id) REFERENCES edit_page (edit_page_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE,
) INHERITS (edit_generic) WITHOUT OIDS; ) INHERITS (edit_generic) WITHOUT OIDS;

View File

@@ -0,0 +1,20 @@
-- AUTHOR: Clemens Schwaighofer
-- DATE: 2019/9/9
-- DESCRIPTION:
-- sub content to one page with additional edit access right set
-- can be eg JS content groups on one page
-- TABLE: edit_page_content
-- HISTORY:
-- DROP TABLE edit_page_content;
CREATE TABLE edit_page_content (
edit_page_content_id SERIAL PRIMARY KEY,
edit_page_id INT NOT NULL,
edit_access_right_id INT NOT NULL,
name VARCHAR,
uid VARCHAR UNIQUE,
order_number INT NOT NULL,
online SMALLINT NOT NULL DEFAULT 0,
FOREIGN KEY (edit_access_right_id) REFERENCES edit_access_right (edit_access_right_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (edit_page_id) REFERENCES edit_page (edit_page_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE
) INHERITS (edit_generic) WITHOUT OIDS;

View File

@@ -0,0 +1,4 @@
DROP TRIGGER trg_edit_page_content ON edit_page_content;
CREATE TRIGGER trg_edit_page_content
BEFORE INSERT OR UPDATE ON edit_page_content
FOR EACH ROW EXECUTE PROCEDURE set_edit_generic();

View File

@@ -0,0 +1,7 @@
-- 2019/9/10 update edit_page with reference
-- page content reference settings
-- UPDATE
ALTER TABLE edit_page ADD content_alias_edit_page_id INT;
ALTER TABLE edit_page ADD CONSTRAINT edit_page_content_alias_edit_page_id_fkey FOREIGN KEY (content_alias_edit_page_id) REFERENCES edit_page (edit_page_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations $DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
$DEBUG_ALL = 1; $DEBUG_ALL = 1;
@@ -33,7 +33,7 @@ ob_end_flush();
// set + check edit access id // set + check edit access id
$edit_access_id = 3; $edit_access_id = 3;
if (isset($login) && is_object($login) && isset($login->acl['unit'])) { if (isset($login) && is_object($login) && isset($login->acl['unit'])) {
print "ACL UNIT: ".print_r(array_keys($login->acl['unit']), 1)."<br>"; print "ACL UNIT: ".print_r(array_keys($login->acl['unit']), true)."<br>";
print "ACCESS CHECK: ".$login->loginCheckEditAccess($edit_access_id)."<br>"; print "ACCESS CHECK: ".$login->loginCheckEditAccess($edit_access_id)."<br>";
if ($login->loginCheckEditAccess($edit_access_id)) { if ($login->loginCheckEditAccess($edit_access_id)) {
$basic->edit_access_id = $edit_access_id; $basic->edit_access_id = $edit_access_id;
@@ -87,22 +87,22 @@ while ($res = $basic->dbReturn("SELECT * FROM max_test")) {
} }
$status = $basic->dbExec("INSERT INTO foo (test) VALUES ('FOO TEST ".time()."') RETURNING test"); $status = $basic->dbExec("INSERT INTO foo (test) VALUES ('FOO TEST ".time()."') RETURNING test");
print "DIRECT INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, 1)."<br>"; print "DIRECT INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, true)."<br>";
print "DIRECT INSERT PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), 1)."<br>"; print "DIRECT INSERT PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), true)."<br>";
$basic->dbPrepare("ins_foo", "INSERT INTO foo (test) VALUES ($1)"); $basic->dbPrepare("ins_foo", "INSERT INTO foo (test) VALUES ($1)");
$status = $basic->dbExecute("ins_foo", array('BAR TEST '.time())); $status = $basic->dbExecute("ins_foo", array('BAR TEST '.time()));
print "PREPARE INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, 1)."<br>"; print "PREPARE INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, true)."<br>";
print "PREPARE INSERT PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), 1)."<br>"; print "PREPARE INSERT PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), true)."<br>";
// returning test with multiple entries // returning test with multiple entries
// $status = $basic->db_exec("INSERT INTO foo (test) values ('BAR 1 ".time()."'), ('BAR 2 ".time()."'), ('BAR 3 ".time()."') RETURNING foo_id"); // $status = $basic->db_exec("INSERT INTO foo (test) values ('BAR 1 ".time()."'), ('BAR 2 ".time()."'), ('BAR 3 ".time()."') RETURNING foo_id");
$status = $basic->dbExec("INSERT INTO foo (test) values ('BAR 1 ".time()."'), ('BAR 2 ".time()."'), ('BAR 3 ".time()."') RETURNING foo_id, test"); $status = $basic->dbExec("INSERT INTO foo (test) values ('BAR 1 ".time()."'), ('BAR 2 ".time()."'), ('BAR 3 ".time()."') RETURNING foo_id, test");
print "DIRECT MULTIPLE INSERT STATUS: $status | PRIMARY KEYS: ".print_r($basic->insert_id, 1)." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, 1)."<br>"; print "DIRECT MULTIPLE INSERT STATUS: $status | PRIMARY KEYS: ".print_r($basic->insert_id, true)." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, true)."<br>";
// no returning, but not needed ; // no returning, but not needed ;
$status = $basic->dbExec("INSERT INTO foo (test) VALUES ('FOO; TEST ".time()."');"); $status = $basic->dbExec("INSERT INTO foo (test) VALUES ('FOO; TEST ".time()."');");
print "DIRECT INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, 1)."<br>"; print "DIRECT INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, true)."<br>";
// UPDATE WITH RETURNING // UPDATE WITH RETURNING
$status = $basic->dbExec("UPDATE foo SET test = 'SOMETHING DIFFERENT' WHERE foo_id = 3688452 RETURNING test"); $status = $basic->dbExec("UPDATE foo SET test = 'SOMETHING DIFFERENT' WHERE foo_id = 3688452 RETURNING test");
print "UPDATE STATUS: $status | RETURNING EXT: ".print_r($basic->insert_id_ext, 1)."<br>"; print "UPDATE STATUS: $status | RETURNING EXT: ".print_r($basic->insert_id_ext, true)."<br>";
# db write class test # db write class test
$table = 'foo'; $table = 'foo';
@@ -125,6 +125,11 @@ $data = array ('test' => 'BOOL TEST UNSET '.time());
$primary_key = $basic->dbWriteDataExt($db_write_table, $primary_key, $table, $object_fields_not_touch, $object_fields_not_update, $data); $primary_key = $basic->dbWriteDataExt($db_write_table, $primary_key, $table, $object_fields_not_touch, $object_fields_not_update, $data);
print "Wrote to DB tabel $table and got primary key $primary_key<br>"; print "Wrote to DB tabel $table and got primary key $primary_key<br>";
// return Array Test
$query = "SELECT type, sdate, integer FROM foobar";
$data = $basic->dbReturnArray($query, true);
print "Full foobar list: <br><pre>".print_r($data, true)."</pre><br>";
# async test queries # async test queries
/* $basic->dbExecAsync("SELECT test FROM foo, (SELECT pg_sleep(10)) as sub WHERE foo_id IN (27, 50, 67, 44, 10)"); /* $basic->dbExecAsync("SELECT test FROM foo, (SELECT pg_sleep(10)) as sub WHERE foo_id IN (27, 50, 67, 44, 10)");
echo "WAITING FOR ASYNC: "; echo "WAITING FOR ASYNC: ";
@@ -156,7 +161,7 @@ while (($ret = $basic->dbCheckAsync()) === true)
flush(); flush();
} }
print "<br>END STATUS: ".$ret." | PK: ".$basic->insert_id."<br>"; print "<br>END STATUS: ".$ret." | PK: ".$basic->insert_id."<br>";
print "ASYNC PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), 1)."<br>"; */ print "ASYNC PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), true)."<br>"; */
$to_db_version = '9.1.9'; $to_db_version = '9.1.9';
print "VERSION DB: ".$basic->dbVersion()."<br>"; print "VERSION DB: ".$basic->dbVersion()."<br>";

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations $DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
$DEBUG_ALL = 1; $DEBUG_ALL = 1;

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
// debug for L10n issues in php 7.3 // debug for L10n issues in php 7.3

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
declare(strict_types=1); declare(strict_types=1);

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
namespace Foo; namespace Foo;

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
$ENABLE_ERROR_HANDLING = 0; $ENABLE_ERROR_HANDLING = 0;
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations $DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
$DEBUG_ALL = 1; $DEBUG_ALL = 1;

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/******************************************************************** /********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2018/10/11 * CREATED: 2018/10/11

View File

@@ -1,3 +1,3 @@
<?php <?php declare(strict_types=1);
require 'config.php'; require 'config.php';

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/******************************************************************** /********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2005/07/19 * CREATED: 2005/07/19

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/******************************************************************** /********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2008/08/14 * CREATED: 2008/08/14

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/******************************************************************** /********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2008/08/01 * CREATED: 2008/08/01

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/******************************************************************** /********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2007/09/03 * CREATED: 2007/09/03

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/******************************************************************** /********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2005/07/12 * CREATED: 2005/07/12

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/******************************************************************** /********************************************************************
* AUTHOR: Clemens "Gullevek" Schwaighofer (www.gullevek.org) * AUTHOR: Clemens "Gullevek" Schwaighofer (www.gullevek.org)
* CREATED: 2003/06/10 * CREATED: 2003/06/10
@@ -41,7 +41,7 @@ if (!DEBUG) {
} }
// set default lang if not set otherwise // set default lang if not set otherwise
if (!$lang) { if (!isset($lang)) {
$lang = DEFAULT_LANG; $lang = DEFAULT_LANG;
} }
// should be utf8 // should be utf8
@@ -58,6 +58,8 @@ if ($form->mobile_phone) {
// smarty template engine (extended Translation version) // smarty template engine (extended Translation version)
$smarty = new CoreLibs\Template\SmartyExtend($lang); $smarty = new CoreLibs\Template\SmartyExtend($lang);
$form->debug('POST', $form->printAr($_POST));
if (TARGET == 'live' || TARGET == 'remote') { if (TARGET == 'live' || TARGET == 'remote') {
// login // login
$login->debug_output_all = DEBUG ? 1 : 0; $login->debug_output_all = DEBUG ? 1 : 0;
@@ -123,7 +125,7 @@ if ($form->my_page_name == 'edit_order') {
// there are the POSITION stored, that should CHANGE there order (up/down) // there are the POSITION stored, that should CHANGE there order (up/down)
// $row_data_id ... has ALL ids from the sorting part // $row_data_id ... has ALL ids from the sorting part
// $row_data_order ... has ALL order positions from the soirting part // $row_data_order ... has ALL order positions from the soirting part
if (!is_array($position)) { if (!isset($position)) {
$position = array (); $position = array ();
} }
if (count($position)) { if (count($position)) {
@@ -131,7 +133,7 @@ if ($form->my_page_name == 'edit_order') {
// FIRST u have to put right sort, then read again ... // FIRST u have to put right sort, then read again ...
// hast to be >0 or the first one is selected and then there is no move // hast to be >0 or the first one is selected and then there is no move
if ($up && $position[0] > 0) { if (isset($up) && $position[0] > 0) {
for ($i = 0; $i < count($position); $i++) { for ($i = 0; $i < count($position); $i++) {
// change position order // change position order
// this gets temp, id before that, gets actual (moves one "down") // this gets temp, id before that, gets actual (moves one "down")
@@ -146,7 +148,7 @@ if ($form->my_page_name == 'edit_order') {
} // if up } // if up
// the last position id from position array is not to be the count-1 of row_data_id array, or it is the last element // the last position id from position array is not to be the count-1 of row_data_id array, or it is the last element
if ($down && ($position[count($position) - 1] != (count($row_data_id) - 1))) { if (isset($down) && ($position[count($position) - 1] != (count($row_data_id) - 1))) {
for ($i = count($position) - 1; $i >= 0; $i --) { for ($i = count($position) - 1; $i >= 0; $i --) {
// same as up, just up in other way, starts from bottom (last element) and moves "up" // same as up, just up in other way, starts from bottom (last element) and moves "up"
// element before actuel gets temp, this element, becomes element after this, // element before actuel gets temp, this element, becomes element after this,
@@ -158,7 +160,9 @@ if ($form->my_page_name == 'edit_order') {
} // if down } // if down
// write data ... (which has to be abstrackt ...) // write data ... (which has to be abstrackt ...)
if (($up && $position[0] > 0) || ($down && ($position[count($position) - 1]!=(count($row_data_id) - 1)))) { if ((isset($up) && $position[0] > 0) ||
(isset($down) && ($position[count($position) - 1] != (count($row_data_id) - 1)))
) {
for ($i = 0; $i < count($row_data_id); $i ++) { for ($i = 0; $i < count($row_data_id); $i ++) {
$q = "UPDATE ".$table_name." SET order_number = ".$row_data_order[$i]." WHERE ".$table_name."_id = ".$row_data_id[$i]; $q = "UPDATE ".$table_name." SET order_number = ".$row_data_order[$i]." WHERE ".$table_name."_id = ".$row_data_id[$i];
$q = $form->dbExec($q); $q = $form->dbExec($q);
@@ -168,7 +172,7 @@ if ($form->my_page_name == 'edit_order') {
// get ... // get ...
$q = "SELECT ".$table_name."_id, name, order_number FROM ".$table_name." "; $q = "SELECT ".$table_name."_id, name, order_number FROM ".$table_name." ";
if ($where_string) { if (!empty($where_string)) {
$q .= "WHERE $where_string "; $q .= "WHERE $where_string ";
} }
$q .= "ORDER BY order_number"; $q .= "ORDER BY order_number";
@@ -184,8 +188,9 @@ if ($form->my_page_name == 'edit_order') {
// html title // html title
$HEADER['HTML_TITLE'] = $form->l->__('Edit Order'); $HEADER['HTML_TITLE'] = $form->l->__('Edit Order');
$messages = array ();
// error msg // error msg
if ($error) { if (isset($error)) {
$messages[] = array ('msg' => $msg, 'class' => 'error', 'width' => '100%'); $messages[] = array ('msg' => $msg, 'class' => 'error', 'width' => '100%');
} }
$DATA['form_error_msg'] = $messages; $DATA['form_error_msg'] = $messages;
@@ -199,11 +204,11 @@ if ($form->my_page_name == 'edit_order') {
} }
for ($i = 0; $i < count($row_data); $i ++) { for ($i = 0; $i < count($row_data); $i ++) {
$options_id[] = $i; $options_id[] = $i;
$options_name[] = $row_data[$i]["name"]; $options_name[] = $row_data[$i]['name'];
// list of points to order // list of points to order
for ($j = 0; $j < count($position); $j++) { for ($j = 0; $j < count($position); $j++) {
// if matches, put into select array // if matches, put into select array
if ($original_id[$position[$j]] == $row_data[$i]["id"]) { if ($original_id[$position[$j]] == $row_data[$i]['id']) {
$options_selected[] = $i; $options_selected[] = $i;
} }
} }
@@ -216,23 +221,29 @@ if ($form->my_page_name == 'edit_order') {
$row_data_id = array (); $row_data_id = array ();
$row_data_order = array (); $row_data_order = array ();
for ($i = 0; $i < count($row_data); $i++) { for ($i = 0; $i < count($row_data); $i++) {
$row_data_id[] = $row_data[$i]["id"]; $row_data_id[] = $row_data[$i]['id'];
$row_data_order[] = $row_data[$i]["order"]; $row_data_order[] = $row_data[$i]['order'];
} }
$DATA['row_data_id'] = $row_data_id; $DATA['row_data_id'] = $row_data_id;
$DATA['row_data_order'] = $row_data_order; $DATA['row_data_order'] = $row_data_order;
// hidden names for the table & where string // hidden names for the table & where string
$DATA['table_name'] = $table_name; $DATA['table_name'] = $table_name;
$DATA['where_string'] = $where_string; $DATA['where_string'] = isset($where_string) ? $where_string : '';
$EDIT_TEMPLATE = 'edit_order.tpl'; $EDIT_TEMPLATE = 'edit_order.tpl';
} else { } else {
$form->formProcedureLoad(${$form->archive_pk_name}); // load call only if id is set
if (isset(${$form->archive_pk_name})) {
$form->formProcedureLoad(${$form->archive_pk_name});
}
$form->formProcedureNew(); $form->formProcedureNew();
$form->formProcedureSave(); $form->formProcedureSave();
$form->formProcedureDelete(); $form->formProcedureDelete();
$form->formProcedureDeleteFromElementList($element_list, $remove_name); // delete call only if those two are set
if (isset($element_list) && isset($remove_name)) {
$form->formProcedureDeleteFromElementList($element_list, $remove_name);
}
$DATA['table_width'] = $table_width; $DATA['table_width'] = $table_width;
@@ -242,26 +253,26 @@ if ($form->my_page_name == 'edit_order') {
// MENU START // MENU START
// request some session vars // request some session vars
if (!$HEADER_COLOR) { if (!isset($HEADER_COLOR)) {
$DATA['HEADER_COLOR'] = "#E0E2FF"; $DATA['HEADER_COLOR'] = '#E0E2FF';
} else { } else {
$DATA['HEADER_COLOR'] = $_SESSION['HEADER_COLOR']; $DATA['HEADER_COLOR'] = $_SESSION['HEADER_COLOR'];
} }
$DATA['USER_NAME'] = $_SESSION["USER_NAME"]; $DATA['USER_NAME'] = $_SESSION['USER_NAME'];
$DATA['EUID'] = $_SESSION["EUID"]; $DATA['EUID'] = $_SESSION['EUID'];
$DATA['GROUP_NAME'] = $_SESSION["GROUP_NAME"]; $DATA['GROUP_NAME'] = $_SESSION['GROUP_NAME'];
$DATA['GROUP_LEVEL'] = $_SESSION["GROUP_LEVEL"]; $DATA['GROUP_LEVEL'] = $_SESSION['GROUP_ACL_LEVEL'];
$PAGES = $_SESSION["PAGES"]; $PAGES = $_SESSION['PAGES'];
//$form->debug('menu', $form->printAr($PAGES)); //$form->debug('menu', $form->printAr($PAGES));
// build nav from $PAGES ... // build nav from $PAGES ...
if (!is_array($PAGES)) { if (!isset($PAGES) || !is_array($PAGES)) {
$PAGES = array (); $PAGES = array ();
} }
for ($i = 0, $i_max = count($PAGES); $i < $i_max; $i ++) { foreach ($PAGES as $PAGE_CUID => $PAGE_DATA) {
if ($PAGES[$i]["menu"] && $PAGES[$i]["online"]) { if ($PAGE_DATA['menu'] && $PAGE_DATA['online']) {
$menuarray[] = $PAGES[$i]; $menuarray[] = $PAGE_DATA;
} }
} }
@@ -276,34 +287,44 @@ if ($form->my_page_name == 'edit_order') {
} }
} }
$position = 0;
for ($i = 1; $i <= count($menuarray); $i ++) { for ($i = 1; $i <= count($menuarray); $i ++) {
// do that for new array // do that for new array
$j = $i - 1; $j = $i - 1;
$menu_data[$j]['pagename'] = htmlentities($menuarray[($i-1)]["page_name"]); $menu_data[$j]['pagename'] = htmlentities($menuarray[($i-1)]['page_name']);
$menu_data[$j]['filename'] = $menuarray[($i-1)]["filename"].$menuarray[($i-1)]["query_string"]; $menu_data[$j]['filename'] = $menuarray[($i-1)]['filename'].(isset($menuarray[$j]['query_string']) ? $menuarray[$j]['query_string'] : '');
if ($i == 1 || !(($i - 1) % $SPLIT_FACTOR)) { if ($i == 1 || !($j % $SPLIT_FACTOR)) {
$menu_data[$j]['splitfactor_in'] = 1; $menu_data[$j]['splitfactor_in'] = 1;
} else {
$menu_data[$j]['splitfactor_in'] = 0;
} }
if ($menuarray[($i - 1)]["filename"] == $form->getPageName()) { if ($menuarray[$j]['filename'] == $form->getPageName()) {
$position = $i - 1; $position = $j;
$menu_data[$j]['position'] = 1; $menu_data[$j]['position'] = 1;
$menu_data[$j]['popup'] = 0;
} else { } else {
// add query stuff // add query stuff
// HAS TO DONE LATER ... set urlencode, etc ... // HAS TO DONE LATER ... set urlencode, etc ...
// check if popup needed // check if popup needed
if ($menuarray[($i - 1)]["popup"]) { if (isset($menuarray[$j]['popup']) && $menuarray[$j]['popup'] == 1) {
$menu_data[$j]['popup'] = 1; $menu_data[$j]['popup'] = 1;
$menu_data[$j]['rand'] = uniqid(rand()); $menu_data[$j]['rand'] = uniqid((string)rand());
$menu_data[$j]['width'] = $menuarray[($i-1)]["popup_x"]; $menu_data[$j]['width'] = $menuarray[$j]['popup_x'];
$menu_data[$j]['height'] = $menuarray[($i-1)]["popup_y"]; $menu_data[$j]['height'] = $menuarray[$j]['popup_y'];
} // popup or not } else {
$menu_data[$j]['popup'] = 0;
}
$menu_data[$j]['position'] = 0;
} // highlight or not } // highlight or not
if (!($i % $SPLIT_FACTOR) || (($i + 1) > count($menuarray))) { if (!($i % $SPLIT_FACTOR) || (($i + 1) > count($menuarray))) {
$menu_data[$j]['splitfactor_out'] = 1; $menu_data[$j]['splitfactor_out'] = 1;
} // split } else {
$menu_data[$j]['splitfactor_out'] = 0;
}
} // for } // for
// $form->debug('MENU ARRAY', $form->printAr($menu_data));
$DATA['menu_data'] = $menu_data; $DATA['menu_data'] = $menu_data;
$DATA['page_name'] = $menuarray[$position]["page_name"]; $DATA['page_name'] = $menuarray[$position]['page_name'];
$L_TITLE = $DATA['page_name']; $L_TITLE = $DATA['page_name'];
// html title // html title
$HEADER['HTML_TITLE'] = $form->l->__($L_TITLE); $HEADER['HTML_TITLE'] = $form->l->__($L_TITLE);
@@ -315,118 +336,124 @@ if ($form->my_page_name == 'edit_order') {
if ($form->yes) { if ($form->yes) {
$DATA['form_yes'] = $form->yes; $DATA['form_yes'] = $form->yes;
$DATA['form_my_page_name'] = $form->my_page_name; $DATA['form_my_page_name'] = $form->my_page_name;
$DATA['filename_exist'] = 0;
$DATA['drop_down_input'] = 0;
// depending on the "getPageName()" I show different stuff // depending on the "getPageName()" I show different stuff
switch ($form->my_page_name) { switch ($form->my_page_name) {
case "edit_users": case 'edit_users':
$elements[] = $form->formCreateElement("login_error_count"); $elements[] = $form->formCreateElement('login_error_count');
$elements[] = $form->formCreateElement("login_error_date_last"); $elements[] = $form->formCreateElement('login_error_date_last');
$elements[] = $form->formCreateElement("login_error_date_first"); $elements[] = $form->formCreateElement('login_error_date_first');
$elements[] = $form->formCreateElement("enabled"); $elements[] = $form->formCreateElement('enabled');
$elements[] = $form->formCreateElement("protected"); $elements[] = $form->formCreateElement('protected');
$elements[] = $form->formCreateElement("username"); $elements[] = $form->formCreateElement('username');
$elements[] = $form->formCreateElement("password"); $elements[] = $form->formCreateElement('password');
$elements[] = $form->formCreateElement("password_change_interval"); $elements[] = $form->formCreateElement('password_change_interval');
$elements[] = $form->formCreateElement("email"); $elements[] = $form->formCreateElement('email');
$elements[] = $form->formCreateElement("last_name"); $elements[] = $form->formCreateElement('last_name');
$elements[] = $form->formCreateElement("first_name"); $elements[] = $form->formCreateElement('first_name');
$elements[] = $form->formCreateElement("edit_group_id"); $elements[] = $form->formCreateElement('edit_group_id');
$elements[] = $form->formCreateElement("edit_access_right_id"); $elements[] = $form->formCreateElement('edit_access_right_id');
$elements[] = $form->formCreateElement("strict"); $elements[] = $form->formCreateElement('strict');
$elements[] = $form->formCreateElement("locked"); $elements[] = $form->formCreateElement('locked');
$elements[] = $form->formCreateElement("admin"); $elements[] = $form->formCreateElement('admin');
$elements[] = $form->formCreateElement("debug"); $elements[] = $form->formCreateElement('debug');
$elements[] = $form->formCreateElement("db_debug"); $elements[] = $form->formCreateElement('db_debug');
$elements[] = $form->formCreateElement("edit_language_id"); $elements[] = $form->formCreateElement('edit_language_id');
$elements[] = $form->formCreateElement("edit_scheme_id"); $elements[] = $form->formCreateElement('edit_scheme_id');
$elements[] = $form->formCreateElementListTable("edit_access_user"); $elements[] = $form->formCreateElementListTable('edit_access_user');
$elements[] = $form->formCreateElement("additional_acl"); $elements[] = $form->formCreateElement('additional_acl');
break; break;
case "edit_schemes": case 'edit_schemes':
$elements[] = $form->formCreateElement("enabled"); $elements[] = $form->formCreateElement('enabled');
$elements[] = $form->formCreateElement("name"); $elements[] = $form->formCreateElement('name');
$elements[] = $form->formCreateElement("header_color"); $elements[] = $form->formCreateElement('header_color');
$elements[] = $form->formCreateElement("template"); $elements[] = $form->formCreateElement('template');
break; break;
case "edit_pages": case 'edit_pages':
if (!$form->table_array["edit_page_id"]["value"]) { if (!isset($form->table_array['edit_page_id']['value'])) {
$q = "DELETE FROM temp_files"; $q = "DELETE FROM temp_files";
$form->dbExec($q); $form->dbExec($q);
// gets all files in the current dir ending with .php // gets all files in the current dir ending with .php
$crap = exec("ls *.php", $output, $status); $crap = exec('ls *.php', $output, $status);
// now get all that are NOT in de DB // now get all that are NOT in de DB
$q = "INSERT INTO temp_files VALUES "; $q = "INSERT INTO temp_files VALUES ";
for ($i = 0; $i < count($output); $i ++) { for ($i = 0; $i < count($output); $i ++) {
$t_q = "('".$form->dbEscapeString($output[$i])."')"; $t_q = "('".$form->dbEscapeString($output[$i])."')";
$form->dbExec($q.$t_q, 'NULL'); $form->dbExec($q.$t_q, 'NULL');
} }
$elements[] = $form->formCreateElement("filename"); $elements[] = $form->formCreateElement('filename');
} else { } else {
// show file menu // show file menu
// just show name of file ... // just show name of file ...
$DATA['filename_exist'] = 1; $DATA['filename_exist'] = 1;
$DATA['filename'] = $form->table_array["filename"]["value"]; $DATA['filename'] = $form->table_array['filename']['value'];
} // File Name View IF } // File Name View IF
$elements[] = $form->formCreateElement("name"); $elements[] = $form->formCreateElement('name');
// $elements[] = $form->formCreateElement("tag"); // $elements[] = $form->formCreateElement('tag');
// $elements[] = $form->formCreateElement("min_acl"); // $elements[] = $form->formCreateElement('min_acl');
$elements[] = $form->formCreateElement("order_number"); $elements[] = $form->formCreateElement('order_number');
$elements[] = $form->formCreateElement("online"); $elements[] = $form->formCreateElement('online');
$elements[] = $form->formCreateElement("menu"); $elements[] = $form->formCreateElement('menu');
$elements[] = $form->formCreateElementListTable("edit_query_string"); $elements[] = $form->formCreateElementListTable('edit_query_string');
$elements[] = $form->formCreateElement("popup"); $elements[] = $form->formCreateElement('content_alias_edit_page_id');
$elements[] = $form->formCreateElement("popup_x"); $elements[] = $form->formCreateElementListTable('edit_page_content');
$elements[] = $form->formCreateElement("popup_y"); $elements[] = $form->formCreateElement('popup');
$elements[] = $form->formCreateElementReferenceTable("edit_visible_group"); $elements[] = $form->formCreateElement('popup_x');
$elements[] = $form->formCreateElementReferenceTable("edit_menu_group"); $elements[] = $form->formCreateElement('popup_y');
$elements[] = $form->formCreateElementReferenceTable('edit_visible_group');
$elements[] = $form->formCreateElementReferenceTable('edit_menu_group');
break; break;
case "edit_languages": case 'edit_languages':
$elements[] = $form->formCreateElement("enabled"); $elements[] = $form->formCreateElement('enabled');
$elements[] = $form->formCreateElement("short_name"); $elements[] = $form->formCreateElement('short_name');
$elements[] = $form->formCreateElement("long_name"); $elements[] = $form->formCreateElement('long_name');
$elements[] = $form->formCreateElement("iso_name"); $elements[] = $form->formCreateElement('iso_name');
break; break;
case "edit_groups": case 'edit_groups':
$elements[] = $form->formCreateElement("enabled"); $elements[] = $form->formCreateElement('enabled');
$elements[] = $form->formCreateElement("name"); $elements[] = $form->formCreateElement('name');
$elements[] = $form->formCreateElement("edit_access_right_id"); $elements[] = $form->formCreateElement('edit_access_right_id');
$elements[] = $form->formCreateElement("edit_scheme_id"); $elements[] = $form->formCreateElement('edit_scheme_id');
$elements[] = $form->formCreateElementListTable("edit_page_access"); $elements[] = $form->formCreateElementListTable('edit_page_access');
$elements[] = $form->formCreateElement("additional_acl"); $elements[] = $form->formCreateElement('additional_acl');
break; break;
case "edit_visible_group": case 'edit_visible_group':
$elements[] = $form->formCreateElement("name"); $elements[] = $form->formCreateElement('name');
$elements[] = $form->formCreateElement("flag"); $elements[] = $form->formCreateElement('flag');
break; break;
case "edit_menu_group": case 'edit_menu_group':
$elements[] = $form->formCreateElement("name"); $elements[] = $form->formCreateElement('name');
$elements[] = $form->formCreateElement("flag"); $elements[] = $form->formCreateElement('flag');
$elements[] = $form->formCreateElement("order_number"); $elements[] = $form->formCreateElement('order_number');
break; break;
case "edit_access": case 'edit_access':
$elements[] = $form->formCreateElement("name"); $elements[] = $form->formCreateElement('name');
$elements[] = $form->formCreateElement("enabled"); $elements[] = $form->formCreateElement('enabled');
$elements[] = $form->formCreateElement("protected"); $elements[] = $form->formCreateElement('protected');
$elements[] = $form->formCreateElement("color"); $elements[] = $form->formCreateElement('color');
$elements[] = $form->formCreateElement("description"); $elements[] = $form->formCreateElement('description');
// add name/value list here // add name/value list here
$elements[] = $form->formCreateElementListTable("edit_access_data"); $elements[] = $form->formCreateElementListTable('edit_access_data');
$elements[] = $form->formCreateElement("additional_acl"); $elements[] = $form->formCreateElement('additional_acl');
break; break;
default: default:
print "[No valid page definition given]"; print '[No valid page definition given]';
break; break;
} }
// $form->debug('edit', "Elements: <pre>".$form->printAr($elements)); // $form->debug('edit', "Elements: <pre>".$form->printAr($elements));
$DATA['elements'] = $elements; $DATA['elements'] = $elements;
$DATA['hidden'] = $form->formCreateHiddenFields(); $DATA['hidden'] = $form->formCreateHiddenFields();
$DATA['save_delete'] = $form->formCreateSaveDelete(); $DATA['save_delete'] = $form->formCreateSaveDelete();
} else {
$DATA['form_yes'] = 0;
} }
$EDIT_TEMPLATE = 'edit_body.tpl'; $EDIT_TEMPLATE = 'edit_body.tpl';
} }
// debug data, if DEBUG flag is on, this data is print out // debug data, if DEBUG flag is on, this data is print out
$DEBUG_DATA['DEBUG'] = $DEBUG_TMPL; $DEBUG_DATA['DEBUG'] = isset($DEBUG_TMPL) ? $DEBUG_TMPL : '';
// create main data array // create main data array
$CONTENT_DATA = array_merge($HEADER, $DATA, $DEBUG_DATA); $CONTENT_DATA = array_merge($HEADER, $DATA, $DEBUG_DATA);

View File

@@ -1,103 +1,104 @@
<?php <?php declare(strict_types=1);
$edit_access = array ( $edit_access = array (
"table_array" => array ( 'table_array' => array (
"edit_access_id" => array ( 'edit_access_id' => array (
"value" => $GLOBALS["edit_access_id"], 'value' => isset($GLOBALS['edit_access_id']) ? $GLOBALS['edit_access_id'] : '',
"type" => "hidden", 'type' => 'hidden',
"pk" => 1 'pk' => 1
), ),
"name" => array ( 'name' => array (
"value" => $GLOBALS["name"], 'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
"output_name" => $this->l->__("Access Group Name"), 'output_name' => $this->l->__('Access Group Name'),
"mandatory" => 1, 'mandatory' => 1,
"type" => "text", 'type' => 'text',
"error_check" => "alphanumericspace|unique" 'error_check' => 'alphanumericspace|unique'
), ),
"description" => array ( 'description' => array (
"value" => $GLOBALS["description"], 'value' => isset($GLOBALS['description']) ? $GLOBALS['description'] : '',
"output_name" => $this->l->__("Description"), 'output_name' => $this->l->__('Description'),
"type" => "textarea" 'type' => 'textarea'
), ),
"color" => array ( 'color' => array (
"value" => $GLOBALS["color"], 'value' => isset($GLOBALS['color']) ? $GLOBALS['color'] : '',
"output_name" => $this->l->__("Color"), 'output_name' => $this->l->__('Color'),
"mandatory" => 0, 'mandatory' => 0,
"type" => "text", 'type' => 'text',
"size" => 6, 'size' => 6,
"length" => 6, 'length' => 6,
"error_check" => "custom", 'error_check' => 'custom',
"error_regex" => "/[\dA-Fa-f]{6}/", 'error_regex' => "/[\dA-Fa-f]{6}/",
"error_example" => "F6A544" 'error_example' => 'F6A544'
), ),
"enabled" => array ( 'enabled' => array (
"value" => $GLOBALS["enabled"], 'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : 0,
"output_name" => "Enabled", 'output_name' => 'Enabled',
"type" => "binary", 'type' => 'binary',
"int" => 1, // OR "bool" => 1 'int' => 1, // OR 'bool' => 1
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"protected" => array ( 'protected' => array (
"value" => $GLOBALS["protected"], 'value' => isset($GLOBALS['protected']) ? $GLOBALS['protected'] : 0,
"output_name" => "Protected", 'output_name' => 'Protected',
"type" => "binary", 'type' => 'binary',
"int" => 1, 'int' => 1,
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"additional_acl" => array ( 'additional_acl' => array (
"value" => $GLOBALS["additional_acl"], 'value' => isset($GLOBALS['additional_acl']) ? $GLOBALS['additional_acl'] : '',
"output_name" => "Additional ACL (as JSON)", 'output_name' => 'Additional ACL (as JSON)',
"type" => "textarea", 'type' => 'textarea',
"error_check" => "json", 'error_check' => 'json',
"rows" => 10, 'rows' => 10,
"cols" => 60 'cols' => 60
), ),
), ),
"table_name" => "edit_access", 'table_name' => 'edit_access',
"load_query" => "SELECT edit_access_id, name FROM edit_access ORDER BY name", "load_query" => "SELECT edit_access_id, name FROM edit_access ORDER BY name",
"show_fields" => array ( 'show_fields' => array (
array ( array (
"name" => "name" 'name' => 'name'
) )
), ),
"element_list" => array ( 'element_list' => array (
"edit_access_data" => array ( 'edit_access_data' => array (
"output_name" => "Edit Access Data", 'output_name' => 'Edit Access Data',
"type" => "reference_data", # is not a sub table read and connect, but only a sub table with data 'delete_name' => 'remove_edit_access_data',
"max_empty" => 5, # maxium visible if no data is set, if filled add this number to visible // 'type' => 'reference_data', # is not a sub table read and connect, but only a sub table with data
"prefix" => "ead", 'max_empty' => 5, # maxium visible if no data is set, if filled add this number to visible
"elements" => array ( 'prefix' => 'ead',
"edit_access_data_id" => array ( 'elements' => array (
"output_name" => "Activate", 'name' => array (
"type" => "hidden", 'type' => 'text',
"int" => 1, 'error_check' => 'alphanumeric|unique',
"pk_id" => 1 'output_name' => 'Name',
'mandatory' => 1
), ),
"name" => array ( 'value' => array (
"type" => "text", 'type' => 'text',
"error_check" => "alphanumeric|unique", 'output_name' => 'Value'
"output_name" => "Name"
), ),
"value" => array ( 'enabled' => array (
"type" => "text", 'type' => 'checkbox',
"output_name" => "Value" 'output_name' => 'Activate',
'int' => 1,
'element_list' => array(1)
), ),
"enabled" => array ( /*'edit_access_id' => array (
"type" => "checkbox", 'int' => 1,
"output_name" => "Activate", 'type' => 'hidden',
"int" => 1, 'fk_id' => 1 # reference main key from master table above
"element_list" => array(1) ),*/
), 'edit_access_data_id' => array (
"edit_access_id" => array ( 'type' => 'hidden',
"int" => 1, 'int' => 1,
"type" => "hidden", 'pk_id' => 1
"fk_id" => 1 # reference main key from master table above
) )
) )
) )

View File

@@ -1,106 +1,105 @@
<?php <?php declare(strict_types=1);
$edit_groups = array ( $edit_groups = array (
"table_array" => array ( 'table_array' => array (
"edit_group_id" => array ( 'edit_group_id' => array (
"value" => $GLOBALS["edit_group_id"], 'value' => isset($GLOBALS['edit_group_id']) ? $GLOBALS['edit_group_id'] : '',
"pk" => 1, 'pk' => 1,
"type" => "hidden" 'type' => 'hidden'
), ),
"enabled" => array ( 'enabled' => array (
"value" => $GLOBALS["enabled"], 'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
"output_name" => "Enabled", 'output_name' => 'Enabled',
"int" => 1, 'int' => 1,
"type" => "binary", 'type' => 'binary',
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"name" => array ( 'name' => array (
"value" => $GLOBALS["name"], 'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
"output_name" => "Group Name", 'output_name' => 'Group Name',
"type" => "text", 'type' => 'text',
"mandatory" => 1 'mandatory' => 1
), ),
"edit_access_right_id" => array ( 'edit_access_right_id' => array (
"value" => $GLOBALS["edit_access_right_id"], 'value' => isset($GLOBALS['edit_access_right_id']) ? $GLOBALS['edit_access_right_id'] : '',
"output_name" => "Group Level", 'output_name' => 'Group Level',
"mandatory" => 1, 'mandatory' => 1,
"int" => 1, 'int' => 1,
"type" => "drop_down_db", 'type' => 'drop_down_db',
"query" => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level" 'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
), ),
"edit_scheme_id" => array ( 'edit_scheme_id' => array (
"value" => $GLOBALS["edit_scheme_id"], 'value' => isset($GLOBALS['edit_scheme_id']) ? $GLOBALS['edit_scheme_id'] : '',
"output_name" => "Group Scheme", 'output_name' => 'Group Scheme',
"int_null" => 1, 'int_null' => 1,
"type" => "drop_down_db", 'type' => 'drop_down_db',
"query" => "SELECT edit_scheme_id, name FROM edit_scheme WHERE enabled = 1 ORDER BY name" 'query' => "SELECT edit_scheme_id, name FROM edit_scheme WHERE enabled = 1 ORDER BY name"
), ),
"additional_acl" => array ( 'additional_acl' => array (
"value" => $GLOBALS["additional_acl"], 'value' => isset($GLOBALS['additional_acl']) ? $GLOBALS['additional_acl'] : '',
"output_name" => "Additional ACL (as JSON)", 'output_name' => 'Additional ACL (as JSON)',
"type" => "textarea", 'type' => 'textarea',
"error_check" => "json", 'error_check' => 'json',
"rows" => 10, 'rows' => 10,
"cols" => 60 'cols' => 60
), ),
), ),
"load_query" => "SELECT edit_group_id, name, enabled FROM edit_group ORDER BY name", 'load_query' => "SELECT edit_group_id, name, enabled FROM edit_group ORDER BY name",
"table_name" => "edit_group", 'table_name' => 'edit_group',
"show_fields" => array ( 'show_fields' => array (
array ( array (
"name" => "name" 'name' => 'name'
), ),
array ( array (
"name" => "enabled", 'name' => 'enabled',
"binary" => array ("Yes", "No"), 'binary' => array ('Yes', 'No'),
"before_value" => "Enabled: " 'before_value' => 'Enabled: '
) )
), ),
"element_list" => array ( 'element_list' => array (
"edit_page_access" => array ( 'edit_page_access' => array (
"output_name" => "Pages", 'output_name' => 'Pages',
"mandatory" => 1, 'mandatory' => 1,
"delete" => 0, // set then reference entries are deleted, else the "enable" flag is only set 'delete' => 0, // set then reference entries are deleted, else the 'enable' flag is only set
"enable_name" => "enable_page_access", 'enable_name' => 'enable_page_access',
"prefix" => "epa", 'prefix' => 'epa',
"read_data" => array ( 'read_data' => array (
"table_name" => "edit_page", 'table_name' => 'edit_page',
"pk_id" => "edit_page_id", 'pk_id' => 'edit_page_id',
"name" => "name", 'name' => 'name',
"order" => "order_number" 'order' => 'order_number'
), ),
"elements" => array ( 'elements' => array (
"edit_page_access_id" => array ( 'edit_page_access_id' => array (
"output_name" => "Activate", 'type' => 'hidden',
"type" => "hidden", 'int' => 1,
"int" => 1, 'pk_id' => 1
"pk_id" => 1
), ),
"enabled" => array ( 'enabled' => array (
"type" => "checkbox", 'type' => 'checkbox',
"output_name" => "Activate", 'output_name' => 'Activate',
"int" => 1, 'int' => 1,
"element_list" => array(1) 'element_list' => array(1)
), ),
"edit_access_right_id" => array ( 'edit_access_right_id' => array (
"type" => "drop_down_db", 'type' => 'drop_down_db',
"output_name" => "Access Level", 'output_name' => 'Access Level',
"int" => 1, 'int' => 1,
"preset" => 1, // first of the select 'preset' => 1, // first of the select
"query" => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level" 'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
), ),
"edit_page_id" => array ( 'edit_page_id' => array (
"int" => 1, 'int' => 1,
"type" => "hidden" 'type' => 'hidden'
) )
/*, /*,
"edit_default" => array ( 'edit_default' => array (
"output_name" => "Default", 'output_name' => 'Default',
"type" => "radio", 'type' => 'radio',
"mandatory" => 1 'mandatory' => 1
)*/ )*/
) )
) // edit pages ggroup ) // edit pages ggroup

View File

@@ -1,75 +1,75 @@
<?php <?php declare(strict_types=1);
$edit_languages=array ( $edit_languages=array (
"table_array" => array ( 'table_array' => array (
"edit_language_id" => array ( 'edit_language_id' => array (
"value" => $GLOBALS["edit_language_id"], 'value' => isset($GLOBALS['edit_language_id']) ? $GLOBALS['edit_language_id'] : '',
"type" => "hidden", 'type' => 'hidden',
"pk" => 1 'pk' => 1
), ),
"short_name" => array ( 'short_name' => array (
"value" => $GLOBALS["short_name"], 'value' => isset($GLOBALS['short_name']) ? $GLOBALS['short_name'] : '',
"output_name" => "Language (short)", 'output_name' => 'Language (short)',
"mandatory" => 1, 'mandatory' => 1,
"type" => "text", 'type' => 'text',
"size" => 2, 'size' => 2,
"length" => 2 'length' => 2
), ),
"long_name" => array ( 'long_name' => array (
"value" => $GLOBALS["long_name"], 'value' => isset($GLOBALS['long_name']) ? $GLOBALS['long_name'] : '',
"output_name" => "Language (long)", 'output_name' => 'Language (long)',
"mandatory" => 1, 'mandatory' => 1,
"type" => "text", 'type' => 'text',
"size" => 40 'size' => 40
), ),
"iso_name" => array ( 'iso_name' => array (
"value" => $GLOBALS["iso_name"], 'value' => isset($GLOBALS['iso_name']) ? $GLOBALS['iso_name'] : '',
"output_name" => "ISO Code", 'output_name' => 'ISO Code',
"mandatory" => 1, 'mandatory' => 1,
"type" => "text" 'type' => 'text'
), ),
"order_number" => array ( 'order_number' => array (
"value" => $GLOBALS["order_number"], 'value' => isset($GLOBALS['order_number']) ? $GLOBALS['order_number'] : '',
"int" => 1, 'int' => 1,
"order" => 1 'order' => 1
), ),
"enabled" => array ( 'enabled' => array (
"value" => $GLOBALS["enabled"], 'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
"output_name" => "Enabled", 'output_name' => 'Enabled',
"int" => 1, 'int' => 1,
"type" => "binary", 'type' => 'binary',
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"lang_default" => array ( 'lang_default' => array (
"value" => $GLOBALS["lang_default"], 'value' => isset($GLOBALS['lang_default']) ? $GLOBALS['lang_default'] : '',
"output_name" => "Default Language", 'output_name' => 'Default Language',
"int" => 1, 'int' => 1,
"type" => "binary", 'type' => 'binary',
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
) )
), ),
"load_query" => "SELECT edit_language_id, long_name, iso_name, enabled FROM edit_language ORDER BY long_name", 'load_query' => "SELECT edit_language_id, long_name, iso_name, enabled FROM edit_language ORDER BY long_name",
"show_fields" => array ( 'show_fields' => array (
array ( array (
"name" => "long_name" 'name' => 'long_name'
), ),
array ( array (
"name" => "iso_name", 'name' => 'iso_name',
"before_value" => "ISO: " 'before_value' => 'ISO: '
), ),
array ( array (
"name" => "enabled", 'name' => 'enabled',
"before_value" => "Enabled: ", 'before_value' => 'Enabled: ',
"binary" => array ("Yes","No") 'binary' => array ('Yes','No')
) )
), ),
"table_name" => "edit_language" 'table_name' => 'edit_language'
); );
// __END__ // __END__

View File

@@ -1,38 +1,38 @@
<?php <?php declare(strict_types=1);
$edit_menu_group = array ( $edit_menu_group = array (
"table_array" => array ( 'table_array' => array (
"edit_menu_group_id" => array ( 'edit_menu_group_id' => array (
"value" => $GLOBALS["edit_menu_group_id"], 'value' => isset($GLOBALS['edit_menu_group_id']) ? $GLOBALS['edit_menu_group_id'] : '',
"type" => "hidden", 'type' => 'hidden',
"pk" => 1 'pk' => 1
), ),
"name" => array ( 'name' => array (
"value" => $GLOBALS["name"], 'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
"output_name" => $this->l->__("Group name"), 'output_name' => $this->l->__('Group name'),
"mandatory" => 1, 'mandatory' => 1,
"type" => "text" 'type' => 'text'
), ),
"flag" => array ( 'flag' => array (
"value" => $GLOBALS["flag"], 'value' => isset($GLOBALS['flag']) ? $GLOBALS['flag'] : '',
"output_name" => $this->l->__("Flag"), 'output_name' => $this->l->__('Flag'),
"mandatory" => 1, 'mandatory' => 1,
"type" => "text", 'type' => 'text',
"error_check" => "alphanumeric|unique" 'error_check' => 'alphanumeric|unique'
), ),
"order_number" => array ( 'order_number' => array (
"value" => $GLOBALS["order_number"], 'value' => isset($GLOBALS['order_number']) ? $GLOBALS['order_number'] : '',
"output_name" => "Group order", 'output_name' => 'Group order',
"type" => "order", 'type' => 'order',
"int" => 1, 'int' => 1,
"order" => 1 'order' => 1
) )
), ),
"table_name" => "edit_menu_group", 'table_name' => 'edit_menu_group',
"load_query" => "SELECT edit_menu_group_id, name FROM edit_menu_group ORDER BY name", 'load_query' => "SELECT edit_menu_group_id, name FROM edit_menu_group ORDER BY name",
"show_fields" => array ( 'show_fields' => array (
array ( array (
"name" => "name" 'name' => 'name'
) )
) )
); );

View File

@@ -1,179 +1,235 @@
<?php <?php declare(strict_types=1);
$edit_pages = array ( $edit_pages = array (
"table_array" => array ( 'table_array' => array (
"edit_page_id" => array ( 'edit_page_id' => array (
"value" => $GLOBALS["edit_page_id"], 'value' => isset($GLOBALS['edit_page_id']) ? $GLOBALS['edit_page_id'] : '',
"type" => "hidden", 'type' => 'hidden',
"pk" => 1 'pk' => 1
), ),
"filename" => array ( 'filename' => array (
"value" => $GLOBALS["filename"], 'value' => isset($GLOBALS['filename']) ? $GLOBALS['filename'] : '',
"output_name" => "Add File ...", 'output_name' => 'Add File ...',
"mandatory" => 1, 'mandatory' => 1,
"type" => "drop_down_db", 'type' => 'drop_down_db',
"query" => "SELECT DISTINCT temp_files.filename AS id, temp_files.filename AS name FROM temp_files LEFT JOIN edit_page ep ON temp_files.filename = ep.filename WHERE ep.filename IS NULL" 'query' => "SELECT DISTINCT temp_files.filename AS id, temp_files.filename AS name ".
"FROM temp_files ".
"LEFT JOIN edit_page ep ON temp_files.filename = ep.filename ".
"WHERE ep.filename IS NULL"
), ),
"name" => array ( 'name' => array (
"value" => $GLOBALS["name"], 'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
"output_name" => "Page name", 'output_name' => 'Page name',
"mandatory" => 1, 'mandatory' => 1,
"type" => "text" 'type' => 'text'
), ),
"order_number" => array ( 'order_number' => array (
"value" => $GLOBALS["order_number"], 'value' => isset($GLOBALS['order_number']) ? $GLOBALS['order_number'] : '',
"output_name" => "Page order", 'output_name' => 'Page order',
"type" => "order", 'type' => 'order',
"int" => 1, 'int' => 1,
"order" => 1 'order' => 1
), ),
/* "flag" => array ( /* 'flag' => array (
"value" => $GLOBALS["flag"], 'value' => isset($GLOBALS['flag']) ? $GLOBALS['flag'] : '',
"output_name" => "Page Flag", 'output_name' => 'Page Flag',
"type" => "drop_down_array", 'type' => 'drop_down_array',
"query" => array ( 'query' => array (
"0" => "0", '0' => '0',
"1" => "1", '1' => '1',
"2" => "2", '2' => '2',
"3" => "3", '3' => '3',
"4" => "4", '4' => '4',
"5" => "5" '5' => '5'
) )
),*/ ),*/
"online" => array ( 'online' => array (
"value" => $GLOBALS["online"], 'value' => isset($GLOBALS['online']) ? $GLOBALS['online'] : '',
"output_name" => "Online", 'output_name' => 'Online',
"int" => 1, 'int' => 1,
"type" => "binary", 'type' => 'binary',
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"menu" => array ( 'menu' => array (
"value" => $GLOBALS["menu"], 'value' => isset($GLOBALS['menu']) ? $GLOBALS['menu'] : '',
"output_name" => "Menu", 'output_name' => 'Menu',
"int" => 1, 'int' => 1,
"type" => "binary", 'type' => 'binary',
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"popup" => array ( 'popup' => array (
"value" => $GLOBALS["popup"], 'value' => isset($GLOBALS['popup']) ? $GLOBALS['popup'] : '',
"output_name" => "Popup", 'output_name' => 'Popup',
"int" => 1, 'int' => 1,
"type" => "binary", 'type' => 'binary',
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"popup_x" => array ( 'popup_x' => array (
"value" => $GLOBALS["popup_x"], 'value' => isset($GLOBALS['popup_x']) ? $GLOBALS['popup_x'] : '',
"output_name" => "Popup Width", 'output_name' => 'Popup Width',
"int_null" => 1, 'int_null' => 1,
"type" => "text", 'type' => 'text',
"size" => 4, 'size' => 4,
"length" => 4 'length' => 4
), ),
"popup_y" => array ( 'popup_y' => array (
"value" => $GLOBALS["popup_y"], 'value' => isset($GLOBALS['popup_y']) ? $GLOBALS['popup_y'] : '',
"output_name" => "Popup Height", 'output_name' => 'Popup Height',
"int_null" => 1, 'int_null' => 1,
"type" => "text", 'type' => 'text',
"size" => 4, 'size' => 4,
"length" => 4 'length' => 4
)/*,
"query_string" => array (
"value" => $GLOBALS["query_string"],
"output_name" => "Query String for Link",
"type" => "text",
"size" => "50"
)*/
),
"load_query" => "SELECT edit_page_id, filename, name, online, menu, popup FROM edit_page ORDER BY order_number",
"table_name" => "edit_page",
"show_fields" => array (
array (
"name" => "name"
), ),
array ( 'content_alias_edit_page_id' => array (
"name" => "filename", 'value' => isset($GLOBALS['content_alias_edit_page_id']) ? $GLOBALS['content_alias_edit_page_id'] : '',
"before_value" => "Filename: " 'output_name' => 'Content Alias Source',
), 'int' => 1,
array ( 'type' => 'drop_down_db',
"name" => "online", // query creation
"binary" => array ("Yes","No"), 'select_distinct' => 0,
"before_value" => "Online: " 'pk_name' => 'edit_page_id AS content_alias_edit_page_id',
), 'input_name' => 'name',
array ( 'table_name' => 'edit_page',
"name" => "menu", 'where_not_self' => 1,
"binary" => array ("Yes","No"), 'order_by' => 'order_number'
"before_value" => "Menu: " // 'query' => "SELECT edit_page_id AS content_alias_edit_page_id, name ".
), // "FROM edit_page ".
array ( // (isset($GLOBALS['edit_page_id']) ? " WHERE edit_page_id <> ".$GLOBALS['edit_page_id'] : "")." ".
"name" => "popup", // "ORDER BY order_number"
"binary" => array ("Yes","No"),
"before_value" => "Popup: "
) )
), ),
"reference_arrays" => array ( 'load_query' => "SELECT edit_page_id, filename, name, online, menu, popup FROM edit_page ORDER BY order_number",
"edit_visible_group" => array ( 'table_name' => 'edit_page',
"table_name" => "edit_page_visible_group", 'show_fields' => array (
"other_table_pk" => "edit_visible_group_id", array (
"output_name" => "Visible Groups (access)", 'name' => 'name'
"mandatory" => 1,
"select_size" => 10,
"selected" => $GLOBALS["edit_visible_group_id"],
"query" => 'SELECT edit_visible_group_id, \'Name: \' || name || \', \' || \'Flag: \' || flag FROM edit_visible_group ORDER BY name'
), ),
"edit_menu_group" => array ( array (
"table_name" => "edit_page_menu_group", 'name' => 'filename',
"other_table_pk" => "edit_menu_group_id", 'before_value' => 'Filename: '
"output_name" => "Menu Groups (grouping)", ),
"mandatory" => 1, array (
"select_size" => 10, 'name' => 'online',
"selected" => $GLOBALS["edit_menu_group_id"], 'binary' => array ('Yes','No'),
"query" => 'SELECT edit_menu_group_id, \'Name: \' || name || \', \' || \'Flag: \' || flag FROM edit_menu_group ORDER BY order_number' 'before_value' => 'Online: '
),
array (
'name' => 'menu',
'binary' => array ('Yes','No'),
'before_value' => 'Menu: '
),
array (
'name' => 'popup',
'binary' => array ('Yes','No'),
'before_value' => 'Popup: '
)
),
'reference_arrays' => array (
'edit_visible_group' => array (
'table_name' => 'edit_page_visible_group',
'other_table_pk' => 'edit_visible_group_id',
'output_name' => 'Visible Groups (access)',
'mandatory' => 1,
'select_size' => 10,
'selected' => isset($GLOBALS['edit_visible_group_id']) ? $GLOBALS['edit_visible_group_id'] : '',
'query' => "SELECT edit_visible_group_id, 'Name: ' || name || ', ' || 'Flag: ' || flag FROM edit_visible_group ORDER BY name"
),
'edit_menu_group' => array (
'table_name' => 'edit_page_menu_group',
'other_table_pk' => 'edit_menu_group_id',
'output_name' => 'Menu Groups (grouping)',
'mandatory' => 1,
'select_size' => 10,
'selected' => isset($GLOBALS['edit_menu_group_id']) ? $GLOBALS['edit_menu_group_id'] : '',
'query' => "SELECT edit_menu_group_id, 'Name: ' || name || ', ' || 'Flag: ' || flag FROM edit_menu_group ORDER BY order_number"
) )
), ),
"element_list" => array ( 'element_list' => array (
"edit_query_string" => array ( 'edit_query_string' => array (
"output_name" => "Query Strings", 'output_name' => 'Query Strings',
"delete_name" => "remove_query_string", 'delete_name' => 'remove_query_string',
"prefix" => "eqs", 'prefix' => 'eqs',
"elements" => array ( 'elements' => array (
"name" => array ( 'name' => array (
"output_name" => "Name", 'output_name' => 'Name',
"type" => "text", 'type' => 'text',
"error_check" => "unique|alphanumeric", 'error_check' => 'unique|alphanumeric',
"mandatory" => 1 'mandatory' => 1
), ),
"value" => array ( 'value' => array (
"output_name" => "Value", 'output_name' => 'Value',
"type" => "text" 'type' => 'text'
), ),
"enabled" => array ( 'enabled' => array (
"output_name" => "Enabled", 'output_name' => 'Enabled',
"int" => 1, 'int' => 1,
"type" => "checkbox", 'type' => 'checkbox',
"element_list" => array (1) 'element_list' => array (1)
), ),
"dynamic" => array ( 'dynamic' => array (
"output_name" => "Dynamic", 'output_name' => 'Dynamic',
"int" => 1, 'int' => 1,
"type" => "checkbox", 'type' => 'checkbox',
"element_list" => array (1) 'element_list' => array (1)
), ),
"edit_query_string_id" => array ( 'edit_query_string_id' => array (
"type" => "hidden", 'type' => 'hidden',
"pk_id" => 1 'pk_id' => 1
) )
) // elements ) // elements
) // query_string element list ), // query_string element list
'edit_page_content' => array (
'output_name' => 'Page Content',
'delete_name' => 'remove_page_content',
'prefix' => 'epc',
'elements' => array (
'name' => array (
'output_name' => 'Content',
'type' => 'text',
'error_check' => 'alphanumeric',
'mandatory' => 1
),
'uid' => array (
'output_name' => 'UID',
'type' => 'text',
'error_check' => 'unique|alphanumeric',
'mandatory' => 1
),
'order_number' => array (
'output_name' => 'Order',
'type' => 'text',
'error_check' => 'int',
'mandatory' => 1
),
'online' => array (
'output_name' => 'Online',
'int' => 1,
'type' => 'checkbox',
'element_list' => array (1)
),
'edit_access_right_id' => array (
'type' => 'drop_down_db',
'output_name' => 'Access Level',
'int' => 1,
'preset' => 1, // first of the select
'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
),
'edit_page_content_id' => array (
'type' => 'hidden',
'pk_id' => 1
)
)
)
) // element list ) // element list
); );

View File

@@ -1,55 +1,55 @@
<?php <?php declare(strict_types=1);
$edit_schemes = array ( $edit_schemes = array (
"table_array" => array ( 'table_array' => array (
"edit_scheme_id" => array ( 'edit_scheme_id' => array (
"value" => $GLOBALS["edit_scheme_id"], 'value' => isset($GLOBALS['edit_scheme_id']) ? $GLOBALS['edit_scheme_id'] : '',
"type" => "hidden", 'type' => 'hidden',
"pk" => 1 'pk' => 1
), ),
"name" => array ( 'name' => array (
"value" => $GLOBALS["name"], 'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
"output_name" => "Scheme Name", 'output_name' => 'Scheme Name',
"mandatory" => 1, 'mandatory' => 1,
"type" => "text" 'type' => 'text'
), ),
"header_color" => array ( 'header_color' => array (
"value" => $GLOBALS["header_color"], 'value' => isset($GLOBALS['header_color']) ? $GLOBALS['header_color'] : '',
"output_name" => "Header Color", 'output_name' => 'Header Color',
"mandatory" => 1, 'mandatory' => 1,
"type" => "text", 'type' => 'text',
"size" => 6, 'size' => 6,
"length" => 6, 'length' => 6,
"error_check" => "custom", 'error_check' => 'custom',
"error_regex" => "/[\dA-Fa-f]{6}/", 'error_regex' => '/[\dA-Fa-f]{6}/',
"error_example" => "F6A544" 'error_example' => 'F6A544'
), ),
"enabled" => array ( 'enabled' => array (
"value" => $GLOBALS["enabled"], 'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
"output_name" => "Enabled", 'output_name' => 'Enabled',
"int" => 1, 'int' => 1,
"type" => "binary", 'type' => 'binary',
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"template" => array ( 'template' => array (
"value" => $GLOBALS["template"], 'value' => isset($GLOBALS['template']) ? $GLOBALS['template'] : '',
"output_name" => "Template", 'output_name' => 'Template',
"type" => "text" 'type' => 'text'
) )
), ),
"table_name" => "edit_scheme", 'table_name' => 'edit_scheme',
"load_query" => "SELECT edit_scheme_id, name, enabled FROM edit_scheme ORDER BY name", 'load_query' => "SELECT edit_scheme_id, name, enabled FROM edit_scheme ORDER BY name",
"show_fields" => array ( 'show_fields' => array (
array ( array (
"name" => "name" 'name' => 'name'
), ),
array ( array (
"name" => "enabled", 'name' => 'enabled',
"binary" => array ("Yes", "No"), 'binary' => array ('Yes', 'No'),
"before_value" => "Enabled: " 'before_value' => 'Enabled: '
) )
) )
); // main array ); // main array

View File

@@ -1,27 +1,27 @@
<?php <?php declare(strict_types=1);
$edit_users = array ( $edit_users = array (
"table_array" => array ( 'table_array' => array (
"edit_user_id" => array ( 'edit_user_id' => array (
"value" => $GLOBALS["edit_user_id"], 'value' => isset($GLOBALS['edit_user_id']) ? $GLOBALS['edit_user_id'] : '',
"type" => "hidden", 'type' => 'hidden',
"pk" => 1, 'pk' => 1,
"int" => 1 'int' => 1
), ),
"username" => array ( 'username' => array (
"value" => $GLOBALS["username"], 'value' => isset($GLOBALS['username']) ? $GLOBALS['username'] : '',
"output_name" => "Username", 'output_name' => 'Username',
"mandatory" => 1, 'mandatory' => 1,
"error_check" => "unique|alphanumericextended", 'error_check' => 'unique|alphanumericextended',
"type" => "text" 'type' => 'text'
), ),
"password" => array ( 'password' => array (
"value" => $GLOBALS["password"], 'value' => isset($GLOBALS['password']) ? $GLOBALS['password'] : '',
"HIDDEN_value" => $GLOBALS["HIDDEN_password"], 'HIDDEN_value' => isset($GLOBALS['HIDDEN_password']) ? $GLOBALS['HIDDEN_password'] : '',
"CONFIRM_value" => $GLOBALS["CONFIRM_password"], 'CONFIRM_value' => isset($GLOBALS['CONFIRM_password']) ? $GLOBALS['CONFIRM_password'] : '',
"output_name" => "Password", 'output_name' => 'Password',
"mandatory" => 1, 'mandatory' => 1,
"type" => "password", // later has to be password for encryption in database 'type' => 'password', // later has to be password for encryption in database
'update' => array ( // connected field updates, and update data 'update' => array ( // connected field updates, and update data
'password_change_date' => array ( // db row to update 'password_change_date' => array ( // db row to update
'type' => 'date', // type of field (int/text/date/etc) 'type' => 'date', // type of field (int/text/date/etc)
@@ -32,7 +32,7 @@ $edit_users = array (
// password date when first insert and password is set, needs special field with connection to password // password date when first insert and password is set, needs special field with connection to password
// password reset force interval, if set, user needs to reset password after X time period // password reset force interval, if set, user needs to reset password after X time period
'password_change_interval' => array ( 'password_change_interval' => array (
'value' => $GLOBALS['password_change_interval'], 'value' => isset($GLOBALS['password_change_interval']) ? $GLOBALS['password_change_interval'] : '',
'output_name' => 'Password change interval', 'output_name' => 'Password change interval',
'error_check' => 'intervalshort', // can be any date length format. n Y/M/D [not H/M/S], only one set, no combination 'error_check' => 'intervalshort', // can be any date length format. n Y/M/D [not H/M/S], only one set, no combination
'type' => 'text', 'type' => 'text',
@@ -40,227 +40,227 @@ $edit_users = array (
'size' => 5, // make it 5 chars long 'size' => 5, // make it 5 chars long
'length' => 5 'length' => 5
), ),
"enabled" => array ( 'enabled' => array (
"value" => $GLOBALS["enabled"], 'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
"output_name" => "Enabled", 'output_name' => 'Enabled',
"type" => "binary", 'type' => 'binary',
"int" => 1, 'int' => 1,
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"strict" => array ( 'strict' => array (
"value" => $GLOBALS["strict"], 'value' => isset($GLOBALS['strict']) ? $GLOBALS['strict'] : '',
"output_name" => "Strict (Lock after errors)", 'output_name' => 'Strict (Lock after errors)',
"type" => "binary", 'type' => 'binary',
"int" => 1, 'int' => 1,
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"locked" => array ( 'locked' => array (
"value" => $GLOBALS["locked"], 'value' => isset($GLOBALS['locked']) ? $GLOBALS['locked'] : '',
"output_name" => "Locked (auto set if strict with errors)", 'output_name' => 'Locked (auto set if strict with errors)',
"type" => "binary", 'type' => 'binary',
"int" => 1, 'int' => 1,
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"admin" => array ( 'admin' => array (
"value" => $GLOBALS["admin"], 'value' => isset($GLOBALS['admin']) ? $GLOBALS['admin'] : '',
"output_name" => "Admin", 'output_name' => 'Admin',
"type" => "binary", 'type' => 'binary',
"int" => 1, 'int' => 1,
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"debug" => array ( 'debug' => array (
"value" => $GLOBALS["debug"], 'value' => isset($GLOBALS['debug']) ? $GLOBALS['debug'] : '',
"output_name" => "Debug", 'output_name' => 'Debug',
"type" => "binary", 'type' => 'binary',
"int" => 1, 'int' => 1,
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"db_debug" => array ( 'db_debug' => array (
"value" => $GLOBALS["db_debug"], 'value' => isset($GLOBALS['db_debug']) ? $GLOBALS['db_debug'] : '',
"output_name" => "DB Debug", 'output_name' => 'DB Debug',
"type" => "binary", 'type' => 'binary',
"int" => 1, 'int' => 1,
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"email" => array ( 'email' => array (
"value" => $GLOBALS["email"], 'value' => isset($GLOBALS['email']) ? $GLOBALS['email'] : '',
"output_name" => "E-Mail", 'output_name' => 'E-Mail',
"type" => "text", 'type' => 'text',
"error_check" => "email" 'error_check' => 'email'
), ),
"last_name" => array ( 'last_name' => array (
"value" => $GLOBALS["last_name"], 'value' => isset($GLOBALS['last_name']) ? $GLOBALS['last_name'] : '',
"output_name" => "Last Name", 'output_name' => 'Last Name',
"type" => "text" 'type' => 'text'
), ),
"first_name" => array ( 'first_name' => array (
"value" => $GLOBALS["first_name"], 'value' => isset($GLOBALS['first_name']) ? $GLOBALS['first_name'] : '',
"output_name" => "First Name", 'output_name' => 'First Name',
"type" => "text" 'type' => 'text'
), ),
"edit_language_id" => array ( 'edit_language_id' => array (
"value" => $GLOBALS["edit_language_id"], 'value' => isset($GLOBALS['edit_language_id']) ? $GLOBALS['edit_language_id'] : '',
"output_name" => "Language", 'output_name' => 'Language',
"mandatory" => 1, 'mandatory' => 1,
"int" => 1, 'int' => 1,
"type" => "drop_down_db", 'type' => 'drop_down_db',
"query" => "SELECT edit_language_id, long_name FROM edit_language WHERE enabled = 1 ORDER BY order_number" 'query' => "SELECT edit_language_id, long_name FROM edit_language WHERE enabled = 1 ORDER BY order_number"
), ),
"edit_scheme_id" => array ( 'edit_scheme_id' => array (
"value" => $GLOBALS["edit_scheme_id"], 'value' => isset($GLOBALS['edit_scheme_id']) ? $GLOBALS['edit_scheme_id'] : '',
"output_name" => "Scheme", 'output_name' => 'Scheme',
"int_null" => 1, 'int_null' => 1,
"type" => "drop_down_db", 'type' => 'drop_down_db',
"query" => "SELECT edit_scheme_id, name FROM edit_scheme WHERE enabled = 1 ORDER BY name" 'query' => "SELECT edit_scheme_id, name FROM edit_scheme WHERE enabled = 1 ORDER BY name"
), ),
"edit_group_id" => array ( 'edit_group_id' => array (
"value" => $GLOBALS["edit_group_id"], 'value' => isset($GLOBALS['edit_group_id']) ? $GLOBALS['edit_group_id'] : '',
"output_name" => "Group", 'output_name' => 'Group',
"int" => 1, 'int' => 1,
"type" => "drop_down_db", 'type' => 'drop_down_db',
"query" => "SELECT edit_group_id, name FROM edit_group WHERE enabled = 1 ORDER BY name", 'query' => "SELECT edit_group_id, name FROM edit_group WHERE enabled = 1 ORDER BY name",
"mandatory" => 1 'mandatory' => 1
), ),
"edit_access_right_id" => array ( 'edit_access_right_id' => array (
"value" => $GLOBALS["edit_access_right_id"], 'value' => isset($GLOBALS['edit_access_right_id']) ? $GLOBALS['edit_access_right_id'] : '',
"output_name" => "User Level", 'output_name' => 'User Level',
"mandatory" => 1, 'mandatory' => 1,
"int" => 1, 'int' => 1,
"type" => "drop_down_db", 'type' => 'drop_down_db',
"query" => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level" 'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
), ),
"login_error_count" => array ( 'login_error_count' => array (
"output_name" => "Login error count", 'output_name' => 'Login error count',
"value" => $GLOBALS['login_error_count'], 'value' => isset($GLOBALS['login_error_count']) ? $GLOBALS['login_error_count'] : '',
"type" => "view", 'type' => 'view',
"empty" => "0" 'empty' => '0'
), ),
"login_error_date_last" => array ( 'login_error_date_last' => array (
"output_name" => "Last login error", 'output_name' => 'Last login error',
"value" => $GLOBALS['login_error_date_liast'], 'value' => isset($GLOBALS['login_error_date_liast']) ? $GLOBALS['login_error_date_liast'] : '',
"type" => "view", 'type' => 'view',
"empty" => "-" 'empty' => '-'
), ),
"login_error_date_first" => array ( 'login_error_date_first' => array (
"output_name" => "First login error", 'output_name' => 'First login error',
"value" => $GLOBALS['login_error_date_first'], 'value' => isset($GLOBALS['login_error_date_first']) ? $GLOBALS['login_error_date_first'] : '',
"type" => "view", 'type' => 'view',
"empty" => "-" 'empty' => '-'
), ),
"protected" => array ( 'protected' => array (
"value" => $GLOBALS["protected"], 'value' => isset($GLOBALS['protected']) ? $GLOBALS['protected'] : '',
"output_name" => "Protected", 'output_name' => 'Protected',
"type" => "binary", 'type' => 'binary',
"int" => 1, 'int' => 1,
"element_list" => array ( 'element_list' => array (
"1" => "Yes", '1' => 'Yes',
"0" => "No" '0' => 'No'
) )
), ),
"additional_acl" => array ( 'additional_acl' => array (
"value" => $GLOBALS["additional_acl"], 'value' => isset($GLOBALS['additional_acl']) ? $GLOBALS['additional_acl'] : '',
"output_name" => "Additional ACL (as JSON)", 'output_name' => 'Additional ACL (as JSON)',
"type" => "textarea", 'type' => 'textarea',
"error_check" => "json", 'error_check' => 'json',
"rows" => 10, 'rows' => 10,
"cols" => 60 'cols' => 60
), ),
), ),
"load_query" => "SELECT edit_user_id, username, enabled, debug, db_debug, strict, locked, login_error_count FROM edit_user ORDER BY username", 'load_query' => "SELECT edit_user_id, username, enabled, debug, db_debug, strict, locked, login_error_count FROM edit_user ORDER BY username",
"table_name" => "edit_user", 'table_name' => 'edit_user',
"show_fields" => array ( 'show_fields' => array (
array ( array (
"name" => "username" 'name' => 'username'
), ),
array ( array (
"name" => "enabled", 'name' => 'enabled',
"binary" => array ("Yes", "No"), 'binary' => array ('Yes', 'No'),
"before_value" => "Enabled: " 'before_value' => 'Enabled: '
), ),
array ( array (
"name" => "debug", 'name' => 'debug',
"binary" => array ("Yes", "No"), 'binary' => array ('Yes', 'No'),
"before_value" => "Debug: " 'before_value' => 'Debug: '
), ),
array ( array (
"name" => "db_debug", 'name' => 'db_debug',
"binary" => array ("Yes", "No"), 'binary' => array ('Yes', 'No'),
"before_value" => "DB Debug: " 'before_value' => 'DB Debug: '
), ),
array ( array (
"name" => "strict", 'name' => 'strict',
"binary" => array ("Yes", "No"), 'binary' => array ('Yes', 'No'),
"before_value" => "Strict: " 'before_value' => 'Strict: '
), ),
array ( array (
"name" => "locked", 'name' => 'locked',
"binary" => array ("Yes", "No"), 'binary' => array ('Yes', 'No'),
"before_value" => "Locked: " 'before_value' => 'Locked: '
), ),
array ( array (
"name" => "login_error_count", 'name' => 'login_error_count',
"before_value" => "Errors: " 'before_value' => 'Errors: '
) )
), ),
"element_list" => array ( 'element_list' => array (
"edit_access_user" => array ( 'edit_access_user' => array (
"output_name" => "Accounts", 'output_name' => 'Accounts',
"mandatory" => 1, 'mandatory' => 1,
"delete" => 0, // set then reference entries are deleted, else the "enable" flag is only set 'delete' => 0, // set then reference entries are deleted, else the 'enable' flag is only set
"prefix" => "ecu", 'prefix' => 'ecu',
"read_data" => array ( 'read_data' => array (
"table_name" => "edit_access", 'table_name' => 'edit_access',
"pk_id" => "edit_access_id", 'pk_id' => 'edit_access_id',
"name" => "name", 'name' => 'name',
"order" => "name" 'order' => 'name'
), ),
"elements" => array ( 'elements' => array (
"edit_access_user_id" => array ( 'edit_access_user_id' => array (
"output_name" => "Activate", 'output_name' => 'Activate',
"type" => "hidden", 'type' => 'hidden',
"int" => 1, 'int' => 1,
"pk_id" => 1 'pk_id' => 1
), ),
"enabled" => array ( 'enabled' => array (
"type" => "checkbox", 'type' => 'checkbox',
"output_name" => "Activate", 'output_name' => 'Activate',
"int" => 1, 'int' => 1,
"element_list" => array (1) 'element_list' => array (1)
), ),
"edit_access_right_id" => array ( 'edit_access_right_id' => array (
"type" => "drop_down_db", 'type' => 'drop_down_db',
"output_name" => "Access Level", 'output_name' => 'Access Level',
"preset" => 1, // first of the select 'preset' => 1, // first of the select
"int" => 1, 'int' => 1,
"query" => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level" 'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
), ),
"edit_default" => array ( 'edit_default' => array (
"type" => "radio_group", 'type' => 'radio_group',
"output_name" => "Default", 'output_name' => 'Default',
"int" => 1, 'int' => 1,
"element_list" => "radio_group" 'element_list' => 'radio_group'
), ),
"edit_access_id" => array ( 'edit_access_id' => array (
"type" => "hidden", 'type' => 'hidden',
"int" => 1 'int' => 1
) )
) )
) // edit pages ggroup ) // edit pages ggroup

View File

@@ -1,31 +1,31 @@
<?php <?php declare(strict_types=1);
$edit_visible_group = array ( $edit_visible_group = array (
"table_array" => array ( 'table_array' => array (
"edit_visible_group_id" => array ( 'edit_visible_group_id' => array (
"value" => $GLOBALS["edit_visible_group_id"], 'value' => isset($GLOBALS['edit_visible_group_id']) ? $GLOBALS['edit_visible_group_id'] : '',
"type" => "hidden", 'type' => 'hidden',
"pk" => 1 'pk' => 1
), ),
"name" => array ( 'name' => array (
"value" => $GLOBALS["name"], 'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
"output_name" => $this->l->__("Group name"), 'output_name' => $this->l->__('Group name'),
"mandatory" => 1, 'mandatory' => 1,
"type" => "text" 'type' => 'text'
), ),
"flag" => array ( 'flag' => array (
"value" => $GLOBALS["flag"], 'value' => isset($GLOBALS['flag']) ? $GLOBALS['flag'] : '',
"output_name" => $this->l->__("Flag"), 'output_name' => $this->l->__('Flag'),
"mandatory" => 1, 'mandatory' => 1,
"type" => "text", 'type' => 'text',
"error_check" => "alphanumeric|unique" 'error_check' => 'alphanumeric|unique'
) )
), ),
"table_name" => "edit_visible_group", 'table_name' => 'edit_visible_group',
"load_query" => "SELECT edit_visible_group_id, name FROM edit_visible_group ORDER BY name", 'load_query' => "SELECT edit_visible_group_id, name FROM edit_visible_group ORDER BY name",
"show_fields" => array ( 'show_fields' => array (
array ( array (
"name" => "name" 'name' => 'name'
) )
) )
); );

View File

@@ -114,8 +114,8 @@
{/foreach} {/foreach}
</table> </table>
{if $element.data.delete_name} {if $element.data.delete_name}
<input type="hidden" value="" name="{$element.data.delete_name}"> <input type="hidden" value="" id="{$element.data.delete_name}" name="{$element.data.delete_name}">
<input type="hidden" value="" name="{$element.data.delete_name}_flag"> <input type="hidden" value="" id="{$element.data.delete_name}_flag" name="{$element.data.delete_name}_flag">
<input type="hidden" name="remove_name[]" value="{$element.data.delete_name}"> <input type="hidden" name="remove_name[]" value="{$element.data.delete_name}">
{/if} {/if}
{if $element.data.enable_name} {if $element.data.enable_name}

View File

@@ -15,12 +15,6 @@
{if $STYLESHEET} {if $STYLESHEET}
<link rel=stylesheet type="text/css" href="{$css}{$STYLESHEET}"> <link rel=stylesheet type="text/css" href="{$css}{$STYLESHEET}">
{/if} {/if}
{if $JAVASCRIPT}
<script language="JavaScript" src="{$JS}{$JAVASCRIPT}"></script>
{/if}
{if $DATE_JAVASCRIPT}
<script language="JavaScript" src="{$JS}{$DATE_JAVASCRIPT}"></script>
{/if}
</head> </head>
<body> <body>
<table width="100%" border="0" cellpadding="0" cellspacing="1"> <table width="100%" border="0" cellpadding="0" cellspacing="1">

View File

@@ -274,6 +274,22 @@ const keyInObject = (key, object) => (key in object) ? true : false;
return (key in object) ? true : false; return (key in object) ? true : false;
}*/ }*/
// METHOD: getKeyByValue
// PARAMS: object, value
// RETURN: key found
// DESC : returns matching key of value
const getKeyByValue = (obj, value) => Object.keys(obj).find(key => obj[key] === value);
// function getKeyByValue(object, value)
// {
// return Object.keys(object).find(key => object[key] === value);
// }
// METHOD: valueInObject
// PARAMS: obj, value
// RETURN: true/false
// DESC : returns true if value is found in object with a key
const valueInObject = (obj, value) => (Object.keys(obj).find(key => obj[key] === value)) ? true : false;
// METHOD: exists // METHOD: exists
// PARAMS: uid // PARAMS: uid
// RETURN: true/false // RETURN: true/false

View File

@@ -352,6 +352,22 @@ const keyInObject = (key, object) => (key in object) ? true : false;
return (key in object) ? true : false; return (key in object) ? true : false;
}*/ }*/
// METHOD: getKeyByValue
// PARAMS: object, value
// RETURN: key found
// DESC : returns matching key of value
const getKeyByValue = (obj, value) => Object.keys(obj).find(key => obj[key] === value);
// function getKeyByValue(object, value)
// {
// return Object.keys(object).find(key => object[key] === value);
// }
// METHOD: valueInObject
// PARAMS: obj, value
// RETURN: true/false
// DESC : returns true if value is found in object with a key
const valueInObject = (obj, value) => (Object.keys(obj).find(key => obj[key] === value)) ? true : false;
// METHOD: exists // METHOD: exists
// PARAMS: uid // PARAMS: uid
// RETURN: true/false // RETURN: true/false

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/********************************************************************* /*********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2000/06/01 * CREATED: 2000/06/01
@@ -67,7 +67,7 @@ class Login extends \CoreLibs\DB\IO
private $username; // login name private $username; // login name
private $password; // login password private $password; // login password
private $logout; // logout button private $logout; // logout button
private $login_error; // login error code, can be matched to the array login_error_msg, which holds the string private $login_error = 0; // login error code, can be matched to the array login_error_msg, which holds the string
private $password_change = false; // if this is set to true, the user can change passwords private $password_change = false; // if this is set to true, the user can change passwords
private $password_change_ok = false; // password change was successful private $password_change_ok = false; // password change was successful
private $password_forgot = false; // can we reset password and mail to user with new password set screen private $password_forgot = false; // can we reset password and mail to user with new password set screen
@@ -426,18 +426,22 @@ class Login extends \CoreLibs\DB\IO
$pages = array(); $pages = array();
$edit_page_ids = array(); $edit_page_ids = array();
// set pages access // set pages access
$q = "SELECT ep.edit_page_id, filename, ep.name AS edit_page_name, ep.order_number AS edit_page_order, menu, "; $q = "SELECT ep.edit_page_id, ep.cuid, epca.cuid AS content_alias_uid, ep.filename, ep.name AS edit_page_name, ep.order_number AS edit_page_order, ep.menu, ";
$q .= "popup, popup_x, popup_y, online, ear.level, ear.type "; $q .= "ep.popup, ep.popup_x, ep.popup_y, ep.online, ear.level, ear.type ";
$q .= "FROM edit_page ep, edit_page_access epa, edit_access_right ear "; $q .= "FROM edit_page ep ";
$q .= "LEFT JOIN edit_page epca ON (epca.edit_page_id = ep.content_alias_edit_page_id)";
$q .= ", edit_page_access epa, edit_access_right ear ";
$q .= "WHERE ep.edit_page_id = epa.edit_page_id AND ear.edit_access_right_id = epa.edit_access_right_id "; $q .= "WHERE ep.edit_page_id = epa.edit_page_id AND ear.edit_access_right_id = epa.edit_access_right_id ";
$q .= "AND epa.enabled = 1 AND epa.edit_group_id = ".$res["edit_group_id"]." "; $q .= "AND epa.enabled = 1 AND epa.edit_group_id = ".$res["edit_group_id"]." ";
$q .= "ORDER BY ep.order_number"; $q .= "ORDER BY ep.order_number";
while ($res = $this->dbReturn($q)) { while ($res = $this->dbReturn($q)) {
// page id array for sub data readout // page id array for sub data readout
$edit_page_ids[] = $res['edit_page_id']; $edit_page_ids[$res['edit_page_id']] = $res['cuid'];
// create the array for pages // create the array for pages
array_push($pages, array ( $pages[$res['cuid']] = array (
'edit_page_id' => $res['edit_page_id'], 'edit_page_id' => $res['edit_page_id'],
'cuid' => $res['cuid'],
'content_alias_uid' => $res['content_alias_uid'], // for reference of content data on a differen page
'filename' => $res['filename'], 'filename' => $res['filename'],
'page_name' => $res['edit_page_name'], 'page_name' => $res['edit_page_name'],
'order' => $res['edit_page_order'], 'order' => $res['edit_page_order'],
@@ -450,7 +454,7 @@ class Login extends \CoreLibs\DB\IO
'acl_type' => $res['type'], 'acl_type' => $res['type'],
'query' => array (), 'query' => array (),
'visible' => array () 'visible' => array ()
)); );
// make reference filename -> level // make reference filename -> level
$pages_acl[$res['filename']] = $res['level']; $pages_acl[$res['filename']] = $res['level'];
} // for each page } // for each page
@@ -458,33 +462,42 @@ class Login extends \CoreLibs\DB\IO
$_edit_page_id = 0; $_edit_page_id = 0;
$q = "SELECT epvg.edit_page_id, name, flag "; $q = "SELECT epvg.edit_page_id, name, flag ";
$q .= "FROM edit_visible_group evp, edit_page_visible_group epvg "; $q .= "FROM edit_visible_group evp, edit_page_visible_group epvg ";
$q .= "WHERE evp.edit_visible_group_id = epvg.edit_visible_group_id AND epvg.edit_page_id IN (".join(', ', $edit_page_ids).") "; $q .= "WHERE evp.edit_visible_group_id = epvg.edit_visible_group_id AND epvg.edit_page_id IN (".join(', ', array_keys($edit_page_ids)).") ";
$q .= "ORDER BY epvg.edit_page_id"; $q .= "ORDER BY epvg.edit_page_id";
while ($res = $this->dbReturn($q)) { while ($res = $this->dbReturn($q)) {
if ($res['edit_page_id'] != $_edit_page_id) { $pages[$edit_page_ids[$res['edit_page_id']]]['visible'][$res['name']] = $res['flag'];
// search the pos in the array push
$pos = $this->arraySearchRecursive($res['edit_page_id'], $pages, 'edit_page_id');
$_edit_page_id = $res['edit_page_id'];
}
$pages[$pos[0]]['visible'][$res['name']] = $res['flag'];
} }
// get the same for the query strings // get the same for the query strings
$_edit_page_id = 0; $_edit_page_id = 0;
$q = "SELECT eqs.edit_page_id, name, value, dynamic FROM edit_query_string eqs "; $q = "SELECT eqs.edit_page_id, name, value, dynamic FROM edit_query_string eqs ";
$q .= "WHERE enabled = 1 AND edit_page_id IN (".join(', ', $edit_page_ids).") ORDER BY eqs.edit_page_id"; $q .= "WHERE enabled = 1 AND edit_page_id IN (".join(', ', array_keys($edit_page_ids)).") ";
$q .= "ORDER BY eqs.edit_page_id";
while ($res = $this->dbReturn($q)) { while ($res = $this->dbReturn($q)) {
if ($res['edit_page_id'] != $_edit_page_id) { $pages[$edit_page_ids[$res['edit_page_id']]]['query'][] = array (
// search the pos in the array push
$pos = $this->arraySearchRecursive($res['edit_page_id'], $pages, 'edit_page_id');
$_edit_page_id = $res['edit_page_id'];
}
$pages[$pos[0]]['query'][] = array (
'name' => $res['name'], 'name' => $res['name'],
'value' => $res['value'], 'value' => $res['value'],
'dynamic' => $res['dynamic'] 'dynamic' => $res['dynamic']
); );
} }
// get the page content and add them to the page
$_edit_page_id = 0;
$q = "SELECT epc.edit_page_id, epc.name, epc.uid, epc.order_number, epc.online, ear.level, ear.type ";
$q .= "FROM edit_page_content epc, edit_access_right ear ";
$q .= "WHERE epc.edit_access_right_id = ear.edit_access_right_id AND ";
$q .= "epc.edit_page_id IN (".join(', ', array_keys($edit_page_ids)).") ";
$q .= "ORDER BY epc.order_number";
while ($res = $this->dbReturn($q)) {
$pages[$edit_page_ids[$res['edit_page_id']]]['content'][$res['uid']] = array (
'name' => $res['name'],
'uid' => $res['uid'],
'online' => $res['online'],
'order' => $res['order_number'],
// access name and level
'acl_type' => $res['type'],
'acl_level' => $res['level']
);
}
// write back the pages data to the output array
$_SESSION['PAGES'] = $pages; $_SESSION['PAGES'] = $pages;
$_SESSION['PAGES_ACL_LEVEL'] = $pages_acl; $_SESSION['PAGES_ACL_LEVEL'] = $pages_acl;
// load the edit_access user rights // load the edit_access user rights
@@ -593,7 +606,8 @@ class Login extends \CoreLibs\DB\IO
if ($this->logout || $this->login_error) { if ($this->logout || $this->login_error) {
// unregister and destroy session vars // unregister and destroy session vars
unset($_SESSION['EUID']); unset($_SESSION['EUID']);
unset($_SESSION['GROUP_LEVEL']); unset($_SESSION['GROUP_ACL_LEVEL']);
unset($_SESSION['USER_ACL_LEVEL']);
unset($_SESSION['PAGES']); unset($_SESSION['PAGES']);
unset($_SESSION['USER_NAME']); unset($_SESSION['USER_NAME']);
unset($_SESSION['UNIT']); unset($_SESSION['UNIT']);
@@ -658,6 +672,7 @@ class Login extends \CoreLibs\DB\IO
$this->acl['base'] = $_SESSION['USER_ACL_LEVEL']; $this->acl['base'] = $_SESSION['USER_ACL_LEVEL'];
} }
} }
$_SESSION['BASE_ACL_LEVEL'] = $this->acl['base'];
// set the current page acl // set the current page acl
// start with default acl // start with default acl

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/********************************************************************* /*********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2006/08/15 * CREATED: 2006/08/15

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/********************************************************************* /*********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2003/03/24 * CREATED: 2003/03/24
@@ -169,7 +169,7 @@ class Basic
public function __construct($debug_all = 0, $echo_all = 1, $print_all = 0) public function __construct($debug_all = 0, $echo_all = 1, $print_all = 0)
{ {
// set per run UID for logging // set per run UID for logging
$this->running_uid = hash($this->hash_algo, uniqid(rand(), true)); $this->running_uid = hash($this->hash_algo, uniqid((string)rand(), true));
// internal info var // internal info var
$this->class_info["basic"] = array ( $this->class_info["basic"] = array (
@@ -369,8 +369,6 @@ class Basic
$this->session_id = session_id(); $this->session_id = session_id();
} }
// [!!! DEPRECATED !!!] init crypt settings
$this->cryptInit();
// new better password init // new better password init
$this->passwordInit(); $this->passwordInit();
@@ -452,7 +450,7 @@ class Basic
$this->endtime = ((float)$micro + (float)$timestamp); $this->endtime = ((float)$micro + (float)$timestamp);
$string .= $simple ? 'End: ' : "<b>Stopped at</b>: "; $string .= $simple ? 'End: ' : "<b>Stopped at</b>: ";
} }
$string .= date("Y-m-d H:i:s", $timestamp); $string .= date("Y-m-d H:i:s", (int)$timestamp);
$string .= " ".$micro; $string .= " ".$micro;
if ($this->starttime && $this->endtime) { if ($this->starttime && $this->endtime) {
$running_time = $this->endtime - $this->starttime; $running_time = $this->endtime - $this->starttime;
@@ -480,7 +478,7 @@ class Basic
public static function printTime($set_microtime = -1) public static function printTime($set_microtime = -1)
{ {
list($microtime, $timestamp) = explode(' ', microtime()); list($microtime, $timestamp) = explode(' ', microtime());
$string = date("Y-m-d H:i:s", $timestamp); $string = date("Y-m-d H:i:s", (int)$timestamp);
// if microtime flag is -1 no round, if 0, no microtime, if >= 1, round that size // if microtime flag is -1 no round, if 0, no microtime, if >= 1, round that size
if ($set_microtime == -1) { if ($set_microtime == -1) {
$string .= substr($microtime, 1); $string .= substr($microtime, 1);
@@ -494,8 +492,8 @@ class Basic
// METHOD: fdebug // METHOD: fdebug
// PARAMS: $string: data to write to file // PARAMS: $string: data to write to file
// $enter: default on true, if set to false, no linebreak (\n) will be put at the end // $enter: default on true, if set to false, no linebreak (\n) will be put at the end
// RETURN: none // RETURN: none
// DESC : writes a string to a file immediatly, for fast debug output // DESC : writes a string to a file immediatly, for fast debug output
public function fdebug($string, $enter = 1) public function fdebug($string, $enter = 1)
{ {
@@ -695,7 +693,7 @@ class Basic
$this->log_file_unique_id = $GLOBALS['LOG_FILE_UNIQUE_ID']; $this->log_file_unique_id = $GLOBALS['LOG_FILE_UNIQUE_ID'];
} }
if (!$this->log_file_unique_id) { if (!$this->log_file_unique_id) {
$GLOBALS['LOG_FILE_UNIQUE_ID'] = $this->log_file_unique_id = date('Y-m-d_His').'_U_'.substr(hash('sha1', uniqid(mt_rand(), true)), 0, 8); $GLOBALS['LOG_FILE_UNIQUE_ID'] = $this->log_file_unique_id = date('Y-m-d_His').'_U_'.substr(hash('sha1', uniqid((string)mt_rand(), true)), 0, 8);
} }
$rpl_string = '_'.$this->log_file_unique_id; // add 8 char unique string $rpl_string = '_'.$this->log_file_unique_id; // add 8 char unique string
} else { } else {
@@ -792,9 +790,9 @@ class Basic
// PARAMS: $array // PARAMS: $array
// RETURN: string html formatted // RETURN: string html formatted
// DESC : prints a html formatted (pre) array // DESC : prints a html formatted (pre) array
public static function printAr($array) public static function printAr(array $array)
{ {
return "<pre>".print_r($array, 1)."</pre>"; return "<pre>".print_r($array, true)."</pre>";
} }
// METHOD: checked // METHOD: checked
@@ -951,6 +949,8 @@ class Basic
$host_name = 'NA'; $host_name = 'NA';
} }
$this->host_port = $port ? $port : 80; $this->host_port = $port ? $port : 80;
$this->host_name = $host_name;
// also return for old type call
return $host_name; return $host_name;
} }
@@ -993,7 +993,7 @@ class Basic
// RETURN: array with the elements where the needle can be found in the haystack array // RETURN: array with the elements where the needle can be found in the haystack array
// DESC : searches key = value in an array / array // DESC : searches key = value in an array / array
// only returns the first one found // only returns the first one found
public static function arraySearchRecursive($needle, $haystack, $key_lookin = "") public static function arraySearchRecursive($needle, $haystack, $key_lookin = '')
{ {
$path = null; $path = null;
if (!is_array($haystack)) { if (!is_array($haystack)) {
@@ -1360,9 +1360,9 @@ class Basic
public static function timeStringFormat($timestamp, $show_micro = true) public static function timeStringFormat($timestamp, $show_micro = true)
{ {
// check if the timestamp has any h/m/s/ms inside, if yes skip // check if the timestamp has any h/m/s/ms inside, if yes skip
if (!preg_match("/(h|m|s|ms)/", $timestamp)) { if (!preg_match("/(h|m|s|ms)/", (string)$timestamp)) {
$ms = 0; $ms = 0;
list ($timestamp, $ms) = explode('.', round($timestamp, 4)); list ($timestamp, $ms) = explode('.', (string)round($timestamp, 4));
$timegroups = array (86400, 3600, 60, 1); $timegroups = array (86400, 3600, 60, 1);
$labels = array ('d', 'h', 'm', 's'); $labels = array ('d', 'h', 'm', 's');
$time_string = ''; $time_string = '';
@@ -1584,14 +1584,14 @@ class Basic
3 => 'png' 3 => 'png'
); );
if ($cache_source) { if (!empty($cache_source)) {
$tmp_src = $cache_source; $tmp_src = $cache_source;
} else { } else {
$tmp_src = BASE.TMP; $tmp_src = BASE.TMP;
} }
// check if pic has a path, and override next sets // check if pic has a path, and override next sets
if (strstr($pic, '/') === false) { if (strstr($pic, '/') === false) {
if (!$path) { if (empty($path)) {
$path = BASE; $path = BASE;
} }
$filename = $path.MEDIA.PICTURES.$pic; $filename = $path.MEDIA.PICTURES.$pic;
@@ -1847,6 +1847,7 @@ class Basic
// there is no auto init for this at the moment // there is no auto init for this at the moment
private function cryptInit() private function cryptInit()
{ {
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
// SET CRYPT SALT PREFIX: // SET CRYPT SALT PREFIX:
// the prefix string is defined by what the server can do // the prefix string is defined by what the server can do
// first we check if we can do blowfish, if not we try md5 and then des // first we check if we can do blowfish, if not we try md5 and then des
@@ -1892,6 +1893,7 @@ class Basic
// DESC : creates a random string from alphanumeric characters: A-Z a-z 0-9 ./ // DESC : creates a random string from alphanumeric characters: A-Z a-z 0-9 ./
private function cryptSaltString($nSize = 22) private function cryptSaltString($nSize = 22)
{ {
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
// A-Z is 65,90 // A-Z is 65,90
// a-z is 97,122 // a-z is 97,122
// 0-9 is 48,57 // 0-9 is 48,57
@@ -1921,6 +1923,7 @@ class Basic
// DESC : encrypts the string with blowfish and returns the full string + salt part that needs to be stored somewhere (eg DB) // DESC : encrypts the string with blowfish and returns the full string + salt part that needs to be stored somewhere (eg DB)
public function cryptString($string) public function cryptString($string)
{ {
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
// the crypt prefix is set in the init of the class // the crypt prefix is set in the init of the class
// uses the random string method to create the salt // uses the random string method to create the salt
return crypt($string, $this->cryptSaltPrefix.$this->cryptSaltString($this->cryptSaltSize).$this->cryptSaltSuffix); return crypt($string, $this->cryptSaltPrefix.$this->cryptSaltString($this->cryptSaltSize).$this->cryptSaltSuffix);
@@ -1934,6 +1937,7 @@ class Basic
// DESC : compares the string with the crypted one, is counter method to cryptString // DESC : compares the string with the crypted one, is counter method to cryptString
public function verifyCryptString($string, $crypt) public function verifyCryptString($string, $crypt)
{ {
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
// the full crypted string needs to be passed on to the salt, so the init (for blowfish) and salt are passed on // the full crypted string needs to be passed on to the salt, so the init (for blowfish) and salt are passed on
if (crypt($string, $crypt) == $crypt) { if (crypt($string, $crypt) == $crypt) {
return true; return true;
@@ -2457,6 +2461,7 @@ class Basic
public function checkConvert($string, $from_encoding, $to_encoding) public function checkConvert($string, $from_encoding, $to_encoding)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->checkConvertEncoding($string, $from_encoding, $to_encoding); return $this->checkConvertEncoding($string, $from_encoding, $to_encoding);
} }
@@ -2469,144 +2474,168 @@ class Basic
public function running_time($simple = false) public function running_time($simple = false)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->runningTime($simple); return $this->runningTime($simple);
} }
public static function print_time($set_microtime = -1) public static function print_time($set_microtime = -1)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return Basic::printTime($set_microtime); return Basic::printTime($set_microtime);
} }
private function fdebug_fp($flag = '') private function fdebug_fp($flag = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->fdebugFP($flag); return $this->fdebugFP($flag);
} }
public function debug_for($type, $flag) public function debug_for($type, $flag)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->debugFor($type, $flag); return $this->debugFor($type, $flag);
} }
public function get_caller_method($level = 2) public function get_caller_method($level = 2)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->getCallerMethod($level); return $this->getCallerMethod($level);
} }
public function merge_errors($error_msg = array ()) public function merge_errors($error_msg = array ())
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->mergeErrors($error_msg); return $this->mergeErrors($error_msg);
} }
public function print_error_msg($string = '') public function print_error_msg($string = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->printErrorMsg($string); return $this->printErrorMsg($string);
} }
private function write_error_msg($level, $error_string) private function write_error_msg($level, $error_string)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->writeErrorMsg($level, $error_string); return $this->writeErrorMsg($level, $error_string);
} }
public function reset_error_msg($level = '') public function reset_error_msg($level = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->resetErrorMsg($level); return $this->resetErrorMsg($level);
} }
public static function print_ar($array) public static function print_ar($array)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return Basic::printAr($array); return Basic::printAr($array);
} }
public function magic_links($string, $target = "_blank") public function magic_links($string, $target = "_blank")
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->magicLinks($string, $target); return $this->magicLinks($string, $target);
} }
private function create_url($href, $atag, $_1, $_2, $_3, $name, $class) private function create_url($href, $atag, $_1, $_2, $_3, $name, $class)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->createUrl($href, $atag, $_1, $_2, $_3, $name, $class); return $this->createUrl($href, $atag, $_1, $_2, $_3, $name, $class);
} }
private function create_email($mailto, $atag, $_1, $_2, $_3, $title, $class) private function create_email($mailto, $atag, $_1, $_2, $_3, $title, $class)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->createEmail($mailto, $atag, $_1, $_2, $_3, $title, $class); return $this->createEmail($mailto, $atag, $_1, $_2, $_3, $title, $class);
} }
public function get_host_name() public function get_host_name()
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->getHostName(); return $this->getHostName();
} }
public static function get_page_name($strip_ext = 0) public static function get_page_name($strip_ext = 0)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return Basic::getPageName($strip_ext); return Basic::getPageName($strip_ext);
} }
public static function get_filename_ending($filename) public static function get_filename_ending($filename)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return Basic::getFilenameEnding($filename); return Basic::getFilenameEnding($filename);
} }
public static function array_search_recursive($needle, $haystack, $key_lookin = "") public static function array_search_recursive($needle, $haystack, $key_lookin = "")
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return Basic::arraySearchRecursive($needle, $haystack, $key_lookin); return Basic::arraySearchRecursive($needle, $haystack, $key_lookin);
} }
public static function array_search_recursive_all($needle, $haystack, $key, $path = null) public static function array_search_recursive_all($needle, $haystack, $key, $path = null)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return Basic::arraySearchRecursiveAll($needle, $haystack, $key, $path); return Basic::arraySearchRecursiveAll($needle, $haystack, $key, $path);
} }
public static function array_search_simple($array, $key, $value) public static function array_search_simple($array, $key, $value)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return Basic::arraySearchSimple($array, $key, $value); return Basic::arraySearchSimple($array, $key, $value);
} }
public static function _mb_mime_encode($string, $encoding) public static function _mb_mime_encode($string, $encoding)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return Basic::__mbMimeEncode($string, $encoding); return Basic::__mbMimeEncode($string, $encoding);
} }
public function _crc32b($string) public function _crc32b($string)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__crc32b($string); return $this->__crc32b($string);
} }
public function _sha1_short($string, $use_sha = false) public function _sha1_short($string, $use_sha = false)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__sha1Short($string, $use_sha); return $this->__sha1Short($string, $use_sha);
} }
public function _hash($string, $hash_type = 'adler32') public function _hash($string, $hash_type = 'adler32')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__hash($string, $hash_type); return $this->__hash($string, $hash_type);
} }
public static function in_array_any($needle, $haystack) public static function in_array_any($needle, $haystack)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return Basic::inArrayAny($needle, $haystack); return Basic::inArrayAny($needle, $haystack);
} }
} }

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/********************************************************************* /*********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2002/12/17 * CREATED: 2002/12/17
@@ -69,7 +69,7 @@ class ArrayIO extends \CoreLibs\DB\IO
// set primary key for given table_array // set primary key for given table_array
if (is_array($this->table_array)) { if (is_array($this->table_array)) {
foreach ($this->table_array as $key => $value) { foreach ($this->table_array as $key => $value) {
if ($value['pk']) { if (isset($value['pk'])) {
$this->pk_name = $key; $this->pk_name = $key;
} }
} }
@@ -204,7 +204,9 @@ class ArrayIO extends \CoreLibs\DB\IO
$q_where = ''; $q_where = '';
foreach ($this->table_array as $column => $data_array) { foreach ($this->table_array as $column => $data_array) {
// suchen nach bildern und lschen ... // suchen nach bildern und lschen ...
if ($this->table_array[$column]['file'] && file_exists($this->table_array[$column]['url'].$this->table_array[$column]['value'])) { if (!empty($this->table_array[$column]['file']) &&
file_exists($this->table_array[$column]['url'].$this->table_array[$column]['value'])
) {
if (file_exists($this->table_array[$column]['path'].$this->table_array[$column]['value'])) { if (file_exists($this->table_array[$column]['path'].$this->table_array[$column]['value'])) {
unlink($this->table_array[$column]['path'].$this->table_array[$column]['value']); unlink($this->table_array[$column]['path'].$this->table_array[$column]['value']);
} }
@@ -214,7 +216,7 @@ class ArrayIO extends \CoreLibs\DB\IO
} }
} }
// if we have a foreign key // if we have a foreign key
if ($this->table_array[$column]['fk']) { if (!empty($this->table_array[$column]['fk'])) {
// create FK constraint checks // create FK constraint checks
if ($q_where) { if ($q_where) {
$q_where .= ' AND '; $q_where .= ' AND ';
@@ -263,7 +265,7 @@ class ArrayIO extends \CoreLibs\DB\IO
$q_select .= $column; $q_select .= $column;
// check FK ... // check FK ...
if ($this->table_array[$column]['fk'] && $this->table_array[$column]['value']) { if (isset($this->table_array[$column]['fk']) && isset($this->table_array[$column]['value'])) {
if ($q_where) { if ($q_where) {
$q_where .= ' AND '; $q_where .= ' AND ';
} }
@@ -290,7 +292,9 @@ class ArrayIO extends \CoreLibs\DB\IO
if ($edit) { if ($edit) {
$this->table_array[$column]['value'] = $res[$column]; $this->table_array[$column]['value'] = $res[$column];
// if password, also write to hidden // if password, also write to hidden
if ($this->table_array[$column]['type'] == 'password') { if (isset($this->table_array[$column]['type']) &&
$this->table_array[$column]['type'] == 'password'
) {
$this->table_array[$column]['HIDDEN_value'] = $res[$column]; $this->table_array[$column]['HIDDEN_value'] = $res[$column];
} }
} else { } else {
@@ -336,7 +340,7 @@ class ArrayIO extends \CoreLibs\DB\IO
foreach ($this->table_array as $column => $data_array) { foreach ($this->table_array as $column => $data_array) {
/********************************* START FILE *************************************/ /********************************* START FILE *************************************/
// file upload // file upload
if ($this->table_array[$column]['file']) { if (isset($this->table_array[$column]['file'])) {
// falls was im tmp drinnen, sprich ein upload, datei kopieren, Dateinamen in db schreiben // falls was im tmp drinnen, sprich ein upload, datei kopieren, Dateinamen in db schreiben
// falls datei schon am server (physischer pfad), dann einfach url in db schreiben (update) // falls datei schon am server (physischer pfad), dann einfach url in db schreiben (update)
// falls in 'delete' 'ja' dann loeschen (und gibts eh nur beim update) // falls in 'delete' 'ja' dann loeschen (und gibts eh nur beim update)
@@ -384,9 +388,16 @@ class ArrayIO extends \CoreLibs\DB\IO
/********************************* END FILE **************************************/ /********************************* END FILE **************************************/
// do not write 'pk' (primary key) or 'view' values // do not write 'pk' (primary key) or 'view' values
if (!$this->table_array[$column]['pk'] && $this->table_array[$column]['type'] != 'view' && strlen($column) > 0) { if (!isset($this->table_array[$column]['pk']) &&
isset($this->table_array[$column]['type']) &&
$this->table_array[$column]['type'] != 'view' &&
strlen($column) > 0
) {
// for password use hidden value if main is not set // for password use hidden value if main is not set
if ($this->table_array[$column]['type'] == 'password' && !$this->table_array[$column]['value']) { if (isset($this->table_array[$column]['type']) &&
$this->table_array[$column]['type'] == 'password' &&
empty($this->table_array[$column]['value'])
) {
$this->table_array[$column]['value'] = $this->table_array[$column]['HIDDEN_value']; $this->table_array[$column]['value'] = $this->table_array[$column]['HIDDEN_value'];
} }
if (!$insert) { if (!$insert) {
@@ -399,35 +410,47 @@ class ArrayIO extends \CoreLibs\DB\IO
if (strlen($q_data)) { if (strlen($q_data)) {
$q_data .= ', '; $q_data .= ', ';
} }
if ($q_vars) { if (strlen($q_vars)) {
$q_vars .= ', '; $q_vars .= ', ';
} }
$q_vars .= $column; $q_vars .= $column;
} }
// integer is different // integer is different
if ($this->table_array[$column]['int'] || $this->table_array[$column]['int_null']) { if (isset($this->table_array[$column]['int']) || isset($this->table_array[$column]['int_null'])) {
$this->debug('write_check', '[$column]['.$this->table_array[$column]['value'].'] Foo: '.isset($this->table_array[$column]['value']).' | '.$this->table_array[$column]['int_null']); $this->debug('write_check', '['.$column.']['.$this->table_array[$column]['value'].']['.$this->table_array[$column]['type'].'] VALUE SET: '.isset($this->table_array[$column]['value']).' | INT NULL: '.isset($this->table_array[$column]['int_null']));
if (!$this->table_array[$column]['value'] && $this->table_array[$column]['int_null']) { if (isset($this->table_array[$column]['value']) &&
!$this->table_array[$column]['value'] &&
isset($this->table_array[$column]['int_null'])
) {
$_value = 'NULL'; $_value = 'NULL';
} elseif (!isset($this->table_array[$column]['value'])) { } elseif (!isset($this->table_array[$column]['value']) ||
(isset($this->table_array[$column]['value']) && !$this->table_array[$column]['value'])
) {
$_value = 0; $_value = 0;
} else { } else {
$_value = $this->table_array[$column]['value']; $_value = $this->table_array[$column]['value'];
} }
$q_data .= $_value; $q_data .= $_value;
} elseif ($this->table_array[$column]['bool']) { } elseif (isset($this->table_array[$column]['bool'])) {
// boolean storeage (reverse check on ifset) // boolean storeage (reverse check on ifset)
$q_data .= "'".$this->dbBoolean($this->table_array[$column]['value'], true)."'"; $q_data .= "'".$this->dbBoolean($this->table_array[$column]['value'], true)."'";
} elseif ($this->table_array[$column]["interval"]) { } elseif (isset($this->table_array[$column]['interval'])) {
// for interval we check if no value, then we set null // for interval we check if no value, then we set null
if (!$this->table_array[$column]['value']) { if (!isset($this->table_array[$column]['value']) ||
(isset($this->table_array[$column]['value']) && !$this->table_array[$column]['value'])
) {
$_value = 'NULL'; $_value = 'NULL';
} elseif (isset($this->table_array[$column]['value'])) {
$_value = $this->table_array[$column]['value'];
} }
$q_data .= $_value; $q_data .= $_value;
} else { } else {
// if the error check is json, we set field to null if NOT set // if the error check is json, we set field to null if NOT set
// else normal string write // else normal string write
if ($this->table_array[$column]['error_check'] == 'json' && !$this->table_array[$column]['value']) { if (isset($this->table_array[$column]['error_check']) &&
$this->table_array[$column]['error_check'] == 'json' &&
(!isset($this->table_array[$column]['value']) || (isset($this->table_array[$column]['value']) && !$this->table_array[$column]['value']))
) {
$q_data .= 'NULL'; $q_data .= 'NULL';
} else { } else {
// normal string // normal string
@@ -450,8 +473,8 @@ class ArrayIO extends \CoreLibs\DB\IO
// create select part & addition FK part // create select part & addition FK part
foreach ($this->table_array as $column => $data_array) { foreach ($this->table_array as $column => $data_array) {
// check FK ... // check FK ...
if ($this->table_array[$column]['fk'] && $this->table_array[$column]['value']) { if (isset($this->table_array[$column]['fk']) && isset($this->table_array[$column]['value'])) {
if ($q_where) { if (!empty($q_where)) {
$q_where .= ' AND '; $q_where .= ' AND ';
} }
$q_where .= $column .= ' = '.$this->table_array[$column]['value']; $q_where .= $column .= ' = '.$this->table_array[$column]['value'];
@@ -459,11 +482,11 @@ class ArrayIO extends \CoreLibs\DB\IO
} }
// if no PK set, then get max ID from DB // if no PK set, then get max ID from DB
if (!$this->table_array[$this->pk_name]["value"]) { if (!$this->table_array[$this->pk_name]['value']) {
// max id, falls INSERT // max id, falls INSERT
$q = 'SELECT MAX('.$this->pk_name.') + 1 AS pk_id FROM '.$this->table_name; $q = 'SELECT MAX('.$this->pk_name.') + 1 AS pk_id FROM '.$this->table_name;
$res = $this->dbReturnRow($q); $res = $this->dbReturnRow($q);
if (!$res['pk_id']) { if (!isset($res['pk_id'])) {
$res['pk_id'] = 1; $res['pk_id'] = 1;
} }
$this->table_array[$this->pk_name]['value'] = $res['pk_id']; $this->table_array[$this->pk_name]['value'] = $res['pk_id'];
@@ -474,7 +497,7 @@ class ArrayIO extends \CoreLibs\DB\IO
$q .= $q_data; $q .= $q_data;
$q .= ' WHERE '; $q .= ' WHERE ';
$q .= $this->pk_name.' = '.$this->table_array[$this->pk_name]['value'].' '; $q .= $this->pk_name.' = '.$this->table_array[$this->pk_name]['value'].' ';
if ($q_where) { if (!empty($q_where)) {
$q .= ' AND '.$q_where; $q .= ' AND '.$q_where;
} }
// set pk_id ... if it has changed or so // set pk_id ... if it has changed or so
@@ -486,8 +509,8 @@ class ArrayIO extends \CoreLibs\DB\IO
// write primary key too // write primary key too
// if ($q_data) // if ($q_data)
// $q .= ", "; // $q .= ", ";
// $q .= $this->pk_name." = ".$this->table_array[$this->pk_name]["value"]." "; // $q .= $this->pk_name." = ".$this->table_array[$this->pk_name]['value']." ";
// $this->pk_id = $this->table_array[$this->pk_name]["value"]; // $this->pk_id = $this->table_array[$this->pk_name]['value'];
} }
// return success or not // return success or not
if (!$this->dbExec($q)) { if (!$this->dbExec($q)) {
@@ -512,48 +535,56 @@ class ArrayIO extends \CoreLibs\DB\IO
public function convert_data($text) public function convert_data($text)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->convertData($text); return $this->convertData($text);
} }
public function convert_entities($text) public function convert_entities($text)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->convertEntities($text); return $this->convertEntities($text);
} }
public function db_dump_array($write = 0) public function db_dump_array($write = 0)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbDumpArray($write); return $this->dbDumpArray($write);
} }
public function db_check_pk_set() public function db_check_pk_set()
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbCheckPkSet(); return $this->dbCheckPkSet();
} }
public function db_reset_array($reset_pk = 0) public function db_reset_array($reset_pk = 0)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbResetArray($reset_pk); return $this->dbResetArray($reset_pk);
} }
public function db_delete($table_array = 0) public function db_delete($table_array = 0)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbDelete($table_array); return $this->dbDelete($table_array);
} }
public function db_read($edit = 0, $table_array = 0) public function db_read($edit = 0, $table_array = 0)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbRead($edit, $table_array); return $this->dbRead($edit, $table_array);
} }
public function db_write($addslashes = 0, $table_array = 0) public function db_write($addslashes = 0, $table_array = 0)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbWrite($addslashes, $table_array); return $this->dbWrite($addslashes, $table_array);
} }
} // end of class } // end of class

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/******************************************************************** /********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2000/11/23 * CREATED: 2000/11/23
@@ -784,7 +784,7 @@ class IO extends \CoreLibs\Basic
// we have returning, now we need to check if we get one or many returned // we have returning, now we need to check if we get one or many returned
// we'll need to loop this, if we have multiple insert_id returns // we'll need to loop this, if we have multiple insert_id returns
while ($_insert_id = $this->db_functions->__dbFetchArray($this->cursor, PGSQL_ASSOC)) { while ($_insert_id = $this->db_functions->__dbFetchArray($this->cursor, PGSQL_ASSOC)) {
// echo "*** RETURNING: ".print_r($_insert_id, 1)."<br>"; // echo "*** RETURNING: ".print_r($_insert_id, true)."<br>";
$this->insert_id[] = $_insert_id; $this->insert_id[] = $_insert_id;
} }
// if we have only one, revert from array to single // if we have only one, revert from array to single
@@ -1307,10 +1307,11 @@ class IO extends \CoreLibs\Basic
// METHOD: dbReturnArray // METHOD: dbReturnArray
// WAS : db_return_array // WAS : db_return_array
// PARAMS: query -> the query to be executed, named_only -> if true, only name ref are returned // PARAMS: query -> the query to be executed
// assoc_only -> if true, only name ref are returned
// RETURN: array of hashes (row -> fields) // RETURN: array of hashes (row -> fields)
// DESC : createds an array of hashes of the query (all data) // DESC : createds an array of hashes of the query (all data)
public function dbReturnArray($query, $named_only = 0) public function dbReturnArray($query, $assoc_only = false)
{ {
if (!$query) { if (!$query) {
$this->error_id = 11; $this->error_id = 11;
@@ -1324,14 +1325,9 @@ class IO extends \CoreLibs\Basic
return false; return false;
} }
$cursor = $this->dbExec($query); $cursor = $this->dbExec($query);
while ($res = $this->dbFetchArray($cursor)) { while ($res = $this->dbFetchArray($cursor, $assoc_only)) {
for ($i = 0; $i < $this->num_fields; $i ++) { for ($i = 0; $i < $this->num_fields; $i ++) {
// cereated mixed, first name
$data[$this->field_names[$i]] = $res[$this->field_names[$i]]; $data[$this->field_names[$i]] = $res[$this->field_names[$i]];
// then number
if (!$named_only) {
$data[$i] = $res[$this->field_names[$i]];
}
} }
$rows[] = $data; $rows[] = $data;
} }
@@ -1590,7 +1586,7 @@ class IO extends \CoreLibs\Basic
public function dbCompareVersion($compare) public function dbCompareVersion($compare)
{ {
// compare has =, >, < prefix, and gets stripped, if the rest is not X.Y format then error // compare has =, >, < prefix, and gets stripped, if the rest is not X.Y format then error
preg_match("/^([<>=]{1,2})(\d{1,2})\.(\d{1,2})/", $compare, $matches); preg_match("/^([<>=]{1,})(\d{1,})\.(\d{1,})/", $compare, $matches);
$compare = $matches[1]; $compare = $matches[1];
$to_master = $matches[2]; $to_master = $matches[2];
$to_minor = $matches[3]; $to_minor = $matches[3];
@@ -1601,7 +1597,9 @@ class IO extends \CoreLibs\Basic
} }
// db_version can return X.Y.Z // db_version can return X.Y.Z
// we only compare the first two // we only compare the first two
list ($master, $minor, $_other) = explode('.', $this->dbVersion()); preg_match("/^(\d{1,})\.(\d{1,})\.?(\d{1,})?/", $this->dbVersion(), $matches);
$master = $matches[1];
$minor = $matches[2];
$version = $master.($minor < 10 ? '0' : '').$minor; $version = $master.($minor < 10 ? '0' : '').$minor;
$return = false; $return = false;
// compare // compare
@@ -1866,264 +1864,308 @@ class IO extends \CoreLibs\Basic
private function _connect_to_db() private function _connect_to_db()
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__connectToDB(); return $this->__connectToDB();
} }
private function _close_db() private function _close_db()
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__closeDB(); return $this->__closeDB();
} }
private function _check_query_for_select($query) private function _check_query_for_select($query)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__checkQueryForSelect($query); return $this->__checkQueryForSelect($query);
} }
private function _check_query_for_insert($query, $pure = false) private function _check_query_for_insert($query, $pure = false)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__checkQueryForInsert($query, $pure); return $this->__checkQueryForInsert($query, $pure);
} }
private function _print_array($array) private function _print_array($array)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__printArray($array); return $this->__printArray($array);
} }
private function _db_debug($debug_id, $error_string, $id = '', $type = '') private function _db_debug($debug_id, $error_string, $id = '', $type = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__dbDebug($debug_id, $error_string, $id, $type); return $this->__dbDebug($debug_id, $error_string, $id, $type);
} }
public function _db_error($cursor = '', $msg = '') public function _db_error($cursor = '', $msg = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__dbError($cursor, $msg); return $this->__dbError($cursor, $msg);
} }
private function _db_convert_encoding($row) private function _db_convert_encoding($row)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__dbConvertEncoding($row); return $this->__dbConvertEncoding($row);
} }
private function _db_debug_prepare($stm_name, $data = array()) private function _db_debug_prepare($stm_name, $data = array())
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__dbDebugPrepare($stm_name, $data); return $this->__dbDebugPrepare($stm_name, $data);
} }
private function _db_return_table($query) private function _db_return_table($query)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__dbReturnTable($query); return $this->__dbReturnTable($query);
} }
private function _db_prepare_exec($query, $pk_name) private function _db_prepare_exec($query, $pk_name)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__dbPrepareExec($query, $pk_name); return $this->__dbPrepareExec($query, $pk_name);
} }
private function _db_post_exec() private function _db_post_exec()
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->__dbPostExec(); return $this->__dbPostExec();
} }
public function db_set_debug($debug = '') public function db_set_debug($debug = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbSetDebug($debug); return $this->dbSetDebug($debug);
} }
public function db_reset_query_called($query) public function db_reset_query_called($query)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbResetQueryCalled($query); return $this->dbResetQueryCalled($query);
} }
public function db_get_query_called($query) public function db_get_query_called($query)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbGetQueryCalled($query); return $this->dbGetQueryCalled($query);
} }
public function db_close() public function db_close()
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbClose(); return $this->dbClose();
} }
public function db_set_schema($db_schema = '') public function db_set_schema($db_schema = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbSetSchema($db_schema); return $this->dbSetSchema($db_schema);
} }
public function db_get_schema() public function db_get_schema()
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbGetSchema(); return $this->dbGetSchema();
} }
public function db_set_encoding($db_encoding = '') public function db_set_encoding($db_encoding = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbSetEncoding($db_encoding); return $this->dbSetEncoding($db_encoding);
} }
public function db_info($show = 1) public function db_info($show = 1)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbInfo($show); return $this->dbInfo($show);
} }
public function db_dump_data($query = 0) public function db_dump_data($query = 0)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbDumpData($query); return $this->dbDumpData($query);
} }
public function db_return($query, $reset = 0) public function db_return($query, $reset = 0)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbReturn($query, $reset); return $this->dbReturn($query, $reset);
} }
public function db_cache_reset($query) public function db_cache_reset($query)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbCacheReset($query); return $this->dbCacheReset($query);
} }
public function db_exec($query = 0, $pk_name = '') public function db_exec($query = 0, $pk_name = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbExec($query, $pk_name); return $this->dbExec($query, $pk_name);
} }
public function db_exec_async($query, $pk_name = '') public function db_exec_async($query, $pk_name = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbExecAsync($query, $pk_name); return $this->dbExecAsync($query, $pk_name);
} }
public function db_check_async() public function db_check_async()
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbCheckAsync(); return $this->dbCheckAsync();
} }
public function db_fetch_array($cursor = 0) public function db_fetch_array($cursor = 0)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbFetchArray($cursor); return $this->dbFetchArray($cursor);
} }
public function db_return_row($query) public function db_return_row($query)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbReturnRow($query); return $this->dbReturnRow($query);
} }
public function db_return_array($query, $named_only = 0) public function db_return_array($query, $named_only = 0)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbReturnArray($query, $named_only); return $this->dbReturnArray($query, $named_only);
} }
public function db_cursor_pos($query) public function db_cursor_pos($query)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbCursorPos($query); return $this->dbCursorPos($query);
} }
public function db_cursor_num_rows($query) public function db_cursor_num_rows($query)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbCursorNumRows($query); return $this->dbCursorNumRows($query);
} }
public function db_show_table_meta_data($table, $schema = '') public function db_show_table_meta_data($table, $schema = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbShowTableMetaData($table, $schema); return $this->dbShowTableMetaData($table, $schema);
} }
public function db_prepare($stm_name, $query, $pk_name = '') public function db_prepare($stm_name, $query, $pk_name = '')
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbPrepare($stm_name, $query, $pk_name); return $this->dbPrepare($stm_name, $query, $pk_name);
} }
public function db_execute($stm_name, $data = array()) public function db_execute($stm_name, $data = array())
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbExecute($stm_name, $data); return $this->dbExecute($stm_name, $data);
} }
public function db_escape_string($string) public function db_escape_string($string)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbEscapeString($string); return $this->dbEscapeString($string);
} }
public function db_escape_bytea($bytea) public function db_escape_bytea($bytea)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbEscapeBytea($bytea); return $this->dbEscapeBytea($bytea);
} }
public function db_version() public function db_version()
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbVersion(); return $this->dbVersion();
} }
public function db_compare_version($compare) public function db_compare_version($compare)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbCompareVersion($compare); return $this->dbCompareVersion($compare);
} }
public function db_boolean($string, $rev = false) public function db_boolean($string, $rev = false)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbBoolean($string, $rev); return $this->dbBoolean($string, $rev);
} }
public function db_write_data($write_array, $not_write_array, $primary_key, $table, $data = array ()) public function db_write_data($write_array, $not_write_array, $primary_key, $table, $data = array ())
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbWriteData($write_array, $not_write_array, $primary_key, $table, $data); return $this->dbWriteData($write_array, $not_write_array, $primary_key, $table, $data);
} }
public function db_write_data_ext($write_array, $primary_key, $table, $not_write_array = array (), $not_write_update_array = array (), $data = array ()) public function db_write_data_ext($write_array, $primary_key, $table, $not_write_array = array (), $not_write_update_array = array (), $data = array ())
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbWriteDataExt($write_array, $primary_key, $table, $not_write_array, $not_write_update_array, $data); return $this->dbWriteDataExt($write_array, $primary_key, $table, $not_write_array, $not_write_update_array, $data);
} }
public function db_time_format($age, $show_micro = false) public function db_time_format($age, $show_micro = false)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbTimeFormat($age, $show_micro); return $this->dbTimeFormat($age, $show_micro);
} }
public function db_array_parse($text) public function db_array_parse($text)
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbArrayParse($text); return $this->dbArrayParse($text);
} }
public function db_sql_escape($value, $kbn = "") public function db_sql_escape($value, $kbn = "")
{ {
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']); error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
return $this->dbSqlEscape($value, $kbn); return $this->dbSqlEscape($value, $kbn);
} }
} // end if db class } // end if db class

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/********************************************************************* /*********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2003/04/09 * CREATED: 2003/04/09
@@ -376,7 +376,7 @@ class PgSQL
// DESC : wrapper for pg_escape_string // DESC : wrapper for pg_escape_string
public function __dbEscapeString($string) public function __dbEscapeString($string)
{ {
return pg_escape_string($this->dbh, $string); return pg_escape_string($this->dbh, (string)$string);
} }
// METHOD: __dbEscapeBytea // METHOD: __dbEscapeBytea

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/* /*
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>. Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/* /*
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>. Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/* /*
Copyright (c) 2003, 2009 Danilo Segan <danilo@kvota.net>. Copyright (c) 2003, 2009 Danilo Segan <danilo@kvota.net>.
Copyright (c) 2005 Nico Kaiser <nico@siriux.net> Copyright (c) 2005 Nico Kaiser <nico@siriux.net>

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/* /*
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>. Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/* /*
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>. Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/********************************************************************* /*********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2004/11/18 * CREATED: 2004/11/18

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/* /*
* Class ProgressBar * Class ProgressBar
* *
@@ -481,7 +481,7 @@ class ProgressBar
$js .= ' }'."\n"; $js .= ' }'."\n";
$js .= '}'."\n"; $js .= '}'."\n";
// print "DUMP LABEL: <br><pre>".print_r($this->label, 1)."</pre><br>"; // print "DUMP LABEL: <br><pre>".print_r($this->label, true)."</pre><br>";
foreach ($this->label as $name => $data) { foreach ($this->label as $name => $data) {
// set what type of move we do // set what type of move we do
$move_prefix = $data['type'] == 'button' ? 'margin' : 'padding'; $move_prefix = $data['type'] == 'button' ? 'margin' : 'padding';

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/******************************************************************** /********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2004/12/21 * CREATED: 2004/12/21

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/********************************************************************* /*********************************************************************
* AUTHOR: Clemens Schwaighofer * AUTHOR: Clemens Schwaighofer
* CREATED: 2011/2/8 * CREATED: 2011/2/8

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
namespace Autoloader; namespace Autoloader;