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
This commit is contained in:
@@ -28,10 +28,12 @@
|
||||
|
||||
// set + check edit access id
|
||||
$edit_access_id = 3;
|
||||
print "ACL UNIT: ".print_r(array_keys($login->acl['unit']), 1)."<br>";
|
||||
print "ACCESS CHECK: ".$login->login_check_edit_access($edit_access_id)."<br>";
|
||||
if ($login->login_check_edit_access($edit_access_id))
|
||||
$basic->edit_access_id = $edit_access_id;
|
||||
else
|
||||
$basic->edit_access_id = $login->acl['info']['default_edit_access'];
|
||||
$basic->edit_access_id = $login->acl['unit_id'];
|
||||
|
||||
// $basic->debug('SESSION', $basic->print_ar($_SESSION));
|
||||
|
||||
|
||||
@@ -1081,6 +1081,20 @@
|
||||
return $number;
|
||||
}
|
||||
|
||||
// METHOD: DateStringFormat
|
||||
// PARAMS: unix timestamp, true/false to show microtime
|
||||
// RETURN: string formated date+time in Y-M-D h:m:s
|
||||
// DESC : a simple wrapper for the date format
|
||||
public static function DateStringFormat($timestamp, $show_micro = true)
|
||||
{
|
||||
list ($timestamp, $ms) = explode('.', round($timestamp, 4));
|
||||
if ($show_micro)
|
||||
$string = date("Y-m-d H:i:s", $timestamp).' '.$ms.'ms';
|
||||
else
|
||||
$string = date("Y-m-d H:i:s", $timestamp);
|
||||
return $string;
|
||||
}
|
||||
|
||||
// METHOD: TimeStringFormat
|
||||
// PARAMS: seconds
|
||||
// RETURN: formated time string
|
||||
|
||||
@@ -641,7 +641,7 @@
|
||||
// DESC : checks if this edit access id is valid
|
||||
public function login_check_edit_access($edit_access_id)
|
||||
{
|
||||
if (array_key_exists($edit_access_id, $this->acl['info']['edit_access']))
|
||||
if (array_key_exists($edit_access_id, $this->acl['unit']))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user