Skip to content

Installation Instructions

Jakub edited this page Sep 6, 2013 · 4 revisions
  • Download the latest version of A3M
  • Extract to a folder accessible on your webserver (/ or something like /a3m/ )
  • Create a database by importing a3m_database.sql script found it root folder of package
  • Configure /application/config/config.php & database.php to match your CI setup (domain + database credentials)
  • Modify .htaccess file if your app location is different than / (example: domain.com/a3m/)
  • Configure /application/config/account/* files to reflect your setup (reCAPTCHA, twitter, facebook, openid providers, etc;)

Configure external Oauth/OpenID providers as needed

Testing on localhost
  • Testing on localhost works without any changes.

Authorization, Roles, and Permissions:

  • Connect to your database and insert a new row into the "a3m_rel_account_role" with the Role ID for Admin (by default this is "1") and the Account ID you want to give Admin Rights to.
  • After you login to the website you should see a few new options under your account for Manage Users, Manage Roles, and Manage Permissions.

Example: Create an Authors Role with permissions to "Post New Articles".

  • Go to "Manage Roles" and create the new "Authors" role.

    • Name: Authors
    • Description: Website Authors that are allowed to post new articles.
    • Permissions: None
  • Jump to "Manage Permissions" and create the "Post New Articles" permission:

    • Key: post_articles
    • Description: Post New Articles
    • Roles: Check the "Authors" Role
  • Now you can check if the currently logged in user has access to certain features in your Controllers. You simply pass in the "Key" of the permission you created, in this case that is "post_articles".

    $this->authorization->is_permitted('post_articles'); //returns boolean value

Note

  • Please fork and help out! Only with your help will this keep growing and getting better.
  • Note that twitter doesn't work if your base url is localhost and facebook won't work if your base url is 127.0.0.1. Therefore ensure that your base url is something like yoursite.com. One way to do that is to simply map the hostname your want to 127.0.0.1 on your development machine. Your twitter callback URL should take into account whether or not you have enabled SSL in your a3m config
  • https://domain.com/account/connect_twitter (SSL Enabled)
  • http://domain.com/account/connect_twitter (SSL Disabled)

Configuring this wrongly will result in an EpiOAuthUnauthorizedException exception being thrown.