fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [9277] registration: include user/password in confirm


From: Sigurd Nes
Subject: [Fmsystem-commits] [9277] registration: include user/password in confirmation mail
Date: Fri, 04 May 2012 10:48:45 +0000

Revision: 9277
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9277
Author:   sigurdne
Date:     2012-05-04 10:48:44 +0000 (Fri, 04 May 2012)
Log Message:
-----------
registration: include user/password in confirmation mail

Modified Paths:
--------------
    trunk/registration/inc/class.bopending.inc.php
    trunk/registration/inc/class.soreg.inc.php
    trunk/registration/inc/class.uireg.inc.php

Modified: trunk/registration/inc/class.bopending.inc.php
===================================================================
--- trunk/registration/inc/class.bopending.inc.php      2012-05-04 09:24:59 UTC 
(rev 9276)
+++ trunk/registration/inc/class.bopending.inc.php      2012-05-04 10:48:44 UTC 
(rev 9277)
@@ -277,8 +277,6 @@
                                
if($so->create_account($reg_info['reg_lid'],$reg_info['reg_info']))
                                {
                                        $info = 
unserialize(base64_decode($reg_info['reg_info']));
-                                       unset($info['passwd']);
-                                       unset($info['passwd_confirm']);
 
                                        $body = <<<HTML
 
@@ -289,10 +287,16 @@
        
        <a href='$url'>Login.</a>
        
+       User: {$reg_info['reg_lid']}
+       Password:{$info['passwd']}
+
        If you did not request this account, simply ignore this message.
        {$support_email_text} {$support_email}
        
 HTML;
+                                       unset($info['passwd']);
+                                       unset($info['passwd_confirm']);
+
                                        try
                                        {
 //                                             $info['email'] = 
'address@hidden';

Modified: trunk/registration/inc/class.soreg.inc.php
===================================================================
--- trunk/registration/inc/class.soreg.inc.php  2012-05-04 09:24:59 UTC (rev 
9276)
+++ trunk/registration/inc/class.soreg.inc.php  2012-05-04 10:48:44 UTC (rev 
9277)
@@ -79,43 +79,70 @@
                                . time() . "', reg_info='" . 
base64_encode(serialize($fields))
                                . "' WHERE 
reg_lid='$account_lid'",__LINE__,__FILE__);
 
-                       if ($this->config['activate_account'] == 
'pending_approval' || $this->config['activate_account'] =='immediately')
+                       if ($this->config['activate_account'] == 
'pending_approval' )
                        {
                                return $this->reg_id;
                        }
 
-                       $smtp = createobject('phpgwapi.send');
+                       if($this->config['activate_account'] =='immediately')
+                       {
+                               $url = 
$GLOBALS['phpgw']->link('/login.php',array( 'logindomain' => 
$GLOBALS['phpgw_info']['user']['domain']),false,true);
+                               $body = <<<HTML
 
-                       $GLOBALS['phpgw']->template->set_file(array(
-                               'message' => 'confirm_email.tpl'
-                       ));
+       Hi {$info['n_given']} {$info['n_family']},
 
-                       if ($fields['n_given'])
-                       {
-                               $GLOBALS['phpgw']->template->set_var 
('firstname', $fields['n_given'] . ' ');
+       This is a confirmation email for your new account on 
{$GLOBALS['phpgw_info']['server']['system_name']}::{$GLOBALS['phpgw_info']['server']['site_title']}.
+       Click on the following link to log into your account. 
+       
+       <a href='$url'>Login.</a>
+
+       User: {$account_lid}
+       Password:{$fields['passwd']}
+
+       If you did not request this account, simply ignore this message.
+       {$support_email_text} {$support_email}
+       
+HTML;
+                       $body = nl2br($body);
                        }
-
-                       if ($fields['n_family'])
+                       else
                        {
-                               $GLOBALS['phpgw']->template->set_var 
('lastname', $fields['n_family'] . ' ');
-                       }
 
+                               $GLOBALS['phpgw']->template->set_file(array(
+                                       'message' => 'confirm_email.tpl'
+                               ));
 
-                       $url = 
$GLOBALS['phpgw']->link('/registration/main.php',array('menuaction'=> 
'registration.boreg.step4', 'reg_id'=> $this->reg_id, 'logindomain' => 
$_REQUEST['logindomain']),false,true);
-                       
$GLOBALS['phpgw']->template->set_var('activate_url',"</br><a 
href='$url'>Link.</a></br>");
+                               if ($fields['n_given'])
+                               {
+                                       $GLOBALS['phpgw']->template->set_var 
('firstname', $fields['n_given'] . ' ');
+                               }
 
-                       if ($this->config['support_email'])
-                       {
-                               $GLOBALS['phpgw']->template->set_var 
('support_email_text', lang ('Report all problems and abuse to'));
-                               $GLOBALS['phpgw']->template->set_var 
('support_email', $this->config['support_email']);
+                               if ($fields['n_family'])
+                               {
+                                       $GLOBALS['phpgw']->template->set_var 
('lastname', $fields['n_family'] . ' ');
+                               }
+
+
+                               $url = 
$GLOBALS['phpgw']->link('/registration/main.php',array('menuaction'=> 
'registration.boreg.step4', 'reg_id'=> $this->reg_id, 'logindomain' => 
$_REQUEST['logindomain']),false,true);
+                               
$GLOBALS['phpgw']->template->set_var('activate_url',"</br><a 
href='$url'>Link.</a></br>");
+
+                               if ($this->config['support_email'])
+                               {
+                                       $GLOBALS['phpgw']->template->set_var 
('support_email_text', lang ('Report all problems and abuse to'));
+                                       $GLOBALS['phpgw']->template->set_var 
('support_email', $this->config['support_email']);
+                               }
+
+                               $body = 
$GLOBALS['phpgw']->template->fp('out','message');
                        }
 
                        $subject = $this->config['subject_confirm'] ? 
lang($this->config['subject_confirm']) : lang('Account registration');
                        $noreply = $this->config['mail_nobody'] ? ('No reply <' 
. $this->config['mail_nobody'] . '>') : ('No reply <noreply@' . 
$GLOBALS['phpgw_info']['server']['hostname'] . '>');
 
+                       $smtp = createobject('phpgwapi.send');
+
                        try
                        {
-                               
$smtp->msg('email',$fields['email'],$subject,$GLOBALS['phpgw']->template->fp('out','message'),'','','',$noreply,'','html');
+                               
$smtp->msg('email',$fields['email'],$subject,$body,'','','',$noreply,'','html');
                        }
                        catch(Exception $e)
                        {

Modified: trunk/registration/inc/class.uireg.inc.php
===================================================================
--- trunk/registration/inc/class.uireg.inc.php  2012-05-04 09:24:59 UTC (rev 
9276)
+++ trunk/registration/inc/class.uireg.inc.php  2012-05-04 10:48:44 UTC (rev 
9277)
@@ -228,57 +228,6 @@
                        $this->template->set_block ('form', 
'other_fields_proto', 'other_fields_list');
                        reset ($this->fields);
                        
-/*
-                       $this->fields['loc1'] = array
-                       (
-                               'field_name' => 'loc1',
-                               'field_text' => 'Eiendom',
-                               'field_type' => 'location',
-                               'field_values' => '',
-                               'field_required' => 'Y',
-                               'field_order' => 0
-               );
-
-                       $this->fields['loc2'] = array
-                       (
-                               'field_name' => 'loc2',
-                               'field_text' => 'Bygning',
-                               'field_type' => 'location',
-                               'field_values' => '',
-                               'field_required' => 'N',
-                               'field_order' => 0
-               );
-
-                       $this->fields['loc3'] = array
-                       (
-                               'field_name' => 'loc3',
-                               'field_text' => 'Etasje',
-                               'field_type' => 'location',
-                               'field_values' => '',
-                               'field_required' => 'N',
-                               'field_order' => 0
-               );
-
-                       $this->fields['loc4'] = array
-                       (
-                               'field_name' => 'loc4',
-                               'field_text' => 'Sone',
-                               'field_type' => 'location',
-                               'field_values' => '',
-                               'field_required' => 'N',
-                               'field_order' => 0
-               );
-
-                       $this->fields['loc5'] = array
-                       (
-                               'field_name' => 'loc5',
-                               'field_text' => 'Rom',
-                               'field_type' => 'location',
-                               'field_values' => '',
-                               'field_required' => 'N',
-                               'field_order' => 0
-               );
-*/
 //_debug_array($this->fields);
                        foreach ($this->fields as $num => $field_info)
                        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]