Compare commits

..

6 Commits

Author SHA1 Message Date
Clemens Schwaighofer
be03bc96cb Core libs clean up
- end comments from # to //
- clean up not initialzed vars and wrong named vars
2019-04-22 10:28:01 +09:00
Clemens Schwaighofer
4f73a88a8b Remove old config template 2019-04-22 09:53:58 +09:00
Clemens Schwaighofer
b2019226da Update Smarty test, Base class email comment update
- smarty test with optgroup
- ignore file update for log folder
- email regex comment update
2019-04-03 17:45:56 +09:00
Clemens Schwaighofer
754c2edbd2 Add three new methods to the Basic class
- fceil: hack for float numbers that not properly round up
- floorp: roundown(number, precision): eg 48756, -2 => 48700
- initNumeric: set variable to 0 if not numeric
2018-12-19 11:17:20 +09:00
Clemens Schwaighofer
98e16e6143 Some minor updates for test files 2018-12-14 13:07:10 +09:00
Clemens Schwaighofer
005584e2ed Remove old .htaccess php xdebug, test updates, fixes in admin header
- remove all old php_value settings as they wont work with php-fpm
- test check for removeLB
- fix URL for Error handling include in admin header
2018-11-30 11:37:50 +09:00
43 changed files with 248 additions and 411 deletions

View File

@@ -1,6 +1,3 @@
# php_value xdebug.profiler_output_dir /home/developer/xdebug/
# php_value xdebug.profiler_output_name timestamp
# php_value xdebug.profiler_enable 0
# all .inc files are denied access from outside
<Files "*.inc">
Require all denied

View File

@@ -32,7 +32,7 @@ ob_end_flush();
// set + check edit access id
$edit_access_id = 3;
if (array_key_exists('unit', $login->acl)) {
if (isset($login) && is_object($login) && isset($login->acl['unit'])) {
print "ACL UNIT: ".print_r(array_keys($login->acl['unit']), 1)."<br>";
print "ACCESS CHECK: ".$login->loginCheckEditAccess($edit_access_id)."<br>";
if ($login->loginCheckEditAccess($edit_access_id)) {
@@ -68,14 +68,16 @@ print "CALLER BACKTRACE: ".$basic->getCallerMethod()."<br>";
$basic->debug('SOME MARK', 'Some error output');
print "EDIT ACCESS ID: ".$basic->edit_access_id."<br>";
// print "ACL: <br>".$basic->print_ar($login->acl)."<br>";
$basic->debug('ACL', "ACL: ".$basic->printAr($login->acl));
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
// $result = array_flip(array_filter(array_flip($login->default_acl_list), function ($key) { if (is_numeric($key)) return $key; }));
// print "DEFAULT ACL: <br>".$basic->print_ar($result)."<br>";
// DEPRICATED CALL
// $basic->adbSetACL($login->acl);
if (isset($login)) {
// print "ACL: <br>".$basic->print_ar($login->acl)."<br>";
$basic->debug('ACL', "ACL: ".$basic->printAr($login->acl));
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
// $result = array_flip(array_filter(array_flip($login->default_acl_list), function ($key) { if (is_numeric($key)) return $key; }));
// print "DEFAULT ACL: <br>".$basic->print_ar($result)."<br>";
// DEPRICATED CALL
// $basic->adbSetACL($login->acl);
}
// DB client encoding
print "DB Client encoding: ".$basic->dbGetEncoding()."<br>";
@@ -165,14 +167,14 @@ print "DB Version bigger than $to_db_version: ".$basic->dbCompareVersion('>='.$t
print "DB Version bigger $to_db_version: ".$basic->dbCompareVersion('>'.$to_db_version)."<br>";
/* $q = "SELECT FOO FRO BAR";
// $q = "Select * from foo";
// $q = "Select * from foo";
$foo = $basic->dbExecAsync($q);
print "[ERR] Query: ".$q."<br>";
print "[ERR] RESOURCE: $foo<br>";
while (($ret = $basic->dbCheckAsync()) === true)
{
print "[ERR]: $ret<br>";
// sleep(5);
sleep(5);
} */
// search path check
@@ -210,7 +212,7 @@ print "COMPARE DATE: ".$basic->compareDate($date_1, $date_2)."<br>";
// array re
// print error messages
print $login->printErrorMsg();
// print $login->printErrorMsg();
print $basic->printErrorMsg();
print "</body></html>";

View File

@@ -10,7 +10,7 @@ if ($DEBUG_ALL) {
}
// sample config
require("config.inc");
require 'config.php';
echo "FILE: ".BASE.LIB."Error.Handling.inc<br>";
require(BASE.LIB."Error.Handling.inc");

17
www/admin/l10n_test.php Executable file
View File

@@ -0,0 +1,17 @@
<?php
// debug for L10n issues in php 7.3
// namespace test
ob_start();
$lang = 'en_utf8';
// admin class tests
require 'config.php';
$l = new CoreLibs\Language\L10n($lang);
echo "OK<br>";
ob_end_flush();
// __END__

View File

@@ -18,5 +18,24 @@ require BASE.INCLUDES.'admin_set_paths.inc';
// smarty test
$cms->DATA['SMARTY_TEST'] = 'Test Data';
// drop down test with optgroups
$options = array (
'' => '選択してください',
'4/25(木)' => array (
'4/25(木) 11:00-11:50' => '4/25(木) 11:00-11:50',
'4/25(木) 12:20-13:00' => '4/25(木) 12:20-13:00'
),
'4/26(金)' => array (
'4/26(金) 11:00-11:50' => '4/26(金) 11:00-11:50',
'4/26(金) 12:20-13:00' => '4/26(金) 12:20-13:00'
),
'4/27(土)' => array (
'4/27(土) 11:00-11:50' => '4/27(土) 11:00-11:50',
'4/27(土) 12:20-13:00' => '4/27(土) 12:20-13:00'
)
);
$cms->DATA['drop_down_test'] = $options;
require BASE.INCLUDES.'admin_smarty.inc';
require BASE.INCLUDES.'admin_footer.inc';

View File

@@ -17,6 +17,15 @@ print "BASE: ".BASE."<br>";
print "ROOT: ".ROOT."<br>";
print "HOST: ".$HOST_NAME." => DB HOST: ".$DB_HOST[$HOST_NAME]." => ".MAIN_DB."<br>";
$text = 'I am some text
with some
line breaks
in there. Theis
is sucky';
print "LB remove: ".$base->removeLB($text)."<br>";
print "LB remove: ".$base->removeLB($text, '##BR##')."<br>";
// $test = array (
// 'A' => array (
// 'B' => array (),

View File

@@ -1,293 +0,0 @@
<?php
/********************************************************************
* AUTHOR: Clemens Schwaighofer
* CREATED: 2003/06/10
* SHORT DESCRIPTION:
* configuration file
* HISTORY:
*********************************************************************/
/************* SESSION NAMES *************/
// server name HASH
DEFINE('SERVER_NAME_HASH', hash('crc32b', $_SERVER['HTTP_HOST']));
// backend
DEFINE('EDIT_SESSION_NAME', '<ADMIN SESSION NAME>'.SERVER_NAME_HASH);
// frontend
DEFINE('SESSION_NAME', '<SESSION NAME>'.SERVER_NAME_HASH);
// SET_SESSION_NAME should be set in the header if a special session name is needed
// DEFINE('SET_SESSION_NAME', SESSION_NAME);
/************* LANGUAGE / ENCODING *******/
DEFINE('DEFAULT_LANG', 'en_utf8');
// default web page encoding setting
DEFINE('DEFAULT_ENCODING', 'UTF-8');
/************* PATHS *********************/
// directory seperator
DEFINE('DS', DIRECTORY_SEPARATOR);
// ** NEW/BETTER DIR DECLARATIONS **
// path to original file (if symlink)
DEFINE('DIR', __DIR__.DS);
// base dir root folder level
DEFINE('BASE', str_replace('configs', '', __DIR__));
// ** OLD DIR DECLARATIONS **
// path to document root of file called
DEFINE('ROOT', getcwd().DS);
// libs path
DEFINE('LIB', 'lib'.DS);
DEFINE('LIBS', 'lib'.DS);
// configs folder
DEFINE('CONFIGS', 'configs'.DS);
// includes (strings, arrays for static, etc)
DEFINE('INCLUDES', 'includes'.DS);
// layout base path
DEFINE('LAYOUT', 'layout'.DS);
// pic-root (compatible to CMS)
DEFINE('PICTURES', 'images'.DS);
// images
DEFINE('IMAGES', 'images'.DS);
// icons (below the images/ folder)
DEFINE('ICONS', 'icons'.DS);
// media
DEFINE('MEDIA', 'media'.DS);
// flash-root (below media)
DEFINE('FLASH', 'flash'.DS);
// uploads (anything to keep)
DEFINE('UPLOADS', 'uploads'.DS);
// files (binaries) (below media)
DEFINE('BINARIES', 'binaries'.DS);
// files (videos) (below media)
DEFINE('VIDEOS', 'videos'.DS);
// files (documents) (below media)
DEFINE('DOCUMENTS', 'documents'.DS);
// files (pdfs) (below media)
DEFINE('PDFS', 'documents'.DS);
// CSV
DEFINE('CSV', 'csv'.DS);
// css
DEFINE('CSS', 'css'.DS);
// js
DEFINE('JS', 'javascript'.DS);
// table arrays
DEFINE('TABLE_ARRAYS', 'table_arrays'.DS);
// smarty libs path
DEFINE('SMARTY', 'Smarty'.DS);
// po langs
DEFINE('LANG', 'lang'.DS);
// cache path
DEFINE('CACHE', 'cache'.DS);
// temp path
DEFINE('TMP', 'tmp'.DS);
// log files
DEFINE('LOG', 'log'.DS);
// compiled template folder
DEFINE('TEMPLATES_C', 'templates_c'.DS);
// template base
DEFINE('TEMPLATES', 'templates'.DS);
// frontend template dir', only for admin
DEFINE('TEMPLATES_FRONTEND', 'templates_frontend'.DS);
// default template
DEFINE('DEFAULT_TEMPLATE', 'default'.DS);
// default template file
DEFINE('DEFAULT_TEMPLATE_FILE', 'default.tpl');
/************* HASH / ACL DEFAULT / ERROR SETTINGS / SMARTY *************/
// default hash type
DEFINE('DEFAULT_HASH', 'sha256');
// default acl level
DEFINE('DEFAULT_ACL_LEVEL', 80);
// default levels for certain actions
/* DEFINE('DEFAULT_ACL_READ', 20);
DEFINE('DEFAULT_ACL_CONFIRM', 35);
DEFINE('DEFAULT_ACL_MOD', 40);
DEFINE('DEFAULT_ACL_WRITE', 60);
DEFINE('DEFAULT_ACL_SEND', 70);
DEFINE('DEFAULT_ACL_DEL', 80);
DEFINE('DEFAULT_ACL_ADMIN', 100); */
// SSL host name
// DEFINE('SSL_HOST', 'ssl.host.name');
// error page strictness, Default is 3
// 1: only show error page as the last mesure if really no mid & aid can be loaded and found at all
// 2: if template not found, do not search, show error template
// 3: if default template is not found, show error template, do not fall back to default tree
// 4: very strict, even on normal fixable errors through error
// DEFINE('ERROR_STRICT', 3);
// allow page caching in general, set to 'FALSE' if you do debugging or development!
// DEFINE('ALLOW_SMARTY_CACHE', FALSE);
// cache life time, in seconds, default here is 2 days (172800s)
// -1 is never expire cache
// DEFINE('SMARTY_CACHE_LIFETIME', -1);
/************* LOGOUT ********************/
// logout target
DEFINE('LOGOUT_TARGET', '');
// password change allowed
DEFINE('PASSWORD_CHANGE', false);
// min/max password length
DEFINE('PASSWORD_MIN_LENGTH', 8);
DEFINE('PASSWORD_MAX_LENGTH', 255);
/************* AJAX / ACCESS *************/
// ajax request type
DEFINE('AJAX_REQUEST_TYPE', 'POST');
// what AJAX type to use
DEFINE('USE_PROTOTYPE', true);
DEFINE('USE_SCRIPTACULOUS', false);
DEFINE('USE_JQUERY', false);
/************* LAYOUT WIDTHS *************/
DEFINE('PAGE_WIDTH', 800);
// the default template name
DEFINE('MASTER_TEMPLATE_NAME', 'main_body.tpl');
// below two can be defined here, but they should be
// defined in either the header file or the file itself
/************* LOGGING *******************/
// DEFINE('LOG_FILE_ID', '');
/************* QUEUE TABLE *************/
// if we have a dev/live system
// set_live is a per page/per item
// live_queue is a global queue system
// DEFINE('QUEUE', 'live_queue');
/************* DB PATHS (PostgreSQL) *****************/
// schema names, can also be defined per <DB INFO>
DEFINE('PUBLIC_SCHEMA', 'public');
DEFINE('DEV_SCHEMA', 'public');
DEFINE('TEST_SCHEMA', 'public');
DEFINE('LIVE_SCHEMA', 'public');
/************* OTHER PATHS *****************/
// File and Folder paths
// ID is TARGET (first array element)
// $PATHS['test']['csv_path'] = '';
// $PATHS['test']['perl_bin'] = '';
// $PATHS['test']['redirect_url'] = '';
// non constant part
/************* DB ACCESS *****************/
if (file_exists(BASE.CONFIGS.'config.db.inc')) {
require BASE.CONFIGS.'config.db.inc';
}
// -> below in config.db.inc
// *** START ***
// // please be VERY carefull only to change the right side
// $DB_CONFIG = array (
// '<DB ID>' => array (
// 'db_name' => '<DB NAME>',
// 'db_user' => '<DB USER>',
// 'db_pass' => '<DB PASSWORD>',
// 'db_host' => '<DB HOST>',
// 'db_port' => '5432',
// 'db_schema' => '<DB SCHEMA>', // if not set, uses public
// 'db_type' => 'pgsql',
// 'db_encoding' => '',
// 'db_ssl' => 'disable' // allow, disable, require, prefer
// )
// );
// *** END ***
if (file_exists(BASE.CONFIGS.'config.host.inc')) {
require BASE.CONFIGS.'config.host.inc';
}
// // -> below in config.host.inc
// *** START ***
// // each host has a different db_host
// // development host
// $DB_HOST['<HOST NAME>'] = '<DB ID>';
// // target host (live)
// // $DB_TARGET_HOST['<HOST NAME>'] = '<DB ID>';
// // url redirect database
// // $DB_URL_REDIRECT_HOST['<HOST NAME>'] = '<DB ID>';
// // location flagging
// // test/dev/live
// $LOCATION['<HOST NAME>'] = '<test|live|remote|etc>';
// // show DEBUG override
// // true/false
// $DEBUG_FLAG['<HOST NAME>'] = true;
// // set postgresql paths (schemas)
// $DB_PATH['<HOST NAME>'] = PUBLIC_SCHEMA;
// *** END ***
// set the USE_DATABASE var, if there is nothing set, we assume TRUE
$USE_DATABASE = defined('USE_DATABASE') ? USE_DATABASE : true;
// live frontend pages
// ** missing live domains **
// get the name without the port
list($HOST_NAME, $PORT) = array_pad(explode(':', $_SERVER['HTTP_HOST'], 2), 2, null);
if (!$DB_HOST[$HOST_NAME] && $USE_DATABASE) {
echo 'No matching DB config found. Contact Admin<br>';
exit -1;
}
// set HOST name
DEFINE('HOST_NAME', $HOST_NAME);
// set SSL on
if ((array_key_exists('HTTPS', $_SERVER) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ||
$_SERVER['SERVER_PORT'] == 443) {
DEFINE('HOST_SSL', true);
DEFINE('HOST_PROTOCOL', 'https://');
} else {
DEFINE('HOST_SSL', false);
DEFINE('HOST_PROTOCOL', 'http://');
}
// define the static names
DEFINE('LOGIN_DB', $DB_HOST[$HOST_NAME]);
DEFINE('MAIN_DB', $DB_HOST[$HOST_NAME]);
DEFINE('DB_SCHEMA', $DB_PATH[$HOST_NAME]);
// DEFINE('TARGET_DB', $DB_TARGET_HOST[$HOST_NAME]);
// DEFINE('URL_REDIRECT_DB', $DB_URL_REDIRECT_HOST[$HOST_NAME]);
// next three if top is not set
// DEFINE('DEV_SCHEMA', $DB_CONFIG[MAIN_DB]['db_schema']);
// DEFINE('TEST_SCHEMA', $DB_CONFIG[MAIN_DB]['db_schema']);
// DEFINE('PUBLIC_SCHEMA', $DB_CONFIG[TARGET_DB]['db_schema']);
DEFINE('LOGIN_DB_SCHEMA', 'public'); // where the edit* tables are
DEFINE('GLOBAL_DB_SCHEMA', 'public'); // where global tables are that are used by all schemas (eg queue tables for online, etc)
DEFINE('TARGET', $LOCATION[$HOST_NAME]);
// DEFINE('CSV_PATH', $PATHS[TARGET]['csv_path']);
// DEFINE('EXPORT_SCRIPT', $PATHS[TARGET]['perl_bin']);
// DEFINE('REDIRECT_URL', $PATHS[TARGET]['redirect_url']);
DEFINE('DEBUG', $DEBUG_FLAG[$HOST_NAME]);
DEFINE('SHOW_ALL_ERRORS', false); // show all errors if debug_all & show_error_handling are enabled
/************* GENERAL PAGE TITLE ********/
$G_TITLE = '<OVERALL PAGE TITLE>';
/************ STYLE SHEETS / JS **********/
$EDIT_STYLESHEET = 'edit.css';
$EDIT_JAVASCRIPT = 'edit.js';
$STYLESHEET = 'frontend.css';
$JAVASCRIPT = 'frontend.js';
/************* CONVERT *******************/
$paths = array (
'/bin',
'/usr/bin',
'/usr/local/bin'
);
// find convert
foreach ($paths as $path) {
if (file_exists($path.'/convert') && is_file($path.'/convert')) {
// image magick convert location
DEFINE('CONVERT', $path.'/convert');
}
}
// turn off debug if debug flag is OFF
if (DEBUG == false) {
$ECHO_ALL = 0;
$DEBUG_ALL = 0;
$PRINT_ALL = 0;
$DB_DEBUG = 0;
$ENABLE_ERROR_HANDLING = 0;
}
// any other global definitons here
// DEFINE('SOME_ID', <SOME VALUE>);
// read auto loader
require BASE.LIB.'autoloader.php';
# __END__

View File

@@ -1,4 +1,4 @@
<?
<?php
/********************************************************************
* AUTHOR: Clemens Schwaighofer
* CREATED: 2005/07/19
@@ -7,45 +7,55 @@
* HISTORY:
*********************************************************************/
$day_short[1] = "Mon";
$day_short[2] = "Tue";
$day_short[3] = "Wed";
$day_short[4] = "Thu";
$day_short[5] = "Fri";
$day_short[6] = "Sat";
$day_short[7] = "Sun";
$day_short = array (
1 => 'Mon',
2 => 'Tue',
3 => 'Wed',
4 => 'Thu',
5 => 'Fri',
6 => 'Sat',
7 => 'Sun'
);
$day_long[1] = "Monday";
$day_long[2] = "Tuesday";
$day_long[3] = "Wednesday";
$day_long[4] = "Thursday";
$day_long[5] = "Friday";
$day_long[6] = "Saturday";
$day_long[7] = "Sunday";
$day_long = array (
1 => 'Monday',
2 => 'Tuesday',
3 => 'Wednesday',
4 => 'Thursday',
5 => 'Friday',
6 => 'Saturday',
7 => 'Sunday'
);
// monate
$month_long[1] = "January";
$month_long[2] = "February";
$month_long[3] = "March";
$month_long[4] = "April";
$month_long[5] = "May";
$month_long[6] = "June";
$month_long[7] = "July";
$month_long[8] = "August";
$month_long[9] = "September";
$month_long[10] = "October";
$month_long[11] = "November";
$month_long[12] = "December";
// months
$month_long = array (
1 => 'January',
2 => 'February',
3 => 'March',
4 => 'April',
5 => 'May',
6 => 'June',
7 => 'July',
8 => 'August',
9 => 'September',
10 => 'October',
11 => 'November',
12 => 'December'
);
$month_short[1] = "Jan";
$month_short[2] = "Feb";
$month_short[3] = "Mar";
$month_short[4] = "Apr";
$month_short[5] = "May";
$month_short[6] = "Jun";
$month_short[7] = "Jul";
$month_short[8] = "Aug";
$month_short[9] = "Sep";
$month_short[10] = "Oct";
$month_short[11] = "Nov";
$month_short[12] = "Dec";
$month_short = array (
1 => 'Jan',
2 => 'Feb',
3 => 'Mar',
4 => 'Apr',
5 => 'May',
6 => 'Jun',
7 => 'Jul',
8 => 'Aug',
9 => 'Sep',
10 => 'Oct',
11 => 'Nov',
12 => 'Dec'
);
// __END__

View File

@@ -10,3 +10,5 @@
// print debug messages
echo $login->printErrorMsg();
echo $cms->printErrorMsg();
// __END__

View File

@@ -10,7 +10,7 @@
//------------------------------ variable init start
// for dev test we set full error reporting; writes everything, except E_ERROR into logs/php_error-<day>.log
if ($DEBUG_ALL && $ENABLE_ERROR_HANDLING) {
include("../lib/Error.Handling.inc");
include(BASE.LIBS."Error.Handling.inc");
}
// predefine vars
$lang = '';
@@ -94,3 +94,5 @@ if ((TARGET == 'live' || TARGET == 'remote') && !$DEBUG_ALL_OVERRIDE) {
$cms->print_output_all = 0;
}
$cms->DATA['JS_DEBUG'] = DEBUG;
// __END__

View File

@@ -144,4 +144,4 @@ if (!file_exists($smarty->getTemplateDir()[0].DS.$TEMPLATE_TRANSLATE)) {
$cms->debug("LANGUAGE", "SL: ".$_SESSION['DEFAULT_CHARSET']." | ".$_SESSION['LANG']." | ".$_SESSION['DEFAULT_LANG']);
$cms->debug("TEMPLATE", "P: ".$smarty->getTemplateDir()[0]);
# __END__
// __END__

View File

@@ -101,4 +101,4 @@ if (is_dir(BASE.CACHE)) {
}
$smarty->display($MASTER_TEMPLATE_NAME, $TEMPLATE.$lang, $TEMPLATE.$lang);
# __END__
// __END__

View File

@@ -325,4 +325,4 @@ $smarty->display('edit_body.tpl');
echo $login->printErrorMsg();
echo $form->printErrorMsg();
# __END__
// __END__

View File

@@ -1,4 +1,5 @@
<?php
$edit_access = array (
"table_array" => array (
"edit_access_id" => array (
@@ -95,4 +96,4 @@ $edit_access = array (
)
);
# __END__
// __END__

View File

@@ -1,4 +1,5 @@
<?php
$edit_groups = array (
"table_array" => array (
"edit_group_id" => array (
@@ -98,4 +99,4 @@ $edit_groups = array (
)
);
# __END__
// __END__

View File

@@ -1,4 +1,5 @@
<?php
$edit_languages=array (
"table_array" => array (
"edit_language_id" => array (
@@ -71,4 +72,4 @@ $edit_languages=array (
"table_name" => "edit_language"
);
# __END__
// __END__

View File

@@ -1,4 +1,5 @@
<?php
$edit_menu_group = array (
"table_array" => array (
"edit_menu_group_id" => array (
@@ -36,4 +37,4 @@ $edit_menu_group = array (
)
);
# __END__
// __END__

View File

@@ -1,4 +1,5 @@
<?php
$edit_pages = array (
"table_array" => array (
"edit_page_id" => array (
@@ -176,4 +177,4 @@ $edit_pages = array (
) // element list
);
# __END__
// __END__

View File

@@ -1,4 +1,5 @@
<?php
$edit_schemes = array (
"table_array" => array (
"edit_scheme_id" => array (
@@ -53,4 +54,4 @@ $edit_schemes = array (
)
); // main array
# __END__
// __END__

View File

@@ -1,4 +1,5 @@
<?php
$edit_users = array (
"table_array" => array (
"edit_user_id" => array (
@@ -257,4 +258,4 @@ $edit_users = array (
)
);
# __END__
// __END__

View File

@@ -1,4 +1,5 @@
<?php
$edit_visible_group = array (
"table_array" => array (
"edit_visible_group_id" => array (
@@ -29,4 +30,4 @@ $edit_visible_group = array (
)
);
# __END__
// __END__

5
www/layout/admin/default/templates/smarty_test.tpl Normal file → Executable file
View File

@@ -1,3 +1,8 @@
<div>
{$SMARTY_TEST}
</div>
<div>
<select id="drop_down_test" name="drop_down_test">
{html_options options=$drop_down_test selected=$drop_down_test_selected}
</select>
</div>

View File

@@ -72,6 +72,11 @@ class Login extends \CoreLibs\DB\IO
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_ok = false; // password forgot mail send ok
private $change_password;
private $pw_username;
private $pw_old_password;
private $pw_new_password;
private $pw_new_password_confirm;
private $pw_change_deny_users = array (); // array of users for which the password change is forbidden
// if we have password change we need to define some rules
@@ -179,12 +184,12 @@ class Login extends \CoreLibs\DB\IO
$_POST['pw_new_password_confirm'] = '';
}
// pass on vars to Object vars
$this->login = $_POST["login_login"];
$this->username = $_POST["login_username"];
$this->password = $_POST["login_password"];
$this->logout = $_POST["login_logout"];
$this->login = $_POST['login_login'];
$this->username = $_POST['login_username'];
$this->password = $_POST['login_password'];
$this->logout = $_POST['login_logout'];
// password change vars
$this->change_password = $_POST["change_password"];
$this->change_password = $_POST['change_password'];
$this->pw_username = $_POST['pw_username'];
$this->pw_old_password = $_POST['pw_old_password'];
$this->pw_new_password = $_POST['pw_new_password'];
@@ -1187,4 +1192,4 @@ EOM;
}
} // close class
# __END__
// __END__

View File

@@ -359,4 +359,4 @@ class Backend extends \CoreLibs\DB\IO
}
}
# __END__
// __END__

View File

@@ -307,8 +307,8 @@ class Basic
'.*@bandai\.jp$' => 'keitai_willcom_bandai', # willcom paipo! (kids)
'.*@pipopa\.ne\.jp$' => 'keitai_willcom_pipopa', # willcom paipo! (kids)
'.*@([a-z0-9]{2,4}\.)?pdx\.ne\.jp$' => 'keitai_willcom_pdx', # actually only di,dj,dk,wm -> all others are "wrong", but none also allowed?
'.*@ymobile([1]{1})?\.ne\.jp$' => 'keitai_willcom_ymobile', # ymobile, ymobile1 techincally not willcom, but I group them there
'.*@y-mobile\.ne\.jp$' => 'keitai_willcom_ymobile', # y-mobile techincally not willcom, but I group them there
'.*@ymobile([1]{1})?\.ne\.jp$' => 'keitai_willcom_ymobile', # ymobile, ymobile1 techincally not willcom, but I group them there (softbank sub)
'.*@y-mobile\.ne\.jp$' => 'keitai_willcom_ymobile', # y-mobile techincally not willcom, but I group them there (softbank sub)
'.*@emnet\.ne\.jp$' => 'keitai_willcom_emnet', # e-mobile, group will willcom
'.*@emobile\.ne\.jp$' => 'keitai_willcom_emnet', # e-mobile, group will willcom
'.*@emobile-s\.ne\.jp$' => 'keitai_willcom_emnet' # e-mobile, group will willcom
@@ -419,6 +419,7 @@ class Basic
{
unset($string);
list($major, $minor, $patchlvl) = explode(".", $this->class_info[$class_name]["class_version"]);
$string = '';
$string .= "<b>-Class-info-[".$class_name."]-></b> Class Name: <b>".$this->class_info[$class_name]["class_name"]."</b><br>";
$string .= "<b>-Class-info-[".$class_name."]-></b> Class Author: <b>".$this->class_info[$class_name]["class_author"]."</b><br>";
$string .= "<b>-Class-info-[".$class_name."]-></b> Class Version: <b>".$this->class_info[$class_name]["class_version"]."</b><br>";
@@ -484,7 +485,8 @@ class Basic
if ($set_microtime == -1) {
$string .= substr($microtime, 1);
} elseif ($set_microtime >= 1) {
$string .= substr(round($microtime, $set_microtime), 1);
// in round case we run this through number format to always get the same amount of digits
$string .= substr(number_format(round($microtime, $set_microtime), $set_microtime), 1);
}
return $string;
}
@@ -1195,6 +1197,7 @@ class Basic
$pos = 0;
$split = 36; // after 36 single bytes characters, if then comes MB, it is broken
// has to 2 x 36 < 74 so the mb_encode_mimeheader 74 hardcoded split does not get triggered
$_string = '';
while ($pos < mb_strlen($string, $encoding)) {
$output = mb_strimwidth($string, $pos, $split, "", $encoding);
$pos += mb_strlen($output, $encoding);
@@ -1785,6 +1788,7 @@ class Basic
}
// max should be 63 for this case
$max_rand = count($chars) - 1;
$salt_string = '';
// create the salt part
for ($i = 1; $i <= $nSize; $i ++) {
$salt_string .= $chars[mt_rand(0, $max_rand)];
@@ -2275,6 +2279,38 @@ class Basic
return str_replace(array("\r", "\n"), $replace, $string);
}
// METHOD: fceil
// PARAMS: number, round decimals (default 10)
// RETURN: correct ceil number
// DESC : some float numbers will be rounded up even if they have no decimal entries
public function fceil($number, $precision = 10)
{
return ceil(round($number, $precision));
}
// METHOD floorp
// PARAMS: number, round to
// RETURN: floor number but with tround to
// DESC : eg 48767 with -2 -> 48700
public function floorp($number, $precision = -2)
{
$mult = pow(10, $precision); // Can be cached in lookup table
return floor($number * $mult) / $mult;
}
// METHOD: initNumeric
// PARAMS: any value
// RETURN: if not numeric, sets to 0, else returns value already set
// DESC : inits input to 0, if value is not numeric
public function initNumeric($number)
{
if (!is_numeric($number)) {
return 0;
} else {
return $number;
}
}
// METHOD: setFormToken
// PARAMS: session name, if not set then default is form_token
// RETURN: form token
@@ -2457,4 +2493,4 @@ class Basic
}
}
# __END__
// __END__

View File

@@ -133,6 +133,7 @@ class ArrayIO extends \CoreLibs\DB\IO
public function dbDumpArray($write = 0)
{
reset($this->table_array);
$string = '';
foreach ($this->table_array as $column => $data_array) {
$string .= "<b>".$column."</b> -> ".$data_array["value"]."<br>";
}
@@ -200,20 +201,21 @@ class ArrayIO extends \CoreLibs\DB\IO
$q .= $this->pk_name." = ".$this->table_array[$this->pk_name]["value"]." ";
// delete files and build FK query
reset($this->table_array);
$q_where = '';
foreach ($this->table_array as $column => $data_array) {
// suchen nach bildern und lschen ...
if ($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"])) {
unlink($this->table_array[$column]["path"].$this->table_array[$column]["value"]);
}
$dateiname = str_replace("_tn", "", $this->table_array[$column]["value"]);
if (file_exists($this->table_array[$column]["path"].$dateiname)) {
unlink($this->table_array[$column]["path"].$dateiname);
$file_name = str_replace("_tn", "", $this->table_array[$column]["value"]);
if (file_exists($this->table_array[$column]["path"].$file_name)) {
unlink($this->table_array[$column]["path"].$file_name);
}
}
// if we have a foreign key
if ($this->table_array[$column]["fk"]) {
// zusammenstellen der FKs
// create FK constraint checks
if ($q_where) {
$q_where .= " AND ";
}
@@ -251,6 +253,8 @@ class ArrayIO extends \CoreLibs\DB\IO
return $this->table_array;
}
reset($this->table_array);
$q_select = '';
$q_where = '';
// create select part & addition FK part
foreach ($this->table_array as $column => $data_array) {
if ($q_select) {
@@ -326,6 +330,9 @@ class ArrayIO extends \CoreLibs\DB\IO
}
reset($this->table_array);
$q_data = '';
$q_vars = '';
$q_where = '';
foreach ($this->table_array as $column => $data_array) {
/********************************* START FILE *************************************/
// file upload
@@ -338,9 +345,9 @@ class ArrayIO extends \CoreLibs\DB\IO
if (file_exists($this->table_array[$column]["path"].$this->table_array[$column]["value"])) {
unlink($this->table_array[$column]["path"].$this->table_array[$column]["value"]);
}
$dateiname = str_replace("_tn", "", $this->table_array[$column]["value"]);
if (file_exists($this->table_array[$column]["path"].$dateiname)) {
unlink($this->table_array[$column]["path"].$dateiname);
$file_name = str_replace("_tn", "", $this->table_array[$column]["value"]);
if (file_exists($this->table_array[$column]["path"].$file_name)) {
unlink($this->table_array[$column]["path"].$file_name);
}
$this->table_array[$column]["value"] = "";
} else {
@@ -355,20 +362,19 @@ class ArrayIO extends \CoreLibs\DB\IO
$ext = end($filename_parts);
array_splice($filename_parts, -1, 1);
$name = str_replace(" ", "_", implode(".", $filename_parts));
//echo "PK: $pk_ids_file<br>";
$dateiname = $name.$pk_ids_file.".".$ext;
//echo "Dn: $dateiname";
copy($this->table_array[$column]["tmp"], $this->table_array[$column]["path"].$dateiname);
$file_name = $name.".".$ext;
//echo "Dn: $file_name";
copy($this->table_array[$column]["tmp"], $this->table_array[$column]["path"].$file_name);
// automatisch thumbnail generieren, geht nur mit convert (ImageMagic!!!), aber nur bei bild ..
if (strtolower($ext) == "jpeg" || strtolower($ext) == "jpg" || strtolower($ext) == "gif" || strtolower($ext) == "png") {
$dateiname_tn = $name.$pk_ids_file."_tn.".$ext;
$eingang = $this->table_array[$column]["path"].$dateiname;
$ausgang = $this->table_array[$column]["path"].$dateiname_tn;
$file_name_tn = $name."_tn.".$ext;
$eingang = $this->table_array[$column]["path"].$file_name;
$ausgang = $this->table_array[$column]["path"].$file_name_tn;
$com = "convert -geometry 115 $eingang $ausgang";
exec($com);
$this->table_array[$column]["value"] = $dateiname_tn;
$this->table_array[$column]["value"] = $file_name_tn;
} else {
$this->table_array[$column]["value"] = $dateiname;
$this->table_array[$column]["value"] = $file_name;
}
} elseif (file_exists($this->table_array[$column]["path"].$this->table_array[$column]["value"])) {
// mach gar nix, wenn bild schon da ???
@@ -546,4 +552,4 @@ class ArrayIO extends \CoreLibs\DB\IO
}
} // end of class
# __END__
// __END__

View File

@@ -511,6 +511,7 @@ class IO extends \CoreLibs\Basic
// NOTE : used in db_dump_data only
private function __printArray($array)
{
$string = '';
foreach ($array as $key => $value) {
$string .= $this->nbsp.'<b>'.$key.'</b> => ';
if (is_array($value)) {
@@ -977,6 +978,7 @@ class IO extends \CoreLibs\Basic
} else {
$array = $this->cursor_ext;
}
$string = '';
if (is_array($array)) {
$this->nbps = '';
$string .= $this->__printArray($array);
@@ -1816,6 +1818,7 @@ class IO extends \CoreLibs\Basic
// DESC : this is only needed for Postgresql. Converts postgresql arrays to PHP
public function dbArrayParse($text)
{
$output = array ();
return $this->db_functions->__dbArrayParse($text, $output);
}
@@ -2117,3 +2120,5 @@ class IO extends \CoreLibs\Basic
return $this->dbSqlEscape($value, $kbn);
}
} // end if db class
// __END__

View File

@@ -148,7 +148,7 @@ class PgSQL
{
$result = pg_execute($this->dbh, $name, $data);
if (!$result) {
$this->last_error_query = $query;
$this->last_error_query = $name;
}
return $result;
}
@@ -428,4 +428,4 @@ class PgSQL
}
}
# __END__
// __END__

View File

@@ -45,4 +45,4 @@ class CachedFileReader extends CoreLibs\Language\Core\StringReader
}
}
# __END__
// __END__

View File

@@ -88,4 +88,4 @@ class FileReader
}
}
# __END__
// __END__

View File

@@ -146,8 +146,8 @@ class GetTextReader
private function load_tables()
{
if (is_array($this->cache_translations) &&
is_array($this->table_originals) &&
is_array($this->table_translations)) {
is_array($this->table_originals) &&
is_array($this->table_translations)) {
return;
}
@@ -457,4 +457,4 @@ class GetTextReader
}
}
# __END__
// __END__

View File

@@ -51,4 +51,4 @@ class StreamReader
}
}
# __END__
// __END__

View File

@@ -64,4 +64,4 @@ class StringReader
}
}
# __END__
// __END__

View File

@@ -57,7 +57,6 @@ class L10n extends \CoreLibs\Basic
} else {
$this->input = false;
}
$this->l10n = new GetTextReader($this->input);
}
@@ -114,3 +113,5 @@ class L10n extends \CoreLibs\Basic
return $this->mofile;
}
}
// __END__

View File

@@ -323,7 +323,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
$this->table_array = array ();
}
reset($this->table_array);
$string .= "<b>TABLE ARRAY DUMP:</b> ".$this->table_name."<br>";
$string = "<b>TABLE ARRAY DUMP:</b> ".$this->table_name."<br>";
foreach ($this->table_array as $key => $value) {
$string .= "<b>$key</b>: ".$value["value"]."<br>";
}
@@ -557,7 +557,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
if ($res[$this->int_pk_name] == $this->table_array[$this->int_pk_name]["value"]) {
$pk_selected = $res[$this->int_pk_name];
}
unset($t_string);
$t_string = '';
for ($i = 0, $i_max = count($this->field_array); $i < $i_max; $i ++) {
if ($t_string) {
$t_string .= ", ";
@@ -1013,7 +1013,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
}
// do optional error checks like for normal fields
// currently active: unique/alphanumeric
if ($data_rray['error_check']) {
if ($data_array['error_check']) {
foreach (explode('|', $value["error_check"]) as $error_check) {
switch ($error_check) {
// check unique, check if field in table is not yet exist
@@ -1314,6 +1314,9 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// go through all submitted data
// for ($i = 0; $i < count($_POST[$el_name]); $i ++)
for ($i = 0; $i < $max; $i ++) {
$q_data[$i] = '';
$q_names[$i] = '';
$q_values[$i] = '';
// if we have enable name & delete set, then only insert/update those which are flagged as active
// check if mandatory field is set, if not set "do not write flag"
if ($data_array["mandatory"] && !$_POST[$prfx.$el_name][$i]) {
@@ -1718,4 +1721,4 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
}
} // end of class
# __END__
// __END__

View File

@@ -527,7 +527,7 @@ class ProgressBar
case 'percent':
// only one inner percent
// print "STYLE[$name]: ".$style_lbl."<br>";
if (!$html_percent) {
if (!isset($html_percent)) {
$html_percent = '<div id="plbl'.$name.$this->code.'" style="'.$style_lbl.'width:'.$data['width'].'px;line-height:1;text-shadow: 0 0 .2em white, 0 0 .5em white;">'.$this->__calculatePercent($this->step).'%</div>'."\n";
}
break;
@@ -669,4 +669,4 @@ class ProgressBar
}
}
# __END__
// __END__

View File

@@ -29,4 +29,4 @@ class SmartyExtend extends SmartyBC
}
}
# __END__
// __END__

View File

@@ -28,4 +28,4 @@ class qqUploadedFileForm
}
}
# __END__
// __END__

View File

@@ -43,4 +43,4 @@ class qqUploadedFileXhr
}
}
# __END__
// __END__

View File

@@ -109,4 +109,4 @@ class qqFileUploader
}
}
# __END__
// __END__

View File

@@ -108,3 +108,5 @@ function MyErrorHandler($type, $message, $file, $line, $context)
// init the error handler
set_error_handler("MyErrorHandler");
// __END__

View File

@@ -54,4 +54,4 @@ if (class_exists('Autoload', false) === false) {
spl_autoload_register('Autoloader\Autoload::load', true, true);
} // end check for already defined
# __END__
// __END__

1
www/log/.gitignore vendored
View File

@@ -1,2 +1,3 @@
*log
*LOG
!.gitignore