8a4acb54b452ad801825c59cc7aa542eae0f9f3f
bernd webinterface => /webinterface

bernd authored 17 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15) */
bernd webinterface => /webinterface

bernd authored 17 years ago

16) 
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

17) require_once('class/database.php');
bernd add a function to handle re...

bernd authored 14 years ago

18) require_once('inc/debug.php');
bernd sql-abfragen abstrahiert

bernd authored 16 years ago

19) 
schokokeks.org web services Ermögliche Socket-Angabe fü...

schokokeks.org web services authored 10 years ago

20) function config($key, $localonly = false)
bernd Mehr config-optionen und co...

bernd authored 14 years ago

21) {
22)   global $config;
bernd Erlaube subusers, die nur Z...

bernd authored 13 years ago

23) 
Bernd Wurst Lizenzinfos in eigenes Modu...

Bernd Wurst authored 10 years ago

24)   if ($key == "modules") {
25)     // Stelle sicher, dass das "index"-Modul immer aktiv ist!
26)     if (! in_array("index", $config['modules'])) {
27)       $config['modules'][] = "index";
28)     }
29)     // Stelle sicher, dass das "about"-Modul immer aktiv ist!
30)     if (! in_array("about", $config['modules'])) {
31)       $config['modules'][] = "about";
32)     }
33)   }
34) 
bernd Erlaube subusers, die nur Z...

bernd authored 13 years ago

35)   if ($key == 'modules' && isset($_SESSION['restrict_modules']))
36)   {
37)     $modules = array();
38)     foreach ($config['modules'] as $mod)
39)     {
40)       if (in_array($mod, $_SESSION['restrict_modules']))
41)         $modules[] = $mod;
42)     }
43)     return $modules;
44)   }
45) 
bernd config() liest die Datenban...

bernd authored 14 years ago

46)   if (array_key_exists($key, $config))
47)     return $config[$key];
48)   
schokokeks.org web services Ermögliche Socket-Angabe fü...

schokokeks.org web services authored 10 years ago

49)   if ($localonly) {
50)     return NULL;
51)   }  
52) 
bernd config() liest die Datenban...

bernd authored 14 years ago

53)   /* read configuration from database */
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

54)   $result = db_query( "SELECT `key`, value FROM misc.config" );
bernd config() liest die Datenban...

bernd authored 14 years ago

55)   
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

56)   while( $object = $result->fetch() ) {
schokokeks.org web services Config-File-Optionen werden...

schokokeks.org web services authored 10 years ago

57)     if (!array_key_exists($object['key'], $config)) {
Bernd Wurst Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 years ago

58) 	    $config[$object['key']]=$object['value'];
schokokeks.org web services Config-File-Optionen werden...

schokokeks.org web services authored 10 years ago

59)     }
bernd config() liest die Datenban...

bernd authored 14 years ago

60)   }
bernd Passwort-Ändern geht jetzt...

bernd authored 13 years ago

61)   // Sonst wird das Passwort des webadmin-Users mit ausgegeben
62)   $debug_config = $config;
63)   unset($debug_config['db_pass']);
64)   DEBUG($debug_config);
bernd Mehr config-optionen und co...

bernd authored 14 years ago

65)   if (array_key_exists($key, $config))
66)     return $config[$key];
67)   else
bernd Logger mit Logleveln

bernd authored 14 years ago

68)     logger(LOG_ERR, "inc/base", "config", "Request to read nonexistant config option »{$key}«.");
bernd Einige Dummheiten repariert...

bernd authored 14 years ago

69)     return NULL;
bernd Mehr config-optionen und co...

bernd authored 14 years ago

70) }
71) 
bernd Info-Seite über Mail-Login-...

bernd authored 13 years ago

72) function get_server_by_id($id) {
73)   $id = (int) $id;
Bernd Wurst Weitere Prepared-Statement-...

Bernd Wurst authored 10 years ago

74)   $result = db_query("SELECT hostname FROM system.servers WHERE id=?", array($id));
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

75)   $ret = $result->fetch();
76)   return $ret['hostname'];
bernd Info-Seite über Mail-Login-...

bernd authored 13 years ago

77) }
78) 
bernd Mehr config-optionen und co...

bernd authored 14 years ago

79) 
bernd add a function to handle re...

bernd authored 14 years ago

80) function redirect($target)
81) {
82)   global $debugmode;
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

83)   if (! $debugmode) {
bernd add a function to handle re...

bernd authored 14 years ago

84)     header("Location: {$target}");
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

85)   } else {
Bernd Wurst Lasse die API bestimmen was...

Bernd Wurst authored 6 years ago

86)       if ($target == '') {
87)           $target = $_SERVER['REQUEST_URI'];
88)       }
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

89)       if (strpos($target, '?') === false) {
90)         print 'REDIRECT: '.internal_link($target, $target);
91)       } else {
92)           list($file, $qs) = explode('?', $target, 2);
93)           print 'REDIRECT: '.internal_link($file, $target, $qs);
94)       }
95)   }
bernd add a function to handle re...

bernd authored 14 years ago

96)   die();
97) }
98) 
99) 
bernd Hilfsfunktionen bzgl. mehre...

bernd authored 14 years ago

100) function my_server_id()
101) {
102)   $uid = (int) $_SESSION['userinfo']['uid'];
Bernd Wurst Einige Statements auf Prepa...

Bernd Wurst authored 10 years ago

103)   $result = db_query("SELECT server FROM system.useraccounts WHERE uid=?", array($uid));
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

104)   $r = $result->fetch();
bernd Hilfsfunktionen bzgl. mehre...

bernd authored 14 years ago

105)   DEBUG($r);
106)   return $r['server'];
107) }
108) 
109) 
110) function additional_servers()
111) {
112)   $uid = (int) $_SESSION['userinfo']['uid'];
Bernd Wurst Einige Statements auf Prepa...

Bernd Wurst authored 10 years ago

113)   $result = db_query("SELECT server FROM system.user_server WHERE uid=?", array($uid));
bernd Hilfsfunktionen bzgl. mehre...

bernd authored 14 years ago

114)   $servers = array();
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

115)   while ($s = $result->fetch())
bernd Hilfsfunktionen bzgl. mehre...

bernd authored 14 years ago

116)     $servers[] = $s['server'];
117)   DEBUG($servers);
118)   return $servers;
119) }
120) 
121) 
122) function server_names()
123) {
Bernd Wurst Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 years ago

124)   $result = db_query("SELECT id, hostname FROM system.servers");
bernd Hilfsfunktionen bzgl. mehre...

bernd authored 14 years ago

125)   $servers = array();
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

126)   while ($s = $result->fetch())
bernd Hilfsfunktionen bzgl. mehre...

bernd authored 14 years ago

127)     $servers[$s['id']] = $s['hostname'];
128)   DEBUG($servers);
129)   return $servers;
130) }
131) 
132) 
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

133) function maybe_null($value)
134) {
Bernd Wurst Funktion maybe_null() umdef...

Bernd Wurst authored 6 years ago

135)   if (! $value)
136)     return NULL;
bernd maybe_null behandelt jetzt...

bernd authored 14 years ago

137) 
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

138)   if (strlen( (string) $value ) > 0)
Bernd Wurst Funktion maybe_null() umdef...

Bernd Wurst authored 6 years ago

139)     return (string) $value;
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

140)   else
Bernd Wurst Funktion maybe_null() umdef...

Bernd Wurst authored 6 years ago

141)     return NULL;
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

142) }
143) 
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

144) 
bernd Logger mit Logleveln

bernd authored 14 years ago

145) #define('LOG_ERR', 3);
146) #define('LOG_WARNING', 4);
147) #define('LOG_INFO', 6);
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

148) 
bernd Logger mit Logleveln

bernd authored 14 years ago

149) function logger($severity, $scriptname, $scope, $message)
bernd Logging aktiviert

bernd authored 16 years ago

150) {
bernd Logger mit Logleveln

bernd authored 14 years ago

151)   if (config('logging') <= $severity)
bernd Logging konfigurierbar

bernd authored 16 years ago

152)     return;
153) 
Bernd Wurst * Weitere Module auf prepar...

Bernd Wurst authored 10 years ago

154)   $user = NULL;
bernd Bugfix: Logger zeigt wieder...

bernd authored 16 years ago

155)   if ($_SESSION['role'] & ROLE_SYSTEMUSER)
Bernd Wurst * Weitere Module auf prepar...

Bernd Wurst authored 10 years ago

156)     $user = $_SESSION['userinfo']['username'];
bernd Bugfix: Logger zeigt wieder...

bernd authored 16 years ago

157)   elseif ($_SESSION['role'] & ROLE_CUSTOMER)
Bernd Wurst * Weitere Module auf prepar...

Bernd Wurst authored 10 years ago

158)     $user = $_SESSION['customerinfo']['customerno'];
bernd Logging aktiviert

bernd authored 16 years ago

159)   
Bernd Wurst * Weitere Module auf prepar...

Bernd Wurst authored 10 years ago

160)   $args = array(":user" => $user,
161)                 ":remote" => $_SERVER['REMOTE_ADDR'],
162)                 ":scriptname" => $scriptname,
163)                 ":scope" => $scope,
164)                 ":message" => $message);
bernd Logging aktiviert

bernd authored 16 years ago

165) 
Bernd Wurst * Weitere Module auf prepar...

Bernd Wurst authored 10 years ago

166)   db_query("INSERT INTO misc.scriptlog (remote, user,scriptname,scope,message) VALUES (:remote, :user, :scriptname, :scope, :message)", $args);
bernd Logging aktiviert

bernd authored 16 years ago

167) }
168) 
bernd Allow Header entries and AJAX

bernd authored 15 years ago

169) function html_header($arg)
170) {
171)   global $html_header;
172)   $html_header .= $arg;
173) }
bernd Logging aktiviert

bernd authored 16 years ago

174) 
bernd Umstellung auf Theme-Suppor...

bernd authored 13 years ago

175) function title($arg)
176) {
177)   global $title;
178)   $title = $arg;
179) }
180) 
181) function headline($arg)
182) {
183)   global $headline;
184)   $headline = $arg;
185) }
186) 
bernd webinterface => /webinterface

bernd authored 17 years ago

187) function output($arg)
188) {
189)   global $output;
190)   $output .= $arg;
191) }
192) 
Bernd Wurst Funktion für Fußnoten einge...

Bernd Wurst authored 6 years ago

193) function footnote($explaination)
194) {
195)     global $footnotes;
196)     if (!isset($footnotes) || !is_array($footnotes)) {
197)         $footnotes = array();
198)     }
199)     $fnid = array_search($explaination, $footnotes);
Bernd Wurst Bugfix für Fußnoten

Bernd Wurst authored 6 years ago

200)     DEBUG($footnotes);
201)     if ($fnid === FALSE) {
202)         DEBUG("Footnote »{$explaination}« is not in footnotes!");
Bernd Wurst Funktion für Fußnoten einge...

Bernd Wurst authored 6 years ago

203)         $footnotes[] = $explaination;
204)     }
205)     $fnid = array_search($explaination, $footnotes);
206)     return str_repeat('*', ($fnid+1));
207) }
bernd webinterface => /webinterface

bernd authored 17 years ago

208) 
Bernd Wurst random_string korrigiert, s...

Bernd Wurst authored 7 years ago

209) function random_string($len) 
Bernd Wurst random_string() verwendet u...

Bernd Wurst authored 7 years ago

210) {
Bernd Wurst random_string korrigiert, s...

Bernd Wurst authored 7 years ago

211)   $s = str_replace('+', '.', base64_encode(random_bytes(ceil($len*3/4))));
212)   return substr($s, 0, $len);
Bernd Wurst random_string() verwendet u...

Bernd Wurst authored 7 years ago

213) }
bernd webinterface => /webinterface

bernd authored 17 years ago

214) 
215) 
216) function are_you_sure($query_string, $question)
217) {
bernd * alle internen Links sinnv...

bernd authored 15 years ago

218)   $query_string = encode_querystring($query_string);
bernd webinterface => /webinterface

bernd authored 17 years ago

219)   $token = random_string(20);
bernd XSRF-kram fixed

bernd authored 16 years ago

220)   $_SESSION['are_you_sure_token'] = $token;
bernd Benutze überall title() sta...

bernd authored 13 years ago

221)   title('Sicherheitsabfrage');
222)   output("
bernd * alle internen Links sinnv...

bernd authored 15 years ago

223)     <form action=\"{$query_string}\" method=\"post\">
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

224)     <div class=\"confirmation\">
225)       <div class=\"question\">{$question}</div>
226)       <p class=\"buttons\">
227)         <input type=\"hidden\" name=\"random_token\" value=\"{$token}\" />
228)         <input type=\"submit\" name=\"really\" value=\"Ja\" />
bernd Entities repariert

bernd authored 16 years ago

229)         &#160; &#160;
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

230)         <input type=\"submit\" name=\"not_really\" value=\"Nein\" />
231)       </p>
232)     </div>");
bernd </form>

bernd authored 16 years ago

233)   output("</form>\n");
bernd webinterface => /webinterface

bernd authored 17 years ago

234) }
235) 
236) 
237) function user_is_sure()
238) {
239)   if (isset($_POST['really']))
240)   {
bernd XSRF-kram fixed

bernd authored 16 years ago

241)     if ($_POST['random_token'] == $_SESSION['are_you_sure_token'])
bernd webinterface => /webinterface

bernd authored 17 years ago

242)       return true;
243)     else
244)       system_failure("Possible Cross-site-request-forgery detected!");
245)   }
246)   elseif (isset($_POST['not_really']))
247)     return false;
248)   else
249)     return NULL;
250) }
251) 
252) 
253) 
bernd XSRF-kram fixed

bernd authored 16 years ago

254) function generate_form_token($form_id)
255) {
256)   require_once("inc/debug.php");
257)   $sessid = session_id();
258)   if ($sessid == "") 
259)   {
260)     DEBUG("Uh? Session not running? Wtf?");
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

261)     system_failure("Internal error!");
bernd XSRF-kram fixed

bernd authored 16 years ago

262)   }
Bernd Wurst random_string() verwendet u...

Bernd Wurst authored 7 years ago

263)   if (! isset($_SESSION['session_token'])) {
bernd XSRF-kram fixed

bernd authored 16 years ago

264)     $_SESSION['session_token'] = random_string(10);
Bernd Wurst random_string() verwendet u...

Bernd Wurst authored 7 years ago

265)   }
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

266)   return hash('sha256', $sessid.$form_id.$_SESSION['session_token']);
bernd XSRF-kram fixed

bernd authored 16 years ago

267) }
268) 
269) 
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

270) function check_form_token($form_id, $formtoken = NULL)
bernd XSRF-kram fixed

bernd authored 16 years ago

271) {
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

272)   if ($formtoken == NULL)
Bernd Wurst Neue MySQL-Verwaltung

Bernd Wurst authored 11 years ago

273)     $formtoken = $_REQUEST['formtoken'];
bernd XSRF-kram fixed

bernd authored 16 years ago

274)   $sessid = session_id();
275)   if ($sessid == "") 
276)   {
277)     DEBUG("Uh? Session not running? Wtf?");
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

278)     system_failure("Internal error! (Session not running)");
bernd XSRF-kram fixed

bernd authored 16 years ago

279)   }
280) 
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

281)   $correct_formtoken = hash('sha256', $sessid.$form_id.$_SESSION['session_token']);
bernd XSRF-kram fixed

bernd authored 16 years ago

282) 
283)   if (! ($formtoken == $correct_formtoken))
284)     system_failure("Possible cross-site-request-forgery!");
285) }
286) 
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

287) 
bernd Zeige Links auf dem Startse...

bernd authored 14 years ago

288) function have_module($modname)
289) {
bernd Mehr config-optionen und co...

bernd authored 14 years ago

290)   return in_array($modname, config('modules'));
bernd Zeige Links auf dem Startse...

bernd authored 14 years ago

291) }
292) 
293) 
Bernd Wurst Rudimentäre Adressauswahl/D...

Bernd Wurst authored 6 years ago

294) function use_module($modname) 
295) {
Bernd Wurst Aktualisiere Domain- und In...

Bernd Wurst authored 6 years ago

296)     global $prefix, $needed_modules;
297)     if (! isset($needed_modules)) {
298)         $needed_modules = array();
299)     }
300)     if (in_array($modname, $needed_modules)) {
301)         return;
302)     }
303)     $needed_modules[] = $modname;
Bernd Wurst Rudimentäre Adressauswahl/D...

Bernd Wurst authored 6 years ago

304)     if (! have_module($modname)) {
305)         system_failure("Soll nicht verfügbares Modul laden!");
306)     }
307)     /* setup module include path */
308)     ini_set('include_path',ini_get('include_path').':./modules/'.$modname.'/include:');
309)     $style = 'modules/'.$modname.'/style.css';
310)     if (file_exists($style)) {
311)         html_header('<link rel="stylesheet" href="'.$prefix.$style.'" type="text/css" />'."\n");
312)     }
313) 
314) }
315) 
316) 
bernd * alle internen Links sinnv...

bernd authored 15 years ago

317) function encode_querystring($querystring)
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

318) {
319)   global $debugmode;
320)   if ($debugmode)
bernd * alle internen Links sinnv...

bernd authored 15 years ago

321)     $querystring = 'debug&'.$querystring;
322)   $query = explode('&', $querystring);
323)   $new_query = array();
324)   foreach ($query AS $item)
325)     if ($item != '')
326)     {
bernd fix a warning

bernd authored 14 years ago

327)       $split = explode('=', $item, 2);
328)       if (count($split) == 1)
329)         $new_query[] = $split[0];
bernd Bug im Client-Zertfikat-Man...

bernd authored 15 years ago

330)       else
bernd fix a warning

bernd authored 14 years ago

331)         $new_query[] = $split[0].'='.urlencode($split[1]);
bernd * alle internen Links sinnv...

bernd authored 15 years ago

332)     }
333)   $querystring = implode('&amp;', $new_query);
334)   if ($querystring)
335)     $querystring = '?'.$querystring;
336)   return $querystring;
337) }
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

338) 
bernd * alle internen Links sinnv...

bernd authored 15 years ago

339) 
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

340) function addnew($file, $label, $querystring = '', $attribs = '')
bernd addnew() eingeführt

bernd authored 14 years ago

341) {
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

342)   output('<p class="addnew">'.internal_link($file, $label, $querystring, $attribs).'</p>');
bernd addnew() eingeführt

bernd authored 14 years ago

343) }
344) 
bernd * alle internen Links sinnv...

bernd authored 15 years ago

345) 
346) function internal_link($file, $label, $querystring = '', $attribs = '')
347) {
bernd Erlaube absolute Links

bernd authored 14 years ago

348)   global $prefix;
bernd Das böse ==0

bernd authored 14 years ago

349)   if (strpos($file, '/') === 0)
bernd Erlaube absolute Links

bernd authored 14 years ago

350)   {
351)     $file = $prefix.substr($file, 1);
352)   }
bernd * alle internen Links sinnv...

bernd authored 15 years ago

353)   $querystring = encode_querystring($querystring);
354)   return "<a href=\"{$file}{$querystring}\" {$attribs} >{$label}</a>";
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

355) }
356) 
357) 
358) function html_form($form_id, $scriptname, $querystring, $content)
359) {
bernd * alle internen Links sinnv...

bernd authored 15 years ago

360)   $querystring = encode_querystring($querystring);
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

361)   $ret = '';
bernd * alle internen Links sinnv...

bernd authored 15 years ago

362)   $ret .= '<form action="'.$scriptname.$querystring.'" method="post">'."\n";
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

363)   $ret .= '<p style="display: none;"><input type="hidden" name="formtoken" value="'.generate_form_token($form_id).'" /></p>'."\n";
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

364)   $ret .= $content;
365)   $ret .= '</form>';
366)   return $ret;  
367) }
368) 
369) 
bernd * wie viele Reihen wurden a...

bernd authored 15 years ago

370) function html_select($name, $options, $default='', $free='')
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

371) {
372)   require_once('inc/security.php');
bernd * wie viele Reihen wurden a...

bernd authored 15 years ago

373)   $ret = "<select name=\"{$name}\" id=\"{$name}\" size=\"1\" {$free} >\n";
bernd Neues Modul für "Kunde werden"

bernd authored 16 years ago

374)   foreach ($options as $key => $value)
375)   {
376)     $selected = '';
377)     if ($default == $key)
378)       $selected = ' selected="selected" ';
379)     $key = filter_input_general($key);
380)     $value = filter_input_general($value);
381)     $ret .= "  <option value=\"{$key}\"{$selected}>{$value}</option>\n";
382)   }
383)   $ret .= '</select>';
384)   return $ret;
385) }
386) 
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

387) 
bernd Neue Funktion zur Anzeige e...

bernd authored 12 years ago

388) function html_datepicker($nameprefix, $timestamp)
389) {
390)   $valid_days = array( 1 =>  1,  2 =>  2,  3 =>  3,  4 =>  4,  5 =>  5,
391)                        6 =>  6,  7 =>  7,  8 =>  8,  9 =>  9, 10 => 10,
392)                       11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15,
393)                       16 => 16, 17 => 17, 18 => 18, 19 => 19, 20 => 20,
394)                       21 => 21, 22 => 22, 23 => 23, 24 => 24, 25 => 25,
395)                       26 => 26, 27 => 27, 28 => 28, 29 => 29, 30 => 30,
396)                       31 => 31);
397)   $valid_months = array( 1 =>  1,  2 =>  2,  3 =>  3,  4 =>  4,  5 =>  5,
398)                          6 =>  6,  7 =>  7,  8 =>  8,  9 =>  9, 10 => 10,
399)                         11 => 11, 12 => 12);
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

400)   $current_year = (int) date('Y');
401)   $valid_years = array($current_year => $current_year, 
402)                        $current_year+1 => $current_year+1,
403)                        $current_year+2 => $current_year+2,
404)                        $current_year+3 => $current_year+3,
405)                        $current_year+4 => $current_year+4);
406)               
bernd Neue Funktion zur Anzeige e...

bernd authored 12 years ago

407)   $selected_day = date('d', $timestamp);
408)   $selected_month = date('m', $timestamp);
409)   $selected_year = date('Y', $timestamp);
410)   $ret = '';
411)   $ret .= html_select($nameprefix.'_day', $valid_days, $selected_day, 'style="text-align: right;"').". ";
412)   $ret .= html_select($nameprefix.'_month', $valid_months, $selected_month, 'style="text-align: right;"').". ";
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

413)   $ret .= html_select($nameprefix.'_year', $valid_years, $selected_year);
bernd Neue Funktion zur Anzeige e...

bernd authored 12 years ago

414)   return $ret;
415) }
416) 
bernd Index-Blöcke werden jetzt v...

bernd authored 12 years ago

417) function get_modules_info() 
418) {
419)   $modules = config('modules');
420)   $modconfig = array();
421)   foreach ($modules AS $name) {
422)     $modconfig[$name] = NULL;
423)     if (file_exists('modules/'.$name.'/module.info')) {
424)       $modconfig[$name] = parse_ini_file('modules/'.$name.'/module.info');
425)     }
426)   }
427)   return $modconfig;
428) }
429) 
430) 
bernd Neues Jabber-Modul (noch ni...

bernd authored 16 years ago

431)