Skip to content

Commit e04e0b0

Browse files
committed
added checks for email and user name
1 parent 066393d commit e04e0b0

File tree

6 files changed

+39
-9
lines changed

6 files changed

+39
-9
lines changed

src/Controllers/Examples/eSignature/EG020PhoneAuthentication.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ public function createController(): void
3535
$this->checkDsToken();
3636

3737
try {
38+
if($this->args['envelope_args']['signer_email'] == $GLOBALS['DS_CONFIG']['signer_email']) {
39+
$GLOBALS['twig']->display(
40+
'error.html',
41+
[
42+
'error_code' => "400",
43+
'error_message' => ManifestService::getCommonTexts()['RecipientShouldDifferFromSender'],
44+
'common_texts' => ManifestService::getCommonTexts()
45+
]
46+
);
47+
exit;
48+
}
49+
3850
$envelopeAuthentification = PhoneAuthenticationService::phoneAuthentication(
3951
$this->args,
4052
$this::DEMO_DOCS_PATH,

src/Controllers/Examples/eSignature/EG022KbAuthentication.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ public function createController(): void
3737
# Obtain your OAuth Token
3838
$this->checkDsToken();
3939

40+
if($this->args['envelope_args']['signer_email'] == $GLOBALS['DS_CONFIG']['signer_email']) {
41+
$GLOBALS['twig']->display(
42+
'error.html',
43+
[
44+
'error_code' => "400",
45+
'error_message' => ManifestService::getCommonTexts()['RecipientShouldDifferFromSender'],
46+
'common_texts' => ManifestService::getCommonTexts()
47+
]
48+
);
49+
exit;
50+
}
51+
4052
$envelopeAuthentification = KbAuthenticationService::kbAuthentification(
4153
$this->args,
4254
$this->clientService,

src/Controllers/Examples/eSignature/EG023IDVAuthentication.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ public function createController(): void
3939
$this->checkDsToken();
4040

4141
try {
42+
if($this->args['envelope_args']['signer_email'] == $GLOBALS['DS_CONFIG']['signer_email']) {
43+
$GLOBALS['twig']->display(
44+
'error.html',
45+
[
46+
'error_code' => "400",
47+
'error_message' => ManifestService::getCommonTexts()['RecipientShouldDifferFromSender'],
48+
'common_texts' => ManifestService::getCommonTexts()
49+
]
50+
);
51+
exit;
52+
}
53+
4254
$envelopeAuthentification = IDVAuthenticationService::idvAuthentication(
4355
$this->args,
4456
$this->clientService,

templates/esignature/eg020_phone_authentication.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ <h4>{{ code_example_text['ExampleName'] | raw }}</h4>
7676
name="signer_email"
7777
aria-describedby="emailHelp"
7878
placeholder="{{code_example_text['Forms'][formNumber]['Inputs'][signerEmailInputNumber]['InputPlaceholder']}}"
79-
required
80-
value="{{ signer_email }}">
79+
required>
8180

8281
<small id="emailHelp" class="form-text text-muted">
8382
{{ common_texts["HelpingTexts"]["EmailWontBeShared"] | raw }}
@@ -93,7 +92,6 @@ <h4>{{ code_example_text['ExampleName'] | raw }}</h4>
9392
id="signer_name"
9493
placeholder="{{code_example_text['Forms'][formNumber]['Inputs'][signerNameInputNumber]['InputPlaceholder']}}"
9594
name="signer_name"
96-
value="{{ signer_name }}"
9795
required>
9896
</div>
9997
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>

templates/esignature/eg022_kba_authentication.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ <h4>{{ code_example_text['ExampleName'] | raw }}</h4>
5050
name="signer_email"
5151
aria-describedby="emailHelp"
5252
placeholder="{{code_example_text['Forms'][formNumber]['Inputs'][signerEmailInputNumber]['InputPlaceholder']}}"
53-
required
54-
value="{{ signer_email }}">
53+
required>
5554

5655
<small id="emailHelp" class="form-text text-muted">
5756
{{ common_texts["HelpingTexts"]["EmailWontBeShared"] | raw }}
@@ -67,7 +66,6 @@ <h4>{{ code_example_text['ExampleName'] | raw }}</h4>
6766
id="signer_name"
6867
placeholder="{{code_example_text['Forms'][formNumber]['Inputs'][signerNameInputNumber]['InputPlaceholder']}}"
6968
name="signer_name"
70-
value="{{ signer_name }}"
7169
required>
7270
</div>
7371
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>

templates/esignature/eg023_idv_authentication.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ <h4>{{ code_example_text['ExampleName'] | raw }}</h4>
5050
name="signer_email"
5151
aria-describedby="emailHelp"
5252
placeholder="{{code_example_text['Forms'][formNumber]['Inputs'][signerEmailInputNumber]['InputPlaceholder']}}"
53-
required
54-
value="{{ signer_email }}">
53+
required>
5554

5655
<small id="emailHelp" class="form-text text-muted">
5756
{{ common_texts["HelpingTexts"]["EmailWontBeShared"] | raw }}
@@ -67,7 +66,6 @@ <h4>{{ code_example_text['ExampleName'] | raw }}</h4>
6766
id="signer_name"
6867
placeholder="{{code_example_text['Forms'][formNumber]['Inputs'][signerNameInputNumber]['InputPlaceholder']}}"
6968
name="signer_name"
70-
value="{{ signer_name }}"
7169
required>
7270
</div>
7371
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>

0 commit comments

Comments
 (0)