function adduser($name, $password, $record = null, $authorisation = 1) { $hash = phash($password); $username = amd5($name); if (!is_null($this->db->getRowUH('users', 'name', $username))) { return false; } return $this->db->addRow('users', 'name, password, record, authorisation', 'UNHEX(\'' . $username . '\'), \'' . $hash . '\', \'' . $record . '\', \'' . $authorisation . '\''); }
function __construct($data = null, $file = null) { global $l; //$l->a('Creating new Csum.<br>'); if (!is_null($data)) { $this->len = strlen($data); $this->md5 = amd5($data); $this->sha = sha($data); $this->s512 = s512($data); } else { if (is_null($file)) { $this->len = null; $this->md5 = null; $this->sha = null; $this->s512 = null; } else { $this->len = filesize($file); $this->md5 = amd5f($file); $this->sha = shaf($file); $this->s512 = s512f($file); } } }