]> jfr.im git - z_archive/KronOS.git/blob - core/common.php
Added a simple login/sessions system.
[z_archive/KronOS.git] / core / common.php
1 <?php
2 include('config.php');
3
4 function make_reply($data, $errcode=NULL) {
5 if ($errcode === NULL) {
6 $resp = array(
7 'success' => TRUE,
8 'time' => time(),
9 'contents' => $data,
10 );
11 echo json_encode($resp);
12 } else {
13 $resp = array(
14 'success' => FALSE,
15 'time' => time(),
16 'error' => array(
17 'code' => $errcode,
18 'reason' => $data,
19 ),
20 );
21 echo json_encode($resp);
22 }
23 exit(0);
24 }