/** * @param $args * @param $url * * @return mixed */ public function add_auth_headers($args, $url) { if (strpos($url, $this->api_url) !== 0) { return $args; } $this->license->load(); if (!isset($args['headers'])) { $args['headers'] = array(); } $args['headers']['Authorization'] = 'Basic ' . base64_encode(urlencode($this->license->site) . ':' . urlencode($this->license->key)); return $args; }
<form action="./common/controller.php" method="post" style="padding-left: 10px;"> <input type="hidden" name="action" value="saveLicense"/> <input type="hidden" name="host" value="<?php echo $_SERVER['SERVER_NAME']; ?> "/> Serial key<br/> <input type="text" name="serial" id="serial" style="width: 300px;"/> <p/> <input type="image" src="./assets/images/save.gif" style="vertical-align: middle;" value="Save"/> </form> </div> <?php } else { $l = new License(); $l->load($rawLicense); ?> Ok, you have a license. <br/> Host: <?php echo $l->host; ?> <br/> Serial: <?php echo $l->serial; ?> <?php } ?> </div>