Coder Social home page Coder Social logo

plg_user_restrictusername's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

counterpoint

plg_user_restrictusername's Issues

RFE: restrict also "Name", not only username

I thank you for this plugin. Could you add the ability to apply restrictions to the "Name" field as well, in addition to the "Username" field?

The reason is that there are some bots that make automatic registrations by entering web and/or email addresses within both "Name" and "Username". To stop this behavior, it would be sufficient to apply some restrictions.

It is not giving any result?!

I installed and enabled plugin in my site having Joomla 3.81 version. But It does not show any sign of action. No result.

Regex to check for spam usernames

I’ve tried using your plugin to disallow registrations from spam scripts with a definite pattern of usernames — they always end in two uppercase letters. Although the regex I’ve come up with works in a tester (like https://regex101.com/), it doesn’t work in the plugin. I’ve spent quite a bit of time on this, but after trying to add some logging to your code I’ve realised I know too little about PHP and Joomla to even debug it at this point. Could you give me any suggestions to figure out why this isn’t working?

I do two checks — one for the general format and one for the last characters. I think the general format part works as I’ve tested a username with a non-ASCII character and it was rejected. My check for the endings doesn’t work though.

Regex
/^[a-zA-Z0-9._!!"£$%^&*(){}[\]':;~#>,\/\?\|\+=_]+(?![a-z][A-Z]{2})$/

i.e. alphanumeric plus punctuation
^[a-zA-Z0-9._!!"£$%^&*(){}[\]':;~#>,\/\?\|\+=_]+

then not a lowercase char followed by two uppercase chars at the end
(?<![a-z][A-Z]{2})$

Of course, it’s possible there’s something stupid about my regex too. Very grateful for any help you can give.

Edit: I just realised on posting this that the < is stripped from my expression when I save in the plugin, so it ends up as (?![a-z][A-Z]{2})$. Is lookbehind not possible?

Problems with existing usernames that fail the checks

This plugin is useful for limiting usernames. But I didn't anticipate the issues that arise where there are existing usernames that don't pass the checks. So long as people just login, all is well. However, a problem arises when a user tries to use the "forgotten password" facility. Presumably because the user record gets saved with some new data, triggering the plugin. The user gets a message about permitted usernames, but can't do anything because they have forgotten their password! And the system won't deal with the password reset while the username is failing checks. I'm wondering what is a neat way to get round this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.