/** * 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); } }
/** * 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; } }
/** * 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; } }
/** * 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); }