summaryrefslogtreecommitdiff
path: root/plugins/session/www/rpc.php
blob: fca85a032ca1833a3a4b2c6ba14a11c11f8150ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

define('SESS_ROOT', __DIR__ . '/../');

require_once SESS_ROOT . 'main.php';

$entry = (!empty($_POST['salt']) && strlen($_POST['salt']) >= 16) ?
         create_key($_POST['salt']) : FALSE;

if ($entry) {
  header('Content-type: text/plain; charset=UTF-8');
  print json_encode($entry);
}
else {
  header('HTTP/1.1 403 Forbidden');
}