3 # Copyright (C) 2008 Jason Woofenden
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Affero General Public License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 function tiny_agreement_get_fields() {
19 $name = format_oneline($_REQUEST['name']);
20 tem_set('name', $name);
22 $level = format_options($_REQUEST['level'], 'level');
24 return array($name, $level);
27 function tiny_agreement_main() {
29 $GLOBALS['url'] = this_url();
33 pulldown('level', array(
41 array('300', '$300')), PULLDOWN_2D);
43 if(isset($_REQUEST['name'])) {
44 list($name, $level) = tiny_agreement_get_fields();
48 db_update('people', 'name,tiny_agreement', $name, $level, 'where id=%i', logged_in());
49 message('Thank you for filling out the Tiny User Agreement.');
52 message('Please enter your name.');
55 message('Something went wrong there. Please try again');