Esempio n. 1
0
 /**
  * Creates a new connection from
  * encrypted string in the
  * Connection Resource List
  *
  * @param $name     - Nome da Conexão
  * @param $data     - String criptografada com os dados
  */
 public function createNewConnection($name, $data)
 {
     $data = CR::decrypt($data);
     $json = json_decode($data, true);
     if ($json) {
         $this->connections[$name] = $json;
     }
 }
Esempio n. 2
0
 /**
  * The URL Loader
  *
  * Thou shalt not call superglobals directly
  *
  * @return  array|mixed
  */
 private static function loadUrl()
 {
     $uri = filter_input(INPUT_SERVER, 'REQUEST_URI');
     if (ENCRYPTURL == '1') {
         $uri = CR::decrypt($uri);
     }
     BASEDIR == '/' || ($uri = str_replace(BASEDIR, '', $uri));
     $uri = explode('/', $uri);
     array_walk($uri, function (&$item) {
         strpos($item, '?') === false || ($item = substr($item, 0, strpos($item, '?')));
     });
     String::arrayTrimNumericIndexed($uri);
     self::$uri = $uri;
 }
Esempio n. 3
0
 /**
  * Loads the API Authentication File with
  * encrypted code
  */
 private function loadAthentication()
 {
     $authFile = IFCDIR . '/data/' . md5(ORBIT_ID);
     if (!file_exists($authFile)) {
         return;
     }
     $content = file_get_contents($authFile);
     $content = CR::decrypt($content);
     $data = json_decode($content, true);
     if (!$data) {
         return;
     }
     foreach (array('id', 'secret') as $item) {
         if (!isset($data[$item])) {
             return;
         } else {
             $this->{$item} = $data[$item];
         }
     }
 }