예제 #1
0
 /**
  * Constructor
  *
  * @param   array  $config   Configuration for Strong and Login Details
  * @return  void
  */
 public function __construct(array $config = array(), Strong $auth = null)
 {
     $this->config = array_merge($this->settings, $config);
     $this->auth = $auth;
     if (empty($auth)) {
         $this->auth = Strong::factory($config);
     }
 }
예제 #2
0
 /**
  * Call
  *
  * @return void
  */
 public function call()
 {
     $app = $this->app;
     $config = $this->config;
     $req = $this->app->request();
     // Authentication Initialised
     $auth = Strong::factory($this->config);
     switch ($this->config['auth_type']) {
         case 'form':
             $this->formauth($auth, $req);
             break;
         default:
             $this->httpauth($auth, $req);
             break;
     }
 }
예제 #3
0
 /**
  * Create Users
  * @example  $users->create('admin', 'password', '*****@*****.**');
  * @return booleon
  */
 public function create($username, $password, $email, $ex_data = NULL)
 {
     // Data information
     $this->data['username'] = $username;
     $this->data['password'] = Strong::factory()->hash_password($password);
     $this->data['email'] = $email;
     if (is_array($ex_data)) {
         foreach ($ex_data as $key => $value) {
             $this->data[$key] = $value;
         }
     }
     // Set the save field
     $this->db->insert($this->table, $this->data);
     $this->user_id = $this->db->insert_id();
     if ((bool) $this->user_id) {
         return $this->user_id;
     }
 }
예제 #4
0
 /**
  * Constructor
  *
  * @param   array  $config   Configuration for Strong and Login Details
  * @param   \Strong $strong
  * @return  void
  */
 public function __construct(array $config = array(), \Strong $strong = null)
 {
     $this->config = array_merge($this->settings, $config);
     $this->auth = !empty($strong) ? $strong : \Strong::factory($this->config);
 }