mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-10-04 18:19:18 +02:00
introduce option to disable vizhash for paranoid admins, resolves #20 point 2.4
This commit is contained in:
parent
20cf678a75
commit
ff0c55c0d6
5 changed files with 83 additions and 11 deletions
|
@ -174,16 +174,19 @@ class model_comment extends model_abstract
|
|||
if (!sjcl::isValid($nickname)) throw new Exception('Invalid data.', 66);
|
||||
$this->_data->meta->nickname = $nickname;
|
||||
|
||||
// Generation of the anonymous avatar (Vizhash):
|
||||
// If a nickname is provided, we generate a Vizhash.
|
||||
// (We assume that if the user did not enter a nickname, he/she wants
|
||||
// to be anonymous and we will not generate the vizhash.)
|
||||
$vh = new vizhash16x16();
|
||||
$pngdata = $vh->generate(trafficlimiter::getIp());
|
||||
if ($pngdata != '')
|
||||
if ($this->_conf->getKey('vizhash'))
|
||||
{
|
||||
$this->_data->meta->vizhash = 'data:image/png;base64,' . base64_encode($pngdata);
|
||||
// Generation of the anonymous avatar (Vizhash):
|
||||
// If a nickname is provided, we generate a Vizhash.
|
||||
// (We assume that if the user did not enter a nickname, he/she wants
|
||||
// to be anonymous and we will not generate the vizhash.)
|
||||
$vh = new vizhash16x16();
|
||||
$pngdata = $vh->generate(trafficlimiter::getIp());
|
||||
if ($pngdata != '')
|
||||
{
|
||||
$this->_data->meta->vizhash = 'data:image/png;base64,' . base64_encode($pngdata);
|
||||
}
|
||||
// Once the avatar is generated, we do not keep the IP address, nor its hash.
|
||||
}
|
||||
// Once the avatar is generated, we do not keep the IP address, nor its hash.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue