[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [17321] include ssn_hash for user-registration
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [17321] include ssn_hash for user-registration |
Date: |
Fri, 17 Nov 2017 09:53:04 -0500 (EST) |
Revision: 17321
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17321
Author: sigurdne
Date: 2017-11-17 09:53:03 -0500 (Fri, 17 Nov 2017)
Log Message:
-----------
include ssn_hash for user-registration
Modified Paths:
--------------
trunk/eventplannerfrontend/inc/class.hook_helper.inc.php
trunk/felamimail/inc/class.bofelamimail.inc.php
trunk/registration/inc/class.boreg.inc.php
trunk/registration/inc/class.soreg.inc.php
Modified: trunk/eventplannerfrontend/inc/class.hook_helper.inc.php
===================================================================
--- trunk/eventplannerfrontend/inc/class.hook_helper.inc.php 2017-11-16
18:18:34 UTC (rev 17320)
+++ trunk/eventplannerfrontend/inc/class.hook_helper.inc.php 2017-11-17
14:53:03 UTC (rev 17321)
@@ -258,6 +258,13 @@
function addaccount()
{
$account_id =
(int)$GLOBALS['hook_values']['account_id'];
+
+ $GLOBALS['phpgw']->db->query("SELECT account_id FROM
phpgw_accounts_data WHERE account_id = {$account_id}",__LINE__,__FILE__);
+ if ($this->db->next_record())
+ {
+ return;
+ }
+
$headers = getallheaders();
$ssn = $headers['uid'];
Modified: trunk/felamimail/inc/class.bofelamimail.inc.php
===================================================================
--- trunk/felamimail/inc/class.bofelamimail.inc.php 2017-11-16 18:18:34 UTC
(rev 17320)
+++ trunk/felamimail/inc/class.bofelamimail.inc.php 2017-11-17 14:53:03 UTC
(rev 17321)
@@ -178,6 +178,11 @@
*/
function addAccount($_hookValues)
{
+ if(!$this->mailPreferences)
+ {
+
phpgwapi_cache::message_set('bofelamimail::mailPreferences not set', 'error');
+ return;
+ }
$icServer =
$this->mailPreferences->getIncomingServer(0);
if(is_a($icServer,'defaultimap')) {
$icServer->addAccount($_hookValues);
Modified: trunk/registration/inc/class.boreg.inc.php
===================================================================
--- trunk/registration/inc/class.boreg.inc.php 2017-11-16 18:18:34 UTC (rev
17320)
+++ trunk/registration/inc/class.boreg.inc.php 2017-11-17 14:53:03 UTC (rev
17321)
@@ -268,6 +268,14 @@
if (!$errors)
{
+ $headers = getallheaders();
+ $ssn = $headers['uid'];
+ if($ssn)
+ {
+ $ssn_hash = "{SHA}" .
base64_encode(phpgwapi_common::hex2bin(sha1($ssn)));
+ $fields['ssn_hash'] =
$GLOBALS['phpgw']->db->db_addslashes($ssn_hash); // just to be safe :)
+ }
+
$so = createobject('registration.soreg');
$reg_id = $so->step2($fields);
}
Modified: trunk/registration/inc/class.soreg.inc.php
===================================================================
--- trunk/registration/inc/class.soreg.inc.php 2017-11-16 18:18:34 UTC (rev
17320)
+++ trunk/registration/inc/class.soreg.inc.php 2017-11-17 14:53:03 UTC (rev
17321)
@@ -445,6 +445,17 @@
{
$GLOBALS['phpgw']->log->write(array('text' => 'I-Notification, user created %1',
'p1' => $account_lid));
+
+ if(!empty($fields['ssn_hash']))
+ {
+
$GLOBALS['phpgw']->db->query("SELECT account_id FROM phpgw_accounts_data WHERE
account_id = " . (int)$account_id,__LINE__,__FILE__);
+ if (!$this->db->next_record())
+ {
+ $data =
json_encode(array('ssn_hash' => $fields['ssn_hash']));
+ $sql = "INSERT INTO
phpgw_accounts_data (account_id, account_data) VALUES ({$account_id},
'{$data}')";
+
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
+ }
+ }
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [17321] include ssn_hash for user-registration,
sigurdne <=