GithubHelp home page GithubHelp logo

rahulyhg / satyatest1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from satyaaec/satyatest1

0.0 2.0 0.0 936 KB

License: BSD 3-Clause "New" or "Revised" License

PHP 84.28% HTML 14.98% ApacheConf 0.28% CSS 0.46%

satyatest1's Introduction

User Demo Sample

This sample is based on Hello World sample. It shows how to:

  • Create a new module named User
  • Create User entity
  • Implement user authentication (with login and password)
  • Implement access filter to restrict access to certain pages to authenticated users only
  • Implement user management UI
  • Init main menu items differently based on whether the current user is logged in or not

Installation

You need to have Apache 2.4 HTTP server, PHP v.5.6 or later with gd and intl extensions, and MySQL 5.6 or later.

Download the sample to some directory (it can be your home dir or /var/www/html) and run Composer as follows:

php composer.phar install

The command above will install the dependencies (Zend Framework and Doctrine).

Enable development mode:

php composer.phar development-enable

Adjust permissions for data directory:

sudo chown -R www-data:www-data data
sudo chmod -R 775 data

Create public/img/captcha directory:

mkdir public/img/captcha

Adjust permissions for public/img/captcha directory:

sudo chown -R www-data:www-data public/img/captcha
sudo chmod -R 775 public/img/captcha 

Create config/autoload/local.php config file by copying its distrib version:

cp config/autoload/local.php.dist config/autoload/local.php

Edit config/autoload/local.php and set database password parameter.

Login to MySQL client:

mysql -u root -p

Create database:

CREATE DATABASE userdemo;
GRANT ALL PRIVILEGES ON userdemo.* TO userdemo@localhost identified by '<your_password>';
quit

Run database migrations to intialize database schema:

./vendor/bin/doctrine-module migrations:migrate

Then create an Apache virtual host. It should look like below:

<VirtualHost *:80>
    DocumentRoot /path/to/userdemo/public
    
	<Directory /path/to/userdemo/public/>
        DirectoryIndex index.php
        AllowOverride All
        Require all granted
    </Directory>

</VirtualHost>

Now you should be able to see the User Demo website by visiting the link "http://localhost/".

License

This code is provided under the BSD-like license.

Contributing

If you found a mistake or a bug, please report it using the Issues page. Your feedback is highly appreciated.

satyatest1's People

Watchers

James Cloos avatar  avatar

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.