Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typos #155

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 1-minimal/classes/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct() {

// check the possible login actions:
// 1. logout (happen when user clicks logout button)
// 2. login via session data (happens each time user opens a page on your php project AFTER he has sucessfully logged in via the login form)
// 2. login via session data (happens each time user opens a page on your php project AFTER he has successfully logged in via the login form)
// 3. login via post data, which means simply logging in via the login form. after the user has submit his login/password successfully, his
// logged-in-status is written into his session data on the server. this is the typical behaviour of common login scripts.

Expand Down
6 changes: 3 additions & 3 deletions 1-minimal/classes/Registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private function registerNewUser() {

} elseif (!preg_match('/^[a-z\d]{2,64}$/i', $_POST['user_name'])) {

$this->errors[] = "Username does not fit the name sheme: only a-Z and numbers are allowed, 2 to 64 characters";
$this->errors[] = "Username does not fit the name scheme: only a-Z and numbers are allowed, 2 to 64 characters";

} elseif (empty($_POST['user_email'])) {

Expand All @@ -77,7 +77,7 @@ private function registerNewUser() {

} elseif (!filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {

$this->errors[] = "Your email adress is not in a valid email format";
$this->errors[] = "Your email address is not in a valid email format";

} elseif (!empty($_POST['user_name'])
&& strlen($_POST['user_name']) <= 64
Expand Down Expand Up @@ -142,7 +142,7 @@ private function registerNewUser() {

} else {

$this->errors[] = "An unknown error occured.";
$this->errors[] = "An unknown error occurred.";

}

Expand Down
2 changes: 1 addition & 1 deletion 1-minimal/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// load the registration class
require_once("classes/Registration.php");

// create the registration object. when this object is created, it will do all registration stuff automaticly
// create the registration object. when this object is created, it will do all registration stuff automatically
// so this single line handles the entire registration process.
$registration = new Registration();

Expand Down
8 changes: 4 additions & 4 deletions 2-advanced/classes/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public function editUserPassword() {
// check if exactly one row was successfully changed:
if ($this->db_connection->affected_rows == 1) {

$this->messages[] = "Password sucessfully changed!";
$this->messages[] = "Password successfully changed!";

} else {

Expand Down Expand Up @@ -719,7 +719,7 @@ public function editNewPassword() {
if ($this->db_connection->affected_rows == 1) {

$this->password_reset_was_successful = true;
$this->messages[] = "Password sucessfully changed!";
$this->messages[] = "Password successfully changed!";

} else {

Expand All @@ -742,7 +742,7 @@ public function editNewPassword() {

} else {

$this->errors[] = "Passwords dont match, please request a new password reset.";
$this->errors[] = "Passwords don't match, please request a new password reset.";

}

Expand Down Expand Up @@ -805,7 +805,7 @@ public function getGravatarImageUrl($email, $s = 50, $d = 'mm', $r = 'g', $atts
$url .= md5( strtolower( trim( $email ) ) );
$url .= "?s=$s&d=$d&r=$r&f=y";

// the image url (on gravatarr servers), will return in something like
// the image url (on gravatar servers), will return in something like
// http:https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?s=80&d=mm&r=g
// note: the url does NOT have something like .jpg
$this->user_gravatar_image_url = $url;
Expand Down
4 changes: 2 additions & 2 deletions 2-advanced/classes/Registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private function registerNewUser() {

} elseif (!preg_match('/^[a-z\d]{2,64}$/i', $_POST['user_name'])) {

$this->errors[] = "Username does not fit the name sheme: only a-Z and numbers are allowed, 2 to 64 characters";
$this->errors[] = "Username does not fit the name scheme: only a-Z and numbers are allowed, 2 to 64 characters";

} elseif (empty($_POST['user_email'])) {

Expand Down Expand Up @@ -188,7 +188,7 @@ private function registerNewUser() {

} else {

$this->errors[] = "An unknown error occured.";
$this->errors[] = "An unknown error occurred.";

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS `login`.`users` (
`user_account_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'user''s account type (basic, premium, etc)',
`user_has_avatar` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 if user has a local avatar, 0 if not',
`user_rememberme_token` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'user''s remember-me cookie token',
`user_failed_logins` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'user''s failed login attemps',
`user_failed_logins` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'user''s failed login attempts',
`user_last_failed_login` int(10) DEFAULT NULL COMMENT 'unix timestamp of last failed login attempt',
`user_activation_hash` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'user''s email verification hash string',
`user_password_reset_hash` char(40) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'user''s password reset code',
Expand Down
10 changes: 5 additions & 5 deletions 4-full-mvc-framework/models/login_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function login() {
public function logout() {

// set the rememberme-cookie to yesterday.
// that's obivously the best practice to kill a cookie via php
// that's obviously the best practice to kill a cookie via php
// @see http:https://stackoverflow.com/a/686166/1114320
setcookie('rememberme', false, time() - 3600, '/');

Expand Down Expand Up @@ -550,7 +550,7 @@ public function setGravatarImageUrl($email, $s = 44, $d = 'mm', $r = 'pg', $atts
$url .= md5( strtolower( trim( $email ) ) );
$url .= "?s=$s&d=$d&r=$r";

// the image url (on gravatarr servers), will return in something like
// the image url (on gravatar servers), will return in something like
// http:https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?s=80&d=mm&r=g
// note: the url does NOT have something like .jpg
Session::set('user_gravatar_image_url', $url);
Expand Down Expand Up @@ -594,7 +594,7 @@ public function createAvatar() {
// btw: why does PHP call this getimagesize when it gets much more than just the size ?
$image_proportions = getimagesize($_FILES['avatar_file']['tmp_name']);

// dont handle files > 5MB
// don't handle files > 5MB
if ($_FILES['avatar_file']['size'] <= 5000000 ) {

if ($image_proportions[0] >= 100 && $image_proportions[1] >= 100) {
Expand All @@ -606,7 +606,7 @@ public function createAvatar() {
if (is_writeable($target_file_path)) {

// creates a 44x44px avatar jpg file in the avatar folder
// see the function defintion (also in this class) for more info on how to use
// see the function definition (also in this class) for more info on how to use
$this->resize_image($_FILES['avatar_file']['tmp_name'], $target_file_path, 44, 44, 85, true);

$sth = $this->db->prepare("UPDATE users SET user_has_avatar = TRUE WHERE user_id = :user_id");
Expand Down Expand Up @@ -913,7 +913,7 @@ public function verifypasswordrequest($user_name, $verification_code) {

if ($result_user_row->user_password_reset_timestamp > $timestamp_one_hour_ago) {

// verification was sucessful
// verification was successful
return true;

} else {
Expand Down
2 changes: 1 addition & 1 deletion 4-full-mvc-framework/models/overview_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function getUserProfile($user_id) {
}

/**
* Gets a gravatar image link from given email adress
* Gets a gravatar image link from given email address
* Gravatar is the #1 (free) provider for email address based global avatar hosting.
* The URL (or image) returns always a .jpg file !
* For deeper info on the different parameter possibilities:
Expand Down
2 changes: 1 addition & 1 deletion 4-full-mvc-framework/views/dashboard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
Try to log out, an go to /dashboard/ again. You'll be redirected to /index/ as you are not logged in.
...<br/><br/>
You can protect a whole section in your app within the according controller (here: controllers/dashboard.php)
by placing <span style='font-style: italic;'>Auth::handleLogin();</span> into the contructor.
by placing <span style='font-style: italic;'>Auth::handleLogin();</span> into the constructor.
</div>
2 changes: 1 addition & 1 deletion 4-full-mvc-framework/views/login/changeaccounttype.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h1>Change account type</h1>

<p>
This page is a basic implementation of the upgrage-process.
This page is a basic implementation of the upgrade-process.
User can click on that button to upgrade their accounts from
"basic account" to "premium account". This script simple offers
a clickable button that will upgrade/downgrade the account instantly.
Expand Down
4 changes: 2 additions & 2 deletions 4-full-mvc-framework/views/login/edituseremail.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="content">

<h1>Change your email adress</h1>
<h1>Change your email address</h1>

<?php

Expand All @@ -16,7 +16,7 @@

<form action="<?php echo URL; ?>login/edituseremail_action" method="post">

<label>New email adress:</label>
<label>New email address:</label>
<input type="text" name="user_email" />

<label>Your password (to prove it's really YOU):</label>
Expand Down
4 changes: 2 additions & 2 deletions 4-full-mvc-framework/views/overview/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<p>
This controller/action/view shows a list of all users in the system.
You could use the underlaying code to build things that use profile information
You could use the underlying code to build things that use profile information
of one or multiple/all users.
</p>

<p>
<span style="color: red;">NOTE: be sure NOT to show email adresses of users in a real app. This is just a demo.</span>
<span style="color: red;">NOTE: be sure NOT to show email addresses of users in a real app. This is just a demo.</span>

<table class="overview-table">
<?php
Expand Down
2 changes: 1 addition & 1 deletion 4-full-mvc-framework/views/overview/showuserprofile.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</p>

<p>
<span style="color: red;">NOTE: be sure NOT to show email adresses of users in a real app. This is just a demo.</span>
<span style="color: red;">NOTE: be sure NOT to show email addresses of users in a real app. This is just a demo.</span>

<table class="overview-table">
<?php
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ https://github.com/panique/php-login-styles
- `4-full-mvc-framework`: http:https://109.75.177.79:84/

Server's phpinfo() here: http:https://109.75.177.79:80/ ! Feel free to test the scripts, and feel free to find security holes, problems and errors.
Please note that this is just a preview, so don't misuse it. Also don't post your personal email adress here as it will be visible! Use a trash
Please note that this is just a preview, so don't misuse it. Also don't post your personal email address here as it will be visible! Use a trash
mail account instead, like this one: http:https://trashmail.ws/

###DIFFERENT VERSIONS
Expand All @@ -48,7 +48,7 @@ mail account instead, like this one: http:https://trashmail.ws/
- feature: email must be provided, email must fit email format (checked in PHP and client-side in HTML5)
- feature: password and password repeat check need to be the same (strict php string check ===)
- security: SQL injection prevention: everything is escaped with real_escape_string()
- security: passwords are hashed and salted using the offical PHP 5.5 password hashing functions
- security: passwords are hashed and salted using the official PHP 5.5 password hashing functions
- security: (works 100% too in PHP 5.3 and 5.4 due to included function compatibility file (in "libraries"))
- security: user input is cleaned, your php app is protected against XSS attacks

Expand Down Expand Up @@ -86,7 +86,7 @@ BIG BIG THANKS to **JREAM** and his excellent mvc-framework tutorial / codebase
The **PHP Login Framework** is build using code from JReam's framework (I took the base code from
"Part 3" and improved with code from "Part 9", "Part 10" and "Part 11", so the code itself is still basic
and not too advanced). If you like, have a look on the how-to-build-a-framework-tutorials on his site,
they are excellent and very sympathic.
they are excellent and very friendly.

*Screenshot (desktop) from the 4-full-mvc-framework:*

Expand Down Expand Up @@ -124,8 +124,8 @@ that in the first lines on the script.
* 2. change mySQL user and or mySQL password in config/db.php ("DB_USER" and "DB_PASS").
* 3. as this version uses email sending, you'll need to a) provide an SMTP account in the config OR b) install a mail server tool on your server.
If you want to use local mail sending (which is NOT recommended) then please have a look into the file "how to setup mail in PHP.txt" in the "_install" folder.
If you want to use SMTP mail sending, then get an SMTP accound (gmail.com for example) and put your login data into the config/email.php file.
There's already a demo account sheme in the config. To connect to a SMTP service you'll proably need the PHP OpenSSL module, which is usually
If you want to use SMTP mail sending, then get an SMTP account (gmail.com for example) and put your login data into the config/email.php file.
There's already a demo account scheme in the config. To connect to a SMTP service you'll probably need the PHP OpenSSL module, which is usually
preinstalled on php/apache2. If it's not activated, please do so by uncommenting this line `extension=php_openssl.dll` in your php.ini !

#####HOW TO INSTALL 4-FULL-MVC-FRAMEWORK VERSION
Expand All @@ -138,7 +138,7 @@ the config files/.htaccess like described below. Sometimes, you'll need to insta
if there's a better way] on that folder.
* 2. activate the apache module mod_rewrite by typing on the command line (on your server): `a2enmod rewrite`
* 3. usually the mod_rewrite module will not work now (why?), so you have to edit
`/etc/apache2/sites-available/default` and change the first two occurences of `AllowOverride None` to `AllowOverride All`
`/etc/apache2/sites-available/default` and change the first two occurrences of `AllowOverride None` to `AllowOverride All`
* 4. restart your server by typing `service apache2 restart` or `/etc/init.d/apache2 restart`

Please note: I really don't understand why it's so goddamn complicated to set up the most simple features on a linux server.
Expand All @@ -152,8 +152,8 @@ And a general StackOverflow discussion about the activation of mod_rewrite (and
http:https://stackoverflow.com/q/869092/1114320

If you want to use local mail sending (which is NOT recommended) then please have a look into the file "how to setup mail in PHP.txt" in the "_install" folder.
If you want to use SMTP mail sending, then get an SMTP accound (gmail.com for example) and put your login data into the config/email.php file.
There's already a demo account sheme in the config. To connect to a SMTP service you'll proably need PHP OpenSSL module, which is usually
If you want to use SMTP mail sending, then get an SMTP account (gmail.com for example) and put your login data into the config/email.php file.
There's already a demo account scheme in the config. To connect to a SMTP service you'll probably need PHP OpenSSL module, which is usually
preinstalled on php/apache2. If it's not activated, please do so by uncommenting this line `extension=php_openssl.dll` in your php.ini !

*IN THE CODE*
Expand All @@ -162,7 +162,7 @@ preinstalled on php/apache2. If it's not activated, please do so by uncommenting
* 2. change mySQL user and or mySQL password in config/db.php ("DB_USER" and "DB_PASS").
* 3. change the LIB constant in config/config.php to the URL (not path!) of your app.
* 4. change the RewriteBase in .htaccess to the subfolder of your web/ht_docs/www directory (not path!, not URL!) where your app is in.
If your app is in the root of your web folder, then pleae delete this line. If it's in var/www/myapp, then your line should look like
If your app is in the root of your web folder, then please delete this line. If it's in var/www/myapp, then your line should look like
RewriteBase /myapp/
* 5. Mail sending: if you are using a local mail server tool (sendmail) then you can skip this step. If you want to use an SMTP account
then fill in your credentials in EMAIL_SMTP_... and set EMAIL_USE_SMTP to true.
Expand Down Expand Up @@ -194,7 +194,7 @@ Yeah, a little bit weird, but the people behind PHP have thought about this, and
Have a look on this excellent answer on StackOverflow to read more about this topic:
[How do I expire a PHP session after 30 minutes?](http:https://stackoverflow.com/a/1270960/1114320).
For this script it means, that when you close your browser and open it again, and are still logged in, it has to do with
PHP's session gargabe collector process ;)
PHP's session garbage collector process ;)

###IF YOU WANT TO KNOW MORE ABOUT THE PHP 5.5 (and 5.3/5.4) PASSWORD FUNCTIONS

Expand All @@ -212,7 +212,7 @@ You can find all them in the project's [github wiki](https://github.com/panique/
* are the database connection infos in config/db.php correct ?
* have you created a database named "login" like mentioned above ?
* does the provided database user (standard is "root") have rights to read (and write) the database ?
* please don't use this script if you have absolutly no idea what PHP or MySQL is. Seriously.
* please don't use this script if you have absolutely no idea what PHP or MySQL is. Seriously.
* the 2-advanced and 4-full-mvc-framework versions use mail sending, so you need to have `sendmail` or something enabled on your server.
Please see the instruction in the folder "__install" if you need help with that. The 4-full-mvc-framework version also allows to send
mails with an SMTP account.
Expand Down