-
Notifications
You must be signed in to change notification settings - Fork 3
/
registrazione.php
76 lines (73 loc) · 3.72 KB
/
registrazione.php
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
<?php
REQUIRE_ONCE __DIR__ . DIRECTORY_SEPARATOR . "toolkit.php";
if (session_status() == PHP_SESSION_NONE){
session_start();
}
$errmsgs = array();
$content = file_get_contents(__("strutturaregistrazione.html"));
addMobileStyleSheet("CSS" . DIRECTORY_SEPARATOR . "style_mobile.css", $content);
if (isset($_SESSION['reload'])){
unset( $_SESSION['reload'] );
$xml = new DOMDocument();
$xml->loadHTML($content);
$userErr = false;
if (isset($_SESSION['RuserErr'])){
$userErr = $_SESSION['RuserErr'];
}
prefillAndHighlight("Rusername", $userErr, $xml, $_SESSION['Rusername']);
$errorMail = false;
if (isset($_SESSION['RemailErr'])){
$errorMail = $_SESSION['RemailErr'];
}
if (isset($_SESSION['RemailErr2'])){
$errorMail = $errorMail || $_SESSION['RemailErr2'];
}
prefillAndHighlight("Remail", $errorMail, $xml, $_SESSION['Remail']);
prefillAndHighlight("Rtel", $_SESSION['RtelErr'], $xml, $_SESSION['Rtel']);
$errorPass = false;
if (isset($_SESSION["RpassErr"])){
$errorPass = $_SESSION['RpassErr'];
}
if (isset($_SESSION['RpassErr2'])){
$errorPass = $errorPass || $_SESSION['RpassErr2'];
}
prefillAndHighlight("Rpwd", $errorPass, $xml, "");
prefillAndHighlight("Rpwd2", $errorPass, $xml, "");
setHTMLNameSpaces($xml);
$content = $xml->saveXML($xml->documentElement);
addXHTMLdtd($content);
if (isset($_SESSION['RuserErr']) && $_SESSION['RuserErr']){
$errmsgs[] = "<a href=\"#Rusername\" title=\"" . getMessage("108") . "\">" . getMessage("226") . "</a>";
}
if (isset($_SESSION['RemailErr']) && $_SESSION['RemailErr']){
$errmsgs[] = "<a href=\"#Remail\" title=\"" . getMessage("106") . "\">" . getMessage("227") . "</a>";
}
if (isset($_SESSION['RemailErr2']) && $_SESSION['RemailErr2']){
$errmsgs[] = "<a href=\"#Remail\" title=\"" . getMessage("106") . "\">" . getMessage("221") . "</a>";
}
if (isset($_SESSION['RpassErr']) && $_SESSION['RpassErr']){
$errmsgs[] = "<a href=\"#Rpwd\" title=\"" . getMessage("105") . "\">" .getMessage("228") . "</a>";
}
if (isset($_SESSION['RpassErr2']) && $_SESSION['RpassErr2']){
$errmsgs[] = "<a href=\"#Rpwd\" title=\"" . getMessage("105") . "\">" .getMessage("229") . "</a>";
}
if (isset($_SESSION['RtelErr']) && $_SESSION['RtelErr']){
$errmsgs[] = "<a href=\"#Rtel\" title=\"" . getMessage("105") . "\">" .getMessage("222") . "</a>";
}
}else{
$xml = new DOMDocument();
$xml->loadHTML($content);
setHTMLNameSpaces($xml);
$content = $xml->saveXML($xml->documentElement);
addXHTMLdtd($content);
}
if (!(empty($errmsgs))){
$repl="<div id='errorlist'>";
foreach ($errmsgs as $error):
$repl = $repl . $error . "<br/>";
endforeach;
$repl= $repl . "</div>";
$content=str_replace("<!--STATOREGISTRAZIONE-->", $repl, $content);
}
echo($content);
?>