@@ -28,56 +28,56 @@ |
||
28 | 28 | * @since 9.0.0 |
29 | 29 | */ |
30 | 30 | interface IWatcher { |
31 | - public const CHECK_NEVER = 0; // never check the underlying filesystem for updates |
|
32 | - public const CHECK_ONCE = 1; // check the underlying filesystem for updates once every request for each file |
|
33 | - public const CHECK_ALWAYS = 2; // always check the underlying filesystem for updates |
|
31 | + public const CHECK_NEVER = 0; // never check the underlying filesystem for updates |
|
32 | + public const CHECK_ONCE = 1; // check the underlying filesystem for updates once every request for each file |
|
33 | + public const CHECK_ALWAYS = 2; // always check the underlying filesystem for updates |
|
34 | 34 | |
35 | - /** |
|
36 | - * @param int $policy either IWatcher::CHECK_NEVER, IWatcher::CHECK_ONCE, IWatcher::CHECK_ALWAYS |
|
37 | - * @since 9.0.0 |
|
38 | - */ |
|
39 | - public function setPolicy($policy); |
|
35 | + /** |
|
36 | + * @param int $policy either IWatcher::CHECK_NEVER, IWatcher::CHECK_ONCE, IWatcher::CHECK_ALWAYS |
|
37 | + * @since 9.0.0 |
|
38 | + */ |
|
39 | + public function setPolicy($policy); |
|
40 | 40 | |
41 | - /** |
|
42 | - * @return int either IWatcher::CHECK_NEVER, IWatcher::CHECK_ONCE, IWatcher::CHECK_ALWAYS |
|
43 | - * @since 9.0.0 |
|
44 | - */ |
|
45 | - public function getPolicy(); |
|
41 | + /** |
|
42 | + * @return int either IWatcher::CHECK_NEVER, IWatcher::CHECK_ONCE, IWatcher::CHECK_ALWAYS |
|
43 | + * @since 9.0.0 |
|
44 | + */ |
|
45 | + public function getPolicy(); |
|
46 | 46 | |
47 | - /** |
|
48 | - * check $path for updates and update if needed |
|
49 | - * |
|
50 | - * @param string $path |
|
51 | - * @param ICacheEntry|null $cachedEntry |
|
52 | - * @return boolean true if path was updated |
|
53 | - * @since 9.0.0 |
|
54 | - */ |
|
55 | - public function checkUpdate($path, $cachedEntry = null); |
|
47 | + /** |
|
48 | + * check $path for updates and update if needed |
|
49 | + * |
|
50 | + * @param string $path |
|
51 | + * @param ICacheEntry|null $cachedEntry |
|
52 | + * @return boolean true if path was updated |
|
53 | + * @since 9.0.0 |
|
54 | + */ |
|
55 | + public function checkUpdate($path, $cachedEntry = null); |
|
56 | 56 | |
57 | - /** |
|
58 | - * Update the cache for changes to $path |
|
59 | - * |
|
60 | - * @param string $path |
|
61 | - * @param ICacheEntry $cachedData |
|
62 | - * @since 9.0.0 |
|
63 | - */ |
|
64 | - public function update($path, $cachedData); |
|
57 | + /** |
|
58 | + * Update the cache for changes to $path |
|
59 | + * |
|
60 | + * @param string $path |
|
61 | + * @param ICacheEntry $cachedData |
|
62 | + * @since 9.0.0 |
|
63 | + */ |
|
64 | + public function update($path, $cachedData); |
|
65 | 65 | |
66 | - /** |
|
67 | - * Check if the cache for $path needs to be updated |
|
68 | - * |
|
69 | - * @param string $path |
|
70 | - * @param ICacheEntry $cachedData |
|
71 | - * @return bool |
|
72 | - * @since 9.0.0 |
|
73 | - */ |
|
74 | - public function needsUpdate($path, $cachedData); |
|
66 | + /** |
|
67 | + * Check if the cache for $path needs to be updated |
|
68 | + * |
|
69 | + * @param string $path |
|
70 | + * @param ICacheEntry $cachedData |
|
71 | + * @return bool |
|
72 | + * @since 9.0.0 |
|
73 | + */ |
|
74 | + public function needsUpdate($path, $cachedData); |
|
75 | 75 | |
76 | - /** |
|
77 | - * remove deleted files in $path from the cache |
|
78 | - * |
|
79 | - * @param string $path |
|
80 | - * @since 9.0.0 |
|
81 | - */ |
|
82 | - public function cleanFolder($path); |
|
76 | + /** |
|
77 | + * remove deleted files in $path from the cache |
|
78 | + * |
|
79 | + * @param string $path |
|
80 | + * @since 9.0.0 |
|
81 | + */ |
|
82 | + public function cleanFolder($path); |
|
83 | 83 | } |
@@ -29,28 +29,28 @@ |
||
29 | 29 | * @since 12.0.0 |
30 | 30 | */ |
31 | 31 | interface IChange { |
32 | - public const ADDED = 1; |
|
33 | - public const REMOVED = 2; |
|
34 | - public const MODIFIED = 3; |
|
35 | - public const RENAMED = 4; |
|
32 | + public const ADDED = 1; |
|
33 | + public const REMOVED = 2; |
|
34 | + public const MODIFIED = 3; |
|
35 | + public const RENAMED = 4; |
|
36 | 36 | |
37 | - /** |
|
38 | - * Get the type of the change |
|
39 | - * |
|
40 | - * @return int IChange::ADDED, IChange::REMOVED, IChange::MODIFIED or IChange::RENAMED |
|
41 | - * |
|
42 | - * @since 12.0.0 |
|
43 | - */ |
|
44 | - public function getType(); |
|
37 | + /** |
|
38 | + * Get the type of the change |
|
39 | + * |
|
40 | + * @return int IChange::ADDED, IChange::REMOVED, IChange::MODIFIED or IChange::RENAMED |
|
41 | + * |
|
42 | + * @since 12.0.0 |
|
43 | + */ |
|
44 | + public function getType(); |
|
45 | 45 | |
46 | - /** |
|
47 | - * Get the path of the file that was changed relative to the root of the storage |
|
48 | - * |
|
49 | - * Note, for rename changes this path is the old path for the file |
|
50 | - * |
|
51 | - * @return mixed |
|
52 | - * |
|
53 | - * @since 12.0.0 |
|
54 | - */ |
|
55 | - public function getPath(); |
|
46 | + /** |
|
47 | + * Get the path of the file that was changed relative to the root of the storage |
|
48 | + * |
|
49 | + * Note, for rename changes this path is the old path for the file |
|
50 | + * |
|
51 | + * @return mixed |
|
52 | + * |
|
53 | + * @since 12.0.0 |
|
54 | + */ |
|
55 | + public function getPath(); |
|
56 | 56 | } |
@@ -44,50 +44,50 @@ |
||
44 | 44 | * @since 6.0.0 - since 8.2.1 based on HintException |
45 | 45 | */ |
46 | 46 | class StorageNotAvailableException extends HintException { |
47 | - public const STATUS_SUCCESS = 0; |
|
48 | - public const STATUS_ERROR = 1; |
|
49 | - public const STATUS_INDETERMINATE = 2; |
|
50 | - public const STATUS_INCOMPLETE_CONF = 3; |
|
51 | - public const STATUS_UNAUTHORIZED = 4; |
|
52 | - public const STATUS_TIMEOUT = 5; |
|
53 | - public const STATUS_NETWORK_ERROR = 6; |
|
47 | + public const STATUS_SUCCESS = 0; |
|
48 | + public const STATUS_ERROR = 1; |
|
49 | + public const STATUS_INDETERMINATE = 2; |
|
50 | + public const STATUS_INCOMPLETE_CONF = 3; |
|
51 | + public const STATUS_UNAUTHORIZED = 4; |
|
52 | + public const STATUS_TIMEOUT = 5; |
|
53 | + public const STATUS_NETWORK_ERROR = 6; |
|
54 | 54 | |
55 | - /** |
|
56 | - * StorageNotAvailableException constructor. |
|
57 | - * |
|
58 | - * @param string $message |
|
59 | - * @param int $code |
|
60 | - * @param \Exception|null $previous |
|
61 | - * @since 6.0.0 |
|
62 | - */ |
|
63 | - public function __construct($message = '', $code = self::STATUS_ERROR, \Exception $previous = null) { |
|
64 | - $l = \OC::$server->getL10N('core'); |
|
65 | - parent::__construct($message, $l->t('Storage is temporarily not available'), $code, $previous); |
|
66 | - } |
|
55 | + /** |
|
56 | + * StorageNotAvailableException constructor. |
|
57 | + * |
|
58 | + * @param string $message |
|
59 | + * @param int $code |
|
60 | + * @param \Exception|null $previous |
|
61 | + * @since 6.0.0 |
|
62 | + */ |
|
63 | + public function __construct($message = '', $code = self::STATUS_ERROR, \Exception $previous = null) { |
|
64 | + $l = \OC::$server->getL10N('core'); |
|
65 | + parent::__construct($message, $l->t('Storage is temporarily not available'), $code, $previous); |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * Get the name for a status code |
|
70 | - * |
|
71 | - * @param int $code |
|
72 | - * @return string |
|
73 | - * @since 9.0.0 |
|
74 | - */ |
|
75 | - public static function getStateCodeName($code) { |
|
76 | - switch ($code) { |
|
77 | - case self::STATUS_SUCCESS: |
|
78 | - return 'ok'; |
|
79 | - case self::STATUS_ERROR: |
|
80 | - return 'error'; |
|
81 | - case self::STATUS_INDETERMINATE: |
|
82 | - return 'indeterminate'; |
|
83 | - case self::STATUS_UNAUTHORIZED: |
|
84 | - return 'unauthorized'; |
|
85 | - case self::STATUS_TIMEOUT: |
|
86 | - return 'timeout'; |
|
87 | - case self::STATUS_NETWORK_ERROR: |
|
88 | - return 'network error'; |
|
89 | - default: |
|
90 | - return 'unknown'; |
|
91 | - } |
|
92 | - } |
|
68 | + /** |
|
69 | + * Get the name for a status code |
|
70 | + * |
|
71 | + * @param int $code |
|
72 | + * @return string |
|
73 | + * @since 9.0.0 |
|
74 | + */ |
|
75 | + public static function getStateCodeName($code) { |
|
76 | + switch ($code) { |
|
77 | + case self::STATUS_SUCCESS: |
|
78 | + return 'ok'; |
|
79 | + case self::STATUS_ERROR: |
|
80 | + return 'error'; |
|
81 | + case self::STATUS_INDETERMINATE: |
|
82 | + return 'indeterminate'; |
|
83 | + case self::STATUS_UNAUTHORIZED: |
|
84 | + return 'unauthorized'; |
|
85 | + case self::STATUS_TIMEOUT: |
|
86 | + return 'timeout'; |
|
87 | + case self::STATUS_NETWORK_ERROR: |
|
88 | + return 'network error'; |
|
89 | + default: |
|
90 | + return 'unknown'; |
|
91 | + } |
|
92 | + } |
|
93 | 93 | } |
@@ -27,27 +27,27 @@ |
||
27 | 27 | * @since 12.0.0 |
28 | 28 | */ |
29 | 29 | interface ISearchBinaryOperator extends ISearchOperator { |
30 | - public const OPERATOR_AND = 'and'; |
|
31 | - public const OPERATOR_OR = 'or'; |
|
32 | - public const OPERATOR_NOT = 'not'; |
|
30 | + public const OPERATOR_AND = 'and'; |
|
31 | + public const OPERATOR_OR = 'or'; |
|
32 | + public const OPERATOR_NOT = 'not'; |
|
33 | 33 | |
34 | - /** |
|
35 | - * The type of binary operator |
|
36 | - * |
|
37 | - * One of the ISearchBinaryOperator::OPERATOR_* constants |
|
38 | - * |
|
39 | - * @return string |
|
40 | - * @since 12.0.0 |
|
41 | - */ |
|
42 | - public function getType(); |
|
34 | + /** |
|
35 | + * The type of binary operator |
|
36 | + * |
|
37 | + * One of the ISearchBinaryOperator::OPERATOR_* constants |
|
38 | + * |
|
39 | + * @return string |
|
40 | + * @since 12.0.0 |
|
41 | + */ |
|
42 | + public function getType(); |
|
43 | 43 | |
44 | - /** |
|
45 | - * The arguments for the binary operator |
|
46 | - * |
|
47 | - * One argument for the 'not' operator and two for 'and' and 'or' |
|
48 | - * |
|
49 | - * @return ISearchOperator[] |
|
50 | - * @since 12.0.0 |
|
51 | - */ |
|
52 | - public function getArguments(); |
|
44 | + /** |
|
45 | + * The arguments for the binary operator |
|
46 | + * |
|
47 | + * One argument for the 'not' operator and two for 'and' and 'or' |
|
48 | + * |
|
49 | + * @return ISearchOperator[] |
|
50 | + * @since 12.0.0 |
|
51 | + */ |
|
52 | + public function getArguments(); |
|
53 | 53 | } |
@@ -34,63 +34,63 @@ |
||
34 | 34 | * @since 6.0.0 |
35 | 35 | */ |
36 | 36 | class Http { |
37 | - public const STATUS_CONTINUE = 100; |
|
38 | - public const STATUS_SWITCHING_PROTOCOLS = 101; |
|
39 | - public const STATUS_PROCESSING = 102; |
|
40 | - public const STATUS_OK = 200; |
|
41 | - public const STATUS_CREATED = 201; |
|
42 | - public const STATUS_ACCEPTED = 202; |
|
43 | - public const STATUS_NON_AUTHORATIVE_INFORMATION = 203; |
|
44 | - public const STATUS_NO_CONTENT = 204; |
|
45 | - public const STATUS_RESET_CONTENT = 205; |
|
46 | - public const STATUS_PARTIAL_CONTENT = 206; |
|
47 | - public const STATUS_MULTI_STATUS = 207; |
|
48 | - public const STATUS_ALREADY_REPORTED = 208; |
|
49 | - public const STATUS_IM_USED = 226; |
|
50 | - public const STATUS_MULTIPLE_CHOICES = 300; |
|
51 | - public const STATUS_MOVED_PERMANENTLY = 301; |
|
52 | - public const STATUS_FOUND = 302; |
|
53 | - public const STATUS_SEE_OTHER = 303; |
|
54 | - public const STATUS_NOT_MODIFIED = 304; |
|
55 | - public const STATUS_USE_PROXY = 305; |
|
56 | - public const STATUS_RESERVED = 306; |
|
57 | - public const STATUS_TEMPORARY_REDIRECT = 307; |
|
58 | - public const STATUS_BAD_REQUEST = 400; |
|
59 | - public const STATUS_UNAUTHORIZED = 401; |
|
60 | - public const STATUS_PAYMENT_REQUIRED = 402; |
|
61 | - public const STATUS_FORBIDDEN = 403; |
|
62 | - public const STATUS_NOT_FOUND = 404; |
|
63 | - public const STATUS_METHOD_NOT_ALLOWED = 405; |
|
64 | - public const STATUS_NOT_ACCEPTABLE = 406; |
|
65 | - public const STATUS_PROXY_AUTHENTICATION_REQUIRED = 407; |
|
66 | - public const STATUS_REQUEST_TIMEOUT = 408; |
|
67 | - public const STATUS_CONFLICT = 409; |
|
68 | - public const STATUS_GONE = 410; |
|
69 | - public const STATUS_LENGTH_REQUIRED = 411; |
|
70 | - public const STATUS_PRECONDITION_FAILED = 412; |
|
71 | - public const STATUS_REQUEST_ENTITY_TOO_LARGE = 413; |
|
72 | - public const STATUS_REQUEST_URI_TOO_LONG = 414; |
|
73 | - public const STATUS_UNSUPPORTED_MEDIA_TYPE = 415; |
|
74 | - public const STATUS_REQUEST_RANGE_NOT_SATISFIABLE = 416; |
|
75 | - public const STATUS_EXPECTATION_FAILED = 417; |
|
76 | - public const STATUS_IM_A_TEAPOT = 418; |
|
77 | - public const STATUS_UNPROCESSABLE_ENTITY = 422; |
|
78 | - public const STATUS_LOCKED = 423; |
|
79 | - public const STATUS_FAILED_DEPENDENCY = 424; |
|
80 | - public const STATUS_UPGRADE_REQUIRED = 426; |
|
81 | - public const STATUS_PRECONDITION_REQUIRED = 428; |
|
82 | - public const STATUS_TOO_MANY_REQUESTS = 429; |
|
83 | - public const STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; |
|
84 | - public const STATUS_INTERNAL_SERVER_ERROR = 500; |
|
85 | - public const STATUS_NOT_IMPLEMENTED = 501; |
|
86 | - public const STATUS_BAD_GATEWAY = 502; |
|
87 | - public const STATUS_SERVICE_UNAVAILABLE = 503; |
|
88 | - public const STATUS_GATEWAY_TIMEOUT = 504; |
|
89 | - public const STATUS_HTTP_VERSION_NOT_SUPPORTED = 505; |
|
90 | - public const STATUS_VARIANT_ALSO_NEGOTIATES = 506; |
|
91 | - public const STATUS_INSUFFICIENT_STORAGE = 507; |
|
92 | - public const STATUS_LOOP_DETECTED = 508; |
|
93 | - public const STATUS_BANDWIDTH_LIMIT_EXCEEDED = 509; |
|
94 | - public const STATUS_NOT_EXTENDED = 510; |
|
95 | - public const STATUS_NETWORK_AUTHENTICATION_REQUIRED = 511; |
|
37 | + public const STATUS_CONTINUE = 100; |
|
38 | + public const STATUS_SWITCHING_PROTOCOLS = 101; |
|
39 | + public const STATUS_PROCESSING = 102; |
|
40 | + public const STATUS_OK = 200; |
|
41 | + public const STATUS_CREATED = 201; |
|
42 | + public const STATUS_ACCEPTED = 202; |
|
43 | + public const STATUS_NON_AUTHORATIVE_INFORMATION = 203; |
|
44 | + public const STATUS_NO_CONTENT = 204; |
|
45 | + public const STATUS_RESET_CONTENT = 205; |
|
46 | + public const STATUS_PARTIAL_CONTENT = 206; |
|
47 | + public const STATUS_MULTI_STATUS = 207; |
|
48 | + public const STATUS_ALREADY_REPORTED = 208; |
|
49 | + public const STATUS_IM_USED = 226; |
|
50 | + public const STATUS_MULTIPLE_CHOICES = 300; |
|
51 | + public const STATUS_MOVED_PERMANENTLY = 301; |
|
52 | + public const STATUS_FOUND = 302; |
|
53 | + public const STATUS_SEE_OTHER = 303; |
|
54 | + public const STATUS_NOT_MODIFIED = 304; |
|
55 | + public const STATUS_USE_PROXY = 305; |
|
56 | + public const STATUS_RESERVED = 306; |
|
57 | + public const STATUS_TEMPORARY_REDIRECT = 307; |
|
58 | + public const STATUS_BAD_REQUEST = 400; |
|
59 | + public const STATUS_UNAUTHORIZED = 401; |
|
60 | + public const STATUS_PAYMENT_REQUIRED = 402; |
|
61 | + public const STATUS_FORBIDDEN = 403; |
|
62 | + public const STATUS_NOT_FOUND = 404; |
|
63 | + public const STATUS_METHOD_NOT_ALLOWED = 405; |
|
64 | + public const STATUS_NOT_ACCEPTABLE = 406; |
|
65 | + public const STATUS_PROXY_AUTHENTICATION_REQUIRED = 407; |
|
66 | + public const STATUS_REQUEST_TIMEOUT = 408; |
|
67 | + public const STATUS_CONFLICT = 409; |
|
68 | + public const STATUS_GONE = 410; |
|
69 | + public const STATUS_LENGTH_REQUIRED = 411; |
|
70 | + public const STATUS_PRECONDITION_FAILED = 412; |
|
71 | + public const STATUS_REQUEST_ENTITY_TOO_LARGE = 413; |
|
72 | + public const STATUS_REQUEST_URI_TOO_LONG = 414; |
|
73 | + public const STATUS_UNSUPPORTED_MEDIA_TYPE = 415; |
|
74 | + public const STATUS_REQUEST_RANGE_NOT_SATISFIABLE = 416; |
|
75 | + public const STATUS_EXPECTATION_FAILED = 417; |
|
76 | + public const STATUS_IM_A_TEAPOT = 418; |
|
77 | + public const STATUS_UNPROCESSABLE_ENTITY = 422; |
|
78 | + public const STATUS_LOCKED = 423; |
|
79 | + public const STATUS_FAILED_DEPENDENCY = 424; |
|
80 | + public const STATUS_UPGRADE_REQUIRED = 426; |
|
81 | + public const STATUS_PRECONDITION_REQUIRED = 428; |
|
82 | + public const STATUS_TOO_MANY_REQUESTS = 429; |
|
83 | + public const STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; |
|
84 | + public const STATUS_INTERNAL_SERVER_ERROR = 500; |
|
85 | + public const STATUS_NOT_IMPLEMENTED = 501; |
|
86 | + public const STATUS_BAD_GATEWAY = 502; |
|
87 | + public const STATUS_SERVICE_UNAVAILABLE = 503; |
|
88 | + public const STATUS_GATEWAY_TIMEOUT = 504; |
|
89 | + public const STATUS_HTTP_VERSION_NOT_SUPPORTED = 505; |
|
90 | + public const STATUS_VARIANT_ALSO_NEGOTIATES = 506; |
|
91 | + public const STATUS_INSUFFICIENT_STORAGE = 507; |
|
92 | + public const STATUS_LOOP_DETECTED = 508; |
|
93 | + public const STATUS_BANDWIDTH_LIMIT_EXCEEDED = 509; |
|
94 | + public const STATUS_NOT_EXTENDED = 510; |
|
95 | + public const STATUS_NETWORK_AUTHENTICATION_REQUIRED = 511; |
|
96 | 96 | } |
@@ -26,114 +26,114 @@ |
||
26 | 26 | use OCP\Remote\IUser; |
27 | 27 | |
28 | 28 | class User implements IUser { |
29 | - public const EXPECTED_KEYS = [ |
|
30 | - 'id', |
|
31 | - 'email', |
|
32 | - 'displayname', |
|
33 | - 'phone', |
|
34 | - 'address', |
|
35 | - 'website', |
|
36 | - 'groups', |
|
37 | - 'language', |
|
38 | - 'quota' |
|
39 | - ]; |
|
40 | - |
|
41 | - /** @var array */ |
|
42 | - private $data; |
|
43 | - |
|
44 | - public function __construct(array $data) { |
|
45 | - $this->data = $data; |
|
46 | - } |
|
47 | - |
|
48 | - |
|
49 | - /** |
|
50 | - * @return string |
|
51 | - */ |
|
52 | - public function getUserId() { |
|
53 | - return $this->data['id']; |
|
54 | - } |
|
55 | - |
|
56 | - /** |
|
57 | - * @return string |
|
58 | - */ |
|
59 | - public function getEmail() { |
|
60 | - return $this->data['email']; |
|
61 | - } |
|
62 | - |
|
63 | - /** |
|
64 | - * @return string |
|
65 | - */ |
|
66 | - public function getDisplayName() { |
|
67 | - return $this->data['displayname']; |
|
68 | - } |
|
69 | - |
|
70 | - /** |
|
71 | - * @return string |
|
72 | - */ |
|
73 | - public function getPhone() { |
|
74 | - return $this->data['phone']; |
|
75 | - } |
|
76 | - |
|
77 | - /** |
|
78 | - * @return string |
|
79 | - */ |
|
80 | - public function getAddress() { |
|
81 | - return $this->data['address']; |
|
82 | - } |
|
83 | - |
|
84 | - /** |
|
85 | - * @return string |
|
86 | - */ |
|
87 | - public function getWebsite() { |
|
88 | - return $this->data['website']; |
|
89 | - } |
|
90 | - |
|
91 | - /** |
|
92 | - * @return string |
|
93 | - */ |
|
94 | - public function getTwitter() { |
|
95 | - return isset($this->data['twitter']) ? $this->data['twitter'] : ''; |
|
96 | - } |
|
97 | - |
|
98 | - /** |
|
99 | - * @return string[] |
|
100 | - */ |
|
101 | - public function getGroups() { |
|
102 | - return $this->data['groups']; |
|
103 | - } |
|
104 | - |
|
105 | - /** |
|
106 | - * @return string |
|
107 | - */ |
|
108 | - public function getLanguage() { |
|
109 | - return $this->data['language']; |
|
110 | - } |
|
111 | - |
|
112 | - /** |
|
113 | - * @return int |
|
114 | - */ |
|
115 | - public function getUsedSpace() { |
|
116 | - return $this->data['quota']['used']; |
|
117 | - } |
|
118 | - |
|
119 | - /** |
|
120 | - * @return int |
|
121 | - */ |
|
122 | - public function getFreeSpace() { |
|
123 | - return $this->data['quota']['free']; |
|
124 | - } |
|
125 | - |
|
126 | - /** |
|
127 | - * @return int |
|
128 | - */ |
|
129 | - public function getTotalSpace() { |
|
130 | - return $this->data['quota']['total']; |
|
131 | - } |
|
132 | - |
|
133 | - /** |
|
134 | - * @return int |
|
135 | - */ |
|
136 | - public function getQuota() { |
|
137 | - return $this->data['quota']['quota']; |
|
138 | - } |
|
29 | + public const EXPECTED_KEYS = [ |
|
30 | + 'id', |
|
31 | + 'email', |
|
32 | + 'displayname', |
|
33 | + 'phone', |
|
34 | + 'address', |
|
35 | + 'website', |
|
36 | + 'groups', |
|
37 | + 'language', |
|
38 | + 'quota' |
|
39 | + ]; |
|
40 | + |
|
41 | + /** @var array */ |
|
42 | + private $data; |
|
43 | + |
|
44 | + public function __construct(array $data) { |
|
45 | + $this->data = $data; |
|
46 | + } |
|
47 | + |
|
48 | + |
|
49 | + /** |
|
50 | + * @return string |
|
51 | + */ |
|
52 | + public function getUserId() { |
|
53 | + return $this->data['id']; |
|
54 | + } |
|
55 | + |
|
56 | + /** |
|
57 | + * @return string |
|
58 | + */ |
|
59 | + public function getEmail() { |
|
60 | + return $this->data['email']; |
|
61 | + } |
|
62 | + |
|
63 | + /** |
|
64 | + * @return string |
|
65 | + */ |
|
66 | + public function getDisplayName() { |
|
67 | + return $this->data['displayname']; |
|
68 | + } |
|
69 | + |
|
70 | + /** |
|
71 | + * @return string |
|
72 | + */ |
|
73 | + public function getPhone() { |
|
74 | + return $this->data['phone']; |
|
75 | + } |
|
76 | + |
|
77 | + /** |
|
78 | + * @return string |
|
79 | + */ |
|
80 | + public function getAddress() { |
|
81 | + return $this->data['address']; |
|
82 | + } |
|
83 | + |
|
84 | + /** |
|
85 | + * @return string |
|
86 | + */ |
|
87 | + public function getWebsite() { |
|
88 | + return $this->data['website']; |
|
89 | + } |
|
90 | + |
|
91 | + /** |
|
92 | + * @return string |
|
93 | + */ |
|
94 | + public function getTwitter() { |
|
95 | + return isset($this->data['twitter']) ? $this->data['twitter'] : ''; |
|
96 | + } |
|
97 | + |
|
98 | + /** |
|
99 | + * @return string[] |
|
100 | + */ |
|
101 | + public function getGroups() { |
|
102 | + return $this->data['groups']; |
|
103 | + } |
|
104 | + |
|
105 | + /** |
|
106 | + * @return string |
|
107 | + */ |
|
108 | + public function getLanguage() { |
|
109 | + return $this->data['language']; |
|
110 | + } |
|
111 | + |
|
112 | + /** |
|
113 | + * @return int |
|
114 | + */ |
|
115 | + public function getUsedSpace() { |
|
116 | + return $this->data['quota']['used']; |
|
117 | + } |
|
118 | + |
|
119 | + /** |
|
120 | + * @return int |
|
121 | + */ |
|
122 | + public function getFreeSpace() { |
|
123 | + return $this->data['quota']['free']; |
|
124 | + } |
|
125 | + |
|
126 | + /** |
|
127 | + * @return int |
|
128 | + */ |
|
129 | + public function getTotalSpace() { |
|
130 | + return $this->data['quota']['total']; |
|
131 | + } |
|
132 | + |
|
133 | + /** |
|
134 | + * @return int |
|
135 | + */ |
|
136 | + public function getQuota() { |
|
137 | + return $this->data['quota']['quota']; |
|
138 | + } |
|
139 | 139 | } |
@@ -30,106 +30,106 @@ |
||
30 | 30 | use JsonSerializable; |
31 | 31 | |
32 | 32 | interface IToken extends JsonSerializable { |
33 | - public const TEMPORARY_TOKEN = 0; |
|
34 | - public const PERMANENT_TOKEN = 1; |
|
35 | - public const WIPE_TOKEN = 2; |
|
36 | - public const DO_NOT_REMEMBER = 0; |
|
37 | - public const REMEMBER = 1; |
|
38 | - |
|
39 | - /** |
|
40 | - * Get the token ID |
|
41 | - * |
|
42 | - * @return int |
|
43 | - */ |
|
44 | - public function getId(): int; |
|
45 | - |
|
46 | - /** |
|
47 | - * Get the user UID |
|
48 | - * |
|
49 | - * @return string |
|
50 | - */ |
|
51 | - public function getUID(): string; |
|
52 | - |
|
53 | - /** |
|
54 | - * Get the login name used when generating the token |
|
55 | - * |
|
56 | - * @return string |
|
57 | - */ |
|
58 | - public function getLoginName(): string; |
|
59 | - |
|
60 | - /** |
|
61 | - * Get the (encrypted) login password |
|
62 | - * |
|
63 | - * @return string|null |
|
64 | - */ |
|
65 | - public function getPassword(); |
|
66 | - |
|
67 | - /** |
|
68 | - * Get the timestamp of the last password check |
|
69 | - * |
|
70 | - * @return int |
|
71 | - */ |
|
72 | - public function getLastCheck(): int; |
|
73 | - |
|
74 | - /** |
|
75 | - * Set the timestamp of the last password check |
|
76 | - * |
|
77 | - * @param int $time |
|
78 | - */ |
|
79 | - public function setLastCheck(int $time); |
|
80 | - |
|
81 | - /** |
|
82 | - * Get the authentication scope for this token |
|
83 | - * |
|
84 | - * @return string |
|
85 | - */ |
|
86 | - public function getScope(): string; |
|
87 | - |
|
88 | - /** |
|
89 | - * Get the authentication scope for this token |
|
90 | - * |
|
91 | - * @return array |
|
92 | - */ |
|
93 | - public function getScopeAsArray(): array; |
|
94 | - |
|
95 | - /** |
|
96 | - * Set the authentication scope for this token |
|
97 | - * |
|
98 | - * @param array $scope |
|
99 | - */ |
|
100 | - public function setScope($scope); |
|
101 | - |
|
102 | - /** |
|
103 | - * Get the name of the token |
|
104 | - * @return string |
|
105 | - */ |
|
106 | - public function getName(): string; |
|
107 | - |
|
108 | - /** |
|
109 | - * Get the remember state of the token |
|
110 | - * |
|
111 | - * @return int |
|
112 | - */ |
|
113 | - public function getRemember(): int; |
|
114 | - |
|
115 | - /** |
|
116 | - * Set the token |
|
117 | - * |
|
118 | - * @param string $token |
|
119 | - */ |
|
120 | - public function setToken(string $token); |
|
121 | - |
|
122 | - /** |
|
123 | - * Set the password |
|
124 | - * |
|
125 | - * @param string $password |
|
126 | - */ |
|
127 | - public function setPassword(string $password); |
|
128 | - |
|
129 | - /** |
|
130 | - * Set the expiration time of the token |
|
131 | - * |
|
132 | - * @param int|null $expires |
|
133 | - */ |
|
134 | - public function setExpires($expires); |
|
33 | + public const TEMPORARY_TOKEN = 0; |
|
34 | + public const PERMANENT_TOKEN = 1; |
|
35 | + public const WIPE_TOKEN = 2; |
|
36 | + public const DO_NOT_REMEMBER = 0; |
|
37 | + public const REMEMBER = 1; |
|
38 | + |
|
39 | + /** |
|
40 | + * Get the token ID |
|
41 | + * |
|
42 | + * @return int |
|
43 | + */ |
|
44 | + public function getId(): int; |
|
45 | + |
|
46 | + /** |
|
47 | + * Get the user UID |
|
48 | + * |
|
49 | + * @return string |
|
50 | + */ |
|
51 | + public function getUID(): string; |
|
52 | + |
|
53 | + /** |
|
54 | + * Get the login name used when generating the token |
|
55 | + * |
|
56 | + * @return string |
|
57 | + */ |
|
58 | + public function getLoginName(): string; |
|
59 | + |
|
60 | + /** |
|
61 | + * Get the (encrypted) login password |
|
62 | + * |
|
63 | + * @return string|null |
|
64 | + */ |
|
65 | + public function getPassword(); |
|
66 | + |
|
67 | + /** |
|
68 | + * Get the timestamp of the last password check |
|
69 | + * |
|
70 | + * @return int |
|
71 | + */ |
|
72 | + public function getLastCheck(): int; |
|
73 | + |
|
74 | + /** |
|
75 | + * Set the timestamp of the last password check |
|
76 | + * |
|
77 | + * @param int $time |
|
78 | + */ |
|
79 | + public function setLastCheck(int $time); |
|
80 | + |
|
81 | + /** |
|
82 | + * Get the authentication scope for this token |
|
83 | + * |
|
84 | + * @return string |
|
85 | + */ |
|
86 | + public function getScope(): string; |
|
87 | + |
|
88 | + /** |
|
89 | + * Get the authentication scope for this token |
|
90 | + * |
|
91 | + * @return array |
|
92 | + */ |
|
93 | + public function getScopeAsArray(): array; |
|
94 | + |
|
95 | + /** |
|
96 | + * Set the authentication scope for this token |
|
97 | + * |
|
98 | + * @param array $scope |
|
99 | + */ |
|
100 | + public function setScope($scope); |
|
101 | + |
|
102 | + /** |
|
103 | + * Get the name of the token |
|
104 | + * @return string |
|
105 | + */ |
|
106 | + public function getName(): string; |
|
107 | + |
|
108 | + /** |
|
109 | + * Get the remember state of the token |
|
110 | + * |
|
111 | + * @return int |
|
112 | + */ |
|
113 | + public function getRemember(): int; |
|
114 | + |
|
115 | + /** |
|
116 | + * Set the token |
|
117 | + * |
|
118 | + * @param string $token |
|
119 | + */ |
|
120 | + public function setToken(string $token); |
|
121 | + |
|
122 | + /** |
|
123 | + * Set the password |
|
124 | + * |
|
125 | + * @param string $password |
|
126 | + */ |
|
127 | + public function setPassword(string $password); |
|
128 | + |
|
129 | + /** |
|
130 | + * Set the expiration time of the token |
|
131 | + * |
|
132 | + * @param int|null $expires |
|
133 | + */ |
|
134 | + public function setExpires($expires); |
|
135 | 135 | } |
@@ -26,24 +26,24 @@ |
||
26 | 26 | namespace OC\DB; |
27 | 27 | |
28 | 28 | class AdapterOCI8 extends Adapter { |
29 | - public function lastInsertId($table) { |
|
30 | - if (is_null($table)) { |
|
31 | - throw new \InvalidArgumentException('Oracle requires a table name to be passed into lastInsertId()'); |
|
32 | - } |
|
33 | - if ($table !== null) { |
|
34 | - $suffix = '_SEQ'; |
|
35 | - $table = '"' . $table . $suffix . '"'; |
|
36 | - } |
|
37 | - return $this->conn->realLastInsertId($table); |
|
38 | - } |
|
29 | + public function lastInsertId($table) { |
|
30 | + if (is_null($table)) { |
|
31 | + throw new \InvalidArgumentException('Oracle requires a table name to be passed into lastInsertId()'); |
|
32 | + } |
|
33 | + if ($table !== null) { |
|
34 | + $suffix = '_SEQ'; |
|
35 | + $table = '"' . $table . $suffix . '"'; |
|
36 | + } |
|
37 | + return $this->conn->realLastInsertId($table); |
|
38 | + } |
|
39 | 39 | |
40 | - public const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400"; |
|
40 | + public const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400"; |
|
41 | 41 | |
42 | - public function fixupStatement($statement) { |
|
43 | - $statement = preg_replace('/`(\w+)` ILIKE \?/', 'REGEXP_LIKE(`$1`, \'^\' || REPLACE(?, \'%\', \'.*\') || \'$\', \'i\')', $statement); |
|
44 | - $statement = str_replace('`', '"', $statement); |
|
45 | - $statement = str_ireplace('NOW()', 'CURRENT_TIMESTAMP', $statement); |
|
46 | - $statement = str_ireplace('UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement); |
|
47 | - return $statement; |
|
48 | - } |
|
42 | + public function fixupStatement($statement) { |
|
43 | + $statement = preg_replace('/`(\w+)` ILIKE \?/', 'REGEXP_LIKE(`$1`, \'^\' || REPLACE(?, \'%\', \'.*\') || \'$\', \'i\')', $statement); |
|
44 | + $statement = str_replace('`', '"', $statement); |
|
45 | + $statement = str_ireplace('NOW()', 'CURRENT_TIMESTAMP', $statement); |
|
46 | + $statement = str_ireplace('UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement); |
|
47 | + return $statement; |
|
48 | + } |
|
49 | 49 | } |
@@ -31,157 +31,157 @@ |
||
31 | 31 | |
32 | 32 | class Session { |
33 | 33 | |
34 | - /** @var ISession */ |
|
35 | - protected $session; |
|
36 | - |
|
37 | - public const NOT_INITIALIZED = '0'; |
|
38 | - public const INIT_EXECUTED = '1'; |
|
39 | - public const INIT_SUCCESSFUL = '2'; |
|
40 | - |
|
41 | - /** |
|
42 | - * @param ISession $session |
|
43 | - */ |
|
44 | - public function __construct(ISession $session) { |
|
45 | - $this->session = $session; |
|
46 | - } |
|
47 | - |
|
48 | - /** |
|
49 | - * Sets status of encryption app |
|
50 | - * |
|
51 | - * @param string $status INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INITIALIZED |
|
52 | - */ |
|
53 | - public function setStatus($status) { |
|
54 | - $this->session->set('encryptionInitialized', $status); |
|
55 | - } |
|
56 | - |
|
57 | - /** |
|
58 | - * Gets status if we already tried to initialize the encryption app |
|
59 | - * |
|
60 | - * @return string init status INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INITIALIZED |
|
61 | - */ |
|
62 | - public function getStatus() { |
|
63 | - $status = $this->session->get('encryptionInitialized'); |
|
64 | - if (is_null($status)) { |
|
65 | - $status = self::NOT_INITIALIZED; |
|
66 | - } |
|
67 | - |
|
68 | - return $status; |
|
69 | - } |
|
70 | - |
|
71 | - /** |
|
72 | - * check if encryption was initialized successfully |
|
73 | - * |
|
74 | - * @return bool |
|
75 | - */ |
|
76 | - public function isReady() { |
|
77 | - $status = $this->getStatus(); |
|
78 | - return $status === self::INIT_SUCCESSFUL; |
|
79 | - } |
|
80 | - |
|
81 | - /** |
|
82 | - * Gets user or public share private key from session |
|
83 | - * |
|
84 | - * @return string $privateKey The user's plaintext private key |
|
85 | - * @throws Exceptions\PrivateKeyMissingException |
|
86 | - */ |
|
87 | - public function getPrivateKey() { |
|
88 | - $key = $this->session->get('privateKey'); |
|
89 | - if (is_null($key)) { |
|
90 | - throw new Exceptions\PrivateKeyMissingException('please try to log-out and log-in again', 0); |
|
91 | - } |
|
92 | - return $key; |
|
93 | - } |
|
94 | - |
|
95 | - /** |
|
96 | - * check if private key is set |
|
97 | - * |
|
98 | - * @return boolean |
|
99 | - */ |
|
100 | - public function isPrivateKeySet() { |
|
101 | - $key = $this->session->get('privateKey'); |
|
102 | - if (is_null($key)) { |
|
103 | - return false; |
|
104 | - } |
|
105 | - |
|
106 | - return true; |
|
107 | - } |
|
108 | - |
|
109 | - /** |
|
110 | - * Sets user private key to session |
|
111 | - * |
|
112 | - * @param string $key users private key |
|
113 | - * |
|
114 | - * @note this should only be set on login |
|
115 | - */ |
|
116 | - public function setPrivateKey($key) { |
|
117 | - $this->session->set('privateKey', $key); |
|
118 | - } |
|
119 | - |
|
120 | - /** |
|
121 | - * store data needed for the decrypt all operation in the session |
|
122 | - * |
|
123 | - * @param string $user |
|
124 | - * @param string $key |
|
125 | - */ |
|
126 | - public function prepareDecryptAll($user, $key) { |
|
127 | - $this->session->set('decryptAll', true); |
|
128 | - $this->session->set('decryptAllKey', $key); |
|
129 | - $this->session->set('decryptAllUid', $user); |
|
130 | - } |
|
131 | - |
|
132 | - /** |
|
133 | - * check if we are in decrypt all mode |
|
134 | - * |
|
135 | - * @return bool |
|
136 | - */ |
|
137 | - public function decryptAllModeActivated() { |
|
138 | - $decryptAll = $this->session->get('decryptAll'); |
|
139 | - return ($decryptAll === true); |
|
140 | - } |
|
141 | - |
|
142 | - /** |
|
143 | - * get uid used for decrypt all operation |
|
144 | - * |
|
145 | - * @return string |
|
146 | - * @throws \Exception |
|
147 | - */ |
|
148 | - public function getDecryptAllUid() { |
|
149 | - $uid = $this->session->get('decryptAllUid'); |
|
150 | - if (is_null($uid) && $this->decryptAllModeActivated()) { |
|
151 | - throw new \Exception('No uid found while in decrypt all mode'); |
|
152 | - } elseif (is_null($uid)) { |
|
153 | - throw new \Exception('Please activate decrypt all mode first'); |
|
154 | - } |
|
155 | - |
|
156 | - return $uid; |
|
157 | - } |
|
158 | - |
|
159 | - /** |
|
160 | - * get private key for decrypt all operation |
|
161 | - * |
|
162 | - * @return string |
|
163 | - * @throws PrivateKeyMissingException |
|
164 | - */ |
|
165 | - public function getDecryptAllKey() { |
|
166 | - $privateKey = $this->session->get('decryptAllKey'); |
|
167 | - if (is_null($privateKey) && $this->decryptAllModeActivated()) { |
|
168 | - throw new PrivateKeyMissingException('No private key found while in decrypt all mode'); |
|
169 | - } elseif (is_null($privateKey)) { |
|
170 | - throw new PrivateKeyMissingException('Please activate decrypt all mode first'); |
|
171 | - } |
|
172 | - |
|
173 | - return $privateKey; |
|
174 | - } |
|
175 | - |
|
176 | - /** |
|
177 | - * remove keys from session |
|
178 | - */ |
|
179 | - public function clear() { |
|
180 | - $this->session->remove('publicSharePrivateKey'); |
|
181 | - $this->session->remove('privateKey'); |
|
182 | - $this->session->remove('encryptionInitialized'); |
|
183 | - $this->session->remove('decryptAll'); |
|
184 | - $this->session->remove('decryptAllKey'); |
|
185 | - $this->session->remove('decryptAllUid'); |
|
186 | - } |
|
34 | + /** @var ISession */ |
|
35 | + protected $session; |
|
36 | + |
|
37 | + public const NOT_INITIALIZED = '0'; |
|
38 | + public const INIT_EXECUTED = '1'; |
|
39 | + public const INIT_SUCCESSFUL = '2'; |
|
40 | + |
|
41 | + /** |
|
42 | + * @param ISession $session |
|
43 | + */ |
|
44 | + public function __construct(ISession $session) { |
|
45 | + $this->session = $session; |
|
46 | + } |
|
47 | + |
|
48 | + /** |
|
49 | + * Sets status of encryption app |
|
50 | + * |
|
51 | + * @param string $status INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INITIALIZED |
|
52 | + */ |
|
53 | + public function setStatus($status) { |
|
54 | + $this->session->set('encryptionInitialized', $status); |
|
55 | + } |
|
56 | + |
|
57 | + /** |
|
58 | + * Gets status if we already tried to initialize the encryption app |
|
59 | + * |
|
60 | + * @return string init status INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INITIALIZED |
|
61 | + */ |
|
62 | + public function getStatus() { |
|
63 | + $status = $this->session->get('encryptionInitialized'); |
|
64 | + if (is_null($status)) { |
|
65 | + $status = self::NOT_INITIALIZED; |
|
66 | + } |
|
67 | + |
|
68 | + return $status; |
|
69 | + } |
|
70 | + |
|
71 | + /** |
|
72 | + * check if encryption was initialized successfully |
|
73 | + * |
|
74 | + * @return bool |
|
75 | + */ |
|
76 | + public function isReady() { |
|
77 | + $status = $this->getStatus(); |
|
78 | + return $status === self::INIT_SUCCESSFUL; |
|
79 | + } |
|
80 | + |
|
81 | + /** |
|
82 | + * Gets user or public share private key from session |
|
83 | + * |
|
84 | + * @return string $privateKey The user's plaintext private key |
|
85 | + * @throws Exceptions\PrivateKeyMissingException |
|
86 | + */ |
|
87 | + public function getPrivateKey() { |
|
88 | + $key = $this->session->get('privateKey'); |
|
89 | + if (is_null($key)) { |
|
90 | + throw new Exceptions\PrivateKeyMissingException('please try to log-out and log-in again', 0); |
|
91 | + } |
|
92 | + return $key; |
|
93 | + } |
|
94 | + |
|
95 | + /** |
|
96 | + * check if private key is set |
|
97 | + * |
|
98 | + * @return boolean |
|
99 | + */ |
|
100 | + public function isPrivateKeySet() { |
|
101 | + $key = $this->session->get('privateKey'); |
|
102 | + if (is_null($key)) { |
|
103 | + return false; |
|
104 | + } |
|
105 | + |
|
106 | + return true; |
|
107 | + } |
|
108 | + |
|
109 | + /** |
|
110 | + * Sets user private key to session |
|
111 | + * |
|
112 | + * @param string $key users private key |
|
113 | + * |
|
114 | + * @note this should only be set on login |
|
115 | + */ |
|
116 | + public function setPrivateKey($key) { |
|
117 | + $this->session->set('privateKey', $key); |
|
118 | + } |
|
119 | + |
|
120 | + /** |
|
121 | + * store data needed for the decrypt all operation in the session |
|
122 | + * |
|
123 | + * @param string $user |
|
124 | + * @param string $key |
|
125 | + */ |
|
126 | + public function prepareDecryptAll($user, $key) { |
|
127 | + $this->session->set('decryptAll', true); |
|
128 | + $this->session->set('decryptAllKey', $key); |
|
129 | + $this->session->set('decryptAllUid', $user); |
|
130 | + } |
|
131 | + |
|
132 | + /** |
|
133 | + * check if we are in decrypt all mode |
|
134 | + * |
|
135 | + * @return bool |
|
136 | + */ |
|
137 | + public function decryptAllModeActivated() { |
|
138 | + $decryptAll = $this->session->get('decryptAll'); |
|
139 | + return ($decryptAll === true); |
|
140 | + } |
|
141 | + |
|
142 | + /** |
|
143 | + * get uid used for decrypt all operation |
|
144 | + * |
|
145 | + * @return string |
|
146 | + * @throws \Exception |
|
147 | + */ |
|
148 | + public function getDecryptAllUid() { |
|
149 | + $uid = $this->session->get('decryptAllUid'); |
|
150 | + if (is_null($uid) && $this->decryptAllModeActivated()) { |
|
151 | + throw new \Exception('No uid found while in decrypt all mode'); |
|
152 | + } elseif (is_null($uid)) { |
|
153 | + throw new \Exception('Please activate decrypt all mode first'); |
|
154 | + } |
|
155 | + |
|
156 | + return $uid; |
|
157 | + } |
|
158 | + |
|
159 | + /** |
|
160 | + * get private key for decrypt all operation |
|
161 | + * |
|
162 | + * @return string |
|
163 | + * @throws PrivateKeyMissingException |
|
164 | + */ |
|
165 | + public function getDecryptAllKey() { |
|
166 | + $privateKey = $this->session->get('decryptAllKey'); |
|
167 | + if (is_null($privateKey) && $this->decryptAllModeActivated()) { |
|
168 | + throw new PrivateKeyMissingException('No private key found while in decrypt all mode'); |
|
169 | + } elseif (is_null($privateKey)) { |
|
170 | + throw new PrivateKeyMissingException('Please activate decrypt all mode first'); |
|
171 | + } |
|
172 | + |
|
173 | + return $privateKey; |
|
174 | + } |
|
175 | + |
|
176 | + /** |
|
177 | + * remove keys from session |
|
178 | + */ |
|
179 | + public function clear() { |
|
180 | + $this->session->remove('publicSharePrivateKey'); |
|
181 | + $this->session->remove('privateKey'); |
|
182 | + $this->session->remove('encryptionInitialized'); |
|
183 | + $this->session->remove('decryptAll'); |
|
184 | + $this->session->remove('decryptAllKey'); |
|
185 | + $this->session->remove('decryptAllUid'); |
|
186 | + } |
|
187 | 187 | } |