Subversion Repositories oidplus

Rev

Rev 1018 | Rev 1050 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1018 Rev 1033
Line 62... Line 62...
62
 
62
 
63
echo '<form method="POST" action="oobe.php">';
63
echo '<form method="POST" action="oobe.php">';
64
echo '<input type="hidden" name="sent" value="1">';
64
echo '<input type="hidden" name="sent" value="1">';
65
 
65
 
66
if (OIDplus::getActiveCaptchaPlugin()->isVisible()) echo '<p><u>'._L('Step %1: Solve CAPTCHA',$step++).'</u></p>';
66
if (OIDplus::getActiveCaptchaPlugin()->isVisible()) echo '<p><u>'._L('Step %1: Solve CAPTCHA',$step++).'</u></p>';
67
if (isset($_REQUEST['sent'])) {
67
if (isset($_POST['sent'])) {
68
        try {
68
        try {
69
                OIDplus::getActiveCaptchaPlugin()->captchaVerify($_POST);
69
                OIDplus::getActiveCaptchaPlugin()->captchaVerify($_POST);
70
        } catch (Exception $e) {
70
        } catch (Exception $e) {
71
                echo '<p><font color="red"><b>'.htmlentities($e->getMessage()).'</b></font></p>';
71
                echo '<p><font color="red"><b>'.htmlentities($e->getMessage()).'</b></font></p>';
72
                $errors_happened = true;
72
                $errors_happened = true;
Line 85... Line 85...
85
 
85
 
86
        echo '<p>'._L('Please enter the administrator password you have entered before.').'</p>';
86
        echo '<p>'._L('Please enter the administrator password you have entered before.').'</p>';
87
 
87
 
88
        echo '<p><input type="password" name="admin_password" value=""> (<a href="'.OIDplus::webpath(null,OIDplus::PATH_RELATIVE).'setup/">'._L('Forgot password?').'</a>) ';
88
        echo '<p><input type="password" name="admin_password" value=""> (<a href="'.OIDplus::webpath(null,OIDplus::PATH_RELATIVE).'setup/">'._L('Forgot password?').'</a>) ';
89
 
89
 
90
        if (isset($_REQUEST['sent'])) {
90
        if (isset($_POST['sent'])) {
91
                if (!OIDplus::authUtils()->adminCheckPassword(isset($_REQUEST['admin_password']) ? $_REQUEST['admin_password'] : '')) {
91
                if (!OIDplus::authUtils()->adminCheckPassword(isset($_POST['admin_password']) ? $_POST['admin_password'] : '')) {
92
                        $errors_happened = true;
92
                        $errors_happened = true;
93
                        $edits_possible = false;
93
                        $edits_possible = false;
94
                        echo '<font color="red"><b>'._L('Wrong password').'</b></font>';
94
                        echo '<font color="red"><b>'._L('Wrong password').'</b></font>';
95
                }
95
                }
96
        }
96
        }
97
 
97
 
98
        echo '</p>';
98
        echo '</p>';
99
}
99
}
100
 
100
 
101
#------------------------
101
#------------------------
102
$do_edits = isset($_REQUEST['sent']) && $edits_possible;;
102
$do_edits = isset($_POST['sent']) && $edits_possible;;
103
#------------------------
103
#------------------------
104
 
104
 
105
# ---
105
# ---
106
 
106
 
107
function step_admin_email($step, $do_edits, &$errors_happened) {
107
function step_admin_email($step, $do_edits, &$errors_happened) {
108
        echo '<p><u>'._L('Step %1: Please enter the email address of the system administrator',$step).'</u></p>';
108
        echo '<p><u>'._L('Step %1: Please enter the email address of the system administrator',$step).'</u></p>';
109
        echo '<input type="text" name="admin_email" value="';
109
        echo '<input type="text" name="admin_email" value="';
110
 
110
 
111
        $msg = '';
111
        $msg = '';
112
        if (isset($_REQUEST['sent'])) {
112
        if (isset($_POST['sent'])) {
113
                echo htmlentities(isset($_REQUEST['admin_email']) ? $_REQUEST['admin_email'] : '');
113
                echo htmlentities(isset($_POST['admin_email']) ? $_POST['admin_email'] : '');
114
                if ($do_edits) {
114
                if ($do_edits) {
115
                        try {
115
                        try {
116
                                OIDplus::config()->setValue('admin_email', isset($_REQUEST['admin_email']) ? $_REQUEST['admin_email'] : '');
116
                                OIDplus::config()->setValue('admin_email', isset($_POST['admin_email']) ? $_POST['admin_email'] : '');
117
                        } catch (Exception $e) {
117
                        } catch (Exception $e) {
118
                                $msg = $e->getMessage();
118
                                $msg = $e->getMessage();
119
                                $errors_happened = true;
119
                                $errors_happened = true;
120
                        }
120
                        }
121
                }
121
                }
Line 132... Line 132...
132
function step_system_title($step, $do_edits, &$errors_happened) {
132
function step_system_title($step, $do_edits, &$errors_happened) {
133
        echo '<p><u>'._L('Step %1: What title should your Registration Authority / OIDplus instance have?',$step).'</u></p>';
133
        echo '<p><u>'._L('Step %1: What title should your Registration Authority / OIDplus instance have?',$step).'</u></p>';
134
        echo '<input type="text" name="system_title" value="';
134
        echo '<input type="text" name="system_title" value="';
135
 
135
 
136
        $msg = '';
136
        $msg = '';
137
        if (isset($_REQUEST['sent'])) {
137
        if (isset($_POST['sent'])) {
138
                echo htmlentities(isset($_REQUEST['system_title']) ? $_REQUEST['system_title'] : '');
138
                echo htmlentities(isset($_POST['system_title']) ? $_POST['system_title'] : '');
139
                if ($do_edits) {
139
                if ($do_edits) {
140
                        try {
140
                        try {
141
                                OIDplus::config()->setValue('system_title', isset($_REQUEST['system_title']) ? $_REQUEST['system_title'] : '');
141
                                OIDplus::config()->setValue('system_title', isset($_POST['system_title']) ? $_POST['system_title'] : '');
142
                        } catch (Exception $e) {
142
                        } catch (Exception $e) {
143
                                $msg = $e->getMessage();
143
                                $msg = $e->getMessage();
144
                                $errors_happened = true;
144
                                $errors_happened = true;
145
                        }
145
                        }
146
                }
146
                }