Fool proof. User data security Ch 6 login using name required

Why did I get this form?

There is currently a Brute-force attack on your site. A Brute-force attack is a password guessing attack. In this case, a password is selected for the administrative panel of your site.

To prevent your site from being hacked and to increase its security, we have installed additional protection.

How can I now access the site's admin panel?

Now, when accessing the administrative panel of your website (on Joomla or WordPress), an additional window for entering your login and password will appear with the inscription “please use your control panel password". As a login, you must enter the login of your hosting service, it looks like “u1234567”. The password is the current password for your hosting service.

After passing basic HTTP authentication, you will see a standard login field in the admin panel of your site. Now you will need to enter the site administrator login and password.

How HTTP Basic Authentication Works

When you enter your login and password into the basic authentication window, the login and password hash values ​​will be compared with the values ​​in the special file ~/etc/users available in the hosting control panel. The contents of the file look something like this: “u1234567:dm48bspxIO3rg” . Where “u1234567” is the login, and “dm48bspxIO3rg” is the password hash (note: only the hash, not the password itself!). A password hash is the result of converting a password using a specific algorithm.

Thus, when you enter your username and password into the basic authentication window, a hash of the entered password is taken and compared with the hash value in the ~/etc/users file. If the values ​​match, you are authenticated.

I can't pass basic authentication

You are probably entering the wrong password. Set a new password for basic authentication:

If you have passed basic authentication but cannot log in directly to the admin panel of your Joomla or WordPress site, use the help:

How to increase your website's protection against Brute-force attacks?

To increase site security:

  • change the superuser login to a more unique one. Do not use short names, it is better if you use the first name along with the last name. There are many resources on the Internet where the most popular logins are collected. Familiarize yourself with them and never use them;
  • Set a complex site administrator password. A complex password must contain upper and lower case letters, numbers and additional symbols such as “* - _ # :”, etc. The password length is no less than 6 characters. Preferably 10 and above.
How to remove the HTTP Basic Authentication form?

To remove the HTTP Basic Authentication form:

AuthType Basic AuthName "please use your control panel password" AuthUserFile .../users Require valid-user

To comment a line, put a hash symbol (“#”) at the beginning of the line, like this.

Hello guys hope things are going well, today we will be explaining a very useful tutorial with you. In today's tutorial we will create a simple contact form using angularJS and php.

The contact form is a standard web page that is available on every website. This allows site visitors to contact the site owners or service providers who are responsible for maintaining that website. So we thought why not create a simple contact form using Angularjs and php to receive messages from websites, readers and/or users.

We use Angularjs for the front end and php on the server side. We will write code in php that takes data from an Angular form and sends it via email to the site administrator. Create a folder called “contact-form” in your web application directory and create a sample design HTML pages– index.html. Now copy and paste the code below into the index.html file.

Demo - Simple contact form using Angularjs and php Contact form using angularjs and PHP Your name Email Message Send

Php code to send email

Create a contact.php page and copy paste the code below. Below is the php code that will fetch data from angular form and send via email, by specified address email.

< ?php $post_data = file_get_contents("php://input"); $data = json_decode($post_data); //Just to display the form values echo "Name: " . $data->name; echo "Email: " . $data->email; echo "Message: " . $data->message; // sned an email $to = $data->email; $subject = "Test letter site for testing angularjs contact form"; $message = $data->message; $headers = "From: " . $data->name .. "\r\n" .. "\r\n" . "X-Mailer: PHP/" . phpversion(); //function PHP mail to send email to email address mail($to, $subject, $message, $headers); ?>

We will need the following pages:

  • Registration page with registration form
  • Account activation page
  • Password recovery page
  • Password reset page

The site login form will be placed on all pages of the site (for example, in the header).

This is the registration page we want to get:

Here's the type account will determine which group we will register the user into. Also, the identification field (username) will be email.

Let's add a call to the Register snippet to the page:

[[!Register? &submitVar=`register-btn` &activationResourceId=`27` &activationEmailTpl=`Email.Activation` &activationEmailSubject=`You are registered on example.com` &placeholderPrefix=`reg.` &successMsg=`Thank you for registering. A letter with a link to activate your account has been sent to your email [[!+reg.email]]. Follow this link to complete your registration. ` &usernameField=`email` &usergroupsField=`reg_type` &customValidators=`valueIn` &validate=`username:blank, reg_type:valueIn=^Readers;Writers;Idlers ^, fullname:required:minLength=^6^, password:required:minLength =^6^, password_confirm:password_confirm=^password^, email:required:email` ]] [[!+error.message:default=`[[!$Register.Form]]`]]

Please note that all registration-related tags must be called uncached. The same rules apply when processing forms with the FormIt snippet.

Let's look at the call parameters:

&submitVar=`register-btn` - specifies the name attribute of the input tag. That is, the snippet will only work if the form is submitted with a button with a specific name.

&activationResourceId=`42` - looking ahead, 42 is the identifier of the page on which we will activate the user.

&activationEmailTpl=`Email.Activation` - chunk with the activation letter, more on that later.

&placeholderPrefix=`reg.` - indicates that all placeholders, with rare exceptions (more on this later), that are created in this snippet must begin with “reg.”.

&successMsg – the message that will be displayed when the form is successfully submitted. Note that it can contain values ​​from the form and any other tags. This message will be written to the placeholder [[!+error.message]]. Quite a strange name, and in the documentation for at the moment error. It says [[!+reg.error.message]], but the component code shows that this is not the case.

&usernameField=`email` - specifies that the email field will be used as the username.

&usergroupsField=`reg_type` - defines a field that specifies the group to which the new user will be added.

&customValidators=`valueIn` - specifies additional validators that need to be created manually.

&validate – validators are specified separated by commas for each field, and if several validators are required for one field, they are also separated by a colon. Let's look at them separately:

username:blank is a simple spam trap that means that the username field should be left empty.

reg_type:valueIn=^Readers;Writers;Idlers^ - we limit the possible groups to the three specified. There is no such thing in the initial distribution and evil hackers can register, for example, under the Administrator group (if you have not renamed it).

fullname:required:minLength=^6^ - the fullname field must not be empty and contain at least 6 characters.

password:required:minLength=^6^ - similar for password.

password_confirm:password_confirm=^password^ - passwords must match.

email:required:email – email must not be empty and be an actual mail.

The [[!+error.message:default=`[[!$Register.Form]]`]] construction displays a message about the successful submission of the form or chunk of the form if you just visited the page or filled it out incorrectly.

Let's create the above valueIn validator. To do this, create a snippet called valueIn and the following code:

$valueIn = explode(";", $param); return in_array($value, $valueIn);

Now you need to create a chunk Register.Form. In this case it will be as follows (Bootstrap 3 is used):

Select account type Chukchi-Reader Peysatel Bum Introduce yourself: [[!+reg.error.fullname:notempty=`[[!+reg.error.fullname]]`]] E-mail: [[!+reg.error.email:notempty=`[[!+reg.error.email]]`]] Password: [[!+reg.error.password:notempty=`[[!+reg.error .password]]`]] Repeat password: [[!+reg.error.password_confirm:notempty=`[[!+reg.error.password_confirm]]`]]

All fields are required

In this form I will note a few things regarding MODX: