Lines Matching defs:d
148 } elseif (check_data($_REQUEST['d'])) {
150 if (!store_data($_REQUEST['d'])) {
158 print_form($_REQUEST['d']);
178 * @param array $d submitted entry 'd' of request data
180 function print_form($d)
187 if (!is_array($d)) $d = [];
188 $d = array_map('hsc', $d);
190 if (!isset($d['acl'])) $d['acl'] = 1;
191 if (!isset($d['pop'])) $d['pop'] = 1;
198 <input type="text" name="d[title]" id="title" value="<?php echo $d['title'] ?>" style="width: 20em;"/>
203 <input type="checkbox" name="d[acl]"
204 id="acl" <?php echo(($d['acl'] ? ' checked="checked"' : '')); ?> />
209 <input class="text" type="text" name="d[superuser]" id="superuser"
210 value="<?php echo $d['superuser'] ?>"/>
213 <input class="text" type="text" name="d[fullname]" id="fullname"
214 value="<?php echo $d['fullname'] ?>"/>
217 <input class="text" type="text" name="d[email]" id="email" value="<?php echo $d['email'] ?>"/>
220 <input class="text" type="password" name="d[password]" id="password"/>
223 <input class="text" type="password" name="d[confirm]" id="confirm"/>
226 <select class="text" name="d[policy]" id="policy">
227 <option value="0" <?php echo ($d['policy'] == 0) ? 'selected="selected"' : '' ?>><?php
229 <option value="1" <?php echo ($d['policy'] == 1) ? 'selected="selected"' : '' ?>><?php
231 <option value="2" <?php echo ($d['policy'] == 2) ? 'selected="selected"' : '' ?>><?php
236 <input type="checkbox" name="d[allowreg]" id="allowreg" <?php
237 echo(($d['allowreg'] ? ' checked="checked"' : '')); ?> />
247 if (empty($d['license'])) $d['license'] = 'cc-by-sa';
250 echo '<input type="radio" name="d[license]" value="' . hsc($key) . '" id="lic_' . $key . '"' .
251 (($d['license'] === $key) ? ' checked="checked"' : '') . '>';
262 <input type="checkbox" name="d[pop]" id="pop" <?php
263 echo(($d['pop'] ? ' checked="checked"' : '')); ?> />
294 * @param array $d
299 function check_data(&$d)
316 if (!is_array($d)) $d = [];
317 foreach ($d as $k => $v) {
319 unset($d[$k]);
320 else $d[$k] = (string)$v;
324 $d['superuser'] = isset($d['superuser']) ? strtolower($d['superuser']) : "";
332 if (empty($d['title'])) {
336 if (isset($d['acl'])) {
337 if (empty($d['superuser']) || ($d['superuser'] !== cleanID($d['superuser']))) {
341 if (empty($d['password'])) {
344 } elseif (!isset($d['confirm']) || $d['confirm'] != $d['password']) {
348 if (empty($d['fullname']) || strstr($d['fullname'], ':')) {
352 if (empty($d['email']) || strstr($d['email'], ':') || !strstr($d['email'], '@')) {
358 $d['acl'] = '0';
361 $d = array_merge($form_default, $d);
368 * @param array $d
374 function store_data($d)
378 $d['policy'] = (int)$d['policy'];
401 $output .= '$conf[\'title\'] = \'' . addslashes($d['title']) . "';\n";
403 $output .= '$conf[\'license\'] = \'' . addslashes($d['license']) . "';\n";
404 if ($d['acl']) {
408 if (!$d['allowreg']) {
413 if ($d['acl']) {
416 $pass = $phash->hash_bcrypt($d['password']);
435 $d['superuser'],
437 $d['fullname'],
438 $d['email'],
455 if ($d['policy'] == 2) {
458 } elseif ($d['policy'] == 1) {
468 if (isset($d['pop']) && $d['pop']) {