Myth:Auth - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Addins (https://forum.codeigniter.com/forumdisplay.php?fid=34) +--- Thread: Myth:Auth (/showthread.php?tid=75039) |
RE: Myth:Auth - InsiteFX - 11-13-2020 I put this together tonight may help you. PHP Code: // ------------------------------------------------------------------- Returns the complete user object. 10-15-2020 - Update to do better error checking on the user id. RE: Myth:Auth - suvi - 11-13-2020 @InsiteFX Perfect, thanks RE: Myth:Auth - InsiteFX - 11-13-2020 You can change the result to an array if you like, I like to work with objects. RE: Myth:Auth - suvi - 11-15-2020 Almost there, one thing though... I'm trying to create a form where administrators can create new users. It has a list of groups that can be assigned to the new user. By reading Myth's code I figured out how to create the user in my own controller and how to assign groups to user id with GroupModel. My problem is, I don't know the user id of the newly created user. Is there some direct way to find out what the user id is? Code: $users = model('UserModel'); RE: Myth:Auth - InsiteFX - 11-15-2020 You need to return the insert id of the new user, you could also pass it in the session. PHP Code: $db->insertID() RE: Myth:Auth - suvi - 11-15-2020 @InsiteFX Thanks. Much simpler than the custom User model and entity I wrote to get around the problem RE: Myth:Auth - lan89 - 12-05-2020 Nice work and nice package! I have question How to extends user model & user entities ?. I get this error when try to load getDisplayName() function on Entities Quote:ErrorException #1 app/Entities/User.php PHP Code: <?php namespace App\Entities; app/Models/UserModel.php PHP Code: <?php namespace App\Models; Thanks RE: Myth:Auth - MGatner - 12-06-2020 “ Class 'Myth\Auth\Entities\User' not found” Sounds like you don’t have the package installed correctly. Are you able to use other portions of it? RE: Myth:Auth - lan89 - 12-06-2020 (12-06-2020, 05:33 AM)MGatner Wrote: “ Class 'Myth\Auth\Entities\User' not found” Nevermind m8, i found this issue. I need to load function authentication on Services and all is working good. good reference for extending entities and so on . i take it from : https://github.com/lonnieezell/myth-forums How to use the invitation feature? - suvi - 12-30-2020 In Config/Auth.php theres this: PHP Code: //-------------------------------------------------------------------- How can I generate the tokenized URL? Didn't find anything in the docs or the source code. |