| @@ 150-168 (lines=19) @@ | ||
| 147 | * @param string $password |
|
| 148 | * @throws \Exception |
|
| 149 | */ |
|
| 150 | protected function verifyPassword($password) { |
|
| 151 | // Let others verify the password |
|
| 152 | $accepted = true; |
|
| 153 | $message = ''; |
|
| 154 | \OCP\Util::emitHook('\OC\Share', 'verifyPassword', [ |
|
| 155 | 'password' => $password, |
|
| 156 | 'accepted' => &$accepted, |
|
| 157 | 'message' => &$message |
|
| 158 | ]); |
|
| 159 | ||
| 160 | if (!$accepted) { |
|
| 161 | throw new \Exception($message); |
|
| 162 | } |
|
| 163 | ||
| 164 | \OC::$server->getEventDispatcher()->dispatch( |
|
| 165 | 'OCP\Share::validatePassword', |
|
| 166 | new GenericEvent(null, ['password' => $password]) |
|
| 167 | ); |
|
| 168 | } |
|
| 169 | ||
| 170 | /** |
|
| 171 | * Check if a password must be enforced if the shared has those permissions |
|
| @@ 2863-2881 (lines=19) @@ | ||
| 2860 | * @param string $password |
|
| 2861 | * @throws \Exception |
|
| 2862 | */ |
|
| 2863 | private static function verifyPassword($password) { |
|
| 2864 | ||
| 2865 | $accepted = true; |
|
| 2866 | $message = ''; |
|
| 2867 | \OCP\Util::emitHook('\OC\Share', 'verifyPassword', [ |
|
| 2868 | 'password' => $password, |
|
| 2869 | 'accepted' => &$accepted, |
|
| 2870 | 'message' => &$message |
|
| 2871 | ]); |
|
| 2872 | ||
| 2873 | if (!$accepted) { |
|
| 2874 | throw new \Exception($message); |
|
| 2875 | } |
|
| 2876 | ||
| 2877 | \OC::$server->getEventDispatcher()->dispatch( |
|
| 2878 | 'OCP\Share::validatePassword', |
|
| 2879 | new GenericEvent(null, ['password' => $password]) |
|
| 2880 | ); |
|
| 2881 | } |
|
| 2882 | ||
| 2883 | /** |
|
| 2884 | * @param $user |
|