From edbff3701c3b341437eb6d1b2e3be329b05051c2 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 11 Jun 2013 15:47:44 -0700 Subject: [PATCH] Alt-Auth support for User-Id. (work in progress) --- e107_plugins/alt_auth/alt_auth_adminmenu.php | 12 ++++++++---- e107_plugins/alt_auth/alt_auth_login_class.php | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/e107_plugins/alt_auth/alt_auth_adminmenu.php b/e107_plugins/alt_auth/alt_auth_adminmenu.php index 483925c47..f68ce3e40 100755 --- a/e107_plugins/alt_auth/alt_auth_adminmenu.php +++ b/e107_plugins/alt_auth/alt_auth_adminmenu.php @@ -111,6 +111,7 @@ class alt_auth_admin extends alt_auth_base * 'default' may be a single value to set the same for all connect methods, or an array to set different defaults. */ private $alt_auth_user_fields = array( + 'user_id' => array('prompt' => "User Id", 'help'=>'Use with caution', 'default' => false, 'optional' => TRUE, 'otherdb' => FALSE, 'e107db' => TRUE, 'importdb' => FALSE, 'ldap' => FALSE), 'user_email' => array('prompt' => LAN_ALT_12, 'default' => 'user_email', 'optional' => TRUE, 'otherdb' => TRUE, 'e107db' => TRUE, 'importdb' => FALSE, 'ldap' => TRUE, 'ldap_field' => 'mail'), 'user_hideemail' => array('prompt' => LAN_ALT_13, 'default' => 'user_hideemail', 'optional' => TRUE, 'otherdb' => TRUE, 'e107db' => TRUE, 'importdb' => FALSE, 'ldap' => TRUE, 'ldap_field' => '', method => 'bool1'), 'user_name' => array('prompt' => LAN_ALT_14, 'default' => 'user_name', 'optional' => TRUE, 'otherdb' => TRUE, 'e107db' => TRUE, 'importdb' => FALSE, 'ldap' => TRUE, 'ldap_field' => ''), @@ -143,10 +144,7 @@ class alt_auth_admin extends alt_auth_base $ret .= ""; if ($v['optional'] == FALSE) $ret .= '* '; $ret .= $v['prompt'].':'; - if (isset($v['help'])) - { - $ret .= "
".$v['help'].""; - } + $ret .= ""; // $fieldname = $tableType.'_'.$v['optname']; $fieldname = $tableType.'_xf_'.$f; // Name of the input box @@ -172,6 +170,12 @@ class alt_auth_admin extends alt_auth_base $ret .= '  '.$this->alt_auth_processing($fieldMethod,$v['method'], $method); } } + if (isset($v['help'])) + { + $ret .= "".$v['help'].""; + } + + $ret .= "\n"; } } diff --git a/e107_plugins/alt_auth/alt_auth_login_class.php b/e107_plugins/alt_auth/alt_auth_login_class.php index 4d9eb00bc..34012d119 100755 --- a/e107_plugins/alt_auth/alt_auth_login_class.php +++ b/e107_plugins/alt_auth/alt_auth_login_class.php @@ -211,7 +211,9 @@ class alt_login $newUser['data'] = $db_vals; $userMethods->addNonDefaulted($newUser); validatorClass::addFieldTypes($userMethods->userVettingInfo,$newUser); - $newID = $aa_sql->db_Insert('user',$newUser); + + $newID = $aa_sql->insert('user',$newUser); + if ($newID !== FALSE) { if (count($xFields))