Allow name change

This commit is contained in:
Sándor 2021-09-20 12:29:59 +02:00
parent a3768e996d
commit f120fb88d3

View File

@ -89,7 +89,8 @@ class ninjaMailSubscription extends ninjaMail
{ {
private $list; private $list;
private $activated = false; private $activated = 0;
private $forcenamechange = 0;
public function list($id) public function list($id)
{ {
@ -103,11 +104,18 @@ class ninjaMailSubscription extends ninjaMail
public function activated($s) public function activated($s)
{ {
if ($s) $this->activated = 1; if ($s) $this->activated = 1;
else $this->activated = 0; else $this->activated = 0;
return true; return true;
} }
public function namechange($s)
{
if ($s) $this->forcenamechange = 1;
else $this->forcenamechange = 0;
return true;
}
public function subscribe($email, $name = '') public function subscribe($email, $name = '')
{ {
if (!$this->list || !is_numeric($this->activated)) if (!$this->list || !is_numeric($this->activated))
@ -117,7 +125,8 @@ class ninjaMailSubscription extends ninjaMail
'list' => $this->list, 'list' => $this->list,
'name' => $name, 'name' => $name,
'email' => $email, 'email' => $email,
'activated' => $this->activated 'activated' => $this->activated,
'forcenamechange' => $this->forcenamechange
]; ];
return $this->process('subscribe', $post, true)->status == 'success' ? true : false; return $this->process('subscribe', $post, true)->status == 'success' ? true : false;
} }