public function login($options = array()) { $defaults = array('dnkey' => false, 'uid' => false, 'pwid' => false, 'chain' => false, 'password' => false); $settings = array_merge($defaults, $options); if (class_exists('bs_dnkey') && $settings['dnkey']) { $dnkey = new bs_dnkey(); $results = $dnkey->get(array('type' => 'blockauth', 'host' => $settings['dnkey'])); if (isset($results['success']) && $results['success']) { $auth = $results['data']['dnkeys']['blockauth']; if (is_array($auth)) { foreach ($auth as $blockchain => $keys) { foreach ($keys as $key => $obj) { if (isset($obj['uid']) && isset($obj['pwid'])) { return $this->check($obj['pwid'], $obj['uid'], $blockchain, $settings['password']); } } } } } } else { return $this->check($settings['pwid'], $settings['uid'], $settings['chain'], $settings['password']); } }
public function dnkey($settings = array()) { if (class_exists('bs_dnkey')) { $dnkey = new bs_dnkey(); return $dnkey->api($settings); } else { return 'Need to make API call'; } }