Commit Graph

79 Commits

Author SHA1 Message Date
Clemens Schwaighofer
02d1d03c15 Fix long lines, fix timestamp method, fix db error to warning
DB IO: On multiple PK return it say DB_ERROR, but this is actually a
warning DB_WARNING
Login: fix long lines and make SCHEMA set better with if instead of
terinary
Basic: fix string to time with loop over array parts and not for loop
2018-06-04 18:53:28 +09:00
Clemens Schwaighofer
c21e194eaf Add proper PHP password management
The old crypt based password methods are all deprecated and the new
password_* are now standard.

Also added auto rehash for old password on login
2018-05-09 11:34:40 +09:00
Clemens Schwaighofer
0f483a2d20 description for session/log id define, better error check for no pk id
PK ID return check if not set is checked correctly in normal execute
The SET_SESSION_NAME and LOG_FILE_ID get commented out in settings as
they should be rather set per file or in header
2018-04-24 10:04:51 +09:00
Clemens Schwaighofer
bf5486a59e Switch php code tag, fix php code
all files use <?php for code tag open
fix various bugs & speed problems. eg switch from while (each ...) to
foreach, ...
2018-04-03 16:39:57 +09:00
Clemens Schwaighofer
8151c05d91 Class namespace change testing
- move auto loader to lib/ folder (so it doesn't exist in document root)
- Fix a lot of old method names in DB\IO and Form\General, etc
- Fix login with non existing DB set (abort -> exit)
- add getDbEncoding call to DB\IO
2018-03-27 18:01:10 +09:00
7d42256a30 PHP CodeStandard update
- all if/while/for/etc blocks have brackets on same line
- functions have brackets on new line
- no blocks without brackets
- all code starts on col 0 and there are no tab intends anymore

off: came case for classes and class methods
ignore: _ prefix functions (we can't change that anymore)
2018-03-15 17:38:33 +09:00
Clemens Schwaighofer
d9df0d64b8 Class DB IO, fix for trailing ; with RETURNING
If an INSERT query has no RETURNING but ; at the end, the RETURNING was
added after the ;

The ; is now stripped before adding RETURNING
2018-02-08 10:58:53 +09:00
Clemens Schwaighofer
c39e48a709 Bug fix Class DB IO data write function
The data write function did not write data correctly if it was empty or
null. Especially for boolean ones when set 0 was set NULL and not 'f'.

This is fixed now.
Also filles MUST set not null fields with 0/'' but does not add missing
column to list yet
2017-10-24 16:51:21 +09:00
Clemens Schwaighofer
1cc010818d Fix DB IO write array method
Data was not written correctly in connection with boolean field types as
the "has default" was used as if a default value, but it is just a flag
IF it has a default value
2017-09-26 13:33:52 +09:00
Clemens Schwaighofer
9f7ab65a15 Update Basic, DB IO, Login class
- DB IO: update the write data method to update data that is empty (aka
null) and not skip it (aka never unset data)
- Basic: add date time compare method based on strtotime
- Login: ACL for page level check if array is set before setting
anything
2017-09-07 18:24:52 +09:00
Clemens Schwaighofer
f7685463b4 error log ID settings added via global define
A global define for LOG_FILE_ID before any class is initialized (or any
place later allowed too) will add a sub id to the error_msg log file
before any other (level, class, etc) id.

This can be used to easily split between frontend and backend logs or
logs for a certain page without using pagename (eg to group all ajax
logs into one)
2017-04-11 10:25:07 +09:00
Clemens Schwaighofer
6606f30ceb Basic date compare fix
The date compare now uses correct preg_split for splitting with - and /
as date separators
2017-04-03 17:52:49 +09:00
Clemens Schwaighofer
d64e40ca2c Second fix for returning with multiple entries in DB IO
- all data stored in array (size contrain needs to be checked)
- allows any returning data
- only named rows are returned (no numbers for column access)
- if multiple rows then insert_id is an array with the return data
- if single row the insert_id holds the PK, and insert_id_ext holds
extended data if exists
2017-03-14 15:19:31 +09:00
Clemens Schwaighofer
d7a6abd5b9 Class DB IO: multiple insert returning now works
If an INSERT had multiple inserts (values) the returning only returned
the first one and never the other ones.

This is fxed now.

If only ONE. then insert_id is scalar, else it is an array with all the
data in a flat array
2017-03-14 13:33:04 +09:00
Clemens Schwaighofer
03be3a317f Change the logging file name set
The date part is not set external, but internal via a flag.
The file name extension cannot be set anymore and the file_name_ext has
been removed and is now log_file_name_ext and privte.

This is a drop in solution and can be used with previous settings.

Changes that should be done:
Class.Login: remove the file name ext and replace it with log_per_class
= 1
Remove all file_name_ext entries as they area not needed anymore
2017-02-22 10:18:53 +09:00
Clemens Schwaighofer
bdcd83c579 Generic table update 2017-02-16 10:29:50 +09:00
Clemens Schwaighofer
a2129f91c5 White space fixes 2016-08-31 15:20:40 +09:00
Clemens Schwaighofer
adf46f620b Update class basic, bug fixes for acl unit set in login class
class basic has a simple date string format method. returns Y-m-d h:i:s
for a trimestring, optional microseconds too
bug fix for unit/edit access id check in login class
2016-08-27 13:28:42 +09:00
Clemens Schwaighofer
b2fdbc0571 Better autoload for required files
Add autoload function to main config file.
Add better DIR declarations in config file based on __DIR__ for libs &
smarty classes.
Load all class files with the new autoload function in header & direct
file calls.
2015-11-11 14:14:06 +09:00
Clemens Schwaighofer
ae1ef182ef Update Core libs to avoid notice errors, add debug override switch
$DEBUG_ALL_OVERRIDE added to not override the set
$DEBUG_ALL/$PRINT_ALL/etc switches on one script.

Fix various notice bugs on very strict PHP setups.
2015-11-06 11:43:01 +09:00
Clemens Schwaighofer
474d6810f4 JQuery library update, class test update
Add test for time to string and string to time convert functions
2015-03-26 11:26:39 +09:00
Clemens Schwaighofer
c1dca67176 Update to core classes, see detail below
- config.inc: add define for show/not show all errors when parsning
  through Error.Handling.inc with SHOW_ALL_ERRORS
- Error.Handling.inc: check php error level and do not show ones that
  are not flagged unless SHOW_ALL_ERRORS is set to true
- db_pgsql.inc for fetch array, call the internal wrapper method, not
  the pg method directly
- db_pgsql_pdo.inc: test insert for alternative with pdo lib instead of
  php internal postgresql interface
- Class.DB.IO.inc: on prepared check if cursor exist before returing
  inserted id in INSERT queries. fail if no insert id could be aquired
  if there was no cursor (or other error)
- Class.Basic.inc: rewrite Time to string method for speed up and
  removal of old php microtime format
2015-03-05 16:59:05 +09:00
Clemens Schwaighofer
7ea35c2e61 Fix depricated /e for magic links regex callback. 2014-03-11 09:36:49 +09:00
Clemens Schwaighofer
db4d386fb2 Remove all Subversion keywords 2014-02-06 17:17:01 +09:00
Clemens Schwaighofer
2dd286b25e Remove not needed empty line 2014-01-30 17:36:56 +09:00
Clemens Schwaighofer
0658514e2e fixed bug in db async call if the query had an error, the error was not
cought and not reported back
2014-01-23 12:04:05 +09:00
Clemens Schwaighofer
1f7cab6241 fixed bug in getting primary key name if the table is in a different
schema to the current one
 * check current schema and set prefix to table if needed
 * check that if cursor is null we do not try to get any data but return false
2014-01-20 12:27:15 +09:00
Clemens Schwaighofer
2327fcb68f - update Basic class to automatically set the session
- update Login class to init basic class before session check
- add form token set/validate methos in basic class
- remove old smarty 3.1.14
2014-01-07 11:52:01 +09:00
7285d3947c PHP Core Libraries
- add .gitignore for log, templates_c and tmp
- add base www/ folder
2013-12-11 15:52:08 +09:00