Welcome Guest, Not a member yet? Register   Sign In
Codeigniter Shield Banning users?
#1

(This post was last modified: 04-24-2024, 07:43 AM by xsPurX.)

Hi,
i am looking at this userguideĀ https://shield.codeigniter.com/user_mana...ing_users/
it doesn't make sense cause where do you put the user_id to know which user to ban? The function doesn't show any user id. so if I run this function how will it know what user to ban?
Thanks,
Shawn`
Reply
#2

(This post was last modified: 04-24-2024, 03:55 PM by kenjis.)

In the sample code, $user is a User Entity. It knows user_id.

You can get a User Entity from the User Provider.
https://shield.codeigniter.com/user_mana...ing-a-user
Reply
#3

So I would get the user like this?
Code:
$users = auth()->getProvider();

$user = $users->findById(123);
Reply
#4

Yes.
Reply
#5

Ok, thanks very much. Makes sense now. Smile
Reply
#6

Updated the docs. See the Note:
https://shield.codeigniter.com/user_mana...ing_users/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB