Permalink
Browse files

Updated to 1.0.4

  • Loading branch information...
0 parents commit 61da4231fbb493a3510642f0961002f081248c9f Adam Griffiths committed Apr 15, 2009
@@ -0,0 +1,25 @@
+<?php
+
+/**
+* The array which holds your user groups and their ID.
+* If you have a database table for groups, these ID's must be the same as in the database.
+*/
+$config['auth_groups'] = array(
+ 'admin' => '1',
+ 'editor' => '2',
+ 'user' => '100'
+ );
+
+/**
+* The default URI string to redirect to after a successful login.
+*/
+$config['auth_login'] = 'admin/';
+
+
+/**
+* bool TRUE / FALSE
+* Determines whether or not users will be remembered by the auth library
+*/
+$config['auth_remember'] = TRUE;
+
+?>
@@ -0,0 +1,58 @@
+<?php
+
+class Admin extends Application
+{
+ function Admin()
+ {
+ parent::Application();
+ }
+
+ function index()
+ {
+ if($this->auth->logged_in())
+ {
+ echo("This is the admin section.");
+ }
+ else
+ {
+ echo("This is the client section.");
+ }
+ }
+
+ function admin_area()
+ {
+ // This is only accessible to admins
+ $this->auth->restrict('admin');
+ echo("admin area");
+ }
+
+ function editor_area()
+ {
+ // This is accessible to editors and admins
+ $this->auth->restrict('editor');
+ echo("editor area");
+ }
+
+ function user_area()
+ {
+ // This is accessible to all users
+ $this->auth->restrict('user');
+ echo("user area");
+ }
+
+ function users_area()
+ {
+ // This is accessible to all users too
+ $this->auth->restrict();
+ echo("user area");
+ }
+
+ function just_user()
+ {
+ // This is accessible to only 'users'
+ $this->auth->restrict('user', TRUE);
+ echo("user area only");
+ }
+}
+
+?>
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>403 Forbidden</title>
+</head>
+<body>
+
+<p>Directory access is forbidden.</p>
+
+</body>
+</html>
@@ -0,0 +1,46 @@
+-- phpMyAdmin SQL Dump
+-- version 2.10.2
+-- http://www.phpmyadmin.net
+--
+-- Host: localhost
+-- Generation Time: Feb 24, 2009 at 09:12 PM
+-- Server version: 5.0.41
+-- PHP Version: 5.2.5
+
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+
+--
+-- Database: `ci_auth`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `users`
+--
+
+CREATE TABLE `users` (
+ `id` int(11) NOT NULL auto_increment,
+ `username` varchar(255) NOT NULL,
+ `email` varchar(255) NOT NULL,
+ `password` varchar(255) NOT NULL,
+ `group_id` int(11) NOT NULL default '100',
+ `identifier` varchar(255) NOT NULL,
+ `token` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+CREATE TABLE `groups` (
+`id` int(11) NOT NULL,
+`title` varchar(20) NOT NULL default '',
+`description` varchar(100) NOT NULL default '',
+PRIMARY KEY (`id`));
+
+CREATE TABLE IF NOT EXISTS `ci_sessions` (
+session_id varchar(40) DEFAULT '0' NOT NULL,
+ip_address varchar(16) DEFAULT '0' NOT NULL,
+user_agent varchar(50) NOT NULL,
+last_activity int(10) unsigned DEFAULT 0 NOT NULL,
+user_data text NOT NULL,
+PRIMARY KEY (session_id)
+);
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>403 Forbidden</title>
+</head>
+<body>
+
+<p>Directory access is forbidden.</p>
+
+</body>
+</html>
@@ -0,0 +1,12 @@
+<?php
+
+$lang['insufficient_privs'] = "You do not have sufficient privileges to access this page.";
+$lang['username_callback_error'] = "The username was not found in our database.";
+$lang['reg_username_callback_error'] = "The username is in use, please select another username.";
+$lang['reg_email_callback_error'] = "The email is in use, please select another email.";
+$lang['login_details_error'] = "The username and password did not match our records, please try again.";
+$lang['max_login_attempts_error'] = "You have exceeded your maximum number of attempted logins, if you have forgotten your password, please consult the lost password form. You will be able to login again in 15 minutes.";
+
+$lang['logout_perms_error'] = "You have been logged out due to a permission error, please login again.";
+
+?>
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>403 Forbidden</title>
+</head>
+<body>
+
+<p>Directory access is forbidden.</p>
+
+</body>
+</html>
Oops, something went wrong. Retry.

0 comments on commit 61da423

Please sign in to comment.