(aka. Someone ) */ require_once(FUNCS_PATH.'/settings.php'); require_once(FUNCS_PATH.'/db_funcs.php'); require_once(FUNCS_PATH.'/html_funcs.php'); function login(){ if(!isset($_SERVER['HTTPS'])){ $url = 'https://'.$_SERVER["HTTP_HOST"].$_SERVER['REQUEST_URI']; header('Location: '.$url, true, 301); exit('

Redirecting to: '.$url.'

'); } $uinfo = db_get_uinfo($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); if($uinfo['lvl'] >= 1){ $GLOBALS['uname'] = $uinfo['uname']; $GLOBALS['lvl'] = $uinfo['lvl']; }else{ header('WWW-Authenticate: Basic realm="WelcomeTUcode login"'); header('HTTP/1.0 401 Unauthorized'); exit(html_top("Anmeldesystem").html_linkbox().'Nicht eingeloggt. Falsche Anmeldedaten?'.html_bottom()); } } function list_anmeldungen(){ $liste = db_list_anmeldungen(); $ret = ''. ''. ''."\n"; foreach ($liste as &$person) { $ret .=''; $ret .=''; $ret .=''; $ret .=''; $ret .=''."\n"; } return $ret.'
AktionidAnmeldung beiNachname(n)Vorname(n)GeborenNationalitätSprachkenntnisVorwissenAnalphabetGruppen-Foto-VideoerlaubnisStatusBemerkungTermin
Bearbeiten'.$person['id'].''.$person['uname'].''.$person['nname'].''.$person['vname'].''.$person['gebdatum'].''.$person['nationaliaet'].''.$person['sprachen'].''.$person['vorwissen'].''.$person['analphabet'].''.$person['gruppenfotoerlaubnis'].''.$person['fotoerlaubnis'].''.$person['videoerlaubnis'].''.$person['status'].''.$person['bemerkungen'].''.$person['termin'].'
'."\n"; } function store_person(){ if(!isset($_REQUEST['delete']) && !isset($_REQUEST['save']))return; //var_export($_REQUEST); if(isset($_REQUEST['delete']))return db_delete_person($_REQUEST['id']); if(isset($_REQUEST['save'])){ if(!isset($_REQUEST['vname']))throw new Exception('NOT_SET vname'); $pdata['vname']=$_REQUEST['vname']; if(!isset($_REQUEST['nname']))throw new Exception('NOT_SET nname'); $pdata['nname']=$_REQUEST['nname']; if($pdata['vname'] == '' && $pdata['nname'] == '')throw new Exception('NO_NAME'); if(!isset($_REQUEST['gebdatum']))throw new Exception('NOT_SET gebdatum'); $pdata['gebdatum']=$_REQUEST['gebdatum']; if(!isset($_REQUEST['nationaliaet']))throw new Exception('NOT_SET nationalitaet'); $pdata['nationaliaet']=$_REQUEST['nationaliaet']; if(!isset($_REQUEST['sprachen']))throw new Exception('NOT_SET sprachen'); $pdata['sprachen']=$_REQUEST['sprachen']; if(!isset($_REQUEST['vorwissen']))throw new Exception('NOT_SET vorwissen'); $pdata['vorwissen']=$_REQUEST['vorwissen']; if(!isset($_REQUEST['analphabet']))$_REQUEST['analphabet'] = '0'; $pdata['analphabet']=$_REQUEST['analphabet']; if(!isset($_REQUEST['fotoerlaubnis']))$_REQUEST['fotoerlaubnis'] = '0'; $pdata['fotoerlaubnis']=$_REQUEST['fotoerlaubnis']; if(!isset($_REQUEST['gruppenfotoerlaubnis']))$_REQUEST['gruppenfotoerlaubnis'] = '0'; $pdata['gruppenfotoerlaubnis']=$_REQUEST['gruppenfotoerlaubnis']; if(!isset($_REQUEST['videoerlaubnis']))$_REQUEST['videoerlaubnis'] = '0'; $pdata['videoerlaubnis']=$_REQUEST['videoerlaubnis']; if(!isset($_REQUEST['bemerkungen']))throw new Exception('NOT_SET bemerkungen'); $pdata['bemerkungen']=$_REQUEST['bemerkungen']; if(!isset($_REQUEST['termin']))throw new Exception('NOT_SET termin'); $pdata['termin']=$_REQUEST['termin']; if(!isset($_REQUEST['status']))throw new Exception('NOT_SET status'); $pdata['status']=$_REQUEST['status']; return db_store_person($_REQUEST['id'], $pdata); } } function get_person($id){ if(!is_numeric($id)) return NULL; return db_get_person($id); }