Browse code

fix codingstyle

Hanno Böck authored on02/05/2020 12:01:35
Showing1 changed files
... ...
@@ -92,8 +92,6 @@ if ($_GET['action'] == 'new') {
92 92
             header("Location: accounts");
93 93
         }
94 94
     }
95
-
96
-
97 95
 } else {
98 96
     system_failure("Unimplemented action");
99 97
 }
Browse code

implemented deletion of unused jabber domains

Bernd Wurst authored on01/05/2020 08:34:04
Showing1 changed files
... ...
@@ -75,6 +75,25 @@ if ($_GET['action'] == 'new') {
75 75
     check_form_token('jabber_new_domain');
76 76
     new_jabber_domain($_REQUEST['domain']);
77 77
     header("Location: accounts");
78
+} elseif ($_GET['action'] == 'deldomain') {
79
+    $title = "Jabber-Domain löschen";
80
+    $section = 'jabber_accounts';
81
+    $domain = new Domain((int) $_GET['domain']);
82
+    $sure = user_is_sure();
83
+    if ($sure === null) {
84
+        are_you_sure("action=deldomain&domain={$_GET['domain']}", "Möchten Sie die Domain »".filter_output_html($domain->fqdn)."« aus der Jabber-Konfiguration entfernen?");
85
+    } elseif ($sure === true) {
86
+        delete_jabber_domain($domain->id);
87
+        if (! $debugmode) {
88
+            header("Location: accounts");
89
+        }
90
+    } elseif ($sure === false) {
91
+        if (! $debugmode) {
92
+            header("Location: accounts");
93
+        }
94
+    }
95
+
96
+
78 97
 } else {
79 98
     system_failure("Unimplemented action");
80 99
 }
Browse code

fixing syntax error

Bernd Wurst authored on11/11/2019 17:46:31
Showing1 changed files
... ...
@@ -60,7 +60,7 @@ if ($_GET['action'] == 'new') {
60 60
     $account_string = $account['local'].'@'.$account['domain'];
61 61
     $sure = user_is_sure();
62 62
     if ($sure === null) {
63
-        are_you_sure("action=delete&account={$_GET['account']}", "Möchten Sie den Account »".filter_output_html($account_string})."« wirklich löschen?");
63
+        are_you_sure("action=delete&account={$_GET['account']}", "Möchten Sie den Account »".filter_output_html($account_string)."« wirklich löschen?");
64 64
     } elseif ($sure === true) {
65 65
         delete_jabber_account($account['id']);
66 66
         if (! $debugmode) {
Browse code

Umstellung von filter_input_general() auf filter_output_html()

Bernd Wurst authored on21/09/2019 17:07:48
Showing1 changed files
... ...
@@ -57,10 +57,10 @@ if ($_GET['action'] == 'new') {
57 57
     $section = 'jabber_accounts';
58 58
 
59 59
     $account = get_jabberaccount_details($_GET['account']);
60
-    $account_string = filter_input_general($account['local'].'@'.$account['domain']);
60
+    $account_string = $account['local'].'@'.$account['domain'];
61 61
     $sure = user_is_sure();
62 62
     if ($sure === null) {
63
-        are_you_sure("action=delete&account={$_GET['account']}", "Möchten Sie den Account »{$account_string}« wirklich löschen?");
63
+        are_you_sure("action=delete&account={$_GET['account']}", "Möchten Sie den Account »".filter_output_html($account_string})."« wirklich löschen?");
64 64
     } elseif ($sure === true) {
65 65
         delete_jabber_account($account['id']);
66 66
         if (! $debugmode) {
Browse code

remove whitespace in empty lines

Hanno authored on26/06/2018 23:36:40
Showing1 changed files
... ...
@@ -55,7 +55,7 @@ if ($_GET['action'] == 'new') {
55 55
 } elseif ($_GET['action'] == 'delete') {
56 56
     $title = "Jabber-Account löschen";
57 57
     $section = 'jabber_accounts';
58
-  
58
+
59 59
     $account = get_jabberaccount_details($_GET['account']);
60 60
     $account_string = filter_input_general($account['local'].'@'.$account['domain']);
61 61
     $sure = user_is_sure();
Browse code

Fix coding style with php-cs-checker, see https://cs.sensiolabs.org/

Hanno authored on26/06/2018 13:58:19
Showing1 changed files
... ...
@@ -8,7 +8,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely
8 8
 
9 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 10
 
11
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
11
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
12 12
 http://creativecommons.org/publicdomain/zero/1.0/
13 13
 
14 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.
... ...
@@ -26,75 +26,57 @@ require_role(ROLE_CUSTOMER);
26 26
 require_once("inc/debug.php");
27 27
 global $debugmode;
28 28
 
29
-if ($_GET['action'] == 'new')
30
-{
31
-  check_form_token('jabber_new_account');
32
-  if (filter_input_username($_POST['local']) == '' ||
29
+if ($_GET['action'] == 'new') {
30
+    check_form_token('jabber_new_account');
31
+    if (filter_input_username($_POST['local']) == '' ||
33 32
       $_POST['domain'] == '' ||
34
-      $_POST['password'] == '')
35
-  {
36
-    input_error('Sie müssen alle Felder ausfüllen!');
37
-  }
38
-  else
39
-  {
40
-    create_jabber_account($_POST['local'], $_POST['domain'], stripslashes($_POST['password']));
41
-    if (! $debugmode)
42
-      header('Location: accounts');
43
-  }
44
-}
45
-elseif ($_GET['action'] == 'chpass')
46
-{
47
-  check_form_token('jabber_chpass');
48
-  get_jabberaccount_details($_POST['accountid']);
49
-  if ($_POST['newpass'] == '' ||
33
+      $_POST['password'] == '') {
34
+        input_error('Sie müssen alle Felder ausfüllen!');
35
+    } else {
36
+        create_jabber_account($_POST['local'], $_POST['domain'], stripslashes($_POST['password']));
37
+        if (! $debugmode) {
38
+            header('Location: accounts');
39
+        }
40
+    }
41
+} elseif ($_GET['action'] == 'chpass') {
42
+    check_form_token('jabber_chpass');
43
+    get_jabberaccount_details($_POST['accountid']);
44
+    if ($_POST['newpass'] == '' ||
50 45
       $_POST['newpass2'] == '' ||
51 46
       $_POST['newpass'] != $_POST['newpass2'] ||
52
-      $_POST['accountid'] == '')
53
-  {
54
-    input_error('Bitte zweimal ein neues Passwort eingeben!');
55
-  }
56
-  else
57
-  {
58
-    change_jabber_password($_POST['accountid'], stripslashes($_POST['newpass']));
59
-    if (! $debugmode)
60
-      header('Location: accounts');
61
-  }
62
-}
63
-elseif ($_GET['action'] == 'delete')
64
-{
65
-  $title = "Jabber-Account löschen";
66
-  $section = 'jabber_accounts';
47
+      $_POST['accountid'] == '') {
48
+        input_error('Bitte zweimal ein neues Passwort eingeben!');
49
+    } else {
50
+        change_jabber_password($_POST['accountid'], stripslashes($_POST['newpass']));
51
+        if (! $debugmode) {
52
+            header('Location: accounts');
53
+        }
54
+    }
55
+} elseif ($_GET['action'] == 'delete') {
56
+    $title = "Jabber-Account löschen";
57
+    $section = 'jabber_accounts';
67 58
   
68
-  $account = get_jabberaccount_details($_GET['account']);
69
-  $account_string = filter_input_general( $account['local'].'@'.$account['domain'] );
70
-  $sure = user_is_sure();
71
-  if ($sure === NULL)
72
-  {
73
-    are_you_sure("action=delete&account={$_GET['account']}", "Möchten Sie den Account »{$account_string}« wirklich löschen?");
74
-  }
75
-  elseif ($sure === true)
76
-  {
77
-    delete_jabber_account($account['id']);
78
-    if (! $debugmode)
79
-      header("Location: accounts");
80
-  }
81
-  elseif ($sure === false)
82
-  {
83
-    if (! $debugmode)
84
-      header("Location: accounts");
85
-  }
86
-
59
+    $account = get_jabberaccount_details($_GET['account']);
60
+    $account_string = filter_input_general($account['local'].'@'.$account['domain']);
61
+    $sure = user_is_sure();
62
+    if ($sure === null) {
63
+        are_you_sure("action=delete&account={$_GET['account']}", "Möchten Sie den Account »{$account_string}« wirklich löschen?");
64
+    } elseif ($sure === true) {
65
+        delete_jabber_account($account['id']);
66
+        if (! $debugmode) {
67
+            header("Location: accounts");
68
+        }
69
+    } elseif ($sure === false) {
70
+        if (! $debugmode) {
71
+            header("Location: accounts");
72
+        }
73
+    }
74
+} elseif ($_GET['action'] == 'newdomain') {
75
+    check_form_token('jabber_new_domain');
76
+    new_jabber_domain($_REQUEST['domain']);
77
+    header("Location: accounts");
78
+} else {
79
+    system_failure("Unimplemented action");
87 80
 }
88
-elseif ($_GET['action'] == 'newdomain')
89
-{
90
-  check_form_token('jabber_new_domain');
91
-  new_jabber_domain( $_REQUEST['domain'] );
92
-  header("Location: accounts");
93
-}
94
-else
95
-  system_failure("Unimplemented action");
96 81
 
97 82
 output('');
98
-
99
-
100
-?>
Browse code

Copyright year update

Bernd Wurst authored on13/01/2018 06:07:05
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2014 by schokokeks.org Hosting, namely
5
+Written 2008-2018 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Lizenzinfos in eigenes Modul ausgelagert und Copyright auf 2014 angepasst

Bernd Wurst authored on08/02/2014 05:45:07
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2013 by schokokeks.org Hosting, namely
5
+Written 2008-2014 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Updated copyright notice (2012 => 2013)

Bernd Wurst authored on19/01/2013 10:49:50
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2012 by schokokeks.org Hosting, namely
5
+Written 2008-2013 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Added license tags for CC0, README and COPYING

Bernd Wurst authored on11/03/2012 15:40:04
Showing1 changed files
... ...
@@ -1,4 +1,18 @@
1 1
 <?php
2
+/*
3
+This file belongs to the Webinterface of schokokeks.org Hosting
4
+
5
+Written 2008-2012 by schokokeks.org Hosting, namely
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
+*/
2 16
 
3 17
 require_once('session/start.php');
4 18
 
Browse code

Neue Jabber-Domains selbst eintragen.

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1486 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on01/10/2009 03:32:52
Showing1 changed files
... ...
@@ -71,6 +71,12 @@ elseif ($_GET['action'] == 'delete')
71 71
   }
72 72
 
73 73
 }
74
+elseif ($_GET['action'] == 'newdomain')
75
+{
76
+  check_form_token('jabber_new_domain');
77
+  new_jabber_domain( $_REQUEST['domain'] );
78
+  header("Location: accounts");
79
+}
74 80
 else
75 81
   system_failure("Unimplemented action");
76 82
 
Browse code

* alle internen Links sinnvoll (und gleichartig!) encoden * Automatischer Upgrader für Drupal funktioniert jetzt

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1301 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on07/03/2009 14:48:53
Showing1 changed files
... ...
@@ -56,7 +56,7 @@ elseif ($_GET['action'] == 'delete')
56 56
   $sure = user_is_sure();
57 57
   if ($sure === NULL)
58 58
   {
59
-    are_you_sure("action=delete&amp;account={$_GET['account']}", "Möchten Sie den Account »{$account_string}« wirklich löschen?");
59
+    are_you_sure("action=delete&account={$_GET['account']}", "Möchten Sie den Account »{$account_string}« wirklich löschen?");
60 60
   }
61 61
   elseif ($sure === true)
62 62
   {
Browse code

eliminate .php extensions for URLs

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1128 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on08/08/2008 19:32:32
Showing1 changed files
... ...
@@ -25,7 +25,7 @@ if ($_GET['action'] == 'new')
25 25
   {
26 26
     create_jabber_account($_POST['local'], $_POST['domain'], stripslashes($_POST['password']));
27 27
     if (! $debugmode)
28
-      header('Location: accounts.php');
28
+      header('Location: accounts');
29 29
   }
30 30
 }
31 31
 elseif ($_GET['action'] == 'chpass')
... ...
@@ -43,7 +43,7 @@ elseif ($_GET['action'] == 'chpass')
43 43
   {
44 44
     change_jabber_password($_POST['accountid'], stripslashes($_POST['newpass']));
45 45
     if (! $debugmode)
46
-      header('Location: accounts.php');
46
+      header('Location: accounts');
47 47
   }
48 48
 }
49 49
 elseif ($_GET['action'] == 'delete')
... ...
@@ -62,12 +62,12 @@ elseif ($_GET['action'] == 'delete')
62 62
   {
63 63
     delete_jabber_account($account['id']);
64 64
     if (! $debugmode)
65
-      header("Location: accounts.php");
65
+      header("Location: accounts");
66 66
   }
67 67
   elseif ($sure === false)
68 68
   {
69 69
     if (! $debugmode)
70
-      header("Location: accounts.php");
70
+      header("Location: accounts");
71 71
   }
72 72
 
73 73
 }
Browse code

stripslashes und erlaube Anführungszeichen im Passwort

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@788 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on16/11/2007 16:36:04
Showing1 changed files
... ...
@@ -23,7 +23,7 @@ if ($_GET['action'] == 'new')
23 23
   }
24 24
   else
25 25
   {
26
-    create_jabber_account($_POST['local'], $_POST['domain'], $_POST['password']);
26
+    create_jabber_account($_POST['local'], $_POST['domain'], stripslashes($_POST['password']));
27 27
     if (! $debugmode)
28 28
       header('Location: accounts.php');
29 29
   }
... ...
@@ -41,7 +41,7 @@ elseif ($_GET['action'] == 'chpass')
41 41
   }
42 42
   else
43 43
   {
44
-    change_jabber_password($_POST['accountid'], $_POST['newpass']);
44
+    change_jabber_password($_POST['accountid'], stripslashes($_POST['newpass']));
45 45
     if (! $debugmode)
46 46
       header('Location: accounts.php');
47 47
   }
Browse code

Anführungszeichen filtern

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@784 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on16/11/2007 16:16:18
Showing1 changed files
... ...
@@ -17,7 +17,7 @@ if ($_GET['action'] == 'new')
17 17
   check_form_token('jabber_new_account');
18 18
   if (filter_input_username($_POST['local']) == '' ||
19 19
       $_POST['domain'] == '' ||
20
-      filter_shell($_POST['password']) == '')
20
+      $_POST['password'] == '')
21 21
   {
22 22
     input_error('Sie müssen alle Felder ausfüllen!');
23 23
   }
Browse code

Umfangreiche Code-Aufräumarbeiten Neuer "Are you sure"-Dialog

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@604 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on09/08/2007 19:04:25
Showing1 changed files
... ...
@@ -48,6 +48,9 @@ elseif ($_GET['action'] == 'chpass')
48 48
 }
49 49
 elseif ($_GET['action'] == 'delete')
50 50
 {
51
+  $title = "Jabber-Account löschen";
52
+  $section = 'jabber_accounts';
53
+  
51 54
   $account = get_jabberaccount_details($_GET['account']);
52 55
   $account_string = filter_input_general( $account['local'].'@'.$account['domain'] );
53 56
   $sure = user_is_sure();
Browse code

Parse Error, hatte ich gar nicht bemerkt...

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@560 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on28/07/2007 17:20:15
Showing1 changed files
... ...
@@ -2,7 +2,6 @@
2 2
 
3 3
 require_once('session/start.php');
4 4
 
5
-require_once('domains.php');
6 5
 require_once('jabberaccounts.php');
7 6
 
8 7
 require_once('inc/security.php');
... ...
@@ -12,7 +11,6 @@ require_role(ROLE_CUSTOMER);
12 11
 
13 12
 require_once("inc/debug.php");
14 13
 global $debugmode;
15
-DEBUG("GET: ".htmlentities(print_r($_GET, true))." / POST: ".htmlentities(print_r($_POST, true)));
16 14
 
17 15
 if ($_GET['action'] == 'new')
18 16
 {
... ...
@@ -33,6 +31,7 @@ if ($_GET['action'] == 'new')
33 31
 elseif ($_GET['action'] == 'chpass')
34 32
 {
35 33
   check_form_token('jabber_chpass');
34
+  get_jabberaccount_details($_POST['accountid']);
36 35
   if ($_POST['newpass'] == '' ||
37 36
       $_POST['newpass2'] == '' ||
38 37
       $_POST['newpass'] != $_POST['newpass2'] ||
Browse code

Erst filtern, dann schauen ob Felder leer sind

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@508 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on16/06/2007 14:48:23
Showing1 changed files
... ...
@@ -17,9 +17,9 @@ DEBUG("GET: ".htmlentities(print_r($_GET, true))." / POST: ".htmlentities(print_
17 17
 if ($_GET['action'] == 'new')
18 18
 {
19 19
   check_form_token('jabber_new_account');
20
-  if ($_POST['local'] == '' ||
20
+  if (filter_input_username($_POST['local']) == '' ||
21 21
       $_POST['domain'] == '' ||
22
-      $_POST['password'] == '')
22
+      filter_shell($_POST['password']) == '')
23 23
   {
24 24
     input_error('Sie müssen alle Felder ausfüllen!');
25 25
   }
Browse code

bisschen XSS-Schutz

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@501 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on16/06/2007 14:17:05
Showing1 changed files
... ...
@@ -5,6 +5,9 @@ require_once('session/start.php');
5 5
 require_once('domains.php');
6 6
 require_once('jabberaccounts.php');
7 7
 
8
+require_once('inc/security.php');
9
+
10
+
8 11
 require_role(ROLE_CUSTOMER);
9 12
 
10 13
 require_once("inc/debug.php");
... ...
@@ -47,7 +50,7 @@ elseif ($_GET['action'] == 'chpass')
47 50
 elseif ($_GET['action'] == 'delete')
48 51
 {
49 52
   $account = get_jabberaccount_details($_GET['account']);
50
-  $account_string = $account['local'].'@'.$account['domain'];
53
+  $account_string = filter_input_general( $account['local'].'@'.$account['domain'] );
51 54
   $sure = user_is_sure();
52 55
   if ($sure === NULL)
53 56
   {
Browse code

Neues Jabber-Modul (noch nicht ganz fertig) und Formular-Framework

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@481 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on01/06/2007 16:53:03
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,75 @@
1
+<?php
2
+
3
+require_once('session/start.php');
4
+
5
+require_once('domains.php');
6
+require_once('jabberaccounts.php');
7
+
8
+require_role(ROLE_CUSTOMER);
9
+
10
+require_once("inc/debug.php");
11
+global $debugmode;
12
+DEBUG("GET: ".htmlentities(print_r($_GET, true))." / POST: ".htmlentities(print_r($_POST, true)));
13
+
14
+if ($_GET['action'] == 'new')
15
+{
16
+  check_form_token('jabber_new_account');
17
+  if ($_POST['local'] == '' ||
18
+      $_POST['domain'] == '' ||
19
+      $_POST['password'] == '')
20
+  {
21
+    input_error('Sie müssen alle Felder ausfüllen!');
22
+  }
23
+  else
24
+  {
25
+    create_jabber_account($_POST['local'], $_POST['domain'], $_POST['password']);
26
+    if (! $debugmode)
27
+      header('Location: accounts.php');
28
+  }
29
+}
30
+elseif ($_GET['action'] == 'chpass')
31
+{
32
+  check_form_token('jabber_chpass');
33
+  if ($_POST['newpass'] == '' ||
34
+      $_POST['newpass2'] == '' ||
35
+      $_POST['newpass'] != $_POST['newpass2'] ||
36
+      $_POST['accountid'] == '')
37
+  {
38
+    input_error('Bitte zweimal ein neues Passwort eingeben!');
39
+  }
40
+  else
41
+  {
42
+    change_jabber_password($_POST['accountid'], $_POST['newpass']);
43
+    if (! $debugmode)
44
+      header('Location: accounts.php');
45
+  }
46
+}
47
+elseif ($_GET['action'] == 'delete')
48
+{
49
+  $account = get_jabberaccount_details($_GET['account']);
50
+  $account_string = $account['local'].'@'.$account['domain'];
51
+  $sure = user_is_sure();
52
+  if ($sure === NULL)
53
+  {
54
+    are_you_sure("action=delete&amp;account={$_GET['account']}", "Möchten Sie den Account »{$account_string}« wirklich löschen?");
55
+  }
56
+  elseif ($sure === true)
57
+  {
58
+    delete_jabber_account($account['id']);
59
+    if (! $debugmode)
60
+      header("Location: accounts.php");
61
+  }
62
+  elseif ($sure === false)
63
+  {
64
+    if (! $debugmode)
65
+      header("Location: accounts.php");
66
+  }
67
+
68
+}
69
+else
70
+  system_failure("Unimplemented action");
71
+
72
+output('');
73
+
74
+
75
+?>