简体   繁体   English

使用PHP在Joomla中创建不受阻碍的用户

[英]Create unblocked user in Joomla using PHP

Despite setting "block" to 0 I cannot create a user who is unblocked. 尽管将“阻止”设置为0,但我无法创建未阻止的用户。 I am able to successfully create users, but I cannot have them be set up from the beginning as unblocked. 我能够成功创建用户,但是不能一开始就将它们设置为不受阻碍。

$data = array(
"name"=>$name,
"username"=>$username,
"password"=>$password,
"password2"=>$password,
"email"=>$email,
"block"=>0,
"sendEmail"=>0,
"groups"=>$arrGroups
);

If you are wondering why I would ever do this it's because I am confident that users who get this far are not bots. 如果您想知道为什么我会这样做,那是因为我有信心做到这一点的用户不是机器人。

That's definitely the code for creating unblocked users. 那绝对是创建不受阻碍的用户的代码。 $data['block'] should be 0. Are you sure that the user was actually blocked and not something else? $data['block']应该为0。确定用户实际上已被阻止,而不是其他什么? Have you checked the row created in the database and checked that the block field is set to 1? 您是否检查了在数据库中创建的行,并检查“ block字段是否设置为1?

Are you 100% sure that the above piece of code is the one being executed when the users are created blocked? 您是否100%确定上述代码是创建用户时被阻止的代码?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM