Update edit user base, config template, class basic

Class.Basic
add general 8 char hash wrapper function (for adler32, fnv, jooa)

Edit Users
add first/last name to the basic user info

Config template
Update config template from current working template
This commit is contained in:
Clemens Schwaighofer
2016-07-12 10:44:53 +09:00
parent 1c5bb8aebe
commit fa246dcfeb
5 changed files with 87 additions and 32 deletions

View File

@@ -230,6 +230,8 @@
$elements[] = $form->form_create_element("password"); $elements[] = $form->form_create_element("password");
$elements[] = $form->form_create_element("password_change_interval"); $elements[] = $form->form_create_element("password_change_interval");
$elements[] = $form->form_create_element("email"); $elements[] = $form->form_create_element("email");
$elements[] = $form->form_create_element("last_name");
$elements[] = $form->form_create_element("first_name");
$elements[] = $form->form_create_element("edit_group_id"); $elements[] = $form->form_create_element("edit_group_id");
$elements[] = $form->form_create_element("edit_access_right_id"); $elements[] = $form->form_create_element("edit_access_right_id");
$elements[] = $form->form_create_element("strict"); $elements[] = $form->form_create_element("strict");

View File

@@ -2,24 +2,24 @@
$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" => $GLOBALS["edit_user_id"],
"type" => "hidden", "type" => "hidden",
"pk" => 1, "pk" => 1,
"int" => 1 "int" => 1
), ),
"username" => array ( "username" => array (
"value" => $GLOBALS["username"], "value" => $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" => $GLOBALS["password"],
"HIDDEN_value" => $GLOBALS["HIDDEN_password"], "HIDDEN_value" => $GLOBALS["HIDDEN_password"],
"CONFIRM_value" => $GLOBALS["CONFIRM_password"], "CONFIRM_value" => $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
@@ -40,12 +40,12 @@
), ),
// 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
"enabled" => array ( "enabled" => array (
"value" => $GLOBALS["enabled"], "value" => $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"
) )
), ),
@@ -80,28 +80,38 @@
) )
), ),
"debug" => array ( "debug" => array (
"value" => $GLOBALS["debug"], "value" => $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" => $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" => $GLOBALS["email"],
"output_name" => "E-Mail", "output_name" => "E-Mail",
"type" => "text"
),
"last_name" => array (
"value" => $GLOBALS["last_name"],
"output_name" => "Last Name",
"type" => "text"
),
"first_name" => array (
"value" => $GLOBALS["first_name"],
"output_name" => "First Name",
"type" => "text" "type" => "text"
), ),
"edit_language_id" => array ( "edit_language_id" => array (

View File

@@ -258,12 +258,12 @@
{ {
// where to search for the files to include // where to search for the files to include
$dirs = array ( $dirs = array (
LIBDIR, LIBDIR,
SMARTYDIR, SMARTYDIR,
TABLEARRAYDIR, TABLEARRAYDIR,
'', '',
LIBS, LIBS,
SMARTY, SMARTY,
TABLE_ARRAYS, TABLE_ARRAYS,
__DIR__.'/'.LIBS, __DIR__.'/'.LIBS,
__DIR__.'/'.SMARTY __DIR__.'/'.SMARTY
@@ -279,5 +279,4 @@
} }
return false; return false;
} }
?> ?>

View File

@@ -1,10 +1,5 @@
<? <?
/******************************************************************** /********************************************************************
* $HeadURL: svn://svn/development/core_data/php/www/configs/config.template.inc $
* $LastChangedBy: gullevek $
* $LastChangedDate: 2013-02-18 16:27:24 +0900 (Mon, 18 Feb 2013) $
* $LastChangedRevision: 4382 $
*********************************************************************
* AUTHOR: Clemens "Gullevek" Schwaighofer (www.gullevek.org) * AUTHOR: Clemens "Gullevek" Schwaighofer (www.gullevek.org)
* CREATED: 2003/06/10 * CREATED: 2003/06/10
* SHORT DESCRIPTION: * SHORT DESCRIPTION:
@@ -24,6 +19,17 @@
DEFINE('DEFAULT_ENCODING', "UTF-8"); DEFINE('DEFAULT_ENCODING', "UTF-8");
/************* PATHS *********************/ /************* PATHS *********************/
// ** NEW/BETTER DIR DECLARATIONS **
// path to original file (if symlink)
DEFINE('DIR', __DIR__."/");
// libs base path based on DIR
DEFINE('LIBDIR', DIR.'libs/');
// SMARTY path based on DIR
DEFINE('SMARTYDIR', DIR.'Smarty/');
// table arrays for Class Form
DEFINE('TABLEARRAYDIR', DIR.'table_arrays/');
// ** OLD DIR DECLARATIONS **
// path to document root // path to document root
DEFINE('ROOT', getcwd()."/"); DEFINE('ROOT', getcwd()."/");
// libs path // libs path
@@ -230,6 +236,31 @@
// any other global definitons here // any other global definitons here
// DEFINE('SOME_ID', <SOME VALUE>); // DEFINE('SOME_ID', <SOME VALUE>);
// $Id: config.template.inc 4382 2013-02-18 07:27:24Z gullevek $ // function that will be called on top of each class include to load the class
function _spl_autoload($include_file)
{
// where to search for the files to include
$dirs = array (
LIBDIR,
SMARTYDIR,
TABLEARRAYDIR,
'',
LIBS,
SMARTY,
TABLE_ARRAYS,
__DIR__.'/'.LIBS,
__DIR__.'/'.SMARTY
);
// try to find and load the class ifle
foreach ($dirs as $folder)
{
if (file_exists($folder.$include_file))
{
require_once($folder.$include_file);
return true;
}
}
return false;
}
?> ?>

View File

@@ -1442,6 +1442,19 @@
return $this->_crc32b($string); return $this->_crc32b($string);
} }
// METHOD: _hash
// PARAMS: string, type of hash to use
// RETURN: hashed string
// DESC : replacemend for _crc32b call (alternate)
// defaults to adler 32, fnv132, fnv1a32, joaat
// all that create 8 char long hashes
public function _hash($string, $hash_type = 'adler32')
{
if (!in_array($hash_type, array('adler32', 'fnv132', 'fnv1a32', 'joaat')))
$hash_type = 'adler32';
return hash($hash_type, $string);
}
// METHOD: checkPHPVersion // METHOD: checkPHPVersion
// PARAMS: $min_version: minimum version. in format x, x.y or x.y.z // PARAMS: $min_version: minimum version. in format x, x.y or x.y.z
// $max_version: default empty, else in same format as min version // $max_version: default empty, else in same format as min version