From 747d98c5bedc03445cbb99b407533073dc07198d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 7 Apr 2014 13:05:31 +0000 Subject: [PATCH] Anpassungen Passwortaenderung --- cis/public/accountactivation.php | 150 +++++++++++++++++-------------- include/benutzer.class.php | 2 +- include/tw/passwort.inc.php | 1 + system/checksystem.php | 17 +++- 4 files changed, 101 insertions(+), 69 deletions(-) diff --git a/cis/public/accountactivation.php b/cis/public/accountactivation.php index 4f98a0191..846e423cc 100644 --- a/cis/public/accountactivation.php +++ b/cis/public/accountactivation.php @@ -35,6 +35,7 @@ if(isset($_GET['sprache'])) setSprache(DEFAULT_LANGUAGE); } +$erfolgreichaktiviert=false; $sprache = getSprache(); $p = new phrasen($sprache); @@ -63,7 +64,7 @@ if(isset($_POST['submit'])) if($benutzer->load($username)) { // Aktivierungscode pruefen - if($benutzer->aktivierungscode==$code) + if($benutzer->aktivierungscode==$code && $code!='') { $passwort = $_POST['passwort']; $passwort2 = $_POST['passwort2']; @@ -80,6 +81,9 @@ if(isset($_POST['submit'])) // Code entfernen $benutzer = new benutzer(); $benutzer->DeleteAktivierungscode($username); + + // Account aktiviert + $erfolgreichaktiviert=true; } } } @@ -125,77 +129,89 @@ echo '

'; -echo ' - - - - -
-
'; -echo ' -

'.$p->t('passwort/AccountAktivierung').'

-'.$p->t('passwort/PasswortWaehlen').'
'. -$p->t('passwort/InfotextPolicy').' -

'; -if(!isset($_SERVER['HTTPS']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='off')) +if($erfolgreichaktiviert) { + echo '

Ihr Account wurde erfolgreich aktiviert



+ >> Weiter zum Login'; +} +else +{ + echo ' + + + + +
+
'; + + echo ' +

'.$p->t('passwort/AccountAktivierung').'

+ '.$p->t('passwort/PasswortWaehlen').'
'. + $p->t('passwort/InfotextPolicy').' +

'; + if(!isset($_SERVER['HTTPS']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='off')) + { - $httpspath = str_replace('http://','https://',APP_ROOT).'cis/public/accountactivation.php'; - echo '
'.$p->t('passwort/NoHttps').'
- '.$p->t('passwort/ZuHttpsWechseln').'

'; + $httpspath = str_replace('http://','https://',APP_ROOT).'cis/public/accountactivation.php'; + echo '
'.$p->t('passwort/NoHttps').'
+ '.$p->t('passwort/ZuHttpsWechseln').'

'; + } + + echo '
+ '.$errormsg.' +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Username
Code
'.$p->t('passwort/NeuesPasswort').'
'.$p->t('passwort/PasswortWiederholung').'
 
+ '.$p->t('passwort/CaptchaEingabe').' +
+ '.$p->t('passwort/ReloadCaptcha').' +
+ CAPTCHA Image +
+ +
+
'; } -echo '
-'.$errormsg.' -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Username
Code
'.$p->t('passwort/NeuesPasswort').'
'.$p->t('passwort/PasswortWiederholung').'
 
- '.$p->t('passwort/CaptchaEingabe').' -
- '.$p->t('passwort/ReloadCaptcha').' -
- CAPTCHA Image -
- -
-
+echo ' + diff --git a/include/benutzer.class.php b/include/benutzer.class.php index 1b50b3b84..8c3b6e8ba 100644 --- a/include/benutzer.class.php +++ b/include/benutzer.class.php @@ -415,7 +415,7 @@ class benutzer extends person */ public function DeleteAktivierungscode($username) { - $qry = "UPDATE public.tbl_benutzer SET aktivierungscode=null WHERE uid=".$db->db_add_param($username); + $qry = "UPDATE public.tbl_benutzer SET aktivierungscode=null WHERE uid=".$this->db_add_param($username); if($this->db_query($qry)) return true; else diff --git a/include/tw/passwort.inc.php b/include/tw/passwort.inc.php index 4ad86fcc8..2236bf8d2 100644 --- a/include/tw/passwort.inc.php +++ b/include/tw/passwort.inc.php @@ -21,6 +21,7 @@ * Funktionen zum Pruefen der Passwort Policy und setzen des Passworts */ require_once(dirname(__FILE__).'/../addon.class.php'); +require_once(dirname(__FILE__).'/../Crypt_CHAP-1.5.0/CHAP.php'); // die aktiven Addons werden durchsucht, ob eines davon eine eigene UID Generierung vorsieht // falls ja, wird die Version des Addons genommen, ansonsten die Default Generierung diff --git a/system/checksystem.php b/system/checksystem.php index f397fd03d..9c24ec370 100644 --- a/system/checksystem.php +++ b/system/checksystem.php @@ -1383,6 +1383,21 @@ if($result = @$db->db_query("SELECT view_definition FROM information_schema.view } } +// Berechtigungen fuer web User erteilen fuer tbl_benutzer zum reset des aktivierungscodes +if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants WHERE table_name='tbl_benutzer' AND table_schema='public' AND grantee='web' AND privilege_type='UPDATE'")) +{ + if($db->db_num_rows($result)==0) + { + + $qry = "GRANT UPDATE ON public.tbl_benutzer TO web;"; + + if(!$db->db_query($qry)) + echo 'public.tbl_benutzer: '.$db->db_last_error().'
'; + else + echo 'public.tbl_benutzer: Update rechte fuer User web erteilt'; + } +} + echo '


'; $tabellen=array( @@ -1851,4 +1866,4 @@ foreach($webservicerecht as $row) } echo ''; -?> \ No newline at end of file +?>