By jabberwok on
I am trying to make all usernames lowercase
I am using hook_user like this when a user registers.
if($op = 'insert'){
$name = strtolower($edit['name']);
$account ->name = $name;
$edit['name'] = NULL;
}
But the drupal username in users table is still in mixed case letters.
I must be using $edit wrong or something
I have output both $account ->name and $edit['name'] after executing the above code
and $acccount ->name shows lowercase version of username
and $edit['name'] shows nothing
Please tell me where i am going wrong.
Comments
_
Maybe try the 'submit' op?
EDIT
actually, now that I look at this again, try:
I just tried this again and
I just tried this again and it didn't work
I think that was actually the first idea I had.
_
what about
$edit['username'] = drupal_strtolower($edit['name']);I put this code under submit
I put this code under submit but no it did not work
I dont think submit is getting executed on registration though
I will try your code in insert
**EDIT insert did not work either**
After some testing it seems
After some testing it seems that submit is not getting executed at registration
<none>
still need help
_
i'm an idiot, try this:
That did it! after three days
That did it!
after three days on this problem
Thank you much
Hi, I'm not sure whether your
Hi, I'm not sure whether your wanting this as a purely aesthetic thing or not. If you are then have you checked out the CSS text transform property? http://www.w3schools.com/Css/pr_text_text-transform.asp
Not aesthetic
I need it so as to make the email system fully work
for UTF 8 use $string =
for UTF 8 use
$string = mb_strtolower($string);
if still not ok, try mb_convert_case
I tried these functions and
I tried these functions and none worked
you see my problem isn't converting the string
or even overwritting $account ->name or $edit['name']
its getting drupal to save the change to the database
I am considering making a change to the db myself somehow
I just dont know when to make the change
it would get overwritten in $op == 'submit'
$op == 'login' may be the place