$password = '{SSHA512}' . base64_encode(hash('sha512', $password . $salt). $salt);
return $password;
}
+
public function ssha_password($password='') {
if (empty($password)) return $password;
$salt = substr(str_shuffle(str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',4)),0,4);
$password = '{SSHA}' . base64_encode(sha1( $password.$salt, TRUE ). $salt);
return $password;
}
- #public function default_table() { return $this->default_table; }
+
} # < Class
?>
$id = preg_replace('/[^\w\._-]/','',$id);
$file = TABLE_TEMPLATE.'/'.$id.'.php';
- if (!is_readable($file)) return false; #self::bye("Wrong id `$id`");
+ if (!is_readable($file)) return false; #$this->bye("Wrong id `$id`");
# NB 02.12.16 $o['file'] = $file;
$this->__file = $file;
$this->__fields = array_keys($fields);
private function template_id($id=null) {
if (empty($id)
- and !( $id=self::p('table.template.id') )
- and !( $id=self::p('idtemplate') )
+ and !( $id=$this->p('table.template.id') )
+ and !( $id=$this->p('idtemplate') )
and !( $id = $this->template_id )
- ) self::bye('Wrong parameter!');
+ ) $this->bye('Wrong parameter!');
return $id;
}
$id = preg_replace('/[^\w\._-]/','',$id);
$file = TABLE_TEMPLATE.'/'.$id.'.php';
- if (!is_readable($file)) return false; #self::bye("Wrong id `$id`");
+ if (!is_readable($file)) return false; #$this->bye("Wrong id `$id`");
$opt = [ 'format'=> '' ];
$this->rows($opt);
public function ssha_password($password) {
return $this->db()->ssha_password($password);
}
+
+ static public function _bye($msg = '__bye__', $backtrace_deep = 0) {
+ die($msg);
+ }
+
} # < Class
__table_define();
?>
# NB 30.10.17 return bye($msg,$backtrace_deep+1);
# NB 30.10.17 }
# # NB 30.10.17: From function.php
- public function bye($msg='__bye__',$backtrace_deep=0) {
+ public static function bye($msg='__bye__',$backtrace_deep=0) {
#if ($msg) err($msg,'bye',$backtrace_deep === 0 ? 1 : $backtrace_deep);
if ($msg!=='__bye__') {