5 changed files with 1332 additions and 636 deletions
@ -19,10 +19,13 @@ class Example extends CI_Controller {
|
||||
|
||||
public function index() { |
||||
|
||||
if ($this->aauth->login('a[email protected]', 'password', true)) |
||||
if ($this->aauth->login('a[email protected]', '12345')) |
||||
echo 'tmm'; |
||||
|
||||
else |
||||
echo 'hyr'; |
||||
//echo date("Y-m-d H:i:s"); |
||||
|
||||
$this->aauth->print_errors(); |
||||
} |
||||
|
||||
function debug(){ |
||||
@ -31,14 +34,14 @@ class Example extends CI_Controller {
|
||||
|
||||
print_r( |
||||
//$this->aauth->is_admin() |
||||
//$this->aauth->get_user() |
||||
//$this->aauth->control_group("Mod") |
||||
//$this->aauth->control_perm(1) |
||||
//$this->aauth->list_groups() |
||||
//$this->aauth->list_users() |
||||
//$this->aauth->is_allowed(1) |
||||
//$this->aauth->is_admin() |
||||
//$this->aauth->create_perm("deneme",'defff') |
||||
//$this->aauth->get_user() |
||||
//$this->aauth->control_group("Mod") |
||||
//$this->aauth->control_perm(1) |
||||
//$this->aauth->list_groups() |
||||
//$this->aauth->list_users() |
||||
//$this->aauth->is_allowed(1) |
||||
//$this->aauth->is_admin() |
||||
//$this->aauth->create_perm("deneme",'defff') |
||||
//$this->aauth->update_perm(3,'dess','asd') |
||||
//$this->aauth->allow(1,1) |
||||
//$this->aauth->add_member(1,1) |
||||
@ -94,11 +97,16 @@ class Example extends CI_Controller {
|
||||
//$this->aauth->_reset_login_attempts(1); |
||||
} |
||||
|
||||
public function login_fast(){ |
||||
$this->aauth->login_fast(1); |
||||
} |
||||
|
||||
public function is_loggedin() { |
||||
|
||||
if ($this->aauth->is_loggedin()) |
||||
echo 'girdin'; |
||||
|
||||
print_r( $this->aauth->get_user() ); |
||||
} |
||||
|
||||
public function logout() { |
||||
@ -108,7 +116,7 @@ class Example extends CI_Controller {
|
||||
|
||||
public function is_member() { |
||||
|
||||
if ($this->aauth->is_member('Admin')) |
||||
if ($this->aauth->is_member('deneme',9)) |
||||
echo 'uye'; |
||||
} |
||||
|
||||
@ -127,14 +135,19 @@ class Example extends CI_Controller {
|
||||
} |
||||
} |
||||
|
||||
public function group() { |
||||
public function get_group_name() { |
||||
|
||||
echo $this->aauth->get_group_name(1); |
||||
} |
||||
|
||||
public function get_group_id() { |
||||
|
||||
echo $this->aauth->get_group_id("Admin"); |
||||
} |
||||
|
||||
public function list_users() { |
||||
echo '<pre>'; |
||||
print_r($this->aauth->list_users("Mod")); |
||||
print_r($this->aauth->list_users()); |
||||
echo '</pre>'; |
||||
} |
||||
|
||||
@ -146,24 +159,31 @@ class Example extends CI_Controller {
|
||||
|
||||
public function check_email() { |
||||
|
||||
if ($this->aauth->check_email("emre@emreakay.com")) |
||||
if ($this->aauth->check_email("aa@a.com")) |
||||
echo 'uygun '; |
||||
else |
||||
echo 'alindi '; |
||||
|
||||
echo $this->aauth->get_errors(); |
||||
|
||||
echo ' sadsad'; |
||||
$this->aauth->print_errors(); |
||||
} |
||||
|
||||
public function get_user() { |
||||
print_r($this->aauth->get_user(1)); |
||||
print_r($this->aauth->get_user()); |
||||
} |
||||
|
||||
function create_user() { |
||||
$a = $this->aauth->create_user("[email protected]", "asd", "asdasd"); |
||||
|
||||
$a = $this->aauth->create_user("[email protected]", "12345", "Admin"); |
||||
|
||||
if ($a) |
||||
echo "tmm "; |
||||
else |
||||
echo "hyr "; |
||||
|
||||
|
||||
print_r($this->aauth->get_user($a)); |
||||
|
||||
$this->aauth->print_errors(); |
||||
} |
||||
|
||||
public function is_banned() { |
||||
@ -177,39 +197,180 @@ class Example extends CI_Controller {
|
||||
print_r($a); |
||||
} |
||||
|
||||
function delete_user() { |
||||
|
||||
$a = $this->aauth->delete_user(7); |
||||
|
||||
print_r($a); |
||||
} |
||||
|
||||
function unban_user() { |
||||
|
||||
$a = $this->aauth->unban_user(6); |
||||
|
||||
print_r($a); |
||||
} |
||||
|
||||
function update_user() { |
||||
$a = $this->aauth->update_user(3, "[email protected]", "asd", "asdasd"); |
||||
$a = $this->aauth->update_user(6, "[email protected]", "12345", "tested"); |
||||
|
||||
print_r($a); |
||||
} |
||||
|
||||
function update_activity() { |
||||
$a = $this->aauth->update_activity(); |
||||
|
||||
print_r($a); |
||||
} |
||||
|
||||
function update_login_attempt() { |
||||
$a = $this->aauth->update_login_attempts("[email protected]"); |
||||
|
||||
print_r($a); |
||||
} |
||||
|
||||
function create_group() { |
||||
|
||||
$a = $this->aauth->create_group("denemeee"); |
||||
$a = $this->aauth->create_group("deneme"); |
||||
} |
||||
|
||||
function delete_group() { |
||||
|
||||
$a = $this->aauth->delete_group(3); |
||||
$a = $this->aauth->delete_group("deneme"); |
||||
} |
||||
|
||||
function update_group() { |
||||
|
||||
$a = $this->aauth->update_group(4, "zxxx"); |
||||
$a = $this->aauth->update_group("deneme", "zxxx"); |
||||
} |
||||
|
||||
function add_member() { |
||||
|
||||
$a = $this->aauth->add_member(1, 4); |
||||
$a = $this->aauth->add_member(8, "deneme"); |
||||
} |
||||
|
||||
function fire_member() { |
||||
|
||||
$a = $this->aauth->fire_member(1, 4); |
||||
$a = $this->aauth->fire_member(8, "deneme"); |
||||
} |
||||
|
||||
|
||||
function create_perm() { |
||||
|
||||
$a = $this->aauth->create_perm("deneme","def"); |
||||
} |
||||
|
||||
|
||||
function update_perm() { |
||||
|
||||
$a = $this->aauth->update_perm("deneme","deneme","xxx"); |
||||
} |
||||
|
||||
function delete_perm() { |
||||
|
||||
$a = $this->aauth->update_perm("deneme","deneme","xxx"); |
||||
} |
||||
|
||||
function allow_user() { |
||||
|
||||
$a = $this->aauth->allow_user(9,"deneme"); |
||||
} |
||||
|
||||
|
||||
function deny_user() { |
||||
|
||||
$a = $this->aauth->deny_user(9,"deneme"); |
||||
} |
||||
|
||||
function allow_group() { |
||||
|
||||
$a = $this->aauth->allow_group("deneme","deneme"); |
||||
} |
||||
|
||||
function deny_group() { |
||||
|
||||
$a = $this->aauth->deny_group("deneme","deneme"); |
||||
} |
||||
|
||||
function list_perms() { |
||||
|
||||
$a = $this->aauth->list_perms(); |
||||
print_r($a); |
||||
} |
||||
|
||||
function get_perm_id() { |
||||
|
||||
$a = $this->aauth->get_perm_id("deneme"); |
||||
print_r($a); |
||||
} |
||||
|
||||
|
||||
function send_pm() { |
||||
|
||||
$a = $this->aauth->send_pm(1,8,'s',"w"); |
||||
$this->aauth->print_errors(); |
||||
} |
||||
|
||||
function list_pms(){ |
||||
|
||||
print_r( $this->aauth->list_pms() ); |
||||
} |
||||
|
||||
function get_pm(){ |
||||
|
||||
print_r( $this->aauth->get_pm(39,false)); |
||||
} |
||||
|
||||
function delete_pm(){ |
||||
|
||||
$this->aauth->delete_pm(41); |
||||
} |
||||
|
||||
|
||||
function count_unread_pms(){ |
||||
|
||||
echo $this->aauth->count_unread_pms(8); |
||||
} |
||||
|
||||
function error(){ |
||||
|
||||
$this->aauth->error("asd"); |
||||
$this->aauth->error("xasd"); |
||||
$this->aauth->keep_errors(); |
||||
$this->aauth->print_errors(); |
||||
|
||||
} |
||||
|
||||
function keep_errors(){ |
||||
|
||||
$this->aauth->print_errors(); |
||||
//$this->aauth->keep_errors(); |
||||
} |
||||
|
||||
function set_user_var(){ |
||||
$this->aauth->set_user_var("emre","akasy"); |
||||
} |
||||
|
||||
function unset_user_var(){ |
||||
$this->aauth->unset_user_var("emre"); |
||||
} |
||||
|
||||
function get_user_var(){ |
||||
echo $this->aauth->get_user_var("emre"); |
||||
} |
||||
|
||||
function set_system_var(){ |
||||
$this->aauth->set_system_var("emre","akay"); |
||||
} |
||||
|
||||
function unset_system_var(){ |
||||
$this->aauth->unset_system_var("emre"); |
||||
} |
||||
|
||||
function get_system_var(){ |
||||
echo $this->aauth->get_system_var("emre"); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
}//end |
||||
|
||||
/* End of file welcome.php */ |
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,171 @@
|
||||
/* |
||||
Navicat MySQL Data Transfer |
||||
|
||||
Source Server : local |
||||
Source Server Version : 50508 |
||||
Source Host : localhost:3306 |
||||
Source Database : aauth_v2_dev |
||||
|
||||
Target Server Type : MYSQL |
||||
Target Server Version : 50508 |
||||
File Encoding : 65001 |
||||
|
||||
Date: 2014-07-03 21:23:21 |
||||
*/ |
||||
|
||||
SET FOREIGN_KEY_CHECKS=0; |
||||
|
||||
-- ---------------------------- |
||||
-- Table structure for `aauth_groups` |
||||
-- ---------------------------- |
||||
DROP TABLE IF EXISTS `aauth_groups`; |
||||
CREATE TABLE `aauth_groups` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`name` text, |
||||
PRIMARY KEY (`id`), |
||||
KEY `id_index` (`id`) |
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; |
||||
|
||||
-- ---------------------------- |
||||
-- Records of aauth_groups |
||||
-- ---------------------------- |
||||
INSERT INTO `aauth_groups` VALUES ('1', 'Admin'); |
||||
INSERT INTO `aauth_groups` VALUES ('2', 'Public'); |
||||
INSERT INTO `aauth_groups` VALUES ('3', 'Default'); |
||||
|
||||
-- ---------------------------- |
||||
-- Table structure for `aauth_perms` |
||||
-- ---------------------------- |
||||
DROP TABLE IF EXISTS `aauth_perms`; |
||||
CREATE TABLE `aauth_perms` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`name` text, |
||||
`definition` text, |
||||
PRIMARY KEY (`id`), |
||||
KEY `id_index` (`id`) |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
||||
|
||||
-- ---------------------------- |
||||
-- Records of aauth_perms |
||||
-- ---------------------------- |
||||
|
||||
-- ---------------------------- |
||||
-- Table structure for `aauth_perm_to_group` |
||||
-- ---------------------------- |
||||
DROP TABLE IF EXISTS `aauth_perm_to_group`; |
||||
CREATE TABLE `aauth_perm_to_group` ( |
||||
`perm_id` int(11) DEFAULT NULL, |
||||
`group_id` int(11) DEFAULT NULL, |
||||
KEY `perm_id_group_id_index` (`perm_id`,`group_id`) |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
||||
|
||||
-- ---------------------------- |
||||
-- Records of aauth_perm_to_group |
||||
-- ---------------------------- |
||||
|
||||
-- ---------------------------- |
||||
-- Table structure for `aauth_perm_to_user` |
||||
-- ---------------------------- |
||||
DROP TABLE IF EXISTS `aauth_perm_to_user`; |
||||
CREATE TABLE `aauth_perm_to_user` ( |
||||
`perm_id` int(11) DEFAULT NULL, |
||||
`user_id` int(11) DEFAULT NULL, |
||||
KEY `perm_id_user_id_index` (`perm_id`,`user_id`) |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
||||
|
||||
-- ---------------------------- |
||||
-- Records of aauth_perm_to_user |
||||
-- ---------------------------- |
||||
|
||||
-- ---------------------------- |
||||
-- Table structure for `aauth_pms` |
||||
-- ---------------------------- |
||||
DROP TABLE IF EXISTS `aauth_pms`; |
||||
CREATE TABLE `aauth_pms` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`sender_id` int(11) NOT NULL, |
||||
`receiver_id` int(11) NOT NULL, |
||||
`title` text NOT NULL, |
||||
`message` text, |
||||
`date` datetime DEFAULT NULL, |
||||
`read` int(11) DEFAULT '0', |
||||
PRIMARY KEY (`id`), |
||||
KEY `full_index` (`id`,`sender_id`,`receiver_id`,`read`) |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
||||
|
||||
-- ---------------------------- |
||||
-- Records of aauth_pms |
||||
-- ---------------------------- |
||||
|
||||
-- ---------------------------- |
||||
-- Table structure for `aauth_system_variables` |
||||
-- ---------------------------- |
||||
DROP TABLE IF EXISTS `aauth_system_variables`; |
||||
CREATE TABLE `aauth_system_variables` ( |
||||
`key` text NOT NULL, |
||||
`value` text |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
||||
|
||||
-- ---------------------------- |
||||
-- Records of aauth_system_variables |
||||
-- ---------------------------- |
||||
|
||||
-- ---------------------------- |
||||
-- Table structure for `aauth_users` |
||||
-- ---------------------------- |
||||
DROP TABLE IF EXISTS `aauth_users`; |
||||
CREATE TABLE `aauth_users` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`email` text COLLATE utf8_turkish_ci NOT NULL, |
||||
`pass` text COLLATE utf8_turkish_ci NOT NULL, |
||||
`name` text COLLATE utf8_turkish_ci, |
||||
`banned` int(11) DEFAULT '0', |
||||
`last_login` datetime DEFAULT NULL, |
||||
`last_activity` datetime DEFAULT NULL, |
||||
`last_login_attempt` datetime DEFAULT NULL, |
||||
`forgot_exp` text COLLATE utf8_turkish_ci, |
||||
`remember_time` datetime DEFAULT NULL, |
||||
`remember_exp` text COLLATE utf8_turkish_ci, |
||||
`verification_code` text COLLATE utf8_turkish_ci, |
||||
`ip_address` text COLLATE utf8_turkish_ci, |
||||
`login_attempts` int(11) DEFAULT '0', |
||||
PRIMARY KEY (`id`), |
||||
KEY `id_index` (`id`) |
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci; |
||||
|
||||
-- ---------------------------- |
||||
-- Records of aauth_users |
||||
-- ---------------------------- |
||||
INSERT INTO `aauth_users` VALUES ('1', '[email protected]', 'dd5073c93fb477a167fd69072e95455834acd93df8fed41a2c468c45b394bfe3', 'Admin', '0', null, null, null, null, null, null, null, null, '0'); |
||||
|
||||
-- ---------------------------- |
||||
-- Table structure for `aauth_user_to_group` |
||||
-- ---------------------------- |
||||
DROP TABLE IF EXISTS `aauth_user_to_group`; |
||||
CREATE TABLE `aauth_user_to_group` ( |
||||
`user_id` int(11) NOT NULL DEFAULT '0', |
||||
`group_id` int(11) NOT NULL DEFAULT '0', |
||||
PRIMARY KEY (`user_id`,`group_id`), |
||||
KEY `user_id_group_id_index` (`user_id`,`group_id`) |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
||||
|
||||
-- ---------------------------- |
||||
-- Records of aauth_user_to_group |
||||
-- ---------------------------- |
||||
INSERT INTO `aauth_user_to_group` VALUES ('1', '1'); |
||||
INSERT INTO `aauth_user_to_group` VALUES ('1', '3'); |
||||
|
||||
-- ---------------------------- |
||||
-- Table structure for `aauth_user_variables` |
||||
-- ---------------------------- |
||||
DROP TABLE IF EXISTS `aauth_user_variables`; |
||||
CREATE TABLE `aauth_user_variables` ( |
||||
`user_id` int(11) NOT NULL, |
||||
`key` text NOT NULL, |
||||
`value` text, |
||||
KEY `user_id_index` (`user_id`) |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
||||
|
||||
-- ---------------------------- |
||||
-- Records of aauth_user_variables |
||||
-- ---------------------------- |
@ -1,144 +0,0 @@
|
||||
-- phpMyAdmin SQL Dump |
||||
-- version 3.3.9 |
||||
-- http://www.phpmyadmin.net |
||||
-- |
||||
-- Anamakine: localhost |
||||
-- Üretim Zamanı: 18 Eylül 2013 saat 10:18:09 |
||||
-- Sunucu sürümü: 5.5.8 |
||||
-- PHP Sürümü: 5.3.5 |
||||
|
||||
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; |
||||
/*!40101 SET NAMES utf8 */; |
||||
|
||||
-- |
||||
-- Veritabanı: `aauth2` |
||||
-- |
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- Tablo için tablo yapısı `aauth_groups` |
||||
-- |
||||
|
||||
CREATE TABLE IF NOT EXISTS `aauth_groups` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`name` text, |
||||
PRIMARY KEY (`id`) |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; |
||||
|
||||
-- |
||||
-- Tablo döküm verisi `aauth_groups` |
||||
-- |
||||
|
||||
INSERT INTO `aauth_groups` (`id`, `name`) VALUES |
||||
(1, 'admin'), |
||||
(2, 'public'), |
||||
(3, 'default'); |
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- Tablo için tablo yapısı `aauth_perms` |
||||
-- |
||||
|
||||
CREATE TABLE IF NOT EXISTS `aauth_perms` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`name` text, |
||||
`definition` text, |
||||
PRIMARY KEY (`id`) |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
||||
|
||||
-- |
||||
-- Tablo döküm verisi `aauth_perms` |
||||
-- |
||||
|
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- Tablo için tablo yapısı `aauth_perm_to_group` |
||||
-- |
||||
|
||||
CREATE TABLE IF NOT EXISTS `aauth_perm_to_group` ( |
||||
`perm_id` int(11) DEFAULT NULL, |
||||
`group_id` int(11) DEFAULT NULL |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
||||
|
||||
-- |
||||
-- Tablo döküm verisi `aauth_perm_to_group` |
||||
-- |
||||
|
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- Tablo için tablo yapısı `aauth_pm` |
||||
-- |
||||
|
||||
CREATE TABLE IF NOT EXISTS `aauth_pm` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`sender_id` int(11) NOT NULL, |
||||
`receiver_id` int(11) NOT NULL, |
||||
`message` text, |
||||
`date` datetime DEFAULT NULL, |
||||
`read` int(11) DEFAULT '0', |
||||
PRIMARY KEY (`id`) |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
||||
|
||||
-- |
||||
-- Tablo döküm verisi `aauth_pm` |
||||
-- |
||||
|
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- Tablo için tablo yapısı `aauth_users` |
||||
-- |
||||
|
||||
CREATE TABLE IF NOT EXISTS `aauth_users` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`email` text COLLATE utf8_turkish_ci NOT NULL, |
||||
`pass` text COLLATE utf8_turkish_ci NOT NULL, |
||||
`name` text COLLATE utf8_turkish_ci, |
||||
`banned` int(11) DEFAULT '0', |
||||
`last_login` datetime DEFAULT NULL, |
||||
`last_activity` datetime DEFAULT NULL, |
||||
`last_login_attempt` datetime DEFAULT NULL, |
||||
`forgot_exp` text COLLATE utf8_turkish_ci, |
||||
`remember_time` datetime DEFAULT NULL, |
||||
`remember_exp` text COLLATE utf8_turkish_ci, |
||||
`verification_code` text COLLATE utf8_turkish_ci, |
||||
PRIMARY KEY (`id`) |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci AUTO_INCREMENT=2 ; |
||||
|
||||
-- |
||||
-- Tablo döküm verisi `aauth_users` |
||||
-- |
||||
|
||||
INSERT INTO `aauth_users` (`id`, `email`, `pass`, `name`, `banned`, `last_login`, `last_activity`, `last_login_attempt`, `forgot_exp`, `remember_time`, `remember_exp`, `verification_code`) VALUES |
||||
(1, '[email protected]', 'admin pass', 'Admin', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); |
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- Tablo için tablo yapısı `aauth_user_to_group` |
||||
-- |
||||
|
||||
CREATE TABLE IF NOT EXISTS `aauth_user_to_group` ( |
||||
`user_id` int(11) NOT NULL DEFAULT '0', |
||||
`group_id` int(11) NOT NULL DEFAULT '0', |
||||
PRIMARY KEY (`user_id`,`group_id`) |
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
||||
|
||||
-- |
||||
-- Tablo döküm verisi `aauth_user_to_group` |
||||
-- |
||||
|
||||
INSERT INTO `aauth_user_to_group` (`user_id`, `group_id`) VALUES |
||||
(1, 1); |
Loading…
Reference in new issue