Domanda

Is there any way to allow spaces in user names Name Givenname and characters like ščťžýáíéúô (any UTF-8 characters) in CodeIgniter Tank Auth library?

I was browse code but I do not know hot to allow it? And aloso I need to allow duplicate usernames (need only email to be unique).

EDIT:

When I trying to register new user I get this error.

http://i.stack.imgur.com/jhxEO.png enter image description here

È stato utile?

Soluzione

I don't think Tank Auth places any restrictions on spaces/characters in the username, it's more likely to be the collation on your users table. Tank Auth uses SQL LOWER() functions to compare usernames to input, so SQL LOWER('whatever is in the DB') must equal PHP strtolower('whatever the user entered').

If your users table is not defined with collation UTF8_GENERAL_CI, try changing it to that.

If that doesn't fix it, the code in models/tank_auth/users.php is very simple, so you can easily adapt it to meet your needs.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top