Browse Source

minor changes

some bugs fixed
develop
Emre Akay 11 years ago
parent
commit
c78c66a5f1
  1. 5
      application/config/aauth.php
  2. 191
      application/controllers/example.php
  3. 940
      application/libraries/Aauth.php

5
application/config/aauth.php

@ -38,7 +38,7 @@ $config['aauth'] = array(
// pm table // pm table
'pms' => 'aauth_pms', 'pms' => 'aauth_pms',
// system variables // system variables
'aauth_variables' => 'aauth_system_variables', 'system_variables' => 'aauth_system_variables',
// user variables // user variables
'user_variables' => 'aauth_user_variables', 'user_variables' => 'aauth_user_variables',
@ -57,7 +57,7 @@ $config['aauth'] = array(
// login attempts time interval // login attempts time interval
// default 20 times in one hour // default 20 times in one hour
'max_login_attempt' => 20, 'max_login_attempt' => 10,
// to register email verifitaion need? true / false // to register email verifitaion need? true / false
'verification' => false, 'verification' => false,
@ -91,6 +91,7 @@ $config['aauth'] = array(
'no_user' => 'User not Exist', 'no_user' => 'User not Exist',
'not_verified' => 'Please verify your account.', 'not_verified' => 'Please verify your account.',
'group_exist' => 'Group already exists', 'group_exist' => 'Group already exists',
'no_group' => 'Group doesn\'t exists',
'self_pm' => 'It is not reasonable to send pm to yourself :)', 'self_pm' => 'It is not reasonable to send pm to yourself :)',
'no_pm' => 'Pm not found', 'no_pm' => 'Pm not found',

191
application/controllers/example.php

@ -19,11 +19,13 @@ class Example extends CI_Controller {
public function index() { public function index() {
if ($this->aauth->login('admin@admin.com', 'password', true)) if ($this->aauth->login('aa@a.com', '12345'))
echo 'tmm'; echo 'tmm';
else else
echo 'hyr'; echo 'hyr';
//echo date("Y-m-d H:i:s"); //echo date("Y-m-d H:i:s");
$this->aauth->print_errors();
} }
function debug(){ function debug(){
@ -95,11 +97,16 @@ class Example extends CI_Controller {
//$this->aauth->_reset_login_attempts(1); //$this->aauth->_reset_login_attempts(1);
} }
public function login_fast(){
$this->aauth->login_fast(1);
}
public function is_loggedin() { public function is_loggedin() {
if ($this->aauth->is_loggedin()) if ($this->aauth->is_loggedin())
echo 'girdin'; echo 'girdin';
print_r( $this->aauth->get_user() );
} }
public function logout() { public function logout() {
@ -109,7 +116,7 @@ class Example extends CI_Controller {
public function is_member() { public function is_member() {
if ($this->aauth->is_member('Admin')) if ($this->aauth->is_member('deneme',9))
echo 'uye'; echo 'uye';
} }
@ -128,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"); echo $this->aauth->get_group_id("Admin");
} }
public function list_users() { public function list_users() {
echo '<pre>'; echo '<pre>';
print_r($this->aauth->list_users("Mod")); print_r($this->aauth->list_users());
echo '</pre>'; echo '</pre>';
} }
@ -147,25 +159,27 @@ class Example extends CI_Controller {
public function check_email() { public function check_email() {
if ($this->aauth->check_email("emre@emreakay.com")) if ($this->aauth->check_email("aa@a.com"))
echo 'uygun '; echo 'uygun ';
else else
echo 'alindi '; echo 'alindi ';
echo $this->aauth->get_errors(); $this->aauth->print_errors();
echo ' sadsad';
} }
public function get_user() { public function get_user() {
print_r($this->aauth->get_user(1)); print_r($this->aauth->get_user());
} }
function create_user() { function create_user() {
echo "as"; $a = $this->aauth->create_user("aaa@a.com", "12345", "aa");
if ($a)
echo "tmm ";
else
echo "hyr ";
$a = $this->aauth->create_user("aaasada@aaasda.com", "asd", "asdasd11");
print_r($this->aauth->get_user($a)); print_r($this->aauth->get_user($a));
@ -183,39 +197,180 @@ class Example extends CI_Controller {
print_r($a); 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() { function update_user() {
$a = $this->aauth->update_user(3, "xxx@ssdas.com", "asd", "asdasd"); $a = $this->aauth->update_user(6, "a@a.com", "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("a@a.com");
print_r($a); print_r($a);
} }
function create_group() { function create_group() {
$a = $this->aauth->create_group("denemeee"); $a = $this->aauth->create_group("deneme");
} }
function delete_group() { function delete_group() {
$a = $this->aauth->delete_group(3); $a = $this->aauth->delete_group("deneme");
} }
function update_group() { function update_group() {
$a = $this->aauth->update_group(4, "zxxx"); $a = $this->aauth->update_group("deneme", "zxxx");
} }
function add_member() { function add_member() {
$a = $this->aauth->add_member(1, 4); $a = $this->aauth->add_member(8, "deneme");
} }
function fire_member() { 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 */ /* End of file welcome.php */

940
application/libraries/Aauth.php

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save