Lack of interest userdw improvement

R

ragtek

Guest
the usergroup
Why it's necessary, to set the default usergroup id for new users manual??
IMO this should be handled by the datawriter,... if non groupid is set, set the default groupid ( XenForo_Model_User::$defaultRegisteredGroupId )

IMO the logic doesn't need to handle this.
just like the language_id for example

the userdw should require IMO only username & pw to be able to create successful a new user record.
All other fields are already handled by the dw, so the default group id should be handled too, without needing to set it manual
 
R

ragtek

Guest
that's what i have changed and is working


Code:
Index: library/XenForo/DataWriter/User.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- library/XenForo/DataWriter/User.php(revision )
+++ library/XenForo/DataWriter/User.php(revision )
@@ -65,7 +65,7 @@
 'visible'
 => array('type' => self::TYPE_BOOLEAN, 'default' => 1),
 'user_group_id'
-=> array('type' => self::TYPE_UINT, 'required' => true),
+=> array('type' => self::TYPE_UINT),
 'secondary_group_ids'
 => array('type' => self::TYPE_BINARY, 'default' => ''),
 'display_style_group_id'
@@ -731,7 +731,11 @@
 if ($this->isChanged('scheme_class', 'xf_user_authenticate') || $this->isChanged('data', 'xf_user_authenticate'))
 {
 $this->set('remember_key', XenForo_Application::generateRandomString(40));
+}
+
+        if (!$this->get('user_group_id')){
+            $this->set('user_group_id', XenForo_Model_User::$defaultRegisteredGroupId);
-}
+        }
 
 if (!$this->get('csrf_token'))
 {
 

Attachments

Top