protected function build_usermanagement(rsContainer $Container) { if (isset($_GET['k']) && $_GET['k'] == 'usermanagement') { if (intval($_POST['userid'] > 0)) { $userdb = new rsMysql('user'); $rightsdb = new rsMysql('rights'); if (isset($_POST['email'])) { $gebdatum = explode('.', $_POST['geburtsdatum']); $userdb->update(array('vorname' => $_POST['vorname'], 'nachname' => $_POST['nachname'], 'aktiv' => $_POST['aktiv'] == 'on' ? '1' : '0', 'nickname' => strtolower($_POST['nickname']), 'klasse' => strtolower($_POST['klasse']), 'typ' => $_POST['typ'], 'amt' => $_POST['amt'], 'email' => strtolower($_POST['email']), 'geburtsdatum' => mktime(0, 0, 0, intval($gebdatum[1]), intval($gebdatum[0]), intval($gebdatum[2]))), '`id`=' . intval($_POST['userid'])); if ($_POST['docs'] != '' || $_POST['mediadirs'] != '') { $rightsdb->update_insert(array('docid' => $_POST['docs'], 'mediaid' => $_POST['mediadirs'], 'userid' => intval($_POST['userid'])), '`userid`=' . intval($_POST['userid'])); } $Container->subordinate('p', array('class' => 'success'), 'Der Benutzer "' . $_POST['vorname'] . ' ' . $_POST['nachname'] . '" (' . strtolower($_POST['email']) . ') wurde überarbeitet.'); } $user = $userdb->getRow('`id` = ' . intval($_POST['userid'])); $Container = $Container->subordinate('form', array('method' => 'post', 'class' => 'spalten')); $Container->subordinate('input', array('type' => 'hidden', 'name' => 'userid', 'value' => intval($_POST['userid']))); $Container->subordinate('p', '<div>Vorname:</div>')->subordinate('input', array('type' => 'text', 'name' => 'vorname', 'value' => $user['vorname'])); $Container->subordinate('p', '<div>Nachname:</div>')->subordinate('input', array('type' => 'text', 'name' => 'nachname', 'value' => $user['nachname'])); $Container->subordinate('p', '<div>Freigeschaltet:</div>')->subordinate('input', array('type' => 'checkbox', 'name' => 'aktiv', 'checked' => $user['aktiv'] == 0 ? 'false' : 'true')); $Container->subordinate('p', '<div>Klasse:</div>')->subordinate('input', array('type' => 'text', 'name' => 'klasse', 'value' => $user['klasse'])); $Container->subordinate('p', '<div>Nickname:</div>')->subordinate('input', array('type' => 'text', 'name' => 'nickname', 'value' => $user['nickname'])); $Container->subordinate('p', '<div>eMail-Adresse:</div>')->subordinate('input', array('type' => 'text', 'name' => 'email', 'value' => $user['email'])); $Container->subordinate('p', '<div>Amt:</div>')->subordinate('input', array('type' => 'text', 'name' => 'amt', 'value' => $user['amt'])); $Container->subordinate('p', '<div>Geburtsdatum:</div>')->subordinate('input', array('type' => 'text', 'name' => 'geburtsdatum', 'value' => date('d.m.Y', $user['geburtsdatum']))); $Typ = $Container->subordinate('p', '<div>Benutzer-Typ:</div>')->subordinate('select', array('name' => 'typ')); $Typ->subordinate('option', array('value' => 'schueler'), 'Schüler'); $Typ->subordinate('option', array('value' => 'lehrer'), 'Lehrer'); $Typ->subordinate('option', array('value' => 'aussenstehender'), 'Außenstehender'); $Container->subordinate('p', '<div>Dokument(e):</div>')->subordinate('input', array('type' => 'text', 'name' => 'docs', 'value' => $rightsdb->getColumn('docid', '`userid`=' . $user['id']))); $Container->subordinate('p', '<div>Medienverzeichniss(e):</div>')->subordinate('input', array('type' => 'text', 'name' => 'mediadirs', 'value' => $rightsdb->getColumn('mediaid', '`userid`=' . $user['id']))); $Container->subordinate('p', '<div></div>')->subordinate('input', array('type' => 'submit', 'value' => 'Änderungen sichern'))->subordinate('input', array('type' => 'button', 'onClick' => 'document.location.href=\'?i=' . $this->docid . '&j=administration\'', 'value' => 'Abbrechen')); } else { $Container = $Container->subordinate('form', array('method' => 'post')); $Container->subordinate('p', '<div>Benutzer: <span id="foundusername"></span></div>')->subordinate('input', array('type' => 'hidden', 'name' => 'userid', 'id' => 'inputfounduserid'))->subordinate('div', array('id' => 'getUser')); $Container->subordinate('div', array('id' => 'userprofile')); $Container->subordinate('p', '<div></div>')->subordinate('input', array('type' => 'submit', 'value' => 'Benutzerkonto bearbeiten'))->subordinate('input', array('type' => 'button', 'onClick' => 'document.location.href=\'?i=' . $this->docid . '&j=administration\'', 'value' => 'Abbrechen')); } } }
protected function process_validation(rsContainer $Container) { $postdb = new rsMysql('guestbook'); $data = $postdb->getRow('`id` = ' . intval($_GET['postid'])); if ($_GET['guestbook'] == md5($data['name'] . $data['email'] . $data['timestamp'])) { $postdb->update(array('valid' => 1), '`id` = ' . intval($_GET['postid'])); } else { $Container->subordinate('p', array('class' => 'error'), 'Der Link stimmt nicht oder Sie haben sich mit der Freischaltung zu viel Zeit gelassen.'); return false; } return true; }