Browse code

Use autocomplete=new-password on password changing forms

Hanno authored on24/10/2019 21:14:02
Showing1 changed files
... ...
@@ -77,11 +77,11 @@ output('<p>Hier können Sie Ihr Passwort ändern.</p>
77 77
     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
78 78
   </tr>
79 79
   <tr>
80
-    <td>neues Passwort:</td>       <td><input type="password" name="password1" value="" /></td>
80
+    <td>neues Passwort:</td>       <td><input type="password" name="password1" value="" autocomplete="new-password" /></td>
81 81
   </tr>
82 82
   <tr>
83 83
     <td>Bestätigung:<br /><span style="font-size: 80%;">(nochmal neues Passwort)</span></td>
84
-                                   <td><input type="password" name="password2" value="" /></td>
84
+                                   <td><input type="password" name="password2" value="" autocomplete="new-password" /></td>
85 85
   </tr>
86 86
 </table>
87 87
 <p><input type="submit" value="Speichern" /></p>
Browse code

remove whitespace in empty lines

Hanno authored on26/06/2018 23:36:40
Showing1 changed files
... ...
@@ -56,7 +56,7 @@ if (isset($_POST['password1'])) {
56 56
         } else {
57 57
             system_failure("WTF?! (\$result={$result})");
58 58
         }
59
-    
59
+
60 60
         if (! $debugmode) {
61 61
             header('Location: index');
62 62
         } else {
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.
... ...
@@ -23,50 +23,53 @@ $error = '';
23 23
 
24 24
 
25 25
 
26
-if (isset($_POST['password1']))
27
-{
28
-  check_form_token('index_chpass');
29
-  $result = NULL;
30
-  if ($_SESSION['role'] & ROLE_SYSTEMUSER)
31
-    if ($_SESSION['role'] & ROLE_SUBUSER)
32
-      $result = find_role($_SESSION['subuser'], $_POST['old_password']);
33
-    else
34
-      $result = find_role($_SESSION['userinfo']['uid'], $_POST['old_password']);
35
-  else
36
-    $result = find_role($_SESSION['customerinfo']['customerno'], $_POST['old_password']);
37
-
38
-  if ($result == NULL)
39
-    input_error('Das bisherige Passwort ist nicht korrekt!');
40
-  elseif ($_POST['password2'] != $_POST['password1'])
41
-    input_error('Die Bestätigung ist nicht identisch mit dem neuen Passwort!');
42
-  elseif ($_POST['password2'] == '')
43
-    input_error('Sie müssen das neue Passwort zweimal eingeben!');
44
-  elseif ($_POST['old_password'] == '')
45
-    input_error('Altes Passwort nicht angegeben!');
46
-  elseif (($check = strong_password($_POST['password1'])) !== true)
47
-    input_error("Das Passwort ist zu einfach ({$check})!");
48
-  else
49
-  {
50
-    if ($result & ROLE_SYSTEMUSER)
51
-      set_systemuser_password($_SESSION['userinfo']['uid'], $_POST['password1']);
52
-    elseif ($result & ROLE_SUBUSER)
53
-      set_subuser_password($_SESSION['subuser'], $_POST['password1']);
54
-    elseif ($result & ROLE_CUSTOMER)
55
-      set_customer_password($_SESSION['customerinfo']['customerno'], $_POST['password1']);
56
-    else
57
-      system_failure("WTF?! (\$result={$result})");
26
+if (isset($_POST['password1'])) {
27
+    check_form_token('index_chpass');
28
+    $result = null;
29
+    if ($_SESSION['role'] & ROLE_SYSTEMUSER) {
30
+        if ($_SESSION['role'] & ROLE_SUBUSER) {
31
+            $result = find_role($_SESSION['subuser'], $_POST['old_password']);
32
+        } else {
33
+            $result = find_role($_SESSION['userinfo']['uid'], $_POST['old_password']);
34
+        }
35
+    } else {
36
+        $result = find_role($_SESSION['customerinfo']['customerno'], $_POST['old_password']);
37
+    }
38
+
39
+    if ($result == null) {
40
+        input_error('Das bisherige Passwort ist nicht korrekt!');
41
+    } elseif ($_POST['password2'] != $_POST['password1']) {
42
+        input_error('Die Bestätigung ist nicht identisch mit dem neuen Passwort!');
43
+    } elseif ($_POST['password2'] == '') {
44
+        input_error('Sie müssen das neue Passwort zweimal eingeben!');
45
+    } elseif ($_POST['old_password'] == '') {
46
+        input_error('Altes Passwort nicht angegeben!');
47
+    } elseif (($check = strong_password($_POST['password1'])) !== true) {
48
+        input_error("Das Passwort ist zu einfach ({$check})!");
49
+    } else {
50
+        if ($result & ROLE_SYSTEMUSER) {
51
+            set_systemuser_password($_SESSION['userinfo']['uid'], $_POST['password1']);
52
+        } elseif ($result & ROLE_SUBUSER) {
53
+            set_subuser_password($_SESSION['subuser'], $_POST['password1']);
54
+        } elseif ($result & ROLE_CUSTOMER) {
55
+            set_customer_password($_SESSION['customerinfo']['customerno'], $_POST['password1']);
56
+        } else {
57
+            system_failure("WTF?! (\$result={$result})");
58
+        }
58 59
     
59
-    if (! $debugmode)
60
-      header('Location: index');
61
-    else
62
-      output('');
63
-  }
60
+        if (! $debugmode) {
61
+            header('Location: index');
62
+        } else {
63
+            output('');
64
+        }
65
+    }
64 66
 }
65 67
 
66 68
 
67 69
 
68
-if ($_SESSION['role'] & ROLE_SYSTEMUSER && ! ($_SESSION['role'] & ROLE_SUBUSER))
69
-  warning('Beachten Sie: Wenn Sie hier Ihr Passwort ändern, betrifft dies auch Ihr Anmelde-Passwort am Server (SSH).');
70
+if ($_SESSION['role'] & ROLE_SYSTEMUSER && ! ($_SESSION['role'] & ROLE_SUBUSER)) {
71
+    warning('Beachten Sie: Wenn Sie hier Ihr Passwort ändern, betrifft dies auch Ihr Anmelde-Passwort am Server (SSH).');
72
+}
70 73
 
71 74
 output('<p>Hier können Sie Ihr Passwort ändern.</p>
72 75
 '.html_form('index_chpass', 'chpass', '', '<table>
... ...
@@ -83,8 +86,3 @@ output('<p>Hier können Sie Ihr Passwort ändern.</p>
83 86
 </table>
84 87
 <p><input type="submit" value="Speichern" /></p>
85 88
 '));
86
-
87
-
88
-
89
-
90
-?>
Browse code

Referenzen auf cracklib entfernt

Bernd Wurst authored on09/02/2018 05:58:06
Showing1 changed files
... ...
@@ -44,7 +44,7 @@ if (isset($_POST['password1']))
44 44
   elseif ($_POST['old_password'] == '')
45 45
     input_error('Altes Passwort nicht angegeben!');
46 46
   elseif (($check = strong_password($_POST['password1'])) !== true)
47
-    input_error("Das Passwort ist zu einfach (cracklib sagt: {$check})!");
47
+    input_error("Das Passwort ist zu einfach ({$check})!");
48 48
   else
49 49
   {
50 50
     if ($result & ROLE_SYSTEMUSER)
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,19 @@
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
+*/
16
+
2 17
 require_once('inc/debug.php');
3 18
 require_once('inc/security.php');
4 19
 require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER, ROLE_SUBUSER));
Browse code

Passwort-Ändern geht jetzt auch für Subuser

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

bernd authored on01/10/2010 10:45:36
Showing1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 <?php
2 2
 require_once('inc/debug.php');
3 3
 require_once('inc/security.php');
4
-require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER));
4
+require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER, ROLE_SUBUSER));
5 5
 
6 6
 title("Passwort ändern");
7 7
 $error = '';
... ...
@@ -13,7 +13,10 @@ if (isset($_POST['password1']))
13 13
   check_form_token('index_chpass');
14 14
   $result = NULL;
15 15
   if ($_SESSION['role'] & ROLE_SYSTEMUSER)
16
-    $result = find_role($_SESSION['userinfo']['uid'], $_POST['old_password']);
16
+    if ($_SESSION['role'] & ROLE_SUBUSER)
17
+      $result = find_role($_SESSION['subuser'], $_POST['old_password']);
18
+    else
19
+      $result = find_role($_SESSION['userinfo']['uid'], $_POST['old_password']);
17 20
   else
18 21
     $result = find_role($_SESSION['customerinfo']['customerno'], $_POST['old_password']);
19 22
 
... ...
@@ -31,6 +34,8 @@ if (isset($_POST['password1']))
31 34
   {
32 35
     if ($result & ROLE_SYSTEMUSER)
33 36
       set_systemuser_password($_SESSION['userinfo']['uid'], $_POST['password1']);
37
+    elseif ($result & ROLE_SUBUSER)
38
+      set_subuser_password($_SESSION['subuser'], $_POST['password1']);
34 39
     elseif ($result & ROLE_CUSTOMER)
35 40
       set_customer_password($_SESSION['customerinfo']['customerno'], $_POST['password1']);
36 41
     else
... ...
@@ -45,7 +50,7 @@ if (isset($_POST['password1']))
45 50
 
46 51
 
47 52
 
48
-if ($_SESSION['role'] & ROLE_SYSTEMUSER)
53
+if ($_SESSION['role'] & ROLE_SYSTEMUSER && ! ($_SESSION['role'] & ROLE_SUBUSER))
49 54
   warning('Beachten Sie: Wenn Sie hier Ihr Passwort ändern, betrifft dies auch Ihr Anmelde-Passwort am Server (SSH).');
50 55
 
51 56
 output('<p>Hier können Sie Ihr Passwort ändern.</p>
Browse code

Benutze überall title() statt output("<h3>...</h3>")

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

bernd authored on18/09/2010 13:35:15
Showing1 changed files
... ...
@@ -3,7 +3,7 @@ require_once('inc/debug.php');
3 3
 require_once('inc/security.php');
4 4
 require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER));
5 5
 
6
-$title = "Passwort ändern";
6
+title("Passwort ändern");
7 7
 $error = '';
8 8
 
9 9
 
... ...
@@ -48,8 +48,7 @@ if (isset($_POST['password1']))
48 48
 if ($_SESSION['role'] & ROLE_SYSTEMUSER)
49 49
   warning('Beachten Sie: Wenn Sie hier Ihr Passwort ändern, betrifft dies auch Ihr Anmelde-Passwort am Server (SSH).');
50 50
 
51
-output('<h3>Passwort ändern</h3>
52
-<p>Hier können Sie Ihr Passwort ändern.</p>
51
+output('<p>Hier können Sie Ihr Passwort ändern.</p>
53 52
 '.html_form('index_chpass', 'chpass', '', '<table>
54 53
   <tr>
55 54
     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
Browse code

Umstellung auf Theme-Support (Frei nach phptemplate)

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

bernd authored on18/09/2010 13:35:10
Showing1 changed files
... ...
@@ -1,11 +1,11 @@
1 1
 <?php
2 2
 require_once('inc/debug.php');
3 3
 require_once('inc/security.php');
4
+require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER));
4 5
 
5 6
 $title = "Passwort ändern";
6 7
 $error = '';
7 8
 
8
-require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER));
9 9
 
10 10
 
11 11
 if (isset($_POST['password1']))
Browse code

neue Bilder, mehr SSL-Zertifikate-Verwaltung

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

bernd authored on29/08/2009 17:08:03
Showing1 changed files
... ...
@@ -8,7 +8,7 @@ $error = '';
8 8
 require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER));
9 9
 
10 10
 
11
-if ($_POST['password1'] != '')
11
+if (isset($_POST['password1']))
12 12
 {
13 13
   check_form_token('index_chpass');
14 14
   $result = NULL;
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
... ...
@@ -37,7 +37,7 @@ if ($_POST['password1'] != '')
37 37
       system_failure("WTF?! (\$result={$result})");
38 38
     
39 39
     if (! $debugmode)
40
-      header('Location: index.php');
40
+      header('Location: index');
41 41
     else
42 42
       output('');
43 43
   }
... ...
@@ -50,7 +50,7 @@ if ($_SESSION['role'] & ROLE_SYSTEMUSER)
50 50
 
51 51
 output('<h3>Passwort ändern</h3>
52 52
 <p>Hier können Sie Ihr Passwort ändern.</p>
53
-'.html_form('index_chpass', 'chpass.php', '', '<table>
53
+'.html_form('index_chpass', 'chpass', '', '<table>
54 54
   <tr>
55 55
     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
56 56
   </tr>
Browse code

Entities repariert

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

bernd authored on02/11/2007 13:06:25
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 require_once('inc/debug.php');
3 3
 require_once('inc/security.php');
4 4
 
5
-$title = "Passwort &auml;ndern";
5
+$title = "Passwort ändern";
6 6
 $error = '';
7 7
 
8 8
 require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER));
... ...
@@ -48,8 +48,8 @@ if ($_POST['password1'] != '')
48 48
 if ($_SESSION['role'] & ROLE_SYSTEMUSER)
49 49
   warning('Beachten Sie: Wenn Sie hier Ihr Passwort ändern, betrifft dies auch Ihr Anmelde-Passwort am Server (SSH).');
50 50
 
51
-output('<h3>Passwort &auml;ndern</h3>
52
-<p>Hier k&ouml;nnen Sie Ihr Passwort &auml;ndern.</p>
51
+output('<h3>Passwort ändern</h3>
52
+<p>Hier können Sie Ihr Passwort ändern.</p>
53 53
 '.html_form('index_chpass', 'chpass.php', '', '<table>
54 54
   <tr>
55 55
     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
... ...
@@ -58,7 +58,7 @@ output('<h3>Passwort &auml;ndern</h3>
58 58
     <td>neues Passwort:</td>       <td><input type="password" name="password1" value="" /></td>
59 59
   </tr>
60 60
   <tr>
61
-    <td>Best&auml;tigung:<br /><span style="font-size: 80%;">(nochmal neues Passwort)</span></td>
61
+    <td>Bestätigung:<br /><span style="font-size: 80%;">(nochmal neues Passwort)</span></td>
62 62
                                    <td><input type="password" name="password2" value="" /></td>
63 63
   </tr>
64 64
 </table>
Browse code

Auch mailaccounts können sich einloggen

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

bernd authored on13/08/2007 13:15:55
Showing1 changed files
... ...
@@ -61,10 +61,9 @@ output('<h3>Passwort &auml;ndern</h3>
61 61
     <td>Best&auml;tigung:<br /><span style="font-size: 80%;">(nochmal neues Passwort)</span></td>
62 62
                                    <td><input type="password" name="password2" value="" /></td>
63 63
   </tr>
64
-  <tr>
65
-    <td>&nbsp;</td><td><input type="submit" value="Speichern" /></td>
66
-  </tr>
67
-</table>'));
64
+</table>
65
+<p><input type="submit" value="Speichern" /></p>
66
+'));
68 67
 
69 68
 
70 69
 
Browse code

Viele XHTML-Fehler korrigiert, jetzt validiert alles.

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

bernd authored on09/08/2007 20:20:29
Showing1 changed files
... ...
@@ -20,18 +20,18 @@ if ($_POST['password1'] != '')
20 20
   if ($result == NULL)
21 21
     input_error('Das bisherige Passwort ist nicht korrekt!');
22 22
   elseif ($_POST['password2'] != $_POST['password1'])
23
-    input_error('Die Best&auml;tigung ist nicht identisch mit dem neuen Passwort!');
23
+    input_error('Die Bestätigung ist nicht identisch mit dem neuen Passwort!');
24 24
   elseif ($_POST['password2'] == '')
25
-    input_error('Sie m&uuml;ssen das neue Passwort zweimal eingeben!');
25
+    input_error('Sie müssen das neue Passwort zweimal eingeben!');
26 26
   elseif ($_POST['old_password'] == '')
27 27
     input_error('Altes Passwort nicht angegeben!');
28 28
   elseif (($check = strong_password($_POST['password1'])) !== true)
29 29
     input_error("Das Passwort ist zu einfach (cracklib sagt: {$check})!");
30 30
   else
31 31
   {
32
-    if ($result === ROLE_SYSTEMUSER)
32
+    if ($result & ROLE_SYSTEMUSER)
33 33
       set_systemuser_password($_SESSION['userinfo']['uid'], $_POST['password1']);
34
-    elseif ($result === ROLE_CUSTOMER)
34
+    elseif ($result & ROLE_CUSTOMER)
35 35
       set_customer_password($_SESSION['customerinfo']['customerno'], $_POST['password1']);
36 36
     else
37 37
       system_failure("WTF?! (\$result={$result})");
... ...
@@ -50,9 +50,7 @@ if ($_SESSION['role'] & ROLE_SYSTEMUSER)
50 50
 
51 51
 output('<h3>Passwort &auml;ndern</h3>
52 52
 <p>Hier k&ouml;nnen Sie Ihr Passwort &auml;ndern.</p>
53
-<form method="post" action="'.($debugmode ? '?debug' : '').'">
54
-'.generate_form_token('index_chpass').'
55
-<table>
53
+'.html_form('index_chpass', 'chpass.php', '', '<table>
56 54
   <tr>
57 55
     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
58 56
   </tr>
... ...
@@ -66,9 +64,9 @@ output('<h3>Passwort &auml;ndern</h3>
66 64
   <tr>
67 65
     <td>&nbsp;</td><td><input type="submit" value="Speichern" /></td>
68 66
   </tr>
69
-</table>
70
-</form>
67
+</table>'));
68
+
69
+
71 70
 
72
-');
73 71
 
74 72
 ?>
Browse code

* Initialisierung der Session-Variablen ausgelagert * Rollen als Bitmaske * Ein user kann mehrere Rollen parallel annehmen * Primärer User erhält auch die Rechte des entsprechenden Kundenaccounts

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

bernd authored on30/07/2007 13:00:58
Showing1 changed files
... ...
@@ -12,15 +12,11 @@ if ($_POST['password1'] != '')
12 12
 {
13 13
   check_form_token('index_chpass');
14 14
   $result = NULL;
15
-  switch ($_SESSION['role'])
16
-  {
17
-    case ROLE_SYSTEMUSER:
18
-      $result = find_role($_SESSION['userinfo']['uid'], $_POST['old_password']);
19
-      break;
20
-    case ROLE_CUSTOMER:
21
-      $result = find_role($_SESSION['customerinfo']['customerno'], $_POST['old_password']);
22
-      break;
23
-  }
15
+  if ($_SESSION['role'] & ROLE_SYSTEMUSER)
16
+    $result = find_role($_SESSION['userinfo']['uid'], $_POST['old_password']);
17
+  else
18
+    $result = find_role($_SESSION['customerinfo']['customerno'], $_POST['old_password']);
19
+
24 20
   if ($result == NULL)
25 21
     input_error('Das bisherige Passwort ist nicht korrekt!');
26 22
   elseif ($_POST['password2'] != $_POST['password1'])
... ...
@@ -38,7 +34,7 @@ if ($_POST['password1'] != '')
38 34
     elseif ($result === ROLE_CUSTOMER)
39 35
       set_customer_password($_SESSION['customerinfo']['customerno'], $_POST['password1']);
40 36
     else
41
-      system_failure("WTF?!");
37
+      system_failure("WTF?! (\$result={$result})");
42 38
     
43 39
     if (! $debugmode)
44 40
       header('Location: index.php');
... ...
@@ -49,7 +45,7 @@ if ($_POST['password1'] != '')
49 45
 
50 46
 
51 47
 
52
-if ($_SESSION['role'] == ROLE_SYSTEMUSER)
48
+if ($_SESSION['role'] & ROLE_SYSTEMUSER)
53 49
   warning('Beachten Sie: Wenn Sie hier Ihr Passwort ändern, betrifft dies auch Ihr Anmelde-Passwort am Server (SSH).');
54 50
 
55 51
 output('<h3>Passwort &auml;ndern</h3>
Browse code

* Passwörter mit cracklib prüfen * Nach Passwort-neu-setzen ist man eingeloggt

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

bernd authored on04/07/2007 12:54:53
Showing1 changed files
... ...
@@ -1,5 +1,6 @@
1 1
 <?php
2 2
 require_once('inc/debug.php');
3
+require_once('inc/security.php');
3 4
 
4 5
 $title = "Passwort &auml;ndern";
5 6
 $error = '';
... ...
@@ -28,11 +29,13 @@ if ($_POST['password1'] != '')
28 29
     input_error('Sie m&uuml;ssen das neue Passwort zweimal eingeben!');
29 30
   elseif ($_POST['old_password'] == '')
30 31
     input_error('Altes Passwort nicht angegeben!');
32
+  elseif (($check = strong_password($_POST['password1'])) !== true)
33
+    input_error("Das Passwort ist zu einfach (cracklib sagt: {$check})!");
31 34
   else
32 35
   {
33
-    if ($result == ROLE_SYSTEMUSER)
36
+    if ($result === ROLE_SYSTEMUSER)
34 37
       set_systemuser_password($_SESSION['userinfo']['uid'], $_POST['password1']);
35
-    elseif ($result == ROLE_CUSTOMER)
38
+    elseif ($result === ROLE_CUSTOMER)
36 39
       set_customer_password($_SESSION['customerinfo']['customerno'], $_POST['password1']);
37 40
     else
38 41
       system_failure("WTF?!");
Browse code

XSRF-kram fixed

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

bernd authored on01/06/2007 08:02:31
Showing1 changed files
... ...
@@ -9,6 +9,7 @@ require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER));
9 9
 
10 10
 if ($_POST['password1'] != '')
11 11
 {
12
+  check_form_token('index_chpass');
12 13
   $result = NULL;
13 14
   switch ($_SESSION['role'])
14 15
   {
... ...
@@ -51,6 +52,7 @@ if ($_SESSION['role'] == ROLE_SYSTEMUSER)
51 52
 output('<h3>Passwort &auml;ndern</h3>
52 53
 <p>Hier k&ouml;nnen Sie Ihr Passwort &auml;ndern.</p>
53 54
 <form method="post" action="'.($debugmode ? '?debug' : '').'">
55
+'.generate_form_token('index_chpass').'
54 56
 <table>
55 57
   <tr>
56 58
     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
Browse code

webinterface => /webinterface

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

bernd authored on27/03/2007 07:40:51
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,73 @@
1
+<?php
2
+require_once('inc/debug.php');
3
+
4
+$title = "Passwort &auml;ndern";
5
+$error = '';
6
+
7
+require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER));
8
+
9
+
10
+if ($_POST['password1'] != '')
11
+{
12
+  $result = NULL;
13
+  switch ($_SESSION['role'])
14
+  {
15
+    case ROLE_SYSTEMUSER:
16
+      $result = find_role($_SESSION['userinfo']['uid'], $_POST['old_password']);
17
+      break;
18
+    case ROLE_CUSTOMER:
19
+      $result = find_role($_SESSION['customerinfo']['customerno'], $_POST['old_password']);
20
+      break;
21
+  }
22
+  if ($result == NULL)
23
+    input_error('Das bisherige Passwort ist nicht korrekt!');
24
+  elseif ($_POST['password2'] != $_POST['password1'])
25
+    input_error('Die Best&auml;tigung ist nicht identisch mit dem neuen Passwort!');
26
+  elseif ($_POST['password2'] == '')
27
+    input_error('Sie m&uuml;ssen das neue Passwort zweimal eingeben!');
28
+  elseif ($_POST['old_password'] == '')
29
+    input_error('Altes Passwort nicht angegeben!');
30
+  else
31
+  {
32
+    if ($result == ROLE_SYSTEMUSER)
33
+      set_systemuser_password($_SESSION['userinfo']['uid'], $_POST['password1']);
34
+    elseif ($result == ROLE_CUSTOMER)
35
+      set_customer_password($_SESSION['customerinfo']['customerno'], $_POST['password1']);
36
+    else
37
+      system_failure("WTF?!");
38
+    
39
+    if (! $debugmode)
40
+      header('Location: index.php');
41
+    else
42
+      output('');
43
+  }
44
+}
45
+
46
+
47
+
48
+if ($_SESSION['role'] == ROLE_SYSTEMUSER)
49
+  warning('Beachten Sie: Wenn Sie hier Ihr Passwort ändern, betrifft dies auch Ihr Anmelde-Passwort am Server (SSH).');
50
+
51
+output('<h3>Passwort &auml;ndern</h3>
52
+<p>Hier k&ouml;nnen Sie Ihr Passwort &auml;ndern.</p>
53
+<form method="post" action="'.($debugmode ? '?debug' : '').'">
54
+<table>
55
+  <tr>
56
+    <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
57
+  </tr>
58
+  <tr>
59
+    <td>neues Passwort:</td>       <td><input type="password" name="password1" value="" /></td>
60
+  </tr>
61
+  <tr>
62
+    <td>Best&auml;tigung:<br /><span style="font-size: 80%;">(nochmal neues Passwort)</span></td>
63
+                                   <td><input type="password" name="password2" value="" /></td>
64
+  </tr>
65
+  <tr>
66
+    <td>&nbsp;</td><td><input type="submit" value="Speichern" /></td>
67
+  </tr>
68
+</table>
69
+</form>
70
+
71
+');
72
+
73
+?>