ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Security.php
Go to the documentation of this file.
1<?php
2
4
6
8{
14 private $lockRevision = false;
15
21 private $lockStructure = false;
22
28 private $lockWindows = false;
29
35 private $revisionsPassword = '';
36
42 private $workbookPassword = '';
43
47 public function __construct()
48 {
49 }
50
54 public function isSecurityEnabled(): bool
55 {
56 return $this->lockRevision ||
57 $this->lockStructure ||
59 }
60
61 public function getLockRevision(): bool
62 {
64 }
65
66 public function setLockRevision(?bool $pValue): self
67 {
68 if ($pValue !== null) {
69 $this->lockRevision = $pValue;
70 }
71
72 return $this;
73 }
74
75 public function getLockStructure(): bool
76 {
78 }
79
80 public function setLockStructure(?bool $pValue): self
81 {
82 if ($pValue !== null) {
83 $this->lockStructure = $pValue;
84 }
85
86 return $this;
87 }
88
89 public function getLockWindows(): bool
90 {
91 return $this->lockWindows;
92 }
93
94 public function setLockWindows(?bool $pValue): self
95 {
96 if ($pValue !== null) {
97 $this->lockWindows = $pValue;
98 }
99
100 return $this;
101 }
102
103 public function getRevisionsPassword(): string
104 {
106 }
107
108 public function setRevisionsPassword(?string $pValue, bool $pAlreadyHashed = false): self
109 {
110 if ($pValue !== null) {
111 if (!$pAlreadyHashed) {
112 $pValue = PasswordHasher::hashPassword($pValue);
113 }
114 $this->revisionsPassword = $pValue;
115 }
116
117 return $this;
118 }
119
120 public function getWorkbookPassword(): string
121 {
123 }
124
125 public function setWorkbookPassword(?string $pValue, bool $pAlreadyHashed = false): self
126 {
127 if ($pValue !== null) {
128 if (!$pAlreadyHashed) {
129 $pValue = PasswordHasher::hashPassword($pValue);
130 }
131 $this->workbookPassword = $pValue;
132 }
133
134 return $this;
135 }
136}
An exception for terminatinating execution or to throw for unit testing.
isSecurityEnabled()
Is some sort of document security enabled?
Definition: Security.php:54
__construct()
Create a new Document Security instance.
Definition: Security.php:47
setRevisionsPassword(?string $pValue, bool $pAlreadyHashed=false)
Definition: Security.php:108
setWorkbookPassword(?string $pValue, bool $pAlreadyHashed=false)
Definition: Security.php:125
static hashPassword(string $password, string $algorithm='', string $salt='', int $spinCount=10000)
Create a password hash from a given string by a specific algorithm.