News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Popular Users per Language and Region with Silex and Github
June 18, 2015 @ 11:53:49

The SitePoint PHP blog has a new tutorial posted showing you how to use the data the GitHub API provides to find popular users, per language, in an area. His sample example is a simple Silex framework based application and uses the KNPLabs GitHub library to interface with the API.

The data you can get through the GitHub API V3 is mostly what you can see on the GitHub web interface, except you can use the data in your application to come to interesting conclusions. That is what we are going to do in this article. [...] Now, what if there was a web service in which we could specify a location and a language (e.g. PHP) and get a sorted list of contributors to open-source? [...] In our web service, we will have one endpoint (i.e. action, URL) that shows the most popular ten creators. The most popular creators are the people in a location who have the largest number of stargazers. For this, we will retrieve each person's repositories and add up the number of times each one has been starred.

He steps you through getting a Homestead Improved VM up and running (via Vagrant) and a basic Silex application up and running inside. He then pulls in the KNPLabs GitHub library via Composer and sets up a new client in the default route (and grabs the public user data for a user). He then shows how to change it up and use the Search API and some special queries to locate users by a given location. He adds another class, a "StarGazerCalculator", that's given the users returned, filters out the forks in the list and calculates the total "stargazer" count for the user. He does the same with the "top creators" list and sets it up as a service provider, fetches the data and returns the results as a JSON document.

0 comments voice your opinion now!
popular user language region github api silex tutorial

Link: http://www.sitepoint.com/popular-users-per-language-region-silex-github/

SitePoint PHP Blog:
Symfony2 Pre-registration and Invite System
May 07, 2015 @ 08:25:48

The SitePoint PHP blog has kicked off a new series of posts today with part one of a set of tutorials showing you how to create a registration and invitation system with Symfony2. While they've talked about general Symfony2 development before, this series will focus more on the security side, on authentication and authorization.

In this article series of two parts, we are going to talk about a very important area of web application development: Authentication and Authorization. Symfony2 has a very detailed elaboration of these two topics in its official documentation. Anyone who is seriously looking into this is encouraged to read through that official document after absorbing the essentials from this tutorial.

The author starts with a brief list of common user management tasks including registration via a form, sending confirmation emails and verifying the user's login. He helps you create the underlying "user" table (complete with the SQL) and talks a bit about the contents of a few of the columns. He includes the settings you'll need to put into your "security.yml" configuration file and a bit of detail on what each section and its settings mean. He then moves on to the "User" entity and class file, adding some functionality to the standard generated class. He also includes the code needed to create the invite and registration actions.

0 comments voice your opinion now!
registration invite system symfony2 tutorial user management authentication authorization

Link: http://www.sitepoint.com/symfony2-pre-registration-invite-system/

SitePoint PHP Blog:
Efficient User Timelines in a PHP Application with Neo4j
April 15, 2015 @ 12:41:25

In the latest post to the SitePoint PHP blog Christophe Willensen shows you how to use PHP and the Neo4j graph database to make efficient user timelines in your application. In this case, "timeline" should be thought of as something like a Twitter or Facebook status update feed.

Any social application you encounter nowadays features a timeline, showing statuses of your friends or followers generally in a descending order of time. Implementing such a feature has never been easy with common SQL or NoSQL databases. Complexity of queries, performance impacts increasing with the number of friends/followers and difficulties to evolve your social model are points that graph databases are eliminating. In this tutorial, we're going to extend the demo application used by the two introduction articles about Neo4j and PHP.

He starts off with a look at how to model the timeline in the graph database, showing different methods to create the relationships: one a direct user-to-post and the other via a linked list. He goes through the initial setup of the codebase and the sample dataset to populate the Neo4j database. He then includes code samples showing how to get the latest feed items for a user and displaying the results in a simple template (Twig-based). He also shows how to get the latest posts for the timeline and how to add a new post.

0 comments voice your opinion now!
tutorial neo4j database graph user timeline socialmedia

Link: http://www.sitepoint.com/efficient-user-timelines-php-application-neo4j/

NetTuts.com:
Programming With Yii2 Integrating User Registration
March 24, 2015 @ 12:27:16

NetTuts.com has posted the next part in their "Programming with Yii2" series today with this tutorial showing you how to integrate user registration into your sample application.

This is part four of a series on Yii2. In Programming With Yii2: Getting Started, we set up Yii2 locally, built a Hello World application, set up a remote server, and used Github to deploy our code. In part two, we learned about Yii's implementation of its Model View Controller architecture and how to build web pages and forms that collect and validate data. In part three, we learned about working with databases and ActiveRecord. In this tutorial, we'll walk you through integrating a popular user registration plugin.

They walk you through the use of the Yii2-User extension to provide the user handling functionality. The tutorial shows you how to get it installed (via Composer), run its database migrations to create the needed tables and where to update the configuration files to pull the plugin into the execution. They also help you set up SwiftMailer (what it uses to send its emails) and then gets into the integration of the registration with the application with a signup page.

0 comments voice your opinion now!
programming yii2 integration user registration yii2user extension tutorial

Link: http://code.tutsplus.com/tutorials/programming-with-yii2-integrating-user-registration--cms-22974

SitePoint PHP Blog:
User Authentication in Symfony2 with UserApp.io
March 19, 2015 @ 09:18:18

On the SitePoint PHP blog Daniel Sipose has written up a tutorial showing you how to use the UserApp.io service to authenticate users for your Symfony2 applications.

UserApp.io is a handy user management tool and API. It provides a web interface to deal with user accounts (and the many features this involves) and an API to hook them into your own web application. The purpose of this service is to make it easier and safer to manage user authentication by not having to worry about that on your own server. It has SDKs and various wrappers for many programming languages and frameworks and the price is affordable. Yes, it comes with a price but you can get started freely with quite a lot of things to play around with.

He makes use of this library (his own creation) and the UserApp.io SDK to hook into Symfony2's own Security component authentication handling. He starts by explaining some of the classes he'll be creating including the form authenticator, a user provider, the logout handler and an custom exception. The full code is included for each as well as the changes you'll need to make to the YAML configuration to hook it all together.

0 comments voice your opinion now!
user authentication symfony2 userappio service tutorial

Link: http://www.sitepoint.com/user-authentication-symfony2-userapp-io/

Joshua Thijssen:
Advanced user switching
February 25, 2015 @ 09:12:05

Joshua Thijssen has a new post today with a "neat trick" that the Symfony Security component allows - switching (impersonating) another user programatically.

This allows you to login as another user, without supplying their password. Suppose a client of your application has a problem at a certain page which you want to investigate. Sometimes this is not possible under your own account, as you don't have the same data as the user, so the issue might not even occur in your account. Instead of asking the password from the user itself, which is cumbersome, and not a very safe thing to begin with, you can use the switch-user feature.

He talks about how to enable it, how to use it to switch to another user and, most important, how to restrict its use. He points out that there's no way to define who a user can switch to built-in, so he's come up with a custom "switch listener" to help add in this protection. His "SwitchUserListener" class replicates some of the code in the original handling (well, the whole class) and updates the "attemptSwitchUser" method to check the user they're trying to switch to and see if they have the right role. Finally he shows how to add it to the services configuration and how it overrides the default listener.

0 comments voice your opinion now!
user switching advanced tutorial custom listener role access validate

Link: https://www.adayinthelifeof.nl/2015/02/24/advanced-user-switching/

SitePoint PHP Blog:
How to Implement User Log-in with PayPal
November 03, 2014 @ 12:19:09

On the SitePoint PHP blog there's a new tutorial today showing you how to setup a user login through PayPal that lets users authenticate for your application through PayPal's systems.

Curiosity is one of the most important traits in our job. The other day, I found myself exploring PayPal documentation to find something interesting to learn (and share). After a while I stumbled upon the Log In with PayPal tool. With the "Log In with PayPal" tool, your users can authenticate into your application using PayPal. It's the same procedure we already know for Facebook, or maybe Twitter and GitHub. Using this type of authentication is recommended if you want to integrate it with an e-commerce website, but you can use it in every situation and application that requires a user account or membership.

He starts by answering the "why use it" question, suggesting that it adheres to one of the main goals of good, secure authentication systems - simplicity. He then shares an overview of how the process flow works including a graphic outlining each piece involved and what kinds of data is transmitted at each step. He then walks you through the full process of setting up a PayPal application on your account and using the Httpful library (installed via Composer) to connect to their API. He includes the code you'll need to include in your application to provide the link to PayPal for the login and the page it will return to once the process is complete.

0 comments voice your opinion now!
login paypal tutorial user oauth flow httpful api

Link: http://www.sitepoint.com/implement-user-log-paypal/

Joshua Thijssen:
Symfony2 logging out
October 10, 2014 @ 10:51:03

In this new post to his site Joshua Thijssen talks about something that's usually considered a common task and might be overlooked when it comes to security: logging out (specifically in Symfony-based applications).

One of the "golden rules" of symfony2 is to never hardcode urls or paths inside your code or templates. And letting symfony deal with the generation of your urls and paths makes your life a lot easier as a developer. But one of the things I see regularly is that people are still hardcoding their logout urls like using "/logout". But logging out is actually a bit more complex than it might seem, and using a simple /logout might work for most cases, but there are better ways to deal with this.

To give some context, he starts with an overview of the Security component of the Symfony framework, mentioning how it can be configured with different "secure" areas and how they handle the user authentication. He includes an example configuration of one of these "firewalls" in a YAML document with three different sections: "dev", "superadminstuff" and "main". He explains what each of these sections are configuring and how they will react when the user visits them. He talks some about the "logout: true" handling and what kind of defaults are also included when it's called. He suggests that, instead of a hard-coded "logout" URL in your application, you make use of the "logout_url" and "logout_path" functions to create the link for you, making it consistent across the application and easier to configure.

0 comments voice your opinion now!
symfony logout security user login component link

Link: https://www.adayinthelifeof.nl/2014/10/06/symfony2-logging-out/

Cal Evans:
"Delivery Initiated" A word on having empathy for the users of your software
October 08, 2014 @ 09:24:37

In his latest post Cal Evans reminds us, as software developers, that our jobs aren't always about making the things we create about the best code or most tech. It's also about having empathy for users of the software you're building.

I learned something very important in all of [the troubles I had with traveling to Amsterdam], I learned that we as software developers and designers need to have a great deal of empathy for the people using what we build. It is not enough to put yourself in your user's shoes, you have to put yourself in their mindset. You have to design every user interaction with an understanding of not only who is using your software, but why they are using it.

He focuses the rest of the post on his experience post-delay, trying to get an update on where in the world his luggage might be via a URL given to him by the lost luggage group. He comments on the terseness of the message he was given on the page ("Delivery Initiated") but points out that it's not overly user-friendly and really doesn't give much information. He suggests that the developers of the tool didn't actually think about end users, just that they should share a status and that's all.

It is not enough to create personas and figure out who is using your software. You need to understand why they are using it, and what their mindset will be when they are using it. You need to have empathy for your users.
0 comments voice your opinion now!
user empathy system opinion travel luggage delivery

Link: http://blog.calevans.com/2014/10/07/delivery-initated-a-word-on-having-empathy-for-the-users-of-your-software/

The Code of a Ninja:
Salt, Hash and Store Passwords Securely with Phpass
June 16, 2014 @ 11:15:37

In this post to the CodeOfANinjs.com site, they walk you through password hashing, salting and storage using the PHPAss tool from OpenWall. The post itself is a bit older, but the content still provides a good example to teach the basics.

I think the main reason why we have to hash passwords is to prevent passwords from being stolen or compromised. You see, even if someone steal your database, they will never read your actual or cleartext password. I know that some PHP frameworks or CMS already provide this functionality, but I believe that it is important for us to know how its implementation can be made.

The tutorial shows you how to use the library and how to store the result in a simple "users" table in a MySQL database. The examples hash the password given from a simple form and use prepared statements (via PDO) to save it to the database. All PHP, HTML and CSS code you'll need - including the login form that checks the username/password - is included. There's also a few screenshots showing what the resulting forms and data should look like.

0 comments voice your opinion now!
phpass tutorial hash salt password storage mysql user

Link: http://www.codeofaninja.com/2013/03/php-hash-password.html


Community Events

Don't see your event here?
Let us know!


conference laravel list interview podcast community api part2 php7 introduction composer opinion language yii2 project symfony series application framework example

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework