|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @author Sujith Haridasan <[email protected]> |
|
4
|
|
|
* |
|
5
|
|
|
* @copyright Copyright (c) 2018, ownCloud GmbH |
|
6
|
|
|
* @license AGPL-3.0 |
|
7
|
|
|
* |
|
8
|
|
|
* This code is free software: you can redistribute it and/or modify |
|
9
|
|
|
* it under the terms of the GNU Affero General Public License, version 3, |
|
10
|
|
|
* as published by the Free Software Foundation. |
|
11
|
|
|
* |
|
12
|
|
|
* This program is distributed in the hope that it will be useful, |
|
13
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15
|
|
|
* GNU Affero General Public License for more details. |
|
16
|
|
|
* |
|
17
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3, |
|
18
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|
19
|
|
|
* |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
namespace OCP\User; |
|
23
|
|
|
|
|
24
|
|
|
use Symfony\Component\EventDispatcher\Event; |
|
25
|
|
|
|
|
26
|
|
|
class UserPasswordCreateEvent extends Event { |
|
27
|
|
|
const CREATE_PASSWORD = 'OCP\User::createPassword'; |
|
28
|
|
|
|
|
29
|
|
|
/** @var string event name */ |
|
30
|
|
|
protected $event; |
|
31
|
|
|
/** @var array data*/ |
|
32
|
|
|
protected $data; |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* UserPasswordCreateEvent constructor. |
|
36
|
|
|
* |
|
37
|
|
|
* @param string $event |
|
38
|
|
|
* @param array $data |
|
39
|
|
|
*/ |
|
40
|
|
|
public function __construct($event, $data = []) { |
|
41
|
|
|
$this->event = $event; |
|
42
|
|
|
$this->data = $data; |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* @return string |
|
47
|
|
|
*/ |
|
48
|
|
|
public function getEvent() { |
|
49
|
|
|
return $this->event; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @return array |
|
54
|
|
|
*/ |
|
55
|
|
|
public function getData() { |
|
56
|
|
|
return $this->data; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @param string $password |
|
61
|
|
|
*/ |
|
62
|
|
|
public function setPassword($password) { |
|
63
|
|
|
$this->data['password'] = $password; |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @return bool|mixed |
|
68
|
|
|
*/ |
|
69
|
|
|
public function getPassword() { |
|
70
|
|
|
if (isset($this->data['password'])) { |
|
71
|
|
|
return $this->data['password']; |
|
72
|
|
|
} |
|
73
|
|
|
return false; |
|
74
|
|
|
} |
|
75
|
|
|
} |