Subversion Repositories oidplus

Rev

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

Rev 1116 Rev 1130
Line 74... Line 74...
74
        echo '<p>'._L('Please enter the administrator password you have entered before.').'</p>';
74
        echo '<p>'._L('Please enter the administrator password you have entered before.').'</p>';
75
 
75
 
76
        echo '<p><input type="password" name="admin_password" value=""> (<a href="'.OIDplus::webpath(null,OIDplus::PATH_RELATIVE).'setup/">'._L('Forgot password?').'</a>) ';
76
        echo '<p><input type="password" name="admin_password" value=""> (<a href="'.OIDplus::webpath(null,OIDplus::PATH_RELATIVE).'setup/">'._L('Forgot password?').'</a>) ';
77
 
77
 
78
        if (isset($_POST['sent'])) {
78
        if (isset($_POST['sent'])) {
79
                if (!OIDplus::authUtils()->adminCheckPassword(isset($_POST['admin_password']) ? $_POST['admin_password'] : '')) {
79
                if (!OIDplus::authUtils()->adminCheckPassword($_POST['admin_password'] ?? '')) {
80
                        $errors_happened = true;
80
                        $errors_happened = true;
81
                        $edits_possible = false;
81
                        $edits_possible = false;
82
                        echo '<font color="red"><b>'._L('Wrong password').'</b></font>';
82
                        echo '<font color="red"><b>'._L('Wrong password').'</b></font>';
83
                }
83
                }
84
        }
84
        }
Line 90... Line 90...
90
$do_edits = isset($_POST['sent']) && $edits_possible;
90
$do_edits = isset($_POST['sent']) && $edits_possible;
91
#------------------------
91
#------------------------
92
 
92
 
93
# ---
93
# ---
94
 
94
 
-
 
95
/**
-
 
96
 * @param int $step
-
 
97
 * @param bool $do_edits
-
 
98
 * @param bool $errors_happened
-
 
99
 * @return void
-
 
100
 * @throws OIDplusException
-
 
101
 * @throws \ViaThinkSoft\OIDplus\OIDplusConfigInitializationException
-
 
102
 */
95
function step_admin_email($step, $do_edits, &$errors_happened) {
103
function step_admin_email(int $step, bool $do_edits, bool &$errors_happened) {
96
        echo '<h2>'._L('Step %1: Please enter the email address of the system administrator',$step).'</h2>';
104
        echo '<h2>'._L('Step %1: Please enter the email address of the system administrator',$step).'</h2>';
97
        echo '<input type="text" name="admin_email" value="';
105
        echo '<input type="text" name="admin_email" value="';
98
 
106
 
99
        $msg = '';
107
        $msg = '';
100
        if (isset($_POST['sent'])) {
108
        if (isset($_POST['sent'])) {
101
                echo htmlentities(isset($_POST['admin_email']) ? $_POST['admin_email'] : '');
109
                echo htmlentities($_POST['admin_email'] ?? '');
102
                if ($do_edits) {
110
                if ($do_edits) {
103
                        try {
111
                        try {
104
                                OIDplus::config()->setValue('admin_email', isset($_POST['admin_email']) ? $_POST['admin_email'] : '');
112
                                OIDplus::config()->setValue('admin_email', $_POST['admin_email'] ?? '');
105
                        } catch (\Exception $e) {
113
                        } catch (\Exception $e) {
106
                                $msg = $e->getMessage();
114
                                $msg = $e->getMessage();
107
                                $errors_happened = true;
115
                                $errors_happened = true;
108
                        }
116
                        }
109
                }
117
                }
Line 115... Line 123...
115
}
123
}
116
step_admin_email($step++, $do_edits, $errors_happened);
124
step_admin_email($step++, $do_edits, $errors_happened);
117
 
125
 
118
# ---
126
# ---
119
 
127
 
-
 
128
/**
-
 
129
 * @param int $step
-
 
130
 * @param bool $do_edits
-
 
131
 * @param bool $errors_happened
-
 
132
 * @return void
-
 
133
 * @throws OIDplusException
-
 
134
 * @throws \ViaThinkSoft\OIDplus\OIDplusConfigInitializationException
-
 
135
 */
120
function step_system_title($step, $do_edits, &$errors_happened) {
136
function step_system_title(int $step, bool $do_edits, bool &$errors_happened) {
121
        echo '<h2>'._L('Step %1: What title should your Registration Authority / OIDplus instance have?',$step).'</h2>';
137
        echo '<h2>'._L('Step %1: What title should your Registration Authority / OIDplus instance have?',$step).'</h2>';
122
        echo '<input type="text" name="system_title" value="';
138
        echo '<input type="text" name="system_title" value="';
123
 
139
 
124
        $msg = '';
140
        $msg = '';
125
        if (isset($_POST['sent'])) {
141
        if (isset($_POST['sent'])) {
126
                echo htmlentities(isset($_POST['system_title']) ? $_POST['system_title'] : '');
142
                echo htmlentities($_POST['system_title'] ?? '');
127
                if ($do_edits) {
143
                if ($do_edits) {
128
                        try {
144
                        try {
129
                                OIDplus::config()->setValue('system_title', isset($_POST['system_title']) ? $_POST['system_title'] : '');
145
                                OIDplus::config()->setValue('system_title', $_POST['system_title'] ?? '');
130
                        } catch (\Exception $e) {
146
                        } catch (\Exception $e) {
131
                                $msg = $e->getMessage();
147
                                $msg = $e->getMessage();
132
                                $errors_happened = true;
148
                                $errors_happened = true;
133
                        }
149
                        }
134
                }
150
                }