Browse Source

user add fix

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
2d5943e3f7

+ 3
- 1
src/Auth/Business/LuticateUsersBusiness.php View File

@@ -120,7 +120,7 @@ class LuticateUsersBusiness extends LuBusiness {
120 120
         return LuticateUsersLightDbo::fromUserDbo($user);
121 121
     }
122 122
 
123
-    public static function add($username, $email, $password)
123
+    public static function add($username, $email, $firstname, $lastname, $password)
124 124
     {
125 125
         $hash = self::hashPassword($password);
126 126
         if (filter_var($username, FILTER_VALIDATE_EMAIL))
@@ -138,6 +138,8 @@ class LuticateUsersBusiness extends LuBusiness {
138 138
         $user->setEmail($email);
139 139
         $user->setPassword($hash);
140 140
         $user->setUsername($username);
141
+        $user->setFirstname($firstname);
142
+        $user->setLastname($lastname);
141 143
         $user->setSalt(self::getSalt());
142 144
 
143 145
         DB::beginTransaction();

+ 8
- 4
src/Auth/Controller/LuticateUsersController.php View File

@@ -58,12 +58,14 @@ class LuticateUsersController extends LuController {
58 58
      * Add a user
59 59
      * @param $username string The new user username
60 60
      * @param $email string The new user email
61
+     * @param $firstname string The user firstname
62
+     * @param $lastname string The user lastname
61 63
      * @param $password string The new user plain text password
62 64
      * @return int
63 65
      */
64
-    public function add($username, $email, $password)
66
+    public function add($username, $email, $firstname, $lastname, $password)
65 67
     {
66
-        return LuticateUsersBusiness::add($username, $email, $password);
68
+        return LuticateUsersBusiness::add($username, $email, $firstname, $lastname, $password);
67 69
     }
68 70
 
69 71
     /**
@@ -92,12 +94,14 @@ class LuticateUsersController extends LuController {
92 94
     /**
93 95
      * Edit the logged user email
94 96
      * @param $email string The new user email
97
+     * @param $firstname string The user firstname
98
+     * @param $lastname string The user lastname
95 99
      * @param $_user LuticateUsersDbo The logged user
96 100
      * @return bool
97 101
      */
98
-    public function editMe($email, $_user)
102
+    public function editMe($email, $firstname, $lastname, $_user)
99 103
     {
100
-        return LuticateUsersBusiness::edit($_user->getId(), $email);
104
+        return LuticateUsersBusiness::edit($_user->getId(), $firstname, $lastname, $email);
101 105
     }
102 106
 
103 107
     /**

Loading…
Cancel
Save