-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathconfig.php
More file actions
494 lines (483 loc) · 23.6 KB
/
Copy pathconfig.php
File metadata and controls
494 lines (483 loc) · 23.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
<?php
use Illuminate\Support\Str;
use Mni\FrontYAML\Parser;
use TightenCo\Jigsaw\Parsers\FrontMatterParser;
use TightenCo\Jigsaw\Parsers\MarkdownParser;
return [
'production' => false,
'matomo_container' => '8jNjdh8C_dev_dc9cf71ee2745d3690156798',
'baseUrl' => '/',
'accountUrl' => getenv('ACCOUNT_URL'),
'form_url' => 'http://localhost/suitecrm-form-middleware/validate.php',
'url_captcha' => 'http://localhost/suitecrm-form-middleware/captcha.php',
'url_captcha_audio' => 'http://localhost/suitecrm-form-middleware/audio_captcha.php',
'title' => 'LibreSign - Electronic signature of digital documents',
'description' => 'Electronic signature of digital documents',
'wordPressVersion' => function($page) {
$version = file_get_contents($page->accountUrl . '/wp-json/libresign/v1/version');
return json_decode($version)->version;
},
'locales' => [
'' => 'English',
'fr' => 'Français',
'nb-NO' => 'Norsk bokmål',
'pt-BR' => 'Português Brasil',
],
'markdownListToHtml' => function($page, $list) {
$list = $page->t($list);
$list = explode("\n", $list);
$list = array_map(fn ($r) => ltrim($r, '- '), $list);
return '<li>' . implode('</li><li>', $list) . '</li>';
},
'prices' => [
'Business' => [
'price' => 'Contact us to more informations',
'description' => '',
'isActive' => true,
'list' => <<<LIST
- Unlimited accounts
- Storage customized
LIST,
],
],
'optionsServicesLibresign' => [
[
'service' => 'Electronic document management',
'basic' => true,
'business' => true,
],
[
'service' => 'Simple electronic signature (without digital certificate) unlimited',
'basic' => true,
'business' => true,
],
[
'service' => 'Unlimited subscription with A1 digital certificate',
'basic' => true,
'business' => true,
],
[
'service' => 'Sending reminder by email',
'basic' => true,
'business' => true,
],
[
'service' => 'Technical support',
'basic' => false,
'business' => true,
],
[
'service' => 'Online document creation and editing',
'basic' => false,
'business' => true,
],
[
'service' => 'Access management by users or departments',
'basic' => false,
'business' => true,
],
[
'service' => 'Task control and management',
'basic' => false,
'business' => true,
],
[
'service' => 'Customization of visual identity (colors, logo and domain)',
'basic' => false,
'business' => true,
],
],
'testimonials' => [
[
'comment' => "Libresign's nextcloud integration has come a long way in the past year. If you tried it before and found it lacking, give it another chance. I can see it being a real option and alternative to other e-signature services.",
'author' => 'Matt Nelson'
],
[
'comment' => "Congratulations to the LibreSign development team for creating such an efficient solution for electronic signatures! LibreSign has an intuitive interface and ease of use, allowing integration with various APIs. I've been following the development and see it improving with each new release. LibreSign makes managing digital signatures a simple and reliable experience. I highly recommend it!",
'author' => 'Lua Mello'
],
[
'comment' => "Finally an excellent app for signing documents. Very good!",
'author' => 'Daiane Alves'
],
[
'comment' => "Libresign is becoming a fully-featured alternative to expensive cloud services like DocuSign. The nextcloud integration makes it a real option to use for e-signatures.",
'author' => 'Metheos'
],
[
'comment' => "LibreSign has come a long way and it is great replacement to most commercial e-signature solutions and it is open source.",
'author' => '0-bandage-dugouts'
],
[
'comment' => "It works perfectly with the electronic certificate issued by the Spanish Government. Installation has become very simple and affordable for anyone with minimal knowledge of Nextcloud. Developer support is fantastic. It works on all devices, including mobile devices. It has different options for creating, requesting and signing signatures. Version 9 is a great leap in quality and has a lot of future. It's incredible that this application works so well and is free.",
'author' => 'Iván Gómez Fernández'
],
[
'comment' => "A simple and complete solution. It speeds up processes and can eliminate the use of paper. We integrated it with our public management system or e-Cidade, it was absurdly good. Congratulations.",
'author' => 'Igor Afonso Oliveira Ruas'
],
],
'frequentlyQuestions' => [
[
'question' => 'Why LibreSign?',
'answer' => 'LibreSign allows documents to be signed securely and with legal validity, since the system generates hashing - an algorithm that ensures that the file has not been altered after being signed - as well as numbers and records the times of each signature carried out in the document. In this way, the system meets all the requirements of the GDPR - General Data Protection Law.'
],
[
'question' => 'What are the key features of LibreCode signature pads?',
'answer' => 'File Creation, Signature with Digital Certificate, Signature Management, Document Management, Validation, API'
],
[
'question' => 'Is a digital signature the same as a digitized signature?',
'answer' => 'No. The digitized signature is the reproduction of the handwritten signature as an image using scanner-type. It does not guarantee the authorship and of the electronic document, as there is no association between the signer and the text, as it can be easily copied and inserted another document.'
],
[
'question' => 'What is the name of the company that LibreSign was developed by?',
'answer' => 'LibreCode, a Brazilian cooperative of free software developers.'
],
[
'question' => 'Does the plan have any kind of loyalty?',
'answer' => 'You are free to cancel your plan at any time. By canceling, Signater undertakes not to renew the billing for your plan.'
],
[
'question' => 'What happens if I cancel my plan?',
'answer' => 'Yes, at any time. After canceling, you will no longer be charged and there will be no automatic renewal.'
],
[
'question' => 'Can I use my personal digital certificate to sign documents?',
'answer' => 'Yes. You can store your digital certificate in LibreSign and when you sign a document you will be asked for your password.'
],
[
'question' => 'Do I need a digital certificate to sign documents?',
'answer' => 'No. LibreSign creates a digital certificate for each user who does not have a personal digital certificate.'
],
[
'question' => 'What is LibreSign?',
'answer' => 'LibreSign is a platform that makes it easy to sign documents digitally and electronically, guaranteeing security and compliance with the law. With it, you can sign documents using personal and company digital certificates in a simple and secure way.'
],
[
'question' => 'What types of digital certificates does LibreSign accept?',
'answer' => 'LibreSign accepts personal and company digital certificates, including certificates issued by Certificate Authorities in the ICP-Brasil standard. In addition, if you prefer, you can use certificates generated by the system itself.'
],
[
'question' => 'What is the difference between digital and electronic signatures?',
'answer' => 'A digital signature uses a digital certificate, which provides greater security and legal validity. Electronic signatures, on the other hand, are made in other ways, such as by e-mail or cell phone, and also have legal validity, depending on the context.'
],
[
'question' => 'Is LibreSign compatible with mobile devices?',
'answer' => 'Yes, you can use LibreSign directly from your smartphone or tablet by simply accessing the browser. This allows you to sign your documents from anywhere.'
],
[
'question' => 'Is it possible to integrate LibreSign with other systems?',
'answer' => 'Absolutely! LibreSign has APIs that allow you to integrate the platform with other systems you already use, helping to automate processes and make everything more agile.'
],
[
'question' => 'Can LibreSign be used by public bodies?',
'answer' => 'Yes, LibreSign is perfect for town halls and public bodies that need a secure and legally valid solution for signing documents.'
],
[
'question' => 'How can I buy LibreSign?',
'answer' => 'You can purchase LibreSign directly on our website or talk to our sales team, who will help you find the ideal plan for your needs.'
],
[
'question' => 'Does LibreSign offer technical support?',
'answer' => 'Yes, our support team is ready to help you with the configuration and with any questions or problems you may have.'
],
[
'question' => 'How are documents signed in LibreSign?',
'answer' => 'It is very simple! All you have to do is upload the document to the platform, choose who is going to sign it and select the form of signature (digital or electronic). The system will record everything and ensure that the process is secure and traceable.'
],
[
'question' => 'Does LibreSign time-stamp documents?',
'answer' => 'Yes, LibreSign offers time stamping, which guarantees the exact date and time of the signature, which brings even more security and legal validity.'
],
],
'getFromCategory' => function($page, $category) {
$files = array_merge(
glob('source/_posts/*'),
glob('source/_posts/_tmp/*'),
);
$parser = new Parser(
markdownParser: new MarkdownParser()
);
$frontMatterParser = new FrontMatterParser($parser);
$defaultLocale = packageDefaultLocale($page);
$current_path_locale = current_path_locale($page);
$posts = [];
foreach ($files as $file) {
if (!is_file($file)) {
continue;
}
$post = $frontMatterParser->getFrontMatter(file_get_contents($file));
if ($current_path_locale !== $defaultLocale) {
if (!str_contains($file, $current_path_locale)) {
continue;
}
} else {
$langs = $page->localization->keys()->all();
foreach ($langs as $lang) {
if (str_contains($file, $lang)) {
continue 2;
}
}
}
if (isset($post['categories']) && is_array($post['categories']) && in_array($category, $post['categories'])) {
if (!empty($post['original_title'])) {
$post['url'] = locale_url($page, $page->baseUrl . 'posts/' . Str::slug($post['original_title']));
} else {
$post['url'] = locale_url($page, $page->baseUrl . 'posts/' . Str::slug($post['title']));
}
$posts[] = $post;
}
}
return $posts;
},
'mergeCollections' => function ($page, ...$collections) {
$merged = collect();
foreach ($collections as $collection) {
foreach ($collection as $post) {
$merged->add($post);
}
}
return $merged
->sortByDesc(fn($post) => $post->date)
->values();
},
'collections' => [
'redirect' => [
'extends' => '_layouts.redirect301',
'path' => function($page) {
return $page->from;
},
'items' => [
[
'from' => '/account',
'to' => '/',
],
[
'from' => '/atendimento-lgpd',
'to' => '/',
],
[
'from' => '/cadastre-se',
'to' => '/',
],
[
'from' => '/categoria-produto/cloud',
'to' => '/',
],
[
'from' => '/doe',
'to' => '/',
],
[
'from' => '/envolva-se',
'to' => '/',
],
[
'from' => '/loja',
'to' => '/',
],
[
'from' => '/password-reset',
'to' => '/',
],
[
'from' => '/politica-de-privacidade',
'to' => '/',
],
[
'from' => '/produto/libresign-cloud',
'to' => '/',
],
[
'from' => '/recursos',
'to' => '/',
],
[
'from' => '/register',
'to' => '/',
],
[
'from' => '/sobre',
'to' => '/',
],
[
'from' => '/suporte',
'to' => '/',
],
[
'from' => '/termos-e-condicoes',
'to' => '/',
],
],
],
'posts' => [
'path' => function($page) {
$langs = $page->localization->keys()->all();
$lang = array_reduce($langs, function($carry, $lang) use ($page) {
if (str_starts_with($page->_meta->filename, $lang . '_')) {
return $lang;
}
return $carry;
}, '');
if ($lang) {
return $lang . '/posts/' . Str::slug($page->title);
}
return 'posts/' . Str::slug($page->title);
},
'author' => 'LibreSign',
'map' => function ($post) {
$postLang = current_path_locale($post);
$path = 'assets/images/posts/'.$post->getFilename();
$alternativePath = 'assets/images/posts/'. str_replace($postLang . '_', '', $post->getFilename());
$items = $post->get('collections')->get('team')->get('items');
$author = array_filter($items->all(), function($author) use ($post){
return $author->name === $post->author;
});
if(!empty($author)){
$author = current($author);
$post->set('gravatar', $author->gravatar);
}
if(empty($post->cover_image)){
if(file_exists(__DIR__.'/source/'.$path.'/cover.jpg')){
$post->set('cover_image',$post->baseUrl.$path.'/cover.jpg');
} elseif(file_exists(__DIR__.'/source/'.$path.'/cover.png')){
$post->set('cover_image',$post->baseUrl.$path.'/cover.png');
} elseif(file_exists(__DIR__.'/source/'.$alternativePath.'/cover.jpg')){
$post->set('cover_image',$post->baseUrl.$alternativePath.'/cover.jpg');
} elseif(file_exists(__DIR__.'/source/'.$alternativePath.'/cover.png')){
$post->set('cover_image',$post->baseUrl.$alternativePath.'/cover.png');
} else {
$post->set('cover_image',$post->baseUrl.'assets/images/logo/logo.svg');
}
}
if(empty($post->banner)){
if(file_exists(__DIR__.'/source/'.$path.'/banner.jpg')){
$post->set('banner',$post->baseUrl.$path.'/banner.jpg');
} elseif(file_exists(__DIR__.'/source/'.$path.'/banner.png')){
$post->set('banner',$post->baseUrl.$path.'/banner.png');
} elseif(file_exists(__DIR__.'/source/'.$alternativePath.'/banner.jpg')){
$post->set('banner',$post->baseUrl.$alternativePath.'/banner.jpg');
} elseif(file_exists(__DIR__.'/source/'.$alternativePath.'/banner.png')){
$post->set('banner',$post->baseUrl.$alternativePath.'/banner.png');
} else {
$post->set('banner',$post->baseUrl.'assets/images/logo/logo.svg');
}
}
return $post;
}
],
'posts_wordpress' => [
'extends' => '_layouts.post_wordpress',
'path' => function($page) {
foreach ($page->locales as $localeCode => $localeName) {
if ($localeCode === $page->lang) {
return $page->lang . '/posts/' . $page->slug;
} elseif ($localeCode === $page->langSlug) {
return $page->langSlug . '/posts/' . $page->slug;
}
}
return 'posts/' . $page->slug;
},
'items' => function ($post) {
if(empty($post->get('accountUrl'))){
return [];
}
$categories = json_decode(file_get_contents($post->get('accountUrl') . '/wp-json/wp/v2/categories'));
$categories = array_filter($categories, fn ($c) => $c->slug === 'article');
$posts = [];
foreach ($categories as $category) {
$baseUrl = $post->get('accountUrl') . '/wp-json/wp/v2/posts?_embed&categories=' . $category->id . '&lang=' . $category->lang;
$headers = get_headers($baseUrl);
$totalPages = 1;
foreach ($headers as $header) {
if (stripos($header, 'X-WP-TotalPages:') !== false) {
$totalPages = (int) trim(substr($header, strpos($header, ':') + 1));
break;
}
}
$page = 1;
while ($page <= $totalPages) {
$url = $baseUrl . '&page=' . $page;
if (!$response = file_get_contents($url)) {
break;
}
$posts = array_merge($posts, json_decode($response, true));
$page++;
};
}
$wordPressLanguages = json_decode(file_get_contents($post->get('accountUrl') . '/wp-json/pll/v1/languages'));
return collect($posts)->map(function ($fromApi) use ($wordPressLanguages, $post) {
$currentLang = current(array_filter($wordPressLanguages, fn ($l) => $l->slug === $fromApi['lang']));
$data = [
'title' => $fromApi['title']['rendered'],
'slug' => $fromApi['slug'],
'date' => Carbon\Carbon::parse($fromApi['date'])->timestamp,
'content' => $fromApi['content']['rendered'],
'lang' => $currentLang->w3c ?? $fromApi['lang'],
'langSlug' => $currentLang->slug ?? $fromApi['lang'],
'description' => $fromApi['acf']['description'],
];
if (is_array($fromApi['author'])) {
$data['gravatar'] = $fromApi['author']['gravatar_hash'];
$data['author'] = is_array($fromApi['author']) ? $fromApi['author']['name'] : 'LibreSign';
} else {
$data['author'] = 'LibreSign';
}
if (isset($fromApi['_embedded']['wp:featuredmedia'][0]['source_url'])) {
$data['banner'] = $fromApi['_embedded']['wp:featuredmedia'][0]['source_url'];
} else {
$data['banner'] = $post->get('baseUrl') . 'assets/images/logo/logo.svg';
}
$data['cover_image'] = $data['banner'];
return $data;
});
},
],
'team' => [
'path' => function($page){
return 'team/' . Str::slug($page->name);
},
'extends' => '_layouts.team-member',
'items' => [
[
'name' => 'Crisciany Silva',
'gravatar' => 'f2f64ea713b5c39cb64268a0eda7e022',
'bio' => 'I\'m a Developer. I currently study the PHP language with a focus on the Laravel framework. I have professional experience in PHP on a web-oriented system and some system maintenance such as screen creation, reports with jasper reports and mpdf and system versioning with git.',
'role' => 'Software Engineer',
'social' => [
'github' => 'https://github.com/Any97Cris',
'linkedin' => 'https://www.linkedin.com/in/criscianysilva/'
],
],
[
'name' => 'Daiane Alves',
'gravatar' => 'fe9fbbf8677e78931af9a4a5da35e1ee' ,
'bio' => '',
'role' => '',
'social' => [
'linkedin' => 'https://www.linkedin.com/in/daianealvesrj/',
]
],
[
'name' => 'Vitor Mattos',
'gravatar' => '2656fb55188f5a28ee7a99db0b9e6d8f4b91c7f6b88eead05c57386a3a05ff49' ,
'bio' => 'With over 20 years of experience as CTO of LibreCode, is a Zend Certified Engineer and expert in PHP, Linux, and FLOSS solutions. Passionate about technology, is an entrepreneur in the IT field and an activist for privacy. As a strong advocate for open-source software, frequently speaks at regional and national events, demonstrating his commitment to sharing knowledge, promoting the adoption of open technologies, and emphasizing the importance of privacy.',
'role' => 'CTO',
'social' => [
'linkedin' => 'https://www.linkedin.com/in/vitormattos/',
]
],
[
'name' => 'LibreSign',
'gravatar' => '/source/assets/images/logo/Avatar-LibreSign.png' ,
'bio' => '',
'role' => 'Cooperativa',
'social' => [
'linkedin' => 'https://www.linkedin.com/company/libresign/posts/?feedView=all',
]
],
],
],
],
];